From 0b85125d87a99edf9674978f49ad82276e18a38f Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Wed, 9 Nov 2022 20:19:26 +0100 Subject: [PATCH 001/206] feat(validation): use typeprovider pattern to make zodios independant of zod --- src/utils.types.ts | 33 ------ src/zodios.ts | 143 ++++++++++++++++-------- src/zodios.types.ts | 259 +++++++++++++++++++++++++++++++++----------- 3 files changed, 292 insertions(+), 143 deletions(-) diff --git a/src/utils.types.ts b/src/utils.types.ts index cab8e5ab..1f7b6050 100644 --- a/src/utils.types.ts +++ b/src/utils.types.ts @@ -214,39 +214,6 @@ export type ReadonlyDeep = T extends (infer R)[] export type MaybeReadonly = T | ReadonlyDeep; -/** - * Map a type an api description parameter to a zod infer type - * @param T - array of api description parameters - * @details - this is using tail recursion type optimization from typescript 4.5 - */ -export type MapSchemaParameters< - T, - Frontend extends boolean = true, - Acc = {} -> = T extends [infer Head, ...infer Tail] - ? Head extends { - name: infer Name; - schema: infer Schema; - } - ? Name extends string - ? MapSchemaParameters< - Tail, - Frontend, - Merge< - { - [Key in Name]: Schema extends z.ZodType - ? Frontend extends true - ? z.input - : z.output - : never; - }, - Acc - > - > - : Acc - : Acc - : Acc; - /** * get all parameters from an API path * @param Path - API path diff --git a/src/zodios.ts b/src/zodios.ts index 730afb29..5d43d07e 100644 --- a/src/zodios.ts +++ b/src/zodios.ts @@ -13,6 +13,8 @@ import { ZodiosAliases, ZodiosPlugin, Aliases, + AnyZodiosTypeProvider, + ZodTypeProvider, } from "./zodios.types"; import { omit, replacePathParams } from "./utils"; import { @@ -35,10 +37,13 @@ import { checkApi } from "./api"; /** * zodios api client based on axios */ -export class ZodiosClass { +export class ZodiosClass< + Api extends ZodiosEndpointDefinitions, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> { private axiosInstance: AxiosInstance; public readonly options: PickRequired< - ZodiosOptions, + ZodiosOptions, "validate" | "transform" | "sendDefaults" >; public readonly api: Api; @@ -71,14 +76,18 @@ export class ZodiosClass { * } * ]); */ - constructor(api: Narrow, options?: ZodiosOptions); - constructor(baseUrl: string, api: Narrow, options?: ZodiosOptions); + constructor(api: Narrow, options?: ZodiosOptions); + constructor( + baseUrl: string, + api: Narrow, + options?: ZodiosOptions + ); constructor( arg1?: Api | string, - arg2?: Api | ZodiosOptions, - arg3?: ZodiosOptions + arg2?: Api | ZodiosOptions, + arg3?: ZodiosOptions ) { - let options: ZodiosOptions; + let options: ZodiosOptions; if (!arg1) { if (Array.isArray(arg2)) { throw new Error("Zodios: missing base url"); @@ -256,17 +265,15 @@ export class ZodiosClass { * @param config - the config to setup zodios options and parameters * @returns response validated with zod schema provided in the api description */ - async request( - config: Path extends ZodiosPathsByMethod - ? ReadonlyDeep> - : ReadonlyDeep>> - ): Promise< - ZodiosResponseByPath< - Api, - M, - Path extends ZodiosPathsByMethod ? Path : never + async request< + M extends Method, + Path extends ZodiosPathsByMethod, + TConfig = ReadonlyDeep< + ZodiosRequestOptions > - > { + >( + config: TConfig + ): Promise> { let conf = config as unknown as ReadonlyDeep; const anyPlugin = this.getAnyEndpointPlugins()!; const endpointPlugin = this.findEnpointPlugins(conf.method, conf.url); @@ -294,18 +301,24 @@ export class ZodiosClass { */ async get< Path extends ZodiosPathsByMethod, - TConfig extends ZodiosRequestOptionsByPath + TConfig extends ZodiosRequestOptionsByPath< + Api, + "get", + Path, + true, + TypeProvider + > >( path: Path, ...[config]: RequiredKeys extends never ? [config?: ReadonlyDeep] : [config: ReadonlyDeep] - ): Promise> { + ): Promise> { return this.request({ ...config, method: "get", url: path, - } as any); + }); } /** @@ -318,22 +331,28 @@ export class ZodiosClass { async post< Path extends ZodiosPathsByMethod, TBody extends ReadonlyDeep< - UndefinedIfNever> + UndefinedIfNever> >, - TConfig extends ZodiosRequestOptionsByPath + TConfig extends ZodiosRequestOptionsByPath< + Api, + "post", + Path, + true, + TypeProvider + > >( path: Path, data: TBody, ...[config]: RequiredKeys extends never ? [config?: ReadonlyDeep] : [config: ReadonlyDeep] - ): Promise> { + ): Promise> { return this.request({ ...config, method: "post", url: path, data, - } as any); + }); } /** @@ -346,22 +365,28 @@ export class ZodiosClass { async put< Path extends ZodiosPathsByMethod, TBody extends ReadonlyDeep< - UndefinedIfNever> + UndefinedIfNever> >, - TConfig extends ZodiosRequestOptionsByPath + TConfig extends ZodiosRequestOptionsByPath< + Api, + "put", + Path, + true, + TypeProvider + > >( path: Path, data: TBody, ...[config]: RequiredKeys extends never ? [config?: ReadonlyDeep] : [config: ReadonlyDeep] - ): Promise> { + ): Promise> { return this.request({ ...config, method: "put", url: path, data, - } as any); + }); } /** @@ -374,22 +399,28 @@ export class ZodiosClass { async patch< Path extends ZodiosPathsByMethod, TBody extends ReadonlyDeep< - UndefinedIfNever> + UndefinedIfNever> >, - TConfig extends ZodiosRequestOptionsByPath + TConfig extends ZodiosRequestOptionsByPath< + Api, + "patch", + Path, + true, + TypeProvider + > >( path: Path, data: TBody, ...[config]: RequiredKeys extends never ? [config?: ReadonlyDeep] : [config: ReadonlyDeep] - ): Promise> { + ): Promise> { return this.request({ ...config, method: "patch", url: path, data, - } as any); + }); } /** @@ -401,38 +432,54 @@ export class ZodiosClass { async delete< Path extends ZodiosPathsByMethod, TBody extends ReadonlyDeep< - UndefinedIfNever> + UndefinedIfNever< + ZodiosBodyByPath + > >, - TConfig extends ZodiosRequestOptionsByPath + TConfig extends ZodiosRequestOptionsByPath< + Api, + "delete", + Path, + true, + TypeProvider + > >( path: Path, data: TBody, ...[config]: RequiredKeys extends never ? [config?: ReadonlyDeep] : [config: ReadonlyDeep] - ): Promise> { + ): Promise> { return this.request({ ...config, method: "delete", url: path, data, - } as any); + }); } } -export type ZodiosInstance = - ZodiosClass & ZodiosAliases; +export type ZodiosInstance< + Api extends ZodiosEndpointDefinitions, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = ZodiosClass & ZodiosAliases; export type ZodiosConstructor = { - new ( + new < + Api extends ZodiosEndpointDefinitions, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider + >( api: Narrow, - options?: ZodiosOptions - ): ZodiosInstance; - new ( + options?: ZodiosOptions + ): ZodiosInstance; + new < + Api extends ZodiosEndpointDefinitions, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider + >( baseUrl: string, api: Narrow, - options?: ZodiosOptions - ): ZodiosInstance; + options?: ZodiosOptions + ): ZodiosInstance; }; export const Zodios = ZodiosClass as ZodiosConstructor; @@ -441,4 +488,10 @@ export const Zodios = ZodiosClass as ZodiosConstructor; * Get the Api description type from zodios * @param Z - zodios type */ -export type ApiOf = Z extends ZodiosInstance ? Api : never; +export type ApiOf = Z extends ZodiosInstance ? Api : never; +export type TypeProviderOf = Z extends ZodiosInstance< + infer Api, + infer TypeProvider +> + ? TypeProvider + : never; diff --git a/src/zodios.types.ts b/src/zodios.types.ts index dc5bbeaa..788f65e6 100644 --- a/src/zodios.types.ts +++ b/src/zodios.types.ts @@ -1,7 +1,6 @@ import axios, { AxiosError, AxiosInstance, AxiosResponse } from "axios"; import type { FilterArrayByValue, - MapSchemaParameters, PickDefined, NeverIfEmpty, UndefinedToOptional, @@ -57,27 +56,42 @@ export type Aliases = FilterArrayByKey< export type ZodiosResponseForEndpoint< Endpoint extends ZodiosEndpointDefinition, - Frontend extends boolean = true + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider > = Frontend extends true - ? z.output - : z.input; + ? InferOutputTypeFromSchema + : InferInputTypeFromSchema; export type ZodiosResponseByPath< Api extends ZodiosEndpointDefinition[], M extends Method, Path extends ZodiosPathsByMethod, - Frontend extends boolean = true + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider > = Frontend extends true - ? z.output[number]["response"]> - : z.input[number]["response"]>; + ? InferOutputTypeFromSchema< + TypeProvider, + ZodiosEndpointDefinitionByPath[number]["response"] + > + : InferInputTypeFromSchema< + TypeProvider, + ZodiosEndpointDefinitionByPath[number]["response"] + >; export type ZodiosResponseByAlias< Api extends ZodiosEndpointDefinition[], Alias extends string, - Frontend extends boolean = true + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider > = Frontend extends true - ? z.output[number]["response"]> - : z.input[number]["response"]>; + ? InferOutputTypeFromSchema< + TypeProvider, + ZodiosEndpointDefinitionByAlias[number]["response"] + > + : InferInputTypeFromSchema< + TypeProvider, + ZodiosEndpointDefinitionByAlias[number]["response"] + >; export type ZodiosDefaultErrorForEndpoint< Endpoint extends ZodiosEndpointDefinition @@ -114,9 +128,11 @@ type IfNever = IfEquals; export type ZodiosErrorForEndpoint< Endpoint extends ZodiosEndpointDefinition, Status extends number, - Frontend extends boolean = true + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider > = Frontend extends true - ? z.output< + ? InferOutputTypeFromSchema< + TypeProvider, IfNever< FilterArrayByValue< Endpoint["errors"], @@ -127,7 +143,8 @@ export type ZodiosErrorForEndpoint< ZodiosDefaultErrorForEndpoint > > - : z.input< + : InferInputTypeFromSchema< + TypeProvider, IfNever< FilterArrayByValue< Endpoint["errors"], @@ -144,9 +161,11 @@ export type ZodiosErrorByPath< M extends Method, Path extends ZodiosPathsByMethod, Status extends number, - Frontend extends boolean = true + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider > = Frontend extends true - ? z.output< + ? InferOutputTypeFromSchema< + TypeProvider, IfNever< FilterArrayByValue< ZodiosEndpointDefinitionByPath[number]["errors"], @@ -157,7 +176,8 @@ export type ZodiosErrorByPath< ZodiosDefaultErrorByPath > > - : z.input< + : InferInputTypeFromSchema< + TypeProvider, IfNever< FilterArrayByValue< ZodiosEndpointDefinitionByPath[number]["errors"], @@ -220,9 +240,11 @@ export type ZodiosErrorByAlias< Api extends ZodiosEndpointDefinition[], Alias extends string, Status extends number, - Frontend extends boolean = true + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider > = Frontend extends true - ? z.output< + ? InferOutputTypeFromSchema< + TypeProvider, IfNever< FilterArrayByValue< ZodiosEndpointDefinitionByAlias[number]["errors"], @@ -233,7 +255,8 @@ export type ZodiosErrorByAlias< ZodiosDefaultErrorByAlias > > - : z.input< + : InferInputTypeFromSchema< + TypeProvider, IfNever< FilterArrayByValue< ZodiosEndpointDefinitionByAlias[number]["errors"], @@ -262,19 +285,21 @@ export type BodySchema< export type ZodiosBodyForEndpoint< Endpoint extends ZodiosEndpointDefinition, - Frontend extends boolean = true + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider > = Frontend extends true - ? z.input> - : z.output>; + ? InferInputTypeFromSchema> + : InferOutputTypeFromSchema>; export type ZodiosBodyByPath< Api extends ZodiosEndpointDefinition[], M extends Method, Path extends ZodiosPathsByMethod, - Frontend extends boolean = true + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider > = Frontend extends true - ? z.input> - : z.output>; + ? InferInputTypeFromSchema> + : InferOutputTypeFromSchema>; export type BodySchemaByAlias< Api extends ZodiosEndpointDefinition[], @@ -287,19 +312,55 @@ export type BodySchemaByAlias< export type ZodiosBodyByAlias< Api extends ZodiosEndpointDefinition[], Alias extends string, - Frontend extends boolean = true + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider > = Frontend extends true - ? z.input> - : z.output>; + ? InferInputTypeFromSchema> + : InferOutputTypeFromSchema>; + +/** + * Map a type an api description parameter to a zod infer type + * @param T - array of api description parameters + * @details - this is using tail recursion type optimization from typescript 4.5 + */ +export type MapSchemaParameters< + T, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, + Acc = {} +> = T extends [infer Head, ...infer Tail] + ? Head extends { + name: infer Name; + schema: infer Schema; + } + ? Name extends string + ? MapSchemaParameters< + Tail, + Frontend, + TypeProvider, + Merge< + { + [Key in Name]: Frontend extends true + ? InferInputTypeFromSchema + : InferOutputTypeFromSchema; + }, + Acc + > + > + : Acc + : Acc + : Acc; export type ZodiosQueryParamsForEndpoint< Endpoint extends ZodiosEndpointDefinition, - Frontend extends boolean = true + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider > = NeverIfEmpty< UndefinedToOptional< MapSchemaParameters< FilterArrayByValue, - Frontend + Frontend, + TypeProvider > > >; @@ -308,7 +369,8 @@ export type ZodiosQueryParamsByPath< Api extends ZodiosEndpointDefinition[], M extends Method, Path extends ZodiosPathsByMethod, - Frontend extends boolean = true + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider > = NeverIfEmpty< UndefinedToOptional< MapSchemaParameters< @@ -316,7 +378,8 @@ export type ZodiosQueryParamsByPath< ZodiosEndpointDefinitionByPath[number]["parameters"], { type: "Query" } >, - Frontend + Frontend, + TypeProvider > > >; @@ -324,7 +387,8 @@ export type ZodiosQueryParamsByPath< export type ZodiosQueryParamsByAlias< Api extends ZodiosEndpointDefinition[], Alias extends string, - Frontend extends boolean = true + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider > = NeverIfEmpty< UndefinedToOptional< MapSchemaParameters< @@ -332,7 +396,8 @@ export type ZodiosQueryParamsByAlias< ZodiosEndpointDefinitionByAlias[number]["parameters"], { type: "Query" } >, - Frontend + Frontend, + TypeProvider > > >; @@ -347,9 +412,11 @@ export type ZodiosPathParams = NeverIfEmpty< export type ZodiosPathParamsForEndpoint< Endpoint extends ZodiosEndpointDefinition, Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, PathParameters = MapSchemaParameters< FilterArrayByValue, - Frontend + Frontend, + TypeProvider > > = NeverIfEmpty<{ [K in PathParamNames]: PathParameters extends { @@ -367,12 +434,14 @@ export type ZodiosPathParamsByPath< M extends Method, Path extends ZodiosPathsByMethod, Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, PathParameters = MapSchemaParameters< FilterArrayByValue< ZodiosEndpointDefinitionByPath[number]["parameters"], { type: "Path" } >, - Frontend + Frontend, + TypeProvider > > = NeverIfEmpty<{ [K in PathParamNames]: PathParameters extends { [Key in K]: any } @@ -387,6 +456,7 @@ export type ZodiosPathParamByAlias< Api extends ZodiosEndpointDefinition[], Alias extends string, Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, EndpointDefinition extends ZodiosEndpointDefinition = ZodiosEndpointDefinitionByAlias< Api, Alias @@ -394,7 +464,8 @@ export type ZodiosPathParamByAlias< Path = EndpointDefinition["path"], PathParameters = MapSchemaParameters< FilterArrayByValue, - Frontend + Frontend, + TypeProvider > > = NeverIfEmpty<{ [K in PathParamNames]: PathParameters extends { [Key in K]: any } @@ -404,12 +475,14 @@ export type ZodiosPathParamByAlias< export type ZodiosHeaderParamsForEndpoint< Endpoint extends ZodiosEndpointDefinition, - Frontend extends boolean = true + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider > = NeverIfEmpty< UndefinedToOptional< MapSchemaParameters< FilterArrayByValue, - Frontend + Frontend, + TypeProvider > > >; @@ -418,7 +491,8 @@ export type ZodiosHeaderParamsByPath< Api extends ZodiosEndpointDefinition[], M extends Method, Path extends ZodiosPathsByMethod, - Frontend extends boolean = true + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider > = NeverIfEmpty< UndefinedToOptional< MapSchemaParameters< @@ -426,7 +500,8 @@ export type ZodiosHeaderParamsByPath< ZodiosEndpointDefinitionByPath[number]["parameters"], { type: "Header" } >, - Frontend + Frontend, + TypeProvider > > >; @@ -434,7 +509,8 @@ export type ZodiosHeaderParamsByPath< export type ZodiosHeaderParamsByAlias< Api extends ZodiosEndpointDefinition[], Alias extends string, - Frontend extends boolean = true + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider > = NeverIfEmpty< UndefinedToOptional< MapSchemaParameters< @@ -442,20 +518,23 @@ export type ZodiosHeaderParamsByAlias< ZodiosEndpointDefinitionByAlias[number]["parameters"], { type: "Header" } >, - Frontend + Frontend, + TypeProvider > > >; export type ZodiosRequestOptionsByAlias< Api extends ZodiosEndpointDefinition[], - Alias extends string + Alias extends string, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider > = Merge< SetPropsOptionalIfChildrenAreOptional< PickDefined<{ - params: ZodiosPathParamByAlias; - queries: ZodiosQueryParamsByAlias; - headers: ZodiosHeaderParamsByAlias; + params: ZodiosPathParamByAlias; + queries: ZodiosQueryParamsByAlias; + headers: ZodiosHeaderParamsByAlias; }> >, Omit @@ -477,19 +556,23 @@ export type ZodiosAliasRequest = ? (configOptions?: ReadonlyDeep) => Promise : (configOptions: ReadonlyDeep) => Promise; -export type ZodiosAliases = { +export type ZodiosAliases< + Api extends ZodiosEndpointDefinition[], + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = { [Alias in Aliases]: ZodiosEndpointDefinitionByAlias< Api, Alias >[number]["method"] extends MutationMethod ? ZodiosMutationAliasRequest< - ZodiosBodyByAlias, - ZodiosRequestOptionsByAlias, - ZodiosResponseByAlias + ZodiosBodyByAlias, + ZodiosRequestOptionsByAlias, + ZodiosResponseByAlias > : ZodiosAliasRequest< - ZodiosRequestOptionsByAlias, - ZodiosResponseByAlias + ZodiosRequestOptionsByAlias, + ZodiosResponseByAlias >; }; @@ -513,13 +596,15 @@ export type AnyZodiosRequestOptions = Merge< export type ZodiosMethodOptions< Api extends ZodiosEndpointDefinition[], M extends Method, - Path extends ZodiosPathsByMethod + Path extends ZodiosPathsByMethod, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider > = Merge< SetPropsOptionalIfChildrenAreOptional< PickDefined<{ - params: ZodiosPathParamsByPath; - queries: ZodiosQueryParamsByPath; - headers: ZodiosHeaderParamsByPath; + params: ZodiosPathParamsByPath; + queries: ZodiosQueryParamsByPath; + headers: ZodiosHeaderParamsByPath; }> >, Omit @@ -531,13 +616,15 @@ export type ZodiosMethodOptions< export type ZodiosRequestOptionsByPath< Api extends ZodiosEndpointDefinition[], M extends Method, - Path extends ZodiosPathsByMethod + Path extends ZodiosPathsByMethod, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider > = Merge< SetPropsOptionalIfChildrenAreOptional< PickDefined<{ - params: ZodiosPathParamsByPath; - queries: ZodiosQueryParamsByPath; - headers: ZodiosHeaderParamsByPath; + params: ZodiosPathParamsByPath; + queries: ZodiosQueryParamsByPath; + headers: ZodiosHeaderParamsByPath; }> >, Omit @@ -546,20 +633,24 @@ export type ZodiosRequestOptionsByPath< export type ZodiosRequestOptions< Api extends ZodiosEndpointDefinition[], M extends Method, - Path extends ZodiosPathsByMethod + Path extends ZodiosPathsByMethod, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider > = Merge< { method: M; url: Path; - data?: ZodiosBodyByPath; + data?: ZodiosBodyByPath; }, - ZodiosRequestOptionsByPath + ZodiosRequestOptionsByPath >; /** * Zodios options */ -export type ZodiosOptions = { +export type ZodiosOptions< + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = { /** * Should zodios validate parameters and response? Default: true */ @@ -581,6 +672,11 @@ export type ZodiosOptions = { * default config for axios requests */ axiosConfig?: AxiosRequestConfig; + + /** + * set a custom validation plugin via a custom factory + */ + validationPluginFactory?: ZodiosTypeProviderFactory; }; export type ZodiosEndpointParameter = { @@ -686,6 +782,39 @@ export type ZodiosEndpointDefinition = { export type ZodiosEndpointDefinitions = ZodiosEndpointDefinition[]; +export interface AnyZodiosTypeProvider { + schema: unknown; + input: unknown; + output: unknown; +} + +export type InferInputTypeFromSchema< + F extends AnyZodiosTypeProvider, + Schema +> = (F & { schema: Schema })["input"]; +export type InferOutputTypeFromSchema< + F extends AnyZodiosTypeProvider, + Schema +> = (F & { schema: Schema })["output"]; + +export interface ZodTypeProvider extends AnyZodiosTypeProvider { + input: this["schema"] extends z.ZodTypeAny ? z.input : never; + output: this["schema"] extends z.ZodTypeAny + ? z.output + : never; +} + +export type ZodiosTypeProviderFactory< + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = { + _provider: TypeProvider; + factory: (options: { + validate: boolean | "request" | "response" | "all" | "none"; + transform: boolean | "request" | "response"; + sendDefaults: boolean; + }) => ZodiosPlugin; +}; + /** * Zodios plugin that can be used to intercept zodios requests and responses */ From 4312abe387a9984087c6205e2199bb2dbe1fbd47 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Thu, 10 Nov 2022 12:07:05 +0100 Subject: [PATCH 002/206] feat(type-provider): implement io-ts type provider --- examples/io-ts-types.ts | 68 ++++++++++++ package.json | 15 ++- src/plugins/zod-validation.plugin.test.ts | 4 + src/plugins/zod-validation.plugin.ts | 28 +++-- src/type-provider.io-ts.ts | 28 +++++ src/type-provider.types.ts | 26 +++++ src/type-provider.zod.ts | 18 ++++ src/utils.types.ts | 12 ++- src/zodios-error.utils.ts | 13 ++- src/zodios.ts | 13 ++- src/zodios.types.ts | 124 ++++++++++------------ yarn.lock | 10 ++ 12 files changed, 266 insertions(+), 93 deletions(-) create mode 100644 examples/io-ts-types.ts create mode 100644 src/type-provider.io-ts.ts create mode 100644 src/type-provider.types.ts create mode 100644 src/type-provider.zod.ts diff --git a/examples/io-ts-types.ts b/examples/io-ts-types.ts new file mode 100644 index 00000000..e66a1c64 --- /dev/null +++ b/examples/io-ts-types.ts @@ -0,0 +1,68 @@ +import { Zodios, makeApi } from "../src/index"; +import * as t from "io-ts"; +import { ApiOf, TypeProviderOf } from "../src/zodios"; +import { ioTsTypeProvider } from "../src/type-provider.io-ts"; + +// you can define schema before declaring the API to get back the type + +// you can then get back the types +type User = t.TypeOf; +type Users = t.TypeOf; + +// you can also predefine your API +const jsonplaceholderUrl = "https://jsonplaceholder.typicode.com"; + +const userSchema = t.type({ + id: t.number, + name: t.string, +}); + +const usersSchema = t.array(userSchema); + +const jsonplaceholderApi = makeApi([ + { + method: "get", + path: "/users", + description: "Get all users", + parameters: [ + { + name: "q", + description: "full text search", + type: "Query", + schema: t.string, + }, + { + name: "page", + description: "page number", + type: "Query", + schema: t.union([t.number, t.undefined]), + }, + ], + response: usersSchema, + }, + { + method: "get", + path: "/users/:id", + description: "Get a user", + response: userSchema, + }, +]); + +async function bootstrap() { + const apiClient = new Zodios(jsonplaceholderUrl, jsonplaceholderApi, { + typeProvider: ioTsTypeProvider, + }); + + type Api = ApiOf; + // ^? + type Provider = TypeProviderOf; + // ^? + const users = await apiClient.get("/users", { queries: { q: "Nicholas" } }); + // ^? + console.log(users); + const user = await apiClient.get("/users/:id", { params: { id: 7 } }); + // ^? + console.log(user); +} + +bootstrap(); diff --git a/package.json b/package.json index ef9682cc..1e5e1980 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,20 @@ }, "peerDependencies": { "axios": "^0.x || ^1.0.0", - "zod": "^3.x" + "zod": "^3.x", + "fp-ts": "2.x", + "io-ts": "2.x" + }, + "peerDependenciesMeta": { + "zod": { + "optional": true + }, + "fp-ts": { + "optional": true + }, + "io-ts": { + "optional": true + } }, "devDependencies": { "@jest/types": "29.5.0", diff --git a/src/plugins/zod-validation.plugin.test.ts b/src/plugins/zod-validation.plugin.test.ts index ec12250f..f313586a 100644 --- a/src/plugins/zod-validation.plugin.test.ts +++ b/src/plugins/zod-validation.plugin.test.ts @@ -4,22 +4,26 @@ import { apiBuilder } from "../api"; import { ReadonlyDeep } from "../utils.types"; import { AnyZodiosRequestOptions } from "../zodios.types"; import { zodValidationPlugin } from "./zod-validation.plugin"; +import { zodTypeProvider } from "../type-provider.zod"; describe("zodValidationPlugin", () => { const plugin = zodValidationPlugin({ validate: true, transform: true, sendDefaults: false, + typeProvider: zodTypeProvider, }); const pluginWithDefaults = zodValidationPlugin({ validate: true, transform: true, sendDefaults: true, + typeProvider: zodTypeProvider, }); const pluginWithoutTransform = zodValidationPlugin({ validate: true, transform: false, sendDefaults: false, + typeProvider: zodTypeProvider, }); describe("request", () => { diff --git a/src/plugins/zod-validation.plugin.ts b/src/plugins/zod-validation.plugin.ts index af8c035a..0389305a 100644 --- a/src/plugins/zod-validation.plugin.ts +++ b/src/plugins/zod-validation.plugin.ts @@ -1,9 +1,13 @@ import { ZodiosError } from "../zodios-error"; import type { ZodiosOptions, ZodiosPlugin } from "../zodios.types"; import { findEndpoint } from "../utils"; +import type { AnyZodiosTypeProvider } from "../type-provider.types"; -type Options = Required< - Pick +type Options = Required< + Pick< + ZodiosOptions, + "validate" | "transform" | "sendDefaults" | "typeProvider" + > >; function shouldResponse(option: string | boolean) { @@ -19,11 +23,14 @@ function shouldRequest(option: string | boolean) { * By default zodios always validates the response. * @returns zod-validation plugin */ -export function zodValidationPlugin({ +export function zodValidationPlugin< + TypeProvider extends AnyZodiosTypeProvider +>({ validate, transform, sendDefaults, -}: Options): ZodiosPlugin { + typeProvider, +}: Options): ZodiosPlugin { return { name: "zod-validation", request: shouldRequest(validate) @@ -67,7 +74,7 @@ export function zodValidationPlugin({ const { name, schema, type } = parameter; const value = paramsOf[type](name); if (sendDefaults || value !== undefined) { - const parsed = await schema.safeParseAsync(value); + const parsed = await typeProvider.validateAsync(schema, value); if (!parsed.success) { throw new ZodiosError( `Zodios: Invalid ${type} parameter '${name}'`, @@ -96,7 +103,8 @@ export function zodValidationPlugin({ if ( response.headers?.["content-type"]?.includes("application/json") ) { - const parsed = await endpoint.response.safeParseAsync( + const parsed = await typeProvider.validateAsync( + endpoint.response, response.data ); if (!parsed.success) { @@ -105,11 +113,9 @@ export function zodValidationPlugin({ endpoint.path }'\nstatus: ${response.status} ${ response.statusText - }\ncause:\n${parsed.error.message}\nreceived:\n${JSON.stringify( - response.data, - null, - 2 - )}`, + }\ncause:\n${ + parsed.error.message ?? JSON.stringify(parsed.error) + }\nreceived:\n${JSON.stringify(response.data, null, 2)}`, config, response.data, parsed.error diff --git a/src/type-provider.io-ts.ts b/src/type-provider.io-ts.ts new file mode 100644 index 00000000..08e2c29b --- /dev/null +++ b/src/type-provider.io-ts.ts @@ -0,0 +1,28 @@ +import * as t from "io-ts"; +import * as Either from "fp-ts/Either"; +import { + AnyZodiosTypeProvider, + ZodiosDynamicTypeProvider, +} from "./type-provider.types"; + +export interface IoTsTypeProvider extends AnyZodiosTypeProvider { + input: this["schema"] extends t.Type ? t.InputOf : never; + output: this["schema"] extends t.Type + ? t.OutputOf + : never; +} + +export const ioTsTypeProvider: ZodiosDynamicTypeProvider = { + validate: (schema: t.Type, input: unknown) => { + const result = schema.decode(input); + return Either.isRight(result) + ? { success: true, data: result.right } + : { success: false, error: result.left }; + }, + validateAsync: async (schema: t.Type, input: unknown) => { + const result = schema.decode(input); + return Either.isRight(result) + ? { success: true, data: result.right } + : { success: false, error: result.left }; + }, +}; diff --git a/src/type-provider.types.ts b/src/type-provider.types.ts new file mode 100644 index 00000000..7dffc4a8 --- /dev/null +++ b/src/type-provider.types.ts @@ -0,0 +1,26 @@ +export interface AnyZodiosTypeProvider { + schema: unknown; + input: unknown; + output: unknown; +} + +export type InferInputTypeFromSchema< + F extends AnyZodiosTypeProvider, + Schema +> = (F & { schema: Schema })["input"]; +export type InferOutputTypeFromSchema< + F extends AnyZodiosTypeProvider, + Schema +> = (F & { schema: Schema })["output"]; + +export type ZodiosValidateResult = + | { success: true; data: any } + | { success: false; error: any }; + +export type ZodiosDynamicTypeProvider< + TypeProvider extends AnyZodiosTypeProvider +> = { + _provider?: TypeProvider; + validate: (schema: any, input: unknown) => ZodiosValidateResult; + validateAsync: (schema: any, input: unknown) => Promise; +}; diff --git a/src/type-provider.zod.ts b/src/type-provider.zod.ts new file mode 100644 index 00000000..bb5ddea6 --- /dev/null +++ b/src/type-provider.zod.ts @@ -0,0 +1,18 @@ +import { z } from "zod"; +import { + AnyZodiosTypeProvider, + ZodiosDynamicTypeProvider, +} from "./type-provider.types"; + +export interface ZodTypeProvider extends AnyZodiosTypeProvider { + input: this["schema"] extends z.ZodTypeAny ? z.input : never; + output: this["schema"] extends z.ZodTypeAny + ? z.output + : never; +} + +export const zodTypeProvider: ZodiosDynamicTypeProvider = { + validate: (schema, input) => schema.safeParse(input), + validateAsync: (schema: z.ZodTypeAny, input: unknown) => + schema.safeParseAsync(input), +}; diff --git a/src/utils.types.ts b/src/utils.types.ts index 1f7b6050..aa62a8d8 100644 --- a/src/utils.types.ts +++ b/src/utils.types.ts @@ -1,5 +1,3 @@ -import { z, ZodType } from "zod"; - /** * filter an array type by a predicate value * @param T - array type @@ -53,10 +51,14 @@ type NarrowRaw = | (T extends string | number | bigint | boolean ? T : never) | (T extends [] ? [] : never) | { - [K in keyof T]: K extends "description" ? T[K] : NarrowNotZod; + [K in keyof T]: K extends "description" ? T[K] : NarrowNotSchema; }; -type NarrowNotZod = Try>; +type NarrowNotSchema = Try< + T, + { parse: (...args: any[]) => any } | { validate: (...args: any[]) => any }, + NarrowRaw +>; /** * Utility to infer the embedded primitive type of any type @@ -64,7 +66,7 @@ type NarrowNotZod = Try>; * @param T - type to infer the embedded type of * @see - thank you tannerlinsley for this idea */ -export type Narrow = Try>; +export type Narrow = Try>; /** * merge all union types into a single type diff --git a/src/zodios-error.utils.ts b/src/zodios-error.utils.ts index a8f277af..fb662c82 100644 --- a/src/zodios-error.utils.ts +++ b/src/zodios-error.utils.ts @@ -1,4 +1,9 @@ import { AxiosError } from "axios"; +import { + AnyZodiosTypeProvider, + ZodiosDynamicTypeProvider, +} from "./type-provider.types"; +import { ZodTypeProvider, zodTypeProvider } from "./type-provider.zod"; import { findEndpointErrorsByAlias, findEndpointErrorsByPath } from "./utils"; import { Aliases, @@ -10,8 +15,11 @@ import { ZodiosPathsByMethod, } from "./zodios.types"; -function isDefinedError( +function isDefinedError< + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +>( error: unknown, + typeProvider: ZodiosDynamicTypeProvider = zodTypeProvider as any, findEndpointErrors: (error: AxiosError) => ZodiosEndpointError[] | undefined ): boolean { if ( @@ -23,7 +31,8 @@ function isDefinedError( const endpointErrors = findEndpointErrors(err); if (endpointErrors) { return endpointErrors.some( - (desc) => desc.schema.safeParse(err.response!.data).success + (desc) => + typeProvider.validate(desc.schema, err.response!.data).success ); } } diff --git a/src/zodios.ts b/src/zodios.ts index 5d43d07e..a832d9e1 100644 --- a/src/zodios.ts +++ b/src/zodios.ts @@ -13,8 +13,6 @@ import { ZodiosAliases, ZodiosPlugin, Aliases, - AnyZodiosTypeProvider, - ZodTypeProvider, } from "./zodios.types"; import { omit, replacePathParams } from "./utils"; import { @@ -33,7 +31,9 @@ import { UndefinedIfNever, } from "./utils.types"; import { checkApi } from "./api"; - +import type { AnyZodiosTypeProvider } from "./type-provider.types"; +import type { ZodTypeProvider } from "./type-provider.zod"; +import { zodTypeProvider } from "./type-provider.zod"; /** * zodios api client based on axios */ @@ -44,7 +44,7 @@ export class ZodiosClass< private axiosInstance: AxiosInstance; public readonly options: PickRequired< ZodiosOptions, - "validate" | "transform" | "sendDefaults" + "validate" | "transform" | "sendDefaults" | "typeProvider" >; public readonly api: Api; private endpointPlugins: Map = new Map(); @@ -112,6 +112,7 @@ export class ZodiosClass< validate: true, transform: true, sendDefaults: false, + typeProvider: zodTypeProvider as any, ...options, }; @@ -488,7 +489,9 @@ export const Zodios = ZodiosClass as ZodiosConstructor; * Get the Api description type from zodios * @param Z - zodios type */ -export type ApiOf = Z extends ZodiosInstance ? Api : never; +export type ApiOf = Z extends ZodiosInstance + ? Api + : never; export type TypeProviderOf = Z extends ZodiosInstance< infer Api, infer TypeProvider diff --git a/src/zodios.types.ts b/src/zodios.types.ts index 788f65e6..65ade6de 100644 --- a/src/zodios.types.ts +++ b/src/zodios.types.ts @@ -1,4 +1,11 @@ -import axios, { AxiosError, AxiosInstance, AxiosResponse } from "axios"; +import { + AxiosError, + AxiosInstance, + AxiosRequestConfig, + AxiosResponse, +} from "axios"; +import z from "zod"; + import type { FilterArrayByValue, PickDefined, @@ -13,7 +20,13 @@ import type { RequiredKeys, UndefinedIfNever, } from "./utils.types"; -import z from "zod"; +import type { + AnyZodiosTypeProvider, + InferInputTypeFromSchema, + InferOutputTypeFromSchema, + ZodiosDynamicTypeProvider, +} from "./type-provider.types"; +import type { ZodTypeProvider } from "./type-provider.zod"; type AxiosRequestConfig = Parameters[0]; @@ -189,51 +202,57 @@ export type ZodiosErrorByPath< > >; -export type ErrorsToAxios = T extends [ - infer Head, - ...infer Tail -] +export type ErrorsToAxios< + T, + TypeProvider extends AnyZodiosTypeProvider, + Acc extends unknown[] = [] +> = T extends [infer Head, ...infer Tail] ? Head extends { status: infer Status; schema: infer Schema; } - ? Schema extends z.ZodTypeAny - ? ErrorsToAxios< - Tail, - [ - ...Acc, - Merge< - Omit, - { - response: Merge< - AxiosError>["response"], - { - status: Status extends "default" - ? 0 & { error: Status } - : Status; - } - >; - } - > - ] - > - : Acc + ? ErrorsToAxios< + Tail, + TypeProvider, + [ + ...Acc, + Merge< + Omit, + { + response: Merge< + AxiosError< + InferOutputTypeFromSchema + >["response"], + { + status: Status extends "default" + ? 0 & { error: Status } + : Status; + } + >; + } + > + ] + > : Acc : Acc; export type ZodiosMatchingErrorsByPath< Api extends ZodiosEndpointDefinition[], M extends Method, - Path extends ZodiosPathsByMethod + Path extends ZodiosPathsByMethod, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider > = ErrorsToAxios< - ZodiosEndpointDefinitionByPath[number]["errors"] + ZodiosEndpointDefinitionByPath[number]["errors"], + TypeProvider >[number]; export type ZodiosMatchingErrorsByAlias< Api extends ZodiosEndpointDefinition[], - Alias extends string + Alias extends string, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider > = ErrorsToAxios< - ZodiosEndpointDefinitionByAlias[number]["errors"] + ZodiosEndpointDefinitionByAlias[number]["errors"], + TypeProvider >[number]; export type ZodiosErrorByAlias< @@ -674,9 +693,9 @@ export type ZodiosOptions< axiosConfig?: AxiosRequestConfig; /** - * set a custom validation plugin via a custom factory + * set a custom type provider. Default: ZodTypeProvider */ - validationPluginFactory?: ZodiosTypeProviderFactory; + typeProvider?: ZodiosDynamicTypeProvider; }; export type ZodiosEndpointParameter = { @@ -696,7 +715,7 @@ export type ZodiosEndpointParameter = { * zod schema of the parameter * you can use zod `transform` to transform the value of the parameter before sending it to the server */ - schema: z.ZodType; + schema: unknown; }; export type ZodiosEndpointParameters = ZodiosEndpointParameter[]; @@ -714,7 +733,7 @@ export type ZodiosEndpointError = { /** * schema of the error */ - schema: z.ZodType; + schema: unknown; }; export type ZodiosEndpointErrors = ZodiosEndpointError[]; @@ -764,7 +783,7 @@ export type ZodiosEndpointDefinition = { * response of the endpoint * you can use zod `transform` to transform the value of the response before returning it */ - response: z.ZodType; + response: unknown; /** * optional response status of the endpoint for sucess, default is 200 * customize it if your endpoint returns a different status code and if you need openapi to generate the correct status code @@ -782,39 +801,6 @@ export type ZodiosEndpointDefinition = { export type ZodiosEndpointDefinitions = ZodiosEndpointDefinition[]; -export interface AnyZodiosTypeProvider { - schema: unknown; - input: unknown; - output: unknown; -} - -export type InferInputTypeFromSchema< - F extends AnyZodiosTypeProvider, - Schema -> = (F & { schema: Schema })["input"]; -export type InferOutputTypeFromSchema< - F extends AnyZodiosTypeProvider, - Schema -> = (F & { schema: Schema })["output"]; - -export interface ZodTypeProvider extends AnyZodiosTypeProvider { - input: this["schema"] extends z.ZodTypeAny ? z.input : never; - output: this["schema"] extends z.ZodTypeAny - ? z.output - : never; -} - -export type ZodiosTypeProviderFactory< - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider -> = { - _provider: TypeProvider; - factory: (options: { - validate: boolean | "request" | "response" | "all" | "none"; - transform: boolean | "request" | "response"; - sendDefaults: boolean; - }) => ZodiosPlugin; -}; - /** * Zodios plugin that can be used to intercept zodios requests and responses */ diff --git a/yarn.lock b/yarn.lock index db73e76a..6badee86 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1895,6 +1895,11 @@ forwarded@0.2.0: resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" integrity sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow== +fp-ts@2.13.1: + version "2.13.1" + resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-2.13.1.tgz#1bf2b24136cca154846af16752dc29e8fa506f2a" + integrity sha512-0eu5ULPS2c/jsa1lGFneEFFEdTbembJv8e4QKXeVJ3lm/5hyve06dlKZrpxmMwJt6rYen7sxmHHK2CLaXvWuWQ== + fresh@0.5.2: version "0.5.2" resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" @@ -2088,6 +2093,11 @@ inherits@2, inherits@2.0.4, inherits@^2.0.3, inherits@~2.0.3: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== +io-ts@2.2.19: + version "2.2.19" + resolved "https://registry.yarnpkg.com/io-ts/-/io-ts-2.2.19.tgz#4ba5e120472a0a07ff693fdb3d7075ea1c1b77c3" + integrity sha512-ED0GQwvKRr5C2jqOOJCkuJW2clnbzqFexQ8V7Qsb+VB36S1Mk/OKH7k0FjSe4mjKy9qBRA3OqgVGyFMUEKIubw== + ipaddr.js@1.9.1: version "1.9.1" resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" From f4ebc03c4cba7b4138d373063e4df486913c24e6 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Thu, 10 Nov 2022 14:24:53 +0100 Subject: [PATCH 003/206] feat(typeProvider): make type providers library independant --- src/type-provider.io-ts.ts | 20 ++++++++------------ src/type-provider.types.ts | 13 +++++++------ src/type-provider.zod.ts | 16 ++++++++-------- src/zodios-error.utils.ts | 4 ++-- src/zodios.types.ts | 4 ++-- 5 files changed, 27 insertions(+), 30 deletions(-) diff --git a/src/type-provider.io-ts.ts b/src/type-provider.io-ts.ts index 08e2c29b..90a5f6bd 100644 --- a/src/type-provider.io-ts.ts +++ b/src/type-provider.io-ts.ts @@ -1,27 +1,23 @@ -import * as t from "io-ts"; -import * as Either from "fp-ts/Either"; import { AnyZodiosTypeProvider, - ZodiosDynamicTypeProvider, + ZodiosRuntimeTypeProvider, } from "./type-provider.types"; export interface IoTsTypeProvider extends AnyZodiosTypeProvider { - input: this["schema"] extends t.Type ? t.InputOf : never; - output: this["schema"] extends t.Type - ? t.OutputOf - : never; + input: this["schema"] extends { _I: unknown } ? this["schema"]["_I"] : never; + output: this["schema"] extends { _O: unknown } ? this["schema"]["_O"] : never; } -export const ioTsTypeProvider: ZodiosDynamicTypeProvider = { - validate: (schema: t.Type, input: unknown) => { +export const ioTsTypeProvider: ZodiosRuntimeTypeProvider = { + validate: (schema, input) => { const result = schema.decode(input); - return Either.isRight(result) + return result._tag === "Right" ? { success: true, data: result.right } : { success: false, error: result.left }; }, - validateAsync: async (schema: t.Type, input: unknown) => { + validateAsync: async (schema, input) => { const result = schema.decode(input); - return Either.isRight(result) + return result._tag === "Right" ? { success: true, data: result.right } : { success: false, error: result.left }; }, diff --git a/src/type-provider.types.ts b/src/type-provider.types.ts index 7dffc4a8..86ca19e3 100644 --- a/src/type-provider.types.ts +++ b/src/type-provider.types.ts @@ -5,22 +5,23 @@ export interface AnyZodiosTypeProvider { } export type InferInputTypeFromSchema< - F extends AnyZodiosTypeProvider, + TypeProvider extends AnyZodiosTypeProvider, Schema -> = (F & { schema: Schema })["input"]; +> = (TypeProvider & { schema: Schema })["input"]; + export type InferOutputTypeFromSchema< - F extends AnyZodiosTypeProvider, + TypeProvider extends AnyZodiosTypeProvider, Schema -> = (F & { schema: Schema })["output"]; +> = (TypeProvider & { schema: Schema })["output"]; export type ZodiosValidateResult = | { success: true; data: any } | { success: false; error: any }; -export type ZodiosDynamicTypeProvider< +export type ZodiosRuntimeTypeProvider< TypeProvider extends AnyZodiosTypeProvider > = { - _provider?: TypeProvider; + readonly _provider?: TypeProvider; validate: (schema: any, input: unknown) => ZodiosValidateResult; validateAsync: (schema: any, input: unknown) => Promise; }; diff --git a/src/type-provider.zod.ts b/src/type-provider.zod.ts index bb5ddea6..c8d88f03 100644 --- a/src/type-provider.zod.ts +++ b/src/type-provider.zod.ts @@ -1,18 +1,18 @@ -import { z } from "zod"; import { AnyZodiosTypeProvider, - ZodiosDynamicTypeProvider, + ZodiosRuntimeTypeProvider, } from "./type-provider.types"; export interface ZodTypeProvider extends AnyZodiosTypeProvider { - input: this["schema"] extends z.ZodTypeAny ? z.input : never; - output: this["schema"] extends z.ZodTypeAny - ? z.output + input: this["schema"] extends { _input: unknown } + ? this["schema"]["_input"] + : never; + output: this["schema"] extends { _output: unknown } + ? this["schema"]["_output"] : never; } -export const zodTypeProvider: ZodiosDynamicTypeProvider = { +export const zodTypeProvider: ZodiosRuntimeTypeProvider = { validate: (schema, input) => schema.safeParse(input), - validateAsync: (schema: z.ZodTypeAny, input: unknown) => - schema.safeParseAsync(input), + validateAsync: (schema, input) => schema.safeParseAsync(input), }; diff --git a/src/zodios-error.utils.ts b/src/zodios-error.utils.ts index fb662c82..e322cf3d 100644 --- a/src/zodios-error.utils.ts +++ b/src/zodios-error.utils.ts @@ -1,7 +1,7 @@ import { AxiosError } from "axios"; import { AnyZodiosTypeProvider, - ZodiosDynamicTypeProvider, + ZodiosRuntimeTypeProvider, } from "./type-provider.types"; import { ZodTypeProvider, zodTypeProvider } from "./type-provider.zod"; import { findEndpointErrorsByAlias, findEndpointErrorsByPath } from "./utils"; @@ -19,7 +19,7 @@ function isDefinedError< TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider >( error: unknown, - typeProvider: ZodiosDynamicTypeProvider = zodTypeProvider as any, + typeProvider: ZodiosRuntimeTypeProvider = zodTypeProvider as any, findEndpointErrors: (error: AxiosError) => ZodiosEndpointError[] | undefined ): boolean { if ( diff --git a/src/zodios.types.ts b/src/zodios.types.ts index 65ade6de..fcadd875 100644 --- a/src/zodios.types.ts +++ b/src/zodios.types.ts @@ -24,7 +24,7 @@ import type { AnyZodiosTypeProvider, InferInputTypeFromSchema, InferOutputTypeFromSchema, - ZodiosDynamicTypeProvider, + ZodiosRuntimeTypeProvider, } from "./type-provider.types"; import type { ZodTypeProvider } from "./type-provider.zod"; @@ -695,7 +695,7 @@ export type ZodiosOptions< /** * set a custom type provider. Default: ZodTypeProvider */ - typeProvider?: ZodiosDynamicTypeProvider; + typeProvider?: ZodiosRuntimeTypeProvider; }; export type ZodiosEndpointParameter = { From 3d4ca1c77f7a6f624e08f9e74a27cffb45bd3a8b Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Thu, 10 Nov 2022 14:48:29 +0100 Subject: [PATCH 004/206] feat(type-provider): export providers and remove crud helpers --- src/index.ts | 12 +++++++++++- src/zodios.types.ts | 1 - 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index e1b36f0a..1802678e 100644 --- a/src/index.ts +++ b/src/index.ts @@ -42,6 +42,17 @@ export type { ZodiosRequestOptionsByAlias, ZodiosPlugin, } from "./zodios.types"; +export type { + AnyZodiosTypeProvider, + InferInputTypeFromSchema, + InferOutputTypeFromSchema, + ZodiosRuntimeTypeProvider, + ZodiosValidateResult, +} from "./type-provider.types"; +export type { ZodTypeProvider } from "./type-provider.zod"; +export { zodTypeProvider } from "./type-provider.zod"; +export type { IoTsTypeProvider } from "./type-provider.io-ts"; +export { ioTsTypeProvider } from "./type-provider.io-ts"; export { PluginId, zodValidationPlugin, @@ -52,7 +63,6 @@ export { export { makeApi, - makeCrudApi, apiBuilder, parametersBuilder, makeParameters, diff --git a/src/zodios.types.ts b/src/zodios.types.ts index fcadd875..9fe7294b 100644 --- a/src/zodios.types.ts +++ b/src/zodios.types.ts @@ -4,7 +4,6 @@ import { AxiosRequestConfig, AxiosResponse, } from "axios"; -import z from "zod"; import type { FilterArrayByValue, From 2d17dd59a2e602dd3383e0a614cf976395f0aa81 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Thu, 10 Nov 2022 15:27:42 +0100 Subject: [PATCH 005/206] fix(type-provider): remove default on internal error impl --- src/zodios-error.utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zodios-error.utils.ts b/src/zodios-error.utils.ts index e322cf3d..1b10360d 100644 --- a/src/zodios-error.utils.ts +++ b/src/zodios-error.utils.ts @@ -19,7 +19,7 @@ function isDefinedError< TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider >( error: unknown, - typeProvider: ZodiosRuntimeTypeProvider = zodTypeProvider as any, + typeProvider: ZodiosRuntimeTypeProvider, findEndpointErrors: (error: AxiosError) => ZodiosEndpointError[] | undefined ): boolean { if ( From 9ed497b7982ee06ebb8b9acaa4a89860f2ea2656 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Thu, 10 Nov 2022 17:10:29 +0100 Subject: [PATCH 006/206] feat(type-provider): add typescript type provider --- examples/typescript-types.ts | 62 +++++++++++++++++++++++++++++++++ src/type-provider.typescript.ts | 35 +++++++++++++++++++ 2 files changed, 97 insertions(+) create mode 100644 examples/typescript-types.ts create mode 100644 src/type-provider.typescript.ts diff --git a/examples/typescript-types.ts b/examples/typescript-types.ts new file mode 100644 index 00000000..001926ae --- /dev/null +++ b/examples/typescript-types.ts @@ -0,0 +1,62 @@ +import { Zodios, makeApi } from "../src/index"; +import { ApiOf, TypeProviderOf } from "../src/zodios"; +import { tsSchema, tsTypeProvider } from "../src/type-provider.typescript"; + +// you can also predefine your API +const jsonplaceholderUrl = "https://jsonplaceholder.typicode.com"; + +type User = { + id: number; + name: string; +}; + +const userSchema = tsSchema(); + +const usersSchema = tsSchema(); + +const jsonplaceholderApi = makeApi([ + { + method: "get", + path: "/users", + description: "Get all users", + parameters: [ + { + name: "q", + description: "full text search", + type: "Query", + schema: tsSchema(), + }, + { + name: "page", + description: "page number", + type: "Query", + schema: tsSchema(), + }, + ], + response: usersSchema, + }, + { + method: "get", + path: "/users/:id", + description: "Get a user", + response: userSchema, + }, +]); + +async function bootstrap() { + const apiClient = new Zodios(jsonplaceholderUrl, jsonplaceholderApi, { + typeProvider: tsTypeProvider, + }); + + type Api = ApiOf; + // ^? + type Provider = TypeProviderOf; + // ^? + const users = await apiClient.get("/users", { queries: { q: "Nicholas" } }); + // ^? + console.log(users); + const user = await apiClient.get("/users/:id", { params: { id: 7 } }); + // ^? +} + +bootstrap(); diff --git a/src/type-provider.typescript.ts b/src/type-provider.typescript.ts new file mode 100644 index 00000000..06afd492 --- /dev/null +++ b/src/type-provider.typescript.ts @@ -0,0 +1,35 @@ +import { + AnyZodiosTypeProvider, + ZodiosRuntimeTypeProvider, + ZodiosValidateResult, +} from "./type-provider.types"; + +/** + * A basic typescript schema provider + * @returns + */ +export const tsSchema = (): { + readonly _schema: Schema; + parse: (input: unknown) => ZodiosValidateResult; +} => { + return { + _schema: undefined as Schema, + parse: (data) => { + return { success: true, data }; + }, + }; +}; + +export interface TsTypeProvider extends AnyZodiosTypeProvider { + input: this["schema"] extends { _schema: unknown } + ? this["schema"]["_schema"] + : never; + output: this["schema"] extends { _schema: unknown } + ? this["schema"]["_schema"] + : never; +} + +export const tsTypeProvider: ZodiosRuntimeTypeProvider = { + validate: (schema, input) => schema.parse(input), + validateAsync: (schema, input) => schema.parse(input), +}; From ab35b4b3578fd5aa9c0af686ac3c14741daa2c2d Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Thu, 10 Nov 2022 17:28:01 +0100 Subject: [PATCH 007/206] feat(type-provider): improve ts perf and memory footprint --- examples/typescript-types.ts | 1 + src/index.ts | 2 ++ src/type-provider.typescript.ts | 17 +++++++++-------- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/examples/typescript-types.ts b/examples/typescript-types.ts index 001926ae..d1a5be51 100644 --- a/examples/typescript-types.ts +++ b/examples/typescript-types.ts @@ -57,6 +57,7 @@ async function bootstrap() { console.log(users); const user = await apiClient.get("/users/:id", { params: { id: 7 } }); // ^? + console.log(user); } bootstrap(); diff --git a/src/index.ts b/src/index.ts index 1802678e..210b5310 100644 --- a/src/index.ts +++ b/src/index.ts @@ -53,6 +53,8 @@ export type { ZodTypeProvider } from "./type-provider.zod"; export { zodTypeProvider } from "./type-provider.zod"; export type { IoTsTypeProvider } from "./type-provider.io-ts"; export { ioTsTypeProvider } from "./type-provider.io-ts"; +export type { TsTypeProvider } from "./type-provider.typescript"; +export { tsTypeProvider } from "./type-provider.typescript"; export { PluginId, zodValidationPlugin, diff --git a/src/type-provider.typescript.ts b/src/type-provider.typescript.ts index 06afd492..78cd664c 100644 --- a/src/type-provider.typescript.ts +++ b/src/type-provider.typescript.ts @@ -4,6 +4,14 @@ import { ZodiosValidateResult, } from "./type-provider.types"; +const parse = (data: unknown): ZodiosValidateResult => ({ + success: true, + data, +}); + +const genericTsSchema = { + parse, +}; /** * A basic typescript schema provider * @returns @@ -11,14 +19,7 @@ import { export const tsSchema = (): { readonly _schema: Schema; parse: (input: unknown) => ZodiosValidateResult; -} => { - return { - _schema: undefined as Schema, - parse: (data) => { - return { success: true, data }; - }, - }; -}; +} => genericTsSchema as any; export interface TsTypeProvider extends AnyZodiosTypeProvider { input: this["schema"] extends { _schema: unknown } From 2cfaebdd2e6cbedf733dca15a9c35e933f2c2e13 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Thu, 10 Nov 2022 17:32:54 +0100 Subject: [PATCH 008/206] refactor(type-provider): clean type definition for ts schemas --- src/type-provider.typescript.ts | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/type-provider.typescript.ts b/src/type-provider.typescript.ts index 78cd664c..bbbe14ac 100644 --- a/src/type-provider.typescript.ts +++ b/src/type-provider.typescript.ts @@ -4,22 +4,24 @@ import { ZodiosValidateResult, } from "./type-provider.types"; -const parse = (data: unknown): ZodiosValidateResult => ({ - success: true, - data, -}); - const genericTsSchema = { - parse, + parse: (data: unknown): ZodiosValidateResult => ({ + success: true, + data, + }), +}; + +type TsSchema = { + readonly _schema: Schema; + parse: (input: unknown) => ZodiosValidateResult; }; + /** * A basic typescript schema provider * @returns */ -export const tsSchema = (): { - readonly _schema: Schema; - parse: (input: unknown) => ZodiosValidateResult; -} => genericTsSchema as any; +export const tsSchema = (): TsSchema => + genericTsSchema as any; export interface TsTypeProvider extends AnyZodiosTypeProvider { input: this["schema"] extends { _schema: unknown } From ed0b64e1208b52af28ddef65b3fa7613a7e03f88 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Thu, 10 Nov 2022 17:43:58 +0100 Subject: [PATCH 009/206] refactor(type-provider): clean Generic Schema definition --- src/type-provider.typescript.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/type-provider.typescript.ts b/src/type-provider.typescript.ts index bbbe14ac..4a842339 100644 --- a/src/type-provider.typescript.ts +++ b/src/type-provider.typescript.ts @@ -20,8 +20,7 @@ type TsSchema = { * A basic typescript schema provider * @returns */ -export const tsSchema = (): TsSchema => - genericTsSchema as any; +export const tsSchema = (): TsSchema => genericTsSchema as any; export interface TsTypeProvider extends AnyZodiosTypeProvider { input: this["schema"] extends { _schema: unknown } From 45e7822272e3cbd28674b753090ed159c5ab0d9b Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Thu, 10 Nov 2022 19:46:11 +0100 Subject: [PATCH 010/206] feat(type-provider): export ts schema builder --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 210b5310..92e11b94 100644 --- a/src/index.ts +++ b/src/index.ts @@ -54,7 +54,7 @@ export { zodTypeProvider } from "./type-provider.zod"; export type { IoTsTypeProvider } from "./type-provider.io-ts"; export { ioTsTypeProvider } from "./type-provider.io-ts"; export type { TsTypeProvider } from "./type-provider.typescript"; -export { tsTypeProvider } from "./type-provider.typescript"; +export { tsTypeProvider, tsSchema } from "./type-provider.typescript"; export { PluginId, zodValidationPlugin, From 891bbf5234fbd56c610a8e4996a61064ffe2725b Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Thu, 10 Nov 2022 21:20:29 +0100 Subject: [PATCH 011/206] feat(type-provider): export type providers utils --- examples/io-ts-types.ts | 10 +++++++--- examples/typescript-types.ts | 3 +-- src/index.ts | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/examples/io-ts-types.ts b/examples/io-ts-types.ts index e66a1c64..8fbf732f 100644 --- a/examples/io-ts-types.ts +++ b/examples/io-ts-types.ts @@ -1,7 +1,11 @@ -import { Zodios, makeApi } from "../src/index"; +import { + Zodios, + makeApi, + ApiOf, + TypeProviderOf, + ioTsTypeProvider, +} from "../src/index"; import * as t from "io-ts"; -import { ApiOf, TypeProviderOf } from "../src/zodios"; -import { ioTsTypeProvider } from "../src/type-provider.io-ts"; // you can define schema before declaring the API to get back the type diff --git a/examples/typescript-types.ts b/examples/typescript-types.ts index d1a5be51..42804dae 100644 --- a/examples/typescript-types.ts +++ b/examples/typescript-types.ts @@ -1,6 +1,5 @@ import { Zodios, makeApi } from "../src/index"; -import { ApiOf, TypeProviderOf } from "../src/zodios"; -import { tsSchema, tsTypeProvider } from "../src/type-provider.typescript"; +import { ApiOf, TypeProviderOf, tsSchema, tsTypeProvider } from "../src/index"; // you can also predefine your API const jsonplaceholderUrl = "https://jsonplaceholder.typicode.com"; diff --git a/src/index.ts b/src/index.ts index 92e11b94..0aaeedb6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,5 @@ export { Zodios } from "./zodios"; -export type { ApiOf } from "./zodios"; +export type { ApiOf, TypeProviderOf } from "./zodios"; export type { ZodiosInstance, ZodiosClass, ZodiosConstructor } from "./zodios"; export { ZodiosError } from "./zodios-error"; export { isErrorFromPath, isErrorFromAlias } from "./zodios-error.utils"; From a18811ae07997e17801a66f3d1501bb2779f803c Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Thu, 10 Nov 2022 22:01:15 +0100 Subject: [PATCH 012/206] feat(type-provider): add fn validation schema --- examples/typescript-types.ts | 18 +++++++++++++++--- src/index.ts | 6 +++++- src/type-provider.typescript.ts | 32 ++++++++++++++++++++++++++++++-- 3 files changed, 50 insertions(+), 6 deletions(-) diff --git a/examples/typescript-types.ts b/examples/typescript-types.ts index 42804dae..14dfc4e0 100644 --- a/examples/typescript-types.ts +++ b/examples/typescript-types.ts @@ -1,5 +1,12 @@ -import { Zodios, makeApi } from "../src/index"; -import { ApiOf, TypeProviderOf, tsSchema, tsTypeProvider } from "../src/index"; +import { + Zodios, + makeApi, + tsFnSchema, + ApiOf, + TypeProviderOf, + tsSchema, + tsTypeProvider, +} from "../src/index"; // you can also predefine your API const jsonplaceholderUrl = "https://jsonplaceholder.typicode.com"; @@ -23,7 +30,12 @@ const jsonplaceholderApi = makeApi([ name: "q", description: "full text search", type: "Query", - schema: tsSchema(), + schema: tsFnSchema((data) => { + if (typeof data !== "string") { + throw new Error("not a string"); + } + return data; + }), }, { name: "page", diff --git a/src/index.ts b/src/index.ts index 0aaeedb6..16784e90 100644 --- a/src/index.ts +++ b/src/index.ts @@ -54,7 +54,11 @@ export { zodTypeProvider } from "./type-provider.zod"; export type { IoTsTypeProvider } from "./type-provider.io-ts"; export { ioTsTypeProvider } from "./type-provider.io-ts"; export type { TsTypeProvider } from "./type-provider.typescript"; -export { tsTypeProvider, tsSchema } from "./type-provider.typescript"; +export { + tsTypeProvider, + tsSchema, + tsFnSchema, +} from "./type-provider.typescript"; export { PluginId, zodValidationPlugin, diff --git a/src/type-provider.typescript.ts b/src/type-provider.typescript.ts index 4a842339..e649fadb 100644 --- a/src/type-provider.typescript.ts +++ b/src/type-provider.typescript.ts @@ -17,10 +17,34 @@ type TsSchema = { }; /** - * A basic typescript schema provider - * @returns + * A basic typescript schema provider that does not do any validation but provides type inference + * @returns - a schema that can be used with the `tsTypeProvider` */ export const tsSchema = (): TsSchema => genericTsSchema as any; +/** + * An advanced typescript schema provider where the schema is inferred from the + * output type of the throwing validation function + * @param throwingValidator - a function that throws if the input is invalid and returns the output type if the input is valid + * @returns - a schema that can be used with the `tsTypeProvider` + */ +export const tsFnSchema = ( + throwingValidator: (data: unknown) => Schema +): TsSchema => ({ + _schema: undefined as Schema, + parse: (data: unknown): ZodiosValidateResult => { + try { + return { + success: true, + data: throwingValidator(data), + }; + } catch (error) { + return { + success: false, + error, + }; + } + }, +}); export interface TsTypeProvider extends AnyZodiosTypeProvider { input: this["schema"] extends { _schema: unknown } @@ -31,6 +55,10 @@ export interface TsTypeProvider extends AnyZodiosTypeProvider { : never; } +/** + * A native typescript type provider + * to use with the `tsSchema` and `tsFnSchema` functions + */ export const tsTypeProvider: ZodiosRuntimeTypeProvider = { validate: (schema, input) => schema.parse(input), validateAsync: (schema, input) => schema.parse(input), From 7f019bcf83599709f8f0c61266fd3343eed66bdf Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Thu, 10 Nov 2022 22:32:10 +0100 Subject: [PATCH 013/206] 11.0.0-rc.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 1e5e1980..6627c75e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/core", "description": "Typescript API client with autocompletion and zod validations", - "version": "10.9.0", + "version": "11.0.0-rc.0", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", From e5c0ea6d9c71c95061f1cb6c5f1540c267d9b08e Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Fri, 11 Nov 2022 12:18:33 +0100 Subject: [PATCH 014/206] refactor(type-provider): move type providers to sub directory --- src/api.ts | 6 ++---- src/index.ts | 14 +++++++------- src/plugins/zod-validation.plugin.ts | 4 ++-- src/type-providers/index.ts | 4 ++++ src/{ => type-providers}/type-provider.io-ts.ts | 0 src/{ => type-providers}/type-provider.types.ts | 0 .../type-provider.typescript.ts | 0 src/{ => type-providers}/type-provider.zod.ts | 0 src/utils.ts | 4 ++-- src/zodios-error.ts | 4 ++-- src/zodios-error.utils.ts | 9 +++++---- src/zodios.ts | 11 +++++------ src/zodios.types.ts | 4 ++-- 13 files changed, 31 insertions(+), 29 deletions(-) create mode 100644 src/type-providers/index.ts rename src/{ => type-providers}/type-provider.io-ts.ts (100%) rename src/{ => type-providers}/type-provider.types.ts (100%) rename src/{ => type-providers}/type-provider.typescript.ts (100%) rename src/{ => type-providers}/type-provider.zod.ts (100%) diff --git a/src/api.ts b/src/api.ts index cbe21159..e65127f4 100644 --- a/src/api.ts +++ b/src/api.ts @@ -1,15 +1,13 @@ // disable type checking for this file as we need to defer type checking when using these utility types // indeed typescript seems to have a bug, where it tries to infer the type of an undecidable generic type // but when using the functions, types are inferred correctly -import { +import type { ZodiosEndpointDefinition, ZodiosEndpointParameter, ZodiosEndpointDefinitions, ZodiosEndpointError, } from "./zodios.types"; -import z, { ZodRawShape } from "zod"; -import { capitalize } from "./utils"; -import { Narrow, TupleFlat, UnionToTuple } from "./utils.types"; +import type { Narrow } from "./utils.types"; /** * check api for non unique paths diff --git a/src/index.ts b/src/index.ts index 16784e90..3d80412c 100644 --- a/src/index.ts +++ b/src/index.ts @@ -46,19 +46,19 @@ export type { AnyZodiosTypeProvider, InferInputTypeFromSchema, InferOutputTypeFromSchema, + IoTsTypeProvider, + TsTypeProvider, ZodiosRuntimeTypeProvider, ZodiosValidateResult, -} from "./type-provider.types"; -export type { ZodTypeProvider } from "./type-provider.zod"; -export { zodTypeProvider } from "./type-provider.zod"; -export type { IoTsTypeProvider } from "./type-provider.io-ts"; -export { ioTsTypeProvider } from "./type-provider.io-ts"; -export type { TsTypeProvider } from "./type-provider.typescript"; + ZodTypeProvider, +} from "./type-providers"; export { + ioTsTypeProvider, tsTypeProvider, + zodTypeProvider, tsSchema, tsFnSchema, -} from "./type-provider.typescript"; +} from "./type-providers"; export { PluginId, zodValidationPlugin, diff --git a/src/plugins/zod-validation.plugin.ts b/src/plugins/zod-validation.plugin.ts index 0389305a..93bddc26 100644 --- a/src/plugins/zod-validation.plugin.ts +++ b/src/plugins/zod-validation.plugin.ts @@ -1,7 +1,7 @@ +import { findEndpoint } from "../utils"; import { ZodiosError } from "../zodios-error"; +import type { AnyZodiosTypeProvider } from "../type-providers"; import type { ZodiosOptions, ZodiosPlugin } from "../zodios.types"; -import { findEndpoint } from "../utils"; -import type { AnyZodiosTypeProvider } from "../type-provider.types"; type Options = Required< Pick< diff --git a/src/type-providers/index.ts b/src/type-providers/index.ts new file mode 100644 index 00000000..d10fe1c0 --- /dev/null +++ b/src/type-providers/index.ts @@ -0,0 +1,4 @@ +export * from "./type-provider.types"; +export * from "./type-provider.zod"; +export * from "./type-provider.io-ts"; +export * from "./type-provider.typescript"; diff --git a/src/type-provider.io-ts.ts b/src/type-providers/type-provider.io-ts.ts similarity index 100% rename from src/type-provider.io-ts.ts rename to src/type-providers/type-provider.io-ts.ts diff --git a/src/type-provider.types.ts b/src/type-providers/type-provider.types.ts similarity index 100% rename from src/type-provider.types.ts rename to src/type-providers/type-provider.types.ts diff --git a/src/type-provider.typescript.ts b/src/type-providers/type-provider.typescript.ts similarity index 100% rename from src/type-provider.typescript.ts rename to src/type-providers/type-provider.typescript.ts diff --git a/src/type-provider.zod.ts b/src/type-providers/type-provider.zod.ts similarity index 100% rename from src/type-provider.zod.ts rename to src/type-providers/type-provider.zod.ts diff --git a/src/utils.ts b/src/utils.ts index 310fb1e3..7780caf6 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -1,6 +1,6 @@ import { AxiosError } from "axios"; -import { ReadonlyDeep } from "./utils.types"; -import { +import type { ReadonlyDeep } from "./utils.types"; +import type { AnyZodiosRequestOptions, ZodiosEndpointDefinition, ZodiosEndpointDefinitions, diff --git a/src/zodios-error.ts b/src/zodios-error.ts index 3741b535..71f0018a 100644 --- a/src/zodios-error.ts +++ b/src/zodios-error.ts @@ -1,5 +1,5 @@ -import { ReadonlyDeep } from "./utils.types"; -import { AnyZodiosRequestOptions } from "./zodios.types"; +import type { ReadonlyDeep } from "./utils.types"; +import type { AnyZodiosRequestOptions } from "./zodios.types"; /** * Custom Zodios Error with additional information diff --git a/src/zodios-error.utils.ts b/src/zodios-error.utils.ts index 1b10360d..bd0823ec 100644 --- a/src/zodios-error.utils.ts +++ b/src/zodios-error.utils.ts @@ -1,11 +1,12 @@ import { AxiosError } from "axios"; -import { +import type { AnyZodiosTypeProvider, ZodiosRuntimeTypeProvider, -} from "./type-provider.types"; -import { ZodTypeProvider, zodTypeProvider } from "./type-provider.zod"; + ZodTypeProvider, +} from "./type-providers"; +import { zodTypeProvider } from "./type-providers"; import { findEndpointErrorsByAlias, findEndpointErrorsByPath } from "./utils"; -import { +import type { Aliases, Method, ZodiosEndpointDefinitions, diff --git a/src/zodios.ts b/src/zodios.ts index a832d9e1..f5b57a7d 100644 --- a/src/zodios.ts +++ b/src/zodios.ts @@ -1,6 +1,6 @@ import axios from "axios"; -import type { AxiosInstance } from "axios"; -import { +import type { AxiosInstance, AxiosRequestConfig } from "axios"; +import type { AnyZodiosRequestOptions, ZodiosRequestOptions, ZodiosBodyByPath, @@ -23,7 +23,7 @@ import { formURLPlugin, headerPlugin, } from "./plugins"; -import { +import type { Narrow, PickRequired, ReadonlyDeep, @@ -31,9 +31,8 @@ import { UndefinedIfNever, } from "./utils.types"; import { checkApi } from "./api"; -import type { AnyZodiosTypeProvider } from "./type-provider.types"; -import type { ZodTypeProvider } from "./type-provider.zod"; -import { zodTypeProvider } from "./type-provider.zod"; +import type { AnyZodiosTypeProvider, ZodTypeProvider } from "./type-providers"; +import { zodTypeProvider } from "./type-providers"; /** * zodios api client based on axios */ diff --git a/src/zodios.types.ts b/src/zodios.types.ts index 9fe7294b..9fe8d047 100644 --- a/src/zodios.types.ts +++ b/src/zodios.types.ts @@ -24,8 +24,8 @@ import type { InferInputTypeFromSchema, InferOutputTypeFromSchema, ZodiosRuntimeTypeProvider, -} from "./type-provider.types"; -import type { ZodTypeProvider } from "./type-provider.zod"; + ZodTypeProvider, +} from "./type-providers"; type AxiosRequestConfig = Parameters[0]; From 0b1a5be6b9c9454e98d0336ce19c3b5fc8726290 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Fri, 11 Nov 2022 19:20:46 +0100 Subject: [PATCH 015/206] chore(monorepo): migrate to turborepo + pnpm --- .gitignore | 5 + examples/define-types.ts | 2 +- examples/dev.to/api-key-plugin.ts | 2 +- examples/dev.to/articles.ts | 2 +- examples/dev.to/comments.ts | 2 +- examples/dev.to/example.ts | 2 +- examples/dev.to/followers.ts | 2 +- examples/dev.to/follows.ts | 2 +- examples/dev.to/params.ts | 2 +- examples/dev.to/users.ts | 2 +- examples/io-ts-types.ts | 2 +- examples/jsonplaceholder.ts | 2 +- examples/types-from-definition.ts | 2 +- examples/typescript-types.ts | 2 +- package.json | 89 +- packages/core/.gitignore | 105 + .npmignore => packages/core/.npmignore | 0 packages/core/LICENSE | 21 + packages/core/README.md | 198 + packages/core/SECURITY.md | 20 + .../core/jest.config.ts | 0 packages/core/package.json | 84 + {src => packages/core/src}/api.test.ts | 0 {src => packages/core/src}/api.ts | 0 {src => packages/core/src}/index.ts | 0 .../core/src}/plugins/form-data.plugin.ts | 0 .../core/src}/plugins/form-data.utils.ts | 0 .../core/src}/plugins/form-url.plugin.ts | 0 .../core/src}/plugins/header.plugin.ts | 0 {src => packages/core/src}/plugins/index.ts | 0 .../plugins/zod-validation.plugin.test.ts | 2 +- .../src}/plugins/zod-validation.plugin.ts | 0 .../core/src}/plugins/zodios-plugins.test.ts | 0 .../core/src}/plugins/zodios-plugins.ts | 0 .../core/src}/type-providers/index.ts | 0 .../type-providers/type-provider.io-ts.ts | 0 .../type-providers/type-provider.types.ts | 0 .../type-provider.typescript.ts | 0 .../src}/type-providers/type-provider.zod.ts | 0 {src => packages/core/src}/utils.test.ts | 0 {src => packages/core/src}/utils.ts | 0 .../core/src}/utils.types.test.ts | 0 {src => packages/core/src}/utils.types.ts | 0 {src => packages/core/src}/zodios-error.ts | 0 .../core/src}/zodios-error.utils.ts | 0 {src => packages/core/src}/zodios.test.ts | 0 {src => packages/core/src}/zodios.ts | 0 {src => packages/core/src}/zodios.types.ts | 0 .../core/tsconfig.build.json | 0 tsconfig.json => packages/core/tsconfig.json | 4 +- .../core/tsup.config.js | 0 pnpm-lock.yaml | 3641 ++++++++++++++++ pnpm-workspace.yaml | 2 + turbo.json | 12 + yarn.lock | 3721 ----------------- 55 files changed, 4112 insertions(+), 3818 deletions(-) create mode 100644 packages/core/.gitignore rename .npmignore => packages/core/.npmignore (100%) create mode 100644 packages/core/LICENSE create mode 100644 packages/core/README.md create mode 100644 packages/core/SECURITY.md rename jest.config.ts => packages/core/jest.config.ts (100%) create mode 100644 packages/core/package.json rename {src => packages/core/src}/api.test.ts (100%) rename {src => packages/core/src}/api.ts (100%) rename {src => packages/core/src}/index.ts (100%) rename {src => packages/core/src}/plugins/form-data.plugin.ts (100%) rename {src => packages/core/src}/plugins/form-data.utils.ts (100%) rename {src => packages/core/src}/plugins/form-url.plugin.ts (100%) rename {src => packages/core/src}/plugins/header.plugin.ts (100%) rename {src => packages/core/src}/plugins/index.ts (100%) rename {src => packages/core/src}/plugins/zod-validation.plugin.test.ts (99%) rename {src => packages/core/src}/plugins/zod-validation.plugin.ts (100%) rename {src => packages/core/src}/plugins/zodios-plugins.test.ts (100%) rename {src => packages/core/src}/plugins/zodios-plugins.ts (100%) rename {src => packages/core/src}/type-providers/index.ts (100%) rename {src => packages/core/src}/type-providers/type-provider.io-ts.ts (100%) rename {src => packages/core/src}/type-providers/type-provider.types.ts (100%) rename {src => packages/core/src}/type-providers/type-provider.typescript.ts (100%) rename {src => packages/core/src}/type-providers/type-provider.zod.ts (100%) rename {src => packages/core/src}/utils.test.ts (100%) rename {src => packages/core/src}/utils.ts (100%) rename {src => packages/core/src}/utils.types.test.ts (100%) rename {src => packages/core/src}/utils.types.ts (100%) rename {src => packages/core/src}/zodios-error.ts (100%) rename {src => packages/core/src}/zodios-error.utils.ts (100%) rename {src => packages/core/src}/zodios.test.ts (100%) rename {src => packages/core/src}/zodios.ts (100%) rename {src => packages/core/src}/zodios.types.ts (100%) rename tsconfig.build.json => packages/core/tsconfig.build.json (100%) rename tsconfig.json => packages/core/tsconfig.json (86%) rename tsup.config.js => packages/core/tsup.config.js (100%) create mode 100644 pnpm-lock.yaml create mode 100644 pnpm-workspace.yaml create mode 100644 turbo.json delete mode 100644 yarn.lock diff --git a/.gitignore b/.gitignore index 325cfc22..0af2e3cc 100644 --- a/.gitignore +++ b/.gitignore @@ -106,3 +106,8 @@ lib # Developpement directory .devcontainer +# Turbo +.turbo + +# Output +lib/** diff --git a/examples/define-types.ts b/examples/define-types.ts index dfcf6e1e..d074e304 100644 --- a/examples/define-types.ts +++ b/examples/define-types.ts @@ -1,4 +1,4 @@ -import { Zodios, makeApi } from "../src/index"; +import { Zodios, makeApi } from "../packages/core/src/index"; import { z } from "zod"; // you can define schema before declaring the API to get back the type diff --git a/examples/dev.to/api-key-plugin.ts b/examples/dev.to/api-key-plugin.ts index 27bd9e43..2db2802e 100644 --- a/examples/dev.to/api-key-plugin.ts +++ b/examples/dev.to/api-key-plugin.ts @@ -1,6 +1,6 @@ import { AxiosRequestConfig } from "axios"; import { config } from "process"; -import { ZodiosPlugin } from "../../src/index"; +import { ZodiosPlugin } from "../../packages/core/src/index"; export interface ApiKeyPluginConfig { getApiKey: () => Promise; diff --git a/examples/dev.to/articles.ts b/examples/dev.to/articles.ts index 96714c78..91b804fc 100644 --- a/examples/dev.to/articles.ts +++ b/examples/dev.to/articles.ts @@ -1,4 +1,4 @@ -import { apiBuilder, makeApi } from "../../src/index"; +import { apiBuilder, makeApi } from "../../packages/core/src/index"; import { z } from "zod"; import { devUser } from "./users"; import { paramPages } from "./params"; diff --git a/examples/dev.to/comments.ts b/examples/dev.to/comments.ts index 7f749319..37158647 100644 --- a/examples/dev.to/comments.ts +++ b/examples/dev.to/comments.ts @@ -1,4 +1,4 @@ -import { makeApi, makeEndpoint } from "../../src/index"; +import { makeApi, makeEndpoint } from "../../packages/core/src/index"; import { z } from "zod"; import { devUser, User } from "./users"; diff --git a/examples/dev.to/example.ts b/examples/dev.to/example.ts index 4d8ad015..b33f1ba4 100644 --- a/examples/dev.to/example.ts +++ b/examples/dev.to/example.ts @@ -1,4 +1,4 @@ -import { Zodios } from "../../src/index"; +import { Zodios } from "../../packages/core/src/index"; import { articlesApi } from "./articles"; import { commentsApi } from "./comments"; import { followsApi } from "./follows"; diff --git a/examples/dev.to/followers.ts b/examples/dev.to/followers.ts index db9e7d5b..0268c6ee 100644 --- a/examples/dev.to/followers.ts +++ b/examples/dev.to/followers.ts @@ -1,5 +1,5 @@ import { z } from "zod"; -import { makeApi } from "../../src/index"; +import { makeApi } from "../../packages/core/src/index"; import { paramPages } from "./params"; const devFollower = z.object({ diff --git a/examples/dev.to/follows.ts b/examples/dev.to/follows.ts index 3aa7cae6..7e1907b5 100644 --- a/examples/dev.to/follows.ts +++ b/examples/dev.to/follows.ts @@ -1,5 +1,5 @@ import { z } from "zod"; -import { makeApi } from "../../src/index"; +import { makeApi } from "../../packages/core/src/index"; export const devFollow = z.object({ id: z.number(), diff --git a/examples/dev.to/params.ts b/examples/dev.to/params.ts index c07e5a80..b2e38ee4 100644 --- a/examples/dev.to/params.ts +++ b/examples/dev.to/params.ts @@ -1,5 +1,5 @@ import { z } from "zod"; -import { makeParameters } from "../../src/api"; +import { makeParameters } from "../../packages/core/src/api"; export const paramPages = makeParameters([ { diff --git a/examples/dev.to/users.ts b/examples/dev.to/users.ts index 1c74bc1b..5eb28108 100644 --- a/examples/dev.to/users.ts +++ b/examples/dev.to/users.ts @@ -1,5 +1,5 @@ import { z } from "zod"; -import { makeApi } from "../../src/index"; +import { makeApi } from "../../packages/core/src/index"; export const devUser = z.object({ id: z.number(), diff --git a/examples/io-ts-types.ts b/examples/io-ts-types.ts index 8fbf732f..ed0445c4 100644 --- a/examples/io-ts-types.ts +++ b/examples/io-ts-types.ts @@ -4,7 +4,7 @@ import { ApiOf, TypeProviderOf, ioTsTypeProvider, -} from "../src/index"; +} from "../packages/core/src/index"; import * as t from "io-ts"; // you can define schema before declaring the API to get back the type diff --git a/examples/jsonplaceholder.ts b/examples/jsonplaceholder.ts index d4d08b20..8b7e84d1 100644 --- a/examples/jsonplaceholder.ts +++ b/examples/jsonplaceholder.ts @@ -3,7 +3,7 @@ import { ZodiosResponseByAlias, ZodiosHeaderParamsByAlias, Zodios, -} from "../src/index"; +} from "../packages/core/src/index"; import { z } from "zod"; async function bootstrap() { diff --git a/examples/types-from-definition.ts b/examples/types-from-definition.ts index bc25cf30..e5c0a47d 100644 --- a/examples/types-from-definition.ts +++ b/examples/types-from-definition.ts @@ -6,7 +6,7 @@ import { makeApi, ZodiosPathParamByAlias, makeErrors, -} from "../src/index"; +} from "../packages/core/src/index"; import z from "zod"; const user = z.object({ diff --git a/examples/typescript-types.ts b/examples/typescript-types.ts index 14dfc4e0..f05e3680 100644 --- a/examples/typescript-types.ts +++ b/examples/typescript-types.ts @@ -6,7 +6,7 @@ import { TypeProviderOf, tsSchema, tsTypeProvider, -} from "../src/index"; +} from "../packages/core/src/index"; // you can also predefine your API const jsonplaceholderUrl = "https://jsonplaceholder.typicode.com"; diff --git a/package.json b/package.json index 6627c75e..8d965498 100644 --- a/package.json +++ b/package.json @@ -1,87 +1,14 @@ { - "name": "@zodios/core", - "description": "Typescript API client with autocompletion and zod validations", + "name": "zodios", "version": "11.0.0-rc.0", - "main": "lib/index.js", - "module": "lib/index.mjs", - "typings": "lib/index.d.ts", - "exports": { - ".": { - "import": "./lib/index.mjs", - "require": "./lib/index.js", - "types": "./lib/index.d.ts" - }, - "./lib/*.types": { - "import": "./lib/*.types.mjs", - "require": "./lib/*.types.js", - "types": "./lib/*.types.d.ts" - }, - "./package.json": "./package.json" - }, - "files": [ - "lib" - ], - "author": { - "name": "ecyrbe", - "email": "ecyrbe@gmail.com" - }, - "homepage": "https://github.com/ecyrbe/zodios", - "repository": { - "type": "git", - "url": "https://github.com/ecyrbe/zodios.git" - }, - "license": "MIT", - "keywords": [ - "axios", - "openapi", - "zod", - "autocomplete", - "validation" - ], "scripts": { - "prebuild": "rimraf lib", - "example": "ts-node examples/jsonplaceholder.ts", - "example:dev.to": "ts-node examples/dev.to/example.ts", - "major-rc": "npm version premajor --preid=rc", - "minor-rc": "npm version preminor --preid=rc", - "patch-rc": "npm version prepatch --preid=rc", - "rc": "npm version prerelease --preid=rc", - "build": "tsup", - "test": "jest --coverage" - }, - "peerDependencies": { - "axios": "^0.x || ^1.0.0", - "zod": "^3.x", - "fp-ts": "2.x", - "io-ts": "2.x" - }, - "peerDependenciesMeta": { - "zod": { - "optional": true - }, - "fp-ts": { - "optional": true - }, - "io-ts": { - "optional": true - } + "build": "turbo run build", + "test": "turbo run test", + "dev": "turbo run dev", + "lint": "turbo run lint" }, + "private": true, "devDependencies": { - "@jest/types": "29.5.0", - "@types/express": "4.17.17", - "@types/jest": "29.5.0", - "@types/multer": "1.4.7", - "@types/node": "18.15.11", - "axios": "1.3.5", - "express": "4.18.2", - "form-data": "4.0.0", - "jest": "29.5.0", - "multer": "1.4.5-lts.1", - "rimraf": "5.0.0", - "ts-jest": "29.1.0", - "ts-node": "10.9.1", - "tsup": "6.3.0", - "typescript": "5.0.4", - "zod": "3.21.4" + "turbo": "1.6.3" } -} \ No newline at end of file +} diff --git a/packages/core/.gitignore b/packages/core/.gitignore new file mode 100644 index 00000000..9aadc156 --- /dev/null +++ b/packages/core/.gitignore @@ -0,0 +1,105 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env +.env.test + +# parcel-bundler cache (https://parceljs.org/) +.cache + +# Next.js build output +.next + +# Nuxt.js build / generate output +.nuxt +dist +lib + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and *not* Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port diff --git a/.npmignore b/packages/core/.npmignore similarity index 100% rename from .npmignore rename to packages/core/.npmignore diff --git a/packages/core/LICENSE b/packages/core/LICENSE new file mode 100644 index 00000000..e5dea986 --- /dev/null +++ b/packages/core/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 ecyrbe + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/core/README.md b/packages/core/README.md new file mode 100644 index 00000000..31105cd4 --- /dev/null +++ b/packages/core/README.md @@ -0,0 +1,198 @@ +

Zodios

+

+ + Zodios logo + +

+

+ Zodios is a typescript api client and an optional api server with auto-completion features backed by axios and zod and express +
+ Documentation +

+ +

+ + langue typescript + + + npm + + + GitHub + + GitHub Workflow Status +

+ +https://user-images.githubusercontent.com/633115/185851987-554f5686-cb78-4096-8ff5-c8d61b645608.mp4 + +# What is it ? + +It's an axios compatible API client and an optional expressJS compatible API server with the following features: + +- really simple centralized API declaration +- typescript autocompletion in your favorite IDE for URL and parameters +- typescript response types +- parameters and responses schema thanks to zod +- response schema validation +- powerfull plugins like `fetch` adapter or `auth` automatic injection +- all axios features available +- `@tanstack/query` wrappers for react and solid (vue, svelte, etc, soon) +- all expressJS features available (middlewares, etc.) + + +**Table of contents:** + +- [What is it ?](#what-is-it-) +- [Install](#install) + - [Client and api definitions :](#client-and-api-definitions-) + - [Server :](#server-) +- [How to use it on client side ?](#how-to-use-it-on-client-side-) + - [Declare your API with zodios](#declare-your-api-with-zodios) + - [API definition format](#api-definition-format) +- [Full documentation](#full-documentation) +- [Ecosystem](#ecosystem) +- [Roadmap](#roadmap) +- [Dependencies](#dependencies) + +# Install + +## Client and api definitions : + +```bash +> npm install @zodios/core +``` + +or + +```bash +> yarn add @zodios/core +``` + +## Server : + +```bash +> npm install @zodios/core @zodios/express +``` + +or + +```bash +> yarn add @zodios/core @zodios/express +``` + +# How to use it on client side ? + +For an almost complete example on how to use zodios and how to split your APIs declarations, take a look at [dev.to](examples/dev.to/) example. + +## Declare your API with zodios + +Here is an example of API declaration with Zodios. + +```typescript +import { Zodios } from "@zodios/core"; +import { z } from "zod"; + +const apiClient = new Zodios( + "https://jsonplaceholder.typicode.com", + // API definition + [ + { + method: "get", + path: "/users/:id", // auto detect :id and ask for it in apiClient get params + alias: "getUser", // optionnal alias to call this endpoint with it + description: "Get a user", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], +); +``` + +Calling this API is now easy and has builtin autocomplete features : + +```typescript +// typed auto-complete path auto-complete params +// â–¼ â–¼ â–¼ +const user = await apiClient.get("/users/:id", { params: { id: 7 } }); +console.log(user); +``` + +It should output + +```js +{ id: 7, name: 'Kurtis Weissnat' } +``` +You can also use aliases : + +```typescript +// typed alias auto-complete params +// â–¼ â–¼ â–¼ +const user = await apiClient.getUser({ params: { id: 7 } }); +console.log(user); +``` +## API definition format + +```typescript +type ZodiosEndpointDescriptions = Array<{ + method: 'get'|'post'|'put'|'patch'|'delete'; + path: string; // example: /posts/:postId/comments/:commentId + alias?: string; // example: getPostComments + immutable?: boolean; // flag a post request as immutable to allow it to be cached with react-query + description?: string; + requestFormat?: 'json'|'form-data'|'form-url'|'binary'|'text'; // default to json if not set + parameters?: Array<{ + name: string; + description?: string; + type: 'Path'|'Query'|'Body'|'Header'; + schema: ZodSchema; // you can use zod `transform` to transform the value of the parameter before sending it to the server + }>; + response: ZodSchema; // you can use zod `transform` to transform the value of the response before returning it + status?: number; // default to 200, you can use this to override the sucess status code of the response (only usefull for openapi and express) + responseDescription?: string; // optional response description of the endpoint + errors?: Array<{ + status: number | 'default'; + description?: string; + schema: ZodSchema; // transformations are not supported on error schemas + }>; +}>; +``` +# Full documentation + +Check out the [full documentation](https://www.zodios.org) or following shortcuts. + +- [API definition](https://www.zodios.org/docs/category/zodios-api-definition) +- [Http client](https://www.zodios.org/docs/category/zodios-client) +- [React hooks](https://www.zodios.org/docs/client/react) +- [Solid hooks](https://www.zodios.org/docs/client/solid) +- [API server](http://www.zodios.org/docs/category/zodios-server) +- [Nextjs integration](http://www.zodios.org/docs/server/next) + +# Ecosystem + +- [openapi-zod-client](https://github.com/astahmer/openapi-zod-client): generate a zodios client from an openapi specification +- [@zodios/express](https://github.com/ecyrbe/zodios-express): full end to end type safety like tRPC, but for REST APIs +- [@zodios/plugins](https://github.com/ecyrbe/zodios-plugins) : some plugins for zodios +- [@zodios/react](https://github.com/ecyrbe/zodios-react) : a react-query wrapper for zodios +- [@zodios/solid](https://github.com/ecyrbe/zodios-solid) : a solid-query wrapper for zodios + +# Roadmap + +The following will need investigation to check if it's doable : +- implement `@zodios/nestjs` to define your API endpoints with nestjs and share it with your frontend (like tRPC) +- generate openAPI json from your API endpoints + +You have other ideas ? [Let me know !](https://github.com/ecyrbe/zodios/discussions) +# Dependencies + +Zodios even when working in pure Javascript is better suited to be working with Typescript Language Server to handle autocompletion. +So you should at least use the one provided by your IDE (vscode integrates a typescript language server) +However, we will only support fixing bugs related to typings for versions of Typescript Language v4.5 +Earlier versions should work, but do not have TS tail recusion optimisation that impact the size of the API you can declare. + +Also note that Zodios do not embed any dependency. It's your Job to install the peer dependencies you need. + +Internally Zodios uses these libraries on all platforms : +- zod +- axios diff --git a/packages/core/SECURITY.md b/packages/core/SECURITY.md new file mode 100644 index 00000000..16be6051 --- /dev/null +++ b/packages/core/SECURITY.md @@ -0,0 +1,20 @@ +# Security Policy + +## Supported Versions + +Use this section to tell people about which versions of your project are +currently being supported with security updates. + +| Version | Supported | +| --------- | ------------------ | +| 10.x.y | :white_check_mark: | +| < 10.0.0 | :x: | + +## Reporting a Vulnerability + +If you identify a vulnerability on zodios, please create an issue with a reproductible setup. +Do not open an issue if you can't show a reproductible setup of if the vulnerability is on third party dependency. + +Indeed, a vulnerability on a peer dependency should be reported on the appropriate project: +- zod +- axios diff --git a/jest.config.ts b/packages/core/jest.config.ts similarity index 100% rename from jest.config.ts rename to packages/core/jest.config.ts diff --git a/packages/core/package.json b/packages/core/package.json new file mode 100644 index 00000000..7a63e547 --- /dev/null +++ b/packages/core/package.json @@ -0,0 +1,84 @@ +{ + "name": "@zodios/core", + "description": "Typescript API client with autocompletion and zod validations", + "version": "11.0.0-rc.0", + "main": "lib/index.js", + "module": "lib/index.mjs", + "typings": "lib/index.d.ts", + "exports": { + ".": { + "import": "./lib/index.mjs", + "require": "./lib/index.js" + }, + "./package.json": "./package.json" + }, + "files": [ + "lib" + ], + "author": { + "name": "ecyrbe", + "email": "ecyrbe@gmail.com" + }, + "homepage": "https://github.com/ecyrbe/zodios", + "repository": { + "type": "git", + "url": "https://github.com/ecyrbe/zodios.git" + }, + "license": "MIT", + "keywords": [ + "axios", + "openapi", + "zod", + "autocomplete", + "validation" + ], + "scripts": { + "prebuild": "rimraf lib", + "example": "ts-node examples/jsonplaceholder.ts", + "example:dev.to": "ts-node examples/dev.to/example.ts", + "major-rc": "npm version premajor --preid=rc", + "minor-rc": "npm version preminor --preid=rc", + "patch-rc": "npm version prepatch --preid=rc", + "rc": "npm version prerelease --preid=rc", + "build": "tsup", + "test": "jest --coverage" + }, + "peerDependencies": { + "axios": "^0.x || ^1.0.0", + "zod": "^3.x", + "fp-ts": "2.x", + "io-ts": "2.x" + }, + "peerDependenciesMeta": { + "zod": { + "optional": true + }, + "fp-ts": { + "optional": true + }, + "io-ts": { + "optional": true + } + }, + "devDependencies": { + "@jest/globals": "29.3.1", + "@jest/types": "29.3.1", + "@types/express": "4.17.14", + "@types/jest": "29.2.2", + "@types/multer": "1.4.7", + "@types/node": "18.11.9", + "axios": "1.1.3", + "express": "4.18.2", + "fp-ts": "2.13.1", + "io-ts": "2.2.19", + "jest": "29.3.0", + "multer": "1.4.5-lts.1", + "rimraf": "3.0.2", + "ts-jest": "29.0.3", + "ts-node": "10.9.1", + "tsup": "6.3.0", + "typescript": "4.8.4", + "zod": "3.19.1" + }, + "dependencies": {} +} diff --git a/src/api.test.ts b/packages/core/src/api.test.ts similarity index 100% rename from src/api.test.ts rename to packages/core/src/api.test.ts diff --git a/src/api.ts b/packages/core/src/api.ts similarity index 100% rename from src/api.ts rename to packages/core/src/api.ts diff --git a/src/index.ts b/packages/core/src/index.ts similarity index 100% rename from src/index.ts rename to packages/core/src/index.ts diff --git a/src/plugins/form-data.plugin.ts b/packages/core/src/plugins/form-data.plugin.ts similarity index 100% rename from src/plugins/form-data.plugin.ts rename to packages/core/src/plugins/form-data.plugin.ts diff --git a/src/plugins/form-data.utils.ts b/packages/core/src/plugins/form-data.utils.ts similarity index 100% rename from src/plugins/form-data.utils.ts rename to packages/core/src/plugins/form-data.utils.ts diff --git a/src/plugins/form-url.plugin.ts b/packages/core/src/plugins/form-url.plugin.ts similarity index 100% rename from src/plugins/form-url.plugin.ts rename to packages/core/src/plugins/form-url.plugin.ts diff --git a/src/plugins/header.plugin.ts b/packages/core/src/plugins/header.plugin.ts similarity index 100% rename from src/plugins/header.plugin.ts rename to packages/core/src/plugins/header.plugin.ts diff --git a/src/plugins/index.ts b/packages/core/src/plugins/index.ts similarity index 100% rename from src/plugins/index.ts rename to packages/core/src/plugins/index.ts diff --git a/src/plugins/zod-validation.plugin.test.ts b/packages/core/src/plugins/zod-validation.plugin.test.ts similarity index 99% rename from src/plugins/zod-validation.plugin.test.ts rename to packages/core/src/plugins/zod-validation.plugin.test.ts index f313586a..43425afd 100644 --- a/src/plugins/zod-validation.plugin.test.ts +++ b/packages/core/src/plugins/zod-validation.plugin.test.ts @@ -4,7 +4,7 @@ import { apiBuilder } from "../api"; import { ReadonlyDeep } from "../utils.types"; import { AnyZodiosRequestOptions } from "../zodios.types"; import { zodValidationPlugin } from "./zod-validation.plugin"; -import { zodTypeProvider } from "../type-provider.zod"; +import { zodTypeProvider } from "../type-providers"; describe("zodValidationPlugin", () => { const plugin = zodValidationPlugin({ diff --git a/src/plugins/zod-validation.plugin.ts b/packages/core/src/plugins/zod-validation.plugin.ts similarity index 100% rename from src/plugins/zod-validation.plugin.ts rename to packages/core/src/plugins/zod-validation.plugin.ts diff --git a/src/plugins/zodios-plugins.test.ts b/packages/core/src/plugins/zodios-plugins.test.ts similarity index 100% rename from src/plugins/zodios-plugins.test.ts rename to packages/core/src/plugins/zodios-plugins.test.ts diff --git a/src/plugins/zodios-plugins.ts b/packages/core/src/plugins/zodios-plugins.ts similarity index 100% rename from src/plugins/zodios-plugins.ts rename to packages/core/src/plugins/zodios-plugins.ts diff --git a/src/type-providers/index.ts b/packages/core/src/type-providers/index.ts similarity index 100% rename from src/type-providers/index.ts rename to packages/core/src/type-providers/index.ts diff --git a/src/type-providers/type-provider.io-ts.ts b/packages/core/src/type-providers/type-provider.io-ts.ts similarity index 100% rename from src/type-providers/type-provider.io-ts.ts rename to packages/core/src/type-providers/type-provider.io-ts.ts diff --git a/src/type-providers/type-provider.types.ts b/packages/core/src/type-providers/type-provider.types.ts similarity index 100% rename from src/type-providers/type-provider.types.ts rename to packages/core/src/type-providers/type-provider.types.ts diff --git a/src/type-providers/type-provider.typescript.ts b/packages/core/src/type-providers/type-provider.typescript.ts similarity index 100% rename from src/type-providers/type-provider.typescript.ts rename to packages/core/src/type-providers/type-provider.typescript.ts diff --git a/src/type-providers/type-provider.zod.ts b/packages/core/src/type-providers/type-provider.zod.ts similarity index 100% rename from src/type-providers/type-provider.zod.ts rename to packages/core/src/type-providers/type-provider.zod.ts diff --git a/src/utils.test.ts b/packages/core/src/utils.test.ts similarity index 100% rename from src/utils.test.ts rename to packages/core/src/utils.test.ts diff --git a/src/utils.ts b/packages/core/src/utils.ts similarity index 100% rename from src/utils.ts rename to packages/core/src/utils.ts diff --git a/src/utils.types.test.ts b/packages/core/src/utils.types.test.ts similarity index 100% rename from src/utils.types.test.ts rename to packages/core/src/utils.types.test.ts diff --git a/src/utils.types.ts b/packages/core/src/utils.types.ts similarity index 100% rename from src/utils.types.ts rename to packages/core/src/utils.types.ts diff --git a/src/zodios-error.ts b/packages/core/src/zodios-error.ts similarity index 100% rename from src/zodios-error.ts rename to packages/core/src/zodios-error.ts diff --git a/src/zodios-error.utils.ts b/packages/core/src/zodios-error.utils.ts similarity index 100% rename from src/zodios-error.utils.ts rename to packages/core/src/zodios-error.utils.ts diff --git a/src/zodios.test.ts b/packages/core/src/zodios.test.ts similarity index 100% rename from src/zodios.test.ts rename to packages/core/src/zodios.test.ts diff --git a/src/zodios.ts b/packages/core/src/zodios.ts similarity index 100% rename from src/zodios.ts rename to packages/core/src/zodios.ts diff --git a/src/zodios.types.ts b/packages/core/src/zodios.types.ts similarity index 100% rename from src/zodios.types.ts rename to packages/core/src/zodios.types.ts diff --git a/tsconfig.build.json b/packages/core/tsconfig.build.json similarity index 100% rename from tsconfig.build.json rename to packages/core/tsconfig.build.json diff --git a/tsconfig.json b/packages/core/tsconfig.json similarity index 86% rename from tsconfig.json rename to packages/core/tsconfig.json index 928afa0b..4f66f56f 100644 --- a/tsconfig.json +++ b/packages/core/tsconfig.json @@ -11,8 +11,8 @@ "esModuleInterop": true, "sourceMap": true, "declaration": true, - "noErrorTruncation": true, - "jsx": "react-jsx" + "jsx": "react-jsx", + "types": ["jest", "node"] }, "exclude": ["node_modules", "lib"] } diff --git a/tsup.config.js b/packages/core/tsup.config.js similarity index 100% rename from tsup.config.js rename to packages/core/tsup.config.js diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 00000000..c9a7f4d6 --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,3641 @@ +lockfileVersion: 5.4 + +importers: + + .: + specifiers: + turbo: 1.6.3 + devDependencies: + turbo: 1.6.3 + + packages/core: + specifiers: + '@jest/globals': 29.3.1 + '@jest/types': 29.3.1 + '@types/express': 4.17.14 + '@types/jest': 29.2.2 + '@types/multer': 1.4.7 + '@types/node': 18.11.9 + axios: 1.1.3 + express: 4.18.2 + fp-ts: 2.13.1 + io-ts: 2.2.19 + jest: 29.3.0 + multer: 1.4.5-lts.1 + rimraf: 3.0.2 + ts-jest: 29.0.3 + ts-node: 10.9.1 + tsup: 6.3.0 + typescript: 4.8.4 + zod: 3.19.1 + devDependencies: + '@jest/globals': 29.3.1 + '@jest/types': 29.3.1 + '@types/express': 4.17.14 + '@types/jest': 29.2.2 + '@types/multer': 1.4.7 + '@types/node': 18.11.9 + axios: 1.1.3 + express: 4.18.2 + fp-ts: 2.13.1 + io-ts: 2.2.19_fp-ts@2.13.1 + jest: 29.3.0_odkjkoia5xunhxkdrka32ib6vi + multer: 1.4.5-lts.1 + rimraf: 3.0.2 + ts-jest: 29.0.3_zni4oow62srprqrjg644purjpe + ts-node: 10.9.1_cbe7ovvae6zqfnmtgctpgpys54 + tsup: 6.3.0_mwhvu7sfp6vq5ryuwb6hlbjfka + typescript: 4.8.4 + zod: 3.19.1 + +packages: + + /@ampproject/remapping/2.2.0: + resolution: {integrity: sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w==} + engines: {node: '>=6.0.0'} + dependencies: + '@jridgewell/gen-mapping': 0.1.1 + '@jridgewell/trace-mapping': 0.3.17 + dev: true + + /@babel/code-frame/7.18.6: + resolution: {integrity: sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/highlight': 7.18.6 + dev: true + + /@babel/compat-data/7.20.1: + resolution: {integrity: sha512-EWZ4mE2diW3QALKvDMiXnbZpRvlj+nayZ112nK93SnhqOtpdsbVD4W+2tEoT3YNBAG9RBR0ISY758ZkOgsn6pQ==} + engines: {node: '>=6.9.0'} + dev: true + + /@babel/core/7.20.2: + resolution: {integrity: sha512-w7DbG8DtMrJcFOi4VrLm+8QM4az8Mo+PuLBKLp2zrYRCow8W/f9xiXm5sN53C8HksCyDQwCKha9JiDoIyPjT2g==} + engines: {node: '>=6.9.0'} + dependencies: + '@ampproject/remapping': 2.2.0 + '@babel/code-frame': 7.18.6 + '@babel/generator': 7.20.4 + '@babel/helper-compilation-targets': 7.20.0_@babel+core@7.20.2 + '@babel/helper-module-transforms': 7.20.2 + '@babel/helpers': 7.20.1 + '@babel/parser': 7.20.3 + '@babel/template': 7.18.10 + '@babel/traverse': 7.20.1 + '@babel/types': 7.20.2 + convert-source-map: 1.9.0 + debug: 4.3.4 + gensync: 1.0.0-beta.2 + json5: 2.2.1 + semver: 6.3.0 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/generator/7.20.4: + resolution: {integrity: sha512-luCf7yk/cm7yab6CAW1aiFnmEfBJplb/JojV56MYEK7ziWfGmFlTfmL9Ehwfy4gFhbjBfWO1wj7/TuSbVNEEtA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.20.2 + '@jridgewell/gen-mapping': 0.3.2 + jsesc: 2.5.2 + dev: true + + /@babel/helper-compilation-targets/7.20.0_@babel+core@7.20.2: + resolution: {integrity: sha512-0jp//vDGp9e8hZzBc6N/KwA5ZK3Wsm/pfm4CrY7vzegkVxc65SgSn6wYOnwHe9Js9HRQ1YTCKLGPzDtaS3RoLQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/compat-data': 7.20.1 + '@babel/core': 7.20.2 + '@babel/helper-validator-option': 7.18.6 + browserslist: 4.21.4 + semver: 6.3.0 + dev: true + + /@babel/helper-environment-visitor/7.18.9: + resolution: {integrity: sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==} + engines: {node: '>=6.9.0'} + dev: true + + /@babel/helper-function-name/7.19.0: + resolution: {integrity: sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/template': 7.18.10 + '@babel/types': 7.20.2 + dev: true + + /@babel/helper-hoist-variables/7.18.6: + resolution: {integrity: sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.20.2 + dev: true + + /@babel/helper-module-imports/7.18.6: + resolution: {integrity: sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.20.2 + dev: true + + /@babel/helper-module-transforms/7.20.2: + resolution: {integrity: sha512-zvBKyJXRbmK07XhMuujYoJ48B5yvvmM6+wcpv6Ivj4Yg6qO7NOZOSnvZN9CRl1zz1Z4cKf8YejmCMh8clOoOeA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-environment-visitor': 7.18.9 + '@babel/helper-module-imports': 7.18.6 + '@babel/helper-simple-access': 7.20.2 + '@babel/helper-split-export-declaration': 7.18.6 + '@babel/helper-validator-identifier': 7.19.1 + '@babel/template': 7.18.10 + '@babel/traverse': 7.20.1 + '@babel/types': 7.20.2 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/helper-plugin-utils/7.20.2: + resolution: {integrity: sha512-8RvlJG2mj4huQ4pZ+rU9lqKi9ZKiRmuvGuM2HlWmkmgOhbs6zEAw6IEiJ5cQqGbDzGZOhwuOQNtZMi/ENLjZoQ==} + engines: {node: '>=6.9.0'} + dev: true + + /@babel/helper-simple-access/7.20.2: + resolution: {integrity: sha512-+0woI/WPq59IrqDYbVGfshjT5Dmk/nnbdpcF8SnMhhXObpTq2KNBdLFRFrkVdbDOyUmHBCxzm5FHV1rACIkIbA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.20.2 + dev: true + + /@babel/helper-split-export-declaration/7.18.6: + resolution: {integrity: sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.20.2 + dev: true + + /@babel/helper-string-parser/7.19.4: + resolution: {integrity: sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==} + engines: {node: '>=6.9.0'} + dev: true + + /@babel/helper-validator-identifier/7.19.1: + resolution: {integrity: sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==} + engines: {node: '>=6.9.0'} + dev: true + + /@babel/helper-validator-option/7.18.6: + resolution: {integrity: sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw==} + engines: {node: '>=6.9.0'} + dev: true + + /@babel/helpers/7.20.1: + resolution: {integrity: sha512-J77mUVaDTUJFZ5BpP6mMn6OIl3rEWymk2ZxDBQJUG3P+PbmyMcF3bYWvz0ma69Af1oobDqT/iAsvzhB58xhQUg==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/template': 7.18.10 + '@babel/traverse': 7.20.1 + '@babel/types': 7.20.2 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/highlight/7.18.6: + resolution: {integrity: sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-validator-identifier': 7.19.1 + chalk: 2.4.2 + js-tokens: 4.0.0 + dev: true + + /@babel/parser/7.20.3: + resolution: {integrity: sha512-OP/s5a94frIPXwjzEcv5S/tpQfc6XhxYUnmWpgdqMWGgYCuErA3SzozaRAMQgSZWKeTJxht9aWAkUY+0UzvOFg==} + engines: {node: '>=6.0.0'} + hasBin: true + dependencies: + '@babel/types': 7.20.2 + dev: true + + /@babel/plugin-syntax-async-generators/7.8.4_@babel+core@7.20.2: + resolution: {integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.20.2 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-bigint/7.8.3_@babel+core@7.20.2: + resolution: {integrity: sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.20.2 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-class-properties/7.12.13_@babel+core@7.20.2: + resolution: {integrity: sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.20.2 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-import-meta/7.10.4_@babel+core@7.20.2: + resolution: {integrity: sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.20.2 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-json-strings/7.8.3_@babel+core@7.20.2: + resolution: {integrity: sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.20.2 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-jsx/7.18.6_@babel+core@7.20.2: + resolution: {integrity: sha512-6mmljtAedFGTWu2p/8WIORGwy+61PLgOMPOdazc7YoJ9ZCWUyFy3A6CpPkRKLKD1ToAesxX8KGEViAiLo9N+7Q==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.20.2 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-logical-assignment-operators/7.10.4_@babel+core@7.20.2: + resolution: {integrity: sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.20.2 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-nullish-coalescing-operator/7.8.3_@babel+core@7.20.2: + resolution: {integrity: sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.20.2 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-numeric-separator/7.10.4_@babel+core@7.20.2: + resolution: {integrity: sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.20.2 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-object-rest-spread/7.8.3_@babel+core@7.20.2: + resolution: {integrity: sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.20.2 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-optional-catch-binding/7.8.3_@babel+core@7.20.2: + resolution: {integrity: sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.20.2 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-optional-chaining/7.8.3_@babel+core@7.20.2: + resolution: {integrity: sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.20.2 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-top-level-await/7.14.5_@babel+core@7.20.2: + resolution: {integrity: sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.20.2 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/plugin-syntax-typescript/7.20.0_@babel+core@7.20.2: + resolution: {integrity: sha512-rd9TkG+u1CExzS4SM1BlMEhMXwFLKVjOAFFCDx9PbX5ycJWDoWMcwdJH9RhkPu1dOgn5TrxLot/Gx6lWFuAUNQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0-0 + dependencies: + '@babel/core': 7.20.2 + '@babel/helper-plugin-utils': 7.20.2 + dev: true + + /@babel/template/7.18.10: + resolution: {integrity: sha512-TI+rCtooWHr3QJ27kJxfjutghu44DLnasDMwpDqCXVTal9RLp3RSYNh4NdBrRP2cQAoG9A8juOQl6P6oZG4JxA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/code-frame': 7.18.6 + '@babel/parser': 7.20.3 + '@babel/types': 7.20.2 + dev: true + + /@babel/traverse/7.20.1: + resolution: {integrity: sha512-d3tN8fkVJwFLkHkBN479SOsw4DMZnz8cdbL/gvuDuzy3TS6Nfw80HuQqhw1pITbIruHyh7d1fMA47kWzmcUEGA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/code-frame': 7.18.6 + '@babel/generator': 7.20.4 + '@babel/helper-environment-visitor': 7.18.9 + '@babel/helper-function-name': 7.19.0 + '@babel/helper-hoist-variables': 7.18.6 + '@babel/helper-split-export-declaration': 7.18.6 + '@babel/parser': 7.20.3 + '@babel/types': 7.20.2 + debug: 4.3.4 + globals: 11.12.0 + transitivePeerDependencies: + - supports-color + dev: true + + /@babel/types/7.20.2: + resolution: {integrity: sha512-FnnvsNWgZCr232sqtXggapvlkk/tuwR/qhGzcmxI0GXLCjmPYQPzio2FbdlWuY6y1sHFfQKk+rRbUZ9VStQMog==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-string-parser': 7.19.4 + '@babel/helper-validator-identifier': 7.19.1 + to-fast-properties: 2.0.0 + dev: true + + /@bcoe/v8-coverage/0.2.3: + resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} + dev: true + + /@cspotcode/source-map-support/0.8.1: + resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} + engines: {node: '>=12'} + dependencies: + '@jridgewell/trace-mapping': 0.3.9 + dev: true + + /@esbuild/android-arm/0.15.13: + resolution: {integrity: sha512-RY2fVI8O0iFUNvZirXaQ1vMvK0xhCcl0gqRj74Z6yEiO1zAUa7hbsdwZM1kzqbxHK7LFyMizipfXT3JME+12Hw==} + engines: {node: '>=12'} + cpu: [arm] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-loong64/0.15.13: + resolution: {integrity: sha512-+BoyIm4I8uJmH/QDIH0fu7MG0AEx9OXEDXnqptXCwKOlOqZiS4iraH1Nr7/ObLMokW3sOCeBNyD68ATcV9b9Ag==} + engines: {node: '>=12'} + cpu: [loong64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@istanbuljs/load-nyc-config/1.1.0: + resolution: {integrity: sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==} + engines: {node: '>=8'} + dependencies: + camelcase: 5.3.1 + find-up: 4.1.0 + get-package-type: 0.1.0 + js-yaml: 3.14.1 + resolve-from: 5.0.0 + dev: true + + /@istanbuljs/schema/0.1.3: + resolution: {integrity: sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==} + engines: {node: '>=8'} + dev: true + + /@jest/console/29.3.1: + resolution: {integrity: sha512-IRE6GD47KwcqA09RIWrabKdHPiKDGgtAL31xDxbi/RjQMsr+lY+ppxmHwY0dUEV3qvvxZzoe5Hl0RXZJOjQNUg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/types': 29.3.1 + '@types/node': 18.11.9 + chalk: 4.1.2 + jest-message-util: 29.3.1 + jest-util: 29.3.1 + slash: 3.0.0 + dev: true + + /@jest/core/29.3.1_ts-node@10.9.1: + resolution: {integrity: sha512-0ohVjjRex985w5MmO5L3u5GR1O30DexhBSpuwx2P+9ftyqHdJXnk7IUWiP80oHMvt7ubHCJHxV0a0vlKVuZirw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + dependencies: + '@jest/console': 29.3.1 + '@jest/reporters': 29.3.1 + '@jest/test-result': 29.3.1 + '@jest/transform': 29.3.1 + '@jest/types': 29.3.1 + '@types/node': 18.11.9 + ansi-escapes: 4.3.2 + chalk: 4.1.2 + ci-info: 3.5.0 + exit: 0.1.2 + graceful-fs: 4.2.10 + jest-changed-files: 29.2.0 + jest-config: 29.3.1_odkjkoia5xunhxkdrka32ib6vi + jest-haste-map: 29.3.1 + jest-message-util: 29.3.1 + jest-regex-util: 29.2.0 + jest-resolve: 29.3.1 + jest-resolve-dependencies: 29.3.1 + jest-runner: 29.3.1 + jest-runtime: 29.3.1 + jest-snapshot: 29.3.1 + jest-util: 29.3.1 + jest-validate: 29.3.1 + jest-watcher: 29.3.1 + micromatch: 4.0.5 + pretty-format: 29.3.1 + slash: 3.0.0 + strip-ansi: 6.0.1 + transitivePeerDependencies: + - supports-color + - ts-node + dev: true + + /@jest/environment/29.3.1: + resolution: {integrity: sha512-pMmvfOPmoa1c1QpfFW0nXYtNLpofqo4BrCIk6f2kW4JFeNlHV2t3vd+3iDLf31e2ot2Mec0uqZfmI+U0K2CFag==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/fake-timers': 29.3.1 + '@jest/types': 29.3.1 + '@types/node': 18.11.9 + jest-mock: 29.3.1 + dev: true + + /@jest/expect-utils/29.3.1: + resolution: {integrity: sha512-wlrznINZI5sMjwvUoLVk617ll/UYfGIZNxmbU+Pa7wmkL4vYzhV9R2pwVqUh4NWWuLQWkI8+8mOkxs//prKQ3g==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + jest-get-type: 29.2.0 + dev: true + + /@jest/expect/29.3.1: + resolution: {integrity: sha512-QivM7GlSHSsIAWzgfyP8dgeExPRZ9BIe2LsdPyEhCGkZkoyA+kGsoIzbKAfZCvvRzfZioKwPtCZIt5SaoxYCvg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + expect: 29.3.1 + jest-snapshot: 29.3.1 + transitivePeerDependencies: + - supports-color + dev: true + + /@jest/fake-timers/29.3.1: + resolution: {integrity: sha512-iHTL/XpnDlFki9Tq0Q1GGuVeQ8BHZGIYsvCO5eN/O/oJaRzofG9Xndd9HuSDBI/0ZS79pg0iwn07OMTQ7ngF2A==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/types': 29.3.1 + '@sinonjs/fake-timers': 9.1.2 + '@types/node': 18.11.9 + jest-message-util: 29.3.1 + jest-mock: 29.3.1 + jest-util: 29.3.1 + dev: true + + /@jest/globals/29.3.1: + resolution: {integrity: sha512-cTicd134vOcwO59OPaB6AmdHQMCtWOe+/DitpTZVxWgMJ+YvXL1HNAmPyiGbSHmF/mXVBkvlm8YYtQhyHPnV6Q==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/environment': 29.3.1 + '@jest/expect': 29.3.1 + '@jest/types': 29.3.1 + jest-mock: 29.3.1 + transitivePeerDependencies: + - supports-color + dev: true + + /@jest/reporters/29.3.1: + resolution: {integrity: sha512-GhBu3YFuDrcAYW/UESz1JphEAbvUjaY2vShRZRoRY1mxpCMB3yGSJ4j9n0GxVlEOdCf7qjvUfBCrTUUqhVfbRA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + dependencies: + '@bcoe/v8-coverage': 0.2.3 + '@jest/console': 29.3.1 + '@jest/test-result': 29.3.1 + '@jest/transform': 29.3.1 + '@jest/types': 29.3.1 + '@jridgewell/trace-mapping': 0.3.17 + '@types/node': 18.11.9 + chalk: 4.1.2 + collect-v8-coverage: 1.0.1 + exit: 0.1.2 + glob: 7.2.3 + graceful-fs: 4.2.10 + istanbul-lib-coverage: 3.2.0 + istanbul-lib-instrument: 5.2.1 + istanbul-lib-report: 3.0.0 + istanbul-lib-source-maps: 4.0.1 + istanbul-reports: 3.1.5 + jest-message-util: 29.3.1 + jest-util: 29.3.1 + jest-worker: 29.3.1 + slash: 3.0.0 + string-length: 4.0.2 + strip-ansi: 6.0.1 + v8-to-istanbul: 9.0.1 + transitivePeerDependencies: + - supports-color + dev: true + + /@jest/schemas/29.0.0: + resolution: {integrity: sha512-3Ab5HgYIIAnS0HjqJHQYZS+zXc4tUmTmBH3z83ajI6afXp8X3ZtdLX+nXx+I7LNkJD7uN9LAVhgnjDgZa2z0kA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@sinclair/typebox': 0.24.51 + dev: true + + /@jest/source-map/29.2.0: + resolution: {integrity: sha512-1NX9/7zzI0nqa6+kgpSdKPK+WU1p+SJk3TloWZf5MzPbxri9UEeXX5bWZAPCzbQcyuAzubcdUHA7hcNznmRqWQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jridgewell/trace-mapping': 0.3.17 + callsites: 3.1.0 + graceful-fs: 4.2.10 + dev: true + + /@jest/test-result/29.3.1: + resolution: {integrity: sha512-qeLa6qc0ddB0kuOZyZIhfN5q0e2htngokyTWsGriedsDhItisW7SDYZ7ceOe57Ii03sL988/03wAcBh3TChMGw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/console': 29.3.1 + '@jest/types': 29.3.1 + '@types/istanbul-lib-coverage': 2.0.4 + collect-v8-coverage: 1.0.1 + dev: true + + /@jest/test-sequencer/29.3.1: + resolution: {integrity: sha512-IqYvLbieTv20ArgKoAMyhLHNrVHJfzO6ARZAbQRlY4UGWfdDnLlZEF0BvKOMd77uIiIjSZRwq3Jb3Fa3I8+2UA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/test-result': 29.3.1 + graceful-fs: 4.2.10 + jest-haste-map: 29.3.1 + slash: 3.0.0 + dev: true + + /@jest/transform/29.3.1: + resolution: {integrity: sha512-8wmCFBTVGYqFNLWfcOWoVuMuKYPUBTnTMDkdvFtAYELwDOl9RGwOsvQWGPFxDJ8AWY9xM/8xCXdqmPK3+Q5Lug==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@babel/core': 7.20.2 + '@jest/types': 29.3.1 + '@jridgewell/trace-mapping': 0.3.17 + babel-plugin-istanbul: 6.1.1 + chalk: 4.1.2 + convert-source-map: 2.0.0 + fast-json-stable-stringify: 2.1.0 + graceful-fs: 4.2.10 + jest-haste-map: 29.3.1 + jest-regex-util: 29.2.0 + jest-util: 29.3.1 + micromatch: 4.0.5 + pirates: 4.0.5 + slash: 3.0.0 + write-file-atomic: 4.0.2 + transitivePeerDependencies: + - supports-color + dev: true + + /@jest/types/29.3.1: + resolution: {integrity: sha512-d0S0jmmTpjnhCmNpApgX3jrUZgZ22ivKJRvL2lli5hpCRoNnp1f85r2/wpKfXuYu8E7Jjh1hGfhPyup1NM5AmA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/schemas': 29.0.0 + '@types/istanbul-lib-coverage': 2.0.4 + '@types/istanbul-reports': 3.0.1 + '@types/node': 18.11.9 + '@types/yargs': 17.0.13 + chalk: 4.1.2 + dev: true + + /@jridgewell/gen-mapping/0.1.1: + resolution: {integrity: sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==} + engines: {node: '>=6.0.0'} + dependencies: + '@jridgewell/set-array': 1.1.2 + '@jridgewell/sourcemap-codec': 1.4.14 + dev: true + + /@jridgewell/gen-mapping/0.3.2: + resolution: {integrity: sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==} + engines: {node: '>=6.0.0'} + dependencies: + '@jridgewell/set-array': 1.1.2 + '@jridgewell/sourcemap-codec': 1.4.14 + '@jridgewell/trace-mapping': 0.3.17 + dev: true + + /@jridgewell/resolve-uri/3.1.0: + resolution: {integrity: sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==} + engines: {node: '>=6.0.0'} + dev: true + + /@jridgewell/set-array/1.1.2: + resolution: {integrity: sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==} + engines: {node: '>=6.0.0'} + dev: true + + /@jridgewell/sourcemap-codec/1.4.14: + resolution: {integrity: sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==} + dev: true + + /@jridgewell/trace-mapping/0.3.17: + resolution: {integrity: sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g==} + dependencies: + '@jridgewell/resolve-uri': 3.1.0 + '@jridgewell/sourcemap-codec': 1.4.14 + dev: true + + /@jridgewell/trace-mapping/0.3.9: + resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} + dependencies: + '@jridgewell/resolve-uri': 3.1.0 + '@jridgewell/sourcemap-codec': 1.4.14 + dev: true + + /@nodelib/fs.scandir/2.1.5: + resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} + engines: {node: '>= 8'} + dependencies: + '@nodelib/fs.stat': 2.0.5 + run-parallel: 1.2.0 + dev: true + + /@nodelib/fs.stat/2.0.5: + resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} + engines: {node: '>= 8'} + dev: true + + /@nodelib/fs.walk/1.2.8: + resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} + engines: {node: '>= 8'} + dependencies: + '@nodelib/fs.scandir': 2.1.5 + fastq: 1.13.0 + dev: true + + /@sinclair/typebox/0.24.51: + resolution: {integrity: sha512-1P1OROm/rdubP5aFDSZQILU0vrLCJ4fvHt6EoqHEM+2D/G5MK3bIaymUKLit8Js9gbns5UyJnkP/TZROLw4tUA==} + dev: true + + /@sinonjs/commons/1.8.5: + resolution: {integrity: sha512-rTpCA0wG1wUxglBSFdMMY0oTrKYvgf4fNgv/sXbfCVAdf+FnPBdKJR/7XbpTCwbCrvCbdPYnlWaUUYz4V2fPDA==} + dependencies: + type-detect: 4.0.8 + dev: true + + /@sinonjs/fake-timers/9.1.2: + resolution: {integrity: sha512-BPS4ynJW/o92PUR4wgriz2Ud5gpST5vz6GQfMixEDK0Z8ZCUv2M7SkBLykH56T++Xs+8ln9zTGbOvNGIe02/jw==} + dependencies: + '@sinonjs/commons': 1.8.5 + dev: true + + /@tsconfig/node10/1.0.9: + resolution: {integrity: sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==} + dev: true + + /@tsconfig/node12/1.0.11: + resolution: {integrity: sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==} + dev: true + + /@tsconfig/node14/1.0.3: + resolution: {integrity: sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==} + dev: true + + /@tsconfig/node16/1.0.3: + resolution: {integrity: sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==} + dev: true + + /@types/babel__core/7.1.20: + resolution: {integrity: sha512-PVb6Bg2QuscZ30FvOU7z4guG6c926D9YRvOxEaelzndpMsvP+YM74Q/dAFASpg2l6+XLalxSGxcq/lrgYWZtyQ==} + dependencies: + '@babel/parser': 7.20.3 + '@babel/types': 7.20.2 + '@types/babel__generator': 7.6.4 + '@types/babel__template': 7.4.1 + '@types/babel__traverse': 7.18.2 + dev: true + + /@types/babel__generator/7.6.4: + resolution: {integrity: sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==} + dependencies: + '@babel/types': 7.20.2 + dev: true + + /@types/babel__template/7.4.1: + resolution: {integrity: sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==} + dependencies: + '@babel/parser': 7.20.3 + '@babel/types': 7.20.2 + dev: true + + /@types/babel__traverse/7.18.2: + resolution: {integrity: sha512-FcFaxOr2V5KZCviw1TnutEMVUVsGt4D2hP1TAfXZAMKuHYW3xQhe3jTxNPWutgCJ3/X1c5yX8ZoGVEItxKbwBg==} + dependencies: + '@babel/types': 7.20.2 + dev: true + + /@types/body-parser/1.19.2: + resolution: {integrity: sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==} + dependencies: + '@types/connect': 3.4.35 + '@types/node': 18.11.9 + dev: true + + /@types/connect/3.4.35: + resolution: {integrity: sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==} + dependencies: + '@types/node': 18.11.9 + dev: true + + /@types/express-serve-static-core/4.17.31: + resolution: {integrity: sha512-DxMhY+NAsTwMMFHBTtJFNp5qiHKJ7TeqOo23zVEM9alT1Ml27Q3xcTH0xwxn7Q0BbMcVEJOs/7aQtUWupUQN3Q==} + dependencies: + '@types/node': 18.11.9 + '@types/qs': 6.9.7 + '@types/range-parser': 1.2.4 + dev: true + + /@types/express/4.17.14: + resolution: {integrity: sha512-TEbt+vaPFQ+xpxFLFssxUDXj5cWCxZJjIcB7Yg0k0GMHGtgtQgpvx/MUQUeAkNbA9AAGrwkAsoeItdTgS7FMyg==} + dependencies: + '@types/body-parser': 1.19.2 + '@types/express-serve-static-core': 4.17.31 + '@types/qs': 6.9.7 + '@types/serve-static': 1.15.0 + dev: true + + /@types/graceful-fs/4.1.5: + resolution: {integrity: sha512-anKkLmZZ+xm4p8JWBf4hElkM4XR+EZeA2M9BAkkTldmcyDY4mbdIJnRghDJH3Ov5ooY7/UAoENtmdMSkaAd7Cw==} + dependencies: + '@types/node': 18.11.9 + dev: true + + /@types/istanbul-lib-coverage/2.0.4: + resolution: {integrity: sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==} + dev: true + + /@types/istanbul-lib-report/3.0.0: + resolution: {integrity: sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==} + dependencies: + '@types/istanbul-lib-coverage': 2.0.4 + dev: true + + /@types/istanbul-reports/3.0.1: + resolution: {integrity: sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==} + dependencies: + '@types/istanbul-lib-report': 3.0.0 + dev: true + + /@types/jest/29.2.2: + resolution: {integrity: sha512-og1wAmdxKoS71K2ZwSVqWPX6OVn3ihZ6ZT2qvZvZQm90lJVDyXIjYcu4Khx2CNIeaFv12rOU/YObOsI3VOkzog==} + dependencies: + expect: 29.3.1 + pretty-format: 29.3.1 + dev: true + + /@types/mime/3.0.1: + resolution: {integrity: sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==} + dev: true + + /@types/multer/1.4.7: + resolution: {integrity: sha512-/SNsDidUFCvqqcWDwxv2feww/yqhNeTRL5CVoL3jU4Goc4kKEL10T7Eye65ZqPNi4HRx8sAEX59pV1aEH7drNA==} + dependencies: + '@types/express': 4.17.14 + dev: true + + /@types/node/18.11.9: + resolution: {integrity: sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==} + dev: true + + /@types/prettier/2.7.1: + resolution: {integrity: sha512-ri0UmynRRvZiiUJdiz38MmIblKK+oH30MztdBVR95dv/Ubw6neWSb8u1XpRb72L4qsZOhz+L+z9JD40SJmfWow==} + dev: true + + /@types/qs/6.9.7: + resolution: {integrity: sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==} + dev: true + + /@types/range-parser/1.2.4: + resolution: {integrity: sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==} + dev: true + + /@types/serve-static/1.15.0: + resolution: {integrity: sha512-z5xyF6uh8CbjAu9760KDKsH2FcDxZ2tFCsA4HIMWE6IkiYMXfVoa+4f9KX+FN0ZLsaMw1WNG2ETLA6N+/YA+cg==} + dependencies: + '@types/mime': 3.0.1 + '@types/node': 18.11.9 + dev: true + + /@types/stack-utils/2.0.1: + resolution: {integrity: sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==} + dev: true + + /@types/yargs-parser/21.0.0: + resolution: {integrity: sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==} + dev: true + + /@types/yargs/17.0.13: + resolution: {integrity: sha512-9sWaruZk2JGxIQU+IhI1fhPYRcQ0UuTNuKuCW9bR5fp7qi2Llf7WDzNa17Cy7TKnh3cdxDOiyTu6gaLS0eDatg==} + dependencies: + '@types/yargs-parser': 21.0.0 + dev: true + + /accepts/1.3.8: + resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==} + engines: {node: '>= 0.6'} + dependencies: + mime-types: 2.1.35 + negotiator: 0.6.3 + dev: true + + /acorn-walk/8.2.0: + resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==} + engines: {node: '>=0.4.0'} + dev: true + + /acorn/8.8.1: + resolution: {integrity: sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==} + engines: {node: '>=0.4.0'} + hasBin: true + dev: true + + /ansi-escapes/4.3.2: + resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} + engines: {node: '>=8'} + dependencies: + type-fest: 0.21.3 + dev: true + + /ansi-regex/5.0.1: + resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} + engines: {node: '>=8'} + dev: true + + /ansi-styles/3.2.1: + resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} + engines: {node: '>=4'} + dependencies: + color-convert: 1.9.3 + dev: true + + /ansi-styles/4.3.0: + resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} + engines: {node: '>=8'} + dependencies: + color-convert: 2.0.1 + dev: true + + /ansi-styles/5.2.0: + resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==} + engines: {node: '>=10'} + dev: true + + /any-promise/1.3.0: + resolution: {integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==} + dev: true + + /anymatch/3.1.2: + resolution: {integrity: sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==} + engines: {node: '>= 8'} + dependencies: + normalize-path: 3.0.0 + picomatch: 2.3.1 + dev: true + + /append-field/1.0.0: + resolution: {integrity: sha512-klpgFSWLW1ZEs8svjfb7g4qWY0YS5imI82dTg+QahUvJ8YqAY0P10Uk8tTyh9ZGuYEZEMaeJYCF5BFuX552hsw==} + dev: true + + /arg/4.1.3: + resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} + dev: true + + /argparse/1.0.10: + resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} + dependencies: + sprintf-js: 1.0.3 + dev: true + + /array-flatten/1.1.1: + resolution: {integrity: sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==} + dev: true + + /array-union/2.1.0: + resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} + engines: {node: '>=8'} + dev: true + + /asynckit/0.4.0: + resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} + dev: true + + /axios/1.1.3: + resolution: {integrity: sha512-00tXVRwKx/FZr/IDVFt4C+f9FYairX517WoGCL6dpOntqLkZofjhu43F/Xl44UOpqa+9sLFDrG/XAnFsUYgkDA==} + dependencies: + follow-redirects: 1.15.2 + form-data: 4.0.0 + proxy-from-env: 1.1.0 + transitivePeerDependencies: + - debug + dev: true + + /babel-jest/29.3.1_@babel+core@7.20.2: + resolution: {integrity: sha512-aard+xnMoxgjwV70t0L6wkW/3HQQtV+O0PEimxKgzNqCJnbYmroPojdP2tqKSOAt8QAKV/uSZU8851M7B5+fcA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + '@babel/core': ^7.8.0 + dependencies: + '@babel/core': 7.20.2 + '@jest/transform': 29.3.1 + '@types/babel__core': 7.1.20 + babel-plugin-istanbul: 6.1.1 + babel-preset-jest: 29.2.0_@babel+core@7.20.2 + chalk: 4.1.2 + graceful-fs: 4.2.10 + slash: 3.0.0 + transitivePeerDependencies: + - supports-color + dev: true + + /babel-plugin-istanbul/6.1.1: + resolution: {integrity: sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==} + engines: {node: '>=8'} + dependencies: + '@babel/helper-plugin-utils': 7.20.2 + '@istanbuljs/load-nyc-config': 1.1.0 + '@istanbuljs/schema': 0.1.3 + istanbul-lib-instrument: 5.2.1 + test-exclude: 6.0.0 + transitivePeerDependencies: + - supports-color + dev: true + + /babel-plugin-jest-hoist/29.2.0: + resolution: {integrity: sha512-TnspP2WNiR3GLfCsUNHqeXw0RoQ2f9U5hQ5L3XFpwuO8htQmSrhh8qsB6vi5Yi8+kuynN1yjDjQsPfkebmB6ZA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@babel/template': 7.18.10 + '@babel/types': 7.20.2 + '@types/babel__core': 7.1.20 + '@types/babel__traverse': 7.18.2 + dev: true + + /babel-preset-current-node-syntax/1.0.1_@babel+core@7.20.2: + resolution: {integrity: sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.20.2 + '@babel/plugin-syntax-async-generators': 7.8.4_@babel+core@7.20.2 + '@babel/plugin-syntax-bigint': 7.8.3_@babel+core@7.20.2 + '@babel/plugin-syntax-class-properties': 7.12.13_@babel+core@7.20.2 + '@babel/plugin-syntax-import-meta': 7.10.4_@babel+core@7.20.2 + '@babel/plugin-syntax-json-strings': 7.8.3_@babel+core@7.20.2 + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4_@babel+core@7.20.2 + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3_@babel+core@7.20.2 + '@babel/plugin-syntax-numeric-separator': 7.10.4_@babel+core@7.20.2 + '@babel/plugin-syntax-object-rest-spread': 7.8.3_@babel+core@7.20.2 + '@babel/plugin-syntax-optional-catch-binding': 7.8.3_@babel+core@7.20.2 + '@babel/plugin-syntax-optional-chaining': 7.8.3_@babel+core@7.20.2 + '@babel/plugin-syntax-top-level-await': 7.14.5_@babel+core@7.20.2 + dev: true + + /babel-preset-jest/29.2.0_@babel+core@7.20.2: + resolution: {integrity: sha512-z9JmMJppMxNv8N7fNRHvhMg9cvIkMxQBXgFkane3yKVEvEOP+kB50lk8DFRvF9PGqbyXxlmebKWhuDORO8RgdA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.20.2 + babel-plugin-jest-hoist: 29.2.0 + babel-preset-current-node-syntax: 1.0.1_@babel+core@7.20.2 + dev: true + + /balanced-match/1.0.2: + resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + dev: true + + /binary-extensions/2.2.0: + resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==} + engines: {node: '>=8'} + dev: true + + /body-parser/1.20.1: + resolution: {integrity: sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==} + engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} + dependencies: + bytes: 3.1.2 + content-type: 1.0.4 + debug: 2.6.9 + depd: 2.0.0 + destroy: 1.2.0 + http-errors: 2.0.0 + iconv-lite: 0.4.24 + on-finished: 2.4.1 + qs: 6.11.0 + raw-body: 2.5.1 + type-is: 1.6.18 + unpipe: 1.0.0 + transitivePeerDependencies: + - supports-color + dev: true + + /brace-expansion/1.1.11: + resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} + dependencies: + balanced-match: 1.0.2 + concat-map: 0.0.1 + dev: true + + /braces/3.0.2: + resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} + engines: {node: '>=8'} + dependencies: + fill-range: 7.0.1 + dev: true + + /browserslist/4.21.4: + resolution: {integrity: sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw==} + engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} + hasBin: true + dependencies: + caniuse-lite: 1.0.30001431 + electron-to-chromium: 1.4.284 + node-releases: 2.0.6 + update-browserslist-db: 1.0.10_browserslist@4.21.4 + dev: true + + /bs-logger/0.2.6: + resolution: {integrity: sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==} + engines: {node: '>= 6'} + dependencies: + fast-json-stable-stringify: 2.1.0 + dev: true + + /bser/2.1.1: + resolution: {integrity: sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==} + dependencies: + node-int64: 0.4.0 + dev: true + + /buffer-from/1.1.2: + resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} + dev: true + + /bundle-require/3.1.2_esbuild@0.15.13: + resolution: {integrity: sha512-Of6l6JBAxiyQ5axFxUM6dYeP/W7X2Sozeo/4EYB9sJhL+dqL7TKjg+shwxp6jlu/6ZSERfsYtIpSJ1/x3XkAEA==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + peerDependencies: + esbuild: '>=0.13' + dependencies: + esbuild: 0.15.13 + load-tsconfig: 0.2.3 + dev: true + + /busboy/1.6.0: + resolution: {integrity: sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==} + engines: {node: '>=10.16.0'} + dependencies: + streamsearch: 1.1.0 + dev: true + + /bytes/3.1.2: + resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==} + engines: {node: '>= 0.8'} + dev: true + + /cac/6.7.14: + resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} + engines: {node: '>=8'} + dev: true + + /call-bind/1.0.2: + resolution: {integrity: sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==} + dependencies: + function-bind: 1.1.1 + get-intrinsic: 1.1.3 + dev: true + + /callsites/3.1.0: + resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} + engines: {node: '>=6'} + dev: true + + /camelcase/5.3.1: + resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} + engines: {node: '>=6'} + dev: true + + /camelcase/6.3.0: + resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} + engines: {node: '>=10'} + dev: true + + /caniuse-lite/1.0.30001431: + resolution: {integrity: sha512-zBUoFU0ZcxpvSt9IU66dXVT/3ctO1cy4y9cscs1szkPlcWb6pasYM144GqrUygUbT+k7cmUCW61cvskjcv0enQ==} + dev: true + + /chalk/2.4.2: + resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} + engines: {node: '>=4'} + dependencies: + ansi-styles: 3.2.1 + escape-string-regexp: 1.0.5 + supports-color: 5.5.0 + dev: true + + /chalk/4.1.2: + resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} + engines: {node: '>=10'} + dependencies: + ansi-styles: 4.3.0 + supports-color: 7.2.0 + dev: true + + /char-regex/1.0.2: + resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} + engines: {node: '>=10'} + dev: true + + /chokidar/3.5.3: + resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==} + engines: {node: '>= 8.10.0'} + dependencies: + anymatch: 3.1.2 + braces: 3.0.2 + glob-parent: 5.1.2 + is-binary-path: 2.1.0 + is-glob: 4.0.3 + normalize-path: 3.0.0 + readdirp: 3.6.0 + optionalDependencies: + fsevents: 2.3.2 + dev: true + + /ci-info/3.5.0: + resolution: {integrity: sha512-yH4RezKOGlOhxkmhbeNuC4eYZKAUsEaGtBuBzDDP1eFUKiccDWzBABxBfOx31IDwDIXMTxWuwAxUGModvkbuVw==} + dev: true + + /cjs-module-lexer/1.2.2: + resolution: {integrity: sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA==} + dev: true + + /cliui/8.0.1: + resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} + engines: {node: '>=12'} + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 7.0.0 + dev: true + + /co/4.6.0: + resolution: {integrity: sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==} + engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'} + dev: true + + /collect-v8-coverage/1.0.1: + resolution: {integrity: sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg==} + dev: true + + /color-convert/1.9.3: + resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} + dependencies: + color-name: 1.1.3 + dev: true + + /color-convert/2.0.1: + resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} + engines: {node: '>=7.0.0'} + dependencies: + color-name: 1.1.4 + dev: true + + /color-name/1.1.3: + resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==} + dev: true + + /color-name/1.1.4: + resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + dev: true + + /combined-stream/1.0.8: + resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} + engines: {node: '>= 0.8'} + dependencies: + delayed-stream: 1.0.0 + dev: true + + /commander/4.1.1: + resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==} + engines: {node: '>= 6'} + dev: true + + /concat-map/0.0.1: + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + dev: true + + /concat-stream/1.6.2: + resolution: {integrity: sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==} + engines: {'0': node >= 0.8} + dependencies: + buffer-from: 1.1.2 + inherits: 2.0.4 + readable-stream: 2.3.7 + typedarray: 0.0.6 + dev: true + + /content-disposition/0.5.4: + resolution: {integrity: sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==} + engines: {node: '>= 0.6'} + dependencies: + safe-buffer: 5.2.1 + dev: true + + /content-type/1.0.4: + resolution: {integrity: sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==} + engines: {node: '>= 0.6'} + dev: true + + /convert-source-map/1.9.0: + resolution: {integrity: sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==} + dev: true + + /convert-source-map/2.0.0: + resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} + dev: true + + /cookie-signature/1.0.6: + resolution: {integrity: sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==} + dev: true + + /cookie/0.5.0: + resolution: {integrity: sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==} + engines: {node: '>= 0.6'} + dev: true + + /core-util-is/1.0.3: + resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} + dev: true + + /create-require/1.1.1: + resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} + dev: true + + /cross-spawn/7.0.3: + resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} + engines: {node: '>= 8'} + dependencies: + path-key: 3.1.1 + shebang-command: 2.0.0 + which: 2.0.2 + dev: true + + /debug/2.6.9: + resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.0.0 + dev: true + + /debug/4.3.4: + resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.1.2 + dev: true + + /dedent/0.7.0: + resolution: {integrity: sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==} + dev: true + + /deepmerge/4.2.2: + resolution: {integrity: sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==} + engines: {node: '>=0.10.0'} + dev: true + + /delayed-stream/1.0.0: + resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} + engines: {node: '>=0.4.0'} + dev: true + + /depd/2.0.0: + resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==} + engines: {node: '>= 0.8'} + dev: true + + /destroy/1.2.0: + resolution: {integrity: sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==} + engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} + dev: true + + /detect-newline/3.1.0: + resolution: {integrity: sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==} + engines: {node: '>=8'} + dev: true + + /diff-sequences/29.3.1: + resolution: {integrity: sha512-hlM3QR272NXCi4pq+N4Kok4kOp6EsgOM3ZSpJI7Da3UAs+Ttsi8MRmB6trM/lhyzUxGfOgnpkHtgqm5Q/CTcfQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dev: true + + /diff/4.0.2: + resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} + engines: {node: '>=0.3.1'} + dev: true + + /dir-glob/3.0.1: + resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} + engines: {node: '>=8'} + dependencies: + path-type: 4.0.0 + dev: true + + /ee-first/1.1.1: + resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} + dev: true + + /electron-to-chromium/1.4.284: + resolution: {integrity: sha512-M8WEXFuKXMYMVr45fo8mq0wUrrJHheiKZf6BArTKk9ZBYCKJEOU5H8cdWgDT+qCVZf7Na4lVUaZsA+h6uA9+PA==} + dev: true + + /emittery/0.13.1: + resolution: {integrity: sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==} + engines: {node: '>=12'} + dev: true + + /emoji-regex/8.0.0: + resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + dev: true + + /encodeurl/1.0.2: + resolution: {integrity: sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==} + engines: {node: '>= 0.8'} + dev: true + + /error-ex/1.3.2: + resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} + dependencies: + is-arrayish: 0.2.1 + dev: true + + /esbuild-android-64/0.15.13: + resolution: {integrity: sha512-yRorukXBlokwTip+Sy4MYskLhJsO0Kn0/Fj43s1krVblfwP+hMD37a4Wmg139GEsMLl+vh8WXp2mq/cTA9J97g==} + engines: {node: '>=12'} + cpu: [x64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /esbuild-android-arm64/0.15.13: + resolution: {integrity: sha512-TKzyymLD6PiVeyYa4c5wdPw87BeAiTXNtK6amWUcXZxkV51gOk5u5qzmDaYSwiWeecSNHamFsaFjLoi32QR5/w==} + engines: {node: '>=12'} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /esbuild-darwin-64/0.15.13: + resolution: {integrity: sha512-WAx7c2DaOS6CrRcoYCgXgkXDliLnFv3pQLV6GeW1YcGEZq2Gnl8s9Pg7ahValZkpOa0iE/ojRVQ87sbUhF1Cbg==} + engines: {node: '>=12'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /esbuild-darwin-arm64/0.15.13: + resolution: {integrity: sha512-U6jFsPfSSxC3V1CLiQqwvDuj3GGrtQNB3P3nNC3+q99EKf94UGpsG9l4CQ83zBs1NHrk1rtCSYT0+KfK5LsD8A==} + engines: {node: '>=12'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /esbuild-freebsd-64/0.15.13: + resolution: {integrity: sha512-whItJgDiOXaDG/idy75qqevIpZjnReZkMGCgQaBWZuKHoElDJC1rh7MpoUgupMcdfOd+PgdEwNQW9DAE6i8wyA==} + engines: {node: '>=12'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /esbuild-freebsd-arm64/0.15.13: + resolution: {integrity: sha512-6pCSWt8mLUbPtygv7cufV0sZLeylaMwS5Fznj6Rsx9G2AJJsAjQ9ifA+0rQEIg7DwJmi9it+WjzNTEAzzdoM3Q==} + engines: {node: '>=12'} + cpu: [arm64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-32/0.15.13: + resolution: {integrity: sha512-VbZdWOEdrJiYApm2kkxoTOgsoCO1krBZ3quHdYk3g3ivWaMwNIVPIfEE0f0XQQ0u5pJtBsnk2/7OPiCFIPOe/w==} + engines: {node: '>=12'} + cpu: [ia32] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-64/0.15.13: + resolution: {integrity: sha512-rXmnArVNio6yANSqDQlIO4WiP+Cv7+9EuAHNnag7rByAqFVuRusLbGi2697A5dFPNXoO//IiogVwi3AdcfPC6A==} + engines: {node: '>=12'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-arm/0.15.13: + resolution: {integrity: sha512-Ac6LpfmJO8WhCMQmO253xX2IU2B3wPDbl4IvR0hnqcPrdfCaUa2j/lLMGTjmQ4W5JsJIdHEdW12dG8lFS0MbxQ==} + engines: {node: '>=12'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-arm64/0.15.13: + resolution: {integrity: sha512-alEMGU4Z+d17U7KQQw2IV8tQycO6T+rOrgW8OS22Ua25x6kHxoG6Ngry6Aq6uranC+pNWNMB6aHFPh7aTQdORQ==} + engines: {node: '>=12'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-mips64le/0.15.13: + resolution: {integrity: sha512-47PgmyYEu+yN5rD/MbwS6DxP2FSGPo4Uxg5LwIdxTiyGC2XKwHhHyW7YYEDlSuXLQXEdTO7mYe8zQ74czP7W8A==} + engines: {node: '>=12'} + cpu: [mips64el] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-ppc64le/0.15.13: + resolution: {integrity: sha512-z6n28h2+PC1Ayle9DjKoBRcx/4cxHoOa2e689e2aDJSaKug3jXcQw7mM+GLg+9ydYoNzj8QxNL8ihOv/OnezhA==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-riscv64/0.15.13: + resolution: {integrity: sha512-+Lu4zuuXuQhgLUGyZloWCqTslcCAjMZH1k3Xc9MSEJEpEFdpsSU0sRDXAnk18FKOfEjhu4YMGaykx9xjtpA6ow==} + engines: {node: '>=12'} + cpu: [riscv64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-linux-s390x/0.15.13: + resolution: {integrity: sha512-BMeXRljruf7J0TMxD5CIXS65y7puiZkAh+s4XFV9qy16SxOuMhxhVIXYLnbdfLrsYGFzx7U9mcdpFWkkvy/Uag==} + engines: {node: '>=12'} + cpu: [s390x] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /esbuild-netbsd-64/0.15.13: + resolution: {integrity: sha512-EHj9QZOTel581JPj7UO3xYbltFTYnHy+SIqJVq6yd3KkCrsHRbapiPb0Lx3EOOtybBEE9EyqbmfW1NlSDsSzvQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [netbsd] + requiresBuild: true + dev: true + optional: true + + /esbuild-openbsd-64/0.15.13: + resolution: {integrity: sha512-nkuDlIjF/sfUhfx8SKq0+U+Fgx5K9JcPq1mUodnxI0x4kBdCv46rOGWbuJ6eof2n3wdoCLccOoJAbg9ba/bT2w==} + engines: {node: '>=12'} + cpu: [x64] + os: [openbsd] + requiresBuild: true + dev: true + optional: true + + /esbuild-sunos-64/0.15.13: + resolution: {integrity: sha512-jVeu2GfxZQ++6lRdY43CS0Tm/r4WuQQ0Pdsrxbw+aOrHQPHV0+LNOLnvbN28M7BSUGnJnHkHm2HozGgNGyeIRw==} + engines: {node: '>=12'} + cpu: [x64] + os: [sunos] + requiresBuild: true + dev: true + optional: true + + /esbuild-windows-32/0.15.13: + resolution: {integrity: sha512-XoF2iBf0wnqo16SDq+aDGi/+QbaLFpkiRarPVssMh9KYbFNCqPLlGAWwDvxEVz+ywX6Si37J2AKm+AXq1kC0JA==} + engines: {node: '>=12'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /esbuild-windows-64/0.15.13: + resolution: {integrity: sha512-Et6htEfGycjDrtqb2ng6nT+baesZPYQIW+HUEHK4D1ncggNrDNk3yoboYQ5KtiVrw/JaDMNttz8rrPubV/fvPQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /esbuild-windows-arm64/0.15.13: + resolution: {integrity: sha512-3bv7tqntThQC9SWLRouMDmZnlOukBhOCTlkzNqzGCmrkCJI7io5LLjwJBOVY6kOUlIvdxbooNZwjtBvj+7uuVg==} + engines: {node: '>=12'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /esbuild/0.15.13: + resolution: {integrity: sha512-Cu3SC84oyzzhrK/YyN4iEVy2jZu5t2fz66HEOShHURcjSkOSAVL8C/gfUT+lDJxkVHpg8GZ10DD0rMHRPqMFaQ==} + engines: {node: '>=12'} + hasBin: true + requiresBuild: true + optionalDependencies: + '@esbuild/android-arm': 0.15.13 + '@esbuild/linux-loong64': 0.15.13 + esbuild-android-64: 0.15.13 + esbuild-android-arm64: 0.15.13 + esbuild-darwin-64: 0.15.13 + esbuild-darwin-arm64: 0.15.13 + esbuild-freebsd-64: 0.15.13 + esbuild-freebsd-arm64: 0.15.13 + esbuild-linux-32: 0.15.13 + esbuild-linux-64: 0.15.13 + esbuild-linux-arm: 0.15.13 + esbuild-linux-arm64: 0.15.13 + esbuild-linux-mips64le: 0.15.13 + esbuild-linux-ppc64le: 0.15.13 + esbuild-linux-riscv64: 0.15.13 + esbuild-linux-s390x: 0.15.13 + esbuild-netbsd-64: 0.15.13 + esbuild-openbsd-64: 0.15.13 + esbuild-sunos-64: 0.15.13 + esbuild-windows-32: 0.15.13 + esbuild-windows-64: 0.15.13 + esbuild-windows-arm64: 0.15.13 + dev: true + + /escalade/3.1.1: + resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} + engines: {node: '>=6'} + dev: true + + /escape-html/1.0.3: + resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==} + dev: true + + /escape-string-regexp/1.0.5: + resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} + engines: {node: '>=0.8.0'} + dev: true + + /escape-string-regexp/2.0.0: + resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} + engines: {node: '>=8'} + dev: true + + /esprima/4.0.1: + resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} + engines: {node: '>=4'} + hasBin: true + dev: true + + /etag/1.8.1: + resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==} + engines: {node: '>= 0.6'} + dev: true + + /execa/5.1.1: + resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} + engines: {node: '>=10'} + dependencies: + cross-spawn: 7.0.3 + get-stream: 6.0.1 + human-signals: 2.1.0 + is-stream: 2.0.1 + merge-stream: 2.0.0 + npm-run-path: 4.0.1 + onetime: 5.1.2 + signal-exit: 3.0.7 + strip-final-newline: 2.0.0 + dev: true + + /exit/0.1.2: + resolution: {integrity: sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==} + engines: {node: '>= 0.8.0'} + dev: true + + /expect/29.3.1: + resolution: {integrity: sha512-gGb1yTgU30Q0O/tQq+z30KBWv24ApkMgFUpvKBkyLUBL68Wv8dHdJxTBZFl/iT8K/bqDHvUYRH6IIN3rToopPA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/expect-utils': 29.3.1 + jest-get-type: 29.2.0 + jest-matcher-utils: 29.3.1 + jest-message-util: 29.3.1 + jest-util: 29.3.1 + dev: true + + /express/4.18.2: + resolution: {integrity: sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==} + engines: {node: '>= 0.10.0'} + dependencies: + accepts: 1.3.8 + array-flatten: 1.1.1 + body-parser: 1.20.1 + content-disposition: 0.5.4 + content-type: 1.0.4 + cookie: 0.5.0 + cookie-signature: 1.0.6 + debug: 2.6.9 + depd: 2.0.0 + encodeurl: 1.0.2 + escape-html: 1.0.3 + etag: 1.8.1 + finalhandler: 1.2.0 + fresh: 0.5.2 + http-errors: 2.0.0 + merge-descriptors: 1.0.1 + methods: 1.1.2 + on-finished: 2.4.1 + parseurl: 1.3.3 + path-to-regexp: 0.1.7 + proxy-addr: 2.0.7 + qs: 6.11.0 + range-parser: 1.2.1 + safe-buffer: 5.2.1 + send: 0.18.0 + serve-static: 1.15.0 + setprototypeof: 1.2.0 + statuses: 2.0.1 + type-is: 1.6.18 + utils-merge: 1.0.1 + vary: 1.1.2 + transitivePeerDependencies: + - supports-color + dev: true + + /fast-glob/3.2.12: + resolution: {integrity: sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==} + engines: {node: '>=8.6.0'} + dependencies: + '@nodelib/fs.stat': 2.0.5 + '@nodelib/fs.walk': 1.2.8 + glob-parent: 5.1.2 + merge2: 1.4.1 + micromatch: 4.0.5 + dev: true + + /fast-json-stable-stringify/2.1.0: + resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} + dev: true + + /fastq/1.13.0: + resolution: {integrity: sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==} + dependencies: + reusify: 1.0.4 + dev: true + + /fb-watchman/2.0.2: + resolution: {integrity: sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==} + dependencies: + bser: 2.1.1 + dev: true + + /fill-range/7.0.1: + resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} + engines: {node: '>=8'} + dependencies: + to-regex-range: 5.0.1 + dev: true + + /finalhandler/1.2.0: + resolution: {integrity: sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==} + engines: {node: '>= 0.8'} + dependencies: + debug: 2.6.9 + encodeurl: 1.0.2 + escape-html: 1.0.3 + on-finished: 2.4.1 + parseurl: 1.3.3 + statuses: 2.0.1 + unpipe: 1.0.0 + transitivePeerDependencies: + - supports-color + dev: true + + /find-up/4.1.0: + resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} + engines: {node: '>=8'} + dependencies: + locate-path: 5.0.0 + path-exists: 4.0.0 + dev: true + + /follow-redirects/1.15.2: + resolution: {integrity: sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==} + engines: {node: '>=4.0'} + peerDependencies: + debug: '*' + peerDependenciesMeta: + debug: + optional: true + dev: true + + /form-data/4.0.0: + resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} + engines: {node: '>= 6'} + dependencies: + asynckit: 0.4.0 + combined-stream: 1.0.8 + mime-types: 2.1.35 + dev: true + + /forwarded/0.2.0: + resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==} + engines: {node: '>= 0.6'} + dev: true + + /fp-ts/2.13.1: + resolution: {integrity: sha512-0eu5ULPS2c/jsa1lGFneEFFEdTbembJv8e4QKXeVJ3lm/5hyve06dlKZrpxmMwJt6rYen7sxmHHK2CLaXvWuWQ==} + dev: true + + /fresh/0.5.2: + resolution: {integrity: sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==} + engines: {node: '>= 0.6'} + dev: true + + /fs.realpath/1.0.0: + resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} + dev: true + + /fsevents/2.3.2: + resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} + engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /function-bind/1.1.1: + resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} + dev: true + + /gensync/1.0.0-beta.2: + resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} + engines: {node: '>=6.9.0'} + dev: true + + /get-caller-file/2.0.5: + resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} + engines: {node: 6.* || 8.* || >= 10.*} + dev: true + + /get-intrinsic/1.1.3: + resolution: {integrity: sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A==} + dependencies: + function-bind: 1.1.1 + has: 1.0.3 + has-symbols: 1.0.3 + dev: true + + /get-package-type/0.1.0: + resolution: {integrity: sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==} + engines: {node: '>=8.0.0'} + dev: true + + /get-stream/6.0.1: + resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} + engines: {node: '>=10'} + dev: true + + /glob-parent/5.1.2: + resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} + engines: {node: '>= 6'} + dependencies: + is-glob: 4.0.3 + dev: true + + /glob/7.1.6: + resolution: {integrity: sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==} + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.2 + once: 1.4.0 + path-is-absolute: 1.0.1 + dev: true + + /glob/7.2.3: + resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.2 + once: 1.4.0 + path-is-absolute: 1.0.1 + dev: true + + /globals/11.12.0: + resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} + engines: {node: '>=4'} + dev: true + + /globby/11.1.0: + resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} + engines: {node: '>=10'} + dependencies: + array-union: 2.1.0 + dir-glob: 3.0.1 + fast-glob: 3.2.12 + ignore: 5.2.0 + merge2: 1.4.1 + slash: 3.0.0 + dev: true + + /graceful-fs/4.2.10: + resolution: {integrity: sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==} + dev: true + + /has-flag/3.0.0: + resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} + engines: {node: '>=4'} + dev: true + + /has-flag/4.0.0: + resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} + engines: {node: '>=8'} + dev: true + + /has-symbols/1.0.3: + resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} + engines: {node: '>= 0.4'} + dev: true + + /has/1.0.3: + resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==} + engines: {node: '>= 0.4.0'} + dependencies: + function-bind: 1.1.1 + dev: true + + /html-escaper/2.0.2: + resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} + dev: true + + /http-errors/2.0.0: + resolution: {integrity: sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==} + engines: {node: '>= 0.8'} + dependencies: + depd: 2.0.0 + inherits: 2.0.4 + setprototypeof: 1.2.0 + statuses: 2.0.1 + toidentifier: 1.0.1 + dev: true + + /human-signals/2.1.0: + resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} + engines: {node: '>=10.17.0'} + dev: true + + /iconv-lite/0.4.24: + resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} + engines: {node: '>=0.10.0'} + dependencies: + safer-buffer: 2.1.2 + dev: true + + /ignore/5.2.0: + resolution: {integrity: sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==} + engines: {node: '>= 4'} + dev: true + + /import-local/3.1.0: + resolution: {integrity: sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==} + engines: {node: '>=8'} + hasBin: true + dependencies: + pkg-dir: 4.2.0 + resolve-cwd: 3.0.0 + dev: true + + /imurmurhash/0.1.4: + resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} + engines: {node: '>=0.8.19'} + dev: true + + /inflight/1.0.6: + resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} + dependencies: + once: 1.4.0 + wrappy: 1.0.2 + dev: true + + /inherits/2.0.4: + resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + dev: true + + /io-ts/2.2.19_fp-ts@2.13.1: + resolution: {integrity: sha512-ED0GQwvKRr5C2jqOOJCkuJW2clnbzqFexQ8V7Qsb+VB36S1Mk/OKH7k0FjSe4mjKy9qBRA3OqgVGyFMUEKIubw==} + peerDependencies: + fp-ts: ^2.5.0 + dependencies: + fp-ts: 2.13.1 + dev: true + + /ipaddr.js/1.9.1: + resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==} + engines: {node: '>= 0.10'} + dev: true + + /is-arrayish/0.2.1: + resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} + dev: true + + /is-binary-path/2.1.0: + resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} + engines: {node: '>=8'} + dependencies: + binary-extensions: 2.2.0 + dev: true + + /is-core-module/2.11.0: + resolution: {integrity: sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==} + dependencies: + has: 1.0.3 + dev: true + + /is-extglob/2.1.1: + resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} + engines: {node: '>=0.10.0'} + dev: true + + /is-fullwidth-code-point/3.0.0: + resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} + engines: {node: '>=8'} + dev: true + + /is-generator-fn/2.1.0: + resolution: {integrity: sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==} + engines: {node: '>=6'} + dev: true + + /is-glob/4.0.3: + resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} + engines: {node: '>=0.10.0'} + dependencies: + is-extglob: 2.1.1 + dev: true + + /is-number/7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + dev: true + + /is-stream/2.0.1: + resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} + engines: {node: '>=8'} + dev: true + + /isarray/1.0.0: + resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==} + dev: true + + /isexe/2.0.0: + resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + dev: true + + /istanbul-lib-coverage/3.2.0: + resolution: {integrity: sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==} + engines: {node: '>=8'} + dev: true + + /istanbul-lib-instrument/5.2.1: + resolution: {integrity: sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==} + engines: {node: '>=8'} + dependencies: + '@babel/core': 7.20.2 + '@babel/parser': 7.20.3 + '@istanbuljs/schema': 0.1.3 + istanbul-lib-coverage: 3.2.0 + semver: 6.3.0 + transitivePeerDependencies: + - supports-color + dev: true + + /istanbul-lib-report/3.0.0: + resolution: {integrity: sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==} + engines: {node: '>=8'} + dependencies: + istanbul-lib-coverage: 3.2.0 + make-dir: 3.1.0 + supports-color: 7.2.0 + dev: true + + /istanbul-lib-source-maps/4.0.1: + resolution: {integrity: sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==} + engines: {node: '>=10'} + dependencies: + debug: 4.3.4 + istanbul-lib-coverage: 3.2.0 + source-map: 0.6.1 + transitivePeerDependencies: + - supports-color + dev: true + + /istanbul-reports/3.1.5: + resolution: {integrity: sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w==} + engines: {node: '>=8'} + dependencies: + html-escaper: 2.0.2 + istanbul-lib-report: 3.0.0 + dev: true + + /jest-changed-files/29.2.0: + resolution: {integrity: sha512-qPVmLLyBmvF5HJrY7krDisx6Voi8DmlV3GZYX0aFNbaQsZeoz1hfxcCMbqDGuQCxU1dJy9eYc2xscE8QrCCYaA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + execa: 5.1.1 + p-limit: 3.1.0 + dev: true + + /jest-circus/29.3.1: + resolution: {integrity: sha512-wpr26sEvwb3qQQbdlmei+gzp6yoSSoSL6GsLPxnuayZSMrSd5Ka7IjAvatpIernBvT2+Ic6RLTg+jSebScmasg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/environment': 29.3.1 + '@jest/expect': 29.3.1 + '@jest/test-result': 29.3.1 + '@jest/types': 29.3.1 + '@types/node': 18.11.9 + chalk: 4.1.2 + co: 4.6.0 + dedent: 0.7.0 + is-generator-fn: 2.1.0 + jest-each: 29.3.1 + jest-matcher-utils: 29.3.1 + jest-message-util: 29.3.1 + jest-runtime: 29.3.1 + jest-snapshot: 29.3.1 + jest-util: 29.3.1 + p-limit: 3.1.0 + pretty-format: 29.3.1 + slash: 3.0.0 + stack-utils: 2.0.6 + transitivePeerDependencies: + - supports-color + dev: true + + /jest-cli/29.3.1_odkjkoia5xunhxkdrka32ib6vi: + resolution: {integrity: sha512-TO/ewvwyvPOiBBuWZ0gm04z3WWP8TIK8acgPzE4IxgsLKQgb377NYGrQLc3Wl/7ndWzIH2CDNNsUjGxwLL43VQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + hasBin: true + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + dependencies: + '@jest/core': 29.3.1_ts-node@10.9.1 + '@jest/test-result': 29.3.1 + '@jest/types': 29.3.1 + chalk: 4.1.2 + exit: 0.1.2 + graceful-fs: 4.2.10 + import-local: 3.1.0 + jest-config: 29.3.1_odkjkoia5xunhxkdrka32ib6vi + jest-util: 29.3.1 + jest-validate: 29.3.1 + prompts: 2.4.2 + yargs: 17.6.2 + transitivePeerDependencies: + - '@types/node' + - supports-color + - ts-node + dev: true + + /jest-config/29.3.1_odkjkoia5xunhxkdrka32ib6vi: + resolution: {integrity: sha512-y0tFHdj2WnTEhxmGUK1T7fgLen7YK4RtfvpLFBXfQkh2eMJAQq24Vx9472lvn5wg0MAO6B+iPfJfzdR9hJYalg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + '@types/node': '*' + ts-node: '>=9.0.0' + peerDependenciesMeta: + '@types/node': + optional: true + ts-node: + optional: true + dependencies: + '@babel/core': 7.20.2 + '@jest/test-sequencer': 29.3.1 + '@jest/types': 29.3.1 + '@types/node': 18.11.9 + babel-jest: 29.3.1_@babel+core@7.20.2 + chalk: 4.1.2 + ci-info: 3.5.0 + deepmerge: 4.2.2 + glob: 7.2.3 + graceful-fs: 4.2.10 + jest-circus: 29.3.1 + jest-environment-node: 29.3.1 + jest-get-type: 29.2.0 + jest-regex-util: 29.2.0 + jest-resolve: 29.3.1 + jest-runner: 29.3.1 + jest-util: 29.3.1 + jest-validate: 29.3.1 + micromatch: 4.0.5 + parse-json: 5.2.0 + pretty-format: 29.3.1 + slash: 3.0.0 + strip-json-comments: 3.1.1 + ts-node: 10.9.1_cbe7ovvae6zqfnmtgctpgpys54 + transitivePeerDependencies: + - supports-color + dev: true + + /jest-diff/29.3.1: + resolution: {integrity: sha512-vU8vyiO7568tmin2lA3r2DP8oRvzhvRcD4DjpXc6uGveQodyk7CKLhQlCSiwgx3g0pFaE88/KLZ0yaTWMc4Uiw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + chalk: 4.1.2 + diff-sequences: 29.3.1 + jest-get-type: 29.2.0 + pretty-format: 29.3.1 + dev: true + + /jest-docblock/29.2.0: + resolution: {integrity: sha512-bkxUsxTgWQGbXV5IENmfiIuqZhJcyvF7tU4zJ/7ioTutdz4ToB5Yx6JOFBpgI+TphRY4lhOyCWGNH/QFQh5T6A==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + detect-newline: 3.1.0 + dev: true + + /jest-each/29.3.1: + resolution: {integrity: sha512-qrZH7PmFB9rEzCSl00BWjZYuS1BSOH8lLuC0azQE9lQrAx3PWGKHTDudQiOSwIy5dGAJh7KA0ScYlCP7JxvFYA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/types': 29.3.1 + chalk: 4.1.2 + jest-get-type: 29.2.0 + jest-util: 29.3.1 + pretty-format: 29.3.1 + dev: true + + /jest-environment-node/29.3.1: + resolution: {integrity: sha512-xm2THL18Xf5sIHoU7OThBPtuH6Lerd+Y1NLYiZJlkE3hbE+7N7r8uvHIl/FkZ5ymKXJe/11SQuf3fv4v6rUMag==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/environment': 29.3.1 + '@jest/fake-timers': 29.3.1 + '@jest/types': 29.3.1 + '@types/node': 18.11.9 + jest-mock: 29.3.1 + jest-util: 29.3.1 + dev: true + + /jest-get-type/29.2.0: + resolution: {integrity: sha512-uXNJlg8hKFEnDgFsrCjznB+sTxdkuqiCL6zMgA75qEbAJjJYTs9XPrvDctrEig2GDow22T/LvHgO57iJhXB/UA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dev: true + + /jest-haste-map/29.3.1: + resolution: {integrity: sha512-/FFtvoG1xjbbPXQLFef+WSU4yrc0fc0Dds6aRPBojUid7qlPqZvxdUBA03HW0fnVHXVCnCdkuoghYItKNzc/0A==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/types': 29.3.1 + '@types/graceful-fs': 4.1.5 + '@types/node': 18.11.9 + anymatch: 3.1.2 + fb-watchman: 2.0.2 + graceful-fs: 4.2.10 + jest-regex-util: 29.2.0 + jest-util: 29.3.1 + jest-worker: 29.3.1 + micromatch: 4.0.5 + walker: 1.0.8 + optionalDependencies: + fsevents: 2.3.2 + dev: true + + /jest-leak-detector/29.3.1: + resolution: {integrity: sha512-3DA/VVXj4zFOPagGkuqHnSQf1GZBmmlagpguxEERO6Pla2g84Q1MaVIB3YMxgUaFIaYag8ZnTyQgiZ35YEqAQA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + jest-get-type: 29.2.0 + pretty-format: 29.3.1 + dev: true + + /jest-matcher-utils/29.3.1: + resolution: {integrity: sha512-fkRMZUAScup3txIKfMe3AIZZmPEjWEdsPJFK3AIy5qRohWqQFg1qrmKfYXR9qEkNc7OdAu2N4KPHibEmy4HPeQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + chalk: 4.1.2 + jest-diff: 29.3.1 + jest-get-type: 29.2.0 + pretty-format: 29.3.1 + dev: true + + /jest-message-util/29.3.1: + resolution: {integrity: sha512-lMJTbgNcDm5z+6KDxWtqOFWlGQxD6XaYwBqHR8kmpkP+WWWG90I35kdtQHY67Ay5CSuydkTBbJG+tH9JShFCyA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@babel/code-frame': 7.18.6 + '@jest/types': 29.3.1 + '@types/stack-utils': 2.0.1 + chalk: 4.1.2 + graceful-fs: 4.2.10 + micromatch: 4.0.5 + pretty-format: 29.3.1 + slash: 3.0.0 + stack-utils: 2.0.6 + dev: true + + /jest-mock/29.3.1: + resolution: {integrity: sha512-H8/qFDtDVMFvFP4X8NuOT3XRDzOUTz+FeACjufHzsOIBAxivLqkB1PoLCaJx9iPPQ8dZThHPp/G3WRWyMgA3JA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/types': 29.3.1 + '@types/node': 18.11.9 + jest-util: 29.3.1 + dev: true + + /jest-pnp-resolver/1.2.2_jest-resolve@29.3.1: + resolution: {integrity: sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w==} + engines: {node: '>=6'} + peerDependencies: + jest-resolve: '*' + peerDependenciesMeta: + jest-resolve: + optional: true + dependencies: + jest-resolve: 29.3.1 + dev: true + + /jest-regex-util/29.2.0: + resolution: {integrity: sha512-6yXn0kg2JXzH30cr2NlThF+70iuO/3irbaB4mh5WyqNIvLLP+B6sFdluO1/1RJmslyh/f9osnefECflHvTbwVA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dev: true + + /jest-resolve-dependencies/29.3.1: + resolution: {integrity: sha512-Vk0cYq0byRw2WluNmNWGqPeRnZ3p3hHmjJMp2dyyZeYIfiBskwq4rpiuGFR6QGAdbj58WC7HN4hQHjf2mpvrLA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + jest-regex-util: 29.2.0 + jest-snapshot: 29.3.1 + transitivePeerDependencies: + - supports-color + dev: true + + /jest-resolve/29.3.1: + resolution: {integrity: sha512-amXJgH/Ng712w3Uz5gqzFBBjxV8WFLSmNjoreBGMqxgCz5cH7swmBZzgBaCIOsvb0NbpJ0vgaSFdJqMdT+rADw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + chalk: 4.1.2 + graceful-fs: 4.2.10 + jest-haste-map: 29.3.1 + jest-pnp-resolver: 1.2.2_jest-resolve@29.3.1 + jest-util: 29.3.1 + jest-validate: 29.3.1 + resolve: 1.22.1 + resolve.exports: 1.1.0 + slash: 3.0.0 + dev: true + + /jest-runner/29.3.1: + resolution: {integrity: sha512-oFvcwRNrKMtE6u9+AQPMATxFcTySyKfLhvso7Sdk/rNpbhg4g2GAGCopiInk1OP4q6gz3n6MajW4+fnHWlU3bA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/console': 29.3.1 + '@jest/environment': 29.3.1 + '@jest/test-result': 29.3.1 + '@jest/transform': 29.3.1 + '@jest/types': 29.3.1 + '@types/node': 18.11.9 + chalk: 4.1.2 + emittery: 0.13.1 + graceful-fs: 4.2.10 + jest-docblock: 29.2.0 + jest-environment-node: 29.3.1 + jest-haste-map: 29.3.1 + jest-leak-detector: 29.3.1 + jest-message-util: 29.3.1 + jest-resolve: 29.3.1 + jest-runtime: 29.3.1 + jest-util: 29.3.1 + jest-watcher: 29.3.1 + jest-worker: 29.3.1 + p-limit: 3.1.0 + source-map-support: 0.5.13 + transitivePeerDependencies: + - supports-color + dev: true + + /jest-runtime/29.3.1: + resolution: {integrity: sha512-jLzkIxIqXwBEOZx7wx9OO9sxoZmgT2NhmQKzHQm1xwR1kNW/dn0OjxR424VwHHf1SPN6Qwlb5pp1oGCeFTQ62A==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/environment': 29.3.1 + '@jest/fake-timers': 29.3.1 + '@jest/globals': 29.3.1 + '@jest/source-map': 29.2.0 + '@jest/test-result': 29.3.1 + '@jest/transform': 29.3.1 + '@jest/types': 29.3.1 + '@types/node': 18.11.9 + chalk: 4.1.2 + cjs-module-lexer: 1.2.2 + collect-v8-coverage: 1.0.1 + glob: 7.2.3 + graceful-fs: 4.2.10 + jest-haste-map: 29.3.1 + jest-message-util: 29.3.1 + jest-mock: 29.3.1 + jest-regex-util: 29.2.0 + jest-resolve: 29.3.1 + jest-snapshot: 29.3.1 + jest-util: 29.3.1 + slash: 3.0.0 + strip-bom: 4.0.0 + transitivePeerDependencies: + - supports-color + dev: true + + /jest-snapshot/29.3.1: + resolution: {integrity: sha512-+3JOc+s28upYLI2OJM4PWRGK9AgpsMs/ekNryUV0yMBClT9B1DF2u2qay8YxcQd338PPYSFNb0lsar1B49sLDA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@babel/core': 7.20.2 + '@babel/generator': 7.20.4 + '@babel/plugin-syntax-jsx': 7.18.6_@babel+core@7.20.2 + '@babel/plugin-syntax-typescript': 7.20.0_@babel+core@7.20.2 + '@babel/traverse': 7.20.1 + '@babel/types': 7.20.2 + '@jest/expect-utils': 29.3.1 + '@jest/transform': 29.3.1 + '@jest/types': 29.3.1 + '@types/babel__traverse': 7.18.2 + '@types/prettier': 2.7.1 + babel-preset-current-node-syntax: 1.0.1_@babel+core@7.20.2 + chalk: 4.1.2 + expect: 29.3.1 + graceful-fs: 4.2.10 + jest-diff: 29.3.1 + jest-get-type: 29.2.0 + jest-haste-map: 29.3.1 + jest-matcher-utils: 29.3.1 + jest-message-util: 29.3.1 + jest-util: 29.3.1 + natural-compare: 1.4.0 + pretty-format: 29.3.1 + semver: 7.3.8 + transitivePeerDependencies: + - supports-color + dev: true + + /jest-util/29.3.1: + resolution: {integrity: sha512-7YOVZaiX7RJLv76ZfHt4nbNEzzTRiMW/IiOG7ZOKmTXmoGBxUDefgMAxQubu6WPVqP5zSzAdZG0FfLcC7HOIFQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/types': 29.3.1 + '@types/node': 18.11.9 + chalk: 4.1.2 + ci-info: 3.5.0 + graceful-fs: 4.2.10 + picomatch: 2.3.1 + dev: true + + /jest-validate/29.3.1: + resolution: {integrity: sha512-N9Lr3oYR2Mpzuelp1F8negJR3YE+L1ebk1rYA5qYo9TTY3f9OWdptLoNSPP9itOCBIRBqjt/S5XHlzYglLN67g==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/types': 29.3.1 + camelcase: 6.3.0 + chalk: 4.1.2 + jest-get-type: 29.2.0 + leven: 3.1.0 + pretty-format: 29.3.1 + dev: true + + /jest-watcher/29.3.1: + resolution: {integrity: sha512-RspXG2BQFDsZSRKGCT/NiNa8RkQ1iKAjrO0//soTMWx/QUt+OcxMqMSBxz23PYGqUuWm2+m2mNNsmj0eIoOaFg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/test-result': 29.3.1 + '@jest/types': 29.3.1 + '@types/node': 18.11.9 + ansi-escapes: 4.3.2 + chalk: 4.1.2 + emittery: 0.13.1 + jest-util: 29.3.1 + string-length: 4.0.2 + dev: true + + /jest-worker/29.3.1: + resolution: {integrity: sha512-lY4AnnmsEWeiXirAIA0c9SDPbuCBq8IYuDVL8PMm0MZ2PEs2yPvRA/J64QBXuZp7CYKrDM/rmNrc9/i3KJQncw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@types/node': 18.11.9 + jest-util: 29.3.1 + merge-stream: 2.0.0 + supports-color: 8.1.1 + dev: true + + /jest/29.3.0_odkjkoia5xunhxkdrka32ib6vi: + resolution: {integrity: sha512-lWmHtOcJSjR6FYRw+4oo7456QUe6LN73Lw6HLwOWKTPLcyQF60cMh0EoIHi67dV74SY5tw/kL+jYC+Ji43ScUg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + hasBin: true + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + dependencies: + '@jest/core': 29.3.1_ts-node@10.9.1 + '@jest/types': 29.3.1 + import-local: 3.1.0 + jest-cli: 29.3.1_odkjkoia5xunhxkdrka32ib6vi + transitivePeerDependencies: + - '@types/node' + - supports-color + - ts-node + dev: true + + /joycon/3.1.1: + resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==} + engines: {node: '>=10'} + dev: true + + /js-tokens/4.0.0: + resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + dev: true + + /js-yaml/3.14.1: + resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} + hasBin: true + dependencies: + argparse: 1.0.10 + esprima: 4.0.1 + dev: true + + /jsesc/2.5.2: + resolution: {integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==} + engines: {node: '>=4'} + hasBin: true + dev: true + + /json-parse-even-better-errors/2.3.1: + resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} + dev: true + + /json5/2.2.1: + resolution: {integrity: sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==} + engines: {node: '>=6'} + hasBin: true + dev: true + + /kleur/3.0.3: + resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==} + engines: {node: '>=6'} + dev: true + + /leven/3.1.0: + resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==} + engines: {node: '>=6'} + dev: true + + /lilconfig/2.0.6: + resolution: {integrity: sha512-9JROoBW7pobfsx+Sq2JsASvCo6Pfo6WWoUW79HuB1BCoBXD4PLWJPqDF6fNj67pqBYTbAHkE57M1kS/+L1neOg==} + engines: {node: '>=10'} + dev: true + + /lines-and-columns/1.2.4: + resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} + dev: true + + /load-tsconfig/0.2.3: + resolution: {integrity: sha512-iyT2MXws+dc2Wi6o3grCFtGXpeMvHmJqS27sMPGtV2eUu4PeFnG+33I8BlFK1t1NWMjOpcx9bridn5yxLDX2gQ==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dev: true + + /locate-path/5.0.0: + resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} + engines: {node: '>=8'} + dependencies: + p-locate: 4.1.0 + dev: true + + /lodash.memoize/4.1.2: + resolution: {integrity: sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==} + dev: true + + /lodash.sortby/4.7.0: + resolution: {integrity: sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==} + dev: true + + /lru-cache/6.0.0: + resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} + engines: {node: '>=10'} + dependencies: + yallist: 4.0.0 + dev: true + + /make-dir/3.1.0: + resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} + engines: {node: '>=8'} + dependencies: + semver: 6.3.0 + dev: true + + /make-error/1.3.6: + resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} + dev: true + + /makeerror/1.0.12: + resolution: {integrity: sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==} + dependencies: + tmpl: 1.0.5 + dev: true + + /media-typer/0.3.0: + resolution: {integrity: sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==} + engines: {node: '>= 0.6'} + dev: true + + /merge-descriptors/1.0.1: + resolution: {integrity: sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==} + dev: true + + /merge-stream/2.0.0: + resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} + dev: true + + /merge2/1.4.1: + resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} + engines: {node: '>= 8'} + dev: true + + /methods/1.1.2: + resolution: {integrity: sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==} + engines: {node: '>= 0.6'} + dev: true + + /micromatch/4.0.5: + resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} + engines: {node: '>=8.6'} + dependencies: + braces: 3.0.2 + picomatch: 2.3.1 + dev: true + + /mime-db/1.52.0: + resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} + engines: {node: '>= 0.6'} + dev: true + + /mime-types/2.1.35: + resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} + engines: {node: '>= 0.6'} + dependencies: + mime-db: 1.52.0 + dev: true + + /mime/1.6.0: + resolution: {integrity: sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==} + engines: {node: '>=4'} + hasBin: true + dev: true + + /mimic-fn/2.1.0: + resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} + engines: {node: '>=6'} + dev: true + + /minimatch/3.1.2: + resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} + dependencies: + brace-expansion: 1.1.11 + dev: true + + /minimist/1.2.7: + resolution: {integrity: sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==} + dev: true + + /mkdirp/0.5.6: + resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==} + hasBin: true + dependencies: + minimist: 1.2.7 + dev: true + + /ms/2.0.0: + resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} + dev: true + + /ms/2.1.2: + resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} + dev: true + + /ms/2.1.3: + resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + dev: true + + /multer/1.4.5-lts.1: + resolution: {integrity: sha512-ywPWvcDMeH+z9gQq5qYHCCy+ethsk4goepZ45GLD63fOu0YcNecQxi64nDs3qluZB+murG3/D4dJ7+dGctcCQQ==} + engines: {node: '>= 6.0.0'} + dependencies: + append-field: 1.0.0 + busboy: 1.6.0 + concat-stream: 1.6.2 + mkdirp: 0.5.6 + object-assign: 4.1.1 + type-is: 1.6.18 + xtend: 4.0.2 + dev: true + + /mz/2.7.0: + resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==} + dependencies: + any-promise: 1.3.0 + object-assign: 4.1.1 + thenify-all: 1.6.0 + dev: true + + /natural-compare/1.4.0: + resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} + dev: true + + /negotiator/0.6.3: + resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==} + engines: {node: '>= 0.6'} + dev: true + + /node-int64/0.4.0: + resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==} + dev: true + + /node-releases/2.0.6: + resolution: {integrity: sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg==} + dev: true + + /normalize-path/3.0.0: + resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} + engines: {node: '>=0.10.0'} + dev: true + + /npm-run-path/4.0.1: + resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} + engines: {node: '>=8'} + dependencies: + path-key: 3.1.1 + dev: true + + /object-assign/4.1.1: + resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} + engines: {node: '>=0.10.0'} + dev: true + + /object-inspect/1.12.2: + resolution: {integrity: sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==} + dev: true + + /on-finished/2.4.1: + resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==} + engines: {node: '>= 0.8'} + dependencies: + ee-first: 1.1.1 + dev: true + + /once/1.4.0: + resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} + dependencies: + wrappy: 1.0.2 + dev: true + + /onetime/5.1.2: + resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} + engines: {node: '>=6'} + dependencies: + mimic-fn: 2.1.0 + dev: true + + /p-limit/2.3.0: + resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} + engines: {node: '>=6'} + dependencies: + p-try: 2.2.0 + dev: true + + /p-limit/3.1.0: + resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} + engines: {node: '>=10'} + dependencies: + yocto-queue: 0.1.0 + dev: true + + /p-locate/4.1.0: + resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} + engines: {node: '>=8'} + dependencies: + p-limit: 2.3.0 + dev: true + + /p-try/2.2.0: + resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} + engines: {node: '>=6'} + dev: true + + /parse-json/5.2.0: + resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} + engines: {node: '>=8'} + dependencies: + '@babel/code-frame': 7.18.6 + error-ex: 1.3.2 + json-parse-even-better-errors: 2.3.1 + lines-and-columns: 1.2.4 + dev: true + + /parseurl/1.3.3: + resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==} + engines: {node: '>= 0.8'} + dev: true + + /path-exists/4.0.0: + resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} + engines: {node: '>=8'} + dev: true + + /path-is-absolute/1.0.1: + resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} + engines: {node: '>=0.10.0'} + dev: true + + /path-key/3.1.1: + resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} + engines: {node: '>=8'} + dev: true + + /path-parse/1.0.7: + resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} + dev: true + + /path-to-regexp/0.1.7: + resolution: {integrity: sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==} + dev: true + + /path-type/4.0.0: + resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} + engines: {node: '>=8'} + dev: true + + /picocolors/1.0.0: + resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} + dev: true + + /picomatch/2.3.1: + resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} + engines: {node: '>=8.6'} + dev: true + + /pirates/4.0.5: + resolution: {integrity: sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ==} + engines: {node: '>= 6'} + dev: true + + /pkg-dir/4.2.0: + resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} + engines: {node: '>=8'} + dependencies: + find-up: 4.1.0 + dev: true + + /postcss-load-config/3.1.4_ts-node@10.9.1: + resolution: {integrity: sha512-6DiM4E7v4coTE4uzA8U//WhtPwyhiim3eyjEMFCnUpzbrkK9wJHgKDT2mR+HbtSrd/NubVaYTOpSpjUl8NQeRg==} + engines: {node: '>= 10'} + peerDependencies: + postcss: '>=8.0.9' + ts-node: '>=9.0.0' + peerDependenciesMeta: + postcss: + optional: true + ts-node: + optional: true + dependencies: + lilconfig: 2.0.6 + ts-node: 10.9.1_cbe7ovvae6zqfnmtgctpgpys54 + yaml: 1.10.2 + dev: true + + /pretty-format/29.3.1: + resolution: {integrity: sha512-FyLnmb1cYJV8biEIiRyzRFvs2lry7PPIvOqKVe1GCUEYg4YGmlx1qG9EJNMxArYm7piII4qb8UV1Pncq5dxmcg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/schemas': 29.0.0 + ansi-styles: 5.2.0 + react-is: 18.2.0 + dev: true + + /process-nextick-args/2.0.1: + resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} + dev: true + + /prompts/2.4.2: + resolution: {integrity: sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==} + engines: {node: '>= 6'} + dependencies: + kleur: 3.0.3 + sisteransi: 1.0.5 + dev: true + + /proxy-addr/2.0.7: + resolution: {integrity: sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==} + engines: {node: '>= 0.10'} + dependencies: + forwarded: 0.2.0 + ipaddr.js: 1.9.1 + dev: true + + /proxy-from-env/1.1.0: + resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} + dev: true + + /punycode/2.1.1: + resolution: {integrity: sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==} + engines: {node: '>=6'} + dev: true + + /qs/6.11.0: + resolution: {integrity: sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==} + engines: {node: '>=0.6'} + dependencies: + side-channel: 1.0.4 + dev: true + + /queue-microtask/1.2.3: + resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} + dev: true + + /range-parser/1.2.1: + resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==} + engines: {node: '>= 0.6'} + dev: true + + /raw-body/2.5.1: + resolution: {integrity: sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==} + engines: {node: '>= 0.8'} + dependencies: + bytes: 3.1.2 + http-errors: 2.0.0 + iconv-lite: 0.4.24 + unpipe: 1.0.0 + dev: true + + /react-is/18.2.0: + resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==} + dev: true + + /readable-stream/2.3.7: + resolution: {integrity: sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==} + dependencies: + core-util-is: 1.0.3 + inherits: 2.0.4 + isarray: 1.0.0 + process-nextick-args: 2.0.1 + safe-buffer: 5.1.2 + string_decoder: 1.1.1 + util-deprecate: 1.0.2 + dev: true + + /readdirp/3.6.0: + resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} + engines: {node: '>=8.10.0'} + dependencies: + picomatch: 2.3.1 + dev: true + + /require-directory/2.1.1: + resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} + engines: {node: '>=0.10.0'} + dev: true + + /resolve-cwd/3.0.0: + resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} + engines: {node: '>=8'} + dependencies: + resolve-from: 5.0.0 + dev: true + + /resolve-from/5.0.0: + resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} + engines: {node: '>=8'} + dev: true + + /resolve.exports/1.1.0: + resolution: {integrity: sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ==} + engines: {node: '>=10'} + dev: true + + /resolve/1.22.1: + resolution: {integrity: sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==} + hasBin: true + dependencies: + is-core-module: 2.11.0 + path-parse: 1.0.7 + supports-preserve-symlinks-flag: 1.0.0 + dev: true + + /reusify/1.0.4: + resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} + engines: {iojs: '>=1.0.0', node: '>=0.10.0'} + dev: true + + /rimraf/3.0.2: + resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} + hasBin: true + dependencies: + glob: 7.2.3 + dev: true + + /rollup/2.79.1: + resolution: {integrity: sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==} + engines: {node: '>=10.0.0'} + hasBin: true + optionalDependencies: + fsevents: 2.3.2 + dev: true + + /run-parallel/1.2.0: + resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} + dependencies: + queue-microtask: 1.2.3 + dev: true + + /safe-buffer/5.1.2: + resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} + dev: true + + /safe-buffer/5.2.1: + resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} + dev: true + + /safer-buffer/2.1.2: + resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + dev: true + + /semver/6.3.0: + resolution: {integrity: sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==} + hasBin: true + dev: true + + /semver/7.3.8: + resolution: {integrity: sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==} + engines: {node: '>=10'} + hasBin: true + dependencies: + lru-cache: 6.0.0 + dev: true + + /send/0.18.0: + resolution: {integrity: sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==} + engines: {node: '>= 0.8.0'} + dependencies: + debug: 2.6.9 + depd: 2.0.0 + destroy: 1.2.0 + encodeurl: 1.0.2 + escape-html: 1.0.3 + etag: 1.8.1 + fresh: 0.5.2 + http-errors: 2.0.0 + mime: 1.6.0 + ms: 2.1.3 + on-finished: 2.4.1 + range-parser: 1.2.1 + statuses: 2.0.1 + transitivePeerDependencies: + - supports-color + dev: true + + /serve-static/1.15.0: + resolution: {integrity: sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==} + engines: {node: '>= 0.8.0'} + dependencies: + encodeurl: 1.0.2 + escape-html: 1.0.3 + parseurl: 1.3.3 + send: 0.18.0 + transitivePeerDependencies: + - supports-color + dev: true + + /setprototypeof/1.2.0: + resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==} + dev: true + + /shebang-command/2.0.0: + resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} + engines: {node: '>=8'} + dependencies: + shebang-regex: 3.0.0 + dev: true + + /shebang-regex/3.0.0: + resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} + engines: {node: '>=8'} + dev: true + + /side-channel/1.0.4: + resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==} + dependencies: + call-bind: 1.0.2 + get-intrinsic: 1.1.3 + object-inspect: 1.12.2 + dev: true + + /signal-exit/3.0.7: + resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} + dev: true + + /sisteransi/1.0.5: + resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} + dev: true + + /slash/3.0.0: + resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} + engines: {node: '>=8'} + dev: true + + /source-map-support/0.5.13: + resolution: {integrity: sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==} + dependencies: + buffer-from: 1.1.2 + source-map: 0.6.1 + dev: true + + /source-map/0.6.1: + resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} + engines: {node: '>=0.10.0'} + dev: true + + /source-map/0.8.0-beta.0: + resolution: {integrity: sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==} + engines: {node: '>= 8'} + dependencies: + whatwg-url: 7.1.0 + dev: true + + /sprintf-js/1.0.3: + resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} + dev: true + + /stack-utils/2.0.6: + resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} + engines: {node: '>=10'} + dependencies: + escape-string-regexp: 2.0.0 + dev: true + + /statuses/2.0.1: + resolution: {integrity: sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==} + engines: {node: '>= 0.8'} + dev: true + + /streamsearch/1.1.0: + resolution: {integrity: sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==} + engines: {node: '>=10.0.0'} + dev: true + + /string-length/4.0.2: + resolution: {integrity: sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==} + engines: {node: '>=10'} + dependencies: + char-regex: 1.0.2 + strip-ansi: 6.0.1 + dev: true + + /string-width/4.2.3: + resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} + engines: {node: '>=8'} + dependencies: + emoji-regex: 8.0.0 + is-fullwidth-code-point: 3.0.0 + strip-ansi: 6.0.1 + dev: true + + /string_decoder/1.1.1: + resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==} + dependencies: + safe-buffer: 5.1.2 + dev: true + + /strip-ansi/6.0.1: + resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} + engines: {node: '>=8'} + dependencies: + ansi-regex: 5.0.1 + dev: true + + /strip-bom/4.0.0: + resolution: {integrity: sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==} + engines: {node: '>=8'} + dev: true + + /strip-final-newline/2.0.0: + resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} + engines: {node: '>=6'} + dev: true + + /strip-json-comments/3.1.1: + resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} + engines: {node: '>=8'} + dev: true + + /sucrase/3.28.0: + resolution: {integrity: sha512-TK9600YInjuiIhVM3729rH4ZKPOsGeyXUwY+Ugu9eilNbdTFyHr6XcAGYbRVZPDgWj6tgI7bx95aaJjHnbffag==} + engines: {node: '>=8'} + hasBin: true + dependencies: + commander: 4.1.1 + glob: 7.1.6 + lines-and-columns: 1.2.4 + mz: 2.7.0 + pirates: 4.0.5 + ts-interface-checker: 0.1.13 + dev: true + + /supports-color/5.5.0: + resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} + engines: {node: '>=4'} + dependencies: + has-flag: 3.0.0 + dev: true + + /supports-color/7.2.0: + resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} + engines: {node: '>=8'} + dependencies: + has-flag: 4.0.0 + dev: true + + /supports-color/8.1.1: + resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==} + engines: {node: '>=10'} + dependencies: + has-flag: 4.0.0 + dev: true + + /supports-preserve-symlinks-flag/1.0.0: + resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} + engines: {node: '>= 0.4'} + dev: true + + /test-exclude/6.0.0: + resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==} + engines: {node: '>=8'} + dependencies: + '@istanbuljs/schema': 0.1.3 + glob: 7.2.3 + minimatch: 3.1.2 + dev: true + + /thenify-all/1.6.0: + resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==} + engines: {node: '>=0.8'} + dependencies: + thenify: 3.3.1 + dev: true + + /thenify/3.3.1: + resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==} + dependencies: + any-promise: 1.3.0 + dev: true + + /tmpl/1.0.5: + resolution: {integrity: sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==} + dev: true + + /to-fast-properties/2.0.0: + resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==} + engines: {node: '>=4'} + dev: true + + /to-regex-range/5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + dependencies: + is-number: 7.0.0 + dev: true + + /toidentifier/1.0.1: + resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==} + engines: {node: '>=0.6'} + dev: true + + /tr46/1.0.1: + resolution: {integrity: sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==} + dependencies: + punycode: 2.1.1 + dev: true + + /tree-kill/1.2.2: + resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==} + hasBin: true + dev: true + + /ts-interface-checker/0.1.13: + resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} + dev: true + + /ts-jest/29.0.3_zni4oow62srprqrjg644purjpe: + resolution: {integrity: sha512-Ibygvmuyq1qp/z3yTh9QTwVVAbFdDy/+4BtIQR2sp6baF2SJU/8CKK/hhnGIDY2L90Az2jIqTwZPnN2p+BweiQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + hasBin: true + peerDependencies: + '@babel/core': '>=7.0.0-beta.0 <8' + '@jest/types': ^29.0.0 + babel-jest: ^29.0.0 + esbuild: '*' + jest: ^29.0.0 + typescript: '>=4.3' + peerDependenciesMeta: + '@babel/core': + optional: true + '@jest/types': + optional: true + babel-jest: + optional: true + esbuild: + optional: true + dependencies: + '@jest/types': 29.3.1 + bs-logger: 0.2.6 + fast-json-stable-stringify: 2.1.0 + jest: 29.3.0_odkjkoia5xunhxkdrka32ib6vi + jest-util: 29.3.1 + json5: 2.2.1 + lodash.memoize: 4.1.2 + make-error: 1.3.6 + semver: 7.3.8 + typescript: 4.8.4 + yargs-parser: 21.1.1 + dev: true + + /ts-node/10.9.1_cbe7ovvae6zqfnmtgctpgpys54: + resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} + hasBin: true + peerDependencies: + '@swc/core': '>=1.2.50' + '@swc/wasm': '>=1.2.50' + '@types/node': '*' + typescript: '>=2.7' + peerDependenciesMeta: + '@swc/core': + optional: true + '@swc/wasm': + optional: true + dependencies: + '@cspotcode/source-map-support': 0.8.1 + '@tsconfig/node10': 1.0.9 + '@tsconfig/node12': 1.0.11 + '@tsconfig/node14': 1.0.3 + '@tsconfig/node16': 1.0.3 + '@types/node': 18.11.9 + acorn: 8.8.1 + acorn-walk: 8.2.0 + arg: 4.1.3 + create-require: 1.1.1 + diff: 4.0.2 + make-error: 1.3.6 + typescript: 4.8.4 + v8-compile-cache-lib: 3.0.1 + yn: 3.1.1 + dev: true + + /tsup/6.3.0_mwhvu7sfp6vq5ryuwb6hlbjfka: + resolution: {integrity: sha512-IaNQO/o1rFgadLhNonVKNCT2cks+vvnWX3DnL8sB87lBDqRvJXHENr5lSPJlqwplUlDxSwZK8dSg87rgBu6Emw==} + engines: {node: '>=14'} + hasBin: true + peerDependencies: + '@swc/core': ^1 + postcss: ^8.4.12 + typescript: ^4.1.0 + peerDependenciesMeta: + '@swc/core': + optional: true + postcss: + optional: true + typescript: + optional: true + dependencies: + bundle-require: 3.1.2_esbuild@0.15.13 + cac: 6.7.14 + chokidar: 3.5.3 + debug: 4.3.4 + esbuild: 0.15.13 + execa: 5.1.1 + globby: 11.1.0 + joycon: 3.1.1 + postcss-load-config: 3.1.4_ts-node@10.9.1 + resolve-from: 5.0.0 + rollup: 2.79.1 + source-map: 0.8.0-beta.0 + sucrase: 3.28.0 + tree-kill: 1.2.2 + typescript: 4.8.4 + transitivePeerDependencies: + - supports-color + - ts-node + dev: true + + /turbo-darwin-64/1.6.3: + resolution: {integrity: sha512-QmDIX0Yh1wYQl0bUS0gGWwNxpJwrzZU2GIAYt3aOKoirWA2ecnyb3R6ludcS1znfNV2MfunP+l8E3ncxUHwtjA==} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /turbo-darwin-arm64/1.6.3: + resolution: {integrity: sha512-75DXhFpwE7CinBbtxTxH08EcWrxYSPFow3NaeFwsG8aymkWXF+U2aukYHJA6I12n9/dGqf7yRXzkF0S/9UtdyQ==} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /turbo-linux-64/1.6.3: + resolution: {integrity: sha512-O9uc6J0yoRPWdPg9THRQi69K6E2iZ98cRHNvus05lZbcPzZTxJYkYGb5iagCmCW/pq6fL4T4oLWAd6evg2LGQA==} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /turbo-linux-arm64/1.6.3: + resolution: {integrity: sha512-dCy667qqEtZIhulsRTe8hhWQNCJO0i20uHXv7KjLHuFZGCeMbWxB8rsneRoY+blf8+QNqGuXQJxak7ayjHLxiA==} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /turbo-windows-64/1.6.3: + resolution: {integrity: sha512-lKRqwL3mrVF09b9KySSaOwetehmGknV9EcQTF7d2dxngGYYX1WXoQLjFP9YYH8ZV07oPm+RUOAKSCQuDuMNhiA==} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /turbo-windows-arm64/1.6.3: + resolution: {integrity: sha512-BXY1sDPEA1DgPwuENvDCD8B7Hb0toscjus941WpL8CVd10hg9pk/MWn9CNgwDO5Q9ks0mw+liDv2EMnleEjeNA==} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /turbo/1.6.3: + resolution: {integrity: sha512-FtfhJLmEEtHveGxW4Ye/QuY85AnZ2ZNVgkTBswoap7UMHB1+oI4diHPNyqrQLG4K1UFtCkjOlVoLsllUh/9QRw==} + hasBin: true + requiresBuild: true + optionalDependencies: + turbo-darwin-64: 1.6.3 + turbo-darwin-arm64: 1.6.3 + turbo-linux-64: 1.6.3 + turbo-linux-arm64: 1.6.3 + turbo-windows-64: 1.6.3 + turbo-windows-arm64: 1.6.3 + dev: true + + /type-detect/4.0.8: + resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} + engines: {node: '>=4'} + dev: true + + /type-fest/0.21.3: + resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} + engines: {node: '>=10'} + dev: true + + /type-is/1.6.18: + resolution: {integrity: sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==} + engines: {node: '>= 0.6'} + dependencies: + media-typer: 0.3.0 + mime-types: 2.1.35 + dev: true + + /typedarray/0.0.6: + resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} + dev: true + + /typescript/4.8.4: + resolution: {integrity: sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==} + engines: {node: '>=4.2.0'} + hasBin: true + dev: true + + /unpipe/1.0.0: + resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} + engines: {node: '>= 0.8'} + dev: true + + /update-browserslist-db/1.0.10_browserslist@4.21.4: + resolution: {integrity: sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==} + hasBin: true + peerDependencies: + browserslist: '>= 4.21.0' + dependencies: + browserslist: 4.21.4 + escalade: 3.1.1 + picocolors: 1.0.0 + dev: true + + /util-deprecate/1.0.2: + resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} + dev: true + + /utils-merge/1.0.1: + resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==} + engines: {node: '>= 0.4.0'} + dev: true + + /v8-compile-cache-lib/3.0.1: + resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} + dev: true + + /v8-to-istanbul/9.0.1: + resolution: {integrity: sha512-74Y4LqY74kLE6IFyIjPtkSTWzUZmj8tdHT9Ii/26dvQ6K9Dl2NbEfj0XgU2sHCtKgt5VupqhlO/5aWuqS+IY1w==} + engines: {node: '>=10.12.0'} + dependencies: + '@jridgewell/trace-mapping': 0.3.17 + '@types/istanbul-lib-coverage': 2.0.4 + convert-source-map: 1.9.0 + dev: true + + /vary/1.1.2: + resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} + engines: {node: '>= 0.8'} + dev: true + + /walker/1.0.8: + resolution: {integrity: sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==} + dependencies: + makeerror: 1.0.12 + dev: true + + /webidl-conversions/4.0.2: + resolution: {integrity: sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==} + dev: true + + /whatwg-url/7.1.0: + resolution: {integrity: sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==} + dependencies: + lodash.sortby: 4.7.0 + tr46: 1.0.1 + webidl-conversions: 4.0.2 + dev: true + + /which/2.0.2: + resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} + engines: {node: '>= 8'} + hasBin: true + dependencies: + isexe: 2.0.0 + dev: true + + /wrap-ansi/7.0.0: + resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} + engines: {node: '>=10'} + dependencies: + ansi-styles: 4.3.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + dev: true + + /wrappy/1.0.2: + resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + dev: true + + /write-file-atomic/4.0.2: + resolution: {integrity: sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==} + engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} + dependencies: + imurmurhash: 0.1.4 + signal-exit: 3.0.7 + dev: true + + /xtend/4.0.2: + resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==} + engines: {node: '>=0.4'} + dev: true + + /y18n/5.0.8: + resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} + engines: {node: '>=10'} + dev: true + + /yallist/4.0.0: + resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} + dev: true + + /yaml/1.10.2: + resolution: {integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==} + engines: {node: '>= 6'} + dev: true + + /yargs-parser/21.1.1: + resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} + engines: {node: '>=12'} + dev: true + + /yargs/17.6.2: + resolution: {integrity: sha512-1/9UrdHjDZc0eOU0HxOHoS78C69UD3JRMvzlJ7S79S2nTaWRA/whGCTV8o9e/N/1Va9YIV7Q4sOxD8VV4pCWOw==} + engines: {node: '>=12'} + dependencies: + cliui: 8.0.1 + escalade: 3.1.1 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + string-width: 4.2.3 + y18n: 5.0.8 + yargs-parser: 21.1.1 + dev: true + + /yn/3.1.1: + resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} + engines: {node: '>=6'} + dev: true + + /yocto-queue/0.1.0: + resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} + engines: {node: '>=10'} + dev: true + + /zod/3.19.1: + resolution: {integrity: sha512-LYjZsEDhCdYET9ikFu6dVPGp2YH9DegXjdJToSzD9rO6fy4qiRYFoyEYwps88OseJlPyl2NOe2iJuhEhL7IpEA==} + dev: true diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml new file mode 100644 index 00000000..dee51e92 --- /dev/null +++ b/pnpm-workspace.yaml @@ -0,0 +1,2 @@ +packages: + - "packages/*" diff --git a/turbo.json b/turbo.json new file mode 100644 index 00000000..1fd95794 --- /dev/null +++ b/turbo.json @@ -0,0 +1,12 @@ +{ + "$schema": "https://turbo.build/schema.json", + "pipeline": { + "build": { + "dependsOn": ["^build"], + "outputs": ["lib/**"] + }, + "test": {}, + "lint": {}, + "deploy": {} + } +} diff --git a/yarn.lock b/yarn.lock deleted file mode 100644 index 6badee86..00000000 --- a/yarn.lock +++ /dev/null @@ -1,3721 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@ampproject/remapping@^2.0.0": - version "2.1.1" - resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.1.1.tgz#7922fb0817bf3166d8d9e258c57477e3fd1c3610" - integrity sha512-Aolwjd7HSC2PyY0fDj/wA/EimQT4HfEnFYNp5s9CQlrdhyvWTtvZ5YzrUPu6R6/1jKiUlxu8bUhkdSnKHNAHMA== - dependencies: - "@jridgewell/trace-mapping" "^0.3.0" - -"@ampproject/remapping@^2.1.0": - version "2.2.0" - resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.0.tgz#56c133824780de3174aed5ab6834f3026790154d" - integrity sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w== - dependencies: - "@jridgewell/gen-mapping" "^0.1.0" - "@jridgewell/trace-mapping" "^0.3.9" - -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.16.7.tgz#44416b6bd7624b998f5b1af5d470856c40138789" - integrity sha512-iAXqUn8IIeBTNd72xsFlgaXHkMBMt6y4HJp1tIaK465CWLT/fG1aqB7ykr95gHHmlBdGbFeWWfyB4NJJ0nmeIg== - dependencies: - "@babel/highlight" "^7.16.7" - -"@babel/compat-data@^7.16.4": - version "7.17.0" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.17.0.tgz#86850b8597ea6962089770952075dcaabb8dba34" - integrity sha512-392byTlpGWXMv4FbyWw3sAZ/FrW/DrwqLGXpy0mbyNe9Taqv1mg9yON5/o0cnr8XYCkFTZbC1eV+c+LAROgrng== - -"@babel/compat-data@^7.17.10": - version "7.17.10" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.17.10.tgz#711dc726a492dfc8be8220028b1b92482362baab" - integrity sha512-GZt/TCsG70Ms19gfZO1tM4CVnXsPgEPBCpJu+Qz3L0LUDsY5nZqFZglIoPC1kIYOtNBZlrnFT+klg12vFGZXrw== - -"@babel/core@^7.11.6": - version "7.17.10" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.17.10.tgz#74ef0fbf56b7dfc3f198fc2d927f4f03e12f4b05" - integrity sha512-liKoppandF3ZcBnIYFjfSDHZLKdLHGJRkoWtG8zQyGJBQfIYobpnVGI5+pLBNtS6psFLDzyq8+h5HiVljW9PNA== - dependencies: - "@ampproject/remapping" "^2.1.0" - "@babel/code-frame" "^7.16.7" - "@babel/generator" "^7.17.10" - "@babel/helper-compilation-targets" "^7.17.10" - "@babel/helper-module-transforms" "^7.17.7" - "@babel/helpers" "^7.17.9" - "@babel/parser" "^7.17.10" - "@babel/template" "^7.16.7" - "@babel/traverse" "^7.17.10" - "@babel/types" "^7.17.10" - convert-source-map "^1.7.0" - debug "^4.1.0" - gensync "^1.0.0-beta.2" - json5 "^2.2.1" - semver "^6.3.0" - -"@babel/core@^7.12.3": - version "7.17.2" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.17.2.tgz#2c77fc430e95139d816d39b113b31bf40fb22337" - integrity sha512-R3VH5G42VSDolRHyUO4V2cfag8WHcZyxdq5Z/m8Xyb92lW/Erm/6kM+XtRFGf3Mulre3mveni2NHfEUws8wSvw== - dependencies: - "@ampproject/remapping" "^2.0.0" - "@babel/code-frame" "^7.16.7" - "@babel/generator" "^7.17.0" - "@babel/helper-compilation-targets" "^7.16.7" - "@babel/helper-module-transforms" "^7.16.7" - "@babel/helpers" "^7.17.2" - "@babel/parser" "^7.17.0" - "@babel/template" "^7.16.7" - "@babel/traverse" "^7.17.0" - "@babel/types" "^7.17.0" - convert-source-map "^1.7.0" - debug "^4.1.0" - gensync "^1.0.0-beta.2" - json5 "^2.1.2" - semver "^6.3.0" - -"@babel/generator@^7.17.0", "@babel/generator@^7.7.2": - version "7.17.0" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.17.0.tgz#7bd890ba706cd86d3e2f727322346ffdbf98f65e" - integrity sha512-I3Omiv6FGOC29dtlZhkfXO6pgkmukJSlT26QjVvS1DGZe/NzSVCPG41X0tS21oZkJYlovfj9qDWgKP+Cn4bXxw== - dependencies: - "@babel/types" "^7.17.0" - jsesc "^2.5.1" - source-map "^0.5.0" - -"@babel/generator@^7.17.10": - version "7.17.10" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.17.10.tgz#c281fa35b0c349bbe9d02916f4ae08fc85ed7189" - integrity sha512-46MJZZo9y3o4kmhBVc7zW7i8dtR1oIK/sdO5NcfcZRhTGYi+KKJRtHNgsU6c4VUcJmUNV/LQdebD/9Dlv4K+Tg== - dependencies: - "@babel/types" "^7.17.10" - "@jridgewell/gen-mapping" "^0.1.0" - jsesc "^2.5.1" - -"@babel/helper-compilation-targets@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.16.7.tgz#06e66c5f299601e6c7da350049315e83209d551b" - integrity sha512-mGojBwIWcwGD6rfqgRXVlVYmPAv7eOpIemUG3dGnDdCY4Pae70ROij3XmfrH6Fa1h1aiDylpglbZyktfzyo/hA== - dependencies: - "@babel/compat-data" "^7.16.4" - "@babel/helper-validator-option" "^7.16.7" - browserslist "^4.17.5" - semver "^6.3.0" - -"@babel/helper-compilation-targets@^7.17.10": - version "7.17.10" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.17.10.tgz#09c63106d47af93cf31803db6bc49fef354e2ebe" - integrity sha512-gh3RxjWbauw/dFiU/7whjd0qN9K6nPJMqe6+Er7rOavFh0CQUSwhAE3IcTho2rywPJFxej6TUUHDkWcYI6gGqQ== - dependencies: - "@babel/compat-data" "^7.17.10" - "@babel/helper-validator-option" "^7.16.7" - browserslist "^4.20.2" - semver "^6.3.0" - -"@babel/helper-environment-visitor@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.16.7.tgz#ff484094a839bde9d89cd63cba017d7aae80ecd7" - integrity sha512-SLLb0AAn6PkUeAfKJCCOl9e1R53pQlGAfc4y4XuMRZfqeMYLE0dM1LMhqbGAlGQY0lfw5/ohoYWAe9V1yibRag== - dependencies: - "@babel/types" "^7.16.7" - -"@babel/helper-function-name@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.16.7.tgz#f1ec51551fb1c8956bc8dd95f38523b6cf375f8f" - integrity sha512-QfDfEnIUyyBSR3HtrtGECuZ6DAyCkYFp7GHl75vFtTnn6pjKeK0T1DB5lLkFvBea8MdaiUABx3osbgLyInoejA== - dependencies: - "@babel/helper-get-function-arity" "^7.16.7" - "@babel/template" "^7.16.7" - "@babel/types" "^7.16.7" - -"@babel/helper-function-name@^7.17.9": - version "7.17.9" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.17.9.tgz#136fcd54bc1da82fcb47565cf16fd8e444b1ff12" - integrity sha512-7cRisGlVtiVqZ0MW0/yFB4atgpGLWEHUVYnb448hZK4x+vih0YO5UoS11XIYtZYqHd0dIPMdUSv8q5K4LdMnIg== - dependencies: - "@babel/template" "^7.16.7" - "@babel/types" "^7.17.0" - -"@babel/helper-get-function-arity@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-get-function-arity/-/helper-get-function-arity-7.16.7.tgz#ea08ac753117a669f1508ba06ebcc49156387419" - integrity sha512-flc+RLSOBXzNzVhcLu6ujeHUrD6tANAOU5ojrRx/as+tbzf8+stUCj7+IfRRoAbEZqj/ahXEMsjhOhgeZsrnTw== - dependencies: - "@babel/types" "^7.16.7" - -"@babel/helper-hoist-variables@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz#86bcb19a77a509c7b77d0e22323ef588fa58c246" - integrity sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg== - dependencies: - "@babel/types" "^7.16.7" - -"@babel/helper-module-imports@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz#25612a8091a999704461c8a222d0efec5d091437" - integrity sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg== - dependencies: - "@babel/types" "^7.16.7" - -"@babel/helper-module-transforms@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.16.7.tgz#7665faeb721a01ca5327ddc6bba15a5cb34b6a41" - integrity sha512-gaqtLDxJEFCeQbYp9aLAefjhkKdjKcdh6DB7jniIGU3Pz52WAmP268zK0VgPz9hUNkMSYeH976K2/Y6yPadpng== - dependencies: - "@babel/helper-environment-visitor" "^7.16.7" - "@babel/helper-module-imports" "^7.16.7" - "@babel/helper-simple-access" "^7.16.7" - "@babel/helper-split-export-declaration" "^7.16.7" - "@babel/helper-validator-identifier" "^7.16.7" - "@babel/template" "^7.16.7" - "@babel/traverse" "^7.16.7" - "@babel/types" "^7.16.7" - -"@babel/helper-module-transforms@^7.17.7": - version "7.17.7" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.17.7.tgz#3943c7f777139e7954a5355c815263741a9c1cbd" - integrity sha512-VmZD99F3gNTYB7fJRDTi+u6l/zxY0BE6OIxPSU7a50s6ZUQkHwSDmV92FfM+oCG0pZRVojGYhkR8I0OGeCVREw== - dependencies: - "@babel/helper-environment-visitor" "^7.16.7" - "@babel/helper-module-imports" "^7.16.7" - "@babel/helper-simple-access" "^7.17.7" - "@babel/helper-split-export-declaration" "^7.16.7" - "@babel/helper-validator-identifier" "^7.16.7" - "@babel/template" "^7.16.7" - "@babel/traverse" "^7.17.3" - "@babel/types" "^7.17.0" - -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.16.7", "@babel/helper-plugin-utils@^7.8.0": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.16.7.tgz#aa3a8ab4c3cceff8e65eb9e73d87dc4ff320b2f5" - integrity sha512-Qg3Nk7ZxpgMrsox6HreY1ZNKdBq7K72tDSliA6dCl5f007jR4ne8iD5UzuNnCJH2xBf2BEEVGr+/OL6Gdp7RxA== - -"@babel/helper-plugin-utils@^7.18.6": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.18.9.tgz#4b8aea3b069d8cb8a72cdfe28ddf5ceca695ef2f" - integrity sha512-aBXPT3bmtLryXaoJLyYPXPlSD4p1ld9aYeR+sJNOZjJJGiOpb+fKfh3NkcCu7J54nUJwCERPBExCCpyCOHnu/w== - -"@babel/helper-simple-access@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.16.7.tgz#d656654b9ea08dbb9659b69d61063ccd343ff0f7" - integrity sha512-ZIzHVyoeLMvXMN/vok/a4LWRy8G2v205mNP0XOuf9XRLyX5/u9CnVulUtDgUTama3lT+bf/UqucuZjqiGuTS1g== - dependencies: - "@babel/types" "^7.16.7" - -"@babel/helper-simple-access@^7.17.7": - version "7.17.7" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.17.7.tgz#aaa473de92b7987c6dfa7ce9a7d9674724823367" - integrity sha512-txyMCGroZ96i+Pxr3Je3lzEJjqwaRC9buMUgtomcrLe5Nd0+fk1h0LLA+ixUF5OW7AhHuQ7Es1WcQJZmZsz2XA== - dependencies: - "@babel/types" "^7.17.0" - -"@babel/helper-split-export-declaration@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz#0b648c0c42da9d3920d85ad585f2778620b8726b" - integrity sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw== - dependencies: - "@babel/types" "^7.16.7" - -"@babel/helper-validator-identifier@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.16.7.tgz#e8c602438c4a8195751243da9031d1607d247cad" - integrity sha512-hsEnFemeiW4D08A5gUAZxLBTXpZ39P+a+DGDsHw1yxqyQ/jzFEnxf5uTEGp+3bzAbNOxU1paTgYS4ECU/IgfDw== - -"@babel/helper-validator-option@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz#b203ce62ce5fe153899b617c08957de860de4d23" - integrity sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ== - -"@babel/helpers@^7.17.2": - version "7.17.2" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.17.2.tgz#23f0a0746c8e287773ccd27c14be428891f63417" - integrity sha512-0Qu7RLR1dILozr/6M0xgj+DFPmi6Bnulgm9M8BVa9ZCWxDqlSnqt3cf8IDPB5m45sVXUZ0kuQAgUrdSFFH79fQ== - dependencies: - "@babel/template" "^7.16.7" - "@babel/traverse" "^7.17.0" - "@babel/types" "^7.17.0" - -"@babel/helpers@^7.17.9": - version "7.17.9" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.17.9.tgz#b2af120821bfbe44f9907b1826e168e819375a1a" - integrity sha512-cPCt915ShDWUEzEp3+UNRktO2n6v49l5RSnG9M5pS24hA+2FAc5si+Pn1i4VVbQQ+jh+bIZhPFQOJOzbrOYY1Q== - dependencies: - "@babel/template" "^7.16.7" - "@babel/traverse" "^7.17.9" - "@babel/types" "^7.17.0" - -"@babel/highlight@^7.16.7": - version "7.16.10" - resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.16.10.tgz#744f2eb81579d6eea753c227b0f570ad785aba88" - integrity sha512-5FnTQLSLswEj6IkgVw5KusNUUFY9ZGqe/TRFnP/BKYHYgfh7tc+C7mwiy95/yNP7Dh9x580Vv8r7u7ZfTBFxdw== - dependencies: - "@babel/helper-validator-identifier" "^7.16.7" - chalk "^2.0.0" - js-tokens "^4.0.0" - -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.16.7", "@babel/parser@^7.17.0": - version "7.17.0" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.17.0.tgz#f0ac33eddbe214e4105363bb17c3341c5ffcc43c" - integrity sha512-VKXSCQx5D8S04ej+Dqsr1CzYvvWgf20jIw2D+YhQCrIlr2UZGaDds23Y0xg75/skOxpLCRpUZvk/1EAVkGoDOw== - -"@babel/parser@^7.17.10": - version "7.17.10" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.17.10.tgz#873b16db82a8909e0fbd7f115772f4b739f6ce78" - integrity sha512-n2Q6i+fnJqzOaq2VkdXxy2TCPCWQZHiCo0XqmrCvDWcZQKRyZzYi4Z0yxlBuN0w+r2ZHmre+Q087DSrw3pbJDQ== - -"@babel/plugin-syntax-async-generators@^7.8.4": - version "7.8.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz#a983fb1aeb2ec3f6ed042a210f640e90e786fe0d" - integrity sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-bigint@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz#4c9a6f669f5d0cdf1b90a1671e9a146be5300cea" - integrity sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-class-properties@^7.8.3": - version "7.12.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz#b5c987274c4a3a82b89714796931a6b53544ae10" - integrity sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA== - dependencies: - "@babel/helper-plugin-utils" "^7.12.13" - -"@babel/plugin-syntax-import-meta@^7.8.3": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz#ee601348c370fa334d2207be158777496521fd51" - integrity sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g== - dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - -"@babel/plugin-syntax-json-strings@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz#01ca21b668cd8218c9e640cb6dd88c5412b2c96a" - integrity sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-jsx@^7.7.2": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.18.6.tgz#a8feef63b010150abd97f1649ec296e849943ca0" - integrity sha512-6mmljtAedFGTWu2p/8WIORGwy+61PLgOMPOdazc7YoJ9ZCWUyFy3A6CpPkRKLKD1ToAesxX8KGEViAiLo9N+7Q== - dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - -"@babel/plugin-syntax-logical-assignment-operators@^7.8.3": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz#ca91ef46303530448b906652bac2e9fe9941f699" - integrity sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig== - dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - -"@babel/plugin-syntax-nullish-coalescing-operator@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz#167ed70368886081f74b5c36c65a88c03b66d1a9" - integrity sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-numeric-separator@^7.8.3": - version "7.10.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz#b9b070b3e33570cd9fd07ba7fa91c0dd37b9af97" - integrity sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug== - dependencies: - "@babel/helper-plugin-utils" "^7.10.4" - -"@babel/plugin-syntax-object-rest-spread@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz#60e225edcbd98a640332a2e72dd3e66f1af55871" - integrity sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-optional-catch-binding@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz#6111a265bcfb020eb9efd0fdfd7d26402b9ed6c1" - integrity sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-optional-chaining@^7.8.3": - version "7.8.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz#4f69c2ab95167e0180cd5336613f8c5788f7d48a" - integrity sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg== - dependencies: - "@babel/helper-plugin-utils" "^7.8.0" - -"@babel/plugin-syntax-top-level-await@^7.8.3": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz#c1cfdadc35a646240001f06138247b741c34d94c" - integrity sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw== - dependencies: - "@babel/helper-plugin-utils" "^7.14.5" - -"@babel/plugin-syntax-typescript@^7.7.2": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.16.7.tgz#39c9b55ee153151990fb038651d58d3fd03f98f8" - integrity sha512-YhUIJHHGkqPgEcMYkPCKTyGUdoGKWtopIycQyjJH8OjvRgOYsXsaKehLVPScKJWAULPxMa4N1vCe6szREFlZ7A== - dependencies: - "@babel/helper-plugin-utils" "^7.16.7" - -"@babel/template@^7.16.7", "@babel/template@^7.3.3": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.16.7.tgz#8d126c8701fde4d66b264b3eba3d96f07666d155" - integrity sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w== - dependencies: - "@babel/code-frame" "^7.16.7" - "@babel/parser" "^7.16.7" - "@babel/types" "^7.16.7" - -"@babel/traverse@^7.16.7", "@babel/traverse@^7.17.0", "@babel/traverse@^7.7.2": - version "7.17.0" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.17.0.tgz#3143e5066796408ccc880a33ecd3184f3e75cd30" - integrity sha512-fpFIXvqD6kC7c7PUNnZ0Z8cQXlarCLtCUpt2S1Dx7PjoRtCFffvOkHHSom+m5HIxMZn5bIBVb71lhabcmjEsqg== - dependencies: - "@babel/code-frame" "^7.16.7" - "@babel/generator" "^7.17.0" - "@babel/helper-environment-visitor" "^7.16.7" - "@babel/helper-function-name" "^7.16.7" - "@babel/helper-hoist-variables" "^7.16.7" - "@babel/helper-split-export-declaration" "^7.16.7" - "@babel/parser" "^7.17.0" - "@babel/types" "^7.17.0" - debug "^4.1.0" - globals "^11.1.0" - -"@babel/traverse@^7.17.10", "@babel/traverse@^7.17.3", "@babel/traverse@^7.17.9": - version "7.17.10" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.17.10.tgz#1ee1a5ac39f4eac844e6cf855b35520e5eb6f8b5" - integrity sha512-VmbrTHQteIdUUQNTb+zE12SHS/xQVIShmBPhlNP12hD5poF2pbITW1Z4172d03HegaQWhLffdkRJYtAzp0AGcw== - dependencies: - "@babel/code-frame" "^7.16.7" - "@babel/generator" "^7.17.10" - "@babel/helper-environment-visitor" "^7.16.7" - "@babel/helper-function-name" "^7.17.9" - "@babel/helper-hoist-variables" "^7.16.7" - "@babel/helper-split-export-declaration" "^7.16.7" - "@babel/parser" "^7.17.10" - "@babel/types" "^7.17.10" - debug "^4.1.0" - globals "^11.1.0" - -"@babel/types@^7.0.0", "@babel/types@^7.16.7", "@babel/types@^7.17.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3": - version "7.17.0" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.17.0.tgz#a826e368bccb6b3d84acd76acad5c0d87342390b" - integrity sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw== - dependencies: - "@babel/helper-validator-identifier" "^7.16.7" - to-fast-properties "^2.0.0" - -"@babel/types@^7.17.10": - version "7.17.10" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.17.10.tgz#d35d7b4467e439fcf06d195f8100e0fea7fc82c4" - integrity sha512-9O26jG0mBYfGkUYCYZRnBwbVLd1UZOICEr2Em6InB6jVfsAv1GKgwXHmrSg+WFWDmeKTA6vyTZiN8tCSM5Oo3A== - dependencies: - "@babel/helper-validator-identifier" "^7.16.7" - to-fast-properties "^2.0.0" - -"@bcoe/v8-coverage@^0.2.3": - version "0.2.3" - resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" - integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== - -"@cspotcode/source-map-support@^0.8.0": - version "0.8.1" - resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1" - integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw== - dependencies: - "@jridgewell/trace-mapping" "0.3.9" - -"@esbuild/android-arm@0.15.12": - version "0.15.12" - resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.15.12.tgz#e548b10a5e55b9e10537a049ebf0bc72c453b769" - integrity sha512-IC7TqIqiyE0MmvAhWkl/8AEzpOtbhRNDo7aph47We1NbE5w2bt/Q+giAhe0YYeVpYnIhGMcuZY92qDK6dQauvA== - -"@esbuild/linux-loong64@0.15.12": - version "0.15.12" - resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.15.12.tgz#475b33a2631a3d8ca8aa95ee127f9a61d95bf9c1" - integrity sha512-tZEowDjvU7O7I04GYvWQOS4yyP9E/7YlsB0jjw1Ycukgr2ycEzKyIk5tms5WnLBymaewc6VmRKnn5IJWgK4eFw== - -"@istanbuljs/load-nyc-config@^1.0.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" - integrity sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ== - dependencies: - camelcase "^5.3.1" - find-up "^4.1.0" - get-package-type "^0.1.0" - js-yaml "^3.13.1" - resolve-from "^5.0.0" - -"@istanbuljs/schema@^0.1.2": - version "0.1.3" - resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" - integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== - -"@jest/console@^29.5.0": - version "29.5.0" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.5.0.tgz#593a6c5c0d3f75689835f1b3b4688c4f8544cb57" - integrity sha512-NEpkObxPwyw/XxZVLPmAGKE89IQRp4puc6IQRPru6JKd1M3fW9v1xM1AnzIJE65hbCkzQAdnL8P47e9hzhiYLQ== - dependencies: - "@jest/types" "^29.5.0" - "@types/node" "*" - chalk "^4.0.0" - jest-message-util "^29.5.0" - jest-util "^29.5.0" - slash "^3.0.0" - -"@jest/core@^29.5.0": - version "29.5.0" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.5.0.tgz#76674b96904484e8214614d17261cc491e5f1f03" - integrity sha512-28UzQc7ulUrOQw1IsN/kv1QES3q2kkbl/wGslyhAclqZ/8cMdB5M68BffkIdSJgKBUt50d3hbwJ92XESlE7LiQ== - dependencies: - "@jest/console" "^29.5.0" - "@jest/reporters" "^29.5.0" - "@jest/test-result" "^29.5.0" - "@jest/transform" "^29.5.0" - "@jest/types" "^29.5.0" - "@types/node" "*" - ansi-escapes "^4.2.1" - chalk "^4.0.0" - ci-info "^3.2.0" - exit "^0.1.2" - graceful-fs "^4.2.9" - jest-changed-files "^29.5.0" - jest-config "^29.5.0" - jest-haste-map "^29.5.0" - jest-message-util "^29.5.0" - jest-regex-util "^29.4.3" - jest-resolve "^29.5.0" - jest-resolve-dependencies "^29.5.0" - jest-runner "^29.5.0" - jest-runtime "^29.5.0" - jest-snapshot "^29.5.0" - jest-util "^29.5.0" - jest-validate "^29.5.0" - jest-watcher "^29.5.0" - micromatch "^4.0.4" - pretty-format "^29.5.0" - slash "^3.0.0" - strip-ansi "^6.0.0" - -"@jest/environment@^29.5.0": - version "29.5.0" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.5.0.tgz#9152d56317c1fdb1af389c46640ba74ef0bb4c65" - integrity sha512-5FXw2+wD29YU1d4I2htpRX7jYnAyTRjP2CsXQdo9SAM8g3ifxWPSV0HnClSn71xwctr0U3oZIIH+dtbfmnbXVQ== - dependencies: - "@jest/fake-timers" "^29.5.0" - "@jest/types" "^29.5.0" - "@types/node" "*" - jest-mock "^29.5.0" - -"@jest/expect-utils@^29.0.1": - version "29.0.1" - resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.0.1.tgz#c1a84ee66caaef537f351dd82f7c63d559cf78d5" - integrity sha512-Tw5kUUOKmXGQDmQ9TSgTraFFS7HMC1HG/B7y0AN2G2UzjdAXz9BzK2rmNpCSDl7g7y0Gf/VLBm//blonvhtOTQ== - dependencies: - jest-get-type "^29.0.0" - -"@jest/expect-utils@^29.5.0": - version "29.5.0" - resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.5.0.tgz#f74fad6b6e20f924582dc8ecbf2cb800fe43a036" - integrity sha512-fmKzsidoXQT2KwnrwE0SQq3uj8Z763vzR8LnLBwC2qYWEFpjX8daRsk6rHUM1QvNlEW/UJXNXm59ztmJJWs2Mg== - dependencies: - jest-get-type "^29.4.3" - -"@jest/expect@^29.5.0": - version "29.5.0" - resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.5.0.tgz#80952f5316b23c483fbca4363ce822af79c38fba" - integrity sha512-PueDR2HGihN3ciUNGr4uelropW7rqUfTiOn+8u0leg/42UhblPxHkfoh0Ruu3I9Y1962P3u2DY4+h7GVTSVU6g== - dependencies: - expect "^29.5.0" - jest-snapshot "^29.5.0" - -"@jest/fake-timers@^29.5.0": - version "29.5.0" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.5.0.tgz#d4d09ec3286b3d90c60bdcd66ed28d35f1b4dc2c" - integrity sha512-9ARvuAAQcBwDAqOnglWq2zwNIRUDtk/SCkp/ToGEhFv5r86K21l+VEs0qNTaXtyiY0lEePl3kylijSYJQqdbDg== - dependencies: - "@jest/types" "^29.5.0" - "@sinonjs/fake-timers" "^10.0.2" - "@types/node" "*" - jest-message-util "^29.5.0" - jest-mock "^29.5.0" - jest-util "^29.5.0" - -"@jest/globals@^29.5.0": - version "29.5.0" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.5.0.tgz#6166c0bfc374c58268677539d0c181f9c1833298" - integrity sha512-S02y0qMWGihdzNbUiqSAiKSpSozSuHX5UYc7QbnHP+D9Lyw8DgGGCinrN9uSuHPeKgSSzvPom2q1nAtBvUsvPQ== - dependencies: - "@jest/environment" "^29.5.0" - "@jest/expect" "^29.5.0" - "@jest/types" "^29.5.0" - jest-mock "^29.5.0" - -"@jest/reporters@^29.5.0": - version "29.5.0" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.5.0.tgz#985dfd91290cd78ddae4914ba7921bcbabe8ac9b" - integrity sha512-D05STXqj/M8bP9hQNSICtPqz97u7ffGzZu+9XLucXhkOFBqKcXe04JLZOgIekOxdb73MAoBUFnqvf7MCpKk5OA== - dependencies: - "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^29.5.0" - "@jest/test-result" "^29.5.0" - "@jest/transform" "^29.5.0" - "@jest/types" "^29.5.0" - "@jridgewell/trace-mapping" "^0.3.15" - "@types/node" "*" - chalk "^4.0.0" - collect-v8-coverage "^1.0.0" - exit "^0.1.2" - glob "^7.1.3" - graceful-fs "^4.2.9" - istanbul-lib-coverage "^3.0.0" - istanbul-lib-instrument "^5.1.0" - istanbul-lib-report "^3.0.0" - istanbul-lib-source-maps "^4.0.0" - istanbul-reports "^3.1.3" - jest-message-util "^29.5.0" - jest-util "^29.5.0" - jest-worker "^29.5.0" - slash "^3.0.0" - string-length "^4.0.1" - strip-ansi "^6.0.0" - v8-to-istanbul "^9.0.1" - -"@jest/schemas@^29.0.0": - version "29.0.0" - resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-29.0.0.tgz#5f47f5994dd4ef067fb7b4188ceac45f77fe952a" - integrity sha512-3Ab5HgYIIAnS0HjqJHQYZS+zXc4tUmTmBH3z83ajI6afXp8X3ZtdLX+nXx+I7LNkJD7uN9LAVhgnjDgZa2z0kA== - dependencies: - "@sinclair/typebox" "^0.24.1" - -"@jest/schemas@^29.4.3": - version "29.4.3" - resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-29.4.3.tgz#39cf1b8469afc40b6f5a2baaa146e332c4151788" - integrity sha512-VLYKXQmtmuEz6IxJsrZwzG9NvtkQsWNnWMsKxqWNu3+CnfzJQhp0WDDKWLVV9hLKr0l3SLLFRqcYHjhtyuDVxg== - dependencies: - "@sinclair/typebox" "^0.25.16" - -"@jest/source-map@^29.4.3": - version "29.4.3" - resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-29.4.3.tgz#ff8d05cbfff875d4a791ab679b4333df47951d20" - integrity sha512-qyt/mb6rLyd9j1jUts4EQncvS6Yy3PM9HghnNv86QBlV+zdL2inCdK1tuVlL+J+lpiw2BI67qXOrX3UurBqQ1w== - dependencies: - "@jridgewell/trace-mapping" "^0.3.15" - callsites "^3.0.0" - graceful-fs "^4.2.9" - -"@jest/test-result@^29.5.0": - version "29.5.0" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.5.0.tgz#7c856a6ca84f45cc36926a4e9c6b57f1973f1408" - integrity sha512-fGl4rfitnbfLsrfx1uUpDEESS7zM8JdgZgOCQuxQvL1Sn/I6ijeAVQWGfXI9zb1i9Mzo495cIpVZhA0yr60PkQ== - dependencies: - "@jest/console" "^29.5.0" - "@jest/types" "^29.5.0" - "@types/istanbul-lib-coverage" "^2.0.0" - collect-v8-coverage "^1.0.0" - -"@jest/test-sequencer@^29.5.0": - version "29.5.0" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.5.0.tgz#34d7d82d3081abd523dbddc038a3ddcb9f6d3cc4" - integrity sha512-yPafQEcKjkSfDXyvtgiV4pevSeyuA6MQr6ZIdVkWJly9vkqjnFfcfhRQqpD5whjoU8EORki752xQmjaqoFjzMQ== - dependencies: - "@jest/test-result" "^29.5.0" - graceful-fs "^4.2.9" - jest-haste-map "^29.5.0" - slash "^3.0.0" - -"@jest/transform@^29.5.0": - version "29.5.0" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.5.0.tgz#cf9c872d0965f0cbd32f1458aa44a2b1988b00f9" - integrity sha512-8vbeZWqLJOvHaDfeMuoHITGKSz5qWc9u04lnWrQE3VyuSw604PzQM824ZeX9XSjUCeDiE3GuxZe5UKa8J61NQw== - dependencies: - "@babel/core" "^7.11.6" - "@jest/types" "^29.5.0" - "@jridgewell/trace-mapping" "^0.3.15" - babel-plugin-istanbul "^6.1.1" - chalk "^4.0.0" - convert-source-map "^2.0.0" - fast-json-stable-stringify "^2.1.0" - graceful-fs "^4.2.9" - jest-haste-map "^29.5.0" - jest-regex-util "^29.4.3" - jest-util "^29.5.0" - micromatch "^4.0.4" - pirates "^4.0.4" - slash "^3.0.0" - write-file-atomic "^4.0.2" - -"@jest/types@29.5.0", "@jest/types@^29.5.0": - version "29.5.0" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.5.0.tgz#f59ef9b031ced83047c67032700d8c807d6e1593" - integrity sha512-qbu7kN6czmVRc3xWFQcAN03RAUamgppVUdXrvl1Wr3jlNF93o9mJbGcDWrwGB6ht44u7efB1qCFgVQmca24Uog== - dependencies: - "@jest/schemas" "^29.4.3" - "@types/istanbul-lib-coverage" "^2.0.0" - "@types/istanbul-reports" "^3.0.0" - "@types/node" "*" - "@types/yargs" "^17.0.8" - chalk "^4.0.0" - -"@jest/types@^29.0.1": - version "29.0.1" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.0.1.tgz#1985650acf137bdb81710ff39a4689ec071dd86a" - integrity sha512-ft01rxzVsbh9qZPJ6EFgAIj3PT9FCRfBF9Xljo2/33VDOUjLZr0ZJ2oKANqh9S/K0/GERCsHDAQlBwj7RxA+9g== - dependencies: - "@jest/schemas" "^29.0.0" - "@types/istanbul-lib-coverage" "^2.0.0" - "@types/istanbul-reports" "^3.0.0" - "@types/node" "*" - "@types/yargs" "^17.0.8" - chalk "^4.0.0" - -"@jest/types@^29.0.2": - version "29.0.2" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.0.2.tgz#5a5391fa7f7f41bf4b201d6d2da30e874f95b6c1" - integrity sha512-5WNMesBLmlkt1+fVkoCjHa0X3i3q8zc4QLTDkdHgCa2gyPZc7rdlZBWgVLqwS1860ZW5xJuCDwAzqbGaXIr/ew== - dependencies: - "@jest/schemas" "^29.0.0" - "@types/istanbul-lib-coverage" "^2.0.0" - "@types/istanbul-reports" "^3.0.0" - "@types/node" "*" - "@types/yargs" "^17.0.8" - chalk "^4.0.0" - -"@jridgewell/gen-mapping@^0.1.0": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz#e5d2e450306a9491e3bd77e323e38d7aff315996" - integrity sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w== - dependencies: - "@jridgewell/set-array" "^1.0.0" - "@jridgewell/sourcemap-codec" "^1.4.10" - -"@jridgewell/resolve-uri@^3.0.3": - version "3.0.5" - resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.0.5.tgz#68eb521368db76d040a6315cdb24bf2483037b9c" - integrity sha512-VPeQ7+wH0itvQxnG+lIzWgkysKIr3L9sslimFW55rHMdGu/qCQ5z5h9zq4gI8uBtqkpHhsF4Z/OwExufUCThew== - -"@jridgewell/set-array@^1.0.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.0.tgz#1179863356ac8fbea64a5a4bcde93a4871012c01" - integrity sha512-SfJxIxNVYLTsKwzB3MoOQ1yxf4w/E6MdkvTgrgAt1bfxjSrLUoHMKrDOykwN14q65waezZIdqDneUIPh4/sKxg== - -"@jridgewell/sourcemap-codec@^1.4.10": - version "1.4.11" - resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.11.tgz#771a1d8d744eeb71b6adb35808e1a6c7b9b8c8ec" - integrity sha512-Fg32GrJo61m+VqYSdRSjRXMjQ06j8YIYfcTqndLYVAaHmroZHLJZCydsWBOTDqXS2v+mjxohBWEMfg97GXmYQg== - -"@jridgewell/trace-mapping@0.3.9", "@jridgewell/trace-mapping@^0.3.9": - version "0.3.9" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9" - integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== - dependencies: - "@jridgewell/resolve-uri" "^3.0.3" - "@jridgewell/sourcemap-codec" "^1.4.10" - -"@jridgewell/trace-mapping@^0.3.0": - version "0.3.4" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.4.tgz#f6a0832dffd5b8a6aaa633b7d9f8e8e94c83a0c3" - integrity sha512-vFv9ttIedivx0ux3QSjhgtCVjPZd5l46ZOMDSCwnH1yUO2e964gO8LZGyv2QkqcgR6TnBU1v+1IFqmeoG+0UJQ== - dependencies: - "@jridgewell/resolve-uri" "^3.0.3" - "@jridgewell/sourcemap-codec" "^1.4.10" - -"@jridgewell/trace-mapping@^0.3.12": - version "0.3.14" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.14.tgz#b231a081d8f66796e475ad588a1ef473112701ed" - integrity sha512-bJWEfQ9lPTvm3SneWwRFVLzrh6nhjwqw7TUFFBEMzwvg7t7PCDenf2lDwqo4NQXzdpgBXyFgDWnQA+2vkruksQ== - dependencies: - "@jridgewell/resolve-uri" "^3.0.3" - "@jridgewell/sourcemap-codec" "^1.4.10" - -"@jridgewell/trace-mapping@^0.3.15": - version "0.3.15" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.15.tgz#aba35c48a38d3fd84b37e66c9c0423f9744f9774" - integrity sha512-oWZNOULl+UbhsgB51uuZzglikfIKSUBO/M9W2OfEjn7cmqoAiCgmv9lyACTUacZwBz0ITnJ2NqjU8Tx0DHL88g== - dependencies: - "@jridgewell/resolve-uri" "^3.0.3" - "@jridgewell/sourcemap-codec" "^1.4.10" - -"@nodelib/fs.scandir@2.1.5": - version "2.1.5" - resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" - integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== - dependencies: - "@nodelib/fs.stat" "2.0.5" - run-parallel "^1.1.9" - -"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": - version "2.0.5" - resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" - integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== - -"@nodelib/fs.walk@^1.2.3": - version "1.2.8" - resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" - integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== - dependencies: - "@nodelib/fs.scandir" "2.1.5" - fastq "^1.6.0" - -"@sinclair/typebox@^0.24.1": - version "0.24.19" - resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.24.19.tgz#5297278e0d8a1aea084685a3216074910ac6c113" - integrity sha512-gHJu8cdYTD5p4UqmQHrxaWrtb/jkH5imLXzuBypWhKzNkW0qfmgz+w1xaJccWVuJta1YYUdlDiPHXRTR4Ku0MQ== - -"@sinclair/typebox@^0.25.16": - version "0.25.21" - resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.25.21.tgz#763b05a4b472c93a8db29b2c3e359d55b29ce272" - integrity sha512-gFukHN4t8K4+wVC+ECqeqwzBDeFeTzBXroBTqE6vcWrQGbEUpHO7LYdG0f4xnvYq4VOEwITSlHlp0JBAIFMS/g== - -"@sinonjs/commons@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-2.0.0.tgz#fd4ca5b063554307e8327b4564bd56d3b73924a3" - integrity sha512-uLa0j859mMrg2slwQYdO/AkrOfmH+X6LTVmNTS9CqexuE2IvVORIkSpJLqePAbEnKJ77aMmCwr1NUZ57120Xcg== - dependencies: - type-detect "4.0.8" - -"@sinonjs/fake-timers@^10.0.2": - version "10.0.2" - resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-10.0.2.tgz#d10549ed1f423d80639c528b6c7f5a1017747d0c" - integrity sha512-SwUDyjWnah1AaNl7kxsa7cfLhlTYoiyhDAIgyh+El30YvXs/o7OLXpYH88Zdhyx9JExKrmHDJ+10bwIcY80Jmw== - dependencies: - "@sinonjs/commons" "^2.0.0" - -"@tsconfig/node10@^1.0.7": - version "1.0.8" - resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.8.tgz#c1e4e80d6f964fbecb3359c43bd48b40f7cadad9" - integrity sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg== - -"@tsconfig/node12@^1.0.7": - version "1.0.9" - resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.9.tgz#62c1f6dee2ebd9aead80dc3afa56810e58e1a04c" - integrity sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw== - -"@tsconfig/node14@^1.0.0": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.1.tgz#95f2d167ffb9b8d2068b0b235302fafd4df711f2" - integrity sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg== - -"@tsconfig/node16@^1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.2.tgz#423c77877d0569db20e1fc80885ac4118314010e" - integrity sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA== - -"@types/babel__core@^7.1.14": - version "7.1.18" - resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.1.18.tgz#1a29abcc411a9c05e2094c98f9a1b7da6cdf49f8" - integrity sha512-S7unDjm/C7z2A2R9NzfKCK1I+BAALDtxEmsJBwlB3EzNfb929ykjL++1CK9LO++EIp2fQrC8O+BwjKvz6UeDyQ== - dependencies: - "@babel/parser" "^7.1.0" - "@babel/types" "^7.0.0" - "@types/babel__generator" "*" - "@types/babel__template" "*" - "@types/babel__traverse" "*" - -"@types/babel__generator@*": - version "7.6.4" - resolved "https://registry.yarnpkg.com/@types/babel__generator/-/babel__generator-7.6.4.tgz#1f20ce4c5b1990b37900b63f050182d28c2439b7" - integrity sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg== - dependencies: - "@babel/types" "^7.0.0" - -"@types/babel__template@*": - version "7.4.1" - resolved "https://registry.yarnpkg.com/@types/babel__template/-/babel__template-7.4.1.tgz#3d1a48fd9d6c0edfd56f2ff578daed48f36c8969" - integrity sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g== - dependencies: - "@babel/parser" "^7.1.0" - "@babel/types" "^7.0.0" - -"@types/babel__traverse@*", "@types/babel__traverse@^7.0.6": - version "7.14.2" - resolved "https://registry.yarnpkg.com/@types/babel__traverse/-/babel__traverse-7.14.2.tgz#ffcd470bbb3f8bf30481678fb5502278ca833a43" - integrity sha512-K2waXdXBi2302XUdcHcR1jCeU0LL4TD9HRs/gk0N2Xvrht+G/BfJa4QObBQZfhMdxiCpV3COl5Nfq4uKTeTnJA== - dependencies: - "@babel/types" "^7.3.0" - -"@types/body-parser@*": - version "1.19.2" - resolved "https://registry.yarnpkg.com/@types/body-parser/-/body-parser-1.19.2.tgz#aea2059e28b7658639081347ac4fab3de166e6f0" - integrity sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g== - dependencies: - "@types/connect" "*" - "@types/node" "*" - -"@types/connect@*": - version "3.4.35" - resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.35.tgz#5fcf6ae445e4021d1fc2219a4873cc73a3bb2ad1" - integrity sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ== - dependencies: - "@types/node" "*" - -"@types/express-serve-static-core@^4.17.18": - version "4.17.28" - resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.28.tgz#c47def9f34ec81dc6328d0b1b5303d1ec98d86b8" - integrity sha512-P1BJAEAW3E2DJUlkgq4tOL3RyMunoWXqbSCygWo5ZIWTjUgN1YnaXWW4VWl/oc8vs/XoYibEGBKP0uZyF4AHig== - dependencies: - "@types/node" "*" - "@types/qs" "*" - "@types/range-parser" "*" - -"@types/express-serve-static-core@^4.17.33": - version "4.17.33" - resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.33.tgz#de35d30a9d637dc1450ad18dd583d75d5733d543" - integrity sha512-TPBqmR/HRYI3eC2E5hmiivIzv+bidAfXofM+sbonAGvyDhySGw9/PQZFt2BLOrjUUR++4eJVpx6KnLQK1Fk9tA== - dependencies: - "@types/node" "*" - "@types/qs" "*" - "@types/range-parser" "*" - -"@types/express@*": - version "4.17.13" - resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.13.tgz#a76e2995728999bab51a33fabce1d705a3709034" - integrity sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA== - dependencies: - "@types/body-parser" "*" - "@types/express-serve-static-core" "^4.17.18" - "@types/qs" "*" - "@types/serve-static" "*" - -"@types/express@4.17.17": - version "4.17.17" - resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.17.tgz#01d5437f6ef9cfa8668e616e13c2f2ac9a491ae4" - integrity sha512-Q4FmmuLGBG58btUnfS1c1r/NQdlp3DMfGDGig8WhfpA2YRUtEkxAjkZb0yvplJGYdF1fsQ81iMDcH24sSCNC/Q== - dependencies: - "@types/body-parser" "*" - "@types/express-serve-static-core" "^4.17.33" - "@types/qs" "*" - "@types/serve-static" "*" - -"@types/graceful-fs@^4.1.3": - version "4.1.5" - resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.5.tgz#21ffba0d98da4350db64891f92a9e5db3cdb4e15" - integrity sha512-anKkLmZZ+xm4p8JWBf4hElkM4XR+EZeA2M9BAkkTldmcyDY4mbdIJnRghDJH3Ov5ooY7/UAoENtmdMSkaAd7Cw== - dependencies: - "@types/node" "*" - -"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1": - version "2.0.4" - resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz#8467d4b3c087805d63580480890791277ce35c44" - integrity sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g== - -"@types/istanbul-lib-report@*": - version "3.0.0" - resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#c14c24f18ea8190c118ee7562b7ff99a36552686" - integrity sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg== - dependencies: - "@types/istanbul-lib-coverage" "*" - -"@types/istanbul-reports@^3.0.0": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz#9153fe98bba2bd565a63add9436d6f0d7f8468ff" - integrity sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw== - dependencies: - "@types/istanbul-lib-report" "*" - -"@types/jest@29.5.0": - version "29.5.0" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-29.5.0.tgz#337b90bbcfe42158f39c2fb5619ad044bbb518ac" - integrity sha512-3Emr5VOl/aoBwnWcH/EFQvlSAmjV+XtV9GGu5mwdYew5vhQh0IUZx/60x0TzHDu09Bi7HMx10t/namdJw5QIcg== - dependencies: - expect "^29.0.0" - pretty-format "^29.0.0" - -"@types/mime@^1": - version "1.3.2" - resolved "https://registry.yarnpkg.com/@types/mime/-/mime-1.3.2.tgz#93e25bf9ee75fe0fd80b594bc4feb0e862111b5a" - integrity sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw== - -"@types/multer@1.4.7": - version "1.4.7" - resolved "https://registry.yarnpkg.com/@types/multer/-/multer-1.4.7.tgz#89cf03547c28c7bbcc726f029e2a76a7232cc79e" - integrity sha512-/SNsDidUFCvqqcWDwxv2feww/yqhNeTRL5CVoL3jU4Goc4kKEL10T7Eye65ZqPNi4HRx8sAEX59pV1aEH7drNA== - dependencies: - "@types/express" "*" - -"@types/node@*": - version "17.0.17" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.17.tgz#a8ddf6e0c2341718d74ee3dc413a13a042c45a0c" - integrity sha512-e8PUNQy1HgJGV3iU/Bp2+D/DXh3PYeyli8LgIwsQcs1Ar1LoaWHSIT6Rw+H2rNJmiq6SNWiDytfx8+gYj7wDHw== - -"@types/node@18.15.11": - version "18.15.11" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.11.tgz#b3b790f09cb1696cffcec605de025b088fa4225f" - integrity sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q== - -"@types/prettier@^2.1.5": - version "2.4.4" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.4.4.tgz#5d9b63132df54d8909fce1c3f8ca260fdd693e17" - integrity sha512-ReVR2rLTV1kvtlWFyuot+d1pkpG2Fw/XKE3PDAdj57rbM97ttSp9JZ2UsP+2EHTylra9cUf6JA7tGwW1INzUrA== - -"@types/qs@*": - version "6.9.7" - resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.7.tgz#63bb7d067db107cc1e457c303bc25d511febf6cb" - integrity sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw== - -"@types/range-parser@*": - version "1.2.4" - resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.4.tgz#cd667bcfdd025213aafb7ca5915a932590acdcdc" - integrity sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw== - -"@types/serve-static@*": - version "1.13.10" - resolved "https://registry.yarnpkg.com/@types/serve-static/-/serve-static-1.13.10.tgz#f5e0ce8797d2d7cc5ebeda48a52c96c4fa47a8d9" - integrity sha512-nCkHGI4w7ZgAdNkrEu0bv+4xNV/XDqW+DydknebMOQwkpDGx8G+HTlj7R7ABI8i8nKxVw0wtKPi1D+lPOkh4YQ== - dependencies: - "@types/mime" "^1" - "@types/node" "*" - -"@types/stack-utils@^2.0.0": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.1.tgz#20f18294f797f2209b5f65c8e3b5c8e8261d127c" - integrity sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw== - -"@types/yargs-parser@*": - version "20.2.1" - resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-20.2.1.tgz#3b9ce2489919d9e4fea439b76916abc34b2df129" - integrity sha512-7tFImggNeNBVMsn0vLrpn1H1uPrUBdnARPTpZoitY37ZrdJREzf7I16tMrlK3hen349gr1NYh8CmZQa7CTG6Aw== - -"@types/yargs@^17.0.8": - version "17.0.10" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.10.tgz#591522fce85d8739bca7b8bb90d048e4478d186a" - integrity sha512-gmEaFwpj/7f/ROdtIlci1R1VYU1J4j95m8T+Tj3iBgiBFKg1foE/PSl93bBd5T9LDXNPo8UlNN6W0qwD8O5OaA== - dependencies: - "@types/yargs-parser" "*" - -accepts@~1.3.8: - version "1.3.8" - resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.8.tgz#0bf0be125b67014adcb0b0921e62db7bffe16b2e" - integrity sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw== - dependencies: - mime-types "~2.1.34" - negotiator "0.6.3" - -acorn-walk@^8.1.1: - version "8.2.0" - resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.2.0.tgz#741210f2e2426454508853a2f44d0ab83b7f69c1" - integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== - -acorn@^8.4.1: - version "8.7.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.0.tgz#90951fde0f8f09df93549481e5fc141445b791cf" - integrity sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ== - -ansi-escapes@^4.2.1: - version "4.3.2" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" - integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== - dependencies: - type-fest "^0.21.3" - -ansi-regex@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" - integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== - -ansi-styles@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" - integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== - dependencies: - color-convert "^1.9.0" - -ansi-styles@^4.0.0, ansi-styles@^4.1.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" - integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== - dependencies: - color-convert "^2.0.1" - -ansi-styles@^5.0.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-5.2.0.tgz#07449690ad45777d1924ac2abb2fc8895dba836b" - integrity sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA== - -any-promise@^1.0.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" - integrity sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A== - -anymatch@^3.0.3, anymatch@~3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" - integrity sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg== - dependencies: - normalize-path "^3.0.0" - picomatch "^2.0.4" - -append-field@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/append-field/-/append-field-1.0.0.tgz#1e3440e915f0b1203d23748e78edd7b9b5b43e56" - integrity sha512-klpgFSWLW1ZEs8svjfb7g4qWY0YS5imI82dTg+QahUvJ8YqAY0P10Uk8tTyh9ZGuYEZEMaeJYCF5BFuX552hsw== - -arg@^4.1.0: - version "4.1.3" - resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089" - integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA== - -argparse@^1.0.7: - version "1.0.10" - resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" - integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== - dependencies: - sprintf-js "~1.0.2" - -array-flatten@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" - integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI= - -array-union@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" - integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== - -asynckit@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= - -axios@1.3.5: - version "1.3.5" - resolved "https://registry.yarnpkg.com/axios/-/axios-1.3.5.tgz#e07209b39a0d11848e3e341fa087acd71dadc542" - integrity sha512-glL/PvG/E+xCWwV8S6nCHcrfg1exGx7vxyUIivIA1iL7BIh6bePylCfVHwp6k13ao7SATxB6imau2kqY+I67kw== - dependencies: - follow-redirects "^1.15.0" - form-data "^4.0.0" - proxy-from-env "^1.1.0" - -babel-jest@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.5.0.tgz#3fe3ddb109198e78b1c88f9ebdecd5e4fc2f50a5" - integrity sha512-mA4eCDh5mSo2EcA9xQjVTpmbbNk32Zb3Q3QFQsNhaK56Q+yoXowzFodLux30HRgyOho5rsQ6B0P9QpMkvvnJ0Q== - dependencies: - "@jest/transform" "^29.5.0" - "@types/babel__core" "^7.1.14" - babel-plugin-istanbul "^6.1.1" - babel-preset-jest "^29.5.0" - chalk "^4.0.0" - graceful-fs "^4.2.9" - slash "^3.0.0" - -babel-plugin-istanbul@^6.1.1: - version "6.1.1" - resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz#fa88ec59232fd9b4e36dbbc540a8ec9a9b47da73" - integrity sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA== - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@istanbuljs/load-nyc-config" "^1.0.0" - "@istanbuljs/schema" "^0.1.2" - istanbul-lib-instrument "^5.0.4" - test-exclude "^6.0.0" - -babel-plugin-jest-hoist@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.5.0.tgz#a97db437936f441ec196990c9738d4b88538618a" - integrity sha512-zSuuuAlTMT4mzLj2nPnUm6fsE6270vdOfnpbJ+RmruU75UhLFvL0N2NgI7xpeS7NaB6hGqmd5pVpGTDYvi4Q3w== - dependencies: - "@babel/template" "^7.3.3" - "@babel/types" "^7.3.3" - "@types/babel__core" "^7.1.14" - "@types/babel__traverse" "^7.0.6" - -babel-preset-current-node-syntax@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz#b4399239b89b2a011f9ddbe3e4f401fc40cff73b" - integrity sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ== - dependencies: - "@babel/plugin-syntax-async-generators" "^7.8.4" - "@babel/plugin-syntax-bigint" "^7.8.3" - "@babel/plugin-syntax-class-properties" "^7.8.3" - "@babel/plugin-syntax-import-meta" "^7.8.3" - "@babel/plugin-syntax-json-strings" "^7.8.3" - "@babel/plugin-syntax-logical-assignment-operators" "^7.8.3" - "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" - "@babel/plugin-syntax-numeric-separator" "^7.8.3" - "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" - "@babel/plugin-syntax-optional-chaining" "^7.8.3" - "@babel/plugin-syntax-top-level-await" "^7.8.3" - -babel-preset-jest@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-29.5.0.tgz#57bc8cc88097af7ff6a5ab59d1cd29d52a5916e2" - integrity sha512-JOMloxOqdiBSxMAzjRaH023/vvcaSaec49zvg+2LmNsktC7ei39LTJGw02J+9uUtTZUq6xbLyJ4dxe9sSmIuAg== - dependencies: - babel-plugin-jest-hoist "^29.5.0" - babel-preset-current-node-syntax "^1.0.0" - -balanced-match@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" - integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== - -binary-extensions@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" - integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== - -body-parser@1.20.1: - version "1.20.1" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.1.tgz#b1812a8912c195cd371a3ee5e66faa2338a5c668" - integrity sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw== - dependencies: - bytes "3.1.2" - content-type "~1.0.4" - debug "2.6.9" - depd "2.0.0" - destroy "1.2.0" - http-errors "2.0.0" - iconv-lite "0.4.24" - on-finished "2.4.1" - qs "6.11.0" - raw-body "2.5.1" - type-is "~1.6.18" - unpipe "1.0.0" - -brace-expansion@^1.1.7: - version "1.1.11" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" - integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== - dependencies: - balanced-match "^1.0.0" - concat-map "0.0.1" - -brace-expansion@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" - integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== - dependencies: - balanced-match "^1.0.0" - -braces@^3.0.1, braces@~3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" - integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== - dependencies: - fill-range "^7.0.1" - -browserslist@^4.17.5: - version "4.19.1" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.19.1.tgz#4ac0435b35ab655896c31d53018b6dd5e9e4c9a3" - integrity sha512-u2tbbG5PdKRTUoctO3NBD8FQ5HdPh1ZXPHzp1rwaa5jTc+RV9/+RlWiAIKmjRPQF+xbGM9Kklj5bZQFa2s/38A== - dependencies: - caniuse-lite "^1.0.30001286" - electron-to-chromium "^1.4.17" - escalade "^3.1.1" - node-releases "^2.0.1" - picocolors "^1.0.0" - -browserslist@^4.20.2: - version "4.20.3" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.20.3.tgz#eb7572f49ec430e054f56d52ff0ebe9be915f8bf" - integrity sha512-NBhymBQl1zM0Y5dQT/O+xiLP9/rzOIQdKM/eMJBAq7yBgaB6krIYLGejrwVYnSHZdqjscB1SPuAjHwxjvN6Wdg== - dependencies: - caniuse-lite "^1.0.30001332" - electron-to-chromium "^1.4.118" - escalade "^3.1.1" - node-releases "^2.0.3" - picocolors "^1.0.0" - -bs-logger@0.x: - version "0.2.6" - resolved "https://registry.yarnpkg.com/bs-logger/-/bs-logger-0.2.6.tgz#eb7d365307a72cf974cc6cda76b68354ad336bd8" - integrity sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog== - dependencies: - fast-json-stable-stringify "2.x" - -bser@2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/bser/-/bser-2.1.1.tgz#e6787da20ece9d07998533cfd9de6f5c38f4bc05" - integrity sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ== - dependencies: - node-int64 "^0.4.0" - -buffer-from@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" - integrity sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ== - -bundle-require@^3.1.0: - version "3.1.2" - resolved "https://registry.yarnpkg.com/bundle-require/-/bundle-require-3.1.2.tgz#1374a7bdcb8b330a7ccc862ccbf7c137cc43ad27" - integrity sha512-Of6l6JBAxiyQ5axFxUM6dYeP/W7X2Sozeo/4EYB9sJhL+dqL7TKjg+shwxp6jlu/6ZSERfsYtIpSJ1/x3XkAEA== - dependencies: - load-tsconfig "^0.2.0" - -busboy@^1.0.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/busboy/-/busboy-1.6.0.tgz#966ea36a9502e43cdb9146962523b92f531f6893" - integrity sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA== - dependencies: - streamsearch "^1.1.0" - -bytes@3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" - integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg== - -cac@^6.7.12: - version "6.7.14" - resolved "https://registry.yarnpkg.com/cac/-/cac-6.7.14.tgz#804e1e6f506ee363cb0e3ccbb09cad5dd9870959" - integrity sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ== - -call-bind@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" - integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== - dependencies: - function-bind "^1.1.1" - get-intrinsic "^1.0.2" - -callsites@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" - integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== - -camelcase@^5.3.1: - version "5.3.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" - integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== - -camelcase@^6.2.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" - integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== - -caniuse-lite@^1.0.30001286: - version "1.0.30001312" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001312.tgz#e11eba4b87e24d22697dae05455d5aea28550d5f" - integrity sha512-Wiz1Psk2MEK0pX3rUzWaunLTZzqS2JYZFzNKqAiJGiuxIjRPLgV6+VDPOg6lQOUxmDwhTlh198JsTTi8Hzw6aQ== - -caniuse-lite@^1.0.30001332: - version "1.0.30001335" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001335.tgz#899254a0b70579e5a957c32dced79f0727c61f2a" - integrity sha512-ddP1Tgm7z2iIxu6QTtbZUv6HJxSaV/PZeSrWFZtbY4JZ69tOeNhBCl3HyRQgeNZKE5AOn1kpV7fhljigy0Ty3w== - -chalk@^2.0.0: - version "2.4.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== - dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" - -chalk@^4.0.0: - version "4.1.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" - integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - -char-regex@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/char-regex/-/char-regex-1.0.2.tgz#d744358226217f981ed58f479b1d6bcc29545dcf" - integrity sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw== - -chokidar@^3.5.1: - version "3.5.3" - resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd" - integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== - dependencies: - anymatch "~3.1.2" - braces "~3.0.2" - glob-parent "~5.1.2" - is-binary-path "~2.1.0" - is-glob "~4.0.1" - normalize-path "~3.0.0" - readdirp "~3.6.0" - optionalDependencies: - fsevents "~2.3.2" - -ci-info@^3.2.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.3.0.tgz#b4ed1fb6818dea4803a55c623041f9165d2066b2" - integrity sha512-riT/3vI5YpVH6/qomlDnJow6TBee2PBKSEpx3O32EGPYbWGIRsIlGRms3Sm74wYE1JMo8RnO04Hb12+v1J5ICw== - -cjs-module-lexer@^1.0.0: - version "1.2.2" - resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz#9f84ba3244a512f3a54e5277e8eef4c489864e40" - integrity sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA== - -cliui@^7.0.2: - version "7.0.4" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-7.0.4.tgz#a0265ee655476fc807aea9df3df8df7783808b4f" - integrity sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ== - dependencies: - string-width "^4.2.0" - strip-ansi "^6.0.0" - wrap-ansi "^7.0.0" - -co@^4.6.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" - integrity sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ= - -collect-v8-coverage@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz#cc2c8e94fc18bbdffe64d6534570c8a673b27f59" - integrity sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg== - -color-convert@^1.9.0: - version "1.9.3" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" - integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== - dependencies: - color-name "1.1.3" - -color-convert@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" - integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== - dependencies: - color-name "~1.1.4" - -color-name@1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" - integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU= - -color-name@~1.1.4: - version "1.1.4" - resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" - integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== - -combined-stream@^1.0.8: - version "1.0.8" - resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" - integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== - dependencies: - delayed-stream "~1.0.0" - -commander@^4.0.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/commander/-/commander-4.1.1.tgz#9fd602bd936294e9e9ef46a3f4d6964044b18068" - integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA== - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= - -concat-stream@^1.5.2: - version "1.6.2" - resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" - integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== - dependencies: - buffer-from "^1.0.0" - inherits "^2.0.3" - readable-stream "^2.2.2" - typedarray "^0.0.6" - -content-disposition@0.5.4: - version "0.5.4" - resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.4.tgz#8b82b4efac82512a02bb0b1dcec9d2c5e8eb5bfe" - integrity sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ== - dependencies: - safe-buffer "5.2.1" - -content-type@~1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" - integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== - -convert-source-map@^1.6.0, convert-source-map@^1.7.0: - version "1.8.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.8.0.tgz#f3373c32d21b4d780dd8004514684fb791ca4369" - integrity sha512-+OQdjP49zViI/6i7nIJpA8rAl4sV/JdPfU9nZs3VqOwGIgizICvuN2ru6fMd+4llL0tar18UYJXfZ/TWtmhUjA== - dependencies: - safe-buffer "~5.1.1" - -convert-source-map@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a" - integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg== - -cookie-signature@1.0.6: - version "1.0.6" - resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" - integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw= - -cookie@0.5.0: - version "0.5.0" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.5.0.tgz#d1f5d71adec6558c58f389987c366aa47e994f8b" - integrity sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw== - -core-util-is@~1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85" - integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ== - -create-require@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333" - integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ== - -cross-spawn@^7.0.3: - version "7.0.3" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" - integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== - dependencies: - path-key "^3.1.0" - shebang-command "^2.0.0" - which "^2.0.1" - -debug@2.6.9: - version "2.6.9" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" - integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== - dependencies: - ms "2.0.0" - -debug@^4.1.0, debug@^4.1.1: - version "4.3.3" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.3.tgz#04266e0b70a98d4462e6e288e38259213332b664" - integrity sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q== - dependencies: - ms "2.1.2" - -debug@^4.3.1: - version "4.3.4" - resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" - integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== - dependencies: - ms "2.1.2" - -dedent@^0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" - integrity sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw= - -deepmerge@^4.2.2: - version "4.2.2" - resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955" - integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg== - -delayed-stream@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= - -depd@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" - integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== - -destroy@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.2.0.tgz#4803735509ad8be552934c67df614f94e66fa015" - integrity sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg== - -detect-newline@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651" - integrity sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA== - -diff-sequences@^29.0.0: - version "29.0.0" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.0.0.tgz#bae49972ef3933556bcb0800b72e8579d19d9e4f" - integrity sha512-7Qe/zd1wxSDL4D/X/FPjOMB+ZMDt71W94KYaq05I2l0oQqgXgs7s4ftYYmV38gBSrPz2vcygxfs1xn0FT+rKNA== - -diff-sequences@^29.4.3: - version "29.4.3" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.4.3.tgz#9314bc1fabe09267ffeca9cbafc457d8499a13f2" - integrity sha512-ofrBgwpPhCD85kMKtE9RYFFq6OC1A89oW2vvgWZNCwxrUpRUILopY7lsYyMDSjc8g6U6aiO0Qubg6r4Wgt5ZnA== - -diff@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d" - integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A== - -dir-glob@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" - integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== - dependencies: - path-type "^4.0.0" - -ee-first@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" - integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= - -electron-to-chromium@^1.4.118: - version "1.4.131" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.131.tgz#ca42d22eac0fe545860fbc636a6f4a7190ba70a9" - integrity sha512-oi3YPmaP87hiHn0c4ePB67tXaF+ldGhxvZnT19tW9zX6/Ej+pLN0Afja5rQ6S+TND7I9EuwQTT8JYn1k7R7rrw== - -electron-to-chromium@^1.4.17: - version "1.4.68" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.68.tgz#d79447b6bd1bec9183f166bb33d4bef0d5e4e568" - integrity sha512-cId+QwWrV8R1UawO6b9BR1hnkJ4EJPCPAr4h315vliHUtVUJDk39Sg1PMNnaWKfj5x+93ssjeJ9LKL6r8LaMiA== - -emittery@^0.13.1: - version "0.13.1" - resolved "https://registry.yarnpkg.com/emittery/-/emittery-0.13.1.tgz#c04b8c3457490e0847ae51fced3af52d338e3dad" - integrity sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ== - -emoji-regex@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" - integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== - -encodeurl@~1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" - integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= - -error-ex@^1.3.1: - version "1.3.2" - resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" - integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== - dependencies: - is-arrayish "^0.2.1" - -esbuild-android-64@0.15.12: - version "0.15.12" - resolved "https://registry.yarnpkg.com/esbuild-android-64/-/esbuild-android-64-0.15.12.tgz#5e8151d5f0a748c71a7fbea8cee844ccf008e6fc" - integrity sha512-MJKXwvPY9g0rGps0+U65HlTsM1wUs9lbjt5CU19RESqycGFDRijMDQsh68MtbzkqWSRdEtiKS1mtPzKneaAI0Q== - -esbuild-android-arm64@0.15.12: - version "0.15.12" - resolved "https://registry.yarnpkg.com/esbuild-android-arm64/-/esbuild-android-arm64-0.15.12.tgz#5ee72a6baa444bc96ffcb472a3ba4aba2cc80666" - integrity sha512-Hc9SEcZbIMhhLcvhr1DH+lrrec9SFTiRzfJ7EGSBZiiw994gfkVV6vG0sLWqQQ6DD7V4+OggB+Hn0IRUdDUqvA== - -esbuild-darwin-64@0.15.12: - version "0.15.12" - resolved "https://registry.yarnpkg.com/esbuild-darwin-64/-/esbuild-darwin-64-0.15.12.tgz#70047007e093fa1b3ba7ef86f9b3fa63db51fe25" - integrity sha512-qkmqrTVYPFiePt5qFjP8w/S+GIUMbt6k8qmiPraECUWfPptaPJUGkCKrWEfYFRWB7bY23FV95rhvPyh/KARP8Q== - -esbuild-darwin-arm64@0.15.12: - version "0.15.12" - resolved "https://registry.yarnpkg.com/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.15.12.tgz#41c951f23d9a70539bcca552bae6e5196696ae04" - integrity sha512-z4zPX02tQ41kcXMyN3c/GfZpIjKoI/BzHrdKUwhC/Ki5BAhWv59A9M8H+iqaRbwpzYrYidTybBwiZAIWCLJAkw== - -esbuild-freebsd-64@0.15.12: - version "0.15.12" - resolved "https://registry.yarnpkg.com/esbuild-freebsd-64/-/esbuild-freebsd-64-0.15.12.tgz#a761b5afd12bbedb7d56c612e9cfa4d2711f33f0" - integrity sha512-XFL7gKMCKXLDiAiBjhLG0XECliXaRLTZh6hsyzqUqPUf/PY4C6EJDTKIeqqPKXaVJ8+fzNek88285krSz1QECw== - -esbuild-freebsd-arm64@0.15.12: - version "0.15.12" - resolved "https://registry.yarnpkg.com/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.15.12.tgz#6b0839d4d58deabc6cbd96276eb8cbf94f7f335e" - integrity sha512-jwEIu5UCUk6TjiG1X+KQnCGISI+ILnXzIzt9yDVrhjug2fkYzlLbl0K43q96Q3KB66v6N1UFF0r5Ks4Xo7i72g== - -esbuild-linux-32@0.15.12: - version "0.15.12" - resolved "https://registry.yarnpkg.com/esbuild-linux-32/-/esbuild-linux-32-0.15.12.tgz#bd50bfe22514d434d97d5150977496e2631345b4" - integrity sha512-uSQuSEyF1kVzGzuIr4XM+v7TPKxHjBnLcwv2yPyCz8riV8VUCnO/C4BF3w5dHiVpCd5Z1cebBtZJNlC4anWpwA== - -esbuild-linux-64@0.15.12: - version "0.15.12" - resolved "https://registry.yarnpkg.com/esbuild-linux-64/-/esbuild-linux-64-0.15.12.tgz#074bb2b194bf658245f8490f29c01ffcdfa8c931" - integrity sha512-QcgCKb7zfJxqT9o5z9ZUeGH1k8N6iX1Y7VNsEi5F9+HzN1OIx7ESxtQXDN9jbeUSPiRH1n9cw6gFT3H4qbdvcA== - -esbuild-linux-arm64@0.15.12: - version "0.15.12" - resolved "https://registry.yarnpkg.com/esbuild-linux-arm64/-/esbuild-linux-arm64-0.15.12.tgz#3bf789c4396dc032875a122988efd6f3733f28f5" - integrity sha512-HtNq5xm8fUpZKwWKS2/YGwSfTF+339L4aIA8yphNKYJckd5hVdhfdl6GM2P3HwLSCORS++++7++//ApEwXEuAQ== - -esbuild-linux-arm@0.15.12: - version "0.15.12" - resolved "https://registry.yarnpkg.com/esbuild-linux-arm/-/esbuild-linux-arm-0.15.12.tgz#b91b5a8d470053f6c2c9c8a5e67ec10a71fe4a67" - integrity sha512-Wf7T0aNylGcLu7hBnzMvsTfEXdEdJY/hY3u36Vla21aY66xR0MS5I1Hw8nVquXjTN0A6fk/vnr32tkC/C2lb0A== - -esbuild-linux-mips64le@0.15.12: - version "0.15.12" - resolved "https://registry.yarnpkg.com/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.15.12.tgz#2fb54099ada3c950a7536dfcba46172c61e580e2" - integrity sha512-Qol3+AvivngUZkTVFgLpb0H6DT+N5/zM3V1YgTkryPYFeUvuT5JFNDR3ZiS6LxhyF8EE+fiNtzwlPqMDqVcc6A== - -esbuild-linux-ppc64le@0.15.12: - version "0.15.12" - resolved "https://registry.yarnpkg.com/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.15.12.tgz#9e3b8c09825fb27886249dfb3142a750df29a1b7" - integrity sha512-4D8qUCo+CFKaR0cGXtGyVsOI7w7k93Qxb3KFXWr75An0DHamYzq8lt7TNZKoOq/Gh8c40/aKaxvcZnTgQ0TJNg== - -esbuild-linux-riscv64@0.15.12: - version "0.15.12" - resolved "https://registry.yarnpkg.com/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.15.12.tgz#923d0f5b6e12ee0d1fe116b08e4ae4478fe40693" - integrity sha512-G9w6NcuuCI6TUUxe6ka0enjZHDnSVK8bO+1qDhMOCtl7Tr78CcZilJj8SGLN00zO5iIlwNRZKHjdMpfFgNn1VA== - -esbuild-linux-s390x@0.15.12: - version "0.15.12" - resolved "https://registry.yarnpkg.com/esbuild-linux-s390x/-/esbuild-linux-s390x-0.15.12.tgz#3b1620220482b96266a0c6d9d471d451a1eab86f" - integrity sha512-Lt6BDnuXbXeqSlVuuUM5z18GkJAZf3ERskGZbAWjrQoi9xbEIsj/hEzVnSAFLtkfLuy2DE4RwTcX02tZFunXww== - -esbuild-netbsd-64@0.15.12: - version "0.15.12" - resolved "https://registry.yarnpkg.com/esbuild-netbsd-64/-/esbuild-netbsd-64-0.15.12.tgz#276730f80da646859b1af5a740e7802d8cd73e42" - integrity sha512-jlUxCiHO1dsqoURZDQts+HK100o0hXfi4t54MNRMCAqKGAV33JCVvMplLAa2FwviSojT/5ZG5HUfG3gstwAG8w== - -esbuild-openbsd-64@0.15.12: - version "0.15.12" - resolved "https://registry.yarnpkg.com/esbuild-openbsd-64/-/esbuild-openbsd-64-0.15.12.tgz#bd0eea1dd2ca0722ed489d88c26714034429f8ae" - integrity sha512-1o1uAfRTMIWNOmpf8v7iudND0L6zRBYSH45sofCZywrcf7NcZA+c7aFsS1YryU+yN7aRppTqdUK1PgbZVaB1Dw== - -esbuild-sunos-64@0.15.12: - version "0.15.12" - resolved "https://registry.yarnpkg.com/esbuild-sunos-64/-/esbuild-sunos-64-0.15.12.tgz#5e56bf9eef3b2d92360d6d29dcde7722acbecc9e" - integrity sha512-nkl251DpoWoBO9Eq9aFdoIt2yYmp4I3kvQjba3jFKlMXuqQ9A4q+JaqdkCouG3DHgAGnzshzaGu6xofGcXyPXg== - -esbuild-windows-32@0.15.12: - version "0.15.12" - resolved "https://registry.yarnpkg.com/esbuild-windows-32/-/esbuild-windows-32-0.15.12.tgz#a4f1a301c1a2fa7701fcd4b91ef9d2620cf293d0" - integrity sha512-WlGeBZHgPC00O08luIp5B2SP4cNCp/PcS+3Pcg31kdcJPopHxLkdCXtadLU9J82LCfw4TVls21A6lilQ9mzHrw== - -esbuild-windows-64@0.15.12: - version "0.15.12" - resolved "https://registry.yarnpkg.com/esbuild-windows-64/-/esbuild-windows-64-0.15.12.tgz#bc2b467541744d653be4fe64eaa9b0dbbf8e07f6" - integrity sha512-VActO3WnWZSN//xjSfbiGOSyC+wkZtI8I4KlgrTo5oHJM6z3MZZBCuFaZHd8hzf/W9KPhF0lY8OqlmWC9HO5AA== - -esbuild-windows-arm64@0.15.12: - version "0.15.12" - resolved "https://registry.yarnpkg.com/esbuild-windows-arm64/-/esbuild-windows-arm64-0.15.12.tgz#9a7266404334a86be800957eaee9aef94c3df328" - integrity sha512-Of3MIacva1OK/m4zCNIvBfz8VVROBmQT+gRX6pFTLPngFYcj6TFH/12VveAqq1k9VB2l28EoVMNMUCcmsfwyuA== - -esbuild@^0.15.1: - version "0.15.12" - resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.15.12.tgz#6c8e22d6d3b7430d165c33848298d3fc9a1f251c" - integrity sha512-PcT+/wyDqJQsRVhaE9uX/Oq4XLrFh0ce/bs2TJh4CSaw9xuvI+xFrH2nAYOADbhQjUgAhNWC5LKoUsakm4dxng== - optionalDependencies: - "@esbuild/android-arm" "0.15.12" - "@esbuild/linux-loong64" "0.15.12" - esbuild-android-64 "0.15.12" - esbuild-android-arm64 "0.15.12" - esbuild-darwin-64 "0.15.12" - esbuild-darwin-arm64 "0.15.12" - esbuild-freebsd-64 "0.15.12" - esbuild-freebsd-arm64 "0.15.12" - esbuild-linux-32 "0.15.12" - esbuild-linux-64 "0.15.12" - esbuild-linux-arm "0.15.12" - esbuild-linux-arm64 "0.15.12" - esbuild-linux-mips64le "0.15.12" - esbuild-linux-ppc64le "0.15.12" - esbuild-linux-riscv64 "0.15.12" - esbuild-linux-s390x "0.15.12" - esbuild-netbsd-64 "0.15.12" - esbuild-openbsd-64 "0.15.12" - esbuild-sunos-64 "0.15.12" - esbuild-windows-32 "0.15.12" - esbuild-windows-64 "0.15.12" - esbuild-windows-arm64 "0.15.12" - -escalade@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" - integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== - -escape-html@~1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" - integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= - -escape-string-regexp@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= - -escape-string-regexp@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz#a30304e99daa32e23b2fd20f51babd07cffca344" - integrity sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w== - -esprima@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" - integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== - -etag@~1.8.1: - version "1.8.1" - resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" - integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= - -execa@^5.0.0: - version "5.1.1" - resolved "https://registry.yarnpkg.com/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd" - integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== - dependencies: - cross-spawn "^7.0.3" - get-stream "^6.0.0" - human-signals "^2.1.0" - is-stream "^2.0.0" - merge-stream "^2.0.0" - npm-run-path "^4.0.1" - onetime "^5.1.2" - signal-exit "^3.0.3" - strip-final-newline "^2.0.0" - -exit@^0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" - integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= - -expect@^29.0.0: - version "29.0.1" - resolved "https://registry.yarnpkg.com/expect/-/expect-29.0.1.tgz#a2fa64a59cffe4b4007877e730bc82be3d1742bb" - integrity sha512-yQgemsjLU+1S8t2A7pXT3Sn/v5/37LY8J+tocWtKEA0iEYYc6gfKbbJJX2fxHZmd7K9WpdbQqXUpmYkq1aewYg== - dependencies: - "@jest/expect-utils" "^29.0.1" - jest-get-type "^29.0.0" - jest-matcher-utils "^29.0.1" - jest-message-util "^29.0.1" - jest-util "^29.0.1" - -expect@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/expect/-/expect-29.5.0.tgz#68c0509156cb2a0adb8865d413b137eeaae682f7" - integrity sha512-yM7xqUrCO2JdpFo4XpM82t+PJBFybdqoQuJLDGeDX2ij8NZzqRHyu3Hp188/JX7SWqud+7t4MUdvcgGBICMHZg== - dependencies: - "@jest/expect-utils" "^29.5.0" - jest-get-type "^29.4.3" - jest-matcher-utils "^29.5.0" - jest-message-util "^29.5.0" - jest-util "^29.5.0" - -express@4.18.2: - version "4.18.2" - resolved "https://registry.yarnpkg.com/express/-/express-4.18.2.tgz#3fabe08296e930c796c19e3c516979386ba9fd59" - integrity sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ== - dependencies: - accepts "~1.3.8" - array-flatten "1.1.1" - body-parser "1.20.1" - content-disposition "0.5.4" - content-type "~1.0.4" - cookie "0.5.0" - cookie-signature "1.0.6" - debug "2.6.9" - depd "2.0.0" - encodeurl "~1.0.2" - escape-html "~1.0.3" - etag "~1.8.1" - finalhandler "1.2.0" - fresh "0.5.2" - http-errors "2.0.0" - merge-descriptors "1.0.1" - methods "~1.1.2" - on-finished "2.4.1" - parseurl "~1.3.3" - path-to-regexp "0.1.7" - proxy-addr "~2.0.7" - qs "6.11.0" - range-parser "~1.2.1" - safe-buffer "5.2.1" - send "0.18.0" - serve-static "1.15.0" - setprototypeof "1.2.0" - statuses "2.0.1" - type-is "~1.6.18" - utils-merge "1.0.1" - vary "~1.1.2" - -fast-glob@^3.2.9: - version "3.2.12" - resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.12.tgz#7f39ec99c2e6ab030337142da9e0c18f37afae80" - integrity sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w== - dependencies: - "@nodelib/fs.stat" "^2.0.2" - "@nodelib/fs.walk" "^1.2.3" - glob-parent "^5.1.2" - merge2 "^1.3.0" - micromatch "^4.0.4" - -fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" - integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== - -fastq@^1.6.0: - version "1.13.0" - resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.13.0.tgz#616760f88a7526bdfc596b7cab8c18938c36b98c" - integrity sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw== - dependencies: - reusify "^1.0.4" - -fb-watchman@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.1.tgz#fc84fb39d2709cf3ff6d743706157bb5708a8a85" - integrity sha512-DkPJKQeY6kKwmuMretBhr7G6Vodr7bFwDYTXIkfG1gjvNpaxBTQV3PbXg6bR1c1UP4jPOX0jHUbbHANL9vRjVg== - dependencies: - bser "2.1.1" - -fill-range@^7.0.1: - version "7.0.1" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" - integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== - dependencies: - to-regex-range "^5.0.1" - -finalhandler@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.2.0.tgz#7d23fe5731b207b4640e4fcd00aec1f9207a7b32" - integrity sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg== - dependencies: - debug "2.6.9" - encodeurl "~1.0.2" - escape-html "~1.0.3" - on-finished "2.4.1" - parseurl "~1.3.3" - statuses "2.0.1" - unpipe "~1.0.0" - -find-up@^4.0.0, find-up@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" - integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== - dependencies: - locate-path "^5.0.0" - path-exists "^4.0.0" - -follow-redirects@^1.15.0: - version "1.15.2" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" - integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== - -form-data@4.0.0, form-data@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" - integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== - dependencies: - asynckit "^0.4.0" - combined-stream "^1.0.8" - mime-types "^2.1.12" - -forwarded@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" - integrity sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow== - -fp-ts@2.13.1: - version "2.13.1" - resolved "https://registry.yarnpkg.com/fp-ts/-/fp-ts-2.13.1.tgz#1bf2b24136cca154846af16752dc29e8fa506f2a" - integrity sha512-0eu5ULPS2c/jsa1lGFneEFFEdTbembJv8e4QKXeVJ3lm/5hyve06dlKZrpxmMwJt6rYen7sxmHHK2CLaXvWuWQ== - -fresh@0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" - integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8= - -fsevents@^2.3.2, fsevents@~2.3.2: - version "2.3.2" - resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" - integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== - -function-bind@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" - integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== - -gensync@^1.0.0-beta.2: - version "1.0.0-beta.2" - resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" - integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== - -get-caller-file@^2.0.5: - version "2.0.5" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" - integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== - -get-intrinsic@^1.0.2: - version "1.1.1" - resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6" - integrity sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q== - dependencies: - function-bind "^1.1.1" - has "^1.0.3" - has-symbols "^1.0.1" - -get-package-type@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" - integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== - -get-stream@^6.0.0: - version "6.0.1" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" - integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== - -glob-parent@^5.1.2, glob-parent@~5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" - integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== - dependencies: - is-glob "^4.0.1" - -glob@7.1.6: - version "7.1.6" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6" - integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -glob@^10.0.0: - version "10.0.0" - resolved "https://registry.yarnpkg.com/glob/-/glob-10.0.0.tgz#034ab2e93644ba702e769c3e0558143d3fbd1612" - integrity sha512-zmp9ZDC6NpDNLujV2W2n+3lH+BafIVZ4/ct+Yj3BMZTH/+bgm/eVjHzeFLwxJrrIGgjjS2eiQLlpurHsNlEAtQ== - dependencies: - fs.realpath "^1.0.0" - minimatch "^9.0.0" - minipass "^5.0.0" - path-scurry "^1.6.4" - -glob@^7.1.3, glob@^7.1.4: - version "7.2.0" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.0.tgz#d15535af7732e02e948f4c41628bd910293f6023" - integrity sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -globals@^11.1.0: - version "11.12.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" - integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== - -globby@^11.0.3: - version "11.1.0" - resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" - integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== - dependencies: - array-union "^2.1.0" - dir-glob "^3.0.1" - fast-glob "^3.2.9" - ignore "^5.2.0" - merge2 "^1.4.1" - slash "^3.0.0" - -graceful-fs@^4.2.9: - version "4.2.9" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.9.tgz#041b05df45755e587a24942279b9d113146e1c96" - integrity sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ== - -has-flag@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" - integrity sha1-tdRU3CGZriJWmfNGfloH87lVuv0= - -has-flag@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" - integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== - -has-symbols@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" - integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== - -has@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" - integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== - dependencies: - function-bind "^1.1.1" - -html-escaper@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" - integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== - -http-errors@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-2.0.0.tgz#b7774a1486ef73cf7667ac9ae0858c012c57b9d3" - integrity sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ== - dependencies: - depd "2.0.0" - inherits "2.0.4" - setprototypeof "1.2.0" - statuses "2.0.1" - toidentifier "1.0.1" - -human-signals@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" - integrity sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw== - -iconv-lite@0.4.24: - version "0.4.24" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" - integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== - dependencies: - safer-buffer ">= 2.1.2 < 3" - -ignore@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.0.tgz#6d3bac8fa7fe0d45d9f9be7bac2fc279577e345a" - integrity sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ== - -import-local@^3.0.2: - version "3.1.0" - resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.1.0.tgz#b4479df8a5fd44f6cdce24070675676063c95cb4" - integrity sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg== - dependencies: - pkg-dir "^4.2.0" - resolve-cwd "^3.0.0" - -imurmurhash@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" - integrity sha1-khi5srkoojixPcT7a21XbyMUU+o= - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk= - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2, inherits@2.0.4, inherits@^2.0.3, inherits@~2.0.3: - version "2.0.4" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" - integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== - -io-ts@2.2.19: - version "2.2.19" - resolved "https://registry.yarnpkg.com/io-ts/-/io-ts-2.2.19.tgz#4ba5e120472a0a07ff693fdb3d7075ea1c1b77c3" - integrity sha512-ED0GQwvKRr5C2jqOOJCkuJW2clnbzqFexQ8V7Qsb+VB36S1Mk/OKH7k0FjSe4mjKy9qBRA3OqgVGyFMUEKIubw== - -ipaddr.js@1.9.1: - version "1.9.1" - resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" - integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== - -is-arrayish@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" - integrity sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0= - -is-binary-path@~2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" - integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== - dependencies: - binary-extensions "^2.0.0" - -is-core-module@^2.8.1: - version "2.8.1" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.8.1.tgz#f59fdfca701d5879d0a6b100a40aa1560ce27211" - integrity sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA== - dependencies: - has "^1.0.3" - -is-extglob@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" - integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== - -is-fullwidth-code-point@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" - integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== - -is-generator-fn@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-generator-fn/-/is-generator-fn-2.1.0.tgz#7d140adc389aaf3011a8f2a2a4cfa6faadffb118" - integrity sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ== - -is-glob@^4.0.1, is-glob@~4.0.1: - version "4.0.3" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" - integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== - dependencies: - is-extglob "^2.1.1" - -is-number@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" - integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== - -is-stream@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" - integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== - -isarray@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - integrity sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ== - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA= - -istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz#189e7909d0a39fa5a3dfad5b03f71947770191d3" - integrity sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw== - -istanbul-lib-instrument@^5.0.4, istanbul-lib-instrument@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-5.1.0.tgz#7b49198b657b27a730b8e9cb601f1e1bff24c59a" - integrity sha512-czwUz525rkOFDJxfKK6mYfIs9zBKILyrZQxjz3ABhjQXhbhFsSbo1HW/BFcsDnfJYJWA6thRR5/TUY2qs5W99Q== - dependencies: - "@babel/core" "^7.12.3" - "@babel/parser" "^7.14.7" - "@istanbuljs/schema" "^0.1.2" - istanbul-lib-coverage "^3.2.0" - semver "^6.3.0" - -istanbul-lib-report@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#7518fe52ea44de372f460a76b5ecda9ffb73d8a6" - integrity sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw== - dependencies: - istanbul-lib-coverage "^3.0.0" - make-dir "^3.0.0" - supports-color "^7.1.0" - -istanbul-lib-source-maps@^4.0.0: - version "4.0.1" - resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.1.tgz#895f3a709fcfba34c6de5a42939022f3e4358551" - integrity sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw== - dependencies: - debug "^4.1.1" - istanbul-lib-coverage "^3.0.0" - source-map "^0.6.1" - -istanbul-reports@^3.1.3: - version "3.1.4" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-3.1.4.tgz#1b6f068ecbc6c331040aab5741991273e609e40c" - integrity sha512-r1/DshN4KSE7xWEknZLLLLDn5CJybV3nw01VTkp6D5jzLuELlcbudfj/eSQFvrKsJuTVCGnePO7ho82Nw9zzfw== - dependencies: - html-escaper "^2.0.0" - istanbul-lib-report "^3.0.0" - -jest-changed-files@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.5.0.tgz#e88786dca8bf2aa899ec4af7644e16d9dcf9b23e" - integrity sha512-IFG34IUMUaNBIxjQXF/iu7g6EcdMrGRRxaUSw92I/2g2YC6vCdTltl4nHvt7Ci5nSJwXIkCu8Ka1DKF+X7Z1Ag== - dependencies: - execa "^5.0.0" - p-limit "^3.1.0" - -jest-circus@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.5.0.tgz#b5926989449e75bff0d59944bae083c9d7fb7317" - integrity sha512-gq/ongqeQKAplVxqJmbeUOJJKkW3dDNPY8PjhJ5G0lBRvu0e3EWGxGy5cI4LAGA7gV2UHCtWBI4EMXK8c9nQKA== - dependencies: - "@jest/environment" "^29.5.0" - "@jest/expect" "^29.5.0" - "@jest/test-result" "^29.5.0" - "@jest/types" "^29.5.0" - "@types/node" "*" - chalk "^4.0.0" - co "^4.6.0" - dedent "^0.7.0" - is-generator-fn "^2.0.0" - jest-each "^29.5.0" - jest-matcher-utils "^29.5.0" - jest-message-util "^29.5.0" - jest-runtime "^29.5.0" - jest-snapshot "^29.5.0" - jest-util "^29.5.0" - p-limit "^3.1.0" - pretty-format "^29.5.0" - pure-rand "^6.0.0" - slash "^3.0.0" - stack-utils "^2.0.3" - -jest-cli@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.5.0.tgz#b34c20a6d35968f3ee47a7437ff8e53e086b4a67" - integrity sha512-L1KcP1l4HtfwdxXNFCL5bmUbLQiKrakMUriBEcc1Vfz6gx31ORKdreuWvmQVBit+1ss9NNR3yxjwfwzZNdQXJw== - dependencies: - "@jest/core" "^29.5.0" - "@jest/test-result" "^29.5.0" - "@jest/types" "^29.5.0" - chalk "^4.0.0" - exit "^0.1.2" - graceful-fs "^4.2.9" - import-local "^3.0.2" - jest-config "^29.5.0" - jest-util "^29.5.0" - jest-validate "^29.5.0" - prompts "^2.0.1" - yargs "^17.3.1" - -jest-config@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.5.0.tgz#3cc972faec8c8aaea9ae158c694541b79f3748da" - integrity sha512-kvDUKBnNJPNBmFFOhDbm59iu1Fii1Q6SxyhXfvylq3UTHbg6o7j/g8k2dZyXWLvfdKB1vAPxNZnMgtKJcmu3kA== - dependencies: - "@babel/core" "^7.11.6" - "@jest/test-sequencer" "^29.5.0" - "@jest/types" "^29.5.0" - babel-jest "^29.5.0" - chalk "^4.0.0" - ci-info "^3.2.0" - deepmerge "^4.2.2" - glob "^7.1.3" - graceful-fs "^4.2.9" - jest-circus "^29.5.0" - jest-environment-node "^29.5.0" - jest-get-type "^29.4.3" - jest-regex-util "^29.4.3" - jest-resolve "^29.5.0" - jest-runner "^29.5.0" - jest-util "^29.5.0" - jest-validate "^29.5.0" - micromatch "^4.0.4" - parse-json "^5.2.0" - pretty-format "^29.5.0" - slash "^3.0.0" - strip-json-comments "^3.1.1" - -jest-diff@^29.0.1: - version "29.0.1" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.0.1.tgz#d14e900a38ee4798d42feaaf0c61cb5b98e4c028" - integrity sha512-l8PYeq2VhcdxG9tl5cU78ClAlg/N7RtVSp0v3MlXURR0Y99i6eFnegmasOandyTmO6uEdo20+FByAjBFEO9nuw== - dependencies: - chalk "^4.0.0" - diff-sequences "^29.0.0" - jest-get-type "^29.0.0" - pretty-format "^29.0.1" - -jest-diff@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.5.0.tgz#e0d83a58eb5451dcc1fa61b1c3ee4e8f5a290d63" - integrity sha512-LtxijLLZBduXnHSniy0WMdaHjmQnt3g5sa16W4p0HqukYTTsyTW3GD1q41TyGl5YFXj/5B2U6dlh5FM1LIMgxw== - dependencies: - chalk "^4.0.0" - diff-sequences "^29.4.3" - jest-get-type "^29.4.3" - pretty-format "^29.5.0" - -jest-docblock@^29.4.3: - version "29.4.3" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-29.4.3.tgz#90505aa89514a1c7dceeac1123df79e414636ea8" - integrity sha512-fzdTftThczeSD9nZ3fzA/4KkHtnmllawWrXO69vtI+L9WjEIuXWs4AmyME7lN5hU7dB0sHhuPfcKofRsUb/2Fg== - dependencies: - detect-newline "^3.0.0" - -jest-each@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.5.0.tgz#fc6e7014f83eac68e22b7195598de8554c2e5c06" - integrity sha512-HM5kIJ1BTnVt+DQZ2ALp3rzXEl+g726csObrW/jpEGl+CDSSQpOJJX2KE/vEg8cxcMXdyEPu6U4QX5eruQv5hA== - dependencies: - "@jest/types" "^29.5.0" - chalk "^4.0.0" - jest-get-type "^29.4.3" - jest-util "^29.5.0" - pretty-format "^29.5.0" - -jest-environment-node@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.5.0.tgz#f17219d0f0cc0e68e0727c58b792c040e332c967" - integrity sha512-ExxuIK/+yQ+6PRGaHkKewYtg6hto2uGCgvKdb2nfJfKXgZ17DfXjvbZ+jA1Qt9A8EQSfPnt5FKIfnOO3u1h9qw== - dependencies: - "@jest/environment" "^29.5.0" - "@jest/fake-timers" "^29.5.0" - "@jest/types" "^29.5.0" - "@types/node" "*" - jest-mock "^29.5.0" - jest-util "^29.5.0" - -jest-get-type@^29.0.0: - version "29.0.0" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.0.0.tgz#843f6c50a1b778f7325df1129a0fd7aa713aef80" - integrity sha512-83X19z/HuLKYXYHskZlBAShO7UfLFXu/vWajw9ZNJASN32li8yHMaVGAQqxFW1RCFOkB7cubaL6FaJVQqqJLSw== - -jest-get-type@^29.4.3: - version "29.4.3" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.4.3.tgz#1ab7a5207c995161100b5187159ca82dd48b3dd5" - integrity sha512-J5Xez4nRRMjk8emnTpWrlkyb9pfRQQanDrvWHhsR1+VUfbwxi30eVcZFlcdGInRibU4G5LwHXpI7IRHU0CY+gg== - -jest-haste-map@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.5.0.tgz#69bd67dc9012d6e2723f20a945099e972b2e94de" - integrity sha512-IspOPnnBro8YfVYSw6yDRKh/TiCdRngjxeacCps1cQ9cgVN6+10JUcuJ1EabrgYLOATsIAigxA0rLR9x/YlrSA== - dependencies: - "@jest/types" "^29.5.0" - "@types/graceful-fs" "^4.1.3" - "@types/node" "*" - anymatch "^3.0.3" - fb-watchman "^2.0.0" - graceful-fs "^4.2.9" - jest-regex-util "^29.4.3" - jest-util "^29.5.0" - jest-worker "^29.5.0" - micromatch "^4.0.4" - walker "^1.0.8" - optionalDependencies: - fsevents "^2.3.2" - -jest-leak-detector@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.5.0.tgz#cf4bdea9615c72bac4a3a7ba7e7930f9c0610c8c" - integrity sha512-u9YdeeVnghBUtpN5mVxjID7KbkKE1QU4f6uUwuxiY0vYRi9BUCLKlPEZfDGR67ofdFmDz9oPAy2G92Ujrntmow== - dependencies: - jest-get-type "^29.4.3" - pretty-format "^29.5.0" - -jest-matcher-utils@^29.0.1: - version "29.0.1" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.0.1.tgz#eaa92dd5405c2df9d31d45ec4486361d219de3e9" - integrity sha512-/e6UbCDmprRQFnl7+uBKqn4G22c/OmwriE5KCMVqxhElKCQUDcFnq5XM9iJeKtzy4DUjxT27y9VHmKPD8BQPaw== - dependencies: - chalk "^4.0.0" - jest-diff "^29.0.1" - jest-get-type "^29.0.0" - pretty-format "^29.0.1" - -jest-matcher-utils@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.5.0.tgz#d957af7f8c0692c5453666705621ad4abc2c59c5" - integrity sha512-lecRtgm/rjIK0CQ7LPQwzCs2VwW6WAahA55YBuI+xqmhm7LAaxokSB8C97yJeYyT+HvQkH741StzpU41wohhWw== - dependencies: - chalk "^4.0.0" - jest-diff "^29.5.0" - jest-get-type "^29.4.3" - pretty-format "^29.5.0" - -jest-message-util@^29.0.1: - version "29.0.1" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.0.1.tgz#85c4b5b90296c228da158e168eaa5b079f2ab879" - integrity sha512-wRMAQt3HrLpxSubdnzOo68QoTfQ+NLXFzU0Heb18ZUzO2S9GgaXNEdQ4rpd0fI9dq2NXkpCk1IUWSqzYKji64A== - dependencies: - "@babel/code-frame" "^7.12.13" - "@jest/types" "^29.0.1" - "@types/stack-utils" "^2.0.0" - chalk "^4.0.0" - graceful-fs "^4.2.9" - micromatch "^4.0.4" - pretty-format "^29.0.1" - slash "^3.0.0" - stack-utils "^2.0.3" - -jest-message-util@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.5.0.tgz#1f776cac3aca332ab8dd2e3b41625435085c900e" - integrity sha512-Kijeg9Dag6CKtIDA7O21zNTACqD5MD/8HfIV8pdD94vFyFuer52SigdC3IQMhab3vACxXMiFk+yMHNdbqtyTGA== - dependencies: - "@babel/code-frame" "^7.12.13" - "@jest/types" "^29.5.0" - "@types/stack-utils" "^2.0.0" - chalk "^4.0.0" - graceful-fs "^4.2.9" - micromatch "^4.0.4" - pretty-format "^29.5.0" - slash "^3.0.0" - stack-utils "^2.0.3" - -jest-mock@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.5.0.tgz#26e2172bcc71d8b0195081ff1f146ac7e1518aed" - integrity sha512-GqOzvdWDE4fAV2bWQLQCkujxYWL7RxjCnj71b5VhDAGOevB3qj3Ovg26A5NI84ZpODxyzaozXLOh2NCgkbvyaw== - dependencies: - "@jest/types" "^29.5.0" - "@types/node" "*" - jest-util "^29.5.0" - -jest-pnp-resolver@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz#b704ac0ae028a89108a4d040b3f919dfddc8e33c" - integrity sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w== - -jest-regex-util@^29.4.3: - version "29.4.3" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.4.3.tgz#a42616141e0cae052cfa32c169945d00c0aa0bb8" - integrity sha512-O4FglZaMmWXbGHSQInfXewIsd1LMn9p3ZXB/6r4FOkyhX2/iP/soMG98jGvk/A3HAN78+5VWcBGO0BJAPRh4kg== - -jest-resolve-dependencies@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.5.0.tgz#f0ea29955996f49788bf70996052aa98e7befee4" - integrity sha512-sjV3GFr0hDJMBpYeUuGduP+YeCRbd7S/ck6IvL3kQ9cpySYKqcqhdLLC2rFwrcL7tz5vYibomBrsFYWkIGGjOg== - dependencies: - jest-regex-util "^29.4.3" - jest-snapshot "^29.5.0" - -jest-resolve@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.5.0.tgz#b053cc95ad1d5f6327f0ac8aae9f98795475ecdc" - integrity sha512-1TzxJ37FQq7J10jPtQjcc+MkCkE3GBpBecsSUWJ0qZNJpmg6m0D9/7II03yJulm3H/fvVjgqLh/k2eYg+ui52w== - dependencies: - chalk "^4.0.0" - graceful-fs "^4.2.9" - jest-haste-map "^29.5.0" - jest-pnp-resolver "^1.2.2" - jest-util "^29.5.0" - jest-validate "^29.5.0" - resolve "^1.20.0" - resolve.exports "^2.0.0" - slash "^3.0.0" - -jest-runner@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.5.0.tgz#6a57c282eb0ef749778d444c1d758c6a7693b6f8" - integrity sha512-m7b6ypERhFghJsslMLhydaXBiLf7+jXy8FwGRHO3BGV1mcQpPbwiqiKUR2zU2NJuNeMenJmlFZCsIqzJCTeGLQ== - dependencies: - "@jest/console" "^29.5.0" - "@jest/environment" "^29.5.0" - "@jest/test-result" "^29.5.0" - "@jest/transform" "^29.5.0" - "@jest/types" "^29.5.0" - "@types/node" "*" - chalk "^4.0.0" - emittery "^0.13.1" - graceful-fs "^4.2.9" - jest-docblock "^29.4.3" - jest-environment-node "^29.5.0" - jest-haste-map "^29.5.0" - jest-leak-detector "^29.5.0" - jest-message-util "^29.5.0" - jest-resolve "^29.5.0" - jest-runtime "^29.5.0" - jest-util "^29.5.0" - jest-watcher "^29.5.0" - jest-worker "^29.5.0" - p-limit "^3.1.0" - source-map-support "0.5.13" - -jest-runtime@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.5.0.tgz#c83f943ee0c1da7eb91fa181b0811ebd59b03420" - integrity sha512-1Hr6Hh7bAgXQP+pln3homOiEZtCDZFqwmle7Ew2j8OlbkIu6uE3Y/etJQG8MLQs3Zy90xrp2C0BRrtPHG4zryw== - dependencies: - "@jest/environment" "^29.5.0" - "@jest/fake-timers" "^29.5.0" - "@jest/globals" "^29.5.0" - "@jest/source-map" "^29.4.3" - "@jest/test-result" "^29.5.0" - "@jest/transform" "^29.5.0" - "@jest/types" "^29.5.0" - "@types/node" "*" - chalk "^4.0.0" - cjs-module-lexer "^1.0.0" - collect-v8-coverage "^1.0.0" - glob "^7.1.3" - graceful-fs "^4.2.9" - jest-haste-map "^29.5.0" - jest-message-util "^29.5.0" - jest-mock "^29.5.0" - jest-regex-util "^29.4.3" - jest-resolve "^29.5.0" - jest-snapshot "^29.5.0" - jest-util "^29.5.0" - slash "^3.0.0" - strip-bom "^4.0.0" - -jest-snapshot@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.5.0.tgz#c9c1ce0331e5b63cd444e2f95a55a73b84b1e8ce" - integrity sha512-x7Wolra5V0tt3wRs3/ts3S6ciSQVypgGQlJpz2rsdQYoUKxMxPNaoHMGJN6qAuPJqS+2iQ1ZUn5kl7HCyls84g== - dependencies: - "@babel/core" "^7.11.6" - "@babel/generator" "^7.7.2" - "@babel/plugin-syntax-jsx" "^7.7.2" - "@babel/plugin-syntax-typescript" "^7.7.2" - "@babel/traverse" "^7.7.2" - "@babel/types" "^7.3.3" - "@jest/expect-utils" "^29.5.0" - "@jest/transform" "^29.5.0" - "@jest/types" "^29.5.0" - "@types/babel__traverse" "^7.0.6" - "@types/prettier" "^2.1.5" - babel-preset-current-node-syntax "^1.0.0" - chalk "^4.0.0" - expect "^29.5.0" - graceful-fs "^4.2.9" - jest-diff "^29.5.0" - jest-get-type "^29.4.3" - jest-matcher-utils "^29.5.0" - jest-message-util "^29.5.0" - jest-util "^29.5.0" - natural-compare "^1.4.0" - pretty-format "^29.5.0" - semver "^7.3.5" - -jest-util@^29.0.0: - version "29.0.2" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.0.2.tgz#c75c5cab7f3b410782f9570a60c5558b5dfb6e3a" - integrity sha512-ozk8ruEEEACxqpz0hN9UOgtPZS0aN+NffwQduR5dVlhN+eN47vxurtvgZkYZYMpYrsmlAEx1XabkB3BnN0GfKQ== - dependencies: - "@jest/types" "^29.0.2" - "@types/node" "*" - chalk "^4.0.0" - ci-info "^3.2.0" - graceful-fs "^4.2.9" - picomatch "^2.2.3" - -jest-util@^29.0.1: - version "29.0.1" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.0.1.tgz#f854a4a8877c7817316c4afbc2a851ceb2e71598" - integrity sha512-GIWkgNfkeA9d84rORDHPGGTFBrRD13A38QVSKE0bVrGSnoR1KDn8Kqz+0yI5kezMgbT/7zrWaruWP1Kbghlb2A== - dependencies: - "@jest/types" "^29.0.1" - "@types/node" "*" - chalk "^4.0.0" - ci-info "^3.2.0" - graceful-fs "^4.2.9" - picomatch "^2.2.3" - -jest-util@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.5.0.tgz#24a4d3d92fc39ce90425311b23c27a6e0ef16b8f" - integrity sha512-RYMgG/MTadOr5t8KdhejfvUU82MxsCu5MF6KuDUHl+NuwzUt+Sm6jJWxTJVrDR1j5M/gJVCPKQEpWXY+yIQ6lQ== - dependencies: - "@jest/types" "^29.5.0" - "@types/node" "*" - chalk "^4.0.0" - ci-info "^3.2.0" - graceful-fs "^4.2.9" - picomatch "^2.2.3" - -jest-validate@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.5.0.tgz#8e5a8f36178d40e47138dc00866a5f3bd9916ffc" - integrity sha512-pC26etNIi+y3HV8A+tUGr/lph9B18GnzSRAkPaaZJIE1eFdiYm6/CewuiJQ8/RlfHd1u/8Ioi8/sJ+CmbA+zAQ== - dependencies: - "@jest/types" "^29.5.0" - camelcase "^6.2.0" - chalk "^4.0.0" - jest-get-type "^29.4.3" - leven "^3.1.0" - pretty-format "^29.5.0" - -jest-watcher@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.5.0.tgz#cf7f0f949828ba65ddbbb45c743a382a4d911363" - integrity sha512-KmTojKcapuqYrKDpRwfqcQ3zjMlwu27SYext9pt4GlF5FUgB+7XE1mcCnSm6a4uUpFyQIkb6ZhzZvHl+jiBCiA== - dependencies: - "@jest/test-result" "^29.5.0" - "@jest/types" "^29.5.0" - "@types/node" "*" - ansi-escapes "^4.2.1" - chalk "^4.0.0" - emittery "^0.13.1" - jest-util "^29.5.0" - string-length "^4.0.1" - -jest-worker@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.5.0.tgz#bdaefb06811bd3384d93f009755014d8acb4615d" - integrity sha512-NcrQnevGoSp4b5kg+akIpthoAFHxPBcb5P6mYPY0fUNT+sSvmtu6jlkEle3anczUKIKEbMxFimk9oTP/tpIPgA== - dependencies: - "@types/node" "*" - jest-util "^29.5.0" - merge-stream "^2.0.0" - supports-color "^8.0.0" - -jest@29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/jest/-/jest-29.5.0.tgz#f75157622f5ce7ad53028f2f8888ab53e1f1f24e" - integrity sha512-juMg3he2uru1QoXX078zTa7pO85QyB9xajZc6bU+d9yEGwrKX6+vGmJQ3UdVZsvTEUARIdObzH68QItim6OSSQ== - dependencies: - "@jest/core" "^29.5.0" - "@jest/types" "^29.5.0" - import-local "^3.0.2" - jest-cli "^29.5.0" - -joycon@^3.0.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/joycon/-/joycon-3.1.1.tgz#bce8596d6ae808f8b68168f5fc69280996894f03" - integrity sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw== - -js-tokens@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" - integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== - -js-yaml@^3.13.1: - version "3.14.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" - integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - -jsesc@^2.5.1: - version "2.5.2" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" - integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== - -json-parse-even-better-errors@^2.3.0: - version "2.3.1" - resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" - integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== - -json5@^2.1.2, json5@^2.2.1: - version "2.2.2" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.2.tgz#64471c5bdcc564c18f7c1d4df2e2297f2457c5ab" - integrity sha512-46Tk9JiOL2z7ytNQWFLpj99RZkVgeHf87yGQKsIkaPz1qSH9UczKH1rO7K3wgRselo0tYMUNfecYpm/p1vC7tQ== - -json5@^2.2.3: - version "2.2.3" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" - integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== - -kleur@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" - integrity sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w== - -leven@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/leven/-/leven-3.1.0.tgz#77891de834064cccba82ae7842bb6b14a13ed7f2" - integrity sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A== - -lilconfig@^2.0.5: - version "2.0.6" - resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.0.6.tgz#32a384558bd58af3d4c6e077dd1ad1d397bc69d4" - integrity sha512-9JROoBW7pobfsx+Sq2JsASvCo6Pfo6WWoUW79HuB1BCoBXD4PLWJPqDF6fNj67pqBYTbAHkE57M1kS/+L1neOg== - -lines-and-columns@^1.1.6: - version "1.2.4" - resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" - integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== - -load-tsconfig@^0.2.0: - version "0.2.3" - resolved "https://registry.yarnpkg.com/load-tsconfig/-/load-tsconfig-0.2.3.tgz#08af3e7744943caab0c75f8af7f1703639c3ef1f" - integrity sha512-iyT2MXws+dc2Wi6o3grCFtGXpeMvHmJqS27sMPGtV2eUu4PeFnG+33I8BlFK1t1NWMjOpcx9bridn5yxLDX2gQ== - -locate-path@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" - integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== - dependencies: - p-locate "^4.1.0" - -lodash.memoize@4.x: - version "4.1.2" - resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" - integrity sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4= - -lodash.sortby@^4.7.0: - version "4.7.0" - resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" - integrity sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA== - -lru-cache@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" - integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== - dependencies: - yallist "^4.0.0" - -lru-cache@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-9.0.0.tgz#daece36a9fc332e93f8e75f3fcfd17900253567c" - integrity sha512-9AEKXzvOZc4BMacFnYiTOlDH/197LNnQIK9wZ6iMB5NXPzuv4bWR/Msv7iUMplkiMQ1qQL+KSv/JF1mZAB5Lrg== - -make-dir@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" - integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== - dependencies: - semver "^6.0.0" - -make-error@1.x, make-error@^1.1.1: - version "1.3.6" - resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" - integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw== - -makeerror@1.0.12: - version "1.0.12" - resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.12.tgz#3e5dd2079a82e812e983cc6610c4a2cb0eaa801a" - integrity sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg== - dependencies: - tmpl "1.0.5" - -media-typer@0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" - integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= - -merge-descriptors@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" - integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E= - -merge-stream@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" - integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== - -merge2@^1.3.0, merge2@^1.4.1: - version "1.4.1" - resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" - integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== - -methods@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" - integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= - -micromatch@^4.0.4: - version "4.0.4" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.4.tgz#896d519dfe9db25fce94ceb7a500919bf881ebf9" - integrity sha512-pRmzw/XUcwXGpD9aI9q/0XOwLNygjETJ8y0ao0wdqprrzDa4YnxLcz7fQRZr8voh8V10kGhABbNcHVk5wHgWwg== - dependencies: - braces "^3.0.1" - picomatch "^2.2.3" - -mime-db@1.51.0: - version "1.51.0" - resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.51.0.tgz#d9ff62451859b18342d960850dc3cfb77e63fb0c" - integrity sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g== - -mime-types@^2.1.12, mime-types@~2.1.24, mime-types@~2.1.34: - version "2.1.34" - resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.34.tgz#5a712f9ec1503511a945803640fafe09d3793c24" - integrity sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A== - dependencies: - mime-db "1.51.0" - -mime@1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" - integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== - -mimic-fn@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" - integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== - -minimatch@^3.0.4: - version "3.1.1" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.1.tgz#879ad447200773912898b46cd516a7abbb5e50b0" - integrity sha512-reLxBcKUPNBnc/sVtAbxgRVFSegoGeLaSjmphNhcwcolhYLRgtJscn5mRl6YRZNQv40Y7P6JM2YhSIsbL9OB5A== - dependencies: - brace-expansion "^1.1.7" - -minimatch@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-9.0.0.tgz#bfc8e88a1c40ffd40c172ddac3decb8451503b56" - integrity sha512-0jJj8AvgKqWN05mrwuqi8QYKx1WmYSUoKSxu5Qhs9prezTz10sxAHGNZe9J9cqIJzta8DWsleh2KaVaLl6Ru2w== - dependencies: - brace-expansion "^2.0.1" - -minimist@^1.2.6: - version "1.2.6" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" - integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== - -minipass@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/minipass/-/minipass-5.0.0.tgz#3e9788ffb90b694a5d0ec94479a45b5d8738133d" - integrity sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ== - -mkdirp@^0.5.4: - version "0.5.6" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.6.tgz#7def03d2432dcae4ba1d611445c48396062255f6" - integrity sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw== - dependencies: - minimist "^1.2.6" - -ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= - -ms@2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" - integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== - -ms@2.1.3: - version "2.1.3" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" - integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== - -multer@1.4.5-lts.1: - version "1.4.5-lts.1" - resolved "https://registry.yarnpkg.com/multer/-/multer-1.4.5-lts.1.tgz#803e24ad1984f58edffbc79f56e305aec5cfd1ac" - integrity sha512-ywPWvcDMeH+z9gQq5qYHCCy+ethsk4goepZ45GLD63fOu0YcNecQxi64nDs3qluZB+murG3/D4dJ7+dGctcCQQ== - dependencies: - append-field "^1.0.0" - busboy "^1.0.0" - concat-stream "^1.5.2" - mkdirp "^0.5.4" - object-assign "^4.1.1" - type-is "^1.6.4" - xtend "^4.0.0" - -mz@^2.7.0: - version "2.7.0" - resolved "https://registry.yarnpkg.com/mz/-/mz-2.7.0.tgz#95008057a56cafadc2bc63dde7f9ff6955948e32" - integrity sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q== - dependencies: - any-promise "^1.0.0" - object-assign "^4.0.1" - thenify-all "^1.0.0" - -natural-compare@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" - integrity sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc= - -negotiator@0.6.3: - version "0.6.3" - resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.3.tgz#58e323a72fedc0d6f9cd4d31fe49f51479590ccd" - integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg== - -node-int64@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" - integrity sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs= - -node-releases@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.2.tgz#7139fe71e2f4f11b47d4d2986aaf8c48699e0c01" - integrity sha512-XxYDdcQ6eKqp/YjI+tb2C5WM2LgjnZrfYg4vgQt49EK268b6gYCHsBLrK2qvJo4FmCtqmKezb0WZFK4fkrZNsg== - -node-releases@^2.0.3: - version "2.0.4" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.4.tgz#f38252370c43854dc48aa431c766c6c398f40476" - integrity sha512-gbMzqQtTtDz/00jQzZ21PQzdI9PyLYqUSvD0p3naOhX4odFji0ZxYdnVwPTxmSwkmxhcFImpozceidSG+AgoPQ== - -normalize-path@^3.0.0, normalize-path@~3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" - integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== - -npm-run-path@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" - integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== - dependencies: - path-key "^3.0.0" - -object-assign@^4.0.1, object-assign@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== - -object-inspect@^1.9.0: - version "1.12.0" - resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.0.tgz#6e2c120e868fd1fd18cb4f18c31741d0d6e776f0" - integrity sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g== - -on-finished@2.4.1: - version "2.4.1" - resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.4.1.tgz#58c8c44116e54845ad57f14ab10b03533184ac3f" - integrity sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg== - dependencies: - ee-first "1.1.1" - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E= - dependencies: - wrappy "1" - -onetime@^5.1.2: - version "5.1.2" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-5.1.2.tgz#d0e96ebb56b07476df1dd9c4806e5237985ca45e" - integrity sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg== - dependencies: - mimic-fn "^2.1.0" - -p-limit@^2.2.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" - integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== - dependencies: - p-try "^2.0.0" - -p-limit@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" - integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== - dependencies: - yocto-queue "^0.1.0" - -p-locate@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" - integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== - dependencies: - p-limit "^2.2.0" - -p-try@^2.0.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" - integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== - -parse-json@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd" - integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== - dependencies: - "@babel/code-frame" "^7.0.0" - error-ex "^1.3.1" - json-parse-even-better-errors "^2.3.0" - lines-and-columns "^1.1.6" - -parseurl@~1.3.3: - version "1.3.3" - resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" - integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== - -path-exists@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" - integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== - -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18= - -path-key@^3.0.0, path-key@^3.1.0: - version "3.1.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" - integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== - -path-parse@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" - integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== - -path-scurry@^1.6.4: - version "1.6.4" - resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-1.6.4.tgz#020a9449e5382a4acb684f9c7e1283bc5695de66" - integrity sha512-Qp/9IHkdNiXJ3/Kon++At2nVpnhRiPq/aSvQN+H3U1WZbvNRK0RIQK/o4HMqPoXjpuGJUEWpHSs6Mnjxqh3TQg== - dependencies: - lru-cache "^9.0.0" - minipass "^5.0.0" - -path-to-regexp@0.1.7: - version "0.1.7" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" - integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w= - -path-type@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" - integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== - -picocolors@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" - integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== - -picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3: - version "2.3.1" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" - integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== - -pirates@^4.0.1, pirates@^4.0.4: - version "4.0.5" - resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.5.tgz#feec352ea5c3268fb23a37c702ab1699f35a5f3b" - integrity sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ== - -pkg-dir@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" - integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== - dependencies: - find-up "^4.0.0" - -postcss-load-config@^3.0.1: - version "3.1.4" - resolved "https://registry.yarnpkg.com/postcss-load-config/-/postcss-load-config-3.1.4.tgz#1ab2571faf84bb078877e1d07905eabe9ebda855" - integrity sha512-6DiM4E7v4coTE4uzA8U//WhtPwyhiim3eyjEMFCnUpzbrkK9wJHgKDT2mR+HbtSrd/NubVaYTOpSpjUl8NQeRg== - dependencies: - lilconfig "^2.0.5" - yaml "^1.10.2" - -pretty-format@^29.0.0, pretty-format@^29.0.1: - version "29.0.1" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.0.1.tgz#2f8077114cdac92a59b464292972a106410c7ad0" - integrity sha512-iTHy3QZMzuL484mSTYbQIM1AHhEQsH8mXWS2/vd2yFBYnG3EBqGiMONo28PlPgrW7P/8s/1ISv+y7WH306l8cw== - dependencies: - "@jest/schemas" "^29.0.0" - ansi-styles "^5.0.0" - react-is "^18.0.0" - -pretty-format@^29.5.0: - version "29.5.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.5.0.tgz#283134e74f70e2e3e7229336de0e4fce94ccde5a" - integrity sha512-V2mGkI31qdttvTFX7Mt4efOqHXqJWMu4/r66Xh3Z3BwZaPfPJgp6/gbwoujRpPUtfEF6AUUWx3Jim3GCw5g/Qw== - dependencies: - "@jest/schemas" "^29.4.3" - ansi-styles "^5.0.0" - react-is "^18.0.0" - -process-nextick-args@~2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" - integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== - -prompts@^2.0.1: - version "2.4.2" - resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.4.2.tgz#7b57e73b3a48029ad10ebd44f74b01722a4cb069" - integrity sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q== - dependencies: - kleur "^3.0.3" - sisteransi "^1.0.5" - -proxy-addr@~2.0.7: - version "2.0.7" - resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025" - integrity sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg== - dependencies: - forwarded "0.2.0" - ipaddr.js "1.9.1" - -proxy-from-env@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" - integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== - -punycode@^2.1.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" - integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== - -pure-rand@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/pure-rand/-/pure-rand-6.0.0.tgz#701996ceefa253507923a0e864c17ab421c04a7c" - integrity sha512-rLSBxJjP+4DQOgcJAx6RZHT2he2pkhQdSnofG5VWyVl6GRq/K02ISOuOLcsMOrtKDIJb8JN2zm3FFzWNbezdPw== - -qs@6.11.0: - version "6.11.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a" - integrity sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q== - dependencies: - side-channel "^1.0.4" - -queue-microtask@^1.2.2: - version "1.2.3" - resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" - integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== - -range-parser@~1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" - integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== - -raw-body@2.5.1: - version "2.5.1" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.1.tgz#fe1b1628b181b700215e5fd42389f98b71392857" - integrity sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig== - dependencies: - bytes "3.1.2" - http-errors "2.0.0" - iconv-lite "0.4.24" - unpipe "1.0.0" - -react-is@^18.0.0: - version "18.1.0" - resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.1.0.tgz#61aaed3096d30eacf2a2127118b5b41387d32a67" - integrity sha512-Fl7FuabXsJnV5Q1qIOQwx/sagGF18kogb4gpfcG4gjLBWO0WDiiz1ko/ExayuxE7InyQkBLkxRFG5oxY6Uu3Kg== - -readable-stream@^2.2.2: - version "2.3.7" - resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57" - integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw== - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.3" - isarray "~1.0.0" - process-nextick-args "~2.0.0" - safe-buffer "~5.1.1" - string_decoder "~1.1.1" - util-deprecate "~1.0.1" - -readdirp@~3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" - integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== - dependencies: - picomatch "^2.2.1" - -require-directory@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" - integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I= - -resolve-cwd@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/resolve-cwd/-/resolve-cwd-3.0.0.tgz#0f0075f1bb2544766cf73ba6a6e2adfebcb13f2d" - integrity sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg== - dependencies: - resolve-from "^5.0.0" - -resolve-from@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" - integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== - -resolve.exports@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-2.0.0.tgz#c1a0028c2d166ec2fbf7d0644584927e76e7400e" - integrity sha512-6K/gDlqgQscOlg9fSRpWstA8sYe8rbELsSTNpx+3kTrsVCzvSl0zIvRErM7fdl9ERWDsKnrLnwB+Ne89918XOg== - -resolve@^1.20.0: - version "1.22.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.0.tgz#5e0b8c67c15df57a89bdbabe603a002f21731198" - integrity sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw== - dependencies: - is-core-module "^2.8.1" - path-parse "^1.0.7" - supports-preserve-symlinks-flag "^1.0.0" - -reusify@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" - integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== - -rimraf@5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-5.0.0.tgz#5bda14e410d7e4dd522154891395802ce032c2cb" - integrity sha512-Jf9llaP+RvaEVS5nPShYFhtXIrb3LRKP281ib3So0KkeZKo2wIKyq0Re7TOSwanasA423PSr6CCIL4bP6T040g== - dependencies: - glob "^10.0.0" - -rollup@^2.74.1: - version "2.79.1" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.79.1.tgz#bedee8faef7c9f93a2647ac0108748f497f081c7" - integrity sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw== - optionalDependencies: - fsevents "~2.3.2" - -run-parallel@^1.1.9: - version "1.2.0" - resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" - integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== - dependencies: - queue-microtask "^1.2.2" - -safe-buffer@5.2.1: - version "5.2.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== - -safe-buffer@~5.1.0, safe-buffer@~5.1.1: - version "5.1.2" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - -"safer-buffer@>= 2.1.2 < 3": - version "2.1.2" - resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" - integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== - -semver@7.x: - version "7.3.5" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7" - integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ== - dependencies: - lru-cache "^6.0.0" - -semver@^6.0.0, semver@^6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" - integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== - -semver@^7.3.5: - version "7.3.7" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.7.tgz#12c5b649afdbf9049707796e22a4028814ce523f" - integrity sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g== - dependencies: - lru-cache "^6.0.0" - -send@0.18.0: - version "0.18.0" - resolved "https://registry.yarnpkg.com/send/-/send-0.18.0.tgz#670167cc654b05f5aa4a767f9113bb371bc706be" - integrity sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg== - dependencies: - debug "2.6.9" - depd "2.0.0" - destroy "1.2.0" - encodeurl "~1.0.2" - escape-html "~1.0.3" - etag "~1.8.1" - fresh "0.5.2" - http-errors "2.0.0" - mime "1.6.0" - ms "2.1.3" - on-finished "2.4.1" - range-parser "~1.2.1" - statuses "2.0.1" - -serve-static@1.15.0: - version "1.15.0" - resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.15.0.tgz#faaef08cffe0a1a62f60cad0c4e513cff0ac9540" - integrity sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g== - dependencies: - encodeurl "~1.0.2" - escape-html "~1.0.3" - parseurl "~1.3.3" - send "0.18.0" - -setprototypeof@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" - integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== - -shebang-command@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" - integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== - dependencies: - shebang-regex "^3.0.0" - -shebang-regex@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" - integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== - -side-channel@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" - integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== - dependencies: - call-bind "^1.0.0" - get-intrinsic "^1.0.2" - object-inspect "^1.9.0" - -signal-exit@^3.0.3, signal-exit@^3.0.7: - version "3.0.7" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" - integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== - -sisteransi@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.5.tgz#134d681297756437cc05ca01370d3a7a571075ed" - integrity sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg== - -slash@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" - integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== - -source-map-support@0.5.13: - version "0.5.13" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.13.tgz#31b24a9c2e73c2de85066c0feb7d44767ed52932" - integrity sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - -source-map@0.8.0-beta.0: - version "0.8.0-beta.0" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.8.0-beta.0.tgz#d4c1bb42c3f7ee925f005927ba10709e0d1d1f11" - integrity sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA== - dependencies: - whatwg-url "^7.0.0" - -source-map@^0.5.0: - version "0.5.7" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" - integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= - -source-map@^0.6.0, source-map@^0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - -sprintf-js@~1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" - integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= - -stack-utils@^2.0.3: - version "2.0.5" - resolved "https://registry.yarnpkg.com/stack-utils/-/stack-utils-2.0.5.tgz#d25265fca995154659dbbfba3b49254778d2fdd5" - integrity sha512-xrQcmYhOsn/1kX+Vraq+7j4oE2j/6BFscZ0etmYg81xuM8Gq0022Pxb8+IqgOFUIaxHs0KaSb7T1+OegiNrNFA== - dependencies: - escape-string-regexp "^2.0.0" - -statuses@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" - integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== - -streamsearch@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/streamsearch/-/streamsearch-1.1.0.tgz#404dd1e2247ca94af554e841a8ef0eaa238da764" - integrity sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg== - -string-length@^4.0.1: - version "4.0.2" - resolved "https://registry.yarnpkg.com/string-length/-/string-length-4.0.2.tgz#a8a8dc7bd5c1a82b9b3c8b87e125f66871b6e57a" - integrity sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ== - dependencies: - char-regex "^1.0.2" - strip-ansi "^6.0.0" - -string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8" - integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== - dependencies: - safe-buffer "~5.1.0" - -strip-ansi@^6.0.0, strip-ansi@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - -strip-bom@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-4.0.0.tgz#9c3505c1db45bcedca3d9cf7a16f5c5aa3901878" - integrity sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w== - -strip-final-newline@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" - integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA== - -strip-json-comments@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" - integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== - -sucrase@^3.20.3: - version "3.28.0" - resolved "https://registry.yarnpkg.com/sucrase/-/sucrase-3.28.0.tgz#7fd8b3118d2155fcdf291088ab77fa6eefd63c4c" - integrity sha512-TK9600YInjuiIhVM3729rH4ZKPOsGeyXUwY+Ugu9eilNbdTFyHr6XcAGYbRVZPDgWj6tgI7bx95aaJjHnbffag== - dependencies: - commander "^4.0.0" - glob "7.1.6" - lines-and-columns "^1.1.6" - mz "^2.7.0" - pirates "^4.0.1" - ts-interface-checker "^0.1.9" - -supports-color@^5.3.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" - integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== - dependencies: - has-flag "^3.0.0" - -supports-color@^7.1.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" - integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== - dependencies: - has-flag "^4.0.0" - -supports-color@^8.0.0: - version "8.1.1" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" - integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== - dependencies: - has-flag "^4.0.0" - -supports-preserve-symlinks-flag@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" - integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== - -test-exclude@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e" - integrity sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w== - dependencies: - "@istanbuljs/schema" "^0.1.2" - glob "^7.1.4" - minimatch "^3.0.4" - -thenify-all@^1.0.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/thenify-all/-/thenify-all-1.6.0.tgz#1a1918d402d8fc3f98fbf234db0bcc8cc10e9726" - integrity sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA== - dependencies: - thenify ">= 3.1.0 < 4" - -"thenify@>= 3.1.0 < 4": - version "3.3.1" - resolved "https://registry.yarnpkg.com/thenify/-/thenify-3.3.1.tgz#8932e686a4066038a016dd9e2ca46add9838a95f" - integrity sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw== - dependencies: - any-promise "^1.0.0" - -tmpl@1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc" - integrity sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw== - -to-fast-properties@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" - integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= - -to-regex-range@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" - integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== - dependencies: - is-number "^7.0.0" - -toidentifier@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" - integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== - -tr46@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" - integrity sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA== - dependencies: - punycode "^2.1.0" - -tree-kill@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/tree-kill/-/tree-kill-1.2.2.tgz#4ca09a9092c88b73a7cdc5e8a01b507b0790a0cc" - integrity sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A== - -ts-interface-checker@^0.1.9: - version "0.1.13" - resolved "https://registry.yarnpkg.com/ts-interface-checker/-/ts-interface-checker-0.1.13.tgz#784fd3d679722bc103b1b4b8030bcddb5db2a699" - integrity sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA== - -ts-jest@29.1.0: - version "29.1.0" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-29.1.0.tgz#4a9db4104a49b76d2b368ea775b6c9535c603891" - integrity sha512-ZhNr7Z4PcYa+JjMl62ir+zPiNJfXJN6E8hSLnaUKhOgqcn8vb3e537cpkd0FuAfRK3sR1LSqM1MOhliXNgOFPA== - dependencies: - bs-logger "0.x" - fast-json-stable-stringify "2.x" - jest-util "^29.0.0" - json5 "^2.2.3" - lodash.memoize "4.x" - make-error "1.x" - semver "7.x" - yargs-parser "^21.0.1" - -ts-node@10.9.1: - version "10.9.1" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.1.tgz#e73de9102958af9e1f0b168a6ff320e25adcff4b" - integrity sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw== - dependencies: - "@cspotcode/source-map-support" "^0.8.0" - "@tsconfig/node10" "^1.0.7" - "@tsconfig/node12" "^1.0.7" - "@tsconfig/node14" "^1.0.0" - "@tsconfig/node16" "^1.0.2" - acorn "^8.4.1" - acorn-walk "^8.1.1" - arg "^4.1.0" - create-require "^1.1.0" - diff "^4.0.1" - make-error "^1.1.1" - v8-compile-cache-lib "^3.0.1" - yn "3.1.1" - -tsup@6.3.0: - version "6.3.0" - resolved "https://registry.yarnpkg.com/tsup/-/tsup-6.3.0.tgz#aa270a788e54248d4a5541f722c8763bca778e3c" - integrity sha512-IaNQO/o1rFgadLhNonVKNCT2cks+vvnWX3DnL8sB87lBDqRvJXHENr5lSPJlqwplUlDxSwZK8dSg87rgBu6Emw== - dependencies: - bundle-require "^3.1.0" - cac "^6.7.12" - chokidar "^3.5.1" - debug "^4.3.1" - esbuild "^0.15.1" - execa "^5.0.0" - globby "^11.0.3" - joycon "^3.0.1" - postcss-load-config "^3.0.1" - resolve-from "^5.0.0" - rollup "^2.74.1" - source-map "0.8.0-beta.0" - sucrase "^3.20.3" - tree-kill "^1.2.2" - -type-detect@4.0.8: - version "4.0.8" - resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" - integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== - -type-fest@^0.21.3: - version "0.21.3" - resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.21.3.tgz#d260a24b0198436e133fa26a524a6d65fa3b2e37" - integrity sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w== - -type-is@^1.6.4, type-is@~1.6.18: - version "1.6.18" - resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" - integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== - dependencies: - media-typer "0.3.0" - mime-types "~2.1.24" - -typedarray@^0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" - integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA== - -typescript@5.0.4: - version "5.0.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.0.4.tgz#b217fd20119bd61a94d4011274e0ab369058da3b" - integrity sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw== - -unpipe@1.0.0, unpipe@~1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" - integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= - -util-deprecate@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" - integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw== - -utils-merge@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" - integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= - -v8-compile-cache-lib@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf" - integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg== - -v8-to-istanbul@^9.0.1: - version "9.0.1" - resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.0.1.tgz#b6f994b0b5d4ef255e17a0d17dc444a9f5132fa4" - integrity sha512-74Y4LqY74kLE6IFyIjPtkSTWzUZmj8tdHT9Ii/26dvQ6K9Dl2NbEfj0XgU2sHCtKgt5VupqhlO/5aWuqS+IY1w== - dependencies: - "@jridgewell/trace-mapping" "^0.3.12" - "@types/istanbul-lib-coverage" "^2.0.1" - convert-source-map "^1.6.0" - -vary@~1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" - integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= - -walker@^1.0.8: - version "1.0.8" - resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.8.tgz#bd498db477afe573dc04185f011d3ab8a8d7653f" - integrity sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ== - dependencies: - makeerror "1.0.12" - -webidl-conversions@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" - integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg== - -whatwg-url@^7.0.0: - version "7.1.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-7.1.0.tgz#c2c492f1eca612988efd3d2266be1b9fc6170d06" - integrity sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg== - dependencies: - lodash.sortby "^4.7.0" - tr46 "^1.0.1" - webidl-conversions "^4.0.2" - -which@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" - integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== - dependencies: - isexe "^2.0.0" - -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8= - -write-file-atomic@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-4.0.2.tgz#a9df01ae5b77858a027fd2e80768ee433555fcfd" - integrity sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg== - dependencies: - imurmurhash "^0.1.4" - signal-exit "^3.0.7" - -xtend@^4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54" - integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== - -y18n@^5.0.5: - version "5.0.8" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55" - integrity sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA== - -yallist@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" - integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== - -yaml@^1.10.2: - version "1.10.2" - resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" - integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== - -yargs-parser@^21.0.0, yargs-parser@^21.0.1: - version "21.0.1" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.0.1.tgz#0267f286c877a4f0f728fceb6f8a3e4cb95c6e35" - integrity sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg== - -yargs@^17.3.1: - version "17.4.1" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.4.1.tgz#ebe23284207bb75cee7c408c33e722bfb27b5284" - integrity sha512-WSZD9jgobAg3ZKuCQZSa3g9QOJeCCqLoLAykiWgmXnDo9EPnn4RPf5qVTtzgOx66o6/oqhcA5tHtJXpG8pMt3g== - dependencies: - cliui "^7.0.2" - escalade "^3.1.1" - get-caller-file "^2.0.5" - require-directory "^2.1.1" - string-width "^4.2.3" - y18n "^5.0.5" - yargs-parser "^21.0.0" - -yn@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50" - integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q== - -yocto-queue@^0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" - integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== - -zod@3.21.4: - version "3.21.4" - resolved "https://registry.yarnpkg.com/zod/-/zod-3.21.4.tgz#10882231d992519f0a10b5dd58a38c9dabbb64db" - integrity sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw== From 5fd697f96cc84eeae623155fcb52f6c889647378 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Fri, 11 Nov 2022 21:47:54 +0100 Subject: [PATCH 016/206] chore(changeset): use changeset --- .changeset/README.md | 8 + .changeset/config.json | 11 + .changeset/pre.json | 8 + .github/workflows/ci.yml | 8 +- .github/workflows/publish.yml | 18 +- package.json | 3 + pnpm-lock.yaml | 1186 ++++++++++++++++++++++++++++++--- 7 files changed, 1134 insertions(+), 108 deletions(-) create mode 100644 .changeset/README.md create mode 100644 .changeset/config.json create mode 100644 .changeset/pre.json diff --git a/.changeset/README.md b/.changeset/README.md new file mode 100644 index 00000000..e5b6d8d6 --- /dev/null +++ b/.changeset/README.md @@ -0,0 +1,8 @@ +# Changesets + +Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works +with multi-package repos, or single-package repos to help you version and publish your code. You can +find the full documentation for it [in our repository](https://github.com/changesets/changesets) + +We have a quick list of common questions to get you started engaging with this project in +[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) diff --git a/.changeset/config.json b/.changeset/config.json new file mode 100644 index 00000000..8523752f --- /dev/null +++ b/.changeset/config.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://unpkg.com/@changesets/config@2.2.0/schema.json", + "changelog": "@changesets/cli/changelog", + "commit": false, + "fixed": [["@zodios/*"]], + "linked": [], + "access": "public", + "baseBranch": "main", + "updateInternalDependencies": "patch", + "ignore": [] +} diff --git a/.changeset/pre.json b/.changeset/pre.json new file mode 100644 index 00000000..69cc4d3a --- /dev/null +++ b/.changeset/pre.json @@ -0,0 +1,8 @@ +{ + "mode": "pre", + "tag": "beta", + "initialVersions": { + "@zodios/core": "11.0.0-rc.0" + }, + "changesets": [] +} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4edc70f1..5510d41a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,10 +34,10 @@ jobs: uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - cache: "yarn" - - run: yarn install --ignore-engines - - run: yarn build - - run: yarn test + cache: "pnpm" + - run: pnpm install --ignore-engines + - run: pnpm build + - run: pnpm test analyze: name: Analyze runs-on: ubuntu-latest diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2e39c9cf..3ca036b7 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -18,23 +18,15 @@ jobs: with: registry-url: "https://registry.npmjs.org" node-version: ${{ matrix.node-version }} - cache: "yarn" + cache: "pnpm" - name: install dependencies - run: yarn install + run: pnpm install - name: build - run: yarn build + run: pnpm build - name: run test - run: yarn test + run: pnpm test - name: publish to npm - # only run when tag has no 'rc' in it - if: ${{ !contains(github.ref, 'rc') }} - run: yarn publish --access public - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - name: publish beta to npm - # only run when tag has 'rc' in it - if: ${{ contains(github.ref, 'rc') }} - run: yarn publish --access public --tag beta + run: pnpm changeset publish env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: generate changelog diff --git a/package.json b/package.json index 8d965498..df3f8d5d 100644 --- a/package.json +++ b/package.json @@ -10,5 +10,8 @@ "private": true, "devDependencies": { "turbo": "1.6.3" + }, + "dependencies": { + "@changesets/cli": "^2.25.2" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c9a7f4d6..65c80ad2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,7 +4,10 @@ importers: .: specifiers: + '@changesets/cli': ^2.25.2 turbo: 1.6.3 + dependencies: + '@changesets/cli': 2.25.2 devDependencies: turbo: 1.6.3 @@ -63,7 +66,6 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/highlight': 7.18.6 - dev: true /@babel/compat-data/7.20.1: resolution: {integrity: sha512-EWZ4mE2diW3QALKvDMiXnbZpRvlj+nayZ112nK93SnhqOtpdsbVD4W+2tEoT3YNBAG9RBR0ISY758ZkOgsn6pQ==} @@ -185,7 +187,6 @@ packages: /@babel/helper-validator-identifier/7.19.1: resolution: {integrity: sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==} engines: {node: '>=6.9.0'} - dev: true /@babel/helper-validator-option/7.18.6: resolution: {integrity: sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw==} @@ -210,7 +211,6 @@ packages: '@babel/helper-validator-identifier': 7.19.1 chalk: 2.4.2 js-tokens: 4.0.0 - dev: true /@babel/parser/7.20.3: resolution: {integrity: sha512-OP/s5a94frIPXwjzEcv5S/tpQfc6XhxYUnmWpgdqMWGgYCuErA3SzozaRAMQgSZWKeTJxht9aWAkUY+0UzvOFg==} @@ -349,6 +349,13 @@ packages: '@babel/helper-plugin-utils': 7.20.2 dev: true + /@babel/runtime/7.20.1: + resolution: {integrity: sha512-mrzLkl6U9YLF8qpqI7TB82PESyEGjm/0Ly91jG575eVxMMlb8fYfOXFZIJ8XfLrJZQbm7dlKry2bJmXBUEkdFg==} + engines: {node: '>=6.9.0'} + dependencies: + regenerator-runtime: 0.13.10 + dev: false + /@babel/template/7.18.10: resolution: {integrity: sha512-TI+rCtooWHr3QJ27kJxfjutghu44DLnasDMwpDqCXVTal9RLp3RSYNh4NdBrRP2cQAoG9A8juOQl6P6oZG4JxA==} engines: {node: '>=6.9.0'} @@ -389,6 +396,189 @@ packages: resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} dev: true + /@changesets/apply-release-plan/6.1.2: + resolution: {integrity: sha512-H8TV9E/WtJsDfoDVbrDGPXmkZFSv7W2KLqp4xX4MKZXshb0hsQZUNowUa8pnus9qb/5OZrFFRVsUsDCVHNW/AQ==} + dependencies: + '@babel/runtime': 7.20.1 + '@changesets/config': 2.2.0 + '@changesets/get-version-range-type': 0.3.2 + '@changesets/git': 1.5.0 + '@changesets/types': 5.2.0 + '@manypkg/get-packages': 1.1.3 + detect-indent: 6.1.0 + fs-extra: 7.0.1 + lodash.startcase: 4.4.0 + outdent: 0.5.0 + prettier: 2.7.1 + resolve-from: 5.0.0 + semver: 5.7.1 + dev: false + + /@changesets/assemble-release-plan/5.2.2: + resolution: {integrity: sha512-B1qxErQd85AeZgZFZw2bDKyOfdXHhG+X5S+W3Da2yCem8l/pRy4G/S7iOpEcMwg6lH8q2ZhgbZZwZ817D+aLuQ==} + dependencies: + '@babel/runtime': 7.20.1 + '@changesets/errors': 0.1.4 + '@changesets/get-dependents-graph': 1.3.4 + '@changesets/types': 5.2.0 + '@manypkg/get-packages': 1.1.3 + semver: 5.7.1 + dev: false + + /@changesets/changelog-git/0.1.13: + resolution: {integrity: sha512-zvJ50Q+EUALzeawAxax6nF2WIcSsC5PwbuLeWkckS8ulWnuPYx8Fn/Sjd3rF46OzeKA8t30loYYV6TIzp4DIdg==} + dependencies: + '@changesets/types': 5.2.0 + dev: false + + /@changesets/cli/2.25.2: + resolution: {integrity: sha512-ACScBJXI3kRyMd2R8n8SzfttDHi4tmKSwVwXBazJOylQItSRSF4cGmej2E4FVf/eNfGy6THkL9GzAahU9ErZrA==} + hasBin: true + dependencies: + '@babel/runtime': 7.20.1 + '@changesets/apply-release-plan': 6.1.2 + '@changesets/assemble-release-plan': 5.2.2 + '@changesets/changelog-git': 0.1.13 + '@changesets/config': 2.2.0 + '@changesets/errors': 0.1.4 + '@changesets/get-dependents-graph': 1.3.4 + '@changesets/get-release-plan': 3.0.15 + '@changesets/git': 1.5.0 + '@changesets/logger': 0.0.5 + '@changesets/pre': 1.0.13 + '@changesets/read': 0.5.8 + '@changesets/types': 5.2.0 + '@changesets/write': 0.2.2 + '@manypkg/get-packages': 1.1.3 + '@types/is-ci': 3.0.0 + '@types/semver': 6.2.3 + ansi-colors: 4.1.3 + chalk: 2.4.2 + enquirer: 2.3.6 + external-editor: 3.1.0 + fs-extra: 7.0.1 + human-id: 1.0.2 + is-ci: 3.0.1 + meow: 6.1.1 + outdent: 0.5.0 + p-limit: 2.3.0 + preferred-pm: 3.0.3 + resolve-from: 5.0.0 + semver: 5.7.1 + spawndamnit: 2.0.0 + term-size: 2.2.1 + tty-table: 4.1.6 + dev: false + + /@changesets/config/2.2.0: + resolution: {integrity: sha512-GGaokp3nm5FEDk/Fv2PCRcQCOxGKKPRZ7prcMqxEr7VSsG75MnChQE8plaW1k6V8L2bJE+jZWiRm19LbnproOw==} + dependencies: + '@changesets/errors': 0.1.4 + '@changesets/get-dependents-graph': 1.3.4 + '@changesets/logger': 0.0.5 + '@changesets/types': 5.2.0 + '@manypkg/get-packages': 1.1.3 + fs-extra: 7.0.1 + micromatch: 4.0.5 + dev: false + + /@changesets/errors/0.1.4: + resolution: {integrity: sha512-HAcqPF7snsUJ/QzkWoKfRfXushHTu+K5KZLJWPb34s4eCZShIf8BFO3fwq6KU8+G7L5KdtN2BzQAXOSXEyiY9Q==} + dependencies: + extendable-error: 0.1.7 + dev: false + + /@changesets/get-dependents-graph/1.3.4: + resolution: {integrity: sha512-+C4AOrrFY146ydrgKOo5vTZfj7vetNu1tWshOID+UjPUU9afYGDXI8yLnAeib1ffeBXV3TuGVcyphKpJ3cKe+A==} + dependencies: + '@changesets/types': 5.2.0 + '@manypkg/get-packages': 1.1.3 + chalk: 2.4.2 + fs-extra: 7.0.1 + semver: 5.7.1 + dev: false + + /@changesets/get-release-plan/3.0.15: + resolution: {integrity: sha512-W1tFwxE178/en+zSj/Nqbc3mvz88mcdqUMJhRzN1jDYqN3QI4ifVaRF9mcWUU+KI0gyYEtYR65tour690PqTcA==} + dependencies: + '@babel/runtime': 7.20.1 + '@changesets/assemble-release-plan': 5.2.2 + '@changesets/config': 2.2.0 + '@changesets/pre': 1.0.13 + '@changesets/read': 0.5.8 + '@changesets/types': 5.2.0 + '@manypkg/get-packages': 1.1.3 + dev: false + + /@changesets/get-version-range-type/0.3.2: + resolution: {integrity: sha512-SVqwYs5pULYjYT4op21F2pVbcrca4qA/bAA3FmFXKMN7Y+HcO8sbZUTx3TAy2VXulP2FACd1aC7f2nTuqSPbqg==} + dev: false + + /@changesets/git/1.5.0: + resolution: {integrity: sha512-Xo8AT2G7rQJSwV87c8PwMm6BAc98BnufRMsML7m7Iw8Or18WFvFmxqG5aOL5PBvhgq9KrKvaeIBNIymracSuHg==} + dependencies: + '@babel/runtime': 7.20.1 + '@changesets/errors': 0.1.4 + '@changesets/types': 5.2.0 + '@manypkg/get-packages': 1.1.3 + is-subdir: 1.2.0 + spawndamnit: 2.0.0 + dev: false + + /@changesets/logger/0.0.5: + resolution: {integrity: sha512-gJyZHomu8nASHpaANzc6bkQMO9gU/ib20lqew1rVx753FOxffnCrJlGIeQVxNWCqM+o6OOleCo/ivL8UAO5iFw==} + dependencies: + chalk: 2.4.2 + dev: false + + /@changesets/parse/0.3.15: + resolution: {integrity: sha512-3eDVqVuBtp63i+BxEWHPFj2P1s3syk0PTrk2d94W9JD30iG+OER0Y6n65TeLlY8T2yB9Fvj6Ev5Gg0+cKe/ZUA==} + dependencies: + '@changesets/types': 5.2.0 + js-yaml: 3.14.1 + dev: false + + /@changesets/pre/1.0.13: + resolution: {integrity: sha512-jrZc766+kGZHDukjKhpBXhBJjVQMied4Fu076y9guY1D3H622NOw8AQaLV3oQsDtKBTrT2AUFjt9Z2Y9Qx+GfA==} + dependencies: + '@babel/runtime': 7.20.1 + '@changesets/errors': 0.1.4 + '@changesets/types': 5.2.0 + '@manypkg/get-packages': 1.1.3 + fs-extra: 7.0.1 + dev: false + + /@changesets/read/0.5.8: + resolution: {integrity: sha512-eYaNfxemgX7f7ELC58e7yqQICW5FB7V+bd1lKt7g57mxUrTveYME+JPaBPpYx02nP53XI6CQp6YxnR9NfmFPKw==} + dependencies: + '@babel/runtime': 7.20.1 + '@changesets/git': 1.5.0 + '@changesets/logger': 0.0.5 + '@changesets/parse': 0.3.15 + '@changesets/types': 5.2.0 + chalk: 2.4.2 + fs-extra: 7.0.1 + p-filter: 2.1.0 + dev: false + + /@changesets/types/4.1.0: + resolution: {integrity: sha512-LDQvVDv5Kb50ny2s25Fhm3d9QSZimsoUGBsUioj6MC3qbMUCuC8GPIvk/M6IvXx3lYhAs0lwWUQLb+VIEUCECw==} + dev: false + + /@changesets/types/5.2.0: + resolution: {integrity: sha512-km/66KOqJC+eicZXsm2oq8A8bVTSpkZJ60iPV/Nl5Z5c7p9kk8xxh6XGRTlnludHldxOOfudhnDN2qPxtHmXzA==} + dev: false + + /@changesets/write/0.2.2: + resolution: {integrity: sha512-kCYNHyF3xaId1Q/QE+DF3UTrHTyg3Cj/f++T8S8/EkC+jh1uK2LFnM9h+EzV+fsmnZDrs7r0J4LLpeI/VWC5Hg==} + dependencies: + '@babel/runtime': 7.20.1 + '@changesets/types': 5.2.0 + fs-extra: 7.0.1 + human-id: 1.0.2 + prettier: 2.7.1 + dev: false + /@cspotcode/source-map-support/0.8.1: resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} engines: {node: '>=12'} @@ -688,18 +878,36 @@ packages: '@jridgewell/sourcemap-codec': 1.4.14 dev: true + /@manypkg/find-root/1.1.0: + resolution: {integrity: sha512-mki5uBvhHzO8kYYix/WRy2WX8S3B5wdVSc9D6KcU5lQNglP2yt58/VfLuAK49glRXChosY8ap2oJ1qgma3GUVA==} + dependencies: + '@babel/runtime': 7.20.1 + '@types/node': 12.20.55 + find-up: 4.1.0 + fs-extra: 8.1.0 + dev: false + + /@manypkg/get-packages/1.1.3: + resolution: {integrity: sha512-fo+QhuU3qE/2TQMQmbVMqaQ6EWbMhi4ABWP+O4AM1NqPBuy0OrApV5LO6BrrgnhtAHS2NH6RrVk9OL181tTi8A==} + dependencies: + '@babel/runtime': 7.20.1 + '@changesets/types': 4.1.0 + '@manypkg/find-root': 1.1.0 + fs-extra: 8.1.0 + globby: 11.1.0 + read-yaml-file: 1.1.0 + dev: false + /@nodelib/fs.scandir/2.1.5: resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} dependencies: '@nodelib/fs.stat': 2.0.5 run-parallel: 1.2.0 - dev: true /@nodelib/fs.stat/2.0.5: resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} engines: {node: '>= 8'} - dev: true /@nodelib/fs.walk/1.2.8: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} @@ -707,7 +915,6 @@ packages: dependencies: '@nodelib/fs.scandir': 2.1.5 fastq: 1.13.0 - dev: true /@sinclair/typebox/0.24.51: resolution: {integrity: sha512-1P1OROm/rdubP5aFDSZQILU0vrLCJ4fvHt6EoqHEM+2D/G5MK3bIaymUKLit8Js9gbns5UyJnkP/TZROLw4tUA==} @@ -806,6 +1013,12 @@ packages: '@types/node': 18.11.9 dev: true + /@types/is-ci/3.0.0: + resolution: {integrity: sha512-Q0Op0hdWbYd1iahB+IFNQcWXFq4O0Q5MwQP7uN0souuQ4rPg1vEYcnIOfr1gY+M+6rc8FGoRaBO1mOOvL29sEQ==} + dependencies: + ci-info: 3.5.0 + dev: false + /@types/istanbul-lib-coverage/2.0.4: resolution: {integrity: sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==} dev: true @@ -833,16 +1046,28 @@ packages: resolution: {integrity: sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==} dev: true + /@types/minimist/1.2.2: + resolution: {integrity: sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==} + dev: false + /@types/multer/1.4.7: resolution: {integrity: sha512-/SNsDidUFCvqqcWDwxv2feww/yqhNeTRL5CVoL3jU4Goc4kKEL10T7Eye65ZqPNi4HRx8sAEX59pV1aEH7drNA==} dependencies: '@types/express': 4.17.14 dev: true + /@types/node/12.20.55: + resolution: {integrity: sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==} + dev: false + /@types/node/18.11.9: resolution: {integrity: sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==} dev: true + /@types/normalize-package-data/2.4.1: + resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==} + dev: false + /@types/prettier/2.7.1: resolution: {integrity: sha512-ri0UmynRRvZiiUJdiz38MmIblKK+oH30MztdBVR95dv/Ubw6neWSb8u1XpRb72L4qsZOhz+L+z9JD40SJmfWow==} dev: true @@ -855,6 +1080,10 @@ packages: resolution: {integrity: sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==} dev: true + /@types/semver/6.2.3: + resolution: {integrity: sha512-KQf+QAMWKMrtBMsB8/24w53tEsxllMj6TuA80TT/5igJalLI/zm0L3oXRbIAl4Ohfc85gyHX/jhMwsVkmhLU4A==} + dev: false + /@types/serve-static/1.15.0: resolution: {integrity: sha512-z5xyF6uh8CbjAu9760KDKsH2FcDxZ2tFCsA4HIMWE6IkiYMXfVoa+4f9KX+FN0ZLsaMw1WNG2ETLA6N+/YA+cg==} dependencies: @@ -895,6 +1124,11 @@ packages: hasBin: true dev: true + /ansi-colors/4.1.3: + resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} + engines: {node: '>=6'} + dev: false + /ansi-escapes/4.3.2: resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} engines: {node: '>=8'} @@ -905,21 +1139,18 @@ packages: /ansi-regex/5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} - dev: true /ansi-styles/3.2.1: resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} engines: {node: '>=4'} dependencies: color-convert: 1.9.3 - dev: true /ansi-styles/4.3.0: resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} engines: {node: '>=8'} dependencies: color-convert: 2.0.1 - dev: true /ansi-styles/5.2.0: resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==} @@ -950,7 +1181,6 @@ packages: resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} dependencies: sprintf-js: 1.0.3 - dev: true /array-flatten/1.1.1: resolution: {integrity: sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==} @@ -959,7 +1189,21 @@ packages: /array-union/2.1.0: resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} engines: {node: '>=8'} - dev: true + + /array.prototype.flat/1.3.1: + resolution: {integrity: sha512-roTU0KWIOmJ4DRLmwKd19Otg0/mT3qPNt0Qb3GWW8iObuZXxrjB/pzn0R3hqpRSWg4HCwqx+0vwOnWnvlOyeIA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + es-abstract: 1.20.4 + es-shim-unscopables: 1.0.0 + dev: false + + /arrify/1.0.1: + resolution: {integrity: sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==} + engines: {node: '>=0.10.0'} + dev: false /asynckit/0.4.0: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} @@ -1051,6 +1295,13 @@ packages: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} dev: true + /better-path-resolve/1.0.0: + resolution: {integrity: sha512-pbnl5XzGBdrFU/wT4jqmJVPn2B6UHPBOhzMQkY/SPUPB6QtUXtmBHBIwCbXJol93mOpGMnQyP/+BB19q04xj7g==} + engines: {node: '>=4'} + dependencies: + is-windows: 1.0.2 + dev: false + /binary-extensions/2.2.0: resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==} engines: {node: '>=8'} @@ -1088,7 +1339,12 @@ packages: engines: {node: '>=8'} dependencies: fill-range: 7.0.1 - dev: true + + /breakword/1.0.5: + resolution: {integrity: sha512-ex5W9DoOQ/LUEU3PMdLs9ua/CYZl1678NUkKOdUSi8Aw5F1idieaiRURCBFJCwVcrD1J8Iy3vfWSloaMwO2qFg==} + dependencies: + wcwidth: 1.0.1 + dev: false /browserslist/4.21.4: resolution: {integrity: sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw==} @@ -1150,17 +1406,24 @@ packages: dependencies: function-bind: 1.1.1 get-intrinsic: 1.1.3 - dev: true /callsites/3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} dev: true + /camelcase-keys/6.2.2: + resolution: {integrity: sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==} + engines: {node: '>=8'} + dependencies: + camelcase: 5.3.1 + map-obj: 4.3.0 + quick-lru: 4.0.1 + dev: false + /camelcase/5.3.1: resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} engines: {node: '>=6'} - dev: true /camelcase/6.3.0: resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} @@ -1178,7 +1441,6 @@ packages: ansi-styles: 3.2.1 escape-string-regexp: 1.0.5 supports-color: 5.5.0 - dev: true /chalk/4.1.2: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} @@ -1186,13 +1448,16 @@ packages: dependencies: ansi-styles: 4.3.0 supports-color: 7.2.0 - dev: true /char-regex/1.0.2: resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} engines: {node: '>=10'} dev: true + /chardet/0.7.0: + resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} + dev: false + /chokidar/3.5.3: resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==} engines: {node: '>= 8.10.0'} @@ -1210,12 +1475,19 @@ packages: /ci-info/3.5.0: resolution: {integrity: sha512-yH4RezKOGlOhxkmhbeNuC4eYZKAUsEaGtBuBzDDP1eFUKiccDWzBABxBfOx31IDwDIXMTxWuwAxUGModvkbuVw==} - dev: true /cjs-module-lexer/1.2.2: resolution: {integrity: sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA==} dev: true + /cliui/6.0.0: + resolution: {integrity: sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==} + dependencies: + string-width: 4.2.3 + strip-ansi: 6.0.1 + wrap-ansi: 6.2.0 + dev: false + /cliui/8.0.1: resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} engines: {node: '>=12'} @@ -1223,7 +1495,11 @@ packages: string-width: 4.2.3 strip-ansi: 6.0.1 wrap-ansi: 7.0.0 - dev: true + + /clone/1.0.4: + resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} + engines: {node: '>=0.8'} + dev: false /co/4.6.0: resolution: {integrity: sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==} @@ -1238,22 +1514,18 @@ packages: resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} dependencies: color-name: 1.1.3 - dev: true /color-convert/2.0.1: resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} engines: {node: '>=7.0.0'} dependencies: color-name: 1.1.4 - dev: true /color-name/1.1.3: resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==} - dev: true /color-name/1.1.4: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - dev: true /combined-stream/1.0.8: resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} @@ -1318,6 +1590,14 @@ packages: resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} dev: true + /cross-spawn/5.1.0: + resolution: {integrity: sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==} + dependencies: + lru-cache: 4.1.5 + shebang-command: 1.2.0 + which: 1.3.1 + dev: false + /cross-spawn/7.0.3: resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} engines: {node: '>= 8'} @@ -1327,6 +1607,28 @@ packages: which: 2.0.2 dev: true + /csv-generate/3.4.3: + resolution: {integrity: sha512-w/T+rqR0vwvHqWs/1ZyMDWtHHSJaN06klRqJXBEpDJaM/+dZkso0OKh1VcuuYvK3XM53KysVNq8Ko/epCK8wOw==} + dev: false + + /csv-parse/4.16.3: + resolution: {integrity: sha512-cO1I/zmz4w2dcKHVvpCr7JVRu8/FymG5OEpmvsZYlccYolPBLoVGKUHgNoc4ZGkFeFlWGEDmMyBM+TTqRdW/wg==} + dev: false + + /csv-stringify/5.6.5: + resolution: {integrity: sha512-PjiQ659aQ+fUTQqSrd1XEDnOr52jh30RBurfzkscaE2tPaFsDH5wOAHJiw8XAHphRknCwMUE9KRayc4K/NbO8A==} + dev: false + + /csv/5.5.3: + resolution: {integrity: sha512-QTaY0XjjhTQOdguARF0lGKm5/mEq9PD9/VhZZegHDIBq2tQwgNpHc3dneD4mGo2iJs+fTKv5Bp0fZ+BRuY3Z0g==} + engines: {node: '>= 0.1.90'} + dependencies: + csv-generate: 3.4.3 + csv-parse: 4.16.3 + csv-stringify: 5.6.5 + stream-transform: 2.1.3 + dev: false + /debug/2.6.9: resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} peerDependencies: @@ -1350,6 +1652,19 @@ packages: ms: 2.1.2 dev: true + /decamelize-keys/1.1.1: + resolution: {integrity: sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==} + engines: {node: '>=0.10.0'} + dependencies: + decamelize: 1.2.0 + map-obj: 1.0.1 + dev: false + + /decamelize/1.2.0: + resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==} + engines: {node: '>=0.10.0'} + dev: false + /dedent/0.7.0: resolution: {integrity: sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==} dev: true @@ -1359,6 +1674,20 @@ packages: engines: {node: '>=0.10.0'} dev: true + /defaults/1.0.4: + resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} + dependencies: + clone: 1.0.4 + dev: false + + /define-properties/1.1.4: + resolution: {integrity: sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==} + engines: {node: '>= 0.4'} + dependencies: + has-property-descriptors: 1.0.0 + object-keys: 1.1.1 + dev: false + /delayed-stream/1.0.0: resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} engines: {node: '>=0.4.0'} @@ -1374,6 +1703,11 @@ packages: engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} dev: true + /detect-indent/6.1.0: + resolution: {integrity: sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==} + engines: {node: '>=8'} + dev: false + /detect-newline/3.1.0: resolution: {integrity: sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==} engines: {node: '>=8'} @@ -1394,7 +1728,6 @@ packages: engines: {node: '>=8'} dependencies: path-type: 4.0.0 - dev: true /ee-first/1.1.1: resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} @@ -1411,18 +1744,68 @@ packages: /emoji-regex/8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} - dev: true /encodeurl/1.0.2: resolution: {integrity: sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==} engines: {node: '>= 0.8'} dev: true + /enquirer/2.3.6: + resolution: {integrity: sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==} + engines: {node: '>=8.6'} + dependencies: + ansi-colors: 4.1.3 + dev: false + /error-ex/1.3.2: resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} dependencies: is-arrayish: 0.2.1 - dev: true + + /es-abstract/1.20.4: + resolution: {integrity: sha512-0UtvRN79eMe2L+UNEF1BwRe364sj/DXhQ/k5FmivgoSdpM90b8Jc0mDzKMGo7QS0BVbOP/bTwBKNnDc9rNzaPA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + es-to-primitive: 1.2.1 + function-bind: 1.1.1 + function.prototype.name: 1.1.5 + get-intrinsic: 1.1.3 + get-symbol-description: 1.0.0 + has: 1.0.3 + has-property-descriptors: 1.0.0 + has-symbols: 1.0.3 + internal-slot: 1.0.3 + is-callable: 1.2.7 + is-negative-zero: 2.0.2 + is-regex: 1.1.4 + is-shared-array-buffer: 1.0.2 + is-string: 1.0.7 + is-weakref: 1.0.2 + object-inspect: 1.12.2 + object-keys: 1.1.1 + object.assign: 4.1.4 + regexp.prototype.flags: 1.4.3 + safe-regex-test: 1.0.0 + string.prototype.trimend: 1.0.6 + string.prototype.trimstart: 1.0.6 + unbox-primitive: 1.0.2 + dev: false + + /es-shim-unscopables/1.0.0: + resolution: {integrity: sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==} + dependencies: + has: 1.0.3 + dev: false + + /es-to-primitive/1.2.1: + resolution: {integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==} + engines: {node: '>= 0.4'} + dependencies: + is-callable: 1.2.7 + is-date-object: 1.0.5 + is-symbol: 1.0.4 + dev: false /esbuild-android-64/0.15.13: resolution: {integrity: sha512-yRorukXBlokwTip+Sy4MYskLhJsO0Kn0/Fj43s1krVblfwP+hMD37a4Wmg139GEsMLl+vh8WXp2mq/cTA9J97g==} @@ -1637,7 +2020,6 @@ packages: /escalade/3.1.1: resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} engines: {node: '>=6'} - dev: true /escape-html/1.0.3: resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==} @@ -1646,7 +2028,6 @@ packages: /escape-string-regexp/1.0.5: resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} engines: {node: '>=0.8.0'} - dev: true /escape-string-regexp/2.0.0: resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} @@ -1657,7 +2038,6 @@ packages: resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} engines: {node: '>=4'} hasBin: true - dev: true /etag/1.8.1: resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==} @@ -1734,6 +2114,19 @@ packages: - supports-color dev: true + /extendable-error/0.1.7: + resolution: {integrity: sha512-UOiS2in6/Q0FK0R0q6UY9vYpQ21mr/Qn1KOnte7vsACuNJf514WvCCUHSRCPcgjPT2bAhNIJdlE6bVap1GKmeg==} + dev: false + + /external-editor/3.1.0: + resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} + engines: {node: '>=4'} + dependencies: + chardet: 0.7.0 + iconv-lite: 0.4.24 + tmp: 0.0.33 + dev: false + /fast-glob/3.2.12: resolution: {integrity: sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==} engines: {node: '>=8.6.0'} @@ -1743,7 +2136,6 @@ packages: glob-parent: 5.1.2 merge2: 1.4.1 micromatch: 4.0.5 - dev: true /fast-json-stable-stringify/2.1.0: resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} @@ -1753,7 +2145,6 @@ packages: resolution: {integrity: sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==} dependencies: reusify: 1.0.4 - dev: true /fb-watchman/2.0.2: resolution: {integrity: sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==} @@ -1766,7 +2157,6 @@ packages: engines: {node: '>=8'} dependencies: to-regex-range: 5.0.1 - dev: true /finalhandler/1.2.0: resolution: {integrity: sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==} @@ -1789,7 +2179,21 @@ packages: dependencies: locate-path: 5.0.0 path-exists: 4.0.0 - dev: true + + /find-up/5.0.0: + resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} + engines: {node: '>=10'} + dependencies: + locate-path: 6.0.0 + path-exists: 4.0.0 + dev: false + + /find-yarn-workspace-root2/1.2.16: + resolution: {integrity: sha512-hr6hb1w8ePMpPVUK39S4RlwJzi+xPLuVuG8XlwXU3KD5Yn3qgBWVfy3AzNlDhWvE1EORCE65/Qm26rFQt3VLVA==} + dependencies: + micromatch: 4.0.5 + pkg-dir: 4.2.0 + dev: false /follow-redirects/1.15.2: resolution: {integrity: sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==} @@ -1824,6 +2228,24 @@ packages: engines: {node: '>= 0.6'} dev: true + /fs-extra/7.0.1: + resolution: {integrity: sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==} + engines: {node: '>=6 <7 || >=8'} + dependencies: + graceful-fs: 4.2.10 + jsonfile: 4.0.0 + universalify: 0.1.2 + dev: false + + /fs-extra/8.1.0: + resolution: {integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==} + engines: {node: '>=6 <7 || >=8'} + dependencies: + graceful-fs: 4.2.10 + jsonfile: 4.0.0 + universalify: 0.1.2 + dev: false + /fs.realpath/1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} dev: true @@ -1838,7 +2260,20 @@ packages: /function-bind/1.1.1: resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} - dev: true + + /function.prototype.name/1.1.5: + resolution: {integrity: sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + es-abstract: 1.20.4 + functions-have-names: 1.2.3 + dev: false + + /functions-have-names/1.2.3: + resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} + dev: false /gensync/1.0.0-beta.2: resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} @@ -1848,7 +2283,6 @@ packages: /get-caller-file/2.0.5: resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} engines: {node: 6.* || 8.* || >= 10.*} - dev: true /get-intrinsic/1.1.3: resolution: {integrity: sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A==} @@ -1856,7 +2290,6 @@ packages: function-bind: 1.1.1 has: 1.0.3 has-symbols: 1.0.3 - dev: true /get-package-type/0.1.0: resolution: {integrity: sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==} @@ -1868,12 +2301,19 @@ packages: engines: {node: '>=10'} dev: true + /get-symbol-description/1.0.0: + resolution: {integrity: sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + get-intrinsic: 1.1.3 + dev: false + /glob-parent/5.1.2: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} engines: {node: '>= 6'} dependencies: is-glob: 4.0.3 - dev: true /glob/7.1.6: resolution: {integrity: sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==} @@ -1912,33 +2352,57 @@ packages: ignore: 5.2.0 merge2: 1.4.1 slash: 3.0.0 - dev: true /graceful-fs/4.2.10: resolution: {integrity: sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==} - dev: true + + /grapheme-splitter/1.0.4: + resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==} + dev: false + + /hard-rejection/2.1.0: + resolution: {integrity: sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==} + engines: {node: '>=6'} + dev: false + + /has-bigints/1.0.2: + resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==} + dev: false /has-flag/3.0.0: resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} engines: {node: '>=4'} - dev: true /has-flag/4.0.0: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} - dev: true + + /has-property-descriptors/1.0.0: + resolution: {integrity: sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==} + dependencies: + get-intrinsic: 1.1.3 + dev: false /has-symbols/1.0.3: resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} engines: {node: '>= 0.4'} - dev: true + + /has-tostringtag/1.0.0: + resolution: {integrity: sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==} + engines: {node: '>= 0.4'} + dependencies: + has-symbols: 1.0.3 + dev: false /has/1.0.3: resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==} engines: {node: '>= 0.4.0'} dependencies: function-bind: 1.1.1 - dev: true + + /hosted-git-info/2.8.9: + resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} + dev: false /html-escaper/2.0.2: resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} @@ -1955,6 +2419,10 @@ packages: toidentifier: 1.0.1 dev: true + /human-id/1.0.2: + resolution: {integrity: sha512-UNopramDEhHJD+VR+ehk8rOslwSfByxPIZyJRfV739NDhN5LF1fa1MqnzKm2lGTQRjNrjK19Q5fhkgIfjlVUKw==} + dev: false + /human-signals/2.1.0: resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} engines: {node: '>=10.17.0'} @@ -1965,12 +2433,10 @@ packages: engines: {node: '>=0.10.0'} dependencies: safer-buffer: 2.1.2 - dev: true /ignore/5.2.0: resolution: {integrity: sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==} engines: {node: '>= 4'} - dev: true /import-local/3.1.0: resolution: {integrity: sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==} @@ -1986,6 +2452,11 @@ packages: engines: {node: '>=0.8.19'} dev: true + /indent-string/4.0.0: + resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==} + engines: {node: '>=8'} + dev: false + /inflight/1.0.6: resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} dependencies: @@ -1997,6 +2468,15 @@ packages: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} dev: true + /internal-slot/1.0.3: + resolution: {integrity: sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==} + engines: {node: '>= 0.4'} + dependencies: + get-intrinsic: 1.1.3 + has: 1.0.3 + side-channel: 1.0.4 + dev: false + /io-ts/2.2.19_fp-ts@2.13.1: resolution: {integrity: sha512-ED0GQwvKRr5C2jqOOJCkuJW2clnbzqFexQ8V7Qsb+VB36S1Mk/OKH7k0FjSe4mjKy9qBRA3OqgVGyFMUEKIubw==} peerDependencies: @@ -2012,7 +2492,12 @@ packages: /is-arrayish/0.2.1: resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} - dev: true + + /is-bigint/1.0.4: + resolution: {integrity: sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==} + dependencies: + has-bigints: 1.0.2 + dev: false /is-binary-path/2.1.0: resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} @@ -2021,21 +2506,45 @@ packages: binary-extensions: 2.2.0 dev: true + /is-boolean-object/1.1.2: + resolution: {integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + has-tostringtag: 1.0.0 + dev: false + + /is-callable/1.2.7: + resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} + engines: {node: '>= 0.4'} + dev: false + + /is-ci/3.0.1: + resolution: {integrity: sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==} + hasBin: true + dependencies: + ci-info: 3.5.0 + dev: false + /is-core-module/2.11.0: resolution: {integrity: sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==} dependencies: has: 1.0.3 - dev: true + + /is-date-object/1.0.5: + resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==} + engines: {node: '>= 0.4'} + dependencies: + has-tostringtag: 1.0.0 + dev: false /is-extglob/2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} - dev: true /is-fullwidth-code-point/3.0.0: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} engines: {node: '>=8'} - dev: true /is-generator-fn/2.1.0: resolution: {integrity: sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==} @@ -2047,25 +2556,85 @@ packages: engines: {node: '>=0.10.0'} dependencies: is-extglob: 2.1.1 - dev: true + + /is-negative-zero/2.0.2: + resolution: {integrity: sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==} + engines: {node: '>= 0.4'} + dev: false + + /is-number-object/1.0.7: + resolution: {integrity: sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==} + engines: {node: '>= 0.4'} + dependencies: + has-tostringtag: 1.0.0 + dev: false /is-number/7.0.0: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} - dev: true + + /is-plain-obj/1.1.0: + resolution: {integrity: sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==} + engines: {node: '>=0.10.0'} + dev: false + + /is-regex/1.1.4: + resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + has-tostringtag: 1.0.0 + dev: false + + /is-shared-array-buffer/1.0.2: + resolution: {integrity: sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==} + dependencies: + call-bind: 1.0.2 + dev: false /is-stream/2.0.1: resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} engines: {node: '>=8'} dev: true + /is-string/1.0.7: + resolution: {integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==} + engines: {node: '>= 0.4'} + dependencies: + has-tostringtag: 1.0.0 + dev: false + + /is-subdir/1.2.0: + resolution: {integrity: sha512-2AT6j+gXe/1ueqbW6fLZJiIw3F8iXGJtt0yDrZaBhAZEG1raiTxKWU+IPqMCzQAXOUCKdA4UDMgacKH25XG2Cw==} + engines: {node: '>=4'} + dependencies: + better-path-resolve: 1.0.0 + dev: false + + /is-symbol/1.0.4: + resolution: {integrity: sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==} + engines: {node: '>= 0.4'} + dependencies: + has-symbols: 1.0.3 + dev: false + + /is-weakref/1.0.2: + resolution: {integrity: sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==} + dependencies: + call-bind: 1.0.2 + dev: false + + /is-windows/1.0.2: + resolution: {integrity: sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==} + engines: {node: '>=0.10.0'} + dev: false + /isarray/1.0.0: resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==} dev: true /isexe/2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} - dev: true /istanbul-lib-coverage/3.2.0: resolution: {integrity: sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==} @@ -2530,7 +3099,6 @@ packages: /js-tokens/4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} - dev: true /js-yaml/3.14.1: resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} @@ -2538,7 +3106,6 @@ packages: dependencies: argparse: 1.0.10 esprima: 4.0.1 - dev: true /jsesc/2.5.2: resolution: {integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==} @@ -2548,7 +3115,6 @@ packages: /json-parse-even-better-errors/2.3.1: resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} - dev: true /json5/2.2.1: resolution: {integrity: sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==} @@ -2556,11 +3122,27 @@ packages: hasBin: true dev: true + /jsonfile/4.0.0: + resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==} + optionalDependencies: + graceful-fs: 4.2.10 + dev: false + + /kind-of/6.0.3: + resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==} + engines: {node: '>=0.10.0'} + dev: false + /kleur/3.0.3: resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==} engines: {node: '>=6'} dev: true + /kleur/4.1.5: + resolution: {integrity: sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==} + engines: {node: '>=6'} + dev: false + /leven/3.1.0: resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==} engines: {node: '>=6'} @@ -2573,19 +3155,34 @@ packages: /lines-and-columns/1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} - dev: true /load-tsconfig/0.2.3: resolution: {integrity: sha512-iyT2MXws+dc2Wi6o3grCFtGXpeMvHmJqS27sMPGtV2eUu4PeFnG+33I8BlFK1t1NWMjOpcx9bridn5yxLDX2gQ==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dev: true + /load-yaml-file/0.2.0: + resolution: {integrity: sha512-OfCBkGEw4nN6JLtgRidPX6QxjBQGQf72q3si2uvqyFEMbycSFFHwAZeXx6cJgFM9wmLrf9zBwCP3Ivqa+LLZPw==} + engines: {node: '>=6'} + dependencies: + graceful-fs: 4.2.10 + js-yaml: 3.14.1 + pify: 4.0.1 + strip-bom: 3.0.0 + dev: false + /locate-path/5.0.0: resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} engines: {node: '>=8'} dependencies: p-locate: 4.1.0 - dev: true + + /locate-path/6.0.0: + resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} + engines: {node: '>=10'} + dependencies: + p-locate: 5.0.0 + dev: false /lodash.memoize/4.1.2: resolution: {integrity: sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==} @@ -2595,6 +3192,17 @@ packages: resolution: {integrity: sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==} dev: true + /lodash.startcase/4.4.0: + resolution: {integrity: sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==} + dev: false + + /lru-cache/4.1.5: + resolution: {integrity: sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==} + dependencies: + pseudomap: 1.0.2 + yallist: 2.1.2 + dev: false + /lru-cache/6.0.0: resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} engines: {node: '>=10'} @@ -2619,11 +3227,38 @@ packages: tmpl: 1.0.5 dev: true + /map-obj/1.0.1: + resolution: {integrity: sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==} + engines: {node: '>=0.10.0'} + dev: false + + /map-obj/4.3.0: + resolution: {integrity: sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==} + engines: {node: '>=8'} + dev: false + /media-typer/0.3.0: resolution: {integrity: sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==} engines: {node: '>= 0.6'} dev: true + /meow/6.1.1: + resolution: {integrity: sha512-3YffViIt2QWgTy6Pale5QpopX/IvU3LPL03jOTqp6pGj3VjesdO/U8CuHMKpnQr4shCNCM5fd5XFFvIIl6JBHg==} + engines: {node: '>=8'} + dependencies: + '@types/minimist': 1.2.2 + camelcase-keys: 6.2.2 + decamelize-keys: 1.1.1 + hard-rejection: 2.1.0 + minimist-options: 4.1.0 + normalize-package-data: 2.5.0 + read-pkg-up: 7.0.1 + redent: 3.0.0 + trim-newlines: 3.0.1 + type-fest: 0.13.1 + yargs-parser: 18.1.3 + dev: false + /merge-descriptors/1.0.1: resolution: {integrity: sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==} dev: true @@ -2635,7 +3270,6 @@ packages: /merge2/1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} - dev: true /methods/1.1.2: resolution: {integrity: sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==} @@ -2648,7 +3282,6 @@ packages: dependencies: braces: 3.0.2 picomatch: 2.3.1 - dev: true /mime-db/1.52.0: resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} @@ -2673,16 +3306,35 @@ packages: engines: {node: '>=6'} dev: true + /min-indent/1.0.1: + resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} + engines: {node: '>=4'} + dev: false + /minimatch/3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} dependencies: brace-expansion: 1.1.11 dev: true + /minimist-options/4.1.0: + resolution: {integrity: sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==} + engines: {node: '>= 6'} + dependencies: + arrify: 1.0.1 + is-plain-obj: 1.1.0 + kind-of: 6.0.3 + dev: false + /minimist/1.2.7: resolution: {integrity: sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==} dev: true + /mixme/0.5.4: + resolution: {integrity: sha512-3KYa4m4Vlqx98GPdOHghxSdNtTvcP8E0kkaJ5Dlh+h2DRzF7zpuVVcA8B0QpKd11YJeP9QQ7ASkKzOeu195Wzw==} + engines: {node: '>= 8.0.0'} + dev: false + /mkdirp/0.5.6: resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==} hasBin: true @@ -2740,6 +3392,15 @@ packages: resolution: {integrity: sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg==} dev: true + /normalize-package-data/2.5.0: + resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} + dependencies: + hosted-git-info: 2.8.9 + resolve: 1.22.1 + semver: 5.7.1 + validate-npm-package-license: 3.0.4 + dev: false + /normalize-path/3.0.0: resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} engines: {node: '>=0.10.0'} @@ -2759,7 +3420,21 @@ packages: /object-inspect/1.12.2: resolution: {integrity: sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==} - dev: true + + /object-keys/1.1.1: + resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} + engines: {node: '>= 0.4'} + dev: false + + /object.assign/4.1.4: + resolution: {integrity: sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + has-symbols: 1.0.3 + object-keys: 1.1.1 + dev: false /on-finished/2.4.1: resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==} @@ -2781,31 +3456,55 @@ packages: mimic-fn: 2.1.0 dev: true + /os-tmpdir/1.0.2: + resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} + engines: {node: '>=0.10.0'} + dev: false + + /outdent/0.5.0: + resolution: {integrity: sha512-/jHxFIzoMXdqPzTaCpFzAAWhpkSjZPF4Vsn6jAfNpmbH/ymsmd7Qc6VE9BGn0L6YMj6uwpQLxCECpus4ukKS9Q==} + dev: false + + /p-filter/2.1.0: + resolution: {integrity: sha512-ZBxxZ5sL2HghephhpGAQdoskxplTwr7ICaehZwLIlfL6acuVgZPm8yBNuRAFBGEqtD/hmUeq9eqLg2ys9Xr/yw==} + engines: {node: '>=8'} + dependencies: + p-map: 2.1.0 + dev: false + /p-limit/2.3.0: resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} engines: {node: '>=6'} dependencies: p-try: 2.2.0 - dev: true /p-limit/3.1.0: resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} engines: {node: '>=10'} dependencies: yocto-queue: 0.1.0 - dev: true /p-locate/4.1.0: resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} engines: {node: '>=8'} dependencies: p-limit: 2.3.0 - dev: true + + /p-locate/5.0.0: + resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} + engines: {node: '>=10'} + dependencies: + p-limit: 3.1.0 + dev: false + + /p-map/2.1.0: + resolution: {integrity: sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==} + engines: {node: '>=6'} + dev: false /p-try/2.2.0: resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} engines: {node: '>=6'} - dev: true /parse-json/5.2.0: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} @@ -2815,7 +3514,6 @@ packages: error-ex: 1.3.2 json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 - dev: true /parseurl/1.3.3: resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==} @@ -2825,7 +3523,6 @@ packages: /path-exists/4.0.0: resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} engines: {node: '>=8'} - dev: true /path-is-absolute/1.0.1: resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} @@ -2839,7 +3536,6 @@ packages: /path-parse/1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} - dev: true /path-to-regexp/0.1.7: resolution: {integrity: sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==} @@ -2848,7 +3544,6 @@ packages: /path-type/4.0.0: resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} engines: {node: '>=8'} - dev: true /picocolors/1.0.0: resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} @@ -2857,7 +3552,11 @@ packages: /picomatch/2.3.1: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} - dev: true + + /pify/4.0.1: + resolution: {integrity: sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==} + engines: {node: '>=6'} + dev: false /pirates/4.0.5: resolution: {integrity: sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ==} @@ -2869,7 +3568,6 @@ packages: engines: {node: '>=8'} dependencies: find-up: 4.1.0 - dev: true /postcss-load-config/3.1.4_ts-node@10.9.1: resolution: {integrity: sha512-6DiM4E7v4coTE4uzA8U//WhtPwyhiim3eyjEMFCnUpzbrkK9wJHgKDT2mR+HbtSrd/NubVaYTOpSpjUl8NQeRg==} @@ -2888,6 +3586,22 @@ packages: yaml: 1.10.2 dev: true + /preferred-pm/3.0.3: + resolution: {integrity: sha512-+wZgbxNES/KlJs9q40F/1sfOd/j7f1O9JaHcW5Dsn3aUUOZg3L2bjpVUcKV2jvtElYfoTuQiNeMfQJ4kwUAhCQ==} + engines: {node: '>=10'} + dependencies: + find-up: 5.0.0 + find-yarn-workspace-root2: 1.2.16 + path-exists: 4.0.0 + which-pm: 2.0.0 + dev: false + + /prettier/2.7.1: + resolution: {integrity: sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==} + engines: {node: '>=10.13.0'} + hasBin: true + dev: false + /pretty-format/29.3.1: resolution: {integrity: sha512-FyLnmb1cYJV8biEIiRyzRFvs2lry7PPIvOqKVe1GCUEYg4YGmlx1qG9EJNMxArYm7piII4qb8UV1Pncq5dxmcg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -2921,6 +3635,10 @@ packages: resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} dev: true + /pseudomap/1.0.2: + resolution: {integrity: sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==} + dev: false + /punycode/2.1.1: resolution: {integrity: sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==} engines: {node: '>=6'} @@ -2935,7 +3653,11 @@ packages: /queue-microtask/1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - dev: true + + /quick-lru/4.0.1: + resolution: {integrity: sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==} + engines: {node: '>=8'} + dev: false /range-parser/1.2.1: resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==} @@ -2956,6 +3678,35 @@ packages: resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==} dev: true + /read-pkg-up/7.0.1: + resolution: {integrity: sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==} + engines: {node: '>=8'} + dependencies: + find-up: 4.1.0 + read-pkg: 5.2.0 + type-fest: 0.8.1 + dev: false + + /read-pkg/5.2.0: + resolution: {integrity: sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==} + engines: {node: '>=8'} + dependencies: + '@types/normalize-package-data': 2.4.1 + normalize-package-data: 2.5.0 + parse-json: 5.2.0 + type-fest: 0.6.0 + dev: false + + /read-yaml-file/1.1.0: + resolution: {integrity: sha512-VIMnQi/Z4HT2Fxuwg5KrY174U1VdUIASQVWXXyqtNRtxSr9IYkn1rsI6Tb6HsrHCmB7gVpNwX6JxPTHcH6IoTA==} + engines: {node: '>=6'} + dependencies: + graceful-fs: 4.2.10 + js-yaml: 3.14.1 + pify: 4.0.1 + strip-bom: 3.0.0 + dev: false + /readable-stream/2.3.7: resolution: {integrity: sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==} dependencies: @@ -2975,10 +3726,34 @@ packages: picomatch: 2.3.1 dev: true + /redent/3.0.0: + resolution: {integrity: sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==} + engines: {node: '>=8'} + dependencies: + indent-string: 4.0.0 + strip-indent: 3.0.0 + dev: false + + /regenerator-runtime/0.13.10: + resolution: {integrity: sha512-KepLsg4dU12hryUO7bp/axHAKvwGOCV0sGloQtpagJ12ai+ojVDqkeGSiRX1zlq+kjIMZ1t7gpze+26QqtdGqw==} + dev: false + + /regexp.prototype.flags/1.4.3: + resolution: {integrity: sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + functions-have-names: 1.2.3 + dev: false + /require-directory/2.1.1: resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} engines: {node: '>=0.10.0'} - dev: true + + /require-main-filename/2.0.0: + resolution: {integrity: sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==} + dev: false /resolve-cwd/3.0.0: resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} @@ -2990,7 +3765,6 @@ packages: /resolve-from/5.0.0: resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} engines: {node: '>=8'} - dev: true /resolve.exports/1.1.0: resolution: {integrity: sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ==} @@ -3004,12 +3778,10 @@ packages: is-core-module: 2.11.0 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 - dev: true /reusify/1.0.4: resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - dev: true /rimraf/3.0.2: resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} @@ -3030,7 +3802,6 @@ packages: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} dependencies: queue-microtask: 1.2.3 - dev: true /safe-buffer/5.1.2: resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} @@ -3040,9 +3811,21 @@ packages: resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} dev: true + /safe-regex-test/1.0.0: + resolution: {integrity: sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==} + dependencies: + call-bind: 1.0.2 + get-intrinsic: 1.1.3 + is-regex: 1.1.4 + dev: false + /safer-buffer/2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} - dev: true + + /semver/5.7.1: + resolution: {integrity: sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==} + hasBin: true + dev: false /semver/6.3.0: resolution: {integrity: sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==} @@ -3090,10 +3873,21 @@ packages: - supports-color dev: true + /set-blocking/2.0.0: + resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} + dev: false + /setprototypeof/1.2.0: resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==} dev: true + /shebang-command/1.2.0: + resolution: {integrity: sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==} + engines: {node: '>=0.10.0'} + dependencies: + shebang-regex: 1.0.0 + dev: false + /shebang-command/2.0.0: resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} engines: {node: '>=8'} @@ -3101,6 +3895,11 @@ packages: shebang-regex: 3.0.0 dev: true + /shebang-regex/1.0.0: + resolution: {integrity: sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==} + engines: {node: '>=0.10.0'} + dev: false + /shebang-regex/3.0.0: resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} engines: {node: '>=8'} @@ -3112,11 +3911,9 @@ packages: call-bind: 1.0.2 get-intrinsic: 1.1.3 object-inspect: 1.12.2 - dev: true /signal-exit/3.0.7: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} - dev: true /sisteransi/1.0.5: resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} @@ -3125,7 +3922,19 @@ packages: /slash/3.0.0: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} engines: {node: '>=8'} - dev: true + + /smartwrap/2.0.2: + resolution: {integrity: sha512-vCsKNQxb7PnCNd2wY1WClWifAc2lwqsG8OaswpJkVJsvMGcnEntdTCDajZCkk93Ay1U3t/9puJmb525Rg5MZBA==} + engines: {node: '>=6'} + hasBin: true + dependencies: + array.prototype.flat: 1.3.1 + breakword: 1.0.5 + grapheme-splitter: 1.0.4 + strip-ansi: 6.0.1 + wcwidth: 1.0.1 + yargs: 15.4.1 + dev: false /source-map-support/0.5.13: resolution: {integrity: sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==} @@ -3146,9 +3955,37 @@ packages: whatwg-url: 7.1.0 dev: true + /spawndamnit/2.0.0: + resolution: {integrity: sha512-j4JKEcncSjFlqIwU5L/rp2N5SIPsdxaRsIv678+TZxZ0SRDJTm8JrxJMjE/XuiEZNEir3S8l0Fa3Ke339WI4qA==} + dependencies: + cross-spawn: 5.1.0 + signal-exit: 3.0.7 + dev: false + + /spdx-correct/3.1.1: + resolution: {integrity: sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==} + dependencies: + spdx-expression-parse: 3.0.1 + spdx-license-ids: 3.0.12 + dev: false + + /spdx-exceptions/2.3.0: + resolution: {integrity: sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==} + dev: false + + /spdx-expression-parse/3.0.1: + resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==} + dependencies: + spdx-exceptions: 2.3.0 + spdx-license-ids: 3.0.12 + dev: false + + /spdx-license-ids/3.0.12: + resolution: {integrity: sha512-rr+VVSXtRhO4OHbXUiAF7xW3Bo9DuuF6C5jH+q/x15j2jniycgKbxU09Hr0WqlSLUs4i4ltHGXqTe7VHclYWyA==} + dev: false + /sprintf-js/1.0.3: resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - dev: true /stack-utils/2.0.6: resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} @@ -3162,6 +3999,12 @@ packages: engines: {node: '>= 0.8'} dev: true + /stream-transform/2.1.3: + resolution: {integrity: sha512-9GHUiM5hMiCi6Y03jD2ARC1ettBXkQBoQAe7nJsPknnI0ow10aXjTnew8QtYQmLjzn974BnmWEAJgCY6ZP1DeQ==} + dependencies: + mixme: 0.5.4 + dev: false + /streamsearch/1.1.0: resolution: {integrity: sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==} engines: {node: '>=10.0.0'} @@ -3182,7 +4025,22 @@ packages: emoji-regex: 8.0.0 is-fullwidth-code-point: 3.0.0 strip-ansi: 6.0.1 - dev: true + + /string.prototype.trimend/1.0.6: + resolution: {integrity: sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + es-abstract: 1.20.4 + dev: false + + /string.prototype.trimstart/1.0.6: + resolution: {integrity: sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + es-abstract: 1.20.4 + dev: false /string_decoder/1.1.1: resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==} @@ -3195,7 +4053,11 @@ packages: engines: {node: '>=8'} dependencies: ansi-regex: 5.0.1 - dev: true + + /strip-bom/3.0.0: + resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} + engines: {node: '>=4'} + dev: false /strip-bom/4.0.0: resolution: {integrity: sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==} @@ -3207,6 +4069,13 @@ packages: engines: {node: '>=6'} dev: true + /strip-indent/3.0.0: + resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==} + engines: {node: '>=8'} + dependencies: + min-indent: 1.0.1 + dev: false + /strip-json-comments/3.1.1: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} @@ -3230,14 +4099,12 @@ packages: engines: {node: '>=4'} dependencies: has-flag: 3.0.0 - dev: true /supports-color/7.2.0: resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} engines: {node: '>=8'} dependencies: has-flag: 4.0.0 - dev: true /supports-color/8.1.1: resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==} @@ -3249,7 +4116,11 @@ packages: /supports-preserve-symlinks-flag/1.0.0: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} - dev: true + + /term-size/2.2.1: + resolution: {integrity: sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg==} + engines: {node: '>=8'} + dev: false /test-exclude/6.0.0: resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==} @@ -3273,6 +4144,13 @@ packages: any-promise: 1.3.0 dev: true + /tmp/0.0.33: + resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} + engines: {node: '>=0.6.0'} + dependencies: + os-tmpdir: 1.0.2 + dev: false + /tmpl/1.0.5: resolution: {integrity: sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==} dev: true @@ -3287,7 +4165,6 @@ packages: engines: {node: '>=8.0'} dependencies: is-number: 7.0.0 - dev: true /toidentifier/1.0.1: resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==} @@ -3305,6 +4182,11 @@ packages: hasBin: true dev: true + /trim-newlines/3.0.1: + resolution: {integrity: sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==} + engines: {node: '>=8'} + dev: false + /ts-interface-checker/0.1.13: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} dev: true @@ -3410,6 +4292,20 @@ packages: - ts-node dev: true + /tty-table/4.1.6: + resolution: {integrity: sha512-kRj5CBzOrakV4VRRY5kUWbNYvo/FpOsz65DzI5op9P+cHov3+IqPbo1JE1ZnQGkHdZgNFDsrEjrfqqy/Ply9fw==} + engines: {node: '>=8.0.0'} + hasBin: true + dependencies: + chalk: 4.1.2 + csv: 5.5.3 + kleur: 4.1.5 + smartwrap: 2.0.2 + strip-ansi: 6.0.1 + wcwidth: 1.0.1 + yargs: 17.6.2 + dev: false + /turbo-darwin-64/1.6.3: resolution: {integrity: sha512-QmDIX0Yh1wYQl0bUS0gGWwNxpJwrzZU2GIAYt3aOKoirWA2ecnyb3R6ludcS1znfNV2MfunP+l8E3ncxUHwtjA==} cpu: [x64] @@ -3476,11 +4372,26 @@ packages: engines: {node: '>=4'} dev: true + /type-fest/0.13.1: + resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} + engines: {node: '>=10'} + dev: false + /type-fest/0.21.3: resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} engines: {node: '>=10'} dev: true + /type-fest/0.6.0: + resolution: {integrity: sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==} + engines: {node: '>=8'} + dev: false + + /type-fest/0.8.1: + resolution: {integrity: sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==} + engines: {node: '>=8'} + dev: false + /type-is/1.6.18: resolution: {integrity: sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==} engines: {node: '>= 0.6'} @@ -3499,6 +4410,20 @@ packages: hasBin: true dev: true + /unbox-primitive/1.0.2: + resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} + dependencies: + call-bind: 1.0.2 + has-bigints: 1.0.2 + has-symbols: 1.0.3 + which-boxed-primitive: 1.0.2 + dev: false + + /universalify/0.1.2: + resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} + engines: {node: '>= 4.0.0'} + dev: false + /unpipe/1.0.0: resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} engines: {node: '>= 0.8'} @@ -3537,6 +4462,13 @@ packages: convert-source-map: 1.9.0 dev: true + /validate-npm-package-license/3.0.4: + resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} + dependencies: + spdx-correct: 3.1.1 + spdx-expression-parse: 3.0.1 + dev: false + /vary/1.1.2: resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} engines: {node: '>= 0.8'} @@ -3548,6 +4480,12 @@ packages: makeerror: 1.0.12 dev: true + /wcwidth/1.0.1: + resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} + dependencies: + defaults: 1.0.4 + dev: false + /webidl-conversions/4.0.2: resolution: {integrity: sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==} dev: true @@ -3560,6 +4498,35 @@ packages: webidl-conversions: 4.0.2 dev: true + /which-boxed-primitive/1.0.2: + resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==} + dependencies: + is-bigint: 1.0.4 + is-boolean-object: 1.1.2 + is-number-object: 1.0.7 + is-string: 1.0.7 + is-symbol: 1.0.4 + dev: false + + /which-module/2.0.0: + resolution: {integrity: sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==} + dev: false + + /which-pm/2.0.0: + resolution: {integrity: sha512-Lhs9Pmyph0p5n5Z3mVnN0yWcbQYUAD7rbQUiMsQxOJ3T57k7RFe35SUwWMf7dsbDZks1uOmw4AecB/JMDj3v/w==} + engines: {node: '>=8.15'} + dependencies: + load-yaml-file: 0.2.0 + path-exists: 4.0.0 + dev: false + + /which/1.3.1: + resolution: {integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==} + hasBin: true + dependencies: + isexe: 2.0.0 + dev: false + /which/2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} engines: {node: '>= 8'} @@ -3568,6 +4535,15 @@ packages: isexe: 2.0.0 dev: true + /wrap-ansi/6.2.0: + resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} + engines: {node: '>=8'} + dependencies: + ansi-styles: 4.3.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + dev: false + /wrap-ansi/7.0.0: resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} engines: {node: '>=10'} @@ -3575,7 +4551,6 @@ packages: ansi-styles: 4.3.0 string-width: 4.2.3 strip-ansi: 6.0.1 - dev: true /wrappy/1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} @@ -3594,10 +4569,17 @@ packages: engines: {node: '>=0.4'} dev: true + /y18n/4.0.3: + resolution: {integrity: sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==} + dev: false + /y18n/5.0.8: resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} engines: {node: '>=10'} - dev: true + + /yallist/2.1.2: + resolution: {integrity: sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==} + dev: false /yallist/4.0.0: resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} @@ -3608,10 +4590,34 @@ packages: engines: {node: '>= 6'} dev: true + /yargs-parser/18.1.3: + resolution: {integrity: sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==} + engines: {node: '>=6'} + dependencies: + camelcase: 5.3.1 + decamelize: 1.2.0 + dev: false + /yargs-parser/21.1.1: resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} engines: {node: '>=12'} - dev: true + + /yargs/15.4.1: + resolution: {integrity: sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==} + engines: {node: '>=8'} + dependencies: + cliui: 6.0.0 + decamelize: 1.2.0 + find-up: 4.1.0 + get-caller-file: 2.0.5 + require-directory: 2.1.1 + require-main-filename: 2.0.0 + set-blocking: 2.0.0 + string-width: 4.2.3 + which-module: 2.0.0 + y18n: 4.0.3 + yargs-parser: 18.1.3 + dev: false /yargs/17.6.2: resolution: {integrity: sha512-1/9UrdHjDZc0eOU0HxOHoS78C69UD3JRMvzlJ7S79S2nTaWRA/whGCTV8o9e/N/1Va9YIV7Q4sOxD8VV4pCWOw==} @@ -3624,7 +4630,6 @@ packages: string-width: 4.2.3 y18n: 5.0.8 yargs-parser: 21.1.1 - dev: true /yn/3.1.1: resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} @@ -3634,7 +4639,6 @@ packages: /yocto-queue/0.1.0: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} - dev: true /zod/3.19.1: resolution: {integrity: sha512-LYjZsEDhCdYET9ikFu6dVPGp2YH9DegXjdJToSzD9rO6fy4qiRYFoyEYwps88OseJlPyl2NOe2iJuhEhL7IpEA==} From 9fbc254bfd826d24ebf16eb7e8026b5f90513c63 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Fri, 11 Nov 2022 22:03:11 +0100 Subject: [PATCH 017/206] chore: new beta release --- .changeset/pre.json | 4 +++- .changeset/thin-dots-know.md | 5 +++++ packages/core/CHANGELOG.md | 7 +++++++ packages/core/package.json | 2 +- 4 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 .changeset/thin-dots-know.md create mode 100644 packages/core/CHANGELOG.md diff --git a/.changeset/pre.json b/.changeset/pre.json index 69cc4d3a..449c00ed 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -4,5 +4,7 @@ "initialVersions": { "@zodios/core": "11.0.0-rc.0" }, - "changesets": [] + "changesets": [ + "thin-dots-know" + ] } diff --git a/.changeset/thin-dots-know.md b/.changeset/thin-dots-know.md new file mode 100644 index 00000000..997ec446 --- /dev/null +++ b/.changeset/thin-dots-know.md @@ -0,0 +1,5 @@ +--- +"@zodios/core": patch +--- + +migrate to monorepo diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md new file mode 100644 index 00000000..28417fcf --- /dev/null +++ b/packages/core/CHANGELOG.md @@ -0,0 +1,7 @@ +# @zodios/core + +## 11.0.0-beta.1 + +### Patch Changes + +- migrate to monorepo diff --git a/packages/core/package.json b/packages/core/package.json index 7a63e547..504b145d 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/core", "description": "Typescript API client with autocompletion and zod validations", - "version": "11.0.0-rc.0", + "version": "11.0.0-beta.1", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", From d93d5bce2670f59d740c332197ff7c4d9a634d07 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Fri, 11 Nov 2022 22:08:21 +0100 Subject: [PATCH 018/206] chore(publish): remove publish from gh actions --- .github/workflows/publish.yml | 58 ----------------------------------- 1 file changed, 58 deletions(-) delete mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 3ca036b7..00000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,58 +0,0 @@ -# publish on npm when there is a new version tag - -name: publish -on: - push: - tags: [v*] - -jobs: - publish: - runs-on: ubuntu-latest - strategy: - matrix: - node-version: [16.x] - steps: - - uses: actions/checkout@v3 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - registry-url: "https://registry.npmjs.org" - node-version: ${{ matrix.node-version }} - cache: "pnpm" - - name: install dependencies - run: pnpm install - - name: build - run: pnpm build - - name: run test - run: pnpm test - - name: publish to npm - run: pnpm changeset publish - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - name: generate changelog - uses: orhun/git-cliff-action@v2 - id: cliff - with: - args: --latest --strip footer - env: - OUTPUT: CHANGES.md - - name: save changelog - id: changelog - shell: bash - run: | - changelog=$(cat ${{ steps.cliff.outputs.changelog }}) - changelog="${changelog//'%'/'%25'}" - changelog="${changelog//$'\n'/'%0A'}" - changelog="${changelog//$'\r'/'%0D'}" - echo "changelog=$changelog" >> $GITHUB_OUTPUT - - name: create release - id: release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} - release_name: Release ${{ github.ref }} - body: ${{ steps.changelog.outputs.changelog }} - draft: false - prerelease: false From a449bf20dcb47c1845f5418367132bbb5c3fda6c Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Fri, 11 Nov 2022 22:10:35 +0100 Subject: [PATCH 019/206] chore: new version --- .changeset/dry-worms-smell.md | 5 +++++ .changeset/pre.json | 1 + packages/core/CHANGELOG.md | 6 ++++++ packages/core/package.json | 2 +- 4 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 .changeset/dry-worms-smell.md diff --git a/.changeset/dry-worms-smell.md b/.changeset/dry-worms-smell.md new file mode 100644 index 00000000..13a619de --- /dev/null +++ b/.changeset/dry-worms-smell.md @@ -0,0 +1,5 @@ +--- +"@zodios/core": patch +--- + +remove publish action from ci diff --git a/.changeset/pre.json b/.changeset/pre.json index 449c00ed..1401bd90 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -5,6 +5,7 @@ "@zodios/core": "11.0.0-rc.0" }, "changesets": [ + "dry-worms-smell", "thin-dots-know" ] } diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 28417fcf..dd457033 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,11 @@ # @zodios/core +## 11.0.0-beta.2 + +### Patch Changes + +- remove publish action from ci + ## 11.0.0-beta.1 ### Patch Changes diff --git a/packages/core/package.json b/packages/core/package.json index 504b145d..a95398cd 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/core", "description": "Typescript API client with autocompletion and zod validations", - "version": "11.0.0-beta.1", + "version": "11.0.0-beta.2", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", From e4193450b3e10143fa8c649bb04675274bcdf061 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Fri, 11 Nov 2022 23:51:42 +0100 Subject: [PATCH 020/206] fix(types): remove unecessry generic --- packages/core/src/api.ts | 7 ++----- packages/core/src/zodios.types.ts | 6 +++--- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/packages/core/src/api.ts b/packages/core/src/api.ts index e65127f4..f7a341a5 100644 --- a/packages/core/src/api.ts +++ b/packages/core/src/api.ts @@ -1,6 +1,3 @@ -// disable type checking for this file as we need to defer type checking when using these utility types -// indeed typescript seems to have a bug, where it tries to infer the type of an undecidable generic type -// but when using the functions, types are inferred correctly import type { ZodiosEndpointDefinition, ZodiosEndpointParameter, @@ -198,7 +195,7 @@ export function makeErrors( * @param endpoint - api endpoint definition * @returns the endpoint definition */ -export function makeEndpoint>( +export function makeEndpoint( endpoint: Narrow ): T { return endpoint as T; @@ -220,7 +217,7 @@ export class Builder { * @param endpoint * @returns - a builder to build your api definitions */ -export function apiBuilder>( +export function apiBuilder( endpoint: Narrow ): Builder<[T]> { return new Builder([endpoint] as [T]); diff --git a/packages/core/src/zodios.types.ts b/packages/core/src/zodios.types.ts index 9fe8d047..1a919857 100644 --- a/packages/core/src/zodios.types.ts +++ b/packages/core/src/zodios.types.ts @@ -697,7 +697,7 @@ export type ZodiosOptions< typeProvider?: ZodiosRuntimeTypeProvider; }; -export type ZodiosEndpointParameter = { +export type ZodiosEndpointParameter = { /** * name of the parameter */ @@ -719,7 +719,7 @@ export type ZodiosEndpointParameter = { export type ZodiosEndpointParameters = ZodiosEndpointParameter[]; -export type ZodiosEndpointError = { +export type ZodiosEndpointError = { /** * status code of the error * use 'default' to declare a default error @@ -740,7 +740,7 @@ export type ZodiosEndpointErrors = ZodiosEndpointError[]; /** * Zodios enpoint definition that should be used to create a new instance of Zodios */ -export type ZodiosEndpointDefinition = { +export type ZodiosEndpointDefinition = { /** * http method : get, post, put, patch, delete */ From 08d0381c1b962475ab947c0ae5f353ec3c1b94a4 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Fri, 11 Nov 2022 23:52:20 +0100 Subject: [PATCH 021/206] test(type-provider): add typeprovider tests --- .../src/type-providers/type-provider.test.ts | 84 +++++++++++++++++++ turbo.json | 4 +- 2 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 packages/core/src/type-providers/type-provider.test.ts diff --git a/packages/core/src/type-providers/type-provider.test.ts b/packages/core/src/type-providers/type-provider.test.ts new file mode 100644 index 00000000..23e9819e --- /dev/null +++ b/packages/core/src/type-providers/type-provider.test.ts @@ -0,0 +1,84 @@ +import { + ioTsTypeProvider, + zodTypeProvider, + tsTypeProvider, + tsSchema, + tsFnSchema, +} from "./index"; +import * as t from "io-ts"; +import z from "zod"; +import assert from "assert"; + +describe("type-provider", () => { + describe("io-ts", () => { + it("should validate", async () => { + const schema = t.type({ + name: t.string, + }); + const result = ioTsTypeProvider.validate(schema, { name: "test" }); + assert(result.success); + expect(result.data).toEqual({ name: "test" }); + const result2 = await ioTsTypeProvider.validateAsync(schema, { + name: "test", + }); + assert(result2.success); + expect(result2.data).toEqual({ name: "test" }); + }); + }); + it("should not validate", async () => { + const schema = t.type({ + name: t.string, + }); + const result = ioTsTypeProvider.validate(schema, { names: "test" }); + assert(!result.success); + expect(result.error).toBeDefined(); + const result2 = await ioTsTypeProvider.validateAsync(schema, { + name: 2, + }); + assert(!result2.success); + expect(result2.error).toBeDefined(); + }); + describe("zod", () => { + it("should validate", () => { + const schema = z.object({ + name: z.string(), + }); + const result = zodTypeProvider.validate(schema, { name: "test" }); + assert(result.success); + expect(result.data).toEqual({ name: "test" }); + }); + }); + it("should not validate", () => { + const schema = z.object({ + name: z.string(), + }); + const result = zodTypeProvider.validate(schema, { names: "test" }); + assert(!result.success); + expect(result.error).toBeDefined(); + }); + describe("ts", () => { + it("should validate", async () => { + const schema = tsSchema<{ name: string }>(); + const result = tsTypeProvider.validate(schema, { name: "test" }); + assert(result.success); + expect(result.data).toEqual({ name: "test" }); + const result2 = await tsTypeProvider.validateAsync(schema, { + name: "test", + }); + assert(result2.success); + expect(result2.data).toEqual({ name: "test" }); + }); + }); + it("should not validate", () => { + const schema = tsFnSchema((data) => { + if (!data || typeof data !== "object") throw new Error("not an object"); + if (!("name" in data)) throw new Error("missing name"); + // @ts-ignore + const { name } = data; + if (typeof name !== "string") throw new Error("name is not a string"); + return data; + }); + const result = tsTypeProvider.validate(schema, { names: "test" }); + assert(!result.success); + }); +}); diff --git a/turbo.json b/turbo.json index 1fd95794..cb0bebe8 100644 --- a/turbo.json +++ b/turbo.json @@ -5,7 +5,9 @@ "dependsOn": ["^build"], "outputs": ["lib/**"] }, - "test": {}, + "test": { + "outputs": [] + }, "lint": {}, "deploy": {} } From ac6f66dc4c483c0b5e3b6e2fa4ae731ef5a19935 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Fri, 11 Nov 2022 23:59:51 +0100 Subject: [PATCH 022/206] chore: add publish script --- .changeset/warm-beans-do.md | 5 +++++ package.json | 7 +++---- 2 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 .changeset/warm-beans-do.md diff --git a/.changeset/warm-beans-do.md b/.changeset/warm-beans-do.md new file mode 100644 index 00000000..6b6b3b01 --- /dev/null +++ b/.changeset/warm-beans-do.md @@ -0,0 +1,5 @@ +--- +"@zodios/core": patch +--- + +add tests for type providers diff --git a/package.json b/package.json index df3f8d5d..0d18beb0 100644 --- a/package.json +++ b/package.json @@ -5,13 +5,12 @@ "build": "turbo run build", "test": "turbo run test", "dev": "turbo run dev", - "lint": "turbo run lint" + "lint": "turbo run lint", + "publish-packages": "turbo run build test && changeset version && changeset publish" }, "private": true, "devDependencies": { - "turbo": "1.6.3" - }, - "dependencies": { + "turbo": "1.6.3", "@changesets/cli": "^2.25.2" } } From 5c2e1a55d61f782e9a3de3b9ccc76f08421b871e Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sat, 12 Nov 2022 00:03:13 +0100 Subject: [PATCH 023/206] chore: update changesets --- .changeset/pre.json | 4 +++- .changeset/shy-games-beg.md | 5 +++++ packages/core/CHANGELOG.md | 7 +++++++ packages/core/package.json | 2 +- 4 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 .changeset/shy-games-beg.md diff --git a/.changeset/pre.json b/.changeset/pre.json index 1401bd90..e8472216 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -6,6 +6,8 @@ }, "changesets": [ "dry-worms-smell", - "thin-dots-know" + "shy-games-beg", + "thin-dots-know", + "warm-beans-do" ] } diff --git a/.changeset/shy-games-beg.md b/.changeset/shy-games-beg.md new file mode 100644 index 00000000..dea58cbc --- /dev/null +++ b/.changeset/shy-games-beg.md @@ -0,0 +1,5 @@ +--- +"@zodios/core": patch +--- + +add publish script diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index dd457033..673f2985 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,12 @@ # @zodios/core +## 11.0.0-beta.3 + +### Patch Changes + +- add publish script +- 5575e28: add tests for type providers + ## 11.0.0-beta.2 ### Patch Changes diff --git a/packages/core/package.json b/packages/core/package.json index a95398cd..07f7d885 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/core", "description": "Typescript API client with autocompletion and zod validations", - "version": "11.0.0-beta.2", + "version": "11.0.0-beta.3", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", From 7a2063872c94a01863a21dfbbd8211258729987a Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sat, 12 Nov 2022 00:11:19 +0100 Subject: [PATCH 024/206] chore: changeset should commit --- .changeset/config.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/config.json b/.changeset/config.json index 8523752f..99119101 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -1,7 +1,7 @@ { "$schema": "https://unpkg.com/@changesets/config@2.2.0/schema.json", "changelog": "@changesets/cli/changelog", - "commit": false, + "commit": true, "fixed": [["@zodios/*"]], "linked": [], "access": "public", From 4810810440e045797ad3a694c3ab776703e083d3 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sat, 12 Nov 2022 00:11:53 +0100 Subject: [PATCH 025/206] docs(changeset): autocommit on changesets --- .changeset/few-bottles-shave.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/few-bottles-shave.md diff --git a/.changeset/few-bottles-shave.md b/.changeset/few-bottles-shave.md new file mode 100644 index 00000000..0c71a38e --- /dev/null +++ b/.changeset/few-bottles-shave.md @@ -0,0 +1,5 @@ +--- +"@zodios/core": patch +--- + +autocommit on changesets From 8761ee082eee9988db3e48d3525a8ffdf286cbc1 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sun, 13 Nov 2022 15:17:59 +0100 Subject: [PATCH 026/206] chore: move examples to core --- {examples => packages/core/examples}/define-types.ts | 2 +- {examples => packages/core/examples}/dev.to/api-key-plugin.ts | 2 +- {examples => packages/core/examples}/dev.to/articles.ts | 2 +- {examples => packages/core/examples}/dev.to/comments.ts | 2 +- {examples => packages/core/examples}/dev.to/example.ts | 2 +- {examples => packages/core/examples}/dev.to/followers.ts | 2 +- {examples => packages/core/examples}/dev.to/follows.ts | 2 +- {examples => packages/core/examples}/dev.to/params.ts | 2 +- {examples => packages/core/examples}/dev.to/users.ts | 2 +- {examples => packages/core/examples}/io-ts-types.ts | 2 +- {examples => packages/core/examples}/jsonplaceholder.ts | 2 +- {examples => packages/core/examples}/types-from-definition.ts | 2 +- {examples => packages/core/examples}/typescript-types.ts | 2 +- 13 files changed, 13 insertions(+), 13 deletions(-) rename {examples => packages/core/examples}/define-types.ts (95%) rename {examples => packages/core/examples}/dev.to/api-key-plugin.ts (87%) rename {examples => packages/core/examples}/dev.to/articles.ts (98%) rename {examples => packages/core/examples}/dev.to/comments.ts (94%) rename {examples => packages/core/examples}/dev.to/example.ts (90%) rename {examples => packages/core/examples}/dev.to/followers.ts (92%) rename {examples => packages/core/examples}/dev.to/follows.ts (89%) rename {examples => packages/core/examples}/dev.to/params.ts (81%) rename {examples => packages/core/examples}/dev.to/users.ts (96%) rename {examples => packages/core/examples}/io-ts-types.ts (97%) rename {examples => packages/core/examples}/jsonplaceholder.ts (98%) rename {examples => packages/core/examples}/types-from-definition.ts (98%) rename {examples => packages/core/examples}/typescript-types.ts (97%) diff --git a/examples/define-types.ts b/packages/core/examples/define-types.ts similarity index 95% rename from examples/define-types.ts rename to packages/core/examples/define-types.ts index d074e304..dfcf6e1e 100644 --- a/examples/define-types.ts +++ b/packages/core/examples/define-types.ts @@ -1,4 +1,4 @@ -import { Zodios, makeApi } from "../packages/core/src/index"; +import { Zodios, makeApi } from "../src/index"; import { z } from "zod"; // you can define schema before declaring the API to get back the type diff --git a/examples/dev.to/api-key-plugin.ts b/packages/core/examples/dev.to/api-key-plugin.ts similarity index 87% rename from examples/dev.to/api-key-plugin.ts rename to packages/core/examples/dev.to/api-key-plugin.ts index 2db2802e..27bd9e43 100644 --- a/examples/dev.to/api-key-plugin.ts +++ b/packages/core/examples/dev.to/api-key-plugin.ts @@ -1,6 +1,6 @@ import { AxiosRequestConfig } from "axios"; import { config } from "process"; -import { ZodiosPlugin } from "../../packages/core/src/index"; +import { ZodiosPlugin } from "../../src/index"; export interface ApiKeyPluginConfig { getApiKey: () => Promise; diff --git a/examples/dev.to/articles.ts b/packages/core/examples/dev.to/articles.ts similarity index 98% rename from examples/dev.to/articles.ts rename to packages/core/examples/dev.to/articles.ts index 91b804fc..96714c78 100644 --- a/examples/dev.to/articles.ts +++ b/packages/core/examples/dev.to/articles.ts @@ -1,4 +1,4 @@ -import { apiBuilder, makeApi } from "../../packages/core/src/index"; +import { apiBuilder, makeApi } from "../../src/index"; import { z } from "zod"; import { devUser } from "./users"; import { paramPages } from "./params"; diff --git a/examples/dev.to/comments.ts b/packages/core/examples/dev.to/comments.ts similarity index 94% rename from examples/dev.to/comments.ts rename to packages/core/examples/dev.to/comments.ts index 37158647..7f749319 100644 --- a/examples/dev.to/comments.ts +++ b/packages/core/examples/dev.to/comments.ts @@ -1,4 +1,4 @@ -import { makeApi, makeEndpoint } from "../../packages/core/src/index"; +import { makeApi, makeEndpoint } from "../../src/index"; import { z } from "zod"; import { devUser, User } from "./users"; diff --git a/examples/dev.to/example.ts b/packages/core/examples/dev.to/example.ts similarity index 90% rename from examples/dev.to/example.ts rename to packages/core/examples/dev.to/example.ts index b33f1ba4..4d8ad015 100644 --- a/examples/dev.to/example.ts +++ b/packages/core/examples/dev.to/example.ts @@ -1,4 +1,4 @@ -import { Zodios } from "../../packages/core/src/index"; +import { Zodios } from "../../src/index"; import { articlesApi } from "./articles"; import { commentsApi } from "./comments"; import { followsApi } from "./follows"; diff --git a/examples/dev.to/followers.ts b/packages/core/examples/dev.to/followers.ts similarity index 92% rename from examples/dev.to/followers.ts rename to packages/core/examples/dev.to/followers.ts index 0268c6ee..db9e7d5b 100644 --- a/examples/dev.to/followers.ts +++ b/packages/core/examples/dev.to/followers.ts @@ -1,5 +1,5 @@ import { z } from "zod"; -import { makeApi } from "../../packages/core/src/index"; +import { makeApi } from "../../src/index"; import { paramPages } from "./params"; const devFollower = z.object({ diff --git a/examples/dev.to/follows.ts b/packages/core/examples/dev.to/follows.ts similarity index 89% rename from examples/dev.to/follows.ts rename to packages/core/examples/dev.to/follows.ts index 7e1907b5..3aa7cae6 100644 --- a/examples/dev.to/follows.ts +++ b/packages/core/examples/dev.to/follows.ts @@ -1,5 +1,5 @@ import { z } from "zod"; -import { makeApi } from "../../packages/core/src/index"; +import { makeApi } from "../../src/index"; export const devFollow = z.object({ id: z.number(), diff --git a/examples/dev.to/params.ts b/packages/core/examples/dev.to/params.ts similarity index 81% rename from examples/dev.to/params.ts rename to packages/core/examples/dev.to/params.ts index b2e38ee4..c07e5a80 100644 --- a/examples/dev.to/params.ts +++ b/packages/core/examples/dev.to/params.ts @@ -1,5 +1,5 @@ import { z } from "zod"; -import { makeParameters } from "../../packages/core/src/api"; +import { makeParameters } from "../../src/api"; export const paramPages = makeParameters([ { diff --git a/examples/dev.to/users.ts b/packages/core/examples/dev.to/users.ts similarity index 96% rename from examples/dev.to/users.ts rename to packages/core/examples/dev.to/users.ts index 5eb28108..1c74bc1b 100644 --- a/examples/dev.to/users.ts +++ b/packages/core/examples/dev.to/users.ts @@ -1,5 +1,5 @@ import { z } from "zod"; -import { makeApi } from "../../packages/core/src/index"; +import { makeApi } from "../../src/index"; export const devUser = z.object({ id: z.number(), diff --git a/examples/io-ts-types.ts b/packages/core/examples/io-ts-types.ts similarity index 97% rename from examples/io-ts-types.ts rename to packages/core/examples/io-ts-types.ts index ed0445c4..8fbf732f 100644 --- a/examples/io-ts-types.ts +++ b/packages/core/examples/io-ts-types.ts @@ -4,7 +4,7 @@ import { ApiOf, TypeProviderOf, ioTsTypeProvider, -} from "../packages/core/src/index"; +} from "../src/index"; import * as t from "io-ts"; // you can define schema before declaring the API to get back the type diff --git a/examples/jsonplaceholder.ts b/packages/core/examples/jsonplaceholder.ts similarity index 98% rename from examples/jsonplaceholder.ts rename to packages/core/examples/jsonplaceholder.ts index 8b7e84d1..d4d08b20 100644 --- a/examples/jsonplaceholder.ts +++ b/packages/core/examples/jsonplaceholder.ts @@ -3,7 +3,7 @@ import { ZodiosResponseByAlias, ZodiosHeaderParamsByAlias, Zodios, -} from "../packages/core/src/index"; +} from "../src/index"; import { z } from "zod"; async function bootstrap() { diff --git a/examples/types-from-definition.ts b/packages/core/examples/types-from-definition.ts similarity index 98% rename from examples/types-from-definition.ts rename to packages/core/examples/types-from-definition.ts index e5c0a47d..bc25cf30 100644 --- a/examples/types-from-definition.ts +++ b/packages/core/examples/types-from-definition.ts @@ -6,7 +6,7 @@ import { makeApi, ZodiosPathParamByAlias, makeErrors, -} from "../packages/core/src/index"; +} from "../src/index"; import z from "zod"; const user = z.object({ diff --git a/examples/typescript-types.ts b/packages/core/examples/typescript-types.ts similarity index 97% rename from examples/typescript-types.ts rename to packages/core/examples/typescript-types.ts index f05e3680..14dfc4e0 100644 --- a/examples/typescript-types.ts +++ b/packages/core/examples/typescript-types.ts @@ -6,7 +6,7 @@ import { TypeProviderOf, tsSchema, tsTypeProvider, -} from "../packages/core/src/index"; +} from "../src/index"; // you can also predefine your API const jsonplaceholderUrl = "https://jsonplaceholder.typicode.com"; From 3e81762c48b364961015623c8a48344dd90205b0 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sun, 13 Nov 2022 15:18:45 +0100 Subject: [PATCH 027/206] feat(fetcher-provider): first impl of axios fetcher provider --- .../fetcher-provider.axios.ts | 54 +++++++++ .../fetcher-provider.types.ts | 42 +++++++ .../core/src/fetcher-providers.ts/index.ts | 2 + packages/core/src/index.ts | 1 - .../core/src/plugins/zod-validation.plugin.ts | 11 +- packages/core/src/utils.types.ts | 15 +-- packages/core/src/zodios.test.ts | 9 -- packages/core/src/zodios.ts | 107 +++++++++--------- packages/core/src/zodios.types.ts | 102 ++++++----------- 9 files changed, 200 insertions(+), 143 deletions(-) create mode 100644 packages/core/src/fetcher-providers.ts/fetcher-provider.axios.ts create mode 100644 packages/core/src/fetcher-providers.ts/fetcher-provider.types.ts create mode 100644 packages/core/src/fetcher-providers.ts/index.ts diff --git a/packages/core/src/fetcher-providers.ts/fetcher-provider.axios.ts b/packages/core/src/fetcher-providers.ts/fetcher-provider.axios.ts new file mode 100644 index 00000000..5165318c --- /dev/null +++ b/packages/core/src/fetcher-providers.ts/fetcher-provider.axios.ts @@ -0,0 +1,54 @@ +import axios, { + AxiosRequestConfig, + AxiosError, + AxiosInstance, + AxiosResponse, +} from "axios"; +import { + AnyZodiosFetcherProvider, + ZodiosRuntimeFetcherProvider, +} from "./fetcher-provider.types"; +import { Merge } from "../utils.types"; +import { omit, replacePathParams } from "../utils"; +import { AnyZodiosRequestOptions } from "../zodios.types"; + +type AxiosErrorStatus = Merge< + Omit, + { + response: Merge< + AxiosError["response"], + { + status: Status extends "default" ? 0 & { error: "default" } : Status; + } + >; + } +>; + +export interface AxiosProvider extends AnyZodiosFetcherProvider { + config: Omit; + response: AxiosResponse; + + // provider for TypeOfError + error: AxiosErrorStatus; +} + +export const axiosProvider = (options: { + baseURL?: string; + axiosInstance?: AxiosInstance; + axiosConfig?: AxiosRequestConfig; +}): ZodiosRuntimeFetcherProvider => { + const { axiosInstance, axiosConfig, baseURL } = options; + const instance = axiosInstance || axios.create(axiosConfig); + if (baseURL) instance.defaults.baseURL = baseURL; + + return { + fetch: async (config) => { + const requestConfig: AxiosRequestConfig = { + ...omit(config as AnyZodiosRequestOptions, ["params", "queries"]), + url: replacePathParams(config), + params: config.queries, + }; + return instance.request(requestConfig); + }, + }; +}; diff --git a/packages/core/src/fetcher-providers.ts/fetcher-provider.types.ts b/packages/core/src/fetcher-providers.ts/fetcher-provider.types.ts new file mode 100644 index 00000000..81bb7fb7 --- /dev/null +++ b/packages/core/src/fetcher-providers.ts/fetcher-provider.types.ts @@ -0,0 +1,42 @@ +/** + * A type provider for Fetcher + * allows to define request, response and error types for a fetcher + */ +export interface AnyZodiosFetcherProvider { + /** + * inputs types to call fetcher + */ + arg1: unknown; + arg2: unknown; + + /** + * config types to call fetcher + */ + config: unknown; + response: unknown; + error: unknown; +} + +export type TypeOfFetcherConfig< + FetcherProvider extends AnyZodiosFetcherProvider +> = FetcherProvider["config"]; + +export type TypeOfFetcherError< + FetcherProvider extends AnyZodiosFetcherProvider, + Response, + Status +> = (FetcherProvider & { + arg1: Response; + arg2: Status; +})["error"]; + +export type TypeOfFetcherResponse< + FetcherProvider extends AnyZodiosFetcherProvider +> = FetcherProvider["response"]; + +export type ZodiosRuntimeFetcherProvider< + FetcherProvider extends AnyZodiosFetcherProvider +> = { + readonly _provider?: FetcherProvider; + fetch: (params: any) => Promise; +}; diff --git a/packages/core/src/fetcher-providers.ts/index.ts b/packages/core/src/fetcher-providers.ts/index.ts new file mode 100644 index 00000000..550256d3 --- /dev/null +++ b/packages/core/src/fetcher-providers.ts/index.ts @@ -0,0 +1,2 @@ +export * from "./fetcher-provider.types"; +export * from "./fetcher-provider.axios"; diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 3d80412c..344903e7 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -37,7 +37,6 @@ export type { ZodiosEndpointErrors, ZodiosOptions, ZodiosRequestOptions, - ZodiosMethodOptions, ZodiosRequestOptionsByPath, ZodiosRequestOptionsByAlias, ZodiosPlugin, diff --git a/packages/core/src/plugins/zod-validation.plugin.ts b/packages/core/src/plugins/zod-validation.plugin.ts index 93bddc26..c1f22009 100644 --- a/packages/core/src/plugins/zod-validation.plugin.ts +++ b/packages/core/src/plugins/zod-validation.plugin.ts @@ -2,10 +2,14 @@ import { findEndpoint } from "../utils"; import { ZodiosError } from "../zodios-error"; import type { AnyZodiosTypeProvider } from "../type-providers"; import type { ZodiosOptions, ZodiosPlugin } from "../zodios.types"; +import { AnyZodiosFetcherProvider } from "../fetcher-providers.ts"; -type Options = Required< +type Options< + FetcherProvider extends AnyZodiosFetcherProvider, + TypeProvider extends AnyZodiosTypeProvider +> = Required< Pick< - ZodiosOptions, + ZodiosOptions, "validate" | "transform" | "sendDefaults" | "typeProvider" > >; @@ -24,13 +28,14 @@ function shouldRequest(option: string | boolean) { * @returns zod-validation plugin */ export function zodValidationPlugin< + FetcherProvider extends AnyZodiosFetcherProvider, TypeProvider extends AnyZodiosTypeProvider >({ validate, transform, sendDefaults, typeProvider, -}: Options): ZodiosPlugin { +}: Options): ZodiosPlugin { return { name: "zod-validation", request: shouldRequest(validate) diff --git a/packages/core/src/utils.types.ts b/packages/core/src/utils.types.ts index aa62a8d8..a541f606 100644 --- a/packages/core/src/utils.types.ts +++ b/packages/core/src/utils.types.ts @@ -171,22 +171,13 @@ export type UndefinedIfEmpty = IfEquals; export type UndefinedIfNever = IfEquals; -type RequiredChildProps = { - [K in keyof T]: IfEquals, never, K>; -}[keyof T]; - -export type OptionalChildProps = { - [K in keyof T]: IfEquals, K, never>; -}[keyof T]; - /** * set properties to optional if their child properties are optional * @param T - object type */ -export type SetPropsOptionalIfChildrenAreOptional = Merge< - Pick, OptionalChildProps>, - Pick> ->; +export type TransitiveOptional = UndefinedToOptional<{ + [k in keyof T]: RequiredKeys extends never ? T[k] | undefined : T[k]; +}>; /** * transform an array type into a readonly array type diff --git a/packages/core/src/zodios.test.ts b/packages/core/src/zodios.test.ts index 44fcdb47..20ddb364 100644 --- a/packages/core/src/zodios.test.ts +++ b/packages/core/src/zodios.test.ts @@ -109,10 +109,6 @@ describe("Zodios", () => { expect(() => new Zodios({})).toThrowError("Zodios: api must be an array"); }); - it("should return the underlying axios instance", () => { - const zodios = new Zodios(`http://localhost:${port}`, []); - expect(zodios.axios).toBeDefined(); - }); it("should create a new instance of Zodios", () => { const zodios = new Zodios(`http://localhost:${port}`, []); expect(zodios).toBeDefined(); @@ -155,11 +151,6 @@ describe("Zodios", () => { ).toThrowError("Zodios: Duplicate path 'get /:id'"); }); - it("should get base url", () => { - const zodios = new Zodios(`http://localhost:${port}`, []); - expect(zodios.baseURL).toBe(`http://localhost:${port}`); - }); - it("should create a new instance whithout base URL", () => { const zodios = new Zodios([ { diff --git a/packages/core/src/zodios.ts b/packages/core/src/zodios.ts index f5b57a7d..d1dc7f9c 100644 --- a/packages/core/src/zodios.ts +++ b/packages/core/src/zodios.ts @@ -1,5 +1,3 @@ -import axios from "axios"; -import type { AxiosInstance, AxiosRequestConfig } from "axios"; import type { AnyZodiosRequestOptions, ZodiosRequestOptions, @@ -33,19 +31,42 @@ import type { import { checkApi } from "./api"; import type { AnyZodiosTypeProvider, ZodTypeProvider } from "./type-providers"; import { zodTypeProvider } from "./type-providers"; +import { + AnyZodiosFetcherProvider, + axiosProvider, + AxiosProvider, +} from "./fetcher-providers.ts"; + +interface ZodiosBase< + Api extends ZodiosEndpointDefinitions, + FetcherProvider extends AnyZodiosFetcherProvider, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> { + readonly api: Api; + readonly _typeProvider: TypeProvider; + readonly _fetcherProvider: FetcherProvider; +} + /** * zodios api client based on axios */ export class ZodiosClass< Api extends ZodiosEndpointDefinitions, + FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider, TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider -> { - private axiosInstance: AxiosInstance; +> implements ZodiosBase +{ public readonly options: PickRequired< - ZodiosOptions, - "validate" | "transform" | "sendDefaults" | "typeProvider" + ZodiosOptions, + | "validate" + | "transform" + | "sendDefaults" + | "typeProvider" + | "fetcherProvider" >; public readonly api: Api; + public readonly _typeProvider: TypeProvider; + public readonly _fetcherProvider: FetcherProvider; private endpointPlugins: Map = new Map(); /** @@ -75,18 +96,21 @@ export class ZodiosClass< * } * ]); */ - constructor(api: Narrow, options?: ZodiosOptions); + constructor( + api: Narrow, + options?: ZodiosOptions + ); constructor( baseUrl: string, api: Narrow, - options?: ZodiosOptions + options?: ZodiosOptions ); constructor( arg1?: Api | string, - arg2?: Api | ZodiosOptions, - arg3?: ZodiosOptions + arg2?: Api | ZodiosOptions, + arg3?: ZodiosOptions ) { - let options: ZodiosOptions; + let options: ZodiosOptions; if (!arg1) { if (Array.isArray(arg2)) { throw new Error("Zodios: missing base url"); @@ -112,17 +136,11 @@ export class ZodiosClass< transform: true, sendDefaults: false, typeProvider: zodTypeProvider as any, + fetcherProvider: axiosProvider({ baseURL }) as any, ...options, }; - - if (this.options.axiosInstance) { - this.axiosInstance = this.options.axiosInstance; - } else { - this.axiosInstance = axios.create({ - ...this.options.axiosConfig, - }); - } - if (baseURL) this.axiosInstance.defaults.baseURL = baseURL; + this._typeProvider = undefined as any; + this._fetcherProvider = undefined as any; this.injectAliasEndpoints(); this.initPlugins(); @@ -170,20 +188,6 @@ export class ZodiosClass< return this.endpointPlugins.get(`${method}-${path}`); } - /** - * get the base url of the api - */ - get baseURL() { - return this.axiosInstance.defaults.baseURL; - } - - /** - * get the underlying axios instance - */ - get axios() { - return this.axiosInstance; - } - /** * register a plugin to intercept the requests or responses * @param plugin - the plugin to use @@ -281,11 +285,7 @@ export class ZodiosClass< if (endpointPlugin) { conf = await endpointPlugin.interceptRequest(this.api, conf); } - let response = this.axiosInstance.request({ - ...omit(conf as AnyZodiosRequestOptions, ["params", "queries"]), - url: replacePathParams(conf), - params: conf.queries, - }); + let response = this.options.fetcherProvider.fetch(conf); if (endpointPlugin) { response = endpointPlugin.interceptResponse(this.api, conf, response); } @@ -461,25 +461,29 @@ export class ZodiosClass< export type ZodiosInstance< Api extends ZodiosEndpointDefinitions, + FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider, TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider -> = ZodiosClass & ZodiosAliases; +> = ZodiosClass & + ZodiosAliases; export type ZodiosConstructor = { new < Api extends ZodiosEndpointDefinitions, + FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider, TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider >( api: Narrow, - options?: ZodiosOptions - ): ZodiosInstance; + options?: ZodiosOptions + ): ZodiosInstance; new < Api extends ZodiosEndpointDefinitions, + FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider, TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider >( baseUrl: string, api: Narrow, - options?: ZodiosOptions - ): ZodiosInstance; + options?: ZodiosOptions + ): ZodiosInstance; }; export const Zodios = ZodiosClass as ZodiosConstructor; @@ -488,12 +492,9 @@ export const Zodios = ZodiosClass as ZodiosConstructor; * Get the Api description type from zodios * @param Z - zodios type */ -export type ApiOf = Z extends ZodiosInstance - ? Api - : never; -export type TypeProviderOf = Z extends ZodiosInstance< - infer Api, - infer TypeProvider -> - ? TypeProvider - : never; +export type ApiOf> = Z["api"]; +/** + * Get the type provider type from zodios + * @param Z - zodios type + */ +export type TypeProviderOf> = Z["_typeProvider"]; diff --git a/packages/core/src/zodios.types.ts b/packages/core/src/zodios.types.ts index 1a919857..6eb5201d 100644 --- a/packages/core/src/zodios.types.ts +++ b/packages/core/src/zodios.types.ts @@ -1,17 +1,10 @@ -import { - AxiosError, - AxiosInstance, - AxiosRequestConfig, - AxiosResponse, -} from "axios"; - import type { FilterArrayByValue, PickDefined, NeverIfEmpty, UndefinedToOptional, PathParamNames, - SetPropsOptionalIfChildrenAreOptional, + TransitiveOptional, ReadonlyDeep, Merge, FilterArrayByKey, @@ -26,6 +19,14 @@ import type { ZodiosRuntimeTypeProvider, ZodTypeProvider, } from "./type-providers"; +import { + AnyZodiosFetcherProvider, + TypeOfFetcherConfig, + TypeOfFetcherError, + TypeOfFetcherResponse, + ZodiosRuntimeFetcherProvider, + AxiosProvider, +} from "./fetcher-providers.ts"; type AxiosRequestConfig = Parameters[0]; @@ -201,34 +202,26 @@ export type ZodiosErrorByPath< > >; -export type ErrorsToAxios< +export type InferFetcherErrors< T, TypeProvider extends AnyZodiosTypeProvider, + FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider, Acc extends unknown[] = [] > = T extends [infer Head, ...infer Tail] ? Head extends { status: infer Status; schema: infer Schema; } - ? ErrorsToAxios< + ? InferFetcherErrors< Tail, TypeProvider, + FetcherProvider, [ ...Acc, - Merge< - Omit, - { - response: Merge< - AxiosError< - InferOutputTypeFromSchema - >["response"], - { - status: Status extends "default" - ? 0 & { error: Status } - : Status; - } - >; - } + TypeOfFetcherError< + FetcherProvider, + InferOutputTypeFromSchema, + Status > ] > @@ -240,7 +233,7 @@ export type ZodiosMatchingErrorsByPath< M extends Method, Path extends ZodiosPathsByMethod, TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider -> = ErrorsToAxios< +> = InferFetcherErrors< ZodiosEndpointDefinitionByPath[number]["errors"], TypeProvider >[number]; @@ -249,7 +242,7 @@ export type ZodiosMatchingErrorsByAlias< Api extends ZodiosEndpointDefinition[], Alias extends string, TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider -> = ErrorsToAxios< +> = InferFetcherErrors< ZodiosEndpointDefinitionByAlias[number]["errors"], TypeProvider >[number]; @@ -546,16 +539,17 @@ export type ZodiosRequestOptionsByAlias< Api extends ZodiosEndpointDefinition[], Alias extends string, Frontend extends boolean = true, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, + FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider > = Merge< - SetPropsOptionalIfChildrenAreOptional< + TransitiveOptional< PickDefined<{ params: ZodiosPathParamByAlias; queries: ZodiosQueryParamsByAlias; headers: ZodiosHeaderParamsByAlias; }> >, - Omit + TypeOfFetcherConfig >; export type ZodiosMutationAliasRequest = @@ -600,7 +594,7 @@ export type AnyZodiosMethodOptions = Merge< queries?: Record; headers?: Record; }, - Omit + TypeOfFetcherConfig >; export type AnyZodiosRequestOptions = Merge< @@ -608,26 +602,6 @@ export type AnyZodiosRequestOptions = Merge< AnyZodiosMethodOptions >; -/** - * @deprecated - use ZodiosRequestOptionsByPath instead - */ -export type ZodiosMethodOptions< - Api extends ZodiosEndpointDefinition[], - M extends Method, - Path extends ZodiosPathsByMethod, - Frontend extends boolean = true, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider -> = Merge< - SetPropsOptionalIfChildrenAreOptional< - PickDefined<{ - params: ZodiosPathParamsByPath; - queries: ZodiosQueryParamsByPath; - headers: ZodiosHeaderParamsByPath; - }> - >, - Omit ->; - /** * Get the request options for a given endpoint */ @@ -636,16 +610,17 @@ export type ZodiosRequestOptionsByPath< M extends Method, Path extends ZodiosPathsByMethod, Frontend extends boolean = true, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, + FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider > = Merge< - SetPropsOptionalIfChildrenAreOptional< + TransitiveOptional< PickDefined<{ params: ZodiosPathParamsByPath; queries: ZodiosQueryParamsByPath; headers: ZodiosHeaderParamsByPath; }> >, - Omit + TypeOfFetcherConfig >; export type ZodiosRequestOptions< @@ -667,6 +642,7 @@ export type ZodiosRequestOptions< * Zodios options */ export type ZodiosOptions< + FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider, TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider > = { /** @@ -682,14 +658,8 @@ export type ZodiosOptions< * you usually want your backend to handle default values */ sendDefaults?: boolean; - /** - * Override the default axios instance. Default: zodios will create it's own axios instance - */ - axiosInstance?: AxiosInstance; - /** - * default config for axios requests - */ - axiosConfig?: AxiosRequestConfig; + + fetcherProvider?: ZodiosRuntimeFetcherProvider; /** * set a custom type provider. Default: ZodTypeProvider @@ -803,7 +773,9 @@ export type ZodiosEndpointDefinitions = ZodiosEndpointDefinition[]; /** * Zodios plugin that can be used to intercept zodios requests and responses */ -export type ZodiosPlugin = { +export type ZodiosPlugin< + FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider +> = { /** * Optional name of the plugin * naming a plugin allows to remove it or replace it later @@ -829,8 +801,8 @@ export type ZodiosPlugin = { response?: ( api: ZodiosEndpointDefinitions, config: ReadonlyDeep, - response: AxiosResponse - ) => Promise; + response: TypeOfFetcherResponse + ) => Promise>; /** * error interceptor for response errors * there is no error interceptor for request errors @@ -843,5 +815,5 @@ export type ZodiosPlugin = { api: ZodiosEndpointDefinitions, config: ReadonlyDeep, error: Error - ) => Promise; + ) => Promise>; }; From 3738d2bbde39d7cbaa05845b30257ffed09c1552 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sun, 13 Nov 2022 15:19:54 +0100 Subject: [PATCH 028/206] docs(changeset): add fetcher provider and axios impl --- .changeset/neat-frogs-fold.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/neat-frogs-fold.md diff --git a/.changeset/neat-frogs-fold.md b/.changeset/neat-frogs-fold.md new file mode 100644 index 00000000..b9d15125 --- /dev/null +++ b/.changeset/neat-frogs-fold.md @@ -0,0 +1,5 @@ +--- +"@zodios/core": patch +--- + +add fetcher provider and axios impl From a4be0f07ba9ae18f15955a2fe779c2ce76a7b155 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sun, 13 Nov 2022 15:57:47 +0100 Subject: [PATCH 029/206] feat(plugins): make plugins fetcher provider compliant --- .../core/examples/dev.to/api-key-plugin.ts | 2 - .../fetcher-provider.axios.ts | 0 .../fetcher-provider.types.ts | 0 .../index.ts | 0 packages/core/src/plugins/form-data.plugin.ts | 47 ++++++++++--------- packages/core/src/plugins/form-url.plugin.ts | 47 ++++++++++--------- packages/core/src/plugins/header.plugin.ts | 6 ++- .../core/src/plugins/zod-validation.plugin.ts | 2 +- packages/core/src/plugins/zodios-plugins.ts | 13 +++-- packages/core/src/zodios.ts | 31 ++++++++---- packages/core/src/zodios.types.ts | 2 +- 11 files changed, 84 insertions(+), 66 deletions(-) rename packages/core/src/{fetcher-providers.ts => fetcher-providers}/fetcher-provider.axios.ts (100%) rename packages/core/src/{fetcher-providers.ts => fetcher-providers}/fetcher-provider.types.ts (100%) rename packages/core/src/{fetcher-providers.ts => fetcher-providers}/index.ts (100%) diff --git a/packages/core/examples/dev.to/api-key-plugin.ts b/packages/core/examples/dev.to/api-key-plugin.ts index 27bd9e43..ba768056 100644 --- a/packages/core/examples/dev.to/api-key-plugin.ts +++ b/packages/core/examples/dev.to/api-key-plugin.ts @@ -1,5 +1,3 @@ -import { AxiosRequestConfig } from "axios"; -import { config } from "process"; import { ZodiosPlugin } from "../../src/index"; export interface ApiKeyPluginConfig { diff --git a/packages/core/src/fetcher-providers.ts/fetcher-provider.axios.ts b/packages/core/src/fetcher-providers/fetcher-provider.axios.ts similarity index 100% rename from packages/core/src/fetcher-providers.ts/fetcher-provider.axios.ts rename to packages/core/src/fetcher-providers/fetcher-provider.axios.ts diff --git a/packages/core/src/fetcher-providers.ts/fetcher-provider.types.ts b/packages/core/src/fetcher-providers/fetcher-provider.types.ts similarity index 100% rename from packages/core/src/fetcher-providers.ts/fetcher-provider.types.ts rename to packages/core/src/fetcher-providers/fetcher-provider.types.ts diff --git a/packages/core/src/fetcher-providers.ts/index.ts b/packages/core/src/fetcher-providers/index.ts similarity index 100% rename from packages/core/src/fetcher-providers.ts/index.ts rename to packages/core/src/fetcher-providers/index.ts diff --git a/packages/core/src/plugins/form-data.plugin.ts b/packages/core/src/plugins/form-data.plugin.ts index 65d84e07..0dc7406e 100644 --- a/packages/core/src/plugins/form-data.plugin.ts +++ b/packages/core/src/plugins/form-data.plugin.ts @@ -1,27 +1,7 @@ import { getFormDataStream } from "./form-data.utils"; import { ZodiosError } from "../zodios-error"; import type { ZodiosPlugin } from "../zodios.types"; - -const plugin: ZodiosPlugin = { - name: "form-data", - request: async (_, config) => { - if (typeof config.data !== "object" || Array.isArray(config.data)) { - throw new ZodiosError( - "Zodios: multipart/form-data body must be an object", - config - ); - } - const result = getFormDataStream(config.data as any); - return { - ...config, - data: result.data, - headers: { - ...config.headers, - ...result.headers, - }, - }; - }, -}; +import { AnyZodiosFetcherProvider } from "../fetcher-providers"; /** * form-data plugin used internally by Zodios. @@ -53,6 +33,27 @@ const plugin: ZodiosPlugin = { * ``` * @returns form-data plugin */ -export function formDataPlugin(): ZodiosPlugin { - return plugin; +export function formDataPlugin< + FetcherProvider extends AnyZodiosFetcherProvider +>(): ZodiosPlugin { + return { + name: "form-data", + request: async (_, config) => { + if (typeof config.data !== "object" || Array.isArray(config.data)) { + throw new ZodiosError( + "Zodios: multipart/form-data body must be an object", + config + ); + } + const result = getFormDataStream(config.data); + return { + ...config, + data: result.data, + headers: { + ...config.headers, + ...result.headers, + }, + }; + }, + }; } diff --git a/packages/core/src/plugins/form-url.plugin.ts b/packages/core/src/plugins/form-url.plugin.ts index 7cee181c..1d4625aa 100644 --- a/packages/core/src/plugins/form-url.plugin.ts +++ b/packages/core/src/plugins/form-url.plugin.ts @@ -1,27 +1,7 @@ +import { AnyZodiosFetcherProvider } from "../fetcher-providers"; import { ZodiosError } from "../zodios-error"; import type { ZodiosPlugin } from "../zodios.types"; -const plugin: ZodiosPlugin = { - name: "form-url", - request: async (_, config) => { - if (typeof config.data !== "object" || Array.isArray(config.data)) { - throw new ZodiosError( - "Zodios: application/x-www-form-urlencoded body must be an object", - config - ); - } - - return { - ...config, - data: new URLSearchParams(config.data as any).toString(), - headers: { - ...config.headers, - "Content-Type": "application/x-www-form-urlencoded", - }, - }; - }, -}; - /** * form-url plugin used internally by Zodios. * @example @@ -53,6 +33,27 @@ const plugin: ZodiosPlugin = { * ``` * @returns form-url plugin */ -export function formURLPlugin(): ZodiosPlugin { - return plugin; +export function formURLPlugin< + FetcherProvider extends AnyZodiosFetcherProvider +>(): ZodiosPlugin { + return { + name: "form-url", + request: async (_, config) => { + if (typeof config.data !== "object" || Array.isArray(config.data)) { + throw new ZodiosError( + "Zodios: application/x-www-form-urlencoded body must be an object", + config + ); + } + + return { + ...config, + data: new URLSearchParams(config.data).toString(), + headers: { + ...config.headers, + "Content-Type": "application/x-www-form-urlencoded", + }, + }; + }, + }; } diff --git a/packages/core/src/plugins/header.plugin.ts b/packages/core/src/plugins/header.plugin.ts index ea9d7234..6752e143 100644 --- a/packages/core/src/plugins/header.plugin.ts +++ b/packages/core/src/plugins/header.plugin.ts @@ -1,6 +1,10 @@ +import { AnyZodiosFetcherProvider } from "../fetcher-providers"; import type { ZodiosPlugin } from "../zodios.types"; -export function headerPlugin(key: string, value: string): ZodiosPlugin { +export function headerPlugin( + key: string, + value: string +): ZodiosPlugin { return { request: async (_, config) => { return { diff --git a/packages/core/src/plugins/zod-validation.plugin.ts b/packages/core/src/plugins/zod-validation.plugin.ts index c1f22009..27c45f79 100644 --- a/packages/core/src/plugins/zod-validation.plugin.ts +++ b/packages/core/src/plugins/zod-validation.plugin.ts @@ -2,7 +2,7 @@ import { findEndpoint } from "../utils"; import { ZodiosError } from "../zodios-error"; import type { AnyZodiosTypeProvider } from "../type-providers"; import type { ZodiosOptions, ZodiosPlugin } from "../zodios.types"; -import { AnyZodiosFetcherProvider } from "../fetcher-providers.ts"; +import { AnyZodiosFetcherProvider } from "../fetcher-providers"; type Options< FetcherProvider extends AnyZodiosFetcherProvider, diff --git a/packages/core/src/plugins/zodios-plugins.ts b/packages/core/src/plugins/zodios-plugins.ts index b4742849..45b3a991 100644 --- a/packages/core/src/plugins/zodios-plugins.ts +++ b/packages/core/src/plugins/zodios-plugins.ts @@ -1,4 +1,7 @@ -import { AxiosResponse } from "axios"; +import { + AnyZodiosFetcherProvider, + TypeOfFetcherResponse, +} from "../fetcher-providers"; import { ReadonlyDeep } from "../utils.types"; import { AnyZodiosRequestOptions, @@ -15,9 +18,9 @@ export type PluginId = { /** * A list of plugins that can be used by the Zodios client. */ -export class ZodiosPlugins { +export class ZodiosPlugins { public readonly key: string; - private plugins: Array = []; + private plugins: Array | undefined> = []; /** * Constructor @@ -43,7 +46,7 @@ export class ZodiosPlugins { * @param plugin - plugin to register * @returns unique id of the plugin */ - use(plugin: ZodiosPlugin): PluginId { + use(plugin: ZodiosPlugin): PluginId { if (plugin.name) { const id = this.indexOf(plugin.name); if (id !== -1) { @@ -105,7 +108,7 @@ export class ZodiosPlugins { async interceptResponse( api: ZodiosEndpointDefinitions, config: ReadonlyDeep, - response: Promise + response: Promise> ) { let pluginResponse = response; for (let index = this.plugins.length - 1; index >= 0; index--) { diff --git a/packages/core/src/zodios.ts b/packages/core/src/zodios.ts index d1dc7f9c..62108c30 100644 --- a/packages/core/src/zodios.ts +++ b/packages/core/src/zodios.ts @@ -35,7 +35,7 @@ import { AnyZodiosFetcherProvider, axiosProvider, AxiosProvider, -} from "./fetcher-providers.ts"; +} from "./fetcher-providers"; interface ZodiosBase< Api extends ZodiosEndpointDefinitions, @@ -67,7 +67,8 @@ export class ZodiosClass< public readonly api: Api; public readonly _typeProvider: TypeProvider; public readonly _fetcherProvider: FetcherProvider; - private endpointPlugins: Map = new Map(); + private endpointPlugins: Map> = + new Map(); /** * constructor @@ -153,19 +154,29 @@ export class ZodiosClass< this.endpointPlugins.set("any-any", new ZodiosPlugins("any", "any")); this.api.forEach((endpoint) => { - const plugins = new ZodiosPlugins(endpoint.method, endpoint.path); + const plugins = new ZodiosPlugins( + endpoint.method, + endpoint.path + ); switch (endpoint.requestFormat) { case "binary": - plugins.use(headerPlugin("Content-Type", "application/octet-stream")); + plugins.use( + headerPlugin( + "Content-Type", + "application/octet-stream" + ) + ); break; case "form-data": - plugins.use(formDataPlugin()); + plugins.use(formDataPlugin()); break; case "form-url": - plugins.use(formURLPlugin()); + plugins.use(formURLPlugin()); break; case "text": - plugins.use(headerPlugin("Content-Type", "text/plain")); + plugins.use( + headerPlugin("Content-Type", "text/plain") + ); break; } this.endpointPlugins.set(`${endpoint.method}-${endpoint.path}`, plugins); @@ -203,14 +214,14 @@ export class ZodiosClass< use(...args: unknown[]) { if (typeof args[0] === "object") { const plugins = this.getAnyEndpointPlugins()!; - return plugins.use(args[0] as ZodiosPlugin); + return plugins.use(args[0] as ZodiosPlugin); } else if (typeof args[0] === "string" && typeof args[1] === "object") { const plugins = this.findAliasEndpointPlugins(args[0]); if (!plugins) throw new Error( `Zodios: no alias '${args[0]}' found to register plugin` ); - return plugins.use(args[1] as ZodiosPlugin); + return plugins.use(args[1] as ZodiosPlugin); } else if ( typeof args[0] === "string" && typeof args[1] === "string" && @@ -221,7 +232,7 @@ export class ZodiosClass< throw new Error( `Zodios: no endpoint '${args[0]} ${args[1]}' found to register plugin` ); - return plugins.use(args[2] as ZodiosPlugin); + return plugins.use(args[2] as ZodiosPlugin); } throw new Error("Zodios: invalid plugin registration"); } diff --git a/packages/core/src/zodios.types.ts b/packages/core/src/zodios.types.ts index 6eb5201d..66295fde 100644 --- a/packages/core/src/zodios.types.ts +++ b/packages/core/src/zodios.types.ts @@ -26,7 +26,7 @@ import { TypeOfFetcherResponse, ZodiosRuntimeFetcherProvider, AxiosProvider, -} from "./fetcher-providers.ts"; +} from "./fetcher-providers"; type AxiosRequestConfig = Parameters[0]; From ed550b965525ad6778793560cb6dc281bdf93833 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Thu, 17 Nov 2022 21:27:03 +0100 Subject: [PATCH 030/206] feat(fetch): add fetch implementation --- packages/core/examples/io-ts-types.ts | 8 + packages/core/package.json | 9 +- .../fetcher-provider.axios.ts | 49 ++- .../fetcher-provider.fetch/fetch.ts | 112 +++++ .../fetcher-provider.fetch/fetch.types.ts | 13 + .../fetcher-provider.fetch/fetch.utils.ts | 54 +++ .../fetcher-provider.fetch.ts | 50 +++ .../fetcher-provider.types.ts | 15 +- .../src/plugins/zod-validation.plugin.test.ts | 17 +- .../core/src/plugins/zod-validation.plugin.ts | 12 +- .../core/src/plugins/zodios-plugins.test.ts | 19 +- packages/core/src/plugins/zodios-plugins.ts | 4 +- packages/core/src/utils.ts | 2 +- packages/core/src/zodios-error.ts | 5 +- packages/core/src/zodios.test.ts | 5 +- packages/core/src/zodios.ts | 92 ++-- packages/core/src/zodios.types.ts | 55 ++- pnpm-lock.yaml | 393 +++++++++++------- 18 files changed, 664 insertions(+), 250 deletions(-) create mode 100644 packages/core/src/fetcher-providers/fetcher-provider.fetch/fetch.ts create mode 100644 packages/core/src/fetcher-providers/fetcher-provider.fetch/fetch.types.ts create mode 100644 packages/core/src/fetcher-providers/fetcher-provider.fetch/fetch.utils.ts create mode 100644 packages/core/src/fetcher-providers/fetcher-provider.fetch/fetcher-provider.fetch.ts diff --git a/packages/core/examples/io-ts-types.ts b/packages/core/examples/io-ts-types.ts index 8fbf732f..ff490f4b 100644 --- a/packages/core/examples/io-ts-types.ts +++ b/packages/core/examples/io-ts-types.ts @@ -6,6 +6,8 @@ import { ioTsTypeProvider, } from "../src/index"; import * as t from "io-ts"; +import { fetchProvider } from "../src/fetcher-providers/fetcher-provider.fetch/fetcher-provider.fetch"; +import { FetcherProviderOf } from "../src/zodios"; // you can define schema before declaring the API to get back the type @@ -27,6 +29,7 @@ const jsonplaceholderApi = makeApi([ { method: "get", path: "/users", + alias: "getUsers", description: "Get all users", parameters: [ { @@ -55,14 +58,19 @@ const jsonplaceholderApi = makeApi([ async function bootstrap() { const apiClient = new Zodios(jsonplaceholderUrl, jsonplaceholderApi, { typeProvider: ioTsTypeProvider, + fetcherProvider: fetchProvider, }); type Api = ApiOf; // ^? type Provider = TypeProviderOf; // ^? + type FetcherProvider = FetcherProviderOf; + // ^? const users = await apiClient.get("/users", { queries: { q: "Nicholas" } }); // ^? + const users2 = await apiClient.getUsers({ queries: { q: "Nicholas" } }); + // ^? console.log(users); const user = await apiClient.get("/users/:id", { params: { id: 7 } }); // ^? diff --git a/packages/core/package.json b/packages/core/package.json index 07f7d885..eedd2499 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -45,9 +45,9 @@ }, "peerDependencies": { "axios": "^0.x || ^1.0.0", - "zod": "^3.x", "fp-ts": "2.x", - "io-ts": "2.x" + "io-ts": "2.x", + "zod": "^3.x" }, "peerDependenciesMeta": { "zod": { @@ -67,6 +67,7 @@ "@types/jest": "29.2.2", "@types/multer": "1.4.7", "@types/node": "18.11.9", + "@types/qs": "6.9.7", "axios": "1.1.3", "express": "4.18.2", "fp-ts": "2.13.1", @@ -80,5 +81,7 @@ "typescript": "4.8.4", "zod": "3.19.1" }, - "dependencies": {} + "dependencies": { + "qs": "6.11.0" + } } diff --git a/packages/core/src/fetcher-providers/fetcher-provider.axios.ts b/packages/core/src/fetcher-providers/fetcher-provider.axios.ts index 5165318c..084ebb33 100644 --- a/packages/core/src/fetcher-providers/fetcher-provider.axios.ts +++ b/packages/core/src/fetcher-providers/fetcher-provider.axios.ts @@ -24,7 +24,13 @@ type AxiosErrorStatus = Merge< } >; +type AxiosProviderOptions = { + axiosInstance?: AxiosInstance; + axiosConfig?: AxiosRequestConfig; +}; + export interface AxiosProvider extends AnyZodiosFetcherProvider { + options: AxiosProviderOptions; config: Omit; response: AxiosResponse; @@ -32,23 +38,28 @@ export interface AxiosProvider extends AnyZodiosFetcherProvider { error: AxiosErrorStatus; } -export const axiosProvider = (options: { - baseURL?: string; - axiosInstance?: AxiosInstance; - axiosConfig?: AxiosRequestConfig; -}): ZodiosRuntimeFetcherProvider => { - const { axiosInstance, axiosConfig, baseURL } = options; - const instance = axiosInstance || axios.create(axiosConfig); - if (baseURL) instance.defaults.baseURL = baseURL; - - return { - fetch: async (config) => { - const requestConfig: AxiosRequestConfig = { - ...omit(config as AnyZodiosRequestOptions, ["params", "queries"]), - url: replacePathParams(config), - params: config.queries, - }; - return instance.request(requestConfig); - }, - }; +export const axiosProvider: ZodiosRuntimeFetcherProvider & { + instance: AxiosInstance; +} = { + instance: undefined as any, + create( + options: { + baseURL?: string; + } & AxiosProviderOptions + ) { + const { axiosInstance, axiosConfig, baseURL } = options; + this.instance = axiosInstance || axios.create(axiosConfig); + if (baseURL) { + this.instance.defaults.baseURL = baseURL; + this.baseURL = baseURL; + } + }, + fetch(config: AnyZodiosRequestOptions) { + const requestConfig: AxiosRequestConfig = { + ...omit(config, ["params", "queries"]), + url: replacePathParams(config), + params: config.queries, + }; + return this.instance.request(requestConfig); + }, }; diff --git a/packages/core/src/fetcher-providers/fetcher-provider.fetch/fetch.ts b/packages/core/src/fetcher-providers/fetcher-provider.fetch/fetch.ts new file mode 100644 index 00000000..19533962 --- /dev/null +++ b/packages/core/src/fetcher-providers/fetcher-provider.fetch/fetch.ts @@ -0,0 +1,112 @@ +import { AnyZodiosRequestOptions } from "../../zodios.types"; +import { FetchProviderResponse, FetchProviderConfig } from "./fetch.types"; +import { buildURL, isBlob, isFile, isFormData } from "./fetch.utils"; +import { FetchProvider } from "./fetcher-provider.fetch"; + +export class FetchError extends Error { + /** + * constructore with same signature as AxiosError + */ + constructor( + message?: string, + public code?: string, + public config?: FetchProviderConfig, + public request?: Request, + public response?: FetchProviderResponse + ) { + super(message); + } +} + +/** + * fetch provider + * @param config - fetch config + * @returns + */ +export const advancedFetch = async ( + config: AnyZodiosRequestOptions +) => { + const request = createFetchRequest(config); + const response = (await fetchRequest( + request, + config + )) as FetchProviderResponse; + response.data = await getResponseData(response, config); + if ( + (config.validateStatus && !config.validateStatus(response.status)) || + !response.ok + ) { + throw new FetchError( + response.statusText, + `${response.status}`, + config, + request, + response + ); + } + return response; +}; + +function createFetchRequest(config: AnyZodiosRequestOptions) { + const headers = new Headers(config.headers); + if ( + (isFormData(config.body) || isBlob(config.body) || isFile(config.body)) && + headers.get("Content-Type") + ) { + headers.delete("Content-Type"); + } + + if (config.auth) { + const username = config.auth.username || ""; + const password = config.auth.password + ? decodeURI(encodeURIComponent(config.auth.password)) + : ""; + headers.set("Authorization", `Basic ${btoa(username + ":" + password)}`); + } + + if (config.timeout && !config.signal) { + const controller = new AbortController(); + const timeout = setTimeout(() => controller.abort(), config.timeout); + config.signal = controller.signal; + config.signal.addEventListener("abort", () => clearTimeout(timeout)); + } + + const url = buildURL(config); + return new Request(url, { ...config, headers }); +} + +async function fetchRequest(request: Request, config: FetchProviderConfig) { + try { + return await fetch(request); + } catch (error) { + if (error instanceof Error) { + throw new FetchError(error.message, "ERR_NETWORK", config, request); + } else { + throw new FetchError("Network Error", "ERR_NETWORK", config, request); + } + } +} + +async function getResponseData( + response: Response, + config: FetchProviderConfig +) { + switch (config.responseType) { + case "arraybuffer": + return response.arrayBuffer(); + case "blob": + return response.blob(); + case "stream": + return response.body; + case "text": + return response.text(); + case "json": + return response.json(); + default: { + if (response.headers.get("content-type")?.includes("application/json")) { + return response.json(); + } + return response.text(); + } + } +} diff --git a/packages/core/src/fetcher-providers/fetcher-provider.fetch/fetch.types.ts b/packages/core/src/fetcher-providers/fetcher-provider.fetch/fetch.types.ts new file mode 100644 index 00000000..90558252 --- /dev/null +++ b/packages/core/src/fetcher-providers/fetcher-provider.fetch/fetch.types.ts @@ -0,0 +1,13 @@ +import { Method } from "../../zodios.types"; + +export interface FetchProviderConfig extends RequestInit { + baseURL?: string; + auth?: { username: string; password: string }; + validateStatus?: (status: number) => boolean; + timeout?: number; + responseType?: "arraybuffer" | "blob" | "json" | "text" | "stream"; +} + +export interface FetchProviderResponse extends Response { + data: Data; +} diff --git a/packages/core/src/fetcher-providers/fetcher-provider.fetch/fetch.utils.ts b/packages/core/src/fetcher-providers/fetcher-provider.fetch/fetch.utils.ts new file mode 100644 index 00000000..9527f9ba --- /dev/null +++ b/packages/core/src/fetcher-providers/fetcher-provider.fetch/fetch.utils.ts @@ -0,0 +1,54 @@ +import qs from "qs"; +import { AnyZodiosRequestOptions } from "../../zodios.types"; +import { FetchProviderConfig } from "./fetch.types"; +import { FetchProvider } from "./fetcher-provider.fetch"; + +/** + * more resilient alternative to instanceof when the object is not native and compiled to es5 + * @param kind - string representation of the object kind + * @returns - a function that checks if the object is of the given kind + */ +// istanbul ignore next +export const isKindOf = + (kind: string) => + (data: any): boolean => { + const pattern = `[object ${kind}]`; + return ( + data && + (toString.call(data) === pattern || + (typeof data.toString === "function" && data.toString() === pattern)) + ); + }; + +// istanbul ignore next +export const isFormData = isKindOf("FormData"); +// istanbul ignore next +export const isBlob = isKindOf("Blob"); +// istanbul ignore next +export const isFile = isKindOf("File"); +// istanbul ignore next +export const isSearchParams = isKindOf("URLSearchParams"); + +function getFullURL(config: AnyZodiosRequestOptions) { + if (config.url?.startsWith("http") || !config.baseURL) { + return config.url; + } + const baseURL = config.baseURL.replace(/\/$/, ""); + if (!config.url) { + return baseURL; + } + const path = config.url.replace(/^\//, ""); + return `${baseURL}/${path}`; +} + +export function buildURL(config: AnyZodiosRequestOptions) { + let fullURL = getFullURL(config) || "/"; + const serializedParams = qs.stringify(config.queries, { + arrayFormat: "brackets", + encodeValuesOnly: true, + }); + if (serializedParams) { + fullURL += fullURL.indexOf("?") === -1 ? "?" : "&"; + } + return `${fullURL}${serializedParams}`; +} diff --git a/packages/core/src/fetcher-providers/fetcher-provider.fetch/fetcher-provider.fetch.ts b/packages/core/src/fetcher-providers/fetcher-provider.fetch/fetcher-provider.fetch.ts new file mode 100644 index 00000000..3978de92 --- /dev/null +++ b/packages/core/src/fetcher-providers/fetcher-provider.fetch/fetcher-provider.fetch.ts @@ -0,0 +1,50 @@ +import { + AnyZodiosFetcherProvider, + ZodiosRuntimeFetcherProvider, +} from "../fetcher-provider.types"; +import { omit, replacePathParams } from "../../utils"; +import { FetchProviderConfig, FetchProviderResponse } from "./fetch.types"; +import { advancedFetch } from "./fetch"; +import { AnyZodiosRequestOptions } from "../../zodios.types"; + +type FetchErrorStatus = { + status: Status extends "default" ? 0 & { error: "default" } : Status; + response: TResponse; +}; + +type FetchProviderOptions = { + fetchConfig?: FetchProviderConfig; +}; + +export interface FetchProvider extends AnyZodiosFetcherProvider { + options: FetchProviderOptions; + config: FetchProviderConfig; + response: FetchProviderResponse; + error: FetchErrorStatus; +} + +export const fetchProvider: ZodiosRuntimeFetcherProvider & + FetchProviderOptions = { + create( + options: { + baseURL?: string; + } & FetchProviderOptions + ) { + const { baseURL, fetchConfig } = options; + this.fetchConfig = fetchConfig; + if (baseURL) { + this.baseURL = baseURL; + } + }, + async fetch(config: AnyZodiosRequestOptions) { + const requestConfig = { + ...this.fetchConfig, + ...config, + baseURL: this.baseURL, + url: replacePathParams(config), + }; + return advancedFetch( + requestConfig as AnyZodiosRequestOptions + ); + }, +}; diff --git a/packages/core/src/fetcher-providers/fetcher-provider.types.ts b/packages/core/src/fetcher-providers/fetcher-provider.types.ts index 81bb7fb7..84bb028e 100644 --- a/packages/core/src/fetcher-providers/fetcher-provider.types.ts +++ b/packages/core/src/fetcher-providers/fetcher-provider.types.ts @@ -12,9 +12,10 @@ export interface AnyZodiosFetcherProvider { /** * config types to call fetcher */ - config: unknown; - response: unknown; - error: unknown; + options: any; + config: any; + response: any; + error: any; } export type TypeOfFetcherConfig< @@ -34,9 +35,15 @@ export type TypeOfFetcherResponse< FetcherProvider extends AnyZodiosFetcherProvider > = FetcherProvider["response"]; +export type TypeOfFetcherOptions< + FetcherProvider extends AnyZodiosFetcherProvider +> = FetcherProvider["options"]; + export type ZodiosRuntimeFetcherProvider< FetcherProvider extends AnyZodiosFetcherProvider > = { readonly _provider?: FetcherProvider; - fetch: (params: any) => Promise; + baseURL?: string; + create(options: any): void; + fetch(params: any): Promise; }; diff --git a/packages/core/src/plugins/zod-validation.plugin.test.ts b/packages/core/src/plugins/zod-validation.plugin.test.ts index 43425afd..43d0197c 100644 --- a/packages/core/src/plugins/zod-validation.plugin.test.ts +++ b/packages/core/src/plugins/zod-validation.plugin.test.ts @@ -4,7 +4,8 @@ import { apiBuilder } from "../api"; import { ReadonlyDeep } from "../utils.types"; import { AnyZodiosRequestOptions } from "../zodios.types"; import { zodValidationPlugin } from "./zod-validation.plugin"; -import { zodTypeProvider } from "../type-providers"; +import { AnyZodiosTypeProvider, zodTypeProvider } from "../type-providers"; +import { AnyZodiosFetcherProvider } from "../fetcher-providers"; describe("zodValidationPlugin", () => { const plugin = zodValidationPlugin({ @@ -258,12 +259,16 @@ received: }); }); - const notExistingConfig: ReadonlyDeep = { + const notExistingConfig: ReadonlyDeep< + AnyZodiosRequestOptions + > = { method: "get", url: "/notExisting", }; - const createSampleConfig = (url: string): AnyZodiosRequestOptions => ({ + const createSampleConfig = ( + url: string + ): AnyZodiosRequestOptions => ({ method: "post", url, data: "123", @@ -275,7 +280,9 @@ received: }, }); - const createEmptySampleConfig = (url: string): AnyZodiosRequestOptions => ({ + const createEmptySampleConfig = ( + url: string + ): AnyZodiosRequestOptions => ({ method: "post", url, data: "", @@ -289,7 +296,7 @@ received: const createUndefinedSampleConfig = ( url: string - ): AnyZodiosRequestOptions => ({ + ): AnyZodiosRequestOptions => ({ method: "get", url, }); diff --git a/packages/core/src/plugins/zod-validation.plugin.ts b/packages/core/src/plugins/zod-validation.plugin.ts index 27c45f79..6251afdb 100644 --- a/packages/core/src/plugins/zod-validation.plugin.ts +++ b/packages/core/src/plugins/zod-validation.plugin.ts @@ -2,7 +2,7 @@ import { findEndpoint } from "../utils"; import { ZodiosError } from "../zodios-error"; import type { AnyZodiosTypeProvider } from "../type-providers"; import type { ZodiosOptions, ZodiosPlugin } from "../zodios.types"; -import { AnyZodiosFetcherProvider } from "../fetcher-providers"; +import { AnyZodiosFetcherProvider, AxiosProvider } from "../fetcher-providers"; type Options< FetcherProvider extends AnyZodiosFetcherProvider, @@ -35,7 +35,7 @@ export function zodValidationPlugin< transform, sendDefaults, typeProvider, -}: Options): ZodiosPlugin { +}: Options): ZodiosPlugin { return { name: "zod-validation", request: shouldRequest(validate) @@ -106,7 +106,13 @@ export function zodValidationPlugin< ); } if ( - response.headers?.["content-type"]?.includes("application/json") + typeof response.headers?.get === "function" + ? (response.headers.get("content-type") as string)?.includes?.( + "application/json" + ) + : response.headers?.["content-type"]?.includes?.( + "application/json" + ) ) { const parsed = await typeProvider.validateAsync( endpoint.response, diff --git a/packages/core/src/plugins/zodios-plugins.test.ts b/packages/core/src/plugins/zodios-plugins.test.ts index 7f4f7415..a2c186b4 100644 --- a/packages/core/src/plugins/zodios-plugins.test.ts +++ b/packages/core/src/plugins/zodios-plugins.test.ts @@ -1,3 +1,4 @@ +import { AnyZodiosFetcherProvider } from "../fetcher-providers"; import { ZodiosPlugin } from "../zodios.types"; import { ZodiosPlugins } from "./zodios-plugins"; @@ -8,7 +9,7 @@ describe("ZodiosPlugins", () => { it("should register one plugin", () => { const plugins = new ZodiosPlugins("any", "any"); - const plugin: ZodiosPlugin = { + const plugin: ZodiosPlugin = { request: async (api, config) => config, response: async (api, config, response) => response, }; @@ -20,7 +21,7 @@ describe("ZodiosPlugins", () => { it("should unregister one plugin", () => { const plugins = new ZodiosPlugins("any", "any"); - const plugin: ZodiosPlugin = { + const plugin: ZodiosPlugin = { request: async (api, config) => config, response: async (api, config, response) => response, }; @@ -31,7 +32,7 @@ describe("ZodiosPlugins", () => { it("should replace named plugins", () => { const plugins = new ZodiosPlugins("any", "any"); - const plugin: ZodiosPlugin = { + const plugin: ZodiosPlugin = { name: "test", request: async (api, config) => config, response: async (api, config, response) => response, @@ -58,7 +59,7 @@ describe("ZodiosPlugins", () => { it("should execute response plugins consistently", async () => { const plugins = new ZodiosPlugins("any", "any"); - const plugin1: ZodiosPlugin = { + const plugin1: ZodiosPlugin = { request: async (api, config) => config, response: async (api, config, response) => { response.data += "1"; @@ -66,7 +67,7 @@ describe("ZodiosPlugins", () => { }, }; plugins.use(plugin1); - const plugin2: ZodiosPlugin = { + const plugin2: ZodiosPlugin = { request: async (api, config) => config, response: async (api, config, response) => { response.data += "2"; @@ -92,7 +93,7 @@ describe("ZodiosPlugins", () => { it('should catch error if plugin "error" is defined', async () => { const plugins = new ZodiosPlugins("any", "any"); - const plugin: ZodiosPlugin = { + const plugin: ZodiosPlugin = { request: async (api, config) => config, // @ts-ignore error: async (api, config, error) => ({ test: true }), @@ -109,12 +110,14 @@ describe("ZodiosPlugins", () => { it("should count plugins", () => { const plugins = new ZodiosPlugins("any", "any"); - const namedPlugin: (n: number) => ZodiosPlugin = (n) => ({ + const namedPlugin: (n: number) => ZodiosPlugin = ( + n + ) => ({ name: `test${n}`, request: async (api, config) => config, response: async (api, config, response) => response, }); - const plugin: ZodiosPlugin = { + const plugin: ZodiosPlugin = { request: async (api, config) => config, response: async (api, config, response) => response, }; diff --git a/packages/core/src/plugins/zodios-plugins.ts b/packages/core/src/plugins/zodios-plugins.ts index 45b3a991..602e4114 100644 --- a/packages/core/src/plugins/zodios-plugins.ts +++ b/packages/core/src/plugins/zodios-plugins.ts @@ -87,7 +87,7 @@ export class ZodiosPlugins { */ async interceptRequest( api: ZodiosEndpointDefinitions, - config: ReadonlyDeep + config: ReadonlyDeep> ) { let pluginConfig = config; for (const plugin of this.plugins) { @@ -107,7 +107,7 @@ export class ZodiosPlugins { */ async interceptResponse( api: ZodiosEndpointDefinitions, - config: ReadonlyDeep, + config: ReadonlyDeep>, response: Promise> ) { let pluginResponse = response; diff --git a/packages/core/src/utils.ts b/packages/core/src/utils.ts index 7780caf6..fc218b10 100644 --- a/packages/core/src/utils.ts +++ b/packages/core/src/utils.ts @@ -54,7 +54,7 @@ export function capitalize(str: T): Capitalize { const paramsRegExp = /:([a-zA-Z_][a-zA-Z0-9_]*)/g; export function replacePathParams( - config: ReadonlyDeep + config: ReadonlyDeep<{ url: string; params?: Record }> ) { let result: string = config.url; const params = config.params; diff --git a/packages/core/src/zodios-error.ts b/packages/core/src/zodios-error.ts index 71f0018a..4d4b804a 100644 --- a/packages/core/src/zodios-error.ts +++ b/packages/core/src/zodios-error.ts @@ -1,3 +1,4 @@ +import { AnyZodiosFetcherProvider } from "./fetcher-providers"; import type { ReadonlyDeep } from "./utils.types"; import type { AnyZodiosRequestOptions } from "./zodios.types"; @@ -11,7 +12,9 @@ import type { AnyZodiosRequestOptions } from "./zodios.types"; export class ZodiosError extends Error { constructor( message: string, - public readonly config?: ReadonlyDeep, + public readonly config?: ReadonlyDeep< + AnyZodiosRequestOptions + >, public readonly data?: unknown, public readonly cause?: Error ) { diff --git a/packages/core/src/zodios.test.ts b/packages/core/src/zodios.test.ts index 20ddb364..5a720f0a 100644 --- a/packages/core/src/zodios.test.ts +++ b/packages/core/src/zodios.test.ts @@ -10,6 +10,7 @@ import { ZodiosPlugin } from "./zodios.types"; import { apiBuilder } from "./api"; import { isErrorFromPath, isErrorFromAlias } from "./zodios-error.utils"; import { Assert } from "./utils.types"; +import { AnyZodiosFetcherProvider } from "./fetcher-providers"; const multipart = multer({ storage: multer.memoryStorage() }); @@ -194,7 +195,7 @@ describe("Zodios", () => { it("should replace a named plugin", () => { const zodios = new Zodios(`http://localhost:${port}`, []); - const plugin: ZodiosPlugin = { + const plugin: ZodiosPlugin = { name: "test", request: async (_, config) => config, }; @@ -207,7 +208,7 @@ describe("Zodios", () => { it("should unregister a named plugin", () => { const zodios = new Zodios(`http://localhost:${port}`, []); - const plugin: ZodiosPlugin = { + const plugin: ZodiosPlugin = { name: "test", request: async (_, config) => config, }; diff --git a/packages/core/src/zodios.ts b/packages/core/src/zodios.ts index 62108c30..bf38f560 100644 --- a/packages/core/src/zodios.ts +++ b/packages/core/src/zodios.ts @@ -35,12 +35,13 @@ import { AnyZodiosFetcherProvider, axiosProvider, AxiosProvider, + TypeOfFetcherOptions, } from "./fetcher-providers"; interface ZodiosBase< Api extends ZodiosEndpointDefinitions, FetcherProvider extends AnyZodiosFetcherProvider, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider + TypeProvider extends AnyZodiosTypeProvider > { readonly api: Api; readonly _typeProvider: TypeProvider; @@ -52,8 +53,8 @@ interface ZodiosBase< */ export class ZodiosClass< Api extends ZodiosEndpointDefinitions, - FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, + FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider > implements ZodiosBase { public readonly options: PickRequired< @@ -99,19 +100,26 @@ export class ZodiosClass< */ constructor( api: Narrow, - options?: ZodiosOptions + options?: ZodiosOptions & + TypeOfFetcherOptions ); constructor( baseUrl: string, api: Narrow, - options?: ZodiosOptions + options?: ZodiosOptions & + TypeOfFetcherOptions ); constructor( arg1?: Api | string, - arg2?: Api | ZodiosOptions, - arg3?: ZodiosOptions + arg2?: + | Api + | (ZodiosOptions & + TypeOfFetcherOptions), + arg3?: ZodiosOptions & + TypeOfFetcherOptions ) { - let options: ZodiosOptions; + let options: ZodiosOptions & + TypeOfFetcherOptions; if (!arg1) { if (Array.isArray(arg2)) { throw new Error("Zodios: missing base url"); @@ -137,15 +145,17 @@ export class ZodiosClass< transform: true, sendDefaults: false, typeProvider: zodTypeProvider as any, - fetcherProvider: axiosProvider({ baseURL }) as any, + fetcherProvider: axiosProvider, ...options, }; this._typeProvider = undefined as any; this._fetcherProvider = undefined as any; + this.options.fetcherProvider.create({ baseURL, ...this.options }); this.injectAliasEndpoints(); this.initPlugins(); if ([true, "all", "request", "response"].includes(this.options.validate)) { + // @ts-expect-error this.use(zodValidationPlugin(this.options)); } } @@ -204,12 +214,15 @@ export class ZodiosClass< * @param plugin - the plugin to use * @returns an id to allow you to unregister the plugin */ - use(plugin: ZodiosPlugin): PluginId; - use>(alias: Alias, plugin: ZodiosPlugin): PluginId; + use(plugin: ZodiosPlugin): PluginId; + use>( + alias: Alias, + plugin: ZodiosPlugin + ): PluginId; use>( method: M, path: Path, - plugin: ZodiosPlugin + plugin: ZodiosPlugin ): PluginId; use(...args: unknown[]) { if (typeof args[0] === "object") { @@ -284,12 +297,14 @@ export class ZodiosClass< M extends Method, Path extends ZodiosPathsByMethod, TConfig = ReadonlyDeep< - ZodiosRequestOptions + ZodiosRequestOptions > >( config: TConfig ): Promise> { - let conf = config as unknown as ReadonlyDeep; + let conf = config as unknown as ReadonlyDeep< + AnyZodiosRequestOptions + >; const anyPlugin = this.getAnyEndpointPlugins()!; const endpointPlugin = this.findEnpointPlugins(conf.method, conf.url); conf = await anyPlugin.interceptRequest(this.api, conf); @@ -317,7 +332,8 @@ export class ZodiosClass< "get", Path, true, - TypeProvider + TypeProvider, + FetcherProvider > >( path: Path, @@ -349,7 +365,8 @@ export class ZodiosClass< "post", Path, true, - TypeProvider + TypeProvider, + FetcherProvider > >( path: Path, @@ -383,7 +400,8 @@ export class ZodiosClass< "put", Path, true, - TypeProvider + TypeProvider, + FetcherProvider > >( path: Path, @@ -417,7 +435,8 @@ export class ZodiosClass< "patch", Path, true, - TypeProvider + TypeProvider, + FetcherProvider > >( path: Path, @@ -452,7 +471,8 @@ export class ZodiosClass< "delete", Path, true, - TypeProvider + TypeProvider, + FetcherProvider > >( path: Path, @@ -472,29 +492,31 @@ export class ZodiosClass< export type ZodiosInstance< Api extends ZodiosEndpointDefinitions, - FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider -> = ZodiosClass & - ZodiosAliases; + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, + FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider +> = ZodiosClass & + ZodiosAliases; export type ZodiosConstructor = { new < Api extends ZodiosEndpointDefinitions, - FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, + FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider >( api: Narrow, - options?: ZodiosOptions - ): ZodiosInstance; + options?: ZodiosOptions & + TypeOfFetcherOptions + ): ZodiosInstance; new < Api extends ZodiosEndpointDefinitions, - FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, + FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider >( baseUrl: string, api: Narrow, - options?: ZodiosOptions - ): ZodiosInstance; + options?: ZodiosOptions & + TypeOfFetcherOptions + ): ZodiosInstance; }; export const Zodios = ZodiosClass as ZodiosConstructor; @@ -503,9 +525,13 @@ export const Zodios = ZodiosClass as ZodiosConstructor; * Get the Api description type from zodios * @param Z - zodios type */ -export type ApiOf> = Z["api"]; +export type ApiOf> = Z["api"]; /** * Get the type provider type from zodios * @param Z - zodios type */ -export type TypeProviderOf> = Z["_typeProvider"]; +export type TypeProviderOf> = + Z["_typeProvider"]; + +export type FetcherProviderOf> = + Z["_fetcherProvider"]; diff --git a/packages/core/src/zodios.types.ts b/packages/core/src/zodios.types.ts index 66295fde..30910f6b 100644 --- a/packages/core/src/zodios.types.ts +++ b/packages/core/src/zodios.types.ts @@ -571,7 +571,8 @@ export type ZodiosAliasRequest = export type ZodiosAliases< Api extends ZodiosEndpointDefinition[], Frontend extends boolean = true, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, + FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider > = { [Alias in Aliases]: ZodiosEndpointDefinitionByAlias< Api, @@ -579,27 +580,43 @@ export type ZodiosAliases< >[number]["method"] extends MutationMethod ? ZodiosMutationAliasRequest< ZodiosBodyByAlias, - ZodiosRequestOptionsByAlias, + ZodiosRequestOptionsByAlias< + Api, + Alias, + Frontend, + TypeProvider, + FetcherProvider + >, ZodiosResponseByAlias > : ZodiosAliasRequest< - ZodiosRequestOptionsByAlias, + ZodiosRequestOptionsByAlias< + Api, + Alias, + Frontend, + TypeProvider, + FetcherProvider + >, ZodiosResponseByAlias >; }; -export type AnyZodiosMethodOptions = Merge< +export type AnyZodiosMethodOptions< + FetcherProvider extends AnyZodiosFetcherProvider +> = Merge< { params?: Record; queries?: Record; headers?: Record; }, - TypeOfFetcherConfig + TypeOfFetcherConfig >; -export type AnyZodiosRequestOptions = Merge< +export type AnyZodiosRequestOptions< + FetcherProvider extends AnyZodiosFetcherProvider +> = Merge< { method: Method; url: string }, - AnyZodiosMethodOptions + AnyZodiosMethodOptions >; /** @@ -628,14 +645,22 @@ export type ZodiosRequestOptions< M extends Method, Path extends ZodiosPathsByMethod, Frontend extends boolean = true, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, + FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider > = Merge< { method: M; url: Path; data?: ZodiosBodyByPath; }, - ZodiosRequestOptionsByPath + ZodiosRequestOptionsByPath< + Api, + M, + Path, + Frontend, + TypeProvider, + FetcherProvider + > >; /** @@ -773,9 +798,7 @@ export type ZodiosEndpointDefinitions = ZodiosEndpointDefinition[]; /** * Zodios plugin that can be used to intercept zodios requests and responses */ -export type ZodiosPlugin< - FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider -> = { +export type ZodiosPlugin = { /** * Optional name of the plugin * naming a plugin allows to remove it or replace it later @@ -789,8 +812,8 @@ export type ZodiosPlugin< */ request?: ( api: ZodiosEndpointDefinitions, - config: ReadonlyDeep - ) => Promise>; + config: ReadonlyDeep> + ) => Promise>>; /** * response interceptor to modify or inspect the response before it is returned * @param api - the api description @@ -800,7 +823,7 @@ export type ZodiosPlugin< */ response?: ( api: ZodiosEndpointDefinitions, - config: ReadonlyDeep, + config: ReadonlyDeep>, response: TypeOfFetcherResponse ) => Promise>; /** @@ -813,7 +836,7 @@ export type ZodiosPlugin< */ error?: ( api: ZodiosEndpointDefinitions, - config: ReadonlyDeep, + config: ReadonlyDeep>, error: Error ) => Promise>; }; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 65c80ad2..8d569f97 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,9 +6,8 @@ importers: specifiers: '@changesets/cli': ^2.25.2 turbo: 1.6.3 - dependencies: - '@changesets/cli': 2.25.2 devDependencies: + '@changesets/cli': 2.25.2 turbo: 1.6.3 packages/core: @@ -19,18 +18,22 @@ importers: '@types/jest': 29.2.2 '@types/multer': 1.4.7 '@types/node': 18.11.9 + '@types/qs': 6.9.7 axios: 1.1.3 express: 4.18.2 fp-ts: 2.13.1 io-ts: 2.2.19 jest: 29.3.0 multer: 1.4.5-lts.1 + qs: 6.11.0 rimraf: 3.0.2 ts-jest: 29.0.3 ts-node: 10.9.1 tsup: 6.3.0 typescript: 4.8.4 zod: 3.19.1 + dependencies: + qs: 6.11.0 devDependencies: '@jest/globals': 29.3.1 '@jest/types': 29.3.1 @@ -38,6 +41,7 @@ importers: '@types/jest': 29.2.2 '@types/multer': 1.4.7 '@types/node': 18.11.9 + '@types/qs': 6.9.7 axios: 1.1.3 express: 4.18.2 fp-ts: 2.13.1 @@ -66,6 +70,7 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/highlight': 7.18.6 + dev: true /@babel/compat-data/7.20.1: resolution: {integrity: sha512-EWZ4mE2diW3QALKvDMiXnbZpRvlj+nayZ112nK93SnhqOtpdsbVD4W+2tEoT3YNBAG9RBR0ISY758ZkOgsn6pQ==} @@ -187,6 +192,7 @@ packages: /@babel/helper-validator-identifier/7.19.1: resolution: {integrity: sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==} engines: {node: '>=6.9.0'} + dev: true /@babel/helper-validator-option/7.18.6: resolution: {integrity: sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw==} @@ -211,6 +217,7 @@ packages: '@babel/helper-validator-identifier': 7.19.1 chalk: 2.4.2 js-tokens: 4.0.0 + dev: true /@babel/parser/7.20.3: resolution: {integrity: sha512-OP/s5a94frIPXwjzEcv5S/tpQfc6XhxYUnmWpgdqMWGgYCuErA3SzozaRAMQgSZWKeTJxht9aWAkUY+0UzvOFg==} @@ -354,7 +361,7 @@ packages: engines: {node: '>=6.9.0'} dependencies: regenerator-runtime: 0.13.10 - dev: false + dev: true /@babel/template/7.18.10: resolution: {integrity: sha512-TI+rCtooWHr3QJ27kJxfjutghu44DLnasDMwpDqCXVTal9RLp3RSYNh4NdBrRP2cQAoG9A8juOQl6P6oZG4JxA==} @@ -412,7 +419,7 @@ packages: prettier: 2.7.1 resolve-from: 5.0.0 semver: 5.7.1 - dev: false + dev: true /@changesets/assemble-release-plan/5.2.2: resolution: {integrity: sha512-B1qxErQd85AeZgZFZw2bDKyOfdXHhG+X5S+W3Da2yCem8l/pRy4G/S7iOpEcMwg6lH8q2ZhgbZZwZ817D+aLuQ==} @@ -423,13 +430,13 @@ packages: '@changesets/types': 5.2.0 '@manypkg/get-packages': 1.1.3 semver: 5.7.1 - dev: false + dev: true /@changesets/changelog-git/0.1.13: resolution: {integrity: sha512-zvJ50Q+EUALzeawAxax6nF2WIcSsC5PwbuLeWkckS8ulWnuPYx8Fn/Sjd3rF46OzeKA8t30loYYV6TIzp4DIdg==} dependencies: '@changesets/types': 5.2.0 - dev: false + dev: true /@changesets/cli/2.25.2: resolution: {integrity: sha512-ACScBJXI3kRyMd2R8n8SzfttDHi4tmKSwVwXBazJOylQItSRSF4cGmej2E4FVf/eNfGy6THkL9GzAahU9ErZrA==} @@ -468,7 +475,7 @@ packages: spawndamnit: 2.0.0 term-size: 2.2.1 tty-table: 4.1.6 - dev: false + dev: true /@changesets/config/2.2.0: resolution: {integrity: sha512-GGaokp3nm5FEDk/Fv2PCRcQCOxGKKPRZ7prcMqxEr7VSsG75MnChQE8plaW1k6V8L2bJE+jZWiRm19LbnproOw==} @@ -480,13 +487,13 @@ packages: '@manypkg/get-packages': 1.1.3 fs-extra: 7.0.1 micromatch: 4.0.5 - dev: false + dev: true /@changesets/errors/0.1.4: resolution: {integrity: sha512-HAcqPF7snsUJ/QzkWoKfRfXushHTu+K5KZLJWPb34s4eCZShIf8BFO3fwq6KU8+G7L5KdtN2BzQAXOSXEyiY9Q==} dependencies: extendable-error: 0.1.7 - dev: false + dev: true /@changesets/get-dependents-graph/1.3.4: resolution: {integrity: sha512-+C4AOrrFY146ydrgKOo5vTZfj7vetNu1tWshOID+UjPUU9afYGDXI8yLnAeib1ffeBXV3TuGVcyphKpJ3cKe+A==} @@ -496,7 +503,7 @@ packages: chalk: 2.4.2 fs-extra: 7.0.1 semver: 5.7.1 - dev: false + dev: true /@changesets/get-release-plan/3.0.15: resolution: {integrity: sha512-W1tFwxE178/en+zSj/Nqbc3mvz88mcdqUMJhRzN1jDYqN3QI4ifVaRF9mcWUU+KI0gyYEtYR65tour690PqTcA==} @@ -508,11 +515,11 @@ packages: '@changesets/read': 0.5.8 '@changesets/types': 5.2.0 '@manypkg/get-packages': 1.1.3 - dev: false + dev: true /@changesets/get-version-range-type/0.3.2: resolution: {integrity: sha512-SVqwYs5pULYjYT4op21F2pVbcrca4qA/bAA3FmFXKMN7Y+HcO8sbZUTx3TAy2VXulP2FACd1aC7f2nTuqSPbqg==} - dev: false + dev: true /@changesets/git/1.5.0: resolution: {integrity: sha512-Xo8AT2G7rQJSwV87c8PwMm6BAc98BnufRMsML7m7Iw8Or18WFvFmxqG5aOL5PBvhgq9KrKvaeIBNIymracSuHg==} @@ -523,20 +530,20 @@ packages: '@manypkg/get-packages': 1.1.3 is-subdir: 1.2.0 spawndamnit: 2.0.0 - dev: false + dev: true /@changesets/logger/0.0.5: resolution: {integrity: sha512-gJyZHomu8nASHpaANzc6bkQMO9gU/ib20lqew1rVx753FOxffnCrJlGIeQVxNWCqM+o6OOleCo/ivL8UAO5iFw==} dependencies: chalk: 2.4.2 - dev: false + dev: true /@changesets/parse/0.3.15: resolution: {integrity: sha512-3eDVqVuBtp63i+BxEWHPFj2P1s3syk0PTrk2d94W9JD30iG+OER0Y6n65TeLlY8T2yB9Fvj6Ev5Gg0+cKe/ZUA==} dependencies: '@changesets/types': 5.2.0 js-yaml: 3.14.1 - dev: false + dev: true /@changesets/pre/1.0.13: resolution: {integrity: sha512-jrZc766+kGZHDukjKhpBXhBJjVQMied4Fu076y9guY1D3H622NOw8AQaLV3oQsDtKBTrT2AUFjt9Z2Y9Qx+GfA==} @@ -546,7 +553,7 @@ packages: '@changesets/types': 5.2.0 '@manypkg/get-packages': 1.1.3 fs-extra: 7.0.1 - dev: false + dev: true /@changesets/read/0.5.8: resolution: {integrity: sha512-eYaNfxemgX7f7ELC58e7yqQICW5FB7V+bd1lKt7g57mxUrTveYME+JPaBPpYx02nP53XI6CQp6YxnR9NfmFPKw==} @@ -559,15 +566,15 @@ packages: chalk: 2.4.2 fs-extra: 7.0.1 p-filter: 2.1.0 - dev: false + dev: true /@changesets/types/4.1.0: resolution: {integrity: sha512-LDQvVDv5Kb50ny2s25Fhm3d9QSZimsoUGBsUioj6MC3qbMUCuC8GPIvk/M6IvXx3lYhAs0lwWUQLb+VIEUCECw==} - dev: false + dev: true /@changesets/types/5.2.0: resolution: {integrity: sha512-km/66KOqJC+eicZXsm2oq8A8bVTSpkZJ60iPV/Nl5Z5c7p9kk8xxh6XGRTlnludHldxOOfudhnDN2qPxtHmXzA==} - dev: false + dev: true /@changesets/write/0.2.2: resolution: {integrity: sha512-kCYNHyF3xaId1Q/QE+DF3UTrHTyg3Cj/f++T8S8/EkC+jh1uK2LFnM9h+EzV+fsmnZDrs7r0J4LLpeI/VWC5Hg==} @@ -577,7 +584,7 @@ packages: fs-extra: 7.0.1 human-id: 1.0.2 prettier: 2.7.1 - dev: false + dev: true /@cspotcode/source-map-support/0.8.1: resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} @@ -885,7 +892,7 @@ packages: '@types/node': 12.20.55 find-up: 4.1.0 fs-extra: 8.1.0 - dev: false + dev: true /@manypkg/get-packages/1.1.3: resolution: {integrity: sha512-fo+QhuU3qE/2TQMQmbVMqaQ6EWbMhi4ABWP+O4AM1NqPBuy0OrApV5LO6BrrgnhtAHS2NH6RrVk9OL181tTi8A==} @@ -896,7 +903,7 @@ packages: fs-extra: 8.1.0 globby: 11.1.0 read-yaml-file: 1.1.0 - dev: false + dev: true /@nodelib/fs.scandir/2.1.5: resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} @@ -904,10 +911,12 @@ packages: dependencies: '@nodelib/fs.stat': 2.0.5 run-parallel: 1.2.0 + dev: true /@nodelib/fs.stat/2.0.5: resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} engines: {node: '>= 8'} + dev: true /@nodelib/fs.walk/1.2.8: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} @@ -915,6 +924,7 @@ packages: dependencies: '@nodelib/fs.scandir': 2.1.5 fastq: 1.13.0 + dev: true /@sinclair/typebox/0.24.51: resolution: {integrity: sha512-1P1OROm/rdubP5aFDSZQILU0vrLCJ4fvHt6EoqHEM+2D/G5MK3bIaymUKLit8Js9gbns5UyJnkP/TZROLw4tUA==} @@ -1017,7 +1027,7 @@ packages: resolution: {integrity: sha512-Q0Op0hdWbYd1iahB+IFNQcWXFq4O0Q5MwQP7uN0souuQ4rPg1vEYcnIOfr1gY+M+6rc8FGoRaBO1mOOvL29sEQ==} dependencies: ci-info: 3.5.0 - dev: false + dev: true /@types/istanbul-lib-coverage/2.0.4: resolution: {integrity: sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==} @@ -1048,7 +1058,7 @@ packages: /@types/minimist/1.2.2: resolution: {integrity: sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==} - dev: false + dev: true /@types/multer/1.4.7: resolution: {integrity: sha512-/SNsDidUFCvqqcWDwxv2feww/yqhNeTRL5CVoL3jU4Goc4kKEL10T7Eye65ZqPNi4HRx8sAEX59pV1aEH7drNA==} @@ -1058,7 +1068,7 @@ packages: /@types/node/12.20.55: resolution: {integrity: sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==} - dev: false + dev: true /@types/node/18.11.9: resolution: {integrity: sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==} @@ -1066,7 +1076,7 @@ packages: /@types/normalize-package-data/2.4.1: resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==} - dev: false + dev: true /@types/prettier/2.7.1: resolution: {integrity: sha512-ri0UmynRRvZiiUJdiz38MmIblKK+oH30MztdBVR95dv/Ubw6neWSb8u1XpRb72L4qsZOhz+L+z9JD40SJmfWow==} @@ -1082,7 +1092,7 @@ packages: /@types/semver/6.2.3: resolution: {integrity: sha512-KQf+QAMWKMrtBMsB8/24w53tEsxllMj6TuA80TT/5igJalLI/zm0L3oXRbIAl4Ohfc85gyHX/jhMwsVkmhLU4A==} - dev: false + dev: true /@types/serve-static/1.15.0: resolution: {integrity: sha512-z5xyF6uh8CbjAu9760KDKsH2FcDxZ2tFCsA4HIMWE6IkiYMXfVoa+4f9KX+FN0ZLsaMw1WNG2ETLA6N+/YA+cg==} @@ -1127,7 +1137,7 @@ packages: /ansi-colors/4.1.3: resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} engines: {node: '>=6'} - dev: false + dev: true /ansi-escapes/4.3.2: resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} @@ -1139,18 +1149,21 @@ packages: /ansi-regex/5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} + dev: true /ansi-styles/3.2.1: resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} engines: {node: '>=4'} dependencies: color-convert: 1.9.3 + dev: true /ansi-styles/4.3.0: resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} engines: {node: '>=8'} dependencies: color-convert: 2.0.1 + dev: true /ansi-styles/5.2.0: resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==} @@ -1181,6 +1194,7 @@ packages: resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} dependencies: sprintf-js: 1.0.3 + dev: true /array-flatten/1.1.1: resolution: {integrity: sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==} @@ -1189,6 +1203,7 @@ packages: /array-union/2.1.0: resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} engines: {node: '>=8'} + dev: true /array.prototype.flat/1.3.1: resolution: {integrity: sha512-roTU0KWIOmJ4DRLmwKd19Otg0/mT3qPNt0Qb3GWW8iObuZXxrjB/pzn0R3hqpRSWg4HCwqx+0vwOnWnvlOyeIA==} @@ -1198,12 +1213,12 @@ packages: define-properties: 1.1.4 es-abstract: 1.20.4 es-shim-unscopables: 1.0.0 - dev: false + dev: true /arrify/1.0.1: resolution: {integrity: sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==} engines: {node: '>=0.10.0'} - dev: false + dev: true /asynckit/0.4.0: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} @@ -1300,7 +1315,7 @@ packages: engines: {node: '>=4'} dependencies: is-windows: 1.0.2 - dev: false + dev: true /binary-extensions/2.2.0: resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==} @@ -1339,12 +1354,13 @@ packages: engines: {node: '>=8'} dependencies: fill-range: 7.0.1 + dev: true /breakword/1.0.5: resolution: {integrity: sha512-ex5W9DoOQ/LUEU3PMdLs9ua/CYZl1678NUkKOdUSi8Aw5F1idieaiRURCBFJCwVcrD1J8Iy3vfWSloaMwO2qFg==} dependencies: wcwidth: 1.0.1 - dev: false + dev: true /browserslist/4.21.4: resolution: {integrity: sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw==} @@ -1419,11 +1435,12 @@ packages: camelcase: 5.3.1 map-obj: 4.3.0 quick-lru: 4.0.1 - dev: false + dev: true /camelcase/5.3.1: resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} engines: {node: '>=6'} + dev: true /camelcase/6.3.0: resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} @@ -1441,6 +1458,7 @@ packages: ansi-styles: 3.2.1 escape-string-regexp: 1.0.5 supports-color: 5.5.0 + dev: true /chalk/4.1.2: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} @@ -1448,6 +1466,7 @@ packages: dependencies: ansi-styles: 4.3.0 supports-color: 7.2.0 + dev: true /char-regex/1.0.2: resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} @@ -1456,7 +1475,7 @@ packages: /chardet/0.7.0: resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} - dev: false + dev: true /chokidar/3.5.3: resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==} @@ -1475,6 +1494,7 @@ packages: /ci-info/3.5.0: resolution: {integrity: sha512-yH4RezKOGlOhxkmhbeNuC4eYZKAUsEaGtBuBzDDP1eFUKiccDWzBABxBfOx31IDwDIXMTxWuwAxUGModvkbuVw==} + dev: true /cjs-module-lexer/1.2.2: resolution: {integrity: sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA==} @@ -1486,7 +1506,7 @@ packages: string-width: 4.2.3 strip-ansi: 6.0.1 wrap-ansi: 6.2.0 - dev: false + dev: true /cliui/8.0.1: resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} @@ -1495,11 +1515,12 @@ packages: string-width: 4.2.3 strip-ansi: 6.0.1 wrap-ansi: 7.0.0 + dev: true /clone/1.0.4: resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} engines: {node: '>=0.8'} - dev: false + dev: true /co/4.6.0: resolution: {integrity: sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==} @@ -1514,18 +1535,22 @@ packages: resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} dependencies: color-name: 1.1.3 + dev: true /color-convert/2.0.1: resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} engines: {node: '>=7.0.0'} dependencies: color-name: 1.1.4 + dev: true /color-name/1.1.3: resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==} + dev: true /color-name/1.1.4: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + dev: true /combined-stream/1.0.8: resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} @@ -1596,7 +1621,7 @@ packages: lru-cache: 4.1.5 shebang-command: 1.2.0 which: 1.3.1 - dev: false + dev: true /cross-spawn/7.0.3: resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} @@ -1609,15 +1634,15 @@ packages: /csv-generate/3.4.3: resolution: {integrity: sha512-w/T+rqR0vwvHqWs/1ZyMDWtHHSJaN06klRqJXBEpDJaM/+dZkso0OKh1VcuuYvK3XM53KysVNq8Ko/epCK8wOw==} - dev: false + dev: true /csv-parse/4.16.3: resolution: {integrity: sha512-cO1I/zmz4w2dcKHVvpCr7JVRu8/FymG5OEpmvsZYlccYolPBLoVGKUHgNoc4ZGkFeFlWGEDmMyBM+TTqRdW/wg==} - dev: false + dev: true /csv-stringify/5.6.5: resolution: {integrity: sha512-PjiQ659aQ+fUTQqSrd1XEDnOr52jh30RBurfzkscaE2tPaFsDH5wOAHJiw8XAHphRknCwMUE9KRayc4K/NbO8A==} - dev: false + dev: true /csv/5.5.3: resolution: {integrity: sha512-QTaY0XjjhTQOdguARF0lGKm5/mEq9PD9/VhZZegHDIBq2tQwgNpHc3dneD4mGo2iJs+fTKv5Bp0fZ+BRuY3Z0g==} @@ -1627,7 +1652,7 @@ packages: csv-parse: 4.16.3 csv-stringify: 5.6.5 stream-transform: 2.1.3 - dev: false + dev: true /debug/2.6.9: resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} @@ -1658,12 +1683,12 @@ packages: dependencies: decamelize: 1.2.0 map-obj: 1.0.1 - dev: false + dev: true /decamelize/1.2.0: resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==} engines: {node: '>=0.10.0'} - dev: false + dev: true /dedent/0.7.0: resolution: {integrity: sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==} @@ -1678,7 +1703,7 @@ packages: resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} dependencies: clone: 1.0.4 - dev: false + dev: true /define-properties/1.1.4: resolution: {integrity: sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==} @@ -1686,7 +1711,7 @@ packages: dependencies: has-property-descriptors: 1.0.0 object-keys: 1.1.1 - dev: false + dev: true /delayed-stream/1.0.0: resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} @@ -1706,7 +1731,7 @@ packages: /detect-indent/6.1.0: resolution: {integrity: sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==} engines: {node: '>=8'} - dev: false + dev: true /detect-newline/3.1.0: resolution: {integrity: sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==} @@ -1728,6 +1753,7 @@ packages: engines: {node: '>=8'} dependencies: path-type: 4.0.0 + dev: true /ee-first/1.1.1: resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} @@ -1744,6 +1770,7 @@ packages: /emoji-regex/8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + dev: true /encodeurl/1.0.2: resolution: {integrity: sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==} @@ -1755,12 +1782,13 @@ packages: engines: {node: '>=8.6'} dependencies: ansi-colors: 4.1.3 - dev: false + dev: true /error-ex/1.3.2: resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} dependencies: is-arrayish: 0.2.1 + dev: true /es-abstract/1.20.4: resolution: {integrity: sha512-0UtvRN79eMe2L+UNEF1BwRe364sj/DXhQ/k5FmivgoSdpM90b8Jc0mDzKMGo7QS0BVbOP/bTwBKNnDc9rNzaPA==} @@ -1790,13 +1818,13 @@ packages: string.prototype.trimend: 1.0.6 string.prototype.trimstart: 1.0.6 unbox-primitive: 1.0.2 - dev: false + dev: true /es-shim-unscopables/1.0.0: resolution: {integrity: sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==} dependencies: has: 1.0.3 - dev: false + dev: true /es-to-primitive/1.2.1: resolution: {integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==} @@ -1805,7 +1833,7 @@ packages: is-callable: 1.2.7 is-date-object: 1.0.5 is-symbol: 1.0.4 - dev: false + dev: true /esbuild-android-64/0.15.13: resolution: {integrity: sha512-yRorukXBlokwTip+Sy4MYskLhJsO0Kn0/Fj43s1krVblfwP+hMD37a4Wmg139GEsMLl+vh8WXp2mq/cTA9J97g==} @@ -2020,6 +2048,7 @@ packages: /escalade/3.1.1: resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} engines: {node: '>=6'} + dev: true /escape-html/1.0.3: resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==} @@ -2028,6 +2057,7 @@ packages: /escape-string-regexp/1.0.5: resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} engines: {node: '>=0.8.0'} + dev: true /escape-string-regexp/2.0.0: resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} @@ -2038,6 +2068,7 @@ packages: resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} engines: {node: '>=4'} hasBin: true + dev: true /etag/1.8.1: resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==} @@ -2116,7 +2147,7 @@ packages: /extendable-error/0.1.7: resolution: {integrity: sha512-UOiS2in6/Q0FK0R0q6UY9vYpQ21mr/Qn1KOnte7vsACuNJf514WvCCUHSRCPcgjPT2bAhNIJdlE6bVap1GKmeg==} - dev: false + dev: true /external-editor/3.1.0: resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} @@ -2125,7 +2156,7 @@ packages: chardet: 0.7.0 iconv-lite: 0.4.24 tmp: 0.0.33 - dev: false + dev: true /fast-glob/3.2.12: resolution: {integrity: sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==} @@ -2136,6 +2167,7 @@ packages: glob-parent: 5.1.2 merge2: 1.4.1 micromatch: 4.0.5 + dev: true /fast-json-stable-stringify/2.1.0: resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} @@ -2145,6 +2177,7 @@ packages: resolution: {integrity: sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==} dependencies: reusify: 1.0.4 + dev: true /fb-watchman/2.0.2: resolution: {integrity: sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==} @@ -2157,6 +2190,7 @@ packages: engines: {node: '>=8'} dependencies: to-regex-range: 5.0.1 + dev: true /finalhandler/1.2.0: resolution: {integrity: sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==} @@ -2179,6 +2213,7 @@ packages: dependencies: locate-path: 5.0.0 path-exists: 4.0.0 + dev: true /find-up/5.0.0: resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} @@ -2186,14 +2221,14 @@ packages: dependencies: locate-path: 6.0.0 path-exists: 4.0.0 - dev: false + dev: true /find-yarn-workspace-root2/1.2.16: resolution: {integrity: sha512-hr6hb1w8ePMpPVUK39S4RlwJzi+xPLuVuG8XlwXU3KD5Yn3qgBWVfy3AzNlDhWvE1EORCE65/Qm26rFQt3VLVA==} dependencies: micromatch: 4.0.5 pkg-dir: 4.2.0 - dev: false + dev: true /follow-redirects/1.15.2: resolution: {integrity: sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==} @@ -2235,7 +2270,7 @@ packages: graceful-fs: 4.2.10 jsonfile: 4.0.0 universalify: 0.1.2 - dev: false + dev: true /fs-extra/8.1.0: resolution: {integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==} @@ -2244,7 +2279,7 @@ packages: graceful-fs: 4.2.10 jsonfile: 4.0.0 universalify: 0.1.2 - dev: false + dev: true /fs.realpath/1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} @@ -2269,11 +2304,11 @@ packages: define-properties: 1.1.4 es-abstract: 1.20.4 functions-have-names: 1.2.3 - dev: false + dev: true /functions-have-names/1.2.3: resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} - dev: false + dev: true /gensync/1.0.0-beta.2: resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} @@ -2283,6 +2318,7 @@ packages: /get-caller-file/2.0.5: resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} engines: {node: 6.* || 8.* || >= 10.*} + dev: true /get-intrinsic/1.1.3: resolution: {integrity: sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A==} @@ -2307,13 +2343,14 @@ packages: dependencies: call-bind: 1.0.2 get-intrinsic: 1.1.3 - dev: false + dev: true /glob-parent/5.1.2: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} engines: {node: '>= 6'} dependencies: is-glob: 4.0.3 + dev: true /glob/7.1.6: resolution: {integrity: sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==} @@ -2352,36 +2389,40 @@ packages: ignore: 5.2.0 merge2: 1.4.1 slash: 3.0.0 + dev: true /graceful-fs/4.2.10: resolution: {integrity: sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==} + dev: true /grapheme-splitter/1.0.4: resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==} - dev: false + dev: true /hard-rejection/2.1.0: resolution: {integrity: sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==} engines: {node: '>=6'} - dev: false + dev: true /has-bigints/1.0.2: resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==} - dev: false + dev: true /has-flag/3.0.0: resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} engines: {node: '>=4'} + dev: true /has-flag/4.0.0: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} + dev: true /has-property-descriptors/1.0.0: resolution: {integrity: sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==} dependencies: get-intrinsic: 1.1.3 - dev: false + dev: true /has-symbols/1.0.3: resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} @@ -2392,7 +2433,7 @@ packages: engines: {node: '>= 0.4'} dependencies: has-symbols: 1.0.3 - dev: false + dev: true /has/1.0.3: resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==} @@ -2402,7 +2443,7 @@ packages: /hosted-git-info/2.8.9: resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} - dev: false + dev: true /html-escaper/2.0.2: resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} @@ -2421,7 +2462,7 @@ packages: /human-id/1.0.2: resolution: {integrity: sha512-UNopramDEhHJD+VR+ehk8rOslwSfByxPIZyJRfV739NDhN5LF1fa1MqnzKm2lGTQRjNrjK19Q5fhkgIfjlVUKw==} - dev: false + dev: true /human-signals/2.1.0: resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} @@ -2433,10 +2474,12 @@ packages: engines: {node: '>=0.10.0'} dependencies: safer-buffer: 2.1.2 + dev: true /ignore/5.2.0: resolution: {integrity: sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==} engines: {node: '>= 4'} + dev: true /import-local/3.1.0: resolution: {integrity: sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==} @@ -2455,7 +2498,7 @@ packages: /indent-string/4.0.0: resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==} engines: {node: '>=8'} - dev: false + dev: true /inflight/1.0.6: resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} @@ -2475,7 +2518,7 @@ packages: get-intrinsic: 1.1.3 has: 1.0.3 side-channel: 1.0.4 - dev: false + dev: true /io-ts/2.2.19_fp-ts@2.13.1: resolution: {integrity: sha512-ED0GQwvKRr5C2jqOOJCkuJW2clnbzqFexQ8V7Qsb+VB36S1Mk/OKH7k0FjSe4mjKy9qBRA3OqgVGyFMUEKIubw==} @@ -2492,12 +2535,13 @@ packages: /is-arrayish/0.2.1: resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} + dev: true /is-bigint/1.0.4: resolution: {integrity: sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==} dependencies: has-bigints: 1.0.2 - dev: false + dev: true /is-binary-path/2.1.0: resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} @@ -2512,39 +2556,42 @@ packages: dependencies: call-bind: 1.0.2 has-tostringtag: 1.0.0 - dev: false + dev: true /is-callable/1.2.7: resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} engines: {node: '>= 0.4'} - dev: false + dev: true /is-ci/3.0.1: resolution: {integrity: sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==} hasBin: true dependencies: ci-info: 3.5.0 - dev: false + dev: true /is-core-module/2.11.0: resolution: {integrity: sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==} dependencies: has: 1.0.3 + dev: true /is-date-object/1.0.5: resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==} engines: {node: '>= 0.4'} dependencies: has-tostringtag: 1.0.0 - dev: false + dev: true /is-extglob/2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} + dev: true /is-fullwidth-code-point/3.0.0: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} engines: {node: '>=8'} + dev: true /is-generator-fn/2.1.0: resolution: {integrity: sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==} @@ -2556,27 +2603,29 @@ packages: engines: {node: '>=0.10.0'} dependencies: is-extglob: 2.1.1 + dev: true /is-negative-zero/2.0.2: resolution: {integrity: sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==} engines: {node: '>= 0.4'} - dev: false + dev: true /is-number-object/1.0.7: resolution: {integrity: sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==} engines: {node: '>= 0.4'} dependencies: has-tostringtag: 1.0.0 - dev: false + dev: true /is-number/7.0.0: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} + dev: true /is-plain-obj/1.1.0: resolution: {integrity: sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==} engines: {node: '>=0.10.0'} - dev: false + dev: true /is-regex/1.1.4: resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==} @@ -2584,13 +2633,13 @@ packages: dependencies: call-bind: 1.0.2 has-tostringtag: 1.0.0 - dev: false + dev: true /is-shared-array-buffer/1.0.2: resolution: {integrity: sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==} dependencies: call-bind: 1.0.2 - dev: false + dev: true /is-stream/2.0.1: resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} @@ -2602,32 +2651,32 @@ packages: engines: {node: '>= 0.4'} dependencies: has-tostringtag: 1.0.0 - dev: false + dev: true /is-subdir/1.2.0: resolution: {integrity: sha512-2AT6j+gXe/1ueqbW6fLZJiIw3F8iXGJtt0yDrZaBhAZEG1raiTxKWU+IPqMCzQAXOUCKdA4UDMgacKH25XG2Cw==} engines: {node: '>=4'} dependencies: better-path-resolve: 1.0.0 - dev: false + dev: true /is-symbol/1.0.4: resolution: {integrity: sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==} engines: {node: '>= 0.4'} dependencies: has-symbols: 1.0.3 - dev: false + dev: true /is-weakref/1.0.2: resolution: {integrity: sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==} dependencies: call-bind: 1.0.2 - dev: false + dev: true /is-windows/1.0.2: resolution: {integrity: sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==} engines: {node: '>=0.10.0'} - dev: false + dev: true /isarray/1.0.0: resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==} @@ -2635,6 +2684,7 @@ packages: /isexe/2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + dev: true /istanbul-lib-coverage/3.2.0: resolution: {integrity: sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==} @@ -3099,6 +3149,7 @@ packages: /js-tokens/4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + dev: true /js-yaml/3.14.1: resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} @@ -3106,6 +3157,7 @@ packages: dependencies: argparse: 1.0.10 esprima: 4.0.1 + dev: true /jsesc/2.5.2: resolution: {integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==} @@ -3115,6 +3167,7 @@ packages: /json-parse-even-better-errors/2.3.1: resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} + dev: true /json5/2.2.1: resolution: {integrity: sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==} @@ -3126,12 +3179,12 @@ packages: resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==} optionalDependencies: graceful-fs: 4.2.10 - dev: false + dev: true /kind-of/6.0.3: resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==} engines: {node: '>=0.10.0'} - dev: false + dev: true /kleur/3.0.3: resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==} @@ -3141,7 +3194,7 @@ packages: /kleur/4.1.5: resolution: {integrity: sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==} engines: {node: '>=6'} - dev: false + dev: true /leven/3.1.0: resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==} @@ -3155,6 +3208,7 @@ packages: /lines-and-columns/1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} + dev: true /load-tsconfig/0.2.3: resolution: {integrity: sha512-iyT2MXws+dc2Wi6o3grCFtGXpeMvHmJqS27sMPGtV2eUu4PeFnG+33I8BlFK1t1NWMjOpcx9bridn5yxLDX2gQ==} @@ -3169,20 +3223,21 @@ packages: js-yaml: 3.14.1 pify: 4.0.1 strip-bom: 3.0.0 - dev: false + dev: true /locate-path/5.0.0: resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} engines: {node: '>=8'} dependencies: p-locate: 4.1.0 + dev: true /locate-path/6.0.0: resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} engines: {node: '>=10'} dependencies: p-locate: 5.0.0 - dev: false + dev: true /lodash.memoize/4.1.2: resolution: {integrity: sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==} @@ -3194,14 +3249,14 @@ packages: /lodash.startcase/4.4.0: resolution: {integrity: sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==} - dev: false + dev: true /lru-cache/4.1.5: resolution: {integrity: sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==} dependencies: pseudomap: 1.0.2 yallist: 2.1.2 - dev: false + dev: true /lru-cache/6.0.0: resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} @@ -3230,12 +3285,12 @@ packages: /map-obj/1.0.1: resolution: {integrity: sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==} engines: {node: '>=0.10.0'} - dev: false + dev: true /map-obj/4.3.0: resolution: {integrity: sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==} engines: {node: '>=8'} - dev: false + dev: true /media-typer/0.3.0: resolution: {integrity: sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==} @@ -3257,7 +3312,7 @@ packages: trim-newlines: 3.0.1 type-fest: 0.13.1 yargs-parser: 18.1.3 - dev: false + dev: true /merge-descriptors/1.0.1: resolution: {integrity: sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==} @@ -3270,6 +3325,7 @@ packages: /merge2/1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} + dev: true /methods/1.1.2: resolution: {integrity: sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==} @@ -3282,6 +3338,7 @@ packages: dependencies: braces: 3.0.2 picomatch: 2.3.1 + dev: true /mime-db/1.52.0: resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} @@ -3309,7 +3366,7 @@ packages: /min-indent/1.0.1: resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} engines: {node: '>=4'} - dev: false + dev: true /minimatch/3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} @@ -3324,7 +3381,7 @@ packages: arrify: 1.0.1 is-plain-obj: 1.1.0 kind-of: 6.0.3 - dev: false + dev: true /minimist/1.2.7: resolution: {integrity: sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==} @@ -3333,7 +3390,7 @@ packages: /mixme/0.5.4: resolution: {integrity: sha512-3KYa4m4Vlqx98GPdOHghxSdNtTvcP8E0kkaJ5Dlh+h2DRzF7zpuVVcA8B0QpKd11YJeP9QQ7ASkKzOeu195Wzw==} engines: {node: '>= 8.0.0'} - dev: false + dev: true /mkdirp/0.5.6: resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==} @@ -3399,7 +3456,7 @@ packages: resolve: 1.22.1 semver: 5.7.1 validate-npm-package-license: 3.0.4 - dev: false + dev: true /normalize-path/3.0.0: resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} @@ -3424,7 +3481,7 @@ packages: /object-keys/1.1.1: resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} engines: {node: '>= 0.4'} - dev: false + dev: true /object.assign/4.1.4: resolution: {integrity: sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==} @@ -3434,7 +3491,7 @@ packages: define-properties: 1.1.4 has-symbols: 1.0.3 object-keys: 1.1.1 - dev: false + dev: true /on-finished/2.4.1: resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==} @@ -3459,52 +3516,56 @@ packages: /os-tmpdir/1.0.2: resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} engines: {node: '>=0.10.0'} - dev: false + dev: true /outdent/0.5.0: resolution: {integrity: sha512-/jHxFIzoMXdqPzTaCpFzAAWhpkSjZPF4Vsn6jAfNpmbH/ymsmd7Qc6VE9BGn0L6YMj6uwpQLxCECpus4ukKS9Q==} - dev: false + dev: true /p-filter/2.1.0: resolution: {integrity: sha512-ZBxxZ5sL2HghephhpGAQdoskxplTwr7ICaehZwLIlfL6acuVgZPm8yBNuRAFBGEqtD/hmUeq9eqLg2ys9Xr/yw==} engines: {node: '>=8'} dependencies: p-map: 2.1.0 - dev: false + dev: true /p-limit/2.3.0: resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} engines: {node: '>=6'} dependencies: p-try: 2.2.0 + dev: true /p-limit/3.1.0: resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} engines: {node: '>=10'} dependencies: yocto-queue: 0.1.0 + dev: true /p-locate/4.1.0: resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} engines: {node: '>=8'} dependencies: p-limit: 2.3.0 + dev: true /p-locate/5.0.0: resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} engines: {node: '>=10'} dependencies: p-limit: 3.1.0 - dev: false + dev: true /p-map/2.1.0: resolution: {integrity: sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==} engines: {node: '>=6'} - dev: false + dev: true /p-try/2.2.0: resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} engines: {node: '>=6'} + dev: true /parse-json/5.2.0: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} @@ -3514,6 +3575,7 @@ packages: error-ex: 1.3.2 json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 + dev: true /parseurl/1.3.3: resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==} @@ -3523,6 +3585,7 @@ packages: /path-exists/4.0.0: resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} engines: {node: '>=8'} + dev: true /path-is-absolute/1.0.1: resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} @@ -3536,6 +3599,7 @@ packages: /path-parse/1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} + dev: true /path-to-regexp/0.1.7: resolution: {integrity: sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==} @@ -3544,6 +3608,7 @@ packages: /path-type/4.0.0: resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} engines: {node: '>=8'} + dev: true /picocolors/1.0.0: resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} @@ -3552,11 +3617,12 @@ packages: /picomatch/2.3.1: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} + dev: true /pify/4.0.1: resolution: {integrity: sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==} engines: {node: '>=6'} - dev: false + dev: true /pirates/4.0.5: resolution: {integrity: sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ==} @@ -3568,6 +3634,7 @@ packages: engines: {node: '>=8'} dependencies: find-up: 4.1.0 + dev: true /postcss-load-config/3.1.4_ts-node@10.9.1: resolution: {integrity: sha512-6DiM4E7v4coTE4uzA8U//WhtPwyhiim3eyjEMFCnUpzbrkK9wJHgKDT2mR+HbtSrd/NubVaYTOpSpjUl8NQeRg==} @@ -3594,13 +3661,13 @@ packages: find-yarn-workspace-root2: 1.2.16 path-exists: 4.0.0 which-pm: 2.0.0 - dev: false + dev: true /prettier/2.7.1: resolution: {integrity: sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==} engines: {node: '>=10.13.0'} hasBin: true - dev: false + dev: true /pretty-format/29.3.1: resolution: {integrity: sha512-FyLnmb1cYJV8biEIiRyzRFvs2lry7PPIvOqKVe1GCUEYg4YGmlx1qG9EJNMxArYm7piII4qb8UV1Pncq5dxmcg==} @@ -3637,7 +3704,7 @@ packages: /pseudomap/1.0.2: resolution: {integrity: sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==} - dev: false + dev: true /punycode/2.1.1: resolution: {integrity: sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==} @@ -3649,15 +3716,15 @@ packages: engines: {node: '>=0.6'} dependencies: side-channel: 1.0.4 - dev: true /queue-microtask/1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} + dev: true /quick-lru/4.0.1: resolution: {integrity: sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==} engines: {node: '>=8'} - dev: false + dev: true /range-parser/1.2.1: resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==} @@ -3685,7 +3752,7 @@ packages: find-up: 4.1.0 read-pkg: 5.2.0 type-fest: 0.8.1 - dev: false + dev: true /read-pkg/5.2.0: resolution: {integrity: sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==} @@ -3695,7 +3762,7 @@ packages: normalize-package-data: 2.5.0 parse-json: 5.2.0 type-fest: 0.6.0 - dev: false + dev: true /read-yaml-file/1.1.0: resolution: {integrity: sha512-VIMnQi/Z4HT2Fxuwg5KrY174U1VdUIASQVWXXyqtNRtxSr9IYkn1rsI6Tb6HsrHCmB7gVpNwX6JxPTHcH6IoTA==} @@ -3705,7 +3772,7 @@ packages: js-yaml: 3.14.1 pify: 4.0.1 strip-bom: 3.0.0 - dev: false + dev: true /readable-stream/2.3.7: resolution: {integrity: sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==} @@ -3732,11 +3799,11 @@ packages: dependencies: indent-string: 4.0.0 strip-indent: 3.0.0 - dev: false + dev: true /regenerator-runtime/0.13.10: resolution: {integrity: sha512-KepLsg4dU12hryUO7bp/axHAKvwGOCV0sGloQtpagJ12ai+ojVDqkeGSiRX1zlq+kjIMZ1t7gpze+26QqtdGqw==} - dev: false + dev: true /regexp.prototype.flags/1.4.3: resolution: {integrity: sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==} @@ -3745,15 +3812,16 @@ packages: call-bind: 1.0.2 define-properties: 1.1.4 functions-have-names: 1.2.3 - dev: false + dev: true /require-directory/2.1.1: resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} engines: {node: '>=0.10.0'} + dev: true /require-main-filename/2.0.0: resolution: {integrity: sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==} - dev: false + dev: true /resolve-cwd/3.0.0: resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} @@ -3765,6 +3833,7 @@ packages: /resolve-from/5.0.0: resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} engines: {node: '>=8'} + dev: true /resolve.exports/1.1.0: resolution: {integrity: sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ==} @@ -3778,10 +3847,12 @@ packages: is-core-module: 2.11.0 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 + dev: true /reusify/1.0.4: resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} + dev: true /rimraf/3.0.2: resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} @@ -3802,6 +3873,7 @@ packages: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} dependencies: queue-microtask: 1.2.3 + dev: true /safe-buffer/5.1.2: resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} @@ -3817,15 +3889,16 @@ packages: call-bind: 1.0.2 get-intrinsic: 1.1.3 is-regex: 1.1.4 - dev: false + dev: true /safer-buffer/2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + dev: true /semver/5.7.1: resolution: {integrity: sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==} hasBin: true - dev: false + dev: true /semver/6.3.0: resolution: {integrity: sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==} @@ -3875,7 +3948,7 @@ packages: /set-blocking/2.0.0: resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} - dev: false + dev: true /setprototypeof/1.2.0: resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==} @@ -3886,7 +3959,7 @@ packages: engines: {node: '>=0.10.0'} dependencies: shebang-regex: 1.0.0 - dev: false + dev: true /shebang-command/2.0.0: resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} @@ -3898,7 +3971,7 @@ packages: /shebang-regex/1.0.0: resolution: {integrity: sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==} engines: {node: '>=0.10.0'} - dev: false + dev: true /shebang-regex/3.0.0: resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} @@ -3914,6 +3987,7 @@ packages: /signal-exit/3.0.7: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} + dev: true /sisteransi/1.0.5: resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} @@ -3922,6 +3996,7 @@ packages: /slash/3.0.0: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} engines: {node: '>=8'} + dev: true /smartwrap/2.0.2: resolution: {integrity: sha512-vCsKNQxb7PnCNd2wY1WClWifAc2lwqsG8OaswpJkVJsvMGcnEntdTCDajZCkk93Ay1U3t/9puJmb525Rg5MZBA==} @@ -3934,7 +4009,7 @@ packages: strip-ansi: 6.0.1 wcwidth: 1.0.1 yargs: 15.4.1 - dev: false + dev: true /source-map-support/0.5.13: resolution: {integrity: sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==} @@ -3960,32 +4035,33 @@ packages: dependencies: cross-spawn: 5.1.0 signal-exit: 3.0.7 - dev: false + dev: true /spdx-correct/3.1.1: resolution: {integrity: sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==} dependencies: spdx-expression-parse: 3.0.1 spdx-license-ids: 3.0.12 - dev: false + dev: true /spdx-exceptions/2.3.0: resolution: {integrity: sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==} - dev: false + dev: true /spdx-expression-parse/3.0.1: resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==} dependencies: spdx-exceptions: 2.3.0 spdx-license-ids: 3.0.12 - dev: false + dev: true /spdx-license-ids/3.0.12: resolution: {integrity: sha512-rr+VVSXtRhO4OHbXUiAF7xW3Bo9DuuF6C5jH+q/x15j2jniycgKbxU09Hr0WqlSLUs4i4ltHGXqTe7VHclYWyA==} - dev: false + dev: true /sprintf-js/1.0.3: resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} + dev: true /stack-utils/2.0.6: resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} @@ -4003,7 +4079,7 @@ packages: resolution: {integrity: sha512-9GHUiM5hMiCi6Y03jD2ARC1ettBXkQBoQAe7nJsPknnI0ow10aXjTnew8QtYQmLjzn974BnmWEAJgCY6ZP1DeQ==} dependencies: mixme: 0.5.4 - dev: false + dev: true /streamsearch/1.1.0: resolution: {integrity: sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==} @@ -4025,6 +4101,7 @@ packages: emoji-regex: 8.0.0 is-fullwidth-code-point: 3.0.0 strip-ansi: 6.0.1 + dev: true /string.prototype.trimend/1.0.6: resolution: {integrity: sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==} @@ -4032,7 +4109,7 @@ packages: call-bind: 1.0.2 define-properties: 1.1.4 es-abstract: 1.20.4 - dev: false + dev: true /string.prototype.trimstart/1.0.6: resolution: {integrity: sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==} @@ -4040,7 +4117,7 @@ packages: call-bind: 1.0.2 define-properties: 1.1.4 es-abstract: 1.20.4 - dev: false + dev: true /string_decoder/1.1.1: resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==} @@ -4053,11 +4130,12 @@ packages: engines: {node: '>=8'} dependencies: ansi-regex: 5.0.1 + dev: true /strip-bom/3.0.0: resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} engines: {node: '>=4'} - dev: false + dev: true /strip-bom/4.0.0: resolution: {integrity: sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==} @@ -4074,7 +4152,7 @@ packages: engines: {node: '>=8'} dependencies: min-indent: 1.0.1 - dev: false + dev: true /strip-json-comments/3.1.1: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} @@ -4099,12 +4177,14 @@ packages: engines: {node: '>=4'} dependencies: has-flag: 3.0.0 + dev: true /supports-color/7.2.0: resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} engines: {node: '>=8'} dependencies: has-flag: 4.0.0 + dev: true /supports-color/8.1.1: resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==} @@ -4116,11 +4196,12 @@ packages: /supports-preserve-symlinks-flag/1.0.0: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} + dev: true /term-size/2.2.1: resolution: {integrity: sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg==} engines: {node: '>=8'} - dev: false + dev: true /test-exclude/6.0.0: resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==} @@ -4149,7 +4230,7 @@ packages: engines: {node: '>=0.6.0'} dependencies: os-tmpdir: 1.0.2 - dev: false + dev: true /tmpl/1.0.5: resolution: {integrity: sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==} @@ -4165,6 +4246,7 @@ packages: engines: {node: '>=8.0'} dependencies: is-number: 7.0.0 + dev: true /toidentifier/1.0.1: resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==} @@ -4185,7 +4267,7 @@ packages: /trim-newlines/3.0.1: resolution: {integrity: sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==} engines: {node: '>=8'} - dev: false + dev: true /ts-interface-checker/0.1.13: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} @@ -4304,7 +4386,7 @@ packages: strip-ansi: 6.0.1 wcwidth: 1.0.1 yargs: 17.6.2 - dev: false + dev: true /turbo-darwin-64/1.6.3: resolution: {integrity: sha512-QmDIX0Yh1wYQl0bUS0gGWwNxpJwrzZU2GIAYt3aOKoirWA2ecnyb3R6ludcS1znfNV2MfunP+l8E3ncxUHwtjA==} @@ -4375,7 +4457,7 @@ packages: /type-fest/0.13.1: resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} engines: {node: '>=10'} - dev: false + dev: true /type-fest/0.21.3: resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} @@ -4385,12 +4467,12 @@ packages: /type-fest/0.6.0: resolution: {integrity: sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==} engines: {node: '>=8'} - dev: false + dev: true /type-fest/0.8.1: resolution: {integrity: sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==} engines: {node: '>=8'} - dev: false + dev: true /type-is/1.6.18: resolution: {integrity: sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==} @@ -4417,12 +4499,12 @@ packages: has-bigints: 1.0.2 has-symbols: 1.0.3 which-boxed-primitive: 1.0.2 - dev: false + dev: true /universalify/0.1.2: resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} engines: {node: '>= 4.0.0'} - dev: false + dev: true /unpipe/1.0.0: resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} @@ -4467,7 +4549,7 @@ packages: dependencies: spdx-correct: 3.1.1 spdx-expression-parse: 3.0.1 - dev: false + dev: true /vary/1.1.2: resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} @@ -4484,7 +4566,7 @@ packages: resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} dependencies: defaults: 1.0.4 - dev: false + dev: true /webidl-conversions/4.0.2: resolution: {integrity: sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==} @@ -4506,11 +4588,11 @@ packages: is-number-object: 1.0.7 is-string: 1.0.7 is-symbol: 1.0.4 - dev: false + dev: true /which-module/2.0.0: resolution: {integrity: sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==} - dev: false + dev: true /which-pm/2.0.0: resolution: {integrity: sha512-Lhs9Pmyph0p5n5Z3mVnN0yWcbQYUAD7rbQUiMsQxOJ3T57k7RFe35SUwWMf7dsbDZks1uOmw4AecB/JMDj3v/w==} @@ -4518,14 +4600,14 @@ packages: dependencies: load-yaml-file: 0.2.0 path-exists: 4.0.0 - dev: false + dev: true /which/1.3.1: resolution: {integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==} hasBin: true dependencies: isexe: 2.0.0 - dev: false + dev: true /which/2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} @@ -4542,7 +4624,7 @@ packages: ansi-styles: 4.3.0 string-width: 4.2.3 strip-ansi: 6.0.1 - dev: false + dev: true /wrap-ansi/7.0.0: resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} @@ -4551,6 +4633,7 @@ packages: ansi-styles: 4.3.0 string-width: 4.2.3 strip-ansi: 6.0.1 + dev: true /wrappy/1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} @@ -4571,15 +4654,16 @@ packages: /y18n/4.0.3: resolution: {integrity: sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==} - dev: false + dev: true /y18n/5.0.8: resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} engines: {node: '>=10'} + dev: true /yallist/2.1.2: resolution: {integrity: sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==} - dev: false + dev: true /yallist/4.0.0: resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} @@ -4596,11 +4680,12 @@ packages: dependencies: camelcase: 5.3.1 decamelize: 1.2.0 - dev: false + dev: true /yargs-parser/21.1.1: resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} engines: {node: '>=12'} + dev: true /yargs/15.4.1: resolution: {integrity: sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==} @@ -4617,7 +4702,7 @@ packages: which-module: 2.0.0 y18n: 4.0.3 yargs-parser: 18.1.3 - dev: false + dev: true /yargs/17.6.2: resolution: {integrity: sha512-1/9UrdHjDZc0eOU0HxOHoS78C69UD3JRMvzlJ7S79S2nTaWRA/whGCTV8o9e/N/1Va9YIV7Q4sOxD8VV4pCWOw==} @@ -4630,6 +4715,7 @@ packages: string-width: 4.2.3 y18n: 5.0.8 yargs-parser: 21.1.1 + dev: true /yn/3.1.1: resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} @@ -4639,6 +4725,7 @@ packages: /yocto-queue/0.1.0: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} + dev: true /zod/3.19.1: resolution: {integrity: sha512-LYjZsEDhCdYET9ikFu6dVPGp2YH9DegXjdJToSzD9rO6fy4qiRYFoyEYwps88OseJlPyl2NOe2iJuhEhL7IpEA==} From 260a9ce7ed06a84c7171c06b630bab75545483da Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Thu, 17 Nov 2022 21:28:17 +0100 Subject: [PATCH 031/206] docs(changeset): add fetch implementation --- .changeset/beige-horses-deny.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/beige-horses-deny.md diff --git a/.changeset/beige-horses-deny.md b/.changeset/beige-horses-deny.md new file mode 100644 index 00000000..f6b0abce --- /dev/null +++ b/.changeset/beige-horses-deny.md @@ -0,0 +1,5 @@ +--- +"@zodios/core": patch +--- + +add fetch implementation From f1cccb5844d12886de6f045227bfe8b52a3bcaab Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Thu, 17 Nov 2022 21:34:48 +0100 Subject: [PATCH 032/206] refactor(fetcher): move fetchers to their own directory --- packages/core/examples/io-ts-types.ts | 2 +- .../{ => axios-provider}/fetcher-provider.axios.ts | 8 ++++---- .../{fetcher-provider.fetch => fetch-provider}/fetch.ts | 0 .../fetch.types.ts | 0 .../fetch.utils.ts | 0 .../fetcher-provider.fetch.ts | 0 .../core/src/fetcher-providers/fetch-provider/index.ts | 1 + packages/core/src/fetcher-providers/index.ts | 3 ++- 8 files changed, 8 insertions(+), 6 deletions(-) rename packages/core/src/fetcher-providers/{ => axios-provider}/fetcher-provider.axios.ts (88%) rename packages/core/src/fetcher-providers/{fetcher-provider.fetch => fetch-provider}/fetch.ts (100%) rename packages/core/src/fetcher-providers/{fetcher-provider.fetch => fetch-provider}/fetch.types.ts (100%) rename packages/core/src/fetcher-providers/{fetcher-provider.fetch => fetch-provider}/fetch.utils.ts (100%) rename packages/core/src/fetcher-providers/{fetcher-provider.fetch => fetch-provider}/fetcher-provider.fetch.ts (100%) create mode 100644 packages/core/src/fetcher-providers/fetch-provider/index.ts diff --git a/packages/core/examples/io-ts-types.ts b/packages/core/examples/io-ts-types.ts index ff490f4b..3f2736cd 100644 --- a/packages/core/examples/io-ts-types.ts +++ b/packages/core/examples/io-ts-types.ts @@ -6,7 +6,7 @@ import { ioTsTypeProvider, } from "../src/index"; import * as t from "io-ts"; -import { fetchProvider } from "../src/fetcher-providers/fetcher-provider.fetch/fetcher-provider.fetch"; +import { fetchProvider } from "../src/fetcher-providers"; import { FetcherProviderOf } from "../src/zodios"; // you can define schema before declaring the API to get back the type diff --git a/packages/core/src/fetcher-providers/fetcher-provider.axios.ts b/packages/core/src/fetcher-providers/axios-provider/fetcher-provider.axios.ts similarity index 88% rename from packages/core/src/fetcher-providers/fetcher-provider.axios.ts rename to packages/core/src/fetcher-providers/axios-provider/fetcher-provider.axios.ts index 084ebb33..36817124 100644 --- a/packages/core/src/fetcher-providers/fetcher-provider.axios.ts +++ b/packages/core/src/fetcher-providers/axios-provider/fetcher-provider.axios.ts @@ -7,10 +7,10 @@ import axios, { import { AnyZodiosFetcherProvider, ZodiosRuntimeFetcherProvider, -} from "./fetcher-provider.types"; -import { Merge } from "../utils.types"; -import { omit, replacePathParams } from "../utils"; -import { AnyZodiosRequestOptions } from "../zodios.types"; +} from "../fetcher-provider.types"; +import { Merge } from "../../utils.types"; +import { omit, replacePathParams } from "../../utils"; +import { AnyZodiosRequestOptions } from "../../zodios.types"; type AxiosErrorStatus = Merge< Omit, diff --git a/packages/core/src/fetcher-providers/fetcher-provider.fetch/fetch.ts b/packages/core/src/fetcher-providers/fetch-provider/fetch.ts similarity index 100% rename from packages/core/src/fetcher-providers/fetcher-provider.fetch/fetch.ts rename to packages/core/src/fetcher-providers/fetch-provider/fetch.ts diff --git a/packages/core/src/fetcher-providers/fetcher-provider.fetch/fetch.types.ts b/packages/core/src/fetcher-providers/fetch-provider/fetch.types.ts similarity index 100% rename from packages/core/src/fetcher-providers/fetcher-provider.fetch/fetch.types.ts rename to packages/core/src/fetcher-providers/fetch-provider/fetch.types.ts diff --git a/packages/core/src/fetcher-providers/fetcher-provider.fetch/fetch.utils.ts b/packages/core/src/fetcher-providers/fetch-provider/fetch.utils.ts similarity index 100% rename from packages/core/src/fetcher-providers/fetcher-provider.fetch/fetch.utils.ts rename to packages/core/src/fetcher-providers/fetch-provider/fetch.utils.ts diff --git a/packages/core/src/fetcher-providers/fetcher-provider.fetch/fetcher-provider.fetch.ts b/packages/core/src/fetcher-providers/fetch-provider/fetcher-provider.fetch.ts similarity index 100% rename from packages/core/src/fetcher-providers/fetcher-provider.fetch/fetcher-provider.fetch.ts rename to packages/core/src/fetcher-providers/fetch-provider/fetcher-provider.fetch.ts diff --git a/packages/core/src/fetcher-providers/fetch-provider/index.ts b/packages/core/src/fetcher-providers/fetch-provider/index.ts new file mode 100644 index 00000000..67bc2279 --- /dev/null +++ b/packages/core/src/fetcher-providers/fetch-provider/index.ts @@ -0,0 +1 @@ +export * from "./fetcher-provider.fetch"; diff --git a/packages/core/src/fetcher-providers/index.ts b/packages/core/src/fetcher-providers/index.ts index 550256d3..8f823752 100644 --- a/packages/core/src/fetcher-providers/index.ts +++ b/packages/core/src/fetcher-providers/index.ts @@ -1,2 +1,3 @@ export * from "./fetcher-provider.types"; -export * from "./fetcher-provider.axios"; +export * from "./axios-provider/fetcher-provider.axios"; +export * from "./fetch-provider"; From 75623622b4545108d4ae7838d52efea9f3db88ac Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sat, 19 Nov 2022 01:04:48 +0100 Subject: [PATCH 033/206] feat(fetcher): body is now part of config BREAKING CHANGE --- .../axios-provider/fetcher-provider.axios.ts | 3 +- .../fetcher-providers/fetch-provider/fetch.ts | 19 ++++--- packages/core/src/plugins/form-data.plugin.ts | 6 +-- packages/core/src/plugins/form-url.plugin.ts | 4 +- .../src/plugins/zod-validation.plugin.test.ts | 16 +++--- .../core/src/plugins/zod-validation.plugin.ts | 7 +-- packages/core/src/zodios.test.ts | 53 ++++++++++++------- packages/core/src/zodios.ts | 47 +++------------- packages/core/src/zodios.types.ts | 28 +++++----- 9 files changed, 84 insertions(+), 99 deletions(-) diff --git a/packages/core/src/fetcher-providers/axios-provider/fetcher-provider.axios.ts b/packages/core/src/fetcher-providers/axios-provider/fetcher-provider.axios.ts index 36817124..17dd733f 100644 --- a/packages/core/src/fetcher-providers/axios-provider/fetcher-provider.axios.ts +++ b/packages/core/src/fetcher-providers/axios-provider/fetcher-provider.axios.ts @@ -56,9 +56,10 @@ export const axiosProvider: ZodiosRuntimeFetcherProvider & { }, fetch(config: AnyZodiosRequestOptions) { const requestConfig: AxiosRequestConfig = { - ...omit(config, ["params", "queries"]), + ...omit(config, ["params", "queries", "body"]), url: replacePathParams(config), params: config.queries, + data: config.body, }; return this.instance.request(requestConfig); }, diff --git a/packages/core/src/fetcher-providers/fetch-provider/fetch.ts b/packages/core/src/fetcher-providers/fetch-provider/fetch.ts index 19533962..d3e4d503 100644 --- a/packages/core/src/fetcher-providers/fetch-provider/fetch.ts +++ b/packages/core/src/fetcher-providers/fetch-provider/fetch.ts @@ -49,11 +49,14 @@ export const advancedFetch = async ( function createFetchRequest(config: AnyZodiosRequestOptions) { const headers = new Headers(config.headers); - if ( - (isFormData(config.body) || isBlob(config.body) || isFile(config.body)) && - headers.get("Content-Type") - ) { - headers.delete("Content-Type"); + if (isFormData(config.body) || isBlob(config.body) || isFile(config.body)) { + if (headers.has("Content-Type")) { + headers.delete("Content-Type"); + } + } else if (typeof config.body === "object") { + headers.set("Content-Type", "application/json"); + headers.set("Accept", "application/json"); + config.body = JSON.stringify(config.body); } if (config.auth) { @@ -72,7 +75,11 @@ function createFetchRequest(config: AnyZodiosRequestOptions) { } const url = buildURL(config); - return new Request(url, { ...config, headers }); + return new Request(url, { + ...config, + method: config.method.toUpperCase(), + headers, + }); } async function fetchRequest(request: Request, config: FetchProviderConfig) { diff --git a/packages/core/src/plugins/form-data.plugin.ts b/packages/core/src/plugins/form-data.plugin.ts index 0dc7406e..196e2fab 100644 --- a/packages/core/src/plugins/form-data.plugin.ts +++ b/packages/core/src/plugins/form-data.plugin.ts @@ -39,16 +39,16 @@ export function formDataPlugin< return { name: "form-data", request: async (_, config) => { - if (typeof config.data !== "object" || Array.isArray(config.data)) { + if (typeof config.body !== "object" || Array.isArray(config.body)) { throw new ZodiosError( "Zodios: multipart/form-data body must be an object", config ); } - const result = getFormDataStream(config.data); + const result = getFormDataStream(config.body); return { ...config, - data: result.data, + body: result.data, headers: { ...config.headers, ...result.headers, diff --git a/packages/core/src/plugins/form-url.plugin.ts b/packages/core/src/plugins/form-url.plugin.ts index 1d4625aa..d6a14f3f 100644 --- a/packages/core/src/plugins/form-url.plugin.ts +++ b/packages/core/src/plugins/form-url.plugin.ts @@ -39,7 +39,7 @@ export function formURLPlugin< return { name: "form-url", request: async (_, config) => { - if (typeof config.data !== "object" || Array.isArray(config.data)) { + if (typeof config.body !== "object" || Array.isArray(config.body)) { throw new ZodiosError( "Zodios: application/x-www-form-urlencoded body must be an object", config @@ -48,7 +48,7 @@ export function formURLPlugin< return { ...config, - data: new URLSearchParams(config.data).toString(), + body: new URLSearchParams(config.body).toString(), headers: { ...config.headers, "Content-Type": "application/x-www-form-urlencoded", diff --git a/packages/core/src/plugins/zod-validation.plugin.test.ts b/packages/core/src/plugins/zod-validation.plugin.test.ts index 43d0197c..a0ddfb31 100644 --- a/packages/core/src/plugins/zod-validation.plugin.test.ts +++ b/packages/core/src/plugins/zod-validation.plugin.test.ts @@ -44,7 +44,7 @@ describe("zodValidationPlugin", () => { createSampleConfig("/parse") ); - expect(transformed.data).toBe("123"); + expect(transformed.body).toBe("123"); expect(transformed.queries).toStrictEqual({ sampleQueryParam: "456", }); @@ -59,7 +59,7 @@ describe("zodValidationPlugin", () => { createSampleConfig("/transform") ); - expect(transformed.data).toBe("123_transformed"); + expect(transformed.body).toBe("123_transformed"); expect(transformed.queries).toStrictEqual({ sampleQueryParam: "456_transformed", }); @@ -74,7 +74,7 @@ describe("zodValidationPlugin", () => { createEmptySampleConfig("/transform") ); - expect(transformed.data).toBe("_transformed"); + expect(transformed.body).toBe("_transformed"); expect(transformed.queries).toStrictEqual({ sampleQueryParam: "_transformed", }); @@ -103,7 +103,7 @@ describe("zodValidationPlugin", () => { createSampleConfig("/transform") ); - expect(notTransformed.data).toBe("123"); + expect(notTransformed.body).toBe("123"); expect(notTransformed.queries).toStrictEqual({ sampleQueryParam: "456", }); @@ -118,7 +118,7 @@ describe("zodValidationPlugin", () => { createSampleConfig("/transformAsync") ); - expect(transformed.data).toBe("123_transformed"); + expect(transformed.body).toBe("123_transformed"); expect(transformed.queries).toStrictEqual({ sampleQueryParam: "456_transformed", }); @@ -133,7 +133,7 @@ describe("zodValidationPlugin", () => { createSampleConfig("/transformAsync") ); - expect(notTransformed.data).toBe("123"); + expect(notTransformed.body).toBe("123"); expect(notTransformed.queries).toStrictEqual({ sampleQueryParam: "456", }); @@ -271,7 +271,7 @@ received: ): AnyZodiosRequestOptions => ({ method: "post", url, - data: "123", + body: "123", queries: { sampleQueryParam: "456", }, @@ -285,7 +285,7 @@ received: ): AnyZodiosRequestOptions => ({ method: "post", url, - data: "", + body: "", queries: { sampleQueryParam: "", }, diff --git a/packages/core/src/plugins/zod-validation.plugin.ts b/packages/core/src/plugins/zod-validation.plugin.ts index 6251afdb..3882052d 100644 --- a/packages/core/src/plugins/zod-validation.plugin.ts +++ b/packages/core/src/plugins/zod-validation.plugin.ts @@ -35,7 +35,7 @@ export function zodValidationPlugin< transform, sendDefaults, typeProvider, -}: Options): ZodiosPlugin { +}: Options): ZodiosPlugin { return { name: "zod-validation", request: shouldRequest(validate) @@ -61,16 +61,17 @@ export function zodValidationPlugin< params: { ...config.params, }, + body: config.body, }; const paramsOf = { Query: (name: string) => conf.queries?.[name], - Body: (_: string) => conf.data, + Body: (_: string) => conf.body, Header: (name: string) => conf.headers?.[name], Path: (name: string) => conf.params?.[name], }; const setParamsOf = { Query: (name: string, value: any) => (conf.queries![name] = value), - Body: (_: string, value: any) => (conf.data = value), + Body: (_: string, value: any) => (conf.body = value), Header: (name: string, value: any) => (conf.headers![name] = value), Path: (name: string, value: any) => (conf.params![name] = value), }; diff --git a/packages/core/src/zodios.test.ts b/packages/core/src/zodios.test.ts index 5a720f0a..5e3f30c9 100644 --- a/packages/core/src/zodios.test.ts +++ b/packages/core/src/zodios.test.ts @@ -2,7 +2,9 @@ import { AxiosError } from "axios"; import express from "express"; import { AddressInfo } from "net"; import { z, ZodError } from "zod"; +//if (globalThis.FormData === undefined) { globalThis.FormData = require("form-data"); +//} import { Zodios } from "./zodios"; import { ZodiosError } from "./zodios-error"; import multer from "multer"; @@ -461,7 +463,7 @@ describe("Zodios", () => { }), }, ]); - const response = await zodios.post("/", { name: "post" }); + const response = await zodios.post("/", { body: { name: "post" } }); expect(response).toEqual({ id: 3, name: "post" }); }); @@ -493,13 +495,13 @@ describe("Zodios", () => { const config = { method: "post", url: "/", - data: { firstname: "post", lastname: "test" }, + body: { firstname: "post", lastname: "test" }, } as const; const response = await zodios.request(config); expect(config).toEqual({ method: "post", url: "/", - data: { firstname: "post", lastname: "test" }, + body: { firstname: "post", lastname: "test" }, }); expect(response).toEqual({ id: 3, name: "post test" }); }); @@ -532,7 +534,9 @@ describe("Zodios", () => { let error: ZodiosError | undefined; try { response = await zodios.post("/", { - email: "post", + body: { + email: "post", + }, }); } catch (err) { error = err as ZodiosError; @@ -564,7 +568,7 @@ describe("Zodios", () => { }), }, ]); - const response = await zodios.create({ name: "post" }); + const response = await zodios.create({ body: { name: "post" } }); expect(response).toEqual({ id: 3, name: "post" }); }); @@ -589,7 +593,7 @@ describe("Zodios", () => { }), }, ]); - const response = await zodios.put("/", { id: 5, name: "put" }); + const response = await zodios.put("/", { body: { id: 5, name: "put" } }); expect(response).toEqual({ id: 5, name: "put" }); }); @@ -615,7 +619,7 @@ describe("Zodios", () => { }), }, ]); - const response = await zodios.update({ id: 5, name: "put" }); + const response = await zodios.update({ body: { id: 5, name: "put" } }); expect(response).toEqual({ id: 5, name: "put" }); }); @@ -640,7 +644,9 @@ describe("Zodios", () => { }), }, ]); - const response = await zodios.patch("/", { id: 4, name: "patch" }); + const response = await zodios.patch("/", { + body: { id: 4, name: "patch" }, + }); expect(response).toEqual({ id: 4, name: "patch" }); }); @@ -666,7 +672,7 @@ describe("Zodios", () => { }), }, ]); - const response = await zodios.update({ id: 4, name: "patch" }); + const response = await zodios.update({ body: { id: 4, name: "patch" } }); expect(response).toEqual({ id: 4, name: "patch" }); }); @@ -680,7 +686,7 @@ describe("Zodios", () => { }), }, ]); - const response = await zodios.delete("/:id", undefined, { + const response = await zodios.delete("/:id", { params: { id: 6 }, }); expect(response).toEqual({ id: 6 }); @@ -697,7 +703,7 @@ describe("Zodios", () => { }), }, ]); - const response = await zodios.remove(undefined, { + const response = await zodios.remove({ params: { id: 6 }, }); expect(response).toEqual({ id: 6 }); @@ -878,7 +884,7 @@ received: } catch (e) { error = e; } - expect(error).toBeInstanceOf(AxiosError); + expect(error).toBeInstanceOf(Error); expect((error as AxiosError).response?.status).toBe(502); if (isErrorFromPath(zodios.api, "get", "/error502", error)) { expect(error.response.status).toBe(502); @@ -1092,7 +1098,7 @@ received: error = e; } - expect(error).toBeInstanceOf(AxiosError); + expect(error).toBeInstanceOf(Error); expect((error as AxiosError).response?.status).toBe(502); expect(isErrorFromPath(zodios.api, "get", "/error502", error)).toBe(false); expect(isErrorFromAlias(zodios.api, "getError502", error)).toBe(false); @@ -1165,7 +1171,9 @@ received: }), }, ]); - const response = await zodios.post("/form-data", { id: 4, name: "post" }); + const response = await zodios.post("/form-data", { + body: { id: 4, name: "post" }, + }); expect(response).toEqual({ id: "4", name: "post" }); }); @@ -1180,7 +1188,7 @@ received: name: "body", type: "Body", schema: z.object({ - id: z.number(), + id: z.string(), name: z.string(), }), }, @@ -1191,7 +1199,10 @@ received: }), }, ]); - const response = await zodios.post("/form-data", { id: 4, name: "post" }); + const response = await zodios.post("/form-data", { + // @ts-ignore + body: { id: "4", name: "post" }, + }); expect(response).toEqual({ id: "4", name: "post" }); }, 100); @@ -1214,7 +1225,7 @@ received: let error: Error | undefined; let response: string | undefined; try { - response = await zodios.post("/form-data", ["test", "test2"]); + response = await zodios.post("/form-data", { body: ["test", "test2"] }); } catch (err) { error = err as Error; } @@ -1247,7 +1258,9 @@ received: }), }, ]); - const response = await zodios.post("/form-url", { id: 4, name: "post" }); + const response = await zodios.post("/form-url", { + body: { id: 4, name: "post" }, + }); expect(response).toEqual({ id: "4", name: "post" }); }); @@ -1270,7 +1283,7 @@ received: let error: Error | undefined; let response: string | undefined; try { - response = await zodios.post("/form-url", ["test", "test2"]); + response = await zodios.post("/form-url", { body: ["test", "test2"] }); } catch (err) { error = err as Error; } @@ -1297,7 +1310,7 @@ received: response: z.string(), }, ]); - const response = await zodios.post("/text", "test"); + const response = await zodios.post("/text", { body: "test" }); expect(response).toEqual("test"); }); }); diff --git a/packages/core/src/zodios.ts b/packages/core/src/zodios.ts index bf38f560..4f25def6 100644 --- a/packages/core/src/zodios.ts +++ b/packages/core/src/zodios.ts @@ -12,7 +12,6 @@ import type { ZodiosPlugin, Aliases, } from "./zodios.types"; -import { omit, replacePathParams } from "./utils"; import { PluginId, ZodiosPlugins, @@ -35,6 +34,7 @@ import { AnyZodiosFetcherProvider, axiosProvider, AxiosProvider, + fetchProvider, TypeOfFetcherOptions, } from "./fetcher-providers"; @@ -155,7 +155,6 @@ export class ZodiosClass< this.injectAliasEndpoints(); this.initPlugins(); if ([true, "all", "request", "response"].includes(this.options.validate)) { - // @ts-expect-error this.use(zodValidationPlugin(this.options)); } } @@ -268,22 +267,12 @@ export class ZodiosClass< private injectAliasEndpoints() { this.api.forEach((endpoint) => { if (endpoint.alias) { - if (["post", "put", "patch", "delete"].includes(endpoint.method)) { - (this as any)[endpoint.alias] = (data: any, config: any) => - this.request({ - ...config, - method: endpoint.method, - url: endpoint.path, - data, - }); - } else { - (this as any)[endpoint.alias] = (config: any) => - this.request({ - ...config, - method: endpoint.method, - url: endpoint.path, - }); - } + (this as any)[endpoint.alias] = (config: any) => + this.request({ + ...config, + method: endpoint.method, + url: endpoint.path, + }); } }); } @@ -357,9 +346,6 @@ export class ZodiosClass< */ async post< Path extends ZodiosPathsByMethod, - TBody extends ReadonlyDeep< - UndefinedIfNever> - >, TConfig extends ZodiosRequestOptionsByPath< Api, "post", @@ -370,7 +356,6 @@ export class ZodiosClass< > >( path: Path, - data: TBody, ...[config]: RequiredKeys extends never ? [config?: ReadonlyDeep] : [config: ReadonlyDeep] @@ -379,7 +364,6 @@ export class ZodiosClass< ...config, method: "post", url: path, - data, }); } @@ -392,9 +376,6 @@ export class ZodiosClass< */ async put< Path extends ZodiosPathsByMethod, - TBody extends ReadonlyDeep< - UndefinedIfNever> - >, TConfig extends ZodiosRequestOptionsByPath< Api, "put", @@ -405,7 +386,6 @@ export class ZodiosClass< > >( path: Path, - data: TBody, ...[config]: RequiredKeys extends never ? [config?: ReadonlyDeep] : [config: ReadonlyDeep] @@ -414,7 +394,6 @@ export class ZodiosClass< ...config, method: "put", url: path, - data, }); } @@ -427,9 +406,6 @@ export class ZodiosClass< */ async patch< Path extends ZodiosPathsByMethod, - TBody extends ReadonlyDeep< - UndefinedIfNever> - >, TConfig extends ZodiosRequestOptionsByPath< Api, "patch", @@ -440,7 +416,6 @@ export class ZodiosClass< > >( path: Path, - data: TBody, ...[config]: RequiredKeys extends never ? [config?: ReadonlyDeep] : [config: ReadonlyDeep] @@ -449,7 +424,6 @@ export class ZodiosClass< ...config, method: "patch", url: path, - data, }); } @@ -461,11 +435,6 @@ export class ZodiosClass< */ async delete< Path extends ZodiosPathsByMethod, - TBody extends ReadonlyDeep< - UndefinedIfNever< - ZodiosBodyByPath - > - >, TConfig extends ZodiosRequestOptionsByPath< Api, "delete", @@ -476,7 +445,6 @@ export class ZodiosClass< > >( path: Path, - data: TBody, ...[config]: RequiredKeys extends never ? [config?: ReadonlyDeep] : [config: ReadonlyDeep] @@ -485,7 +453,6 @@ export class ZodiosClass< ...config, method: "delete", url: path, - data, }); } } diff --git a/packages/core/src/zodios.types.ts b/packages/core/src/zodios.types.ts index 30910f6b..4fd08d0a 100644 --- a/packages/core/src/zodios.types.ts +++ b/packages/core/src/zodios.types.ts @@ -542,26 +542,21 @@ export type ZodiosRequestOptionsByAlias< TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider > = Merge< + TypeOfFetcherConfig, TransitiveOptional< PickDefined<{ params: ZodiosPathParamByAlias; queries: ZodiosQueryParamsByAlias; headers: ZodiosHeaderParamsByAlias; + body: ZodiosBodyByAlias; }> - >, - TypeOfFetcherConfig + > >; -export type ZodiosMutationAliasRequest = +export type ZodiosMutationAliasRequest = RequiredKeys extends never - ? ( - body: ReadonlyDeep>, - configOptions?: ReadonlyDeep - ) => Promise - : ( - body: ReadonlyDeep>, - configOptions: ReadonlyDeep - ) => Promise; + ? (configOptions?: ReadonlyDeep) => Promise + : (configOptions: ReadonlyDeep) => Promise; export type ZodiosAliasRequest = RequiredKeys extends never @@ -579,7 +574,6 @@ export type ZodiosAliases< Alias >[number]["method"] extends MutationMethod ? ZodiosMutationAliasRequest< - ZodiosBodyByAlias, ZodiosRequestOptionsByAlias< Api, Alias, @@ -604,12 +598,13 @@ export type ZodiosAliases< export type AnyZodiosMethodOptions< FetcherProvider extends AnyZodiosFetcherProvider > = Merge< + TypeOfFetcherConfig, { params?: Record; queries?: Record; headers?: Record; - }, - TypeOfFetcherConfig + body?: unknown; + } >; export type AnyZodiosRequestOptions< @@ -630,14 +625,15 @@ export type ZodiosRequestOptionsByPath< TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider > = Merge< + TypeOfFetcherConfig, TransitiveOptional< PickDefined<{ params: ZodiosPathParamsByPath; queries: ZodiosQueryParamsByPath; headers: ZodiosHeaderParamsByPath; + body: ZodiosBodyByPath; }> - >, - TypeOfFetcherConfig + > >; export type ZodiosRequestOptions< From eb82d3b03c1d111a17a1852b921695b167feb82b Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sat, 19 Nov 2022 01:05:36 +0100 Subject: [PATCH 034/206] docs(changeset): body is now part of the config --- .changeset/wet-rocks-sniff.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/wet-rocks-sniff.md diff --git a/.changeset/wet-rocks-sniff.md b/.changeset/wet-rocks-sniff.md new file mode 100644 index 00000000..e7cc6601 --- /dev/null +++ b/.changeset/wet-rocks-sniff.md @@ -0,0 +1,5 @@ +--- +"@zodios/core": patch +--- + +body is now part of the config From b41c07d6e0a61f3395bcb5c5817cafd57fb208ef Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sat, 19 Nov 2022 15:37:21 +0100 Subject: [PATCH 035/206] chore(axios): clone core to axios directory --- packages/axios/.gitignore | 105 ++ packages/axios/.npmignore | 40 + packages/axios/CHANGELOG.md | 20 + packages/axios/LICENSE | 21 + packages/axios/README.md | 198 +++ packages/axios/SECURITY.md | 20 + packages/axios/examples/define-types.ts | 59 + .../axios/examples/dev.to/api-key-plugin.ts | 19 + packages/axios/examples/dev.to/articles.ts | 167 +++ packages/axios/examples/dev.to/comments.ts | 61 + packages/axios/examples/dev.to/example.ts | 23 + packages/axios/examples/dev.to/followers.ts | 33 + packages/axios/examples/dev.to/follows.ts | 23 + packages/axios/examples/dev.to/params.ts | 16 + packages/axios/examples/dev.to/users.ts | 64 + packages/axios/examples/io-ts-types.ts | 80 ++ packages/axios/examples/jsonplaceholder.ts | 97 ++ .../axios/examples/types-from-definition.ts | 128 ++ packages/axios/examples/typescript-types.ts | 74 ++ packages/axios/jest.config.ts | 24 + packages/axios/package.json | 86 ++ .../axios-provider/fetcher-provider.axios.ts | 2 +- packages/axios/src/fetcher-providers/index.ts | 1 + packages/axios/src/index.ts | 75 ++ packages/axios/src/utils.test.ts | 68 + packages/axios/src/utils.ts | 122 ++ packages/axios/src/utils.types.test.ts | 66 + packages/axios/src/utils.types.ts | 237 ++++ packages/axios/src/zodios-error.ts | 23 + .../{core => axios}/src/zodios-error.utils.ts | 0 packages/axios/src/zodios.test.ts | 1122 +++++++++++++++++ packages/axios/src/zodios.ts | 504 ++++++++ packages/axios/src/zodios.types.ts | 836 ++++++++++++ packages/axios/tsconfig.build.json | 17 + packages/axios/tsconfig.json | 18 + packages/axios/tsup.config.js | 14 + 36 files changed, 4462 insertions(+), 1 deletion(-) create mode 100644 packages/axios/.gitignore create mode 100644 packages/axios/.npmignore create mode 100644 packages/axios/CHANGELOG.md create mode 100644 packages/axios/LICENSE create mode 100644 packages/axios/README.md create mode 100644 packages/axios/SECURITY.md create mode 100644 packages/axios/examples/define-types.ts create mode 100644 packages/axios/examples/dev.to/api-key-plugin.ts create mode 100644 packages/axios/examples/dev.to/articles.ts create mode 100644 packages/axios/examples/dev.to/comments.ts create mode 100644 packages/axios/examples/dev.to/example.ts create mode 100644 packages/axios/examples/dev.to/followers.ts create mode 100644 packages/axios/examples/dev.to/follows.ts create mode 100644 packages/axios/examples/dev.to/params.ts create mode 100644 packages/axios/examples/dev.to/users.ts create mode 100644 packages/axios/examples/io-ts-types.ts create mode 100644 packages/axios/examples/jsonplaceholder.ts create mode 100644 packages/axios/examples/types-from-definition.ts create mode 100644 packages/axios/examples/typescript-types.ts create mode 100644 packages/axios/jest.config.ts create mode 100644 packages/axios/package.json rename packages/{core => axios}/src/fetcher-providers/axios-provider/fetcher-provider.axios.ts (98%) create mode 100644 packages/axios/src/fetcher-providers/index.ts create mode 100644 packages/axios/src/index.ts create mode 100644 packages/axios/src/utils.test.ts create mode 100644 packages/axios/src/utils.ts create mode 100644 packages/axios/src/utils.types.test.ts create mode 100644 packages/axios/src/utils.types.ts create mode 100644 packages/axios/src/zodios-error.ts rename packages/{core => axios}/src/zodios-error.utils.ts (100%) create mode 100644 packages/axios/src/zodios.test.ts create mode 100644 packages/axios/src/zodios.ts create mode 100644 packages/axios/src/zodios.types.ts create mode 100644 packages/axios/tsconfig.build.json create mode 100644 packages/axios/tsconfig.json create mode 100644 packages/axios/tsup.config.js diff --git a/packages/axios/.gitignore b/packages/axios/.gitignore new file mode 100644 index 00000000..9aadc156 --- /dev/null +++ b/packages/axios/.gitignore @@ -0,0 +1,105 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env +.env.test + +# parcel-bundler cache (https://parceljs.org/) +.cache + +# Next.js build output +.next + +# Nuxt.js build / generate output +.nuxt +dist +lib + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and *not* Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port diff --git a/packages/axios/.npmignore b/packages/axios/.npmignore new file mode 100644 index 00000000..e09f31c9 --- /dev/null +++ b/packages/axios/.npmignore @@ -0,0 +1,40 @@ +# compiled output +!/lib +/node_modules +/src +/examples +/website + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# OS +.DS_Store + +# Tests +/coverage +/.nyc_output + +# IDEs and editors +/.idea +.project +.classpath +.c9/ +*.launch +.settings/ +*.sublime-workspace + +# IDE - VSCode +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + +# ENV +.env diff --git a/packages/axios/CHANGELOG.md b/packages/axios/CHANGELOG.md new file mode 100644 index 00000000..673f2985 --- /dev/null +++ b/packages/axios/CHANGELOG.md @@ -0,0 +1,20 @@ +# @zodios/core + +## 11.0.0-beta.3 + +### Patch Changes + +- add publish script +- 5575e28: add tests for type providers + +## 11.0.0-beta.2 + +### Patch Changes + +- remove publish action from ci + +## 11.0.0-beta.1 + +### Patch Changes + +- migrate to monorepo diff --git a/packages/axios/LICENSE b/packages/axios/LICENSE new file mode 100644 index 00000000..e5dea986 --- /dev/null +++ b/packages/axios/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 ecyrbe + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/axios/README.md b/packages/axios/README.md new file mode 100644 index 00000000..31105cd4 --- /dev/null +++ b/packages/axios/README.md @@ -0,0 +1,198 @@ +

Zodios

+

+ + Zodios logo + +

+

+ Zodios is a typescript api client and an optional api server with auto-completion features backed by axios and zod and express +
+ Documentation +

+ +

+ + langue typescript + + + npm + + + GitHub + + GitHub Workflow Status +

+ +https://user-images.githubusercontent.com/633115/185851987-554f5686-cb78-4096-8ff5-c8d61b645608.mp4 + +# What is it ? + +It's an axios compatible API client and an optional expressJS compatible API server with the following features: + +- really simple centralized API declaration +- typescript autocompletion in your favorite IDE for URL and parameters +- typescript response types +- parameters and responses schema thanks to zod +- response schema validation +- powerfull plugins like `fetch` adapter or `auth` automatic injection +- all axios features available +- `@tanstack/query` wrappers for react and solid (vue, svelte, etc, soon) +- all expressJS features available (middlewares, etc.) + + +**Table of contents:** + +- [What is it ?](#what-is-it-) +- [Install](#install) + - [Client and api definitions :](#client-and-api-definitions-) + - [Server :](#server-) +- [How to use it on client side ?](#how-to-use-it-on-client-side-) + - [Declare your API with zodios](#declare-your-api-with-zodios) + - [API definition format](#api-definition-format) +- [Full documentation](#full-documentation) +- [Ecosystem](#ecosystem) +- [Roadmap](#roadmap) +- [Dependencies](#dependencies) + +# Install + +## Client and api definitions : + +```bash +> npm install @zodios/core +``` + +or + +```bash +> yarn add @zodios/core +``` + +## Server : + +```bash +> npm install @zodios/core @zodios/express +``` + +or + +```bash +> yarn add @zodios/core @zodios/express +``` + +# How to use it on client side ? + +For an almost complete example on how to use zodios and how to split your APIs declarations, take a look at [dev.to](examples/dev.to/) example. + +## Declare your API with zodios + +Here is an example of API declaration with Zodios. + +```typescript +import { Zodios } from "@zodios/core"; +import { z } from "zod"; + +const apiClient = new Zodios( + "https://jsonplaceholder.typicode.com", + // API definition + [ + { + method: "get", + path: "/users/:id", // auto detect :id and ask for it in apiClient get params + alias: "getUser", // optionnal alias to call this endpoint with it + description: "Get a user", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], +); +``` + +Calling this API is now easy and has builtin autocomplete features : + +```typescript +// typed auto-complete path auto-complete params +// â–¼ â–¼ â–¼ +const user = await apiClient.get("/users/:id", { params: { id: 7 } }); +console.log(user); +``` + +It should output + +```js +{ id: 7, name: 'Kurtis Weissnat' } +``` +You can also use aliases : + +```typescript +// typed alias auto-complete params +// â–¼ â–¼ â–¼ +const user = await apiClient.getUser({ params: { id: 7 } }); +console.log(user); +``` +## API definition format + +```typescript +type ZodiosEndpointDescriptions = Array<{ + method: 'get'|'post'|'put'|'patch'|'delete'; + path: string; // example: /posts/:postId/comments/:commentId + alias?: string; // example: getPostComments + immutable?: boolean; // flag a post request as immutable to allow it to be cached with react-query + description?: string; + requestFormat?: 'json'|'form-data'|'form-url'|'binary'|'text'; // default to json if not set + parameters?: Array<{ + name: string; + description?: string; + type: 'Path'|'Query'|'Body'|'Header'; + schema: ZodSchema; // you can use zod `transform` to transform the value of the parameter before sending it to the server + }>; + response: ZodSchema; // you can use zod `transform` to transform the value of the response before returning it + status?: number; // default to 200, you can use this to override the sucess status code of the response (only usefull for openapi and express) + responseDescription?: string; // optional response description of the endpoint + errors?: Array<{ + status: number | 'default'; + description?: string; + schema: ZodSchema; // transformations are not supported on error schemas + }>; +}>; +``` +# Full documentation + +Check out the [full documentation](https://www.zodios.org) or following shortcuts. + +- [API definition](https://www.zodios.org/docs/category/zodios-api-definition) +- [Http client](https://www.zodios.org/docs/category/zodios-client) +- [React hooks](https://www.zodios.org/docs/client/react) +- [Solid hooks](https://www.zodios.org/docs/client/solid) +- [API server](http://www.zodios.org/docs/category/zodios-server) +- [Nextjs integration](http://www.zodios.org/docs/server/next) + +# Ecosystem + +- [openapi-zod-client](https://github.com/astahmer/openapi-zod-client): generate a zodios client from an openapi specification +- [@zodios/express](https://github.com/ecyrbe/zodios-express): full end to end type safety like tRPC, but for REST APIs +- [@zodios/plugins](https://github.com/ecyrbe/zodios-plugins) : some plugins for zodios +- [@zodios/react](https://github.com/ecyrbe/zodios-react) : a react-query wrapper for zodios +- [@zodios/solid](https://github.com/ecyrbe/zodios-solid) : a solid-query wrapper for zodios + +# Roadmap + +The following will need investigation to check if it's doable : +- implement `@zodios/nestjs` to define your API endpoints with nestjs and share it with your frontend (like tRPC) +- generate openAPI json from your API endpoints + +You have other ideas ? [Let me know !](https://github.com/ecyrbe/zodios/discussions) +# Dependencies + +Zodios even when working in pure Javascript is better suited to be working with Typescript Language Server to handle autocompletion. +So you should at least use the one provided by your IDE (vscode integrates a typescript language server) +However, we will only support fixing bugs related to typings for versions of Typescript Language v4.5 +Earlier versions should work, but do not have TS tail recusion optimisation that impact the size of the API you can declare. + +Also note that Zodios do not embed any dependency. It's your Job to install the peer dependencies you need. + +Internally Zodios uses these libraries on all platforms : +- zod +- axios diff --git a/packages/axios/SECURITY.md b/packages/axios/SECURITY.md new file mode 100644 index 00000000..16be6051 --- /dev/null +++ b/packages/axios/SECURITY.md @@ -0,0 +1,20 @@ +# Security Policy + +## Supported Versions + +Use this section to tell people about which versions of your project are +currently being supported with security updates. + +| Version | Supported | +| --------- | ------------------ | +| 10.x.y | :white_check_mark: | +| < 10.0.0 | :x: | + +## Reporting a Vulnerability + +If you identify a vulnerability on zodios, please create an issue with a reproductible setup. +Do not open an issue if you can't show a reproductible setup of if the vulnerability is on third party dependency. + +Indeed, a vulnerability on a peer dependency should be reported on the appropriate project: +- zod +- axios diff --git a/packages/axios/examples/define-types.ts b/packages/axios/examples/define-types.ts new file mode 100644 index 00000000..dfcf6e1e --- /dev/null +++ b/packages/axios/examples/define-types.ts @@ -0,0 +1,59 @@ +import { Zodios, makeApi } from "../src/index"; +import { z } from "zod"; + +// you can define schema before declaring the API to get back the type +const userSchema = z + .object({ + id: z.number(), + name: z.string(), + }) + .required(); + +const usersSchema = z.array(userSchema); + +// you can then get back the types +type User = z.infer; +type Users = z.infer; + +// you can also predefine your API +const jsonplaceholderUrl = "https://jsonplaceholder.typicode.com"; +const jsonplaceholderApi = makeApi([ + { + method: "get", + path: "/users", + description: "Get all users", + parameters: [ + { + name: "q", + description: "full text search", + type: "Query", + schema: z.string(), + }, + { + name: "page", + description: "page number", + type: "Query", + schema: z.number().optional(), + }, + ], + response: usersSchema, + }, + { + method: "get", + path: "/users/:id", + description: "Get a user", + response: userSchema, + }, +]); + +// and then use them in your API +async function bootstrap() { + const apiClient = new Zodios(jsonplaceholderUrl, jsonplaceholderApi); + + const users = await apiClient.get("/users", { queries: { q: "Nicholas" } }); + console.log(users); + const user = await apiClient.get("/users/:id", { params: { id: 7 } }); + console.log(user); +} + +bootstrap(); diff --git a/packages/axios/examples/dev.to/api-key-plugin.ts b/packages/axios/examples/dev.to/api-key-plugin.ts new file mode 100644 index 00000000..ba768056 --- /dev/null +++ b/packages/axios/examples/dev.to/api-key-plugin.ts @@ -0,0 +1,19 @@ +import { ZodiosPlugin } from "../../src/index"; + +export interface ApiKeyPluginConfig { + getApiKey: () => Promise; +} + +export function pluginApiKey(provider: ApiKeyPluginConfig): ZodiosPlugin { + return { + request: async (_, config) => { + return { + ...config, + headers: { + ...config.headers, + "api-key": await provider.getApiKey(), + }, + }; + }, + }; +} diff --git a/packages/axios/examples/dev.to/articles.ts b/packages/axios/examples/dev.to/articles.ts new file mode 100644 index 00000000..96714c78 --- /dev/null +++ b/packages/axios/examples/dev.to/articles.ts @@ -0,0 +1,167 @@ +import { apiBuilder, makeApi } from "../../src/index"; +import { z } from "zod"; +import { devUser } from "./users"; +import { paramPages } from "./params"; + +const devArticle = z.object({ + id: z.number(), + type_of: z.string(), + title: z.string(), + description: z.string(), + cover_image: z.string().or(z.null()), + readable_publish_date: z.string().optional(), + social_image: z.string().optional(), + tag_list: z.array(z.string()).or(z.string()), + tags: z.array(z.string()).or(z.string()).optional(), + slug: z.string(), + path: z.string(), + url: z.string(), + canonical_url: z.string(), + comments_count: z.number(), + positive_reactions_count: z.number(), + public_reactions_count: z.number(), + collection_id: z.number().or(z.null()).optional(), + created_at: z.string().optional(), + edited_at: z.string().optional(), + crossposted_at: z.string().or(z.null()).optional(), + published_at: z.string().or(z.null()).optional(), + last_comment_at: z.string().optional(), + published_timestamp: z.string(), + reading_time_minutes: z.number(), + user: devUser.partial(), + read_time_minutes: z.number().optional(), + organization: z + .object({ + name: z.string(), + username: z.string(), + slug: z.string(), + profile_image: z.string(), + profile_image_90: z.string(), + }) + .optional(), + flare_tag: z + .object({ + name: z.string(), + bg_color_hex: z.string(), + text_color_hex: z.string(), + }) + .optional(), +}); + +const devArticles = z.array(devArticle); + +export type Article = z.infer; +export type Articles = z.infer; + +export const articlesApi = apiBuilder({ + method: "get", + path: "/articles", + alias: "getAllArticles", + description: "Get all articles", + parameters: [ + ...paramPages, + { + name: "tag", + description: "Filter by tag", + type: "Query", + schema: z.string().optional(), + }, + { + name: "tags", + description: "Filter by tags", + type: "Query", + schema: z.string().optional(), + }, + { + name: "tags_exclude", + description: "Exclude tags", + type: "Query", + schema: z.string().optional(), + }, + { + name: "username", + description: "Filter by username", + type: "Query", + schema: z.string().optional(), + }, + { + name: "state", + description: "Filter by state", + type: "Query", + schema: z.string().optional(), + }, + { + name: "top", + type: "Query", + schema: z.number().optional(), + }, + { + name: "collection_id", + type: "Query", + schema: z.number().optional(), + }, + ], + response: devArticles, +}) + .addEndpoint({ + method: "get", + path: "/articles/latest", + alias: "getLatestArticle", + description: "Get latest articles", + parameters: paramPages, + response: devArticles, + }) + .addEndpoint({ + method: "get", + path: "/articles/:id", + alias: "getArticle", + description: "Get an article by id", + response: devArticle, + }) + .addEndpoint({ + method: "put", + path: "/articles/:id", + alias: "updateArticle", + description: "Update an article", + response: devArticle, + }) + .addEndpoint({ + method: "get", + path: "/articles/:username/:slug", + alias: "getArticleByUsernameAndSlug", + description: "Get an article by username and slug", + response: devArticle, + }) + .addEndpoint({ + method: "get", + path: "/articles/me", + alias: "getMyArticles", + description: "Get current user's articles", + parameters: paramPages, + response: devArticles, + }) + .addEndpoint({ + method: "get", + path: "/articles/me/published", + alias: "getMyPublishedArticles", + description: "Get current user's published articles", + parameters: paramPages, + response: devArticles, + }) + .addEndpoint({ + method: "get", + path: "/articles/me/unpublished", + alias: "getMyUnpublishedArticles", + description: "Get current user's unpublished articles", + parameters: paramPages, + response: devArticles, + }) + .addEndpoint({ + method: "get", + path: "/articles/me/all", + alias: "getAllMyArticles", + description: "Get current user's all articles", + parameters: paramPages, + response: devArticles, + }) + .build(); diff --git a/packages/axios/examples/dev.to/comments.ts b/packages/axios/examples/dev.to/comments.ts new file mode 100644 index 00000000..7f749319 --- /dev/null +++ b/packages/axios/examples/dev.to/comments.ts @@ -0,0 +1,61 @@ +import { makeApi, makeEndpoint } from "../../src/index"; +import { z } from "zod"; +import { devUser, User } from "./users"; + +/** + * zod does not handle recusive well, so we need to manually define the schema + */ +export type Comment = { + type_of: string; + id_code: string; + created_at: string; + body_html: string; + user: User; + children: Comment[]; +}; + +export const devComment: z.ZodSchema = z.lazy(() => + z.object({ + type_of: z.string(), + id_code: z.string(), + created_at: z.string(), + body_html: z.string(), + user: devUser, + children: z.array(devComment), + }) +); +export const devComments = z.array(devComment); + +export type Comments = z.infer; + +const getAllComments = makeEndpoint({ + method: "get", + path: "/comments", + alias: "getAllComments", + description: "Get all comments", + parameters: [ + { + name: "a_id", + description: "Article ID", + type: "Query", + schema: z.number().optional(), + }, + { + name: "p_id", + description: "Podcast comment ID", + type: "Query", + schema: z.number().optional(), + }, + ], + response: devComments, +}); + +const getComment = makeEndpoint({ + method: "get", + path: "/comments/:id", + alias: "getComment", + description: "Get a comment", + response: devComment, +}); + +export const commentsApi = makeApi([getAllComments, getComment]); diff --git a/packages/axios/examples/dev.to/example.ts b/packages/axios/examples/dev.to/example.ts new file mode 100644 index 00000000..4d8ad015 --- /dev/null +++ b/packages/axios/examples/dev.to/example.ts @@ -0,0 +1,23 @@ +import { Zodios } from "../../src/index"; +import { articlesApi } from "./articles"; +import { commentsApi } from "./comments"; +import { followsApi } from "./follows"; +import { followersApi } from "./followers"; +import { userApi } from "./users"; +import { pluginApiKey } from "./api-key-plugin"; + +export const devTo = new Zodios("https://dev.to/api", [ + ...articlesApi, + ...commentsApi, + ...followsApi, + ...followersApi, + ...userApi, +]); + +devTo.use( + pluginApiKey({ + getApiKey: async () => "", + }) +); + +devTo.get("/articles/me/all").then(console.log); diff --git a/packages/axios/examples/dev.to/followers.ts b/packages/axios/examples/dev.to/followers.ts new file mode 100644 index 00000000..db9e7d5b --- /dev/null +++ b/packages/axios/examples/dev.to/followers.ts @@ -0,0 +1,33 @@ +import { z } from "zod"; +import { makeApi } from "../../src/index"; +import { paramPages } from "./params"; + +const devFollower = z.object({ + type_of: z.string(), + created_at: z.string(), + id: z.number(), + name: z.string(), + path: z.string(), + username: z.string(), + profile_image: z.string(), +}); + +const devFollowers = z.array(devFollower); + +export const followersApi = makeApi([ + { + method: "get", + path: "/followers/users", + alias: "getAllFollowers", + parameters: [ + ...paramPages, + { + name: "sort", + description: "Sort by. defaults to created_at", + type: "Query", + schema: z.string().optional(), + }, + ], + response: devFollowers, + }, +]); diff --git a/packages/axios/examples/dev.to/follows.ts b/packages/axios/examples/dev.to/follows.ts new file mode 100644 index 00000000..3aa7cae6 --- /dev/null +++ b/packages/axios/examples/dev.to/follows.ts @@ -0,0 +1,23 @@ +import { z } from "zod"; +import { makeApi } from "../../src/index"; + +export const devFollow = z.object({ + id: z.number(), + name: z.string(), + points: z.number(), +}); + +export const devFollows = z.array(devFollow); + +export type Follow = z.infer; +export type Follows = z.infer; + +export const followsApi = makeApi([ + { + method: "get", + path: "/follows/tags", + alias: "getAllFollowedTags", + description: "Get all followed tags", + response: devFollows, + }, +]); diff --git a/packages/axios/examples/dev.to/params.ts b/packages/axios/examples/dev.to/params.ts new file mode 100644 index 00000000..c07e5a80 --- /dev/null +++ b/packages/axios/examples/dev.to/params.ts @@ -0,0 +1,16 @@ +import { z } from "zod"; +import { makeParameters } from "../../src/api"; + +export const paramPages = makeParameters([ + { + name: "page", + type: "Query", + description: "Page number", + schema: z.number().optional(), + }, + { + name: "per_page", + type: "Query", + schema: z.number().optional(), + }, +]); diff --git a/packages/axios/examples/dev.to/users.ts b/packages/axios/examples/dev.to/users.ts new file mode 100644 index 00000000..1c74bc1b --- /dev/null +++ b/packages/axios/examples/dev.to/users.ts @@ -0,0 +1,64 @@ +import { z } from "zod"; +import { makeApi } from "../../src/index"; + +export const devUser = z.object({ + id: z.number(), + type_of: z.string(), + name: z.string(), + username: z.string(), + summary: z.string().or(z.null()), + twitter_username: z.string().or(z.null()), + github_username: z.string().or(z.null()), + website_url: z.string().or(z.null()), + location: z.string().or(z.null()), + joined_at: z.string(), + profile_image: z.string(), + profile_image_90: z.string(), +}); + +export type User = z.infer; + +export const devProfileImage = z.object({ + type_of: z.string(), + image_of: z.string(), + profile_image: z.string(), + profile_image_90: z.string(), +}); + +export type ProfileImage = z.infer; + +export const userApi = makeApi([ + { + method: "get", + path: "/users/:id", + alias: "getUser", + description: "Get a user", + response: devUser, + errors: [ + { + status: "default", + description: "Default error", + schema: z.object({ + error: z.object({ + code: z.string(), + message: z.string(), + }), + }), + }, + ], + }, + { + method: "get", + path: "/users/me", + alias: "getMe", + description: "Get current user", + response: devUser, + }, + { + method: "get", + path: "/profile_image/:username", + alias: "getProfileImage", + description: "Get a user's profile image", + response: devProfileImage, + }, +]); diff --git a/packages/axios/examples/io-ts-types.ts b/packages/axios/examples/io-ts-types.ts new file mode 100644 index 00000000..3f2736cd --- /dev/null +++ b/packages/axios/examples/io-ts-types.ts @@ -0,0 +1,80 @@ +import { + Zodios, + makeApi, + ApiOf, + TypeProviderOf, + ioTsTypeProvider, +} from "../src/index"; +import * as t from "io-ts"; +import { fetchProvider } from "../src/fetcher-providers"; +import { FetcherProviderOf } from "../src/zodios"; + +// you can define schema before declaring the API to get back the type + +// you can then get back the types +type User = t.TypeOf; +type Users = t.TypeOf; + +// you can also predefine your API +const jsonplaceholderUrl = "https://jsonplaceholder.typicode.com"; + +const userSchema = t.type({ + id: t.number, + name: t.string, +}); + +const usersSchema = t.array(userSchema); + +const jsonplaceholderApi = makeApi([ + { + method: "get", + path: "/users", + alias: "getUsers", + description: "Get all users", + parameters: [ + { + name: "q", + description: "full text search", + type: "Query", + schema: t.string, + }, + { + name: "page", + description: "page number", + type: "Query", + schema: t.union([t.number, t.undefined]), + }, + ], + response: usersSchema, + }, + { + method: "get", + path: "/users/:id", + description: "Get a user", + response: userSchema, + }, +]); + +async function bootstrap() { + const apiClient = new Zodios(jsonplaceholderUrl, jsonplaceholderApi, { + typeProvider: ioTsTypeProvider, + fetcherProvider: fetchProvider, + }); + + type Api = ApiOf; + // ^? + type Provider = TypeProviderOf; + // ^? + type FetcherProvider = FetcherProviderOf; + // ^? + const users = await apiClient.get("/users", { queries: { q: "Nicholas" } }); + // ^? + const users2 = await apiClient.getUsers({ queries: { q: "Nicholas" } }); + // ^? + console.log(users); + const user = await apiClient.get("/users/:id", { params: { id: 7 } }); + // ^? + console.log(user); +} + +bootstrap(); diff --git a/packages/axios/examples/jsonplaceholder.ts b/packages/axios/examples/jsonplaceholder.ts new file mode 100644 index 00000000..5bd28b12 --- /dev/null +++ b/packages/axios/examples/jsonplaceholder.ts @@ -0,0 +1,97 @@ +import { + ApiOf, + ZodiosResponseByAlias, + ZodiosHeaderParamsByAlias, + Zodios, +} from "../src/index"; +import { z } from "zod"; + +async function bootstrap() { + const apiClient = new Zodios("https://jsonplaceholder.typicode.com", [ + { + method: "get", + path: "/users", + alias: "getUsers", + description: "Get all users", + parameters: [ + { + name: "q", + type: "Query", + schema: z.string(), + }, + { + name: "page", + type: "Query", + schema: z.string().optional(), + }, + ], + response: z.array(z.object({ id: z.number(), name: z.string() })), + }, + { + method: "get", + path: "/users/:id", + alias: "getUser", + description: "Get a user", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + { + method: "delete", + path: "/users/:id", + alias: "deleteUser", + description: "Delete a user", + response: z.void(), + }, + { + method: "post", + path: "/users", + alias: "createUser", + description: "Create a user", + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ name: z.string() }), + }, + { + name: "Content-Type", + type: "Header", + schema: z.string(), + }, + ], + response: z.object({ id: z.number(), name: z.string() }), + }, + ]); + + type UserResponseAlias = ZodiosResponseByAlias< + ApiOf, + "getUsers" + >; + + type Test = ZodiosHeaderParamsByAlias, "createUser">; + + const users: UserResponseAlias = await apiClient.getUsers({ + queries: { q: "Nicholas" }, + }); + console.log(users); + const user = await apiClient.getUser({ params: { id: 7 } }); + console.log(user); + const createdUser = await apiClient.createUser( + { name: "john doe" }, + { + headers: { + "Content-Type": "application/json", + Accept: "application/json", + }, + } + ); + console.log(createdUser); + const deletedUser = await apiClient.deleteUser(undefined, { + params: { id: 7 }, + }); + console.log(deletedUser); +} + +bootstrap(); diff --git a/packages/axios/examples/types-from-definition.ts b/packages/axios/examples/types-from-definition.ts new file mode 100644 index 00000000..bc25cf30 --- /dev/null +++ b/packages/axios/examples/types-from-definition.ts @@ -0,0 +1,128 @@ +import { + ZodiosResponseByPath, + ZodiosBodyByPath, + ZodiosPathParamsByPath, + ZodiosQueryParamsByPath, + makeApi, + ZodiosPathParamByAlias, + makeErrors, +} from "../src/index"; +import z from "zod"; + +const user = z.object({ + id: z.number(), + name: z.string(), + email: z.string().email(), + phone: z.string(), +}); + +const errors = makeErrors([ + { + status: 404, + schema: z.object({ + message: z.string(), + }), + }, + { + status: 401, + schema: z.object({ + message: z.string(), + }), + }, + { + status: 500, + schema: z.object({ + message: z.string(), + cause: z.record(z.string()), + }), + }, +]); + +const api = makeApi([ + { + path: "/users", + method: "get", + response: z.array(user), + }, + { + path: "/users/:id", + method: "get", + alias: "getUser", + parameters: [ + { + name: "id", + type: "Path", + schema: z.number().positive(), + }, + ], + response: user, + errors, + }, + { + path: "/users", + method: "post", + parameters: [ + { + name: "body", + type: "Body", + schema: user, + }, + ], + response: user, + }, + { + path: "/users/:id", + method: "put", + parameters: [ + { + name: "body", + type: "Body", + schema: user, + }, + ], + response: user, + }, + { + path: "/users/:id", + method: "patch", + parameters: [ + { + name: "body", + type: "Body", + schema: user, + }, + ], + response: user, + }, + { + path: "/users/:id", + method: "delete", + response: z.object({}), + }, +]); + +type User = z.infer; +type Api = typeof api; + +type Users = ZodiosResponseByPath; +// ^? +type UserById = ZodiosResponseByPath; +// ^? +type GetUserParams = ZodiosPathParamsByPath; +// ^? +type GetUserParamsByAlias = ZodiosPathParamByAlias; +// ^? +type GetUsersParams = ZodiosPathParamsByPath; +// ^? +type GetUserQueries = ZodiosQueryParamsByPath; +// ^? +type CreateUserBody = ZodiosBodyByPath; +// ^? +type CreateUserResponse = ZodiosResponseByPath; +// ^? +type UpdateUserBody = ZodiosBodyByPath; +// ^? +type PatchUserBody = ZodiosBodyByPath; +// ^? +type DeleteUserResponse = ZodiosResponseByPath; +// ^? diff --git a/packages/axios/examples/typescript-types.ts b/packages/axios/examples/typescript-types.ts new file mode 100644 index 00000000..14dfc4e0 --- /dev/null +++ b/packages/axios/examples/typescript-types.ts @@ -0,0 +1,74 @@ +import { + Zodios, + makeApi, + tsFnSchema, + ApiOf, + TypeProviderOf, + tsSchema, + tsTypeProvider, +} from "../src/index"; + +// you can also predefine your API +const jsonplaceholderUrl = "https://jsonplaceholder.typicode.com"; + +type User = { + id: number; + name: string; +}; + +const userSchema = tsSchema(); + +const usersSchema = tsSchema(); + +const jsonplaceholderApi = makeApi([ + { + method: "get", + path: "/users", + description: "Get all users", + parameters: [ + { + name: "q", + description: "full text search", + type: "Query", + schema: tsFnSchema((data) => { + if (typeof data !== "string") { + throw new Error("not a string"); + } + return data; + }), + }, + { + name: "page", + description: "page number", + type: "Query", + schema: tsSchema(), + }, + ], + response: usersSchema, + }, + { + method: "get", + path: "/users/:id", + description: "Get a user", + response: userSchema, + }, +]); + +async function bootstrap() { + const apiClient = new Zodios(jsonplaceholderUrl, jsonplaceholderApi, { + typeProvider: tsTypeProvider, + }); + + type Api = ApiOf; + // ^? + type Provider = TypeProviderOf; + // ^? + const users = await apiClient.get("/users", { queries: { q: "Nicholas" } }); + // ^? + console.log(users); + const user = await apiClient.get("/users/:id", { params: { id: 7 } }); + // ^? + console.log(user); +} + +bootstrap(); diff --git a/packages/axios/jest.config.ts b/packages/axios/jest.config.ts new file mode 100644 index 00000000..d0da3728 --- /dev/null +++ b/packages/axios/jest.config.ts @@ -0,0 +1,24 @@ +import type { Config } from "@jest/types"; + +// Objet synchrone +const config: Config.InitialOptions = { + verbose: true, + moduleFileExtensions: ["ts", "js", "json", "node"], + rootDir: "./", + testRegex: ".(spec|test).tsx?$", + transform: { + "^.+\\.tsx?$": "ts-jest", + }, + coveragePathIgnorePatterns: ["/node_modules/", "index\\.ts"], + coverageDirectory: "./coverage", + coverageThreshold: { + global: { + branches: 80, + functions: 85, + lines: 85, + statements: 85, + }, + }, + testEnvironment: "node", +}; +export default config; diff --git a/packages/axios/package.json b/packages/axios/package.json new file mode 100644 index 00000000..7b4d19cb --- /dev/null +++ b/packages/axios/package.json @@ -0,0 +1,86 @@ +{ + "name": "@zodios/axios", + "description": "Typescript API client with axios", + "version": "11.0.0-beta.3", + "main": "lib/index.js", + "module": "lib/index.mjs", + "typings": "lib/index.d.ts", + "exports": { + ".": { + "import": "./lib/index.mjs", + "require": "./lib/index.js" + }, + "./package.json": "./package.json" + }, + "files": [ + "lib" + ], + "author": { + "name": "ecyrbe", + "email": "ecyrbe@gmail.com" + }, + "homepage": "https://github.com/ecyrbe/zodios", + "repository": { + "type": "git", + "url": "https://github.com/ecyrbe/zodios.git" + }, + "license": "MIT", + "keywords": [ + "axios", + "openapi", + "zod", + "autocomplete", + "validation" + ], + "scripts": { + "prebuild": "rimraf lib", + "example": "ts-node examples/jsonplaceholder.ts", + "example:dev.to": "ts-node examples/dev.to/example.ts", + "major-rc": "npm version premajor --preid=rc", + "minor-rc": "npm version preminor --preid=rc", + "patch-rc": "npm version prepatch --preid=rc", + "rc": "npm version prerelease --preid=rc", + "build": "tsup", + "test": "jest --coverage" + }, + "peerDependencies": { + "axios": "^0.x || ^1.0.0", + "fp-ts": "2.x", + "io-ts": "2.x", + "zod": "^3.x" + }, + "peerDependenciesMeta": { + "zod": { + "optional": true + }, + "fp-ts": { + "optional": true + }, + "io-ts": { + "optional": true + } + }, + "devDependencies": { + "@jest/globals": "29.3.1", + "@jest/types": "29.3.1", + "@types/express": "4.17.14", + "@types/jest": "29.2.2", + "@types/multer": "1.4.7", + "@types/node": "18.11.9", + "axios": "1.1.3", + "express": "4.18.2", + "fp-ts": "2.13.1", + "io-ts": "2.2.19", + "jest": "29.3.0", + "multer": "1.4.5-lts.1", + "rimraf": "3.0.2", + "ts-jest": "29.0.3", + "ts-node": "10.9.1", + "tsup": "6.3.0", + "typescript": "4.9.3", + "zod": "3.19.1" + }, + "dependencies": { + "@zodios/core": "workspace:*" + } +} diff --git a/packages/core/src/fetcher-providers/axios-provider/fetcher-provider.axios.ts b/packages/axios/src/fetcher-providers/axios-provider/fetcher-provider.axios.ts similarity index 98% rename from packages/core/src/fetcher-providers/axios-provider/fetcher-provider.axios.ts rename to packages/axios/src/fetcher-providers/axios-provider/fetcher-provider.axios.ts index 17dd733f..652c4645 100644 --- a/packages/core/src/fetcher-providers/axios-provider/fetcher-provider.axios.ts +++ b/packages/axios/src/fetcher-providers/axios-provider/fetcher-provider.axios.ts @@ -7,7 +7,7 @@ import axios, { import { AnyZodiosFetcherProvider, ZodiosRuntimeFetcherProvider, -} from "../fetcher-provider.types"; +} from "@zodios/core"; import { Merge } from "../../utils.types"; import { omit, replacePathParams } from "../../utils"; import { AnyZodiosRequestOptions } from "../../zodios.types"; diff --git a/packages/axios/src/fetcher-providers/index.ts b/packages/axios/src/fetcher-providers/index.ts new file mode 100644 index 00000000..8fd7b80d --- /dev/null +++ b/packages/axios/src/fetcher-providers/index.ts @@ -0,0 +1 @@ +export * from "./axios-provider/fetcher-provider.axios"; diff --git a/packages/axios/src/index.ts b/packages/axios/src/index.ts new file mode 100644 index 00000000..7ec983c5 --- /dev/null +++ b/packages/axios/src/index.ts @@ -0,0 +1,75 @@ +export { Zodios } from "./zodios"; +export type { ApiOf, TypeProviderOf } from "./zodios"; +export type { ZodiosInstance, ZodiosClass, ZodiosConstructor } from "./zodios"; +export { ZodiosError } from "./zodios-error"; +export { isErrorFromPath, isErrorFromAlias } from "./zodios-error.utils"; +export type { + AnyZodiosMethodOptions, + AnyZodiosRequestOptions, + ZodiosBodyForEndpoint, + ZodiosBodyByPath, + ZodiosBodyByAlias, + ZodiosHeaderParamsForEndpoint, + ZodiosHeaderParamsByPath, + ZodiosHeaderParamsByAlias, + Method, + ZodiosPathParams, + ZodiosPathParamsForEndpoint, + ZodiosPathParamsByPath, + ZodiosPathParamByAlias, + ZodiosPathsByMethod, + ZodiosResponseForEndpoint, + ZodiosResponseByPath, + ZodiosResponseByAlias, + ZodiosQueryParamsForEndpoint, + ZodiosQueryParamsByPath, + ZodiosQueryParamsByAlias, + ZodiosEndpointDefinitionByPath, + ZodiosEndpointDefinitionByAlias, + ZodiosErrorForEndpoint, + ZodiosErrorByPath, + ZodiosErrorByAlias, + ZodiosEndpointDefinition, + ZodiosEndpointDefinitions, + ZodiosEndpointParameter, + ZodiosEndpointParameters, + ZodiosEndpointError, + ZodiosEndpointErrors, + ZodiosOptions, + ZodiosRequestOptions, + ZodiosRequestOptionsByPath, + ZodiosRequestOptionsByAlias, + ZodiosPlugin, +} from "./zodios.types"; +export type { + AnyZodiosTypeProvider, + InferInputTypeFromSchema, + InferOutputTypeFromSchema, + IoTsTypeProvider, + TsTypeProvider, + ZodiosRuntimeTypeProvider, + ZodiosValidateResult, + ZodTypeProvider, +} from "./type-providers"; +export { + ioTsTypeProvider, + tsTypeProvider, + zodTypeProvider, + tsSchema, + tsFnSchema, +} from "./type-providers"; +export { + PluginId, + zodValidationPlugin, + formDataPlugin, + formURLPlugin, + headerPlugin, +} from "./plugins"; +export { + makeApi, + apiBuilder, + makeParameters, + makeEndpoint, + makeErrors, + checkApi, +} from "./api"; diff --git a/packages/axios/src/utils.test.ts b/packages/axios/src/utils.test.ts new file mode 100644 index 00000000..c432b63d --- /dev/null +++ b/packages/axios/src/utils.test.ts @@ -0,0 +1,68 @@ +import { omit, pick } from "./utils"; + +describe("omit", () => { + it("should be defined", () => { + expect(omit).toBeDefined(); + }); + + it("should support undefined parameters", () => { + const obj: any = undefined; + expect(omit(obj, ["a"])).toEqual({}); + }); + + it("should remove the given keys from the object", () => { + const obj = { + a: 1, + b: 2, + c: 3, + }; + + expect(omit(obj, ["a"])).toEqual({ + b: 2, + c: 3, + }); + }); + + it("should accept to remove all keys from object", () => { + const obj = { + a: 1, + b: 2, + c: 3, + }; + + expect(omit(obj, ["a", "b", "c"])).toEqual({}); + }); +}); + +describe("pick", () => { + it("should be defined", () => { + expect(pick).toBeDefined(); + }); + + it("should support undefined parameters", () => { + const obj: any = undefined; + expect(pick(obj, ["a"])).toEqual({}); + }); + + it("should pick the given keys from the object", () => { + const obj = { + a: 1, + b: 2, + c: 3, + }; + + expect(pick(obj, ["a"])).toEqual({ + a: 1, + }); + }); + + it("should accept to pick all keys from object", () => { + const obj = { + a: 1, + b: 2, + c: 3, + }; + + expect(pick(obj, ["a", "b", "c"])).toEqual(obj); + }); +}); diff --git a/packages/axios/src/utils.ts b/packages/axios/src/utils.ts new file mode 100644 index 00000000..678482ef --- /dev/null +++ b/packages/axios/src/utils.ts @@ -0,0 +1,122 @@ +import { AxiosError } from "axios"; +import type { ReadonlyDeep } from "./utils.types"; +import type { + AnyZodiosRequestOptions, + ZodiosEndpointDefinition, + ZodiosEndpointDefinitions, +} from "./zodios.types"; + +/** + * omit properties from an object + * @param obj - the object to omit properties from + * @param keys - the keys to omit + * @returns the object with the omitted properties + */ +export function omit( + obj: T | undefined, + keys: K[] +): Omit { + const ret = { ...obj } as T; + for (const key of keys) { + delete ret[key]; + } + return ret; +} + +/** + * pick properties from an object + * @param obj - the object to pick properties from + * @param keys - the keys to pick + * @returns the object with the picked properties + */ +export function pick( + obj: T | undefined, + keys: K[] +): Pick { + const ret = {} as Pick; + if (obj) { + for (const key of keys) { + ret[key] = obj[key]; + } + } + return ret; +} + +/** + * set first letter of a string to uppercase + * @param str - the string to capitalize + * @returns - the string with the first letter uppercased + */ +export function capitalize(str: T): Capitalize { + return (str.charAt(0).toUpperCase() + str.slice(1)) as Capitalize; +} + +const paramsRegExp = /:([a-zA-Z_][a-zA-Z0-9_]*)/g; + +export function replacePathParams( + config: ReadonlyDeep<{ url: string; params?: Record }> +) { + let result: string = config.url; + const params = config.params; + if (params) { + result = result.replace(paramsRegExp, (match, key) => + key in params ? `${params[key]}` : match + ); + } + return result; +} + +export function findEndpoint( + api: ZodiosEndpointDefinitions, + method: string, + path: string +) { + return api.find((e) => e.method === method && e.path === path); +} + +export function findEndpointByAlias( + api: ZodiosEndpointDefinitions, + alias: string +) { + return api.find((e) => e.alias === alias); +} + +export function findEndpointErrors( + endpoint: ZodiosEndpointDefinition, + err: AxiosError +) { + const matchingErrors = endpoint.errors?.filter( + (error) => error.status === err.response!.status + ); + if (matchingErrors && matchingErrors.length > 0) return matchingErrors; + return endpoint.errors?.filter((error) => error.status === "default"); +} + +export function findEndpointErrorsByPath( + api: ZodiosEndpointDefinitions, + method: string, + path: string, + err: AxiosError +) { + const endpoint = findEndpoint(api, method, path); + return endpoint && + err.config && + endpoint.method === err.config.method && + endpoint.path === err.config.url + ? findEndpointErrors(endpoint, err) + : undefined; +} + +export function findEndpointErrorsByAlias( + api: ZodiosEndpointDefinitions, + alias: string, + err: AxiosError +) { + const endpoint = findEndpointByAlias(api, alias); + return endpoint && + err.config && + endpoint.method === err.config.method && + endpoint.path === err.config.url + ? findEndpointErrors(endpoint, err) + : undefined; +} diff --git a/packages/axios/src/utils.types.test.ts b/packages/axios/src/utils.types.test.ts new file mode 100644 index 00000000..122dbd03 --- /dev/null +++ b/packages/axios/src/utils.types.test.ts @@ -0,0 +1,66 @@ +import type { + Assert, + FilterArrayByValue, + FilterArrayByKey, +} from "./utils.types"; + +describe("utils.types", () => { + describe("FilterArrayByValue", () => { + it("should support empty array", () => { + type Input = []; + const test: Assert, []> = true; + }); + + it("should filter typed Array by value in declared order", () => { + type Input = [ + { a: number; b: string }, + { a: number; c: boolean }, + { c: boolean }, + { d: string }, + { e: number } + ]; + const test1: Assert< + FilterArrayByValue, + [{ a: number; b: string }, { a: number; c: boolean }] + > = true; + const test2: Assert< + FilterArrayByValue, + [{ a: number; c: boolean }, { c: boolean }] + > = true; + const test3: Assert< + FilterArrayByValue, + [{ d: string }] + > = true; + const test4: Assert< + FilterArrayByValue, + [{ e: number }] + > = true; + }); + }); + + describe("FilterArrayByKey", () => { + it("should support empty array", () => { + type Input = []; + const test: Assert, []> = true; + }); + it("should filter typed Array by key in declared order", () => { + type Input = [ + { a: number; b: string }, + { a: number; c: boolean }, + { c: boolean }, + { d: string }, + { e: number } + ]; + const test1: Assert< + FilterArrayByKey, + [{ a: number; b: string }, { a: number; c: boolean }] + > = true; + const test2: Assert< + FilterArrayByKey, + [{ a: number; c: boolean }, { c: boolean }] + > = true; + const test3: Assert, [{ d: string }]> = true; + const test4: Assert, [{ e: number }]> = true; + }); + }); +}); diff --git a/packages/axios/src/utils.types.ts b/packages/axios/src/utils.types.ts new file mode 100644 index 00000000..28ffccd3 --- /dev/null +++ b/packages/axios/src/utils.types.ts @@ -0,0 +1,237 @@ +/** + * filter an array type by a predicate value + * @param T - array type + * @param C - predicate object to match + * @details - this is using tail recursion type optimization from typescript 4.5 + */ +export type FilterArrayByValue< + T extends unknown[] | undefined, + C, + Acc extends unknown[] = [] +> = T extends [infer Head, ...infer Tail] + ? Head extends C + ? FilterArrayByValue + : FilterArrayByValue + : Acc; + +/** + * filter an array type by key + * @param T - array type + * @param K - key to match + * @details - this is using tail recursion type optimization from typescript 4.5 + */ +export type FilterArrayByKey< + T extends unknown[], + K extends string, + Acc extends unknown[] = [] +> = T extends [infer Head, ...infer Tail] + ? Head extends { [Key in K]: unknown } + ? FilterArrayByKey + : FilterArrayByKey + : Acc; + +/** + * filter an array type by removing undefined values + * @param T - array type + * @details - this is using tail recursion type optimization from typescript 4.5 + */ +export type DefinedArray< + T extends unknown[], + Acc extends unknown[] = [] +> = T extends [infer Head, ...infer Tail] + ? Head extends undefined + ? DefinedArray + : DefinedArray + : Acc; + +type Try = A extends B ? A : C; + +type NarrowRaw = + | (T extends Function ? T : never) + | (T extends string | number | bigint | boolean ? T : never) + | (T extends [] ? [] : never) + | { + [K in keyof T]: K extends "description" ? T[K] : NarrowNotSchema; + }; + +type NarrowNotSchema = Try< + T, + { parse: (...args: any[]) => any } | { validate: (...args: any[]) => any }, + NarrowRaw +>; + +/** + * Utility to infer the embedded primitive type of any type + * Same as `as const` but without setting the object as readonly and without needing the user to use it + * @param T - type to infer the embedded type of + * @see - thank you tannerlinsley for this idea + */ +export type Narrow = Try>; + +/** + * merge all union types into a single type + * @param T - union type + */ +export type MergeUnion = ( + T extends unknown ? (k: T) => void : never +) extends (k: infer I) => void + ? { [K in keyof I]: I[K] } + : never; + +/** + * get all required properties from an object type + * @param T - object type + */ +export type RequiredProps = Omit< + T, + { + [P in keyof T]-?: undefined extends T[P] ? P : never; + }[keyof T] +>; + +/** + * get all optional properties from an object type + * @param T - object type + */ +export type OptionalProps = Pick< + T, + { + [P in keyof T]-?: undefined extends T[P] ? P : never; + }[keyof T] +>; + +/** + * get all properties from an object type that are not undefined or optional + * @param T - object type + * @returns - union type of all properties that are not undefined or optional + */ +export type RequiredKeys = { + [P in keyof T]-?: undefined extends T[P] ? never : P; +}[keyof T]; + +/** + * Simplify a type by merging intersections if possible + * @param T - type to simplify + */ +export type Simplify = T extends unknown ? { [K in keyof T]: T[K] } : T; + +/** + * Merge two types into a single type + * @param T - first type + * @param U - second type + */ +export type Merge = Simplify; + +/** + * transform possible undefined properties from a type into optional properties + * @param T - object type + */ +export type UndefinedToOptional = Merge< + RequiredProps, + Partial> +>; + +/** + * remove all the never properties from a type object + * @param T - object type + */ +export type PickDefined = Pick< + T, + { [K in keyof T]: T[K] extends never ? never : K }[keyof T] +>; + +/** + * check if two types are equal + */ +export type IfEquals = (() => G extends T + ? 1 + : 2) extends () => G extends U ? 1 : 2 + ? Y + : N; + +/** + * get never if empty type + * @param T - type + * @example + * ```ts + * type A = {}; + * type B = NotEmpty; // B = never + */ +export type NeverIfEmpty = IfEquals; + +/** + * get undefined if empty type + * @param T - type + * @example + * ```ts + * type A = {}; + * type B = NotEmpty; // B = never + */ +export type UndefinedIfEmpty = IfEquals; + +export type UndefinedIfNever = IfEquals; + +/** + * set properties to optional if their child properties are optional + * @param T - object type + */ +export type TransitiveOptional = UndefinedToOptional<{ + [k in keyof T]: RequiredKeys extends never ? T[k] | undefined : T[k]; +}>; + +/** + * transform an array type into a readonly array type + * @param T - array type + */ +interface ReadonlyArrayDeep extends ReadonlyArray> {} + +/** + * transform an object type into a readonly object type + * @param T - object type + */ +export type DeepReadonlyObject = { + readonly [P in keyof T]: ReadonlyDeep; +}; + +/** + * transform a type into a readonly type + * @param T - type + */ +export type ReadonlyDeep = T extends (infer R)[] + ? ReadonlyArrayDeep + : T extends Function + ? T + : T extends object + ? DeepReadonlyObject + : T; + +export type MaybeReadonly = T | ReadonlyDeep; + +/** + * get all parameters from an API path + * @param Path - API path + * @details - this is using tail recursion type optimization from typescript 4.5 + */ +export type PathParamNames< + Path, + Acc = never +> = Path extends `${string}:${infer Name}/${infer R}` + ? PathParamNames + : Path extends `${string}:${infer Name}` + ? Name | Acc + : Acc; + +/** + * Check if two type are equal else generate a compiler error + * @param T - type to check + * @param U - type to check against + * @returns true if types are equal else a detailed compiler error + */ +export type Assert = IfEquals< + T, + U, + true, + { error: "Types are not equal"; type1: T; type2: U } +>; + +export type PickRequired = Merge; diff --git a/packages/axios/src/zodios-error.ts b/packages/axios/src/zodios-error.ts new file mode 100644 index 00000000..4d4b804a --- /dev/null +++ b/packages/axios/src/zodios-error.ts @@ -0,0 +1,23 @@ +import { AnyZodiosFetcherProvider } from "./fetcher-providers"; +import type { ReadonlyDeep } from "./utils.types"; +import type { AnyZodiosRequestOptions } from "./zodios.types"; + +/** + * Custom Zodios Error with additional information + * @param message - the error message + * @param data - the parameter or response object that caused the error + * @param config - the config object from zodios + * @param cause - the error cause + */ +export class ZodiosError extends Error { + constructor( + message: string, + public readonly config?: ReadonlyDeep< + AnyZodiosRequestOptions + >, + public readonly data?: unknown, + public readonly cause?: Error + ) { + super(message); + } +} diff --git a/packages/core/src/zodios-error.utils.ts b/packages/axios/src/zodios-error.utils.ts similarity index 100% rename from packages/core/src/zodios-error.utils.ts rename to packages/axios/src/zodios-error.utils.ts diff --git a/packages/axios/src/zodios.test.ts b/packages/axios/src/zodios.test.ts new file mode 100644 index 00000000..f9c0c1b3 --- /dev/null +++ b/packages/axios/src/zodios.test.ts @@ -0,0 +1,1122 @@ +import { AxiosError } from "axios"; +import express from "express"; +import { AddressInfo } from "net"; +import { z, ZodError } from "zod"; +//if (globalThis.FormData === undefined) { +globalThis.FormData = require("form-data"); +//} +import { Zodios } from "./zodios"; +import { ZodiosError } from "./zodios-error"; +import multer from "multer"; +import { ZodiosPlugin } from "./zodios.types"; +import { apiBuilder } from "./api"; +import { isErrorFromPath, isErrorFromAlias } from "./zodios-error.utils"; +import { Assert } from "./utils.types"; +import { AnyZodiosFetcherProvider } from "./fetcher-providers"; + +const multipart = multer({ storage: multer.memoryStorage() }); + +describe("Zodios", () => { + let app: express.Express; + let server: ReturnType; + let port: number; + + beforeAll(async () => { + app = express(); + app.use(express.json()); + app.get("/token", (req, res) => { + res.status(200).json({ token: req.headers.authorization }); + }); + app.post("/token", (req, res) => { + res.status(200).json({ token: req.headers.authorization }); + }); + app.get("/error401", (req, res) => { + res.status(401).json({}); + }); + app.get("/error502", (req, res) => { + res.status(502).json({ error: { message: "bad gateway" } }); + }); + app.get("/queries", (req, res) => { + res.status(200).json({ + queries: req.query.id, + }); + }); + app.get("/:id", (req, res) => { + res.status(200).json({ id: Number(req.params.id), name: "test" }); + }); + app.get("/path/:uuid", (req, res) => { + res.status(200).json({ uuid: req.params.uuid }); + }); + app.get("/:id/address/:address", (req, res) => { + res + .status(200) + .json({ id: Number(req.params.id), address: req.params.address }); + }); + app.post("/", (req, res) => { + res.status(200).json({ id: 3, name: req.body.name }); + }); + app.put("/", (req, res) => { + res.status(200).json({ id: req.body.id, name: req.body.name }); + }); + app.patch("/", (req, res) => { + res.status(200).json({ id: req.body.id, name: req.body.name }); + }); + app.delete("/:id", (req, res) => { + res.status(200).json({ id: Number(req.params.id) }); + }); + app.post("/form-data", multipart.none(), (req, res) => { + res.status(200).json(req.body); + }); + app.post( + "/form-url", + express.urlencoded({ extended: false }), + (req, res) => { + res.status(200).json(req.body); + } + ); + app.post("/text", express.text(), (req, res) => { + res.status(200).send(req.body); + }); + server = app.listen(0); + port = (server.address() as AddressInfo).port; + }); + + afterAll(() => { + server.close(); + }); + + it("should be defined", () => { + expect(Zodios).toBeDefined(); + }); + + it("should throw if baseUrl is not provided", () => { + // @ts-ignore + expect(() => new Zodios(undefined, [])).toThrowError( + "Zodios: missing base url" + ); + }); + + it("should throw if api is not provided", () => { + // @ts-ignore + expect(() => new Zodios()).toThrowError("Zodios: missing api description"); + }); + + it("should throw if api is not an array", () => { + // @ts-ignore + expect(() => new Zodios({})).toThrowError("Zodios: api must be an array"); + }); + + it("should create a new instance of Zodios", () => { + const zodios = new Zodios(`http://localhost:${port}`, []); + expect(zodios).toBeDefined(); + }); + it("should create a new instance when providing an api", () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/:id", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + expect(zodios).toBeDefined(); + }); + + it("should should throw with duplicate api endpoints", () => { + expect( + () => + new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/:id", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + { + method: "get", + path: "/:id", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]) + ).toThrowError("Zodios: Duplicate path 'get /:id'"); + }); + + it("should create a new instance whithout base URL", () => { + const zodios = new Zodios([ + { + method: "get", + path: "/:id", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + expect(zodios).toBeDefined(); + }); + + it("should register have validation plugin automatically installed", () => { + const zodios = new Zodios(`http://localhost:${port}`, []); + // @ts-ignore + expect(zodios.endpointPlugins.get("any-any").count()).toBe(1); + }); + + it("should register a plugin", () => { + const zodios = new Zodios(`http://localhost:${port}`, []); + zodios.use({ + request: async (_, config) => config, + }); + // @ts-ignore + expect(zodios.endpointPlugins.get("any-any").count()).toBe(2); + }); + + it("should unregister a plugin", () => { + const zodios = new Zodios(`http://localhost:${port}`, []); + const id = zodios.use({ + request: async (_, config) => config, + }); + // @ts-ignore + expect(zodios.endpointPlugins.get("any-any").count()).toBe(2); + zodios.eject(id); + // @ts-ignore + expect(zodios.endpointPlugins.get("any-any").count()).toBe(1); + }); + + it("should replace a named plugin", () => { + const zodios = new Zodios(`http://localhost:${port}`, []); + const plugin: ZodiosPlugin = { + name: "test", + request: async (_, config) => config, + }; + zodios.use(plugin); + zodios.use(plugin); + zodios.use(plugin); + // @ts-ignore + expect(zodios.endpointPlugins.get("any-any").count()).toBe(2); + }); + + it("should unregister a named plugin", () => { + const zodios = new Zodios(`http://localhost:${port}`, []); + const plugin: ZodiosPlugin = { + name: "test", + request: async (_, config) => config, + }; + zodios.use(plugin); + zodios.eject("test"); + // @ts-ignore + expect(zodios.endpointPlugins.get("any-any").count()).toBe(1); + }); + + it("should throw if invalide parameters when registering a plugin", () => { + const zodios = new Zodios(`http://localhost:${port}`, []); + // @ts-ignore + expect(() => zodios.use(0)).toThrowError("Zodios: invalid plugin"); + }); + + it("should throw if invalid alias when registering a plugin", () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/:id", + alias: "test", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + expect(() => + // @ts-ignore + zodios.use("tests", { + // @ts-ignore + request: async (_, config) => config, + }) + ).toThrowError("Zodios: no alias 'tests' found to register plugin"); + }); + + it("should throw if invalid endpoint when registering a plugin", () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/:id", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + expect(() => + // @ts-ignore + zodios.use("get", "/test/:id", { + // @ts-ignore + request: async (_, config) => config, + }) + ).toThrowError( + "Zodios: no endpoint 'get /test/:id' found to register plugin" + ); + }); + + it("should register a plugin by endpoint", () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/:id", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + zodios.use("get", "/:id", { + request: async (_, config) => config, + }); + // @ts-ignore + expect(zodios.endpointPlugins.get("get-/:id").count()).toBe(1); + }); + + it("should register a plugin by alias", () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/:id", + alias: "test", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + zodios.use("test", { + request: async (_, config) => config, + }); + // @ts-ignore + expect(zodios.endpointPlugins.get("get-/:id").count()).toBe(1); + }); + + it("should make an http request", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/:id", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + { + method: "get", + path: "/users", + response: z.array( + z.object({ + id: z.number(), + name: z.string(), + }) + ), + }, + ]); + const response = await zodios.request({ + method: "get", + url: "/:id", + params: { id: 7 }, + }); + expect(response).toEqual({ id: 7, name: "test" }); + }); + + it("should make an http get with standard query arrays", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/queries", + parameters: [ + { + name: "id", + type: "Query", + schema: z.array(z.number()), + }, + ], + response: z.object({ + queries: z.array(z.string()), + }), + }, + ]); + const response = await zodios.get("/queries", { queries: { id: [1, 2] } }); + expect(response).toEqual({ queries: ["1", "2"] }); + }); + + it("should make an http get with one path params", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/:id", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + const response = await zodios.get("/:id", { params: { id: 7 } }); + expect(response).toEqual({ id: 7, name: "test" }); + }); + + it("should make an http alias request with one path params", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/:id", + alias: "getById", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + const response = await zodios.getById({ params: { id: 7 } }); + expect(response).toEqual({ id: 7, name: "test" }); + }); + + it("should work with api builder", async () => { + const api = apiBuilder({ + method: "get", + path: "/:id", + alias: "getById", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }).build(); + const zodios = new Zodios(`http://localhost:${port}`, api); + const response = await zodios.getById({ params: { id: 7 } }); + expect(response).toEqual({ id: 7, name: "test" }); + }); + + it("should make a get request with forgotten params and get back a zod error", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/:id", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + try { + // @ts-ignore + await zodios.get("/:id"); + } catch (e) { + expect(e).toBeInstanceOf(ZodiosError); + } + }); + + it("should make an http get with multiples path params", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/:id/address/:address", + response: z.object({ + id: z.number(), + address: z.string(), + }), + }, + ]); + const response = await zodios.get("/:id/address/:address", { + params: { id: 7, address: "address" }, + }); + expect(response).toEqual({ id: 7, address: "address" }); + }); + + it("should make an http post with body param", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "post", + path: "/", + parameters: [ + { + name: "name", + type: "Body", + schema: z.object({ + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + const response = await zodios.post("/", { body: { name: "post" } }); + expect(response).toEqual({ id: 3, name: "post" }); + }); + + it("should make an http post with transformed body param", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "post", + path: "/", + parameters: [ + { + name: "name", + type: "Body", + schema: z + .object({ + firstname: z.string(), + lastname: z.string(), + }) + .transform((data) => ({ + name: `${data.firstname} ${data.lastname}`, + })), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + const config = { + method: "post", + url: "/", + body: { firstname: "post", lastname: "test" }, + } as const; + const response = await zodios.request(config); + expect(config).toEqual({ + method: "post", + url: "/", + body: { firstname: "post", lastname: "test" }, + }); + expect(response).toEqual({ id: 3, name: "post test" }); + }); + + it("should throw a zodios error if params are not correct", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "post", + path: "/", + parameters: [ + { + name: "name", + type: "Body", + schema: z + .object({ + email: z.string().email(), + }) + .transform((data) => ({ + name: `${data.email.split("@")[0]}`, + })), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + let response; + let error: ZodiosError | undefined; + try { + response = await zodios.post("/", { + body: { + email: "post", + }, + }); + } catch (err) { + error = err as ZodiosError; + } + expect(response).toBeUndefined(); + expect(error).toBeInstanceOf(ZodiosError); + expect(error!.cause).toBeInstanceOf(ZodError); + expect(error!.message).toBe("Zodios: Invalid Body parameter 'name'"); + }); + + it("should make an http mutation alias request with body param", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "post", + path: "/", + alias: "create", + parameters: [ + { + name: "name", + type: "Body", + schema: z.object({ + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + const response = await zodios.create({ body: { name: "post" } }); + expect(response).toEqual({ id: 3, name: "post" }); + }); + + it("should make an http put", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "put", + path: "/", + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + const response = await zodios.put("/", { body: { id: 5, name: "put" } }); + expect(response).toEqual({ id: 5, name: "put" }); + }); + + it("should make an http put alias", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "put", + path: "/", + alias: "update", + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + const response = await zodios.update({ body: { id: 5, name: "put" } }); + expect(response).toEqual({ id: 5, name: "put" }); + }); + + it("should make an http patch", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "patch", + path: "/", + parameters: [ + { + name: "id", + type: "Body", + schema: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + const response = await zodios.patch("/", { + body: { id: 4, name: "patch" }, + }); + expect(response).toEqual({ id: 4, name: "patch" }); + }); + + it("should make an http patch alias", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "patch", + path: "/", + alias: "update", + parameters: [ + { + name: "id", + type: "Body", + schema: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + const response = await zodios.update({ body: { id: 4, name: "patch" } }); + expect(response).toEqual({ id: 4, name: "patch" }); + }); + + it("should make an http delete", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "delete", + path: "/:id", + response: z.object({ + id: z.number(), + }), + }, + ]); + const response = await zodios.delete("/:id", { + params: { id: 6 }, + }); + expect(response).toEqual({ id: 6 }); + }); + + it("should make an http delete alias", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "delete", + path: "/:id", + alias: "remove", + response: z.object({ + id: z.number(), + }), + }, + ]); + const response = await zodios.remove({ + params: { id: 6 }, + }); + expect(response).toEqual({ id: 6 }); + }); + + it("should validate uuid in path params", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/path/:uuid", + parameters: [ + { + name: "uuid", + type: "Path", + schema: z.string().uuid(), + }, + ], + response: z.object({ + uuid: z.string(), + }), + }, + ]); + const response = await zodios.get("/path/:uuid", { + params: { uuid: "e9e09a1d-3967-4518-bc89-75a901aee128" }, + }); + expect(response).toEqual({ + uuid: "e9e09a1d-3967-4518-bc89-75a901aee128", + }); + }); + + it("should not validate bad path params", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/path/:uuid", + parameters: [ + { + name: "uuid", + type: "Path", + schema: z.string().uuid(), + }, + ], + response: z.object({ + uuid: z.string(), + }), + }, + ]); + let error; + try { + await zodios.get("/path/:uuid", { + params: { uuid: "e9e09a1-3967-4518-bc89-75a901aee128" }, + }); + } catch (e) { + error = e; + } + expect(error).toBeInstanceOf(ZodiosError); + expect((error as ZodiosError).cause).toBeInstanceOf(ZodError); + expect((error as ZodiosError).message).toBe( + "Zodios: Invalid Path parameter 'uuid'" + ); + }); + + it("should not validate bad formatted responses", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/:id", + response: z.object({ + id: z.number(), + name: z.string(), + more: z.string(), + }), + }, + ]); + try { + await zodios.get("/:id", { params: { id: 1 } }); + } catch (e) { + expect(e).toBeInstanceOf(ZodiosError); + expect((e as ZodiosError).cause).toBeInstanceOf(ZodError); + expect((e as ZodiosError).message) + .toBe(`Zodios: Invalid response from endpoint 'get /:id' +status: 200 OK +cause: +[ + { + "code": "invalid_type", + "expected": "string", + "received": "undefined", + "path": [ + "more" + ], + "message": "Required" + } +] +received: +{ + "id": 1, + "name": "test" +}`); + expect((e as ZodiosError).data).toEqual({ + id: 1, + name: "test", + }); + expect((e as ZodiosError).config).toEqual({ + method: "get", + url: "/:id", + params: { id: 1 }, + }); + } + }); + + it("should match Expected error", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + alias: "getError502", + path: "/error502", + response: z.void(), + errors: [ + { + status: 502, + schema: z.object({ + error: z.object({ + message: z.string(), + }), + }), + }, + { + status: 401, + schema: z.object({ + error: z.object({ + message: z.string(), + _401: z.literal(true), + }), + }), + }, + { + status: "default", + schema: z.object({ + error: z.object({ + message: z.string(), + _default: z.literal(true), + }), + }), + }, + ], + }, + ]); + let error; + try { + await zodios.get("/error502"); + } catch (e) { + error = e; + } + expect(error).toBeInstanceOf(Error); + expect((error as AxiosError).response?.status).toBe(502); + if (isErrorFromPath(zodios.api, "get", "/error502", error)) { + expect(error.response.status).toBe(502); + if (error.response.status === 502) { + const data = error.response.data; + const test: Assert = true; + } + expect(error.response?.data).toEqual({ + error: { message: "bad gateway" }, + }); + } + if (isErrorFromAlias(zodios.api, "getError502", error)) { + expect(error.response.status).toBe(502); + if (error.response.status === 502) { + const data = error.response.data; + // ^? + const test: Assert = true; + } else if (error.response.status === 401) { + const data = error.response.data; + // ^? + const test: Assert< + typeof data, + { error: { message: string; _401: true } } + > = true; + } else { + const testStatus = error.response.status; + // ^? + const data = error.response.data; + // ^? + const test: Assert< + typeof data, + { error: { message: string; _default: true } } + > = true; + } + expect(error.response?.data).toEqual({ + error: { message: "bad gateway" }, + }); + } + }); + + it("should match Unexpected error", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + alias: "getError502", + path: "/error502", + response: z.void(), + }, + ]); + let error; + try { + await zodios.get("/error502"); + } catch (e) { + error = e; + } + + expect(error).toBeInstanceOf(Error); + expect((error as AxiosError).response?.status).toBe(502); + expect(isErrorFromPath(zodios.api, "get", "/error502", error)).toBe(false); + expect(isErrorFromAlias(zodios.api, "getError502", error)).toBe(false); + }); + + it("should return response when disabling validation", async () => { + const zodios = new Zodios( + `http://localhost:${port}`, + [ + { + method: "get", + path: "/:id", + response: z.object({ + id: z.number(), + name: z.string(), + more: z.string(), + }), + }, + ], + { validate: false } + ); + const response = await zodios.get("/:id", { params: { id: 1 } }); + expect(response).toEqual({ + id: 1, + name: "test", + }); + }); + + it("should trigger an axios error with error response", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/error502", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + try { + await zodios.get("/error502"); + } catch (e) { + expect((e as AxiosError).response?.data).toEqual({ + error: { + message: "bad gateway", + }, + }); + } + }); + + it("should send a form data request", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "post", + path: "/form-data", + requestFormat: "form-data", + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.string(), + name: z.string(), + }), + }, + ]); + const response = await zodios.post("/form-data", { + body: { id: 4, name: "post" }, + }); + expect(response).toEqual({ id: "4", name: "post" }); + }); + + it("should send a form data request a second time under 100 ms", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "post", + path: "/form-data", + requestFormat: "form-data", + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ + id: z.string(), + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.string(), + name: z.string(), + }), + }, + ]); + const response = await zodios.post("/form-data", { + // @ts-ignore + body: { id: "4", name: "post" }, + }); + expect(response).toEqual({ id: "4", name: "post" }); + }, 100); + + it("should not send an array as form data request", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "post", + path: "/form-data", + requestFormat: "form-data", + parameters: [ + { + name: "body", + type: "Body", + schema: z.array(z.string()), + }, + ], + response: z.string(), + }, + ]); + let error: Error | undefined; + let response: string | undefined; + try { + response = await zodios.post("/form-data", { body: ["test", "test2"] }); + } catch (err) { + error = err as Error; + } + expect(response).toBeUndefined(); + expect(error).toBeInstanceOf(ZodiosError); + expect((error as ZodiosError).message).toBe( + "Zodios: multipart/form-data body must be an object" + ); + }); + + it("should send a form url request", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "post", + path: "/form-url", + requestFormat: "form-url", + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.string(), + name: z.string(), + }), + }, + ]); + const response = await zodios.post("/form-url", { + body: { id: 4, name: "post" }, + }); + expect(response).toEqual({ id: "4", name: "post" }); + }); + + it("should not send an array as form url request", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "post", + path: "/form-url", + requestFormat: "form-url", + parameters: [ + { + name: "body", + type: "Body", + schema: z.array(z.string()), + }, + ], + response: z.string(), + }, + ]); + let error: Error | undefined; + let response: string | undefined; + try { + response = await zodios.post("/form-url", { body: ["test", "test2"] }); + } catch (err) { + error = err as Error; + } + expect(response).toBeUndefined(); + expect(error).toBeInstanceOf(ZodiosError); + expect((error as ZodiosError).message).toBe( + "Zodios: application/x-www-form-urlencoded body must be an object" + ); + }); + + it("should send a text request", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "post", + path: "/text", + requestFormat: "text", + parameters: [ + { + name: "body", + type: "Body", + schema: z.string(), + }, + ], + response: z.string(), + }, + ]); + const response = await zodios.post("/text", { body: "test" }); + expect(response).toEqual("test"); + }); +}); diff --git a/packages/axios/src/zodios.ts b/packages/axios/src/zodios.ts new file mode 100644 index 00000000..4f25def6 --- /dev/null +++ b/packages/axios/src/zodios.ts @@ -0,0 +1,504 @@ +import type { + AnyZodiosRequestOptions, + ZodiosRequestOptions, + ZodiosBodyByPath, + Method, + ZodiosPathsByMethod, + ZodiosResponseByPath, + ZodiosOptions, + ZodiosEndpointDefinitions, + ZodiosRequestOptionsByPath, + ZodiosAliases, + ZodiosPlugin, + Aliases, +} from "./zodios.types"; +import { + PluginId, + ZodiosPlugins, + zodValidationPlugin, + formDataPlugin, + formURLPlugin, + headerPlugin, +} from "./plugins"; +import type { + Narrow, + PickRequired, + ReadonlyDeep, + RequiredKeys, + UndefinedIfNever, +} from "./utils.types"; +import { checkApi } from "./api"; +import type { AnyZodiosTypeProvider, ZodTypeProvider } from "./type-providers"; +import { zodTypeProvider } from "./type-providers"; +import { + AnyZodiosFetcherProvider, + axiosProvider, + AxiosProvider, + fetchProvider, + TypeOfFetcherOptions, +} from "./fetcher-providers"; + +interface ZodiosBase< + Api extends ZodiosEndpointDefinitions, + FetcherProvider extends AnyZodiosFetcherProvider, + TypeProvider extends AnyZodiosTypeProvider +> { + readonly api: Api; + readonly _typeProvider: TypeProvider; + readonly _fetcherProvider: FetcherProvider; +} + +/** + * zodios api client based on axios + */ +export class ZodiosClass< + Api extends ZodiosEndpointDefinitions, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, + FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider +> implements ZodiosBase +{ + public readonly options: PickRequired< + ZodiosOptions, + | "validate" + | "transform" + | "sendDefaults" + | "typeProvider" + | "fetcherProvider" + >; + public readonly api: Api; + public readonly _typeProvider: TypeProvider; + public readonly _fetcherProvider: FetcherProvider; + private endpointPlugins: Map> = + new Map(); + + /** + * constructor + * @param baseURL - the base url to use - if omited will use the browser domain + * @param api - the description of all the api endpoints + * @param options - the options to setup the client API + * @example + * const apiClient = new Zodios("https://jsonplaceholder.typicode.com", [ + * { + * method: "get", + * path: "/users", + * description: "Get all users", + * parameters: [ + * { + * name: "q", + * type: "Query", + * schema: z.string(), + * }, + * { + * name: "page", + * type: "Query", + * schema: z.string().optional(), + * }, + * ], + * response: z.array(z.object({ id: z.number(), name: z.string() })), + * } + * ]); + */ + constructor( + api: Narrow, + options?: ZodiosOptions & + TypeOfFetcherOptions + ); + constructor( + baseUrl: string, + api: Narrow, + options?: ZodiosOptions & + TypeOfFetcherOptions + ); + constructor( + arg1?: Api | string, + arg2?: + | Api + | (ZodiosOptions & + TypeOfFetcherOptions), + arg3?: ZodiosOptions & + TypeOfFetcherOptions + ) { + let options: ZodiosOptions & + TypeOfFetcherOptions; + if (!arg1) { + if (Array.isArray(arg2)) { + throw new Error("Zodios: missing base url"); + } + throw new Error("Zodios: missing api description"); + } + let baseURL: string | undefined; + if (typeof arg1 === "string" && Array.isArray(arg2)) { + baseURL = arg1; + this.api = arg2; + options = arg3 || {}; + } else if (Array.isArray(arg1) && !Array.isArray(arg2)) { + this.api = arg1; + options = arg2 || {}; + } else { + throw new Error("Zodios: api must be an array"); + } + + checkApi(this.api); + + this.options = { + validate: true, + transform: true, + sendDefaults: false, + typeProvider: zodTypeProvider as any, + fetcherProvider: axiosProvider, + ...options, + }; + this._typeProvider = undefined as any; + this._fetcherProvider = undefined as any; + this.options.fetcherProvider.create({ baseURL, ...this.options }); + + this.injectAliasEndpoints(); + this.initPlugins(); + if ([true, "all", "request", "response"].includes(this.options.validate)) { + this.use(zodValidationPlugin(this.options)); + } + } + + private initPlugins() { + this.endpointPlugins.set("any-any", new ZodiosPlugins("any", "any")); + + this.api.forEach((endpoint) => { + const plugins = new ZodiosPlugins( + endpoint.method, + endpoint.path + ); + switch (endpoint.requestFormat) { + case "binary": + plugins.use( + headerPlugin( + "Content-Type", + "application/octet-stream" + ) + ); + break; + case "form-data": + plugins.use(formDataPlugin()); + break; + case "form-url": + plugins.use(formURLPlugin()); + break; + case "text": + plugins.use( + headerPlugin("Content-Type", "text/plain") + ); + break; + } + this.endpointPlugins.set(`${endpoint.method}-${endpoint.path}`, plugins); + }); + } + + private getAnyEndpointPlugins() { + return this.endpointPlugins.get("any-any"); + } + + private findAliasEndpointPlugins(alias: string) { + const endpoint = this.api.find((endpoint) => endpoint.alias === alias); + if (endpoint) { + return this.endpointPlugins.get(`${endpoint.method}-${endpoint.path}`); + } + return undefined; + } + + private findEnpointPlugins(method: Method, path: string) { + return this.endpointPlugins.get(`${method}-${path}`); + } + + /** + * register a plugin to intercept the requests or responses + * @param plugin - the plugin to use + * @returns an id to allow you to unregister the plugin + */ + use(plugin: ZodiosPlugin): PluginId; + use>( + alias: Alias, + plugin: ZodiosPlugin + ): PluginId; + use>( + method: M, + path: Path, + plugin: ZodiosPlugin + ): PluginId; + use(...args: unknown[]) { + if (typeof args[0] === "object") { + const plugins = this.getAnyEndpointPlugins()!; + return plugins.use(args[0] as ZodiosPlugin); + } else if (typeof args[0] === "string" && typeof args[1] === "object") { + const plugins = this.findAliasEndpointPlugins(args[0]); + if (!plugins) + throw new Error( + `Zodios: no alias '${args[0]}' found to register plugin` + ); + return plugins.use(args[1] as ZodiosPlugin); + } else if ( + typeof args[0] === "string" && + typeof args[1] === "string" && + typeof args[2] === "object" + ) { + const plugins = this.findEnpointPlugins(args[0] as Method, args[1]); + if (!plugins) + throw new Error( + `Zodios: no endpoint '${args[0]} ${args[1]}' found to register plugin` + ); + return plugins.use(args[2] as ZodiosPlugin); + } + throw new Error("Zodios: invalid plugin registration"); + } + + /** + * unregister a plugin + * if the plugin name is provided instead of the registration plugin id, + * it will unregister the plugin with that name only for non endpoint plugins + * @param plugin - id of the plugin to remove + */ + eject(plugin: PluginId | string): void { + if (typeof plugin === "string") { + const plugins = this.getAnyEndpointPlugins()!; + plugins.eject(plugin); + return; + } + this.endpointPlugins.get(plugin.key)?.eject(plugin); + } + + private injectAliasEndpoints() { + this.api.forEach((endpoint) => { + if (endpoint.alias) { + (this as any)[endpoint.alias] = (config: any) => + this.request({ + ...config, + method: endpoint.method, + url: endpoint.path, + }); + } + }); + } + + /** + * make a request to the api + * @param config - the config to setup zodios options and parameters + * @returns response validated with zod schema provided in the api description + */ + async request< + M extends Method, + Path extends ZodiosPathsByMethod, + TConfig = ReadonlyDeep< + ZodiosRequestOptions + > + >( + config: TConfig + ): Promise> { + let conf = config as unknown as ReadonlyDeep< + AnyZodiosRequestOptions + >; + const anyPlugin = this.getAnyEndpointPlugins()!; + const endpointPlugin = this.findEnpointPlugins(conf.method, conf.url); + conf = await anyPlugin.interceptRequest(this.api, conf); + if (endpointPlugin) { + conf = await endpointPlugin.interceptRequest(this.api, conf); + } + let response = this.options.fetcherProvider.fetch(conf); + if (endpointPlugin) { + response = endpointPlugin.interceptResponse(this.api, conf, response); + } + response = anyPlugin.interceptResponse(this.api, conf, response); + return (await response).data; + } + + /** + * make a get request to the api + * @param path - the path to api endpoint + * @param config - the config to setup axios options and parameters + * @returns response validated with zod schema provided in the api description + */ + async get< + Path extends ZodiosPathsByMethod, + TConfig extends ZodiosRequestOptionsByPath< + Api, + "get", + Path, + true, + TypeProvider, + FetcherProvider + > + >( + path: Path, + ...[config]: RequiredKeys extends never + ? [config?: ReadonlyDeep] + : [config: ReadonlyDeep] + ): Promise> { + return this.request({ + ...config, + method: "get", + url: path, + }); + } + + /** + * make a post request to the api + * @param path - the path to api endpoint + * @param data - the data to send + * @param config - the config to setup axios options and parameters + * @returns response validated with zod schema provided in the api description + */ + async post< + Path extends ZodiosPathsByMethod, + TConfig extends ZodiosRequestOptionsByPath< + Api, + "post", + Path, + true, + TypeProvider, + FetcherProvider + > + >( + path: Path, + ...[config]: RequiredKeys extends never + ? [config?: ReadonlyDeep] + : [config: ReadonlyDeep] + ): Promise> { + return this.request({ + ...config, + method: "post", + url: path, + }); + } + + /** + * make a put request to the api + * @param path - the path to api endpoint + * @param data - the data to send + * @param config - the config to setup axios options and parameters + * @returns response validated with zod schema provided in the api description + */ + async put< + Path extends ZodiosPathsByMethod, + TConfig extends ZodiosRequestOptionsByPath< + Api, + "put", + Path, + true, + TypeProvider, + FetcherProvider + > + >( + path: Path, + ...[config]: RequiredKeys extends never + ? [config?: ReadonlyDeep] + : [config: ReadonlyDeep] + ): Promise> { + return this.request({ + ...config, + method: "put", + url: path, + }); + } + + /** + * make a patch request to the api + * @param path - the path to api endpoint + * @param data - the data to send + * @param config - the config to setup axios options and parameters + * @returns response validated with zod schema provided in the api description + */ + async patch< + Path extends ZodiosPathsByMethod, + TConfig extends ZodiosRequestOptionsByPath< + Api, + "patch", + Path, + true, + TypeProvider, + FetcherProvider + > + >( + path: Path, + ...[config]: RequiredKeys extends never + ? [config?: ReadonlyDeep] + : [config: ReadonlyDeep] + ): Promise> { + return this.request({ + ...config, + method: "patch", + url: path, + }); + } + + /** + * make a delete request to the api + * @param path - the path to api endpoint + * @param config - the config to setup axios options and parameters + * @returns response validated with zod schema provided in the api description + */ + async delete< + Path extends ZodiosPathsByMethod, + TConfig extends ZodiosRequestOptionsByPath< + Api, + "delete", + Path, + true, + TypeProvider, + FetcherProvider + > + >( + path: Path, + ...[config]: RequiredKeys extends never + ? [config?: ReadonlyDeep] + : [config: ReadonlyDeep] + ): Promise> { + return this.request({ + ...config, + method: "delete", + url: path, + }); + } +} + +export type ZodiosInstance< + Api extends ZodiosEndpointDefinitions, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, + FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider +> = ZodiosClass & + ZodiosAliases; + +export type ZodiosConstructor = { + new < + Api extends ZodiosEndpointDefinitions, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, + FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider + >( + api: Narrow, + options?: ZodiosOptions & + TypeOfFetcherOptions + ): ZodiosInstance; + new < + Api extends ZodiosEndpointDefinitions, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, + FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider + >( + baseUrl: string, + api: Narrow, + options?: ZodiosOptions & + TypeOfFetcherOptions + ): ZodiosInstance; +}; + +export const Zodios = ZodiosClass as ZodiosConstructor; + +/** + * Get the Api description type from zodios + * @param Z - zodios type + */ +export type ApiOf> = Z["api"]; +/** + * Get the type provider type from zodios + * @param Z - zodios type + */ +export type TypeProviderOf> = + Z["_typeProvider"]; + +export type FetcherProviderOf> = + Z["_fetcherProvider"]; diff --git a/packages/axios/src/zodios.types.ts b/packages/axios/src/zodios.types.ts new file mode 100644 index 00000000..5b2883c6 --- /dev/null +++ b/packages/axios/src/zodios.types.ts @@ -0,0 +1,836 @@ +import type { + FilterArrayByValue, + PickDefined, + NeverIfEmpty, + UndefinedToOptional, + PathParamNames, + TransitiveOptional, + ReadonlyDeep, + Merge, + FilterArrayByKey, + IfEquals, + RequiredKeys, + UndefinedIfNever, +} from "./utils.types"; +import type { + AnyZodiosTypeProvider, + InferInputTypeFromSchema, + InferOutputTypeFromSchema, + ZodiosRuntimeTypeProvider, + ZodTypeProvider, +} from "./type-providers"; +import { + AnyZodiosFetcherProvider, + TypeOfFetcherConfig, + TypeOfFetcherError, + TypeOfFetcherResponse, + ZodiosRuntimeFetcherProvider, + AxiosProvider, +} from "./fetcher-providers"; + +export type MutationMethod = "post" | "put" | "patch" | "delete"; + +export type Method = "get" | "head" | "options" | MutationMethod; + +export type RequestFormat = + | "json" // default + | "form-data" // for file uploads + | "form-url" // for hiding query params in the body + | "binary" // for binary data / file uploads + | "text"; // for text data + +type EndpointDefinitionsByMethod< + Api extends ZodiosEndpointDefinition[], + M extends Method +> = FilterArrayByValue; + +export type ZodiosEndpointDefinitionByPath< + Api extends ZodiosEndpointDefinition[], + M extends Method, + Path extends ZodiosPathsByMethod +> = FilterArrayByValue; + +export type ZodiosEndpointDefinitionByAlias< + Api extends ZodiosEndpointDefinition[], + Alias extends string +> = FilterArrayByValue; + +export type ZodiosPathsByMethod< + Api extends ZodiosEndpointDefinition[], + M extends Method +> = EndpointDefinitionsByMethod[number]["path"]; + +export type Aliases = FilterArrayByKey< + Api, + "alias" +>[number]["alias"]; + +export type ZodiosResponseForEndpoint< + Endpoint extends ZodiosEndpointDefinition, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = Frontend extends true + ? InferOutputTypeFromSchema + : InferInputTypeFromSchema; + +export type ZodiosResponseByPath< + Api extends ZodiosEndpointDefinition[], + M extends Method, + Path extends ZodiosPathsByMethod, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = Frontend extends true + ? InferOutputTypeFromSchema< + TypeProvider, + ZodiosEndpointDefinitionByPath[number]["response"] + > + : InferInputTypeFromSchema< + TypeProvider, + ZodiosEndpointDefinitionByPath[number]["response"] + >; + +export type ZodiosResponseByAlias< + Api extends ZodiosEndpointDefinition[], + Alias extends string, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = Frontend extends true + ? InferOutputTypeFromSchema< + TypeProvider, + ZodiosEndpointDefinitionByAlias[number]["response"] + > + : InferInputTypeFromSchema< + TypeProvider, + ZodiosEndpointDefinitionByAlias[number]["response"] + >; + +export type ZodiosDefaultErrorForEndpoint< + Endpoint extends ZodiosEndpointDefinition +> = FilterArrayByValue< + Endpoint["errors"], + { + status: "default"; + } +>[number]["schema"]; + +type ZodiosDefaultErrorByPath< + Api extends ZodiosEndpointDefinition[], + M extends Method, + Path extends ZodiosPathsByMethod +> = FilterArrayByValue< + ZodiosEndpointDefinitionByPath[number]["errors"], + { + status: "default"; + } +>[number]["schema"]; + +type ZodiosDefaultErrorByAlias< + Api extends ZodiosEndpointDefinition[], + Alias extends string +> = FilterArrayByValue< + ZodiosEndpointDefinitionByAlias[number]["errors"], + { + status: "default"; + } +>[number]["schema"]; + +type IfNever = IfEquals; + +export type ZodiosErrorForEndpoint< + Endpoint extends ZodiosEndpointDefinition, + Status extends number, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = Frontend extends true + ? InferOutputTypeFromSchema< + TypeProvider, + IfNever< + FilterArrayByValue< + Endpoint["errors"], + { + status: Status; + } + >[number]["schema"], + ZodiosDefaultErrorForEndpoint + > + > + : InferInputTypeFromSchema< + TypeProvider, + IfNever< + FilterArrayByValue< + Endpoint["errors"], + { + status: Status; + } + >[number]["schema"], + ZodiosDefaultErrorForEndpoint + > + >; + +export type ZodiosErrorByPath< + Api extends ZodiosEndpointDefinition[], + M extends Method, + Path extends ZodiosPathsByMethod, + Status extends number, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = Frontend extends true + ? InferOutputTypeFromSchema< + TypeProvider, + IfNever< + FilterArrayByValue< + ZodiosEndpointDefinitionByPath[number]["errors"], + { + status: Status; + } + >[number]["schema"], + ZodiosDefaultErrorByPath + > + > + : InferInputTypeFromSchema< + TypeProvider, + IfNever< + FilterArrayByValue< + ZodiosEndpointDefinitionByPath[number]["errors"], + { + status: Status; + } + >[number]["schema"], + ZodiosDefaultErrorByPath + > + >; + +export type InferFetcherErrors< + T, + TypeProvider extends AnyZodiosTypeProvider, + FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider, + Acc extends unknown[] = [] +> = T extends [infer Head, ...infer Tail] + ? Head extends { + status: infer Status; + schema: infer Schema; + } + ? InferFetcherErrors< + Tail, + TypeProvider, + FetcherProvider, + [ + ...Acc, + TypeOfFetcherError< + FetcherProvider, + InferOutputTypeFromSchema, + Status + > + ] + > + : Acc + : Acc; + +export type ZodiosMatchingErrorsByPath< + Api extends ZodiosEndpointDefinition[], + M extends Method, + Path extends ZodiosPathsByMethod, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = InferFetcherErrors< + ZodiosEndpointDefinitionByPath[number]["errors"], + TypeProvider +>[number]; + +export type ZodiosMatchingErrorsByAlias< + Api extends ZodiosEndpointDefinition[], + Alias extends string, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = InferFetcherErrors< + ZodiosEndpointDefinitionByAlias[number]["errors"], + TypeProvider +>[number]; + +export type ZodiosErrorByAlias< + Api extends ZodiosEndpointDefinition[], + Alias extends string, + Status extends number, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = Frontend extends true + ? InferOutputTypeFromSchema< + TypeProvider, + IfNever< + FilterArrayByValue< + ZodiosEndpointDefinitionByAlias[number]["errors"], + { + status: Status; + } + >[number]["schema"], + ZodiosDefaultErrorByAlias + > + > + : InferInputTypeFromSchema< + TypeProvider, + IfNever< + FilterArrayByValue< + ZodiosEndpointDefinitionByAlias[number]["errors"], + { + status: Status; + } + >[number]["schema"], + ZodiosDefaultErrorByAlias + > + >; + +export type BodySchemaForEndpoint = + FilterArrayByValue< + Endpoint["parameters"], + { type: "Body" } + >[number]["schema"]; + +export type BodySchema< + Api extends ZodiosEndpointDefinition[], + M extends Method, + Path extends ZodiosPathsByMethod +> = FilterArrayByValue< + ZodiosEndpointDefinitionByPath[number]["parameters"], + { type: "Body" } +>[number]["schema"]; + +export type ZodiosBodyForEndpoint< + Endpoint extends ZodiosEndpointDefinition, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = Frontend extends true + ? InferInputTypeFromSchema> + : InferOutputTypeFromSchema>; + +export type ZodiosBodyByPath< + Api extends ZodiosEndpointDefinition[], + M extends Method, + Path extends ZodiosPathsByMethod, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = Frontend extends true + ? InferInputTypeFromSchema> + : InferOutputTypeFromSchema>; + +export type BodySchemaByAlias< + Api extends ZodiosEndpointDefinition[], + Alias extends string +> = FilterArrayByValue< + ZodiosEndpointDefinitionByAlias[number]["parameters"], + { type: "Body" } +>[number]["schema"]; + +export type ZodiosBodyByAlias< + Api extends ZodiosEndpointDefinition[], + Alias extends string, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = Frontend extends true + ? InferInputTypeFromSchema> + : InferOutputTypeFromSchema>; + +/** + * Map a type an api description parameter to a zod infer type + * @param T - array of api description parameters + * @details - this is using tail recursion type optimization from typescript 4.5 + */ +export type MapSchemaParameters< + T, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, + Acc = {} +> = T extends [infer Head, ...infer Tail] + ? Head extends { + name: infer Name; + schema: infer Schema; + } + ? Name extends string + ? MapSchemaParameters< + Tail, + Frontend, + TypeProvider, + Merge< + { + [Key in Name]: Frontend extends true + ? InferInputTypeFromSchema + : InferOutputTypeFromSchema; + }, + Acc + > + > + : Acc + : Acc + : Acc; + +export type ZodiosQueryParamsForEndpoint< + Endpoint extends ZodiosEndpointDefinition, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = NeverIfEmpty< + UndefinedToOptional< + MapSchemaParameters< + FilterArrayByValue, + Frontend, + TypeProvider + > + > +>; + +export type ZodiosQueryParamsByPath< + Api extends ZodiosEndpointDefinition[], + M extends Method, + Path extends ZodiosPathsByMethod, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = NeverIfEmpty< + UndefinedToOptional< + MapSchemaParameters< + FilterArrayByValue< + ZodiosEndpointDefinitionByPath[number]["parameters"], + { type: "Query" } + >, + Frontend, + TypeProvider + > + > +>; + +export type ZodiosQueryParamsByAlias< + Api extends ZodiosEndpointDefinition[], + Alias extends string, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = NeverIfEmpty< + UndefinedToOptional< + MapSchemaParameters< + FilterArrayByValue< + ZodiosEndpointDefinitionByAlias[number]["parameters"], + { type: "Query" } + >, + Frontend, + TypeProvider + > + > +>; + +/** + * @deprecated - use ZodiosQueryParamsByPath instead + */ +export type ZodiosPathParams = NeverIfEmpty< + Record, string | number> +>; + +export type ZodiosPathParamsForEndpoint< + Endpoint extends ZodiosEndpointDefinition, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, + PathParameters = MapSchemaParameters< + FilterArrayByValue, + Frontend, + TypeProvider + > +> = NeverIfEmpty<{ + [K in PathParamNames]: PathParameters extends { + [Key in K]: any; + } + ? PathParameters[K] + : string | number; +}>; + +/** + * Get path params for a given endpoint by path + */ +export type ZodiosPathParamsByPath< + Api extends ZodiosEndpointDefinition[], + M extends Method, + Path extends ZodiosPathsByMethod, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, + PathParameters = MapSchemaParameters< + FilterArrayByValue< + ZodiosEndpointDefinitionByPath[number]["parameters"], + { type: "Path" } + >, + Frontend, + TypeProvider + > +> = NeverIfEmpty<{ + [K in PathParamNames]: PathParameters extends { [Key in K]: any } + ? PathParameters[K] + : string | number; +}>; + +/** + * Get path params for a given endpoint by alias + */ +export type ZodiosPathParamByAlias< + Api extends ZodiosEndpointDefinition[], + Alias extends string, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, + EndpointDefinition extends ZodiosEndpointDefinition = ZodiosEndpointDefinitionByAlias< + Api, + Alias + >[number], + Path = EndpointDefinition["path"], + PathParameters = MapSchemaParameters< + FilterArrayByValue, + Frontend, + TypeProvider + > +> = NeverIfEmpty<{ + [K in PathParamNames]: PathParameters extends { [Key in K]: any } + ? PathParameters[K] + : string | number; +}>; + +export type ZodiosHeaderParamsForEndpoint< + Endpoint extends ZodiosEndpointDefinition, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = NeverIfEmpty< + UndefinedToOptional< + MapSchemaParameters< + FilterArrayByValue, + Frontend, + TypeProvider + > + > +>; + +export type ZodiosHeaderParamsByPath< + Api extends ZodiosEndpointDefinition[], + M extends Method, + Path extends ZodiosPathsByMethod, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = NeverIfEmpty< + UndefinedToOptional< + MapSchemaParameters< + FilterArrayByValue< + ZodiosEndpointDefinitionByPath[number]["parameters"], + { type: "Header" } + >, + Frontend, + TypeProvider + > + > +>; + +export type ZodiosHeaderParamsByAlias< + Api extends ZodiosEndpointDefinition[], + Alias extends string, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = NeverIfEmpty< + UndefinedToOptional< + MapSchemaParameters< + FilterArrayByValue< + ZodiosEndpointDefinitionByAlias[number]["parameters"], + { type: "Header" } + >, + Frontend, + TypeProvider + > + > +>; + +export type ZodiosRequestOptionsByAlias< + Api extends ZodiosEndpointDefinition[], + Alias extends string, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, + FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider +> = Merge< + TypeOfFetcherConfig, + TransitiveOptional< + PickDefined<{ + params: ZodiosPathParamByAlias; + queries: ZodiosQueryParamsByAlias; + headers: ZodiosHeaderParamsByAlias; + body: ZodiosBodyByAlias; + }> + > +>; + +export type ZodiosMutationAliasRequest = + RequiredKeys extends never + ? (configOptions?: ReadonlyDeep) => Promise + : (configOptions: ReadonlyDeep) => Promise; + +export type ZodiosAliasRequest = + RequiredKeys extends never + ? (configOptions?: ReadonlyDeep) => Promise + : (configOptions: ReadonlyDeep) => Promise; + +export type ZodiosAliases< + Api extends ZodiosEndpointDefinition[], + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, + FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider +> = { + [Alias in Aliases]: ZodiosEndpointDefinitionByAlias< + Api, + Alias + >[number]["method"] extends MutationMethod + ? ZodiosMutationAliasRequest< + ZodiosRequestOptionsByAlias< + Api, + Alias, + Frontend, + TypeProvider, + FetcherProvider + >, + ZodiosResponseByAlias + > + : ZodiosAliasRequest< + ZodiosRequestOptionsByAlias< + Api, + Alias, + Frontend, + TypeProvider, + FetcherProvider + >, + ZodiosResponseByAlias + >; +}; + +export type AnyZodiosMethodOptions< + FetcherProvider extends AnyZodiosFetcherProvider +> = Merge< + TypeOfFetcherConfig, + { + params?: Record; + queries?: Record; + headers?: Record; + body?: unknown; + } +>; + +export type AnyZodiosRequestOptions< + FetcherProvider extends AnyZodiosFetcherProvider +> = Merge< + { method: Method; url: string }, + AnyZodiosMethodOptions +>; + +/** + * Get the request options for a given endpoint + */ +export type ZodiosRequestOptionsByPath< + Api extends ZodiosEndpointDefinition[], + M extends Method, + Path extends ZodiosPathsByMethod, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, + FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider +> = Merge< + TypeOfFetcherConfig, + TransitiveOptional< + PickDefined<{ + params: ZodiosPathParamsByPath; + queries: ZodiosQueryParamsByPath; + headers: ZodiosHeaderParamsByPath; + body: ZodiosBodyByPath; + }> + > +>; + +export type ZodiosRequestOptions< + Api extends ZodiosEndpointDefinition[], + M extends Method, + Path extends ZodiosPathsByMethod, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, + FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider +> = Merge< + { + method: M; + url: Path; + data?: ZodiosBodyByPath; + }, + ZodiosRequestOptionsByPath< + Api, + M, + Path, + Frontend, + TypeProvider, + FetcherProvider + > +>; + +/** + * Zodios options + */ +export type ZodiosOptions< + FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = { + /** + * Should zodios validate parameters and response? Default: true + */ + validate?: boolean | "request" | "response" | "all" | "none"; + /** + * Should zodios transform the request and response ? Default: true + */ + transform?: boolean | "request" | "response"; + /** + * Should zod schema default values be used on parameters? Default: false + * you usually want your backend to handle default values + */ + sendDefaults?: boolean; + + fetcherProvider?: ZodiosRuntimeFetcherProvider; + + /** + * set a custom type provider. Default: ZodTypeProvider + */ + typeProvider?: ZodiosRuntimeTypeProvider; +}; + +export type ZodiosEndpointParameter = { + /** + * name of the parameter + */ + name: string; + /** + * optional description of the parameter + */ + description?: string; + /** + * type of the parameter: Query, Body, Header, Path + */ + type: "Query" | "Body" | "Header" | "Path"; + /** + * zod schema of the parameter + * you can use zod `transform` to transform the value of the parameter before sending it to the server + */ + schema: unknown; +}; + +export type ZodiosEndpointParameters = ZodiosEndpointParameter[]; + +export type ZodiosEndpointError = { + /** + * status code of the error + * use 'default' to declare a default error + */ + status: number | "default"; + /** + * description of the error - used to generate the openapi error description + */ + description?: string; + /** + * schema of the error + */ + schema: unknown; +}; + +export type ZodiosEndpointErrors = ZodiosEndpointError[]; + +/** + * Zodios enpoint definition that should be used to create a new instance of Zodios + */ +export type ZodiosEndpointDefinition = { + /** + * http method : get, post, put, patch, delete + */ + method: Method; + /** + * path of the endpoint + * @example + * ```text + * /posts/:postId/comments/:commentId + * ``` + */ + path: string; + /** + * optional alias to call the endpoint easily + * @example + * ```text + * getPostComments + * ``` + */ + alias?: string; + /** + * optional description of the endpoint + */ + description?: string; + /** + * optional request format of the endpoint: json, form-data, form-url, binary, text + */ + requestFormat?: RequestFormat; + /** + * optionally mark the endpoint as immutable to allow zodios to cache the response with react-query + * use it to mark a 'post' endpoint as immutable + */ + immutable?: boolean; + /** + * optional parameters of the endpoint + */ + parameters?: Array; + /** + * response of the endpoint + * you can use zod `transform` to transform the value of the response before returning it + */ + response: unknown; + /** + * optional response status of the endpoint for sucess, default is 200 + * customize it if your endpoint returns a different status code and if you need openapi to generate the correct status code + */ + status?: number; + /** + * optional response description of the endpoint + */ + responseDescription?: string; + /** + * optional errors of the endpoint - only usefull when using @zodios/express + */ + errors?: Array; +}; + +export type ZodiosEndpointDefinitions = ZodiosEndpointDefinition[]; + +/** + * Zodios plugin that can be used to intercept zodios requests and responses + */ +export type ZodiosPlugin = { + /** + * Optional name of the plugin + * naming a plugin allows to remove it or replace it later + */ + name?: string; + /** + * request interceptor to modify or inspect the request before it is sent + * @param api - the api description + * @param request - the request config + * @returns possibly a new request config + */ + request?: ( + api: ZodiosEndpointDefinitions, + config: ReadonlyDeep> + ) => Promise>>; + /** + * response interceptor to modify or inspect the response before it is returned + * @param api - the api description + * @param config - the request config + * @param response - the response + * @returns possibly a new response + */ + response?: ( + api: ZodiosEndpointDefinitions, + config: ReadonlyDeep>, + response: TypeOfFetcherResponse + ) => Promise>; + /** + * error interceptor for response errors + * there is no error interceptor for request errors + * @param api - the api description + * @param config - the config for the request + * @param error - the error that occured + * @returns possibly a new response or a new error + */ + error?: ( + api: ZodiosEndpointDefinitions, + config: ReadonlyDeep>, + error: Error + ) => Promise>; +}; diff --git a/packages/axios/tsconfig.build.json b/packages/axios/tsconfig.build.json new file mode 100644 index 00000000..3add8009 --- /dev/null +++ b/packages/axios/tsconfig.build.json @@ -0,0 +1,17 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "target": "ES6", + "sourceMap": false + }, + "exclude": [ + "node_modules", + "lib", + "examples", + "website", + "**/*.config.ts", + "**/*.spec.ts", + "**/*.test.ts", + "**/*.d.ts" + ] +} diff --git a/packages/axios/tsconfig.json b/packages/axios/tsconfig.json new file mode 100644 index 00000000..4f66f56f --- /dev/null +++ b/packages/axios/tsconfig.json @@ -0,0 +1,18 @@ +{ + // ts config for es 2021 + "compilerOptions": { + "target": "ES2019", + "module": "CommonJS", + "moduleResolution": "Node", + "lib": ["ES2019"], + "outDir": "./lib", + "alwaysStrict": true, + "strict": true, + "esModuleInterop": true, + "sourceMap": true, + "declaration": true, + "jsx": "react-jsx", + "types": ["jest", "node"] + }, + "exclude": ["node_modules", "lib"] +} diff --git a/packages/axios/tsup.config.js b/packages/axios/tsup.config.js new file mode 100644 index 00000000..6fc64294 --- /dev/null +++ b/packages/axios/tsup.config.js @@ -0,0 +1,14 @@ +import { defineConfig } from "tsup"; + +export default defineConfig({ + clean: true, + dts: true, + entry: ["src/index.ts", "src/utils.types.ts", "src/zodios.types.ts"], + outDir: "lib", + format: ["cjs", "esm"], + minify: true, + treeshake: true, + tsconfig: "tsconfig.build.json", + splitting: true, + sourcemap: false, +}); From 4556ac972b50b87e197e03c25681d4e5d50c6816 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sat, 19 Nov 2022 15:40:02 +0100 Subject: [PATCH 036/206] feat(fetcher): remove core axios dep --- package.json | 3 +- packages/core/package.json | 5 +- .../fetcher-providers/fetch-provider/fetch.ts | 4 +- .../fetch-provider/fetcher-provider.fetch.ts | 18 ++- packages/core/src/fetcher-providers/index.ts | 1 - packages/core/src/index.ts | 9 +- .../core/src/plugins/zod-validation.plugin.ts | 2 +- packages/core/src/utils.ts | 8 +- packages/core/src/zodios.test.ts | 127 ++++++++--------- packages/core/src/zodios.ts | 133 +++++++++++++----- packages/core/src/zodios.types.ts | 42 +++--- pnpm-lock.yaml | 79 ++++++++--- 12 files changed, 269 insertions(+), 162 deletions(-) diff --git a/package.json b/package.json index 0d18beb0..f827085f 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,8 @@ }, "private": true, "devDependencies": { + "@changesets/cli": "2.25.2", "turbo": "1.6.3", - "@changesets/cli": "^2.25.2" + "typescript": "4.9.3" } } diff --git a/packages/core/package.json b/packages/core/package.json index eedd2499..abb95753 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -26,7 +26,6 @@ }, "license": "MIT", "keywords": [ - "axios", "openapi", "zod", "autocomplete", @@ -44,7 +43,6 @@ "test": "jest --coverage" }, "peerDependencies": { - "axios": "^0.x || ^1.0.0", "fp-ts": "2.x", "io-ts": "2.x", "zod": "^3.x" @@ -68,7 +66,6 @@ "@types/multer": "1.4.7", "@types/node": "18.11.9", "@types/qs": "6.9.7", - "axios": "1.1.3", "express": "4.18.2", "fp-ts": "2.13.1", "io-ts": "2.2.19", @@ -78,7 +75,7 @@ "ts-jest": "29.0.3", "ts-node": "10.9.1", "tsup": "6.3.0", - "typescript": "4.8.4", + "typescript": "4.9.3", "zod": "3.19.1" }, "dependencies": { diff --git a/packages/core/src/fetcher-providers/fetch-provider/fetch.ts b/packages/core/src/fetcher-providers/fetch-provider/fetch.ts index d3e4d503..79a56cd2 100644 --- a/packages/core/src/fetcher-providers/fetch-provider/fetch.ts +++ b/packages/core/src/fetcher-providers/fetch-provider/fetch.ts @@ -3,7 +3,7 @@ import { FetchProviderResponse, FetchProviderConfig } from "./fetch.types"; import { buildURL, isBlob, isFile, isFormData } from "./fetch.utils"; import { FetchProvider } from "./fetcher-provider.fetch"; -export class FetchError extends Error { +export class FetchError extends Error { /** * constructore with same signature as AxiosError */ @@ -12,7 +12,7 @@ export class FetchError extends Error { public code?: string, public config?: FetchProviderConfig, public request?: Request, - public response?: FetchProviderResponse + public response?: FetchProviderResponse ) { super(message); } diff --git a/packages/core/src/fetcher-providers/fetch-provider/fetcher-provider.fetch.ts b/packages/core/src/fetcher-providers/fetch-provider/fetcher-provider.fetch.ts index 3978de92..2b224cc7 100644 --- a/packages/core/src/fetcher-providers/fetch-provider/fetcher-provider.fetch.ts +++ b/packages/core/src/fetcher-providers/fetch-provider/fetcher-provider.fetch.ts @@ -4,13 +4,21 @@ import { } from "../fetcher-provider.types"; import { omit, replacePathParams } from "../../utils"; import { FetchProviderConfig, FetchProviderResponse } from "./fetch.types"; -import { advancedFetch } from "./fetch"; +import { advancedFetch, FetchError } from "./fetch"; import { AnyZodiosRequestOptions } from "../../zodios.types"; +import { Merge } from "../../utils.types"; -type FetchErrorStatus = { - status: Status extends "default" ? 0 & { error: "default" } : Status; - response: TResponse; -}; +type FetchErrorStatus = Merge< + Omit, "status" | "response">, + { + response: Merge< + FetchError["response"], + { + status: Status extends "default" ? 0 & { error: "default" } : Status; + } + >; + } +>; type FetchProviderOptions = { fetchConfig?: FetchProviderConfig; diff --git a/packages/core/src/fetcher-providers/index.ts b/packages/core/src/fetcher-providers/index.ts index 8f823752..1e2b121a 100644 --- a/packages/core/src/fetcher-providers/index.ts +++ b/packages/core/src/fetcher-providers/index.ts @@ -1,3 +1,2 @@ export * from "./fetcher-provider.types"; -export * from "./axios-provider/fetcher-provider.axios"; export * from "./fetch-provider"; diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 344903e7..2537004e 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -2,7 +2,6 @@ export { Zodios } from "./zodios"; export type { ApiOf, TypeProviderOf } from "./zodios"; export type { ZodiosInstance, ZodiosClass, ZodiosConstructor } from "./zodios"; export { ZodiosError } from "./zodios-error"; -export { isErrorFromPath, isErrorFromAlias } from "./zodios-error.utils"; export type { AnyZodiosMethodOptions, AnyZodiosRequestOptions, @@ -58,6 +57,14 @@ export { tsSchema, tsFnSchema, } from "./type-providers"; +export type { + AnyZodiosFetcherProvider, + TypeOfFetcherConfig, + TypeOfFetcherError, + TypeOfFetcherOptions, + TypeOfFetcherResponse, + ZodiosRuntimeFetcherProvider, +} from "./fetcher-providers"; export { PluginId, zodValidationPlugin, diff --git a/packages/core/src/plugins/zod-validation.plugin.ts b/packages/core/src/plugins/zod-validation.plugin.ts index 3882052d..4ae989fe 100644 --- a/packages/core/src/plugins/zod-validation.plugin.ts +++ b/packages/core/src/plugins/zod-validation.plugin.ts @@ -2,7 +2,7 @@ import { findEndpoint } from "../utils"; import { ZodiosError } from "../zodios-error"; import type { AnyZodiosTypeProvider } from "../type-providers"; import type { ZodiosOptions, ZodiosPlugin } from "../zodios.types"; -import { AnyZodiosFetcherProvider, AxiosProvider } from "../fetcher-providers"; +import { AnyZodiosFetcherProvider } from "../fetcher-providers"; type Options< FetcherProvider extends AnyZodiosFetcherProvider, diff --git a/packages/core/src/utils.ts b/packages/core/src/utils.ts index fc218b10..429dfc25 100644 --- a/packages/core/src/utils.ts +++ b/packages/core/src/utils.ts @@ -1,7 +1,5 @@ -import { AxiosError } from "axios"; import type { ReadonlyDeep } from "./utils.types"; import type { - AnyZodiosRequestOptions, ZodiosEndpointDefinition, ZodiosEndpointDefinitions, } from "./zodios.types"; @@ -83,7 +81,7 @@ export function findEndpointByAlias( export function findEndpointErrors( endpoint: ZodiosEndpointDefinition, - err: AxiosError + err: any ) { const matchingErrors = endpoint.errors?.filter( (error) => error.status === err.response!.status @@ -96,7 +94,7 @@ export function findEndpointErrorsByPath( api: ZodiosEndpointDefinitions, method: string, path: string, - err: AxiosError + err: any ) { const endpoint = findEndpoint(api, method, path); return endpoint && @@ -111,7 +109,7 @@ export function findEndpointErrorsByPath( export function findEndpointErrorsByAlias( api: ZodiosEndpointDefinitions, alias: string, - err: AxiosError + err: any ) { const endpoint = findEndpointByAlias(api, alias); diff --git a/packages/core/src/zodios.test.ts b/packages/core/src/zodios.test.ts index 5e3f30c9..cbc43847 100644 --- a/packages/core/src/zodios.test.ts +++ b/packages/core/src/zodios.test.ts @@ -1,18 +1,17 @@ -import { AxiosError } from "axios"; import express from "express"; import { AddressInfo } from "net"; import { z, ZodError } from "zod"; -//if (globalThis.FormData === undefined) { -globalThis.FormData = require("form-data"); -//} +if (globalThis.FormData === undefined) { + globalThis.FormData = require("form-data"); +} import { Zodios } from "./zodios"; import { ZodiosError } from "./zodios-error"; import multer from "multer"; import { ZodiosPlugin } from "./zodios.types"; import { apiBuilder } from "./api"; -import { isErrorFromPath, isErrorFromAlias } from "./zodios-error.utils"; import { Assert } from "./utils.types"; -import { AnyZodiosFetcherProvider } from "./fetcher-providers"; +import { AnyZodiosFetcherProvider, fetchProvider } from "./fetcher-providers"; +import { FetchError } from "./fetcher-providers/fetch-provider/fetch"; const multipart = multer({ storage: multer.memoryStorage() }); @@ -816,68 +815,48 @@ received: }); it("should match Expected error", async () => { - const zodios = new Zodios(`http://localhost:${port}`, [ - { - method: "get", - alias: "getError502", - path: "/error502", - response: z.void(), - errors: [ - { - status: 502, - schema: z.object({ - error: z.object({ - message: z.string(), - _502: z.literal(true), + const zodios = new Zodios( + `http://localhost:${port}`, + [ + { + method: "get", + alias: "getError502", + path: "/error502", + response: z.void(), + errors: [ + { + status: 502, + schema: z.object({ + error: z.object({ + message: z.string(), + }), }), - }), - }, - { - status: 401, - schema: z.object({ - error: z.object({ - message: z.string(), - _401: z.literal(true), + }, + { + status: 401, + schema: z.object({ + error: z.object({ + message: z.string(), + _401: z.literal(true), + }), }), - }), - }, - { - status: "default", - schema: z.object({ - error: z.object({ - message: z.string(), - _default: z.literal(true), + }, + { + status: "default", + schema: z.object({ + error: z.object({ + message: z.string(), + _default: z.literal(true), + }), }), - }), - }, - ], - }, + }, + ], + }, + ], { - method: "get", - alias: "getErrorById", - path: "/error502/:id", - response: z.void(), - errors: [ - { - status: 502, - schema: z.object({ - error: z.object({ - message: z.string(), - }), - }), - }, - { - status: 401, - schema: z.object({ - error: z.object({ - message: z.string(), - _401: z.literal(true), - }), - }), - }, - ], - }, - ]); + fetcherProvider: fetchProvider, + } + ); let error; try { await zodios.get("/error502"); @@ -885,8 +864,8 @@ received: error = e; } expect(error).toBeInstanceOf(Error); - expect((error as AxiosError).response?.status).toBe(502); - if (isErrorFromPath(zodios.api, "get", "/error502", error)) { + expect((error as FetchError).response?.status).toBe(502); + if (zodios.isErrorFromPath(zodios.api, "get", "/error502", error)) { expect(error.response.status).toBe(502); if (error.response.status === 502) { const data = error.response.data; @@ -899,7 +878,7 @@ received: error: { message: "bad gateway" }, }); } - if (isErrorFromAlias(zodios.api, "getError502", error)) { + if (zodios.isErrorFromAlias(zodios.api, "getError502", error)) { expect(error.response.status).toBe(502); if (error.response.status === 502) { const data = error.response.data; @@ -1099,9 +1078,13 @@ received: } expect(error).toBeInstanceOf(Error); - expect((error as AxiosError).response?.status).toBe(502); - expect(isErrorFromPath(zodios.api, "get", "/error502", error)).toBe(false); - expect(isErrorFromAlias(zodios.api, "getError502", error)).toBe(false); + expect((error as FetchError).response?.status).toBe(502); + expect(zodios.isErrorFromPath(zodios.api, "get", "/error502", error)).toBe( + false + ); + expect(zodios.isErrorFromAlias(zodios.api, "getError502", error)).toBe( + false + ); }); it("should return response when disabling validation", async () => { @@ -1127,7 +1110,7 @@ received: }); }); - it("should trigger an axios error with error response", async () => { + it("should trigger an error with error response", async () => { const zodios = new Zodios(`http://localhost:${port}`, [ { method: "get", @@ -1141,7 +1124,7 @@ received: try { await zodios.get("/error502"); } catch (e) { - expect((e as AxiosError).response?.data).toEqual({ + expect((e as FetchError).response?.data).toEqual({ error: { message: "bad gateway", }, diff --git a/packages/core/src/zodios.ts b/packages/core/src/zodios.ts index 4f25def6..5fc0a23d 100644 --- a/packages/core/src/zodios.ts +++ b/packages/core/src/zodios.ts @@ -11,6 +11,9 @@ import type { ZodiosAliases, ZodiosPlugin, Aliases, + ZodiosEndpointError, + ZodiosMatchingErrorsByPath, + ZodiosMatchingErrorsByAlias, } from "./zodios.types"; import { PluginId, @@ -32,11 +35,10 @@ import type { AnyZodiosTypeProvider, ZodTypeProvider } from "./type-providers"; import { zodTypeProvider } from "./type-providers"; import { AnyZodiosFetcherProvider, - axiosProvider, - AxiosProvider, fetchProvider, TypeOfFetcherOptions, } from "./fetcher-providers"; +import { findEndpointErrorsByAlias, findEndpointErrorsByPath } from "./utils"; interface ZodiosBase< Api extends ZodiosEndpointDefinitions, @@ -49,12 +51,12 @@ interface ZodiosBase< } /** - * zodios api client based on axios + * zodios api client */ export class ZodiosClass< Api extends ZodiosEndpointDefinitions, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, - FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider + FetcherProvider extends AnyZodiosFetcherProvider, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider > implements ZodiosBase { public readonly options: PickRequired< @@ -145,7 +147,7 @@ export class ZodiosClass< transform: true, sendDefaults: false, typeProvider: zodTypeProvider as any, - fetcherProvider: axiosProvider, + fetcherProvider: fetchProvider, ...options, }; this._typeProvider = undefined as any; @@ -286,7 +288,7 @@ export class ZodiosClass< M extends Method, Path extends ZodiosPathsByMethod, TConfig = ReadonlyDeep< - ZodiosRequestOptions + ZodiosRequestOptions > >( config: TConfig @@ -311,7 +313,7 @@ export class ZodiosClass< /** * make a get request to the api * @param path - the path to api endpoint - * @param config - the config to setup axios options and parameters + * @param config - the config to setup options and parameters * @returns response validated with zod schema provided in the api description */ async get< @@ -320,9 +322,9 @@ export class ZodiosClass< Api, "get", Path, + FetcherProvider, true, - TypeProvider, - FetcherProvider + TypeProvider > >( path: Path, @@ -341,7 +343,7 @@ export class ZodiosClass< * make a post request to the api * @param path - the path to api endpoint * @param data - the data to send - * @param config - the config to setup axios options and parameters + * @param config - the config to setup options and parameters * @returns response validated with zod schema provided in the api description */ async post< @@ -350,9 +352,9 @@ export class ZodiosClass< Api, "post", Path, + FetcherProvider, true, - TypeProvider, - FetcherProvider + TypeProvider > >( path: Path, @@ -371,7 +373,7 @@ export class ZodiosClass< * make a put request to the api * @param path - the path to api endpoint * @param data - the data to send - * @param config - the config to setup axios options and parameters + * @param config - the config to setup options and parameters * @returns response validated with zod schema provided in the api description */ async put< @@ -380,9 +382,9 @@ export class ZodiosClass< Api, "put", Path, + FetcherProvider, true, - TypeProvider, - FetcherProvider + TypeProvider > >( path: Path, @@ -401,7 +403,7 @@ export class ZodiosClass< * make a patch request to the api * @param path - the path to api endpoint * @param data - the data to send - * @param config - the config to setup axios options and parameters + * @param config - the config to setup options and parameters * @returns response validated with zod schema provided in the api description */ async patch< @@ -410,9 +412,9 @@ export class ZodiosClass< Api, "patch", Path, + FetcherProvider, true, - TypeProvider, - FetcherProvider + TypeProvider > >( path: Path, @@ -430,7 +432,7 @@ export class ZodiosClass< /** * make a delete request to the api * @param path - the path to api endpoint - * @param config - the config to setup axios options and parameters + * @param config - the config to setup options and parameters * @returns response validated with zod schema provided in the api description */ async delete< @@ -439,9 +441,9 @@ export class ZodiosClass< Api, "delete", Path, + FetcherProvider, true, - TypeProvider, - FetcherProvider + TypeProvider > >( path: Path, @@ -455,35 +457,102 @@ export class ZodiosClass< url: path, }); } + + private isDefinedError( + error: unknown, + findEndpointErrors: (error: unknown) => ZodiosEndpointError[] | undefined + ): boolean { + if (error && typeof error === "object" && "response" in error) { + const response = error.response; + if (response && typeof response === "object" && "data" in response) { + const endpointErrors = findEndpointErrors(error); + if (endpointErrors) { + return endpointErrors.some( + (desc) => + this.options.typeProvider.validate(desc.schema, response.data) + .success + ); + } + } + } + return false; + } + + /** + * check if the error is matching the endpoint errors definitions + * @param api - the api definition + * @param method - http method of the endpoint + * @param path - path of the endpoint + * @param error - the error to check + * @returns - if true, the error type is narrowed to the matching endpoint errors + */ + isErrorFromPath>( + api: Api, + method: M, + path: Path, + error: unknown + ): error is ZodiosMatchingErrorsByPath< + Api, + M, + Path, + FetcherProvider, + TypeProvider + > { + return this.isDefinedError(error, (err) => + findEndpointErrorsByPath(api, method, path, err) + ); + } + + /** + * check if the error is matching the endpoint errors definitions + * @param api - the api definition + * @param alias - alias of the endpoint + * @param error - the error to check + * @returns - if true, the error type is narrowed to the matching endpoint errors + */ + isErrorFromAlias>( + api: Api, + alias: Alias, + error: unknown + ): error is ZodiosMatchingErrorsByAlias< + Api, + Alias, + FetcherProvider, + TypeProvider + > { + return this.isDefinedError(error, (err) => + findEndpointErrorsByAlias(api, alias, err) + ); + } } export type ZodiosInstance< Api extends ZodiosEndpointDefinitions, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, - FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider -> = ZodiosClass & - ZodiosAliases; + FetcherProvider extends AnyZodiosFetcherProvider, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = ZodiosClass & + ZodiosAliases; export type ZodiosConstructor = { new < Api extends ZodiosEndpointDefinitions, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, - FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider + FetcherProvider extends AnyZodiosFetcherProvider, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider >( api: Narrow, options?: ZodiosOptions & TypeOfFetcherOptions - ): ZodiosInstance; + ): ZodiosInstance; new < Api extends ZodiosEndpointDefinitions, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, - FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider + FetcherProvider extends AnyZodiosFetcherProvider, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider >( baseUrl: string, api: Narrow, options?: ZodiosOptions & TypeOfFetcherOptions - ): ZodiosInstance; + ): ZodiosInstance; }; export const Zodios = ZodiosClass as ZodiosConstructor; diff --git a/packages/core/src/zodios.types.ts b/packages/core/src/zodios.types.ts index 4fd08d0a..ea2316cd 100644 --- a/packages/core/src/zodios.types.ts +++ b/packages/core/src/zodios.types.ts @@ -10,7 +10,6 @@ import type { FilterArrayByKey, IfEquals, RequiredKeys, - UndefinedIfNever, } from "./utils.types"; import type { AnyZodiosTypeProvider, @@ -25,7 +24,6 @@ import { TypeOfFetcherError, TypeOfFetcherResponse, ZodiosRuntimeFetcherProvider, - AxiosProvider, } from "./fetcher-providers"; type AxiosRequestConfig = Parameters[0]; @@ -205,7 +203,7 @@ export type ZodiosErrorByPath< export type InferFetcherErrors< T, TypeProvider extends AnyZodiosTypeProvider, - FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider, + FetcherProvider extends AnyZodiosFetcherProvider, Acc extends unknown[] = [] > = T extends [infer Head, ...infer Tail] ? Head extends { @@ -232,19 +230,23 @@ export type ZodiosMatchingErrorsByPath< Api extends ZodiosEndpointDefinition[], M extends Method, Path extends ZodiosPathsByMethod, + FetcherProvider extends AnyZodiosFetcherProvider, TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider > = InferFetcherErrors< ZodiosEndpointDefinitionByPath[number]["errors"], - TypeProvider + TypeProvider, + FetcherProvider >[number]; export type ZodiosMatchingErrorsByAlias< Api extends ZodiosEndpointDefinition[], Alias extends string, + FetcherProvider extends AnyZodiosFetcherProvider, TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider > = InferFetcherErrors< ZodiosEndpointDefinitionByAlias[number]["errors"], - TypeProvider + TypeProvider, + FetcherProvider >[number]; export type ZodiosErrorByAlias< @@ -538,9 +540,9 @@ export type ZodiosHeaderParamsByAlias< export type ZodiosRequestOptionsByAlias< Api extends ZodiosEndpointDefinition[], Alias extends string, + FetcherProvider extends AnyZodiosFetcherProvider, Frontend extends boolean = true, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, - FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider > = Merge< TypeOfFetcherConfig, TransitiveOptional< @@ -565,9 +567,9 @@ export type ZodiosAliasRequest = export type ZodiosAliases< Api extends ZodiosEndpointDefinition[], + FetcherProvider extends AnyZodiosFetcherProvider, Frontend extends boolean = true, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, - FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider > = { [Alias in Aliases]: ZodiosEndpointDefinitionByAlias< Api, @@ -577,9 +579,9 @@ export type ZodiosAliases< ZodiosRequestOptionsByAlias< Api, Alias, + FetcherProvider, Frontend, - TypeProvider, - FetcherProvider + TypeProvider >, ZodiosResponseByAlias > @@ -587,9 +589,9 @@ export type ZodiosAliases< ZodiosRequestOptionsByAlias< Api, Alias, + FetcherProvider, Frontend, - TypeProvider, - FetcherProvider + TypeProvider >, ZodiosResponseByAlias >; @@ -621,9 +623,9 @@ export type ZodiosRequestOptionsByPath< Api extends ZodiosEndpointDefinition[], M extends Method, Path extends ZodiosPathsByMethod, + FetcherProvider extends AnyZodiosFetcherProvider, Frontend extends boolean = true, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, - FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider > = Merge< TypeOfFetcherConfig, TransitiveOptional< @@ -640,9 +642,9 @@ export type ZodiosRequestOptions< Api extends ZodiosEndpointDefinition[], M extends Method, Path extends ZodiosPathsByMethod, + FetcherProvider extends AnyZodiosFetcherProvider, Frontend extends boolean = true, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, - FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider > = Merge< { method: M; @@ -653,9 +655,9 @@ export type ZodiosRequestOptions< Api, M, Path, + FetcherProvider, Frontend, - TypeProvider, - FetcherProvider + TypeProvider > >; @@ -663,7 +665,7 @@ export type ZodiosRequestOptions< * Zodios options */ export type ZodiosOptions< - FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider, + FetcherProvider extends AnyZodiosFetcherProvider, TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider > = { /** diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8d569f97..45b78798 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,11 +4,56 @@ importers: .: specifiers: - '@changesets/cli': ^2.25.2 + '@changesets/cli': 2.25.2 turbo: 1.6.3 + typescript: 4.9.3 devDependencies: '@changesets/cli': 2.25.2 turbo: 1.6.3 + typescript: 4.9.3 + + packages/axios: + specifiers: + '@jest/globals': 29.3.1 + '@jest/types': 29.3.1 + '@types/express': 4.17.14 + '@types/jest': 29.2.2 + '@types/multer': 1.4.7 + '@types/node': 18.11.9 + '@zodios/core': workspace:* + axios: 1.1.3 + express: 4.18.2 + fp-ts: 2.13.1 + io-ts: 2.2.19 + jest: 29.3.0 + multer: 1.4.5-lts.1 + rimraf: 3.0.2 + ts-jest: 29.0.3 + ts-node: 10.9.1 + tsup: 6.3.0 + typescript: 4.9.3 + zod: 3.19.1 + dependencies: + '@zodios/core': link:../core + devDependencies: + '@jest/globals': 29.3.1 + '@jest/types': 29.3.1 + '@types/express': 4.17.14 + '@types/jest': 29.2.2 + '@types/multer': 1.4.7 + '@types/node': 18.11.9 + axios: 1.1.3 + express: 4.18.2 + fp-ts: 2.13.1 + io-ts: 2.2.19_fp-ts@2.13.1 + jest: 29.3.0_odkjkoia5xunhxkdrka32ib6vi + multer: 1.4.5-lts.1 + rimraf: 3.0.2 + ts-jest: 29.0.3_rhbpodbq4tgi7dsfkb4juhkp3y + ts-node: 10.9.1_wup25etrarvlqkprac7h35hj7u + tsup: 6.3.0_2dtigtkb225m7ii7q45utxqwgi + typescript: 4.9.3 + zod: 3.19.1 packages/core: specifiers: @@ -19,7 +64,6 @@ importers: '@types/multer': 1.4.7 '@types/node': 18.11.9 '@types/qs': 6.9.7 - axios: 1.1.3 express: 4.18.2 fp-ts: 2.13.1 io-ts: 2.2.19 @@ -30,7 +74,7 @@ importers: ts-jest: 29.0.3 ts-node: 10.9.1 tsup: 6.3.0 - typescript: 4.8.4 + typescript: 4.9.3 zod: 3.19.1 dependencies: qs: 6.11.0 @@ -42,17 +86,16 @@ importers: '@types/multer': 1.4.7 '@types/node': 18.11.9 '@types/qs': 6.9.7 - axios: 1.1.3 express: 4.18.2 fp-ts: 2.13.1 io-ts: 2.2.19_fp-ts@2.13.1 jest: 29.3.0_odkjkoia5xunhxkdrka32ib6vi multer: 1.4.5-lts.1 rimraf: 3.0.2 - ts-jest: 29.0.3_zni4oow62srprqrjg644purjpe - ts-node: 10.9.1_cbe7ovvae6zqfnmtgctpgpys54 - tsup: 6.3.0_mwhvu7sfp6vq5ryuwb6hlbjfka - typescript: 4.8.4 + ts-jest: 29.0.3_rhbpodbq4tgi7dsfkb4juhkp3y + ts-node: 10.9.1_wup25etrarvlqkprac7h35hj7u + tsup: 6.3.0_2dtigtkb225m7ii7q45utxqwgi + typescript: 4.9.3 zod: 3.19.1 packages: @@ -2830,7 +2873,7 @@ packages: pretty-format: 29.3.1 slash: 3.0.0 strip-json-comments: 3.1.1 - ts-node: 10.9.1_cbe7ovvae6zqfnmtgctpgpys54 + ts-node: 10.9.1_wup25etrarvlqkprac7h35hj7u transitivePeerDependencies: - supports-color dev: true @@ -3649,7 +3692,7 @@ packages: optional: true dependencies: lilconfig: 2.0.6 - ts-node: 10.9.1_cbe7ovvae6zqfnmtgctpgpys54 + ts-node: 10.9.1_wup25etrarvlqkprac7h35hj7u yaml: 1.10.2 dev: true @@ -4273,7 +4316,7 @@ packages: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} dev: true - /ts-jest/29.0.3_zni4oow62srprqrjg644purjpe: + /ts-jest/29.0.3_rhbpodbq4tgi7dsfkb4juhkp3y: resolution: {integrity: sha512-Ibygvmuyq1qp/z3yTh9QTwVVAbFdDy/+4BtIQR2sp6baF2SJU/8CKK/hhnGIDY2L90Az2jIqTwZPnN2p+BweiQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -4303,11 +4346,11 @@ packages: lodash.memoize: 4.1.2 make-error: 1.3.6 semver: 7.3.8 - typescript: 4.8.4 + typescript: 4.9.3 yargs-parser: 21.1.1 dev: true - /ts-node/10.9.1_cbe7ovvae6zqfnmtgctpgpys54: + /ts-node/10.9.1_wup25etrarvlqkprac7h35hj7u: resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true peerDependencies: @@ -4333,12 +4376,12 @@ packages: create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 4.8.4 + typescript: 4.9.3 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 dev: true - /tsup/6.3.0_mwhvu7sfp6vq5ryuwb6hlbjfka: + /tsup/6.3.0_2dtigtkb225m7ii7q45utxqwgi: resolution: {integrity: sha512-IaNQO/o1rFgadLhNonVKNCT2cks+vvnWX3DnL8sB87lBDqRvJXHENr5lSPJlqwplUlDxSwZK8dSg87rgBu6Emw==} engines: {node: '>=14'} hasBin: true @@ -4368,7 +4411,7 @@ packages: source-map: 0.8.0-beta.0 sucrase: 3.28.0 tree-kill: 1.2.2 - typescript: 4.8.4 + typescript: 4.9.3 transitivePeerDependencies: - supports-color - ts-node @@ -4486,8 +4529,8 @@ packages: resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} dev: true - /typescript/4.8.4: - resolution: {integrity: sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==} + /typescript/4.9.3: + resolution: {integrity: sha512-CIfGzTelbKNEnLpLdGFgdyKhG23CKdKgQPOBc+OUNrkJ2vr+KSzsSV5kq5iWhEQbok+quxgGzrAtGWCyU7tHnA==} engines: {node: '>=4.2.0'} hasBin: true dev: true From 83ee90de9c9113a5c50d532ef8702b7deca576fd Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sat, 19 Nov 2022 21:57:38 +0100 Subject: [PATCH 037/206] refactor(core): rename core exports --- packages/core/examples/io-ts-types.ts | 4 +- packages/core/src/index.ts | 11 ++- packages/core/src/zodios.test.ts | 104 +++++++++++++------------- packages/core/src/zodios.ts | 11 ++- 4 files changed, 69 insertions(+), 61 deletions(-) diff --git a/packages/core/examples/io-ts-types.ts b/packages/core/examples/io-ts-types.ts index 3f2736cd..9c34f6f1 100644 --- a/packages/core/examples/io-ts-types.ts +++ b/packages/core/examples/io-ts-types.ts @@ -1,5 +1,5 @@ import { - Zodios, + ZodiosCore, makeApi, ApiOf, TypeProviderOf, @@ -56,7 +56,7 @@ const jsonplaceholderApi = makeApi([ ]); async function bootstrap() { - const apiClient = new Zodios(jsonplaceholderUrl, jsonplaceholderApi, { + const apiClient = new ZodiosCore(jsonplaceholderUrl, jsonplaceholderApi, { typeProvider: ioTsTypeProvider, fetcherProvider: fetchProvider, }); diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 2537004e..1b95fe0c 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -1,6 +1,11 @@ -export { Zodios } from "./zodios"; -export type { ApiOf, TypeProviderOf } from "./zodios"; -export type { ZodiosInstance, ZodiosClass, ZodiosConstructor } from "./zodios"; +export { ZodiosCore, ZodiosCoreImpl } from "./zodios"; +export type { + ApiOf, + TypeProviderOf, + FetcherProviderOf, + ZodiosInstance, + ZodiosBase, +} from "./zodios"; export { ZodiosError } from "./zodios-error"; export type { AnyZodiosMethodOptions, diff --git a/packages/core/src/zodios.test.ts b/packages/core/src/zodios.test.ts index cbc43847..c56f488a 100644 --- a/packages/core/src/zodios.test.ts +++ b/packages/core/src/zodios.test.ts @@ -4,7 +4,7 @@ import { z, ZodError } from "zod"; if (globalThis.FormData === undefined) { globalThis.FormData = require("form-data"); } -import { Zodios } from "./zodios"; +import { ZodiosCore } from "./zodios"; import { ZodiosError } from "./zodios-error"; import multer from "multer"; import { ZodiosPlugin } from "./zodios.types"; @@ -91,32 +91,36 @@ describe("Zodios", () => { }); it("should be defined", () => { - expect(Zodios).toBeDefined(); + expect(ZodiosCore).toBeDefined(); }); it("should throw if baseUrl is not provided", () => { // @ts-ignore - expect(() => new Zodios(undefined, [])).toThrowError( + expect(() => new ZodiosCore(undefined, [])).toThrowError( "Zodios: missing base url" ); }); it("should throw if api is not provided", () => { // @ts-ignore - expect(() => new Zodios()).toThrowError("Zodios: missing api description"); + expect(() => new ZodiosCore()).toThrowError( + "Zodios: missing api description" + ); }); it("should throw if api is not an array", () => { // @ts-ignore - expect(() => new Zodios({})).toThrowError("Zodios: api must be an array"); + expect(() => new ZodiosCore({})).toThrowError( + "Zodios: api must be an array" + ); }); it("should create a new instance of Zodios", () => { - const zodios = new Zodios(`http://localhost:${port}`, []); + const zodios = new ZodiosCore(`http://localhost:${port}`, []); expect(zodios).toBeDefined(); }); it("should create a new instance when providing an api", () => { - const zodios = new Zodios(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost:${port}`, [ { method: "get", path: "/:id", @@ -132,7 +136,7 @@ describe("Zodios", () => { it("should should throw with duplicate api endpoints", () => { expect( () => - new Zodios(`http://localhost:${port}`, [ + new ZodiosCore(`http://localhost:${port}`, [ { method: "get", path: "/:id", @@ -154,7 +158,7 @@ describe("Zodios", () => { }); it("should create a new instance whithout base URL", () => { - const zodios = new Zodios([ + const zodios = new ZodiosCore([ { method: "get", path: "/:id", @@ -168,13 +172,13 @@ describe("Zodios", () => { }); it("should register have validation plugin automatically installed", () => { - const zodios = new Zodios(`http://localhost:${port}`, []); + const zodios = new ZodiosCore(`http://localhost:${port}`, []); // @ts-ignore expect(zodios.endpointPlugins.get("any-any").count()).toBe(1); }); it("should register a plugin", () => { - const zodios = new Zodios(`http://localhost:${port}`, []); + const zodios = new ZodiosCore(`http://localhost:${port}`, []); zodios.use({ request: async (_, config) => config, }); @@ -183,7 +187,7 @@ describe("Zodios", () => { }); it("should unregister a plugin", () => { - const zodios = new Zodios(`http://localhost:${port}`, []); + const zodios = new ZodiosCore(`http://localhost:${port}`, []); const id = zodios.use({ request: async (_, config) => config, }); @@ -195,7 +199,7 @@ describe("Zodios", () => { }); it("should replace a named plugin", () => { - const zodios = new Zodios(`http://localhost:${port}`, []); + const zodios = new ZodiosCore(`http://localhost:${port}`, []); const plugin: ZodiosPlugin = { name: "test", request: async (_, config) => config, @@ -208,7 +212,7 @@ describe("Zodios", () => { }); it("should unregister a named plugin", () => { - const zodios = new Zodios(`http://localhost:${port}`, []); + const zodios = new ZodiosCore(`http://localhost:${port}`, []); const plugin: ZodiosPlugin = { name: "test", request: async (_, config) => config, @@ -219,14 +223,14 @@ describe("Zodios", () => { expect(zodios.endpointPlugins.get("any-any").count()).toBe(1); }); - it("should throw if invalid parameters when registering a plugin", () => { - const zodios = new Zodios(`http://localhost:${port}`, []); + it("should throw if invalide parameters when registering a plugin", () => { + const zodios = new ZodiosCore(`http://localhost:${port}`, []); // @ts-ignore expect(() => zodios.use(0)).toThrowError("Zodios: invalid plugin"); }); it("should throw if invalid alias when registering a plugin", () => { - const zodios = new Zodios(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost:${port}`, [ { method: "get", path: "/:id", @@ -247,7 +251,7 @@ describe("Zodios", () => { }); it("should throw if invalid endpoint when registering a plugin", () => { - const zodios = new Zodios(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost:${port}`, [ { method: "get", path: "/:id", @@ -269,7 +273,7 @@ describe("Zodios", () => { }); it("should register a plugin by endpoint", () => { - const zodios = new Zodios(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost:${port}`, [ { method: "get", path: "/:id", @@ -287,7 +291,7 @@ describe("Zodios", () => { }); it("should register a plugin by alias", () => { - const zodios = new Zodios(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost:${port}`, [ { method: "get", path: "/:id", @@ -306,7 +310,7 @@ describe("Zodios", () => { }); it("should make an http request", async () => { - const zodios = new Zodios(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost:${port}`, [ { method: "get", path: "/:id", @@ -340,7 +344,7 @@ describe("Zodios", () => { }); it("should make an http get with standard query arrays", async () => { - const zodios = new Zodios(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost:${port}`, [ { method: "get", path: "/queries", @@ -361,7 +365,7 @@ describe("Zodios", () => { }); it("should make an http get with one path params", async () => { - const zodios = new Zodios(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost:${port}`, [ { method: "get", path: "/:id", @@ -376,7 +380,7 @@ describe("Zodios", () => { }); it("should make an http alias request with one path params", async () => { - const zodios = new Zodios(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost:${port}`, [ { method: "get", path: "/:id", @@ -401,13 +405,13 @@ describe("Zodios", () => { name: z.string(), }), }).build(); - const zodios = new Zodios(`http://localhost:${port}`, api); + const zodios = new ZodiosCore(`http://localhost:${port}`, api); const response = await zodios.getById({ params: { id: 7 } }); expect(response).toEqual({ id: 7, name: "test" }); }); it("should make a get request with forgotten params and get back a zod error", async () => { - const zodios = new Zodios(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost:${port}`, [ { method: "get", path: "/:id", @@ -426,7 +430,7 @@ describe("Zodios", () => { }); it("should make an http get with multiples path params", async () => { - const zodios = new Zodios(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost:${port}`, [ { method: "get", path: "/:id/address/:address", @@ -443,7 +447,7 @@ describe("Zodios", () => { }); it("should make an http post with body param", async () => { - const zodios = new Zodios(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost:${port}`, [ { method: "post", path: "/", @@ -467,7 +471,7 @@ describe("Zodios", () => { }); it("should make an http post with transformed body param", async () => { - const zodios = new Zodios(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost:${port}`, [ { method: "post", path: "/", @@ -506,7 +510,7 @@ describe("Zodios", () => { }); it("should throw a zodios error if params are not correct", async () => { - const zodios = new Zodios(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost:${port}`, [ { method: "post", path: "/", @@ -547,7 +551,7 @@ describe("Zodios", () => { }); it("should make an http mutation alias request with body param", async () => { - const zodios = new Zodios(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost:${port}`, [ { method: "post", path: "/", @@ -572,7 +576,7 @@ describe("Zodios", () => { }); it("should make an http put", async () => { - const zodios = new Zodios(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost:${port}`, [ { method: "put", path: "/", @@ -597,7 +601,7 @@ describe("Zodios", () => { }); it("should make an http put alias", async () => { - const zodios = new Zodios(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost:${port}`, [ { method: "put", path: "/", @@ -623,7 +627,7 @@ describe("Zodios", () => { }); it("should make an http patch", async () => { - const zodios = new Zodios(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost:${port}`, [ { method: "patch", path: "/", @@ -650,7 +654,7 @@ describe("Zodios", () => { }); it("should make an http patch alias", async () => { - const zodios = new Zodios(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost:${port}`, [ { method: "patch", path: "/", @@ -676,7 +680,7 @@ describe("Zodios", () => { }); it("should make an http delete", async () => { - const zodios = new Zodios(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost:${port}`, [ { method: "delete", path: "/:id", @@ -692,7 +696,7 @@ describe("Zodios", () => { }); it("should make an http delete alias", async () => { - const zodios = new Zodios(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost:${port}`, [ { method: "delete", path: "/:id", @@ -709,7 +713,7 @@ describe("Zodios", () => { }); it("should validate uuid in path params", async () => { - const zodios = new Zodios(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost:${port}`, [ { method: "get", path: "/path/:uuid", @@ -734,7 +738,7 @@ describe("Zodios", () => { }); it("should not validate bad path params", async () => { - const zodios = new Zodios(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost:${port}`, [ { method: "get", path: "/path/:uuid", @@ -766,7 +770,7 @@ describe("Zodios", () => { }); it("should not validate bad formatted responses", async () => { - const zodios = new Zodios(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost:${port}`, [ { method: "get", path: "/:id", @@ -815,7 +819,7 @@ received: }); it("should match Expected error", async () => { - const zodios = new Zodios( + const zodios = new ZodiosCore( `http://localhost:${port}`, [ { @@ -1062,7 +1066,7 @@ received: }); it("should match Unexpected error", async () => { - const zodios = new Zodios(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost:${port}`, [ { method: "get", alias: "getError502", @@ -1088,7 +1092,7 @@ received: }); it("should return response when disabling validation", async () => { - const zodios = new Zodios( + const zodios = new ZodiosCore( `http://localhost:${port}`, [ { @@ -1111,7 +1115,7 @@ received: }); it("should trigger an error with error response", async () => { - const zodios = new Zodios(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost:${port}`, [ { method: "get", path: "/error502", @@ -1133,7 +1137,7 @@ received: }); it("should send a form data request", async () => { - const zodios = new Zodios(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost:${port}`, [ { method: "post", path: "/form-data", @@ -1161,7 +1165,7 @@ received: }); it("should send a form data request a second time under 100 ms", async () => { - const zodios = new Zodios(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost:${port}`, [ { method: "post", path: "/form-data", @@ -1190,7 +1194,7 @@ received: }, 100); it("should not send an array as form data request", async () => { - const zodios = new Zodios(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost:${port}`, [ { method: "post", path: "/form-data", @@ -1220,7 +1224,7 @@ received: }); it("should send a form url request", async () => { - const zodios = new Zodios(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost:${port}`, [ { method: "post", path: "/form-url", @@ -1248,7 +1252,7 @@ received: }); it("should not send an array as form url request", async () => { - const zodios = new Zodios(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost:${port}`, [ { method: "post", path: "/form-url", @@ -1278,7 +1282,7 @@ received: }); it("should send a text request", async () => { - const zodios = new Zodios(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost:${port}`, [ { method: "post", path: "/text", diff --git a/packages/core/src/zodios.ts b/packages/core/src/zodios.ts index 5fc0a23d..84c25231 100644 --- a/packages/core/src/zodios.ts +++ b/packages/core/src/zodios.ts @@ -1,7 +1,6 @@ import type { AnyZodiosRequestOptions, ZodiosRequestOptions, - ZodiosBodyByPath, Method, ZodiosPathsByMethod, ZodiosResponseByPath, @@ -40,7 +39,7 @@ import { } from "./fetcher-providers"; import { findEndpointErrorsByAlias, findEndpointErrorsByPath } from "./utils"; -interface ZodiosBase< +export interface ZodiosBase< Api extends ZodiosEndpointDefinitions, FetcherProvider extends AnyZodiosFetcherProvider, TypeProvider extends AnyZodiosTypeProvider @@ -53,7 +52,7 @@ interface ZodiosBase< /** * zodios api client */ -export class ZodiosClass< +export class ZodiosCoreImpl< Api extends ZodiosEndpointDefinitions, FetcherProvider extends AnyZodiosFetcherProvider, TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider @@ -530,10 +529,10 @@ export type ZodiosInstance< Api extends ZodiosEndpointDefinitions, FetcherProvider extends AnyZodiosFetcherProvider, TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider -> = ZodiosClass & +> = ZodiosCoreImpl & ZodiosAliases; -export type ZodiosConstructor = { +export type ZodiosCore = { new < Api extends ZodiosEndpointDefinitions, FetcherProvider extends AnyZodiosFetcherProvider, @@ -555,7 +554,7 @@ export type ZodiosConstructor = { ): ZodiosInstance; }; -export const Zodios = ZodiosClass as ZodiosConstructor; +export const ZodiosCore = ZodiosCoreImpl as ZodiosCore; /** * Get the Api description type from zodios From 938c4f649a5c1794ef2c8bd1294ae89a8ab36c43 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sat, 19 Nov 2022 22:00:16 +0100 Subject: [PATCH 038/206] docs(changeset): rename exports --- .changeset/orange-balloons-peel.md | 5 + packages/axios/examples/io-ts-types.ts | 4 +- packages/axios/examples/typescript-types.ts | 5 +- ...er-provider.axios.ts => axios-provider.ts} | 6 +- packages/axios/src/fetcher-providers/index.ts | 1 - packages/axios/src/index.ts | 75 +- packages/axios/src/utils.test.ts | 68 -- packages/axios/src/utils.ts | 72 +- packages/axios/src/utils.types.test.ts | 66 -- packages/axios/src/utils.types.ts | 237 ----- packages/axios/src/zodios-error.ts | 23 - packages/axios/src/zodios-error.utils.ts | 91 -- packages/axios/src/zodios.test.ts | 6 +- packages/axios/src/zodios.ts | 517 +---------- packages/axios/src/zodios.types.ts | 836 ------------------ packages/axios/tsup.config.js | 2 +- 16 files changed, 47 insertions(+), 1967 deletions(-) create mode 100644 .changeset/orange-balloons-peel.md rename packages/axios/src/{fetcher-providers/axios-provider/fetcher-provider.axios.ts => axios-provider.ts} (91%) delete mode 100644 packages/axios/src/fetcher-providers/index.ts delete mode 100644 packages/axios/src/utils.test.ts delete mode 100644 packages/axios/src/utils.types.test.ts delete mode 100644 packages/axios/src/utils.types.ts delete mode 100644 packages/axios/src/zodios-error.ts delete mode 100644 packages/axios/src/zodios-error.utils.ts delete mode 100644 packages/axios/src/zodios.types.ts diff --git a/.changeset/orange-balloons-peel.md b/.changeset/orange-balloons-peel.md new file mode 100644 index 00000000..85b7cc6f --- /dev/null +++ b/.changeset/orange-balloons-peel.md @@ -0,0 +1,5 @@ +--- +"@zodios/core": major +--- + +rename exports diff --git a/packages/axios/examples/io-ts-types.ts b/packages/axios/examples/io-ts-types.ts index 3f2736cd..a2d64de4 100644 --- a/packages/axios/examples/io-ts-types.ts +++ b/packages/axios/examples/io-ts-types.ts @@ -3,11 +3,10 @@ import { makeApi, ApiOf, TypeProviderOf, + FetcherProviderOf, ioTsTypeProvider, } from "../src/index"; import * as t from "io-ts"; -import { fetchProvider } from "../src/fetcher-providers"; -import { FetcherProviderOf } from "../src/zodios"; // you can define schema before declaring the API to get back the type @@ -58,7 +57,6 @@ const jsonplaceholderApi = makeApi([ async function bootstrap() { const apiClient = new Zodios(jsonplaceholderUrl, jsonplaceholderApi, { typeProvider: ioTsTypeProvider, - fetcherProvider: fetchProvider, }); type Api = ApiOf; diff --git a/packages/axios/examples/typescript-types.ts b/packages/axios/examples/typescript-types.ts index 14dfc4e0..fdf8e533 100644 --- a/packages/axios/examples/typescript-types.ts +++ b/packages/axios/examples/typescript-types.ts @@ -6,7 +6,8 @@ import { TypeProviderOf, tsSchema, tsTypeProvider, -} from "../src/index"; + FetcherProviderOf, +} from "../src"; // you can also predefine your API const jsonplaceholderUrl = "https://jsonplaceholder.typicode.com"; @@ -63,6 +64,8 @@ async function bootstrap() { // ^? type Provider = TypeProviderOf; // ^? + type FetcherProvider = FetcherProviderOf; + // ^? const users = await apiClient.get("/users", { queries: { q: "Nicholas" } }); // ^? console.log(users); diff --git a/packages/axios/src/fetcher-providers/axios-provider/fetcher-provider.axios.ts b/packages/axios/src/axios-provider.ts similarity index 91% rename from packages/axios/src/fetcher-providers/axios-provider/fetcher-provider.axios.ts rename to packages/axios/src/axios-provider.ts index 652c4645..10fff9e6 100644 --- a/packages/axios/src/fetcher-providers/axios-provider/fetcher-provider.axios.ts +++ b/packages/axios/src/axios-provider.ts @@ -5,12 +5,12 @@ import axios, { AxiosResponse, } from "axios"; import { + AnyZodiosRequestOptions, AnyZodiosFetcherProvider, ZodiosRuntimeFetcherProvider, } from "@zodios/core"; -import { Merge } from "../../utils.types"; -import { omit, replacePathParams } from "../../utils"; -import { AnyZodiosRequestOptions } from "../../zodios.types"; +import { Merge } from "@zodios/core/lib/utils.types"; +import { omit, replacePathParams } from "./utils"; type AxiosErrorStatus = Merge< Omit, diff --git a/packages/axios/src/fetcher-providers/index.ts b/packages/axios/src/fetcher-providers/index.ts deleted file mode 100644 index 8fd7b80d..00000000 --- a/packages/axios/src/fetcher-providers/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./axios-provider/fetcher-provider.axios"; diff --git a/packages/axios/src/index.ts b/packages/axios/src/index.ts index 7ec983c5..9f1d3e90 100644 --- a/packages/axios/src/index.ts +++ b/packages/axios/src/index.ts @@ -1,75 +1,2 @@ export { Zodios } from "./zodios"; -export type { ApiOf, TypeProviderOf } from "./zodios"; -export type { ZodiosInstance, ZodiosClass, ZodiosConstructor } from "./zodios"; -export { ZodiosError } from "./zodios-error"; -export { isErrorFromPath, isErrorFromAlias } from "./zodios-error.utils"; -export type { - AnyZodiosMethodOptions, - AnyZodiosRequestOptions, - ZodiosBodyForEndpoint, - ZodiosBodyByPath, - ZodiosBodyByAlias, - ZodiosHeaderParamsForEndpoint, - ZodiosHeaderParamsByPath, - ZodiosHeaderParamsByAlias, - Method, - ZodiosPathParams, - ZodiosPathParamsForEndpoint, - ZodiosPathParamsByPath, - ZodiosPathParamByAlias, - ZodiosPathsByMethod, - ZodiosResponseForEndpoint, - ZodiosResponseByPath, - ZodiosResponseByAlias, - ZodiosQueryParamsForEndpoint, - ZodiosQueryParamsByPath, - ZodiosQueryParamsByAlias, - ZodiosEndpointDefinitionByPath, - ZodiosEndpointDefinitionByAlias, - ZodiosErrorForEndpoint, - ZodiosErrorByPath, - ZodiosErrorByAlias, - ZodiosEndpointDefinition, - ZodiosEndpointDefinitions, - ZodiosEndpointParameter, - ZodiosEndpointParameters, - ZodiosEndpointError, - ZodiosEndpointErrors, - ZodiosOptions, - ZodiosRequestOptions, - ZodiosRequestOptionsByPath, - ZodiosRequestOptionsByAlias, - ZodiosPlugin, -} from "./zodios.types"; -export type { - AnyZodiosTypeProvider, - InferInputTypeFromSchema, - InferOutputTypeFromSchema, - IoTsTypeProvider, - TsTypeProvider, - ZodiosRuntimeTypeProvider, - ZodiosValidateResult, - ZodTypeProvider, -} from "./type-providers"; -export { - ioTsTypeProvider, - tsTypeProvider, - zodTypeProvider, - tsSchema, - tsFnSchema, -} from "./type-providers"; -export { - PluginId, - zodValidationPlugin, - formDataPlugin, - formURLPlugin, - headerPlugin, -} from "./plugins"; -export { - makeApi, - apiBuilder, - makeParameters, - makeEndpoint, - makeErrors, - checkApi, -} from "./api"; +export * from "@zodios/core"; diff --git a/packages/axios/src/utils.test.ts b/packages/axios/src/utils.test.ts deleted file mode 100644 index c432b63d..00000000 --- a/packages/axios/src/utils.test.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { omit, pick } from "./utils"; - -describe("omit", () => { - it("should be defined", () => { - expect(omit).toBeDefined(); - }); - - it("should support undefined parameters", () => { - const obj: any = undefined; - expect(omit(obj, ["a"])).toEqual({}); - }); - - it("should remove the given keys from the object", () => { - const obj = { - a: 1, - b: 2, - c: 3, - }; - - expect(omit(obj, ["a"])).toEqual({ - b: 2, - c: 3, - }); - }); - - it("should accept to remove all keys from object", () => { - const obj = { - a: 1, - b: 2, - c: 3, - }; - - expect(omit(obj, ["a", "b", "c"])).toEqual({}); - }); -}); - -describe("pick", () => { - it("should be defined", () => { - expect(pick).toBeDefined(); - }); - - it("should support undefined parameters", () => { - const obj: any = undefined; - expect(pick(obj, ["a"])).toEqual({}); - }); - - it("should pick the given keys from the object", () => { - const obj = { - a: 1, - b: 2, - c: 3, - }; - - expect(pick(obj, ["a"])).toEqual({ - a: 1, - }); - }); - - it("should accept to pick all keys from object", () => { - const obj = { - a: 1, - b: 2, - c: 3, - }; - - expect(pick(obj, ["a", "b", "c"])).toEqual(obj); - }); -}); diff --git a/packages/axios/src/utils.ts b/packages/axios/src/utils.ts index 678482ef..67f86002 100644 --- a/packages/axios/src/utils.ts +++ b/packages/axios/src/utils.ts @@ -1,10 +1,4 @@ -import { AxiosError } from "axios"; -import type { ReadonlyDeep } from "./utils.types"; -import type { - AnyZodiosRequestOptions, - ZodiosEndpointDefinition, - ZodiosEndpointDefinitions, -} from "./zodios.types"; +import type { ReadonlyDeep } from "@zodios/core/lib/utils.types"; /** * omit properties from an object @@ -42,15 +36,6 @@ export function pick( return ret; } -/** - * set first letter of a string to uppercase - * @param str - the string to capitalize - * @returns - the string with the first letter uppercased - */ -export function capitalize(str: T): Capitalize { - return (str.charAt(0).toUpperCase() + str.slice(1)) as Capitalize; -} - const paramsRegExp = /:([a-zA-Z_][a-zA-Z0-9_]*)/g; export function replacePathParams( @@ -65,58 +50,3 @@ export function replacePathParams( } return result; } - -export function findEndpoint( - api: ZodiosEndpointDefinitions, - method: string, - path: string -) { - return api.find((e) => e.method === method && e.path === path); -} - -export function findEndpointByAlias( - api: ZodiosEndpointDefinitions, - alias: string -) { - return api.find((e) => e.alias === alias); -} - -export function findEndpointErrors( - endpoint: ZodiosEndpointDefinition, - err: AxiosError -) { - const matchingErrors = endpoint.errors?.filter( - (error) => error.status === err.response!.status - ); - if (matchingErrors && matchingErrors.length > 0) return matchingErrors; - return endpoint.errors?.filter((error) => error.status === "default"); -} - -export function findEndpointErrorsByPath( - api: ZodiosEndpointDefinitions, - method: string, - path: string, - err: AxiosError -) { - const endpoint = findEndpoint(api, method, path); - return endpoint && - err.config && - endpoint.method === err.config.method && - endpoint.path === err.config.url - ? findEndpointErrors(endpoint, err) - : undefined; -} - -export function findEndpointErrorsByAlias( - api: ZodiosEndpointDefinitions, - alias: string, - err: AxiosError -) { - const endpoint = findEndpointByAlias(api, alias); - return endpoint && - err.config && - endpoint.method === err.config.method && - endpoint.path === err.config.url - ? findEndpointErrors(endpoint, err) - : undefined; -} diff --git a/packages/axios/src/utils.types.test.ts b/packages/axios/src/utils.types.test.ts deleted file mode 100644 index 122dbd03..00000000 --- a/packages/axios/src/utils.types.test.ts +++ /dev/null @@ -1,66 +0,0 @@ -import type { - Assert, - FilterArrayByValue, - FilterArrayByKey, -} from "./utils.types"; - -describe("utils.types", () => { - describe("FilterArrayByValue", () => { - it("should support empty array", () => { - type Input = []; - const test: Assert, []> = true; - }); - - it("should filter typed Array by value in declared order", () => { - type Input = [ - { a: number; b: string }, - { a: number; c: boolean }, - { c: boolean }, - { d: string }, - { e: number } - ]; - const test1: Assert< - FilterArrayByValue, - [{ a: number; b: string }, { a: number; c: boolean }] - > = true; - const test2: Assert< - FilterArrayByValue, - [{ a: number; c: boolean }, { c: boolean }] - > = true; - const test3: Assert< - FilterArrayByValue, - [{ d: string }] - > = true; - const test4: Assert< - FilterArrayByValue, - [{ e: number }] - > = true; - }); - }); - - describe("FilterArrayByKey", () => { - it("should support empty array", () => { - type Input = []; - const test: Assert, []> = true; - }); - it("should filter typed Array by key in declared order", () => { - type Input = [ - { a: number; b: string }, - { a: number; c: boolean }, - { c: boolean }, - { d: string }, - { e: number } - ]; - const test1: Assert< - FilterArrayByKey, - [{ a: number; b: string }, { a: number; c: boolean }] - > = true; - const test2: Assert< - FilterArrayByKey, - [{ a: number; c: boolean }, { c: boolean }] - > = true; - const test3: Assert, [{ d: string }]> = true; - const test4: Assert, [{ e: number }]> = true; - }); - }); -}); diff --git a/packages/axios/src/utils.types.ts b/packages/axios/src/utils.types.ts deleted file mode 100644 index 28ffccd3..00000000 --- a/packages/axios/src/utils.types.ts +++ /dev/null @@ -1,237 +0,0 @@ -/** - * filter an array type by a predicate value - * @param T - array type - * @param C - predicate object to match - * @details - this is using tail recursion type optimization from typescript 4.5 - */ -export type FilterArrayByValue< - T extends unknown[] | undefined, - C, - Acc extends unknown[] = [] -> = T extends [infer Head, ...infer Tail] - ? Head extends C - ? FilterArrayByValue - : FilterArrayByValue - : Acc; - -/** - * filter an array type by key - * @param T - array type - * @param K - key to match - * @details - this is using tail recursion type optimization from typescript 4.5 - */ -export type FilterArrayByKey< - T extends unknown[], - K extends string, - Acc extends unknown[] = [] -> = T extends [infer Head, ...infer Tail] - ? Head extends { [Key in K]: unknown } - ? FilterArrayByKey - : FilterArrayByKey - : Acc; - -/** - * filter an array type by removing undefined values - * @param T - array type - * @details - this is using tail recursion type optimization from typescript 4.5 - */ -export type DefinedArray< - T extends unknown[], - Acc extends unknown[] = [] -> = T extends [infer Head, ...infer Tail] - ? Head extends undefined - ? DefinedArray - : DefinedArray - : Acc; - -type Try = A extends B ? A : C; - -type NarrowRaw = - | (T extends Function ? T : never) - | (T extends string | number | bigint | boolean ? T : never) - | (T extends [] ? [] : never) - | { - [K in keyof T]: K extends "description" ? T[K] : NarrowNotSchema; - }; - -type NarrowNotSchema = Try< - T, - { parse: (...args: any[]) => any } | { validate: (...args: any[]) => any }, - NarrowRaw ->; - -/** - * Utility to infer the embedded primitive type of any type - * Same as `as const` but without setting the object as readonly and without needing the user to use it - * @param T - type to infer the embedded type of - * @see - thank you tannerlinsley for this idea - */ -export type Narrow = Try>; - -/** - * merge all union types into a single type - * @param T - union type - */ -export type MergeUnion = ( - T extends unknown ? (k: T) => void : never -) extends (k: infer I) => void - ? { [K in keyof I]: I[K] } - : never; - -/** - * get all required properties from an object type - * @param T - object type - */ -export type RequiredProps = Omit< - T, - { - [P in keyof T]-?: undefined extends T[P] ? P : never; - }[keyof T] ->; - -/** - * get all optional properties from an object type - * @param T - object type - */ -export type OptionalProps = Pick< - T, - { - [P in keyof T]-?: undefined extends T[P] ? P : never; - }[keyof T] ->; - -/** - * get all properties from an object type that are not undefined or optional - * @param T - object type - * @returns - union type of all properties that are not undefined or optional - */ -export type RequiredKeys = { - [P in keyof T]-?: undefined extends T[P] ? never : P; -}[keyof T]; - -/** - * Simplify a type by merging intersections if possible - * @param T - type to simplify - */ -export type Simplify = T extends unknown ? { [K in keyof T]: T[K] } : T; - -/** - * Merge two types into a single type - * @param T - first type - * @param U - second type - */ -export type Merge = Simplify; - -/** - * transform possible undefined properties from a type into optional properties - * @param T - object type - */ -export type UndefinedToOptional = Merge< - RequiredProps, - Partial> ->; - -/** - * remove all the never properties from a type object - * @param T - object type - */ -export type PickDefined = Pick< - T, - { [K in keyof T]: T[K] extends never ? never : K }[keyof T] ->; - -/** - * check if two types are equal - */ -export type IfEquals = (() => G extends T - ? 1 - : 2) extends () => G extends U ? 1 : 2 - ? Y - : N; - -/** - * get never if empty type - * @param T - type - * @example - * ```ts - * type A = {}; - * type B = NotEmpty; // B = never - */ -export type NeverIfEmpty = IfEquals; - -/** - * get undefined if empty type - * @param T - type - * @example - * ```ts - * type A = {}; - * type B = NotEmpty; // B = never - */ -export type UndefinedIfEmpty = IfEquals; - -export type UndefinedIfNever = IfEquals; - -/** - * set properties to optional if their child properties are optional - * @param T - object type - */ -export type TransitiveOptional = UndefinedToOptional<{ - [k in keyof T]: RequiredKeys extends never ? T[k] | undefined : T[k]; -}>; - -/** - * transform an array type into a readonly array type - * @param T - array type - */ -interface ReadonlyArrayDeep extends ReadonlyArray> {} - -/** - * transform an object type into a readonly object type - * @param T - object type - */ -export type DeepReadonlyObject = { - readonly [P in keyof T]: ReadonlyDeep; -}; - -/** - * transform a type into a readonly type - * @param T - type - */ -export type ReadonlyDeep = T extends (infer R)[] - ? ReadonlyArrayDeep - : T extends Function - ? T - : T extends object - ? DeepReadonlyObject - : T; - -export type MaybeReadonly = T | ReadonlyDeep; - -/** - * get all parameters from an API path - * @param Path - API path - * @details - this is using tail recursion type optimization from typescript 4.5 - */ -export type PathParamNames< - Path, - Acc = never -> = Path extends `${string}:${infer Name}/${infer R}` - ? PathParamNames - : Path extends `${string}:${infer Name}` - ? Name | Acc - : Acc; - -/** - * Check if two type are equal else generate a compiler error - * @param T - type to check - * @param U - type to check against - * @returns true if types are equal else a detailed compiler error - */ -export type Assert = IfEquals< - T, - U, - true, - { error: "Types are not equal"; type1: T; type2: U } ->; - -export type PickRequired = Merge; diff --git a/packages/axios/src/zodios-error.ts b/packages/axios/src/zodios-error.ts deleted file mode 100644 index 4d4b804a..00000000 --- a/packages/axios/src/zodios-error.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { AnyZodiosFetcherProvider } from "./fetcher-providers"; -import type { ReadonlyDeep } from "./utils.types"; -import type { AnyZodiosRequestOptions } from "./zodios.types"; - -/** - * Custom Zodios Error with additional information - * @param message - the error message - * @param data - the parameter or response object that caused the error - * @param config - the config object from zodios - * @param cause - the error cause - */ -export class ZodiosError extends Error { - constructor( - message: string, - public readonly config?: ReadonlyDeep< - AnyZodiosRequestOptions - >, - public readonly data?: unknown, - public readonly cause?: Error - ) { - super(message); - } -} diff --git a/packages/axios/src/zodios-error.utils.ts b/packages/axios/src/zodios-error.utils.ts deleted file mode 100644 index bd0823ec..00000000 --- a/packages/axios/src/zodios-error.utils.ts +++ /dev/null @@ -1,91 +0,0 @@ -import { AxiosError } from "axios"; -import type { - AnyZodiosTypeProvider, - ZodiosRuntimeTypeProvider, - ZodTypeProvider, -} from "./type-providers"; -import { zodTypeProvider } from "./type-providers"; -import { findEndpointErrorsByAlias, findEndpointErrorsByPath } from "./utils"; -import type { - Aliases, - Method, - ZodiosEndpointDefinitions, - ZodiosEndpointError, - ZodiosMatchingErrorsByAlias, - ZodiosMatchingErrorsByPath, - ZodiosPathsByMethod, -} from "./zodios.types"; - -function isDefinedError< - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider ->( - error: unknown, - typeProvider: ZodiosRuntimeTypeProvider, - findEndpointErrors: (error: AxiosError) => ZodiosEndpointError[] | undefined -): boolean { - if ( - error instanceof AxiosError || - (error && typeof error === "object" && "isAxiosError" in error) - ) { - const err = error as AxiosError; - if (err.response) { - const endpointErrors = findEndpointErrors(err); - if (endpointErrors) { - return endpointErrors.some( - (desc) => - typeProvider.validate(desc.schema, err.response!.data).success - ); - } - } - } - return false; -} - -/** - * check if the error is matching the endpoint errors definitions - * @param api - the api definition - * @param method - http method of the endpoint - * @param path - path of the endpoint - * @param error - the error to check - * @returns - if true, the error type is narrowed to the matching endpoint errors - */ -export function isErrorFromPath< - Api extends ZodiosEndpointDefinitions, - M extends Method, - Path extends string ->( - api: Api, - method: M, - path: Path extends ZodiosPathsByMethod - ? Path - : ZodiosPathsByMethod, - error: unknown -): error is ZodiosMatchingErrorsByPath< - Api, - M, - Path extends ZodiosPathsByMethod ? Path : never -> { - return isDefinedError(error, (err) => - findEndpointErrorsByPath(api, method, path, err) - ); -} - -/** - * check if the error is matching the endpoint errors definitions - * @param api - the api definition - * @param alias - alias of the endpoint - * @param error - the error to check - * @returns - if true, the error type is narrowed to the matching endpoint errors - */ -export function isErrorFromAlias< - Api extends ZodiosEndpointDefinitions, - Alias extends string ->( - api: Api, - alias: Alias extends Aliases ? Alias : Aliases, - error: unknown -): error is ZodiosMatchingErrorsByAlias { - return isDefinedError(error, (err) => - findEndpointErrorsByAlias(api, alias, err) - ); -} diff --git a/packages/axios/src/zodios.test.ts b/packages/axios/src/zodios.test.ts index f9c0c1b3..cd769466 100644 --- a/packages/axios/src/zodios.test.ts +++ b/packages/axios/src/zodios.test.ts @@ -6,13 +6,9 @@ import { z, ZodError } from "zod"; globalThis.FormData = require("form-data"); //} import { Zodios } from "./zodios"; -import { ZodiosError } from "./zodios-error"; +import { ZodiosError, AnyZodiosFetcherProvider } from "@zodios/core"; import multer from "multer"; -import { ZodiosPlugin } from "./zodios.types"; -import { apiBuilder } from "./api"; -import { isErrorFromPath, isErrorFromAlias } from "./zodios-error.utils"; import { Assert } from "./utils.types"; -import { AnyZodiosFetcherProvider } from "./fetcher-providers"; const multipart = multer({ storage: multer.memoryStorage() }); diff --git a/packages/axios/src/zodios.ts b/packages/axios/src/zodios.ts index 4f25def6..4108cb93 100644 --- a/packages/axios/src/zodios.ts +++ b/packages/axios/src/zodios.ts @@ -1,504 +1,47 @@ +import { Narrow } from "@zodios/core/lib/utils.types"; import type { - AnyZodiosRequestOptions, - ZodiosRequestOptions, - ZodiosBodyByPath, - Method, - ZodiosPathsByMethod, - ZodiosResponseByPath, - ZodiosOptions, ZodiosEndpointDefinitions, - ZodiosRequestOptionsByPath, - ZodiosAliases, - ZodiosPlugin, - Aliases, -} from "./zodios.types"; -import { - PluginId, - ZodiosPlugins, - zodValidationPlugin, - formDataPlugin, - formURLPlugin, - headerPlugin, -} from "./plugins"; -import type { - Narrow, - PickRequired, - ReadonlyDeep, - RequiredKeys, - UndefinedIfNever, -} from "./utils.types"; -import { checkApi } from "./api"; -import type { AnyZodiosTypeProvider, ZodTypeProvider } from "./type-providers"; -import { zodTypeProvider } from "./type-providers"; -import { - AnyZodiosFetcherProvider, - axiosProvider, - AxiosProvider, - fetchProvider, + ZodiosOptions, + AnyZodiosTypeProvider, TypeOfFetcherOptions, -} from "./fetcher-providers"; - -interface ZodiosBase< - Api extends ZodiosEndpointDefinitions, - FetcherProvider extends AnyZodiosFetcherProvider, - TypeProvider extends AnyZodiosTypeProvider -> { - readonly api: Api; - readonly _typeProvider: TypeProvider; - readonly _fetcherProvider: FetcherProvider; + ZodiosInstance, + ZodTypeProvider, +} from "@zodios/core"; +import { ZodiosCore } from "@zodios/core"; +import { axiosProvider, AxiosProvider } from "./axios-provider"; + +function ZodiosAxios(...args: any[]) { + // get last argument + let options: ZodiosOptions = args[args.length - 1]; + if (!Array.isArray(options) && typeof options === "object") { + args[args.length - 1] = { ...options, fetcherProvider: axiosProvider }; + } else { + args.push({ fetcherProvider: axiosProvider }); + } + // @ts-ignore + return new ZodiosCore(...args); } -/** - * zodios api client based on axios - */ -export class ZodiosClass< - Api extends ZodiosEndpointDefinitions, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, - FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider -> implements ZodiosBase -{ - public readonly options: PickRequired< - ZodiosOptions, - | "validate" - | "transform" - | "sendDefaults" - | "typeProvider" - | "fetcherProvider" - >; - public readonly api: Api; - public readonly _typeProvider: TypeProvider; - public readonly _fetcherProvider: FetcherProvider; - private endpointPlugins: Map> = - new Map(); - - /** - * constructor - * @param baseURL - the base url to use - if omited will use the browser domain - * @param api - the description of all the api endpoints - * @param options - the options to setup the client API - * @example - * const apiClient = new Zodios("https://jsonplaceholder.typicode.com", [ - * { - * method: "get", - * path: "/users", - * description: "Get all users", - * parameters: [ - * { - * name: "q", - * type: "Query", - * schema: z.string(), - * }, - * { - * name: "page", - * type: "Query", - * schema: z.string().optional(), - * }, - * ], - * response: z.array(z.object({ id: z.number(), name: z.string() })), - * } - * ]); - */ - constructor( - api: Narrow, - options?: ZodiosOptions & - TypeOfFetcherOptions - ); - constructor( - baseUrl: string, - api: Narrow, - options?: ZodiosOptions & - TypeOfFetcherOptions - ); - constructor( - arg1?: Api | string, - arg2?: - | Api - | (ZodiosOptions & - TypeOfFetcherOptions), - arg3?: ZodiosOptions & - TypeOfFetcherOptions - ) { - let options: ZodiosOptions & - TypeOfFetcherOptions; - if (!arg1) { - if (Array.isArray(arg2)) { - throw new Error("Zodios: missing base url"); - } - throw new Error("Zodios: missing api description"); - } - let baseURL: string | undefined; - if (typeof arg1 === "string" && Array.isArray(arg2)) { - baseURL = arg1; - this.api = arg2; - options = arg3 || {}; - } else if (Array.isArray(arg1) && !Array.isArray(arg2)) { - this.api = arg1; - options = arg2 || {}; - } else { - throw new Error("Zodios: api must be an array"); - } - - checkApi(this.api); - - this.options = { - validate: true, - transform: true, - sendDefaults: false, - typeProvider: zodTypeProvider as any, - fetcherProvider: axiosProvider, - ...options, - }; - this._typeProvider = undefined as any; - this._fetcherProvider = undefined as any; - this.options.fetcherProvider.create({ baseURL, ...this.options }); - - this.injectAliasEndpoints(); - this.initPlugins(); - if ([true, "all", "request", "response"].includes(this.options.validate)) { - this.use(zodValidationPlugin(this.options)); - } - } - - private initPlugins() { - this.endpointPlugins.set("any-any", new ZodiosPlugins("any", "any")); - - this.api.forEach((endpoint) => { - const plugins = new ZodiosPlugins( - endpoint.method, - endpoint.path - ); - switch (endpoint.requestFormat) { - case "binary": - plugins.use( - headerPlugin( - "Content-Type", - "application/octet-stream" - ) - ); - break; - case "form-data": - plugins.use(formDataPlugin()); - break; - case "form-url": - plugins.use(formURLPlugin()); - break; - case "text": - plugins.use( - headerPlugin("Content-Type", "text/plain") - ); - break; - } - this.endpointPlugins.set(`${endpoint.method}-${endpoint.path}`, plugins); - }); - } - - private getAnyEndpointPlugins() { - return this.endpointPlugins.get("any-any"); - } - - private findAliasEndpointPlugins(alias: string) { - const endpoint = this.api.find((endpoint) => endpoint.alias === alias); - if (endpoint) { - return this.endpointPlugins.get(`${endpoint.method}-${endpoint.path}`); - } - return undefined; - } - - private findEnpointPlugins(method: Method, path: string) { - return this.endpointPlugins.get(`${method}-${path}`); - } - - /** - * register a plugin to intercept the requests or responses - * @param plugin - the plugin to use - * @returns an id to allow you to unregister the plugin - */ - use(plugin: ZodiosPlugin): PluginId; - use>( - alias: Alias, - plugin: ZodiosPlugin - ): PluginId; - use>( - method: M, - path: Path, - plugin: ZodiosPlugin - ): PluginId; - use(...args: unknown[]) { - if (typeof args[0] === "object") { - const plugins = this.getAnyEndpointPlugins()!; - return plugins.use(args[0] as ZodiosPlugin); - } else if (typeof args[0] === "string" && typeof args[1] === "object") { - const plugins = this.findAliasEndpointPlugins(args[0]); - if (!plugins) - throw new Error( - `Zodios: no alias '${args[0]}' found to register plugin` - ); - return plugins.use(args[1] as ZodiosPlugin); - } else if ( - typeof args[0] === "string" && - typeof args[1] === "string" && - typeof args[2] === "object" - ) { - const plugins = this.findEnpointPlugins(args[0] as Method, args[1]); - if (!plugins) - throw new Error( - `Zodios: no endpoint '${args[0]} ${args[1]}' found to register plugin` - ); - return plugins.use(args[2] as ZodiosPlugin); - } - throw new Error("Zodios: invalid plugin registration"); - } - - /** - * unregister a plugin - * if the plugin name is provided instead of the registration plugin id, - * it will unregister the plugin with that name only for non endpoint plugins - * @param plugin - id of the plugin to remove - */ - eject(plugin: PluginId | string): void { - if (typeof plugin === "string") { - const plugins = this.getAnyEndpointPlugins()!; - plugins.eject(plugin); - return; - } - this.endpointPlugins.get(plugin.key)?.eject(plugin); - } - - private injectAliasEndpoints() { - this.api.forEach((endpoint) => { - if (endpoint.alias) { - (this as any)[endpoint.alias] = (config: any) => - this.request({ - ...config, - method: endpoint.method, - url: endpoint.path, - }); - } - }); - } - - /** - * make a request to the api - * @param config - the config to setup zodios options and parameters - * @returns response validated with zod schema provided in the api description - */ - async request< - M extends Method, - Path extends ZodiosPathsByMethod, - TConfig = ReadonlyDeep< - ZodiosRequestOptions - > - >( - config: TConfig - ): Promise> { - let conf = config as unknown as ReadonlyDeep< - AnyZodiosRequestOptions - >; - const anyPlugin = this.getAnyEndpointPlugins()!; - const endpointPlugin = this.findEnpointPlugins(conf.method, conf.url); - conf = await anyPlugin.interceptRequest(this.api, conf); - if (endpointPlugin) { - conf = await endpointPlugin.interceptRequest(this.api, conf); - } - let response = this.options.fetcherProvider.fetch(conf); - if (endpointPlugin) { - response = endpointPlugin.interceptResponse(this.api, conf, response); - } - response = anyPlugin.interceptResponse(this.api, conf, response); - return (await response).data; - } - - /** - * make a get request to the api - * @param path - the path to api endpoint - * @param config - the config to setup axios options and parameters - * @returns response validated with zod schema provided in the api description - */ - async get< - Path extends ZodiosPathsByMethod, - TConfig extends ZodiosRequestOptionsByPath< - Api, - "get", - Path, - true, - TypeProvider, - FetcherProvider - > - >( - path: Path, - ...[config]: RequiredKeys extends never - ? [config?: ReadonlyDeep] - : [config: ReadonlyDeep] - ): Promise> { - return this.request({ - ...config, - method: "get", - url: path, - }); - } - - /** - * make a post request to the api - * @param path - the path to api endpoint - * @param data - the data to send - * @param config - the config to setup axios options and parameters - * @returns response validated with zod schema provided in the api description - */ - async post< - Path extends ZodiosPathsByMethod, - TConfig extends ZodiosRequestOptionsByPath< - Api, - "post", - Path, - true, - TypeProvider, - FetcherProvider - > - >( - path: Path, - ...[config]: RequiredKeys extends never - ? [config?: ReadonlyDeep] - : [config: ReadonlyDeep] - ): Promise> { - return this.request({ - ...config, - method: "post", - url: path, - }); - } - - /** - * make a put request to the api - * @param path - the path to api endpoint - * @param data - the data to send - * @param config - the config to setup axios options and parameters - * @returns response validated with zod schema provided in the api description - */ - async put< - Path extends ZodiosPathsByMethod, - TConfig extends ZodiosRequestOptionsByPath< - Api, - "put", - Path, - true, - TypeProvider, - FetcherProvider - > - >( - path: Path, - ...[config]: RequiredKeys extends never - ? [config?: ReadonlyDeep] - : [config: ReadonlyDeep] - ): Promise> { - return this.request({ - ...config, - method: "put", - url: path, - }); - } - - /** - * make a patch request to the api - * @param path - the path to api endpoint - * @param data - the data to send - * @param config - the config to setup axios options and parameters - * @returns response validated with zod schema provided in the api description - */ - async patch< - Path extends ZodiosPathsByMethod, - TConfig extends ZodiosRequestOptionsByPath< - Api, - "patch", - Path, - true, - TypeProvider, - FetcherProvider - > - >( - path: Path, - ...[config]: RequiredKeys extends never - ? [config?: ReadonlyDeep] - : [config: ReadonlyDeep] - ): Promise> { - return this.request({ - ...config, - method: "patch", - url: path, - }); - } - - /** - * make a delete request to the api - * @param path - the path to api endpoint - * @param config - the config to setup axios options and parameters - * @returns response validated with zod schema provided in the api description - */ - async delete< - Path extends ZodiosPathsByMethod, - TConfig extends ZodiosRequestOptionsByPath< - Api, - "delete", - Path, - true, - TypeProvider, - FetcherProvider - > - >( - path: Path, - ...[config]: RequiredKeys extends never - ? [config?: ReadonlyDeep] - : [config: ReadonlyDeep] - ): Promise> { - return this.request({ - ...config, - method: "delete", - url: path, - }); - } -} - -export type ZodiosInstance< - Api extends ZodiosEndpointDefinitions, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, - FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider -> = ZodiosClass & - ZodiosAliases; - -export type ZodiosConstructor = { +export type ZodiosAxiosConstructor = { new < Api extends ZodiosEndpointDefinitions, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, - FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider >( api: Narrow, - options?: ZodiosOptions & - TypeOfFetcherOptions - ): ZodiosInstance; + options?: ZodiosOptions & + TypeOfFetcherOptions + ): ZodiosInstance; new < Api extends ZodiosEndpointDefinitions, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, - FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider >( baseUrl: string, api: Narrow, - options?: ZodiosOptions & - TypeOfFetcherOptions - ): ZodiosInstance; + options?: ZodiosOptions & + TypeOfFetcherOptions + ): ZodiosInstance; }; -export const Zodios = ZodiosClass as ZodiosConstructor; - -/** - * Get the Api description type from zodios - * @param Z - zodios type - */ -export type ApiOf> = Z["api"]; -/** - * Get the type provider type from zodios - * @param Z - zodios type - */ -export type TypeProviderOf> = - Z["_typeProvider"]; +const Zodios = ZodiosAxios as unknown as ZodiosAxiosConstructor; -export type FetcherProviderOf> = - Z["_fetcherProvider"]; +export { Zodios }; diff --git a/packages/axios/src/zodios.types.ts b/packages/axios/src/zodios.types.ts deleted file mode 100644 index 5b2883c6..00000000 --- a/packages/axios/src/zodios.types.ts +++ /dev/null @@ -1,836 +0,0 @@ -import type { - FilterArrayByValue, - PickDefined, - NeverIfEmpty, - UndefinedToOptional, - PathParamNames, - TransitiveOptional, - ReadonlyDeep, - Merge, - FilterArrayByKey, - IfEquals, - RequiredKeys, - UndefinedIfNever, -} from "./utils.types"; -import type { - AnyZodiosTypeProvider, - InferInputTypeFromSchema, - InferOutputTypeFromSchema, - ZodiosRuntimeTypeProvider, - ZodTypeProvider, -} from "./type-providers"; -import { - AnyZodiosFetcherProvider, - TypeOfFetcherConfig, - TypeOfFetcherError, - TypeOfFetcherResponse, - ZodiosRuntimeFetcherProvider, - AxiosProvider, -} from "./fetcher-providers"; - -export type MutationMethod = "post" | "put" | "patch" | "delete"; - -export type Method = "get" | "head" | "options" | MutationMethod; - -export type RequestFormat = - | "json" // default - | "form-data" // for file uploads - | "form-url" // for hiding query params in the body - | "binary" // for binary data / file uploads - | "text"; // for text data - -type EndpointDefinitionsByMethod< - Api extends ZodiosEndpointDefinition[], - M extends Method -> = FilterArrayByValue; - -export type ZodiosEndpointDefinitionByPath< - Api extends ZodiosEndpointDefinition[], - M extends Method, - Path extends ZodiosPathsByMethod -> = FilterArrayByValue; - -export type ZodiosEndpointDefinitionByAlias< - Api extends ZodiosEndpointDefinition[], - Alias extends string -> = FilterArrayByValue; - -export type ZodiosPathsByMethod< - Api extends ZodiosEndpointDefinition[], - M extends Method -> = EndpointDefinitionsByMethod[number]["path"]; - -export type Aliases = FilterArrayByKey< - Api, - "alias" ->[number]["alias"]; - -export type ZodiosResponseForEndpoint< - Endpoint extends ZodiosEndpointDefinition, - Frontend extends boolean = true, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider -> = Frontend extends true - ? InferOutputTypeFromSchema - : InferInputTypeFromSchema; - -export type ZodiosResponseByPath< - Api extends ZodiosEndpointDefinition[], - M extends Method, - Path extends ZodiosPathsByMethod, - Frontend extends boolean = true, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider -> = Frontend extends true - ? InferOutputTypeFromSchema< - TypeProvider, - ZodiosEndpointDefinitionByPath[number]["response"] - > - : InferInputTypeFromSchema< - TypeProvider, - ZodiosEndpointDefinitionByPath[number]["response"] - >; - -export type ZodiosResponseByAlias< - Api extends ZodiosEndpointDefinition[], - Alias extends string, - Frontend extends boolean = true, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider -> = Frontend extends true - ? InferOutputTypeFromSchema< - TypeProvider, - ZodiosEndpointDefinitionByAlias[number]["response"] - > - : InferInputTypeFromSchema< - TypeProvider, - ZodiosEndpointDefinitionByAlias[number]["response"] - >; - -export type ZodiosDefaultErrorForEndpoint< - Endpoint extends ZodiosEndpointDefinition -> = FilterArrayByValue< - Endpoint["errors"], - { - status: "default"; - } ->[number]["schema"]; - -type ZodiosDefaultErrorByPath< - Api extends ZodiosEndpointDefinition[], - M extends Method, - Path extends ZodiosPathsByMethod -> = FilterArrayByValue< - ZodiosEndpointDefinitionByPath[number]["errors"], - { - status: "default"; - } ->[number]["schema"]; - -type ZodiosDefaultErrorByAlias< - Api extends ZodiosEndpointDefinition[], - Alias extends string -> = FilterArrayByValue< - ZodiosEndpointDefinitionByAlias[number]["errors"], - { - status: "default"; - } ->[number]["schema"]; - -type IfNever = IfEquals; - -export type ZodiosErrorForEndpoint< - Endpoint extends ZodiosEndpointDefinition, - Status extends number, - Frontend extends boolean = true, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider -> = Frontend extends true - ? InferOutputTypeFromSchema< - TypeProvider, - IfNever< - FilterArrayByValue< - Endpoint["errors"], - { - status: Status; - } - >[number]["schema"], - ZodiosDefaultErrorForEndpoint - > - > - : InferInputTypeFromSchema< - TypeProvider, - IfNever< - FilterArrayByValue< - Endpoint["errors"], - { - status: Status; - } - >[number]["schema"], - ZodiosDefaultErrorForEndpoint - > - >; - -export type ZodiosErrorByPath< - Api extends ZodiosEndpointDefinition[], - M extends Method, - Path extends ZodiosPathsByMethod, - Status extends number, - Frontend extends boolean = true, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider -> = Frontend extends true - ? InferOutputTypeFromSchema< - TypeProvider, - IfNever< - FilterArrayByValue< - ZodiosEndpointDefinitionByPath[number]["errors"], - { - status: Status; - } - >[number]["schema"], - ZodiosDefaultErrorByPath - > - > - : InferInputTypeFromSchema< - TypeProvider, - IfNever< - FilterArrayByValue< - ZodiosEndpointDefinitionByPath[number]["errors"], - { - status: Status; - } - >[number]["schema"], - ZodiosDefaultErrorByPath - > - >; - -export type InferFetcherErrors< - T, - TypeProvider extends AnyZodiosTypeProvider, - FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider, - Acc extends unknown[] = [] -> = T extends [infer Head, ...infer Tail] - ? Head extends { - status: infer Status; - schema: infer Schema; - } - ? InferFetcherErrors< - Tail, - TypeProvider, - FetcherProvider, - [ - ...Acc, - TypeOfFetcherError< - FetcherProvider, - InferOutputTypeFromSchema, - Status - > - ] - > - : Acc - : Acc; - -export type ZodiosMatchingErrorsByPath< - Api extends ZodiosEndpointDefinition[], - M extends Method, - Path extends ZodiosPathsByMethod, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider -> = InferFetcherErrors< - ZodiosEndpointDefinitionByPath[number]["errors"], - TypeProvider ->[number]; - -export type ZodiosMatchingErrorsByAlias< - Api extends ZodiosEndpointDefinition[], - Alias extends string, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider -> = InferFetcherErrors< - ZodiosEndpointDefinitionByAlias[number]["errors"], - TypeProvider ->[number]; - -export type ZodiosErrorByAlias< - Api extends ZodiosEndpointDefinition[], - Alias extends string, - Status extends number, - Frontend extends boolean = true, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider -> = Frontend extends true - ? InferOutputTypeFromSchema< - TypeProvider, - IfNever< - FilterArrayByValue< - ZodiosEndpointDefinitionByAlias[number]["errors"], - { - status: Status; - } - >[number]["schema"], - ZodiosDefaultErrorByAlias - > - > - : InferInputTypeFromSchema< - TypeProvider, - IfNever< - FilterArrayByValue< - ZodiosEndpointDefinitionByAlias[number]["errors"], - { - status: Status; - } - >[number]["schema"], - ZodiosDefaultErrorByAlias - > - >; - -export type BodySchemaForEndpoint = - FilterArrayByValue< - Endpoint["parameters"], - { type: "Body" } - >[number]["schema"]; - -export type BodySchema< - Api extends ZodiosEndpointDefinition[], - M extends Method, - Path extends ZodiosPathsByMethod -> = FilterArrayByValue< - ZodiosEndpointDefinitionByPath[number]["parameters"], - { type: "Body" } ->[number]["schema"]; - -export type ZodiosBodyForEndpoint< - Endpoint extends ZodiosEndpointDefinition, - Frontend extends boolean = true, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider -> = Frontend extends true - ? InferInputTypeFromSchema> - : InferOutputTypeFromSchema>; - -export type ZodiosBodyByPath< - Api extends ZodiosEndpointDefinition[], - M extends Method, - Path extends ZodiosPathsByMethod, - Frontend extends boolean = true, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider -> = Frontend extends true - ? InferInputTypeFromSchema> - : InferOutputTypeFromSchema>; - -export type BodySchemaByAlias< - Api extends ZodiosEndpointDefinition[], - Alias extends string -> = FilterArrayByValue< - ZodiosEndpointDefinitionByAlias[number]["parameters"], - { type: "Body" } ->[number]["schema"]; - -export type ZodiosBodyByAlias< - Api extends ZodiosEndpointDefinition[], - Alias extends string, - Frontend extends boolean = true, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider -> = Frontend extends true - ? InferInputTypeFromSchema> - : InferOutputTypeFromSchema>; - -/** - * Map a type an api description parameter to a zod infer type - * @param T - array of api description parameters - * @details - this is using tail recursion type optimization from typescript 4.5 - */ -export type MapSchemaParameters< - T, - Frontend extends boolean = true, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, - Acc = {} -> = T extends [infer Head, ...infer Tail] - ? Head extends { - name: infer Name; - schema: infer Schema; - } - ? Name extends string - ? MapSchemaParameters< - Tail, - Frontend, - TypeProvider, - Merge< - { - [Key in Name]: Frontend extends true - ? InferInputTypeFromSchema - : InferOutputTypeFromSchema; - }, - Acc - > - > - : Acc - : Acc - : Acc; - -export type ZodiosQueryParamsForEndpoint< - Endpoint extends ZodiosEndpointDefinition, - Frontend extends boolean = true, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider -> = NeverIfEmpty< - UndefinedToOptional< - MapSchemaParameters< - FilterArrayByValue, - Frontend, - TypeProvider - > - > ->; - -export type ZodiosQueryParamsByPath< - Api extends ZodiosEndpointDefinition[], - M extends Method, - Path extends ZodiosPathsByMethod, - Frontend extends boolean = true, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider -> = NeverIfEmpty< - UndefinedToOptional< - MapSchemaParameters< - FilterArrayByValue< - ZodiosEndpointDefinitionByPath[number]["parameters"], - { type: "Query" } - >, - Frontend, - TypeProvider - > - > ->; - -export type ZodiosQueryParamsByAlias< - Api extends ZodiosEndpointDefinition[], - Alias extends string, - Frontend extends boolean = true, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider -> = NeverIfEmpty< - UndefinedToOptional< - MapSchemaParameters< - FilterArrayByValue< - ZodiosEndpointDefinitionByAlias[number]["parameters"], - { type: "Query" } - >, - Frontend, - TypeProvider - > - > ->; - -/** - * @deprecated - use ZodiosQueryParamsByPath instead - */ -export type ZodiosPathParams = NeverIfEmpty< - Record, string | number> ->; - -export type ZodiosPathParamsForEndpoint< - Endpoint extends ZodiosEndpointDefinition, - Frontend extends boolean = true, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, - PathParameters = MapSchemaParameters< - FilterArrayByValue, - Frontend, - TypeProvider - > -> = NeverIfEmpty<{ - [K in PathParamNames]: PathParameters extends { - [Key in K]: any; - } - ? PathParameters[K] - : string | number; -}>; - -/** - * Get path params for a given endpoint by path - */ -export type ZodiosPathParamsByPath< - Api extends ZodiosEndpointDefinition[], - M extends Method, - Path extends ZodiosPathsByMethod, - Frontend extends boolean = true, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, - PathParameters = MapSchemaParameters< - FilterArrayByValue< - ZodiosEndpointDefinitionByPath[number]["parameters"], - { type: "Path" } - >, - Frontend, - TypeProvider - > -> = NeverIfEmpty<{ - [K in PathParamNames]: PathParameters extends { [Key in K]: any } - ? PathParameters[K] - : string | number; -}>; - -/** - * Get path params for a given endpoint by alias - */ -export type ZodiosPathParamByAlias< - Api extends ZodiosEndpointDefinition[], - Alias extends string, - Frontend extends boolean = true, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, - EndpointDefinition extends ZodiosEndpointDefinition = ZodiosEndpointDefinitionByAlias< - Api, - Alias - >[number], - Path = EndpointDefinition["path"], - PathParameters = MapSchemaParameters< - FilterArrayByValue, - Frontend, - TypeProvider - > -> = NeverIfEmpty<{ - [K in PathParamNames]: PathParameters extends { [Key in K]: any } - ? PathParameters[K] - : string | number; -}>; - -export type ZodiosHeaderParamsForEndpoint< - Endpoint extends ZodiosEndpointDefinition, - Frontend extends boolean = true, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider -> = NeverIfEmpty< - UndefinedToOptional< - MapSchemaParameters< - FilterArrayByValue, - Frontend, - TypeProvider - > - > ->; - -export type ZodiosHeaderParamsByPath< - Api extends ZodiosEndpointDefinition[], - M extends Method, - Path extends ZodiosPathsByMethod, - Frontend extends boolean = true, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider -> = NeverIfEmpty< - UndefinedToOptional< - MapSchemaParameters< - FilterArrayByValue< - ZodiosEndpointDefinitionByPath[number]["parameters"], - { type: "Header" } - >, - Frontend, - TypeProvider - > - > ->; - -export type ZodiosHeaderParamsByAlias< - Api extends ZodiosEndpointDefinition[], - Alias extends string, - Frontend extends boolean = true, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider -> = NeverIfEmpty< - UndefinedToOptional< - MapSchemaParameters< - FilterArrayByValue< - ZodiosEndpointDefinitionByAlias[number]["parameters"], - { type: "Header" } - >, - Frontend, - TypeProvider - > - > ->; - -export type ZodiosRequestOptionsByAlias< - Api extends ZodiosEndpointDefinition[], - Alias extends string, - Frontend extends boolean = true, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, - FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider -> = Merge< - TypeOfFetcherConfig, - TransitiveOptional< - PickDefined<{ - params: ZodiosPathParamByAlias; - queries: ZodiosQueryParamsByAlias; - headers: ZodiosHeaderParamsByAlias; - body: ZodiosBodyByAlias; - }> - > ->; - -export type ZodiosMutationAliasRequest = - RequiredKeys extends never - ? (configOptions?: ReadonlyDeep) => Promise - : (configOptions: ReadonlyDeep) => Promise; - -export type ZodiosAliasRequest = - RequiredKeys extends never - ? (configOptions?: ReadonlyDeep) => Promise - : (configOptions: ReadonlyDeep) => Promise; - -export type ZodiosAliases< - Api extends ZodiosEndpointDefinition[], - Frontend extends boolean = true, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, - FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider -> = { - [Alias in Aliases]: ZodiosEndpointDefinitionByAlias< - Api, - Alias - >[number]["method"] extends MutationMethod - ? ZodiosMutationAliasRequest< - ZodiosRequestOptionsByAlias< - Api, - Alias, - Frontend, - TypeProvider, - FetcherProvider - >, - ZodiosResponseByAlias - > - : ZodiosAliasRequest< - ZodiosRequestOptionsByAlias< - Api, - Alias, - Frontend, - TypeProvider, - FetcherProvider - >, - ZodiosResponseByAlias - >; -}; - -export type AnyZodiosMethodOptions< - FetcherProvider extends AnyZodiosFetcherProvider -> = Merge< - TypeOfFetcherConfig, - { - params?: Record; - queries?: Record; - headers?: Record; - body?: unknown; - } ->; - -export type AnyZodiosRequestOptions< - FetcherProvider extends AnyZodiosFetcherProvider -> = Merge< - { method: Method; url: string }, - AnyZodiosMethodOptions ->; - -/** - * Get the request options for a given endpoint - */ -export type ZodiosRequestOptionsByPath< - Api extends ZodiosEndpointDefinition[], - M extends Method, - Path extends ZodiosPathsByMethod, - Frontend extends boolean = true, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, - FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider -> = Merge< - TypeOfFetcherConfig, - TransitiveOptional< - PickDefined<{ - params: ZodiosPathParamsByPath; - queries: ZodiosQueryParamsByPath; - headers: ZodiosHeaderParamsByPath; - body: ZodiosBodyByPath; - }> - > ->; - -export type ZodiosRequestOptions< - Api extends ZodiosEndpointDefinition[], - M extends Method, - Path extends ZodiosPathsByMethod, - Frontend extends boolean = true, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, - FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider -> = Merge< - { - method: M; - url: Path; - data?: ZodiosBodyByPath; - }, - ZodiosRequestOptionsByPath< - Api, - M, - Path, - Frontend, - TypeProvider, - FetcherProvider - > ->; - -/** - * Zodios options - */ -export type ZodiosOptions< - FetcherProvider extends AnyZodiosFetcherProvider = AxiosProvider, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider -> = { - /** - * Should zodios validate parameters and response? Default: true - */ - validate?: boolean | "request" | "response" | "all" | "none"; - /** - * Should zodios transform the request and response ? Default: true - */ - transform?: boolean | "request" | "response"; - /** - * Should zod schema default values be used on parameters? Default: false - * you usually want your backend to handle default values - */ - sendDefaults?: boolean; - - fetcherProvider?: ZodiosRuntimeFetcherProvider; - - /** - * set a custom type provider. Default: ZodTypeProvider - */ - typeProvider?: ZodiosRuntimeTypeProvider; -}; - -export type ZodiosEndpointParameter = { - /** - * name of the parameter - */ - name: string; - /** - * optional description of the parameter - */ - description?: string; - /** - * type of the parameter: Query, Body, Header, Path - */ - type: "Query" | "Body" | "Header" | "Path"; - /** - * zod schema of the parameter - * you can use zod `transform` to transform the value of the parameter before sending it to the server - */ - schema: unknown; -}; - -export type ZodiosEndpointParameters = ZodiosEndpointParameter[]; - -export type ZodiosEndpointError = { - /** - * status code of the error - * use 'default' to declare a default error - */ - status: number | "default"; - /** - * description of the error - used to generate the openapi error description - */ - description?: string; - /** - * schema of the error - */ - schema: unknown; -}; - -export type ZodiosEndpointErrors = ZodiosEndpointError[]; - -/** - * Zodios enpoint definition that should be used to create a new instance of Zodios - */ -export type ZodiosEndpointDefinition = { - /** - * http method : get, post, put, patch, delete - */ - method: Method; - /** - * path of the endpoint - * @example - * ```text - * /posts/:postId/comments/:commentId - * ``` - */ - path: string; - /** - * optional alias to call the endpoint easily - * @example - * ```text - * getPostComments - * ``` - */ - alias?: string; - /** - * optional description of the endpoint - */ - description?: string; - /** - * optional request format of the endpoint: json, form-data, form-url, binary, text - */ - requestFormat?: RequestFormat; - /** - * optionally mark the endpoint as immutable to allow zodios to cache the response with react-query - * use it to mark a 'post' endpoint as immutable - */ - immutable?: boolean; - /** - * optional parameters of the endpoint - */ - parameters?: Array; - /** - * response of the endpoint - * you can use zod `transform` to transform the value of the response before returning it - */ - response: unknown; - /** - * optional response status of the endpoint for sucess, default is 200 - * customize it if your endpoint returns a different status code and if you need openapi to generate the correct status code - */ - status?: number; - /** - * optional response description of the endpoint - */ - responseDescription?: string; - /** - * optional errors of the endpoint - only usefull when using @zodios/express - */ - errors?: Array; -}; - -export type ZodiosEndpointDefinitions = ZodiosEndpointDefinition[]; - -/** - * Zodios plugin that can be used to intercept zodios requests and responses - */ -export type ZodiosPlugin = { - /** - * Optional name of the plugin - * naming a plugin allows to remove it or replace it later - */ - name?: string; - /** - * request interceptor to modify or inspect the request before it is sent - * @param api - the api description - * @param request - the request config - * @returns possibly a new request config - */ - request?: ( - api: ZodiosEndpointDefinitions, - config: ReadonlyDeep> - ) => Promise>>; - /** - * response interceptor to modify or inspect the response before it is returned - * @param api - the api description - * @param config - the request config - * @param response - the response - * @returns possibly a new response - */ - response?: ( - api: ZodiosEndpointDefinitions, - config: ReadonlyDeep>, - response: TypeOfFetcherResponse - ) => Promise>; - /** - * error interceptor for response errors - * there is no error interceptor for request errors - * @param api - the api description - * @param config - the config for the request - * @param error - the error that occured - * @returns possibly a new response or a new error - */ - error?: ( - api: ZodiosEndpointDefinitions, - config: ReadonlyDeep>, - error: Error - ) => Promise>; -}; diff --git a/packages/axios/tsup.config.js b/packages/axios/tsup.config.js index 6fc64294..899d5e3f 100644 --- a/packages/axios/tsup.config.js +++ b/packages/axios/tsup.config.js @@ -3,7 +3,7 @@ import { defineConfig } from "tsup"; export default defineConfig({ clean: true, dts: true, - entry: ["src/index.ts", "src/utils.types.ts", "src/zodios.types.ts"], + entry: ["src/index.ts"], outDir: "lib", format: ["cjs", "esm"], minify: true, From 56c6fe72b11123a7ed8f535f8f09c62fa8f21ccc Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sat, 19 Nov 2022 22:05:40 +0100 Subject: [PATCH 039/206] docs(changeset): update axios --- .changeset/red-eels-drum.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/red-eels-drum.md diff --git a/.changeset/red-eels-drum.md b/.changeset/red-eels-drum.md new file mode 100644 index 00000000..199098e6 --- /dev/null +++ b/.changeset/red-eels-drum.md @@ -0,0 +1,6 @@ +--- +"@zodios/axios": major +"@zodios/core": major +--- + +update axios From 734c3927f45e60e625cdcf802ae29291eb803adc Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sat, 19 Nov 2022 22:06:50 +0100 Subject: [PATCH 040/206] RELEASING: Releasing 2 package(s) Releases: @zodios/core@11.0.0-beta.4 @zodios/axios@11.0.0-beta.4 [skip ci] --- packages/axios/CHANGELOG.md | 16 ++++++++++++++++ packages/axios/package.json | 2 +- packages/core/CHANGELOG.md | 14 ++++++++++++++ packages/core/package.json | 2 +- 4 files changed, 32 insertions(+), 2 deletions(-) diff --git a/packages/axios/CHANGELOG.md b/packages/axios/CHANGELOG.md index 673f2985..ef5da67e 100644 --- a/packages/axios/CHANGELOG.md +++ b/packages/axios/CHANGELOG.md @@ -1,5 +1,21 @@ # @zodios/core +## 11.0.0-beta.4 + +### Major Changes + +- 679a267: update axios + +### Patch Changes + +- Updated dependencies [14ce00b] +- Updated dependencies [c9cae0a] +- Updated dependencies [3ac25a1] +- Updated dependencies [6c10dc2] +- Updated dependencies [679a267] +- Updated dependencies [90108a5] + - @zodios/core@11.0.0-beta.4 + ## 11.0.0-beta.3 ### Patch Changes diff --git a/packages/axios/package.json b/packages/axios/package.json index 7b4d19cb..aac902f7 100644 --- a/packages/axios/package.json +++ b/packages/axios/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/axios", "description": "Typescript API client with axios", - "version": "11.0.0-beta.3", + "version": "11.0.0-beta.4", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 673f2985..b6b0171b 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,19 @@ # @zodios/core +## 11.0.0-beta.4 + +### Major Changes + +- 6c10dc2: rename exports +- 679a267: update axios + +### Patch Changes + +- 14ce00b: add fetch implementation +- c9cae0a: autocommit on changesets +- 3ac25a1: add fetcher provider and axios impl +- 90108a5: body is now part of the config + ## 11.0.0-beta.3 ### Patch Changes diff --git a/packages/core/package.json b/packages/core/package.json index abb95753..ccda32c6 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/core", "description": "Typescript API client with autocompletion and zod validations", - "version": "11.0.0-beta.3", + "version": "11.0.0-beta.4", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", From 56338e427240f09cbd221985db90f30362239497 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sat, 19 Nov 2022 22:09:54 +0100 Subject: [PATCH 041/206] docs(changeset): sync axios and core versions --- .changeset/silent-garlics-scream.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/silent-garlics-scream.md diff --git a/.changeset/silent-garlics-scream.md b/.changeset/silent-garlics-scream.md new file mode 100644 index 00000000..3dd43a4c --- /dev/null +++ b/.changeset/silent-garlics-scream.md @@ -0,0 +1,6 @@ +--- +"@zodios/axios": major +"@zodios/core": major +--- + +sync axios and core versions From 9a2aa7b53f6b9c0d63d0b308a7768039b7bbba56 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sat, 19 Nov 2022 22:11:01 +0100 Subject: [PATCH 042/206] chore: clean changsets --- .changeset/beige-horses-deny.md | 5 ----- .changeset/dry-worms-smell.md | 5 ----- .changeset/few-bottles-shave.md | 5 ----- .changeset/neat-frogs-fold.md | 5 ----- .changeset/orange-balloons-peel.md | 5 ----- .changeset/pre.json | 10 +++------- .changeset/red-eels-drum.md | 6 ------ .changeset/shy-games-beg.md | 5 ----- .changeset/thin-dots-know.md | 5 ----- .changeset/warm-beans-do.md | 5 ----- .changeset/wet-rocks-sniff.md | 5 ----- 11 files changed, 3 insertions(+), 58 deletions(-) delete mode 100644 .changeset/beige-horses-deny.md delete mode 100644 .changeset/dry-worms-smell.md delete mode 100644 .changeset/few-bottles-shave.md delete mode 100644 .changeset/neat-frogs-fold.md delete mode 100644 .changeset/orange-balloons-peel.md delete mode 100644 .changeset/red-eels-drum.md delete mode 100644 .changeset/shy-games-beg.md delete mode 100644 .changeset/thin-dots-know.md delete mode 100644 .changeset/warm-beans-do.md delete mode 100644 .changeset/wet-rocks-sniff.md diff --git a/.changeset/beige-horses-deny.md b/.changeset/beige-horses-deny.md deleted file mode 100644 index f6b0abce..00000000 --- a/.changeset/beige-horses-deny.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@zodios/core": patch ---- - -add fetch implementation diff --git a/.changeset/dry-worms-smell.md b/.changeset/dry-worms-smell.md deleted file mode 100644 index 13a619de..00000000 --- a/.changeset/dry-worms-smell.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@zodios/core": patch ---- - -remove publish action from ci diff --git a/.changeset/few-bottles-shave.md b/.changeset/few-bottles-shave.md deleted file mode 100644 index 0c71a38e..00000000 --- a/.changeset/few-bottles-shave.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@zodios/core": patch ---- - -autocommit on changesets diff --git a/.changeset/neat-frogs-fold.md b/.changeset/neat-frogs-fold.md deleted file mode 100644 index b9d15125..00000000 --- a/.changeset/neat-frogs-fold.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@zodios/core": patch ---- - -add fetcher provider and axios impl diff --git a/.changeset/orange-balloons-peel.md b/.changeset/orange-balloons-peel.md deleted file mode 100644 index 85b7cc6f..00000000 --- a/.changeset/orange-balloons-peel.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@zodios/core": major ---- - -rename exports diff --git a/.changeset/pre.json b/.changeset/pre.json index e8472216..b8569fa3 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -2,12 +2,8 @@ "mode": "pre", "tag": "beta", "initialVersions": { - "@zodios/core": "11.0.0-rc.0" + "@zodios/core": "11.0.0-beta.0", + "@zodios/axios": "11.0.0-beta.0" }, - "changesets": [ - "dry-worms-smell", - "shy-games-beg", - "thin-dots-know", - "warm-beans-do" - ] + "changesets": [] } diff --git a/.changeset/red-eels-drum.md b/.changeset/red-eels-drum.md deleted file mode 100644 index 199098e6..00000000 --- a/.changeset/red-eels-drum.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@zodios/axios": major -"@zodios/core": major ---- - -update axios diff --git a/.changeset/shy-games-beg.md b/.changeset/shy-games-beg.md deleted file mode 100644 index dea58cbc..00000000 --- a/.changeset/shy-games-beg.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@zodios/core": patch ---- - -add publish script diff --git a/.changeset/thin-dots-know.md b/.changeset/thin-dots-know.md deleted file mode 100644 index 997ec446..00000000 --- a/.changeset/thin-dots-know.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@zodios/core": patch ---- - -migrate to monorepo diff --git a/.changeset/warm-beans-do.md b/.changeset/warm-beans-do.md deleted file mode 100644 index 6b6b3b01..00000000 --- a/.changeset/warm-beans-do.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@zodios/core": patch ---- - -add tests for type providers diff --git a/.changeset/wet-rocks-sniff.md b/.changeset/wet-rocks-sniff.md deleted file mode 100644 index e7cc6601..00000000 --- a/.changeset/wet-rocks-sniff.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@zodios/core": patch ---- - -body is now part of the config From 22de18e0fa7484c63d9d626352f447f26418b31c Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sat, 19 Nov 2022 22:31:14 +0100 Subject: [PATCH 043/206] tests(axios): fix tests --- packages/axios/src/zodios.test.ts | 23 +++++++++++++++++------ packages/axios/src/zodios.ts | 13 +++++++------ 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/packages/axios/src/zodios.test.ts b/packages/axios/src/zodios.test.ts index cd769466..903fb014 100644 --- a/packages/axios/src/zodios.test.ts +++ b/packages/axios/src/zodios.test.ts @@ -1,3 +1,4 @@ +/// import { AxiosError } from "axios"; import express from "express"; import { AddressInfo } from "net"; @@ -6,9 +7,15 @@ import { z, ZodError } from "zod"; globalThis.FormData = require("form-data"); //} import { Zodios } from "./zodios"; -import { ZodiosError, AnyZodiosFetcherProvider } from "@zodios/core"; +import { + ZodiosError, + AnyZodiosFetcherProvider, + ZodiosPlugin, + apiBuilder, +} from "@zodios/core"; import multer from "multer"; -import { Assert } from "./utils.types"; +import { Assert } from "@zodios/core/lib/utils.types"; +import { AxiosProvider } from "./axios-provider"; const multipart = multer({ storage: multer.memoryStorage() }); @@ -845,7 +852,7 @@ received: } expect(error).toBeInstanceOf(Error); expect((error as AxiosError).response?.status).toBe(502); - if (isErrorFromPath(zodios.api, "get", "/error502", error)) { + if (zodios.isErrorFromPath(zodios.api, "get", "/error502", error)) { expect(error.response.status).toBe(502); if (error.response.status === 502) { const data = error.response.data; @@ -855,7 +862,7 @@ received: error: { message: "bad gateway" }, }); } - if (isErrorFromAlias(zodios.api, "getError502", error)) { + if (zodios.isErrorFromAlias(zodios.api, "getError502", error)) { expect(error.response.status).toBe(502); if (error.response.status === 502) { const data = error.response.data; @@ -902,8 +909,12 @@ received: expect(error).toBeInstanceOf(Error); expect((error as AxiosError).response?.status).toBe(502); - expect(isErrorFromPath(zodios.api, "get", "/error502", error)).toBe(false); - expect(isErrorFromAlias(zodios.api, "getError502", error)).toBe(false); + expect(zodios.isErrorFromPath(zodios.api, "get", "/error502", error)).toBe( + false + ); + expect(zodios.isErrorFromAlias(zodios.api, "getError502", error)).toBe( + false + ); }); it("should return response when disabling validation", async () => { diff --git a/packages/axios/src/zodios.ts b/packages/axios/src/zodios.ts index 4108cb93..368577fa 100644 --- a/packages/axios/src/zodios.ts +++ b/packages/axios/src/zodios.ts @@ -11,12 +11,13 @@ import { ZodiosCore } from "@zodios/core"; import { axiosProvider, AxiosProvider } from "./axios-provider"; function ZodiosAxios(...args: any[]) { - // get last argument - let options: ZodiosOptions = args[args.length - 1]; - if (!Array.isArray(options) && typeof options === "object") { - args[args.length - 1] = { ...options, fetcherProvider: axiosProvider }; - } else { - args.push({ fetcherProvider: axiosProvider }); + if (args.length !== 0) { + let options: ZodiosOptions = args[args.length - 1]; + if (!Array.isArray(options) && typeof options === "object") { + args[args.length - 1] = { ...options, fetcherProvider: axiosProvider }; + } else { + args.push({ fetcherProvider: axiosProvider }); + } } // @ts-ignore return new ZodiosCore(...args); From ed830b8c80a656953228c1b3baab30bb5b86ab98 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sat, 19 Nov 2022 22:36:51 +0100 Subject: [PATCH 044/206] docs(changeset): fix axios tests --- .changeset/lucky-brooms-fry.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/lucky-brooms-fry.md diff --git a/.changeset/lucky-brooms-fry.md b/.changeset/lucky-brooms-fry.md new file mode 100644 index 00000000..b37568b9 --- /dev/null +++ b/.changeset/lucky-brooms-fry.md @@ -0,0 +1,6 @@ +--- +"@zodios/axios": major +"@zodios/core": major +--- + +fix axios tests From 6f4bbcbc5d69d14ed06f810060ac339f1c1a3537 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sat, 19 Nov 2022 22:48:33 +0100 Subject: [PATCH 045/206] RELEASING: Releasing 2 package(s) Releases: @zodios/axios@11.0.0-beta.5 @zodios/core@11.0.0-beta.5 [skip ci] --- packages/axios/CHANGELOG.md | 13 +++++++++++++ packages/axios/package.json | 2 +- packages/core/CHANGELOG.md | 7 +++++++ packages/core/package.json | 2 +- 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/packages/axios/CHANGELOG.md b/packages/axios/CHANGELOG.md index ef5da67e..630cfa5d 100644 --- a/packages/axios/CHANGELOG.md +++ b/packages/axios/CHANGELOG.md @@ -1,5 +1,18 @@ # @zodios/core +## 11.0.0-beta.5 + +### Major Changes + +- 1b67309: fix axios tests +- c7c03bc: sync axios and core versions + +### Patch Changes + +- Updated dependencies [1b67309] +- Updated dependencies [c7c03bc] + - @zodios/core@11.0.0-beta.5 + ## 11.0.0-beta.4 ### Major Changes diff --git a/packages/axios/package.json b/packages/axios/package.json index aac902f7..7b011e23 100644 --- a/packages/axios/package.json +++ b/packages/axios/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/axios", "description": "Typescript API client with axios", - "version": "11.0.0-beta.4", + "version": "11.0.0-beta.5", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index b6b0171b..3d7ccea6 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,12 @@ # @zodios/core +## 11.0.0-beta.5 + +### Major Changes + +- 1b67309: fix axios tests +- c7c03bc: sync axios and core versions + ## 11.0.0-beta.4 ### Major Changes diff --git a/packages/core/package.json b/packages/core/package.json index ccda32c6..b79c8884 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/core", "description": "Typescript API client with autocompletion and zod validations", - "version": "11.0.0-beta.4", + "version": "11.0.0-beta.5", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", From b291491841d38860b9d62b0f38503da1db08095c Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sat, 19 Nov 2022 22:50:13 +0100 Subject: [PATCH 046/206] chore: update changesets --- .changeset/pre.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.changeset/pre.json b/.changeset/pre.json index b8569fa3..9756d449 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -5,5 +5,8 @@ "@zodios/core": "11.0.0-beta.0", "@zodios/axios": "11.0.0-beta.0" }, - "changesets": [] + "changesets": [ + "lucky-brooms-fry", + "silent-garlics-scream" + ] } From 445a642ba99192c522d5b116d55022e36783c9de Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sat, 19 Nov 2022 22:51:14 +0100 Subject: [PATCH 047/206] RELEASING: Releasing 0 package(s) Releases: [skip ci] From bdd5057d28bfd79e934a5ec16d48927aca1891fb Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sat, 19 Nov 2022 22:52:08 +0100 Subject: [PATCH 048/206] chore: easier publish name --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f827085f..c6b93faf 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "test": "turbo run test", "dev": "turbo run dev", "lint": "turbo run lint", - "publish-packages": "turbo run build test && changeset version && changeset publish" + "pub": "turbo run build test && changeset version && changeset publish" }, "private": true, "devDependencies": { From 293ffec48ff147aa073a66961b3e4fd598a20edb Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sat, 19 Nov 2022 23:33:15 +0100 Subject: [PATCH 049/206] chore: add pnpm to ci --- .github/workflows/ci.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5510d41a..3c03978a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,17 +7,15 @@ on: push: branches: [main] paths: - - src/** - - yarn.lock + - packages/** + - pnpm-lock.yaml - package.json - - tsconfig.json pull_request: branches: [main] paths: - - src/** - - yarn.lock + - packages/** + - pnpm-lock.yaml - package.json - - tsconfig.json jobs: build: @@ -29,7 +27,12 @@ jobs: # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ steps: - - uses: actions/checkout@v3 + - name: Checkout + uses: actions/checkout@v3 + - name: Install pnpm + uses: pnpm/action-setup@v2 + with: + version: 7 - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 with: From 7f6712e7997c3ee830b54cce11a667a090bbdee0 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sat, 19 Nov 2022 23:43:10 +0100 Subject: [PATCH 050/206] chore: rerun ci on workflow changes --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3c03978a..3e318139 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,12 +10,14 @@ on: - packages/** - pnpm-lock.yaml - package.json + - .github/workflows/ci.yml pull_request: branches: [main] paths: - packages/** - pnpm-lock.yaml - package.json + - .github/workflows/ci.yml jobs: build: From 073f7f31a0aaa1bce971d39a4034f0ad36304403 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sat, 19 Nov 2022 23:48:01 +0100 Subject: [PATCH 051/206] chore: fix pnpm install --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3e318139..17f80cdd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,7 +40,7 @@ jobs: with: node-version: ${{ matrix.node-version }} cache: "pnpm" - - run: pnpm install --ignore-engines + - run: pnpm install - run: pnpm build - run: pnpm test analyze: From f3f2a99bc5bea83273690c64684efe3de39de55d Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sun, 20 Nov 2022 00:05:43 +0100 Subject: [PATCH 052/206] chore: add cross fetch for testing --- packages/core/package.json | 1 + packages/core/src/zodios.test.ts | 7 +++--- pnpm-lock.yaml | 37 ++++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 3 deletions(-) diff --git a/packages/core/package.json b/packages/core/package.json index b79c8884..ea040f5a 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -66,6 +66,7 @@ "@types/multer": "1.4.7", "@types/node": "18.11.9", "@types/qs": "6.9.7", + "cross-fetch": "3.1.5", "express": "4.18.2", "fp-ts": "2.13.1", "io-ts": "2.2.19", diff --git a/packages/core/src/zodios.test.ts b/packages/core/src/zodios.test.ts index c56f488a..3a97e909 100644 --- a/packages/core/src/zodios.test.ts +++ b/packages/core/src/zodios.test.ts @@ -1,9 +1,10 @@ -import express from "express"; -import { AddressInfo } from "net"; -import { z, ZodError } from "zod"; if (globalThis.FormData === undefined) { globalThis.FormData = require("form-data"); } +import "cross-fetch/polyfill"; +import express from "express"; +import { AddressInfo } from "net"; +import { z, ZodError } from "zod"; import { ZodiosCore } from "./zodios"; import { ZodiosError } from "./zodios-error"; import multer from "multer"; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 45b78798..1257ab9f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -64,6 +64,7 @@ importers: '@types/multer': 1.4.7 '@types/node': 18.11.9 '@types/qs': 6.9.7 + cross-fetch: 3.1.5 express: 4.18.2 fp-ts: 2.13.1 io-ts: 2.2.19 @@ -86,6 +87,7 @@ importers: '@types/multer': 1.4.7 '@types/node': 18.11.9 '@types/qs': 6.9.7 + cross-fetch: 3.1.5 express: 4.18.2 fp-ts: 2.13.1 io-ts: 2.2.19_fp-ts@2.13.1 @@ -1658,6 +1660,14 @@ packages: resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} dev: true + /cross-fetch/3.1.5: + resolution: {integrity: sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==} + dependencies: + node-fetch: 2.6.7 + transitivePeerDependencies: + - encoding + dev: true + /cross-spawn/5.1.0: resolution: {integrity: sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==} dependencies: @@ -3484,6 +3494,18 @@ packages: engines: {node: '>= 0.6'} dev: true + /node-fetch/2.6.7: + resolution: {integrity: sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==} + engines: {node: 4.x || >=6.0.0} + peerDependencies: + encoding: ^0.1.0 + peerDependenciesMeta: + encoding: + optional: true + dependencies: + whatwg-url: 5.0.0 + dev: true + /node-int64/0.4.0: resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==} dev: true @@ -4296,6 +4318,10 @@ packages: engines: {node: '>=0.6'} dev: true + /tr46/0.0.3: + resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} + dev: true + /tr46/1.0.1: resolution: {integrity: sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==} dependencies: @@ -4611,10 +4637,21 @@ packages: defaults: 1.0.4 dev: true + /webidl-conversions/3.0.1: + resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} + dev: true + /webidl-conversions/4.0.2: resolution: {integrity: sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==} dev: true + /whatwg-url/5.0.0: + resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} + dependencies: + tr46: 0.0.3 + webidl-conversions: 3.0.1 + dev: true + /whatwg-url/7.1.0: resolution: {integrity: sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==} dependencies: From 04a32e5d331d7e462c15b83376624b19efbb2afa Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sun, 20 Nov 2022 14:40:44 +0100 Subject: [PATCH 053/206] feat(core): expose providers --- packages/core/src/index.ts | 2 +- packages/core/src/zodios.ts | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 1b95fe0c..b80ae982 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -1,4 +1,4 @@ -export { ZodiosCore, ZodiosCoreImpl } from "./zodios"; +export { ZodiosCore } from "./zodios"; export type { ApiOf, TypeProviderOf, diff --git a/packages/core/src/zodios.ts b/packages/core/src/zodios.ts index 84c25231..394b56b7 100644 --- a/packages/core/src/zodios.ts +++ b/packages/core/src/zodios.ts @@ -160,6 +160,14 @@ export class ZodiosCoreImpl< } } + public get typeProvider() { + return this.options.typeProvider; + } + + public get fetcherProvider() { + return this.options.fetcherProvider; + } + private initPlugins() { this.endpointPlugins.set("any-any", new ZodiosPlugins("any", "any")); @@ -532,7 +540,7 @@ export type ZodiosInstance< > = ZodiosCoreImpl & ZodiosAliases; -export type ZodiosCore = { +export interface ZodiosCore { new < Api extends ZodiosEndpointDefinitions, FetcherProvider extends AnyZodiosFetcherProvider, @@ -552,7 +560,7 @@ export type ZodiosCore = { options?: ZodiosOptions & TypeOfFetcherOptions ): ZodiosInstance; -}; +} export const ZodiosCore = ZodiosCoreImpl as ZodiosCore; From b797334448f5adc0fff094d70c3003e13af7b748 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sun, 20 Nov 2022 14:51:23 +0100 Subject: [PATCH 054/206] chore(axios): expose providers --- packages/axios/src/index.ts | 1 + packages/axios/src/zodios.ts | 16 +++++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/packages/axios/src/index.ts b/packages/axios/src/index.ts index 9f1d3e90..ffc61dd5 100644 --- a/packages/axios/src/index.ts +++ b/packages/axios/src/index.ts @@ -1,2 +1,3 @@ export { Zodios } from "./zodios"; +export { AxiosProvider, axiosProvider } from "./axios-provider"; export * from "@zodios/core"; diff --git a/packages/axios/src/zodios.ts b/packages/axios/src/zodios.ts index 368577fa..7a580865 100644 --- a/packages/axios/src/zodios.ts +++ b/packages/axios/src/zodios.ts @@ -23,13 +23,16 @@ function ZodiosAxios(...args: any[]) { return new ZodiosCore(...args); } -export type ZodiosAxiosConstructor = { +export interface Zodios { new < Api extends ZodiosEndpointDefinitions, TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider >( api: Narrow, - options?: ZodiosOptions & + options?: Omit< + ZodiosOptions, + "fetcherProvider" + > & TypeOfFetcherOptions ): ZodiosInstance; new < @@ -38,11 +41,14 @@ export type ZodiosAxiosConstructor = { >( baseUrl: string, api: Narrow, - options?: ZodiosOptions & + options?: Omit< + ZodiosOptions, + "fetcherProvider" + > & TypeOfFetcherOptions ): ZodiosInstance; -}; +} -const Zodios = ZodiosAxios as unknown as ZodiosAxiosConstructor; +const Zodios = ZodiosAxios as unknown as Zodios; export { Zodios }; From 894ad485bf86baa249ac9187b8439bce87b0b707 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Tue, 22 Nov 2022 00:59:42 +0100 Subject: [PATCH 055/206] feat(core): add basic mock helpers --- packages/core/package.json | 14 +- .../src/fetcher-providers/default-provider.ts | 8 + .../fetcher-providers/fetch-provider/fetch.ts | 119 ------ .../fetch-provider/fetch.types.ts | 13 - .../fetch-provider/fetch.utils.ts | 54 --- .../fetch-provider/fetcher-provider.fetch.ts | 58 --- .../fetcher-providers/fetch-provider/index.ts | 1 - .../fetcher-provider.types.ts | 2 +- packages/core/src/fetcher-providers/index.ts | 3 +- .../fetcher-providers/mock-provider/index.ts | 1 + .../mock-provider/mock-provider.ts | 100 +++++ packages/core/src/index.ts | 1 + packages/core/src/utils.ts | 25 -- packages/core/src/zodios.test.ts | 379 +++++++++--------- packages/core/src/zodios.ts | 22 +- pnpm-lock.yaml | 81 ++-- 16 files changed, 356 insertions(+), 525 deletions(-) create mode 100644 packages/core/src/fetcher-providers/default-provider.ts delete mode 100644 packages/core/src/fetcher-providers/fetch-provider/fetch.ts delete mode 100644 packages/core/src/fetcher-providers/fetch-provider/fetch.types.ts delete mode 100644 packages/core/src/fetcher-providers/fetch-provider/fetch.utils.ts delete mode 100644 packages/core/src/fetcher-providers/fetch-provider/fetcher-provider.fetch.ts delete mode 100644 packages/core/src/fetcher-providers/fetch-provider/index.ts create mode 100644 packages/core/src/fetcher-providers/mock-provider/index.ts create mode 100644 packages/core/src/fetcher-providers/mock-provider/mock-provider.ts diff --git a/packages/core/package.json b/packages/core/package.json index ea040f5a..79966410 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -35,10 +35,6 @@ "prebuild": "rimraf lib", "example": "ts-node examples/jsonplaceholder.ts", "example:dev.to": "ts-node examples/dev.to/example.ts", - "major-rc": "npm version premajor --preid=rc", - "minor-rc": "npm version preminor --preid=rc", - "patch-rc": "npm version prepatch --preid=rc", - "rc": "npm version prerelease --preid=rc", "build": "tsup", "test": "jest --coverage" }, @@ -61,17 +57,11 @@ "devDependencies": { "@jest/globals": "29.3.1", "@jest/types": "29.3.1", - "@types/express": "4.17.14", "@types/jest": "29.2.2", - "@types/multer": "1.4.7", "@types/node": "18.11.9", - "@types/qs": "6.9.7", - "cross-fetch": "3.1.5", - "express": "4.18.2", "fp-ts": "2.13.1", "io-ts": "2.2.19", "jest": "29.3.0", - "multer": "1.4.5-lts.1", "rimraf": "3.0.2", "ts-jest": "29.0.3", "ts-node": "10.9.1", @@ -79,7 +69,5 @@ "typescript": "4.9.3", "zod": "3.19.1" }, - "dependencies": { - "qs": "6.11.0" - } + "dependencies": {} } diff --git a/packages/core/src/fetcher-providers/default-provider.ts b/packages/core/src/fetcher-providers/default-provider.ts new file mode 100644 index 00000000..e011d6b4 --- /dev/null +++ b/packages/core/src/fetcher-providers/default-provider.ts @@ -0,0 +1,8 @@ +import { + AnyZodiosFetcherProvider, + ZodiosRuntimeFetcherProvider, +} from "./fetcher-provider.types"; + +export const defaults: { + fetcherProvider?: ZodiosRuntimeFetcherProvider; +} = {}; diff --git a/packages/core/src/fetcher-providers/fetch-provider/fetch.ts b/packages/core/src/fetcher-providers/fetch-provider/fetch.ts deleted file mode 100644 index 79a56cd2..00000000 --- a/packages/core/src/fetcher-providers/fetch-provider/fetch.ts +++ /dev/null @@ -1,119 +0,0 @@ -import { AnyZodiosRequestOptions } from "../../zodios.types"; -import { FetchProviderResponse, FetchProviderConfig } from "./fetch.types"; -import { buildURL, isBlob, isFile, isFormData } from "./fetch.utils"; -import { FetchProvider } from "./fetcher-provider.fetch"; - -export class FetchError extends Error { - /** - * constructore with same signature as AxiosError - */ - constructor( - message?: string, - public code?: string, - public config?: FetchProviderConfig, - public request?: Request, - public response?: FetchProviderResponse - ) { - super(message); - } -} - -/** - * fetch provider - * @param config - fetch config - * @returns - */ -export const advancedFetch = async ( - config: AnyZodiosRequestOptions -) => { - const request = createFetchRequest(config); - const response = (await fetchRequest( - request, - config - )) as FetchProviderResponse; - response.data = await getResponseData(response, config); - if ( - (config.validateStatus && !config.validateStatus(response.status)) || - !response.ok - ) { - throw new FetchError( - response.statusText, - `${response.status}`, - config, - request, - response - ); - } - return response; -}; - -function createFetchRequest(config: AnyZodiosRequestOptions) { - const headers = new Headers(config.headers); - if (isFormData(config.body) || isBlob(config.body) || isFile(config.body)) { - if (headers.has("Content-Type")) { - headers.delete("Content-Type"); - } - } else if (typeof config.body === "object") { - headers.set("Content-Type", "application/json"); - headers.set("Accept", "application/json"); - config.body = JSON.stringify(config.body); - } - - if (config.auth) { - const username = config.auth.username || ""; - const password = config.auth.password - ? decodeURI(encodeURIComponent(config.auth.password)) - : ""; - headers.set("Authorization", `Basic ${btoa(username + ":" + password)}`); - } - - if (config.timeout && !config.signal) { - const controller = new AbortController(); - const timeout = setTimeout(() => controller.abort(), config.timeout); - config.signal = controller.signal; - config.signal.addEventListener("abort", () => clearTimeout(timeout)); - } - - const url = buildURL(config); - return new Request(url, { - ...config, - method: config.method.toUpperCase(), - headers, - }); -} - -async function fetchRequest(request: Request, config: FetchProviderConfig) { - try { - return await fetch(request); - } catch (error) { - if (error instanceof Error) { - throw new FetchError(error.message, "ERR_NETWORK", config, request); - } else { - throw new FetchError("Network Error", "ERR_NETWORK", config, request); - } - } -} - -async function getResponseData( - response: Response, - config: FetchProviderConfig -) { - switch (config.responseType) { - case "arraybuffer": - return response.arrayBuffer(); - case "blob": - return response.blob(); - case "stream": - return response.body; - case "text": - return response.text(); - case "json": - return response.json(); - default: { - if (response.headers.get("content-type")?.includes("application/json")) { - return response.json(); - } - return response.text(); - } - } -} diff --git a/packages/core/src/fetcher-providers/fetch-provider/fetch.types.ts b/packages/core/src/fetcher-providers/fetch-provider/fetch.types.ts deleted file mode 100644 index 90558252..00000000 --- a/packages/core/src/fetcher-providers/fetch-provider/fetch.types.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { Method } from "../../zodios.types"; - -export interface FetchProviderConfig extends RequestInit { - baseURL?: string; - auth?: { username: string; password: string }; - validateStatus?: (status: number) => boolean; - timeout?: number; - responseType?: "arraybuffer" | "blob" | "json" | "text" | "stream"; -} - -export interface FetchProviderResponse extends Response { - data: Data; -} diff --git a/packages/core/src/fetcher-providers/fetch-provider/fetch.utils.ts b/packages/core/src/fetcher-providers/fetch-provider/fetch.utils.ts deleted file mode 100644 index 9527f9ba..00000000 --- a/packages/core/src/fetcher-providers/fetch-provider/fetch.utils.ts +++ /dev/null @@ -1,54 +0,0 @@ -import qs from "qs"; -import { AnyZodiosRequestOptions } from "../../zodios.types"; -import { FetchProviderConfig } from "./fetch.types"; -import { FetchProvider } from "./fetcher-provider.fetch"; - -/** - * more resilient alternative to instanceof when the object is not native and compiled to es5 - * @param kind - string representation of the object kind - * @returns - a function that checks if the object is of the given kind - */ -// istanbul ignore next -export const isKindOf = - (kind: string) => - (data: any): boolean => { - const pattern = `[object ${kind}]`; - return ( - data && - (toString.call(data) === pattern || - (typeof data.toString === "function" && data.toString() === pattern)) - ); - }; - -// istanbul ignore next -export const isFormData = isKindOf("FormData"); -// istanbul ignore next -export const isBlob = isKindOf("Blob"); -// istanbul ignore next -export const isFile = isKindOf("File"); -// istanbul ignore next -export const isSearchParams = isKindOf("URLSearchParams"); - -function getFullURL(config: AnyZodiosRequestOptions) { - if (config.url?.startsWith("http") || !config.baseURL) { - return config.url; - } - const baseURL = config.baseURL.replace(/\/$/, ""); - if (!config.url) { - return baseURL; - } - const path = config.url.replace(/^\//, ""); - return `${baseURL}/${path}`; -} - -export function buildURL(config: AnyZodiosRequestOptions) { - let fullURL = getFullURL(config) || "/"; - const serializedParams = qs.stringify(config.queries, { - arrayFormat: "brackets", - encodeValuesOnly: true, - }); - if (serializedParams) { - fullURL += fullURL.indexOf("?") === -1 ? "?" : "&"; - } - return `${fullURL}${serializedParams}`; -} diff --git a/packages/core/src/fetcher-providers/fetch-provider/fetcher-provider.fetch.ts b/packages/core/src/fetcher-providers/fetch-provider/fetcher-provider.fetch.ts deleted file mode 100644 index 2b224cc7..00000000 --- a/packages/core/src/fetcher-providers/fetch-provider/fetcher-provider.fetch.ts +++ /dev/null @@ -1,58 +0,0 @@ -import { - AnyZodiosFetcherProvider, - ZodiosRuntimeFetcherProvider, -} from "../fetcher-provider.types"; -import { omit, replacePathParams } from "../../utils"; -import { FetchProviderConfig, FetchProviderResponse } from "./fetch.types"; -import { advancedFetch, FetchError } from "./fetch"; -import { AnyZodiosRequestOptions } from "../../zodios.types"; -import { Merge } from "../../utils.types"; - -type FetchErrorStatus = Merge< - Omit, "status" | "response">, - { - response: Merge< - FetchError["response"], - { - status: Status extends "default" ? 0 & { error: "default" } : Status; - } - >; - } ->; - -type FetchProviderOptions = { - fetchConfig?: FetchProviderConfig; -}; - -export interface FetchProvider extends AnyZodiosFetcherProvider { - options: FetchProviderOptions; - config: FetchProviderConfig; - response: FetchProviderResponse; - error: FetchErrorStatus; -} - -export const fetchProvider: ZodiosRuntimeFetcherProvider & - FetchProviderOptions = { - create( - options: { - baseURL?: string; - } & FetchProviderOptions - ) { - const { baseURL, fetchConfig } = options; - this.fetchConfig = fetchConfig; - if (baseURL) { - this.baseURL = baseURL; - } - }, - async fetch(config: AnyZodiosRequestOptions) { - const requestConfig = { - ...this.fetchConfig, - ...config, - baseURL: this.baseURL, - url: replacePathParams(config), - }; - return advancedFetch( - requestConfig as AnyZodiosRequestOptions - ); - }, -}; diff --git a/packages/core/src/fetcher-providers/fetch-provider/index.ts b/packages/core/src/fetcher-providers/fetch-provider/index.ts deleted file mode 100644 index 67bc2279..00000000 --- a/packages/core/src/fetcher-providers/fetch-provider/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./fetcher-provider.fetch"; diff --git a/packages/core/src/fetcher-providers/fetcher-provider.types.ts b/packages/core/src/fetcher-providers/fetcher-provider.types.ts index 84bb028e..b5737b01 100644 --- a/packages/core/src/fetcher-providers/fetcher-provider.types.ts +++ b/packages/core/src/fetcher-providers/fetcher-provider.types.ts @@ -44,6 +44,6 @@ export type ZodiosRuntimeFetcherProvider< > = { readonly _provider?: FetcherProvider; baseURL?: string; - create(options: any): void; + init(options: any): void; fetch(params: any): Promise; }; diff --git a/packages/core/src/fetcher-providers/index.ts b/packages/core/src/fetcher-providers/index.ts index 1e2b121a..a5e64c2f 100644 --- a/packages/core/src/fetcher-providers/index.ts +++ b/packages/core/src/fetcher-providers/index.ts @@ -1,2 +1,3 @@ export * from "./fetcher-provider.types"; -export * from "./fetch-provider"; +export * from "./default-provider"; +export * from "./mock-provider"; diff --git a/packages/core/src/fetcher-providers/mock-provider/index.ts b/packages/core/src/fetcher-providers/mock-provider/index.ts new file mode 100644 index 00000000..6fa0ecf1 --- /dev/null +++ b/packages/core/src/fetcher-providers/mock-provider/index.ts @@ -0,0 +1 @@ +export * from "./mock-provider"; diff --git a/packages/core/src/fetcher-providers/mock-provider/mock-provider.ts b/packages/core/src/fetcher-providers/mock-provider/mock-provider.ts new file mode 100644 index 00000000..15db7a24 --- /dev/null +++ b/packages/core/src/fetcher-providers/mock-provider/mock-provider.ts @@ -0,0 +1,100 @@ +import type { + AnyZodiosFetcherProvider, + AnyZodiosRequestOptions, + ZodiosRuntimeFetcherProvider, +} from "../../index"; +import { defaults } from "../default-provider"; + +interface MockProvider extends AnyZodiosFetcherProvider { + options: {}; + config: { + baseURL?: string; + body?: any; + auth?: { username: string; password: string }; + validateStatus?: (status: number) => boolean; + timeout?: number; + responseType?: "arraybuffer" | "blob" | "json" | "text" | "stream"; + }; + response: any; + error: any; +} + +const mockProvider: ZodiosRuntimeFetcherProvider = { + init() {}, + async fetch(config: AnyZodiosRequestOptions) { + const requestConfig = { + ...config, + baseURL: this.baseURL, + }; + for (const [{ method, url }, callback] of zodiosMocks.mocks) { + if (method === requestConfig.method && url === requestConfig.url) { + const result = (await callback( + requestConfig + )) as Required; + if ( + (config.validateStatus && !config.validateStatus(result.status)) || + result.status > 299 + ) { + const err = new Error( + `Request failed with status code ${result.status}` + ) as Error & { code: string; config: any; response: any }; + err.code = `ERR_STATUS_${result.status}`; + err.config = requestConfig; + err.response = result; + throw err; + } + return result; + } + } + throw new Error(`No mocks found for ${requestConfig.url}`); + }, +}; + +type MockResponse = { + readonly headers?: Record; + readonly status?: number; + readonly statusText?: string; + readonly data?: any; +}; + +export const zodiosMocks = { + mocks: new Map< + { method: string; url: string }, + (config: AnyZodiosRequestOptions) => Promise + >(), + install() { + defaults.fetcherProvider = mockProvider; + }, + uninstall() { + this.mocks.clear(); + defaults.fetcherProvider = undefined; + }, + reset() { + this.mocks.clear(); + }, + mockRequest( + method: string, + path: string, + callback: ( + config: AnyZodiosRequestOptions + ) => Promise + ) { + this.mocks.set({ method, url: path }, callback); + }, + mockResponse(method: string, path: string, response: MockResponse) { + this.mocks.set( + { + method, + url: path, + }, + () => + Promise.resolve({ + headers: {}, + data: {}, + status: 200, + statusText: "OK", + ...response, + }) + ); + }, +}; diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index b80ae982..2ccfdc3b 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -70,6 +70,7 @@ export type { TypeOfFetcherResponse, ZodiosRuntimeFetcherProvider, } from "./fetcher-providers"; +export { zodiosMocks } from "./fetcher-providers"; export { PluginId, zodValidationPlugin, diff --git a/packages/core/src/utils.ts b/packages/core/src/utils.ts index 429dfc25..5af29912 100644 --- a/packages/core/src/utils.ts +++ b/packages/core/src/utils.ts @@ -1,4 +1,3 @@ -import type { ReadonlyDeep } from "./utils.types"; import type { ZodiosEndpointDefinition, ZodiosEndpointDefinitions, @@ -40,30 +39,6 @@ export function pick( return ret; } -/** - * set first letter of a string to uppercase - * @param str - the string to capitalize - * @returns - the string with the first letter uppercased - */ -export function capitalize(str: T): Capitalize { - return (str.charAt(0).toUpperCase() + str.slice(1)) as Capitalize; -} - -const paramsRegExp = /:([a-zA-Z_][a-zA-Z0-9_]*)/g; - -export function replacePathParams( - config: ReadonlyDeep<{ url: string; params?: Record }> -) { - let result: string = config.url; - const params = config.params; - if (params) { - result = result.replace(paramsRegExp, (match, key) => - key in params ? `${params[key]}` : match - ); - } - return result; -} - export function findEndpoint( api: ZodiosEndpointDefinitions, method: string, diff --git a/packages/core/src/zodios.test.ts b/packages/core/src/zodios.test.ts index 3a97e909..78add76c 100644 --- a/packages/core/src/zodios.test.ts +++ b/packages/core/src/zodios.test.ts @@ -1,94 +1,117 @@ if (globalThis.FormData === undefined) { globalThis.FormData = require("form-data"); } -import "cross-fetch/polyfill"; -import express from "express"; -import { AddressInfo } from "net"; import { z, ZodError } from "zod"; import { ZodiosCore } from "./zodios"; import { ZodiosError } from "./zodios-error"; -import multer from "multer"; import { ZodiosPlugin } from "./zodios.types"; import { apiBuilder } from "./api"; -import { Assert } from "./utils.types"; -import { AnyZodiosFetcherProvider, fetchProvider } from "./fetcher-providers"; -import { FetchError } from "./fetcher-providers/fetch-provider/fetch"; - -const multipart = multer({ storage: multer.memoryStorage() }); +import { AnyZodiosFetcherProvider } from "./fetcher-providers"; +import { zodiosMocks } from "./fetcher-providers/mock-provider"; describe("Zodios", () => { - let app: express.Express; - let server: ReturnType; - let port: number; - beforeAll(async () => { - app = express(); - app.use(express.json()); - app.get("/token", (req, res) => { - res.status(200).json({ token: req.headers.authorization }); - }); - app.post("/token", (req, res) => { - res.status(200).json({ token: req.headers.authorization }); - }); - app.get("/error401", (req, res) => { - res.status(401).json({}); - }); - app.get("/error//error401", (req, res) => { - res.status(401).json({}); - }); - app.get("/error/:id/error401", (req, res) => { - res.status(401).json({}); - }); - app.get("/error502", (req, res) => { - res.status(502).json({ error: { message: "bad gateway" } }); - }); - app.get("/queries", (req, res) => { - res.status(200).json({ - queries: req.query.id, + zodiosMocks.install(); + zodiosMocks.mockRequest("get", "/token", async (conf) => ({ + data: { + token: conf.headers!.authorization, + }, + })); + zodiosMocks.mockRequest("post", "/token", async (conf) => ({ + data: { + token: conf.headers!.authorization, + }, + })); + zodiosMocks.mockRequest("get", "/error401", async (conf) => ({ + status: 401, + statusText: "Unauthorized", + data: {}, + })); + zodiosMocks.mockRequest("get", "/error502", async (conf) => ({ + status: 502, + statusText: "Bad Gateway", + data: { + error: { + message: "bad gateway", + }, + }, + })); + zodiosMocks.mockRequest("get", "/queries", async (conf) => ({ + data: { + queries: conf.queries!.id, + }, + })); + zodiosMocks.mockRequest("get", "/:id", async (conf) => ({ + data: { + id: conf.params!.id, + name: "test", + }, + })); + zodiosMocks.mockRequest("get", "/path/:uuid", async (config) => ({ + data: { + uuid: config.params!.uuid, + }, + })); + zodiosMocks.mockRequest("get", "/:id/address/:address", async (config) => ({ + data: { + id: config.params!.id, + address: config.params!.address, + }, + })); + zodiosMocks.mockRequest("post", "/", async (config) => ({ + data: { + id: 3, + name: config.body!.name, + }, + })); + zodiosMocks.mockRequest("put", "/", async (config) => ({ + data: { + id: config.body.id, + name: config.body.name, + }, + })); + zodiosMocks.mockRequest("patch", "/", async (config) => ({ + data: { + id: config.body.id, + name: config.body.name, + }, + })); + zodiosMocks.mockRequest("delete", "/:id", async (config) => ({ + data: { + id: config.params!.id, + }, + })); + zodiosMocks.mockRequest("post", "/form-data", async (config) => { + const data = {}; + (config.body as FormData).forEach((value, key) => { + // @ts-ignore + data[key] = value; }); + return { + data, + }; }); - app.get("/:id", (req, res) => { - res.status(200).json({ id: Number(req.params.id), name: "test" }); - }); - app.get("/path/:uuid", (req, res) => { - res.status(200).json({ uuid: req.params.uuid }); - }); - app.get("/:id/address/:address", (req, res) => { - res - .status(200) - .json({ id: Number(req.params.id), address: req.params.address }); - }); - app.post("/", (req, res) => { - res.status(200).json({ id: 3, name: req.body.name }); - }); - app.put("/", (req, res) => { - res.status(200).json({ id: req.body.id, name: req.body.name }); - }); - app.patch("/", (req, res) => { - res.status(200).json({ id: req.body.id, name: req.body.name }); - }); - app.delete("/:id", (req, res) => { - res.status(200).json({ id: Number(req.params.id) }); - }); - app.post("/form-data", multipart.none() as any, (req, res) => { - res.status(200).json(req.body); - }); - app.post( - "/form-url", - express.urlencoded({ extended: false }), - (req, res) => { - res.status(200).json(req.body); + zodiosMocks.mockRequest("post", "/form-url", async (config) => { + const data = {}; + const url = new URLSearchParams(config.body as string); + for (const [key, value] of url) { + // @ts-ignore + data[key] = value; } - ); - app.post("/text", express.text(), (req, res) => { - res.status(200).send(req.body); + return { + data, + }; }); - server = app.listen(0); - port = (server.address() as AddressInfo).port; + zodiosMocks.mockRequest("post", "/text", async (config) => ({ + headers: { + "content-type": "text/plain", + }, + data: config.body, + })); }); afterAll(() => { - server.close(); + zodiosMocks.uninstall(); }); it("should be defined", () => { @@ -117,11 +140,11 @@ describe("Zodios", () => { }); it("should create a new instance of Zodios", () => { - const zodios = new ZodiosCore(`http://localhost:${port}`, []); + const zodios = new ZodiosCore(`http://localhost`, []); expect(zodios).toBeDefined(); }); it("should create a new instance when providing an api", () => { - const zodios = new ZodiosCore(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost`, [ { method: "get", path: "/:id", @@ -137,7 +160,7 @@ describe("Zodios", () => { it("should should throw with duplicate api endpoints", () => { expect( () => - new ZodiosCore(`http://localhost:${port}`, [ + new ZodiosCore(`http://localhost`, [ { method: "get", path: "/:id", @@ -173,13 +196,13 @@ describe("Zodios", () => { }); it("should register have validation plugin automatically installed", () => { - const zodios = new ZodiosCore(`http://localhost:${port}`, []); + const zodios = new ZodiosCore(`http://localhost`, []); // @ts-ignore expect(zodios.endpointPlugins.get("any-any").count()).toBe(1); }); it("should register a plugin", () => { - const zodios = new ZodiosCore(`http://localhost:${port}`, []); + const zodios = new ZodiosCore(`http://localhost`, []); zodios.use({ request: async (_, config) => config, }); @@ -188,7 +211,7 @@ describe("Zodios", () => { }); it("should unregister a plugin", () => { - const zodios = new ZodiosCore(`http://localhost:${port}`, []); + const zodios = new ZodiosCore(`http://localhost`, []); const id = zodios.use({ request: async (_, config) => config, }); @@ -200,7 +223,7 @@ describe("Zodios", () => { }); it("should replace a named plugin", () => { - const zodios = new ZodiosCore(`http://localhost:${port}`, []); + const zodios = new ZodiosCore(`http://localhost`, []); const plugin: ZodiosPlugin = { name: "test", request: async (_, config) => config, @@ -213,7 +236,7 @@ describe("Zodios", () => { }); it("should unregister a named plugin", () => { - const zodios = new ZodiosCore(`http://localhost:${port}`, []); + const zodios = new ZodiosCore(`http://localhost`, []); const plugin: ZodiosPlugin = { name: "test", request: async (_, config) => config, @@ -225,13 +248,13 @@ describe("Zodios", () => { }); it("should throw if invalide parameters when registering a plugin", () => { - const zodios = new ZodiosCore(`http://localhost:${port}`, []); + const zodios = new ZodiosCore(`http://localhost`, []); // @ts-ignore expect(() => zodios.use(0)).toThrowError("Zodios: invalid plugin"); }); it("should throw if invalid alias when registering a plugin", () => { - const zodios = new ZodiosCore(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost`, [ { method: "get", path: "/:id", @@ -252,7 +275,7 @@ describe("Zodios", () => { }); it("should throw if invalid endpoint when registering a plugin", () => { - const zodios = new ZodiosCore(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost`, [ { method: "get", path: "/:id", @@ -274,7 +297,7 @@ describe("Zodios", () => { }); it("should register a plugin by endpoint", () => { - const zodios = new ZodiosCore(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost`, [ { method: "get", path: "/:id", @@ -292,7 +315,7 @@ describe("Zodios", () => { }); it("should register a plugin by alias", () => { - const zodios = new ZodiosCore(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost`, [ { method: "get", path: "/:id", @@ -311,7 +334,7 @@ describe("Zodios", () => { }); it("should make an http request", async () => { - const zodios = new ZodiosCore(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost`, [ { method: "get", path: "/:id", @@ -345,7 +368,7 @@ describe("Zodios", () => { }); it("should make an http get with standard query arrays", async () => { - const zodios = new ZodiosCore(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost`, [ { method: "get", path: "/queries", @@ -362,11 +385,11 @@ describe("Zodios", () => { }, ]); const response = await zodios.get("/queries", { queries: { id: [1, 2] } }); - expect(response).toEqual({ queries: ["1", "2"] }); + expect(response).toEqual({ queries: [1, 2] }); }); it("should make an http get with one path params", async () => { - const zodios = new ZodiosCore(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost`, [ { method: "get", path: "/:id", @@ -381,7 +404,7 @@ describe("Zodios", () => { }); it("should make an http alias request with one path params", async () => { - const zodios = new ZodiosCore(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost`, [ { method: "get", path: "/:id", @@ -406,16 +429,23 @@ describe("Zodios", () => { name: z.string(), }), }).build(); - const zodios = new ZodiosCore(`http://localhost:${port}`, api); + const zodios = new ZodiosCore(`http://localhost`, api); const response = await zodios.getById({ params: { id: 7 } }); expect(response).toEqual({ id: 7, name: "test" }); }); - it("should make a get request with forgotten params and get back a zod error", async () => { - const zodios = new ZodiosCore(`http://localhost:${port}`, [ + it("should make a get request with bad params and get back a zod error", async () => { + const zodios = new ZodiosCore(`http://localhost`, [ { method: "get", path: "/:id", + parameters: [ + { + name: "id", + type: "Path", + schema: z.number(), + }, + ], response: z.object({ id: z.number(), name: z.string(), @@ -423,15 +453,14 @@ describe("Zodios", () => { }, ]); try { - // @ts-ignore - await zodios.get("/:id"); + await zodios.get("/:id", { params: { id: "7" } }); } catch (e) { expect(e).toBeInstanceOf(ZodiosError); } }); it("should make an http get with multiples path params", async () => { - const zodios = new ZodiosCore(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost`, [ { method: "get", path: "/:id/address/:address", @@ -448,7 +477,7 @@ describe("Zodios", () => { }); it("should make an http post with body param", async () => { - const zodios = new ZodiosCore(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost`, [ { method: "post", path: "/", @@ -472,7 +501,7 @@ describe("Zodios", () => { }); it("should make an http post with transformed body param", async () => { - const zodios = new ZodiosCore(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost`, [ { method: "post", path: "/", @@ -511,7 +540,7 @@ describe("Zodios", () => { }); it("should throw a zodios error if params are not correct", async () => { - const zodios = new ZodiosCore(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost`, [ { method: "post", path: "/", @@ -552,7 +581,7 @@ describe("Zodios", () => { }); it("should make an http mutation alias request with body param", async () => { - const zodios = new ZodiosCore(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost`, [ { method: "post", path: "/", @@ -577,7 +606,7 @@ describe("Zodios", () => { }); it("should make an http put", async () => { - const zodios = new ZodiosCore(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost`, [ { method: "put", path: "/", @@ -602,7 +631,7 @@ describe("Zodios", () => { }); it("should make an http put alias", async () => { - const zodios = new ZodiosCore(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost`, [ { method: "put", path: "/", @@ -628,7 +657,7 @@ describe("Zodios", () => { }); it("should make an http patch", async () => { - const zodios = new ZodiosCore(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost`, [ { method: "patch", path: "/", @@ -655,7 +684,7 @@ describe("Zodios", () => { }); it("should make an http patch alias", async () => { - const zodios = new ZodiosCore(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost`, [ { method: "patch", path: "/", @@ -681,7 +710,7 @@ describe("Zodios", () => { }); it("should make an http delete", async () => { - const zodios = new ZodiosCore(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost`, [ { method: "delete", path: "/:id", @@ -697,7 +726,7 @@ describe("Zodios", () => { }); it("should make an http delete alias", async () => { - const zodios = new ZodiosCore(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost`, [ { method: "delete", path: "/:id", @@ -714,7 +743,7 @@ describe("Zodios", () => { }); it("should validate uuid in path params", async () => { - const zodios = new ZodiosCore(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost`, [ { method: "get", path: "/path/:uuid", @@ -739,7 +768,7 @@ describe("Zodios", () => { }); it("should not validate bad path params", async () => { - const zodios = new ZodiosCore(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost`, [ { method: "get", path: "/path/:uuid", @@ -771,7 +800,7 @@ describe("Zodios", () => { }); it("should not validate bad formatted responses", async () => { - const zodios = new ZodiosCore(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost`, [ { method: "get", path: "/:id", @@ -820,48 +849,42 @@ received: }); it("should match Expected error", async () => { - const zodios = new ZodiosCore( - `http://localhost:${port}`, - [ - { - method: "get", - alias: "getError502", - path: "/error502", - response: z.void(), - errors: [ - { - status: 502, - schema: z.object({ - error: z.object({ - message: z.string(), - }), + const zodios = new ZodiosCore(`http://localhost`, [ + { + method: "get", + alias: "getError502", + path: "/error502", + response: z.void(), + errors: [ + { + status: 502, + schema: z.object({ + error: z.object({ + message: z.string(), }), - }, - { - status: 401, - schema: z.object({ - error: z.object({ - message: z.string(), - _401: z.literal(true), - }), + }), + }, + { + status: 401, + schema: z.object({ + error: z.object({ + message: z.string(), + _401: z.literal(true), }), - }, - { - status: "default", - schema: z.object({ - error: z.object({ - message: z.string(), - _default: z.literal(true), - }), + }), + }, + { + status: "default", + schema: z.object({ + error: z.object({ + message: z.string(), + _default: z.literal(true), }), - }, - ], - }, - ], - { - fetcherProvider: fetchProvider, - } - ); + }), + }, + ], + }, + ]); let error; try { await zodios.get("/error502"); @@ -869,46 +892,16 @@ received: error = e; } expect(error).toBeInstanceOf(Error); - expect((error as FetchError).response?.status).toBe(502); + // @ts-ignore + expect(error.response?.status).toBe(502); if (zodios.isErrorFromPath(zodios.api, "get", "/error502", error)) { expect(error.response.status).toBe(502); - if (error.response.status === 502) { - const data = error.response.data; - const test: Assert< - typeof data, - { error: { message: string; _502: true } } - > = true; - } expect(error.response?.data).toEqual({ error: { message: "bad gateway" }, }); } if (zodios.isErrorFromAlias(zodios.api, "getError502", error)) { expect(error.response.status).toBe(502); - if (error.response.status === 502) { - const data = error.response.data; - // ^? - const test: Assert< - typeof data, - { error: { message: string; _502: true } } - > = true; - } else if (error.response.status === 401) { - const data = error.response.data; - // ^? - const test: Assert< - typeof data, - { error: { message: string; _401: true } } - > = true; - } else { - const testStatus = error.response.status; - // ^? - const data = error.response.data; - // ^? - const test: Assert< - typeof data, - { error: { message: string; _default: true } } - > = true; - } expect(error.response?.data).toEqual({ error: { message: "bad gateway" }, }); @@ -1067,7 +1060,7 @@ received: }); it("should match Unexpected error", async () => { - const zodios = new ZodiosCore(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost`, [ { method: "get", alias: "getError502", @@ -1083,7 +1076,8 @@ received: } expect(error).toBeInstanceOf(Error); - expect((error as FetchError).response?.status).toBe(502); + // @ts-ignore + expect(error.response?.status).toBe(502); expect(zodios.isErrorFromPath(zodios.api, "get", "/error502", error)).toBe( false ); @@ -1094,7 +1088,7 @@ received: it("should return response when disabling validation", async () => { const zodios = new ZodiosCore( - `http://localhost:${port}`, + `http://localhost`, [ { method: "get", @@ -1116,7 +1110,7 @@ received: }); it("should trigger an error with error response", async () => { - const zodios = new ZodiosCore(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost`, [ { method: "get", path: "/error502", @@ -1129,7 +1123,8 @@ received: try { await zodios.get("/error502"); } catch (e) { - expect((e as FetchError).response?.data).toEqual({ + // @ts-ignore + expect(e.response?.data).toEqual({ error: { message: "bad gateway", }, @@ -1138,7 +1133,7 @@ received: }); it("should send a form data request", async () => { - const zodios = new ZodiosCore(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost`, [ { method: "post", path: "/form-data", @@ -1166,7 +1161,7 @@ received: }); it("should send a form data request a second time under 100 ms", async () => { - const zodios = new ZodiosCore(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost`, [ { method: "post", path: "/form-data", @@ -1195,7 +1190,7 @@ received: }, 100); it("should not send an array as form data request", async () => { - const zodios = new ZodiosCore(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost`, [ { method: "post", path: "/form-data", @@ -1225,7 +1220,7 @@ received: }); it("should send a form url request", async () => { - const zodios = new ZodiosCore(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost`, [ { method: "post", path: "/form-url", @@ -1253,7 +1248,7 @@ received: }); it("should not send an array as form url request", async () => { - const zodios = new ZodiosCore(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost`, [ { method: "post", path: "/form-url", @@ -1283,7 +1278,7 @@ received: }); it("should send a text request", async () => { - const zodios = new ZodiosCore(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost`, [ { method: "post", path: "/text", diff --git a/packages/core/src/zodios.ts b/packages/core/src/zodios.ts index 394b56b7..d92e1373 100644 --- a/packages/core/src/zodios.ts +++ b/packages/core/src/zodios.ts @@ -27,15 +27,14 @@ import type { PickRequired, ReadonlyDeep, RequiredKeys, - UndefinedIfNever, } from "./utils.types"; import { checkApi } from "./api"; import type { AnyZodiosTypeProvider, ZodTypeProvider } from "./type-providers"; import { zodTypeProvider } from "./type-providers"; import { AnyZodiosFetcherProvider, - fetchProvider, TypeOfFetcherOptions, + defaults, } from "./fetcher-providers"; import { findEndpointErrorsByAlias, findEndpointErrorsByPath } from "./utils"; @@ -60,11 +59,7 @@ export class ZodiosCoreImpl< { public readonly options: PickRequired< ZodiosOptions, - | "validate" - | "transform" - | "sendDefaults" - | "typeProvider" - | "fetcherProvider" + "validate" | "transform" | "sendDefaults" | "typeProvider" >; public readonly api: Api; public readonly _typeProvider: TypeProvider; @@ -146,12 +141,12 @@ export class ZodiosCoreImpl< transform: true, sendDefaults: false, typeProvider: zodTypeProvider as any, - fetcherProvider: fetchProvider, ...options, }; this._typeProvider = undefined as any; this._fetcherProvider = undefined as any; - this.options.fetcherProvider.create({ baseURL, ...this.options }); + + this.options.fetcherProvider?.init({ baseURL, ...this.options }); this.injectAliasEndpoints(); this.initPlugins(); @@ -309,7 +304,14 @@ export class ZodiosCoreImpl< if (endpointPlugin) { conf = await endpointPlugin.interceptRequest(this.api, conf); } - let response = this.options.fetcherProvider.fetch(conf); + let response: Promise; + if (defaults.fetcherProvider) { + response = defaults.fetcherProvider.fetch(conf); + } else if (this.options.fetcherProvider) { + response = this.options.fetcherProvider.fetch(conf); + } else { + throw new Error("Zodios: no fetcher provider provided"); + } if (endpointPlugin) { response = endpointPlugin.interceptResponse(this.api, conf, response); } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1257ab9f..55134b78 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -56,6 +56,36 @@ importers: zod: 3.19.1 packages/core: + specifiers: + '@jest/globals': 29.3.1 + '@jest/types': 29.3.1 + '@types/jest': 29.2.2 + '@types/node': 18.11.9 + fp-ts: 2.13.1 + io-ts: 2.2.19 + jest: 29.3.0 + rimraf: 3.0.2 + ts-jest: 29.0.3 + ts-node: 10.9.1 + tsup: 6.3.0 + typescript: 4.9.3 + zod: 3.19.1 + devDependencies: + '@jest/globals': 29.3.1 + '@jest/types': 29.3.1 + '@types/jest': 29.2.2 + '@types/node': 18.11.9 + fp-ts: 2.13.1 + io-ts: 2.2.19_fp-ts@2.13.1 + jest: 29.3.0_odkjkoia5xunhxkdrka32ib6vi + rimraf: 3.0.2 + ts-jest: 29.0.3_rhbpodbq4tgi7dsfkb4juhkp3y + ts-node: 10.9.1_wup25etrarvlqkprac7h35hj7u + tsup: 6.3.0_2dtigtkb225m7ii7q45utxqwgi + typescript: 4.9.3 + zod: 3.19.1 + + packages/fetch: specifiers: '@jest/globals': 29.3.1 '@jest/types': 29.3.1 @@ -64,7 +94,8 @@ importers: '@types/multer': 1.4.7 '@types/node': 18.11.9 '@types/qs': 6.9.7 - cross-fetch: 3.1.5 + '@zodios/core': workspace:* + axios: 1.1.3 express: 4.18.2 fp-ts: 2.13.1 io-ts: 2.2.19 @@ -78,7 +109,7 @@ importers: typescript: 4.9.3 zod: 3.19.1 dependencies: - qs: 6.11.0 + '@zodios/core': link:../core devDependencies: '@jest/globals': 29.3.1 '@jest/types': 29.3.1 @@ -87,12 +118,13 @@ importers: '@types/multer': 1.4.7 '@types/node': 18.11.9 '@types/qs': 6.9.7 - cross-fetch: 3.1.5 + axios: 1.1.3 express: 4.18.2 fp-ts: 2.13.1 io-ts: 2.2.19_fp-ts@2.13.1 jest: 29.3.0_odkjkoia5xunhxkdrka32ib6vi multer: 1.4.5-lts.1 + qs: 6.11.0 rimraf: 3.0.2 ts-jest: 29.0.3_rhbpodbq4tgi7dsfkb4juhkp3y ts-node: 10.9.1_wup25etrarvlqkprac7h35hj7u @@ -1467,6 +1499,7 @@ packages: dependencies: function-bind: 1.1.1 get-intrinsic: 1.1.3 + dev: true /callsites/3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} @@ -1660,14 +1693,6 @@ packages: resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} dev: true - /cross-fetch/3.1.5: - resolution: {integrity: sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==} - dependencies: - node-fetch: 2.6.7 - transitivePeerDependencies: - - encoding - dev: true - /cross-spawn/5.1.0: resolution: {integrity: sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==} dependencies: @@ -2348,6 +2373,7 @@ packages: /function-bind/1.1.1: resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} + dev: true /function.prototype.name/1.1.5: resolution: {integrity: sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==} @@ -2379,6 +2405,7 @@ packages: function-bind: 1.1.1 has: 1.0.3 has-symbols: 1.0.3 + dev: true /get-package-type/0.1.0: resolution: {integrity: sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==} @@ -2480,6 +2507,7 @@ packages: /has-symbols/1.0.3: resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} engines: {node: '>= 0.4'} + dev: true /has-tostringtag/1.0.0: resolution: {integrity: sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==} @@ -2493,6 +2521,7 @@ packages: engines: {node: '>= 0.4.0'} dependencies: function-bind: 1.1.1 + dev: true /hosted-git-info/2.8.9: resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} @@ -3494,18 +3523,6 @@ packages: engines: {node: '>= 0.6'} dev: true - /node-fetch/2.6.7: - resolution: {integrity: sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==} - engines: {node: 4.x || >=6.0.0} - peerDependencies: - encoding: ^0.1.0 - peerDependenciesMeta: - encoding: - optional: true - dependencies: - whatwg-url: 5.0.0 - dev: true - /node-int64/0.4.0: resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==} dev: true @@ -3542,6 +3559,7 @@ packages: /object-inspect/1.12.2: resolution: {integrity: sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==} + dev: true /object-keys/1.1.1: resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} @@ -3781,6 +3799,7 @@ packages: engines: {node: '>=0.6'} dependencies: side-channel: 1.0.4 + dev: true /queue-microtask/1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} @@ -4049,6 +4068,7 @@ packages: call-bind: 1.0.2 get-intrinsic: 1.1.3 object-inspect: 1.12.2 + dev: true /signal-exit/3.0.7: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} @@ -4318,10 +4338,6 @@ packages: engines: {node: '>=0.6'} dev: true - /tr46/0.0.3: - resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} - dev: true - /tr46/1.0.1: resolution: {integrity: sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==} dependencies: @@ -4637,21 +4653,10 @@ packages: defaults: 1.0.4 dev: true - /webidl-conversions/3.0.1: - resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} - dev: true - /webidl-conversions/4.0.2: resolution: {integrity: sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==} dev: true - /whatwg-url/5.0.0: - resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} - dependencies: - tr46: 0.0.3 - webidl-conversions: 3.0.1 - dev: true - /whatwg-url/7.1.0: resolution: {integrity: sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==} dependencies: From c0f4615028ccb211afe7edb56d05cb8447e1466f Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Tue, 22 Nov 2022 01:00:52 +0100 Subject: [PATCH 056/206] docs(changeset): add basic mocks helpers --- .changeset/short-hounds-mix.md | 7 +++++++ packages/axios/package.json | 4 ---- packages/axios/src/axios-provider.ts | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 .changeset/short-hounds-mix.md diff --git a/.changeset/short-hounds-mix.md b/.changeset/short-hounds-mix.md new file mode 100644 index 00000000..d8422aee --- /dev/null +++ b/.changeset/short-hounds-mix.md @@ -0,0 +1,7 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +--- + +add basic mocks helpers diff --git a/packages/axios/package.json b/packages/axios/package.json index 7b011e23..fe24a678 100644 --- a/packages/axios/package.json +++ b/packages/axios/package.json @@ -36,10 +36,6 @@ "prebuild": "rimraf lib", "example": "ts-node examples/jsonplaceholder.ts", "example:dev.to": "ts-node examples/dev.to/example.ts", - "major-rc": "npm version premajor --preid=rc", - "minor-rc": "npm version preminor --preid=rc", - "patch-rc": "npm version prepatch --preid=rc", - "rc": "npm version prerelease --preid=rc", "build": "tsup", "test": "jest --coverage" }, diff --git a/packages/axios/src/axios-provider.ts b/packages/axios/src/axios-provider.ts index 10fff9e6..37f8e483 100644 --- a/packages/axios/src/axios-provider.ts +++ b/packages/axios/src/axios-provider.ts @@ -42,7 +42,7 @@ export const axiosProvider: ZodiosRuntimeFetcherProvider & { instance: AxiosInstance; } = { instance: undefined as any, - create( + init( options: { baseURL?: string; } & AxiosProviderOptions From e9857ac7caf7d1a53a54b219c1ca70243d3b77e6 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Tue, 22 Nov 2022 01:01:52 +0100 Subject: [PATCH 057/206] docs(changeset): add fetch package --- .changeset/blue-hounds-sort.md | 7 + packages/fetch/.gitignore | 105 ++ packages/fetch/.npmignore | 40 + packages/fetch/CHANGELOG.md | 49 + packages/fetch/LICENSE | 21 + packages/fetch/README.md | 198 +++ packages/fetch/SECURITY.md | 20 + packages/fetch/examples/define-types.ts | 59 + .../fetch/examples/dev.to/api-key-plugin.ts | 19 + packages/fetch/examples/dev.to/articles.ts | 167 +++ packages/fetch/examples/dev.to/comments.ts | 61 + packages/fetch/examples/dev.to/example.ts | 23 + packages/fetch/examples/dev.to/followers.ts | 33 + packages/fetch/examples/dev.to/follows.ts | 23 + packages/fetch/examples/dev.to/params.ts | 16 + packages/fetch/examples/dev.to/users.ts | 64 + packages/fetch/examples/io-ts-types.ts | 78 ++ packages/fetch/examples/jsonplaceholder.ts | 97 ++ .../fetch/examples/types-from-definition.ts | 128 ++ packages/fetch/examples/typescript-types.ts | 77 ++ packages/fetch/jest.config.ts | 24 + packages/fetch/package.json | 83 ++ packages/fetch/src/fetch-provider/fetch.ts | 127 ++ .../fetch/src/fetch-provider/fetch.types.ts | 13 + .../fetch/src/fetch-provider/fetch.utils.ts | 54 + .../fetch-provider/fetcher-provider.fetch.ts | 58 + packages/fetch/src/fetch-provider/index.ts | 1 + packages/fetch/src/index.ts | 3 + packages/fetch/src/utils.ts | 16 + packages/fetch/src/zodios.test.ts | 1129 +++++++++++++++++ packages/fetch/src/zodios.ts | 54 + packages/fetch/tsconfig.build.json | 17 + packages/fetch/tsconfig.json | 18 + packages/fetch/tsup.config.js | 14 + 34 files changed, 2896 insertions(+) create mode 100644 .changeset/blue-hounds-sort.md create mode 100644 packages/fetch/.gitignore create mode 100644 packages/fetch/.npmignore create mode 100644 packages/fetch/CHANGELOG.md create mode 100644 packages/fetch/LICENSE create mode 100644 packages/fetch/README.md create mode 100644 packages/fetch/SECURITY.md create mode 100644 packages/fetch/examples/define-types.ts create mode 100644 packages/fetch/examples/dev.to/api-key-plugin.ts create mode 100644 packages/fetch/examples/dev.to/articles.ts create mode 100644 packages/fetch/examples/dev.to/comments.ts create mode 100644 packages/fetch/examples/dev.to/example.ts create mode 100644 packages/fetch/examples/dev.to/followers.ts create mode 100644 packages/fetch/examples/dev.to/follows.ts create mode 100644 packages/fetch/examples/dev.to/params.ts create mode 100644 packages/fetch/examples/dev.to/users.ts create mode 100644 packages/fetch/examples/io-ts-types.ts create mode 100644 packages/fetch/examples/jsonplaceholder.ts create mode 100644 packages/fetch/examples/types-from-definition.ts create mode 100644 packages/fetch/examples/typescript-types.ts create mode 100644 packages/fetch/jest.config.ts create mode 100644 packages/fetch/package.json create mode 100644 packages/fetch/src/fetch-provider/fetch.ts create mode 100644 packages/fetch/src/fetch-provider/fetch.types.ts create mode 100644 packages/fetch/src/fetch-provider/fetch.utils.ts create mode 100644 packages/fetch/src/fetch-provider/fetcher-provider.fetch.ts create mode 100644 packages/fetch/src/fetch-provider/index.ts create mode 100644 packages/fetch/src/index.ts create mode 100644 packages/fetch/src/utils.ts create mode 100644 packages/fetch/src/zodios.test.ts create mode 100644 packages/fetch/src/zodios.ts create mode 100644 packages/fetch/tsconfig.build.json create mode 100644 packages/fetch/tsconfig.json create mode 100644 packages/fetch/tsup.config.js diff --git a/.changeset/blue-hounds-sort.md b/.changeset/blue-hounds-sort.md new file mode 100644 index 00000000..350243c3 --- /dev/null +++ b/.changeset/blue-hounds-sort.md @@ -0,0 +1,7 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +--- + +add fetch package diff --git a/packages/fetch/.gitignore b/packages/fetch/.gitignore new file mode 100644 index 00000000..9aadc156 --- /dev/null +++ b/packages/fetch/.gitignore @@ -0,0 +1,105 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env +.env.test + +# parcel-bundler cache (https://parceljs.org/) +.cache + +# Next.js build output +.next + +# Nuxt.js build / generate output +.nuxt +dist +lib + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and *not* Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port diff --git a/packages/fetch/.npmignore b/packages/fetch/.npmignore new file mode 100644 index 00000000..e09f31c9 --- /dev/null +++ b/packages/fetch/.npmignore @@ -0,0 +1,40 @@ +# compiled output +!/lib +/node_modules +/src +/examples +/website + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# OS +.DS_Store + +# Tests +/coverage +/.nyc_output + +# IDEs and editors +/.idea +.project +.classpath +.c9/ +*.launch +.settings/ +*.sublime-workspace + +# IDE - VSCode +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + +# ENV +.env diff --git a/packages/fetch/CHANGELOG.md b/packages/fetch/CHANGELOG.md new file mode 100644 index 00000000..630cfa5d --- /dev/null +++ b/packages/fetch/CHANGELOG.md @@ -0,0 +1,49 @@ +# @zodios/core + +## 11.0.0-beta.5 + +### Major Changes + +- 1b67309: fix axios tests +- c7c03bc: sync axios and core versions + +### Patch Changes + +- Updated dependencies [1b67309] +- Updated dependencies [c7c03bc] + - @zodios/core@11.0.0-beta.5 + +## 11.0.0-beta.4 + +### Major Changes + +- 679a267: update axios + +### Patch Changes + +- Updated dependencies [14ce00b] +- Updated dependencies [c9cae0a] +- Updated dependencies [3ac25a1] +- Updated dependencies [6c10dc2] +- Updated dependencies [679a267] +- Updated dependencies [90108a5] + - @zodios/core@11.0.0-beta.4 + +## 11.0.0-beta.3 + +### Patch Changes + +- add publish script +- 5575e28: add tests for type providers + +## 11.0.0-beta.2 + +### Patch Changes + +- remove publish action from ci + +## 11.0.0-beta.1 + +### Patch Changes + +- migrate to monorepo diff --git a/packages/fetch/LICENSE b/packages/fetch/LICENSE new file mode 100644 index 00000000..e5dea986 --- /dev/null +++ b/packages/fetch/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 ecyrbe + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/fetch/README.md b/packages/fetch/README.md new file mode 100644 index 00000000..31105cd4 --- /dev/null +++ b/packages/fetch/README.md @@ -0,0 +1,198 @@ +

Zodios

+

+ + Zodios logo + +

+

+ Zodios is a typescript api client and an optional api server with auto-completion features backed by axios and zod and express +
+ Documentation +

+ +

+ + langue typescript + + + npm + + + GitHub + + GitHub Workflow Status +

+ +https://user-images.githubusercontent.com/633115/185851987-554f5686-cb78-4096-8ff5-c8d61b645608.mp4 + +# What is it ? + +It's an axios compatible API client and an optional expressJS compatible API server with the following features: + +- really simple centralized API declaration +- typescript autocompletion in your favorite IDE for URL and parameters +- typescript response types +- parameters and responses schema thanks to zod +- response schema validation +- powerfull plugins like `fetch` adapter or `auth` automatic injection +- all axios features available +- `@tanstack/query` wrappers for react and solid (vue, svelte, etc, soon) +- all expressJS features available (middlewares, etc.) + + +**Table of contents:** + +- [What is it ?](#what-is-it-) +- [Install](#install) + - [Client and api definitions :](#client-and-api-definitions-) + - [Server :](#server-) +- [How to use it on client side ?](#how-to-use-it-on-client-side-) + - [Declare your API with zodios](#declare-your-api-with-zodios) + - [API definition format](#api-definition-format) +- [Full documentation](#full-documentation) +- [Ecosystem](#ecosystem) +- [Roadmap](#roadmap) +- [Dependencies](#dependencies) + +# Install + +## Client and api definitions : + +```bash +> npm install @zodios/core +``` + +or + +```bash +> yarn add @zodios/core +``` + +## Server : + +```bash +> npm install @zodios/core @zodios/express +``` + +or + +```bash +> yarn add @zodios/core @zodios/express +``` + +# How to use it on client side ? + +For an almost complete example on how to use zodios and how to split your APIs declarations, take a look at [dev.to](examples/dev.to/) example. + +## Declare your API with zodios + +Here is an example of API declaration with Zodios. + +```typescript +import { Zodios } from "@zodios/core"; +import { z } from "zod"; + +const apiClient = new Zodios( + "https://jsonplaceholder.typicode.com", + // API definition + [ + { + method: "get", + path: "/users/:id", // auto detect :id and ask for it in apiClient get params + alias: "getUser", // optionnal alias to call this endpoint with it + description: "Get a user", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], +); +``` + +Calling this API is now easy and has builtin autocomplete features : + +```typescript +// typed auto-complete path auto-complete params +// â–¼ â–¼ â–¼ +const user = await apiClient.get("/users/:id", { params: { id: 7 } }); +console.log(user); +``` + +It should output + +```js +{ id: 7, name: 'Kurtis Weissnat' } +``` +You can also use aliases : + +```typescript +// typed alias auto-complete params +// â–¼ â–¼ â–¼ +const user = await apiClient.getUser({ params: { id: 7 } }); +console.log(user); +``` +## API definition format + +```typescript +type ZodiosEndpointDescriptions = Array<{ + method: 'get'|'post'|'put'|'patch'|'delete'; + path: string; // example: /posts/:postId/comments/:commentId + alias?: string; // example: getPostComments + immutable?: boolean; // flag a post request as immutable to allow it to be cached with react-query + description?: string; + requestFormat?: 'json'|'form-data'|'form-url'|'binary'|'text'; // default to json if not set + parameters?: Array<{ + name: string; + description?: string; + type: 'Path'|'Query'|'Body'|'Header'; + schema: ZodSchema; // you can use zod `transform` to transform the value of the parameter before sending it to the server + }>; + response: ZodSchema; // you can use zod `transform` to transform the value of the response before returning it + status?: number; // default to 200, you can use this to override the sucess status code of the response (only usefull for openapi and express) + responseDescription?: string; // optional response description of the endpoint + errors?: Array<{ + status: number | 'default'; + description?: string; + schema: ZodSchema; // transformations are not supported on error schemas + }>; +}>; +``` +# Full documentation + +Check out the [full documentation](https://www.zodios.org) or following shortcuts. + +- [API definition](https://www.zodios.org/docs/category/zodios-api-definition) +- [Http client](https://www.zodios.org/docs/category/zodios-client) +- [React hooks](https://www.zodios.org/docs/client/react) +- [Solid hooks](https://www.zodios.org/docs/client/solid) +- [API server](http://www.zodios.org/docs/category/zodios-server) +- [Nextjs integration](http://www.zodios.org/docs/server/next) + +# Ecosystem + +- [openapi-zod-client](https://github.com/astahmer/openapi-zod-client): generate a zodios client from an openapi specification +- [@zodios/express](https://github.com/ecyrbe/zodios-express): full end to end type safety like tRPC, but for REST APIs +- [@zodios/plugins](https://github.com/ecyrbe/zodios-plugins) : some plugins for zodios +- [@zodios/react](https://github.com/ecyrbe/zodios-react) : a react-query wrapper for zodios +- [@zodios/solid](https://github.com/ecyrbe/zodios-solid) : a solid-query wrapper for zodios + +# Roadmap + +The following will need investigation to check if it's doable : +- implement `@zodios/nestjs` to define your API endpoints with nestjs and share it with your frontend (like tRPC) +- generate openAPI json from your API endpoints + +You have other ideas ? [Let me know !](https://github.com/ecyrbe/zodios/discussions) +# Dependencies + +Zodios even when working in pure Javascript is better suited to be working with Typescript Language Server to handle autocompletion. +So you should at least use the one provided by your IDE (vscode integrates a typescript language server) +However, we will only support fixing bugs related to typings for versions of Typescript Language v4.5 +Earlier versions should work, but do not have TS tail recusion optimisation that impact the size of the API you can declare. + +Also note that Zodios do not embed any dependency. It's your Job to install the peer dependencies you need. + +Internally Zodios uses these libraries on all platforms : +- zod +- axios diff --git a/packages/fetch/SECURITY.md b/packages/fetch/SECURITY.md new file mode 100644 index 00000000..16be6051 --- /dev/null +++ b/packages/fetch/SECURITY.md @@ -0,0 +1,20 @@ +# Security Policy + +## Supported Versions + +Use this section to tell people about which versions of your project are +currently being supported with security updates. + +| Version | Supported | +| --------- | ------------------ | +| 10.x.y | :white_check_mark: | +| < 10.0.0 | :x: | + +## Reporting a Vulnerability + +If you identify a vulnerability on zodios, please create an issue with a reproductible setup. +Do not open an issue if you can't show a reproductible setup of if the vulnerability is on third party dependency. + +Indeed, a vulnerability on a peer dependency should be reported on the appropriate project: +- zod +- axios diff --git a/packages/fetch/examples/define-types.ts b/packages/fetch/examples/define-types.ts new file mode 100644 index 00000000..dfcf6e1e --- /dev/null +++ b/packages/fetch/examples/define-types.ts @@ -0,0 +1,59 @@ +import { Zodios, makeApi } from "../src/index"; +import { z } from "zod"; + +// you can define schema before declaring the API to get back the type +const userSchema = z + .object({ + id: z.number(), + name: z.string(), + }) + .required(); + +const usersSchema = z.array(userSchema); + +// you can then get back the types +type User = z.infer; +type Users = z.infer; + +// you can also predefine your API +const jsonplaceholderUrl = "https://jsonplaceholder.typicode.com"; +const jsonplaceholderApi = makeApi([ + { + method: "get", + path: "/users", + description: "Get all users", + parameters: [ + { + name: "q", + description: "full text search", + type: "Query", + schema: z.string(), + }, + { + name: "page", + description: "page number", + type: "Query", + schema: z.number().optional(), + }, + ], + response: usersSchema, + }, + { + method: "get", + path: "/users/:id", + description: "Get a user", + response: userSchema, + }, +]); + +// and then use them in your API +async function bootstrap() { + const apiClient = new Zodios(jsonplaceholderUrl, jsonplaceholderApi); + + const users = await apiClient.get("/users", { queries: { q: "Nicholas" } }); + console.log(users); + const user = await apiClient.get("/users/:id", { params: { id: 7 } }); + console.log(user); +} + +bootstrap(); diff --git a/packages/fetch/examples/dev.to/api-key-plugin.ts b/packages/fetch/examples/dev.to/api-key-plugin.ts new file mode 100644 index 00000000..ba768056 --- /dev/null +++ b/packages/fetch/examples/dev.to/api-key-plugin.ts @@ -0,0 +1,19 @@ +import { ZodiosPlugin } from "../../src/index"; + +export interface ApiKeyPluginConfig { + getApiKey: () => Promise; +} + +export function pluginApiKey(provider: ApiKeyPluginConfig): ZodiosPlugin { + return { + request: async (_, config) => { + return { + ...config, + headers: { + ...config.headers, + "api-key": await provider.getApiKey(), + }, + }; + }, + }; +} diff --git a/packages/fetch/examples/dev.to/articles.ts b/packages/fetch/examples/dev.to/articles.ts new file mode 100644 index 00000000..96714c78 --- /dev/null +++ b/packages/fetch/examples/dev.to/articles.ts @@ -0,0 +1,167 @@ +import { apiBuilder, makeApi } from "../../src/index"; +import { z } from "zod"; +import { devUser } from "./users"; +import { paramPages } from "./params"; + +const devArticle = z.object({ + id: z.number(), + type_of: z.string(), + title: z.string(), + description: z.string(), + cover_image: z.string().or(z.null()), + readable_publish_date: z.string().optional(), + social_image: z.string().optional(), + tag_list: z.array(z.string()).or(z.string()), + tags: z.array(z.string()).or(z.string()).optional(), + slug: z.string(), + path: z.string(), + url: z.string(), + canonical_url: z.string(), + comments_count: z.number(), + positive_reactions_count: z.number(), + public_reactions_count: z.number(), + collection_id: z.number().or(z.null()).optional(), + created_at: z.string().optional(), + edited_at: z.string().optional(), + crossposted_at: z.string().or(z.null()).optional(), + published_at: z.string().or(z.null()).optional(), + last_comment_at: z.string().optional(), + published_timestamp: z.string(), + reading_time_minutes: z.number(), + user: devUser.partial(), + read_time_minutes: z.number().optional(), + organization: z + .object({ + name: z.string(), + username: z.string(), + slug: z.string(), + profile_image: z.string(), + profile_image_90: z.string(), + }) + .optional(), + flare_tag: z + .object({ + name: z.string(), + bg_color_hex: z.string(), + text_color_hex: z.string(), + }) + .optional(), +}); + +const devArticles = z.array(devArticle); + +export type Article = z.infer; +export type Articles = z.infer; + +export const articlesApi = apiBuilder({ + method: "get", + path: "/articles", + alias: "getAllArticles", + description: "Get all articles", + parameters: [ + ...paramPages, + { + name: "tag", + description: "Filter by tag", + type: "Query", + schema: z.string().optional(), + }, + { + name: "tags", + description: "Filter by tags", + type: "Query", + schema: z.string().optional(), + }, + { + name: "tags_exclude", + description: "Exclude tags", + type: "Query", + schema: z.string().optional(), + }, + { + name: "username", + description: "Filter by username", + type: "Query", + schema: z.string().optional(), + }, + { + name: "state", + description: "Filter by state", + type: "Query", + schema: z.string().optional(), + }, + { + name: "top", + type: "Query", + schema: z.number().optional(), + }, + { + name: "collection_id", + type: "Query", + schema: z.number().optional(), + }, + ], + response: devArticles, +}) + .addEndpoint({ + method: "get", + path: "/articles/latest", + alias: "getLatestArticle", + description: "Get latest articles", + parameters: paramPages, + response: devArticles, + }) + .addEndpoint({ + method: "get", + path: "/articles/:id", + alias: "getArticle", + description: "Get an article by id", + response: devArticle, + }) + .addEndpoint({ + method: "put", + path: "/articles/:id", + alias: "updateArticle", + description: "Update an article", + response: devArticle, + }) + .addEndpoint({ + method: "get", + path: "/articles/:username/:slug", + alias: "getArticleByUsernameAndSlug", + description: "Get an article by username and slug", + response: devArticle, + }) + .addEndpoint({ + method: "get", + path: "/articles/me", + alias: "getMyArticles", + description: "Get current user's articles", + parameters: paramPages, + response: devArticles, + }) + .addEndpoint({ + method: "get", + path: "/articles/me/published", + alias: "getMyPublishedArticles", + description: "Get current user's published articles", + parameters: paramPages, + response: devArticles, + }) + .addEndpoint({ + method: "get", + path: "/articles/me/unpublished", + alias: "getMyUnpublishedArticles", + description: "Get current user's unpublished articles", + parameters: paramPages, + response: devArticles, + }) + .addEndpoint({ + method: "get", + path: "/articles/me/all", + alias: "getAllMyArticles", + description: "Get current user's all articles", + parameters: paramPages, + response: devArticles, + }) + .build(); diff --git a/packages/fetch/examples/dev.to/comments.ts b/packages/fetch/examples/dev.to/comments.ts new file mode 100644 index 00000000..7f749319 --- /dev/null +++ b/packages/fetch/examples/dev.to/comments.ts @@ -0,0 +1,61 @@ +import { makeApi, makeEndpoint } from "../../src/index"; +import { z } from "zod"; +import { devUser, User } from "./users"; + +/** + * zod does not handle recusive well, so we need to manually define the schema + */ +export type Comment = { + type_of: string; + id_code: string; + created_at: string; + body_html: string; + user: User; + children: Comment[]; +}; + +export const devComment: z.ZodSchema = z.lazy(() => + z.object({ + type_of: z.string(), + id_code: z.string(), + created_at: z.string(), + body_html: z.string(), + user: devUser, + children: z.array(devComment), + }) +); +export const devComments = z.array(devComment); + +export type Comments = z.infer; + +const getAllComments = makeEndpoint({ + method: "get", + path: "/comments", + alias: "getAllComments", + description: "Get all comments", + parameters: [ + { + name: "a_id", + description: "Article ID", + type: "Query", + schema: z.number().optional(), + }, + { + name: "p_id", + description: "Podcast comment ID", + type: "Query", + schema: z.number().optional(), + }, + ], + response: devComments, +}); + +const getComment = makeEndpoint({ + method: "get", + path: "/comments/:id", + alias: "getComment", + description: "Get a comment", + response: devComment, +}); + +export const commentsApi = makeApi([getAllComments, getComment]); diff --git a/packages/fetch/examples/dev.to/example.ts b/packages/fetch/examples/dev.to/example.ts new file mode 100644 index 00000000..4d8ad015 --- /dev/null +++ b/packages/fetch/examples/dev.to/example.ts @@ -0,0 +1,23 @@ +import { Zodios } from "../../src/index"; +import { articlesApi } from "./articles"; +import { commentsApi } from "./comments"; +import { followsApi } from "./follows"; +import { followersApi } from "./followers"; +import { userApi } from "./users"; +import { pluginApiKey } from "./api-key-plugin"; + +export const devTo = new Zodios("https://dev.to/api", [ + ...articlesApi, + ...commentsApi, + ...followsApi, + ...followersApi, + ...userApi, +]); + +devTo.use( + pluginApiKey({ + getApiKey: async () => "", + }) +); + +devTo.get("/articles/me/all").then(console.log); diff --git a/packages/fetch/examples/dev.to/followers.ts b/packages/fetch/examples/dev.to/followers.ts new file mode 100644 index 00000000..db9e7d5b --- /dev/null +++ b/packages/fetch/examples/dev.to/followers.ts @@ -0,0 +1,33 @@ +import { z } from "zod"; +import { makeApi } from "../../src/index"; +import { paramPages } from "./params"; + +const devFollower = z.object({ + type_of: z.string(), + created_at: z.string(), + id: z.number(), + name: z.string(), + path: z.string(), + username: z.string(), + profile_image: z.string(), +}); + +const devFollowers = z.array(devFollower); + +export const followersApi = makeApi([ + { + method: "get", + path: "/followers/users", + alias: "getAllFollowers", + parameters: [ + ...paramPages, + { + name: "sort", + description: "Sort by. defaults to created_at", + type: "Query", + schema: z.string().optional(), + }, + ], + response: devFollowers, + }, +]); diff --git a/packages/fetch/examples/dev.to/follows.ts b/packages/fetch/examples/dev.to/follows.ts new file mode 100644 index 00000000..3aa7cae6 --- /dev/null +++ b/packages/fetch/examples/dev.to/follows.ts @@ -0,0 +1,23 @@ +import { z } from "zod"; +import { makeApi } from "../../src/index"; + +export const devFollow = z.object({ + id: z.number(), + name: z.string(), + points: z.number(), +}); + +export const devFollows = z.array(devFollow); + +export type Follow = z.infer; +export type Follows = z.infer; + +export const followsApi = makeApi([ + { + method: "get", + path: "/follows/tags", + alias: "getAllFollowedTags", + description: "Get all followed tags", + response: devFollows, + }, +]); diff --git a/packages/fetch/examples/dev.to/params.ts b/packages/fetch/examples/dev.to/params.ts new file mode 100644 index 00000000..c07e5a80 --- /dev/null +++ b/packages/fetch/examples/dev.to/params.ts @@ -0,0 +1,16 @@ +import { z } from "zod"; +import { makeParameters } from "../../src/api"; + +export const paramPages = makeParameters([ + { + name: "page", + type: "Query", + description: "Page number", + schema: z.number().optional(), + }, + { + name: "per_page", + type: "Query", + schema: z.number().optional(), + }, +]); diff --git a/packages/fetch/examples/dev.to/users.ts b/packages/fetch/examples/dev.to/users.ts new file mode 100644 index 00000000..1c74bc1b --- /dev/null +++ b/packages/fetch/examples/dev.to/users.ts @@ -0,0 +1,64 @@ +import { z } from "zod"; +import { makeApi } from "../../src/index"; + +export const devUser = z.object({ + id: z.number(), + type_of: z.string(), + name: z.string(), + username: z.string(), + summary: z.string().or(z.null()), + twitter_username: z.string().or(z.null()), + github_username: z.string().or(z.null()), + website_url: z.string().or(z.null()), + location: z.string().or(z.null()), + joined_at: z.string(), + profile_image: z.string(), + profile_image_90: z.string(), +}); + +export type User = z.infer; + +export const devProfileImage = z.object({ + type_of: z.string(), + image_of: z.string(), + profile_image: z.string(), + profile_image_90: z.string(), +}); + +export type ProfileImage = z.infer; + +export const userApi = makeApi([ + { + method: "get", + path: "/users/:id", + alias: "getUser", + description: "Get a user", + response: devUser, + errors: [ + { + status: "default", + description: "Default error", + schema: z.object({ + error: z.object({ + code: z.string(), + message: z.string(), + }), + }), + }, + ], + }, + { + method: "get", + path: "/users/me", + alias: "getMe", + description: "Get current user", + response: devUser, + }, + { + method: "get", + path: "/profile_image/:username", + alias: "getProfileImage", + description: "Get a user's profile image", + response: devProfileImage, + }, +]); diff --git a/packages/fetch/examples/io-ts-types.ts b/packages/fetch/examples/io-ts-types.ts new file mode 100644 index 00000000..a2d64de4 --- /dev/null +++ b/packages/fetch/examples/io-ts-types.ts @@ -0,0 +1,78 @@ +import { + Zodios, + makeApi, + ApiOf, + TypeProviderOf, + FetcherProviderOf, + ioTsTypeProvider, +} from "../src/index"; +import * as t from "io-ts"; + +// you can define schema before declaring the API to get back the type + +// you can then get back the types +type User = t.TypeOf; +type Users = t.TypeOf; + +// you can also predefine your API +const jsonplaceholderUrl = "https://jsonplaceholder.typicode.com"; + +const userSchema = t.type({ + id: t.number, + name: t.string, +}); + +const usersSchema = t.array(userSchema); + +const jsonplaceholderApi = makeApi([ + { + method: "get", + path: "/users", + alias: "getUsers", + description: "Get all users", + parameters: [ + { + name: "q", + description: "full text search", + type: "Query", + schema: t.string, + }, + { + name: "page", + description: "page number", + type: "Query", + schema: t.union([t.number, t.undefined]), + }, + ], + response: usersSchema, + }, + { + method: "get", + path: "/users/:id", + description: "Get a user", + response: userSchema, + }, +]); + +async function bootstrap() { + const apiClient = new Zodios(jsonplaceholderUrl, jsonplaceholderApi, { + typeProvider: ioTsTypeProvider, + }); + + type Api = ApiOf; + // ^? + type Provider = TypeProviderOf; + // ^? + type FetcherProvider = FetcherProviderOf; + // ^? + const users = await apiClient.get("/users", { queries: { q: "Nicholas" } }); + // ^? + const users2 = await apiClient.getUsers({ queries: { q: "Nicholas" } }); + // ^? + console.log(users); + const user = await apiClient.get("/users/:id", { params: { id: 7 } }); + // ^? + console.log(user); +} + +bootstrap(); diff --git a/packages/fetch/examples/jsonplaceholder.ts b/packages/fetch/examples/jsonplaceholder.ts new file mode 100644 index 00000000..5bd28b12 --- /dev/null +++ b/packages/fetch/examples/jsonplaceholder.ts @@ -0,0 +1,97 @@ +import { + ApiOf, + ZodiosResponseByAlias, + ZodiosHeaderParamsByAlias, + Zodios, +} from "../src/index"; +import { z } from "zod"; + +async function bootstrap() { + const apiClient = new Zodios("https://jsonplaceholder.typicode.com", [ + { + method: "get", + path: "/users", + alias: "getUsers", + description: "Get all users", + parameters: [ + { + name: "q", + type: "Query", + schema: z.string(), + }, + { + name: "page", + type: "Query", + schema: z.string().optional(), + }, + ], + response: z.array(z.object({ id: z.number(), name: z.string() })), + }, + { + method: "get", + path: "/users/:id", + alias: "getUser", + description: "Get a user", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + { + method: "delete", + path: "/users/:id", + alias: "deleteUser", + description: "Delete a user", + response: z.void(), + }, + { + method: "post", + path: "/users", + alias: "createUser", + description: "Create a user", + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ name: z.string() }), + }, + { + name: "Content-Type", + type: "Header", + schema: z.string(), + }, + ], + response: z.object({ id: z.number(), name: z.string() }), + }, + ]); + + type UserResponseAlias = ZodiosResponseByAlias< + ApiOf, + "getUsers" + >; + + type Test = ZodiosHeaderParamsByAlias, "createUser">; + + const users: UserResponseAlias = await apiClient.getUsers({ + queries: { q: "Nicholas" }, + }); + console.log(users); + const user = await apiClient.getUser({ params: { id: 7 } }); + console.log(user); + const createdUser = await apiClient.createUser( + { name: "john doe" }, + { + headers: { + "Content-Type": "application/json", + Accept: "application/json", + }, + } + ); + console.log(createdUser); + const deletedUser = await apiClient.deleteUser(undefined, { + params: { id: 7 }, + }); + console.log(deletedUser); +} + +bootstrap(); diff --git a/packages/fetch/examples/types-from-definition.ts b/packages/fetch/examples/types-from-definition.ts new file mode 100644 index 00000000..bc25cf30 --- /dev/null +++ b/packages/fetch/examples/types-from-definition.ts @@ -0,0 +1,128 @@ +import { + ZodiosResponseByPath, + ZodiosBodyByPath, + ZodiosPathParamsByPath, + ZodiosQueryParamsByPath, + makeApi, + ZodiosPathParamByAlias, + makeErrors, +} from "../src/index"; +import z from "zod"; + +const user = z.object({ + id: z.number(), + name: z.string(), + email: z.string().email(), + phone: z.string(), +}); + +const errors = makeErrors([ + { + status: 404, + schema: z.object({ + message: z.string(), + }), + }, + { + status: 401, + schema: z.object({ + message: z.string(), + }), + }, + { + status: 500, + schema: z.object({ + message: z.string(), + cause: z.record(z.string()), + }), + }, +]); + +const api = makeApi([ + { + path: "/users", + method: "get", + response: z.array(user), + }, + { + path: "/users/:id", + method: "get", + alias: "getUser", + parameters: [ + { + name: "id", + type: "Path", + schema: z.number().positive(), + }, + ], + response: user, + errors, + }, + { + path: "/users", + method: "post", + parameters: [ + { + name: "body", + type: "Body", + schema: user, + }, + ], + response: user, + }, + { + path: "/users/:id", + method: "put", + parameters: [ + { + name: "body", + type: "Body", + schema: user, + }, + ], + response: user, + }, + { + path: "/users/:id", + method: "patch", + parameters: [ + { + name: "body", + type: "Body", + schema: user, + }, + ], + response: user, + }, + { + path: "/users/:id", + method: "delete", + response: z.object({}), + }, +]); + +type User = z.infer; +type Api = typeof api; + +type Users = ZodiosResponseByPath; +// ^? +type UserById = ZodiosResponseByPath; +// ^? +type GetUserParams = ZodiosPathParamsByPath; +// ^? +type GetUserParamsByAlias = ZodiosPathParamByAlias; +// ^? +type GetUsersParams = ZodiosPathParamsByPath; +// ^? +type GetUserQueries = ZodiosQueryParamsByPath; +// ^? +type CreateUserBody = ZodiosBodyByPath; +// ^? +type CreateUserResponse = ZodiosResponseByPath; +// ^? +type UpdateUserBody = ZodiosBodyByPath; +// ^? +type PatchUserBody = ZodiosBodyByPath; +// ^? +type DeleteUserResponse = ZodiosResponseByPath; +// ^? diff --git a/packages/fetch/examples/typescript-types.ts b/packages/fetch/examples/typescript-types.ts new file mode 100644 index 00000000..fdf8e533 --- /dev/null +++ b/packages/fetch/examples/typescript-types.ts @@ -0,0 +1,77 @@ +import { + Zodios, + makeApi, + tsFnSchema, + ApiOf, + TypeProviderOf, + tsSchema, + tsTypeProvider, + FetcherProviderOf, +} from "../src"; + +// you can also predefine your API +const jsonplaceholderUrl = "https://jsonplaceholder.typicode.com"; + +type User = { + id: number; + name: string; +}; + +const userSchema = tsSchema(); + +const usersSchema = tsSchema(); + +const jsonplaceholderApi = makeApi([ + { + method: "get", + path: "/users", + description: "Get all users", + parameters: [ + { + name: "q", + description: "full text search", + type: "Query", + schema: tsFnSchema((data) => { + if (typeof data !== "string") { + throw new Error("not a string"); + } + return data; + }), + }, + { + name: "page", + description: "page number", + type: "Query", + schema: tsSchema(), + }, + ], + response: usersSchema, + }, + { + method: "get", + path: "/users/:id", + description: "Get a user", + response: userSchema, + }, +]); + +async function bootstrap() { + const apiClient = new Zodios(jsonplaceholderUrl, jsonplaceholderApi, { + typeProvider: tsTypeProvider, + }); + + type Api = ApiOf; + // ^? + type Provider = TypeProviderOf; + // ^? + type FetcherProvider = FetcherProviderOf; + // ^? + const users = await apiClient.get("/users", { queries: { q: "Nicholas" } }); + // ^? + console.log(users); + const user = await apiClient.get("/users/:id", { params: { id: 7 } }); + // ^? + console.log(user); +} + +bootstrap(); diff --git a/packages/fetch/jest.config.ts b/packages/fetch/jest.config.ts new file mode 100644 index 00000000..d0da3728 --- /dev/null +++ b/packages/fetch/jest.config.ts @@ -0,0 +1,24 @@ +import type { Config } from "@jest/types"; + +// Objet synchrone +const config: Config.InitialOptions = { + verbose: true, + moduleFileExtensions: ["ts", "js", "json", "node"], + rootDir: "./", + testRegex: ".(spec|test).tsx?$", + transform: { + "^.+\\.tsx?$": "ts-jest", + }, + coveragePathIgnorePatterns: ["/node_modules/", "index\\.ts"], + coverageDirectory: "./coverage", + coverageThreshold: { + global: { + branches: 80, + functions: 85, + lines: 85, + statements: 85, + }, + }, + testEnvironment: "node", +}; +export default config; diff --git a/packages/fetch/package.json b/packages/fetch/package.json new file mode 100644 index 00000000..2054a71c --- /dev/null +++ b/packages/fetch/package.json @@ -0,0 +1,83 @@ +{ + "name": "@zodios/fetch", + "description": "Typescript API client with fetch", + "version": "11.0.0-beta.5", + "main": "lib/index.js", + "module": "lib/index.mjs", + "typings": "lib/index.d.ts", + "exports": { + ".": { + "import": "./lib/index.mjs", + "require": "./lib/index.js" + }, + "./package.json": "./package.json" + }, + "files": [ + "lib" + ], + "author": { + "name": "ecyrbe", + "email": "ecyrbe@gmail.com" + }, + "homepage": "https://github.com/ecyrbe/zodios", + "repository": { + "type": "git", + "url": "https://github.com/ecyrbe/zodios.git" + }, + "license": "MIT", + "keywords": [ + "fetch", + "openapi", + "zod", + "autocomplete", + "validation" + ], + "scripts": { + "prebuild": "rimraf lib", + "example": "ts-node examples/jsonplaceholder.ts", + "example:dev.to": "ts-node examples/dev.to/example.ts", + "build": "tsup", + "test": "jest --coverage" + }, + "peerDependencies": { + "fp-ts": "2.x", + "io-ts": "2.x", + "zod": "^3.x" + }, + "peerDependenciesMeta": { + "zod": { + "optional": true + }, + "fp-ts": { + "optional": true + }, + "io-ts": { + "optional": true + } + }, + "devDependencies": { + "@jest/globals": "29.3.1", + "@jest/types": "29.3.1", + "@types/express": "4.17.14", + "@types/jest": "29.2.2", + "@types/multer": "1.4.7", + "@types/node": "18.11.9", + "@types/qs": "6.9.7", + "axios": "1.1.3", + "express": "4.18.2", + "fp-ts": "2.13.1", + "io-ts": "2.2.19", + "jest": "29.3.0", + "multer": "1.4.5-lts.1", + "qs": "6.11.0", + "rimraf": "3.0.2", + "ts-jest": "29.0.3", + "ts-node": "10.9.1", + "tsup": "6.3.0", + "typescript": "4.9.3", + "zod": "3.19.1" + }, + "dependencies": { + "@zodios/core": "workspace:*" + } +} diff --git a/packages/fetch/src/fetch-provider/fetch.ts b/packages/fetch/src/fetch-provider/fetch.ts new file mode 100644 index 00000000..3bce5115 --- /dev/null +++ b/packages/fetch/src/fetch-provider/fetch.ts @@ -0,0 +1,127 @@ +import { AnyZodiosRequestOptions } from "@zodios/core"; +import { FetchProviderResponse, FetchProviderConfig } from "./fetch.types"; +import { buildURL, isBlob, isFile, isFormData } from "./fetch.utils"; +import { FetchProvider } from "./fetcher-provider.fetch"; + +export class FetchError extends Error { + /** + * constructore with same signature as AxiosError + */ + constructor( + message?: string, + public code?: string, + public config?: FetchProviderConfig, + public request?: Request, + public response?: FetchProviderResponse + ) { + super(message); + } +} + +/** + * fetch provider + * @param config - fetch config + * @returns + */ +export const advancedFetch = async ( + config: AnyZodiosRequestOptions +) => { + const request = createFetchRequest(config); + const response = (await fetchRequest( + request, + config as FetchProviderConfig + )) as FetchProviderResponse; + response.data = await getResponseData( + response, + config as FetchProviderConfig + ); + if ( + (config.validateStatus && !config.validateStatus(response.status)) || + !response.ok + ) { + throw new FetchError( + response.statusText, + `${response.status}`, + config as FetchProviderConfig, + request, + response + ); + } + return response; +}; + +function createFetchRequest(config: AnyZodiosRequestOptions) { + const headers = new Headers(config.headers); + if (isFormData(config.body) || isBlob(config.body) || isFile(config.body)) { + if (headers.has("Content-Type")) { + // istanbul ignore next + headers.delete("Content-Type"); + } + } else if (typeof config.body === "object") { + headers.set("Content-Type", "application/json"); + headers.set("Accept", "application/json"); + config.body = JSON.stringify(config.body); + } + + // istanbul ignore next + if (config.auth) { + const username = config.auth.username || ""; + const password = config.auth.password + ? decodeURI(encodeURIComponent(config.auth.password)) + : ""; + headers.set("Authorization", `Basic ${btoa(username + ":" + password)}`); + } + + // istanbul ignore next + if (config.timeout && !config.signal) { + const controller = new AbortController(); + const timeout = setTimeout(() => controller.abort(), config.timeout); + config.signal = controller.signal; + config.signal.addEventListener("abort", () => clearTimeout(timeout)); + } + + const url = buildURL(config); + return new Request(url, { + ...(config as FetchProviderConfig), + method: config.method.toUpperCase(), + headers, + }); +} + +async function fetchRequest(request: Request, config: FetchProviderConfig) { + try { + return await fetch(request); + } catch (error) { + // istanbul ignore next + if (error instanceof Error) { + throw new FetchError(error.message, "ERR_NETWORK", config, request); + } else { + throw new FetchError("Network Error", "ERR_NETWORK", config, request); + } + } +} + +// istanbul ignore next +async function getResponseData( + response: Response, + config: FetchProviderConfig +) { + switch (config.responseType) { + case "arraybuffer": + return response.arrayBuffer(); + case "blob": + return response.blob(); + case "stream": + return response.body; + case "text": + return response.text(); + case "json": + return response.json(); + default: { + if (response.headers.get("content-type")?.includes("application/json")) { + return response.json(); + } + return response.text(); + } + } +} diff --git a/packages/fetch/src/fetch-provider/fetch.types.ts b/packages/fetch/src/fetch-provider/fetch.types.ts new file mode 100644 index 00000000..447b23fa --- /dev/null +++ b/packages/fetch/src/fetch-provider/fetch.types.ts @@ -0,0 +1,13 @@ +/// + +export interface FetchProviderConfig extends RequestInit { + baseURL?: string; + auth?: { username: string; password: string }; + validateStatus?: (status: number) => boolean; + timeout?: number; + responseType?: "arraybuffer" | "blob" | "json" | "text" | "stream"; +} + +export interface FetchProviderResponse extends Response { + data: Data; +} diff --git a/packages/fetch/src/fetch-provider/fetch.utils.ts b/packages/fetch/src/fetch-provider/fetch.utils.ts new file mode 100644 index 00000000..801969ef --- /dev/null +++ b/packages/fetch/src/fetch-provider/fetch.utils.ts @@ -0,0 +1,54 @@ +import qs from "qs"; +import { AnyZodiosRequestOptions } from "@zodios/core"; +import { FetchProvider } from "./fetcher-provider.fetch"; + +/** + * more resilient alternative to instanceof when the object is not native and compiled to es5 + * @param kind - string representation of the object kind + * @returns - a function that checks if the object is of the given kind + */ +// istanbul ignore next +export const isKindOf = + (kind: string) => + (data: any): boolean => { + const pattern = `[object ${kind}]`; + return ( + data && + (toString.call(data) === pattern || + (typeof data.toString === "function" && data.toString() === pattern)) + ); + }; + +// istanbul ignore next +export const isFormData = isKindOf("FormData"); +// istanbul ignore next +export const isBlob = isKindOf("Blob"); +// istanbul ignore next +export const isFile = isKindOf("File"); +// istanbul ignore next +export const isSearchParams = isKindOf("URLSearchParams"); + +// istanbul ignore next +function getFullURL(config: AnyZodiosRequestOptions) { + if (config.url?.startsWith("http") || !config.baseURL) { + return config.url; + } + const baseURL = config.baseURL.replace(/\/$/, ""); + if (!config.url) { + return baseURL; + } + const path = config.url.replace(/^\//, ""); + return `${baseURL}/${path}`; +} + +export function buildURL(config: AnyZodiosRequestOptions) { + let fullURL = getFullURL(config) || "/"; + const serializedParams = qs.stringify(config.queries, { + arrayFormat: "brackets", + encodeValuesOnly: true, + }); + if (serializedParams) { + fullURL += fullURL.indexOf("?") === -1 ? "?" : "&"; + } + return `${fullURL}${serializedParams}`; +} diff --git a/packages/fetch/src/fetch-provider/fetcher-provider.fetch.ts b/packages/fetch/src/fetch-provider/fetcher-provider.fetch.ts new file mode 100644 index 00000000..0de920ab --- /dev/null +++ b/packages/fetch/src/fetch-provider/fetcher-provider.fetch.ts @@ -0,0 +1,58 @@ +import type { + AnyZodiosFetcherProvider, + AnyZodiosRequestOptions, + ZodiosRuntimeFetcherProvider, +} from "@zodios/core"; +import { Merge } from "@zodios/core/lib/utils.types"; +import { replacePathParams } from "../utils"; +import { FetchProviderConfig, FetchProviderResponse } from "./fetch.types"; +import { advancedFetch, FetchError } from "./fetch"; + +type FetchErrorStatus = Merge< + Omit, "status" | "response">, + { + response: Merge< + FetchError["response"], + { + status: Status extends "default" ? 0 & { error: "default" } : Status; + } + >; + } +>; + +type FetchProviderOptions = { + fetchConfig?: FetchProviderConfig; +}; + +export interface FetchProvider extends AnyZodiosFetcherProvider { + options: FetchProviderOptions; + config: Omit; + response: FetchProviderResponse; + error: FetchErrorStatus; +} + +export const fetchProvider: ZodiosRuntimeFetcherProvider & + FetchProviderOptions = { + init( + options: { + baseURL?: string; + } & FetchProviderOptions + ) { + const { baseURL, fetchConfig } = options; + this.fetchConfig = fetchConfig; + if (baseURL) { + this.baseURL = baseURL; + } + }, + async fetch(config: AnyZodiosRequestOptions) { + const requestConfig = { + ...this.fetchConfig, + ...config, + baseURL: this.baseURL, + url: replacePathParams(config), + }; + return advancedFetch( + requestConfig as AnyZodiosRequestOptions + ); + }, +}; diff --git a/packages/fetch/src/fetch-provider/index.ts b/packages/fetch/src/fetch-provider/index.ts new file mode 100644 index 00000000..67bc2279 --- /dev/null +++ b/packages/fetch/src/fetch-provider/index.ts @@ -0,0 +1 @@ +export * from "./fetcher-provider.fetch"; diff --git a/packages/fetch/src/index.ts b/packages/fetch/src/index.ts new file mode 100644 index 00000000..f4ea712c --- /dev/null +++ b/packages/fetch/src/index.ts @@ -0,0 +1,3 @@ +export { Zodios } from "./zodios"; +export { FetchProvider, fetchProvider } from "./fetch-provider"; +export * from "@zodios/core"; diff --git a/packages/fetch/src/utils.ts b/packages/fetch/src/utils.ts new file mode 100644 index 00000000..d1932bda --- /dev/null +++ b/packages/fetch/src/utils.ts @@ -0,0 +1,16 @@ +import type { ReadonlyDeep } from "@zodios/core/lib/utils.types"; + +const paramsRegExp = /:([a-zA-Z_][a-zA-Z0-9_]*)/g; + +export function replacePathParams( + config: ReadonlyDeep<{ url: string; params?: Record }> +) { + let result: string = config.url; + const params = config.params; + if (params) { + result = result.replace(paramsRegExp, (match, key) => + key in params ? `${params[key]}` : match + ); + } + return result; +} diff --git a/packages/fetch/src/zodios.test.ts b/packages/fetch/src/zodios.test.ts new file mode 100644 index 00000000..459f758d --- /dev/null +++ b/packages/fetch/src/zodios.test.ts @@ -0,0 +1,1129 @@ +/// +import { AxiosError } from "axios"; +import express from "express"; +import { AddressInfo } from "net"; +import { z, ZodError } from "zod"; +if (globalThis.FormData === undefined) { + globalThis.FormData = require("form-data"); +} +import { Zodios } from "./zodios"; +import { + ZodiosError, + AnyZodiosFetcherProvider, + ZodiosPlugin, + apiBuilder, +} from "@zodios/core"; +import multer from "multer"; +import { Assert } from "@zodios/core/lib/utils.types"; +import { FetchProvider } from "./fetch-provider"; + +const multipart = multer({ storage: multer.memoryStorage() }); + +describe("Zodios", () => { + let app: express.Express; + let server: ReturnType; + let port: number; + + beforeAll(async () => { + app = express(); + app.use(express.json()); + app.get("/token", (req, res) => { + res.status(200).json({ token: req.headers.authorization }); + }); + app.post("/token", (req, res) => { + res.status(200).json({ token: req.headers.authorization }); + }); + app.get("/error401", (req, res) => { + res.status(401).json({}); + }); + app.get("/error502", (req, res) => { + res.status(502).json({ error: { message: "bad gateway" } }); + }); + app.get("/queries", (req, res) => { + res.status(200).json({ + queries: req.query.id, + }); + }); + app.get("/:id", (req, res) => { + res.status(200).json({ id: Number(req.params.id), name: "test" }); + }); + app.get("/path/:uuid", (req, res) => { + res.status(200).json({ uuid: req.params.uuid }); + }); + app.get("/:id/address/:address", (req, res) => { + res + .status(200) + .json({ id: Number(req.params.id), address: req.params.address }); + }); + app.post("/", (req, res) => { + res.status(200).json({ id: 3, name: req.body.name }); + }); + app.put("/", (req, res) => { + res.status(200).json({ id: req.body.id, name: req.body.name }); + }); + app.patch("/", (req, res) => { + res.status(200).json({ id: req.body.id, name: req.body.name }); + }); + app.delete("/:id", (req, res) => { + res.status(200).json({ id: Number(req.params.id) }); + }); + app.post("/form-data", multipart.none(), (req, res) => { + res.status(200).json(req.body); + }); + app.post( + "/form-url", + express.urlencoded({ extended: false }), + (req, res) => { + res.status(200).json(req.body); + } + ); + app.post("/text", express.text(), (req, res) => { + res.status(200).send(req.body); + }); + server = app.listen(0); + port = (server.address() as AddressInfo).port; + }); + + afterAll(() => { + server.close(); + }); + + it("should be defined", () => { + expect(Zodios).toBeDefined(); + }); + + it("should throw if baseUrl is not provided", () => { + // @ts-ignore + expect(() => new Zodios(undefined, [])).toThrowError( + "Zodios: missing base url" + ); + }); + + it("should throw if api is not provided", () => { + // @ts-ignore + expect(() => new Zodios()).toThrowError("Zodios: missing api description"); + }); + + it("should throw if api is not an array", () => { + // @ts-ignore + expect(() => new Zodios({})).toThrowError("Zodios: api must be an array"); + }); + + it("should create a new instance of Zodios", () => { + const zodios = new Zodios(`http://localhost:${port}`, []); + expect(zodios).toBeDefined(); + }); + it("should create a new instance when providing an api", () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/:id", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + expect(zodios).toBeDefined(); + }); + + it("should should throw with duplicate api endpoints", () => { + expect( + () => + new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/:id", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + { + method: "get", + path: "/:id", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]) + ).toThrowError("Zodios: Duplicate path 'get /:id'"); + }); + + it("should create a new instance whithout base URL", () => { + const zodios = new Zodios([ + { + method: "get", + path: "/:id", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + expect(zodios).toBeDefined(); + }); + + it("should register have validation plugin automatically installed", () => { + const zodios = new Zodios(`http://localhost:${port}`, []); + // @ts-ignore + expect(zodios.endpointPlugins.get("any-any").count()).toBe(1); + }); + + it("should register a plugin", () => { + const zodios = new Zodios(`http://localhost:${port}`, []); + zodios.use({ + request: async (_, config) => config, + }); + // @ts-ignore + expect(zodios.endpointPlugins.get("any-any").count()).toBe(2); + }); + + it("should unregister a plugin", () => { + const zodios = new Zodios(`http://localhost:${port}`, []); + const id = zodios.use({ + request: async (_, config) => config, + }); + // @ts-ignore + expect(zodios.endpointPlugins.get("any-any").count()).toBe(2); + zodios.eject(id); + // @ts-ignore + expect(zodios.endpointPlugins.get("any-any").count()).toBe(1); + }); + + it("should replace a named plugin", () => { + const zodios = new Zodios(`http://localhost:${port}`, []); + const plugin: ZodiosPlugin = { + name: "test", + request: async (_, config) => config, + }; + zodios.use(plugin); + zodios.use(plugin); + zodios.use(plugin); + // @ts-ignore + expect(zodios.endpointPlugins.get("any-any").count()).toBe(2); + }); + + it("should unregister a named plugin", () => { + const zodios = new Zodios(`http://localhost:${port}`, []); + const plugin: ZodiosPlugin = { + name: "test", + request: async (_, config) => config, + }; + zodios.use(plugin); + zodios.eject("test"); + // @ts-ignore + expect(zodios.endpointPlugins.get("any-any").count()).toBe(1); + }); + + it("should throw if invalide parameters when registering a plugin", () => { + const zodios = new Zodios(`http://localhost:${port}`, []); + // @ts-ignore + expect(() => zodios.use(0)).toThrowError("Zodios: invalid plugin"); + }); + + it("should throw if invalid alias when registering a plugin", () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/:id", + alias: "test", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + expect(() => + // @ts-ignore + zodios.use("tests", { + // @ts-ignore + request: async (_, config) => config, + }) + ).toThrowError("Zodios: no alias 'tests' found to register plugin"); + }); + + it("should throw if invalid endpoint when registering a plugin", () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/:id", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + expect(() => + // @ts-ignore + zodios.use("get", "/test/:id", { + // @ts-ignore + request: async (_, config) => config, + }) + ).toThrowError( + "Zodios: no endpoint 'get /test/:id' found to register plugin" + ); + }); + + it("should register a plugin by endpoint", () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/:id", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + zodios.use("get", "/:id", { + request: async (_, config) => config, + }); + // @ts-ignore + expect(zodios.endpointPlugins.get("get-/:id").count()).toBe(1); + }); + + it("should register a plugin by alias", () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/:id", + alias: "test", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + zodios.use("test", { + request: async (_, config) => config, + }); + // @ts-ignore + expect(zodios.endpointPlugins.get("get-/:id").count()).toBe(1); + }); + + it("should make an http request", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/:id", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + { + method: "get", + path: "/users", + response: z.array( + z.object({ + id: z.number(), + name: z.string(), + }) + ), + }, + ]); + const response = await zodios.request({ + method: "get", + url: "/:id", + params: { id: 7 }, + }); + expect(response).toEqual({ id: 7, name: "test" }); + }); + + it("should make an http get with standard query arrays", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/queries", + parameters: [ + { + name: "id", + type: "Query", + schema: z.array(z.number()), + }, + ], + response: z.object({ + queries: z.array(z.string()), + }), + }, + ]); + const response = await zodios.get("/queries", { queries: { id: [1, 2] } }); + expect(response).toEqual({ queries: ["1", "2"] }); + }); + + it("should make an http get with one path params", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/:id", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + const response = await zodios.get("/:id", { params: { id: 7 } }); + expect(response).toEqual({ id: 7, name: "test" }); + }); + + it("should make an http alias request with one path params", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/:id", + alias: "getById", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + const response = await zodios.getById({ params: { id: 7 } }); + expect(response).toEqual({ id: 7, name: "test" }); + }); + + it("should work with api builder", async () => { + const api = apiBuilder({ + method: "get", + path: "/:id", + alias: "getById", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }).build(); + const zodios = new Zodios(`http://localhost:${port}`, api); + const response = await zodios.getById({ params: { id: 7 } }); + expect(response).toEqual({ id: 7, name: "test" }); + }); + + it("should make a get request with forgotten params and get back a zod error", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/:id", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + try { + // @ts-ignore + await zodios.get("/:id"); + } catch (e) { + expect(e).toBeInstanceOf(ZodiosError); + } + }); + + it("should make an http get with multiples path params", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/:id/address/:address", + response: z.object({ + id: z.number(), + address: z.string(), + }), + }, + ]); + const response = await zodios.get("/:id/address/:address", { + params: { id: 7, address: "address" }, + }); + expect(response).toEqual({ id: 7, address: "address" }); + }); + + it("should make an http post with body param", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "post", + path: "/", + parameters: [ + { + name: "name", + type: "Body", + schema: z.object({ + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + const response = await zodios.post("/", { body: { name: "post" } }); + expect(response).toEqual({ id: 3, name: "post" }); + }); + + it("should make an http post with transformed body param", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "post", + path: "/", + parameters: [ + { + name: "name", + type: "Body", + schema: z + .object({ + firstname: z.string(), + lastname: z.string(), + }) + .transform((data) => ({ + name: `${data.firstname} ${data.lastname}`, + })), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + const config = { + method: "post", + url: "/", + body: { firstname: "post", lastname: "test" }, + } as const; + const response = await zodios.request(config); + expect(config).toEqual({ + method: "post", + url: "/", + body: { firstname: "post", lastname: "test" }, + }); + expect(response).toEqual({ id: 3, name: "post test" }); + }); + + it("should throw a zodios error if params are not correct", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "post", + path: "/", + parameters: [ + { + name: "name", + type: "Body", + schema: z + .object({ + email: z.string().email(), + }) + .transform((data) => ({ + name: `${data.email.split("@")[0]}`, + })), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + let response; + let error: ZodiosError | undefined; + try { + response = await zodios.post("/", { + body: { + email: "post", + }, + }); + } catch (err) { + error = err as ZodiosError; + } + expect(response).toBeUndefined(); + expect(error).toBeInstanceOf(ZodiosError); + expect(error!.cause).toBeInstanceOf(ZodError); + expect(error!.message).toBe("Zodios: Invalid Body parameter 'name'"); + }); + + it("should make an http mutation alias request with body param", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "post", + path: "/", + alias: "create", + parameters: [ + { + name: "name", + type: "Body", + schema: z.object({ + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + const response = await zodios.create({ body: { name: "post" } }); + expect(response).toEqual({ id: 3, name: "post" }); + }); + + it("should make an http put", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "put", + path: "/", + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + const response = await zodios.put("/", { body: { id: 5, name: "put" } }); + expect(response).toEqual({ id: 5, name: "put" }); + }); + + it("should make an http put alias", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "put", + path: "/", + alias: "update", + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + const response = await zodios.update({ body: { id: 5, name: "put" } }); + expect(response).toEqual({ id: 5, name: "put" }); + }); + + it("should make an http patch", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "patch", + path: "/", + parameters: [ + { + name: "id", + type: "Body", + schema: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + const response = await zodios.patch("/", { + body: { id: 4, name: "patch" }, + }); + expect(response).toEqual({ id: 4, name: "patch" }); + }); + + it("should make an http patch alias", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "patch", + path: "/", + alias: "update", + parameters: [ + { + name: "id", + type: "Body", + schema: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + const response = await zodios.update({ body: { id: 4, name: "patch" } }); + expect(response).toEqual({ id: 4, name: "patch" }); + }); + + it("should make an http delete", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "delete", + path: "/:id", + response: z.object({ + id: z.number(), + }), + }, + ]); + const response = await zodios.delete("/:id", { + params: { id: 6 }, + }); + expect(response).toEqual({ id: 6 }); + }); + + it("should make an http delete alias", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "delete", + path: "/:id", + alias: "remove", + response: z.object({ + id: z.number(), + }), + }, + ]); + const response = await zodios.remove({ + params: { id: 6 }, + }); + expect(response).toEqual({ id: 6 }); + }); + + it("should validate uuid in path params", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/path/:uuid", + parameters: [ + { + name: "uuid", + type: "Path", + schema: z.string().uuid(), + }, + ], + response: z.object({ + uuid: z.string(), + }), + }, + ]); + const response = await zodios.get("/path/:uuid", { + params: { uuid: "e9e09a1d-3967-4518-bc89-75a901aee128" }, + }); + expect(response).toEqual({ + uuid: "e9e09a1d-3967-4518-bc89-75a901aee128", + }); + }); + + it("should not validate bad path params", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/path/:uuid", + parameters: [ + { + name: "uuid", + type: "Path", + schema: z.string().uuid(), + }, + ], + response: z.object({ + uuid: z.string(), + }), + }, + ]); + let error; + try { + await zodios.get("/path/:uuid", { + params: { uuid: "e9e09a1-3967-4518-bc89-75a901aee128" }, + }); + } catch (e) { + error = e; + } + expect(error).toBeInstanceOf(ZodiosError); + expect((error as ZodiosError).cause).toBeInstanceOf(ZodError); + expect((error as ZodiosError).message).toBe( + "Zodios: Invalid Path parameter 'uuid'" + ); + }); + + it("should not validate bad formatted responses", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/:id", + response: z.object({ + id: z.number(), + name: z.string(), + more: z.string(), + }), + }, + ]); + try { + await zodios.get("/:id", { params: { id: 1 } }); + } catch (e) { + expect(e).toBeInstanceOf(ZodiosError); + expect((e as ZodiosError).cause).toBeInstanceOf(ZodError); + expect((e as ZodiosError).message) + .toBe(`Zodios: Invalid response from endpoint 'get /:id' +status: 200 OK +cause: +[ + { + "code": "invalid_type", + "expected": "string", + "received": "undefined", + "path": [ + "more" + ], + "message": "Required" + } +] +received: +{ + "id": 1, + "name": "test" +}`); + expect((e as ZodiosError).data).toEqual({ + id: 1, + name: "test", + }); + expect((e as ZodiosError).config).toEqual({ + method: "get", + url: "/:id", + params: { id: 1 }, + }); + } + }); + + it("should match Expected error", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + alias: "getError502", + path: "/error502", + response: z.void(), + errors: [ + { + status: 502, + schema: z.object({ + error: z.object({ + message: z.string(), + }), + }), + }, + { + status: 401, + schema: z.object({ + error: z.object({ + message: z.string(), + _401: z.literal(true), + }), + }), + }, + { + status: "default", + schema: z.object({ + error: z.object({ + message: z.string(), + _default: z.literal(true), + }), + }), + }, + ], + }, + ]); + let error; + try { + await zodios.get("/error502"); + } catch (e) { + error = e; + } + expect(error).toBeInstanceOf(Error); + expect((error as AxiosError).response?.status).toBe(502); + if (zodios.isErrorFromPath(zodios.api, "get", "/error502", error)) { + expect(error.response.status).toBe(502); + if (error.response.status === 502) { + const data = error.response.data; + const test: Assert = true; + } + expect(error.response?.data).toEqual({ + error: { message: "bad gateway" }, + }); + } + if (zodios.isErrorFromAlias(zodios.api, "getError502", error)) { + expect(error.response.status).toBe(502); + if (error.response.status === 502) { + const data = error.response.data; + // ^? + const test: Assert = true; + } else if (error.response.status === 401) { + const data = error.response.data; + // ^? + const test: Assert< + typeof data, + { error: { message: string; _401: true } } + > = true; + } else { + const testStatus = error.response.status; + // ^? + const data = error.response.data; + // ^? + const test: Assert< + typeof data, + { error: { message: string; _default: true } } + > = true; + } + expect(error.response?.data).toEqual({ + error: { message: "bad gateway" }, + }); + } + }); + + it("should match Unexpected error", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + alias: "getError502", + path: "/error502", + response: z.void(), + }, + ]); + let error; + try { + await zodios.get("/error502"); + } catch (e) { + error = e; + } + + expect(error).toBeInstanceOf(Error); + expect((error as AxiosError).response?.status).toBe(502); + expect(zodios.isErrorFromPath(zodios.api, "get", "/error502", error)).toBe( + false + ); + expect(zodios.isErrorFromAlias(zodios.api, "getError502", error)).toBe( + false + ); + }); + + it("should return response when disabling validation", async () => { + const zodios = new Zodios( + `http://localhost:${port}`, + [ + { + method: "get", + path: "/:id", + response: z.object({ + id: z.number(), + name: z.string(), + more: z.string(), + }), + }, + ], + { validate: false } + ); + const response = await zodios.get("/:id", { params: { id: 1 } }); + expect(response).toEqual({ + id: 1, + name: "test", + }); + }); + + it("should trigger an axios error with error response", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/error502", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + try { + await zodios.get("/error502"); + } catch (e) { + expect((e as AxiosError).response?.data).toEqual({ + error: { + message: "bad gateway", + }, + }); + } + }); + + it("should send a form data request", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "post", + path: "/form-data", + requestFormat: "form-data", + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.string(), + name: z.string(), + }), + }, + ]); + const response = await zodios.post("/form-data", { + body: { id: 4, name: "post" }, + }); + expect(response).toEqual({ id: "4", name: "post" }); + }); + + it("should send a form data request a second time under 100 ms", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "post", + path: "/form-data", + requestFormat: "form-data", + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ + id: z.string(), + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.string(), + name: z.string(), + }), + }, + ]); + const response = await zodios.post("/form-data", { + // @ts-ignore + body: { id: "4", name: "post" }, + }); + expect(response).toEqual({ id: "4", name: "post" }); + }, 100); + + it("should not send an array as form data request", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "post", + path: "/form-data", + requestFormat: "form-data", + parameters: [ + { + name: "body", + type: "Body", + schema: z.array(z.string()), + }, + ], + response: z.string(), + }, + ]); + let error: Error | undefined; + let response: string | undefined; + try { + response = await zodios.post("/form-data", { body: ["test", "test2"] }); + } catch (err) { + error = err as Error; + } + expect(response).toBeUndefined(); + expect(error).toBeInstanceOf(ZodiosError); + expect((error as ZodiosError).message).toBe( + "Zodios: multipart/form-data body must be an object" + ); + }); + + it("should send a form url request", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "post", + path: "/form-url", + requestFormat: "form-url", + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.string(), + name: z.string(), + }), + }, + ]); + const response = await zodios.post("/form-url", { + body: { id: 4, name: "post" }, + }); + expect(response).toEqual({ id: "4", name: "post" }); + }); + + it("should not send an array as form url request", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "post", + path: "/form-url", + requestFormat: "form-url", + parameters: [ + { + name: "body", + type: "Body", + schema: z.array(z.string()), + }, + ], + response: z.string(), + }, + ]); + let error: Error | undefined; + let response: string | undefined; + try { + response = await zodios.post("/form-url", { body: ["test", "test2"] }); + } catch (err) { + error = err as Error; + } + expect(response).toBeUndefined(); + expect(error).toBeInstanceOf(ZodiosError); + expect((error as ZodiosError).message).toBe( + "Zodios: application/x-www-form-urlencoded body must be an object" + ); + }); + + it("should send a text request", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "post", + path: "/text", + requestFormat: "text", + parameters: [ + { + name: "body", + type: "Body", + schema: z.string(), + }, + ], + response: z.string(), + }, + ]); + const response = await zodios.post("/text", { body: "test" }); + expect(response).toEqual("test"); + }); +}); diff --git a/packages/fetch/src/zodios.ts b/packages/fetch/src/zodios.ts new file mode 100644 index 00000000..c8b748cc --- /dev/null +++ b/packages/fetch/src/zodios.ts @@ -0,0 +1,54 @@ +import { Narrow } from "@zodios/core/lib/utils.types"; +import type { + ZodiosEndpointDefinitions, + ZodiosOptions, + AnyZodiosTypeProvider, + TypeOfFetcherOptions, + ZodiosInstance, + ZodTypeProvider, +} from "@zodios/core"; +import { ZodiosCore } from "@zodios/core"; +import { fetchProvider, FetchProvider } from "./fetch-provider"; + +function ZodiosFetch(...args: any[]) { + if (args.length !== 0) { + let options: ZodiosOptions = args[args.length - 1]; + if (!Array.isArray(options) && typeof options === "object") { + args[args.length - 1] = { ...options, fetcherProvider: fetchProvider }; + } else { + args.push({ fetcherProvider: fetchProvider }); + } + } + // @ts-ignore + return new ZodiosCore(...args); +} + +export interface Zodios { + new < + Api extends ZodiosEndpointDefinitions, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider + >( + api: Narrow, + options?: Omit< + ZodiosOptions, + "fetcherProvider" + > & + TypeOfFetcherOptions + ): ZodiosInstance; + new < + Api extends ZodiosEndpointDefinitions, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider + >( + baseUrl: string, + api: Narrow, + options?: Omit< + ZodiosOptions, + "fetcherProvider" + > & + TypeOfFetcherOptions + ): ZodiosInstance; +} + +const Zodios = ZodiosFetch as unknown as Zodios; + +export { Zodios }; diff --git a/packages/fetch/tsconfig.build.json b/packages/fetch/tsconfig.build.json new file mode 100644 index 00000000..3add8009 --- /dev/null +++ b/packages/fetch/tsconfig.build.json @@ -0,0 +1,17 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "target": "ES6", + "sourceMap": false + }, + "exclude": [ + "node_modules", + "lib", + "examples", + "website", + "**/*.config.ts", + "**/*.spec.ts", + "**/*.test.ts", + "**/*.d.ts" + ] +} diff --git a/packages/fetch/tsconfig.json b/packages/fetch/tsconfig.json new file mode 100644 index 00000000..4f66f56f --- /dev/null +++ b/packages/fetch/tsconfig.json @@ -0,0 +1,18 @@ +{ + // ts config for es 2021 + "compilerOptions": { + "target": "ES2019", + "module": "CommonJS", + "moduleResolution": "Node", + "lib": ["ES2019"], + "outDir": "./lib", + "alwaysStrict": true, + "strict": true, + "esModuleInterop": true, + "sourceMap": true, + "declaration": true, + "jsx": "react-jsx", + "types": ["jest", "node"] + }, + "exclude": ["node_modules", "lib"] +} diff --git a/packages/fetch/tsup.config.js b/packages/fetch/tsup.config.js new file mode 100644 index 00000000..899d5e3f --- /dev/null +++ b/packages/fetch/tsup.config.js @@ -0,0 +1,14 @@ +import { defineConfig } from "tsup"; + +export default defineConfig({ + clean: true, + dts: true, + entry: ["src/index.ts"], + outDir: "lib", + format: ["cjs", "esm"], + minify: true, + treeshake: true, + tsconfig: "tsconfig.build.json", + splitting: true, + sourcemap: false, +}); From 42f473a0924b616d1096c9946b30b817ab168abb Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Tue, 22 Nov 2022 01:02:32 +0100 Subject: [PATCH 058/206] RELEASING: Releasing 3 package(s) Releases: @zodios/axios@11.0.0-beta.6 @zodios/core@11.0.0-beta.6 @zodios/fetch@11.0.0-beta.6 [skip ci] --- packages/axios/CHANGELOG.md | 13 +++++++++++++ packages/axios/package.json | 2 +- packages/core/CHANGELOG.md | 7 +++++++ packages/core/package.json | 2 +- packages/fetch/CHANGELOG.md | 13 +++++++++++++ packages/fetch/package.json | 2 +- 6 files changed, 36 insertions(+), 3 deletions(-) diff --git a/packages/axios/CHANGELOG.md b/packages/axios/CHANGELOG.md index 630cfa5d..565ec0d8 100644 --- a/packages/axios/CHANGELOG.md +++ b/packages/axios/CHANGELOG.md @@ -1,5 +1,18 @@ # @zodios/core +## 11.0.0-beta.6 + +### Major Changes + +- da4ddab: add fetch package +- 535c76b: add basic mocks helpers + +### Patch Changes + +- Updated dependencies [da4ddab] +- Updated dependencies [535c76b] + - @zodios/core@11.0.0-beta.6 + ## 11.0.0-beta.5 ### Major Changes diff --git a/packages/axios/package.json b/packages/axios/package.json index fe24a678..01ea6e2d 100644 --- a/packages/axios/package.json +++ b/packages/axios/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/axios", "description": "Typescript API client with axios", - "version": "11.0.0-beta.5", + "version": "11.0.0-beta.6", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 3d7ccea6..dce7b92c 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,12 @@ # @zodios/core +## 11.0.0-beta.6 + +### Major Changes + +- da4ddab: add fetch package +- 535c76b: add basic mocks helpers + ## 11.0.0-beta.5 ### Major Changes diff --git a/packages/core/package.json b/packages/core/package.json index 79966410..bbe9e150 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/core", "description": "Typescript API client with autocompletion and zod validations", - "version": "11.0.0-beta.5", + "version": "11.0.0-beta.6", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", diff --git a/packages/fetch/CHANGELOG.md b/packages/fetch/CHANGELOG.md index 630cfa5d..565ec0d8 100644 --- a/packages/fetch/CHANGELOG.md +++ b/packages/fetch/CHANGELOG.md @@ -1,5 +1,18 @@ # @zodios/core +## 11.0.0-beta.6 + +### Major Changes + +- da4ddab: add fetch package +- 535c76b: add basic mocks helpers + +### Patch Changes + +- Updated dependencies [da4ddab] +- Updated dependencies [535c76b] + - @zodios/core@11.0.0-beta.6 + ## 11.0.0-beta.5 ### Major Changes diff --git a/packages/fetch/package.json b/packages/fetch/package.json index 2054a71c..263ab7ac 100644 --- a/packages/fetch/package.json +++ b/packages/fetch/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/fetch", "description": "Typescript API client with fetch", - "version": "11.0.0-beta.5", + "version": "11.0.0-beta.6", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", From c87dce319b2d00cec9382437d7a27e06f6065509 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Tue, 22 Nov 2022 01:15:30 +0100 Subject: [PATCH 059/206] docs(changeset): chore(fetch): fix deps --- .changeset/pre.json | 5 +++- .changeset/tasty-bags-happen.md | 7 +++++ packages/fetch/package.json | 5 ++-- pnpm-lock.yaml | 47 ++++++++++++++++++++++++++------- 4 files changed, 52 insertions(+), 12 deletions(-) create mode 100644 .changeset/tasty-bags-happen.md diff --git a/.changeset/pre.json b/.changeset/pre.json index 9756d449..4280724f 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -3,10 +3,13 @@ "tag": "beta", "initialVersions": { "@zodios/core": "11.0.0-beta.0", - "@zodios/axios": "11.0.0-beta.0" + "@zodios/axios": "11.0.0-beta.0", + "@zodios/fetch": "11.0.0-beta.5" }, "changesets": [ + "blue-hounds-sort", "lucky-brooms-fry", + "short-hounds-mix", "silent-garlics-scream" ] } diff --git a/.changeset/tasty-bags-happen.md b/.changeset/tasty-bags-happen.md new file mode 100644 index 00000000..116d6243 --- /dev/null +++ b/.changeset/tasty-bags-happen.md @@ -0,0 +1,7 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +--- + +chore(fetch): fix deps diff --git a/packages/fetch/package.json b/packages/fetch/package.json index 263ab7ac..996e53f9 100644 --- a/packages/fetch/package.json +++ b/packages/fetch/package.json @@ -64,12 +64,12 @@ "@types/node": "18.11.9", "@types/qs": "6.9.7", "axios": "1.1.3", + "cross-fetch": "^3.1.5", "express": "4.18.2", "fp-ts": "2.13.1", "io-ts": "2.2.19", "jest": "29.3.0", "multer": "1.4.5-lts.1", - "qs": "6.11.0", "rimraf": "3.0.2", "ts-jest": "29.0.3", "ts-node": "10.9.1", @@ -78,6 +78,7 @@ "zod": "3.19.1" }, "dependencies": { - "@zodios/core": "workspace:*" + "@zodios/core": "workspace:*", + "qs": "6.11.0" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 55134b78..ba0aea72 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -96,6 +96,7 @@ importers: '@types/qs': 6.9.7 '@zodios/core': workspace:* axios: 1.1.3 + cross-fetch: ^3.1.5 express: 4.18.2 fp-ts: 2.13.1 io-ts: 2.2.19 @@ -110,6 +111,7 @@ importers: zod: 3.19.1 dependencies: '@zodios/core': link:../core + qs: 6.11.0 devDependencies: '@jest/globals': 29.3.1 '@jest/types': 29.3.1 @@ -119,12 +121,12 @@ importers: '@types/node': 18.11.9 '@types/qs': 6.9.7 axios: 1.1.3 + cross-fetch: 3.1.5 express: 4.18.2 fp-ts: 2.13.1 io-ts: 2.2.19_fp-ts@2.13.1 jest: 29.3.0_odkjkoia5xunhxkdrka32ib6vi multer: 1.4.5-lts.1 - qs: 6.11.0 rimraf: 3.0.2 ts-jest: 29.0.3_rhbpodbq4tgi7dsfkb4juhkp3y ts-node: 10.9.1_wup25etrarvlqkprac7h35hj7u @@ -1499,7 +1501,6 @@ packages: dependencies: function-bind: 1.1.1 get-intrinsic: 1.1.3 - dev: true /callsites/3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} @@ -1693,6 +1694,14 @@ packages: resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} dev: true + /cross-fetch/3.1.5: + resolution: {integrity: sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==} + dependencies: + node-fetch: 2.6.7 + transitivePeerDependencies: + - encoding + dev: true + /cross-spawn/5.1.0: resolution: {integrity: sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==} dependencies: @@ -2373,7 +2382,6 @@ packages: /function-bind/1.1.1: resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} - dev: true /function.prototype.name/1.1.5: resolution: {integrity: sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==} @@ -2405,7 +2413,6 @@ packages: function-bind: 1.1.1 has: 1.0.3 has-symbols: 1.0.3 - dev: true /get-package-type/0.1.0: resolution: {integrity: sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==} @@ -2507,7 +2514,6 @@ packages: /has-symbols/1.0.3: resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} engines: {node: '>= 0.4'} - dev: true /has-tostringtag/1.0.0: resolution: {integrity: sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==} @@ -2521,7 +2527,6 @@ packages: engines: {node: '>= 0.4.0'} dependencies: function-bind: 1.1.1 - dev: true /hosted-git-info/2.8.9: resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} @@ -3523,6 +3528,18 @@ packages: engines: {node: '>= 0.6'} dev: true + /node-fetch/2.6.7: + resolution: {integrity: sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==} + engines: {node: 4.x || >=6.0.0} + peerDependencies: + encoding: ^0.1.0 + peerDependenciesMeta: + encoding: + optional: true + dependencies: + whatwg-url: 5.0.0 + dev: true + /node-int64/0.4.0: resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==} dev: true @@ -3559,7 +3576,6 @@ packages: /object-inspect/1.12.2: resolution: {integrity: sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==} - dev: true /object-keys/1.1.1: resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} @@ -3799,7 +3815,6 @@ packages: engines: {node: '>=0.6'} dependencies: side-channel: 1.0.4 - dev: true /queue-microtask/1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} @@ -4068,7 +4083,6 @@ packages: call-bind: 1.0.2 get-intrinsic: 1.1.3 object-inspect: 1.12.2 - dev: true /signal-exit/3.0.7: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} @@ -4338,6 +4352,10 @@ packages: engines: {node: '>=0.6'} dev: true + /tr46/0.0.3: + resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} + dev: true + /tr46/1.0.1: resolution: {integrity: sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==} dependencies: @@ -4653,10 +4671,21 @@ packages: defaults: 1.0.4 dev: true + /webidl-conversions/3.0.1: + resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} + dev: true + /webidl-conversions/4.0.2: resolution: {integrity: sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==} dev: true + /whatwg-url/5.0.0: + resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} + dependencies: + tr46: 0.0.3 + webidl-conversions: 3.0.1 + dev: true + /whatwg-url/7.1.0: resolution: {integrity: sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==} dependencies: From 8fa0c23f100d85b2c69b7f9ca96e04eea86d48bd Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Tue, 22 Nov 2022 01:16:28 +0100 Subject: [PATCH 060/206] RELEASING: Releasing 3 package(s) Releases: @zodios/axios@11.0.0-beta.7 @zodios/core@11.0.0-beta.7 @zodios/fetch@11.0.0-beta.7 [skip ci] --- packages/axios/CHANGELOG.md | 11 +++++++++++ packages/axios/package.json | 2 +- packages/core/CHANGELOG.md | 6 ++++++ packages/core/package.json | 2 +- packages/fetch/CHANGELOG.md | 11 +++++++++++ packages/fetch/package.json | 2 +- 6 files changed, 31 insertions(+), 3 deletions(-) diff --git a/packages/axios/CHANGELOG.md b/packages/axios/CHANGELOG.md index 565ec0d8..c7e48ca0 100644 --- a/packages/axios/CHANGELOG.md +++ b/packages/axios/CHANGELOG.md @@ -1,5 +1,16 @@ # @zodios/core +## 11.0.0-beta.7 + +### Major Changes + +- 7dcbb0c: chore(fetch): fix deps + +### Patch Changes + +- Updated dependencies [7dcbb0c] + - @zodios/core@11.0.0-beta.7 + ## 11.0.0-beta.6 ### Major Changes diff --git a/packages/axios/package.json b/packages/axios/package.json index 01ea6e2d..bbe21e30 100644 --- a/packages/axios/package.json +++ b/packages/axios/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/axios", "description": "Typescript API client with axios", - "version": "11.0.0-beta.6", + "version": "11.0.0-beta.7", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index dce7b92c..adedd362 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,11 @@ # @zodios/core +## 11.0.0-beta.7 + +### Major Changes + +- 7dcbb0c: chore(fetch): fix deps + ## 11.0.0-beta.6 ### Major Changes diff --git a/packages/core/package.json b/packages/core/package.json index bbe9e150..a082bd97 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/core", "description": "Typescript API client with autocompletion and zod validations", - "version": "11.0.0-beta.6", + "version": "11.0.0-beta.7", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", diff --git a/packages/fetch/CHANGELOG.md b/packages/fetch/CHANGELOG.md index 565ec0d8..c7e48ca0 100644 --- a/packages/fetch/CHANGELOG.md +++ b/packages/fetch/CHANGELOG.md @@ -1,5 +1,16 @@ # @zodios/core +## 11.0.0-beta.7 + +### Major Changes + +- 7dcbb0c: chore(fetch): fix deps + +### Patch Changes + +- Updated dependencies [7dcbb0c] + - @zodios/core@11.0.0-beta.7 + ## 11.0.0-beta.6 ### Major Changes diff --git a/packages/fetch/package.json b/packages/fetch/package.json index 996e53f9..739ac230 100644 --- a/packages/fetch/package.json +++ b/packages/fetch/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/fetch", "description": "Typescript API client with fetch", - "version": "11.0.0-beta.6", + "version": "11.0.0-beta.7", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", From beca36b8ba5e3db6f5ae2dbb0330dfff502960d1 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Wed, 23 Nov 2022 20:24:17 +0100 Subject: [PATCH 061/206] docs(changeset): tests(core): fix tests --- .changeset/pre.json | 3 ++- .changeset/slimy-pugs-melt.md | 7 +++++++ packages/core/package.json | 4 ++-- packages/core/src/zodios.test.ts | 35 ++++++++++++++++++++++++++++--- packages/fetch/src/zodios.test.ts | 1 + pnpm-lock.yaml | 2 ++ 6 files changed, 46 insertions(+), 6 deletions(-) create mode 100644 .changeset/slimy-pugs-melt.md diff --git a/.changeset/pre.json b/.changeset/pre.json index 4280724f..5c6951a9 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -10,6 +10,7 @@ "blue-hounds-sort", "lucky-brooms-fry", "short-hounds-mix", - "silent-garlics-scream" + "silent-garlics-scream", + "tasty-bags-happen" ] } diff --git a/.changeset/slimy-pugs-melt.md b/.changeset/slimy-pugs-melt.md new file mode 100644 index 00000000..c66680b1 --- /dev/null +++ b/.changeset/slimy-pugs-melt.md @@ -0,0 +1,7 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +--- + +tests(core): fix tests diff --git a/packages/core/package.json b/packages/core/package.json index a082bd97..fc7d7677 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -59,6 +59,7 @@ "@jest/types": "29.3.1", "@types/jest": "29.2.2", "@types/node": "18.11.9", + "form-data": "^4.0.0", "fp-ts": "2.13.1", "io-ts": "2.2.19", "jest": "29.3.0", @@ -68,6 +69,5 @@ "tsup": "6.3.0", "typescript": "4.9.3", "zod": "3.19.1" - }, - "dependencies": {} + } } diff --git a/packages/core/src/zodios.test.ts b/packages/core/src/zodios.test.ts index 78add76c..3b377fbf 100644 --- a/packages/core/src/zodios.test.ts +++ b/packages/core/src/zodios.test.ts @@ -1,7 +1,36 @@ -if (globalThis.FormData === undefined) { - globalThis.FormData = require("form-data"); -} import { z, ZodError } from "zod"; + +//Mock form data +globalThis.FormData = class FormData { + data = new Map(); + append(name: string, value: string | Blob, fileName?: string): void { + this.data.set(name, `${value}`); + } + delete(name: string): void { + this.data.delete(name); + } + get(name: string): string | File | null { + return this.data.get(name) || null; + } + getAll(name: string): (string | File)[] { + return this.data.has(name) ? [this.data.get(name)!] : []; + } + has(name: string): boolean { + return this.data.has(name); + } + set(name: string, value: string | Blob, fileName?: string): void { + if (typeof value === "string") { + this.data.set(name, value); + } + } + forEach( + callbackfn: (value: string | File, key: string, parent: FormData) => void, + thisArg?: any + ): void { + this.data.forEach((value, key) => callbackfn(value, key, this)); + } +}; + import { ZodiosCore } from "./zodios"; import { ZodiosError } from "./zodios-error"; import { ZodiosPlugin } from "./zodios.types"; diff --git a/packages/fetch/src/zodios.test.ts b/packages/fetch/src/zodios.test.ts index 459f758d..84e0da26 100644 --- a/packages/fetch/src/zodios.test.ts +++ b/packages/fetch/src/zodios.test.ts @@ -6,6 +6,7 @@ import { z, ZodError } from "zod"; if (globalThis.FormData === undefined) { globalThis.FormData = require("form-data"); } +import "cross-fetch/polyfill"; import { Zodios } from "./zodios"; import { ZodiosError, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ba0aea72..d0ea9295 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -61,6 +61,7 @@ importers: '@jest/types': 29.3.1 '@types/jest': 29.2.2 '@types/node': 18.11.9 + form-data: ^4.0.0 fp-ts: 2.13.1 io-ts: 2.2.19 jest: 29.3.0 @@ -75,6 +76,7 @@ importers: '@jest/types': 29.3.1 '@types/jest': 29.2.2 '@types/node': 18.11.9 + form-data: 4.0.0 fp-ts: 2.13.1 io-ts: 2.2.19_fp-ts@2.13.1 jest: 29.3.0_odkjkoia5xunhxkdrka32ib6vi From c503e7b8aa49891145b3fef42271ef4cddf81282 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Wed, 23 Nov 2022 21:35:10 +0100 Subject: [PATCH 062/206] docs(changeset): feat(fetch): remove qs dependency --- .changeset/polite-bugs-confess.md | 7 +++++ packages/fetch/package.json | 4 +-- .../fetch/src/fetch-provider/fetch.utils.ts | 27 +++++++++++++++---- packages/fetch/src/zodios.test.ts | 21 ++++++++++----- pnpm-lock.yaml | 12 ++++++--- 5 files changed, 53 insertions(+), 18 deletions(-) create mode 100644 .changeset/polite-bugs-confess.md diff --git a/.changeset/polite-bugs-confess.md b/.changeset/polite-bugs-confess.md new file mode 100644 index 00000000..f68777d6 --- /dev/null +++ b/.changeset/polite-bugs-confess.md @@ -0,0 +1,7 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +--- + +feat(fetch): remove qs dependency diff --git a/packages/fetch/package.json b/packages/fetch/package.json index 739ac230..d23e4c73 100644 --- a/packages/fetch/package.json +++ b/packages/fetch/package.json @@ -62,7 +62,6 @@ "@types/jest": "29.2.2", "@types/multer": "1.4.7", "@types/node": "18.11.9", - "@types/qs": "6.9.7", "axios": "1.1.3", "cross-fetch": "^3.1.5", "express": "4.18.2", @@ -78,7 +77,6 @@ "zod": "3.19.1" }, "dependencies": { - "@zodios/core": "workspace:*", - "qs": "6.11.0" + "@zodios/core": "workspace:*" } } diff --git a/packages/fetch/src/fetch-provider/fetch.utils.ts b/packages/fetch/src/fetch-provider/fetch.utils.ts index 801969ef..ca082fa0 100644 --- a/packages/fetch/src/fetch-provider/fetch.utils.ts +++ b/packages/fetch/src/fetch-provider/fetch.utils.ts @@ -1,4 +1,3 @@ -import qs from "qs"; import { AnyZodiosRequestOptions } from "@zodios/core"; import { FetchProvider } from "./fetcher-provider.fetch"; @@ -28,6 +27,27 @@ export const isFile = isKindOf("File"); // istanbul ignore next export const isSearchParams = isKindOf("URLSearchParams"); +function queriesToSearchString( + queries?: Record +): string | undefined { + if (queries) { + const searchParams = new URLSearchParams(); + Object.entries(queries).forEach(([key, value]) => { + if (Array.isArray(value)) { + value.forEach((v) => + searchParams.append(`${key}[]`, JSON.stringify(v)) + ); + } else if (typeof value === "string") { + searchParams.append(key, value); + } else { + searchParams.append(key, JSON.stringify(value)); + } + }); + return searchParams.toString(); + } + return ""; +} + // istanbul ignore next function getFullURL(config: AnyZodiosRequestOptions) { if (config.url?.startsWith("http") || !config.baseURL) { @@ -43,10 +63,7 @@ function getFullURL(config: AnyZodiosRequestOptions) { export function buildURL(config: AnyZodiosRequestOptions) { let fullURL = getFullURL(config) || "/"; - const serializedParams = qs.stringify(config.queries, { - arrayFormat: "brackets", - encodeValuesOnly: true, - }); + const serializedParams = queriesToSearchString(config.queries); if (serializedParams) { fullURL += fullURL.indexOf("?") === -1 ? "?" : "&"; } diff --git a/packages/fetch/src/zodios.test.ts b/packages/fetch/src/zodios.test.ts index 84e0da26..5ec63fa7 100644 --- a/packages/fetch/src/zodios.test.ts +++ b/packages/fetch/src/zodios.test.ts @@ -16,7 +16,6 @@ import { } from "@zodios/core"; import multer from "multer"; import { Assert } from "@zodios/core/lib/utils.types"; -import { FetchProvider } from "./fetch-provider"; const multipart = multer({ storage: multer.memoryStorage() }); @@ -42,7 +41,7 @@ describe("Zodios", () => { }); app.get("/queries", (req, res) => { res.status(200).json({ - queries: req.query.id, + queries: req.query, }); }); app.get("/:id", (req, res) => { @@ -340,18 +339,28 @@ describe("Zodios", () => { path: "/queries", parameters: [ { - name: "id", + name: "ids", type: "Query", schema: z.array(z.number()), }, + { + name: "q", + type: "Query", + schema: z.string(), + }, ], response: z.object({ - queries: z.array(z.string()), + queries: z.object({ + ids: z.array(z.string()), + q: z.string(), + }), }), }, ]); - const response = await zodios.get("/queries", { queries: { id: [1, 2] } }); - expect(response).toEqual({ queries: ["1", "2"] }); + const response = await zodios.get("/queries", { + queries: { ids: [1, 2], q: "hello" }, + }); + expect(response).toEqual({ queries: { ids: ["1", "2"], q: "hello" } }); }); it("should make an http get with one path params", async () => { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d0ea9295..dbb7ada2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -95,7 +95,6 @@ importers: '@types/jest': 29.2.2 '@types/multer': 1.4.7 '@types/node': 18.11.9 - '@types/qs': 6.9.7 '@zodios/core': workspace:* axios: 1.1.3 cross-fetch: ^3.1.5 @@ -104,7 +103,6 @@ importers: io-ts: 2.2.19 jest: 29.3.0 multer: 1.4.5-lts.1 - qs: 6.11.0 rimraf: 3.0.2 ts-jest: 29.0.3 ts-node: 10.9.1 @@ -113,7 +111,6 @@ importers: zod: 3.19.1 dependencies: '@zodios/core': link:../core - qs: 6.11.0 devDependencies: '@jest/globals': 29.3.1 '@jest/types': 29.3.1 @@ -121,7 +118,6 @@ importers: '@types/jest': 29.2.2 '@types/multer': 1.4.7 '@types/node': 18.11.9 - '@types/qs': 6.9.7 axios: 1.1.3 cross-fetch: 3.1.5 express: 4.18.2 @@ -1503,6 +1499,7 @@ packages: dependencies: function-bind: 1.1.1 get-intrinsic: 1.1.3 + dev: true /callsites/3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} @@ -2384,6 +2381,7 @@ packages: /function-bind/1.1.1: resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} + dev: true /function.prototype.name/1.1.5: resolution: {integrity: sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==} @@ -2415,6 +2413,7 @@ packages: function-bind: 1.1.1 has: 1.0.3 has-symbols: 1.0.3 + dev: true /get-package-type/0.1.0: resolution: {integrity: sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==} @@ -2516,6 +2515,7 @@ packages: /has-symbols/1.0.3: resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} engines: {node: '>= 0.4'} + dev: true /has-tostringtag/1.0.0: resolution: {integrity: sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==} @@ -2529,6 +2529,7 @@ packages: engines: {node: '>= 0.4.0'} dependencies: function-bind: 1.1.1 + dev: true /hosted-git-info/2.8.9: resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} @@ -3578,6 +3579,7 @@ packages: /object-inspect/1.12.2: resolution: {integrity: sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==} + dev: true /object-keys/1.1.1: resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} @@ -3817,6 +3819,7 @@ packages: engines: {node: '>=0.6'} dependencies: side-channel: 1.0.4 + dev: true /queue-microtask/1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} @@ -4085,6 +4088,7 @@ packages: call-bind: 1.0.2 get-intrinsic: 1.1.3 object-inspect: 1.12.2 + dev: true /signal-exit/3.0.7: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} From 423a1b1831c0246a975b2ec573bc63d8957e6f1c Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Wed, 23 Nov 2022 21:37:17 +0100 Subject: [PATCH 063/206] RELEASING: Releasing 3 package(s) Releases: @zodios/axios@11.0.0-beta.8 @zodios/core@11.0.0-beta.8 @zodios/fetch@11.0.0-beta.8 [skip ci] --- packages/axios/CHANGELOG.md | 13 +++++++++++++ packages/axios/package.json | 2 +- packages/core/CHANGELOG.md | 7 +++++++ packages/core/package.json | 2 +- packages/fetch/CHANGELOG.md | 13 +++++++++++++ packages/fetch/package.json | 2 +- 6 files changed, 36 insertions(+), 3 deletions(-) diff --git a/packages/axios/CHANGELOG.md b/packages/axios/CHANGELOG.md index c7e48ca0..4ecc944b 100644 --- a/packages/axios/CHANGELOG.md +++ b/packages/axios/CHANGELOG.md @@ -1,5 +1,18 @@ # @zodios/core +## 11.0.0-beta.8 + +### Major Changes + +- e67fa49: feat(fetch): remove qs dependency +- 731e399: tests(core): fix tests + +### Patch Changes + +- Updated dependencies [e67fa49] +- Updated dependencies [731e399] + - @zodios/core@11.0.0-beta.8 + ## 11.0.0-beta.7 ### Major Changes diff --git a/packages/axios/package.json b/packages/axios/package.json index bbe21e30..45ff7f13 100644 --- a/packages/axios/package.json +++ b/packages/axios/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/axios", "description": "Typescript API client with axios", - "version": "11.0.0-beta.7", + "version": "11.0.0-beta.8", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index adedd362..0863c179 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,12 @@ # @zodios/core +## 11.0.0-beta.8 + +### Major Changes + +- e67fa49: feat(fetch): remove qs dependency +- 731e399: tests(core): fix tests + ## 11.0.0-beta.7 ### Major Changes diff --git a/packages/core/package.json b/packages/core/package.json index fc7d7677..19a386ca 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/core", "description": "Typescript API client with autocompletion and zod validations", - "version": "11.0.0-beta.7", + "version": "11.0.0-beta.8", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", diff --git a/packages/fetch/CHANGELOG.md b/packages/fetch/CHANGELOG.md index c7e48ca0..4ecc944b 100644 --- a/packages/fetch/CHANGELOG.md +++ b/packages/fetch/CHANGELOG.md @@ -1,5 +1,18 @@ # @zodios/core +## 11.0.0-beta.8 + +### Major Changes + +- e67fa49: feat(fetch): remove qs dependency +- 731e399: tests(core): fix tests + +### Patch Changes + +- Updated dependencies [e67fa49] +- Updated dependencies [731e399] + - @zodios/core@11.0.0-beta.8 + ## 11.0.0-beta.7 ### Major Changes diff --git a/packages/fetch/package.json b/packages/fetch/package.json index d23e4c73..63fec00b 100644 --- a/packages/fetch/package.json +++ b/packages/fetch/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/fetch", "description": "Typescript API client with fetch", - "version": "11.0.0-beta.7", + "version": "11.0.0-beta.8", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", From 7abce27356c1688eb0f655cba4568f242e65ef7d Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Wed, 23 Nov 2022 21:43:14 +0100 Subject: [PATCH 064/206] docs(changeset): chore(deps): upgrade axios --- .changeset/long-fans-dress.md | 7 +++++++ .changeset/pre.json | 2 ++ packages/axios/package.json | 2 +- pnpm-lock.yaml | 14 ++++++++++++-- 4 files changed, 22 insertions(+), 3 deletions(-) create mode 100644 .changeset/long-fans-dress.md diff --git a/.changeset/long-fans-dress.md b/.changeset/long-fans-dress.md new file mode 100644 index 00000000..9055b49e --- /dev/null +++ b/.changeset/long-fans-dress.md @@ -0,0 +1,7 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +--- + +chore(deps): upgrade axios diff --git a/.changeset/pre.json b/.changeset/pre.json index 5c6951a9..77526ed0 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -9,8 +9,10 @@ "changesets": [ "blue-hounds-sort", "lucky-brooms-fry", + "polite-bugs-confess", "short-hounds-mix", "silent-garlics-scream", + "slimy-pugs-melt", "tasty-bags-happen" ] } diff --git a/packages/axios/package.json b/packages/axios/package.json index 45ff7f13..52ac37af 100644 --- a/packages/axios/package.json +++ b/packages/axios/package.json @@ -63,7 +63,7 @@ "@types/jest": "29.2.2", "@types/multer": "1.4.7", "@types/node": "18.11.9", - "axios": "1.1.3", + "axios": "1.2.0", "express": "4.18.2", "fp-ts": "2.13.1", "io-ts": "2.2.19", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index dbb7ada2..62b8786f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -21,7 +21,7 @@ importers: '@types/multer': 1.4.7 '@types/node': 18.11.9 '@zodios/core': workspace:* - axios: 1.1.3 + axios: 1.2.0 express: 4.18.2 fp-ts: 2.13.1 io-ts: 2.2.19 @@ -42,7 +42,7 @@ importers: '@types/jest': 29.2.2 '@types/multer': 1.4.7 '@types/node': 18.11.9 - axios: 1.1.3 + axios: 1.2.0 express: 4.18.2 fp-ts: 2.13.1 io-ts: 2.2.19_fp-ts@2.13.1 @@ -1311,6 +1311,16 @@ packages: - debug dev: true + /axios/1.2.0: + resolution: {integrity: sha512-zT7wZyNYu3N5Bu0wuZ6QccIf93Qk1eV8LOewxgjOZFd2DenOs98cJ7+Y6703d0wkaXGY6/nZd4EweJaHz9uzQw==} + dependencies: + follow-redirects: 1.15.2 + form-data: 4.0.0 + proxy-from-env: 1.1.0 + transitivePeerDependencies: + - debug + dev: true + /babel-jest/29.3.1_@babel+core@7.20.2: resolution: {integrity: sha512-aard+xnMoxgjwV70t0L6wkW/3HQQtV+O0PEimxKgzNqCJnbYmroPojdP2tqKSOAt8QAKV/uSZU8851M7B5+fcA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} From e8022b356acee82adf4ab5045da786e94bb9f3ab Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Thu, 24 Nov 2022 14:40:15 +0100 Subject: [PATCH 065/206] feat(core): expose mock provider --- .../mock-provider/mock-provider.ts | 14 +++---- packages/core/src/index.ts | 5 ++- packages/core/src/zodios.test.ts | 7 +++- packages/core/src/zodios.types.ts | 40 +++++++++++++++++++ 4 files changed, 57 insertions(+), 9 deletions(-) diff --git a/packages/core/src/fetcher-providers/mock-provider/mock-provider.ts b/packages/core/src/fetcher-providers/mock-provider/mock-provider.ts index 15db7a24..b4bd65a1 100644 --- a/packages/core/src/fetcher-providers/mock-provider/mock-provider.ts +++ b/packages/core/src/fetcher-providers/mock-provider/mock-provider.ts @@ -5,21 +5,21 @@ import type { } from "../../index"; import { defaults } from "../default-provider"; -interface MockProvider extends AnyZodiosFetcherProvider { +export interface MockProvider extends AnyZodiosFetcherProvider { options: {}; config: { baseURL?: string; - body?: any; + body?: unknown; auth?: { username: string; password: string }; validateStatus?: (status: number) => boolean; timeout?: number; responseType?: "arraybuffer" | "blob" | "json" | "text" | "stream"; }; - response: any; - error: any; + response: unknown; + error: unknown; } -const mockProvider: ZodiosRuntimeFetcherProvider = { +export const mockProvider: ZodiosRuntimeFetcherProvider = { init() {}, async fetch(config: AnyZodiosRequestOptions) { const requestConfig = { @@ -50,11 +50,11 @@ const mockProvider: ZodiosRuntimeFetcherProvider = { }, }; -type MockResponse = { +export type MockResponse = { readonly headers?: Record; readonly status?: number; readonly statusText?: string; - readonly data?: any; + readonly data?: Data; }; export const zodiosMocks = { diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 2ccfdc3b..b1cb55b2 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -33,6 +33,8 @@ export type { ZodiosErrorForEndpoint, ZodiosErrorByPath, ZodiosErrorByAlias, + ZodiosErrorsByPath, + ZodiosErrorsByAlias, ZodiosEndpointDefinition, ZodiosEndpointDefinitions, ZodiosEndpointParameter, @@ -70,7 +72,8 @@ export type { TypeOfFetcherResponse, ZodiosRuntimeFetcherProvider, } from "./fetcher-providers"; -export { zodiosMocks } from "./fetcher-providers"; +export type { MockProvider, MockResponse } from "./fetcher-providers"; +export { zodiosMocks, mockProvider } from "./fetcher-providers"; export { PluginId, zodValidationPlugin, diff --git a/packages/core/src/zodios.test.ts b/packages/core/src/zodios.test.ts index 3b377fbf..82ce2bc0 100644 --- a/packages/core/src/zodios.test.ts +++ b/packages/core/src/zodios.test.ts @@ -90,18 +90,23 @@ describe("Zodios", () => { zodiosMocks.mockRequest("post", "/", async (config) => ({ data: { id: 3, - name: config.body!.name, + // @ts-ignore + name: config.body.name, // @ts-ignore }, })); zodiosMocks.mockRequest("put", "/", async (config) => ({ data: { + // @ts-ignore id: config.body.id, + // @ts-ignore name: config.body.name, }, })); zodiosMocks.mockRequest("patch", "/", async (config) => ({ data: { + // @ts-ignore id: config.body.id, + // @ts-ignore name: config.body.name, }, })); diff --git a/packages/core/src/zodios.types.ts b/packages/core/src/zodios.types.ts index ea2316cd..ae1ea034 100644 --- a/packages/core/src/zodios.types.ts +++ b/packages/core/src/zodios.types.ts @@ -200,6 +200,46 @@ export type ZodiosErrorByPath< > >; +export type ZodiosErrorsByPath< + Api extends ZodiosEndpointDefinition[], + M extends Method, + Path extends ZodiosPathsByMethod, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = Frontend extends true + ? InferOutputTypeFromSchema< + TypeProvider, + ZodiosEndpointDefinitionByPath< + Api, + M, + Path + >[number]["errors"][number]["schema"] + > + : InferInputTypeFromSchema< + TypeProvider, + ZodiosEndpointDefinitionByPath< + Api, + M, + Path + >[number]["errors"][number]["schema"] + >; + +export type ZodiosErrorsByAlias< + Api extends ZodiosEndpointDefinition[], + M extends Method, + Path extends ZodiosPathsByMethod, + Frontend extends boolean = true, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> = Frontend extends true + ? InferOutputTypeFromSchema< + TypeProvider, + ZodiosEndpointDefinitionByAlias[number]["errors"] + > + : InferInputTypeFromSchema< + TypeProvider, + ZodiosEndpointDefinitionByAlias[number]["errors"] + >; + export type InferFetcherErrors< T, TypeProvider extends AnyZodiosTypeProvider, From 2fe960f21bf25b1b8bc493171b0b06f869b9dde5 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Thu, 24 Nov 2022 14:41:01 +0100 Subject: [PATCH 066/206] docs(changeset): feat(testing): add testing package --- .changeset/nice-kids-attend.md | 8 + packages/testing/.gitignore | 105 +++++++++++ packages/testing/.npmignore | 40 +++++ packages/testing/CHANGELOG.md | 61 +++++++ packages/testing/LICENSE | 21 +++ packages/testing/README.md | 198 +++++++++++++++++++++ packages/testing/SECURITY.md | 20 +++ packages/testing/jest.config.ts | 24 +++ packages/testing/package.json | 58 +++++++ packages/testing/src/index.ts | 3 + packages/testing/src/zodios.test.ts | 250 +++++++++++++++++++++++++++ packages/testing/src/zodios.ts | 154 +++++++++++++++++ packages/testing/tsconfig.build.json | 17 ++ packages/testing/tsconfig.json | 18 ++ packages/testing/tsup.config.js | 14 ++ pnpm-lock.yaml | 34 ++++ 16 files changed, 1025 insertions(+) create mode 100644 .changeset/nice-kids-attend.md create mode 100644 packages/testing/.gitignore create mode 100644 packages/testing/.npmignore create mode 100644 packages/testing/CHANGELOG.md create mode 100644 packages/testing/LICENSE create mode 100644 packages/testing/README.md create mode 100644 packages/testing/SECURITY.md create mode 100644 packages/testing/jest.config.ts create mode 100644 packages/testing/package.json create mode 100644 packages/testing/src/index.ts create mode 100644 packages/testing/src/zodios.test.ts create mode 100644 packages/testing/src/zodios.ts create mode 100644 packages/testing/tsconfig.build.json create mode 100644 packages/testing/tsconfig.json create mode 100644 packages/testing/tsup.config.js diff --git a/.changeset/nice-kids-attend.md b/.changeset/nice-kids-attend.md new file mode 100644 index 00000000..9b877540 --- /dev/null +++ b/.changeset/nice-kids-attend.md @@ -0,0 +1,8 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +"@zodios/testing": major +--- + +feat(testing): add testing package diff --git a/packages/testing/.gitignore b/packages/testing/.gitignore new file mode 100644 index 00000000..9aadc156 --- /dev/null +++ b/packages/testing/.gitignore @@ -0,0 +1,105 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env +.env.test + +# parcel-bundler cache (https://parceljs.org/) +.cache + +# Next.js build output +.next + +# Nuxt.js build / generate output +.nuxt +dist +lib + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and *not* Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port diff --git a/packages/testing/.npmignore b/packages/testing/.npmignore new file mode 100644 index 00000000..e09f31c9 --- /dev/null +++ b/packages/testing/.npmignore @@ -0,0 +1,40 @@ +# compiled output +!/lib +/node_modules +/src +/examples +/website + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# OS +.DS_Store + +# Tests +/coverage +/.nyc_output + +# IDEs and editors +/.idea +.project +.classpath +.c9/ +*.launch +.settings/ +*.sublime-workspace + +# IDE - VSCode +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + +# ENV +.env diff --git a/packages/testing/CHANGELOG.md b/packages/testing/CHANGELOG.md new file mode 100644 index 00000000..0863c179 --- /dev/null +++ b/packages/testing/CHANGELOG.md @@ -0,0 +1,61 @@ +# @zodios/core + +## 11.0.0-beta.8 + +### Major Changes + +- e67fa49: feat(fetch): remove qs dependency +- 731e399: tests(core): fix tests + +## 11.0.0-beta.7 + +### Major Changes + +- 7dcbb0c: chore(fetch): fix deps + +## 11.0.0-beta.6 + +### Major Changes + +- da4ddab: add fetch package +- 535c76b: add basic mocks helpers + +## 11.0.0-beta.5 + +### Major Changes + +- 1b67309: fix axios tests +- c7c03bc: sync axios and core versions + +## 11.0.0-beta.4 + +### Major Changes + +- 6c10dc2: rename exports +- 679a267: update axios + +### Patch Changes + +- 14ce00b: add fetch implementation +- c9cae0a: autocommit on changesets +- 3ac25a1: add fetcher provider and axios impl +- 90108a5: body is now part of the config + +## 11.0.0-beta.3 + +### Patch Changes + +- add publish script +- 5575e28: add tests for type providers + +## 11.0.0-beta.2 + +### Patch Changes + +- remove publish action from ci + +## 11.0.0-beta.1 + +### Patch Changes + +- migrate to monorepo diff --git a/packages/testing/LICENSE b/packages/testing/LICENSE new file mode 100644 index 00000000..e5dea986 --- /dev/null +++ b/packages/testing/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 ecyrbe + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/testing/README.md b/packages/testing/README.md new file mode 100644 index 00000000..31105cd4 --- /dev/null +++ b/packages/testing/README.md @@ -0,0 +1,198 @@ +

Zodios

+

+ + Zodios logo + +

+

+ Zodios is a typescript api client and an optional api server with auto-completion features backed by axios and zod and express +
+ Documentation +

+ +

+ + langue typescript + + + npm + + + GitHub + + GitHub Workflow Status +

+ +https://user-images.githubusercontent.com/633115/185851987-554f5686-cb78-4096-8ff5-c8d61b645608.mp4 + +# What is it ? + +It's an axios compatible API client and an optional expressJS compatible API server with the following features: + +- really simple centralized API declaration +- typescript autocompletion in your favorite IDE for URL and parameters +- typescript response types +- parameters and responses schema thanks to zod +- response schema validation +- powerfull plugins like `fetch` adapter or `auth` automatic injection +- all axios features available +- `@tanstack/query` wrappers for react and solid (vue, svelte, etc, soon) +- all expressJS features available (middlewares, etc.) + + +**Table of contents:** + +- [What is it ?](#what-is-it-) +- [Install](#install) + - [Client and api definitions :](#client-and-api-definitions-) + - [Server :](#server-) +- [How to use it on client side ?](#how-to-use-it-on-client-side-) + - [Declare your API with zodios](#declare-your-api-with-zodios) + - [API definition format](#api-definition-format) +- [Full documentation](#full-documentation) +- [Ecosystem](#ecosystem) +- [Roadmap](#roadmap) +- [Dependencies](#dependencies) + +# Install + +## Client and api definitions : + +```bash +> npm install @zodios/core +``` + +or + +```bash +> yarn add @zodios/core +``` + +## Server : + +```bash +> npm install @zodios/core @zodios/express +``` + +or + +```bash +> yarn add @zodios/core @zodios/express +``` + +# How to use it on client side ? + +For an almost complete example on how to use zodios and how to split your APIs declarations, take a look at [dev.to](examples/dev.to/) example. + +## Declare your API with zodios + +Here is an example of API declaration with Zodios. + +```typescript +import { Zodios } from "@zodios/core"; +import { z } from "zod"; + +const apiClient = new Zodios( + "https://jsonplaceholder.typicode.com", + // API definition + [ + { + method: "get", + path: "/users/:id", // auto detect :id and ask for it in apiClient get params + alias: "getUser", // optionnal alias to call this endpoint with it + description: "Get a user", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], +); +``` + +Calling this API is now easy and has builtin autocomplete features : + +```typescript +// typed auto-complete path auto-complete params +// â–¼ â–¼ â–¼ +const user = await apiClient.get("/users/:id", { params: { id: 7 } }); +console.log(user); +``` + +It should output + +```js +{ id: 7, name: 'Kurtis Weissnat' } +``` +You can also use aliases : + +```typescript +// typed alias auto-complete params +// â–¼ â–¼ â–¼ +const user = await apiClient.getUser({ params: { id: 7 } }); +console.log(user); +``` +## API definition format + +```typescript +type ZodiosEndpointDescriptions = Array<{ + method: 'get'|'post'|'put'|'patch'|'delete'; + path: string; // example: /posts/:postId/comments/:commentId + alias?: string; // example: getPostComments + immutable?: boolean; // flag a post request as immutable to allow it to be cached with react-query + description?: string; + requestFormat?: 'json'|'form-data'|'form-url'|'binary'|'text'; // default to json if not set + parameters?: Array<{ + name: string; + description?: string; + type: 'Path'|'Query'|'Body'|'Header'; + schema: ZodSchema; // you can use zod `transform` to transform the value of the parameter before sending it to the server + }>; + response: ZodSchema; // you can use zod `transform` to transform the value of the response before returning it + status?: number; // default to 200, you can use this to override the sucess status code of the response (only usefull for openapi and express) + responseDescription?: string; // optional response description of the endpoint + errors?: Array<{ + status: number | 'default'; + description?: string; + schema: ZodSchema; // transformations are not supported on error schemas + }>; +}>; +``` +# Full documentation + +Check out the [full documentation](https://www.zodios.org) or following shortcuts. + +- [API definition](https://www.zodios.org/docs/category/zodios-api-definition) +- [Http client](https://www.zodios.org/docs/category/zodios-client) +- [React hooks](https://www.zodios.org/docs/client/react) +- [Solid hooks](https://www.zodios.org/docs/client/solid) +- [API server](http://www.zodios.org/docs/category/zodios-server) +- [Nextjs integration](http://www.zodios.org/docs/server/next) + +# Ecosystem + +- [openapi-zod-client](https://github.com/astahmer/openapi-zod-client): generate a zodios client from an openapi specification +- [@zodios/express](https://github.com/ecyrbe/zodios-express): full end to end type safety like tRPC, but for REST APIs +- [@zodios/plugins](https://github.com/ecyrbe/zodios-plugins) : some plugins for zodios +- [@zodios/react](https://github.com/ecyrbe/zodios-react) : a react-query wrapper for zodios +- [@zodios/solid](https://github.com/ecyrbe/zodios-solid) : a solid-query wrapper for zodios + +# Roadmap + +The following will need investigation to check if it's doable : +- implement `@zodios/nestjs` to define your API endpoints with nestjs and share it with your frontend (like tRPC) +- generate openAPI json from your API endpoints + +You have other ideas ? [Let me know !](https://github.com/ecyrbe/zodios/discussions) +# Dependencies + +Zodios even when working in pure Javascript is better suited to be working with Typescript Language Server to handle autocompletion. +So you should at least use the one provided by your IDE (vscode integrates a typescript language server) +However, we will only support fixing bugs related to typings for versions of Typescript Language v4.5 +Earlier versions should work, but do not have TS tail recusion optimisation that impact the size of the API you can declare. + +Also note that Zodios do not embed any dependency. It's your Job to install the peer dependencies you need. + +Internally Zodios uses these libraries on all platforms : +- zod +- axios diff --git a/packages/testing/SECURITY.md b/packages/testing/SECURITY.md new file mode 100644 index 00000000..16be6051 --- /dev/null +++ b/packages/testing/SECURITY.md @@ -0,0 +1,20 @@ +# Security Policy + +## Supported Versions + +Use this section to tell people about which versions of your project are +currently being supported with security updates. + +| Version | Supported | +| --------- | ------------------ | +| 10.x.y | :white_check_mark: | +| < 10.0.0 | :x: | + +## Reporting a Vulnerability + +If you identify a vulnerability on zodios, please create an issue with a reproductible setup. +Do not open an issue if you can't show a reproductible setup of if the vulnerability is on third party dependency. + +Indeed, a vulnerability on a peer dependency should be reported on the appropriate project: +- zod +- axios diff --git a/packages/testing/jest.config.ts b/packages/testing/jest.config.ts new file mode 100644 index 00000000..d0da3728 --- /dev/null +++ b/packages/testing/jest.config.ts @@ -0,0 +1,24 @@ +import type { Config } from "@jest/types"; + +// Objet synchrone +const config: Config.InitialOptions = { + verbose: true, + moduleFileExtensions: ["ts", "js", "json", "node"], + rootDir: "./", + testRegex: ".(spec|test).tsx?$", + transform: { + "^.+\\.tsx?$": "ts-jest", + }, + coveragePathIgnorePatterns: ["/node_modules/", "index\\.ts"], + coverageDirectory: "./coverage", + coverageThreshold: { + global: { + branches: 80, + functions: 85, + lines: 85, + statements: 85, + }, + }, + testEnvironment: "node", +}; +export default config; diff --git a/packages/testing/package.json b/packages/testing/package.json new file mode 100644 index 00000000..255b7a6e --- /dev/null +++ b/packages/testing/package.json @@ -0,0 +1,58 @@ +{ + "name": "@zodios/testing", + "description": "Zodios mock library", + "version": "11.0.0-beta.8", + "main": "lib/index.js", + "module": "lib/index.mjs", + "typings": "lib/index.d.ts", + "exports": { + ".": { + "import": "./lib/index.mjs", + "require": "./lib/index.js" + }, + "./package.json": "./package.json" + }, + "files": [ + "lib" + ], + "author": { + "name": "ecyrbe", + "email": "ecyrbe@gmail.com" + }, + "homepage": "https://github.com/ecyrbe/zodios", + "repository": { + "type": "git", + "url": "https://github.com/ecyrbe/zodios.git" + }, + "license": "MIT", + "keywords": [ + "zodios", + "mock", + "testing" + ], + "scripts": { + "prebuild": "rimraf lib", + "build": "tsup", + "test": "jest --coverage" + }, + "peerDependencies": { + "@zodios/core": "11.x" + }, + "devDependencies": { + "@jest/globals": "29.3.1", + "@jest/types": "29.3.1", + "@types/jest": "29.2.2", + "@types/node": "18.11.9", + "@zodios/core": "workspace:*", + "form-data": "^4.0.0", + "fp-ts": "2.13.1", + "io-ts": "2.2.19", + "jest": "29.3.0", + "rimraf": "3.0.2", + "ts-jest": "29.0.3", + "ts-node": "10.9.1", + "tsup": "6.3.0", + "typescript": "4.9.3", + "zod": "3.19.1" + } +} diff --git a/packages/testing/src/index.ts b/packages/testing/src/index.ts new file mode 100644 index 00000000..1cf329da --- /dev/null +++ b/packages/testing/src/index.ts @@ -0,0 +1,3 @@ +export { ZodiosMocks } from "./zodios"; +export { zodiosMocks, mockProvider } from "@zodios/core"; +export type { MockProvider, MockResponse } from "@zodios/core"; diff --git a/packages/testing/src/zodios.test.ts b/packages/testing/src/zodios.test.ts new file mode 100644 index 00000000..5f354cff --- /dev/null +++ b/packages/testing/src/zodios.test.ts @@ -0,0 +1,250 @@ +/// +import { z } from "zod"; +import { makeApi, makeErrors, mockProvider, ZodiosCore } from "@zodios/core"; +import { ZodiosMocks } from "./index"; + +const userSchema = z.object({ + id: z.number(), + name: z.string(), + email: z.string(), +}); + +const errorSchemas = makeErrors([ + { + status: "default", + schema: z.object({ + message: z.string(), + }), + }, +]); + +const api = makeApi([ + { + method: "get", + path: "/users", + response: z.array(userSchema), + errors: errorSchemas, + }, + { + method: "get", + path: "/users/:id", + response: userSchema, + errors: errorSchemas, + }, + { + method: "post", + path: "/users", + parameters: [ + { + name: "user", + type: "Body", + schema: userSchema.omit({ id: true }), + }, + ], + response: userSchema, + errors: errorSchemas, + }, + { + method: "put", + path: "/users/:id", + parameters: [ + { + name: "user", + type: "Body", + schema: userSchema, + }, + ], + response: userSchema, + errors: errorSchemas, + }, + { + method: "patch", + path: "/users/:id", + parameters: [ + { + name: "user", + type: "Body", + schema: userSchema, + }, + ], + response: userSchema, + errors: errorSchemas, + }, + { + method: "delete", + path: "/users/:id", + response: userSchema, + errors: errorSchemas, + }, +]); + +const zodios = new ZodiosCore(api, { fetcherProvider: mockProvider }); +const mocks = new ZodiosMocks(zodios); + +describe("Zodios", () => { + beforeAll(async () => { + ZodiosMocks.install(); + mocks.get("/users", async (config) => { + return { + data: [ + { + id: 1, + name: "John Doe", + email: "john.doe@test.com", + }, + ], + }; + }); + mocks.get("/users/:id", async (config) => { + if (config.params.id === 1) { + return { + data: { + id: 1, + name: "John Doe", + email: "john.doe@test.com", + }, + }; + } + return { + status: 404, + data: { + message: "User not found", + }, + }; + }); + mocks.post("/users", async (config) => { + return { + data: { + id: 1, + ...config.body, + }, + }; + }); + mocks.put("/users/:id", async (config) => { + if (config.params.id === 1) { + return { + data: { + ...config.body, + }, + }; + } + return { + status: 404, + data: { + message: "User not found", + }, + }; + }); + mocks.patch("/users/:id", async (config) => { + if (config.params.id === 1) { + return { + data: { + ...config.body, + }, + }; + } + return { + status: 404, + data: { + message: "User not found", + }, + }; + }); + mocks.delete("/users/:id", async (config) => { + if (config.params.id === 1) { + return { + data: { + id: 1, + name: "John Doe", + email: "john.doe@test.com", + }, + }; + } + return { + status: 404, + data: { + message: "User not found", + }, + }; + }); + }); + + afterAll(() => { + ZodiosMocks.uninstall(); + }); + + it("should be defined", () => { + expect(ZodiosMocks).toBeDefined(); + }); + + it("should be able to mock a request", async () => { + const response = await zodios.get("/users"); + expect(response).toEqual([ + { + id: 1, + name: "John Doe", + email: "john.doe@test.com", + }, + ]); + }); + it("should be able to mock a request with params", async () => { + const response = await zodios.get("/users/:id", { params: { id: 1 } }); + expect(response).toEqual({ + id: 1, + name: "John Doe", + email: "john.doe@test.com", + }); + }); + it("should be able to mock errors of a request with params", async () => { + let error; + try { + const response = await zodios.get("/users/:id", { params: { id: 2 } }); + } catch (e) { + error = e; + } + expect(error).toBeDefined(); + expect((error as any).response.status).toEqual(404); + }); + it("should be able to mock a post request", async () => { + const response = await zodios.post("/users", { + body: { name: "John Doe", email: "john.doe@test-post.com" }, + }); + expect(response).toEqual({ + id: 1, + name: "John Doe", + email: "john.doe@test-post.com", + }); + }); + it("should be able to mock a put request", async () => { + const response = await zodios.put("/users/:id", { + params: { id: 1 }, + body: { id: 1, name: "John Doe", email: "john.doe@test-put.com" }, + }); + expect(response).toEqual({ + id: 1, + name: "John Doe", + email: "john.doe@test-put.com", + }); + }); + it("should be able to mock a patch request", async () => { + const response = await zodios.patch("/users/:id", { + params: { id: 1 }, + body: { id: 1, name: "John Doe", email: "john.doe@test-patch.com" }, + }); + expect(response).toEqual({ + id: 1, + name: "John Doe", + email: "john.doe@test-patch.com", + }); + }); + it("should be able to mock a delete request", async () => { + const response = await zodios.delete("/users/:id", { + params: { id: 1 }, + }); + expect(response).toEqual({ + id: 1, + name: "John Doe", + email: "john.doe@test.com", + }); + }); +}); diff --git a/packages/testing/src/zodios.ts b/packages/testing/src/zodios.ts new file mode 100644 index 00000000..cba3587d --- /dev/null +++ b/packages/testing/src/zodios.ts @@ -0,0 +1,154 @@ +import type { + ZodiosPathsByMethod, + ZodiosResponseByPath, + ZodiosEndpointDefinitions, + ZodiosRequestOptionsByPath, + AnyZodiosTypeProvider, + ZodTypeProvider, + AnyZodiosFetcherProvider, + ZodiosBase, + ZodiosErrorsByPath, + MockResponse, +} from "@zodios/core"; +import type { ReadonlyDeep } from "@zodios/core/lib/utils.types"; +import { zodiosMocks } from "@zodios/core"; +/** + * zodios mock service + */ +export class ZodiosMocks< + Api extends ZodiosEndpointDefinitions, + FetcherProvider extends AnyZodiosFetcherProvider, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> { + constructor( + private readonly zodios: ZodiosBase + ) {} + + static install() { + zodiosMocks.install(); + } + + static uninstall() { + zodiosMocks.uninstall(); + } + + get< + Path extends ZodiosPathsByMethod, + TConfig extends ZodiosRequestOptionsByPath< + Api, + "get", + Path, + FetcherProvider, + true, + TypeProvider + > + >( + path: Path, + callback: ( + config: ReadonlyDeep + ) => Promise< + MockResponse< + | ZodiosResponseByPath + | ZodiosErrorsByPath + > + > + ) { + zodiosMocks.mockRequest("get", path, callback as any); + } + + post< + Path extends ZodiosPathsByMethod, + TConfig extends ZodiosRequestOptionsByPath< + Api, + "post", + Path, + FetcherProvider, + true, + TypeProvider + > + >( + path: Path, + callback: ( + config: ReadonlyDeep + ) => Promise< + MockResponse< + | ZodiosResponseByPath + | ZodiosErrorsByPath + > + > + ) { + zodiosMocks.mockRequest("post", path, callback as any); + } + + put< + Path extends ZodiosPathsByMethod, + TConfig extends ZodiosRequestOptionsByPath< + Api, + "put", + Path, + FetcherProvider, + true, + TypeProvider + > + >( + path: Path, + callback: ( + config: ReadonlyDeep + ) => Promise< + MockResponse< + | ZodiosResponseByPath + | ZodiosErrorsByPath + > + > + ) { + zodiosMocks.mockRequest("put", path, callback as any); + } + + patch< + Path extends ZodiosPathsByMethod, + TConfig extends ZodiosRequestOptionsByPath< + Api, + "patch", + Path, + FetcherProvider, + true, + TypeProvider + > + >( + path: Path, + callback: ( + config: ReadonlyDeep + ) => Promise< + MockResponse< + | ZodiosResponseByPath + | ZodiosErrorsByPath + > + > + ) { + zodiosMocks.mockRequest("patch", path, callback as any); + } + + delete< + Path extends ZodiosPathsByMethod, + TConfig extends ZodiosRequestOptionsByPath< + Api, + "delete", + Path, + FetcherProvider, + true, + TypeProvider + > + >( + path: Path, + callback: ( + config: ReadonlyDeep + ) => Promise< + MockResponse< + | ZodiosResponseByPath + | ZodiosErrorsByPath + > + > + ) { + zodiosMocks.mockRequest("delete", path, callback as any); + } +} diff --git a/packages/testing/tsconfig.build.json b/packages/testing/tsconfig.build.json new file mode 100644 index 00000000..3add8009 --- /dev/null +++ b/packages/testing/tsconfig.build.json @@ -0,0 +1,17 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "target": "ES6", + "sourceMap": false + }, + "exclude": [ + "node_modules", + "lib", + "examples", + "website", + "**/*.config.ts", + "**/*.spec.ts", + "**/*.test.ts", + "**/*.d.ts" + ] +} diff --git a/packages/testing/tsconfig.json b/packages/testing/tsconfig.json new file mode 100644 index 00000000..4f66f56f --- /dev/null +++ b/packages/testing/tsconfig.json @@ -0,0 +1,18 @@ +{ + // ts config for es 2021 + "compilerOptions": { + "target": "ES2019", + "module": "CommonJS", + "moduleResolution": "Node", + "lib": ["ES2019"], + "outDir": "./lib", + "alwaysStrict": true, + "strict": true, + "esModuleInterop": true, + "sourceMap": true, + "declaration": true, + "jsx": "react-jsx", + "types": ["jest", "node"] + }, + "exclude": ["node_modules", "lib"] +} diff --git a/packages/testing/tsup.config.js b/packages/testing/tsup.config.js new file mode 100644 index 00000000..6fc64294 --- /dev/null +++ b/packages/testing/tsup.config.js @@ -0,0 +1,14 @@ +import { defineConfig } from "tsup"; + +export default defineConfig({ + clean: true, + dts: true, + entry: ["src/index.ts", "src/utils.types.ts", "src/zodios.types.ts"], + outDir: "lib", + format: ["cjs", "esm"], + minify: true, + treeshake: true, + tsconfig: "tsconfig.build.json", + splitting: true, + sourcemap: false, +}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 62b8786f..8fd37c59 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -132,6 +132,40 @@ importers: typescript: 4.9.3 zod: 3.19.1 + packages/testing: + specifiers: + '@jest/globals': 29.3.1 + '@jest/types': 29.3.1 + '@types/jest': 29.2.2 + '@types/node': 18.11.9 + '@zodios/core': workspace:* + form-data: ^4.0.0 + fp-ts: 2.13.1 + io-ts: 2.2.19 + jest: 29.3.0 + rimraf: 3.0.2 + ts-jest: 29.0.3 + ts-node: 10.9.1 + tsup: 6.3.0 + typescript: 4.9.3 + zod: 3.19.1 + devDependencies: + '@jest/globals': 29.3.1 + '@jest/types': 29.3.1 + '@types/jest': 29.2.2 + '@types/node': 18.11.9 + '@zodios/core': link:../core + form-data: 4.0.0 + fp-ts: 2.13.1 + io-ts: 2.2.19_fp-ts@2.13.1 + jest: 29.3.0_odkjkoia5xunhxkdrka32ib6vi + rimraf: 3.0.2 + ts-jest: 29.0.3_rhbpodbq4tgi7dsfkb4juhkp3y + ts-node: 10.9.1_wup25etrarvlqkprac7h35hj7u + tsup: 6.3.0_2dtigtkb225m7ii7q45utxqwgi + typescript: 4.9.3 + zod: 3.19.1 + packages: /@ampproject/remapping/2.2.0: From da812d96e92fda0fa2fc7aa3924e1cca4093103b Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Thu, 24 Nov 2022 14:45:08 +0100 Subject: [PATCH 067/206] RELEASING: Releasing 4 package(s) Releases: @zodios/axios@11.0.0-beta.9 @zodios/core@11.0.0-beta.9 @zodios/fetch@11.0.0-beta.9 @zodios/testing@11.0.0-beta.9 [skip ci] --- packages/axios/CHANGELOG.md | 13 +++++++++++++ packages/axios/package.json | 2 +- packages/core/CHANGELOG.md | 7 +++++++ packages/core/package.json | 2 +- packages/fetch/CHANGELOG.md | 13 +++++++++++++ packages/fetch/package.json | 2 +- packages/testing/CHANGELOG.md | 12 ++++++++++++ packages/testing/package.json | 4 ++-- 8 files changed, 50 insertions(+), 5 deletions(-) diff --git a/packages/axios/CHANGELOG.md b/packages/axios/CHANGELOG.md index 4ecc944b..26a05673 100644 --- a/packages/axios/CHANGELOG.md +++ b/packages/axios/CHANGELOG.md @@ -1,5 +1,18 @@ # @zodios/core +## 11.0.0-beta.9 + +### Major Changes + +- c4c00a1: chore(deps): upgrade axios +- c6a4d0e: feat(testing): add testing package + +### Patch Changes + +- Updated dependencies [c4c00a1] +- Updated dependencies [c6a4d0e] + - @zodios/core@11.0.0-beta.9 + ## 11.0.0-beta.8 ### Major Changes diff --git a/packages/axios/package.json b/packages/axios/package.json index 52ac37af..c4b179f3 100644 --- a/packages/axios/package.json +++ b/packages/axios/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/axios", "description": "Typescript API client with axios", - "version": "11.0.0-beta.8", + "version": "11.0.0-beta.9", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 0863c179..62cdd312 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,12 @@ # @zodios/core +## 11.0.0-beta.9 + +### Major Changes + +- c4c00a1: chore(deps): upgrade axios +- c6a4d0e: feat(testing): add testing package + ## 11.0.0-beta.8 ### Major Changes diff --git a/packages/core/package.json b/packages/core/package.json index 19a386ca..6e19fbd4 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/core", "description": "Typescript API client with autocompletion and zod validations", - "version": "11.0.0-beta.8", + "version": "11.0.0-beta.9", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", diff --git a/packages/fetch/CHANGELOG.md b/packages/fetch/CHANGELOG.md index 4ecc944b..26a05673 100644 --- a/packages/fetch/CHANGELOG.md +++ b/packages/fetch/CHANGELOG.md @@ -1,5 +1,18 @@ # @zodios/core +## 11.0.0-beta.9 + +### Major Changes + +- c4c00a1: chore(deps): upgrade axios +- c6a4d0e: feat(testing): add testing package + +### Patch Changes + +- Updated dependencies [c4c00a1] +- Updated dependencies [c6a4d0e] + - @zodios/core@11.0.0-beta.9 + ## 11.0.0-beta.8 ### Major Changes diff --git a/packages/fetch/package.json b/packages/fetch/package.json index 63fec00b..39336a41 100644 --- a/packages/fetch/package.json +++ b/packages/fetch/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/fetch", "description": "Typescript API client with fetch", - "version": "11.0.0-beta.8", + "version": "11.0.0-beta.9", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", diff --git a/packages/testing/CHANGELOG.md b/packages/testing/CHANGELOG.md index 0863c179..72112400 100644 --- a/packages/testing/CHANGELOG.md +++ b/packages/testing/CHANGELOG.md @@ -1,5 +1,17 @@ # @zodios/core +## 11.0.0-beta.9 + +### Major Changes + +- c6a4d0e: feat(testing): add testing package + +### Patch Changes + +- Updated dependencies [c4c00a1] +- Updated dependencies [c6a4d0e] + - @zodios/core@11.0.0-beta.9 + ## 11.0.0-beta.8 ### Major Changes diff --git a/packages/testing/package.json b/packages/testing/package.json index 255b7a6e..0b014d8f 100644 --- a/packages/testing/package.json +++ b/packages/testing/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/testing", "description": "Zodios mock library", - "version": "11.0.0-beta.8", + "version": "11.0.0-beta.9", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", @@ -36,7 +36,7 @@ "test": "jest --coverage" }, "peerDependencies": { - "@zodios/core": "11.x" + "@zodios/core": "11.0.0-beta.9" }, "devDependencies": { "@jest/globals": "29.3.1", From 5b242fdc8a4d81d1413f3e2ba56a763c1ab74b24 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Thu, 24 Nov 2022 18:58:11 +0100 Subject: [PATCH 068/206] docs(changeset): feat(testing): add response testing handlers --- .changeset/nice-wombats-boil.md | 8 + .changeset/pre.json | 5 +- packages/testing/src/zodios.test.ts | 399 +++++++++++++++++++--------- packages/testing/src/zodios.ts | 54 ++++ 4 files changed, 335 insertions(+), 131 deletions(-) create mode 100644 .changeset/nice-wombats-boil.md diff --git a/.changeset/nice-wombats-boil.md b/.changeset/nice-wombats-boil.md new file mode 100644 index 00000000..30ee71b7 --- /dev/null +++ b/.changeset/nice-wombats-boil.md @@ -0,0 +1,8 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +"@zodios/testing": major +--- + +feat(testing): add response testing handlers diff --git a/.changeset/pre.json b/.changeset/pre.json index 77526ed0..1434c929 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -4,11 +4,14 @@ "initialVersions": { "@zodios/core": "11.0.0-beta.0", "@zodios/axios": "11.0.0-beta.0", - "@zodios/fetch": "11.0.0-beta.5" + "@zodios/fetch": "11.0.0-beta.5", + "@zodios/testing": "11.0.0-beta.8" }, "changesets": [ "blue-hounds-sort", + "long-fans-dress", "lucky-brooms-fry", + "nice-kids-attend", "polite-bugs-confess", "short-hounds-mix", "silent-garlics-scream", diff --git a/packages/testing/src/zodios.test.ts b/packages/testing/src/zodios.test.ts index 5f354cff..e215b3a5 100644 --- a/packages/testing/src/zodios.test.ts +++ b/packages/testing/src/zodios.test.ts @@ -82,169 +82,308 @@ const zodios = new ZodiosCore(api, { fetcherProvider: mockProvider }); const mocks = new ZodiosMocks(zodios); describe("Zodios", () => { - beforeAll(async () => { - ZodiosMocks.install(); - mocks.get("/users", async (config) => { - return { - data: [ - { - id: 1, - name: "John Doe", - email: "john.doe@test.com", + describe("dynamic mocks", () => { + beforeAll(() => { + ZodiosMocks.install(); + mocks.get("/users", async (config) => { + return { + data: [ + { + id: 1, + name: "John Doe", + email: "john.doe@test.com", + }, + ], + }; + }); + mocks.get("/users/:id", async (config) => { + if (config.params.id === 1) { + return { + data: { + id: 1, + name: "John Doe", + email: "john.doe@test.com", + }, + }; + } + return { + status: 404, + data: { + message: "User not found", }, - ], - }; - }); - mocks.get("/users/:id", async (config) => { - if (config.params.id === 1) { + }; + }); + mocks.post("/users", async (config) => { return { data: { id: 1, - name: "John Doe", - email: "john.doe@test.com", + ...config.body, }, }; - } - return { - status: 404, - data: { - message: "User not found", - }, - }; - }); - mocks.post("/users", async (config) => { - return { - data: { - id: 1, - ...config.body, - }, - }; - }); - mocks.put("/users/:id", async (config) => { - if (config.params.id === 1) { + }); + mocks.put("/users/:id", async (config) => { + if (config.params.id === 1) { + return { + data: { + ...config.body, + }, + }; + } return { + status: 404, data: { - ...config.body, + message: "User not found", }, }; - } - return { - status: 404, - data: { - message: "User not found", - }, - }; - }); - mocks.patch("/users/:id", async (config) => { - if (config.params.id === 1) { + }); + mocks.patch("/users/:id", async (config) => { + if (config.params.id === 1) { + return { + data: { + ...config.body, + }, + }; + } return { + status: 404, data: { - ...config.body, + message: "User not found", }, }; - } - return { - status: 404, - data: { - message: "User not found", - }, - }; - }); - mocks.delete("/users/:id", async (config) => { - if (config.params.id === 1) { + }); + mocks.delete("/users/:id", async (config) => { + if (config.params.id === 1) { + return { + data: { + id: 1, + name: "John Doe", + email: "john.doe@test.com", + }, + }; + } return { + status: 404, data: { - id: 1, - name: "John Doe", - email: "john.doe@test.com", + message: "User not found", }, }; - } - return { - status: 404, - data: { - message: "User not found", - }, - }; + }); }); - }); - afterAll(() => { - ZodiosMocks.uninstall(); - }); + afterAll(() => { + ZodiosMocks.uninstall(); + }); - it("should be defined", () => { - expect(ZodiosMocks).toBeDefined(); - }); + it("should be defined", () => { + expect(ZodiosMocks).toBeDefined(); + }); - it("should be able to mock a request", async () => { - const response = await zodios.get("/users"); - expect(response).toEqual([ - { + it("should be able to mock a request", async () => { + const response = await zodios.get("/users"); + expect(response).toEqual([ + { + id: 1, + name: "John Doe", + email: "john.doe@test.com", + }, + ]); + }); + it("should be able to mock a request with params", async () => { + const response = await zodios.get("/users/:id", { params: { id: 1 } }); + expect(response).toEqual({ id: 1, name: "John Doe", email: "john.doe@test.com", - }, - ]); - }); - it("should be able to mock a request with params", async () => { - const response = await zodios.get("/users/:id", { params: { id: 1 } }); - expect(response).toEqual({ - id: 1, - name: "John Doe", - email: "john.doe@test.com", + }); }); - }); - it("should be able to mock errors of a request with params", async () => { - let error; - try { - const response = await zodios.get("/users/:id", { params: { id: 2 } }); - } catch (e) { - error = e; - } - expect(error).toBeDefined(); - expect((error as any).response.status).toEqual(404); - }); - it("should be able to mock a post request", async () => { - const response = await zodios.post("/users", { - body: { name: "John Doe", email: "john.doe@test-post.com" }, + it("should be able to mock errors of a request with params", async () => { + let error; + try { + const response = await zodios.get("/users/:id", { params: { id: 2 } }); + } catch (e) { + error = e; + } + expect(error).toBeDefined(); + expect((error as any).response.status).toEqual(404); }); - expect(response).toEqual({ - id: 1, - name: "John Doe", - email: "john.doe@test-post.com", + it("should be able to mock a post request", async () => { + const response = await zodios.post("/users", { + body: { name: "John Doe", email: "john.doe@test-post.com" }, + }); + expect(response).toEqual({ + id: 1, + name: "John Doe", + email: "john.doe@test-post.com", + }); }); - }); - it("should be able to mock a put request", async () => { - const response = await zodios.put("/users/:id", { - params: { id: 1 }, - body: { id: 1, name: "John Doe", email: "john.doe@test-put.com" }, + it("should be able to mock a put request", async () => { + const response = await zodios.put("/users/:id", { + params: { id: 1 }, + body: { id: 1, name: "John Doe", email: "john.doe@test-put.com" }, + }); + expect(response).toEqual({ + id: 1, + name: "John Doe", + email: "john.doe@test-put.com", + }); + }); + it("should be able to mock a patch request", async () => { + const response = await zodios.patch("/users/:id", { + params: { id: 1 }, + body: { id: 1, name: "John Doe", email: "john.doe@test-patch.com" }, + }); + expect(response).toEqual({ + id: 1, + name: "John Doe", + email: "john.doe@test-patch.com", + }); }); - expect(response).toEqual({ - id: 1, - name: "John Doe", - email: "john.doe@test-put.com", + it("should be able to mock a delete request", async () => { + const response = await zodios.delete("/users/:id", { + params: { id: 1 }, + }); + expect(response).toEqual({ + id: 1, + name: "John Doe", + email: "john.doe@test.com", + }); }); }); - it("should be able to mock a patch request", async () => { - const response = await zodios.patch("/users/:id", { - params: { id: 1 }, - body: { id: 1, name: "John Doe", email: "john.doe@test-patch.com" }, + + describe("static mocks", () => { + beforeAll(() => { + ZodiosMocks.install(); }); - expect(response).toEqual({ - id: 1, - name: "John Doe", - email: "john.doe@test-patch.com", + afterAll(() => { + ZodiosMocks.uninstall(); }); - }); - it("should be able to mock a delete request", async () => { - const response = await zodios.delete("/users/:id", { - params: { id: 1 }, - }); - expect(response).toEqual({ - id: 1, - name: "John Doe", - email: "john.doe@test.com", + beforeEach(() => { + ZodiosMocks.reset(); + }); + + it("should be able to mock a request", async () => { + mocks.getResponse("/users", { + data: [ + { + id: 1, + name: "John Doe", + email: "john.doe@test.com", + }, + ], + }); + const response = await zodios.get("/users"); + expect(response).toEqual([ + { + id: 1, + name: "John Doe", + email: "john.doe@test.com", + }, + ]); + }); + it("should be able to mock a request with params", async () => { + mocks.getResponse("/users/:id", { + data: { + id: 1, + name: "John Doe", + email: "john.doe@test.com", + }, + }); + + const response = await zodios.get("/users/:id", { params: { id: 1 } }); + expect(response).toEqual({ + id: 1, + name: "John Doe", + email: "john.doe@test.com", + }); + }); + it("should be able to mock errors of a request with params", async () => { + mocks.getResponse("/users/:id", { + status: 404, + data: { + message: "User not found", + }, + }); + let error; + try { + const response = await zodios.get("/users/:id", { params: { id: 2 } }); + } catch (e) { + error = e; + } + expect(error).toBeDefined(); + expect((error as any).response.status).toEqual(404); + }); + it("should be able to mock a post request", async () => { + mocks.postResponse("/users", { + data: { + id: 1, + name: "John Doe", + email: "john.doe@test-post.com", + }, + }); + + const response = await zodios.post("/users", { + body: { name: "John Doe", email: "john.doe@test-post.com" }, + }); + expect(response).toEqual({ + id: 1, + name: "John Doe", + email: "john.doe@test-post.com", + }); + }); + it("should be able to mock a put request", async () => { + mocks.putResponse("/users/:id", { + data: { + id: 1, + name: "John Doe", + email: "john.doe@test-put.com", + }, + }); + + const response = await zodios.put("/users/:id", { + params: { id: 1 }, + body: { id: 1, name: "John Doe", email: "john.doe@test-put.com" }, + }); + expect(response).toEqual({ + id: 1, + name: "John Doe", + email: "john.doe@test-put.com", + }); + }); + it("should be able to mock a patch request", async () => { + mocks.patchResponse("/users/:id", { + data: { + id: 1, + name: "John Doe", + email: "john.doe@test-patch.com", + }, + }); + const response = await zodios.patch("/users/:id", { + params: { id: 1 }, + body: { id: 1, name: "John Doe", email: "john.doe@test-patch.com" }, + }); + expect(response).toEqual({ + id: 1, + name: "John Doe", + email: "john.doe@test-patch.com", + }); + }); + it("should be able to mock a delete request", async () => { + mocks.deleteResponse("/users/:id", { + data: { + id: 1, + name: "John Doe", + email: "john.doe@test.com", + }, + }); + + const response = await zodios.delete("/users/:id", { + params: { id: 1 }, + }); + expect(response).toEqual({ + id: 1, + name: "John Doe", + email: "john.doe@test.com", + }); }); }); }); diff --git a/packages/testing/src/zodios.ts b/packages/testing/src/zodios.ts index cba3587d..8a95da3f 100644 --- a/packages/testing/src/zodios.ts +++ b/packages/testing/src/zodios.ts @@ -32,6 +32,10 @@ export class ZodiosMocks< zodiosMocks.uninstall(); } + static reset() { + zodiosMocks.reset(); + } + get< Path extends ZodiosPathsByMethod, TConfig extends ZodiosRequestOptionsByPath< @@ -56,6 +60,16 @@ export class ZodiosMocks< zodiosMocks.mockRequest("get", path, callback as any); } + getResponse>( + path: Path, + response: MockResponse< + | ZodiosResponseByPath + | ZodiosErrorsByPath + > + ) { + zodiosMocks.mockResponse("get", path, response); + } + post< Path extends ZodiosPathsByMethod, TConfig extends ZodiosRequestOptionsByPath< @@ -80,6 +94,16 @@ export class ZodiosMocks< zodiosMocks.mockRequest("post", path, callback as any); } + postResponse>( + path: Path, + response: MockResponse< + | ZodiosResponseByPath + | ZodiosErrorsByPath + > + ) { + zodiosMocks.mockResponse("post", path, response); + } + put< Path extends ZodiosPathsByMethod, TConfig extends ZodiosRequestOptionsByPath< @@ -104,6 +128,16 @@ export class ZodiosMocks< zodiosMocks.mockRequest("put", path, callback as any); } + putResponse>( + path: Path, + response: MockResponse< + | ZodiosResponseByPath + | ZodiosErrorsByPath + > + ) { + zodiosMocks.mockResponse("put", path, response); + } + patch< Path extends ZodiosPathsByMethod, TConfig extends ZodiosRequestOptionsByPath< @@ -128,6 +162,16 @@ export class ZodiosMocks< zodiosMocks.mockRequest("patch", path, callback as any); } + patchResponse>( + path: Path, + response: MockResponse< + | ZodiosResponseByPath + | ZodiosErrorsByPath + > + ) { + zodiosMocks.mockResponse("patch", path, response); + } + delete< Path extends ZodiosPathsByMethod, TConfig extends ZodiosRequestOptionsByPath< @@ -151,4 +195,14 @@ export class ZodiosMocks< ) { zodiosMocks.mockRequest("delete", path, callback as any); } + + deleteResponse>( + path: Path, + response: MockResponse< + | ZodiosResponseByPath + | ZodiosErrorsByPath + > + ) { + zodiosMocks.mockResponse("delete", path, response); + } } From ff899d4afad2f6f7b54eefe9fd9ab59de5834490 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Thu, 24 Nov 2022 19:53:44 +0100 Subject: [PATCH 069/206] RELEASING: Releasing 4 package(s) Releases: @zodios/axios@11.0.0-beta.10 @zodios/core@11.0.0-beta.10 @zodios/fetch@11.0.0-beta.10 @zodios/testing@11.0.0-beta.10 [skip ci] --- packages/axios/CHANGELOG.md | 11 +++++++++++ packages/axios/package.json | 2 +- packages/core/CHANGELOG.md | 6 ++++++ packages/core/package.json | 2 +- packages/fetch/CHANGELOG.md | 11 +++++++++++ packages/fetch/package.json | 2 +- packages/testing/CHANGELOG.md | 11 +++++++++++ packages/testing/package.json | 4 ++-- 8 files changed, 44 insertions(+), 5 deletions(-) diff --git a/packages/axios/CHANGELOG.md b/packages/axios/CHANGELOG.md index 26a05673..36cf60dd 100644 --- a/packages/axios/CHANGELOG.md +++ b/packages/axios/CHANGELOG.md @@ -1,5 +1,16 @@ # @zodios/core +## 11.0.0-beta.10 + +### Major Changes + +- c360c52: feat(testing): add response testing handlers + +### Patch Changes + +- Updated dependencies [c360c52] + - @zodios/core@11.0.0-beta.10 + ## 11.0.0-beta.9 ### Major Changes diff --git a/packages/axios/package.json b/packages/axios/package.json index c4b179f3..98f663a0 100644 --- a/packages/axios/package.json +++ b/packages/axios/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/axios", "description": "Typescript API client with axios", - "version": "11.0.0-beta.9", + "version": "11.0.0-beta.10", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 62cdd312..916a4af1 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,11 @@ # @zodios/core +## 11.0.0-beta.10 + +### Major Changes + +- c360c52: feat(testing): add response testing handlers + ## 11.0.0-beta.9 ### Major Changes diff --git a/packages/core/package.json b/packages/core/package.json index 6e19fbd4..ded233c7 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/core", "description": "Typescript API client with autocompletion and zod validations", - "version": "11.0.0-beta.9", + "version": "11.0.0-beta.10", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", diff --git a/packages/fetch/CHANGELOG.md b/packages/fetch/CHANGELOG.md index 26a05673..36cf60dd 100644 --- a/packages/fetch/CHANGELOG.md +++ b/packages/fetch/CHANGELOG.md @@ -1,5 +1,16 @@ # @zodios/core +## 11.0.0-beta.10 + +### Major Changes + +- c360c52: feat(testing): add response testing handlers + +### Patch Changes + +- Updated dependencies [c360c52] + - @zodios/core@11.0.0-beta.10 + ## 11.0.0-beta.9 ### Major Changes diff --git a/packages/fetch/package.json b/packages/fetch/package.json index 39336a41..79f3b754 100644 --- a/packages/fetch/package.json +++ b/packages/fetch/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/fetch", "description": "Typescript API client with fetch", - "version": "11.0.0-beta.9", + "version": "11.0.0-beta.10", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", diff --git a/packages/testing/CHANGELOG.md b/packages/testing/CHANGELOG.md index 72112400..ab4efcd3 100644 --- a/packages/testing/CHANGELOG.md +++ b/packages/testing/CHANGELOG.md @@ -1,5 +1,16 @@ # @zodios/core +## 11.0.0-beta.10 + +### Major Changes + +- c360c52: feat(testing): add response testing handlers + +### Patch Changes + +- Updated dependencies [c360c52] + - @zodios/core@11.0.0-beta.10 + ## 11.0.0-beta.9 ### Major Changes diff --git a/packages/testing/package.json b/packages/testing/package.json index 0b014d8f..c5bafc73 100644 --- a/packages/testing/package.json +++ b/packages/testing/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/testing", "description": "Zodios mock library", - "version": "11.0.0-beta.9", + "version": "11.0.0-beta.10", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", @@ -36,7 +36,7 @@ "test": "jest --coverage" }, "peerDependencies": { - "@zodios/core": "11.0.0-beta.9" + "@zodios/core": "11.0.0-beta.10" }, "devDependencies": { "@jest/globals": "29.3.1", From a60be398fda0ae60275deda4762b957d4de15c1a Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Thu, 24 Nov 2022 21:31:15 +0100 Subject: [PATCH 070/206] docs(changeset): refactor(testing): move base hooks to testing --- .changeset/pre.json | 1 + .changeset/soft-seas-lie.md | 8 ++++ packages/core/src/fetcher-providers/index.ts | 2 - .../default-provider.ts => hooks.ts} | 4 +- packages/core/src/index.ts | 3 +- packages/core/src/zodios.test.ts | 2 +- packages/core/src/zodios.ts | 6 +-- packages/testing/src/index.ts | 4 +- .../src}/mock-provider/index.ts | 0 .../src}/mock-provider/mock-provider.ts | 43 +++++++++++++------ packages/testing/src/zodios.test.ts | 4 +- packages/testing/src/zodios.ts | 3 +- 12 files changed, 50 insertions(+), 30 deletions(-) create mode 100644 .changeset/soft-seas-lie.md rename packages/core/src/{fetcher-providers/default-provider.ts => hooks.ts} (67%) rename packages/{core/src/fetcher-providers => testing/src}/mock-provider/index.ts (100%) rename packages/{core/src/fetcher-providers => testing/src}/mock-provider/mock-provider.ts (70%) diff --git a/.changeset/pre.json b/.changeset/pre.json index 1434c929..0b04c0a6 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -12,6 +12,7 @@ "long-fans-dress", "lucky-brooms-fry", "nice-kids-attend", + "nice-wombats-boil", "polite-bugs-confess", "short-hounds-mix", "silent-garlics-scream", diff --git a/.changeset/soft-seas-lie.md b/.changeset/soft-seas-lie.md new file mode 100644 index 00000000..ac75425e --- /dev/null +++ b/.changeset/soft-seas-lie.md @@ -0,0 +1,8 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +"@zodios/testing": major +--- + +refactor(testing): move base hooks to testing diff --git a/packages/core/src/fetcher-providers/index.ts b/packages/core/src/fetcher-providers/index.ts index a5e64c2f..0d65dafe 100644 --- a/packages/core/src/fetcher-providers/index.ts +++ b/packages/core/src/fetcher-providers/index.ts @@ -1,3 +1 @@ export * from "./fetcher-provider.types"; -export * from "./default-provider"; -export * from "./mock-provider"; diff --git a/packages/core/src/fetcher-providers/default-provider.ts b/packages/core/src/hooks.ts similarity index 67% rename from packages/core/src/fetcher-providers/default-provider.ts rename to packages/core/src/hooks.ts index e011d6b4..473b5202 100644 --- a/packages/core/src/fetcher-providers/default-provider.ts +++ b/packages/core/src/hooks.ts @@ -1,8 +1,8 @@ import { AnyZodiosFetcherProvider, ZodiosRuntimeFetcherProvider, -} from "./fetcher-provider.types"; +} from "./fetcher-providers/fetcher-provider.types"; -export const defaults: { +export const hooks: { fetcherProvider?: ZodiosRuntimeFetcherProvider; } = {}; diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index b1cb55b2..57a23c55 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -72,8 +72,7 @@ export type { TypeOfFetcherResponse, ZodiosRuntimeFetcherProvider, } from "./fetcher-providers"; -export type { MockProvider, MockResponse } from "./fetcher-providers"; -export { zodiosMocks, mockProvider } from "./fetcher-providers"; +export { hooks } from "./hooks"; export { PluginId, zodValidationPlugin, diff --git a/packages/core/src/zodios.test.ts b/packages/core/src/zodios.test.ts index 82ce2bc0..61e51a66 100644 --- a/packages/core/src/zodios.test.ts +++ b/packages/core/src/zodios.test.ts @@ -36,7 +36,7 @@ import { ZodiosError } from "./zodios-error"; import { ZodiosPlugin } from "./zodios.types"; import { apiBuilder } from "./api"; import { AnyZodiosFetcherProvider } from "./fetcher-providers"; -import { zodiosMocks } from "./fetcher-providers/mock-provider"; +import { zodiosMocks } from "../../testing/src/mock-provider"; describe("Zodios", () => { beforeAll(async () => { diff --git a/packages/core/src/zodios.ts b/packages/core/src/zodios.ts index d92e1373..9bc51554 100644 --- a/packages/core/src/zodios.ts +++ b/packages/core/src/zodios.ts @@ -34,9 +34,9 @@ import { zodTypeProvider } from "./type-providers"; import { AnyZodiosFetcherProvider, TypeOfFetcherOptions, - defaults, } from "./fetcher-providers"; import { findEndpointErrorsByAlias, findEndpointErrorsByPath } from "./utils"; +import { hooks } from "./hooks"; export interface ZodiosBase< Api extends ZodiosEndpointDefinitions, @@ -305,8 +305,8 @@ export class ZodiosCoreImpl< conf = await endpointPlugin.interceptRequest(this.api, conf); } let response: Promise; - if (defaults.fetcherProvider) { - response = defaults.fetcherProvider.fetch(conf); + if (hooks.fetcherProvider) { + response = hooks.fetcherProvider.fetch(conf); } else if (this.options.fetcherProvider) { response = this.options.fetcherProvider.fetch(conf); } else { diff --git a/packages/testing/src/index.ts b/packages/testing/src/index.ts index 1cf329da..a10dd01e 100644 --- a/packages/testing/src/index.ts +++ b/packages/testing/src/index.ts @@ -1,3 +1,3 @@ export { ZodiosMocks } from "./zodios"; -export { zodiosMocks, mockProvider } from "@zodios/core"; -export type { MockProvider, MockResponse } from "@zodios/core"; +export type { MockProvider, MockResponse } from "./mock-provider"; +export { mockProvider, zodiosMocks } from "./mock-provider"; diff --git a/packages/core/src/fetcher-providers/mock-provider/index.ts b/packages/testing/src/mock-provider/index.ts similarity index 100% rename from packages/core/src/fetcher-providers/mock-provider/index.ts rename to packages/testing/src/mock-provider/index.ts diff --git a/packages/core/src/fetcher-providers/mock-provider/mock-provider.ts b/packages/testing/src/mock-provider/mock-provider.ts similarity index 70% rename from packages/core/src/fetcher-providers/mock-provider/mock-provider.ts rename to packages/testing/src/mock-provider/mock-provider.ts index b4bd65a1..bb55354c 100644 --- a/packages/core/src/fetcher-providers/mock-provider/mock-provider.ts +++ b/packages/testing/src/mock-provider/mock-provider.ts @@ -2,8 +2,8 @@ import type { AnyZodiosFetcherProvider, AnyZodiosRequestOptions, ZodiosRuntimeFetcherProvider, -} from "../../index"; -import { defaults } from "../default-provider"; +} from "../../../core/src/index"; +import { hooks } from "../../../core/src/hooks"; export interface MockProvider extends AnyZodiosFetcherProvider { options: {}; @@ -26,7 +26,7 @@ export const mockProvider: ZodiosRuntimeFetcherProvider = { ...config, baseURL: this.baseURL, }; - for (const [{ method, url }, callback] of zodiosMocks.mocks) { + for (const [{ method, url }, callback] of registeredMocks) { if (method === requestConfig.method && url === requestConfig.url) { const result = (await callback( requestConfig @@ -57,20 +57,35 @@ export type MockResponse = { readonly data?: Data; }; -export const zodiosMocks = { - mocks: new Map< - { method: string; url: string }, - (config: AnyZodiosRequestOptions) => Promise - >(), +interface ZodiosMockBase { + install(): void; + uninstall(): void; + reset(): void; + mockRequest( + method: string, + path: string, + callback: ( + config: AnyZodiosRequestOptions + ) => Promise + ): void; + mockResponse(method: string, path: string, response: MockResponse): void; +} + +const registeredMocks = new Map< + { method: string; url: string }, + (config: AnyZodiosRequestOptions) => Promise +>(); + +export const zodiosMocks: ZodiosMockBase = { install() { - defaults.fetcherProvider = mockProvider; + hooks.fetcherProvider = mockProvider; }, uninstall() { - this.mocks.clear(); - defaults.fetcherProvider = undefined; + registeredMocks.clear(); + hooks.fetcherProvider = undefined; }, reset() { - this.mocks.clear(); + registeredMocks.clear(); }, mockRequest( method: string, @@ -79,10 +94,10 @@ export const zodiosMocks = { config: AnyZodiosRequestOptions ) => Promise ) { - this.mocks.set({ method, url: path }, callback); + registeredMocks.set({ method, url: path }, callback); }, mockResponse(method: string, path: string, response: MockResponse) { - this.mocks.set( + registeredMocks.set( { method, url: path, diff --git a/packages/testing/src/zodios.test.ts b/packages/testing/src/zodios.test.ts index e215b3a5..ed99f4e5 100644 --- a/packages/testing/src/zodios.test.ts +++ b/packages/testing/src/zodios.test.ts @@ -1,7 +1,7 @@ /// import { z } from "zod"; -import { makeApi, makeErrors, mockProvider, ZodiosCore } from "@zodios/core"; -import { ZodiosMocks } from "./index"; +import { makeApi, makeErrors, ZodiosCore } from "@zodios/core"; +import { ZodiosMocks, mockProvider } from "./index"; const userSchema = z.object({ id: z.number(), diff --git a/packages/testing/src/zodios.ts b/packages/testing/src/zodios.ts index 8a95da3f..4ff386e4 100644 --- a/packages/testing/src/zodios.ts +++ b/packages/testing/src/zodios.ts @@ -8,10 +8,9 @@ import type { AnyZodiosFetcherProvider, ZodiosBase, ZodiosErrorsByPath, - MockResponse, } from "@zodios/core"; import type { ReadonlyDeep } from "@zodios/core/lib/utils.types"; -import { zodiosMocks } from "@zodios/core"; +import { zodiosMocks, MockResponse } from "./mock-provider"; /** * zodios mock service */ From 1ee8f56c13e45c29632b1a1f07de9f61d39b7b58 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Thu, 24 Nov 2022 21:37:05 +0100 Subject: [PATCH 071/206] docs(changeset): fix(testing): import types from core instead of relaive directory --- .changeset/polite-points-float.md | 8 ++++++++ packages/testing/src/mock-provider/mock-provider.ts | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 .changeset/polite-points-float.md diff --git a/.changeset/polite-points-float.md b/.changeset/polite-points-float.md new file mode 100644 index 00000000..335a0fce --- /dev/null +++ b/.changeset/polite-points-float.md @@ -0,0 +1,8 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +"@zodios/testing": major +--- + +fix(testing): import types from core instead of relaive directory diff --git a/packages/testing/src/mock-provider/mock-provider.ts b/packages/testing/src/mock-provider/mock-provider.ts index bb55354c..2e56f4a7 100644 --- a/packages/testing/src/mock-provider/mock-provider.ts +++ b/packages/testing/src/mock-provider/mock-provider.ts @@ -2,8 +2,8 @@ import type { AnyZodiosFetcherProvider, AnyZodiosRequestOptions, ZodiosRuntimeFetcherProvider, -} from "../../../core/src/index"; -import { hooks } from "../../../core/src/hooks"; +} from "@zodios/core"; +import { hooks } from "@zodios/core"; export interface MockProvider extends AnyZodiosFetcherProvider { options: {}; From 3d71340fe9b15921b4ba0264aea716835b963904 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Thu, 24 Nov 2022 21:46:26 +0100 Subject: [PATCH 072/206] RELEASING: Releasing 4 package(s) Releases: @zodios/axios@11.0.0-beta.11 @zodios/core@11.0.0-beta.11 @zodios/fetch@11.0.0-beta.11 @zodios/testing@11.0.0-beta.11 [skip ci] --- packages/axios/CHANGELOG.md | 13 +++++++++++++ packages/axios/package.json | 2 +- packages/core/CHANGELOG.md | 7 +++++++ packages/core/package.json | 2 +- packages/fetch/CHANGELOG.md | 13 +++++++++++++ packages/fetch/package.json | 2 +- packages/testing/CHANGELOG.md | 13 +++++++++++++ packages/testing/package.json | 4 ++-- 8 files changed, 51 insertions(+), 5 deletions(-) diff --git a/packages/axios/CHANGELOG.md b/packages/axios/CHANGELOG.md index 36cf60dd..d470b5a2 100644 --- a/packages/axios/CHANGELOG.md +++ b/packages/axios/CHANGELOG.md @@ -1,5 +1,18 @@ # @zodios/core +## 11.0.0-beta.11 + +### Major Changes + +- a753f07: fix(testing): import types from core instead of relaive directory +- 33b5de0: refactor(testing): move base hooks to testing + +### Patch Changes + +- Updated dependencies [a753f07] +- Updated dependencies [33b5de0] + - @zodios/core@11.0.0-beta.11 + ## 11.0.0-beta.10 ### Major Changes diff --git a/packages/axios/package.json b/packages/axios/package.json index 98f663a0..4f44003f 100644 --- a/packages/axios/package.json +++ b/packages/axios/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/axios", "description": "Typescript API client with axios", - "version": "11.0.0-beta.10", + "version": "11.0.0-beta.11", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 916a4af1..ce8c5af4 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,12 @@ # @zodios/core +## 11.0.0-beta.11 + +### Major Changes + +- a753f07: fix(testing): import types from core instead of relaive directory +- 33b5de0: refactor(testing): move base hooks to testing + ## 11.0.0-beta.10 ### Major Changes diff --git a/packages/core/package.json b/packages/core/package.json index ded233c7..ced1b2ba 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/core", "description": "Typescript API client with autocompletion and zod validations", - "version": "11.0.0-beta.10", + "version": "11.0.0-beta.11", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", diff --git a/packages/fetch/CHANGELOG.md b/packages/fetch/CHANGELOG.md index 36cf60dd..d470b5a2 100644 --- a/packages/fetch/CHANGELOG.md +++ b/packages/fetch/CHANGELOG.md @@ -1,5 +1,18 @@ # @zodios/core +## 11.0.0-beta.11 + +### Major Changes + +- a753f07: fix(testing): import types from core instead of relaive directory +- 33b5de0: refactor(testing): move base hooks to testing + +### Patch Changes + +- Updated dependencies [a753f07] +- Updated dependencies [33b5de0] + - @zodios/core@11.0.0-beta.11 + ## 11.0.0-beta.10 ### Major Changes diff --git a/packages/fetch/package.json b/packages/fetch/package.json index 79f3b754..34ce3b0e 100644 --- a/packages/fetch/package.json +++ b/packages/fetch/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/fetch", "description": "Typescript API client with fetch", - "version": "11.0.0-beta.10", + "version": "11.0.0-beta.11", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", diff --git a/packages/testing/CHANGELOG.md b/packages/testing/CHANGELOG.md index ab4efcd3..cd9a5be0 100644 --- a/packages/testing/CHANGELOG.md +++ b/packages/testing/CHANGELOG.md @@ -1,5 +1,18 @@ # @zodios/core +## 11.0.0-beta.11 + +### Major Changes + +- a753f07: fix(testing): import types from core instead of relaive directory +- 33b5de0: refactor(testing): move base hooks to testing + +### Patch Changes + +- Updated dependencies [a753f07] +- Updated dependencies [33b5de0] + - @zodios/core@11.0.0-beta.11 + ## 11.0.0-beta.10 ### Major Changes diff --git a/packages/testing/package.json b/packages/testing/package.json index c5bafc73..f7fb9631 100644 --- a/packages/testing/package.json +++ b/packages/testing/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/testing", "description": "Zodios mock library", - "version": "11.0.0-beta.10", + "version": "11.0.0-beta.11", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", @@ -36,7 +36,7 @@ "test": "jest --coverage" }, "peerDependencies": { - "@zodios/core": "11.0.0-beta.10" + "@zodios/core": "11.0.0-beta.11" }, "devDependencies": { "@jest/globals": "29.3.1", From dd47f61b159ed7666ee6eb9db1c935d81ed38641 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Thu, 24 Nov 2022 23:46:54 +0100 Subject: [PATCH 073/206] docs(changeset): fix(testing): safely export hooks --- .changeset/gentle-ligers-mix.md | 8 ++ .changeset/pre.json | 2 + packages/core/src/hooks.ts | 10 ++ packages/core/src/index.ts | 2 +- packages/core/src/zodios.test.ts | 129 +++++++++++++++++- packages/testing/package.json | 1 + .../src/mock-provider/mock-provider.ts | 6 +- packages/testing/src/zodios.test.ts | 6 +- pnpm-lock.yaml | 2 + 9 files changed, 153 insertions(+), 13 deletions(-) create mode 100644 .changeset/gentle-ligers-mix.md diff --git a/.changeset/gentle-ligers-mix.md b/.changeset/gentle-ligers-mix.md new file mode 100644 index 00000000..7cf20528 --- /dev/null +++ b/.changeset/gentle-ligers-mix.md @@ -0,0 +1,8 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +"@zodios/testing": major +--- + +fix(testing): safely export hooks diff --git a/.changeset/pre.json b/.changeset/pre.json index 0b04c0a6..70b8c6d5 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -14,9 +14,11 @@ "nice-kids-attend", "nice-wombats-boil", "polite-bugs-confess", + "polite-points-float", "short-hounds-mix", "silent-garlics-scream", "slimy-pugs-melt", + "soft-seas-lie", "tasty-bags-happen" ] } diff --git a/packages/core/src/hooks.ts b/packages/core/src/hooks.ts index 473b5202..dada7939 100644 --- a/packages/core/src/hooks.ts +++ b/packages/core/src/hooks.ts @@ -6,3 +6,13 @@ import { export const hooks: { fetcherProvider?: ZodiosRuntimeFetcherProvider; } = {}; + +export function setFetcherHook( + provider: ZodiosRuntimeFetcherProvider +) { + hooks.fetcherProvider = provider; +} + +export function clearFetcherHook() { + hooks.fetcherProvider = undefined; +} diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 57a23c55..bad04660 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -72,7 +72,7 @@ export type { TypeOfFetcherResponse, ZodiosRuntimeFetcherProvider, } from "./fetcher-providers"; -export { hooks } from "./hooks"; +export { setFetcherHook, clearFetcherHook } from "./hooks"; export { PluginId, zodValidationPlugin, diff --git a/packages/core/src/zodios.test.ts b/packages/core/src/zodios.test.ts index 61e51a66..526e6925 100644 --- a/packages/core/src/zodios.test.ts +++ b/packages/core/src/zodios.test.ts @@ -31,12 +31,129 @@ globalThis.FormData = class FormData { } }; -import { ZodiosCore } from "./zodios"; -import { ZodiosError } from "./zodios-error"; -import { ZodiosPlugin } from "./zodios.types"; -import { apiBuilder } from "./api"; -import { AnyZodiosFetcherProvider } from "./fetcher-providers"; -import { zodiosMocks } from "../../testing/src/mock-provider"; +import { + ZodiosCore, + ZodiosError, + apiBuilder, + setFetcherHook, + clearFetcherHook, +} from "./index"; + +import type { + AnyZodiosFetcherProvider, + AnyZodiosRequestOptions, + ZodiosPlugin, + ZodiosRuntimeFetcherProvider, +} from "./index"; + +interface MockProvider extends AnyZodiosFetcherProvider { + options: {}; + config: { + baseURL?: string; + body?: unknown; + auth?: { username: string; password: string }; + validateStatus?: (status: number) => boolean; + timeout?: number; + responseType?: "arraybuffer" | "blob" | "json" | "text" | "stream"; + }; + response: unknown; + error: unknown; +} + +const mockProvider: ZodiosRuntimeFetcherProvider = { + init() {}, + async fetch(config: AnyZodiosRequestOptions) { + const requestConfig = { + ...config, + baseURL: this.baseURL, + }; + for (const [{ method, url }, callback] of registeredMocks) { + if (method === requestConfig.method && url === requestConfig.url) { + const result = (await callback( + requestConfig + )) as Required; + if ( + (config.validateStatus && !config.validateStatus(result.status)) || + result.status > 299 + ) { + const err = new Error( + `Request failed with status code ${result.status}` + ) as Error & { code: string; config: any; response: any }; + err.code = `ERR_STATUS_${result.status}`; + err.config = requestConfig; + err.response = result; + throw err; + } + return result; + } + } + throw new Error(`No mocks found for ${requestConfig.url}`); + }, +}; + +type MockResponse = { + readonly headers?: Record; + readonly status?: number; + readonly statusText?: string; + readonly data?: Data; +}; + +interface ZodiosMockBase { + install(): void; + uninstall(): void; + reset(): void; + mockRequest( + method: string, + path: string, + callback: ( + config: AnyZodiosRequestOptions + ) => Promise + ): void; + mockResponse(method: string, path: string, response: MockResponse): void; +} + +const registeredMocks = new Map< + { method: string; url: string }, + (config: AnyZodiosRequestOptions) => Promise +>(); + +const zodiosMocks: ZodiosMockBase = { + install() { + setFetcherHook(mockProvider); + }, + uninstall() { + registeredMocks.clear(); + clearFetcherHook(); + }, + reset() { + registeredMocks.clear(); + }, + mockRequest( + method: string, + path: string, + callback: ( + config: AnyZodiosRequestOptions + ) => Promise + ) { + registeredMocks.set({ method, url: path }, callback); + }, + mockResponse(method: string, path: string, response: MockResponse) { + registeredMocks.set( + { + method, + url: path, + }, + () => + Promise.resolve({ + headers: {}, + data: {}, + status: 200, + statusText: "OK", + ...response, + }) + ); + }, +}; describe("Zodios", () => { beforeAll(async () => { diff --git a/packages/testing/package.json b/packages/testing/package.json index f7fb9631..3aed0488 100644 --- a/packages/testing/package.json +++ b/packages/testing/package.json @@ -44,6 +44,7 @@ "@types/jest": "29.2.2", "@types/node": "18.11.9", "@zodios/core": "workspace:*", + "@zodios/fetch": "workspace:*", "form-data": "^4.0.0", "fp-ts": "2.13.1", "io-ts": "2.2.19", diff --git a/packages/testing/src/mock-provider/mock-provider.ts b/packages/testing/src/mock-provider/mock-provider.ts index 2e56f4a7..82fe412c 100644 --- a/packages/testing/src/mock-provider/mock-provider.ts +++ b/packages/testing/src/mock-provider/mock-provider.ts @@ -3,7 +3,7 @@ import type { AnyZodiosRequestOptions, ZodiosRuntimeFetcherProvider, } from "@zodios/core"; -import { hooks } from "@zodios/core"; +import { setFetcherHook, clearFetcherHook } from "@zodios/core"; export interface MockProvider extends AnyZodiosFetcherProvider { options: {}; @@ -78,11 +78,11 @@ const registeredMocks = new Map< export const zodiosMocks: ZodiosMockBase = { install() { - hooks.fetcherProvider = mockProvider; + setFetcherHook(mockProvider); }, uninstall() { registeredMocks.clear(); - hooks.fetcherProvider = undefined; + clearFetcherHook(); }, reset() { registeredMocks.clear(); diff --git a/packages/testing/src/zodios.test.ts b/packages/testing/src/zodios.test.ts index ed99f4e5..4d97612a 100644 --- a/packages/testing/src/zodios.test.ts +++ b/packages/testing/src/zodios.test.ts @@ -1,7 +1,7 @@ /// import { z } from "zod"; -import { makeApi, makeErrors, ZodiosCore } from "@zodios/core"; -import { ZodiosMocks, mockProvider } from "./index"; +import { makeApi, makeErrors, Zodios } from "@zodios/fetch"; +import { ZodiosMocks } from "./index"; const userSchema = z.object({ id: z.number(), @@ -78,7 +78,7 @@ const api = makeApi([ }, ]); -const zodios = new ZodiosCore(api, { fetcherProvider: mockProvider }); +const zodios = new Zodios(api); const mocks = new ZodiosMocks(zodios); describe("Zodios", () => { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8fd37c59..5cb0a4b7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -139,6 +139,7 @@ importers: '@types/jest': 29.2.2 '@types/node': 18.11.9 '@zodios/core': workspace:* + '@zodios/fetch': workspace:* form-data: ^4.0.0 fp-ts: 2.13.1 io-ts: 2.2.19 @@ -155,6 +156,7 @@ importers: '@types/jest': 29.2.2 '@types/node': 18.11.9 '@zodios/core': link:../core + '@zodios/fetch': link:../fetch form-data: 4.0.0 fp-ts: 2.13.1 io-ts: 2.2.19_fp-ts@2.13.1 From f0bda89dd4247b55985ec161f1c2534885f88358 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Thu, 24 Nov 2022 23:53:42 +0100 Subject: [PATCH 074/206] RELEASING: Releasing 4 package(s) Releases: @zodios/axios@11.0.0-beta.12 @zodios/core@11.0.0-beta.12 @zodios/fetch@11.0.0-beta.12 @zodios/testing@11.0.0-beta.12 [skip ci] --- packages/axios/CHANGELOG.md | 11 +++++++++++ packages/axios/package.json | 2 +- packages/core/CHANGELOG.md | 6 ++++++ packages/core/package.json | 2 +- packages/fetch/CHANGELOG.md | 11 +++++++++++ packages/fetch/package.json | 2 +- packages/testing/CHANGELOG.md | 11 +++++++++++ packages/testing/package.json | 4 ++-- 8 files changed, 44 insertions(+), 5 deletions(-) diff --git a/packages/axios/CHANGELOG.md b/packages/axios/CHANGELOG.md index d470b5a2..6d4e725d 100644 --- a/packages/axios/CHANGELOG.md +++ b/packages/axios/CHANGELOG.md @@ -1,5 +1,16 @@ # @zodios/core +## 11.0.0-beta.12 + +### Major Changes + +- 29dcf47: fix(testing): safely export hooks + +### Patch Changes + +- Updated dependencies [29dcf47] + - @zodios/core@11.0.0-beta.12 + ## 11.0.0-beta.11 ### Major Changes diff --git a/packages/axios/package.json b/packages/axios/package.json index 4f44003f..aa48d42d 100644 --- a/packages/axios/package.json +++ b/packages/axios/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/axios", "description": "Typescript API client with axios", - "version": "11.0.0-beta.11", + "version": "11.0.0-beta.12", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index ce8c5af4..a47f3211 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,11 @@ # @zodios/core +## 11.0.0-beta.12 + +### Major Changes + +- 29dcf47: fix(testing): safely export hooks + ## 11.0.0-beta.11 ### Major Changes diff --git a/packages/core/package.json b/packages/core/package.json index ced1b2ba..9218e277 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/core", "description": "Typescript API client with autocompletion and zod validations", - "version": "11.0.0-beta.11", + "version": "11.0.0-beta.12", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", diff --git a/packages/fetch/CHANGELOG.md b/packages/fetch/CHANGELOG.md index d470b5a2..6d4e725d 100644 --- a/packages/fetch/CHANGELOG.md +++ b/packages/fetch/CHANGELOG.md @@ -1,5 +1,16 @@ # @zodios/core +## 11.0.0-beta.12 + +### Major Changes + +- 29dcf47: fix(testing): safely export hooks + +### Patch Changes + +- Updated dependencies [29dcf47] + - @zodios/core@11.0.0-beta.12 + ## 11.0.0-beta.11 ### Major Changes diff --git a/packages/fetch/package.json b/packages/fetch/package.json index 34ce3b0e..0b92c9de 100644 --- a/packages/fetch/package.json +++ b/packages/fetch/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/fetch", "description": "Typescript API client with fetch", - "version": "11.0.0-beta.11", + "version": "11.0.0-beta.12", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", diff --git a/packages/testing/CHANGELOG.md b/packages/testing/CHANGELOG.md index cd9a5be0..11ffd340 100644 --- a/packages/testing/CHANGELOG.md +++ b/packages/testing/CHANGELOG.md @@ -1,5 +1,16 @@ # @zodios/core +## 11.0.0-beta.12 + +### Major Changes + +- 29dcf47: fix(testing): safely export hooks + +### Patch Changes + +- Updated dependencies [29dcf47] + - @zodios/core@11.0.0-beta.12 + ## 11.0.0-beta.11 ### Major Changes diff --git a/packages/testing/package.json b/packages/testing/package.json index 3aed0488..77d3ff2a 100644 --- a/packages/testing/package.json +++ b/packages/testing/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/testing", "description": "Zodios mock library", - "version": "11.0.0-beta.11", + "version": "11.0.0-beta.12", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", @@ -36,7 +36,7 @@ "test": "jest --coverage" }, "peerDependencies": { - "@zodios/core": "11.0.0-beta.11" + "@zodios/core": "11.0.0-beta.12" }, "devDependencies": { "@jest/globals": "29.3.1", From 7428c5e851538e75115cc3929edf9514806ecf8d Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Fri, 25 Nov 2022 20:14:48 +0100 Subject: [PATCH 075/206] feat(testing): allow sync func mock callbacks --- .changeset/pre.json | 1 + .../src/mock-provider/mock-provider.ts | 28 +++++++++---------- packages/testing/src/zodios.test.ts | 12 ++++---- packages/testing/src/zodios.ts | 12 ++++---- 4 files changed, 26 insertions(+), 27 deletions(-) diff --git a/.changeset/pre.json b/.changeset/pre.json index 70b8c6d5..80c97975 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -9,6 +9,7 @@ }, "changesets": [ "blue-hounds-sort", + "gentle-ligers-mix", "long-fans-dress", "lucky-brooms-fry", "nice-kids-attend", diff --git a/packages/testing/src/mock-provider/mock-provider.ts b/packages/testing/src/mock-provider/mock-provider.ts index 82fe412c..40eab32f 100644 --- a/packages/testing/src/mock-provider/mock-provider.ts +++ b/packages/testing/src/mock-provider/mock-provider.ts @@ -28,9 +28,12 @@ export const mockProvider: ZodiosRuntimeFetcherProvider = { }; for (const [{ method, url }, callback] of registeredMocks) { if (method === requestConfig.method && url === requestConfig.url) { - const result = (await callback( - requestConfig - )) as Required; + const result = { + headers: {}, + status: 200, + statusText: "OK", + ...(await callback(requestConfig)), + }; if ( (config.validateStatus && !config.validateStatus(result.status)) || result.status > 299 @@ -54,9 +57,11 @@ export type MockResponse = { readonly headers?: Record; readonly status?: number; readonly statusText?: string; - readonly data?: Data; + readonly data: Data; }; +export type MaybePromise = T | Promise; + interface ZodiosMockBase { install(): void; uninstall(): void; @@ -66,14 +71,14 @@ interface ZodiosMockBase { path: string, callback: ( config: AnyZodiosRequestOptions - ) => Promise + ) => MaybePromise ): void; mockResponse(method: string, path: string, response: MockResponse): void; } const registeredMocks = new Map< { method: string; url: string }, - (config: AnyZodiosRequestOptions) => Promise + (config: AnyZodiosRequestOptions) => MaybePromise >(); export const zodiosMocks: ZodiosMockBase = { @@ -92,7 +97,7 @@ export const zodiosMocks: ZodiosMockBase = { path: string, callback: ( config: AnyZodiosRequestOptions - ) => Promise + ) => MaybePromise ) { registeredMocks.set({ method, url: path }, callback); }, @@ -102,14 +107,7 @@ export const zodiosMocks: ZodiosMockBase = { method, url: path, }, - () => - Promise.resolve({ - headers: {}, - data: {}, - status: 200, - statusText: "OK", - ...response, - }) + () => response ); }, }; diff --git a/packages/testing/src/zodios.test.ts b/packages/testing/src/zodios.test.ts index 4d97612a..9feea1c4 100644 --- a/packages/testing/src/zodios.test.ts +++ b/packages/testing/src/zodios.test.ts @@ -85,7 +85,7 @@ describe("Zodios", () => { describe("dynamic mocks", () => { beforeAll(() => { ZodiosMocks.install(); - mocks.get("/users", async (config) => { + mocks.get("/users", (config) => { return { data: [ { @@ -96,7 +96,7 @@ describe("Zodios", () => { ], }; }); - mocks.get("/users/:id", async (config) => { + mocks.get("/users/:id", (config) => { if (config.params.id === 1) { return { data: { @@ -113,7 +113,7 @@ describe("Zodios", () => { }, }; }); - mocks.post("/users", async (config) => { + mocks.post("/users", (config) => { return { data: { id: 1, @@ -121,7 +121,7 @@ describe("Zodios", () => { }, }; }); - mocks.put("/users/:id", async (config) => { + mocks.put("/users/:id", (config) => { if (config.params.id === 1) { return { data: { @@ -136,7 +136,7 @@ describe("Zodios", () => { }, }; }); - mocks.patch("/users/:id", async (config) => { + mocks.patch("/users/:id", (config) => { if (config.params.id === 1) { return { data: { @@ -151,7 +151,7 @@ describe("Zodios", () => { }, }; }); - mocks.delete("/users/:id", async (config) => { + mocks.delete("/users/:id", (config) => { if (config.params.id === 1) { return { data: { diff --git a/packages/testing/src/zodios.ts b/packages/testing/src/zodios.ts index 4ff386e4..2d204c6b 100644 --- a/packages/testing/src/zodios.ts +++ b/packages/testing/src/zodios.ts @@ -10,7 +10,7 @@ import type { ZodiosErrorsByPath, } from "@zodios/core"; import type { ReadonlyDeep } from "@zodios/core/lib/utils.types"; -import { zodiosMocks, MockResponse } from "./mock-provider"; +import { zodiosMocks, MockResponse, MaybePromise } from "./mock-provider"; /** * zodios mock service */ @@ -49,7 +49,7 @@ export class ZodiosMocks< path: Path, callback: ( config: ReadonlyDeep - ) => Promise< + ) => MaybePromise< MockResponse< | ZodiosResponseByPath | ZodiosErrorsByPath @@ -83,7 +83,7 @@ export class ZodiosMocks< path: Path, callback: ( config: ReadonlyDeep - ) => Promise< + ) => MaybePromise< MockResponse< | ZodiosResponseByPath | ZodiosErrorsByPath @@ -117,7 +117,7 @@ export class ZodiosMocks< path: Path, callback: ( config: ReadonlyDeep - ) => Promise< + ) => MaybePromise< MockResponse< | ZodiosResponseByPath | ZodiosErrorsByPath @@ -151,7 +151,7 @@ export class ZodiosMocks< path: Path, callback: ( config: ReadonlyDeep - ) => Promise< + ) => MaybePromise< MockResponse< | ZodiosResponseByPath | ZodiosErrorsByPath @@ -185,7 +185,7 @@ export class ZodiosMocks< path: Path, callback: ( config: ReadonlyDeep - ) => Promise< + ) => MaybePromise< MockResponse< | ZodiosResponseByPath | ZodiosErrorsByPath From ee62a73f2e255cda6acd92ad2eff614eee6576b5 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sat, 26 Nov 2022 21:16:54 +0100 Subject: [PATCH 076/206] fix(core): request options do not have data prop --- packages/core/src/zodios.types.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/core/src/zodios.types.ts b/packages/core/src/zodios.types.ts index ae1ea034..669dc203 100644 --- a/packages/core/src/zodios.types.ts +++ b/packages/core/src/zodios.types.ts @@ -689,7 +689,6 @@ export type ZodiosRequestOptions< { method: M; url: Path; - data?: ZodiosBodyByPath; }, ZodiosRequestOptionsByPath< Api, From 04f3facf79fa03bbef9b34d54dcb314d48cc18d2 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sat, 26 Nov 2022 21:17:27 +0100 Subject: [PATCH 077/206] chore(fetch): remove axios dep --- packages/fetch/package.json | 3 +-- packages/fetch/src/zodios.test.ts | 7 +++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/fetch/package.json b/packages/fetch/package.json index 0b92c9de..cc5aa917 100644 --- a/packages/fetch/package.json +++ b/packages/fetch/package.json @@ -62,8 +62,7 @@ "@types/jest": "29.2.2", "@types/multer": "1.4.7", "@types/node": "18.11.9", - "axios": "1.1.3", - "cross-fetch": "^3.1.5", + "cross-fetch": "3.1.5", "express": "4.18.2", "fp-ts": "2.13.1", "io-ts": "2.2.19", diff --git a/packages/fetch/src/zodios.test.ts b/packages/fetch/src/zodios.test.ts index 5ec63fa7..2dcad89f 100644 --- a/packages/fetch/src/zodios.test.ts +++ b/packages/fetch/src/zodios.test.ts @@ -1,5 +1,4 @@ /// -import { AxiosError } from "axios"; import express from "express"; import { AddressInfo } from "net"; import { z, ZodError } from "zod"; @@ -861,7 +860,7 @@ received: error = e; } expect(error).toBeInstanceOf(Error); - expect((error as AxiosError).response?.status).toBe(502); + expect((error as any).response?.status).toBe(502); if (zodios.isErrorFromPath(zodios.api, "get", "/error502", error)) { expect(error.response.status).toBe(502); if (error.response.status === 502) { @@ -918,7 +917,7 @@ received: } expect(error).toBeInstanceOf(Error); - expect((error as AxiosError).response?.status).toBe(502); + expect((error as any).response?.status).toBe(502); expect(zodios.isErrorFromPath(zodios.api, "get", "/error502", error)).toBe( false ); @@ -964,7 +963,7 @@ received: try { await zodios.get("/error502"); } catch (e) { - expect((e as AxiosError).response?.data).toEqual({ + expect((e as any).response?.data).toEqual({ error: { message: "bad gateway", }, From 217d50bfbfbd2ddc8d13549d818666a6d0bf28c9 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sat, 26 Nov 2022 21:20:38 +0100 Subject: [PATCH 078/206] docs(changeset): feat(react): migrate react to v11 --- .changeset/famous-rules-drop.md | 9 + packages/react/.gitignore | 105 ++++ packages/react/.npmignore | 39 ++ packages/react/LICENSE | 21 + packages/react/README.md | 153 +++++ packages/react/examples/react.tsx | 131 +++++ packages/react/jest.config.ts | 25 + packages/react/package.json | 80 +++ packages/react/renovate.json | 4 + packages/react/src/hooks.spec.tsx | 750 ++++++++++++++++++++++++ packages/react/src/hooks.ts | 871 ++++++++++++++++++++++++++++ packages/react/src/index.ts | 6 + packages/react/src/utils.test.ts | 86 +++ packages/react/src/utils.ts | 56 ++ packages/react/tsconfig.build.json | 20 + packages/react/tsconfig.json | 18 + packages/react/tsup.config.js | 14 + pnpm-lock.yaml | 881 ++++++++++++++++++++++++++++- 18 files changed, 3258 insertions(+), 11 deletions(-) create mode 100644 .changeset/famous-rules-drop.md create mode 100644 packages/react/.gitignore create mode 100644 packages/react/.npmignore create mode 100644 packages/react/LICENSE create mode 100644 packages/react/README.md create mode 100644 packages/react/examples/react.tsx create mode 100644 packages/react/jest.config.ts create mode 100644 packages/react/package.json create mode 100644 packages/react/renovate.json create mode 100644 packages/react/src/hooks.spec.tsx create mode 100644 packages/react/src/hooks.ts create mode 100644 packages/react/src/index.ts create mode 100644 packages/react/src/utils.test.ts create mode 100644 packages/react/src/utils.ts create mode 100644 packages/react/tsconfig.build.json create mode 100644 packages/react/tsconfig.json create mode 100644 packages/react/tsup.config.js diff --git a/.changeset/famous-rules-drop.md b/.changeset/famous-rules-drop.md new file mode 100644 index 00000000..ce7187ce --- /dev/null +++ b/.changeset/famous-rules-drop.md @@ -0,0 +1,9 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +"@zodios/react": major +"@zodios/testing": major +--- + +feat(react): migrate react to v11 diff --git a/packages/react/.gitignore b/packages/react/.gitignore new file mode 100644 index 00000000..9aadc156 --- /dev/null +++ b/packages/react/.gitignore @@ -0,0 +1,105 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# TypeScript v1 declaration files +typings/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variables file +.env +.env.test + +# parcel-bundler cache (https://parceljs.org/) +.cache + +# Next.js build output +.next + +# Nuxt.js build / generate output +.nuxt +dist +lib + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and *not* Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port diff --git a/packages/react/.npmignore b/packages/react/.npmignore new file mode 100644 index 00000000..9b818209 --- /dev/null +++ b/packages/react/.npmignore @@ -0,0 +1,39 @@ +# compiled output +!/lib +/node_modules +/src +/examples + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# OS +.DS_Store + +# Tests +/coverage +/.nyc_output + +# IDEs and editors +/.idea +.project +.classpath +.c9/ +*.launch +.settings/ +*.sublime-workspace + +# IDE - VSCode +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + +# ENV +.env diff --git a/packages/react/LICENSE b/packages/react/LICENSE new file mode 100644 index 00000000..e5dea986 --- /dev/null +++ b/packages/react/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 ecyrbe + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/react/README.md b/packages/react/README.md new file mode 100644 index 00000000..ba6b50b4 --- /dev/null +++ b/packages/react/README.md @@ -0,0 +1,153 @@ +

Zodios React

+

+ + Zodios logo + +

+ +

+ React hooks for zodios backed by react-query +

+ +

+ + langue typescript + + + npm + + + GitHub + + GitHub Workflow Status +

+ +# Install + +```bash +> npm install @zodios/react +``` + +or + +```bash +> yarn add @zodios/react +``` + +# Usage + +Zodios comes with a Query and Mutation hook helper. +It's a thin wrapper around React-Query but with zodios auto completion. + +Zodios query hook also returns an invalidation helper to allow you to reset react query cache easily + +```typescript +import React from "react"; +import { QueryClient, QueryClientProvider } from "react-query"; +import { Zodios, asApi } from "@zodios/core"; +import { ZodiosHooks } from "@zodios/react"; +import { z } from "zod"; + +// you can define schema before declaring the API to get back the type +const userSchema = z + .object({ + id: z.number(), + name: z.string(), + }) + .required(); + +const createUserSchema = z + .object({ + name: z.string(), + }) + .required(); + +const usersSchema = z.array(userSchema); + +// you can then get back the types +type User = z.infer; +type Users = z.infer; + +const api = asApi([ + { + method: "get", + path: "/users", + description: "Get all users", + parameters: [ + { + name: "q", + type: "Query", + schema: z.string(), + }, + { + name: "page", + type: "Query", + schema: z.string().optional(), + }, + ], + response: usersSchema, + }, + { + method: "get", + path: "/users/:id", + description: "Get a user", + response: userSchema, + }, + { + method: "post", + path: "/users", + description: "Create a user", + parameters: [ + { + name: "body", + type: "Body", + schema: createUserSchema, + }, + ], + response: userSchema, + }, +]); +const baseUrl = "https://jsonplaceholder.typicode.com"; + +const zodios = new Zodios(baseUrl, api); +const zodiosHooks = new ZodiosHooks("jsonplaceholder", zodios); + +const Users = () => { + const { + data: users, + isLoading, + error, + invalidate: invalidateUsers, // zodios also provides invalidation helpers + } = zodiosHooks.useQuery("/users"); + const { mutate } = zodiosHooks.useMutation("post", "/users", undefined, { + onSuccess: () => invalidateUsers(), + }); + + return ( + <> +

Users

+ + {isLoading &&
Loading...
} + {error &&
Error: {(error as Error).message}
} + {users && ( +
    + {users.map((user) => ( +
  • {user.name}
  • + ))} +
+ )} + + ); +}; + +// on another file +const queryClient = new QueryClient(); + +export const App = () => { + return ( + + + + ); +}; +``` diff --git a/packages/react/examples/react.tsx b/packages/react/examples/react.tsx new file mode 100644 index 00000000..6c64d7d6 --- /dev/null +++ b/packages/react/examples/react.tsx @@ -0,0 +1,131 @@ +import React, { useRef } from "react"; +import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; +import { makeApi, Zodios } from "@zodios/fetch"; +import { ZodiosHooks } from "../src"; +import { z } from "zod"; + +// you can define schema before declaring the API to get back the type +const userSchema = z + .object({ + id: z.number(), + name: z.string(), + }) + .required(); + +const createUserSchema = z + .object({ + name: z.string(), + }) + .required(); + +const usersSchema = z.array(userSchema); + +// you can then get back the types +type User = z.infer; +type Users = z.infer; + +const api = makeApi([ + { + method: "get", + path: "/users", + alias: "getUsers", + description: "Get all users", + parameters: [ + { + name: "page", + type: "Query", + schema: z.number().positive().optional(), + }, + { + name: "limit", + type: "Query", + schema: z.number().positive().optional(), + }, + ], + response: usersSchema, + }, + { + method: "get", + path: "/users/:id", + description: "Get a user", + alias: "getUser", + response: userSchema, + }, + { + method: "post", + path: "/users", + alias: "createUser", + description: "Create a user", + parameters: [ + { + name: "body", + type: "Body", + schema: createUserSchema, + }, + ], + response: userSchema, + }, +]); +const baseUrl = "https://jsonplaceholder.typicode.com"; + +const zodios = new Zodios(baseUrl, api); +const zodiosHooks = new ZodiosHooks("jsonplaceholder", zodios); + +const Users = () => { + const page = useRef(0); + const { + data: users, + isLoading, + error, + fetchNextPage, + invalidate: invalidateUsers, // zodios also provides invalidation helpers + } = zodiosHooks.useInfiniteQuery( + "/users", + { queries: { limit: 10 } }, + { + getPageParamList: () => { + return ["page"]; + }, + getNextPageParam: () => { + return { + queries: { + page: page.current + 1, + }, + }; + }, + } + ); + const { mutate } = zodiosHooks.useCreateUser(undefined, { + onSuccess: () => invalidateUsers(), + }); + + return ( + <> +

Users

+ + {isLoading &&
Loading...
} + {error &&
Error: {(error as Error).message}
} + {users && ( + <> +
    + {users.pages.flatMap((page) => + page.map((user) =>
  • {user.name}
  • ) + )} +
+ + + )} + + ); +}; + +// on another file +const queryClient = new QueryClient(); + +export const App = () => { + return ( + + + + ); +}; diff --git a/packages/react/jest.config.ts b/packages/react/jest.config.ts new file mode 100644 index 00000000..e334c0a3 --- /dev/null +++ b/packages/react/jest.config.ts @@ -0,0 +1,25 @@ +import type { Config } from "@jest/types"; + +// Objet synchrone +const config: Config.InitialOptions = { + verbose: true, + moduleFileExtensions: ["ts", "js", "tsx", "jsx", "json", "node"], + rootDir: "./", + testRegex: ".(spec|test).tsx?$", + transform: { + "^.+\\.tsx?$": "ts-jest", + "node_modules/axios/.+\\.(j|t)sx?$": "ts-jest", + }, + transformIgnorePatterns: ["node_modules/(?!axios/.*)"], + coverageDirectory: "./coverage", + coverageThreshold: { + global: { + branches: 85, + functions: 85, + lines: 85, + statements: 85, + }, + }, + testEnvironment: "jsdom", +}; +export default config; diff --git a/packages/react/package.json b/packages/react/package.json new file mode 100644 index 00000000..85b9e900 --- /dev/null +++ b/packages/react/package.json @@ -0,0 +1,80 @@ +{ + "name": "@zodios/react", + "description": "React hooks for zodios", + "version": "10.3.4", + "main": "lib/index.js", + "module": "lib/index.mjs", + "typings": "lib/index.d.ts", + "exports": { + ".": { + "import": "./lib/index.mjs", + "require": "./lib/index.js" + }, + "./package.json": "./package.json" + }, + "files": [ + "lib" + ], + "author": { + "name": "ecyrbe", + "email": "ecyrbe@gmail.com" + }, + "homepage": "https://github.com/ecyrbe/zodios", + "repository": { + "type": "git", + "url": "https://github.com/ecyrbe/zodios.git" + }, + "license": "MIT", + "keywords": [ + "axios", + "openapi", + "zod", + "autocomplete", + "validation" + ], + "scripts": { + "prebuild": "rimraf lib", + "build": "tsup", + "test": "jest --coverage" + }, + "peerDependencies": { + "@tanstack/react-query": "4.x", + "@zodios/core": "11.x", + "react": ">=16.8.0" + }, + "devDependencies": { + "@jest/globals": "29.3.1", + "@jest/types": "29.3.1", + "@tanstack/react-query": "4.16.1", + "@testing-library/dom": "8.19.0", + "@testing-library/jest-dom": "5.16.5", + "@testing-library/react": "13.4.0", + "@testing-library/react-hooks": "8.0.1", + "@testing-library/user-event": "14.4.3", + "@types/cors": "2.8.12", + "@types/express": "4.17.14", + "@types/jest": "29.2.3", + "@types/node": "18.11.9", + "@types/react": "18.0.25", + "@zodios/core": "workspace:*", + "@zodios/fetch": "workspace:*", + "cors": "2.8.5", + "cross-fetch": "3.1.5", + "express": "4.18.2", + "jest": "29.3.1", + "jest-environment-jsdom": "29.3.1", + "react": "18.2.0", + "react-dom": "18.2.0", + "react-test-renderer": "18.2.0", + "rimraf": "3.0.2", + "ts-jest": "29.0.3", + "ts-node": "10.9.1", + "tsup": "6.3.0", + "typescript": "4.9.3", + "zod": "3.19.1" + }, + "resolutions": { + "@types/react": "18.0.25" + }, + "dependencies": {} +} diff --git a/packages/react/renovate.json b/packages/react/renovate.json new file mode 100644 index 00000000..24494837 --- /dev/null +++ b/packages/react/renovate.json @@ -0,0 +1,4 @@ +{ + "extends": ["config:base"], + "ignoreDeps": ["tsup"] +} diff --git a/packages/react/src/hooks.spec.tsx b/packages/react/src/hooks.spec.tsx new file mode 100644 index 00000000..2c063ebb --- /dev/null +++ b/packages/react/src/hooks.spec.tsx @@ -0,0 +1,750 @@ +import "cross-fetch/polyfill"; +import React from "react"; +import { renderHook } from "@testing-library/react-hooks"; +import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; +import { Zodios, makeApi, ZodiosError } from "@zodios/fetch"; +import express from "express"; +import { AddressInfo } from "net"; +import cors from "cors"; +import z from "zod"; +import { ZodiosHooks } from "./hooks"; + +const api = makeApi([ + { + method: "get", + path: "/users", + alias: "getUsers", + description: "Get all users", + parameters: [ + { + name: "page", + type: "Query", + schema: z.number().positive().optional(), + }, + { + name: "limit", + type: "Query", + schema: z.number().positive().optional(), + }, + ], + response: z.object({ + page: z.number(), + count: z.number(), + nextPage: z.number().optional(), + users: z.array( + z.object({ + id: z.number(), + name: z.string(), + }) + ), + }), + }, + { + method: "post", + path: "/users/search", + alias: "searchUsers", + description: "Search users", + immutable: true, + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ + name: z.string(), + page: z.number().positive().optional(), + limit: z.number().positive().optional(), + }), + }, + ], + response: z.object({ + page: z.number(), + count: z.number(), + nextPage: z.number().optional(), + users: z.array( + z.object({ + id: z.number(), + name: z.string(), + }) + ), + }), + }, + { + method: "get", + path: "/users/:id", + alias: "getUser", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + { + method: "get", + path: "/users/:id/address/:address", + alias: "getUserAddress", + response: z.object({ + id: z.number(), + address: z.string(), + }), + }, + { + method: "post", + path: "/users", + alias: "createUser", + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + { + method: "put", + path: "/users", + alias: "updateUser", + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + { + method: "patch", + path: "/users", + alias: "patchUser", + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + { + method: "delete", + path: "/users/:id", + alias: "deleteUser", + response: z.object({ + id: z.number(), + }), + }, + { + method: "get", + path: "/users/:id/error", + alias: "getUserError", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, +]); + +const queryClient = new QueryClient({ + defaultOptions: { + queries: { + retry: false, + }, + }, +}); +const wrapper = ({ children }: { children: React.ReactNode }) => ( + {children} +); + +describe("zodios hooks", () => { + describe("keys", () => { + const apiClient = new Zodios(api); + const apiHooks = new ZodiosHooks("test", apiClient); + beforeAll(() => {}); + it("should get back endpoint key", () => { + const key = apiHooks.getKeyByPath("get", "/users/:id", { + params: { id: 1 }, + }); + expect(key).toEqual([ + { api: "test", path: "/users/:id" }, + { params: { id: 1 } }, + ]); + }); + + it("should be serialisable", () => { + const key = apiHooks.getKeyByPath("get", "/users/:id", { + params: { id: 1 }, + }); + expect( + JSON.stringify(key, (k, v) => (v === undefined ? null : v)) + ).toEqual('[{"api":"test","path":"/users/:id"},{"params":{"id":1}}]'); + }); + + it("should throw on invalid endpoint", () => { + expect(() => + // @ts-expect-error + apiHooks.getKeyByPath("get", "/users/:id/bad", { + params: { id: 1 }, + }) + ).toThrow("No endpoint found for path 'get /users/:id/bad'"); + }); + + it("should get back endpoint invalidation key", () => { + const key = apiHooks.getKeyByPath("get", "/users/:id"); + expect(key).toEqual([{ api: "test", path: "/users/:id" }]); + }); + + it("should throw on invalid invalidation endpoint", () => { + expect(() => + // @ts-expect-error + apiHooks.getKeyByPath("get", "/users/:id/bad") + ).toThrow("No endpoint found for path 'get /users/:id/bad'"); + }); + + it("should get back alias key", () => { + const key = apiHooks.getKeyByAlias("getUser", { + params: { id: 1 }, + }); + expect(key).toEqual([ + { api: "test", path: "/users/:id" }, + { params: { id: 1 } }, + ]); + }); + + it("should throw on invalid alias", () => { + expect(() => + // @ts-expect-error + apiHooks.getKeyByAlias("getTest", { + params: { id: 1 }, + }) + ).toThrow("No endpoint found for alias 'getTest'"); + }); + + it("should get back alias invalidation key", () => { + const key = apiHooks.getKeyByAlias("getUser"); + expect(key).toEqual([{ api: "test", path: "/users/:id" }]); + }); + + it("should throw on invalid invalidation alias", () => { + expect(() => + // @ts-expect-error + apiHooks.getKeyByAlias("getTest") + ).toThrow("No endpoint found for alias 'getTest'"); + }); + }); + describe("hooks", () => { + let app: express.Express; + let server: ReturnType; + let port: number; + + beforeAll(async () => { + app = express(); + app.use(express.json()); + app.use(cors()); + const userDB = Array.from({ length: 23 }, (_, i) => ({ + id: i + 1, + name: `User ${i + 1}`, + })); + app.get("/users", (req, res) => { + const page = req.query.page ? +req.query.page : 1; + const limit = req.query.limit ? +req.query.limit : 10; + const start = (page - 1) * limit; + const end = start + limit; + const nextPage = end < userDB.length ? page + 1 : undefined; + const users = userDB.slice(start, end); + + res.json({ + page, + count: users.length, + nextPage, + users, + }); + }); + app.post("/users/search", (req, res) => { + const { name } = req.body; + const users = userDB.filter((user) => user.name.includes(name)); + const page = req.body.page ?? 1; + const limit = req.body.limit ?? 10; + const start = (page - 1) * limit; + const end = start + limit; + const nextPage = end < users.length ? page + 1 : undefined; + const result = users.slice(start, end); + res.json({ + page, + count: result.length, + nextPage, + users: result, + }); + }); + app.get("/error502", (req, res) => { + res.status(502).json({ error: { message: "bad gateway" } }); + }); + app.get("/users/:id", (req, res) => { + res.status(200).json({ id: Number(req.params.id), name: "test" }); + }); + app.get("/users/:id/address/:address", (req, res) => { + res + .status(200) + .json({ id: Number(req.params.id), address: req.params.address }); + }); + app.post("/users", (req, res) => { + res.status(200).json({ id: 3, name: req.body.name }); + }); + app.put("/users", (req, res) => { + res.status(200).json({ id: req.body.id, name: req.body.name }); + }); + app.patch("/users", (req, res) => { + res.status(200).json({ id: req.body.id, name: req.body.name }); + }); + app.delete("/users/:id", (req, res) => { + res.status(200).json({ id: Number(req.params.id) }); + }); + app.get("/users/:id/error", (req, res) => { + res.status(200).json({ id: Number(req.params.id), names: "test" }); + }); + + server = app.listen(0); + port = (server.address() as AddressInfo).port; + }); + + afterAll(() => { + server.close(); + }); + + it("should get id", async () => { + const apiClient = new Zodios(`http://localhost:${port}`, api); + const apiHooks = new ZodiosHooks("test", apiClient); + + const { result, waitFor } = renderHook( + () => apiHooks.useGet("/users/:id", { params: { id: 1 } }), + { wrapper } + ); + await waitFor(() => result.current.isSuccess); + expect(result.current.data).toEqual({ + id: 1, + name: "test", + }); + expect(result.current.invalidate).toBeDefined(); + }); + + it("should have validation error", async () => { + const apiClient = new Zodios(`http://localhost:${port}`, api); + const apiHooks = new ZodiosHooks("test", apiClient); + const { result, waitFor } = renderHook( + () => apiHooks.useGet("/users/:id/error", { params: { id: 1 } }), + { wrapper } + ); + await waitFor(() => result.current.isError); + expect(result.current.error).toBeInstanceOf(ZodiosError); + }); + + it("should get id with alias", async () => { + const apiClient = new Zodios(`http://localhost:${port}`, api); + const apiHooks = new ZodiosHooks("test", apiClient); + const { result, waitFor } = renderHook( + () => apiHooks.useGetUser({ params: { id: 1 } }), + { wrapper } + ); + await waitFor(() => result.current.isSuccess); + expect(result.current.data).toEqual({ + id: 1, + name: "test", + }); + expect(result.current.invalidate).toBeDefined(); + }); + + it("should get id and address", async () => { + const apiClient = new Zodios(`http://localhost:${port}`, api); + const apiHooks = new ZodiosHooks("test", apiClient); + const { result, waitFor } = renderHook( + () => + apiHooks.useGet("/users/:id/address/:address", { + params: { id: 1, address: "test" }, + }), + { wrapper } + ); + await waitFor(() => result.current.isSuccess); + expect(result.current.data).toEqual({ + id: 1, + address: "test", + }); + }); + + it("should create user", async () => { + const apiClient = new Zodios(`http://localhost:${port}`, api); + const apiHooks = new ZodiosHooks("test", apiClient); + const { result, waitFor } = renderHook( + () => { + const [userCreated, setUserCreated] = React.useState<{ + id: number; + name: string; + }>(); + const apiMutations = apiHooks.usePost("/users", undefined, { + onSuccess: (data) => { + setUserCreated(data); + }, + }); + return { apiMutations, userCreated }; + }, + { wrapper } + ); + result.current.apiMutations.mutate({ name: "test" }); + await waitFor(() => result.current.apiMutations.isSuccess); + expect(result.current.userCreated).toEqual({ id: 3, name: "test" }); + }); + + it("should search immutable users", async () => { + const apiClient = new Zodios(`http://localhost:${port}`, api); + const apiHooks = new ZodiosHooks("test", apiClient); + const { result, waitFor } = renderHook( + () => + apiHooks.useImmutableQuery("/users/search", { + body: { + name: "User 21", + }, + }), + { wrapper } + ); + await waitFor(() => result.current.isSuccess); + expect(result.current.data).toEqual({ + page: 1, + count: 1, + users: [ + { + id: 21, + name: "User 21", + }, + ], + }); + expect(result.current.invalidate).toBeDefined(); + expect(result.current.key).toBeDefined(); + }); + + it("should search immutable users by alias", async () => { + const apiClient = new Zodios(`http://localhost:${port}`, api); + const apiHooks = new ZodiosHooks("test", apiClient); + const { result, waitFor } = renderHook( + () => apiHooks.useSearchUsers({ body: { name: "User 22" } }), + { wrapper } + ); + await waitFor(() => result.current.isSuccess); + expect(result.current.data).toEqual({ + page: 1, + count: 1, + users: [ + { + id: 22, + name: "User 22", + }, + ], + }); + expect(result.current.invalidate).toBeDefined(); + expect(result.current.key).toBeDefined(); + }); + + it("should update user", async () => { + const apiClient = new Zodios(`http://localhost:${port}`, api); + const apiHooks = new ZodiosHooks("test", apiClient); + const { result, waitFor } = renderHook( + () => { + const [userUpdated, setUserUpdated] = React.useState<{ + id: number; + name: string; + }>(); + const apiMutations = apiHooks.usePut("/users", undefined, { + onSuccess: (data) => { + setUserUpdated(data); + }, + }); + return { apiMutations, userUpdated }; + }, + { wrapper } + ); + result.current.apiMutations.mutate({ id: 1, name: "test" }); + await waitFor(() => result.current.apiMutations.isSuccess); + expect(result.current.userUpdated).toEqual({ id: 1, name: "test" }); + }); + + it("should patch user", async () => { + const apiClient = new Zodios(`http://localhost:${port}`, api); + const apiHooks = new ZodiosHooks("test", apiClient); + const { result, waitFor } = renderHook( + () => { + const [userPatched, setUserPatched] = React.useState<{ + id: number; + name: string; + }>(); + const apiMutations = apiHooks.usePatch("/users", undefined, { + onSuccess: (data) => { + setUserPatched(data); + }, + }); + return { apiMutations, userPatched }; + }, + { wrapper } + ); + result.current.apiMutations.mutate({ id: 2, name: "test" }); + await waitFor(() => result.current.apiMutations.isSuccess); + expect(result.current.userPatched).toEqual({ id: 2, name: "test" }); + }); + + it("should delete user", async () => { + const apiClient = new Zodios(`http://localhost:${port}`, api); + const apiHooks = new ZodiosHooks("test", apiClient); + const { result, waitFor } = renderHook( + () => { + const [userDeleted, setUserDeleted] = React.useState<{ + id: number; + }>(); + const apiMutations = apiHooks.useDelete( + "/users/:id", + { params: { id: 3 } }, + { + onSuccess: (data) => { + setUserDeleted(data); + }, + } + ); + return { apiMutations, userDeleted }; + }, + { wrapper } + ); + result.current.apiMutations.mutate(undefined); + await waitFor(() => result.current.apiMutations.isSuccess); + expect(result.current.userDeleted).toEqual({ id: 3 }); + }); + + it("should delete user with alias", async () => { + const apiClient = new Zodios(`http://localhost:${port}`, api); + const apiHooks = new ZodiosHooks("test", apiClient); + const { result, waitFor } = renderHook( + () => { + const [userDeleted, setUserDeleted] = React.useState<{ + id: number; + }>(); + const apiMutations = apiHooks.useDeleteUser( + { params: { id: 3 } }, + { + onSuccess: (data) => { + setUserDeleted(data); + }, + } + ); + return { apiMutations, userDeleted }; + }, + { wrapper } + ); + result.current.apiMutations.mutate(undefined); + await waitFor(() => result.current.apiMutations.isSuccess); + expect(result.current.userDeleted).toEqual({ id: 3 }); + }); + + it("should infinite load users", async () => { + const apiClient = new Zodios(`http://localhost:${port}`, api); + const apiHooks = new ZodiosHooks("test", apiClient); + const { result, waitFor } = renderHook( + () => { + const apiInfinite = apiHooks.useInfiniteQuery( + "/users", + { + queries: { limit: 10 }, + }, + { + getPageParamList: () => ["page"], + getNextPageParam: (lastPage, pages) => { + return lastPage.nextPage + ? { + queries: { + page: lastPage.nextPage, + }, + } + : undefined; + }, + } + ); + return { apiInfinite }; + }, + { wrapper } + ); + await waitFor(() => result.current.apiInfinite.isSuccess); + expect(result.current.apiInfinite.data?.pages).toEqual([ + { + users: [ + { + id: 1, + name: "User 1", + }, + { + id: 2, + name: "User 2", + }, + { + id: 3, + name: "User 3", + }, + { + id: 4, + name: "User 4", + }, + { + id: 5, + name: "User 5", + }, + { + id: 6, + name: "User 6", + }, + { + id: 7, + name: "User 7", + }, + { + id: 8, + name: "User 8", + }, + { + id: 9, + name: "User 9", + }, + { + id: 10, + name: "User 10", + }, + ], + page: 1, + count: 10, + nextPage: 2, + }, + ]); + + let i = 1; + do { + result.current.apiInfinite.fetchNextPage(); + await waitFor(() => result.current.apiInfinite.isFetching); + await waitFor(() => !result.current.apiInfinite.isFetching); + expect(result.current.apiInfinite.data?.pages.length).toEqual(++i); + } while (result.current.apiInfinite.hasNextPage); + expect(i).toEqual(3); + }); + + it("should infinite search users", async () => { + const apiClient = new Zodios(`http://localhost:${port}`, api); + const apiHooks = new ZodiosHooks("test", apiClient); + const { result, waitFor } = renderHook( + () => { + const apiInfinite = apiHooks.useImmutableInfiniteQuery( + "/users/search", + { + body: { + name: "User", + limit: 10, + }, + }, + { + getPageParamList: () => ["page"], + getNextPageParam: (lastPage, pages) => { + return lastPage.nextPage + ? { + body: { + page: lastPage.nextPage, + }, + } + : undefined; + }, + } + ); + return { apiInfinite }; + }, + { wrapper } + ); + await waitFor(() => result.current.apiInfinite.isSuccess); + expect(result.current.apiInfinite.data?.pages).toEqual([ + { + users: [ + { + id: 1, + name: "User 1", + }, + { + id: 2, + name: "User 2", + }, + { + id: 3, + name: "User 3", + }, + { + id: 4, + name: "User 4", + }, + { + id: 5, + name: "User 5", + }, + { + id: 6, + name: "User 6", + }, + { + id: 7, + name: "User 7", + }, + { + id: 8, + name: "User 8", + }, + { + id: 9, + name: "User 9", + }, + { + id: 10, + name: "User 10", + }, + ], + page: 1, + count: 10, + + nextPage: 2, + }, + ]); + + let i = 1; + do { + result.current.apiInfinite.fetchNextPage(); + await waitFor(() => result.current.apiInfinite.isFetching); + await waitFor(() => !result.current.apiInfinite.isFetching); + expect(result.current.apiInfinite.data?.pages.length).toEqual(++i); + if (i < 3) { + expect(result.current.apiInfinite.data?.pages[i - 1]).toEqual({ + users: Array.from({ length: 10 }, (_, ii) => ({ + id: (i - 1) * 10 + ii + 1, + name: `User ${(i - 1) * 10 + ii + 1}`, + })), + page: i, + count: 10, + + nextPage: i + 1, + }); + } + } while (result.current.apiInfinite.hasNextPage); + expect(i).toEqual(3); + }); + }); +}); diff --git a/packages/react/src/hooks.ts b/packages/react/src/hooks.ts new file mode 100644 index 00000000..185c6d96 --- /dev/null +++ b/packages/react/src/hooks.ts @@ -0,0 +1,871 @@ +import { + useQuery, + UseQueryOptions, + UseQueryResult, + useMutation, + UseMutationOptions, + UseMutationResult, + useInfiniteQuery, + UseInfiniteQueryOptions, + useQueryClient, + QueryFunctionContext, + QueryKey, + UseInfiniteQueryResult, +} from "@tanstack/react-query"; +import { + AnyZodiosFetcherProvider, + AnyZodiosTypeProvider, + ZodiosError, + ZodiosInstance, + ZodTypeProvider, +} from "@zodios/core"; +import type { + AnyZodiosMethodOptions, + Method, + ZodiosPathsByMethod, + ZodiosResponseByPath, + ZodiosResponseByAlias, + ZodiosEndpointDefinitions, + ZodiosEndpointDefinition, + ZodiosEndpointDefinitionByAlias, + ZodiosRequestOptionsByPath, + ZodiosBodyByPath, + ZodiosBodyByAlias, + ZodiosQueryParamsByPath, + ZodiosRequestOptionsByAlias, +} from "@zodios/core"; +import type { + Aliases, + MutationMethod, + ZodiosAliases, +} from "@zodios/core/lib/zodios.types"; +import type { + IfEquals, + PathParamNames, + ReadonlyDeep, + RequiredKeys, +} from "@zodios/core/lib/utils.types"; +import { capitalize, pick, omit, hasObjectBody } from "./utils"; + +type UndefinedIfNever = IfEquals; +type Errors = Error | ZodiosError; + +type MutationOptions< + Api extends ZodiosEndpointDefinition[], + M extends Method, + Path extends ZodiosPathsByMethod, + TypeProvider extends AnyZodiosTypeProvider +> = Omit< + UseMutationOptions< + Awaited>, + Errors, + UndefinedIfNever> + >, + "mutationFn" | "mutationKey" +>; + +type MutationOptionsByAlias< + Api extends ZodiosEndpointDefinition[], + Alias extends string, + TypeProvider extends AnyZodiosTypeProvider +> = Omit< + UseMutationOptions< + Awaited>, + Errors, + UndefinedIfNever> + >, + "mutationFn" +>; + +export type QueryOptions = Omit< + UseQueryOptions, + "queryKey" | "queryFn" +>; + +type ImmutableQueryOptions = Omit< + UseQueryOptions, + "queryKey" | "queryFn" +>; + +type InfiniteQueryOptions = Omit< + UseInfiniteQueryOptions, + "queryKey" | "queryFn" +>; + +export type ImmutableInfiniteQueryOptions = Omit< + UseInfiniteQueryOptions, + "queryKey" | "queryFn" +>; + +export class ZodiosHooksClass< + Api extends ZodiosEndpointDefinitions, + FetcherProvider extends AnyZodiosFetcherProvider, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> { + constructor( + private readonly apiName: string, + private readonly zodios: ZodiosInstance + ) { + this.injectAliasEndpoints(); + } + + private injectAliasEndpoints() { + this.zodios.api.forEach((endpoint) => { + if (endpoint.alias) { + if (["post", "put", "patch", "delete"].includes(endpoint.method)) { + if (endpoint.method === "post" && endpoint.immutable) { + (this as any)[`use${capitalize(endpoint.alias)}`] = ( + config: any, + mutationOptions: any + ) => + this.useImmutableQuery( + endpoint.path as any, + config, + mutationOptions + ); + } else { + (this as any)[`use${capitalize(endpoint.alias)}`] = ( + config: any, + mutationOptions: any + ) => + this.useMutation( + endpoint.method, + endpoint.path as any, + config, + mutationOptions + ); + } + } else { + (this as any)[`use${capitalize(endpoint.alias)}`] = ( + config: any, + queryOptions: any + ) => this.useQuery(endpoint.path as any, config, queryOptions); + } + } + }); + } + + private getEndpointByPath(method: string, path: string) { + return this.zodios.api.find( + (endpoint) => endpoint.method === method && endpoint.path === path + ); + } + + private getEndpointByAlias(alias: string) { + return this.zodios.api.find((endpoint) => endpoint.alias === alias); + } + + /** + * compute the key for the provided endpoint + * @param method - HTTP method of the endpoint + * @param path - path for the endpoint + * @param config - parameters of the api to the endpoint - when providing no parameters, will return the common key for the endpoint + * @returns - Key + */ + getKeyByPath>( + method: M, + path: Path extends ZodiosPathsByMethod ? Path : never, + config?: ZodiosRequestOptionsByPath< + Api, + M, + Path, + FetcherProvider, + true, + TypeProvider + > + ) { + const endpoint = this.getEndpointByPath(method, path); + if (!endpoint) + throw new Error(`No endpoint found for path '${method} ${path}'`); + if (config) { + const params = pick( + config as AnyZodiosMethodOptions | undefined, + ["params", "queries"] + ); + return [{ api: this.apiName, path: endpoint.path }, params] as QueryKey; + } + return [{ api: this.apiName, path: endpoint.path }] as QueryKey; + } + + /** + * compute the key for the provided endpoint alias + * @param alias - alias of the endpoint + * @param config - parameters of the api to the endpoint + * @returns - QueryKey + */ + getKeyByAlias< + Alias extends keyof ZodiosAliases + >( + alias: Alias extends string ? Alias : never, + config?: Alias extends string + ? ZodiosRequestOptionsByAlias< + Api, + Alias, + FetcherProvider, + true, + TypeProvider + > + : never + ) { + const endpoint = this.getEndpointByAlias(alias); + if (!endpoint) throw new Error(`No endpoint found for alias '${alias}'`); + if (config) { + const params = pick( + config as AnyZodiosMethodOptions | undefined, + ["params", "queries"] + ); + return [{ api: this.apiName, path: endpoint.path }, params] as QueryKey; + } + return [{ api: this.apiName, path: endpoint.path }] as QueryKey; + } + + useQuery< + Path extends ZodiosPathsByMethod, + TConfig extends ZodiosRequestOptionsByPath< + Api, + "get", + Path, + FetcherProvider, + true, + TypeProvider + >, + TQueryFnData = ZodiosResponseByPath, + TData = TQueryFnData + >( + path: Path, + ...[config, queryOptions]: RequiredKeys extends never + ? [ + config?: ReadonlyDeep, + queryOptions?: QueryOptions + ] + : [ + config: ReadonlyDeep, + queryOptions?: QueryOptions + ] + ): UseQueryResult & { + invalidate: () => Promise; + key: QueryKey; + } { + const params = pick( + config as AnyZodiosMethodOptions | undefined, + ["params", "queries", "body"] + ); + const key = [{ api: this.apiName, path }, params] as QueryKey; + // @ts-expect-error + const query = () => this.zodios.get(path, config); + const queryClient = useQueryClient(); + const invalidate = () => queryClient.invalidateQueries(key); + return { + invalidate, + key, + // @ts-expect-error + ...useQuery(key, query, queryOptions), + }; + } + + useImmutableQuery< + Path extends ZodiosPathsByMethod, + TConfig extends ZodiosRequestOptionsByPath< + Api, + "post", + Path, + FetcherProvider, + true, + TypeProvider + >, + TQueryFnData = ZodiosResponseByPath, + TData = TQueryFnData + >( + path: Path, + ...[config, queryOptions]: RequiredKeys extends never + ? [ + config?: ReadonlyDeep, + queryOptions?: ImmutableQueryOptions + ] + : [ + config: ReadonlyDeep, + queryOptions?: ImmutableQueryOptions + ] + ): UseQueryResult & { + invalidate: () => Promise; + key: QueryKey; + } { + const params = pick( + config as AnyZodiosMethodOptions | undefined, + ["params", "queries", "body"] + ); + const key = [{ api: this.apiName, path }, params] as QueryKey; + const query = () => this.zodios.post(path, config as any); + const queryClient = useQueryClient(); + const invalidate = () => queryClient.invalidateQueries(key); + return { + invalidate, + key, + ...useQuery(key, query as any, queryOptions), + }; + } + + useInfiniteQuery< + Path extends ZodiosPathsByMethod, + TConfig extends ZodiosRequestOptionsByPath< + Api, + "get", + Path, + FetcherProvider, + true, + TypeProvider + >, + TQueryFnData = ZodiosResponseByPath, + TData = TQueryFnData, + TQueryParams = ZodiosQueryParamsByPath< + Api, + "get", + Path, + true, + TypeProvider + > extends never + ? never + : keyof ZodiosQueryParamsByPath + >( + path: Path, + ...[config, queryOptions]: RequiredKeys extends never + ? [ + config?: ReadonlyDeep, + queryOptions?: InfiniteQueryOptions & { + getPageParamList: () => (TQueryParams | PathParamNames)[]; + } + ] + : [ + config: ReadonlyDeep, + queryOptions?: InfiniteQueryOptions & { + getPageParamList: () => (TQueryParams | PathParamNames)[]; + } + ] + ): UseInfiniteQueryResult & { + invalidate: () => Promise; + key: QueryKey; + } { + const params = pick( + config as AnyZodiosMethodOptions | undefined, + ["params", "queries", "body"] + ); + // istanbul ignore next + if (params.params && queryOptions) { + // @ts-expect-error + params.params = omit( + params.params, + queryOptions.getPageParamList() as string[] + ); + } + if (params.queries && queryOptions) { + // @ts-expect-error + params.queries = omit( + params.queries, + queryOptions.getPageParamList() as string[] + ); + } + // istanbul ignore next + if ( + params.body && + typeof params.body === "object" && + !Array.isArray(params.body) && + queryOptions + ) { + // @ts-expect-error + params.body = omit( + params.body, + queryOptions.getPageParamList() as string[] + ); + } + const key = [{ api: this.apiName, path }, params]; + const query = ({ pageParam = undefined }: QueryFunctionContext) => + this.zodios.get(path, { + ...config, + queries: { + ...config?.queries, + ...pageParam?.queries, + }, + params: { + ...config?.params, + ...pageParam?.params, + }, + body: + // istanbul ignore next + hasObjectBody(config) + ? { + ...config?.body, + ...pageParam?.body, + } + : config?.body, + } as unknown as ReadonlyDeep); + const queryClient = useQueryClient(); + const invalidate = () => queryClient.invalidateQueries(key); + return { + invalidate, + key, + ...useInfiniteQuery( + key, + query as any, + queryOptions as Omit + ), + }; + } + + useImmutableInfiniteQuery< + Path extends ZodiosPathsByMethod, + TConfig extends ZodiosRequestOptionsByPath< + Api, + "post", + Path, + FetcherProvider, + true, + TypeProvider + >, + TQueryFnData = ZodiosResponseByPath, + TData = TQueryFnData, + TQueryParams = ZodiosQueryParamsByPath< + Api, + "post", + Path, + true, + TypeProvider + > extends never + ? never + : keyof ZodiosQueryParamsByPath + >( + path: Path, + ...[config, queryOptions]: RequiredKeys extends never + ? [ + config?: ReadonlyDeep, + queryOptions?: ImmutableInfiniteQueryOptions & { + getPageParamList: () => ( + | keyof ZodiosBodyByPath + | PathParamNames + | TQueryParams + )[]; + } + ] + : [ + config: ReadonlyDeep, + queryOptions?: ImmutableInfiniteQueryOptions & { + getPageParamList: () => ( + | keyof ZodiosBodyByPath + | PathParamNames + | TQueryParams + )[]; + } + ] + ): UseInfiniteQueryResult & { + invalidate: () => Promise; + key: QueryKey; + } { + const params = pick( + config as AnyZodiosMethodOptions | undefined, + ["params", "queries", "body"] + ); + // istanbul ignore next + if (params.params && queryOptions) { + // @ts-expect-error + params.params = omit( + params.params, + queryOptions.getPageParamList() as string[] + ); + } + // istanbul ignore next + if (params.queries && queryOptions) { + // @ts-expect-error + params.queries = omit( + params.queries, + queryOptions.getPageParamList() as string[] + ); + } + // istanbul ignore next + if ( + params.body && + typeof params.body === "object" && + !Array.isArray(params.body) && + queryOptions + ) { + // @ts-expect-error + params.body = omit( + params.body, + queryOptions.getPageParamList() as string[] + ); + } + const key = [{ api: this.apiName, path }, params]; + const query = ({ pageParam = undefined }: QueryFunctionContext) => + this.zodios.post(path, { + ...config, + queries: { + ...config?.queries, + ...pageParam?.queries, + }, + params: { + ...config?.params, + ...pageParam?.params, + }, + body: + // istanbul ignore next + hasObjectBody(config) + ? { + ...config?.body, + ...pageParam?.body, + } + : config?.body, + } as unknown as ReadonlyDeep); + const queryClient = useQueryClient(); + const invalidate = () => queryClient.invalidateQueries(key); + return { + invalidate, + key, + ...useInfiniteQuery( + key, + // @ts-expect-error + query, + queryOptions as Omit + ), + }; + } + + useMutation< + M extends Method, + Path extends ZodiosPathsByMethod, + TConfig extends Omit< + ZodiosRequestOptionsByPath< + Api, + M, + Path, + FetcherProvider, + true, + TypeProvider + >, + "body" + >, + MutationVariables = UndefinedIfNever< + ZodiosBodyByPath + > + >( + method: M, + path: Path, + ...[config, mutationOptions]: RequiredKeys extends never + ? [ + config?: ReadonlyDeep, + mutationOptions?: MutationOptions + ] + : [ + config: ReadonlyDeep, + mutationOptions?: MutationOptions + ] + ): UseMutationResult< + ZodiosResponseByPath, + Errors, + MutationVariables + > { + const mutation = (body: MutationVariables) => { + return this.zodios.request({ + ...config, + method, + url: path, + body, + } as any); + }; + // @ts-expect-error + return useMutation(mutation, mutationOptions); + } + + useGet< + Path extends ZodiosPathsByMethod, + TConfig extends ZodiosRequestOptionsByPath< + Api, + "get", + Path, + FetcherProvider, + true, + TypeProvider + >, + TQueryFnData = ZodiosResponseByPath, + TData = TQueryFnData + >( + path: Path, + ...rest: RequiredKeys extends never + ? [ + config?: ReadonlyDeep, + queryOptions?: QueryOptions + ] + : [ + config: ReadonlyDeep, + queryOptions?: QueryOptions + ] + ): UseQueryResult & { + invalidate: () => Promise; + key: QueryKey; + } { + return this.useQuery(path, ...(rest as any[])); + } + + usePost< + Path extends ZodiosPathsByMethod, + TConfig extends Omit< + ZodiosRequestOptionsByPath< + Api, + "post", + Path, + FetcherProvider, + true, + TypeProvider + >, + "body" + >, + MutationVariables = UndefinedIfNever< + ZodiosBodyByPath + > + >( + path: Path, + ...rest: RequiredKeys extends never + ? [ + config?: ReadonlyDeep, + mutationOptions?: MutationOptions + ] + : [ + config: ReadonlyDeep, + mutationOptions?: MutationOptions + ] + ): UseMutationResult< + ZodiosResponseByPath, + Errors, + MutationVariables + > { + // @ts-expect-error + return this.useMutation("post", path, ...rest); + } + + usePut< + Path extends ZodiosPathsByMethod, + TConfig extends Omit< + ZodiosRequestOptionsByPath< + Api, + "put", + Path, + FetcherProvider, + true, + TypeProvider + >, + "body" + >, + MutationVariables = UndefinedIfNever< + ZodiosBodyByPath + > + >( + path: Path, + ...rest: RequiredKeys extends never + ? [ + config?: ReadonlyDeep, + mutationOptions?: MutationOptions + ] + : [ + config: ReadonlyDeep, + mutationOptions?: MutationOptions + ] + ): UseMutationResult< + ZodiosResponseByPath, + Errors, + MutationVariables + > { + // @ts-expect-error + return this.useMutation("put", path, ...rest); + } + + usePatch< + Path extends ZodiosPathsByMethod, + TConfig extends Omit< + ZodiosRequestOptionsByPath< + Api, + "patch", + Path, + FetcherProvider, + true, + TypeProvider + >, + "body" + >, + MutationVariables = UndefinedIfNever< + ZodiosBodyByPath + > + >( + path: Path, + ...rest: RequiredKeys extends never + ? [ + config?: ReadonlyDeep, + mutationOptions?: MutationOptions + ] + : [ + config: ReadonlyDeep, + mutationOptions?: MutationOptions + ] + ): UseMutationResult< + ZodiosResponseByPath, + Errors, + MutationVariables + > { + // @ts-expect-error + return this.useMutation("patch", path, ...rest); + } + + useDelete< + Path extends ZodiosPathsByMethod, + TConfig extends Omit< + ZodiosRequestOptionsByPath< + Api, + "delete", + Path, + FetcherProvider, + true, + TypeProvider + >, + "body" + >, + MutationVariables = UndefinedIfNever< + ZodiosBodyByPath + > + >( + path: Path, + ...rest: RequiredKeys extends never + ? [ + config?: ReadonlyDeep, + mutationOptions?: MutationOptions + ] + : [ + config: ReadonlyDeep, + mutationOptions?: MutationOptions + ] + ): UseMutationResult< + ZodiosResponseByPath, + Errors, + MutationVariables + > { + // @ts-expect-error + return this.useMutation("delete", path, ...rest); + } +} + +export type ZodiosMutationAliasHook = + RequiredKeys extends never + ? ( + configOptions?: ReadonlyDeep, + mutationOptions?: MutationOptions + ) => UseMutationResult, unknown> + : ( + configOptions: ReadonlyDeep, + mutationOptions?: MutationOptions + ) => UseMutationResult, unknown>; + +export type ZodiosHooksAliases< + Api extends ZodiosEndpointDefinitions, + FetcherProvider extends AnyZodiosFetcherProvider, + TypeProvider extends AnyZodiosTypeProvider +> = { + [Alias in Aliases as `use${Capitalize}`]: ZodiosEndpointDefinitionByAlias< + Api, + Alias + >[number]["method"] extends infer AliasMethod + ? AliasMethod extends MutationMethod + ? { + immutable: ZodiosEndpointDefinitionByAlias< + Api, + Alias + >[number]["immutable"]; + method: AliasMethod; + } extends { immutable: true; method: "post" } + ? // immutable query + < + TConfig extends ZodiosRequestOptionsByAlias< + Api, + Alias, + FetcherProvider, + true, + TypeProvider + >, + TQueryFnData = ZodiosResponseByAlias< + Api, + Alias, + true, + TypeProvider + >, + TData = ZodiosResponseByAlias + >( + ...[config, queryOptions]: RequiredKeys extends never + ? [ + config?: ReadonlyDeep, + queryOptions?: ImmutableQueryOptions + ] + : [ + config: ReadonlyDeep, + queryOptions?: ImmutableQueryOptions + ] + ) => UseQueryResult & { + invalidate: () => Promise; + key: QueryKey; + } + : // useMutation + ZodiosMutationAliasHook< + ZodiosBodyByAlias, + Omit< + ZodiosRequestOptionsByAlias< + Api, + Alias, + FetcherProvider, + true, + TypeProvider + >, + "body" + >, + MutationOptionsByAlias, + ZodiosResponseByAlias + > + : // useQuery + < + Config extends ZodiosRequestOptionsByAlias< + Api, + Alias, + FetcherProvider, + true, + TypeProvider + >, + TQueryFnData = ZodiosResponseByAlias, + TData = ZodiosResponseByAlias + >( + ...rest: RequiredKeys extends never + ? [ + configOptions?: ReadonlyDeep, + queryOptions?: QueryOptions + ] + : [ + configOptions: ReadonlyDeep, + queryOptions?: QueryOptions + ] + ) => UseQueryResult & { + invalidate: () => Promise; + key: QueryKey; + } + : never; +}; + +export type ZodiosHooksInstance< + Api extends ZodiosEndpointDefinitions, + FetcherProvider extends AnyZodiosFetcherProvider, + TypeProvider extends AnyZodiosTypeProvider +> = ZodiosHooksClass & + ZodiosHooksAliases; + +export type ZodiosHooksConstructor = { + new < + Api extends ZodiosEndpointDefinitions, + FetcherProvider extends AnyZodiosFetcherProvider, + TypeProvider extends AnyZodiosTypeProvider + >( + name: string, + zodios: ZodiosInstance + ): ZodiosHooksInstance; +}; + +export const ZodiosHooks = ZodiosHooksClass as ZodiosHooksConstructor; diff --git a/packages/react/src/index.ts b/packages/react/src/index.ts new file mode 100644 index 00000000..9b1f511f --- /dev/null +++ b/packages/react/src/index.ts @@ -0,0 +1,6 @@ +export { + ZodiosHooks, + ZodiosHooksClass, + ZodiosHooksConstructor, + ZodiosHooksInstance, +} from "./hooks"; diff --git a/packages/react/src/utils.test.ts b/packages/react/src/utils.test.ts new file mode 100644 index 00000000..acd308bd --- /dev/null +++ b/packages/react/src/utils.test.ts @@ -0,0 +1,86 @@ +import { capitalize, omit, pick } from "./utils"; + +describe("omit", () => { + it("should be defined", () => { + expect(omit).toBeDefined(); + }); + + it("should support undefined parameters", () => { + const obj: any = undefined; + expect(omit(obj, ["a"])).toEqual({}); + }); + + it("should remove the given keys from the object", () => { + const obj = { + a: 1, + b: 2, + c: 3, + }; + + expect(omit(obj, ["a"])).toEqual({ + b: 2, + c: 3, + }); + }); + + it("should accept to remove all keys from object", () => { + const obj = { + a: 1, + b: 2, + c: 3, + }; + + expect(omit(obj, ["a", "b", "c"])).toEqual({}); + }); +}); + +describe("pick", () => { + it("should be defined", () => { + expect(pick).toBeDefined(); + }); + + it("should support undefined parameters", () => { + const obj: any = undefined; + expect(pick(obj, ["a"])).toEqual({}); + }); + + it("should pick the given keys from the object", () => { + const obj = { + a: 1, + b: 2, + c: 3, + }; + + expect(pick(obj, ["a"])).toEqual({ + a: 1, + }); + }); + + it("should accept to pick all keys from object", () => { + const obj = { + a: 1, + b: 2, + c: 3, + }; + + expect(pick(obj, ["a", "b", "c"])).toEqual(obj); + }); + + it("should allow undefined picks", () => { + expect(pick(undefined, ["a", "b"])).toEqual({}); + }); +}); + +describe("capitalize", () => { + it("should be defined", () => { + expect(capitalize).toBeDefined(); + }); + + it("should capitalize the first letter of the string", () => { + expect(capitalize("anyway")).toEqual("Anyway"); + }); + + it("should capitalize the first letter of an utf8 string", () => { + expect(capitalize("émmanuelle")).toEqual("Émmanuelle"); + }); +}); diff --git a/packages/react/src/utils.ts b/packages/react/src/utils.ts new file mode 100644 index 00000000..96c85756 --- /dev/null +++ b/packages/react/src/utils.ts @@ -0,0 +1,56 @@ +import { AnyZodiosRequestOptions } from "@zodios/core"; + +/** + * omit properties from an object + * @param obj - the object to omit properties from + * @param keys - the keys to omit + * @returns the object with the omitted properties + */ +export function omit( + obj: T | undefined, + keys: K[] +): Omit { + const ret = { ...obj } as T; + for (const key of keys) { + delete ret[key]; + } + return ret; +} + +/** + * pick properties from an object + * @param obj - the object to pick properties from + * @param keys - the keys to pick + * @returns the object with the picked properties + */ +export function pick, K extends keyof T>( + obj: T | undefined, + keys: K[] +): Pick { + const ret = {} as Pick; + if (obj) { + for (const key of keys) { + if (key in obj && obj[key] !== undefined) { + ret[key] = obj[key]; + } + } + } + return ret; +} + +/** + * set first letter of a string to uppercase + * @param str - the string to capitalize + * @returns - the string with the first letter uppercased + */ +export function capitalize(str: string) { + return str.charAt(0).toUpperCase() + str.slice(1); +} + +export function hasObjectBody(config?: any) { + return ( + config?.body && + typeof config.body === "object" && + !Array.isArray(config.body) + ); +} diff --git a/packages/react/tsconfig.build.json b/packages/react/tsconfig.build.json new file mode 100644 index 00000000..496e5472 --- /dev/null +++ b/packages/react/tsconfig.build.json @@ -0,0 +1,20 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "target": "ES6", + "sourceMap": false + }, + "exclude": [ + "node_modules", + "lib", + "coverage", + "examples", + "**/*.config.js", + "**/*.config.ts", + "**/*.spec.ts", + "**/*.spec.tsx", + "**/*.test.ts", + "**/*.test.tsx", + "**/*.d.ts" + ] +} diff --git a/packages/react/tsconfig.json b/packages/react/tsconfig.json new file mode 100644 index 00000000..240c1c11 --- /dev/null +++ b/packages/react/tsconfig.json @@ -0,0 +1,18 @@ +{ + // ts config for es 2021 + "compilerOptions": { + "target": "ES2019", + "module": "CommonJS", + "moduleResolution": "Node", + "lib": ["ES2019"], + "outDir": "./lib", + "alwaysStrict": true, + "strict": true, + "esModuleInterop": true, + "sourceMap": true, + "declaration": true, + "allowJs": true, + "jsx": "react-jsx" + }, + "exclude": ["node_modules", "lib", "coverage"] +} diff --git a/packages/react/tsup.config.js b/packages/react/tsup.config.js new file mode 100644 index 00000000..899d5e3f --- /dev/null +++ b/packages/react/tsup.config.js @@ -0,0 +1,14 @@ +import { defineConfig } from "tsup"; + +export default defineConfig({ + clean: true, + dts: true, + entry: ["src/index.ts"], + outDir: "lib", + format: ["cjs", "esm"], + minify: true, + treeshake: true, + tsconfig: "tsconfig.build.json", + splitting: true, + sourcemap: false, +}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5cb0a4b7..5676544f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -96,8 +96,7 @@ importers: '@types/multer': 1.4.7 '@types/node': 18.11.9 '@zodios/core': workspace:* - axios: 1.1.3 - cross-fetch: ^3.1.5 + cross-fetch: 3.1.5 express: 4.18.2 fp-ts: 2.13.1 io-ts: 2.2.19 @@ -118,7 +117,6 @@ importers: '@types/jest': 29.2.2 '@types/multer': 1.4.7 '@types/node': 18.11.9 - axios: 1.1.3 cross-fetch: 3.1.5 express: 4.18.2 fp-ts: 2.13.1 @@ -132,6 +130,68 @@ importers: typescript: 4.9.3 zod: 3.19.1 + packages/react: + specifiers: + '@jest/globals': 29.3.1 + '@jest/types': 29.3.1 + '@tanstack/react-query': 4.16.1 + '@testing-library/dom': 8.19.0 + '@testing-library/jest-dom': 5.16.5 + '@testing-library/react': 13.4.0 + '@testing-library/react-hooks': 8.0.1 + '@testing-library/user-event': 14.4.3 + '@types/cors': 2.8.12 + '@types/express': 4.17.14 + '@types/jest': 29.2.3 + '@types/node': 18.11.9 + '@types/react': 18.0.25 + '@zodios/core': workspace:* + '@zodios/fetch': workspace:* + cors: 2.8.5 + cross-fetch: 3.1.5 + express: 4.18.2 + jest: 29.3.1 + jest-environment-jsdom: 29.3.1 + react: 18.2.0 + react-dom: 18.2.0 + react-test-renderer: 18.2.0 + rimraf: 3.0.2 + ts-jest: 29.0.3 + ts-node: 10.9.1 + tsup: 6.3.0 + typescript: 4.9.3 + zod: 3.19.1 + devDependencies: + '@jest/globals': 29.3.1 + '@jest/types': 29.3.1 + '@tanstack/react-query': 4.16.1_biqbaboplfbrettd7655fr4n2y + '@testing-library/dom': 8.19.0 + '@testing-library/jest-dom': 5.16.5 + '@testing-library/react': 13.4.0_biqbaboplfbrettd7655fr4n2y + '@testing-library/react-hooks': 8.0.1_djah6xjkh3i2bchfafvsnwdbb4 + '@testing-library/user-event': 14.4.3_aaq3sbffpfe3jnxzm2zngsddei + '@types/cors': 2.8.12 + '@types/express': 4.17.14 + '@types/jest': 29.2.3 + '@types/node': 18.11.9 + '@types/react': 18.0.25 + '@zodios/core': link:../core + '@zodios/fetch': link:../fetch + cors: 2.8.5 + cross-fetch: 3.1.5 + express: 4.18.2 + jest: 29.3.1_odkjkoia5xunhxkdrka32ib6vi + jest-environment-jsdom: 29.3.1 + react: 18.2.0 + react-dom: 18.2.0_react@18.2.0 + react-test-renderer: 18.2.0_react@18.2.0 + rimraf: 3.0.2 + ts-jest: 29.0.3_wcjxlcwfjvs73rqh2tjbxyoefa + ts-node: 10.9.1_wup25etrarvlqkprac7h35hj7u + tsup: 6.3.0_2dtigtkb225m7ii7q45utxqwgi + typescript: 4.9.3 + zod: 3.19.1 + packages/testing: specifiers: '@jest/globals': 29.3.1 @@ -170,6 +230,10 @@ importers: packages: + /@adobe/css-tools/4.0.1: + resolution: {integrity: sha512-+u76oB43nOHrF4DDWRLWDCtci7f3QJoEBigemIdIeTi1ODqjx6Tad9NCVnPRwewWlKkVab5PlK8DCtPTyX7S8g==} + dev: true + /@ampproject/remapping/2.2.0: resolution: {integrity: sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w==} engines: {node: '>=6.0.0'} @@ -1055,6 +1119,109 @@ packages: '@sinonjs/commons': 1.8.5 dev: true + /@tanstack/query-core/4.15.1: + resolution: {integrity: sha512-+UfqJsNbPIVo0a9ANW0ZxtjiMfGLaaoIaL9vZeVycvmBuWywJGtSi7fgPVMCPdZQFOzMsaXaOsDtSKQD5xLRVQ==} + dev: true + + /@tanstack/react-query/4.16.1_biqbaboplfbrettd7655fr4n2y: + resolution: {integrity: sha512-PDE9u49wSDykPazlCoLFevUpceLjQ0Mm8i6038HgtTEKb/aoVnUZdlUP7C392ds3Cd75+EGlHU7qpEX06R7d9Q==} + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-native: '*' + peerDependenciesMeta: + react-dom: + optional: true + react-native: + optional: true + dependencies: + '@tanstack/query-core': 4.15.1 + react: 18.2.0 + react-dom: 18.2.0_react@18.2.0 + use-sync-external-store: 1.2.0_react@18.2.0 + dev: true + + /@testing-library/dom/8.19.0: + resolution: {integrity: sha512-6YWYPPpxG3e/xOo6HIWwB/58HukkwIVTOaZ0VwdMVjhRUX/01E4FtQbck9GazOOj7MXHc5RBzMrU86iBJHbI+A==} + engines: {node: '>=12'} + dependencies: + '@babel/code-frame': 7.18.6 + '@babel/runtime': 7.20.1 + '@types/aria-query': 4.2.2 + aria-query: 5.1.3 + chalk: 4.1.2 + dom-accessibility-api: 0.5.14 + lz-string: 1.4.4 + pretty-format: 27.5.1 + dev: true + + /@testing-library/jest-dom/5.16.5: + resolution: {integrity: sha512-N5ixQ2qKpi5OLYfwQmUb/5mSV9LneAcaUfp32pn4yCnpb8r/Yz0pXFPck21dIicKmi+ta5WRAknkZCfA8refMA==} + engines: {node: '>=8', npm: '>=6', yarn: '>=1'} + dependencies: + '@adobe/css-tools': 4.0.1 + '@babel/runtime': 7.20.1 + '@types/testing-library__jest-dom': 5.14.5 + aria-query: 5.1.3 + chalk: 3.0.0 + css.escape: 1.5.1 + dom-accessibility-api: 0.5.14 + lodash: 4.17.21 + redent: 3.0.0 + dev: true + + /@testing-library/react-hooks/8.0.1_djah6xjkh3i2bchfafvsnwdbb4: + resolution: {integrity: sha512-Aqhl2IVmLt8IovEVarNDFuJDVWVvhnr9/GCU6UUnrYXwgDFF9h2L2o2P9KBni1AST5sT6riAyoukFLyjQUgD/g==} + engines: {node: '>=12'} + peerDependencies: + '@types/react': ^16.9.0 || ^17.0.0 + react: ^16.9.0 || ^17.0.0 + react-dom: ^16.9.0 || ^17.0.0 + react-test-renderer: ^16.9.0 || ^17.0.0 + peerDependenciesMeta: + '@types/react': + optional: true + react-dom: + optional: true + react-test-renderer: + optional: true + dependencies: + '@babel/runtime': 7.20.1 + '@types/react': 18.0.25 + react: 18.2.0 + react-dom: 18.2.0_react@18.2.0 + react-error-boundary: 3.1.4_react@18.2.0 + react-test-renderer: 18.2.0_react@18.2.0 + dev: true + + /@testing-library/react/13.4.0_biqbaboplfbrettd7655fr4n2y: + resolution: {integrity: sha512-sXOGON+WNTh3MLE9rve97ftaZukN3oNf2KjDy7YTx6hcTO2uuLHuCGynMDhFwGw/jYf4OJ2Qk0i4i79qMNNkyw==} + engines: {node: '>=12'} + peerDependencies: + react: ^18.0.0 + react-dom: ^18.0.0 + dependencies: + '@babel/runtime': 7.20.1 + '@testing-library/dom': 8.19.0 + '@types/react-dom': 18.0.9 + react: 18.2.0 + react-dom: 18.2.0_react@18.2.0 + dev: true + + /@testing-library/user-event/14.4.3_aaq3sbffpfe3jnxzm2zngsddei: + resolution: {integrity: sha512-kCUc5MEwaEMakkO5x7aoD+DLi02ehmEM2QCGWvNqAS1dV/fAvORWEjnjsEIvml59M7Y5kCkWN6fCCyPOe8OL6Q==} + engines: {node: '>=12', npm: '>=6'} + peerDependencies: + '@testing-library/dom': '>=7.21.4' + dependencies: + '@testing-library/dom': 8.19.0 + dev: true + + /@tootallnate/once/2.0.0: + resolution: {integrity: sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==} + engines: {node: '>= 10'} + dev: true + /@tsconfig/node10/1.0.9: resolution: {integrity: sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==} dev: true @@ -1071,6 +1238,10 @@ packages: resolution: {integrity: sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==} dev: true + /@types/aria-query/4.2.2: + resolution: {integrity: sha512-HnYpAE1Y6kRyKM/XkEuiRQhTHvkzMBurTHnpFLYLBGPIylZNPs9jJcuOOYWxPLJCSEtmZT0Y8rHDokKN7rRTig==} + dev: true + /@types/babel__core/7.1.20: resolution: {integrity: sha512-PVb6Bg2QuscZ30FvOU7z4guG6c926D9YRvOxEaelzndpMsvP+YM74Q/dAFASpg2l6+XLalxSGxcq/lrgYWZtyQ==} dependencies: @@ -1113,6 +1284,10 @@ packages: '@types/node': 18.11.9 dev: true + /@types/cors/2.8.12: + resolution: {integrity: sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==} + dev: true + /@types/express-serve-static-core/4.17.31: resolution: {integrity: sha512-DxMhY+NAsTwMMFHBTtJFNp5qiHKJ7TeqOo23zVEM9alT1Ml27Q3xcTH0xwxn7Q0BbMcVEJOs/7aQtUWupUQN3Q==} dependencies: @@ -1165,6 +1340,21 @@ packages: pretty-format: 29.3.1 dev: true + /@types/jest/29.2.3: + resolution: {integrity: sha512-6XwoEbmatfyoCjWRX7z0fKMmgYKe9+/HrviJ5k0X/tjJWHGAezZOfYaxqQKuzG/TvQyr+ktjm4jgbk0s4/oF2w==} + dependencies: + expect: 29.3.1 + pretty-format: 29.3.1 + dev: true + + /@types/jsdom/20.0.1: + resolution: {integrity: sha512-d0r18sZPmMQr1eG35u12FZfhIXNrnsPU/g5wvRKCUf/tOGilKKwYMYGqh33BNR6ba+2gkHw1EUiHoN3mn7E5IQ==} + dependencies: + '@types/node': 18.11.9 + '@types/tough-cookie': 4.0.2 + parse5: 7.1.2 + dev: true + /@types/mime/3.0.1: resolution: {integrity: sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==} dev: true @@ -1195,6 +1385,10 @@ packages: resolution: {integrity: sha512-ri0UmynRRvZiiUJdiz38MmIblKK+oH30MztdBVR95dv/Ubw6neWSb8u1XpRb72L4qsZOhz+L+z9JD40SJmfWow==} dev: true + /@types/prop-types/15.7.5: + resolution: {integrity: sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==} + dev: true + /@types/qs/6.9.7: resolution: {integrity: sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==} dev: true @@ -1203,6 +1397,24 @@ packages: resolution: {integrity: sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==} dev: true + /@types/react-dom/18.0.9: + resolution: {integrity: sha512-qnVvHxASt/H7i+XG1U1xMiY5t+IHcPGUK7TDMDzom08xa7e86eCeKOiLZezwCKVxJn6NEiiy2ekgX8aQssjIKg==} + dependencies: + '@types/react': 18.0.25 + dev: true + + /@types/react/18.0.25: + resolution: {integrity: sha512-xD6c0KDT4m7n9uD4ZHi02lzskaiqcBxf4zi+tXZY98a04wvc0hi/TcCPC2FOESZi51Nd7tlUeOJY8RofL799/g==} + dependencies: + '@types/prop-types': 15.7.5 + '@types/scheduler': 0.16.2 + csstype: 3.1.1 + dev: true + + /@types/scheduler/0.16.2: + resolution: {integrity: sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==} + dev: true + /@types/semver/6.2.3: resolution: {integrity: sha512-KQf+QAMWKMrtBMsB8/24w53tEsxllMj6TuA80TT/5igJalLI/zm0L3oXRbIAl4Ohfc85gyHX/jhMwsVkmhLU4A==} dev: true @@ -1218,6 +1430,16 @@ packages: resolution: {integrity: sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==} dev: true + /@types/testing-library__jest-dom/5.14.5: + resolution: {integrity: sha512-SBwbxYoyPIvxHbeHxTZX2Pe/74F/tX2/D3mMvzabdeJ25bBojfW0TyB8BHrbq/9zaaKICJZjLP+8r6AeZMFCuQ==} + dependencies: + '@types/jest': 29.2.3 + dev: true + + /@types/tough-cookie/4.0.2: + resolution: {integrity: sha512-Q5vtl1W5ue16D+nIaW8JWebSSraJVlK+EthKn7e7UcD4KWsaSJ8BqGPXNaPghgtcn/fhvrN17Tv8ksUsQpiplw==} + dev: true + /@types/yargs-parser/21.0.0: resolution: {integrity: sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==} dev: true @@ -1228,6 +1450,10 @@ packages: '@types/yargs-parser': 21.0.0 dev: true + /abab/2.0.6: + resolution: {integrity: sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==} + dev: true + /accepts/1.3.8: resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==} engines: {node: '>= 0.6'} @@ -1236,6 +1462,13 @@ packages: negotiator: 0.6.3 dev: true + /acorn-globals/7.0.1: + resolution: {integrity: sha512-umOSDSDrfHbTNPuNpC2NSnnA3LUrqpevPb4T9jRx4MagXNS0rs+gwiTcAvqCRmsD6utzsrzNt+ebm00SNWiC3Q==} + dependencies: + acorn: 8.8.1 + acorn-walk: 8.2.0 + dev: true + /acorn-walk/8.2.0: resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==} engines: {node: '>=0.4.0'} @@ -1247,6 +1480,15 @@ packages: hasBin: true dev: true + /agent-base/6.0.2: + resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} + engines: {node: '>= 6.0.0'} + dependencies: + debug: 4.3.4 + transitivePeerDependencies: + - supports-color + dev: true + /ansi-colors/4.1.3: resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} engines: {node: '>=6'} @@ -1309,6 +1551,12 @@ packages: sprintf-js: 1.0.3 dev: true + /aria-query/5.1.3: + resolution: {integrity: sha512-R5iJ5lkuHybztUfuOAznmboyjWq8O6sqNqtK7CLOqdydi54VNbORp49mb14KbWgG1QD3JFO9hJdZ+y4KutfdOQ==} + dependencies: + deep-equal: 2.1.0 + dev: true + /array-flatten/1.1.1: resolution: {integrity: sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==} dev: true @@ -1337,14 +1585,9 @@ packages: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} dev: true - /axios/1.1.3: - resolution: {integrity: sha512-00tXVRwKx/FZr/IDVFt4C+f9FYairX517WoGCL6dpOntqLkZofjhu43F/Xl44UOpqa+9sLFDrG/XAnFsUYgkDA==} - dependencies: - follow-redirects: 1.15.2 - form-data: 4.0.0 - proxy-from-env: 1.1.0 - transitivePeerDependencies: - - debug + /available-typed-arrays/1.0.5: + resolution: {integrity: sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==} + engines: {node: '>= 0.4'} dev: true /axios/1.2.0: @@ -1584,6 +1827,14 @@ packages: supports-color: 5.5.0 dev: true + /chalk/3.0.0: + resolution: {integrity: sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==} + engines: {node: '>=8'} + dependencies: + ansi-styles: 4.3.0 + supports-color: 7.2.0 + dev: true + /chalk/4.1.2: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} @@ -1735,6 +1986,14 @@ packages: resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} dev: true + /cors/2.8.5: + resolution: {integrity: sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==} + engines: {node: '>= 0.10'} + dependencies: + object-assign: 4.1.1 + vary: 1.1.2 + dev: true + /create-require/1.1.1: resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} dev: true @@ -1764,6 +2023,29 @@ packages: which: 2.0.2 dev: true + /css.escape/1.5.1: + resolution: {integrity: sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg==} + dev: true + + /cssom/0.3.8: + resolution: {integrity: sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==} + dev: true + + /cssom/0.5.0: + resolution: {integrity: sha512-iKuQcq+NdHqlAcwUY0o/HL69XQrUaQdMjmStJ8JFmUaiiQErlhrmuigkg/CU4E2J0IyUKUrMAgl36TvN67MqTw==} + dev: true + + /cssstyle/2.3.0: + resolution: {integrity: sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==} + engines: {node: '>=8'} + dependencies: + cssom: 0.3.8 + dev: true + + /csstype/3.1.1: + resolution: {integrity: sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==} + dev: true + /csv-generate/3.4.3: resolution: {integrity: sha512-w/T+rqR0vwvHqWs/1ZyMDWtHHSJaN06klRqJXBEpDJaM/+dZkso0OKh1VcuuYvK3XM53KysVNq8Ko/epCK8wOw==} dev: true @@ -1786,6 +2068,15 @@ packages: stream-transform: 2.1.3 dev: true + /data-urls/3.0.2: + resolution: {integrity: sha512-Jy/tj3ldjZJo63sVAvg6LHt2mHvl4V6AgRAmNDtLdm7faqtsx+aJG42rsyCo9JCoRVKwPFzKlIPx3DIibwSIaQ==} + engines: {node: '>=12'} + dependencies: + abab: 2.0.6 + whatwg-mimetype: 3.0.0 + whatwg-url: 11.0.0 + dev: true + /debug/2.6.9: resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} peerDependencies: @@ -1822,10 +2113,38 @@ packages: engines: {node: '>=0.10.0'} dev: true + /decimal.js/10.4.2: + resolution: {integrity: sha512-ic1yEvwT6GuvaYwBLLY6/aFFgjZdySKTE8en/fkU3QICTmRtgtSlFn0u0BXN06InZwtfCelR7j8LRiDI/02iGA==} + dev: true + /dedent/0.7.0: resolution: {integrity: sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==} dev: true + /deep-equal/2.1.0: + resolution: {integrity: sha512-2pxgvWu3Alv1PoWEyVg7HS8YhGlUFUV7N5oOvfL6d+7xAmLSemMwv/c8Zv/i9KFzxV5Kt5CAvQc70fLwVuf4UA==} + dependencies: + call-bind: 1.0.2 + es-get-iterator: 1.1.2 + get-intrinsic: 1.1.3 + is-arguments: 1.1.1 + is-date-object: 1.0.5 + is-regex: 1.1.4 + isarray: 2.0.5 + object-is: 1.1.5 + object-keys: 1.1.1 + object.assign: 4.1.4 + regexp.prototype.flags: 1.4.3 + side-channel: 1.0.4 + which-boxed-primitive: 1.0.2 + which-collection: 1.0.1 + which-typed-array: 1.1.9 + dev: true + + /deep-is/0.1.4: + resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} + dev: true + /deepmerge/4.2.2: resolution: {integrity: sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==} engines: {node: '>=0.10.0'} @@ -1887,6 +2206,17 @@ packages: path-type: 4.0.0 dev: true + /dom-accessibility-api/0.5.14: + resolution: {integrity: sha512-NMt+m9zFMPZe0JcY9gN224Qvk6qLIdqex29clBvc/y75ZBX9YA9wNK3frsYvu2DI1xcCIwxwnX+TlsJ2DSOADg==} + dev: true + + /domexception/4.0.0: + resolution: {integrity: sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==} + engines: {node: '>=12'} + dependencies: + webidl-conversions: 7.0.0 + dev: true + /ee-first/1.1.1: resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} dev: true @@ -1916,6 +2246,11 @@ packages: ansi-colors: 4.1.3 dev: true + /entities/4.4.0: + resolution: {integrity: sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA==} + engines: {node: '>=0.12'} + dev: true + /error-ex/1.3.2: resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} dependencies: @@ -1952,6 +2287,19 @@ packages: unbox-primitive: 1.0.2 dev: true + /es-get-iterator/1.1.2: + resolution: {integrity: sha512-+DTO8GYwbMCwbywjimwZMHp8AuYXOS2JZFWoi2AlPOS3ebnII9w/NLpNZtA7A0YLaVDw+O7KFCeoIV7OPvM7hQ==} + dependencies: + call-bind: 1.0.2 + get-intrinsic: 1.1.3 + has-symbols: 1.0.3 + is-arguments: 1.1.1 + is-map: 2.0.2 + is-set: 2.0.2 + is-string: 1.0.7 + isarray: 2.0.5 + dev: true + /es-shim-unscopables/1.0.0: resolution: {integrity: sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==} dependencies: @@ -2196,12 +2544,35 @@ packages: engines: {node: '>=8'} dev: true + /escodegen/2.0.0: + resolution: {integrity: sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==} + engines: {node: '>=6.0'} + hasBin: true + dependencies: + esprima: 4.0.1 + estraverse: 5.3.0 + esutils: 2.0.3 + optionator: 0.8.3 + optionalDependencies: + source-map: 0.6.1 + dev: true + /esprima/4.0.1: resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} engines: {node: '>=4'} hasBin: true dev: true + /estraverse/5.3.0: + resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} + engines: {node: '>=4.0'} + dev: true + + /esutils/2.0.3: + resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} + engines: {node: '>=0.10.0'} + dev: true + /etag/1.8.1: resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==} engines: {node: '>= 0.6'} @@ -2305,6 +2676,10 @@ packages: resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} dev: true + /fast-levenshtein/2.0.6: + resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} + dev: true + /fastq/1.13.0: resolution: {integrity: sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==} dependencies: @@ -2372,6 +2747,12 @@ packages: optional: true dev: true + /for-each/0.3.3: + resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} + dependencies: + is-callable: 1.2.7 + dev: true + /form-data/4.0.0: resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} engines: {node: '>= 6'} @@ -2525,6 +2906,12 @@ packages: slash: 3.0.0 dev: true + /gopd/1.0.1: + resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} + dependencies: + get-intrinsic: 1.1.3 + dev: true + /graceful-fs/4.2.10: resolution: {integrity: sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==} dev: true @@ -2581,6 +2968,13 @@ packages: resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} dev: true + /html-encoding-sniffer/3.0.0: + resolution: {integrity: sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==} + engines: {node: '>=12'} + dependencies: + whatwg-encoding: 2.0.0 + dev: true + /html-escaper/2.0.2: resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} dev: true @@ -2596,6 +2990,27 @@ packages: toidentifier: 1.0.1 dev: true + /http-proxy-agent/5.0.0: + resolution: {integrity: sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==} + engines: {node: '>= 6'} + dependencies: + '@tootallnate/once': 2.0.0 + agent-base: 6.0.2 + debug: 4.3.4 + transitivePeerDependencies: + - supports-color + dev: true + + /https-proxy-agent/5.0.1: + resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} + engines: {node: '>= 6'} + dependencies: + agent-base: 6.0.2 + debug: 4.3.4 + transitivePeerDependencies: + - supports-color + dev: true + /human-id/1.0.2: resolution: {integrity: sha512-UNopramDEhHJD+VR+ehk8rOslwSfByxPIZyJRfV739NDhN5LF1fa1MqnzKm2lGTQRjNrjK19Q5fhkgIfjlVUKw==} dev: true @@ -2612,6 +3027,13 @@ packages: safer-buffer: 2.1.2 dev: true + /iconv-lite/0.6.3: + resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} + engines: {node: '>=0.10.0'} + dependencies: + safer-buffer: 2.1.2 + dev: true + /ignore/5.2.0: resolution: {integrity: sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==} engines: {node: '>= 4'} @@ -2669,6 +3091,14 @@ packages: engines: {node: '>= 0.10'} dev: true + /is-arguments/1.1.1: + resolution: {integrity: sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + has-tostringtag: 1.0.0 + dev: true + /is-arrayish/0.2.1: resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} dev: true @@ -2741,6 +3171,10 @@ packages: is-extglob: 2.1.1 dev: true + /is-map/2.0.2: + resolution: {integrity: sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==} + dev: true + /is-negative-zero/2.0.2: resolution: {integrity: sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==} engines: {node: '>= 0.4'} @@ -2763,6 +3197,10 @@ packages: engines: {node: '>=0.10.0'} dev: true + /is-potential-custom-element-name/1.0.1: + resolution: {integrity: sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==} + dev: true + /is-regex/1.1.4: resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==} engines: {node: '>= 0.4'} @@ -2771,6 +3209,10 @@ packages: has-tostringtag: 1.0.0 dev: true + /is-set/2.0.2: + resolution: {integrity: sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==} + dev: true + /is-shared-array-buffer/1.0.2: resolution: {integrity: sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==} dependencies: @@ -2803,12 +3245,34 @@ packages: has-symbols: 1.0.3 dev: true + /is-typed-array/1.1.10: + resolution: {integrity: sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==} + engines: {node: '>= 0.4'} + dependencies: + available-typed-arrays: 1.0.5 + call-bind: 1.0.2 + for-each: 0.3.3 + gopd: 1.0.1 + has-tostringtag: 1.0.0 + dev: true + + /is-weakmap/2.0.1: + resolution: {integrity: sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==} + dev: true + /is-weakref/1.0.2: resolution: {integrity: sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==} dependencies: call-bind: 1.0.2 dev: true + /is-weakset/2.0.2: + resolution: {integrity: sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg==} + dependencies: + call-bind: 1.0.2 + get-intrinsic: 1.1.3 + dev: true + /is-windows/1.0.2: resolution: {integrity: sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==} engines: {node: '>=0.10.0'} @@ -2818,6 +3282,10 @@ packages: resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==} dev: true + /isarray/2.0.5: + resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==} + dev: true + /isexe/2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} dev: true @@ -2999,6 +3467,29 @@ packages: pretty-format: 29.3.1 dev: true + /jest-environment-jsdom/29.3.1: + resolution: {integrity: sha512-G46nKgiez2Gy4zvYNhayfMEAFlVHhWfncqvqS6yCd0i+a4NsSUD2WtrKSaYQrYiLQaupHXxCRi8xxVL2M9PbhA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + canvas: ^2.5.0 + peerDependenciesMeta: + canvas: + optional: true + dependencies: + '@jest/environment': 29.3.1 + '@jest/fake-timers': 29.3.1 + '@jest/types': 29.3.1 + '@types/jsdom': 20.0.1 + '@types/node': 18.11.9 + jest-mock: 29.3.1 + jest-util: 29.3.1 + jsdom: 20.0.3 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + /jest-environment-node/29.3.1: resolution: {integrity: sha512-xm2THL18Xf5sIHoU7OThBPtuH6Lerd+Y1NLYiZJlkE3hbE+7N7r8uvHIl/FkZ5ymKXJe/11SQuf3fv4v6rUMag==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -3278,6 +3769,26 @@ packages: - ts-node dev: true + /jest/29.3.1_odkjkoia5xunhxkdrka32ib6vi: + resolution: {integrity: sha512-6iWfL5DTT0Np6UYs/y5Niu7WIfNv/wRTtN5RSXt2DIEft3dx3zPuw/3WJQBCJfmEzvDiEKwoqMbGD9n49+qLSA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + hasBin: true + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + dependencies: + '@jest/core': 29.3.1_ts-node@10.9.1 + '@jest/types': 29.3.1 + import-local: 3.1.0 + jest-cli: 29.3.1_odkjkoia5xunhxkdrka32ib6vi + transitivePeerDependencies: + - '@types/node' + - supports-color + - ts-node + dev: true + /joycon/3.1.1: resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==} engines: {node: '>=10'} @@ -3295,6 +3806,47 @@ packages: esprima: 4.0.1 dev: true + /jsdom/20.0.3: + resolution: {integrity: sha512-SYhBvTh89tTfCD/CRdSOm13mOBa42iTaTyfyEWBdKcGdPxPtLFBXuHR8XHb33YNYaP+lLbmSvBTsnoesCNJEsQ==} + engines: {node: '>=14'} + peerDependencies: + canvas: ^2.5.0 + peerDependenciesMeta: + canvas: + optional: true + dependencies: + abab: 2.0.6 + acorn: 8.8.1 + acorn-globals: 7.0.1 + cssom: 0.5.0 + cssstyle: 2.3.0 + data-urls: 3.0.2 + decimal.js: 10.4.2 + domexception: 4.0.0 + escodegen: 2.0.0 + form-data: 4.0.0 + html-encoding-sniffer: 3.0.0 + http-proxy-agent: 5.0.0 + https-proxy-agent: 5.0.1 + is-potential-custom-element-name: 1.0.1 + nwsapi: 2.2.2 + parse5: 7.1.2 + saxes: 6.0.0 + symbol-tree: 3.2.4 + tough-cookie: 4.1.2 + w3c-xmlserializer: 4.0.0 + webidl-conversions: 7.0.0 + whatwg-encoding: 2.0.0 + whatwg-mimetype: 3.0.0 + whatwg-url: 11.0.0 + ws: 8.11.0 + xml-name-validator: 4.0.0 + transitivePeerDependencies: + - bufferutil + - supports-color + - utf-8-validate + dev: true + /jsesc/2.5.2: resolution: {integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==} engines: {node: '>=4'} @@ -3337,6 +3889,14 @@ packages: engines: {node: '>=6'} dev: true + /levn/0.3.0: + resolution: {integrity: sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==} + engines: {node: '>= 0.8.0'} + dependencies: + prelude-ls: 1.1.2 + type-check: 0.3.2 + dev: true + /lilconfig/2.0.6: resolution: {integrity: sha512-9JROoBW7pobfsx+Sq2JsASvCo6Pfo6WWoUW79HuB1BCoBXD4PLWJPqDF6fNj67pqBYTbAHkE57M1kS/+L1neOg==} engines: {node: '>=10'} @@ -3387,6 +3947,17 @@ packages: resolution: {integrity: sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==} dev: true + /lodash/4.17.21: + resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} + dev: true + + /loose-envify/1.4.0: + resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} + hasBin: true + dependencies: + js-tokens: 4.0.0 + dev: true + /lru-cache/4.1.5: resolution: {integrity: sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==} dependencies: @@ -3401,6 +3972,11 @@ packages: yallist: 4.0.0 dev: true + /lz-string/1.4.4: + resolution: {integrity: sha512-0ckx7ZHRPqb0oUm8zNr+90mtf9DQB60H1wMCjBtfi62Kl3a7JbHob6gA2bC+xRvZoOL+1hzUK8jeuEIQE8svEQ==} + hasBin: true + dev: true + /make-dir/3.1.0: resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} engines: {node: '>=8'} @@ -3618,6 +4194,10 @@ packages: path-key: 3.1.1 dev: true + /nwsapi/2.2.2: + resolution: {integrity: sha512-90yv+6538zuvUMnN+zCr8LuV6bPFdq50304114vJYJ8RDyK8D5O9Phpbd6SZWgI7PwzmmfN1upeOJlvybDSgCw==} + dev: true + /object-assign/4.1.1: resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} engines: {node: '>=0.10.0'} @@ -3627,6 +4207,14 @@ packages: resolution: {integrity: sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==} dev: true + /object-is/1.1.5: + resolution: {integrity: sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + dev: true + /object-keys/1.1.1: resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} engines: {node: '>= 0.4'} @@ -3662,6 +4250,18 @@ packages: mimic-fn: 2.1.0 dev: true + /optionator/0.8.3: + resolution: {integrity: sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==} + engines: {node: '>= 0.8.0'} + dependencies: + deep-is: 0.1.4 + fast-levenshtein: 2.0.6 + levn: 0.3.0 + prelude-ls: 1.1.2 + type-check: 0.3.2 + word-wrap: 1.2.3 + dev: true + /os-tmpdir/1.0.2: resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} engines: {node: '>=0.10.0'} @@ -3726,6 +4326,12 @@ packages: lines-and-columns: 1.2.4 dev: true + /parse5/7.1.2: + resolution: {integrity: sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==} + dependencies: + entities: 4.4.0 + dev: true + /parseurl/1.3.3: resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==} engines: {node: '>= 0.8'} @@ -3812,12 +4418,26 @@ packages: which-pm: 2.0.0 dev: true + /prelude-ls/1.1.2: + resolution: {integrity: sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==} + engines: {node: '>= 0.8.0'} + dev: true + /prettier/2.7.1: resolution: {integrity: sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==} engines: {node: '>=10.13.0'} hasBin: true dev: true + /pretty-format/27.5.1: + resolution: {integrity: sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==} + engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} + dependencies: + ansi-regex: 5.0.1 + ansi-styles: 5.2.0 + react-is: 17.0.2 + dev: true + /pretty-format/29.3.1: resolution: {integrity: sha512-FyLnmb1cYJV8biEIiRyzRFvs2lry7PPIvOqKVe1GCUEYg4YGmlx1qG9EJNMxArYm7piII4qb8UV1Pncq5dxmcg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -3855,6 +4475,10 @@ packages: resolution: {integrity: sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==} dev: true + /psl/1.9.0: + resolution: {integrity: sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==} + dev: true + /punycode/2.1.1: resolution: {integrity: sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==} engines: {node: '>=6'} @@ -3867,6 +4491,10 @@ packages: side-channel: 1.0.4 dev: true + /querystringify/2.2.0: + resolution: {integrity: sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==} + dev: true + /queue-microtask/1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} dev: true @@ -3891,10 +4519,62 @@ packages: unpipe: 1.0.0 dev: true + /react-dom/18.2.0_react@18.2.0: + resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} + peerDependencies: + react: ^18.2.0 + dependencies: + loose-envify: 1.4.0 + react: 18.2.0 + scheduler: 0.23.0 + dev: true + + /react-error-boundary/3.1.4_react@18.2.0: + resolution: {integrity: sha512-uM9uPzZJTF6wRQORmSrvOIgt4lJ9MC1sNgEOj2XGsDTRE4kmpWxg7ENK9EWNKJRMAOY9z0MuF4yIfl6gp4sotA==} + engines: {node: '>=10', npm: '>=6'} + peerDependencies: + react: '>=16.13.1' + dependencies: + '@babel/runtime': 7.20.1 + react: 18.2.0 + dev: true + + /react-is/17.0.2: + resolution: {integrity: sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==} + dev: true + /react-is/18.2.0: resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==} dev: true + /react-shallow-renderer/16.15.0_react@18.2.0: + resolution: {integrity: sha512-oScf2FqQ9LFVQgA73vr86xl2NaOIX73rh+YFqcOp68CWj56tSfgtGKrEbyhCj0rSijyG9M1CYprTh39fBi5hzA==} + peerDependencies: + react: ^16.0.0 || ^17.0.0 || ^18.0.0 + dependencies: + object-assign: 4.1.1 + react: 18.2.0 + react-is: 18.2.0 + dev: true + + /react-test-renderer/18.2.0_react@18.2.0: + resolution: {integrity: sha512-JWD+aQ0lh2gvh4NM3bBM42Kx+XybOxCpgYK7F8ugAlpaTSnWsX+39Z4XkOykGZAHrjwwTZT3x3KxswVWxHPUqA==} + peerDependencies: + react: ^18.2.0 + dependencies: + react: 18.2.0 + react-is: 18.2.0 + react-shallow-renderer: 16.15.0_react@18.2.0 + scheduler: 0.23.0 + dev: true + + /react/18.2.0: + resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} + engines: {node: '>=0.10.0'} + dependencies: + loose-envify: 1.4.0 + dev: true + /read-pkg-up/7.0.1: resolution: {integrity: sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==} engines: {node: '>=8'} @@ -3973,6 +4653,10 @@ packages: resolution: {integrity: sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==} dev: true + /requires-port/1.0.0: + resolution: {integrity: sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==} + dev: true + /resolve-cwd/3.0.0: resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} engines: {node: '>=8'} @@ -4045,6 +4729,19 @@ packages: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} dev: true + /saxes/6.0.0: + resolution: {integrity: sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==} + engines: {node: '>=v12.22.7'} + dependencies: + xmlchars: 2.2.0 + dev: true + + /scheduler/0.23.0: + resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==} + dependencies: + loose-envify: 1.4.0 + dev: true + /semver/5.7.1: resolution: {integrity: sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==} hasBin: true @@ -4349,6 +5046,10 @@ packages: engines: {node: '>= 0.4'} dev: true + /symbol-tree/3.2.4: + resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==} + dev: true + /term-size/2.2.1: resolution: {integrity: sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg==} engines: {node: '>=8'} @@ -4404,6 +5105,16 @@ packages: engines: {node: '>=0.6'} dev: true + /tough-cookie/4.1.2: + resolution: {integrity: sha512-G9fqXWoYFZgTc2z8Q5zaHy/vJMjm+WV0AkAeHxVCQiEB1b+dGvWzFW6QV07cY5jQ5gRkeid2qIkzkxUnmoQZUQ==} + engines: {node: '>=6'} + dependencies: + psl: 1.9.0 + punycode: 2.1.1 + universalify: 0.2.0 + url-parse: 1.5.10 + dev: true + /tr46/0.0.3: resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} dev: true @@ -4414,6 +5125,13 @@ packages: punycode: 2.1.1 dev: true + /tr46/3.0.0: + resolution: {integrity: sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==} + engines: {node: '>=12'} + dependencies: + punycode: 2.1.1 + dev: true + /tree-kill/1.2.2: resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==} hasBin: true @@ -4462,6 +5180,40 @@ packages: yargs-parser: 21.1.1 dev: true + /ts-jest/29.0.3_wcjxlcwfjvs73rqh2tjbxyoefa: + resolution: {integrity: sha512-Ibygvmuyq1qp/z3yTh9QTwVVAbFdDy/+4BtIQR2sp6baF2SJU/8CKK/hhnGIDY2L90Az2jIqTwZPnN2p+BweiQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + hasBin: true + peerDependencies: + '@babel/core': '>=7.0.0-beta.0 <8' + '@jest/types': ^29.0.0 + babel-jest: ^29.0.0 + esbuild: '*' + jest: ^29.0.0 + typescript: '>=4.3' + peerDependenciesMeta: + '@babel/core': + optional: true + '@jest/types': + optional: true + babel-jest: + optional: true + esbuild: + optional: true + dependencies: + '@jest/types': 29.3.1 + bs-logger: 0.2.6 + fast-json-stable-stringify: 2.1.0 + jest: 29.3.1_odkjkoia5xunhxkdrka32ib6vi + jest-util: 29.3.1 + json5: 2.2.1 + lodash.memoize: 4.1.2 + make-error: 1.3.6 + semver: 7.3.8 + typescript: 4.9.3 + yargs-parser: 21.1.1 + dev: true + /ts-node/10.9.1_wup25etrarvlqkprac7h35hj7u: resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true @@ -4604,6 +5356,13 @@ packages: turbo-windows-arm64: 1.6.3 dev: true + /type-check/0.3.2: + resolution: {integrity: sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==} + engines: {node: '>= 0.8.0'} + dependencies: + prelude-ls: 1.1.2 + dev: true + /type-detect/4.0.8: resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} engines: {node: '>=4'} @@ -4661,6 +5420,11 @@ packages: engines: {node: '>= 4.0.0'} dev: true + /universalify/0.2.0: + resolution: {integrity: sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==} + engines: {node: '>= 4.0.0'} + dev: true + /unpipe/1.0.0: resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} engines: {node: '>= 0.8'} @@ -4677,6 +5441,21 @@ packages: picocolors: 1.0.0 dev: true + /url-parse/1.5.10: + resolution: {integrity: sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==} + dependencies: + querystringify: 2.2.0 + requires-port: 1.0.0 + dev: true + + /use-sync-external-store/1.2.0_react@18.2.0: + resolution: {integrity: sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==} + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + dependencies: + react: 18.2.0 + dev: true + /util-deprecate/1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} dev: true @@ -4711,6 +5490,13 @@ packages: engines: {node: '>= 0.8'} dev: true + /w3c-xmlserializer/4.0.0: + resolution: {integrity: sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw==} + engines: {node: '>=14'} + dependencies: + xml-name-validator: 4.0.0 + dev: true + /walker/1.0.8: resolution: {integrity: sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==} dependencies: @@ -4731,6 +5517,31 @@ packages: resolution: {integrity: sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==} dev: true + /webidl-conversions/7.0.0: + resolution: {integrity: sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==} + engines: {node: '>=12'} + dev: true + + /whatwg-encoding/2.0.0: + resolution: {integrity: sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==} + engines: {node: '>=12'} + dependencies: + iconv-lite: 0.6.3 + dev: true + + /whatwg-mimetype/3.0.0: + resolution: {integrity: sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==} + engines: {node: '>=12'} + dev: true + + /whatwg-url/11.0.0: + resolution: {integrity: sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==} + engines: {node: '>=12'} + dependencies: + tr46: 3.0.0 + webidl-conversions: 7.0.0 + dev: true + /whatwg-url/5.0.0: resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} dependencies: @@ -4756,6 +5567,15 @@ packages: is-symbol: 1.0.4 dev: true + /which-collection/1.0.1: + resolution: {integrity: sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A==} + dependencies: + is-map: 2.0.2 + is-set: 2.0.2 + is-weakmap: 2.0.1 + is-weakset: 2.0.2 + dev: true + /which-module/2.0.0: resolution: {integrity: sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==} dev: true @@ -4768,6 +5588,18 @@ packages: path-exists: 4.0.0 dev: true + /which-typed-array/1.1.9: + resolution: {integrity: sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==} + engines: {node: '>= 0.4'} + dependencies: + available-typed-arrays: 1.0.5 + call-bind: 1.0.2 + for-each: 0.3.3 + gopd: 1.0.1 + has-tostringtag: 1.0.0 + is-typed-array: 1.1.10 + dev: true + /which/1.3.1: resolution: {integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==} hasBin: true @@ -4783,6 +5615,11 @@ packages: isexe: 2.0.0 dev: true + /word-wrap/1.2.3: + resolution: {integrity: sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==} + engines: {node: '>=0.10.0'} + dev: true + /wrap-ansi/6.2.0: resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} engines: {node: '>=8'} @@ -4813,6 +5650,28 @@ packages: signal-exit: 3.0.7 dev: true + /ws/8.11.0: + resolution: {integrity: sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==} + engines: {node: '>=10.0.0'} + peerDependencies: + bufferutil: ^4.0.1 + utf-8-validate: ^5.0.2 + peerDependenciesMeta: + bufferutil: + optional: true + utf-8-validate: + optional: true + dev: true + + /xml-name-validator/4.0.0: + resolution: {integrity: sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==} + engines: {node: '>=12'} + dev: true + + /xmlchars/2.2.0: + resolution: {integrity: sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==} + dev: true + /xtend/4.0.2: resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==} engines: {node: '>=0.4'} From da58f5419df3ad3409dc1470b65105557561b507 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sat, 26 Nov 2022 21:21:25 +0100 Subject: [PATCH 079/206] docs(changeset): fix(react): bump version --- .changeset/rich-pigs-thank.md | 9 +++++++++ packages/react/package.json | 4 ++-- 2 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 .changeset/rich-pigs-thank.md diff --git a/.changeset/rich-pigs-thank.md b/.changeset/rich-pigs-thank.md new file mode 100644 index 00000000..edd7998f --- /dev/null +++ b/.changeset/rich-pigs-thank.md @@ -0,0 +1,9 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +"@zodios/react": major +"@zodios/testing": major +--- + +fix(react): bump version diff --git a/packages/react/package.json b/packages/react/package.json index 85b9e900..14c502f5 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/react", "description": "React hooks for zodios", - "version": "10.3.4", + "version": "11.0.0-beta.12", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", @@ -39,7 +39,7 @@ }, "peerDependencies": { "@tanstack/react-query": "4.x", - "@zodios/core": "11.x", + "@zodios/core": "11.0.0-beta.12", "react": ">=16.8.0" }, "devDependencies": { From a67640fa2aa59fcc3157da381c7a9a5402b6884b Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sat, 26 Nov 2022 21:47:09 +0100 Subject: [PATCH 080/206] RELEASING: Releasing 5 package(s) Releases: @zodios/axios@11.0.0-beta.13 @zodios/core@11.0.0-beta.13 @zodios/fetch@11.0.0-beta.13 @zodios/react@11.0.0-beta.13 @zodios/testing@11.0.0-beta.13 [skip ci] --- packages/axios/CHANGELOG.md | 13 +++++++++++++ packages/axios/package.json | 2 +- packages/core/CHANGELOG.md | 7 +++++++ packages/core/package.json | 2 +- packages/fetch/CHANGELOG.md | 13 +++++++++++++ packages/fetch/package.json | 2 +- packages/react/CHANGELOG.md | 14 ++++++++++++++ packages/react/package.json | 6 +++--- packages/testing/CHANGELOG.md | 13 +++++++++++++ packages/testing/package.json | 4 ++-- 10 files changed, 68 insertions(+), 8 deletions(-) create mode 100644 packages/react/CHANGELOG.md diff --git a/packages/axios/CHANGELOG.md b/packages/axios/CHANGELOG.md index 6d4e725d..072500de 100644 --- a/packages/axios/CHANGELOG.md +++ b/packages/axios/CHANGELOG.md @@ -1,5 +1,18 @@ # @zodios/core +## 11.0.0-beta.13 + +### Major Changes + +- 2745e1a: feat(react): migrate react to v11 +- 98433a9: fix(react): bump version + +### Patch Changes + +- Updated dependencies [2745e1a] +- Updated dependencies [98433a9] + - @zodios/core@11.0.0-beta.13 + ## 11.0.0-beta.12 ### Major Changes diff --git a/packages/axios/package.json b/packages/axios/package.json index aa48d42d..cf62f805 100644 --- a/packages/axios/package.json +++ b/packages/axios/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/axios", "description": "Typescript API client with axios", - "version": "11.0.0-beta.12", + "version": "11.0.0-beta.13", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index a47f3211..97f0e3df 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,12 @@ # @zodios/core +## 11.0.0-beta.13 + +### Major Changes + +- 2745e1a: feat(react): migrate react to v11 +- 98433a9: fix(react): bump version + ## 11.0.0-beta.12 ### Major Changes diff --git a/packages/core/package.json b/packages/core/package.json index 9218e277..858361e4 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/core", "description": "Typescript API client with autocompletion and zod validations", - "version": "11.0.0-beta.12", + "version": "11.0.0-beta.13", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", diff --git a/packages/fetch/CHANGELOG.md b/packages/fetch/CHANGELOG.md index 6d4e725d..072500de 100644 --- a/packages/fetch/CHANGELOG.md +++ b/packages/fetch/CHANGELOG.md @@ -1,5 +1,18 @@ # @zodios/core +## 11.0.0-beta.13 + +### Major Changes + +- 2745e1a: feat(react): migrate react to v11 +- 98433a9: fix(react): bump version + +### Patch Changes + +- Updated dependencies [2745e1a] +- Updated dependencies [98433a9] + - @zodios/core@11.0.0-beta.13 + ## 11.0.0-beta.12 ### Major Changes diff --git a/packages/fetch/package.json b/packages/fetch/package.json index cc5aa917..65df33fd 100644 --- a/packages/fetch/package.json +++ b/packages/fetch/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/fetch", "description": "Typescript API client with fetch", - "version": "11.0.0-beta.12", + "version": "11.0.0-beta.13", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", diff --git a/packages/react/CHANGELOG.md b/packages/react/CHANGELOG.md new file mode 100644 index 00000000..43b41483 --- /dev/null +++ b/packages/react/CHANGELOG.md @@ -0,0 +1,14 @@ +# @zodios/react + +## 11.0.0-beta.13 + +### Major Changes + +- 2745e1a: feat(react): migrate react to v11 +- 98433a9: fix(react): bump version + +### Patch Changes + +- Updated dependencies [2745e1a] +- Updated dependencies [98433a9] + - @zodios/core@11.0.0-beta.13 diff --git a/packages/react/package.json b/packages/react/package.json index 14c502f5..f37fe643 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/react", "description": "React hooks for zodios", - "version": "11.0.0-beta.12", + "version": "11.0.0-beta.13", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", @@ -39,13 +39,13 @@ }, "peerDependencies": { "@tanstack/react-query": "4.x", - "@zodios/core": "11.0.0-beta.12", + "@zodios/core": "11.0.0-beta.13", "react": ">=16.8.0" }, "devDependencies": { "@jest/globals": "29.3.1", "@jest/types": "29.3.1", - "@tanstack/react-query": "4.16.1", + "@tanstack/react-query": "4.18.0", "@testing-library/dom": "8.19.0", "@testing-library/jest-dom": "5.16.5", "@testing-library/react": "13.4.0", diff --git a/packages/testing/CHANGELOG.md b/packages/testing/CHANGELOG.md index 11ffd340..1ff8118e 100644 --- a/packages/testing/CHANGELOG.md +++ b/packages/testing/CHANGELOG.md @@ -1,5 +1,18 @@ # @zodios/core +## 11.0.0-beta.13 + +### Major Changes + +- 2745e1a: feat(react): migrate react to v11 +- 98433a9: fix(react): bump version + +### Patch Changes + +- Updated dependencies [2745e1a] +- Updated dependencies [98433a9] + - @zodios/core@11.0.0-beta.13 + ## 11.0.0-beta.12 ### Major Changes diff --git a/packages/testing/package.json b/packages/testing/package.json index 77d3ff2a..ea81628a 100644 --- a/packages/testing/package.json +++ b/packages/testing/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/testing", "description": "Zodios mock library", - "version": "11.0.0-beta.12", + "version": "11.0.0-beta.13", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", @@ -36,7 +36,7 @@ "test": "jest --coverage" }, "peerDependencies": { - "@zodios/core": "11.0.0-beta.12" + "@zodios/core": "11.0.0-beta.13" }, "devDependencies": { "@jest/globals": "29.3.1", From 26afa6b2715a8b356d9ee71d107d28fc7dcb6337 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sat, 26 Nov 2022 23:51:28 +0100 Subject: [PATCH 081/206] docs(changeset): chore: fix type exports for nodenext --- .changeset/pre.json | 5 ++++- .changeset/small-horses-laugh.md | 9 +++++++++ packages/axios/package.json | 3 ++- packages/core/package.json | 3 ++- packages/fetch/package.json | 3 ++- packages/react/package.json | 3 ++- packages/testing/package.json | 3 ++- 7 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 .changeset/small-horses-laugh.md diff --git a/.changeset/pre.json b/.changeset/pre.json index 80c97975..35031908 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -5,10 +5,12 @@ "@zodios/core": "11.0.0-beta.0", "@zodios/axios": "11.0.0-beta.0", "@zodios/fetch": "11.0.0-beta.5", - "@zodios/testing": "11.0.0-beta.8" + "@zodios/testing": "11.0.0-beta.8", + "@zodios/react": "11.0.0-beta.12" }, "changesets": [ "blue-hounds-sort", + "famous-rules-drop", "gentle-ligers-mix", "long-fans-dress", "lucky-brooms-fry", @@ -16,6 +18,7 @@ "nice-wombats-boil", "polite-bugs-confess", "polite-points-float", + "rich-pigs-thank", "short-hounds-mix", "silent-garlics-scream", "slimy-pugs-melt", diff --git a/.changeset/small-horses-laugh.md b/.changeset/small-horses-laugh.md new file mode 100644 index 00000000..9c04282d --- /dev/null +++ b/.changeset/small-horses-laugh.md @@ -0,0 +1,9 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +"@zodios/react": major +"@zodios/testing": major +--- + +chore: fix type exports for nodenext diff --git a/packages/axios/package.json b/packages/axios/package.json index cf62f805..86057b0b 100644 --- a/packages/axios/package.json +++ b/packages/axios/package.json @@ -8,7 +8,8 @@ "exports": { ".": { "import": "./lib/index.mjs", - "require": "./lib/index.js" + "require": "./lib/index.js", + "types": "./lib/index.d.ts" }, "./package.json": "./package.json" }, diff --git a/packages/core/package.json b/packages/core/package.json index 858361e4..6e4492a9 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -8,7 +8,8 @@ "exports": { ".": { "import": "./lib/index.mjs", - "require": "./lib/index.js" + "require": "./lib/index.js", + "types": "./lib/index.d.ts" }, "./package.json": "./package.json" }, diff --git a/packages/fetch/package.json b/packages/fetch/package.json index 65df33fd..6dce9ea4 100644 --- a/packages/fetch/package.json +++ b/packages/fetch/package.json @@ -8,7 +8,8 @@ "exports": { ".": { "import": "./lib/index.mjs", - "require": "./lib/index.js" + "require": "./lib/index.js", + "types": "./lib/index.d.ts" }, "./package.json": "./package.json" }, diff --git a/packages/react/package.json b/packages/react/package.json index f37fe643..1f41489b 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -8,7 +8,8 @@ "exports": { ".": { "import": "./lib/index.mjs", - "require": "./lib/index.js" + "require": "./lib/index.js", + "types": "./lib/index.d.ts" }, "./package.json": "./package.json" }, diff --git a/packages/testing/package.json b/packages/testing/package.json index ea81628a..d4de437f 100644 --- a/packages/testing/package.json +++ b/packages/testing/package.json @@ -8,7 +8,8 @@ "exports": { ".": { "import": "./lib/index.mjs", - "require": "./lib/index.js" + "require": "./lib/index.js", + "types": "./lib/index.d.ts" }, "./package.json": "./package.json" }, From 29d57e60f3eaf002e6ef447368dabf0ecbfee203 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sun, 27 Nov 2022 11:43:21 +0100 Subject: [PATCH 082/206] docs(changeset): refactor: factor http verbs --- .changeset/slow-worms-destroy.md | 9 ++ packages/core/src/index.ts | 5 + packages/core/src/zodios.test.ts | 112 ++++++++------- packages/core/src/zodios.ts | 176 +++-------------------- packages/core/src/zodios.types.ts | 85 +++++++----- packages/react/src/hooks.ts | 223 ++++++++---------------------- 6 files changed, 208 insertions(+), 402 deletions(-) create mode 100644 .changeset/slow-worms-destroy.md diff --git a/.changeset/slow-worms-destroy.md b/.changeset/slow-worms-destroy.md new file mode 100644 index 00000000..092f0a99 --- /dev/null +++ b/.changeset/slow-worms-destroy.md @@ -0,0 +1,9 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +"@zodios/react": major +"@zodios/testing": major +--- + +refactor: factor http verbs diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index bad04660..4cb6b47c 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -47,6 +47,11 @@ export type { ZodiosRequestOptionsByAlias, ZodiosPlugin, } from "./zodios.types"; +export { + HTTP_METHODS, + HTTP_MUTATION_METHODS, + HTTP_QUERY_METHODS, +} from "./zodios.types"; export type { AnyZodiosTypeProvider, InferInputTypeFromSchema, diff --git a/packages/core/src/zodios.test.ts b/packages/core/src/zodios.test.ts index 526e6925..d09e9873 100644 --- a/packages/core/src/zodios.test.ts +++ b/packages/core/src/zodios.test.ts @@ -348,7 +348,7 @@ describe("Zodios", () => { it("should register have validation plugin automatically installed", () => { const zodios = new ZodiosCore(`http://localhost`, []); - // @ts-ignore + // @ts-expect-error expect(zodios.endpointPlugins.get("any-any").count()).toBe(1); }); @@ -357,7 +357,7 @@ describe("Zodios", () => { zodios.use({ request: async (_, config) => config, }); - // @ts-ignore + // @ts-expect-error expect(zodios.endpointPlugins.get("any-any").count()).toBe(2); }); @@ -366,10 +366,10 @@ describe("Zodios", () => { const id = zodios.use({ request: async (_, config) => config, }); - // @ts-ignore + // @ts-expect-error expect(zodios.endpointPlugins.get("any-any").count()).toBe(2); zodios.eject(id); - // @ts-ignore + // @ts-expect-error expect(zodios.endpointPlugins.get("any-any").count()).toBe(1); }); @@ -382,7 +382,7 @@ describe("Zodios", () => { zodios.use(plugin); zodios.use(plugin); zodios.use(plugin); - // @ts-ignore + // @ts-expect-error expect(zodios.endpointPlugins.get("any-any").count()).toBe(2); }); @@ -394,13 +394,13 @@ describe("Zodios", () => { }; zodios.use(plugin); zodios.eject("test"); - // @ts-ignore + // @ts-expect-error expect(zodios.endpointPlugins.get("any-any").count()).toBe(1); }); it("should throw if invalide parameters when registering a plugin", () => { const zodios = new ZodiosCore(`http://localhost`, []); - // @ts-ignore + // @ts-expect-error expect(() => zodios.use(0)).toThrowError("Zodios: invalid plugin"); }); @@ -417,9 +417,9 @@ describe("Zodios", () => { }, ]); expect(() => - // @ts-ignore + // @ts-expect-error zodios.use("tests", { - // @ts-ignore + // @ts-expect-error request: async (_, config) => config, }) ).toThrowError("Zodios: no alias 'tests' found to register plugin"); @@ -437,9 +437,9 @@ describe("Zodios", () => { }, ]); expect(() => - // @ts-ignore + // @ts-expect-error zodios.use("get", "/test/:id", { - // @ts-ignore + // @ts-expect-error request: async (_, config) => config, }) ).toThrowError( @@ -461,7 +461,7 @@ describe("Zodios", () => { zodios.use("get", "/:id", { request: async (_, config) => config, }); - // @ts-ignore + // @ts-expect-error expect(zodios.endpointPlugins.get("get-/:id").count()).toBe(1); }); @@ -480,31 +480,35 @@ describe("Zodios", () => { zodios.use("test", { request: async (_, config) => config, }); - // @ts-ignore + // @ts-expect-error expect(zodios.endpointPlugins.get("get-/:id").count()).toBe(1); }); it("should make an http request", async () => { - const zodios = new ZodiosCore(`http://localhost`, [ - { - method: "get", - path: "/:id", - response: z.object({ - id: z.number(), - name: z.string(), - }), - }, - { - method: "get", - path: "/users", - response: z.array( - z.object({ + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "get", + path: "/:id", + response: z.object({ id: z.number(), name: z.string(), - }) - ), - }, - ]); + }), + }, + { + method: "get", + path: "/users", + response: z.array( + z.object({ + id: z.number(), + name: z.string(), + }) + ), + }, + ], + { fetcherProvider: mockProvider } + ); const response = await zodios.request({ // ^? method: "get", @@ -519,22 +523,36 @@ describe("Zodios", () => { }); it("should make an http get with standard query arrays", async () => { - const zodios = new ZodiosCore(`http://localhost`, [ - { - method: "get", - path: "/queries", - parameters: [ - { - name: "id", - type: "Query", - schema: z.array(z.number()), - }, - ], - response: z.object({ - queries: z.array(z.string()), - }), - }, - ]); + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "get", + path: "/queries", + parameters: [ + { + name: "id", + type: "Query", + schema: z.array(z.number()), + }, + ], + response: z.object({ + queries: z.array(z.string()), + }), + }, + { + method: "get", + path: "/users", + response: z.array( + z.object({ + id: z.number(), + name: z.string(), + }) + ), + }, + ], + { fetcherProvider: mockProvider } + ); const response = await zodios.get("/queries", { queries: { id: [1, 2] } }); expect(response).toEqual({ queries: [1, 2] }); }); diff --git a/packages/core/src/zodios.ts b/packages/core/src/zodios.ts index 9bc51554..56f0a377 100644 --- a/packages/core/src/zodios.ts +++ b/packages/core/src/zodios.ts @@ -6,14 +6,15 @@ import type { ZodiosResponseByPath, ZodiosOptions, ZodiosEndpointDefinitions, - ZodiosRequestOptionsByPath, ZodiosAliases, ZodiosPlugin, Aliases, ZodiosEndpointError, ZodiosMatchingErrorsByPath, ZodiosMatchingErrorsByAlias, + ZodiosVerbs, } from "./zodios.types"; +import { HTTP_METHODS } from "./zodios.types"; import { PluginId, ZodiosPlugins, @@ -149,6 +150,7 @@ export class ZodiosCoreImpl< this.options.fetcherProvider?.init({ baseURL, ...this.options }); this.injectAliasEndpoints(); + this.injectHttpVerbEndpoints(); this.initPlugins(); if ([true, "all", "request", "response"].includes(this.options.validate)) { this.use(zodValidationPlugin(this.options)); @@ -281,19 +283,26 @@ export class ZodiosCoreImpl< }); } + private injectHttpVerbEndpoints() { + HTTP_METHODS.forEach((method) => { + (this as any)[method] = (path: string, config: any) => + this.request({ + ...config, + method, + url: path, + }); + }); + } + /** * make a request to the api * @param config - the config to setup zodios options and parameters * @returns response validated with zod schema provided in the api description */ - async request< - M extends Method, - Path extends ZodiosPathsByMethod, - TConfig = ReadonlyDeep< + async request>( + config: ReadonlyDeep< ZodiosRequestOptions > - >( - config: TConfig ): Promise> { let conf = config as unknown as ReadonlyDeep< AnyZodiosRequestOptions @@ -319,154 +328,6 @@ export class ZodiosCoreImpl< return (await response).data; } - /** - * make a get request to the api - * @param path - the path to api endpoint - * @param config - the config to setup options and parameters - * @returns response validated with zod schema provided in the api description - */ - async get< - Path extends ZodiosPathsByMethod, - TConfig extends ZodiosRequestOptionsByPath< - Api, - "get", - Path, - FetcherProvider, - true, - TypeProvider - > - >( - path: Path, - ...[config]: RequiredKeys extends never - ? [config?: ReadonlyDeep] - : [config: ReadonlyDeep] - ): Promise> { - return this.request({ - ...config, - method: "get", - url: path, - }); - } - - /** - * make a post request to the api - * @param path - the path to api endpoint - * @param data - the data to send - * @param config - the config to setup options and parameters - * @returns response validated with zod schema provided in the api description - */ - async post< - Path extends ZodiosPathsByMethod, - TConfig extends ZodiosRequestOptionsByPath< - Api, - "post", - Path, - FetcherProvider, - true, - TypeProvider - > - >( - path: Path, - ...[config]: RequiredKeys extends never - ? [config?: ReadonlyDeep] - : [config: ReadonlyDeep] - ): Promise> { - return this.request({ - ...config, - method: "post", - url: path, - }); - } - - /** - * make a put request to the api - * @param path - the path to api endpoint - * @param data - the data to send - * @param config - the config to setup options and parameters - * @returns response validated with zod schema provided in the api description - */ - async put< - Path extends ZodiosPathsByMethod, - TConfig extends ZodiosRequestOptionsByPath< - Api, - "put", - Path, - FetcherProvider, - true, - TypeProvider - > - >( - path: Path, - ...[config]: RequiredKeys extends never - ? [config?: ReadonlyDeep] - : [config: ReadonlyDeep] - ): Promise> { - return this.request({ - ...config, - method: "put", - url: path, - }); - } - - /** - * make a patch request to the api - * @param path - the path to api endpoint - * @param data - the data to send - * @param config - the config to setup options and parameters - * @returns response validated with zod schema provided in the api description - */ - async patch< - Path extends ZodiosPathsByMethod, - TConfig extends ZodiosRequestOptionsByPath< - Api, - "patch", - Path, - FetcherProvider, - true, - TypeProvider - > - >( - path: Path, - ...[config]: RequiredKeys extends never - ? [config?: ReadonlyDeep] - : [config: ReadonlyDeep] - ): Promise> { - return this.request({ - ...config, - method: "patch", - url: path, - }); - } - - /** - * make a delete request to the api - * @param path - the path to api endpoint - * @param config - the config to setup options and parameters - * @returns response validated with zod schema provided in the api description - */ - async delete< - Path extends ZodiosPathsByMethod, - TConfig extends ZodiosRequestOptionsByPath< - Api, - "delete", - Path, - FetcherProvider, - true, - TypeProvider - > - >( - path: Path, - ...[config]: RequiredKeys extends never - ? [config?: ReadonlyDeep] - : [config: ReadonlyDeep] - ): Promise> { - return this.request({ - ...config, - method: "delete", - url: path, - }); - } - private isDefinedError( error: unknown, findEndpointErrors: (error: unknown) => ZodiosEndpointError[] | undefined @@ -538,9 +399,10 @@ export class ZodiosCoreImpl< export type ZodiosInstance< Api extends ZodiosEndpointDefinitions, FetcherProvider extends AnyZodiosFetcherProvider, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider + TypeProvider extends AnyZodiosTypeProvider > = ZodiosCoreImpl & - ZodiosAliases; + ZodiosAliases & + ZodiosVerbs; export interface ZodiosCore { new < diff --git a/packages/core/src/zodios.types.ts b/packages/core/src/zodios.types.ts index 669dc203..a5cfe198 100644 --- a/packages/core/src/zodios.types.ts +++ b/packages/core/src/zodios.types.ts @@ -26,11 +26,21 @@ import { ZodiosRuntimeFetcherProvider, } from "./fetcher-providers"; -type AxiosRequestConfig = Parameters[0]; - -export type MutationMethod = "post" | "put" | "patch" | "delete"; - -export type Method = "get" | "head" | "options" | MutationMethod; +export const HTTP_QUERY_METHODS = ["get", "head"] as const; +export const HTTP_MUTATION_METHODS = [ + "post", + "put", + "patch", + "delete", +] as const; +export const HTTP_METHODS = [ + ...HTTP_QUERY_METHODS, + ...HTTP_MUTATION_METHODS, +] as const; + +export type QueryMethod = typeof HTTP_QUERY_METHODS[number]; +export type MutationMethod = typeof HTTP_MUTATION_METHODS[number]; +export type Method = typeof HTTP_METHODS[number]; export type RequestFormat = | "json" // default @@ -595,11 +605,6 @@ export type ZodiosRequestOptionsByAlias< > >; -export type ZodiosMutationAliasRequest = - RequiredKeys extends never - ? (configOptions?: ReadonlyDeep) => Promise - : (configOptions: ReadonlyDeep) => Promise; - export type ZodiosAliasRequest = RequiredKeys extends never ? (configOptions?: ReadonlyDeep) => Promise @@ -608,33 +613,41 @@ export type ZodiosAliasRequest = export type ZodiosAliases< Api extends ZodiosEndpointDefinition[], FetcherProvider extends AnyZodiosFetcherProvider, - Frontend extends boolean = true, - TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider + TypeProvider extends AnyZodiosTypeProvider > = { - [Alias in Aliases]: ZodiosEndpointDefinitionByAlias< - Api, - Alias - >[number]["method"] extends MutationMethod - ? ZodiosMutationAliasRequest< - ZodiosRequestOptionsByAlias< - Api, - Alias, - FetcherProvider, - Frontend, - TypeProvider - >, - ZodiosResponseByAlias - > - : ZodiosAliasRequest< - ZodiosRequestOptionsByAlias< - Api, - Alias, - FetcherProvider, - Frontend, - TypeProvider - >, - ZodiosResponseByAlias - >; + [Alias in Aliases]: ZodiosAliasRequest< + ZodiosRequestOptionsByAlias< + Api, + Alias, + FetcherProvider, + true, + TypeProvider + >, + ZodiosResponseByAlias + >; +}; + +export type ZodiosVerbs< + Api extends ZodiosEndpointDefinition[], + FetcherProvider extends AnyZodiosFetcherProvider, + TypeProvider extends AnyZodiosTypeProvider +> = { + [M in Method]: < + Path extends ZodiosPathsByMethod, + TConfig extends ZodiosRequestOptionsByPath< + Api, + M, + Path, + FetcherProvider, + true, + TypeProvider + > + >( + path: Path, + ...[config]: RequiredKeys extends never + ? [config?: ReadonlyDeep] + : [config: ReadonlyDeep] + ) => Promise>; }; export type AnyZodiosMethodOptions< diff --git a/packages/react/src/hooks.ts b/packages/react/src/hooks.ts index 185c6d96..3b050709 100644 --- a/packages/react/src/hooks.ts +++ b/packages/react/src/hooks.ts @@ -12,16 +12,13 @@ import { QueryKey, UseInfiniteQueryResult, } from "@tanstack/react-query"; -import { - AnyZodiosFetcherProvider, - AnyZodiosTypeProvider, - ZodiosError, - ZodiosInstance, - ZodTypeProvider, -} from "@zodios/core"; +import { ZodiosError, HTTP_MUTATION_METHODS } from "@zodios/core"; import type { + AnyZodiosFetcherProvider, AnyZodiosMethodOptions, + AnyZodiosTypeProvider, Method, + ZodiosInstance, ZodiosPathsByMethod, ZodiosResponseByPath, ZodiosResponseByAlias, @@ -33,18 +30,15 @@ import type { ZodiosBodyByAlias, ZodiosQueryParamsByPath, ZodiosRequestOptionsByAlias, + ZodTypeProvider, } from "@zodios/core"; -import type { - Aliases, - MutationMethod, - ZodiosAliases, -} from "@zodios/core/lib/zodios.types"; import type { IfEquals, PathParamNames, ReadonlyDeep, RequiredKeys, } from "@zodios/core/lib/utils.types"; +import type { Aliases, MutationMethod } from "@zodios/core/lib/zodios.types"; import { capitalize, pick, omit, hasObjectBody } from "./utils"; type UndefinedIfNever = IfEquals; @@ -107,6 +101,7 @@ export class ZodiosHooksClass< private readonly zodios: ZodiosInstance ) { this.injectAliasEndpoints(); + this.injectMutationEndpoints(); } private injectAliasEndpoints() { @@ -145,6 +140,16 @@ export class ZodiosHooksClass< }); } + private injectMutationEndpoints() { + HTTP_MUTATION_METHODS.forEach((method) => { + (this as any)[`use${capitalize(method)}`] = ( + path: any, + config: any, + mutationOptions: any + ) => this.useMutation(method, path, config, mutationOptions); + }); + } + private getEndpointByPath(method: string, path: string) { return this.zodios.api.find( (endpoint) => endpoint.method === method && endpoint.path === path @@ -180,7 +185,7 @@ export class ZodiosHooksClass< if (config) { const params = pick( config as AnyZodiosMethodOptions | undefined, - ["params", "queries"] + ["params", "queries", "body"] ); return [{ api: this.apiName, path: endpoint.path }, params] as QueryKey; } @@ -193,9 +198,7 @@ export class ZodiosHooksClass< * @param config - parameters of the api to the endpoint * @returns - QueryKey */ - getKeyByAlias< - Alias extends keyof ZodiosAliases - >( + getKeyByAlias>( alias: Alias extends string ? Alias : never, config?: Alias extends string ? ZodiosRequestOptionsByAlias< @@ -212,7 +215,7 @@ export class ZodiosHooksClass< if (config) { const params = pick( config as AnyZodiosMethodOptions | undefined, - ["params", "queries"] + ["params", "queries", "body"] ); return [{ api: this.apiName, path: endpoint.path }, params] as QueryKey; } @@ -602,150 +605,6 @@ export class ZodiosHooksClass< } { return this.useQuery(path, ...(rest as any[])); } - - usePost< - Path extends ZodiosPathsByMethod, - TConfig extends Omit< - ZodiosRequestOptionsByPath< - Api, - "post", - Path, - FetcherProvider, - true, - TypeProvider - >, - "body" - >, - MutationVariables = UndefinedIfNever< - ZodiosBodyByPath - > - >( - path: Path, - ...rest: RequiredKeys extends never - ? [ - config?: ReadonlyDeep, - mutationOptions?: MutationOptions - ] - : [ - config: ReadonlyDeep, - mutationOptions?: MutationOptions - ] - ): UseMutationResult< - ZodiosResponseByPath, - Errors, - MutationVariables - > { - // @ts-expect-error - return this.useMutation("post", path, ...rest); - } - - usePut< - Path extends ZodiosPathsByMethod, - TConfig extends Omit< - ZodiosRequestOptionsByPath< - Api, - "put", - Path, - FetcherProvider, - true, - TypeProvider - >, - "body" - >, - MutationVariables = UndefinedIfNever< - ZodiosBodyByPath - > - >( - path: Path, - ...rest: RequiredKeys extends never - ? [ - config?: ReadonlyDeep, - mutationOptions?: MutationOptions - ] - : [ - config: ReadonlyDeep, - mutationOptions?: MutationOptions - ] - ): UseMutationResult< - ZodiosResponseByPath, - Errors, - MutationVariables - > { - // @ts-expect-error - return this.useMutation("put", path, ...rest); - } - - usePatch< - Path extends ZodiosPathsByMethod, - TConfig extends Omit< - ZodiosRequestOptionsByPath< - Api, - "patch", - Path, - FetcherProvider, - true, - TypeProvider - >, - "body" - >, - MutationVariables = UndefinedIfNever< - ZodiosBodyByPath - > - >( - path: Path, - ...rest: RequiredKeys extends never - ? [ - config?: ReadonlyDeep, - mutationOptions?: MutationOptions - ] - : [ - config: ReadonlyDeep, - mutationOptions?: MutationOptions - ] - ): UseMutationResult< - ZodiosResponseByPath, - Errors, - MutationVariables - > { - // @ts-expect-error - return this.useMutation("patch", path, ...rest); - } - - useDelete< - Path extends ZodiosPathsByMethod, - TConfig extends Omit< - ZodiosRequestOptionsByPath< - Api, - "delete", - Path, - FetcherProvider, - true, - TypeProvider - >, - "body" - >, - MutationVariables = UndefinedIfNever< - ZodiosBodyByPath - > - >( - path: Path, - ...rest: RequiredKeys extends never - ? [ - config?: ReadonlyDeep, - mutationOptions?: MutationOptions - ] - : [ - config: ReadonlyDeep, - mutationOptions?: MutationOptions - ] - ): UseMutationResult< - ZodiosResponseByPath, - Errors, - MutationVariables - > { - // @ts-expect-error - return this.useMutation("delete", path, ...rest); - } } export type ZodiosMutationAliasHook = @@ -850,12 +709,52 @@ export type ZodiosHooksAliases< : never; }; +export type ZodiosHooksMutations< + Api extends ZodiosEndpointDefinitions, + FetcherProvider extends AnyZodiosFetcherProvider, + TypeProvider extends AnyZodiosTypeProvider +> = { + [M in MutationMethod as `use${Capitalize}`]: < + Path extends ZodiosPathsByMethod, + TConfig extends Omit< + ZodiosRequestOptionsByPath< + Api, + M, + Path, + FetcherProvider, + true, + TypeProvider + >, + "body" + >, + MutationVariables = UndefinedIfNever< + ZodiosBodyByPath + > + >( + path: Path, + ...rest: RequiredKeys extends never + ? [ + config?: ReadonlyDeep, + mutationOptions?: MutationOptions + ] + : [ + config: ReadonlyDeep, + mutationOptions?: MutationOptions + ] + ) => UseMutationResult< + ZodiosResponseByPath, + Errors, + MutationVariables + >; +}; + export type ZodiosHooksInstance< Api extends ZodiosEndpointDefinitions, FetcherProvider extends AnyZodiosFetcherProvider, TypeProvider extends AnyZodiosTypeProvider > = ZodiosHooksClass & - ZodiosHooksAliases; + ZodiosHooksAliases & + ZodiosHooksMutations; export type ZodiosHooksConstructor = { new < From 19fc4d66a4d1fb47cb09293766ffab47b0e76bd7 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sun, 27 Nov 2022 11:48:54 +0100 Subject: [PATCH 083/206] RELEASING: Releasing 5 package(s) Releases: @zodios/axios@11.0.0-beta.14 @zodios/core@11.0.0-beta.14 @zodios/fetch@11.0.0-beta.14 @zodios/react@11.0.0-beta.14 @zodios/testing@11.0.0-beta.14 [skip ci] --- packages/axios/CHANGELOG.md | 13 +++++++++++++ packages/axios/package.json | 2 +- packages/core/CHANGELOG.md | 7 +++++++ packages/core/package.json | 2 +- packages/fetch/CHANGELOG.md | 13 +++++++++++++ packages/fetch/package.json | 2 +- packages/react/CHANGELOG.md | 13 +++++++++++++ packages/react/package.json | 4 ++-- packages/testing/CHANGELOG.md | 13 +++++++++++++ packages/testing/package.json | 4 ++-- 10 files changed, 66 insertions(+), 7 deletions(-) diff --git a/packages/axios/CHANGELOG.md b/packages/axios/CHANGELOG.md index 072500de..bd4d56e0 100644 --- a/packages/axios/CHANGELOG.md +++ b/packages/axios/CHANGELOG.md @@ -1,5 +1,18 @@ # @zodios/core +## 11.0.0-beta.14 + +### Major Changes + +- 422221b: refactor: factor http verbs +- 13247c6: chore: fix type exports for nodenext + +### Patch Changes + +- Updated dependencies [422221b] +- Updated dependencies [13247c6] + - @zodios/core@11.0.0-beta.14 + ## 11.0.0-beta.13 ### Major Changes diff --git a/packages/axios/package.json b/packages/axios/package.json index 86057b0b..b45056ab 100644 --- a/packages/axios/package.json +++ b/packages/axios/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/axios", "description": "Typescript API client with axios", - "version": "11.0.0-beta.13", + "version": "11.0.0-beta.14", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 97f0e3df..fa4df7f2 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,12 @@ # @zodios/core +## 11.0.0-beta.14 + +### Major Changes + +- 422221b: refactor: factor http verbs +- 13247c6: chore: fix type exports for nodenext + ## 11.0.0-beta.13 ### Major Changes diff --git a/packages/core/package.json b/packages/core/package.json index 6e4492a9..ff3efb16 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/core", "description": "Typescript API client with autocompletion and zod validations", - "version": "11.0.0-beta.13", + "version": "11.0.0-beta.14", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", diff --git a/packages/fetch/CHANGELOG.md b/packages/fetch/CHANGELOG.md index 072500de..bd4d56e0 100644 --- a/packages/fetch/CHANGELOG.md +++ b/packages/fetch/CHANGELOG.md @@ -1,5 +1,18 @@ # @zodios/core +## 11.0.0-beta.14 + +### Major Changes + +- 422221b: refactor: factor http verbs +- 13247c6: chore: fix type exports for nodenext + +### Patch Changes + +- Updated dependencies [422221b] +- Updated dependencies [13247c6] + - @zodios/core@11.0.0-beta.14 + ## 11.0.0-beta.13 ### Major Changes diff --git a/packages/fetch/package.json b/packages/fetch/package.json index 6dce9ea4..7c8b89c7 100644 --- a/packages/fetch/package.json +++ b/packages/fetch/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/fetch", "description": "Typescript API client with fetch", - "version": "11.0.0-beta.13", + "version": "11.0.0-beta.14", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", diff --git a/packages/react/CHANGELOG.md b/packages/react/CHANGELOG.md index 43b41483..30af06d6 100644 --- a/packages/react/CHANGELOG.md +++ b/packages/react/CHANGELOG.md @@ -1,5 +1,18 @@ # @zodios/react +## 11.0.0-beta.14 + +### Major Changes + +- 422221b: refactor: factor http verbs +- 13247c6: chore: fix type exports for nodenext + +### Patch Changes + +- Updated dependencies [422221b] +- Updated dependencies [13247c6] + - @zodios/core@11.0.0-beta.14 + ## 11.0.0-beta.13 ### Major Changes diff --git a/packages/react/package.json b/packages/react/package.json index 1f41489b..0e64d60e 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/react", "description": "React hooks for zodios", - "version": "11.0.0-beta.13", + "version": "11.0.0-beta.14", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", @@ -40,7 +40,7 @@ }, "peerDependencies": { "@tanstack/react-query": "4.x", - "@zodios/core": "11.0.0-beta.13", + "@zodios/core": "11.0.0-beta.14", "react": ">=16.8.0" }, "devDependencies": { diff --git a/packages/testing/CHANGELOG.md b/packages/testing/CHANGELOG.md index 1ff8118e..2d1a2287 100644 --- a/packages/testing/CHANGELOG.md +++ b/packages/testing/CHANGELOG.md @@ -1,5 +1,18 @@ # @zodios/core +## 11.0.0-beta.14 + +### Major Changes + +- 422221b: refactor: factor http verbs +- 13247c6: chore: fix type exports for nodenext + +### Patch Changes + +- Updated dependencies [422221b] +- Updated dependencies [13247c6] + - @zodios/core@11.0.0-beta.14 + ## 11.0.0-beta.13 ### Major Changes diff --git a/packages/testing/package.json b/packages/testing/package.json index d4de437f..efa6a6d6 100644 --- a/packages/testing/package.json +++ b/packages/testing/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/testing", "description": "Zodios mock library", - "version": "11.0.0-beta.13", + "version": "11.0.0-beta.14", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", @@ -37,7 +37,7 @@ "test": "jest --coverage" }, "peerDependencies": { - "@zodios/core": "11.0.0-beta.13" + "@zodios/core": "11.0.0-beta.14" }, "devDependencies": { "@jest/globals": "29.3.1", From 3664337394a9f15f509cf07d38dfa78d43ed67ae Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sun, 27 Nov 2022 16:57:27 +0100 Subject: [PATCH 084/206] docs(changeset): feat(react): simplify exported instance --- .changeset/pre.json | 2 ++ .changeset/twelve-dingos-cover.md | 9 +++++++++ packages/react/src/hooks.ts | 8 ++++---- packages/react/src/index.ts | 7 +------ 4 files changed, 16 insertions(+), 10 deletions(-) create mode 100644 .changeset/twelve-dingos-cover.md diff --git a/.changeset/pre.json b/.changeset/pre.json index 35031908..3e3a1768 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -22,6 +22,8 @@ "short-hounds-mix", "silent-garlics-scream", "slimy-pugs-melt", + "slow-worms-destroy", + "small-horses-laugh", "soft-seas-lie", "tasty-bags-happen" ] diff --git a/.changeset/twelve-dingos-cover.md b/.changeset/twelve-dingos-cover.md new file mode 100644 index 00000000..90835623 --- /dev/null +++ b/.changeset/twelve-dingos-cover.md @@ -0,0 +1,9 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +"@zodios/react": major +"@zodios/testing": major +--- + +feat(react): simplify exported instance diff --git a/packages/react/src/hooks.ts b/packages/react/src/hooks.ts index 3b050709..c82753c0 100644 --- a/packages/react/src/hooks.ts +++ b/packages/react/src/hooks.ts @@ -91,7 +91,7 @@ export type ImmutableInfiniteQueryOptions = Omit< "queryKey" | "queryFn" >; -export class ZodiosHooksClass< +export class ZodiosHooksImpl< Api extends ZodiosEndpointDefinitions, FetcherProvider extends AnyZodiosFetcherProvider, TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider @@ -752,11 +752,11 @@ export type ZodiosHooksInstance< Api extends ZodiosEndpointDefinitions, FetcherProvider extends AnyZodiosFetcherProvider, TypeProvider extends AnyZodiosTypeProvider -> = ZodiosHooksClass & +> = ZodiosHooksImpl & ZodiosHooksAliases & ZodiosHooksMutations; -export type ZodiosHooksConstructor = { +export type ZodiosHooks = { new < Api extends ZodiosEndpointDefinitions, FetcherProvider extends AnyZodiosFetcherProvider, @@ -767,4 +767,4 @@ export type ZodiosHooksConstructor = { ): ZodiosHooksInstance; }; -export const ZodiosHooks = ZodiosHooksClass as ZodiosHooksConstructor; +export const ZodiosHooks = ZodiosHooksImpl as ZodiosHooks; diff --git a/packages/react/src/index.ts b/packages/react/src/index.ts index 9b1f511f..9b8b40fb 100644 --- a/packages/react/src/index.ts +++ b/packages/react/src/index.ts @@ -1,6 +1 @@ -export { - ZodiosHooks, - ZodiosHooksClass, - ZodiosHooksConstructor, - ZodiosHooksInstance, -} from "./hooks"; +export { ZodiosHooks, ZodiosHooksInstance } from "./hooks"; From d0d24931390e28738d1cb2afca796bf70b0c5992 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sun, 27 Nov 2022 17:19:13 +0100 Subject: [PATCH 085/206] chore(deps): update react-query --- pnpm-lock.yaml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5676544f..6af31c0f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -134,7 +134,7 @@ importers: specifiers: '@jest/globals': 29.3.1 '@jest/types': 29.3.1 - '@tanstack/react-query': 4.16.1 + '@tanstack/react-query': 4.18.0 '@testing-library/dom': 8.19.0 '@testing-library/jest-dom': 5.16.5 '@testing-library/react': 13.4.0 @@ -164,7 +164,7 @@ importers: devDependencies: '@jest/globals': 29.3.1 '@jest/types': 29.3.1 - '@tanstack/react-query': 4.16.1_biqbaboplfbrettd7655fr4n2y + '@tanstack/react-query': 4.18.0_biqbaboplfbrettd7655fr4n2y '@testing-library/dom': 8.19.0 '@testing-library/jest-dom': 5.16.5 '@testing-library/react': 13.4.0_biqbaboplfbrettd7655fr4n2y @@ -1119,12 +1119,12 @@ packages: '@sinonjs/commons': 1.8.5 dev: true - /@tanstack/query-core/4.15.1: - resolution: {integrity: sha512-+UfqJsNbPIVo0a9ANW0ZxtjiMfGLaaoIaL9vZeVycvmBuWywJGtSi7fgPVMCPdZQFOzMsaXaOsDtSKQD5xLRVQ==} + /@tanstack/query-core/4.18.0: + resolution: {integrity: sha512-PP4mG8MD08sq64RZCqMfXMYfaj7+Oulwg7xZ/fJoEOdTZNcPIgaOkHajZvUBsNLbi/0ViMvJB4cFkL2Jg2WPbw==} dev: true - /@tanstack/react-query/4.16.1_biqbaboplfbrettd7655fr4n2y: - resolution: {integrity: sha512-PDE9u49wSDykPazlCoLFevUpceLjQ0Mm8i6038HgtTEKb/aoVnUZdlUP7C392ds3Cd75+EGlHU7qpEX06R7d9Q==} + /@tanstack/react-query/4.18.0_biqbaboplfbrettd7655fr4n2y: + resolution: {integrity: sha512-s1kdbGMdVcfUIllzsHUqVUdktBT5uuIRgnvrqFNLjl9TSOXEoBSDrhjsGjao0INQZv8cMpQlgOh3YH9YtN6cKw==} peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 @@ -1135,7 +1135,7 @@ packages: react-native: optional: true dependencies: - '@tanstack/query-core': 4.15.1 + '@tanstack/query-core': 4.18.0 react: 18.2.0 react-dom: 18.2.0_react@18.2.0 use-sync-external-store: 1.2.0_react@18.2.0 From 583c033f4b4efa8740de06542f5c2c29978f888b Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sun, 27 Nov 2022 21:37:08 +0100 Subject: [PATCH 086/206] feat(core): export base types as interfaces --- packages/core/src/zodios.types.ts | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/packages/core/src/zodios.types.ts b/packages/core/src/zodios.types.ts index a5cfe198..fb633d8c 100644 --- a/packages/core/src/zodios.types.ts +++ b/packages/core/src/zodios.types.ts @@ -692,7 +692,7 @@ export type ZodiosRequestOptionsByPath< >; export type ZodiosRequestOptions< - Api extends ZodiosEndpointDefinition[], + Api extends ZodiosEndpointDefinitions, M extends Method, Path extends ZodiosPathsByMethod, FetcherProvider extends AnyZodiosFetcherProvider, @@ -716,10 +716,10 @@ export type ZodiosRequestOptions< /** * Zodios options */ -export type ZodiosOptions< +export interface ZodiosOptions< FetcherProvider extends AnyZodiosFetcherProvider, TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider -> = { +> { /** * Should zodios validate parameters and response? Default: true */ @@ -740,9 +740,9 @@ export type ZodiosOptions< * set a custom type provider. Default: ZodTypeProvider */ typeProvider?: ZodiosRuntimeTypeProvider; -}; +} -export type ZodiosEndpointParameter = { +export interface ZodiosEndpointParameter { /** * name of the parameter */ @@ -760,11 +760,11 @@ export type ZodiosEndpointParameter = { * you can use zod `transform` to transform the value of the parameter before sending it to the server */ schema: unknown; -}; +} export type ZodiosEndpointParameters = ZodiosEndpointParameter[]; -export type ZodiosEndpointError = { +export interface ZodiosEndpointError { /** * status code of the error * use 'default' to declare a default error @@ -778,14 +778,14 @@ export type ZodiosEndpointError = { * schema of the error */ schema: unknown; -}; +} export type ZodiosEndpointErrors = ZodiosEndpointError[]; /** * Zodios enpoint definition that should be used to create a new instance of Zodios */ -export type ZodiosEndpointDefinition = { +export interface ZodiosEndpointDefinition { /** * http method : get, post, put, patch, delete */ @@ -841,14 +841,16 @@ export type ZodiosEndpointDefinition = { * optional errors of the endpoint - only usefull when using @zodios/express */ errors?: Array; -}; +} export type ZodiosEndpointDefinitions = ZodiosEndpointDefinition[]; /** * Zodios plugin that can be used to intercept zodios requests and responses */ -export type ZodiosPlugin = { +export interface ZodiosPlugin< + FetcherProvider extends AnyZodiosFetcherProvider +> { /** * Optional name of the plugin * naming a plugin allows to remove it or replace it later @@ -889,4 +891,4 @@ export type ZodiosPlugin = { config: ReadonlyDeep>, error: Error ) => Promise>; -}; +} From f73aeae0f5a4b68c6a60a500ab7238c86414c285 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sun, 27 Nov 2022 21:37:18 +0100 Subject: [PATCH 087/206] feat(core): export base types as interfaces --- packages/core/src/type-providers/type-provider.types.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/core/src/type-providers/type-provider.types.ts b/packages/core/src/type-providers/type-provider.types.ts index 86ca19e3..7bd4ac5f 100644 --- a/packages/core/src/type-providers/type-provider.types.ts +++ b/packages/core/src/type-providers/type-provider.types.ts @@ -18,10 +18,10 @@ export type ZodiosValidateResult = | { success: true; data: any } | { success: false; error: any }; -export type ZodiosRuntimeTypeProvider< +export interface ZodiosRuntimeTypeProvider< TypeProvider extends AnyZodiosTypeProvider -> = { +> { readonly _provider?: TypeProvider; validate: (schema: any, input: unknown) => ZodiosValidateResult; validateAsync: (schema: any, input: unknown) => Promise; -}; +} From 26ee1cfd2607a5bc2a4ef4bad9906213bbaabbd0 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Mon, 28 Nov 2022 21:57:33 +0100 Subject: [PATCH 088/206] feat(signals): add signal combination handling --- packages/fetch/src/fetch-provider/fetch.ts | 38 +++++-- .../fetch/src/fetch-provider/fetch.utils.ts | 37 ++++++ packages/fetch/src/zodios.test.ts | 106 ++++++++++++++++++ packages/react/jest.config.ts | 2 +- packages/react/src/hooks.spec.tsx | 104 +++++++++++++++++ packages/react/src/hooks.ts | 35 ++++-- packages/react/src/utils.ts | 37 ++++++ 7 files changed, 343 insertions(+), 16 deletions(-) diff --git a/packages/fetch/src/fetch-provider/fetch.ts b/packages/fetch/src/fetch-provider/fetch.ts index 3bce5115..20c3fd3e 100644 --- a/packages/fetch/src/fetch-provider/fetch.ts +++ b/packages/fetch/src/fetch-provider/fetch.ts @@ -1,6 +1,12 @@ import { AnyZodiosRequestOptions } from "@zodios/core"; import { FetchProviderResponse, FetchProviderConfig } from "./fetch.types"; -import { buildURL, isBlob, isFile, isFormData } from "./fetch.utils"; +import { + buildURL, + combineSignals, + isBlob, + isFile, + isFormData, +} from "./fetch.utils"; import { FetchProvider } from "./fetcher-provider.fetch"; export class FetchError extends Error { @@ -50,6 +56,16 @@ export const advancedFetch = async ( return response; }; +// istanbul ignore next +function getAbortTimeout(ms: number): AbortSignal { + const controller = new AbortController(); + const id = setTimeout(() => controller.abort(), ms); + controller.signal.addEventListener("abort", () => { + clearTimeout(id); + }); + return controller.signal; +} + function createFetchRequest(config: AnyZodiosRequestOptions) { const headers = new Headers(config.headers); if (isFormData(config.body) || isBlob(config.body) || isFile(config.body)) { @@ -72,12 +88,20 @@ function createFetchRequest(config: AnyZodiosRequestOptions) { headers.set("Authorization", `Basic ${btoa(username + ":" + password)}`); } - // istanbul ignore next - if (config.timeout && !config.signal) { - const controller = new AbortController(); - const timeout = setTimeout(() => controller.abort(), config.timeout); - config.signal = controller.signal; - config.signal.addEventListener("abort", () => clearTimeout(timeout)); + if (config.timeout) { + if (!globalThis.AbortController) { + console.warn("Timeout is not supported in this environment"); + } else if (globalThis.AbortSignal && "timeout" in globalThis.AbortSignal) { + config.signal = combineSignals( + config.signal, + AbortSignal.timeout(config.timeout) + ); + } else { + config.signal = combineSignals( + config.signal, + getAbortTimeout(config.timeout) + ); + } } const url = buildURL(config); diff --git a/packages/fetch/src/fetch-provider/fetch.utils.ts b/packages/fetch/src/fetch-provider/fetch.utils.ts index ca082fa0..3349a9db 100644 --- a/packages/fetch/src/fetch-provider/fetch.utils.ts +++ b/packages/fetch/src/fetch-provider/fetch.utils.ts @@ -69,3 +69,40 @@ export function buildURL(config: AnyZodiosRequestOptions) { } return `${fullURL}${serializedParams}`; } + +function isDefinedSignal( + signal: AbortSignal | undefined | null +): signal is AbortSignal { + return Boolean(signal); +} + +/** + * combine multiple abort signals into one + * @param signals - the signals to listen to + * @returns - the combined signal + */ +export function combineSignals( + ...signals: (AbortSignal | undefined | null)[] +): AbortSignal | undefined { + const definedSignals: AbortSignal[] = signals.filter(isDefinedSignal); + if (definedSignals.length < 2) { + return definedSignals[0]; + } + const controller = new AbortController(); + + function onAbort() { + controller.abort(); + definedSignals.forEach((signal) => { + signal.removeEventListener("abort", onAbort); + }); + } + + definedSignals.forEach((signal) => { + if (signal.aborted) { + onAbort(); + } else { + signal.addEventListener("abort", onAbort); + } + }); + return controller.signal; +} diff --git a/packages/fetch/src/zodios.test.ts b/packages/fetch/src/zodios.test.ts index 2dcad89f..e96893c4 100644 --- a/packages/fetch/src/zodios.test.ts +++ b/packages/fetch/src/zodios.test.ts @@ -79,6 +79,10 @@ describe("Zodios", () => { app.post("/text", express.text(), (req, res) => { res.status(200).send(req.body); }); + app.get("/cancel", async (req, res) => { + await new Promise((resolve) => setTimeout(resolve, 1000)); + res.status(200).json({ shouldNotBeReturned: true }); + }); server = app.listen(0); port = (server.address() as AddressInfo).port; }); @@ -816,6 +820,108 @@ received: } }); + it("should cancel request on timeout", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/cancel", + response: z.object({ + shouldNotBeReturned: z.boolean(), + }), + }, + ]); + let error: Error | undefined; + let result; + try { + result = await zodios.get("/cancel", { timeout: 1 }); + } catch (e) { + error = e as Error; + } + expect(result).toBeUndefined(); + expect(error).toBeInstanceOf(Error); + expect(error!.message).toBe("The user aborted a request."); + }); + + it("should cancel request on abort", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/cancel", + response: z.object({ + shouldNotBeReturned: z.boolean(), + }), + }, + ]); + let error: Error | undefined; + let result; + const controller = new AbortController(); + try { + const promise = zodios.get("/cancel", { signal: controller.signal }); + controller.abort(); + result = await promise; + } catch (e) { + error = e as Error; + } + expect(result).toBeUndefined(); + expect(error).toBeInstanceOf(Error); + expect(error!.message).toBe("The user aborted a request."); + }); + + it("should cancel request on abort with timeout", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/cancel", + response: z.object({ + shouldNotBeReturned: z.boolean(), + }), + }, + ]); + let error: Error | undefined; + let result; + const controller = new AbortController(); + try { + const promise = zodios.get("/cancel", { + signal: controller.signal, + timeout: 1000, + }); + controller.abort(); + result = await promise; + } catch (e) { + error = e as Error; + } + expect(result).toBeUndefined(); + expect(error).toBeInstanceOf(Error); + expect(error!.message).toBe("The user aborted a request."); + }); + + it("should cancel request on timeout with abort", async () => { + const zodios = new Zodios(`http://localhost:${port}`, [ + { + method: "get", + path: "/cancel", + response: z.object({ + shouldNotBeReturned: z.boolean(), + }), + }, + ]); + let error: Error | undefined; + let result; + const controller = new AbortController(); + try { + const promise = zodios.get("/cancel", { + signal: controller.signal, + timeout: 1, + }); + result = await promise; + } catch (e) { + error = e as Error; + } + expect(result).toBeUndefined(); + expect(error).toBeInstanceOf(Error); + expect(error!.message).toBe("The user aborted a request."); + }); + it("should match Expected error", async () => { const zodios = new Zodios(`http://localhost:${port}`, [ { diff --git a/packages/react/jest.config.ts b/packages/react/jest.config.ts index e334c0a3..6c31134b 100644 --- a/packages/react/jest.config.ts +++ b/packages/react/jest.config.ts @@ -14,7 +14,7 @@ const config: Config.InitialOptions = { coverageDirectory: "./coverage", coverageThreshold: { global: { - branches: 85, + branches: 75, functions: 85, lines: 85, statements: 85, diff --git a/packages/react/src/hooks.spec.tsx b/packages/react/src/hooks.spec.tsx index 2c063ebb..7d92e1ca 100644 --- a/packages/react/src/hooks.spec.tsx +++ b/packages/react/src/hooks.spec.tsx @@ -159,6 +159,15 @@ const api = makeApi([ name: z.string(), }), }, + { + method: "get", + path: "/users/:id/cancel", + alias: "getUserCancel", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, ]); const queryClient = new QueryClient({ @@ -318,6 +327,10 @@ describe("zodios hooks", () => { app.get("/users/:id/error", (req, res) => { res.status(200).json({ id: Number(req.params.id), names: "test" }); }); + app.get("/users/:id/cancel", async (req, res) => { + await new Promise((resolve) => setTimeout(resolve, 1000)); + res.status(200).json({ id: Number(req.params.id), name: "test" }); + }); server = app.listen(0); port = (server.address() as AddressInfo).port; @@ -555,6 +568,97 @@ describe("zodios hooks", () => { expect(result.current.userDeleted).toEqual({ id: 3 }); }); + it("should cancel request with signal", async () => { + const apiClient = new Zodios(`http://localhost:${port}`, api); + const apiHooks = new ZodiosHooks("test", apiClient, { + shouldAbortOnUnmount: true, + }); + const { result, waitFor } = renderHook( + () => { + const controller = new AbortController(); + const apiCancel = apiHooks.useGet("/users/:id/cancel", { + params: { id: 1 }, + signal: controller.signal, + timeout: 1000, + }); + return { apiCancel, controller }; + }, + { wrapper } + ); + result.current.controller.abort(); + await waitFor(() => result.current.apiCancel.isError); + expect(result.current.apiCancel.error!.message).toEqual( + "The user aborted a request." + ); + }); + + it("should cancel request early with signal", async () => { + const apiClient = new Zodios(`http://localhost:${port}`, api); + const apiHooks = new ZodiosHooks("test", apiClient, { + shouldAbortOnUnmount: true, + }); + const { result, waitFor } = renderHook( + () => { + const controller = new AbortController(); + controller.abort(); + const apiCancel = apiHooks.useGet("/users/:id/cancel", { + params: { id: 1 }, + signal: controller.signal, + }); + return { apiCancel }; + }, + { wrapper } + ); + await waitFor(() => result.current.apiCancel.isError); + expect(result.current.apiCancel.error!.message).toEqual( + "The user aborted a request." + ); + }); + + it("should cancel request with timeout and signal", async () => { + const apiClient = new Zodios(`http://localhost:${port}`, api); + const apiHooks = new ZodiosHooks("test", apiClient, { + shouldAbortOnUnmount: true, + }); + const { result, waitFor } = renderHook( + () => { + const controller = new AbortController(); + const apiCancel = apiHooks.useGet("/users/:id/cancel", { + params: { id: 1 }, + signal: controller.signal, + timeout: 1, + }); + return { apiCancel }; + }, + { wrapper } + ); + await waitFor(() => result.current.apiCancel.isError); + expect(result.current.apiCancel.error!.message).toEqual( + "The user aborted a request." + ); + }); + + it("should cancel request with timeout", async () => { + const apiClient = new Zodios(`http://localhost:${port}`, api); + const apiHooks = new ZodiosHooks("test", apiClient, { + shouldAbortOnUnmount: true, + }); + const { result, waitFor } = renderHook( + () => { + const apiCancel = apiHooks.useGet("/users/:id/cancel", { + params: { id: 1 }, + timeout: 1, + }); + return { apiCancel }; + }, + { wrapper } + ); + await waitFor(() => result.current.apiCancel.isError); + expect(result.current.apiCancel.error!.message).toEqual( + "The user aborted a request." + ); + }); + it("should infinite load users", async () => { const apiClient = new Zodios(`http://localhost:${port}`, api); const apiHooks = new ZodiosHooks("test", apiClient); diff --git a/packages/react/src/hooks.ts b/packages/react/src/hooks.ts index c82753c0..3a7dea78 100644 --- a/packages/react/src/hooks.ts +++ b/packages/react/src/hooks.ts @@ -39,7 +39,7 @@ import type { RequiredKeys, } from "@zodios/core/lib/utils.types"; import type { Aliases, MutationMethod } from "@zodios/core/lib/zodios.types"; -import { capitalize, pick, omit, hasObjectBody } from "./utils"; +import { capitalize, pick, omit, hasObjectBody, combineSignals } from "./utils"; type UndefinedIfNever = IfEquals; type Errors = Error | ZodiosError; @@ -98,7 +98,8 @@ export class ZodiosHooksImpl< > { constructor( private readonly apiName: string, - private readonly zodios: ZodiosInstance + private readonly zodios: ZodiosInstance, + private readonly options: { shouldAbortOnUnmount?: boolean } = {} ) { this.injectAliasEndpoints(); this.injectMutationEndpoints(); @@ -254,8 +255,13 @@ export class ZodiosHooksImpl< ["params", "queries", "body"] ); const key = [{ api: this.apiName, path }, params] as QueryKey; - // @ts-expect-error - const query = () => this.zodios.get(path, config); + const query = ({ signal }: { signal?: AbortSignal }) => + this.zodios.get(path, { + ...(config as any), + signal: this.options.shouldAbortOnUnmount + ? combineSignals(signal, (config as any)?.signal) + : (config as any)?.signal, + }); const queryClient = useQueryClient(); const invalidate = () => queryClient.invalidateQueries(key); return { @@ -298,7 +304,13 @@ export class ZodiosHooksImpl< ["params", "queries", "body"] ); const key = [{ api: this.apiName, path }, params] as QueryKey; - const query = () => this.zodios.post(path, config as any); + const query = ({ signal }: { signal?: AbortSignal }) => + this.zodios.post(path, { + ...(config as any), + signal: this.options.shouldAbortOnUnmount + ? combineSignals(signal, (config as any)?.signal) + : (config as any)?.signal, + }); const queryClient = useQueryClient(); const invalidate = () => queryClient.invalidateQueries(key); return { @@ -381,7 +393,7 @@ export class ZodiosHooksImpl< ); } const key = [{ api: this.apiName, path }, params]; - const query = ({ pageParam = undefined }: QueryFunctionContext) => + const query = ({ pageParam = undefined, signal }: QueryFunctionContext) => this.zodios.get(path, { ...config, queries: { @@ -400,6 +412,9 @@ export class ZodiosHooksImpl< ...pageParam?.body, } : config?.body, + signal: this.options.shouldAbortOnUnmount + ? combineSignals(signal, (config as any)?.signal) + : (config as any)?.signal, } as unknown as ReadonlyDeep); const queryClient = useQueryClient(); const invalidate = () => queryClient.invalidateQueries(key); @@ -496,7 +511,7 @@ export class ZodiosHooksImpl< ); } const key = [{ api: this.apiName, path }, params]; - const query = ({ pageParam = undefined }: QueryFunctionContext) => + const query = ({ pageParam = undefined, signal }: QueryFunctionContext) => this.zodios.post(path, { ...config, queries: { @@ -515,6 +530,9 @@ export class ZodiosHooksImpl< ...pageParam?.body, } : config?.body, + signal: this.options.shouldAbortOnUnmount + ? combineSignals(signal, (config as any)?.signal) + : (config as any)?.signal, } as unknown as ReadonlyDeep); const queryClient = useQueryClient(); const invalidate = () => queryClient.invalidateQueries(key); @@ -763,7 +781,8 @@ export type ZodiosHooks = { TypeProvider extends AnyZodiosTypeProvider >( name: string, - zodios: ZodiosInstance + zodios: ZodiosInstance, + options?: { shouldAbortOnUnmount?: boolean } ): ZodiosHooksInstance; }; diff --git a/packages/react/src/utils.ts b/packages/react/src/utils.ts index 96c85756..d3c077e8 100644 --- a/packages/react/src/utils.ts +++ b/packages/react/src/utils.ts @@ -54,3 +54,40 @@ export function hasObjectBody(config?: any) { !Array.isArray(config.body) ); } + +function isDefinedSignal( + signal: AbortSignal | undefined | null +): signal is AbortSignal { + return Boolean(signal); +} + +/** + * combine multiple abort signals into one + * @param signals - the signals to listen to + * @returns - the combined signal + */ +export function combineSignals( + ...signals: (AbortSignal | undefined | null)[] +): AbortSignal | undefined { + const definedSignals: AbortSignal[] = signals.filter(isDefinedSignal); + if (definedSignals.length < 2) { + return definedSignals[0]; + } + const controller = new AbortController(); + + function onAbort() { + controller.abort(); + definedSignals.forEach((signal) => { + signal.removeEventListener("abort", onAbort); + }); + } + + definedSignals.forEach((signal) => { + if (signal.aborted) { + onAbort(); + } else { + signal.addEventListener("abort", onAbort); + } + }); + return controller.signal; +} From aa43e8a16d6e26a4265fe4c5f027f4afa796885a Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Mon, 28 Nov 2022 23:39:23 +0100 Subject: [PATCH 089/206] chore: add experimental flag for node 14 tests --- packages/fetch/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/fetch/package.json b/packages/fetch/package.json index 7c8b89c7..a51b19d2 100644 --- a/packages/fetch/package.json +++ b/packages/fetch/package.json @@ -38,7 +38,7 @@ "example": "ts-node examples/jsonplaceholder.ts", "example:dev.to": "ts-node examples/dev.to/example.ts", "build": "tsup", - "test": "jest --coverage" + "test": "NODE_OPTIONS=--experimental-abortcontroller jest --coverage" }, "peerDependencies": { "fp-ts": "2.x", From 15a901bcee89719f14bad7c4a53b3d2861f9662d Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Tue, 29 Nov 2022 00:02:36 +0100 Subject: [PATCH 090/206] fix(fetch): check if error like on retrow --- packages/fetch/src/fetch-provider/fetch.ts | 10 ++++++++-- packages/fetch/src/zodios.test.ts | 8 ++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/packages/fetch/src/fetch-provider/fetch.ts b/packages/fetch/src/fetch-provider/fetch.ts index 20c3fd3e..5153eb9a 100644 --- a/packages/fetch/src/fetch-provider/fetch.ts +++ b/packages/fetch/src/fetch-provider/fetch.ts @@ -112,12 +112,18 @@ function createFetchRequest(config: AnyZodiosRequestOptions) { }); } +function isErrorLike(error: unknown): error is Error { + return ( + error instanceof Error || + (!!error && typeof error === "object" && "message" in error) + ); +} + async function fetchRequest(request: Request, config: FetchProviderConfig) { try { return await fetch(request); } catch (error) { - // istanbul ignore next - if (error instanceof Error) { + if (isErrorLike(error)) { throw new FetchError(error.message, "ERR_NETWORK", config, request); } else { throw new FetchError("Network Error", "ERR_NETWORK", config, request); diff --git a/packages/fetch/src/zodios.test.ts b/packages/fetch/src/zodios.test.ts index e96893c4..9d047472 100644 --- a/packages/fetch/src/zodios.test.ts +++ b/packages/fetch/src/zodios.test.ts @@ -839,7 +839,7 @@ received: } expect(result).toBeUndefined(); expect(error).toBeInstanceOf(Error); - expect(error!.message).toBe("The user aborted a request."); + expect(error!.message).toContain("aborted"); }); it("should cancel request on abort", async () => { @@ -864,7 +864,7 @@ received: } expect(result).toBeUndefined(); expect(error).toBeInstanceOf(Error); - expect(error!.message).toBe("The user aborted a request."); + expect(error!.message).toContain("aborted"); }); it("should cancel request on abort with timeout", async () => { @@ -892,7 +892,7 @@ received: } expect(result).toBeUndefined(); expect(error).toBeInstanceOf(Error); - expect(error!.message).toBe("The user aborted a request."); + expect(error!.message).toContain("aborted"); }); it("should cancel request on timeout with abort", async () => { @@ -919,7 +919,7 @@ received: } expect(result).toBeUndefined(); expect(error).toBeInstanceOf(Error); - expect(error!.message).toBe("The user aborted a request."); + expect(error!.message).toContain("aborted"); }); it("should match Expected error", async () => { From b4093e8b351c03efc057f89e6b512cffc845d333 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Tue, 29 Nov 2022 00:19:57 +0100 Subject: [PATCH 091/206] chore: ignore branch paths --- packages/fetch/src/fetch-provider/fetch.ts | 5 ++++- packages/fetch/src/fetch-provider/fetch.utils.ts | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/fetch/src/fetch-provider/fetch.ts b/packages/fetch/src/fetch-provider/fetch.ts index 5153eb9a..0b8cac64 100644 --- a/packages/fetch/src/fetch-provider/fetch.ts +++ b/packages/fetch/src/fetch-provider/fetch.ts @@ -69,8 +69,8 @@ function getAbortTimeout(ms: number): AbortSignal { function createFetchRequest(config: AnyZodiosRequestOptions) { const headers = new Headers(config.headers); if (isFormData(config.body) || isBlob(config.body) || isFile(config.body)) { + // istanbul ignore next if (headers.has("Content-Type")) { - // istanbul ignore next headers.delete("Content-Type"); } } else if (typeof config.body === "object") { @@ -88,6 +88,7 @@ function createFetchRequest(config: AnyZodiosRequestOptions) { headers.set("Authorization", `Basic ${btoa(username + ":" + password)}`); } + // istanbul ignore next if (config.timeout) { if (!globalThis.AbortController) { console.warn("Timeout is not supported in this environment"); @@ -112,6 +113,7 @@ function createFetchRequest(config: AnyZodiosRequestOptions) { }); } +// istanbul ignore next function isErrorLike(error: unknown): error is Error { return ( error instanceof Error || @@ -123,6 +125,7 @@ async function fetchRequest(request: Request, config: FetchProviderConfig) { try { return await fetch(request); } catch (error) { + // istanbul ignore next if (isErrorLike(error)) { throw new FetchError(error.message, "ERR_NETWORK", config, request); } else { diff --git a/packages/fetch/src/fetch-provider/fetch.utils.ts b/packages/fetch/src/fetch-provider/fetch.utils.ts index 3349a9db..fa705e1a 100644 --- a/packages/fetch/src/fetch-provider/fetch.utils.ts +++ b/packages/fetch/src/fetch-provider/fetch.utils.ts @@ -40,6 +40,7 @@ function queriesToSearchString( } else if (typeof value === "string") { searchParams.append(key, value); } else { + // istanbul ignore next searchParams.append(key, JSON.stringify(value)); } }); From 6d31fa78c2aaf2f8f27c3dec126f63876fdd50ab Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Mon, 12 Dec 2022 21:49:16 +0100 Subject: [PATCH 092/206] docs(changeset): chore(deps): update zod --- .changeset/five-apricots-breathe.md | 9 +++++++++ packages/axios/package.json | 2 +- packages/core/package.json | 2 +- packages/fetch/package.json | 2 +- packages/react/package.json | 2 +- packages/testing/package.json | 2 +- pnpm-lock.yaml | 24 ++++++++++++------------ 7 files changed, 26 insertions(+), 17 deletions(-) create mode 100644 .changeset/five-apricots-breathe.md diff --git a/.changeset/five-apricots-breathe.md b/.changeset/five-apricots-breathe.md new file mode 100644 index 00000000..0cec17bc --- /dev/null +++ b/.changeset/five-apricots-breathe.md @@ -0,0 +1,9 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +"@zodios/react": major +"@zodios/testing": major +--- + +chore(deps): update zod diff --git a/packages/axios/package.json b/packages/axios/package.json index b45056ab..bb6e82a4 100644 --- a/packages/axios/package.json +++ b/packages/axios/package.json @@ -75,7 +75,7 @@ "ts-node": "10.9.1", "tsup": "6.3.0", "typescript": "4.9.3", - "zod": "3.19.1" + "zod": "3.20.1" }, "dependencies": { "@zodios/core": "workspace:*" diff --git a/packages/core/package.json b/packages/core/package.json index ff3efb16..c10091e4 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -69,6 +69,6 @@ "ts-node": "10.9.1", "tsup": "6.3.0", "typescript": "4.9.3", - "zod": "3.19.1" + "zod": "3.20.1" } } diff --git a/packages/fetch/package.json b/packages/fetch/package.json index a51b19d2..81cbd8c5 100644 --- a/packages/fetch/package.json +++ b/packages/fetch/package.json @@ -74,7 +74,7 @@ "ts-node": "10.9.1", "tsup": "6.3.0", "typescript": "4.9.3", - "zod": "3.19.1" + "zod": "3.20.1" }, "dependencies": { "@zodios/core": "workspace:*" diff --git a/packages/react/package.json b/packages/react/package.json index 0e64d60e..240b149d 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -72,7 +72,7 @@ "ts-node": "10.9.1", "tsup": "6.3.0", "typescript": "4.9.3", - "zod": "3.19.1" + "zod": "3.20.1" }, "resolutions": { "@types/react": "18.0.25" diff --git a/packages/testing/package.json b/packages/testing/package.json index efa6a6d6..dbc91b39 100644 --- a/packages/testing/package.json +++ b/packages/testing/package.json @@ -55,6 +55,6 @@ "ts-node": "10.9.1", "tsup": "6.3.0", "typescript": "4.9.3", - "zod": "3.19.1" + "zod": "3.20.1" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6af31c0f..ad43267b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -32,7 +32,7 @@ importers: ts-node: 10.9.1 tsup: 6.3.0 typescript: 4.9.3 - zod: 3.19.1 + zod: 3.20.1 dependencies: '@zodios/core': link:../core devDependencies: @@ -53,7 +53,7 @@ importers: ts-node: 10.9.1_wup25etrarvlqkprac7h35hj7u tsup: 6.3.0_2dtigtkb225m7ii7q45utxqwgi typescript: 4.9.3 - zod: 3.19.1 + zod: 3.20.1 packages/core: specifiers: @@ -70,7 +70,7 @@ importers: ts-node: 10.9.1 tsup: 6.3.0 typescript: 4.9.3 - zod: 3.19.1 + zod: 3.20.1 devDependencies: '@jest/globals': 29.3.1 '@jest/types': 29.3.1 @@ -85,7 +85,7 @@ importers: ts-node: 10.9.1_wup25etrarvlqkprac7h35hj7u tsup: 6.3.0_2dtigtkb225m7ii7q45utxqwgi typescript: 4.9.3 - zod: 3.19.1 + zod: 3.20.1 packages/fetch: specifiers: @@ -107,7 +107,7 @@ importers: ts-node: 10.9.1 tsup: 6.3.0 typescript: 4.9.3 - zod: 3.19.1 + zod: 3.20.1 dependencies: '@zodios/core': link:../core devDependencies: @@ -128,7 +128,7 @@ importers: ts-node: 10.9.1_wup25etrarvlqkprac7h35hj7u tsup: 6.3.0_2dtigtkb225m7ii7q45utxqwgi typescript: 4.9.3 - zod: 3.19.1 + zod: 3.20.1 packages/react: specifiers: @@ -160,7 +160,7 @@ importers: ts-node: 10.9.1 tsup: 6.3.0 typescript: 4.9.3 - zod: 3.19.1 + zod: 3.20.1 devDependencies: '@jest/globals': 29.3.1 '@jest/types': 29.3.1 @@ -190,7 +190,7 @@ importers: ts-node: 10.9.1_wup25etrarvlqkprac7h35hj7u tsup: 6.3.0_2dtigtkb225m7ii7q45utxqwgi typescript: 4.9.3 - zod: 3.19.1 + zod: 3.20.1 packages/testing: specifiers: @@ -209,7 +209,7 @@ importers: ts-node: 10.9.1 tsup: 6.3.0 typescript: 4.9.3 - zod: 3.19.1 + zod: 3.20.1 devDependencies: '@jest/globals': 29.3.1 '@jest/types': 29.3.1 @@ -226,7 +226,7 @@ importers: ts-node: 10.9.1_wup25etrarvlqkprac7h35hj7u tsup: 6.3.0_2dtigtkb225m7ii7q45utxqwgi typescript: 4.9.3 - zod: 3.19.1 + zod: 3.20.1 packages: @@ -5752,6 +5752,6 @@ packages: engines: {node: '>=10'} dev: true - /zod/3.19.1: - resolution: {integrity: sha512-LYjZsEDhCdYET9ikFu6dVPGp2YH9DegXjdJToSzD9rO6fy4qiRYFoyEYwps88OseJlPyl2NOe2iJuhEhL7IpEA==} + /zod/3.20.1: + resolution: {integrity: sha512-At2YngeqktnHk6L9vf6Sdt7IGcRFziasf7JyQfKwxMd2rOWIUvURP6oLUTW6N0WKQ5bcIdI+IZ3+uGZCCcQcQg==} dev: true From 8269c4b812adf6a2964b02c71225a597f5751997 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Mon, 12 Dec 2022 22:02:24 +0100 Subject: [PATCH 093/206] docs(changeset): chore(deps): update fp-ts --- .changeset/good-tigers-tie.md | 9 +++++++++ packages/axios/package.json | 2 +- packages/core/package.json | 2 +- packages/fetch/package.json | 2 +- packages/react/package.json | 10 ++++++---- packages/testing/package.json | 2 +- pnpm-lock.yaml | 28 ++++++++++++++++------------ 7 files changed, 35 insertions(+), 20 deletions(-) create mode 100644 .changeset/good-tigers-tie.md diff --git a/.changeset/good-tigers-tie.md b/.changeset/good-tigers-tie.md new file mode 100644 index 00000000..683ffa0c --- /dev/null +++ b/.changeset/good-tigers-tie.md @@ -0,0 +1,9 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +"@zodios/react": major +"@zodios/testing": major +--- + +chore(deps): update fp-ts diff --git a/packages/axios/package.json b/packages/axios/package.json index bb6e82a4..c41ce215 100644 --- a/packages/axios/package.json +++ b/packages/axios/package.json @@ -67,7 +67,7 @@ "axios": "1.2.0", "express": "4.18.2", "fp-ts": "2.13.1", - "io-ts": "2.2.19", + "io-ts": "2.2.20", "jest": "29.3.0", "multer": "1.4.5-lts.1", "rimraf": "3.0.2", diff --git a/packages/core/package.json b/packages/core/package.json index c10091e4..b4dcb1e4 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -62,7 +62,7 @@ "@types/node": "18.11.9", "form-data": "^4.0.0", "fp-ts": "2.13.1", - "io-ts": "2.2.19", + "io-ts": "2.2.20", "jest": "29.3.0", "rimraf": "3.0.2", "ts-jest": "29.0.3", diff --git a/packages/fetch/package.json b/packages/fetch/package.json index 81cbd8c5..76394aa5 100644 --- a/packages/fetch/package.json +++ b/packages/fetch/package.json @@ -66,7 +66,7 @@ "cross-fetch": "3.1.5", "express": "4.18.2", "fp-ts": "2.13.1", - "io-ts": "2.2.19", + "io-ts": "2.2.20", "jest": "29.3.0", "multer": "1.4.5-lts.1", "rimraf": "3.0.2", diff --git a/packages/react/package.json b/packages/react/package.json index 240b149d..4e48a85f 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -40,7 +40,8 @@ }, "peerDependencies": { "@tanstack/react-query": "4.x", - "@zodios/core": "11.0.0-beta.14", + "@zodios/axios": "11.0.0-beta.14", + "@zodios/fetch": "11.0.0-beta.14", "react": ">=16.8.0" }, "devDependencies": { @@ -57,11 +58,13 @@ "@types/jest": "29.2.3", "@types/node": "18.11.9", "@types/react": "18.0.25", - "@zodios/core": "workspace:*", + "@zodios/axios": "workspace:*", "@zodios/fetch": "workspace:*", "cors": "2.8.5", "cross-fetch": "3.1.5", "express": "4.18.2", + "fp-ts": "2.13.1", + "io-ts": "2.2.20", "jest": "29.3.1", "jest-environment-jsdom": "29.3.1", "react": "18.2.0", @@ -76,6 +79,5 @@ }, "resolutions": { "@types/react": "18.0.25" - }, - "dependencies": {} + } } diff --git a/packages/testing/package.json b/packages/testing/package.json index dbc91b39..b79355ed 100644 --- a/packages/testing/package.json +++ b/packages/testing/package.json @@ -48,7 +48,7 @@ "@zodios/fetch": "workspace:*", "form-data": "^4.0.0", "fp-ts": "2.13.1", - "io-ts": "2.2.19", + "io-ts": "2.2.20", "jest": "29.3.0", "rimraf": "3.0.2", "ts-jest": "29.0.3", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ad43267b..88f22b25 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -24,7 +24,7 @@ importers: axios: 1.2.0 express: 4.18.2 fp-ts: 2.13.1 - io-ts: 2.2.19 + io-ts: 2.2.20 jest: 29.3.0 multer: 1.4.5-lts.1 rimraf: 3.0.2 @@ -45,7 +45,7 @@ importers: axios: 1.2.0 express: 4.18.2 fp-ts: 2.13.1 - io-ts: 2.2.19_fp-ts@2.13.1 + io-ts: 2.2.20_fp-ts@2.13.1 jest: 29.3.0_odkjkoia5xunhxkdrka32ib6vi multer: 1.4.5-lts.1 rimraf: 3.0.2 @@ -63,7 +63,7 @@ importers: '@types/node': 18.11.9 form-data: ^4.0.0 fp-ts: 2.13.1 - io-ts: 2.2.19 + io-ts: 2.2.20 jest: 29.3.0 rimraf: 3.0.2 ts-jest: 29.0.3 @@ -78,7 +78,7 @@ importers: '@types/node': 18.11.9 form-data: 4.0.0 fp-ts: 2.13.1 - io-ts: 2.2.19_fp-ts@2.13.1 + io-ts: 2.2.20_fp-ts@2.13.1 jest: 29.3.0_odkjkoia5xunhxkdrka32ib6vi rimraf: 3.0.2 ts-jest: 29.0.3_rhbpodbq4tgi7dsfkb4juhkp3y @@ -99,7 +99,7 @@ importers: cross-fetch: 3.1.5 express: 4.18.2 fp-ts: 2.13.1 - io-ts: 2.2.19 + io-ts: 2.2.20 jest: 29.3.0 multer: 1.4.5-lts.1 rimraf: 3.0.2 @@ -120,7 +120,7 @@ importers: cross-fetch: 3.1.5 express: 4.18.2 fp-ts: 2.13.1 - io-ts: 2.2.19_fp-ts@2.13.1 + io-ts: 2.2.20_fp-ts@2.13.1 jest: 29.3.0_odkjkoia5xunhxkdrka32ib6vi multer: 1.4.5-lts.1 rimraf: 3.0.2 @@ -145,11 +145,13 @@ importers: '@types/jest': 29.2.3 '@types/node': 18.11.9 '@types/react': 18.0.25 - '@zodios/core': workspace:* + '@zodios/axios': workspace:* '@zodios/fetch': workspace:* cors: 2.8.5 cross-fetch: 3.1.5 express: 4.18.2 + fp-ts: 2.13.1 + io-ts: 2.2.20 jest: 29.3.1 jest-environment-jsdom: 29.3.1 react: 18.2.0 @@ -175,11 +177,13 @@ importers: '@types/jest': 29.2.3 '@types/node': 18.11.9 '@types/react': 18.0.25 - '@zodios/core': link:../core + '@zodios/axios': link:../axios '@zodios/fetch': link:../fetch cors: 2.8.5 cross-fetch: 3.1.5 express: 4.18.2 + fp-ts: 2.13.1 + io-ts: 2.2.20_fp-ts@2.13.1 jest: 29.3.1_odkjkoia5xunhxkdrka32ib6vi jest-environment-jsdom: 29.3.1 react: 18.2.0 @@ -202,7 +206,7 @@ importers: '@zodios/fetch': workspace:* form-data: ^4.0.0 fp-ts: 2.13.1 - io-ts: 2.2.19 + io-ts: 2.2.20 jest: 29.3.0 rimraf: 3.0.2 ts-jest: 29.0.3 @@ -219,7 +223,7 @@ importers: '@zodios/fetch': link:../fetch form-data: 4.0.0 fp-ts: 2.13.1 - io-ts: 2.2.19_fp-ts@2.13.1 + io-ts: 2.2.20_fp-ts@2.13.1 jest: 29.3.0_odkjkoia5xunhxkdrka32ib6vi rimraf: 3.0.2 ts-jest: 29.0.3_rhbpodbq4tgi7dsfkb4juhkp3y @@ -3078,8 +3082,8 @@ packages: side-channel: 1.0.4 dev: true - /io-ts/2.2.19_fp-ts@2.13.1: - resolution: {integrity: sha512-ED0GQwvKRr5C2jqOOJCkuJW2clnbzqFexQ8V7Qsb+VB36S1Mk/OKH7k0FjSe4mjKy9qBRA3OqgVGyFMUEKIubw==} + /io-ts/2.2.20_fp-ts@2.13.1: + resolution: {integrity: sha512-Rq2BsYmtwS5vVttie4rqrOCIfHCS9TgpRLFpKQCM1wZBBRY9nWVGmEvm2FnDbSE2un1UE39DvFpTR5UL47YDcA==} peerDependencies: fp-ts: ^2.5.0 dependencies: From ff4da8da246c8c4138b97b6d3160ac5ba26dadd7 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Mon, 12 Dec 2022 22:06:31 +0100 Subject: [PATCH 094/206] docs(changeset): chore(deps): update typescript --- .changeset/rare-zoos-serve.md | 9 ++++ packages/axios/package.json | 2 +- packages/core/package.json | 2 +- packages/fetch/package.json | 2 +- packages/react/package.json | 2 +- packages/testing/package.json | 2 +- pnpm-lock.yaml | 80 +++++++++++++++++++---------------- 7 files changed, 57 insertions(+), 42 deletions(-) create mode 100644 .changeset/rare-zoos-serve.md diff --git a/.changeset/rare-zoos-serve.md b/.changeset/rare-zoos-serve.md new file mode 100644 index 00000000..92d4bb31 --- /dev/null +++ b/.changeset/rare-zoos-serve.md @@ -0,0 +1,9 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +"@zodios/react": major +"@zodios/testing": major +--- + +chore(deps): update typescript diff --git a/packages/axios/package.json b/packages/axios/package.json index c41ce215..8ad4aff2 100644 --- a/packages/axios/package.json +++ b/packages/axios/package.json @@ -74,7 +74,7 @@ "ts-jest": "29.0.3", "ts-node": "10.9.1", "tsup": "6.3.0", - "typescript": "4.9.3", + "typescript": "4.9.4", "zod": "3.20.1" }, "dependencies": { diff --git a/packages/core/package.json b/packages/core/package.json index b4dcb1e4..de4104d6 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -68,7 +68,7 @@ "ts-jest": "29.0.3", "ts-node": "10.9.1", "tsup": "6.3.0", - "typescript": "4.9.3", + "typescript": "4.9.4", "zod": "3.20.1" } } diff --git a/packages/fetch/package.json b/packages/fetch/package.json index 76394aa5..9d3b3cfd 100644 --- a/packages/fetch/package.json +++ b/packages/fetch/package.json @@ -73,7 +73,7 @@ "ts-jest": "29.0.3", "ts-node": "10.9.1", "tsup": "6.3.0", - "typescript": "4.9.3", + "typescript": "4.9.4", "zod": "3.20.1" }, "dependencies": { diff --git a/packages/react/package.json b/packages/react/package.json index 4e48a85f..ab26aad3 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -74,7 +74,7 @@ "ts-jest": "29.0.3", "ts-node": "10.9.1", "tsup": "6.3.0", - "typescript": "4.9.3", + "typescript": "4.9.4", "zod": "3.20.1" }, "resolutions": { diff --git a/packages/testing/package.json b/packages/testing/package.json index b79355ed..8f804bbf 100644 --- a/packages/testing/package.json +++ b/packages/testing/package.json @@ -54,7 +54,7 @@ "ts-jest": "29.0.3", "ts-node": "10.9.1", "tsup": "6.3.0", - "typescript": "4.9.3", + "typescript": "4.9.4", "zod": "3.20.1" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 88f22b25..bbdb1213 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -31,7 +31,7 @@ importers: ts-jest: 29.0.3 ts-node: 10.9.1 tsup: 6.3.0 - typescript: 4.9.3 + typescript: 4.9.4 zod: 3.20.1 dependencies: '@zodios/core': link:../core @@ -49,10 +49,10 @@ importers: jest: 29.3.0_odkjkoia5xunhxkdrka32ib6vi multer: 1.4.5-lts.1 rimraf: 3.0.2 - ts-jest: 29.0.3_rhbpodbq4tgi7dsfkb4juhkp3y - ts-node: 10.9.1_wup25etrarvlqkprac7h35hj7u - tsup: 6.3.0_2dtigtkb225m7ii7q45utxqwgi - typescript: 4.9.3 + ts-jest: 29.0.3_ryjyofpljpjsyhyq2nzx6hq6ei + ts-node: 10.9.1_3v2cms72gsblw7jmali7btb3pu + tsup: 6.3.0_z6wznmtyb6ovnulj6iujpct7um + typescript: 4.9.4 zod: 3.20.1 packages/core: @@ -69,7 +69,7 @@ importers: ts-jest: 29.0.3 ts-node: 10.9.1 tsup: 6.3.0 - typescript: 4.9.3 + typescript: 4.9.4 zod: 3.20.1 devDependencies: '@jest/globals': 29.3.1 @@ -81,10 +81,10 @@ importers: io-ts: 2.2.20_fp-ts@2.13.1 jest: 29.3.0_odkjkoia5xunhxkdrka32ib6vi rimraf: 3.0.2 - ts-jest: 29.0.3_rhbpodbq4tgi7dsfkb4juhkp3y - ts-node: 10.9.1_wup25etrarvlqkprac7h35hj7u - tsup: 6.3.0_2dtigtkb225m7ii7q45utxqwgi - typescript: 4.9.3 + ts-jest: 29.0.3_ryjyofpljpjsyhyq2nzx6hq6ei + ts-node: 10.9.1_3v2cms72gsblw7jmali7btb3pu + tsup: 6.3.0_z6wznmtyb6ovnulj6iujpct7um + typescript: 4.9.4 zod: 3.20.1 packages/fetch: @@ -106,7 +106,7 @@ importers: ts-jest: 29.0.3 ts-node: 10.9.1 tsup: 6.3.0 - typescript: 4.9.3 + typescript: 4.9.4 zod: 3.20.1 dependencies: '@zodios/core': link:../core @@ -124,10 +124,10 @@ importers: jest: 29.3.0_odkjkoia5xunhxkdrka32ib6vi multer: 1.4.5-lts.1 rimraf: 3.0.2 - ts-jest: 29.0.3_rhbpodbq4tgi7dsfkb4juhkp3y - ts-node: 10.9.1_wup25etrarvlqkprac7h35hj7u - tsup: 6.3.0_2dtigtkb225m7ii7q45utxqwgi - typescript: 4.9.3 + ts-jest: 29.0.3_ryjyofpljpjsyhyq2nzx6hq6ei + ts-node: 10.9.1_3v2cms72gsblw7jmali7btb3pu + tsup: 6.3.0_z6wznmtyb6ovnulj6iujpct7um + typescript: 4.9.4 zod: 3.20.1 packages/react: @@ -161,7 +161,7 @@ importers: ts-jest: 29.0.3 ts-node: 10.9.1 tsup: 6.3.0 - typescript: 4.9.3 + typescript: 4.9.4 zod: 3.20.1 devDependencies: '@jest/globals': 29.3.1 @@ -190,10 +190,10 @@ importers: react-dom: 18.2.0_react@18.2.0 react-test-renderer: 18.2.0_react@18.2.0 rimraf: 3.0.2 - ts-jest: 29.0.3_wcjxlcwfjvs73rqh2tjbxyoefa - ts-node: 10.9.1_wup25etrarvlqkprac7h35hj7u - tsup: 6.3.0_2dtigtkb225m7ii7q45utxqwgi - typescript: 4.9.3 + ts-jest: 29.0.3_a67wnu7kur6t3xg6vztzc6sc5i + ts-node: 10.9.1_3v2cms72gsblw7jmali7btb3pu + tsup: 6.3.0_z6wznmtyb6ovnulj6iujpct7um + typescript: 4.9.4 zod: 3.20.1 packages/testing: @@ -212,7 +212,7 @@ importers: ts-jest: 29.0.3 ts-node: 10.9.1 tsup: 6.3.0 - typescript: 4.9.3 + typescript: 4.9.4 zod: 3.20.1 devDependencies: '@jest/globals': 29.3.1 @@ -226,10 +226,10 @@ importers: io-ts: 2.2.20_fp-ts@2.13.1 jest: 29.3.0_odkjkoia5xunhxkdrka32ib6vi rimraf: 3.0.2 - ts-jest: 29.0.3_rhbpodbq4tgi7dsfkb4juhkp3y - ts-node: 10.9.1_wup25etrarvlqkprac7h35hj7u - tsup: 6.3.0_2dtigtkb225m7ii7q45utxqwgi - typescript: 4.9.3 + ts-jest: 29.0.3_ryjyofpljpjsyhyq2nzx6hq6ei + ts-node: 10.9.1_3v2cms72gsblw7jmali7btb3pu + tsup: 6.3.0_z6wznmtyb6ovnulj6iujpct7um + typescript: 4.9.4 zod: 3.20.1 packages: @@ -3438,7 +3438,7 @@ packages: pretty-format: 29.3.1 slash: 3.0.0 strip-json-comments: 3.1.1 - ts-node: 10.9.1_wup25etrarvlqkprac7h35hj7u + ts-node: 10.9.1_3v2cms72gsblw7jmali7btb3pu transitivePeerDependencies: - supports-color dev: true @@ -4408,7 +4408,7 @@ packages: optional: true dependencies: lilconfig: 2.0.6 - ts-node: 10.9.1_wup25etrarvlqkprac7h35hj7u + ts-node: 10.9.1_3v2cms72gsblw7jmali7btb3pu yaml: 1.10.2 dev: true @@ -5150,7 +5150,7 @@ packages: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} dev: true - /ts-jest/29.0.3_rhbpodbq4tgi7dsfkb4juhkp3y: + /ts-jest/29.0.3_a67wnu7kur6t3xg6vztzc6sc5i: resolution: {integrity: sha512-Ibygvmuyq1qp/z3yTh9QTwVVAbFdDy/+4BtIQR2sp6baF2SJU/8CKK/hhnGIDY2L90Az2jIqTwZPnN2p+BweiQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -5174,17 +5174,17 @@ packages: '@jest/types': 29.3.1 bs-logger: 0.2.6 fast-json-stable-stringify: 2.1.0 - jest: 29.3.0_odkjkoia5xunhxkdrka32ib6vi + jest: 29.3.1_odkjkoia5xunhxkdrka32ib6vi jest-util: 29.3.1 json5: 2.2.1 lodash.memoize: 4.1.2 make-error: 1.3.6 semver: 7.3.8 - typescript: 4.9.3 + typescript: 4.9.4 yargs-parser: 21.1.1 dev: true - /ts-jest/29.0.3_wcjxlcwfjvs73rqh2tjbxyoefa: + /ts-jest/29.0.3_ryjyofpljpjsyhyq2nzx6hq6ei: resolution: {integrity: sha512-Ibygvmuyq1qp/z3yTh9QTwVVAbFdDy/+4BtIQR2sp6baF2SJU/8CKK/hhnGIDY2L90Az2jIqTwZPnN2p+BweiQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -5208,17 +5208,17 @@ packages: '@jest/types': 29.3.1 bs-logger: 0.2.6 fast-json-stable-stringify: 2.1.0 - jest: 29.3.1_odkjkoia5xunhxkdrka32ib6vi + jest: 29.3.0_odkjkoia5xunhxkdrka32ib6vi jest-util: 29.3.1 json5: 2.2.1 lodash.memoize: 4.1.2 make-error: 1.3.6 semver: 7.3.8 - typescript: 4.9.3 + typescript: 4.9.4 yargs-parser: 21.1.1 dev: true - /ts-node/10.9.1_wup25etrarvlqkprac7h35hj7u: + /ts-node/10.9.1_3v2cms72gsblw7jmali7btb3pu: resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true peerDependencies: @@ -5244,12 +5244,12 @@ packages: create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 4.9.3 + typescript: 4.9.4 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 dev: true - /tsup/6.3.0_2dtigtkb225m7ii7q45utxqwgi: + /tsup/6.3.0_z6wznmtyb6ovnulj6iujpct7um: resolution: {integrity: sha512-IaNQO/o1rFgadLhNonVKNCT2cks+vvnWX3DnL8sB87lBDqRvJXHENr5lSPJlqwplUlDxSwZK8dSg87rgBu6Emw==} engines: {node: '>=14'} hasBin: true @@ -5279,7 +5279,7 @@ packages: source-map: 0.8.0-beta.0 sucrase: 3.28.0 tree-kill: 1.2.2 - typescript: 4.9.3 + typescript: 4.9.4 transitivePeerDependencies: - supports-color - ts-node @@ -5410,6 +5410,12 @@ packages: hasBin: true dev: true + /typescript/4.9.4: + resolution: {integrity: sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==} + engines: {node: '>=4.2.0'} + hasBin: true + dev: true + /unbox-primitive/1.0.2: resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} dependencies: From e36069fee2da6df498288dffb8ceb7d3ceb5aeb9 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Mon, 9 Jan 2023 18:39:33 +0100 Subject: [PATCH 095/206] feat(fetcher): improve core fetcher declaration --- .../fetcher-provider.types.ts | 23 +++++++++++++++---- packages/core/src/hooks.ts | 12 +++++----- packages/core/src/index.ts | 3 ++- packages/core/src/zodios.test.ts | 16 ++++++------- packages/core/src/zodios.ts | 21 +++++++++-------- packages/core/src/zodios.types.ts | 4 ++-- 6 files changed, 47 insertions(+), 32 deletions(-) diff --git a/packages/core/src/fetcher-providers/fetcher-provider.types.ts b/packages/core/src/fetcher-providers/fetcher-provider.types.ts index b5737b01..bd6f3166 100644 --- a/packages/core/src/fetcher-providers/fetcher-provider.types.ts +++ b/packages/core/src/fetcher-providers/fetcher-provider.types.ts @@ -1,3 +1,6 @@ +import { ReadonlyDeep } from "../utils.types"; +import { AnyZodiosRequestOptions } from "../zodios.types"; + /** * A type provider for Fetcher * allows to define request, response and error types for a fetcher @@ -39,11 +42,21 @@ export type TypeOfFetcherOptions< FetcherProvider extends AnyZodiosFetcherProvider > = FetcherProvider["options"]; -export type ZodiosRuntimeFetcherProvider< +export interface ZodiosFetcher< FetcherProvider extends AnyZodiosFetcherProvider -> = { - readonly _provider?: FetcherProvider; +> { + baseURL?: string; + fetch( + config: ReadonlyDeep> + ): Promise>; +} + +export type FetcherFactoryOptions = { baseURL?: string; - init(options: any): void; - fetch(params: any): Promise; }; + +export type ZodiosFetcherFactory< + FetcherProvider extends AnyZodiosFetcherProvider +> = ( + options?: FetcherFactoryOptions & TypeOfFetcherOptions +) => ZodiosFetcher; diff --git a/packages/core/src/hooks.ts b/packages/core/src/hooks.ts index dada7939..f4570c31 100644 --- a/packages/core/src/hooks.ts +++ b/packages/core/src/hooks.ts @@ -1,18 +1,18 @@ import { AnyZodiosFetcherProvider, - ZodiosRuntimeFetcherProvider, + ZodiosFetcher, } from "./fetcher-providers/fetcher-provider.types"; export const hooks: { - fetcherProvider?: ZodiosRuntimeFetcherProvider; + fetcher?: ZodiosFetcher; } = {}; -export function setFetcherHook( - provider: ZodiosRuntimeFetcherProvider +export function setFetcherHook( + fetcher: ZodiosFetcher ) { - hooks.fetcherProvider = provider; + hooks.fetcher = fetcher; } export function clearFetcherHook() { - hooks.fetcherProvider = undefined; + hooks.fetcher = undefined; } diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 4cb6b47c..5449ef76 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -75,7 +75,8 @@ export type { TypeOfFetcherError, TypeOfFetcherOptions, TypeOfFetcherResponse, - ZodiosRuntimeFetcherProvider, + ZodiosFetcherFactory, + ZodiosFetcher, } from "./fetcher-providers"; export { setFetcherHook, clearFetcherHook } from "./hooks"; export { diff --git a/packages/core/src/zodios.test.ts b/packages/core/src/zodios.test.ts index d09e9873..5fac1207 100644 --- a/packages/core/src/zodios.test.ts +++ b/packages/core/src/zodios.test.ts @@ -43,7 +43,7 @@ import type { AnyZodiosFetcherProvider, AnyZodiosRequestOptions, ZodiosPlugin, - ZodiosRuntimeFetcherProvider, + ZodiosFetcherFactory, } from "./index"; interface MockProvider extends AnyZodiosFetcherProvider { @@ -60,9 +60,8 @@ interface MockProvider extends AnyZodiosFetcherProvider { error: unknown; } -const mockProvider: ZodiosRuntimeFetcherProvider = { - init() {}, - async fetch(config: AnyZodiosRequestOptions) { +const mockFetchFactory: ZodiosFetcherFactory = () => ({ + async fetch(config) { const requestConfig = { ...config, baseURL: this.baseURL, @@ -89,7 +88,7 @@ const mockProvider: ZodiosRuntimeFetcherProvider = { } throw new Error(`No mocks found for ${requestConfig.url}`); }, -}; +}); type MockResponse = { readonly headers?: Record; @@ -119,7 +118,8 @@ const registeredMocks = new Map< const zodiosMocks: ZodiosMockBase = { install() { - setFetcherHook(mockProvider); + const fetcher = mockFetchFactory(); + setFetcherHook(fetcher); }, uninstall() { registeredMocks.clear(); @@ -507,7 +507,7 @@ describe("Zodios", () => { ), }, ], - { fetcherProvider: mockProvider } + { fetcherFactory: mockFetchFactory } ); const response = await zodios.request({ // ^? @@ -551,7 +551,7 @@ describe("Zodios", () => { ), }, ], - { fetcherProvider: mockProvider } + { fetcherFactory: mockFetchFactory } ); const response = await zodios.get("/queries", { queries: { id: [1, 2] } }); expect(response).toEqual({ queries: [1, 2] }); diff --git a/packages/core/src/zodios.ts b/packages/core/src/zodios.ts index 56f0a377..3b3eead7 100644 --- a/packages/core/src/zodios.ts +++ b/packages/core/src/zodios.ts @@ -35,6 +35,7 @@ import { zodTypeProvider } from "./type-providers"; import { AnyZodiosFetcherProvider, TypeOfFetcherOptions, + ZodiosFetcher, } from "./fetcher-providers"; import { findEndpointErrorsByAlias, findEndpointErrorsByPath } from "./utils"; import { hooks } from "./hooks"; @@ -63,6 +64,7 @@ export class ZodiosCoreImpl< "validate" | "transform" | "sendDefaults" | "typeProvider" >; public readonly api: Api; + public readonly fetcher: ZodiosFetcher | undefined; public readonly _typeProvider: TypeProvider; public readonly _fetcherProvider: FetcherProvider; private endpointPlugins: Map> = @@ -147,7 +149,10 @@ export class ZodiosCoreImpl< this._typeProvider = undefined as any; this._fetcherProvider = undefined as any; - this.options.fetcherProvider?.init({ baseURL, ...this.options }); + this.fetcher = this.options.fetcherFactory?.({ + baseURL, + ...this.options, + }); this.injectAliasEndpoints(); this.injectHttpVerbEndpoints(); @@ -161,10 +166,6 @@ export class ZodiosCoreImpl< return this.options.typeProvider; } - public get fetcherProvider() { - return this.options.fetcherProvider; - } - private initPlugins() { this.endpointPlugins.set("any-any", new ZodiosPlugins("any", "any")); @@ -314,12 +315,12 @@ export class ZodiosCoreImpl< conf = await endpointPlugin.interceptRequest(this.api, conf); } let response: Promise; - if (hooks.fetcherProvider) { - response = hooks.fetcherProvider.fetch(conf); - } else if (this.options.fetcherProvider) { - response = this.options.fetcherProvider.fetch(conf); + if (hooks.fetcher) { + response = hooks.fetcher.fetch(conf); + } else if (this.fetcher) { + response = this.fetcher.fetch(conf); } else { - throw new Error("Zodios: no fetcher provider provided"); + throw new Error("Zodios: no fetcher provider found"); } if (endpointPlugin) { response = endpointPlugin.interceptResponse(this.api, conf, response); diff --git a/packages/core/src/zodios.types.ts b/packages/core/src/zodios.types.ts index fb633d8c..8feffe9c 100644 --- a/packages/core/src/zodios.types.ts +++ b/packages/core/src/zodios.types.ts @@ -23,7 +23,7 @@ import { TypeOfFetcherConfig, TypeOfFetcherError, TypeOfFetcherResponse, - ZodiosRuntimeFetcherProvider, + ZodiosFetcherFactory, } from "./fetcher-providers"; export const HTTP_QUERY_METHODS = ["get", "head"] as const; @@ -734,7 +734,7 @@ export interface ZodiosOptions< */ sendDefaults?: boolean; - fetcherProvider?: ZodiosRuntimeFetcherProvider; + fetcherFactory?: ZodiosFetcherFactory; /** * set a custom type provider. Default: ZodTypeProvider From a8083f97ca0389c39e3983ebd4b5b8c0c5e6c47b Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sat, 21 Jan 2023 22:31:14 +0100 Subject: [PATCH 096/206] feat(core): refactor factory options --- .../fetcher-providers/fetcher-provider.types.ts | 15 ++++++++++----- packages/core/src/index.ts | 1 + packages/core/src/zodios.test.ts | 4 ++-- packages/core/src/zodios.ts | 2 +- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/packages/core/src/fetcher-providers/fetcher-provider.types.ts b/packages/core/src/fetcher-providers/fetcher-provider.types.ts index bd6f3166..5a2663d1 100644 --- a/packages/core/src/fetcher-providers/fetcher-provider.types.ts +++ b/packages/core/src/fetcher-providers/fetcher-provider.types.ts @@ -1,4 +1,4 @@ -import { ReadonlyDeep } from "../utils.types"; +import { Merge, ReadonlyDeep } from "../utils.types"; import { AnyZodiosRequestOptions } from "../zodios.types"; /** @@ -51,12 +51,17 @@ export interface ZodiosFetcher< ): Promise>; } -export type FetcherFactoryOptions = { - baseURL?: string; -}; +export type ZodiosFetcherFactoryOptions< + FetcherProvider extends AnyZodiosFetcherProvider +> = Merge< + { + baseURL?: string; + }, + TypeOfFetcherOptions +>; export type ZodiosFetcherFactory< FetcherProvider extends AnyZodiosFetcherProvider > = ( - options?: FetcherFactoryOptions & TypeOfFetcherOptions + options?: ZodiosFetcherFactoryOptions ) => ZodiosFetcher; diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 5449ef76..0fe02018 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -75,6 +75,7 @@ export type { TypeOfFetcherError, TypeOfFetcherOptions, TypeOfFetcherResponse, + ZodiosFetcherFactoryOptions, ZodiosFetcherFactory, ZodiosFetcher, } from "./fetcher-providers"; diff --git a/packages/core/src/zodios.test.ts b/packages/core/src/zodios.test.ts index 5fac1207..266e129f 100644 --- a/packages/core/src/zodios.test.ts +++ b/packages/core/src/zodios.test.ts @@ -60,11 +60,11 @@ interface MockProvider extends AnyZodiosFetcherProvider { error: unknown; } -const mockFetchFactory: ZodiosFetcherFactory = () => ({ +const mockFetchFactory: ZodiosFetcherFactory = (options) => ({ async fetch(config) { const requestConfig = { ...config, - baseURL: this.baseURL, + baseURL: options?.baseURL, }; for (const [{ method, url }, callback] of registeredMocks) { if (method === requestConfig.method && url === requestConfig.url) { diff --git a/packages/core/src/zodios.ts b/packages/core/src/zodios.ts index 3b3eead7..f5f82540 100644 --- a/packages/core/src/zodios.ts +++ b/packages/core/src/zodios.ts @@ -152,7 +152,7 @@ export class ZodiosCoreImpl< this.fetcher = this.options.fetcherFactory?.({ baseURL, ...this.options, - }); + } as any); this.injectAliasEndpoints(); this.injectHttpVerbEndpoints(); From a54caa7fc8b78bf512eae9e9fa85a2f7020005aa Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sun, 22 Jan 2023 00:31:56 +0100 Subject: [PATCH 097/206] feat(fetch): fix baseURL override --- .../fetch-provider/fetcher-provider.fetch.ts | 32 ++++++++-------- packages/fetch/src/index.ts | 2 +- packages/fetch/src/zodios.test.ts | 4 +- packages/fetch/src/zodios.ts | 38 +++++++++++-------- 4 files changed, 41 insertions(+), 35 deletions(-) diff --git a/packages/fetch/src/fetch-provider/fetcher-provider.fetch.ts b/packages/fetch/src/fetch-provider/fetcher-provider.fetch.ts index 0de920ab..d909200b 100644 --- a/packages/fetch/src/fetch-provider/fetcher-provider.fetch.ts +++ b/packages/fetch/src/fetch-provider/fetcher-provider.fetch.ts @@ -1,7 +1,9 @@ import type { AnyZodiosFetcherProvider, AnyZodiosRequestOptions, - ZodiosRuntimeFetcherProvider, + ZodiosFetcher, + ZodiosFetcherFactory, + ZodiosFetcherFactoryOptions, } from "@zodios/core"; import { Merge } from "@zodios/core/lib/utils.types"; import { replacePathParams } from "../utils"; @@ -31,28 +33,24 @@ export interface FetchProvider extends AnyZodiosFetcherProvider { error: FetchErrorStatus; } -export const fetchProvider: ZodiosRuntimeFetcherProvider & - FetchProviderOptions = { - init( - options: { - baseURL?: string; - } & FetchProviderOptions - ) { - const { baseURL, fetchConfig } = options; - this.fetchConfig = fetchConfig; - if (baseURL) { - this.baseURL = baseURL; - } - }, +class Fetcher implements ZodiosFetcher { + constructor( + public baseURL: string | undefined, + public config: FetchProviderConfig | undefined + ) {} async fetch(config: AnyZodiosRequestOptions) { const requestConfig = { - ...this.fetchConfig, - ...config, baseURL: this.baseURL, + ...this.config, + ...config, url: replacePathParams(config), }; return advancedFetch( requestConfig as AnyZodiosRequestOptions ); - }, + } +} + +export const fetchFactory: ZodiosFetcherFactory = (options) => { + return new Fetcher(options?.baseURL, options?.fetchConfig); }; diff --git a/packages/fetch/src/index.ts b/packages/fetch/src/index.ts index f4ea712c..373561c9 100644 --- a/packages/fetch/src/index.ts +++ b/packages/fetch/src/index.ts @@ -1,3 +1,3 @@ export { Zodios } from "./zodios"; -export { FetchProvider, fetchProvider } from "./fetch-provider"; +export type { FetchProvider } from "./fetch-provider"; export * from "@zodios/core"; diff --git a/packages/fetch/src/zodios.test.ts b/packages/fetch/src/zodios.test.ts index 9d047472..2a017972 100644 --- a/packages/fetch/src/zodios.test.ts +++ b/packages/fetch/src/zodios.test.ts @@ -87,8 +87,8 @@ describe("Zodios", () => { port = (server.address() as AddressInfo).port; }); - afterAll(() => { - server.close(); + afterAll((done) => { + server.close(done); }); it("should be defined", () => { diff --git a/packages/fetch/src/zodios.ts b/packages/fetch/src/zodios.ts index c8b748cc..c20f1ae5 100644 --- a/packages/fetch/src/zodios.ts +++ b/packages/fetch/src/zodios.ts @@ -8,21 +8,29 @@ import type { ZodTypeProvider, } from "@zodios/core"; import { ZodiosCore } from "@zodios/core"; -import { fetchProvider, FetchProvider } from "./fetch-provider"; +import { fetchFactory, FetchProvider } from "./fetch-provider"; -function ZodiosFetch(...args: any[]) { - if (args.length !== 0) { - let options: ZodiosOptions = args[args.length - 1]; - if (!Array.isArray(options) && typeof options === "object") { - args[args.length - 1] = { ...options, fetcherProvider: fetchProvider }; - } else { - args.push({ fetcherProvider: fetchProvider }); - } - } - // @ts-ignore - return new ZodiosCore(...args); +function isZodiosOptions( + lastArg: unknown +): lastArg is ZodiosOptions { + return !Array.isArray(lastArg) && typeof lastArg === "object"; } +const ZodiosFetch = new Proxy(ZodiosCore, { + construct: (target, args) => { + if (args.length !== 0) { + let lastArg = args[args.length - 1]; + if (isZodiosOptions(lastArg)) { + lastArg.fetcherFactory = fetchFactory; + } else { + args.push({ fetcherFactory: fetchFactory }); + } + } + // @ts-ignore + return new target(...args); + }, +}); + export interface Zodios { new < Api extends ZodiosEndpointDefinitions, @@ -31,7 +39,7 @@ export interface Zodios { api: Narrow, options?: Omit< ZodiosOptions, - "fetcherProvider" + "fetcherFactory" > & TypeOfFetcherOptions ): ZodiosInstance; @@ -43,12 +51,12 @@ export interface Zodios { api: Narrow, options?: Omit< ZodiosOptions, - "fetcherProvider" + "fetcherFactory" > & TypeOfFetcherOptions ): ZodiosInstance; } -const Zodios = ZodiosFetch as unknown as Zodios; +const Zodios = ZodiosFetch as Zodios; export { Zodios }; From 3cf6d5eaf7fcd39700e1e63b5355487cc61c6c6f Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sun, 22 Jan 2023 20:12:13 +0100 Subject: [PATCH 098/206] docs(changeset): feat(fetcher): change fetcher model to factory --- .changeset/chilled-emus-own.md | 9 ++++ packages/axios/package.json | 7 ++- packages/axios/src/axios-provider.ts | 53 ++++++++++--------- packages/axios/src/index.ts | 2 +- packages/axios/src/utils.ts | 19 ------- packages/axios/src/zodios.ts | 38 +++++++------ packages/fetch/package.json | 5 +- .../fetch-provider/fetcher-provider.fetch.ts | 1 - packages/react/package.json | 10 ++++ packages/testing/src/index.ts | 1 - .../src/mock-provider/mock-provider.ts | 28 +++++----- pnpm-lock.yaml | 16 +++--- 12 files changed, 97 insertions(+), 92 deletions(-) create mode 100644 .changeset/chilled-emus-own.md diff --git a/.changeset/chilled-emus-own.md b/.changeset/chilled-emus-own.md new file mode 100644 index 00000000..31a79699 --- /dev/null +++ b/.changeset/chilled-emus-own.md @@ -0,0 +1,9 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +"@zodios/react": major +"@zodios/testing": major +--- + +feat(fetcher): change fetcher model to factory diff --git a/packages/axios/package.json b/packages/axios/package.json index 8ad4aff2..bc28f2f4 100644 --- a/packages/axios/package.json +++ b/packages/axios/package.json @@ -41,6 +41,7 @@ "test": "jest --coverage" }, "peerDependencies": { + "@zodios/core": "11.x", "axios": "^0.x || ^1.0.0", "fp-ts": "2.x", "io-ts": "2.x", @@ -64,7 +65,8 @@ "@types/jest": "29.2.2", "@types/multer": "1.4.7", "@types/node": "18.11.9", - "axios": "1.2.0", + "@zodios/core": "workspace:*", + "axios": "1.2.3", "express": "4.18.2", "fp-ts": "2.13.1", "io-ts": "2.2.20", @@ -76,8 +78,5 @@ "tsup": "6.3.0", "typescript": "4.9.4", "zod": "3.20.1" - }, - "dependencies": { - "@zodios/core": "workspace:*" } } diff --git a/packages/axios/src/axios-provider.ts b/packages/axios/src/axios-provider.ts index 37f8e483..1987337a 100644 --- a/packages/axios/src/axios-provider.ts +++ b/packages/axios/src/axios-provider.ts @@ -1,13 +1,9 @@ -import axios, { - AxiosRequestConfig, - AxiosError, - AxiosInstance, - AxiosResponse, -} from "axios"; +import axios, { AxiosError, AxiosInstance, AxiosResponse } from "axios"; import { AnyZodiosRequestOptions, AnyZodiosFetcherProvider, - ZodiosRuntimeFetcherProvider, + ZodiosFetcherFactory, + ZodiosFetcher, } from "@zodios/core"; import { Merge } from "@zodios/core/lib/utils.types"; import { omit, replacePathParams } from "./utils"; @@ -24,9 +20,12 @@ type AxiosErrorStatus = Merge< } >; +type AxiosRequestConfig = Parameters[0]; +type AxiosCreateConfig = Parameters[0]; + type AxiosProviderOptions = { axiosInstance?: AxiosInstance; - axiosConfig?: AxiosRequestConfig; + axiosConfig?: AxiosCreateConfig; }; export interface AxiosProvider extends AnyZodiosFetcherProvider { @@ -38,29 +37,31 @@ export interface AxiosProvider extends AnyZodiosFetcherProvider { error: AxiosErrorStatus; } -export const axiosProvider: ZodiosRuntimeFetcherProvider & { +class Fetcher implements ZodiosFetcher { instance: AxiosInstance; -} = { - instance: undefined as any, - init( - options: { - baseURL?: string; - } & AxiosProviderOptions + constructor( + baseURL: string | undefined, + config: AxiosCreateConfig | undefined, + instance: AxiosInstance | undefined ) { - const { axiosInstance, axiosConfig, baseURL } = options; - this.instance = axiosInstance || axios.create(axiosConfig); - if (baseURL) { - this.instance.defaults.baseURL = baseURL; - this.baseURL = baseURL; - } - }, + this.instance = instance || axios.create(config); + if (baseURL) this.instance.defaults.baseURL = baseURL; + } + fetch(config: AnyZodiosRequestOptions) { - const requestConfig: AxiosRequestConfig = { + return this.instance.request({ ...omit(config, ["params", "queries", "body"]), url: replacePathParams(config), params: config.queries, data: config.body, - }; - return this.instance.request(requestConfig); - }, + }); + } +} + +export const axiosFactory: ZodiosFetcherFactory = (options) => { + return new Fetcher( + options?.baseURL, + options?.axiosConfig, + options?.axiosInstance + ); }; diff --git a/packages/axios/src/index.ts b/packages/axios/src/index.ts index ffc61dd5..c1057dfb 100644 --- a/packages/axios/src/index.ts +++ b/packages/axios/src/index.ts @@ -1,3 +1,3 @@ export { Zodios } from "./zodios"; -export { AxiosProvider, axiosProvider } from "./axios-provider"; +export type { AxiosProvider } from "./axios-provider"; export * from "@zodios/core"; diff --git a/packages/axios/src/utils.ts b/packages/axios/src/utils.ts index 67f86002..b84e6338 100644 --- a/packages/axios/src/utils.ts +++ b/packages/axios/src/utils.ts @@ -17,25 +17,6 @@ export function omit( return ret; } -/** - * pick properties from an object - * @param obj - the object to pick properties from - * @param keys - the keys to pick - * @returns the object with the picked properties - */ -export function pick( - obj: T | undefined, - keys: K[] -): Pick { - const ret = {} as Pick; - if (obj) { - for (const key of keys) { - ret[key] = obj[key]; - } - } - return ret; -} - const paramsRegExp = /:([a-zA-Z_][a-zA-Z0-9_]*)/g; export function replacePathParams( diff --git a/packages/axios/src/zodios.ts b/packages/axios/src/zodios.ts index 7a580865..12d961cb 100644 --- a/packages/axios/src/zodios.ts +++ b/packages/axios/src/zodios.ts @@ -8,21 +8,29 @@ import type { ZodTypeProvider, } from "@zodios/core"; import { ZodiosCore } from "@zodios/core"; -import { axiosProvider, AxiosProvider } from "./axios-provider"; +import { axiosFactory, AxiosProvider } from "./axios-provider"; -function ZodiosAxios(...args: any[]) { - if (args.length !== 0) { - let options: ZodiosOptions = args[args.length - 1]; - if (!Array.isArray(options) && typeof options === "object") { - args[args.length - 1] = { ...options, fetcherProvider: axiosProvider }; - } else { - args.push({ fetcherProvider: axiosProvider }); - } - } - // @ts-ignore - return new ZodiosCore(...args); +function isZodiosOptions( + lastArg: unknown +): lastArg is ZodiosOptions { + return !Array.isArray(lastArg) && typeof lastArg === "object"; } +const ZodiosAxios = new Proxy(ZodiosCore, { + construct(target, args) { + if (args.length !== 0) { + let lastArg = args[args.length - 1]; + if (isZodiosOptions(lastArg)) { + lastArg.fetcherFactory = axiosFactory; + } else { + args.push({ fetcherFactory: axiosFactory }); + } + } + // @ts-ignore + return new target(...args); + }, +}); + export interface Zodios { new < Api extends ZodiosEndpointDefinitions, @@ -31,7 +39,7 @@ export interface Zodios { api: Narrow, options?: Omit< ZodiosOptions, - "fetcherProvider" + "fetcherFactory" > & TypeOfFetcherOptions ): ZodiosInstance; @@ -43,12 +51,12 @@ export interface Zodios { api: Narrow, options?: Omit< ZodiosOptions, - "fetcherProvider" + "fetcherFactory" > & TypeOfFetcherOptions ): ZodiosInstance; } -const Zodios = ZodiosAxios as unknown as Zodios; +const Zodios = ZodiosAxios as Zodios; export { Zodios }; diff --git a/packages/fetch/package.json b/packages/fetch/package.json index 9d3b3cfd..25741191 100644 --- a/packages/fetch/package.json +++ b/packages/fetch/package.json @@ -41,6 +41,7 @@ "test": "NODE_OPTIONS=--experimental-abortcontroller jest --coverage" }, "peerDependencies": { + "@zodios/core": "11.x", "fp-ts": "2.x", "io-ts": "2.x", "zod": "^3.x" @@ -63,6 +64,7 @@ "@types/jest": "29.2.2", "@types/multer": "1.4.7", "@types/node": "18.11.9", + "@zodios/core": "workspace:*", "cross-fetch": "3.1.5", "express": "4.18.2", "fp-ts": "2.13.1", @@ -75,8 +77,5 @@ "tsup": "6.3.0", "typescript": "4.9.4", "zod": "3.20.1" - }, - "dependencies": { - "@zodios/core": "workspace:*" } } diff --git a/packages/fetch/src/fetch-provider/fetcher-provider.fetch.ts b/packages/fetch/src/fetch-provider/fetcher-provider.fetch.ts index d909200b..cab92a25 100644 --- a/packages/fetch/src/fetch-provider/fetcher-provider.fetch.ts +++ b/packages/fetch/src/fetch-provider/fetcher-provider.fetch.ts @@ -3,7 +3,6 @@ import type { AnyZodiosRequestOptions, ZodiosFetcher, ZodiosFetcherFactory, - ZodiosFetcherFactoryOptions, } from "@zodios/core"; import { Merge } from "@zodios/core/lib/utils.types"; import { replacePathParams } from "../utils"; diff --git a/packages/react/package.json b/packages/react/package.json index ab26aad3..611fea26 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -40,10 +40,19 @@ }, "peerDependencies": { "@tanstack/react-query": "4.x", + "@zodios/core": "11.x", "@zodios/axios": "11.0.0-beta.14", "@zodios/fetch": "11.0.0-beta.14", "react": ">=16.8.0" }, + "peerDependenciesMeta": { + "@zodios/axios": { + "optional": true + }, + "@zodios/fetch": { + "optional": true + } + }, "devDependencies": { "@jest/globals": "29.3.1", "@jest/types": "29.3.1", @@ -58,6 +67,7 @@ "@types/jest": "29.2.3", "@types/node": "18.11.9", "@types/react": "18.0.25", + "@zodios/core": "workspace:*", "@zodios/axios": "workspace:*", "@zodios/fetch": "workspace:*", "cors": "2.8.5", diff --git a/packages/testing/src/index.ts b/packages/testing/src/index.ts index a10dd01e..94a4a9ce 100644 --- a/packages/testing/src/index.ts +++ b/packages/testing/src/index.ts @@ -1,3 +1,2 @@ export { ZodiosMocks } from "./zodios"; export type { MockProvider, MockResponse } from "./mock-provider"; -export { mockProvider, zodiosMocks } from "./mock-provider"; diff --git a/packages/testing/src/mock-provider/mock-provider.ts b/packages/testing/src/mock-provider/mock-provider.ts index 40eab32f..a890568a 100644 --- a/packages/testing/src/mock-provider/mock-provider.ts +++ b/packages/testing/src/mock-provider/mock-provider.ts @@ -1,7 +1,8 @@ import type { AnyZodiosFetcherProvider, AnyZodiosRequestOptions, - ZodiosRuntimeFetcherProvider, + ZodiosFetcher, + ZodiosFetcherFactory, } from "@zodios/core"; import { setFetcherHook, clearFetcherHook } from "@zodios/core"; @@ -19,20 +20,16 @@ export interface MockProvider extends AnyZodiosFetcherProvider { error: unknown; } -export const mockProvider: ZodiosRuntimeFetcherProvider = { - init() {}, +class Fetcher implements ZodiosFetcher { + constructor(public baseURL: string | undefined) {} async fetch(config: AnyZodiosRequestOptions) { - const requestConfig = { - ...config, - baseURL: this.baseURL, - }; for (const [{ method, url }, callback] of registeredMocks) { - if (method === requestConfig.method && url === requestConfig.url) { + if (method === config.method && url === config.url) { const result = { headers: {}, status: 200, statusText: "OK", - ...(await callback(requestConfig)), + ...(await callback(config)), }; if ( (config.validateStatus && !config.validateStatus(result.status)) || @@ -42,16 +39,19 @@ export const mockProvider: ZodiosRuntimeFetcherProvider = { `Request failed with status code ${result.status}` ) as Error & { code: string; config: any; response: any }; err.code = `ERR_STATUS_${result.status}`; - err.config = requestConfig; + err.config = config; err.response = result; throw err; } return result; } } - throw new Error(`No mocks found for ${requestConfig.url}`); - }, -}; + throw new Error(`No mocks found for ${config.url}`); + } +} + +export const mockFactory: ZodiosFetcherFactory = (options) => + new Fetcher(options?.baseURL); export type MockResponse = { readonly headers?: Record; @@ -83,7 +83,7 @@ const registeredMocks = new Map< export const zodiosMocks: ZodiosMockBase = { install() { - setFetcherHook(mockProvider); + setFetcherHook(mockFactory()); }, uninstall() { registeredMocks.clear(); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bbdb1213..eb2f21c7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -21,7 +21,7 @@ importers: '@types/multer': 1.4.7 '@types/node': 18.11.9 '@zodios/core': workspace:* - axios: 1.2.0 + axios: 1.2.3 express: 4.18.2 fp-ts: 2.13.1 io-ts: 2.2.20 @@ -33,8 +33,6 @@ importers: tsup: 6.3.0 typescript: 4.9.4 zod: 3.20.1 - dependencies: - '@zodios/core': link:../core devDependencies: '@jest/globals': 29.3.1 '@jest/types': 29.3.1 @@ -42,7 +40,8 @@ importers: '@types/jest': 29.2.2 '@types/multer': 1.4.7 '@types/node': 18.11.9 - axios: 1.2.0 + '@zodios/core': link:../core + axios: 1.2.3 express: 4.18.2 fp-ts: 2.13.1 io-ts: 2.2.20_fp-ts@2.13.1 @@ -108,8 +107,6 @@ importers: tsup: 6.3.0 typescript: 4.9.4 zod: 3.20.1 - dependencies: - '@zodios/core': link:../core devDependencies: '@jest/globals': 29.3.1 '@jest/types': 29.3.1 @@ -117,6 +114,7 @@ importers: '@types/jest': 29.2.2 '@types/multer': 1.4.7 '@types/node': 18.11.9 + '@zodios/core': link:../core cross-fetch: 3.1.5 express: 4.18.2 fp-ts: 2.13.1 @@ -146,6 +144,7 @@ importers: '@types/node': 18.11.9 '@types/react': 18.0.25 '@zodios/axios': workspace:* + '@zodios/core': workspace:* '@zodios/fetch': workspace:* cors: 2.8.5 cross-fetch: 3.1.5 @@ -178,6 +177,7 @@ importers: '@types/node': 18.11.9 '@types/react': 18.0.25 '@zodios/axios': link:../axios + '@zodios/core': link:../core '@zodios/fetch': link:../fetch cors: 2.8.5 cross-fetch: 3.1.5 @@ -1594,8 +1594,8 @@ packages: engines: {node: '>= 0.4'} dev: true - /axios/1.2.0: - resolution: {integrity: sha512-zT7wZyNYu3N5Bu0wuZ6QccIf93Qk1eV8LOewxgjOZFd2DenOs98cJ7+Y6703d0wkaXGY6/nZd4EweJaHz9uzQw==} + /axios/1.2.3: + resolution: {integrity: sha512-pdDkMYJeuXLZ6Xj/Q5J3Phpe+jbGdsSzlQaFVkMQzRUL05+6+tetX8TV3p4HrU4kzuO9bt+io/yGQxuyxA/xcw==} dependencies: follow-redirects: 1.15.2 form-data: 4.0.0 From 364457c78daabc06c0088be9c27586b3fc96daf0 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sun, 22 Jan 2023 20:13:49 +0100 Subject: [PATCH 099/206] RELEASING: Releasing 5 package(s) Releases: @zodios/axios@11.0.0-beta.15 @zodios/core@11.0.0-beta.15 @zodios/fetch@11.0.0-beta.15 @zodios/react@11.0.0-beta.15 @zodios/testing@11.0.0-beta.15 [skip ci] --- packages/axios/CHANGELOG.md | 19 +++++++++++++++++++ packages/axios/package.json | 4 ++-- packages/core/CHANGELOG.md | 10 ++++++++++ packages/core/package.json | 2 +- packages/fetch/CHANGELOG.md | 19 +++++++++++++++++++ packages/fetch/package.json | 4 ++-- packages/react/CHANGELOG.md | 21 +++++++++++++++++++++ packages/react/package.json | 8 ++++---- packages/testing/CHANGELOG.md | 19 +++++++++++++++++++ packages/testing/package.json | 4 ++-- 10 files changed, 99 insertions(+), 11 deletions(-) diff --git a/packages/axios/CHANGELOG.md b/packages/axios/CHANGELOG.md index bd4d56e0..e602efff 100644 --- a/packages/axios/CHANGELOG.md +++ b/packages/axios/CHANGELOG.md @@ -1,5 +1,24 @@ # @zodios/core +## 11.0.0-beta.15 + +### Major Changes + +- eaf8e45: feat(fetcher): change fetcher model to factory +- faaec6f: chore(deps): update zod +- f161353: chore(deps): update fp-ts +- 5115eaa: chore(deps): update typescript +- 4ac4921: feat(react): simplify exported instance + +### Patch Changes + +- Updated dependencies [eaf8e45] +- Updated dependencies [faaec6f] +- Updated dependencies [f161353] +- Updated dependencies [5115eaa] +- Updated dependencies [4ac4921] + - @zodios/core@11.0.0-beta.15 + ## 11.0.0-beta.14 ### Major Changes diff --git a/packages/axios/package.json b/packages/axios/package.json index bc28f2f4..1ab3aa2a 100644 --- a/packages/axios/package.json +++ b/packages/axios/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/axios", "description": "Typescript API client with axios", - "version": "11.0.0-beta.14", + "version": "11.0.0-beta.15", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", @@ -41,7 +41,7 @@ "test": "jest --coverage" }, "peerDependencies": { - "@zodios/core": "11.x", + "@zodios/core": "11.0.0-beta.15", "axios": "^0.x || ^1.0.0", "fp-ts": "2.x", "io-ts": "2.x", diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index fa4df7f2..3b9d8314 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,15 @@ # @zodios/core +## 11.0.0-beta.15 + +### Major Changes + +- eaf8e45: feat(fetcher): change fetcher model to factory +- faaec6f: chore(deps): update zod +- f161353: chore(deps): update fp-ts +- 5115eaa: chore(deps): update typescript +- 4ac4921: feat(react): simplify exported instance + ## 11.0.0-beta.14 ### Major Changes diff --git a/packages/core/package.json b/packages/core/package.json index de4104d6..f2061497 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/core", "description": "Typescript API client with autocompletion and zod validations", - "version": "11.0.0-beta.14", + "version": "11.0.0-beta.15", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", diff --git a/packages/fetch/CHANGELOG.md b/packages/fetch/CHANGELOG.md index bd4d56e0..e602efff 100644 --- a/packages/fetch/CHANGELOG.md +++ b/packages/fetch/CHANGELOG.md @@ -1,5 +1,24 @@ # @zodios/core +## 11.0.0-beta.15 + +### Major Changes + +- eaf8e45: feat(fetcher): change fetcher model to factory +- faaec6f: chore(deps): update zod +- f161353: chore(deps): update fp-ts +- 5115eaa: chore(deps): update typescript +- 4ac4921: feat(react): simplify exported instance + +### Patch Changes + +- Updated dependencies [eaf8e45] +- Updated dependencies [faaec6f] +- Updated dependencies [f161353] +- Updated dependencies [5115eaa] +- Updated dependencies [4ac4921] + - @zodios/core@11.0.0-beta.15 + ## 11.0.0-beta.14 ### Major Changes diff --git a/packages/fetch/package.json b/packages/fetch/package.json index 25741191..8ee304b2 100644 --- a/packages/fetch/package.json +++ b/packages/fetch/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/fetch", "description": "Typescript API client with fetch", - "version": "11.0.0-beta.14", + "version": "11.0.0-beta.15", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", @@ -41,7 +41,7 @@ "test": "NODE_OPTIONS=--experimental-abortcontroller jest --coverage" }, "peerDependencies": { - "@zodios/core": "11.x", + "@zodios/core": "11.0.0-beta.15", "fp-ts": "2.x", "io-ts": "2.x", "zod": "^3.x" diff --git a/packages/react/CHANGELOG.md b/packages/react/CHANGELOG.md index 30af06d6..4c9d0567 100644 --- a/packages/react/CHANGELOG.md +++ b/packages/react/CHANGELOG.md @@ -1,5 +1,26 @@ # @zodios/react +## 11.0.0-beta.15 + +### Major Changes + +- eaf8e45: feat(fetcher): change fetcher model to factory +- faaec6f: chore(deps): update zod +- f161353: chore(deps): update fp-ts +- 5115eaa: chore(deps): update typescript +- 4ac4921: feat(react): simplify exported instance + +### Patch Changes + +- Updated dependencies [eaf8e45] +- Updated dependencies [faaec6f] +- Updated dependencies [f161353] +- Updated dependencies [5115eaa] +- Updated dependencies [4ac4921] + - @zodios/axios@11.0.0-beta.15 + - @zodios/core@11.0.0-beta.15 + - @zodios/fetch@11.0.0-beta.15 + ## 11.0.0-beta.14 ### Major Changes diff --git a/packages/react/package.json b/packages/react/package.json index 611fea26..d705bf58 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/react", "description": "React hooks for zodios", - "version": "11.0.0-beta.14", + "version": "11.0.0-beta.15", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", @@ -40,9 +40,9 @@ }, "peerDependencies": { "@tanstack/react-query": "4.x", - "@zodios/core": "11.x", - "@zodios/axios": "11.0.0-beta.14", - "@zodios/fetch": "11.0.0-beta.14", + "@zodios/core": "11.0.0-beta.15", + "@zodios/axios": "11.0.0-beta.15", + "@zodios/fetch": "11.0.0-beta.15", "react": ">=16.8.0" }, "peerDependenciesMeta": { diff --git a/packages/testing/CHANGELOG.md b/packages/testing/CHANGELOG.md index 2d1a2287..8130c035 100644 --- a/packages/testing/CHANGELOG.md +++ b/packages/testing/CHANGELOG.md @@ -1,5 +1,24 @@ # @zodios/core +## 11.0.0-beta.15 + +### Major Changes + +- eaf8e45: feat(fetcher): change fetcher model to factory +- faaec6f: chore(deps): update zod +- f161353: chore(deps): update fp-ts +- 5115eaa: chore(deps): update typescript +- 4ac4921: feat(react): simplify exported instance + +### Patch Changes + +- Updated dependencies [eaf8e45] +- Updated dependencies [faaec6f] +- Updated dependencies [f161353] +- Updated dependencies [5115eaa] +- Updated dependencies [4ac4921] + - @zodios/core@11.0.0-beta.15 + ## 11.0.0-beta.14 ### Major Changes diff --git a/packages/testing/package.json b/packages/testing/package.json index 8f804bbf..84ed9d15 100644 --- a/packages/testing/package.json +++ b/packages/testing/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/testing", "description": "Zodios mock library", - "version": "11.0.0-beta.14", + "version": "11.0.0-beta.15", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", @@ -37,7 +37,7 @@ "test": "jest --coverage" }, "peerDependencies": { - "@zodios/core": "11.0.0-beta.14" + "@zodios/core": "11.0.0-beta.15" }, "devDependencies": { "@jest/globals": "29.3.1", From b5a0433b1a8c6d3a3c8847d566f7e1536ee6c927 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sun, 22 Jan 2023 20:21:13 +0100 Subject: [PATCH 100/206] chore: new beta release --- .changeset/pre.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.changeset/pre.json b/.changeset/pre.json index 3e3a1768..8080ce04 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -10,14 +10,18 @@ }, "changesets": [ "blue-hounds-sort", + "chilled-emus-own", "famous-rules-drop", + "five-apricots-breathe", "gentle-ligers-mix", + "good-tigers-tie", "long-fans-dress", "lucky-brooms-fry", "nice-kids-attend", "nice-wombats-boil", "polite-bugs-confess", "polite-points-float", + "rare-zoos-serve", "rich-pigs-thank", "short-hounds-mix", "silent-garlics-scream", @@ -25,6 +29,7 @@ "slow-worms-destroy", "small-horses-laugh", "soft-seas-lie", - "tasty-bags-happen" + "tasty-bags-happen", + "twelve-dingos-cover" ] } From 35b8891edf365efb615a4816b170eb76fcc75078 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sun, 22 Jan 2023 23:21:04 +0100 Subject: [PATCH 101/206] feat(request): check response type --- packages/core/src/zodios.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/core/src/zodios.test.ts b/packages/core/src/zodios.test.ts index 266e129f..9efac93c 100644 --- a/packages/core/src/zodios.test.ts +++ b/packages/core/src/zodios.test.ts @@ -45,6 +45,7 @@ import type { ZodiosPlugin, ZodiosFetcherFactory, } from "./index"; +import type { Assert } from "./utils.types"; interface MockProvider extends AnyZodiosFetcherProvider { options: {}; From f361589332057455461fe2a8e7f1e2a3c841f29d Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sun, 22 Jan 2023 23:57:34 +0100 Subject: [PATCH 102/206] test: remove axios in tests --- .../src/plugins/zod-validation.plugin.test.ts | 29 +++++++++---------- packages/fetch/src/zodios.test.ts | 2 +- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/packages/core/src/plugins/zod-validation.plugin.test.ts b/packages/core/src/plugins/zod-validation.plugin.test.ts index a0ddfb31..2fb46888 100644 --- a/packages/core/src/plugins/zod-validation.plugin.test.ts +++ b/packages/core/src/plugins/zod-validation.plugin.test.ts @@ -1,10 +1,9 @@ -import type { AxiosResponse } from "axios"; import { z } from "zod"; import { apiBuilder } from "../api"; import { ReadonlyDeep } from "../utils.types"; import { AnyZodiosRequestOptions } from "../zodios.types"; import { zodValidationPlugin } from "./zod-validation.plugin"; -import { AnyZodiosTypeProvider, zodTypeProvider } from "../type-providers"; +import { zodTypeProvider } from "../type-providers"; import { AnyZodiosFetcherProvider } from "../fetcher-providers"; describe("zodValidationPlugin", () => { @@ -232,6 +231,7 @@ describe("zodValidationPlugin", () => { it("should throw on unsuccessful parse", async () => { const badResponse = createSampleResponse(); + // @ts-expect-error badResponse.data.first = 123; await expect( @@ -301,19 +301,18 @@ received: url, }); - const createSampleResponse = () => - ({ - data: { - first: "123", - second: 111, - }, - status: 200, - headers: { - "content-type": "application/json", - }, - config: {}, - statusText: "OK", - } as unknown as AxiosResponse); + const createSampleResponse = () => ({ + data: { + first: "123", + second: 111, + }, + status: 200, + headers: { + "content-type": "application/json", + }, + config: {}, + statusText: "OK", + }); const api = apiBuilder({ path: "/parse", diff --git a/packages/fetch/src/zodios.test.ts b/packages/fetch/src/zodios.test.ts index 2a017972..5d8ada45 100644 --- a/packages/fetch/src/zodios.test.ts +++ b/packages/fetch/src/zodios.test.ts @@ -1055,7 +1055,7 @@ received: }); }); - it("should trigger an axios error with error response", async () => { + it("should trigger an error with error response", async () => { const zodios = new Zodios(`http://localhost:${port}`, [ { method: "get", From bb8f2943b6ac8dab6c28f2440a0176c025856191 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sat, 28 Jan 2023 16:50:41 +0100 Subject: [PATCH 103/206] docs(changeset): feat: improve typings --- .changeset/curly-shrimps-destroy.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .changeset/curly-shrimps-destroy.md diff --git a/.changeset/curly-shrimps-destroy.md b/.changeset/curly-shrimps-destroy.md new file mode 100644 index 00000000..01eba10d --- /dev/null +++ b/.changeset/curly-shrimps-destroy.md @@ -0,0 +1,9 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +"@zodios/react": major +"@zodios/testing": major +--- + +feat: improve typings From 36d676d5fad4c5e60ad013181f6e6231b4751805 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sat, 28 Jan 2023 16:51:22 +0100 Subject: [PATCH 104/206] docs(changeset): feat: improve typings --- .changeset/nervous-kings-bow.md | 9 + packages/axios/package.json | 2 +- packages/core/src/zodios.test.ts | 986 +++++++++++++++++------------- packages/core/src/zodios.types.ts | 30 +- packages/react/src/hooks.spec.tsx | 21 +- packages/react/src/hooks.ts | 167 +++++ pnpm-lock.yaml | 8 +- 7 files changed, 792 insertions(+), 431 deletions(-) create mode 100644 .changeset/nervous-kings-bow.md diff --git a/.changeset/nervous-kings-bow.md b/.changeset/nervous-kings-bow.md new file mode 100644 index 00000000..01eba10d --- /dev/null +++ b/.changeset/nervous-kings-bow.md @@ -0,0 +1,9 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +"@zodios/react": major +"@zodios/testing": major +--- + +feat: improve typings diff --git a/packages/axios/package.json b/packages/axios/package.json index 1ab3aa2a..c3e7a3a5 100644 --- a/packages/axios/package.json +++ b/packages/axios/package.json @@ -66,7 +66,7 @@ "@types/multer": "1.4.7", "@types/node": "18.11.9", "@zodios/core": "workspace:*", - "axios": "1.2.3", + "axios": "1.2.5", "express": "4.18.2", "fp-ts": "2.13.1", "io-ts": "2.2.20", diff --git a/packages/core/src/zodios.test.ts b/packages/core/src/zodios.test.ts index 9efac93c..91dd0c92 100644 --- a/packages/core/src/zodios.test.ts +++ b/packages/core/src/zodios.test.ts @@ -559,33 +559,51 @@ describe("Zodios", () => { }); it("should make an http get with one path params", async () => { - const zodios = new ZodiosCore(`http://localhost`, [ - { - method: "get", - path: "/:id", - response: z.object({ - id: z.number(), - name: z.string(), - }), - }, - ]); + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "get", + path: "/:id", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + { fetcherFactory: mockFetchFactory } + ); const response = await zodios.get("/:id", { params: { id: 7 } }); + const testResonseType: Assert< + typeof response, + { id: number; name: string } + > = true; + expect(response).toEqual({ id: 7, name: "test" }); }); it("should make an http alias request with one path params", async () => { - const zodios = new ZodiosCore(`http://localhost`, [ - { - method: "get", - path: "/:id", - alias: "getById", - response: z.object({ - id: z.number(), - name: z.string(), - }), - }, - ]); + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "get", + path: "/:id", + alias: "getById", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + { fetcherFactory: mockFetchFactory } + ); const response = await zodios.getById({ params: { id: 7 } }); + const testResonseType: Assert< + typeof response, + { id: number; name: string } + > = true; + expect(response).toEqual({ id: 7, name: "test" }); }); @@ -599,140 +617,177 @@ describe("Zodios", () => { name: z.string(), }), }).build(); - const zodios = new ZodiosCore(`http://localhost`, api); + const zodios = new ZodiosCore(`http://localhost`, api, { + fetcherFactory: mockFetchFactory, + }); const response = await zodios.getById({ params: { id: 7 } }); + const testResonseType: Assert< + typeof response, + { id: number; name: string } + > = true; + expect(response).toEqual({ id: 7, name: "test" }); }); it("should make a get request with bad params and get back a zod error", async () => { - const zodios = new ZodiosCore(`http://localhost`, [ - { - method: "get", - path: "/:id", - parameters: [ - { - name: "id", - type: "Path", - schema: z.number(), - }, - ], - response: z.object({ - id: z.number(), - name: z.string(), - }), - }, - ]); + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "get", + path: "/:id", + parameters: [ + { + name: "id", + type: "Path", + schema: z.number(), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + { fetcherFactory: mockFetchFactory } + ); try { - await zodios.get("/:id", { params: { id: "7" } }); + await zodios.get("/:id", { params: { id: "7" as unknown as number } }); } catch (e) { expect(e).toBeInstanceOf(ZodiosError); } }); it("should make an http get with multiples path params", async () => { - const zodios = new ZodiosCore(`http://localhost`, [ - { - method: "get", - path: "/:id/address/:address", - response: z.object({ - id: z.number(), - address: z.string(), - }), - }, - ]); + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "get", + path: "/:id/address/:address", + response: z.object({ + id: z.number(), + address: z.string(), + }), + }, + ], + { fetcherFactory: mockFetchFactory } + ); const response = await zodios.get("/:id/address/:address", { params: { id: 7, address: "address" }, }); + const testResonseType: Assert< + typeof response, + { id: number; address: string } + > = true; + expect(response).toEqual({ id: 7, address: "address" }); }); it("should make an http post with body param", async () => { - const zodios = new ZodiosCore(`http://localhost`, [ - { - method: "post", - path: "/", - parameters: [ - { - name: "name", - type: "Body", - schema: z.object({ - name: z.string(), - }), - }, - ], - response: z.object({ - id: z.number(), - name: z.string(), - }), - }, - ]); + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "post", + path: "/", + parameters: [ + { + name: "name", + type: "Body", + schema: z.object({ + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + { fetcherFactory: mockFetchFactory } + ); const response = await zodios.post("/", { body: { name: "post" } }); + const testResonseType: Assert< + typeof response, + { id: number; name: string } + > = true; expect(response).toEqual({ id: 3, name: "post" }); }); it("should make an http post with transformed body param", async () => { - const zodios = new ZodiosCore(`http://localhost`, [ - { - method: "post", - path: "/", - parameters: [ - { - name: "name", - type: "Body", - schema: z - .object({ - firstname: z.string(), - lastname: z.string(), - }) - .transform((data) => ({ - name: `${data.firstname} ${data.lastname}`, - })), - }, - ], - response: z.object({ - id: z.number(), - name: z.string(), - }), - }, - ]); + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "post", + path: "/", + parameters: [ + { + name: "name", + type: "Body", + schema: z + .object({ + firstname: z.string(), + lastname: z.string(), + }) + .transform((data) => ({ + name: `${data.firstname} ${data.lastname}`, + })), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + { fetcherFactory: mockFetchFactory } + ); const config = { - method: "post", - url: "/", body: { firstname: "post", lastname: "test" }, } as const; - const response = await zodios.request(config); + const response = await zodios.post("/", config); + const testResonseType: Assert< + typeof response, + { id: number; name: string } + > = true; + expect(config).toEqual({ - method: "post", - url: "/", body: { firstname: "post", lastname: "test" }, }); expect(response).toEqual({ id: 3, name: "post test" }); }); it("should throw a zodios error if params are not correct", async () => { - const zodios = new ZodiosCore(`http://localhost`, [ - { - method: "post", - path: "/", - parameters: [ - { - name: "name", - type: "Body", - schema: z - .object({ - email: z.string().email(), - }) - .transform((data) => ({ - name: `${data.email.split("@")[0]}`, - })), - }, - ], - response: z.object({ - id: z.number(), - name: z.string(), - }), - }, - ]); + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "post", + path: "/", + parameters: [ + { + name: "name", + type: "Body", + schema: z + .object({ + email: z.string().email(), + }) + .transform((data) => ({ + name: `${data.email.split("@")[0]}`, + })), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + { fetcherFactory: mockFetchFactory } + ); let response; let error: ZodiosError | undefined; try { @@ -751,209 +806,268 @@ describe("Zodios", () => { }); it("should make an http mutation alias request with body param", async () => { - const zodios = new ZodiosCore(`http://localhost`, [ - { - method: "post", - path: "/", - alias: "create", - parameters: [ - { - name: "name", - type: "Body", - schema: z.object({ - name: z.string(), - }), - }, - ], - response: z.object({ - id: z.number(), - name: z.string(), - }), - }, - ]); + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "post", + path: "/", + alias: "create", + parameters: [ + { + name: "name", + type: "Body", + schema: z.object({ + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + { fetcherFactory: mockFetchFactory } + ); const response = await zodios.create({ body: { name: "post" } }); + const testResonseType: Assert< + typeof response, + { id: number; name: string } + > = true; expect(response).toEqual({ id: 3, name: "post" }); }); it("should make an http put", async () => { - const zodios = new ZodiosCore(`http://localhost`, [ - { - method: "put", - path: "/", - parameters: [ - { - name: "body", - type: "Body", - schema: z.object({ - id: z.number(), - name: z.string(), - }), - }, - ], - response: z.object({ - id: z.number(), - name: z.string(), - }), - }, - ]); + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "put", + path: "/", + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + { fetcherFactory: mockFetchFactory } + ); const response = await zodios.put("/", { body: { id: 5, name: "put" } }); + const testResonseType: Assert< + typeof response, + { id: number; name: string } + > = true; expect(response).toEqual({ id: 5, name: "put" }); }); it("should make an http put alias", async () => { - const zodios = new ZodiosCore(`http://localhost`, [ - { - method: "put", - path: "/", - alias: "update", - parameters: [ - { - name: "body", - type: "Body", - schema: z.object({ - id: z.number(), - name: z.string(), - }), - }, - ], - response: z.object({ - id: z.number(), - name: z.string(), - }), - }, - ]); + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "put", + path: "/", + alias: "update", + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + { fetcherFactory: mockFetchFactory } + ); const response = await zodios.update({ body: { id: 5, name: "put" } }); + const testResonseType: Assert< + typeof response, + { id: number; name: string } + > = true; expect(response).toEqual({ id: 5, name: "put" }); }); it("should make an http patch", async () => { - const zodios = new ZodiosCore(`http://localhost`, [ - { - method: "patch", - path: "/", - parameters: [ - { - name: "id", - type: "Body", - schema: z.object({ - id: z.number(), - name: z.string(), - }), - }, - ], - response: z.object({ - id: z.number(), - name: z.string(), - }), - }, - ]); + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "patch", + path: "/", + parameters: [ + { + name: "id", + type: "Body", + schema: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + { fetcherFactory: mockFetchFactory } + ); const response = await zodios.patch("/", { body: { id: 4, name: "patch" }, }); + const testResonseType: Assert< + typeof response, + { id: number; name: string } + > = true; expect(response).toEqual({ id: 4, name: "patch" }); }); it("should make an http patch alias", async () => { - const zodios = new ZodiosCore(`http://localhost`, [ - { - method: "patch", - path: "/", - alias: "update", - parameters: [ - { - name: "id", - type: "Body", - schema: z.object({ - id: z.number(), - name: z.string(), - }), - }, - ], - response: z.object({ - id: z.number(), - name: z.string(), - }), - }, - ]); + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "patch", + path: "/", + alias: "update", + parameters: [ + { + name: "id", + type: "Body", + schema: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + { fetcherFactory: mockFetchFactory } + ); const response = await zodios.update({ body: { id: 4, name: "patch" } }); + const testResonseType: Assert< + typeof response, + { id: number; name: string } + > = true; expect(response).toEqual({ id: 4, name: "patch" }); }); it("should make an http delete", async () => { - const zodios = new ZodiosCore(`http://localhost`, [ - { - method: "delete", - path: "/:id", - response: z.object({ - id: z.number(), - }), - }, - ]); + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "delete", + path: "/:id", + response: z.object({ + id: z.number(), + }), + }, + ], + { fetcherFactory: mockFetchFactory } + ); const response = await zodios.delete("/:id", { params: { id: 6 }, }); + const testResonseType: Assert = true; expect(response).toEqual({ id: 6 }); }); it("should make an http delete alias", async () => { - const zodios = new ZodiosCore(`http://localhost`, [ - { - method: "delete", - path: "/:id", - alias: "remove", - response: z.object({ - id: z.number(), - }), - }, - ]); - const response = await zodios.remove({ - params: { id: 6 }, - }); - expect(response).toEqual({ id: 6 }); - }); - - it("should validate uuid in path params", async () => { - const zodios = new ZodiosCore(`http://localhost`, [ - { - method: "get", - path: "/path/:uuid", - parameters: [ - { - name: "uuid", - type: "Path", - schema: z.string().uuid(), - }, - ], - response: z.object({ - uuid: z.string(), - }), - }, - ]); + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "delete", + path: "/:id", + alias: "remove", + response: z.object({ + id: z.number(), + }), + }, + ], + { fetcherFactory: mockFetchFactory } + ); + const response = await zodios.remove({ + params: { id: 6 }, + }); + const testResonseType: Assert = true; + expect(response).toEqual({ id: 6 }); + }); + + it("should validate uuid in path params", async () => { + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "get", + path: "/path/:uuid", + parameters: [ + { + name: "uuid", + type: "Path", + schema: z.string().uuid(), + }, + ], + response: z.object({ + uuid: z.string(), + }), + }, + ], + { fetcherFactory: mockFetchFactory } + ); const response = await zodios.get("/path/:uuid", { params: { uuid: "e9e09a1d-3967-4518-bc89-75a901aee128" }, }); + const testResonseType: Assert = true; expect(response).toEqual({ uuid: "e9e09a1d-3967-4518-bc89-75a901aee128", }); }); it("should not validate bad path params", async () => { - const zodios = new ZodiosCore(`http://localhost`, [ - { - method: "get", - path: "/path/:uuid", - parameters: [ - { - name: "uuid", - type: "Path", - schema: z.string().uuid(), - }, - ], - response: z.object({ - uuid: z.string(), - }), - }, - ]); + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "get", + path: "/path/:uuid", + parameters: [ + { + name: "uuid", + type: "Path", + schema: z.string().uuid(), + }, + ], + response: z.object({ + uuid: z.string(), + }), + }, + ], + { fetcherFactory: mockFetchFactory } + ); let error; try { await zodios.get("/path/:uuid", { @@ -970,17 +1084,21 @@ describe("Zodios", () => { }); it("should not validate bad formatted responses", async () => { - const zodios = new ZodiosCore(`http://localhost`, [ - { - method: "get", - path: "/:id", - response: z.object({ - id: z.number(), - name: z.string(), - more: z.string(), - }), - }, - ]); + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "get", + path: "/:id", + response: z.object({ + id: z.number(), + name: z.string(), + more: z.string(), + }), + }, + ], + { fetcherFactory: mockFetchFactory } + ); try { await zodios.get("/:id", { params: { id: 1 } }); } catch (e) { @@ -1270,9 +1388,13 @@ received: }), }, ], - { validate: false } + { validate: false, fetcherFactory: mockFetchFactory } ); const response = await zodios.get("/:id", { params: { id: 1 } }); + const testResonseType: Assert< + typeof response, + { id: number; name: string; more: string } + > = true; expect(response).toEqual({ id: 1, name: "test", @@ -1280,16 +1402,20 @@ received: }); it("should trigger an error with error response", async () => { - const zodios = new ZodiosCore(`http://localhost`, [ - { - method: "get", - path: "/error502", - response: z.object({ - id: z.number(), - name: z.string(), - }), - }, - ]); + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "get", + path: "/error502", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + { fetcherFactory: mockFetchFactory } + ); try { await zodios.get("/error502"); } catch (e) { @@ -1303,78 +1429,97 @@ received: }); it("should send a form data request", async () => { - const zodios = new ZodiosCore(`http://localhost`, [ - { - method: "post", - path: "/form-data", - requestFormat: "form-data", - parameters: [ - { - name: "body", - type: "Body", - schema: z.object({ - id: z.number(), - name: z.string(), - }), - }, - ], - response: z.object({ - id: z.string(), - name: z.string(), - }), - }, - ]); + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "post", + path: "/form-data", + requestFormat: "form-data", + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.string(), + name: z.string(), + }), + }, + ], + { fetcherFactory: mockFetchFactory } + ); const response = await zodios.post("/form-data", { body: { id: 4, name: "post" }, }); + const testResonseType: Assert< + typeof response, + { id: string; name: string } + > = true; expect(response).toEqual({ id: "4", name: "post" }); }); it("should send a form data request a second time under 100 ms", async () => { - const zodios = new ZodiosCore(`http://localhost`, [ - { - method: "post", - path: "/form-data", - requestFormat: "form-data", - parameters: [ - { - name: "body", - type: "Body", - schema: z.object({ - id: z.string(), - name: z.string(), - }), - }, - ], - response: z.object({ - id: z.string(), - name: z.string(), - }), - }, - ]); + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "post", + path: "/form-data", + requestFormat: "form-data", + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ + id: z.string(), + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.string(), + name: z.string(), + }), + }, + ], + { fetcherFactory: mockFetchFactory } + ); const response = await zodios.post("/form-data", { - // @ts-ignore body: { id: "4", name: "post" }, }); + const testResonseType: Assert< + typeof response, + { id: string; name: string } + > = true; expect(response).toEqual({ id: "4", name: "post" }); }, 100); it("should not send an array as form data request", async () => { - const zodios = new ZodiosCore(`http://localhost`, [ - { - method: "post", - path: "/form-data", - requestFormat: "form-data", - parameters: [ - { - name: "body", - type: "Body", - schema: z.array(z.string()), - }, - ], - response: z.string(), - }, - ]); + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "post", + path: "/form-data", + requestFormat: "form-data", + parameters: [ + { + name: "body", + type: "Body", + schema: z.array(z.string()), + }, + ], + response: z.string(), + }, + ], + { fetcherFactory: mockFetchFactory } + ); let error: Error | undefined; let response: string | undefined; try { @@ -1390,49 +1535,61 @@ received: }); it("should send a form url request", async () => { - const zodios = new ZodiosCore(`http://localhost`, [ - { - method: "post", - path: "/form-url", - requestFormat: "form-url", - parameters: [ - { - name: "body", - type: "Body", - schema: z.object({ - id: z.number(), - name: z.string(), - }), - }, - ], - response: z.object({ - id: z.string(), - name: z.string(), - }), - }, - ]); + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "post", + path: "/form-url", + requestFormat: "form-url", + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.string(), + name: z.string(), + }), + }, + ], + { fetcherFactory: mockFetchFactory } + ); const response = await zodios.post("/form-url", { body: { id: 4, name: "post" }, }); + const testResonseType: Assert< + typeof response, + { id: string; name: string } + > = true; expect(response).toEqual({ id: "4", name: "post" }); }); it("should not send an array as form url request", async () => { - const zodios = new ZodiosCore(`http://localhost`, [ - { - method: "post", - path: "/form-url", - requestFormat: "form-url", - parameters: [ - { - name: "body", - type: "Body", - schema: z.array(z.string()), - }, - ], - response: z.string(), - }, - ]); + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "post", + path: "/form-url", + requestFormat: "form-url", + parameters: [ + { + name: "body", + type: "Body", + schema: z.array(z.string()), + }, + ], + response: z.string(), + }, + ], + { fetcherFactory: mockFetchFactory } + ); let error: Error | undefined; let response: string | undefined; try { @@ -1448,22 +1605,27 @@ received: }); it("should send a text request", async () => { - const zodios = new ZodiosCore(`http://localhost`, [ - { - method: "post", - path: "/text", - requestFormat: "text", - parameters: [ - { - name: "body", - type: "Body", - schema: z.string(), - }, - ], - response: z.string(), - }, - ]); + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "post", + path: "/text", + requestFormat: "text", + parameters: [ + { + name: "body", + type: "Body", + schema: z.string(), + }, + ], + response: z.string(), + }, + ], + { fetcherFactory: mockFetchFactory } + ); const response = await zodios.post("/text", { body: "test" }); + const testResonseType: Assert = true; expect(response).toEqual("test"); }); }); diff --git a/packages/core/src/zodios.types.ts b/packages/core/src/zodios.types.ts index 8feffe9c..59d46934 100644 --- a/packages/core/src/zodios.types.ts +++ b/packages/core/src/zodios.types.ts @@ -627,26 +627,38 @@ export type ZodiosAliases< >; }; +type OptionalRequestOptionsByPathParameters< + Api extends ZodiosEndpointDefinition[], + M extends Method, + Path extends ZodiosPathsByMethod, + FetcherProvider extends AnyZodiosFetcherProvider, + TypeProvider extends AnyZodiosTypeProvider, + Config = ZodiosRequestOptionsByPath< + Api, + M, + Path, + FetcherProvider, + true, + TypeProvider + > +> = RequiredKeys extends never + ? [config?: ReadonlyDeep] + : [config: ReadonlyDeep]; + export type ZodiosVerbs< Api extends ZodiosEndpointDefinition[], FetcherProvider extends AnyZodiosFetcherProvider, TypeProvider extends AnyZodiosTypeProvider > = { - [M in Method]: < - Path extends ZodiosPathsByMethod, - TConfig extends ZodiosRequestOptionsByPath< + [M in Method]: >( + path: Path, + ...params: OptionalRequestOptionsByPathParameters< Api, M, Path, FetcherProvider, - true, TypeProvider > - >( - path: Path, - ...[config]: RequiredKeys extends never - ? [config?: ReadonlyDeep] - : [config: ReadonlyDeep] ) => Promise>; }; diff --git a/packages/react/src/hooks.spec.tsx b/packages/react/src/hooks.spec.tsx index 7d92e1ca..5f5e8475 100644 --- a/packages/react/src/hooks.spec.tsx +++ b/packages/react/src/hooks.spec.tsx @@ -8,6 +8,7 @@ import { AddressInfo } from "net"; import cors from "cors"; import z from "zod"; import { ZodiosHooks } from "./hooks"; +import { Assert } from "@zodios/core/lib/utils.types"; const api = makeApi([ { @@ -408,11 +409,21 @@ describe("zodios hooks", () => { id: number; name: string; }>(); - const apiMutations = apiHooks.usePost("/users", undefined, { - onSuccess: (data) => { - setUserCreated(data); - }, - }); + const apiMutations = apiHooks.useMutation( + "post", + "/users", + undefined, + { + onSuccess: (data) => { + // ^? + setUserCreated(data); + }, + } + ); + const testMutation: Assert< + typeof apiMutations.data, + { id: number; name: string } | undefined + > = true; return { apiMutations, userCreated }; }, { wrapper } diff --git a/packages/react/src/hooks.ts b/packages/react/src/hooks.ts index 3a7dea78..f8ae001c 100644 --- a/packages/react/src/hooks.ts +++ b/packages/react/src/hooks.ts @@ -125,6 +125,7 @@ export class ZodiosHooksImpl< mutationOptions: any ) => this.useMutation( + // @ts-expect-error endpoint.method, endpoint.path as any, config, @@ -147,6 +148,7 @@ export class ZodiosHooksImpl< path: any, config: any, mutationOptions: any + // @ts-expect-error ) => this.useMutation(method, path, config, mutationOptions); }); } @@ -548,6 +550,171 @@ export class ZodiosHooksImpl< }; } + useMutation< + Path extends ZodiosPathsByMethod, + TConfig extends Omit< + ZodiosRequestOptionsByPath< + Api, + "get", + Path, + FetcherProvider, + true, + TypeProvider + >, + "body" + >, + MutationVariables = UndefinedIfNever< + ZodiosBodyByPath + > + >( + method: "get", + path: Path, + ...[config, mutationOptions]: RequiredKeys extends never + ? [ + config?: ReadonlyDeep, + mutationOptions?: MutationOptions + ] + : [ + config: ReadonlyDeep, + mutationOptions?: MutationOptions + ] + ): UseMutationResult< + ZodiosResponseByPath, + Errors, + MutationVariables + >; + useMutation< + Path extends ZodiosPathsByMethod, + TConfig extends Omit< + ZodiosRequestOptionsByPath< + Api, + "post", + Path, + FetcherProvider, + true, + TypeProvider + >, + "body" + >, + MutationVariables = UndefinedIfNever< + ZodiosBodyByPath + > + >( + method: "post", + path: Path, + ...[config, mutationOptions]: RequiredKeys extends never + ? [ + config?: ReadonlyDeep, + mutationOptions?: MutationOptions + ] + : [ + config: ReadonlyDeep, + mutationOptions?: MutationOptions + ] + ): UseMutationResult< + ZodiosResponseByPath, + Errors, + MutationVariables + >; + useMutation< + Path extends ZodiosPathsByMethod, + TConfig extends Omit< + ZodiosRequestOptionsByPath< + Api, + "put", + Path, + FetcherProvider, + true, + TypeProvider + >, + "body" + >, + MutationVariables = UndefinedIfNever< + ZodiosBodyByPath + > + >( + method: "put", + path: Path, + ...[config, mutationOptions]: RequiredKeys extends never + ? [ + config?: ReadonlyDeep, + mutationOptions?: MutationOptions + ] + : [ + config: ReadonlyDeep, + mutationOptions?: MutationOptions + ] + ): UseMutationResult< + ZodiosResponseByPath, + Errors, + MutationVariables + >; + useMutation< + Path extends ZodiosPathsByMethod, + TConfig extends Omit< + ZodiosRequestOptionsByPath< + Api, + "patch", + Path, + FetcherProvider, + true, + TypeProvider + >, + "body" + >, + MutationVariables = UndefinedIfNever< + ZodiosBodyByPath + > + >( + method: "patch", + path: Path, + ...[config, mutationOptions]: RequiredKeys extends never + ? [ + config?: ReadonlyDeep, + mutationOptions?: MutationOptions + ] + : [ + config: ReadonlyDeep, + mutationOptions?: MutationOptions + ] + ): UseMutationResult< + ZodiosResponseByPath, + Errors, + MutationVariables + >; + useMutation< + Path extends ZodiosPathsByMethod, + TConfig extends Omit< + ZodiosRequestOptionsByPath< + Api, + "delete", + Path, + FetcherProvider, + true, + TypeProvider + >, + "body" + >, + MutationVariables = UndefinedIfNever< + ZodiosBodyByPath + > + >( + method: "delete", + path: Path, + ...[config, mutationOptions]: RequiredKeys extends never + ? [ + config?: ReadonlyDeep, + mutationOptions?: MutationOptions + ] + : [ + config: ReadonlyDeep, + mutationOptions?: MutationOptions + ] + ): UseMutationResult< + ZodiosResponseByPath, + Errors, + MutationVariables + >; useMutation< M extends Method, Path extends ZodiosPathsByMethod, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index eb2f21c7..fc63bdb3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -21,7 +21,7 @@ importers: '@types/multer': 1.4.7 '@types/node': 18.11.9 '@zodios/core': workspace:* - axios: 1.2.3 + axios: 1.2.5 express: 4.18.2 fp-ts: 2.13.1 io-ts: 2.2.20 @@ -41,7 +41,7 @@ importers: '@types/multer': 1.4.7 '@types/node': 18.11.9 '@zodios/core': link:../core - axios: 1.2.3 + axios: 1.2.5 express: 4.18.2 fp-ts: 2.13.1 io-ts: 2.2.20_fp-ts@2.13.1 @@ -1594,8 +1594,8 @@ packages: engines: {node: '>= 0.4'} dev: true - /axios/1.2.3: - resolution: {integrity: sha512-pdDkMYJeuXLZ6Xj/Q5J3Phpe+jbGdsSzlQaFVkMQzRUL05+6+tetX8TV3p4HrU4kzuO9bt+io/yGQxuyxA/xcw==} + /axios/1.2.5: + resolution: {integrity: sha512-9pU/8mmjSSOb4CXVsvGIevN+MlO/t9OWtKadTaLuN85Gge3HGorUckgp8A/2FH4V4hJ7JuQ3LIeI7KAV9ITZrQ==} dependencies: follow-redirects: 1.15.2 form-data: 4.0.0 From 0a3578c6bcf9c96e3f572b978bb4ab1f838994a6 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sat, 28 Jan 2023 16:54:55 +0100 Subject: [PATCH 105/206] chore(deps): upgrade ts --- package.json | 2 +- pnpm-lock.yaml | 10 ++-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index c6b93faf..6e9c9b19 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,6 @@ "devDependencies": { "@changesets/cli": "2.25.2", "turbo": "1.6.3", - "typescript": "4.9.3" + "typescript": "4.9.4" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fc63bdb3..12637373 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,11 +6,11 @@ importers: specifiers: '@changesets/cli': 2.25.2 turbo: 1.6.3 - typescript: 4.9.3 + typescript: 4.9.4 devDependencies: '@changesets/cli': 2.25.2 turbo: 1.6.3 - typescript: 4.9.3 + typescript: 4.9.4 packages/axios: specifiers: @@ -5404,12 +5404,6 @@ packages: resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} dev: true - /typescript/4.9.3: - resolution: {integrity: sha512-CIfGzTelbKNEnLpLdGFgdyKhG23CKdKgQPOBc+OUNrkJ2vr+KSzsSV5kq5iWhEQbok+quxgGzrAtGWCyU7tHnA==} - engines: {node: '>=4.2.0'} - hasBin: true - dev: true - /typescript/4.9.4: resolution: {integrity: sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==} engines: {node: '>=4.2.0'} From d770be26dd944c833b81fe19459e6c15cd5d94bd Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sun, 29 Jan 2023 12:25:06 +0100 Subject: [PATCH 106/206] fix(core): request should match only on response type --- .../fetcher-provider.types.ts | 4 +- packages/core/src/plugins/form-data.plugin.ts | 8 +- packages/core/src/plugins/form-url.plugin.ts | 8 +- packages/core/src/zodios-request.test.ts | 206 ++++++++++++++++++ packages/core/src/zodios.ts | 34 ++- packages/react/src/hooks.ts | 26 +-- 6 files changed, 260 insertions(+), 26 deletions(-) create mode 100644 packages/core/src/zodios-request.test.ts diff --git a/packages/core/src/fetcher-providers/fetcher-provider.types.ts b/packages/core/src/fetcher-providers/fetcher-provider.types.ts index 5a2663d1..26e957f4 100644 --- a/packages/core/src/fetcher-providers/fetcher-provider.types.ts +++ b/packages/core/src/fetcher-providers/fetcher-provider.types.ts @@ -15,8 +15,8 @@ export interface AnyZodiosFetcherProvider { /** * config types to call fetcher */ - options: any; - config: any; + options: unknown; + config: unknown; response: any; error: any; } diff --git a/packages/core/src/plugins/form-data.plugin.ts b/packages/core/src/plugins/form-data.plugin.ts index 196e2fab..987eb39d 100644 --- a/packages/core/src/plugins/form-data.plugin.ts +++ b/packages/core/src/plugins/form-data.plugin.ts @@ -39,13 +39,17 @@ export function formDataPlugin< return { name: "form-data", request: async (_, config) => { - if (typeof config.body !== "object" || Array.isArray(config.body)) { + if ( + !config.body || + typeof config.body !== "object" || + Array.isArray(config.body) + ) { throw new ZodiosError( "Zodios: multipart/form-data body must be an object", config ); } - const result = getFormDataStream(config.body); + const result = getFormDataStream(config.body as any); return { ...config, body: result.data, diff --git a/packages/core/src/plugins/form-url.plugin.ts b/packages/core/src/plugins/form-url.plugin.ts index d6a14f3f..c553474c 100644 --- a/packages/core/src/plugins/form-url.plugin.ts +++ b/packages/core/src/plugins/form-url.plugin.ts @@ -39,7 +39,11 @@ export function formURLPlugin< return { name: "form-url", request: async (_, config) => { - if (typeof config.body !== "object" || Array.isArray(config.body)) { + if ( + !config.body || + typeof config.body !== "object" || + Array.isArray(config.body) + ) { throw new ZodiosError( "Zodios: application/x-www-form-urlencoded body must be an object", config @@ -48,7 +52,7 @@ export function formURLPlugin< return { ...config, - body: new URLSearchParams(config.body).toString(), + body: new URLSearchParams(config.body as any).toString(), headers: { ...config.headers, "Content-Type": "application/x-www-form-urlencoded", diff --git a/packages/core/src/zodios-request.test.ts b/packages/core/src/zodios-request.test.ts new file mode 100644 index 00000000..50894823 --- /dev/null +++ b/packages/core/src/zodios-request.test.ts @@ -0,0 +1,206 @@ +import { z } from "zod"; +import { makeApi, ZodiosCore } from "./index"; +import { Assert } from "./utils.types"; + +const api = makeApi([ + { + method: "get", + path: "/users", + alias: "getUsers", + description: "Get all users", + parameters: [ + { + name: "page", + type: "Query", + schema: z.number().positive().optional(), + }, + { + name: "limit", + type: "Query", + schema: z.number().positive().optional(), + }, + ], + response: z.object({ + page: z.number(), + count: z.number(), + nextPage: z.number().optional(), + users: z.array( + z.object({ + id: z.number(), + name: z.string(), + }) + ), + }), + }, + { + method: "post", + path: "/users/search", + alias: "searchUsers", + description: "Search users", + immutable: true, + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ + name: z.string(), + page: z.number().positive().optional(), + limit: z.number().positive().optional(), + }), + }, + ], + response: z.object({ + page: z.number(), + count: z.number(), + nextPage: z.number().optional(), + users: z.array( + z.object({ + id: z.number(), + name: z.string(), + }) + ), + }), + }, + { + method: "get", + path: "/users/:id", + alias: "getUser", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + { + method: "get", + path: "/users/:id/address/:address", + alias: "getUserAddress", + response: z.object({ + id: z.number(), + address: z.string(), + }), + }, + { + method: "post", + path: "/users", + alias: "createUser", + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + { + method: "put", + path: "/users", + alias: "updateUser", + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + { + method: "patch", + path: "/users", + alias: "patchUser", + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ], + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + { + method: "delete", + path: "/users/:id", + alias: "deleteUser", + response: z.object({ + id: z.number(), + }), + }, + { + method: "get", + path: "/users/:id/error", + alias: "getUserError", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + { + method: "get", + path: "/users/:id/cancel", + alias: "getUserCancel", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, +]); +const core = new ZodiosCore(api); + +describe("ZodiosCore request", () => { + it("should return only one response type for get request", async () => { + const req = () => + core.request({ + method: "get", + url: "/users", + }); + type Req = typeof req; + const testResult: Assert< + ReturnType, + Promise<{ + nextPage?: number | undefined; + page: number; + count: number; + users: { + name: string; + id: number; + }[]; + }> + > = true; + }); + + it("should return only one response type for post request", async () => { + const core = new ZodiosCore(api); + + const req = () => + core.request({ + method: "post", + url: "/users", + body: { + name: "John", + }, + }); + type Req = typeof req; + const testResult: Assert< + ReturnType, + Promise<{ name: string; id: number }> + > = true; + }); +}); diff --git a/packages/core/src/zodios.ts b/packages/core/src/zodios.ts index f5f82540..c17ba22e 100644 --- a/packages/core/src/zodios.ts +++ b/packages/core/src/zodios.ts @@ -300,11 +300,37 @@ export class ZodiosCoreImpl< * @param config - the config to setup zodios options and parameters * @returns response validated with zod schema provided in the api description */ - async request>( - config: ReadonlyDeep< - ZodiosRequestOptions + async request( + config: Path extends ZodiosPathsByMethod + ? ReadonlyDeep< + ZodiosRequestOptions< + Api, + M, + Path, + FetcherProvider, + true, + TypeProvider + > + > + : ReadonlyDeep< + ZodiosRequestOptions< + Api, + M, + ZodiosPathsByMethod, + FetcherProvider, + true, + TypeProvider + > + > + ): Promise< + ZodiosResponseByPath< + Api, + M, + Path extends ZodiosPathsByMethod ? Path : never, + true, + TypeProvider > - ): Promise> { + > { let conf = config as unknown as ReadonlyDeep< AnyZodiosRequestOptions >; diff --git a/packages/react/src/hooks.ts b/packages/react/src/hooks.ts index f8ae001c..6e8e5d38 100644 --- a/packages/react/src/hooks.ts +++ b/packages/react/src/hooks.ts @@ -368,14 +368,12 @@ export class ZodiosHooksImpl< ); // istanbul ignore next if (params.params && queryOptions) { - // @ts-expect-error params.params = omit( params.params, queryOptions.getPageParamList() as string[] ); } if (params.queries && queryOptions) { - // @ts-expect-error params.queries = omit( params.queries, queryOptions.getPageParamList() as string[] @@ -388,9 +386,8 @@ export class ZodiosHooksImpl< !Array.isArray(params.body) && queryOptions ) { - // @ts-expect-error params.body = omit( - params.body, + params.body as Record, queryOptions.getPageParamList() as string[] ); } @@ -399,21 +396,21 @@ export class ZodiosHooksImpl< this.zodios.get(path, { ...config, queries: { - ...config?.queries, + ...(config as any)?.queries, ...pageParam?.queries, }, params: { - ...config?.params, + ...(config as any)?.params, ...pageParam?.params, }, body: // istanbul ignore next hasObjectBody(config) ? { - ...config?.body, + ...(config as any)?.body, ...pageParam?.body, } - : config?.body, + : (config as any)?.body, signal: this.options.shouldAbortOnUnmount ? combineSignals(signal, (config as any)?.signal) : (config as any)?.signal, @@ -485,7 +482,6 @@ export class ZodiosHooksImpl< ); // istanbul ignore next if (params.params && queryOptions) { - // @ts-expect-error params.params = omit( params.params, queryOptions.getPageParamList() as string[] @@ -493,7 +489,6 @@ export class ZodiosHooksImpl< } // istanbul ignore next if (params.queries && queryOptions) { - // @ts-expect-error params.queries = omit( params.queries, queryOptions.getPageParamList() as string[] @@ -506,9 +501,8 @@ export class ZodiosHooksImpl< !Array.isArray(params.body) && queryOptions ) { - // @ts-expect-error params.body = omit( - params.body, + params.body as Record, queryOptions.getPageParamList() as string[] ); } @@ -517,21 +511,21 @@ export class ZodiosHooksImpl< this.zodios.post(path, { ...config, queries: { - ...config?.queries, + ...(config as any)?.queries, ...pageParam?.queries, }, params: { - ...config?.params, + ...(config as any)?.params, ...pageParam?.params, }, body: // istanbul ignore next hasObjectBody(config) ? { - ...config?.body, + ...(config as any)?.body, ...pageParam?.body, } - : config?.body, + : (config as any)?.body, signal: this.options.shouldAbortOnUnmount ? combineSignals(signal, (config as any)?.signal) : (config as any)?.signal, From 82b769f83fd17e9c3f5faa9bfb02413c2f6e71a4 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sun, 29 Jan 2023 12:27:33 +0100 Subject: [PATCH 107/206] RELEASING: Releasing 5 package(s) Releases: @zodios/axios@11.0.0-beta.16 @zodios/core@11.0.0-beta.16 @zodios/fetch@11.0.0-beta.16 @zodios/react@11.0.0-beta.16 @zodios/testing@11.0.0-beta.16 [skip ci] --- packages/axios/CHANGELOG.md | 13 +++++++++++++ packages/axios/package.json | 4 ++-- packages/core/CHANGELOG.md | 7 +++++++ packages/core/package.json | 2 +- packages/fetch/CHANGELOG.md | 13 +++++++++++++ packages/fetch/package.json | 4 ++-- packages/react/CHANGELOG.md | 15 +++++++++++++++ packages/react/package.json | 8 ++++---- packages/testing/CHANGELOG.md | 13 +++++++++++++ packages/testing/package.json | 4 ++-- 10 files changed, 72 insertions(+), 11 deletions(-) diff --git a/packages/axios/CHANGELOG.md b/packages/axios/CHANGELOG.md index e602efff..18958f82 100644 --- a/packages/axios/CHANGELOG.md +++ b/packages/axios/CHANGELOG.md @@ -1,5 +1,18 @@ # @zodios/core +## 11.0.0-beta.16 + +### Major Changes + +- f1b38f4: feat: improve typings +- cb56d43: feat: improve typings + +### Patch Changes + +- Updated dependencies [f1b38f4] +- Updated dependencies [cb56d43] + - @zodios/core@11.0.0-beta.16 + ## 11.0.0-beta.15 ### Major Changes diff --git a/packages/axios/package.json b/packages/axios/package.json index c3e7a3a5..57319bea 100644 --- a/packages/axios/package.json +++ b/packages/axios/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/axios", "description": "Typescript API client with axios", - "version": "11.0.0-beta.15", + "version": "11.0.0-beta.16", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", @@ -41,7 +41,7 @@ "test": "jest --coverage" }, "peerDependencies": { - "@zodios/core": "11.0.0-beta.15", + "@zodios/core": "11.0.0-beta.16", "axios": "^0.x || ^1.0.0", "fp-ts": "2.x", "io-ts": "2.x", diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 3b9d8314..3d662fd1 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,12 @@ # @zodios/core +## 11.0.0-beta.16 + +### Major Changes + +- f1b38f4: feat: improve typings +- cb56d43: feat: improve typings + ## 11.0.0-beta.15 ### Major Changes diff --git a/packages/core/package.json b/packages/core/package.json index f2061497..4781e80a 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/core", "description": "Typescript API client with autocompletion and zod validations", - "version": "11.0.0-beta.15", + "version": "11.0.0-beta.16", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", diff --git a/packages/fetch/CHANGELOG.md b/packages/fetch/CHANGELOG.md index e602efff..18958f82 100644 --- a/packages/fetch/CHANGELOG.md +++ b/packages/fetch/CHANGELOG.md @@ -1,5 +1,18 @@ # @zodios/core +## 11.0.0-beta.16 + +### Major Changes + +- f1b38f4: feat: improve typings +- cb56d43: feat: improve typings + +### Patch Changes + +- Updated dependencies [f1b38f4] +- Updated dependencies [cb56d43] + - @zodios/core@11.0.0-beta.16 + ## 11.0.0-beta.15 ### Major Changes diff --git a/packages/fetch/package.json b/packages/fetch/package.json index 8ee304b2..4f53042d 100644 --- a/packages/fetch/package.json +++ b/packages/fetch/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/fetch", "description": "Typescript API client with fetch", - "version": "11.0.0-beta.15", + "version": "11.0.0-beta.16", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", @@ -41,7 +41,7 @@ "test": "NODE_OPTIONS=--experimental-abortcontroller jest --coverage" }, "peerDependencies": { - "@zodios/core": "11.0.0-beta.15", + "@zodios/core": "11.0.0-beta.16", "fp-ts": "2.x", "io-ts": "2.x", "zod": "^3.x" diff --git a/packages/react/CHANGELOG.md b/packages/react/CHANGELOG.md index 4c9d0567..4a213a7f 100644 --- a/packages/react/CHANGELOG.md +++ b/packages/react/CHANGELOG.md @@ -1,5 +1,20 @@ # @zodios/react +## 11.0.0-beta.16 + +### Major Changes + +- f1b38f4: feat: improve typings +- cb56d43: feat: improve typings + +### Patch Changes + +- Updated dependencies [f1b38f4] +- Updated dependencies [cb56d43] + - @zodios/axios@11.0.0-beta.16 + - @zodios/core@11.0.0-beta.16 + - @zodios/fetch@11.0.0-beta.16 + ## 11.0.0-beta.15 ### Major Changes diff --git a/packages/react/package.json b/packages/react/package.json index d705bf58..e9e7b6d9 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/react", "description": "React hooks for zodios", - "version": "11.0.0-beta.15", + "version": "11.0.0-beta.16", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", @@ -40,9 +40,9 @@ }, "peerDependencies": { "@tanstack/react-query": "4.x", - "@zodios/core": "11.0.0-beta.15", - "@zodios/axios": "11.0.0-beta.15", - "@zodios/fetch": "11.0.0-beta.15", + "@zodios/core": "11.0.0-beta.16", + "@zodios/axios": "11.0.0-beta.16", + "@zodios/fetch": "11.0.0-beta.16", "react": ">=16.8.0" }, "peerDependenciesMeta": { diff --git a/packages/testing/CHANGELOG.md b/packages/testing/CHANGELOG.md index 8130c035..f5a9c3d6 100644 --- a/packages/testing/CHANGELOG.md +++ b/packages/testing/CHANGELOG.md @@ -1,5 +1,18 @@ # @zodios/core +## 11.0.0-beta.16 + +### Major Changes + +- f1b38f4: feat: improve typings +- cb56d43: feat: improve typings + +### Patch Changes + +- Updated dependencies [f1b38f4] +- Updated dependencies [cb56d43] + - @zodios/core@11.0.0-beta.16 + ## 11.0.0-beta.15 ### Major Changes diff --git a/packages/testing/package.json b/packages/testing/package.json index 84ed9d15..1a523192 100644 --- a/packages/testing/package.json +++ b/packages/testing/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/testing", "description": "Zodios mock library", - "version": "11.0.0-beta.15", + "version": "11.0.0-beta.16", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", @@ -37,7 +37,7 @@ "test": "jest --coverage" }, "peerDependencies": { - "@zodios/core": "11.0.0-beta.15" + "@zodios/core": "11.0.0-beta.16" }, "devDependencies": { "@jest/globals": "29.3.1", From 8065c52944e0c17d2bc8ad3501f193f60c2804e2 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sun, 29 Jan 2023 16:20:08 +0100 Subject: [PATCH 108/206] chore: update changesets --- .changeset/pre.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.changeset/pre.json b/.changeset/pre.json index 8080ce04..2babde43 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -11,12 +11,14 @@ "changesets": [ "blue-hounds-sort", "chilled-emus-own", + "curly-shrimps-destroy", "famous-rules-drop", "five-apricots-breathe", "gentle-ligers-mix", "good-tigers-tie", "long-fans-dress", "lucky-brooms-fry", + "nervous-kings-bow", "nice-kids-attend", "nice-wombats-boil", "polite-bugs-confess", From 4e28e5fe5ba089063bec28b15de1798216df5688 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sun, 29 Jan 2023 19:33:27 +0100 Subject: [PATCH 109/206] chore(core): export types --- packages/core/package.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/core/package.json b/packages/core/package.json index 4781e80a..0f239ae8 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -11,6 +11,11 @@ "require": "./lib/index.js", "types": "./lib/index.d.ts" }, + "./lib/*.types": { + "import": "./lib/*.types.mjs", + "require": "./lib/*.types.js", + "types": "./lib/*.types.d.ts" + }, "./package.json": "./package.json" }, "files": [ From 180a22ae49476e8199369398dbfb75496bcf0c59 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sun, 29 Jan 2023 19:42:25 +0100 Subject: [PATCH 110/206] chore(deps): update express types --- packages/axios/package.json | 2 +- packages/fetch/package.json | 2 +- packages/react/package.json | 2 +- pnpm-lock.yaml | 18 +++++++++--------- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/axios/package.json b/packages/axios/package.json index 57319bea..73a32d19 100644 --- a/packages/axios/package.json +++ b/packages/axios/package.json @@ -61,7 +61,7 @@ "devDependencies": { "@jest/globals": "29.3.1", "@jest/types": "29.3.1", - "@types/express": "4.17.14", + "@types/express": "4.17.16", "@types/jest": "29.2.2", "@types/multer": "1.4.7", "@types/node": "18.11.9", diff --git a/packages/fetch/package.json b/packages/fetch/package.json index 4f53042d..47d37892 100644 --- a/packages/fetch/package.json +++ b/packages/fetch/package.json @@ -60,7 +60,7 @@ "devDependencies": { "@jest/globals": "29.3.1", "@jest/types": "29.3.1", - "@types/express": "4.17.14", + "@types/express": "4.17.16", "@types/jest": "29.2.2", "@types/multer": "1.4.7", "@types/node": "18.11.9", diff --git a/packages/react/package.json b/packages/react/package.json index e9e7b6d9..e5b4e4f6 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -63,7 +63,7 @@ "@testing-library/react-hooks": "8.0.1", "@testing-library/user-event": "14.4.3", "@types/cors": "2.8.12", - "@types/express": "4.17.14", + "@types/express": "4.17.16", "@types/jest": "29.2.3", "@types/node": "18.11.9", "@types/react": "18.0.25", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 12637373..1f198720 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -16,7 +16,7 @@ importers: specifiers: '@jest/globals': 29.3.1 '@jest/types': 29.3.1 - '@types/express': 4.17.14 + '@types/express': 4.17.16 '@types/jest': 29.2.2 '@types/multer': 1.4.7 '@types/node': 18.11.9 @@ -36,7 +36,7 @@ importers: devDependencies: '@jest/globals': 29.3.1 '@jest/types': 29.3.1 - '@types/express': 4.17.14 + '@types/express': 4.17.16 '@types/jest': 29.2.2 '@types/multer': 1.4.7 '@types/node': 18.11.9 @@ -90,7 +90,7 @@ importers: specifiers: '@jest/globals': 29.3.1 '@jest/types': 29.3.1 - '@types/express': 4.17.14 + '@types/express': 4.17.16 '@types/jest': 29.2.2 '@types/multer': 1.4.7 '@types/node': 18.11.9 @@ -110,7 +110,7 @@ importers: devDependencies: '@jest/globals': 29.3.1 '@jest/types': 29.3.1 - '@types/express': 4.17.14 + '@types/express': 4.17.16 '@types/jest': 29.2.2 '@types/multer': 1.4.7 '@types/node': 18.11.9 @@ -139,7 +139,7 @@ importers: '@testing-library/react-hooks': 8.0.1 '@testing-library/user-event': 14.4.3 '@types/cors': 2.8.12 - '@types/express': 4.17.14 + '@types/express': 4.17.16 '@types/jest': 29.2.3 '@types/node': 18.11.9 '@types/react': 18.0.25 @@ -172,7 +172,7 @@ importers: '@testing-library/react-hooks': 8.0.1_djah6xjkh3i2bchfafvsnwdbb4 '@testing-library/user-event': 14.4.3_aaq3sbffpfe3jnxzm2zngsddei '@types/cors': 2.8.12 - '@types/express': 4.17.14 + '@types/express': 4.17.16 '@types/jest': 29.2.3 '@types/node': 18.11.9 '@types/react': 18.0.25 @@ -1300,8 +1300,8 @@ packages: '@types/range-parser': 1.2.4 dev: true - /@types/express/4.17.14: - resolution: {integrity: sha512-TEbt+vaPFQ+xpxFLFssxUDXj5cWCxZJjIcB7Yg0k0GMHGtgtQgpvx/MUQUeAkNbA9AAGrwkAsoeItdTgS7FMyg==} + /@types/express/4.17.16: + resolution: {integrity: sha512-LkKpqRZ7zqXJuvoELakaFYuETHjZkSol8EV6cNnyishutDBCCdv6+dsKPbKkCcIk57qRphOLY5sEgClw1bO3gA==} dependencies: '@types/body-parser': 1.19.2 '@types/express-serve-static-core': 4.17.31 @@ -1370,7 +1370,7 @@ packages: /@types/multer/1.4.7: resolution: {integrity: sha512-/SNsDidUFCvqqcWDwxv2feww/yqhNeTRL5CVoL3jU4Goc4kKEL10T7Eye65ZqPNi4HRx8sAEX59pV1aEH7drNA==} dependencies: - '@types/express': 4.17.14 + '@types/express': 4.17.16 dev: true /@types/node/12.20.55: From 85b3b3b809be0996894b8db27553285c4a0a50b3 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sun, 29 Jan 2023 19:43:39 +0100 Subject: [PATCH 111/206] docs(changeset): fix(react): do not double fetch if react-query signal is not used --- .changeset/gorgeous-dolls-fry.md | 9 +++++++++ packages/react/src/hooks.ts | 28 ++++++++++++++-------------- 2 files changed, 23 insertions(+), 14 deletions(-) create mode 100644 .changeset/gorgeous-dolls-fry.md diff --git a/.changeset/gorgeous-dolls-fry.md b/.changeset/gorgeous-dolls-fry.md new file mode 100644 index 00000000..63a430ec --- /dev/null +++ b/.changeset/gorgeous-dolls-fry.md @@ -0,0 +1,9 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +"@zodios/react": major +"@zodios/testing": major +--- + +fix(react): do not double fetch if react-query signal is not used diff --git a/packages/react/src/hooks.ts b/packages/react/src/hooks.ts index 6e8e5d38..809972d6 100644 --- a/packages/react/src/hooks.ts +++ b/packages/react/src/hooks.ts @@ -257,11 +257,11 @@ export class ZodiosHooksImpl< ["params", "queries", "body"] ); const key = [{ api: this.apiName, path }, params] as QueryKey; - const query = ({ signal }: { signal?: AbortSignal }) => + const query = (queryParams: QueryFunctionContext) => this.zodios.get(path, { ...(config as any), signal: this.options.shouldAbortOnUnmount - ? combineSignals(signal, (config as any)?.signal) + ? combineSignals(queryParams.signal, (config as any)?.signal) : (config as any)?.signal, }); const queryClient = useQueryClient(); @@ -306,11 +306,11 @@ export class ZodiosHooksImpl< ["params", "queries", "body"] ); const key = [{ api: this.apiName, path }, params] as QueryKey; - const query = ({ signal }: { signal?: AbortSignal }) => + const query = (queryParams: QueryFunctionContext) => this.zodios.post(path, { ...(config as any), signal: this.options.shouldAbortOnUnmount - ? combineSignals(signal, (config as any)?.signal) + ? combineSignals(queryParams.signal, (config as any)?.signal) : (config as any)?.signal, }); const queryClient = useQueryClient(); @@ -392,27 +392,27 @@ export class ZodiosHooksImpl< ); } const key = [{ api: this.apiName, path }, params]; - const query = ({ pageParam = undefined, signal }: QueryFunctionContext) => + const query = (queryParams: QueryFunctionContext) => this.zodios.get(path, { ...config, queries: { ...(config as any)?.queries, - ...pageParam?.queries, + ...queryParams.pageParam?.queries, }, params: { ...(config as any)?.params, - ...pageParam?.params, + ...queryParams.pageParam?.params, }, body: // istanbul ignore next hasObjectBody(config) ? { ...(config as any)?.body, - ...pageParam?.body, + ...queryParams.pageParam?.body, } : (config as any)?.body, signal: this.options.shouldAbortOnUnmount - ? combineSignals(signal, (config as any)?.signal) + ? combineSignals(queryParams.signal, (config as any)?.signal) : (config as any)?.signal, } as unknown as ReadonlyDeep); const queryClient = useQueryClient(); @@ -507,27 +507,27 @@ export class ZodiosHooksImpl< ); } const key = [{ api: this.apiName, path }, params]; - const query = ({ pageParam = undefined, signal }: QueryFunctionContext) => + const query = (queryParams: QueryFunctionContext) => this.zodios.post(path, { ...config, queries: { ...(config as any)?.queries, - ...pageParam?.queries, + ...queryParams.pageParam?.queries, }, params: { ...(config as any)?.params, - ...pageParam?.params, + ...queryParams.pageParam?.params, }, body: // istanbul ignore next hasObjectBody(config) ? { ...(config as any)?.body, - ...pageParam?.body, + ...queryParams.pageParam?.body, } : (config as any)?.body, signal: this.options.shouldAbortOnUnmount - ? combineSignals(signal, (config as any)?.signal) + ? combineSignals(queryParams.signal, (config as any)?.signal) : (config as any)?.signal, } as unknown as ReadonlyDeep); const queryClient = useQueryClient(); From cd8ea8f272ab3fef467ce28a05f3d2c5231b958d Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Tue, 31 Jan 2023 14:17:29 +0100 Subject: [PATCH 112/206] docs(changeset): feat(plugin): add new zodios plugin system --- .changeset/quiet-rockets-dream.md | 9 + .../src/__snapshots__/zodios.test.ts.snap | 23 +++ packages/core/src/index.ts | 2 +- packages/core/src/plugins/index.ts | 3 +- ...ugin.test.ts => validation.plugin.test.ts} | 50 ++--- ...idation.plugin.ts => validation.plugin.ts} | 26 +-- .../core/src/plugins/zodios-plugins.test.ts | 92 +++------ packages/core/src/plugins/zodios-plugins.ts | 195 +++++++++--------- .../core/src/plugins/zodios-plugins.types.ts | 46 +++++ packages/core/src/zodios.test.ts | 162 +++++---------- packages/core/src/zodios.ts | 172 ++++++++------- packages/core/src/zodios.types.ts | 6 +- 12 files changed, 386 insertions(+), 400 deletions(-) create mode 100644 .changeset/quiet-rockets-dream.md create mode 100644 packages/core/src/__snapshots__/zodios.test.ts.snap rename packages/core/src/plugins/{zod-validation.plugin.test.ts => validation.plugin.test.ts} (90%) rename packages/core/src/plugins/{zod-validation.plugin.ts => validation.plugin.ts} (84%) create mode 100644 packages/core/src/plugins/zodios-plugins.types.ts diff --git a/.changeset/quiet-rockets-dream.md b/.changeset/quiet-rockets-dream.md new file mode 100644 index 00000000..e1f7571e --- /dev/null +++ b/.changeset/quiet-rockets-dream.md @@ -0,0 +1,9 @@ +--- +"@zodios/axios": major +"@zodios/core": major +"@zodios/fetch": major +"@zodios/react": major +"@zodios/testing": major +--- + +feat(plugin): add new zodios plugin system diff --git a/packages/core/src/__snapshots__/zodios.test.ts.snap b/packages/core/src/__snapshots__/zodios.test.ts.snap new file mode 100644 index 00000000..1ec8bbce --- /dev/null +++ b/packages/core/src/__snapshots__/zodios.test.ts.snap @@ -0,0 +1,23 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`Zodios should not validate bad formatted responses 1`] = ` +"Zodios: Invalid response from endpoint 'get /:id' +status: 200 OK +cause: +[ + { + "code": "invalid_type", + "expected": "string", + "received": "undefined", + "path": [ + "more" + ], + "message": "Required" + } +] +received: +{ + "id": 1, + "name": "test" +}" +`; diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 0fe02018..4becee07 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -82,7 +82,7 @@ export type { export { setFetcherHook, clearFetcherHook } from "./hooks"; export { PluginId, - zodValidationPlugin, + schemaValidationPlugin, formDataPlugin, formURLPlugin, headerPlugin, diff --git a/packages/core/src/plugins/index.ts b/packages/core/src/plugins/index.ts index be1f6cdf..09b66505 100644 --- a/packages/core/src/plugins/index.ts +++ b/packages/core/src/plugins/index.ts @@ -1,5 +1,6 @@ export * from "./form-data.plugin"; export * from "./form-url.plugin"; export * from "./header.plugin"; -export * from "./zod-validation.plugin"; +export * from "./validation.plugin"; export * from "./zodios-plugins"; +export type { PluginId } from "./zodios-plugins.types"; diff --git a/packages/core/src/plugins/zod-validation.plugin.test.ts b/packages/core/src/plugins/validation.plugin.test.ts similarity index 90% rename from packages/core/src/plugins/zod-validation.plugin.test.ts rename to packages/core/src/plugins/validation.plugin.test.ts index 2fb46888..4a59b3d1 100644 --- a/packages/core/src/plugins/zod-validation.plugin.test.ts +++ b/packages/core/src/plugins/validation.plugin.test.ts @@ -2,24 +2,24 @@ import { z } from "zod"; import { apiBuilder } from "../api"; import { ReadonlyDeep } from "../utils.types"; import { AnyZodiosRequestOptions } from "../zodios.types"; -import { zodValidationPlugin } from "./zod-validation.plugin"; +import { schemaValidationPlugin } from "./validation.plugin"; import { zodTypeProvider } from "../type-providers"; import { AnyZodiosFetcherProvider } from "../fetcher-providers"; -describe("zodValidationPlugin", () => { - const plugin = zodValidationPlugin({ +describe("schemaValidationPlugin", () => { + const plugin = schemaValidationPlugin({ validate: true, transform: true, sendDefaults: false, typeProvider: zodTypeProvider, }); - const pluginWithDefaults = zodValidationPlugin({ + const pluginWithDefaults = schemaValidationPlugin({ validate: true, transform: true, sendDefaults: true, typeProvider: zodTypeProvider, }); - const pluginWithoutTransform = zodValidationPlugin({ + const pluginWithoutTransform = schemaValidationPlugin({ validate: true, transform: false, sendDefaults: false, @@ -31,15 +31,9 @@ describe("zodValidationPlugin", () => { expect(plugin.request).toBeDefined(); }); - it("should throw if endpoint is not found", async () => { - await expect( - plugin.request!(api, notExistingConfig) - ).rejects.toThrowError("No endpoint found for get /notExisting"); - }); - it("should verify parameters", async () => { const transformed = await plugin.request!( - api, + api[0], createSampleConfig("/parse") ); @@ -54,7 +48,7 @@ describe("zodValidationPlugin", () => { it("should transform parameters", async () => { const transformed = await plugin.request!( - api, + api[2], createSampleConfig("/transform") ); @@ -69,7 +63,7 @@ describe("zodValidationPlugin", () => { it("should transform empty string parameters", async () => { const transformed = await plugin.request!( - api, + api[2], createEmptySampleConfig("/transform") ); @@ -84,7 +78,7 @@ describe("zodValidationPlugin", () => { it("should generate default parameter when generateDefaults is activated", async () => { const defaulted = await pluginWithDefaults.request!( - api, + api[1], createUndefinedSampleConfig("/defaults") ); @@ -98,7 +92,7 @@ describe("zodValidationPlugin", () => { it("should not transform parameters when transform is disabled", async () => { const notTransformed = await pluginWithoutTransform.request!( - api, + api[2], createSampleConfig("/transform") ); @@ -113,7 +107,7 @@ describe("zodValidationPlugin", () => { it("should transform parameters (async)", async () => { const transformed = await plugin.request!( - api, + api[3], createSampleConfig("/transformAsync") ); @@ -128,7 +122,7 @@ describe("zodValidationPlugin", () => { it("should not transform parameters (async) when transform is disabled", async () => { const notTransformed = await pluginWithoutTransform.request!( - api, + api[3], createSampleConfig("/transformAsync") ); @@ -147,7 +141,7 @@ describe("zodValidationPlugin", () => { sampleQueryParam: 123, }; - await expect(plugin.request!(api, badConfig)).rejects.toThrowError( + await expect(plugin.request!(api[0], badConfig)).rejects.toThrowError( "Zodios: Invalid Query parameter 'sampleQueryParam'" ); }); @@ -158,15 +152,9 @@ describe("zodValidationPlugin", () => { expect(plugin.response).toBeDefined(); }); - it("should throw if endpoint is not found", async () => { - await expect( - plugin.response!(api, notExistingConfig, createSampleResponse()) - ).rejects.toThrowError("No endpoint found for get /notExisting"); - }); - it("should verify body", async () => { const transformed = await plugin.response!( - api, + api[0], createSampleConfig("/parse"), createSampleResponse() ); @@ -179,7 +167,7 @@ describe("zodValidationPlugin", () => { it("should transform body", async () => { const transformed = await plugin.response!( - api, + api[2], createSampleConfig("/transform"), createSampleResponse() ); @@ -192,7 +180,7 @@ describe("zodValidationPlugin", () => { it("should not transform body when transform is disabled", async () => { const notTransformed = await pluginWithoutTransform.response!( - api, + api[2], createSampleConfig("/transform"), createSampleResponse() ); @@ -205,7 +193,7 @@ describe("zodValidationPlugin", () => { it("should transform body (async)", async () => { const transformed = await plugin.response!( - api, + api[3], createSampleConfig("/transformAsync"), createSampleResponse() ); @@ -218,7 +206,7 @@ describe("zodValidationPlugin", () => { it("should not transform body (async) when transform is disabled", async () => { const notTransformed = await pluginWithoutTransform.response!( - api, + api[3], createSampleConfig("/transformAsync"), createSampleResponse() ); @@ -235,7 +223,7 @@ describe("zodValidationPlugin", () => { badResponse.data.first = 123; await expect( - plugin.response!(api, createSampleConfig("/parse"), badResponse) + plugin.response!(api[0], createSampleConfig("/parse"), badResponse) ).rejects .toThrowError(`Zodios: Invalid response from endpoint 'post /parse' status: 200 OK diff --git a/packages/core/src/plugins/zod-validation.plugin.ts b/packages/core/src/plugins/validation.plugin.ts similarity index 84% rename from packages/core/src/plugins/zod-validation.plugin.ts rename to packages/core/src/plugins/validation.plugin.ts index 4ae989fe..a85974bb 100644 --- a/packages/core/src/plugins/zod-validation.plugin.ts +++ b/packages/core/src/plugins/validation.plugin.ts @@ -1,4 +1,3 @@ -import { findEndpoint } from "../utils"; import { ZodiosError } from "../zodios-error"; import type { AnyZodiosTypeProvider } from "../type-providers"; import type { ZodiosOptions, ZodiosPlugin } from "../zodios.types"; @@ -23,11 +22,11 @@ function shouldRequest(option: string | boolean) { } /** - * Zod validation plugin used internally by Zodios. + * alidation plugin used internally by Zodios. * By default zodios always validates the response. - * @returns zod-validation plugin + * @returns schema-validation plugin */ -export function zodValidationPlugin< +export function schemaValidationPlugin< FetcherProvider extends AnyZodiosFetcherProvider, TypeProvider extends AnyZodiosTypeProvider >({ @@ -37,15 +36,9 @@ export function zodValidationPlugin< typeProvider, }: Options): ZodiosPlugin { return { - name: "zod-validation", + name: "schema-validation", request: shouldRequest(validate) - ? async (api, config) => { - const endpoint = findEndpoint(api, config.method, config.url); - if (!endpoint) { - throw new Error( - `No endpoint found for ${config.method} ${config.url}` - ); - } + ? async (endpoint, config) => { const { parameters } = endpoint; if (!parameters) { return config; @@ -98,14 +91,7 @@ export function zodValidationPlugin< } : undefined, response: shouldResponse(validate) - ? async (api, config, response) => { - const endpoint = findEndpoint(api, config.method, config.url); - /* istanbul ignore next */ - if (!endpoint) { - throw new Error( - `No endpoint found for ${config.method} ${config.url}` - ); - } + ? async (endpoint, config, response) => { if ( typeof response.headers?.get === "function" ? (response.headers.get("content-type") as string)?.includes?.( diff --git a/packages/core/src/plugins/zodios-plugins.test.ts b/packages/core/src/plugins/zodios-plugins.test.ts index a2c186b4..6a3f6b5d 100644 --- a/packages/core/src/plugins/zodios-plugins.test.ts +++ b/packages/core/src/plugins/zodios-plugins.test.ts @@ -1,64 +1,44 @@ import { AnyZodiosFetcherProvider } from "../fetcher-providers"; -import { ZodiosPlugin } from "../zodios.types"; +import { tsSchema } from "../type-providers"; +import { ZodiosEndpointDefinition, ZodiosPlugin } from "../zodios.types"; import { ZodiosPlugins } from "./zodios-plugins"; +const testEndpoint: ZodiosEndpointDefinition = { + method: "get", + path: "/test", + alias: "getTest", + response: tsSchema<{ test: string }>(), +}; + describe("ZodiosPlugins", () => { it("should be defined", () => { expect(ZodiosPlugins).toBeDefined(); }); it("should register one plugin", () => { - const plugins = new ZodiosPlugins("any", "any"); + const plugins = new ZodiosPlugins(); const plugin: ZodiosPlugin = { - request: async (api, config) => config, - response: async (api, config, response) => response, + request: async (endpoint, config) => config, + response: async (endpoint, config, response) => response, }; - const id = plugins.use(plugin); - expect(id.key).toBe("any-any"); - expect(id.value).toBe(0); - expect(plugins.count()).toBe(1); + const id = plugins.use({}, plugin); + expect(id).toBe(0); }); it("should unregister one plugin", () => { - const plugins = new ZodiosPlugins("any", "any"); + const plugins = new ZodiosPlugins(); const plugin: ZodiosPlugin = { request: async (api, config) => config, response: async (api, config, response) => response, }; - const id = plugins.use(plugin); + const id = plugins.use({}, plugin); plugins.eject(id); - expect(plugins.count()).toBe(0); - }); - - it("should replace named plugins", () => { - const plugins = new ZodiosPlugins("any", "any"); - const plugin: ZodiosPlugin = { - name: "test", - request: async (api, config) => config, - response: async (api, config, response) => response, - }; - plugins.use(plugin); - plugins.use(plugin); - expect(plugins.count()).toBe(1); - }); - - it("should throw if plugin is not registered", () => { - const plugins = new ZodiosPlugins("any", "any"); - const id = { key: "test-any", value: 5 }; - expect(() => plugins.eject(id)).toThrowError( - `Plugin with key 'test-any' is not registered for endpoint 'any-any'` - ); - }); - - it("should throw if named plugin is not registered", () => { - const plugins = new ZodiosPlugins("any", "any"); - expect(() => plugins.eject("test")).toThrowError( - `Plugin with name 'test' not found` - ); + // @ts-ignore + expect(plugins.plugins.filter((filter) => filter.plugin).length).toBe(0); }); it("should execute response plugins consistently", async () => { - const plugins = new ZodiosPlugins("any", "any"); + const plugins = new ZodiosPlugins(); const plugin1: ZodiosPlugin = { request: async (api, config) => config, response: async (api, config, response) => { @@ -66,7 +46,7 @@ describe("ZodiosPlugins", () => { return response; }, }; - plugins.use(plugin1); + plugins.use({}, plugin1); const plugin2: ZodiosPlugin = { request: async (api, config) => config, response: async (api, config, response) => { @@ -74,16 +54,16 @@ describe("ZodiosPlugins", () => { return response; }, }; - plugins.use(plugin2); + plugins.use({}, plugin2); const response1 = await plugins.interceptResponse( - [], + testEndpoint, // @ts-ignore {}, Promise.resolve({ data: "test1:" }) ); expect(response1.data).toBe("test1:21"); const response2 = await plugins.interceptResponse( - [], + testEndpoint, // @ts-ignore {}, Promise.resolve({ data: "test2:" }) @@ -92,38 +72,18 @@ describe("ZodiosPlugins", () => { }); it('should catch error if plugin "error" is defined', async () => { - const plugins = new ZodiosPlugins("any", "any"); + const plugins = new ZodiosPlugins(); const plugin: ZodiosPlugin = { request: async (api, config) => config, - // @ts-ignore error: async (api, config, error) => ({ test: true }), }; - plugins.use(plugin); + plugins.use({}, plugin); const response = await plugins.interceptResponse( - [], + testEndpoint, // @ts-ignore { method: "any", url: "any" }, Promise.reject(new Error("test")) ); expect(response).toEqual({ test: true }); }); - - it("should count plugins", () => { - const plugins = new ZodiosPlugins("any", "any"); - const namedPlugin: (n: number) => ZodiosPlugin = ( - n - ) => ({ - name: `test${n}`, - request: async (api, config) => config, - response: async (api, config, response) => response, - }); - const plugin: ZodiosPlugin = { - request: async (api, config) => config, - response: async (api, config, response) => response, - }; - plugins.use(namedPlugin(1)); - plugins.use(plugin); - plugins.use(namedPlugin(2)); - expect(plugins.count()).toBe(3); - }); }); diff --git a/packages/core/src/plugins/zodios-plugins.ts b/packages/core/src/plugins/zodios-plugins.ts index 602e4114..77877d82 100644 --- a/packages/core/src/plugins/zodios-plugins.ts +++ b/packages/core/src/plugins/zodios-plugins.ts @@ -1,138 +1,149 @@ -import { +import type { AnyZodiosFetcherProvider, TypeOfFetcherResponse, } from "../fetcher-providers"; -import { ReadonlyDeep } from "../utils.types"; -import { +import type { ReadonlyDeep } from "../utils.types"; +import type { AnyZodiosRequestOptions, - Method, - ZodiosEndpointDefinitions, + ZodiosEndpointDefinition, ZodiosPlugin, } from "../zodios.types"; +import { + PluginId, + ZodiosPluginRegistration, + RequiredZodiosPluginRegistration, + ZodiosPluginFilters, + PluginPriority, + PLUGIN_PRIORITIES_REQUEST, + PLUGIN_PRIORITIES_RESPONSE, + PluginPriorities, +} from "./zodios-plugins.types"; -export type PluginId = { - key: string; - value: number; +const matchPluginFilter = ( + endpoint: ZodiosEndpointDefinition, + filters: ZodiosPluginFilters +) => { + return (Object.keys(filters) as (keyof ZodiosPluginFilters)[]).every( + (key) => { + const filter = filters[key]; + const endpointValue = endpoint[key]; + if (typeof filter === "string" && endpointValue) { + return filter === endpointValue; + } + if (filter instanceof RegExp && endpointValue) { + return filter.test(endpointValue); + } + if (typeof filter === "function") { + return filter(endpointValue ?? ""); + } + return filter === undefined; + } + ); }; -/** - * A list of plugins that can be used by the Zodios client. - */ +const isPluginFor = + ( + endpoint: ZodiosEndpointDefinition, + priority: PluginPriority, + type: "request" | "response" + ) => + ( + plugin: ZodiosPluginRegistration + ): plugin is RequiredZodiosPluginRegistration => { + return ( + plugin.priority === priority && + Boolean(plugin.plugin) && + Boolean( + type === "request" + ? plugin.plugin!.request + : plugin.plugin!.response || plugin.plugin!.error + ) && + matchPluginFilter(endpoint, plugin.filter) + ); + }; export class ZodiosPlugins { - public readonly key: string; - private plugins: Array | undefined> = []; + private plugins: Array> = []; - /** - * Constructor - * @param method - http method of the endpoint where the plugins are registered - * @param path - path of the endpoint where the plugins are registered - */ - constructor(method: Method | "any", path: string) { - this.key = `${method}-${path}`; - } - - /** - * Get the index of a plugin by name - * @param name - name of the plugin - * @returns the index of the plugin if found, -1 otherwise - */ - indexOf(name: string) { - return this.plugins.findIndex((p) => p?.name === name); - } + constructor() {} /** * register a plugin - * if the plugin has a name it will be replaced if it already exists - * @param plugin - plugin to register - * @returns unique id of the plugin + * @param filter - how to match the plugin + * @param plugin - plugin to be registered + * @param priority - low, normal, high, default: normal + * @returns - plugin id to be used for ejecting */ - use(plugin: ZodiosPlugin): PluginId { - if (plugin.name) { - const id = this.indexOf(plugin.name); - if (id !== -1) { - this.plugins[id] = plugin; - return { key: this.key, value: id }; - } - } - this.plugins.push(plugin); - return { key: this.key, value: this.plugins.length - 1 }; + use( + filter: ZodiosPluginFilters, + plugin: ZodiosPlugin, + priority: PluginPriority = PluginPriorities.normal + ): PluginId { + this.plugins.push({ + filter, + plugin, + priority, + }); + return this.plugins.length - 1; } - - /** - * unregister a plugin - * @param plugin - plugin to unregister - */ - eject(plugin: PluginId | string) { - if (typeof plugin === "string") { - const id = this.indexOf(plugin); - if (id === -1) { - throw new Error(`Plugin with name '${plugin}' not found`); - } - this.plugins[id] = undefined; - } else { - if (plugin.key !== this.key) { - throw new Error( - `Plugin with key '${plugin.key}' is not registered for endpoint '${this.key}'` - ); - } - this.plugins[plugin.value] = undefined; - } + eject(id: PluginId) { + this.plugins[id].plugin = undefined; } /** - * Intercept the request config by applying all plugins - * before using it to send a request to the server + * intercept the request before it is sent to the server + * apply plugins in order of registration (internal plugins first) + * @param endpoint - endpoint definition * @param config - request config - * @returns the modified config + * @returns - modified request config */ async interceptRequest( - api: ZodiosEndpointDefinitions, + endpoint: ZodiosEndpointDefinition, config: ReadonlyDeep> ) { let pluginConfig = config; - for (const plugin of this.plugins) { - if (plugin?.request) { - pluginConfig = await plugin.request(api, pluginConfig); + for (const priority of PLUGIN_PRIORITIES_REQUEST) { + for (const plugin of this.plugins.filter( + isPluginFor(endpoint, priority, "request") + )) { + pluginConfig = await plugin.plugin.request(endpoint, pluginConfig); } } return pluginConfig; } /** - * Intercept the response from server by applying all plugins - * @param api - endpoint descriptions + * intercept the response before it is returned to the user + * apply plugins in reverse order of registration (user plugins first) + * @param endpoint - endpoint definition * @param config - request config - * @param response - response from the server - * @returns the modified response + * @param response - response promise from the server + * @returns - modified response promise */ async interceptResponse( - api: ZodiosEndpointDefinitions, + endpoint: ZodiosEndpointDefinition, config: ReadonlyDeep>, response: Promise> ) { let pluginResponse = response; - for (let index = this.plugins.length - 1; index >= 0; index--) { - const plugin = this.plugins[index]; - if (plugin) { + const plugins = [...this.plugins].reverse(); + + for (const priority of PLUGIN_PRIORITIES_RESPONSE) { + for (const plugin of plugins.filter( + isPluginFor(endpoint, priority, "response") + )) { pluginResponse = pluginResponse.then( - plugin?.response - ? (res) => plugin.response!(api, config, res) + Boolean(plugin.plugin.response) + ? (res) => plugin.plugin.response(endpoint, config, res) : undefined, - plugin?.error ? (err) => plugin.error!(api, config, err) : undefined + Boolean(plugin.plugin.error) + ? (err) => { + console.log("plugin error", err); + return plugin.plugin.error(endpoint, config, err); + } + : undefined ); } } return pluginResponse; } - - /** - * Get the number of plugins registered - * @returns the number of plugins registered - */ - count() { - return this.plugins.reduce( - (count, plugin) => (plugin ? count + 1 : count), - 0 - ); - } } diff --git a/packages/core/src/plugins/zodios-plugins.types.ts b/packages/core/src/plugins/zodios-plugins.types.ts new file mode 100644 index 00000000..2b897e7c --- /dev/null +++ b/packages/core/src/plugins/zodios-plugins.types.ts @@ -0,0 +1,46 @@ +import { AnyZodiosFetcherProvider } from "../fetcher-providers"; +import { ZodiosPlugin } from "../zodios.types"; + +export type PluginId = number; + +export const PluginPriorities = { + low: "low", + normal: "normal", + high: "high", +} as const; + +export const PLUGIN_PRIORITIES_REQUEST = [ + PluginPriorities.high, + PluginPriorities.normal, + PluginPriorities.low, +] as const; + +export const PLUGIN_PRIORITIES_RESPONSE = [ + PluginPriorities.low, + PluginPriorities.normal, + PluginPriorities.high, +] as const; + +export type PluginPriority = keyof typeof PluginPriorities; + +export type ZodiosPluginFilters = { + method?: string | RegExp | ((method: string) => boolean); + path?: string | RegExp | ((path: string) => boolean); + alias?: string | RegExp | ((alias: string) => boolean); +}; + +export type ZodiosPluginRegistration< + FetcherProvider extends AnyZodiosFetcherProvider +> = { + priority: PluginPriority; + filter: ZodiosPluginFilters; + plugin?: ZodiosPlugin; +}; + +export type RequiredZodiosPluginRegistration< + FetcherProvider extends AnyZodiosFetcherProvider +> = { + priority: PluginPriority; + filter: ZodiosPluginFilters; + plugin: Required>; +}; diff --git a/packages/core/src/zodios.test.ts b/packages/core/src/zodios.test.ts index 91dd0c92..ff1c49ac 100644 --- a/packages/core/src/zodios.test.ts +++ b/packages/core/src/zodios.test.ts @@ -69,9 +69,13 @@ const mockFetchFactory: ZodiosFetcherFactory = (options) => ({ }; for (const [{ method, url }, callback] of registeredMocks) { if (method === requestConfig.method && url === requestConfig.url) { - const result = (await callback( - requestConfig - )) as Required; + const result = { + status: 200, + statusText: "OK", + headers: {}, + data: {}, + ...(await callback(requestConfig)), + } as Required; if ( (config.validateStatus && !config.validateStatus(result.status)) || result.status > 299 @@ -193,6 +197,9 @@ describe("Zodios", () => { id: conf.params!.id, name: "test", }, + headers: { + "content-type": "application/json", + }, })); zodiosMocks.mockRequest("get", "/path/:uuid", async (config) => ({ data: { @@ -349,8 +356,10 @@ describe("Zodios", () => { it("should register have validation plugin automatically installed", () => { const zodios = new ZodiosCore(`http://localhost`, []); - // @ts-expect-error - expect(zodios.endpointPlugins.get("any-any").count()).toBe(1); + expect( + // @ts-expect-error + zodios.plugins.plugins.filter((plugin) => plugin.plugin).length + ).toBe(1); }); it("should register a plugin", () => { @@ -358,8 +367,10 @@ describe("Zodios", () => { zodios.use({ request: async (_, config) => config, }); - // @ts-expect-error - expect(zodios.endpointPlugins.get("any-any").count()).toBe(2); + expect( + // @ts-expect-error + zodios.plugins.plugins.filter((plugin) => plugin.plugin).length + ).toBe(2); }); it("should unregister a plugin", () => { @@ -367,36 +378,15 @@ describe("Zodios", () => { const id = zodios.use({ request: async (_, config) => config, }); - // @ts-expect-error - expect(zodios.endpointPlugins.get("any-any").count()).toBe(2); + expect( + // @ts-expect-error + zodios.plugins.plugins.filter((plugin) => plugin.plugin).length + ).toBe(2); zodios.eject(id); - // @ts-expect-error - expect(zodios.endpointPlugins.get("any-any").count()).toBe(1); - }); - - it("should replace a named plugin", () => { - const zodios = new ZodiosCore(`http://localhost`, []); - const plugin: ZodiosPlugin = { - name: "test", - request: async (_, config) => config, - }; - zodios.use(plugin); - zodios.use(plugin); - zodios.use(plugin); - // @ts-expect-error - expect(zodios.endpointPlugins.get("any-any").count()).toBe(2); - }); - - it("should unregister a named plugin", () => { - const zodios = new ZodiosCore(`http://localhost`, []); - const plugin: ZodiosPlugin = { - name: "test", - request: async (_, config) => config, - }; - zodios.use(plugin); - zodios.eject("test"); - // @ts-expect-error - expect(zodios.endpointPlugins.get("any-any").count()).toBe(1); + expect( + // @ts-expect-error + zodios.plugins.plugins.filter((plugin) => plugin.plugin).length + ).toBe(1); }); it("should throw if invalide parameters when registering a plugin", () => { @@ -405,49 +395,6 @@ describe("Zodios", () => { expect(() => zodios.use(0)).toThrowError("Zodios: invalid plugin"); }); - it("should throw if invalid alias when registering a plugin", () => { - const zodios = new ZodiosCore(`http://localhost`, [ - { - method: "get", - path: "/:id", - alias: "test", - response: z.object({ - id: z.number(), - name: z.string(), - }), - }, - ]); - expect(() => - // @ts-expect-error - zodios.use("tests", { - // @ts-expect-error - request: async (_, config) => config, - }) - ).toThrowError("Zodios: no alias 'tests' found to register plugin"); - }); - - it("should throw if invalid endpoint when registering a plugin", () => { - const zodios = new ZodiosCore(`http://localhost`, [ - { - method: "get", - path: "/:id", - response: z.object({ - id: z.number(), - name: z.string(), - }), - }, - ]); - expect(() => - // @ts-expect-error - zodios.use("get", "/test/:id", { - // @ts-expect-error - request: async (_, config) => config, - }) - ).toThrowError( - "Zodios: no endpoint 'get /test/:id' found to register plugin" - ); - }); - it("should register a plugin by endpoint", () => { const zodios = new ZodiosCore(`http://localhost`, [ { @@ -462,8 +409,10 @@ describe("Zodios", () => { zodios.use("get", "/:id", { request: async (_, config) => config, }); - // @ts-expect-error - expect(zodios.endpointPlugins.get("get-/:id").count()).toBe(1); + expect( + // @ts-expect-error + zodios.plugins.plugins.filter((plugin) => plugin.plugin).length + ).toBe(2); }); it("should register a plugin by alias", () => { @@ -481,8 +430,10 @@ describe("Zodios", () => { zodios.use("test", { request: async (_, config) => config, }); - // @ts-expect-error - expect(zodios.endpointPlugins.get("get-/:id").count()).toBe(1); + expect( + // @ts-expect-error + zodios.plugins.plugins.filter((plugin) => plugin.plugin).length + ).toBe(2); }); it("should make an http request", async () => { @@ -1099,41 +1050,24 @@ describe("Zodios", () => { ], { fetcherFactory: mockFetchFactory } ); + let error: Error | undefined = undefined; try { await zodios.get("/:id", { params: { id: 1 } }); } catch (e) { - expect(e).toBeInstanceOf(ZodiosError); - expect((e as ZodiosError).cause).toBeInstanceOf(ZodError); - expect((e as ZodiosError).message) - .toBe(`Zodios: Invalid response from endpoint 'get /:id' -status: 200 OK -cause: -[ - { - "code": "invalid_type", - "expected": "string", - "received": "undefined", - "path": [ - "more" - ], - "message": "Required" - } -] -received: -{ - "id": 1, - "name": "test" -}`); - expect((e as ZodiosError).data).toEqual({ - id: 1, - name: "test", - }); - expect((e as ZodiosError).config).toEqual({ - method: "get", - url: "/:id", - params: { id: 1 }, - }); + error = e as Error; } + expect(error).toBeInstanceOf(ZodiosError); + expect((error as ZodiosError).cause).toBeInstanceOf(ZodError); + expect((error as ZodiosError).message).toMatchSnapshot(); + expect((error as ZodiosError).data).toEqual({ + id: 1, + name: "test", + }); + expect((error as ZodiosError).config).toEqual({ + method: "get", + url: "/:id", + params: { id: 1 }, + }); }); it("should match Expected error", async () => { diff --git a/packages/core/src/zodios.ts b/packages/core/src/zodios.ts index c17ba22e..a6dcac56 100644 --- a/packages/core/src/zodios.ts +++ b/packages/core/src/zodios.ts @@ -16,9 +16,8 @@ import type { } from "./zodios.types"; import { HTTP_METHODS } from "./zodios.types"; import { - PluginId, ZodiosPlugins, - zodValidationPlugin, + schemaValidationPlugin, formDataPlugin, formURLPlugin, headerPlugin, @@ -37,8 +36,18 @@ import { TypeOfFetcherOptions, ZodiosFetcher, } from "./fetcher-providers"; -import { findEndpointErrorsByAlias, findEndpointErrorsByPath } from "./utils"; +import { + findEndpoint, + findEndpointErrorsByAlias, + findEndpointErrorsByPath, +} from "./utils"; import { hooks } from "./hooks"; +import { + PluginPriority, + ZodiosPluginFilters, + PluginId, + PluginPriorities, +} from "./plugins/zodios-plugins.types"; export interface ZodiosBase< Api extends ZodiosEndpointDefinitions, @@ -67,8 +76,7 @@ export class ZodiosCoreImpl< public readonly fetcher: ZodiosFetcher | undefined; public readonly _typeProvider: TypeProvider; public readonly _fetcherProvider: FetcherProvider; - private endpointPlugins: Map> = - new Map(); + private plugins = new ZodiosPlugins(); /** * constructor @@ -158,7 +166,7 @@ export class ZodiosCoreImpl< this.injectHttpVerbEndpoints(); this.initPlugins(); if ([true, "all", "request", "response"].includes(this.options.validate)) { - this.use(zodValidationPlugin(this.options)); + this.use(schemaValidationPlugin(this.options), PluginPriorities.high); } } @@ -167,16 +175,15 @@ export class ZodiosCoreImpl< } private initPlugins() { - this.endpointPlugins.set("any-any", new ZodiosPlugins("any", "any")); - this.api.forEach((endpoint) => { - const plugins = new ZodiosPlugins( - endpoint.method, - endpoint.path - ); switch (endpoint.requestFormat) { case "binary": - plugins.use( + this.plugins.use( + { + method: endpoint.method, + path: endpoint.path, + alias: endpoint.alias, + }, headerPlugin( "Content-Type", "application/octet-stream" @@ -184,75 +191,103 @@ export class ZodiosCoreImpl< ); break; case "form-data": - plugins.use(formDataPlugin()); + this.plugins.use( + { + method: endpoint.method, + path: endpoint.path, + alias: endpoint.alias, + }, + formDataPlugin() + ); break; case "form-url": - plugins.use(formURLPlugin()); + this.plugins.use( + { + method: endpoint.method, + path: endpoint.path, + alias: endpoint.alias, + }, + formURLPlugin() + ); break; case "text": - plugins.use( + this.plugins.use( + { + method: endpoint.method, + path: endpoint.path, + alias: endpoint.alias, + }, headerPlugin("Content-Type", "text/plain") ); break; } - this.endpointPlugins.set(`${endpoint.method}-${endpoint.path}`, plugins); }); } - private getAnyEndpointPlugins() { - return this.endpointPlugins.get("any-any"); - } - - private findAliasEndpointPlugins(alias: string) { - const endpoint = this.api.find((endpoint) => endpoint.alias === alias); - if (endpoint) { - return this.endpointPlugins.get(`${endpoint.method}-${endpoint.path}`); - } - return undefined; - } - - private findEnpointPlugins(method: Method, path: string) { - return this.endpointPlugins.get(`${method}-${path}`); - } - /** * register a plugin to intercept the requests or responses * @param plugin - the plugin to use * @returns an id to allow you to unregister the plugin */ - use(plugin: ZodiosPlugin): PluginId; + use( + plugin: ZodiosPlugin, + priority?: PluginPriority + ): PluginId; use>( alias: Alias, - plugin: ZodiosPlugin + plugin: ZodiosPlugin, + priority?: PluginPriority ): PluginId; use>( method: M, path: Path, - plugin: ZodiosPlugin + plugin: ZodiosPlugin, + priority?: PluginPriority + ): PluginId; + use( + filter: ZodiosPluginFilters, + plugin: ZodiosPlugin, + priority?: PluginPriority ): PluginId; - use(...args: unknown[]) { - if (typeof args[0] === "object") { - const plugins = this.getAnyEndpointPlugins()!; - return plugins.use(args[0] as ZodiosPlugin); - } else if (typeof args[0] === "string" && typeof args[1] === "object") { - const plugins = this.findAliasEndpointPlugins(args[0]); - if (!plugins) - throw new Error( - `Zodios: no alias '${args[0]}' found to register plugin` + use( + arg0: ZodiosPlugin | ZodiosPluginFilters | string, + arg1?: ZodiosPlugin | string, + arg2?: ZodiosPlugin | PluginPriority, + arg3?: PluginPriority + ) { + if (typeof arg0 === "object") { + if ("method" in arg0 || "path" in arg0 || "alias" in arg0) { + return this.plugins.use( + arg0, + arg1 as ZodiosPlugin, + arg2 as PluginPriority ); - return plugins.use(args[1] as ZodiosPlugin); - } else if ( - typeof args[0] === "string" && - typeof args[1] === "string" && - typeof args[2] === "object" + } + return this.plugins.use( + {}, + arg0 as ZodiosPlugin, + arg1 as PluginPriority + ); + } + if (typeof arg0 === "string" && typeof arg1 === "object") { + return this.plugins.use( + { alias: arg0 }, + arg1 as ZodiosPlugin, + arg2 as PluginPriority + ); + } + if ( + typeof arg0 === "string" && + typeof arg1 === "string" && + typeof arg2 === "object" ) { - const plugins = this.findEnpointPlugins(args[0] as Method, args[1]); - if (!plugins) - throw new Error( - `Zodios: no endpoint '${args[0]} ${args[1]}' found to register plugin` - ); - return plugins.use(args[2] as ZodiosPlugin); + return this.plugins.use( + { method: arg0, path: arg1 }, + arg2 as ZodiosPlugin, + arg3 as PluginPriority + ); } + throw new Error("Zodios: invalid plugin registration"); } @@ -262,13 +297,8 @@ export class ZodiosCoreImpl< * it will unregister the plugin with that name only for non endpoint plugins * @param plugin - id of the plugin to remove */ - eject(plugin: PluginId | string): void { - if (typeof plugin === "string") { - const plugins = this.getAnyEndpointPlugins()!; - plugins.eject(plugin); - return; - } - this.endpointPlugins.get(plugin.key)?.eject(plugin); + eject(plugin: PluginId): void { + this.plugins.eject(plugin); } private injectAliasEndpoints() { @@ -334,12 +364,13 @@ export class ZodiosCoreImpl< let conf = config as unknown as ReadonlyDeep< AnyZodiosRequestOptions >; - const anyPlugin = this.getAnyEndpointPlugins()!; - const endpointPlugin = this.findEnpointPlugins(conf.method, conf.url); - conf = await anyPlugin.interceptRequest(this.api, conf); - if (endpointPlugin) { - conf = await endpointPlugin.interceptRequest(this.api, conf); + const endpoint = findEndpoint(this.api, conf.method, conf.url); + if (!endpoint) { + throw new Error( + `Zodios: no endpoint found for ${conf.method} ${conf.url}` + ); } + conf = await this.plugins.interceptRequest(endpoint, conf); let response: Promise; if (hooks.fetcher) { response = hooks.fetcher.fetch(conf); @@ -348,10 +379,7 @@ export class ZodiosCoreImpl< } else { throw new Error("Zodios: no fetcher provider found"); } - if (endpointPlugin) { - response = endpointPlugin.interceptResponse(this.api, conf, response); - } - response = anyPlugin.interceptResponse(this.api, conf, response); + response = this.plugins.interceptResponse(endpoint, conf, response); return (await response).data; } diff --git a/packages/core/src/zodios.types.ts b/packages/core/src/zodios.types.ts index 59d46934..4da462ce 100644 --- a/packages/core/src/zodios.types.ts +++ b/packages/core/src/zodios.types.ts @@ -875,7 +875,7 @@ export interface ZodiosPlugin< * @returns possibly a new request config */ request?: ( - api: ZodiosEndpointDefinitions, + endpoint: ZodiosEndpointDefinition, config: ReadonlyDeep> ) => Promise>>; /** @@ -886,7 +886,7 @@ export interface ZodiosPlugin< * @returns possibly a new response */ response?: ( - api: ZodiosEndpointDefinitions, + endpoint: ZodiosEndpointDefinition, config: ReadonlyDeep>, response: TypeOfFetcherResponse ) => Promise>; @@ -899,7 +899,7 @@ export interface ZodiosPlugin< * @returns possibly a new response or a new error */ error?: ( - api: ZodiosEndpointDefinitions, + endpoint: ZodiosEndpointDefinition, config: ReadonlyDeep>, error: Error ) => Promise>; From e5977622b016334a731bcfb0871b62e8666c0962 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Tue, 31 Jan 2023 14:18:25 +0100 Subject: [PATCH 113/206] RELEASING: Releasing 5 package(s) Releases: @zodios/axios@11.0.0-beta.17 @zodios/core@11.0.0-beta.17 @zodios/fetch@11.0.0-beta.17 @zodios/react@11.0.0-beta.17 @zodios/testing@11.0.0-beta.17 [skip ci] --- packages/axios/CHANGELOG.md | 13 +++++++++++++ packages/axios/package.json | 4 ++-- packages/core/CHANGELOG.md | 7 +++++++ packages/core/package.json | 2 +- packages/fetch/CHANGELOG.md | 13 +++++++++++++ packages/fetch/package.json | 4 ++-- packages/react/CHANGELOG.md | 15 +++++++++++++++ packages/react/package.json | 8 ++++---- packages/testing/CHANGELOG.md | 13 +++++++++++++ packages/testing/package.json | 4 ++-- 10 files changed, 72 insertions(+), 11 deletions(-) diff --git a/packages/axios/CHANGELOG.md b/packages/axios/CHANGELOG.md index 18958f82..647206c3 100644 --- a/packages/axios/CHANGELOG.md +++ b/packages/axios/CHANGELOG.md @@ -1,5 +1,18 @@ # @zodios/core +## 11.0.0-beta.17 + +### Major Changes + +- 48a20cc: fix(react): do not double fetch if react-query signal is not used +- 8303e57: feat(plugin): add new zodios plugin system + +### Patch Changes + +- Updated dependencies [48a20cc] +- Updated dependencies [8303e57] + - @zodios/core@11.0.0-beta.17 + ## 11.0.0-beta.16 ### Major Changes diff --git a/packages/axios/package.json b/packages/axios/package.json index 73a32d19..b80c76eb 100644 --- a/packages/axios/package.json +++ b/packages/axios/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/axios", "description": "Typescript API client with axios", - "version": "11.0.0-beta.16", + "version": "11.0.0-beta.17", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", @@ -41,7 +41,7 @@ "test": "jest --coverage" }, "peerDependencies": { - "@zodios/core": "11.0.0-beta.16", + "@zodios/core": "11.0.0-beta.17", "axios": "^0.x || ^1.0.0", "fp-ts": "2.x", "io-ts": "2.x", diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 3d662fd1..22fdb8a0 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,12 @@ # @zodios/core +## 11.0.0-beta.17 + +### Major Changes + +- 48a20cc: fix(react): do not double fetch if react-query signal is not used +- 8303e57: feat(plugin): add new zodios plugin system + ## 11.0.0-beta.16 ### Major Changes diff --git a/packages/core/package.json b/packages/core/package.json index 0f239ae8..a8bedcc0 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/core", "description": "Typescript API client with autocompletion and zod validations", - "version": "11.0.0-beta.16", + "version": "11.0.0-beta.17", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", diff --git a/packages/fetch/CHANGELOG.md b/packages/fetch/CHANGELOG.md index 18958f82..647206c3 100644 --- a/packages/fetch/CHANGELOG.md +++ b/packages/fetch/CHANGELOG.md @@ -1,5 +1,18 @@ # @zodios/core +## 11.0.0-beta.17 + +### Major Changes + +- 48a20cc: fix(react): do not double fetch if react-query signal is not used +- 8303e57: feat(plugin): add new zodios plugin system + +### Patch Changes + +- Updated dependencies [48a20cc] +- Updated dependencies [8303e57] + - @zodios/core@11.0.0-beta.17 + ## 11.0.0-beta.16 ### Major Changes diff --git a/packages/fetch/package.json b/packages/fetch/package.json index 47d37892..a5dcc6a4 100644 --- a/packages/fetch/package.json +++ b/packages/fetch/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/fetch", "description": "Typescript API client with fetch", - "version": "11.0.0-beta.16", + "version": "11.0.0-beta.17", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", @@ -41,7 +41,7 @@ "test": "NODE_OPTIONS=--experimental-abortcontroller jest --coverage" }, "peerDependencies": { - "@zodios/core": "11.0.0-beta.16", + "@zodios/core": "11.0.0-beta.17", "fp-ts": "2.x", "io-ts": "2.x", "zod": "^3.x" diff --git a/packages/react/CHANGELOG.md b/packages/react/CHANGELOG.md index 4a213a7f..481ca1a3 100644 --- a/packages/react/CHANGELOG.md +++ b/packages/react/CHANGELOG.md @@ -1,5 +1,20 @@ # @zodios/react +## 11.0.0-beta.17 + +### Major Changes + +- 48a20cc: fix(react): do not double fetch if react-query signal is not used +- 8303e57: feat(plugin): add new zodios plugin system + +### Patch Changes + +- Updated dependencies [48a20cc] +- Updated dependencies [8303e57] + - @zodios/axios@11.0.0-beta.17 + - @zodios/core@11.0.0-beta.17 + - @zodios/fetch@11.0.0-beta.17 + ## 11.0.0-beta.16 ### Major Changes diff --git a/packages/react/package.json b/packages/react/package.json index e5b4e4f6..8117cc97 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/react", "description": "React hooks for zodios", - "version": "11.0.0-beta.16", + "version": "11.0.0-beta.17", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", @@ -40,9 +40,9 @@ }, "peerDependencies": { "@tanstack/react-query": "4.x", - "@zodios/core": "11.0.0-beta.16", - "@zodios/axios": "11.0.0-beta.16", - "@zodios/fetch": "11.0.0-beta.16", + "@zodios/core": "11.0.0-beta.17", + "@zodios/axios": "11.0.0-beta.17", + "@zodios/fetch": "11.0.0-beta.17", "react": ">=16.8.0" }, "peerDependenciesMeta": { diff --git a/packages/testing/CHANGELOG.md b/packages/testing/CHANGELOG.md index f5a9c3d6..e17b9fb9 100644 --- a/packages/testing/CHANGELOG.md +++ b/packages/testing/CHANGELOG.md @@ -1,5 +1,18 @@ # @zodios/core +## 11.0.0-beta.17 + +### Major Changes + +- 48a20cc: fix(react): do not double fetch if react-query signal is not used +- 8303e57: feat(plugin): add new zodios plugin system + +### Patch Changes + +- Updated dependencies [48a20cc] +- Updated dependencies [8303e57] + - @zodios/core@11.0.0-beta.17 + ## 11.0.0-beta.16 ### Major Changes diff --git a/packages/testing/package.json b/packages/testing/package.json index 1a523192..36cc6325 100644 --- a/packages/testing/package.json +++ b/packages/testing/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/testing", "description": "Zodios mock library", - "version": "11.0.0-beta.16", + "version": "11.0.0-beta.17", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", @@ -37,7 +37,7 @@ "test": "jest --coverage" }, "peerDependencies": { - "@zodios/core": "11.0.0-beta.16" + "@zodios/core": "11.0.0-beta.17" }, "devDependencies": { "@jest/globals": "29.3.1", From f5aeb47fb60c378867b746ffc50e9274cad79b43 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Tue, 31 Jan 2023 19:15:26 +0100 Subject: [PATCH 114/206] test(plugin): fix plugin tests --- .changeset/pre.json | 2 + packages/axios/src/zodios.test.ts | 138 ------------------------------ packages/fetch/src/zodios.test.ts | 138 ------------------------------ 3 files changed, 2 insertions(+), 276 deletions(-) diff --git a/.changeset/pre.json b/.changeset/pre.json index 2babde43..7e3c7ec9 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -16,6 +16,7 @@ "five-apricots-breathe", "gentle-ligers-mix", "good-tigers-tie", + "gorgeous-dolls-fry", "long-fans-dress", "lucky-brooms-fry", "nervous-kings-bow", @@ -23,6 +24,7 @@ "nice-wombats-boil", "polite-bugs-confess", "polite-points-float", + "quiet-rockets-dream", "rare-zoos-serve", "rich-pigs-thank", "short-hounds-mix", diff --git a/packages/axios/src/zodios.test.ts b/packages/axios/src/zodios.test.ts index 903fb014..50f785f4 100644 --- a/packages/axios/src/zodios.test.ts +++ b/packages/axios/src/zodios.test.ts @@ -165,144 +165,6 @@ describe("Zodios", () => { expect(zodios).toBeDefined(); }); - it("should register have validation plugin automatically installed", () => { - const zodios = new Zodios(`http://localhost:${port}`, []); - // @ts-ignore - expect(zodios.endpointPlugins.get("any-any").count()).toBe(1); - }); - - it("should register a plugin", () => { - const zodios = new Zodios(`http://localhost:${port}`, []); - zodios.use({ - request: async (_, config) => config, - }); - // @ts-ignore - expect(zodios.endpointPlugins.get("any-any").count()).toBe(2); - }); - - it("should unregister a plugin", () => { - const zodios = new Zodios(`http://localhost:${port}`, []); - const id = zodios.use({ - request: async (_, config) => config, - }); - // @ts-ignore - expect(zodios.endpointPlugins.get("any-any").count()).toBe(2); - zodios.eject(id); - // @ts-ignore - expect(zodios.endpointPlugins.get("any-any").count()).toBe(1); - }); - - it("should replace a named plugin", () => { - const zodios = new Zodios(`http://localhost:${port}`, []); - const plugin: ZodiosPlugin = { - name: "test", - request: async (_, config) => config, - }; - zodios.use(plugin); - zodios.use(plugin); - zodios.use(plugin); - // @ts-ignore - expect(zodios.endpointPlugins.get("any-any").count()).toBe(2); - }); - - it("should unregister a named plugin", () => { - const zodios = new Zodios(`http://localhost:${port}`, []); - const plugin: ZodiosPlugin = { - name: "test", - request: async (_, config) => config, - }; - zodios.use(plugin); - zodios.eject("test"); - // @ts-ignore - expect(zodios.endpointPlugins.get("any-any").count()).toBe(1); - }); - - it("should throw if invalide parameters when registering a plugin", () => { - const zodios = new Zodios(`http://localhost:${port}`, []); - // @ts-ignore - expect(() => zodios.use(0)).toThrowError("Zodios: invalid plugin"); - }); - - it("should throw if invalid alias when registering a plugin", () => { - const zodios = new Zodios(`http://localhost:${port}`, [ - { - method: "get", - path: "/:id", - alias: "test", - response: z.object({ - id: z.number(), - name: z.string(), - }), - }, - ]); - expect(() => - // @ts-ignore - zodios.use("tests", { - // @ts-ignore - request: async (_, config) => config, - }) - ).toThrowError("Zodios: no alias 'tests' found to register plugin"); - }); - - it("should throw if invalid endpoint when registering a plugin", () => { - const zodios = new Zodios(`http://localhost:${port}`, [ - { - method: "get", - path: "/:id", - response: z.object({ - id: z.number(), - name: z.string(), - }), - }, - ]); - expect(() => - // @ts-ignore - zodios.use("get", "/test/:id", { - // @ts-ignore - request: async (_, config) => config, - }) - ).toThrowError( - "Zodios: no endpoint 'get /test/:id' found to register plugin" - ); - }); - - it("should register a plugin by endpoint", () => { - const zodios = new Zodios(`http://localhost:${port}`, [ - { - method: "get", - path: "/:id", - response: z.object({ - id: z.number(), - name: z.string(), - }), - }, - ]); - zodios.use("get", "/:id", { - request: async (_, config) => config, - }); - // @ts-ignore - expect(zodios.endpointPlugins.get("get-/:id").count()).toBe(1); - }); - - it("should register a plugin by alias", () => { - const zodios = new Zodios(`http://localhost:${port}`, [ - { - method: "get", - path: "/:id", - alias: "test", - response: z.object({ - id: z.number(), - name: z.string(), - }), - }, - ]); - zodios.use("test", { - request: async (_, config) => config, - }); - // @ts-ignore - expect(zodios.endpointPlugins.get("get-/:id").count()).toBe(1); - }); - it("should make an http request", async () => { const zodios = new Zodios(`http://localhost:${port}`, [ { diff --git a/packages/fetch/src/zodios.test.ts b/packages/fetch/src/zodios.test.ts index 5d8ada45..407d94d0 100644 --- a/packages/fetch/src/zodios.test.ts +++ b/packages/fetch/src/zodios.test.ts @@ -168,144 +168,6 @@ describe("Zodios", () => { expect(zodios).toBeDefined(); }); - it("should register have validation plugin automatically installed", () => { - const zodios = new Zodios(`http://localhost:${port}`, []); - // @ts-ignore - expect(zodios.endpointPlugins.get("any-any").count()).toBe(1); - }); - - it("should register a plugin", () => { - const zodios = new Zodios(`http://localhost:${port}`, []); - zodios.use({ - request: async (_, config) => config, - }); - // @ts-ignore - expect(zodios.endpointPlugins.get("any-any").count()).toBe(2); - }); - - it("should unregister a plugin", () => { - const zodios = new Zodios(`http://localhost:${port}`, []); - const id = zodios.use({ - request: async (_, config) => config, - }); - // @ts-ignore - expect(zodios.endpointPlugins.get("any-any").count()).toBe(2); - zodios.eject(id); - // @ts-ignore - expect(zodios.endpointPlugins.get("any-any").count()).toBe(1); - }); - - it("should replace a named plugin", () => { - const zodios = new Zodios(`http://localhost:${port}`, []); - const plugin: ZodiosPlugin = { - name: "test", - request: async (_, config) => config, - }; - zodios.use(plugin); - zodios.use(plugin); - zodios.use(plugin); - // @ts-ignore - expect(zodios.endpointPlugins.get("any-any").count()).toBe(2); - }); - - it("should unregister a named plugin", () => { - const zodios = new Zodios(`http://localhost:${port}`, []); - const plugin: ZodiosPlugin = { - name: "test", - request: async (_, config) => config, - }; - zodios.use(plugin); - zodios.eject("test"); - // @ts-ignore - expect(zodios.endpointPlugins.get("any-any").count()).toBe(1); - }); - - it("should throw if invalide parameters when registering a plugin", () => { - const zodios = new Zodios(`http://localhost:${port}`, []); - // @ts-ignore - expect(() => zodios.use(0)).toThrowError("Zodios: invalid plugin"); - }); - - it("should throw if invalid alias when registering a plugin", () => { - const zodios = new Zodios(`http://localhost:${port}`, [ - { - method: "get", - path: "/:id", - alias: "test", - response: z.object({ - id: z.number(), - name: z.string(), - }), - }, - ]); - expect(() => - // @ts-ignore - zodios.use("tests", { - // @ts-ignore - request: async (_, config) => config, - }) - ).toThrowError("Zodios: no alias 'tests' found to register plugin"); - }); - - it("should throw if invalid endpoint when registering a plugin", () => { - const zodios = new Zodios(`http://localhost:${port}`, [ - { - method: "get", - path: "/:id", - response: z.object({ - id: z.number(), - name: z.string(), - }), - }, - ]); - expect(() => - // @ts-ignore - zodios.use("get", "/test/:id", { - // @ts-ignore - request: async (_, config) => config, - }) - ).toThrowError( - "Zodios: no endpoint 'get /test/:id' found to register plugin" - ); - }); - - it("should register a plugin by endpoint", () => { - const zodios = new Zodios(`http://localhost:${port}`, [ - { - method: "get", - path: "/:id", - response: z.object({ - id: z.number(), - name: z.string(), - }), - }, - ]); - zodios.use("get", "/:id", { - request: async (_, config) => config, - }); - // @ts-ignore - expect(zodios.endpointPlugins.get("get-/:id").count()).toBe(1); - }); - - it("should register a plugin by alias", () => { - const zodios = new Zodios(`http://localhost:${port}`, [ - { - method: "get", - path: "/:id", - alias: "test", - response: z.object({ - id: z.number(), - name: z.string(), - }), - }, - ]); - zodios.use("test", { - request: async (_, config) => config, - }); - // @ts-ignore - expect(zodios.endpointPlugins.get("get-/:id").count()).toBe(1); - }); - it("should make an http request", async () => { const zodios = new Zodios(`http://localhost:${port}`, [ { From 0122529385f2a49e4a5c3f670b0f4c75ab7ba909 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Tue, 31 Jan 2023 23:59:51 +0100 Subject: [PATCH 115/206] chore(express): init express package --- examples/next-turbo/.eslintrc.js | 10 + examples/next-turbo/.gitignore | 33 + examples/next-turbo/README.md | 73 + examples/next-turbo/apps/docs/.eslintrc.js | 4 + examples/next-turbo/apps/docs/README.md | 30 + examples/next-turbo/apps/docs/next-env.d.ts | 5 + examples/next-turbo/apps/docs/next.config.js | 6 + examples/next-turbo/apps/docs/package.json | 27 + examples/next-turbo/apps/docs/pages/index.tsx | 10 + examples/next-turbo/apps/docs/tsconfig.json | 5 + examples/next-turbo/apps/web/.eslintrc.js | 4 + examples/next-turbo/apps/web/README.md | 30 + examples/next-turbo/apps/web/common/api.ts | 13 + examples/next-turbo/apps/web/next-env.d.ts | 5 + examples/next-turbo/apps/web/next.config.js | 6 + examples/next-turbo/apps/web/package.json | 35 + examples/next-turbo/apps/web/pages/_app.tsx | 14 + .../apps/web/pages/api/[...zodios].ts | 3 + examples/next-turbo/apps/web/pages/index.tsx | 23 + .../next-turbo/apps/web/server/context.ts | 11 + .../next-turbo/apps/web/server/routers/app.ts | 10 + examples/next-turbo/apps/web/tsconfig.json | 5 + examples/next-turbo/package.json | 25 + .../packages/eslint-config-custom/index.js | 7 + .../eslint-config-custom/package.json | 19 + .../next-turbo/packages/tsconfig/README.md | 3 + .../next-turbo/packages/tsconfig/base.json | 20 + .../next-turbo/packages/tsconfig/nextjs.json | 23 + .../next-turbo/packages/tsconfig/package.json | 10 + .../packages/tsconfig/react-library.json | 11 + examples/next-turbo/packages/ui/Button.tsx | 4 + examples/next-turbo/packages/ui/index.tsx | 2 + examples/next-turbo/packages/ui/package.json | 19 + examples/next-turbo/packages/ui/tsconfig.json | 5 + examples/next-turbo/pnpm-lock.yaml | 3019 +++++++++++++++++ examples/next-turbo/pnpm-workspace.yaml | 3 + examples/next-turbo/turbo.json | 15 + examples/next/.eslintrc.json | 3 + examples/next/.gitignore | 36 + examples/next/README.md | 34 + examples/next/client/api.ts | 6 + examples/next/common/api.ts | 55 + examples/next/next.config.js | 7 + examples/next/package.json | 32 + examples/next/pages/_app.tsx | 15 + examples/next/pages/api/[...zodios].ts | 3 + examples/next/pages/index.tsx | 62 + examples/next/public/favicon.ico | Bin 0 -> 25931 bytes examples/next/public/vercel.svg | 4 + examples/next/server/context.ts | 10 + examples/next/server/routers/app.ts | 5 + examples/next/server/routers/users.ts | 37 + examples/next/styles/Home.module.css | 129 + examples/next/styles/globals.css | 26 + examples/next/tsconfig.json | 20 + examples/next/yarn.lock | 2225 ++++++++++++ examples/server.ts | 41 + packages/core/src/zodios.types.ts | 1 + packages/express/LICENSE | 21 + packages/express/README.md | 214 ++ packages/express/jest.config.ts | 23 + packages/express/package.json | 64 + packages/express/renovate.json | 5 + packages/express/src/index.ts | 22 + packages/express/src/zodios-validator.ts | 136 + packages/express/src/zodios.spec.ts | 383 +++ packages/express/src/zodios.ts | 109 + packages/express/src/zodios.types.ts | 169 + packages/express/src/zodios.utils.spec.ts | 54 + packages/express/src/zodios.utils.ts | 58 + packages/express/tsconfig.build.json | 16 + packages/express/tsconfig.json | 16 + packages/express/tsup.config.js | 14 + packages/fetch/package.json | 2 - pnpm-lock.yaml | 1130 +++++- 75 files changed, 8633 insertions(+), 101 deletions(-) create mode 100644 examples/next-turbo/.eslintrc.js create mode 100644 examples/next-turbo/.gitignore create mode 100644 examples/next-turbo/README.md create mode 100644 examples/next-turbo/apps/docs/.eslintrc.js create mode 100644 examples/next-turbo/apps/docs/README.md create mode 100644 examples/next-turbo/apps/docs/next-env.d.ts create mode 100644 examples/next-turbo/apps/docs/next.config.js create mode 100644 examples/next-turbo/apps/docs/package.json create mode 100644 examples/next-turbo/apps/docs/pages/index.tsx create mode 100644 examples/next-turbo/apps/docs/tsconfig.json create mode 100644 examples/next-turbo/apps/web/.eslintrc.js create mode 100644 examples/next-turbo/apps/web/README.md create mode 100644 examples/next-turbo/apps/web/common/api.ts create mode 100644 examples/next-turbo/apps/web/next-env.d.ts create mode 100644 examples/next-turbo/apps/web/next.config.js create mode 100644 examples/next-turbo/apps/web/package.json create mode 100644 examples/next-turbo/apps/web/pages/_app.tsx create mode 100644 examples/next-turbo/apps/web/pages/api/[...zodios].ts create mode 100644 examples/next-turbo/apps/web/pages/index.tsx create mode 100644 examples/next-turbo/apps/web/server/context.ts create mode 100644 examples/next-turbo/apps/web/server/routers/app.ts create mode 100644 examples/next-turbo/apps/web/tsconfig.json create mode 100644 examples/next-turbo/package.json create mode 100644 examples/next-turbo/packages/eslint-config-custom/index.js create mode 100644 examples/next-turbo/packages/eslint-config-custom/package.json create mode 100644 examples/next-turbo/packages/tsconfig/README.md create mode 100644 examples/next-turbo/packages/tsconfig/base.json create mode 100644 examples/next-turbo/packages/tsconfig/nextjs.json create mode 100644 examples/next-turbo/packages/tsconfig/package.json create mode 100644 examples/next-turbo/packages/tsconfig/react-library.json create mode 100644 examples/next-turbo/packages/ui/Button.tsx create mode 100644 examples/next-turbo/packages/ui/index.tsx create mode 100644 examples/next-turbo/packages/ui/package.json create mode 100644 examples/next-turbo/packages/ui/tsconfig.json create mode 100644 examples/next-turbo/pnpm-lock.yaml create mode 100644 examples/next-turbo/pnpm-workspace.yaml create mode 100644 examples/next-turbo/turbo.json create mode 100644 examples/next/.eslintrc.json create mode 100644 examples/next/.gitignore create mode 100644 examples/next/README.md create mode 100644 examples/next/client/api.ts create mode 100644 examples/next/common/api.ts create mode 100644 examples/next/next.config.js create mode 100644 examples/next/package.json create mode 100644 examples/next/pages/_app.tsx create mode 100644 examples/next/pages/api/[...zodios].ts create mode 100644 examples/next/pages/index.tsx create mode 100644 examples/next/public/favicon.ico create mode 100644 examples/next/public/vercel.svg create mode 100644 examples/next/server/context.ts create mode 100644 examples/next/server/routers/app.ts create mode 100644 examples/next/server/routers/users.ts create mode 100644 examples/next/styles/Home.module.css create mode 100644 examples/next/styles/globals.css create mode 100644 examples/next/tsconfig.json create mode 100644 examples/next/yarn.lock create mode 100644 examples/server.ts create mode 100644 packages/express/LICENSE create mode 100644 packages/express/README.md create mode 100644 packages/express/jest.config.ts create mode 100644 packages/express/package.json create mode 100644 packages/express/renovate.json create mode 100644 packages/express/src/index.ts create mode 100644 packages/express/src/zodios-validator.ts create mode 100644 packages/express/src/zodios.spec.ts create mode 100644 packages/express/src/zodios.ts create mode 100644 packages/express/src/zodios.types.ts create mode 100644 packages/express/src/zodios.utils.spec.ts create mode 100644 packages/express/src/zodios.utils.ts create mode 100644 packages/express/tsconfig.build.json create mode 100644 packages/express/tsconfig.json create mode 100644 packages/express/tsup.config.js diff --git a/examples/next-turbo/.eslintrc.js b/examples/next-turbo/.eslintrc.js new file mode 100644 index 00000000..5b999efa --- /dev/null +++ b/examples/next-turbo/.eslintrc.js @@ -0,0 +1,10 @@ +module.exports = { + root: true, + // This tells ESLint to load the config from the package `eslint-config-custom` + extends: ["custom"], + settings: { + next: { + rootDir: ["apps/*/"], + }, + }, +}; diff --git a/examples/next-turbo/.gitignore b/examples/next-turbo/.gitignore new file mode 100644 index 00000000..849425fe --- /dev/null +++ b/examples/next-turbo/.gitignore @@ -0,0 +1,33 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +node_modules +.pnp +.pnp.js + +# testing +coverage + +# next.js +.next/ +out/ +build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* +.pnpm-debug.log* + +# local env files +.env.local +.env.development.local +.env.test.local +.env.production.local + +# turbo +.turbo diff --git a/examples/next-turbo/README.md b/examples/next-turbo/README.md new file mode 100644 index 00000000..760edf2b --- /dev/null +++ b/examples/next-turbo/README.md @@ -0,0 +1,73 @@ +# Turborepo starter + +This is an official pnpm starter turborepo. + +## What's inside? + +This turborepo uses [pnpm](https://pnpm.io) as a package manager. It includes the following packages/apps: + +### Apps and Packages + +- `docs`: a [Next.js](https://nextjs.org) app +- `web`: another [Next.js](https://nextjs.org) app +- `ui`: a stub React component library shared by both `web` and `docs` applications +- `eslint-config-custom`: `eslint` configurations (includes `eslint-config-next` and `eslint-config-prettier`) +- `tsconfig`: `tsconfig.json`s used throughout the monorepo + +Each package/app is 100% [TypeScript](https://www.typescriptlang.org/). + +### Utilities + +This turborepo has some additional tools already setup for you: + +- [TypeScript](https://www.typescriptlang.org/) for static type checking +- [ESLint](https://eslint.org/) for code linting +- [Prettier](https://prettier.io) for code formatting + +### Build + +To build all apps and packages, run the following command: + +``` +cd my-turborepo +pnpm run build +``` + +### Develop + +To develop all apps and packages, run the following command: + +``` +cd my-turborepo +pnpm run dev +``` + +### Remote Caching + +Turborepo can use a technique known as [Remote Caching](https://turborepo.org/docs/core-concepts/remote-caching) to share cache artifacts across machines, enabling you to share build caches with your team and CI/CD pipelines. + +By default, Turborepo will cache locally. To enable Remote Caching you will need an account with Vercel. If you don't have an account you can [create one](https://vercel.com/signup), then enter the following commands: + +``` +cd my-turborepo +pnpm dlx turbo login +``` + +This will authenticate the Turborepo CLI with your [Vercel account](https://vercel.com/docs/concepts/personal-accounts/overview). + +Next, you can link your Turborepo to your Remote Cache by running the following command from the root of your turborepo: + +``` +pnpm dlx turbo link +``` + +## Useful Links + +Learn more about the power of Turborepo: + +- [Pipelines](https://turborepo.org/docs/core-concepts/pipelines) +- [Caching](https://turborepo.org/docs/core-concepts/caching) +- [Remote Caching](https://turborepo.org/docs/core-concepts/remote-caching) +- [Scoped Tasks](https://turborepo.org/docs/core-concepts/scopes) +- [Configuration Options](https://turborepo.org/docs/reference/configuration) +- [CLI Usage](https://turborepo.org/docs/reference/command-line-reference) diff --git a/examples/next-turbo/apps/docs/.eslintrc.js b/examples/next-turbo/apps/docs/.eslintrc.js new file mode 100644 index 00000000..c8df6075 --- /dev/null +++ b/examples/next-turbo/apps/docs/.eslintrc.js @@ -0,0 +1,4 @@ +module.exports = { + root: true, + extends: ["custom"], +}; diff --git a/examples/next-turbo/apps/docs/README.md b/examples/next-turbo/apps/docs/README.md new file mode 100644 index 00000000..1d67ece7 --- /dev/null +++ b/examples/next-turbo/apps/docs/README.md @@ -0,0 +1,30 @@ +## Getting Started + +First, run the development server: + +```bash +yarn dev +``` + +Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. + +You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file. + +[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.js`. + +The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages. + +## Learn More + +To learn more about Next.js, take a look at the following resources: + +- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. +- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. + +You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! + +## Deploy on Vercel + +The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_source=github.com&utm_medium=referral&utm_campaign=turborepo-readme) from the creators of Next.js. + +Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. diff --git a/examples/next-turbo/apps/docs/next-env.d.ts b/examples/next-turbo/apps/docs/next-env.d.ts new file mode 100644 index 00000000..4f11a03d --- /dev/null +++ b/examples/next-turbo/apps/docs/next-env.d.ts @@ -0,0 +1,5 @@ +/// +/// + +// NOTE: This file should not be edited +// see https://nextjs.org/docs/basic-features/typescript for more information. diff --git a/examples/next-turbo/apps/docs/next.config.js b/examples/next-turbo/apps/docs/next.config.js new file mode 100644 index 00000000..5e578c4f --- /dev/null +++ b/examples/next-turbo/apps/docs/next.config.js @@ -0,0 +1,6 @@ +module.exports = { + reactStrictMode: true, + experimental: { + transpilePackages: ["ui"], + }, +}; diff --git a/examples/next-turbo/apps/docs/package.json b/examples/next-turbo/apps/docs/package.json new file mode 100644 index 00000000..cb77c505 --- /dev/null +++ b/examples/next-turbo/apps/docs/package.json @@ -0,0 +1,27 @@ +{ + "name": "docs", + "version": "0.0.0", + "private": true, + "scripts": { + "dev": "next dev --port 3001", + "build": "next build", + "start": "next start", + "lint": "next lint" + }, + "dependencies": { + "next": "12.3.1", + "react": "18.2.0", + "react-dom": "18.2.0", + "ui": "workspace:*" + }, + "devDependencies": { + "@babel/core": "^7.0.0", + "eslint-config-custom": "workspace:*", + "eslint": "7.32.0", + "tsconfig": "workspace:*", + "@types/node": "^17.0.12", + "@types/react": "^18.0.22", + "@types/react-dom": "^18.0.7", + "typescript": "^4.5.3" + } +} diff --git a/examples/next-turbo/apps/docs/pages/index.tsx b/examples/next-turbo/apps/docs/pages/index.tsx new file mode 100644 index 00000000..0d1dabc1 --- /dev/null +++ b/examples/next-turbo/apps/docs/pages/index.tsx @@ -0,0 +1,10 @@ +import { Button } from "ui"; + +export default function Docs() { + return ( +
+

Docs

+
+ ); +} diff --git a/examples/next-turbo/apps/docs/tsconfig.json b/examples/next-turbo/apps/docs/tsconfig.json new file mode 100644 index 00000000..a355365b --- /dev/null +++ b/examples/next-turbo/apps/docs/tsconfig.json @@ -0,0 +1,5 @@ +{ + "extends": "tsconfig/nextjs.json", + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], + "exclude": ["node_modules"] +} diff --git a/examples/next-turbo/apps/web/.eslintrc.js b/examples/next-turbo/apps/web/.eslintrc.js new file mode 100644 index 00000000..c8df6075 --- /dev/null +++ b/examples/next-turbo/apps/web/.eslintrc.js @@ -0,0 +1,4 @@ +module.exports = { + root: true, + extends: ["custom"], +}; diff --git a/examples/next-turbo/apps/web/README.md b/examples/next-turbo/apps/web/README.md new file mode 100644 index 00000000..1d67ece7 --- /dev/null +++ b/examples/next-turbo/apps/web/README.md @@ -0,0 +1,30 @@ +## Getting Started + +First, run the development server: + +```bash +yarn dev +``` + +Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. + +You can start editing the page by modifying `pages/index.js`. The page auto-updates as you edit the file. + +[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.js`. + +The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages. + +## Learn More + +To learn more about Next.js, take a look at the following resources: + +- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. +- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. + +You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! + +## Deploy on Vercel + +The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_source=github.com&utm_medium=referral&utm_campaign=turborepo-readme) from the creators of Next.js. + +Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. diff --git a/examples/next-turbo/apps/web/common/api.ts b/examples/next-turbo/apps/web/common/api.ts new file mode 100644 index 00000000..f97e053b --- /dev/null +++ b/examples/next-turbo/apps/web/common/api.ts @@ -0,0 +1,13 @@ +import { makeApi } from "@zodios/core"; +import z from "zod"; + +export const api = makeApi([ + { + method: "get", + path: "/health", + alias: "health", + response: z.object({ + status: z.literal("ok"), + }), + }, +]); diff --git a/examples/next-turbo/apps/web/next-env.d.ts b/examples/next-turbo/apps/web/next-env.d.ts new file mode 100644 index 00000000..4f11a03d --- /dev/null +++ b/examples/next-turbo/apps/web/next-env.d.ts @@ -0,0 +1,5 @@ +/// +/// + +// NOTE: This file should not be edited +// see https://nextjs.org/docs/basic-features/typescript for more information. diff --git a/examples/next-turbo/apps/web/next.config.js b/examples/next-turbo/apps/web/next.config.js new file mode 100644 index 00000000..5e578c4f --- /dev/null +++ b/examples/next-turbo/apps/web/next.config.js @@ -0,0 +1,6 @@ +module.exports = { + reactStrictMode: true, + experimental: { + transpilePackages: ["ui"], + }, +}; diff --git a/examples/next-turbo/apps/web/package.json b/examples/next-turbo/apps/web/package.json new file mode 100644 index 00000000..89ce106d --- /dev/null +++ b/examples/next-turbo/apps/web/package.json @@ -0,0 +1,35 @@ +{ + "name": "web", + "version": "0.0.0", + "private": true, + "scripts": { + "dev": "next dev", + "build": "next build", + "start": "next start", + "lint": "next lint" + }, + "dependencies": { + "@tanstack/react-query": "^4.13.0", + "@zodios/core": "^10.4.3", + "@zodios/express": "^10.4.2", + "@zodios/react": "^10.3.3", + "axios": "^1.1.3", + "express": "^4.18.2", + "next": "12.3.2-canary.40", + "react": "18.2.0", + "react-dom": "18.2.0", + "ui": "workspace:0.0.0", + "zod": "^3.19.1" + }, + "devDependencies": { + "@babel/core": "^7.19.6", + "@types/express": "^4.17.14", + "@types/node": "^17.0.45", + "@types/react": "^18.0.24", + "@types/react-dom": "^18.0.8", + "eslint": "7.32.0", + "eslint-config-custom": "workspace:0.0.0", + "tsconfig": "workspace:0.0.0", + "typescript": "^4.8.4" + } +} diff --git a/examples/next-turbo/apps/web/pages/_app.tsx b/examples/next-turbo/apps/web/pages/_app.tsx new file mode 100644 index 00000000..3c79ddbb --- /dev/null +++ b/examples/next-turbo/apps/web/pages/_app.tsx @@ -0,0 +1,14 @@ +import type { AppProps } from "next/app"; +import { QueryClientProvider, QueryClient } from "@tanstack/react-query"; + +const queryClient = new QueryClient(); + +function MyApp({ Component, pageProps }: AppProps) { + return ( + + + + ); +} + +export default MyApp; diff --git a/examples/next-turbo/apps/web/pages/api/[...zodios].ts b/examples/next-turbo/apps/web/pages/api/[...zodios].ts new file mode 100644 index 00000000..0d172f46 --- /dev/null +++ b/examples/next-turbo/apps/web/pages/api/[...zodios].ts @@ -0,0 +1,3 @@ +import { app } from "../../server/routers/app"; + +export default app; diff --git a/examples/next-turbo/apps/web/pages/index.tsx b/examples/next-turbo/apps/web/pages/index.tsx new file mode 100644 index 00000000..62496a53 --- /dev/null +++ b/examples/next-turbo/apps/web/pages/index.tsx @@ -0,0 +1,23 @@ +import { Button } from "ui"; +import { api } from "../common/api"; +import { Zodios } from "@zodios/core"; +import { ZodiosHooks } from "@zodios/react"; + +const zodios = new Zodios("/api", api); +const zodiosHooks = new ZodiosHooks("health", zodios); + +export default function Web() { + const { data: health, isLoading } = zodiosHooks.useHealth(); + return ( +
+

Health Status

+ {isLoading ? ( +

Loading...

+ ) : ( +

+ Status: {health?.status} +

+ )} +
+ ); +} diff --git a/examples/next-turbo/apps/web/server/context.ts b/examples/next-turbo/apps/web/server/context.ts new file mode 100644 index 00000000..5583411e --- /dev/null +++ b/examples/next-turbo/apps/web/server/context.ts @@ -0,0 +1,11 @@ +import { zodiosContext } from "@zodios/express"; +import z from "zod"; + +export const ctx = zodiosContext( + z.object({ + user: z.object({ + id: z.string(), + name: z.string(), + }), + }) +); diff --git a/examples/next-turbo/apps/web/server/routers/app.ts b/examples/next-turbo/apps/web/server/routers/app.ts new file mode 100644 index 00000000..c8c53357 --- /dev/null +++ b/examples/next-turbo/apps/web/server/routers/app.ts @@ -0,0 +1,10 @@ +import { ctx } from "../context"; +import { api } from "../../common/api"; + +export const app = ctx.nextApp(); +const router = ctx.router(api); +app.use("/api", router); + +router.get("/health", (req, res) => { + res.status(200).json({ status: "ok" }); +}); diff --git a/examples/next-turbo/apps/web/tsconfig.json b/examples/next-turbo/apps/web/tsconfig.json new file mode 100644 index 00000000..a355365b --- /dev/null +++ b/examples/next-turbo/apps/web/tsconfig.json @@ -0,0 +1,5 @@ +{ + "extends": "tsconfig/nextjs.json", + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], + "exclude": ["node_modules"] +} diff --git a/examples/next-turbo/package.json b/examples/next-turbo/package.json new file mode 100644 index 00000000..c49485d1 --- /dev/null +++ b/examples/next-turbo/package.json @@ -0,0 +1,25 @@ +{ + "name": "zodios-turbo", + "version": "0.0.0", + "private": true, + "workspaces": [ + "apps/*", + "packages/*" + ], + "scripts": { + "build": "turbo run build", + "dev": "turbo run dev --parallel", + "lint": "turbo run lint", + "format": "prettier --write \"**/*.{ts,tsx,md}\"" + }, + "devDependencies": { + "eslint-config-custom": "workspace:*", + "prettier": "latest", + "turbo": "latest" + }, + "engines": { + "node": ">=14.0.0" + }, + "dependencies": {}, + "packageManager": "pnpm@7.14.0" +} \ No newline at end of file diff --git a/examples/next-turbo/packages/eslint-config-custom/index.js b/examples/next-turbo/packages/eslint-config-custom/index.js new file mode 100644 index 00000000..2ea526a5 --- /dev/null +++ b/examples/next-turbo/packages/eslint-config-custom/index.js @@ -0,0 +1,7 @@ +module.exports = { + extends: ["next", "turbo", "prettier"], + rules: { + "@next/next/no-html-link-for-pages": "off", + "react/jsx-key": "off", + }, +}; diff --git a/examples/next-turbo/packages/eslint-config-custom/package.json b/examples/next-turbo/packages/eslint-config-custom/package.json new file mode 100644 index 00000000..7f16c312 --- /dev/null +++ b/examples/next-turbo/packages/eslint-config-custom/package.json @@ -0,0 +1,19 @@ +{ + "name": "eslint-config-custom", + "version": "0.0.0", + "main": "index.js", + "license": "MIT", + "dependencies": { + "eslint": "^7.23.0", + "eslint-config-next": "^12.0.8", + "eslint-config-prettier": "^8.3.0", + "eslint-plugin-react": "7.31.8", + "eslint-config-turbo": "latest" + }, + "devDependencies": { + "typescript": "^4.7.4" + }, + "publishConfig": { + "access": "public" + } +} diff --git a/examples/next-turbo/packages/tsconfig/README.md b/examples/next-turbo/packages/tsconfig/README.md new file mode 100644 index 00000000..0da79cf2 --- /dev/null +++ b/examples/next-turbo/packages/tsconfig/README.md @@ -0,0 +1,3 @@ +# `tsconfig` + +These are base shared `tsconfig.json`s from which all other `tsconfig.json`'s inherit from. diff --git a/examples/next-turbo/packages/tsconfig/base.json b/examples/next-turbo/packages/tsconfig/base.json new file mode 100644 index 00000000..d72a9f3a --- /dev/null +++ b/examples/next-turbo/packages/tsconfig/base.json @@ -0,0 +1,20 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "display": "Default", + "compilerOptions": { + "composite": false, + "declaration": true, + "declarationMap": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "inlineSources": false, + "isolatedModules": true, + "moduleResolution": "node", + "noUnusedLocals": false, + "noUnusedParameters": false, + "preserveWatchOutput": true, + "skipLibCheck": true, + "strict": true + }, + "exclude": ["node_modules"] +} diff --git a/examples/next-turbo/packages/tsconfig/nextjs.json b/examples/next-turbo/packages/tsconfig/nextjs.json new file mode 100644 index 00000000..cd9cd38f --- /dev/null +++ b/examples/next-turbo/packages/tsconfig/nextjs.json @@ -0,0 +1,23 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "display": "Next.js", + "extends": "./base.json", + "compilerOptions": { + "target": "ES6", + "lib": ["dom", "dom.iterable", "esnext"], + "allowJs": true, + "skipLibCheck": true, + "strict": true, + "forceConsistentCasingInFileNames": true, + "noEmit": true, + "incremental": true, + "esModuleInterop": true, + "module": "esnext", + "moduleResolution": "Node", + "resolveJsonModule": true, + "isolatedModules": true, + "jsx": "preserve" + }, + "include": ["src", "next-env.d.ts"], + "exclude": ["node_modules"] +} diff --git a/examples/next-turbo/packages/tsconfig/package.json b/examples/next-turbo/packages/tsconfig/package.json new file mode 100644 index 00000000..f4810fc3 --- /dev/null +++ b/examples/next-turbo/packages/tsconfig/package.json @@ -0,0 +1,10 @@ +{ + "name": "tsconfig", + "version": "0.0.0", + "private": true, + "files": [ + "base.json", + "nextjs.json", + "react-library.json" + ] +} diff --git a/examples/next-turbo/packages/tsconfig/react-library.json b/examples/next-turbo/packages/tsconfig/react-library.json new file mode 100644 index 00000000..af8711c5 --- /dev/null +++ b/examples/next-turbo/packages/tsconfig/react-library.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://json.schemastore.org/tsconfig", + "display": "React Library", + "extends": "./base.json", + "compilerOptions": { + "jsx": "react-jsx", + "lib": ["ES2015"], + "module": "ESNext", + "target": "es6" + } +} diff --git a/examples/next-turbo/packages/ui/Button.tsx b/examples/next-turbo/packages/ui/Button.tsx new file mode 100644 index 00000000..7d5c6a73 --- /dev/null +++ b/examples/next-turbo/packages/ui/Button.tsx @@ -0,0 +1,4 @@ +import * as React from "react"; +export const Button = () => { + return ; +}; diff --git a/examples/next-turbo/packages/ui/index.tsx b/examples/next-turbo/packages/ui/index.tsx new file mode 100644 index 00000000..916730e8 --- /dev/null +++ b/examples/next-turbo/packages/ui/index.tsx @@ -0,0 +1,2 @@ +import * as React from "react"; +export * from "./Button"; diff --git a/examples/next-turbo/packages/ui/package.json b/examples/next-turbo/packages/ui/package.json new file mode 100644 index 00000000..17b3a320 --- /dev/null +++ b/examples/next-turbo/packages/ui/package.json @@ -0,0 +1,19 @@ +{ + "name": "ui", + "version": "0.0.0", + "main": "./index.tsx", + "types": "./index.tsx", + "license": "MIT", + "scripts": { + "lint": "eslint *.ts*" + }, + "devDependencies": { + "@types/react": "^18.0.17", + "@types/react-dom": "^18.0.6", + "eslint": "^7.32.0", + "eslint-config-custom": "workspace:*", + "react": "^18.2.0", + "tsconfig": "workspace:*", + "typescript": "^4.5.2" + } +} diff --git a/examples/next-turbo/packages/ui/tsconfig.json b/examples/next-turbo/packages/ui/tsconfig.json new file mode 100644 index 00000000..cd6c94d6 --- /dev/null +++ b/examples/next-turbo/packages/ui/tsconfig.json @@ -0,0 +1,5 @@ +{ + "extends": "tsconfig/react-library.json", + "include": ["."], + "exclude": ["dist", "build", "node_modules"] +} diff --git a/examples/next-turbo/pnpm-lock.yaml b/examples/next-turbo/pnpm-lock.yaml new file mode 100644 index 00000000..019267c5 --- /dev/null +++ b/examples/next-turbo/pnpm-lock.yaml @@ -0,0 +1,3019 @@ +lockfileVersion: 5.4 + +importers: + + .: + specifiers: + eslint-config-custom: workspace:* + prettier: latest + turbo: latest + devDependencies: + eslint-config-custom: link:packages/eslint-config-custom + prettier: 2.7.1 + turbo: 1.6.2 + + apps/docs: + specifiers: + '@babel/core': ^7.0.0 + '@types/node': ^17.0.12 + '@types/react': ^18.0.22 + '@types/react-dom': ^18.0.7 + eslint: 7.32.0 + eslint-config-custom: workspace:* + next: 12.3.1 + react: 18.2.0 + react-dom: 18.2.0 + tsconfig: workspace:* + typescript: ^4.5.3 + ui: workspace:* + dependencies: + next: 12.3.1_qtpcxnaaarbm4ws7ughq6oxfve + react: 18.2.0 + react-dom: 18.2.0_react@18.2.0 + ui: link:../../packages/ui + devDependencies: + '@babel/core': 7.19.6 + '@types/node': 17.0.45 + '@types/react': 18.0.24 + '@types/react-dom': 18.0.8 + eslint: 7.32.0 + eslint-config-custom: link:../../packages/eslint-config-custom + tsconfig: link:../../packages/tsconfig + typescript: 4.8.4 + + apps/web: + specifiers: + '@babel/core': ^7.19.6 + '@tanstack/react-query': ^4.13.0 + '@types/express': ^4.17.14 + '@types/node': ^17.0.45 + '@types/react': ^18.0.24 + '@types/react-dom': ^18.0.8 + '@zodios/core': ^10.4.3 + '@zodios/express': ^10.4.2 + '@zodios/react': ^10.3.3 + axios: ^1.1.3 + eslint: 7.32.0 + eslint-config-custom: workspace:0.0.0 + express: ^4.18.2 + next: 12.3.2-canary.40 + react: 18.2.0 + react-dom: 18.2.0 + tsconfig: workspace:0.0.0 + typescript: ^4.8.4 + ui: workspace:0.0.0 + zod: ^3.19.1 + dependencies: + '@tanstack/react-query': 4.13.0_biqbaboplfbrettd7655fr4n2y + '@types/express': 4.17.14 + '@zodios/core': 10.4.3_axios@1.1.3+zod@3.19.1 + '@zodios/express': 10.4.2_za6leqvtaqdjr5gzlbrsemzpwi + '@zodios/react': 10.3.3_tbpsitbqmenqxmwimr6kvnccvq + axios: 1.1.3 + express: 4.18.2 + next: 12.3.2-canary.40_qtpcxnaaarbm4ws7ughq6oxfve + react: 18.2.0 + react-dom: 18.2.0_react@18.2.0 + ui: link:../../packages/ui + zod: 3.19.1 + devDependencies: + '@babel/core': 7.19.6 + '@types/node': 17.0.45 + '@types/react': 18.0.24 + '@types/react-dom': 18.0.8 + eslint: 7.32.0 + eslint-config-custom: link:../../packages/eslint-config-custom + tsconfig: link:../../packages/tsconfig + typescript: 4.8.4 + + packages/eslint-config-custom: + specifiers: + eslint: ^7.23.0 + eslint-config-next: ^12.0.8 + eslint-config-prettier: ^8.3.0 + eslint-config-turbo: latest + eslint-plugin-react: 7.31.8 + typescript: ^4.7.4 + dependencies: + eslint: 7.32.0 + eslint-config-next: 12.3.1_3rubbgt5ekhqrcgx4uwls3neim + eslint-config-prettier: 8.5.0_eslint@7.32.0 + eslint-config-turbo: 0.0.4_eslint@7.32.0 + eslint-plugin-react: 7.31.8_eslint@7.32.0 + devDependencies: + typescript: 4.8.4 + + packages/tsconfig: + specifiers: {} + + packages/ui: + specifiers: + '@types/react': ^18.0.17 + '@types/react-dom': ^18.0.6 + eslint: ^7.32.0 + eslint-config-custom: workspace:* + react: ^18.2.0 + tsconfig: workspace:* + typescript: ^4.5.2 + devDependencies: + '@types/react': 18.0.24 + '@types/react-dom': 18.0.8 + eslint: 7.32.0 + eslint-config-custom: link:../eslint-config-custom + react: 18.2.0 + tsconfig: link:../tsconfig + typescript: 4.8.4 + +packages: + + /@ampproject/remapping/2.2.0: + resolution: {integrity: sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w==} + engines: {node: '>=6.0.0'} + dependencies: + '@jridgewell/gen-mapping': 0.1.1 + '@jridgewell/trace-mapping': 0.3.17 + + /@babel/code-frame/7.12.11: + resolution: {integrity: sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==} + dependencies: + '@babel/highlight': 7.18.6 + + /@babel/code-frame/7.18.6: + resolution: {integrity: sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/highlight': 7.18.6 + + /@babel/compat-data/7.20.0: + resolution: {integrity: sha512-Gt9jszFJYq7qzXVK4slhc6NzJXnOVmRECWcVjF/T23rNXD9NtWQ0W3qxdg+p9wWIB+VQw3GYV/U2Ha9bRTfs4w==} + engines: {node: '>=6.9.0'} + + /@babel/core/7.19.6: + resolution: {integrity: sha512-D2Ue4KHpc6Ys2+AxpIx1BZ8+UegLLLE2p3KJEuJRKmokHOtl49jQ5ny1773KsGLZs8MQvBidAF6yWUJxRqtKtg==} + engines: {node: '>=6.9.0'} + dependencies: + '@ampproject/remapping': 2.2.0 + '@babel/code-frame': 7.18.6 + '@babel/generator': 7.20.0 + '@babel/helper-compilation-targets': 7.20.0_@babel+core@7.19.6 + '@babel/helper-module-transforms': 7.19.6 + '@babel/helpers': 7.20.0 + '@babel/parser': 7.20.0 + '@babel/template': 7.18.10 + '@babel/traverse': 7.20.0 + '@babel/types': 7.20.0 + convert-source-map: 1.9.0 + debug: 4.3.4 + gensync: 1.0.0-beta.2 + json5: 2.2.1 + semver: 6.3.0 + transitivePeerDependencies: + - supports-color + + /@babel/generator/7.20.0: + resolution: {integrity: sha512-GUPcXxWibClgmYJuIwC2Bc2Lg+8b9VjaJ+HlNdACEVt+Wlr1eoU1OPZjZRm7Hzl0gaTsUZNQfeihvZJhG7oc3w==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.20.0 + '@jridgewell/gen-mapping': 0.3.2 + jsesc: 2.5.2 + + /@babel/helper-compilation-targets/7.20.0_@babel+core@7.19.6: + resolution: {integrity: sha512-0jp//vDGp9e8hZzBc6N/KwA5ZK3Wsm/pfm4CrY7vzegkVxc65SgSn6wYOnwHe9Js9HRQ1YTCKLGPzDtaS3RoLQ==} + engines: {node: '>=6.9.0'} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/compat-data': 7.20.0 + '@babel/core': 7.19.6 + '@babel/helper-validator-option': 7.18.6 + browserslist: 4.21.4 + semver: 6.3.0 + + /@babel/helper-environment-visitor/7.18.9: + resolution: {integrity: sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==} + engines: {node: '>=6.9.0'} + + /@babel/helper-function-name/7.19.0: + resolution: {integrity: sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/template': 7.18.10 + '@babel/types': 7.20.0 + + /@babel/helper-hoist-variables/7.18.6: + resolution: {integrity: sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.20.0 + + /@babel/helper-module-imports/7.18.6: + resolution: {integrity: sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.20.0 + + /@babel/helper-module-transforms/7.19.6: + resolution: {integrity: sha512-fCmcfQo/KYr/VXXDIyd3CBGZ6AFhPFy1TfSEJ+PilGVlQT6jcbqtHAM4C1EciRqMza7/TpOUZliuSH+U6HAhJw==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-environment-visitor': 7.18.9 + '@babel/helper-module-imports': 7.18.6 + '@babel/helper-simple-access': 7.19.4 + '@babel/helper-split-export-declaration': 7.18.6 + '@babel/helper-validator-identifier': 7.19.1 + '@babel/template': 7.18.10 + '@babel/traverse': 7.20.0 + '@babel/types': 7.20.0 + transitivePeerDependencies: + - supports-color + + /@babel/helper-simple-access/7.19.4: + resolution: {integrity: sha512-f9Xq6WqBFqaDfbCzn2w85hwklswz5qsKlh7f08w4Y9yhJHpnNC0QemtSkK5YyOY8kPGvyiwdzZksGUhnGdaUIg==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.20.0 + + /@babel/helper-split-export-declaration/7.18.6: + resolution: {integrity: sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/types': 7.20.0 + + /@babel/helper-string-parser/7.19.4: + resolution: {integrity: sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==} + engines: {node: '>=6.9.0'} + + /@babel/helper-validator-identifier/7.19.1: + resolution: {integrity: sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==} + engines: {node: '>=6.9.0'} + + /@babel/helper-validator-option/7.18.6: + resolution: {integrity: sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw==} + engines: {node: '>=6.9.0'} + + /@babel/helpers/7.20.0: + resolution: {integrity: sha512-aGMjYraN0zosCEthoGLdqot1oRsmxVTQRHadsUPz5QM44Zej2PYRz7XiDE7GqnkZnNtLbOuxqoZw42vkU7+XEQ==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/template': 7.18.10 + '@babel/traverse': 7.20.0 + '@babel/types': 7.20.0 + transitivePeerDependencies: + - supports-color + + /@babel/highlight/7.18.6: + resolution: {integrity: sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-validator-identifier': 7.19.1 + chalk: 2.4.2 + js-tokens: 4.0.0 + + /@babel/parser/7.20.0: + resolution: {integrity: sha512-G9VgAhEaICnz8iiJeGJQyVl6J2nTjbW0xeisva0PK6XcKsga7BIaqm4ZF8Rg1Wbaqmy6znspNqhPaPkyukujzg==} + engines: {node: '>=6.0.0'} + hasBin: true + dependencies: + '@babel/types': 7.20.0 + + /@babel/runtime-corejs3/7.20.0: + resolution: {integrity: sha512-v1JH7PeAAGBEyTQM9TqojVl+b20zXtesFKCJHu50xMxZKD1fX0TKaKHPsZfFkXfs7D1M9M6Eeqg1FkJ3a0x2dA==} + engines: {node: '>=6.9.0'} + dependencies: + core-js-pure: 3.26.0 + regenerator-runtime: 0.13.10 + dev: false + + /@babel/runtime/7.20.0: + resolution: {integrity: sha512-NDYdls71fTXoU8TZHfbBWg7DiZfNzClcKui/+kyi6ppD2L1qnWW3VV6CjtaBXSUGGhiTWJ6ereOIkUvenif66Q==} + engines: {node: '>=6.9.0'} + dependencies: + regenerator-runtime: 0.13.10 + dev: false + + /@babel/template/7.18.10: + resolution: {integrity: sha512-TI+rCtooWHr3QJ27kJxfjutghu44DLnasDMwpDqCXVTal9RLp3RSYNh4NdBrRP2cQAoG9A8juOQl6P6oZG4JxA==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/code-frame': 7.18.6 + '@babel/parser': 7.20.0 + '@babel/types': 7.20.0 + + /@babel/traverse/7.20.0: + resolution: {integrity: sha512-5+cAXQNARgjRUK0JWu2UBwja4JLSO/rBMPJzpsKb+oBF5xlUuCfljQepS4XypBQoiigL0VQjTZy6WiONtUdScQ==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/code-frame': 7.18.6 + '@babel/generator': 7.20.0 + '@babel/helper-environment-visitor': 7.18.9 + '@babel/helper-function-name': 7.19.0 + '@babel/helper-hoist-variables': 7.18.6 + '@babel/helper-split-export-declaration': 7.18.6 + '@babel/parser': 7.20.0 + '@babel/types': 7.20.0 + debug: 4.3.4 + globals: 11.12.0 + transitivePeerDependencies: + - supports-color + + /@babel/types/7.20.0: + resolution: {integrity: sha512-Jlgt3H0TajCW164wkTOTzHkZb075tMQMULzrLUoUeKmO7eFL96GgDxf7/Axhc5CAuKE3KFyVW1p6ysKsi2oXAg==} + engines: {node: '>=6.9.0'} + dependencies: + '@babel/helper-string-parser': 7.19.4 + '@babel/helper-validator-identifier': 7.19.1 + to-fast-properties: 2.0.0 + + /@eslint/eslintrc/0.4.3: + resolution: {integrity: sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==} + engines: {node: ^10.12.0 || >=12.0.0} + dependencies: + ajv: 6.12.6 + debug: 4.3.4 + espree: 7.3.1 + globals: 13.17.0 + ignore: 4.0.6 + import-fresh: 3.3.0 + js-yaml: 3.14.1 + minimatch: 3.1.2 + strip-json-comments: 3.1.1 + transitivePeerDependencies: + - supports-color + + /@humanwhocodes/config-array/0.5.0: + resolution: {integrity: sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==} + engines: {node: '>=10.10.0'} + dependencies: + '@humanwhocodes/object-schema': 1.2.1 + debug: 4.3.4 + minimatch: 3.1.2 + transitivePeerDependencies: + - supports-color + + /@humanwhocodes/object-schema/1.2.1: + resolution: {integrity: sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==} + + /@jridgewell/gen-mapping/0.1.1: + resolution: {integrity: sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==} + engines: {node: '>=6.0.0'} + dependencies: + '@jridgewell/set-array': 1.1.2 + '@jridgewell/sourcemap-codec': 1.4.14 + + /@jridgewell/gen-mapping/0.3.2: + resolution: {integrity: sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==} + engines: {node: '>=6.0.0'} + dependencies: + '@jridgewell/set-array': 1.1.2 + '@jridgewell/sourcemap-codec': 1.4.14 + '@jridgewell/trace-mapping': 0.3.17 + + /@jridgewell/resolve-uri/3.1.0: + resolution: {integrity: sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==} + engines: {node: '>=6.0.0'} + + /@jridgewell/set-array/1.1.2: + resolution: {integrity: sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==} + engines: {node: '>=6.0.0'} + + /@jridgewell/sourcemap-codec/1.4.14: + resolution: {integrity: sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==} + + /@jridgewell/trace-mapping/0.3.17: + resolution: {integrity: sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g==} + dependencies: + '@jridgewell/resolve-uri': 3.1.0 + '@jridgewell/sourcemap-codec': 1.4.14 + + /@next/env/12.3.1: + resolution: {integrity: sha512-9P9THmRFVKGKt9DYqeC2aKIxm8rlvkK38V1P1sRE7qyoPBIs8l9oo79QoSdPtOWfzkbDAVUqvbQGgTMsb8BtJg==} + dev: false + + /@next/env/12.3.2-canary.40: + resolution: {integrity: sha512-Fd6ZDf07ESDJ/C3IvmeWsXNyb6/BvlEM6KHoZU9l+Z/mqSH83T3AnVo44Rj7Pbr9K1aQvEq2qKW1zcsM4pZVwg==} + dev: false + + /@next/eslint-plugin-next/12.3.1: + resolution: {integrity: sha512-sw+lTf6r6P0j+g/n9y4qdWWI2syPqZx+uc0+B/fRENqfR3KpSid6MIKqc9gNwGhJASazEQ5b3w8h4cAET213jw==} + dependencies: + glob: 7.1.7 + dev: false + + /@next/swc-android-arm-eabi/12.3.1: + resolution: {integrity: sha512-i+BvKA8tB//srVPPQxIQN5lvfROcfv4OB23/L1nXznP+N/TyKL8lql3l7oo2LNhnH66zWhfoemg3Q4VJZSruzQ==} + engines: {node: '>= 10'} + cpu: [arm] + os: [android] + requiresBuild: true + dev: false + optional: true + + /@next/swc-android-arm-eabi/12.3.2-canary.40: + resolution: {integrity: sha512-8WVCejEFzPeEouLd6DMjNLMVvVbG+Pw6S7QWPqxNPl5cCI4yem9zl+Niv5SI/DAQu6yBsRXBA50in/vx7NWKUA==} + engines: {node: '>= 10'} + cpu: [arm] + os: [android] + requiresBuild: true + dev: false + optional: true + + /@next/swc-android-arm64/12.3.1: + resolution: {integrity: sha512-CmgU2ZNyBP0rkugOOqLnjl3+eRpXBzB/I2sjwcGZ7/Z6RcUJXK5Evz+N0ucOxqE4cZ3gkTeXtSzRrMK2mGYV8Q==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: false + optional: true + + /@next/swc-android-arm64/12.3.2-canary.40: + resolution: {integrity: sha512-IG044VjmSwXV+zIgRFqgx9wX24M4IIhJgSnTwnTyE5fsbL0eA3VJ2s2Skb40/2y3PTG4EwNZDkpOzpNRWJ8o1A==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: false + optional: true + + /@next/swc-darwin-arm64/12.3.1: + resolution: {integrity: sha512-hT/EBGNcu0ITiuWDYU9ur57Oa4LybD5DOQp4f22T6zLfpoBMfBibPtR8XktXmOyFHrL/6FC2p9ojdLZhWhvBHg==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: false + optional: true + + /@next/swc-darwin-arm64/12.3.2-canary.40: + resolution: {integrity: sha512-P3BrKMqSm2t330VbpdIKHnMjMrxGPEvjosYDh5boQu8+4KgdCcTEHhdrTRwf7hXVZB8ais9I4+YDFe92WY6sqQ==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: false + optional: true + + /@next/swc-darwin-x64/12.3.1: + resolution: {integrity: sha512-9S6EVueCVCyGf2vuiLiGEHZCJcPAxglyckTZcEwLdJwozLqN0gtS0Eq0bQlGS3dH49Py/rQYpZ3KVWZ9BUf/WA==} + engines: {node: '>= 10'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: false + optional: true + + /@next/swc-darwin-x64/12.3.2-canary.40: + resolution: {integrity: sha512-3l2LNNrB/elk12ij7J6/SQHgpdWnrCZQgk501Hrtw7MoRW4Gu8Gee2FwubYGoL3dDe8cloVW04XlHrSAStS/Pg==} + engines: {node: '>= 10'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: false + optional: true + + /@next/swc-freebsd-x64/12.3.1: + resolution: {integrity: sha512-qcuUQkaBZWqzM0F1N4AkAh88lLzzpfE6ImOcI1P6YeyJSsBmpBIV8o70zV+Wxpc26yV9vpzb+e5gCyxNjKJg5Q==} + engines: {node: '>= 10'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: false + optional: true + + /@next/swc-freebsd-x64/12.3.2-canary.40: + resolution: {integrity: sha512-ImJje/zx/07rreE6+MwKsSlYr0j+8MSIBWbHrKZ7Y2kUVA5bAIYPVj+BPLj1ckt9ezf1n4aDt7BSzbEc3mXMBw==} + engines: {node: '>= 10'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: false + optional: true + + /@next/swc-linux-arm-gnueabihf/12.3.1: + resolution: {integrity: sha512-diL9MSYrEI5nY2wc/h/DBewEDUzr/DqBjIgHJ3RUNtETAOB3spMNHvJk2XKUDjnQuluLmFMloet9tpEqU2TT9w==} + engines: {node: '>= 10'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@next/swc-linux-arm-gnueabihf/12.3.2-canary.40: + resolution: {integrity: sha512-7D80PEpsfYg0Cmjd530p0s2ald0p7u+jmgcZ3rCkW3uDWr27ve95vm/MnY2sC/DD8Lo7obFc9NQraKYtR8l9tg==} + engines: {node: '>= 10'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@next/swc-linux-arm64-gnu/12.3.1: + resolution: {integrity: sha512-o/xB2nztoaC7jnXU3Q36vGgOolJpsGG8ETNjxM1VAPxRwM7FyGCPHOMk1XavG88QZSQf+1r+POBW0tLxQOJ9DQ==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@next/swc-linux-arm64-gnu/12.3.2-canary.40: + resolution: {integrity: sha512-xu7dNJdJj4R61j5uHK/AGaQorLCD9CGq/SM2eKoXHvVHqffelKVAjflqXL2HzP6yQpHAIz4zIY20B/vIyIWHBA==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@next/swc-linux-arm64-musl/12.3.1: + resolution: {integrity: sha512-2WEasRxJzgAmP43glFNhADpe8zB7kJofhEAVNbDJZANp+H4+wq+/cW1CdDi8DqjkShPEA6/ejJw+xnEyDID2jg==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@next/swc-linux-arm64-musl/12.3.2-canary.40: + resolution: {integrity: sha512-eIqCjajoHAQAerQFiH0jMXjcDLcvL4a685JwKg1zr72eVLf/y0WVjLOtV43WmjcxPu369IJIztN8Y/5gti5wzg==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@next/swc-linux-x64-gnu/12.3.1: + resolution: {integrity: sha512-JWEaMyvNrXuM3dyy9Pp5cFPuSSvG82+yABqsWugjWlvfmnlnx9HOQZY23bFq3cNghy5V/t0iPb6cffzRWylgsA==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@next/swc-linux-x64-gnu/12.3.2-canary.40: + resolution: {integrity: sha512-yVdX9ZVfhHQ9ltsL4t2MllWyk0/RPg0rsCwx49df8eD56Q0PwHcsjfr7/+6RAOMVqDvek22u0QpedINTzSDH/g==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@next/swc-linux-x64-musl/12.3.1: + resolution: {integrity: sha512-xoEWQQ71waWc4BZcOjmatuvPUXKTv6MbIFzpm4LFeCHsg2iwai0ILmNXf81rJR+L1Wb9ifEke2sQpZSPNz1Iyg==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@next/swc-linux-x64-musl/12.3.2-canary.40: + resolution: {integrity: sha512-49WG2OIPT+FD8wc0junhRBvGAMLIKjwBf7Hrb0cX4Iev+Z/SIseXrASO8l5ADHM/DsGrb1tcVLjpQ/gPCdT48Q==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: false + optional: true + + /@next/swc-win32-arm64-msvc/12.3.1: + resolution: {integrity: sha512-hswVFYQYIeGHE2JYaBVtvqmBQ1CppplQbZJS/JgrVI3x2CurNhEkmds/yqvDONfwfbttTtH4+q9Dzf/WVl3Opw==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: false + optional: true + + /@next/swc-win32-arm64-msvc/12.3.2-canary.40: + resolution: {integrity: sha512-8tLK6AjioExFX67BJ8lPQF7Rr+uqnMSIzAnQElDsBPGNORcrix6QMwNhiMCiqsPBwza3InAZ4qbz5E6bV1Y/fA==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: false + optional: true + + /@next/swc-win32-ia32-msvc/12.3.1: + resolution: {integrity: sha512-Kny5JBehkTbKPmqulr5i+iKntO5YMP+bVM8Hf8UAmjSMVo3wehyLVc9IZkNmcbxi+vwETnQvJaT5ynYBkJ9dWA==} + engines: {node: '>= 10'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: false + optional: true + + /@next/swc-win32-ia32-msvc/12.3.2-canary.40: + resolution: {integrity: sha512-FCjSpNzKuH8LV0BuG49P9OoR7Yd+Tr1dgKv5zSEYqBgLuCmNEPcFZxcGMd7EidmeAh2Oz1IELk18pwgeNeW9IA==} + engines: {node: '>= 10'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: false + optional: true + + /@next/swc-win32-x64-msvc/12.3.1: + resolution: {integrity: sha512-W1ijvzzg+kPEX6LAc+50EYYSEo0FVu7dmTE+t+DM4iOLqgGHoW9uYSz9wCVdkXOEEMP9xhXfGpcSxsfDucyPkA==} + engines: {node: '>= 10'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: false + optional: true + + /@next/swc-win32-x64-msvc/12.3.2-canary.40: + resolution: {integrity: sha512-SNFJcSDvWq5p+3g0TqC7PPfpLIOwP5pBLBNg1i9LSEeULULMWzdnquPBnlEjKwgdqj7B34gHzTK8rApVJ1obVQ==} + engines: {node: '>= 10'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: false + optional: true + + /@nodelib/fs.scandir/2.1.5: + resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} + engines: {node: '>= 8'} + dependencies: + '@nodelib/fs.stat': 2.0.5 + run-parallel: 1.2.0 + dev: false + + /@nodelib/fs.stat/2.0.5: + resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} + engines: {node: '>= 8'} + dev: false + + /@nodelib/fs.walk/1.2.8: + resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} + engines: {node: '>= 8'} + dependencies: + '@nodelib/fs.scandir': 2.1.5 + fastq: 1.13.0 + dev: false + + /@rushstack/eslint-patch/1.2.0: + resolution: {integrity: sha512-sXo/qW2/pAcmT43VoRKOJbDOfV3cYpq3szSVfIThQXNt+E4DfKj361vaAt3c88U5tPUxzEswam7GW48PJqtKAg==} + dev: false + + /@swc/helpers/0.4.11: + resolution: {integrity: sha512-rEUrBSGIoSFuYxwBYtlUFMlE2CwGhmW+w9355/5oduSw8e5h2+Tj4UrAGNNgP9915++wj5vkQo0UuOBqOAq4nw==} + dependencies: + tslib: 2.4.0 + dev: false + + /@tanstack/query-core/4.13.0: + resolution: {integrity: sha512-PzmLQcEgC4rl2OzkiPHYPC9O79DFcMGaKsOzDEP+U4PJ+tbkcEP+Z+FQDlfvX8mCwYC7UNH7hXrQ5EdkGlJjVg==} + dev: false + + /@tanstack/react-query/4.13.0_biqbaboplfbrettd7655fr4n2y: + resolution: {integrity: sha512-dI/5hJ/pGQ74P5hxBLC9h6K0/Cap2T3k0ZjjjFLBCNnohDYgl7LNmMopzrRzBHk2mMjf2hgXHIzcKNG8GOZ5hg==} + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-native: '*' + peerDependenciesMeta: + react-dom: + optional: true + react-native: + optional: true + dependencies: + '@tanstack/query-core': 4.13.0 + react: 18.2.0 + react-dom: 18.2.0_react@18.2.0 + use-sync-external-store: 1.2.0_react@18.2.0 + dev: false + + /@types/body-parser/1.19.2: + resolution: {integrity: sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==} + dependencies: + '@types/connect': 3.4.35 + '@types/node': 17.0.45 + dev: false + + /@types/connect/3.4.35: + resolution: {integrity: sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==} + dependencies: + '@types/node': 17.0.45 + dev: false + + /@types/express-serve-static-core/4.17.31: + resolution: {integrity: sha512-DxMhY+NAsTwMMFHBTtJFNp5qiHKJ7TeqOo23zVEM9alT1Ml27Q3xcTH0xwxn7Q0BbMcVEJOs/7aQtUWupUQN3Q==} + dependencies: + '@types/node': 17.0.45 + '@types/qs': 6.9.7 + '@types/range-parser': 1.2.4 + dev: false + + /@types/express/4.17.14: + resolution: {integrity: sha512-TEbt+vaPFQ+xpxFLFssxUDXj5cWCxZJjIcB7Yg0k0GMHGtgtQgpvx/MUQUeAkNbA9AAGrwkAsoeItdTgS7FMyg==} + dependencies: + '@types/body-parser': 1.19.2 + '@types/express-serve-static-core': 4.17.31 + '@types/qs': 6.9.7 + '@types/serve-static': 1.15.0 + dev: false + + /@types/json5/0.0.29: + resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==} + dev: false + + /@types/mime/3.0.1: + resolution: {integrity: sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==} + dev: false + + /@types/node/17.0.45: + resolution: {integrity: sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==} + + /@types/prop-types/15.7.5: + resolution: {integrity: sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==} + dev: true + + /@types/qs/6.9.7: + resolution: {integrity: sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==} + dev: false + + /@types/range-parser/1.2.4: + resolution: {integrity: sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==} + dev: false + + /@types/react-dom/18.0.8: + resolution: {integrity: sha512-C3GYO0HLaOkk9dDAz3Dl4sbe4AKUGTCfFIZsz3n/82dPNN8Du533HzKatDxeUYWu24wJgMP1xICqkWk1YOLOIw==} + dependencies: + '@types/react': 18.0.24 + dev: true + + /@types/react/18.0.24: + resolution: {integrity: sha512-wRJWT6ouziGUy+9uX0aW4YOJxAY0bG6/AOk5AW5QSvZqI7dk6VBIbXvcVgIw/W5Jrl24f77df98GEKTJGOLx7Q==} + dependencies: + '@types/prop-types': 15.7.5 + '@types/scheduler': 0.16.2 + csstype: 3.1.1 + dev: true + + /@types/scheduler/0.16.2: + resolution: {integrity: sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==} + dev: true + + /@types/serve-static/1.15.0: + resolution: {integrity: sha512-z5xyF6uh8CbjAu9760KDKsH2FcDxZ2tFCsA4HIMWE6IkiYMXfVoa+4f9KX+FN0ZLsaMw1WNG2ETLA6N+/YA+cg==} + dependencies: + '@types/mime': 3.0.1 + '@types/node': 17.0.45 + dev: false + + /@typescript-eslint/parser/5.41.0_3rubbgt5ekhqrcgx4uwls3neim: + resolution: {integrity: sha512-HQVfix4+RL5YRWZboMD1pUfFN8MpRH4laziWkkAzyO1fvNOY/uinZcvo3QiFJVS/siNHupV8E5+xSwQZrl6PZA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/scope-manager': 5.41.0 + '@typescript-eslint/types': 5.41.0 + '@typescript-eslint/typescript-estree': 5.41.0_typescript@4.8.4 + debug: 4.3.4 + eslint: 7.32.0 + typescript: 4.8.4 + transitivePeerDependencies: + - supports-color + dev: false + + /@typescript-eslint/scope-manager/5.41.0: + resolution: {integrity: sha512-xOxPJCnuktUkY2xoEZBKXO5DBCugFzjrVndKdUnyQr3+9aDWZReKq9MhaoVnbL+maVwWJu/N0SEtrtEUNb62QQ==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + '@typescript-eslint/types': 5.41.0 + '@typescript-eslint/visitor-keys': 5.41.0 + dev: false + + /@typescript-eslint/types/5.41.0: + resolution: {integrity: sha512-5BejraMXMC+2UjefDvrH0Fo/eLwZRV6859SXRg+FgbhA0R0l6lDqDGAQYhKbXhPN2ofk2kY5sgGyLNL907UXpA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dev: false + + /@typescript-eslint/typescript-estree/5.41.0_typescript@4.8.4: + resolution: {integrity: sha512-SlzFYRwFSvswzDSQ/zPkIWcHv8O5y42YUskko9c4ki+fV6HATsTODUPbRbcGDFYP86gaJL5xohUEytvyNNcXWg==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + typescript: '*' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@typescript-eslint/types': 5.41.0 + '@typescript-eslint/visitor-keys': 5.41.0 + debug: 4.3.4 + globby: 11.1.0 + is-glob: 4.0.3 + semver: 7.3.8 + tsutils: 3.21.0_typescript@4.8.4 + typescript: 4.8.4 + transitivePeerDependencies: + - supports-color + dev: false + + /@typescript-eslint/visitor-keys/5.41.0: + resolution: {integrity: sha512-vilqeHj267v8uzzakbm13HkPMl7cbYpKVjgFWZPIOHIJHZtinvypUhJ5xBXfWYg4eFKqztbMMpOgFpT9Gfx4fw==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dependencies: + '@typescript-eslint/types': 5.41.0 + eslint-visitor-keys: 3.3.0 + dev: false + + /@zodios/core/10.4.3_axios@1.1.3+zod@3.19.1: + resolution: {integrity: sha512-ejXyMMX8lOELFOlfsCpuHYhAE37UhCYKXBi75ifaWtObvdxuO2kcex5X2B6UOi6wmUKpcKOgbwlSZ96uZP53Fg==} + peerDependencies: + axios: ^0.x || ^1.0.0 + zod: ^3.x + dependencies: + axios: 1.1.3 + zod: 3.19.1 + dev: false + + /@zodios/express/10.4.2_za6leqvtaqdjr5gzlbrsemzpwi: + resolution: {integrity: sha512-s8hxGlVQZHpArPKFbnXbecj/HqTnbOOnYRIHgKBFbZouq9jhh41rmw9hxmTqjnMI6nK6U5gVkkN8u36OPBsyRQ==} + peerDependencies: + '@zodios/core': ^10.x + express: 4.x + zod: ^3.x + dependencies: + '@zodios/core': 10.4.3_axios@1.1.3+zod@3.19.1 + express: 4.18.2 + zod: 3.19.1 + dev: false + + /@zodios/react/10.3.3_tbpsitbqmenqxmwimr6kvnccvq: + resolution: {integrity: sha512-QAnlZVowIlSa0ezQtjr5wI84lJK7HifBtMTxmaEUiwrlOespdsz39IuojwUB+3G66kGTSbZLQcOhBPsiFPCvpQ==} + peerDependencies: + '@tanstack/react-query': 4.x + '@zodios/core': '>=10.2.0 <11.0.0' + react: '>=16.8.0' + dependencies: + '@tanstack/react-query': 4.13.0_biqbaboplfbrettd7655fr4n2y + '@zodios/core': 10.4.3_axios@1.1.3+zod@3.19.1 + react: 18.2.0 + dev: false + + /accepts/1.3.8: + resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==} + engines: {node: '>= 0.6'} + dependencies: + mime-types: 2.1.35 + negotiator: 0.6.3 + dev: false + + /acorn-jsx/5.3.2_acorn@7.4.1: + resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} + peerDependencies: + acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 + dependencies: + acorn: 7.4.1 + + /acorn/7.4.1: + resolution: {integrity: sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==} + engines: {node: '>=0.4.0'} + hasBin: true + + /ajv/6.12.6: + resolution: {integrity: sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==} + dependencies: + fast-deep-equal: 3.1.3 + fast-json-stable-stringify: 2.1.0 + json-schema-traverse: 0.4.1 + uri-js: 4.4.1 + + /ajv/8.11.0: + resolution: {integrity: sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==} + dependencies: + fast-deep-equal: 3.1.3 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + uri-js: 4.4.1 + + /ansi-colors/4.1.3: + resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} + engines: {node: '>=6'} + + /ansi-regex/5.0.1: + resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} + engines: {node: '>=8'} + + /ansi-styles/3.2.1: + resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} + engines: {node: '>=4'} + dependencies: + color-convert: 1.9.3 + + /ansi-styles/4.3.0: + resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} + engines: {node: '>=8'} + dependencies: + color-convert: 2.0.1 + + /argparse/1.0.10: + resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} + dependencies: + sprintf-js: 1.0.3 + + /aria-query/4.2.2: + resolution: {integrity: sha512-o/HelwhuKpTj/frsOsbNLNgnNGVIFsVP/SW2BSF14gVl7kAfMOJ6/8wUAUvG1R1NHKrfG+2sHZTu0yauT1qBrA==} + engines: {node: '>=6.0'} + dependencies: + '@babel/runtime': 7.20.0 + '@babel/runtime-corejs3': 7.20.0 + dev: false + + /array-flatten/1.1.1: + resolution: {integrity: sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==} + dev: false + + /array-includes/3.1.5: + resolution: {integrity: sha512-iSDYZMMyTPkiFasVqfuAQnWAYcvO/SeBSCGKePoEthjp4LEMTe4uLc7b025o4jAZpHhihh8xPo99TNWUWWkGDQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + es-abstract: 1.20.4 + get-intrinsic: 1.1.3 + is-string: 1.0.7 + dev: false + + /array-union/2.1.0: + resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} + engines: {node: '>=8'} + dev: false + + /array.prototype.flat/1.3.0: + resolution: {integrity: sha512-12IUEkHsAhA4DY5s0FPgNXIdc8VRSqD9Zp78a5au9abH/SOBrsp082JOWFNTjkMozh8mqcdiKuaLGhPeYztxSw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + es-abstract: 1.20.4 + es-shim-unscopables: 1.0.0 + dev: false + + /array.prototype.flatmap/1.3.0: + resolution: {integrity: sha512-PZC9/8TKAIxcWKdyeb77EzULHPrIX/tIZebLJUQOMR1OwYosT8yggdfWScfTBCDj5utONvOuPQQumYsU2ULbkg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + es-abstract: 1.20.4 + es-shim-unscopables: 1.0.0 + dev: false + + /ast-types-flow/0.0.7: + resolution: {integrity: sha512-eBvWn1lvIApYMhzQMsu9ciLfkBY499mFZlNqG+/9WR7PVlroQw0vG30cOQQbaKz3sCEc44TAOu2ykzqXSNnwag==} + dev: false + + /astral-regex/2.0.0: + resolution: {integrity: sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==} + engines: {node: '>=8'} + + /asynckit/0.4.0: + resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} + dev: false + + /axe-core/4.5.0: + resolution: {integrity: sha512-4+rr8eQ7+XXS5nZrKcMO/AikHL0hVqy+lHWAnE3xdHl+aguag8SOQ6eEqLexwLNWgXIMfunGuD3ON1/6Kyet0A==} + engines: {node: '>=4'} + dev: false + + /axios/1.1.3: + resolution: {integrity: sha512-00tXVRwKx/FZr/IDVFt4C+f9FYairX517WoGCL6dpOntqLkZofjhu43F/Xl44UOpqa+9sLFDrG/XAnFsUYgkDA==} + dependencies: + follow-redirects: 1.15.2 + form-data: 4.0.0 + proxy-from-env: 1.1.0 + transitivePeerDependencies: + - debug + dev: false + + /axobject-query/2.2.0: + resolution: {integrity: sha512-Td525n+iPOOyUQIeBfcASuG6uJsDOITl7Mds5gFyerkWiX7qhUTdYUBlSgNMyVqtSJqwpt1kXGLdUt6SykLMRA==} + dev: false + + /balanced-match/1.0.2: + resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} + + /body-parser/1.20.1: + resolution: {integrity: sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==} + engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} + dependencies: + bytes: 3.1.2 + content-type: 1.0.4 + debug: 2.6.9 + depd: 2.0.0 + destroy: 1.2.0 + http-errors: 2.0.0 + iconv-lite: 0.4.24 + on-finished: 2.4.1 + qs: 6.11.0 + raw-body: 2.5.1 + type-is: 1.6.18 + unpipe: 1.0.0 + transitivePeerDependencies: + - supports-color + dev: false + + /brace-expansion/1.1.11: + resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} + dependencies: + balanced-match: 1.0.2 + concat-map: 0.0.1 + + /braces/3.0.2: + resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} + engines: {node: '>=8'} + dependencies: + fill-range: 7.0.1 + dev: false + + /browserslist/4.21.4: + resolution: {integrity: sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw==} + engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} + hasBin: true + dependencies: + caniuse-lite: 1.0.30001426 + electron-to-chromium: 1.4.284 + node-releases: 2.0.6 + update-browserslist-db: 1.0.10_browserslist@4.21.4 + + /bytes/3.1.2: + resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==} + engines: {node: '>= 0.8'} + dev: false + + /call-bind/1.0.2: + resolution: {integrity: sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==} + dependencies: + function-bind: 1.1.1 + get-intrinsic: 1.1.3 + dev: false + + /callsites/3.1.0: + resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} + engines: {node: '>=6'} + + /caniuse-lite/1.0.30001426: + resolution: {integrity: sha512-n7cosrHLl8AWt0wwZw/PJZgUg3lV0gk9LMI7ikGJwhyhgsd2Nb65vKvmSexCqq/J7rbH3mFG6yZZiPR5dLPW5A==} + + /chalk/2.4.2: + resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} + engines: {node: '>=4'} + dependencies: + ansi-styles: 3.2.1 + escape-string-regexp: 1.0.5 + supports-color: 5.5.0 + + /chalk/4.1.2: + resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} + engines: {node: '>=10'} + dependencies: + ansi-styles: 4.3.0 + supports-color: 7.2.0 + + /client-only/0.0.1: + resolution: {integrity: sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==} + dev: false + + /color-convert/1.9.3: + resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} + dependencies: + color-name: 1.1.3 + + /color-convert/2.0.1: + resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} + engines: {node: '>=7.0.0'} + dependencies: + color-name: 1.1.4 + + /color-name/1.1.3: + resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==} + + /color-name/1.1.4: + resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} + + /combined-stream/1.0.8: + resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} + engines: {node: '>= 0.8'} + dependencies: + delayed-stream: 1.0.0 + dev: false + + /concat-map/0.0.1: + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} + + /content-disposition/0.5.4: + resolution: {integrity: sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==} + engines: {node: '>= 0.6'} + dependencies: + safe-buffer: 5.2.1 + dev: false + + /content-type/1.0.4: + resolution: {integrity: sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==} + engines: {node: '>= 0.6'} + dev: false + + /convert-source-map/1.9.0: + resolution: {integrity: sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==} + + /cookie-signature/1.0.6: + resolution: {integrity: sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==} + dev: false + + /cookie/0.5.0: + resolution: {integrity: sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==} + engines: {node: '>= 0.6'} + dev: false + + /core-js-pure/3.26.0: + resolution: {integrity: sha512-LiN6fylpVBVwT8twhhluD9TzXmZQQsr2I2eIKtWNbZI1XMfBT7CV18itaN6RA7EtQd/SDdRx/wzvAShX2HvhQA==} + requiresBuild: true + dev: false + + /cross-spawn/7.0.3: + resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} + engines: {node: '>= 8'} + dependencies: + path-key: 3.1.1 + shebang-command: 2.0.0 + which: 2.0.2 + + /csstype/3.1.1: + resolution: {integrity: sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==} + dev: true + + /damerau-levenshtein/1.0.8: + resolution: {integrity: sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==} + dev: false + + /debug/2.6.9: + resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.0.0 + dev: false + + /debug/3.2.7: + resolution: {integrity: sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.1.3 + dev: false + + /debug/4.3.4: + resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + dependencies: + ms: 2.1.2 + + /deep-is/0.1.4: + resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} + + /define-properties/1.1.4: + resolution: {integrity: sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==} + engines: {node: '>= 0.4'} + dependencies: + has-property-descriptors: 1.0.0 + object-keys: 1.1.1 + dev: false + + /delayed-stream/1.0.0: + resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} + engines: {node: '>=0.4.0'} + dev: false + + /depd/2.0.0: + resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==} + engines: {node: '>= 0.8'} + dev: false + + /destroy/1.2.0: + resolution: {integrity: sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==} + engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} + dev: false + + /dir-glob/3.0.1: + resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} + engines: {node: '>=8'} + dependencies: + path-type: 4.0.0 + dev: false + + /doctrine/2.1.0: + resolution: {integrity: sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==} + engines: {node: '>=0.10.0'} + dependencies: + esutils: 2.0.3 + dev: false + + /doctrine/3.0.0: + resolution: {integrity: sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==} + engines: {node: '>=6.0.0'} + dependencies: + esutils: 2.0.3 + + /ee-first/1.1.1: + resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} + dev: false + + /electron-to-chromium/1.4.284: + resolution: {integrity: sha512-M8WEXFuKXMYMVr45fo8mq0wUrrJHheiKZf6BArTKk9ZBYCKJEOU5H8cdWgDT+qCVZf7Na4lVUaZsA+h6uA9+PA==} + + /emoji-regex/8.0.0: + resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} + + /emoji-regex/9.2.2: + resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} + dev: false + + /encodeurl/1.0.2: + resolution: {integrity: sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==} + engines: {node: '>= 0.8'} + dev: false + + /enquirer/2.3.6: + resolution: {integrity: sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==} + engines: {node: '>=8.6'} + dependencies: + ansi-colors: 4.1.3 + + /es-abstract/1.20.4: + resolution: {integrity: sha512-0UtvRN79eMe2L+UNEF1BwRe364sj/DXhQ/k5FmivgoSdpM90b8Jc0mDzKMGo7QS0BVbOP/bTwBKNnDc9rNzaPA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + es-to-primitive: 1.2.1 + function-bind: 1.1.1 + function.prototype.name: 1.1.5 + get-intrinsic: 1.1.3 + get-symbol-description: 1.0.0 + has: 1.0.3 + has-property-descriptors: 1.0.0 + has-symbols: 1.0.3 + internal-slot: 1.0.3 + is-callable: 1.2.7 + is-negative-zero: 2.0.2 + is-regex: 1.1.4 + is-shared-array-buffer: 1.0.2 + is-string: 1.0.7 + is-weakref: 1.0.2 + object-inspect: 1.12.2 + object-keys: 1.1.1 + object.assign: 4.1.4 + regexp.prototype.flags: 1.4.3 + safe-regex-test: 1.0.0 + string.prototype.trimend: 1.0.5 + string.prototype.trimstart: 1.0.5 + unbox-primitive: 1.0.2 + dev: false + + /es-shim-unscopables/1.0.0: + resolution: {integrity: sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==} + dependencies: + has: 1.0.3 + dev: false + + /es-to-primitive/1.2.1: + resolution: {integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==} + engines: {node: '>= 0.4'} + dependencies: + is-callable: 1.2.7 + is-date-object: 1.0.5 + is-symbol: 1.0.4 + dev: false + + /escalade/3.1.1: + resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} + engines: {node: '>=6'} + + /escape-html/1.0.3: + resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==} + dev: false + + /escape-string-regexp/1.0.5: + resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} + engines: {node: '>=0.8.0'} + + /escape-string-regexp/4.0.0: + resolution: {integrity: sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==} + engines: {node: '>=10'} + + /eslint-config-next/12.3.1_3rubbgt5ekhqrcgx4uwls3neim: + resolution: {integrity: sha512-EN/xwKPU6jz1G0Qi6Bd/BqMnHLyRAL0VsaQaWA7F3KkjAgZHi4f1uL1JKGWNxdQpHTW/sdGONBd0bzxUka/DJg==} + peerDependencies: + eslint: ^7.23.0 || ^8.0.0 + typescript: '>=3.3.1' + peerDependenciesMeta: + typescript: + optional: true + dependencies: + '@next/eslint-plugin-next': 12.3.1 + '@rushstack/eslint-patch': 1.2.0 + '@typescript-eslint/parser': 5.41.0_3rubbgt5ekhqrcgx4uwls3neim + eslint: 7.32.0 + eslint-import-resolver-node: 0.3.6 + eslint-import-resolver-typescript: 2.7.1_hpmu7kn6tcn2vnxpfzvv33bxmy + eslint-plugin-import: 2.26.0_r6mdt2nwtavxychxvtdgpnclqq + eslint-plugin-jsx-a11y: 6.6.1_eslint@7.32.0 + eslint-plugin-react: 7.31.8_eslint@7.32.0 + eslint-plugin-react-hooks: 4.6.0_eslint@7.32.0 + typescript: 4.8.4 + transitivePeerDependencies: + - eslint-import-resolver-webpack + - supports-color + dev: false + + /eslint-config-prettier/8.5.0_eslint@7.32.0: + resolution: {integrity: sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==} + hasBin: true + peerDependencies: + eslint: '>=7.0.0' + dependencies: + eslint: 7.32.0 + dev: false + + /eslint-config-turbo/0.0.4_eslint@7.32.0: + resolution: {integrity: sha512-HErPS/wfWkSdV9Yd2dDkhZt3W2B78Ih/aWPFfaHmCMjzPalh+5KxRRGTf8MOBQLCebcWJX0lP1Zvc1rZIHlXGg==} + peerDependencies: + eslint: ^7.23.0 || ^8.0.0 + dependencies: + eslint: 7.32.0 + eslint-plugin-turbo: 0.0.4_eslint@7.32.0 + dev: false + + /eslint-import-resolver-node/0.3.6: + resolution: {integrity: sha512-0En0w03NRVMn9Uiyn8YRPDKvWjxCWkslUEhGNTdGx15RvPJYQ+lbOlqrlNI2vEAs4pDYK4f/HN2TbDmk5TP0iw==} + dependencies: + debug: 3.2.7 + resolve: 1.22.1 + transitivePeerDependencies: + - supports-color + dev: false + + /eslint-import-resolver-typescript/2.7.1_hpmu7kn6tcn2vnxpfzvv33bxmy: + resolution: {integrity: sha512-00UbgGwV8bSgUv34igBDbTOtKhqoRMy9bFjNehT40bXg6585PNIct8HhXZ0SybqB9rWtXj9crcku8ndDn/gIqQ==} + engines: {node: '>=4'} + peerDependencies: + eslint: '*' + eslint-plugin-import: '*' + dependencies: + debug: 4.3.4 + eslint: 7.32.0 + eslint-plugin-import: 2.26.0_r6mdt2nwtavxychxvtdgpnclqq + glob: 7.2.3 + is-glob: 4.0.3 + resolve: 1.22.1 + tsconfig-paths: 3.14.1 + transitivePeerDependencies: + - supports-color + dev: false + + /eslint-module-utils/2.7.4_hc2d46adw36jouofggb76llgoi: + resolution: {integrity: sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA==} + engines: {node: '>=4'} + peerDependencies: + '@typescript-eslint/parser': '*' + eslint: '*' + eslint-import-resolver-node: '*' + eslint-import-resolver-typescript: '*' + eslint-import-resolver-webpack: '*' + peerDependenciesMeta: + '@typescript-eslint/parser': + optional: true + eslint: + optional: true + eslint-import-resolver-node: + optional: true + eslint-import-resolver-typescript: + optional: true + eslint-import-resolver-webpack: + optional: true + dependencies: + '@typescript-eslint/parser': 5.41.0_3rubbgt5ekhqrcgx4uwls3neim + debug: 3.2.7 + eslint: 7.32.0 + eslint-import-resolver-node: 0.3.6 + eslint-import-resolver-typescript: 2.7.1_hpmu7kn6tcn2vnxpfzvv33bxmy + transitivePeerDependencies: + - supports-color + dev: false + + /eslint-plugin-import/2.26.0_r6mdt2nwtavxychxvtdgpnclqq: + resolution: {integrity: sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA==} + engines: {node: '>=4'} + peerDependencies: + '@typescript-eslint/parser': '*' + eslint: ^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8 + peerDependenciesMeta: + '@typescript-eslint/parser': + optional: true + dependencies: + '@typescript-eslint/parser': 5.41.0_3rubbgt5ekhqrcgx4uwls3neim + array-includes: 3.1.5 + array.prototype.flat: 1.3.0 + debug: 2.6.9 + doctrine: 2.1.0 + eslint: 7.32.0 + eslint-import-resolver-node: 0.3.6 + eslint-module-utils: 2.7.4_hc2d46adw36jouofggb76llgoi + has: 1.0.3 + is-core-module: 2.11.0 + is-glob: 4.0.3 + minimatch: 3.1.2 + object.values: 1.1.5 + resolve: 1.22.1 + tsconfig-paths: 3.14.1 + transitivePeerDependencies: + - eslint-import-resolver-typescript + - eslint-import-resolver-webpack + - supports-color + dev: false + + /eslint-plugin-jsx-a11y/6.6.1_eslint@7.32.0: + resolution: {integrity: sha512-sXgFVNHiWffBq23uiS/JaP6eVR622DqwB4yTzKvGZGcPq6/yZ3WmOZfuBks/vHWo9GaFOqC2ZK4i6+C35knx7Q==} + engines: {node: '>=4.0'} + peerDependencies: + eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 + dependencies: + '@babel/runtime': 7.20.0 + aria-query: 4.2.2 + array-includes: 3.1.5 + ast-types-flow: 0.0.7 + axe-core: 4.5.0 + axobject-query: 2.2.0 + damerau-levenshtein: 1.0.8 + emoji-regex: 9.2.2 + eslint: 7.32.0 + has: 1.0.3 + jsx-ast-utils: 3.3.3 + language-tags: 1.0.5 + minimatch: 3.1.2 + semver: 6.3.0 + dev: false + + /eslint-plugin-react-hooks/4.6.0_eslint@7.32.0: + resolution: {integrity: sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g==} + engines: {node: '>=10'} + peerDependencies: + eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 + dependencies: + eslint: 7.32.0 + dev: false + + /eslint-plugin-react/7.31.8_eslint@7.32.0: + resolution: {integrity: sha512-5lBTZmgQmARLLSYiwI71tiGVTLUuqXantZM6vlSY39OaDSV0M7+32K5DnLkmFrwTe+Ksz0ffuLUC91RUviVZfw==} + engines: {node: '>=4'} + peerDependencies: + eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 + dependencies: + array-includes: 3.1.5 + array.prototype.flatmap: 1.3.0 + doctrine: 2.1.0 + eslint: 7.32.0 + estraverse: 5.3.0 + jsx-ast-utils: 3.3.3 + minimatch: 3.1.2 + object.entries: 1.1.5 + object.fromentries: 2.0.5 + object.hasown: 1.1.1 + object.values: 1.1.5 + prop-types: 15.8.1 + resolve: 2.0.0-next.4 + semver: 6.3.0 + string.prototype.matchall: 4.0.7 + dev: false + + /eslint-plugin-turbo/0.0.4_eslint@7.32.0: + resolution: {integrity: sha512-dfmYE/iPvoJInQq+5E/0mj140y/rYwKtzZkn3uVK8+nvwC5zmWKQ6ehMWrL4bYBkGzSgpOndZM+jOXhPQ2m8Cg==} + peerDependencies: + eslint: ^7.23.0 || ^8.0.0 + dependencies: + eslint: 7.32.0 + dev: false + + /eslint-scope/5.1.1: + resolution: {integrity: sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==} + engines: {node: '>=8.0.0'} + dependencies: + esrecurse: 4.3.0 + estraverse: 4.3.0 + + /eslint-utils/2.1.0: + resolution: {integrity: sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==} + engines: {node: '>=6'} + dependencies: + eslint-visitor-keys: 1.3.0 + + /eslint-visitor-keys/1.3.0: + resolution: {integrity: sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==} + engines: {node: '>=4'} + + /eslint-visitor-keys/2.1.0: + resolution: {integrity: sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==} + engines: {node: '>=10'} + + /eslint-visitor-keys/3.3.0: + resolution: {integrity: sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + dev: false + + /eslint/7.32.0: + resolution: {integrity: sha512-VHZ8gX+EDfz+97jGcgyGCyRia/dPOd6Xh9yPv8Bl1+SoaIwD+a/vlrOmGRUyOYu7MwUhc7CxqeaDZU13S4+EpA==} + engines: {node: ^10.12.0 || >=12.0.0} + hasBin: true + dependencies: + '@babel/code-frame': 7.12.11 + '@eslint/eslintrc': 0.4.3 + '@humanwhocodes/config-array': 0.5.0 + ajv: 6.12.6 + chalk: 4.1.2 + cross-spawn: 7.0.3 + debug: 4.3.4 + doctrine: 3.0.0 + enquirer: 2.3.6 + escape-string-regexp: 4.0.0 + eslint-scope: 5.1.1 + eslint-utils: 2.1.0 + eslint-visitor-keys: 2.1.0 + espree: 7.3.1 + esquery: 1.4.0 + esutils: 2.0.3 + fast-deep-equal: 3.1.3 + file-entry-cache: 6.0.1 + functional-red-black-tree: 1.0.1 + glob-parent: 5.1.2 + globals: 13.17.0 + ignore: 4.0.6 + import-fresh: 3.3.0 + imurmurhash: 0.1.4 + is-glob: 4.0.3 + js-yaml: 3.14.1 + json-stable-stringify-without-jsonify: 1.0.1 + levn: 0.4.1 + lodash.merge: 4.6.2 + minimatch: 3.1.2 + natural-compare: 1.4.0 + optionator: 0.9.1 + progress: 2.0.3 + regexpp: 3.2.0 + semver: 7.3.8 + strip-ansi: 6.0.1 + strip-json-comments: 3.1.1 + table: 6.8.0 + text-table: 0.2.0 + v8-compile-cache: 2.3.0 + transitivePeerDependencies: + - supports-color + + /espree/7.3.1: + resolution: {integrity: sha512-v3JCNCE64umkFpmkFGqzVKsOT0tN1Zr+ueqLZfpV1Ob8e+CEgPWa+OxCoGH3tnhimMKIaBm4m/vaRpJ/krRz2g==} + engines: {node: ^10.12.0 || >=12.0.0} + dependencies: + acorn: 7.4.1 + acorn-jsx: 5.3.2_acorn@7.4.1 + eslint-visitor-keys: 1.3.0 + + /esprima/4.0.1: + resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} + engines: {node: '>=4'} + hasBin: true + + /esquery/1.4.0: + resolution: {integrity: sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==} + engines: {node: '>=0.10'} + dependencies: + estraverse: 5.3.0 + + /esrecurse/4.3.0: + resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} + engines: {node: '>=4.0'} + dependencies: + estraverse: 5.3.0 + + /estraverse/4.3.0: + resolution: {integrity: sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==} + engines: {node: '>=4.0'} + + /estraverse/5.3.0: + resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} + engines: {node: '>=4.0'} + + /esutils/2.0.3: + resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} + engines: {node: '>=0.10.0'} + + /etag/1.8.1: + resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==} + engines: {node: '>= 0.6'} + dev: false + + /express/4.18.2: + resolution: {integrity: sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==} + engines: {node: '>= 0.10.0'} + dependencies: + accepts: 1.3.8 + array-flatten: 1.1.1 + body-parser: 1.20.1 + content-disposition: 0.5.4 + content-type: 1.0.4 + cookie: 0.5.0 + cookie-signature: 1.0.6 + debug: 2.6.9 + depd: 2.0.0 + encodeurl: 1.0.2 + escape-html: 1.0.3 + etag: 1.8.1 + finalhandler: 1.2.0 + fresh: 0.5.2 + http-errors: 2.0.0 + merge-descriptors: 1.0.1 + methods: 1.1.2 + on-finished: 2.4.1 + parseurl: 1.3.3 + path-to-regexp: 0.1.7 + proxy-addr: 2.0.7 + qs: 6.11.0 + range-parser: 1.2.1 + safe-buffer: 5.2.1 + send: 0.18.0 + serve-static: 1.15.0 + setprototypeof: 1.2.0 + statuses: 2.0.1 + type-is: 1.6.18 + utils-merge: 1.0.1 + vary: 1.1.2 + transitivePeerDependencies: + - supports-color + dev: false + + /fast-deep-equal/3.1.3: + resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} + + /fast-glob/3.2.12: + resolution: {integrity: sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==} + engines: {node: '>=8.6.0'} + dependencies: + '@nodelib/fs.stat': 2.0.5 + '@nodelib/fs.walk': 1.2.8 + glob-parent: 5.1.2 + merge2: 1.4.1 + micromatch: 4.0.5 + dev: false + + /fast-json-stable-stringify/2.1.0: + resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} + + /fast-levenshtein/2.0.6: + resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} + + /fastq/1.13.0: + resolution: {integrity: sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==} + dependencies: + reusify: 1.0.4 + dev: false + + /file-entry-cache/6.0.1: + resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} + engines: {node: ^10.12.0 || >=12.0.0} + dependencies: + flat-cache: 3.0.4 + + /fill-range/7.0.1: + resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} + engines: {node: '>=8'} + dependencies: + to-regex-range: 5.0.1 + dev: false + + /finalhandler/1.2.0: + resolution: {integrity: sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==} + engines: {node: '>= 0.8'} + dependencies: + debug: 2.6.9 + encodeurl: 1.0.2 + escape-html: 1.0.3 + on-finished: 2.4.1 + parseurl: 1.3.3 + statuses: 2.0.1 + unpipe: 1.0.0 + transitivePeerDependencies: + - supports-color + dev: false + + /flat-cache/3.0.4: + resolution: {integrity: sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==} + engines: {node: ^10.12.0 || >=12.0.0} + dependencies: + flatted: 3.2.7 + rimraf: 3.0.2 + + /flatted/3.2.7: + resolution: {integrity: sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==} + + /follow-redirects/1.15.2: + resolution: {integrity: sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==} + engines: {node: '>=4.0'} + peerDependencies: + debug: '*' + peerDependenciesMeta: + debug: + optional: true + dev: false + + /form-data/4.0.0: + resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} + engines: {node: '>= 6'} + dependencies: + asynckit: 0.4.0 + combined-stream: 1.0.8 + mime-types: 2.1.35 + dev: false + + /forwarded/0.2.0: + resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==} + engines: {node: '>= 0.6'} + dev: false + + /fresh/0.5.2: + resolution: {integrity: sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==} + engines: {node: '>= 0.6'} + dev: false + + /fs.realpath/1.0.0: + resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} + + /function-bind/1.1.1: + resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} + dev: false + + /function.prototype.name/1.1.5: + resolution: {integrity: sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + es-abstract: 1.20.4 + functions-have-names: 1.2.3 + dev: false + + /functional-red-black-tree/1.0.1: + resolution: {integrity: sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==} + + /functions-have-names/1.2.3: + resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} + dev: false + + /gensync/1.0.0-beta.2: + resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} + engines: {node: '>=6.9.0'} + + /get-intrinsic/1.1.3: + resolution: {integrity: sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A==} + dependencies: + function-bind: 1.1.1 + has: 1.0.3 + has-symbols: 1.0.3 + dev: false + + /get-symbol-description/1.0.0: + resolution: {integrity: sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + get-intrinsic: 1.1.3 + dev: false + + /glob-parent/5.1.2: + resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} + engines: {node: '>= 6'} + dependencies: + is-glob: 4.0.3 + + /glob/7.1.7: + resolution: {integrity: sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==} + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.2 + once: 1.4.0 + path-is-absolute: 1.0.1 + dev: false + + /glob/7.2.3: + resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + dependencies: + fs.realpath: 1.0.0 + inflight: 1.0.6 + inherits: 2.0.4 + minimatch: 3.1.2 + once: 1.4.0 + path-is-absolute: 1.0.1 + + /globals/11.12.0: + resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} + engines: {node: '>=4'} + + /globals/13.17.0: + resolution: {integrity: sha512-1C+6nQRb1GwGMKm2dH/E7enFAMxGTmGI7/dEdhy/DNelv85w9B72t3uc5frtMNXIbzrarJJ/lTCjcaZwbLJmyw==} + engines: {node: '>=8'} + dependencies: + type-fest: 0.20.2 + + /globby/11.1.0: + resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} + engines: {node: '>=10'} + dependencies: + array-union: 2.1.0 + dir-glob: 3.0.1 + fast-glob: 3.2.12 + ignore: 5.2.0 + merge2: 1.4.1 + slash: 3.0.0 + dev: false + + /has-bigints/1.0.2: + resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==} + dev: false + + /has-flag/3.0.0: + resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} + engines: {node: '>=4'} + + /has-flag/4.0.0: + resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} + engines: {node: '>=8'} + + /has-property-descriptors/1.0.0: + resolution: {integrity: sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==} + dependencies: + get-intrinsic: 1.1.3 + dev: false + + /has-symbols/1.0.3: + resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} + engines: {node: '>= 0.4'} + dev: false + + /has-tostringtag/1.0.0: + resolution: {integrity: sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==} + engines: {node: '>= 0.4'} + dependencies: + has-symbols: 1.0.3 + dev: false + + /has/1.0.3: + resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==} + engines: {node: '>= 0.4.0'} + dependencies: + function-bind: 1.1.1 + dev: false + + /http-errors/2.0.0: + resolution: {integrity: sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==} + engines: {node: '>= 0.8'} + dependencies: + depd: 2.0.0 + inherits: 2.0.4 + setprototypeof: 1.2.0 + statuses: 2.0.1 + toidentifier: 1.0.1 + dev: false + + /iconv-lite/0.4.24: + resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} + engines: {node: '>=0.10.0'} + dependencies: + safer-buffer: 2.1.2 + dev: false + + /ignore/4.0.6: + resolution: {integrity: sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==} + engines: {node: '>= 4'} + + /ignore/5.2.0: + resolution: {integrity: sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==} + engines: {node: '>= 4'} + dev: false + + /import-fresh/3.3.0: + resolution: {integrity: sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==} + engines: {node: '>=6'} + dependencies: + parent-module: 1.0.1 + resolve-from: 4.0.0 + + /imurmurhash/0.1.4: + resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} + engines: {node: '>=0.8.19'} + + /inflight/1.0.6: + resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} + dependencies: + once: 1.4.0 + wrappy: 1.0.2 + + /inherits/2.0.4: + resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + + /internal-slot/1.0.3: + resolution: {integrity: sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==} + engines: {node: '>= 0.4'} + dependencies: + get-intrinsic: 1.1.3 + has: 1.0.3 + side-channel: 1.0.4 + dev: false + + /ipaddr.js/1.9.1: + resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==} + engines: {node: '>= 0.10'} + dev: false + + /is-bigint/1.0.4: + resolution: {integrity: sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==} + dependencies: + has-bigints: 1.0.2 + dev: false + + /is-boolean-object/1.1.2: + resolution: {integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + has-tostringtag: 1.0.0 + dev: false + + /is-callable/1.2.7: + resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} + engines: {node: '>= 0.4'} + dev: false + + /is-core-module/2.11.0: + resolution: {integrity: sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==} + dependencies: + has: 1.0.3 + dev: false + + /is-date-object/1.0.5: + resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==} + engines: {node: '>= 0.4'} + dependencies: + has-tostringtag: 1.0.0 + dev: false + + /is-extglob/2.1.1: + resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} + engines: {node: '>=0.10.0'} + + /is-fullwidth-code-point/3.0.0: + resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} + engines: {node: '>=8'} + + /is-glob/4.0.3: + resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} + engines: {node: '>=0.10.0'} + dependencies: + is-extglob: 2.1.1 + + /is-negative-zero/2.0.2: + resolution: {integrity: sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==} + engines: {node: '>= 0.4'} + dev: false + + /is-number-object/1.0.7: + resolution: {integrity: sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==} + engines: {node: '>= 0.4'} + dependencies: + has-tostringtag: 1.0.0 + dev: false + + /is-number/7.0.0: + resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} + engines: {node: '>=0.12.0'} + dev: false + + /is-regex/1.1.4: + resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + has-tostringtag: 1.0.0 + dev: false + + /is-shared-array-buffer/1.0.2: + resolution: {integrity: sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==} + dependencies: + call-bind: 1.0.2 + dev: false + + /is-string/1.0.7: + resolution: {integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==} + engines: {node: '>= 0.4'} + dependencies: + has-tostringtag: 1.0.0 + dev: false + + /is-symbol/1.0.4: + resolution: {integrity: sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==} + engines: {node: '>= 0.4'} + dependencies: + has-symbols: 1.0.3 + dev: false + + /is-weakref/1.0.2: + resolution: {integrity: sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==} + dependencies: + call-bind: 1.0.2 + dev: false + + /isexe/2.0.0: + resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} + + /js-tokens/4.0.0: + resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} + + /js-yaml/3.14.1: + resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} + hasBin: true + dependencies: + argparse: 1.0.10 + esprima: 4.0.1 + + /jsesc/2.5.2: + resolution: {integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==} + engines: {node: '>=4'} + hasBin: true + + /json-schema-traverse/0.4.1: + resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} + + /json-schema-traverse/1.0.0: + resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} + + /json-stable-stringify-without-jsonify/1.0.1: + resolution: {integrity: sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==} + + /json5/1.0.1: + resolution: {integrity: sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==} + hasBin: true + dependencies: + minimist: 1.2.7 + dev: false + + /json5/2.2.1: + resolution: {integrity: sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==} + engines: {node: '>=6'} + hasBin: true + + /jsx-ast-utils/3.3.3: + resolution: {integrity: sha512-fYQHZTZ8jSfmWZ0iyzfwiU4WDX4HpHbMCZ3gPlWYiCl3BoeOTsqKBqnTVfH2rYT7eP5c3sVbeSPHnnJOaTrWiw==} + engines: {node: '>=4.0'} + dependencies: + array-includes: 3.1.5 + object.assign: 4.1.4 + dev: false + + /language-subtag-registry/0.3.22: + resolution: {integrity: sha512-tN0MCzyWnoz/4nHS6uxdlFWoUZT7ABptwKPQ52Ea7URk6vll88bWBVhodtnlfEuCcKWNGoc+uGbw1cwa9IKh/w==} + dev: false + + /language-tags/1.0.5: + resolution: {integrity: sha512-qJhlO9cGXi6hBGKoxEG/sKZDAHD5Hnu9Hs4WbOY3pCWXDhw0N8x1NenNzm2EnNLkLkk7J2SdxAkDSbb6ftT+UQ==} + dependencies: + language-subtag-registry: 0.3.22 + dev: false + + /levn/0.4.1: + resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} + engines: {node: '>= 0.8.0'} + dependencies: + prelude-ls: 1.2.1 + type-check: 0.4.0 + + /lodash.merge/4.6.2: + resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} + + /lodash.truncate/4.4.2: + resolution: {integrity: sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==} + + /loose-envify/1.4.0: + resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} + hasBin: true + dependencies: + js-tokens: 4.0.0 + + /lru-cache/6.0.0: + resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} + engines: {node: '>=10'} + dependencies: + yallist: 4.0.0 + + /media-typer/0.3.0: + resolution: {integrity: sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==} + engines: {node: '>= 0.6'} + dev: false + + /merge-descriptors/1.0.1: + resolution: {integrity: sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==} + dev: false + + /merge2/1.4.1: + resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} + engines: {node: '>= 8'} + dev: false + + /methods/1.1.2: + resolution: {integrity: sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==} + engines: {node: '>= 0.6'} + dev: false + + /micromatch/4.0.5: + resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} + engines: {node: '>=8.6'} + dependencies: + braces: 3.0.2 + picomatch: 2.3.1 + dev: false + + /mime-db/1.52.0: + resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} + engines: {node: '>= 0.6'} + dev: false + + /mime-types/2.1.35: + resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} + engines: {node: '>= 0.6'} + dependencies: + mime-db: 1.52.0 + dev: false + + /mime/1.6.0: + resolution: {integrity: sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==} + engines: {node: '>=4'} + hasBin: true + dev: false + + /minimatch/3.1.2: + resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} + dependencies: + brace-expansion: 1.1.11 + + /minimist/1.2.7: + resolution: {integrity: sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==} + dev: false + + /ms/2.0.0: + resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} + dev: false + + /ms/2.1.2: + resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} + + /ms/2.1.3: + resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + dev: false + + /nanoid/3.3.4: + resolution: {integrity: sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==} + engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} + hasBin: true + dev: false + + /natural-compare/1.4.0: + resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} + + /negotiator/0.6.3: + resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==} + engines: {node: '>= 0.6'} + dev: false + + /next/12.3.1_qtpcxnaaarbm4ws7ughq6oxfve: + resolution: {integrity: sha512-l7bvmSeIwX5lp07WtIiP9u2ytZMv7jIeB8iacR28PuUEFG5j0HGAPnMqyG5kbZNBG2H7tRsrQ4HCjuMOPnANZw==} + engines: {node: '>=12.22.0'} + hasBin: true + peerDependencies: + fibers: '>= 3.1.0' + node-sass: ^6.0.0 || ^7.0.0 + react: ^17.0.2 || ^18.0.0-0 + react-dom: ^17.0.2 || ^18.0.0-0 + sass: ^1.3.0 + peerDependenciesMeta: + fibers: + optional: true + node-sass: + optional: true + sass: + optional: true + dependencies: + '@next/env': 12.3.1 + '@swc/helpers': 0.4.11 + caniuse-lite: 1.0.30001426 + postcss: 8.4.14 + react: 18.2.0 + react-dom: 18.2.0_react@18.2.0 + styled-jsx: 5.0.7_otspjrsspon4ofp37rshhlhp2y + use-sync-external-store: 1.2.0_react@18.2.0 + optionalDependencies: + '@next/swc-android-arm-eabi': 12.3.1 + '@next/swc-android-arm64': 12.3.1 + '@next/swc-darwin-arm64': 12.3.1 + '@next/swc-darwin-x64': 12.3.1 + '@next/swc-freebsd-x64': 12.3.1 + '@next/swc-linux-arm-gnueabihf': 12.3.1 + '@next/swc-linux-arm64-gnu': 12.3.1 + '@next/swc-linux-arm64-musl': 12.3.1 + '@next/swc-linux-x64-gnu': 12.3.1 + '@next/swc-linux-x64-musl': 12.3.1 + '@next/swc-win32-arm64-msvc': 12.3.1 + '@next/swc-win32-ia32-msvc': 12.3.1 + '@next/swc-win32-x64-msvc': 12.3.1 + transitivePeerDependencies: + - '@babel/core' + - babel-plugin-macros + dev: false + + /next/12.3.2-canary.40_qtpcxnaaarbm4ws7ughq6oxfve: + resolution: {integrity: sha512-TDIosDIpEC3IaRwwUuQ8ypUxYG7zyIGEN14UW0Y77/gpO20BwbR/0q3ZzHt+4W5JRF7vXZly62xTMMH1hVJHFA==} + engines: {node: '>=14.0.0'} + hasBin: true + peerDependencies: + fibers: '>= 3.1.0' + node-sass: ^6.0.0 || ^7.0.0 + react: ^18.0.0-0 + react-dom: ^18.0.0-0 + sass: ^1.3.0 + peerDependenciesMeta: + fibers: + optional: true + node-sass: + optional: true + sass: + optional: true + dependencies: + '@next/env': 12.3.2-canary.40 + '@swc/helpers': 0.4.11 + caniuse-lite: 1.0.30001426 + postcss: 8.4.14 + react: 18.2.0 + react-dom: 18.2.0_react@18.2.0 + styled-jsx: 5.1.0_otspjrsspon4ofp37rshhlhp2y + use-sync-external-store: 1.2.0_react@18.2.0 + optionalDependencies: + '@next/swc-android-arm-eabi': 12.3.2-canary.40 + '@next/swc-android-arm64': 12.3.2-canary.40 + '@next/swc-darwin-arm64': 12.3.2-canary.40 + '@next/swc-darwin-x64': 12.3.2-canary.40 + '@next/swc-freebsd-x64': 12.3.2-canary.40 + '@next/swc-linux-arm-gnueabihf': 12.3.2-canary.40 + '@next/swc-linux-arm64-gnu': 12.3.2-canary.40 + '@next/swc-linux-arm64-musl': 12.3.2-canary.40 + '@next/swc-linux-x64-gnu': 12.3.2-canary.40 + '@next/swc-linux-x64-musl': 12.3.2-canary.40 + '@next/swc-win32-arm64-msvc': 12.3.2-canary.40 + '@next/swc-win32-ia32-msvc': 12.3.2-canary.40 + '@next/swc-win32-x64-msvc': 12.3.2-canary.40 + transitivePeerDependencies: + - '@babel/core' + - babel-plugin-macros + dev: false + + /node-releases/2.0.6: + resolution: {integrity: sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg==} + + /object-assign/4.1.1: + resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} + engines: {node: '>=0.10.0'} + dev: false + + /object-inspect/1.12.2: + resolution: {integrity: sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==} + dev: false + + /object-keys/1.1.1: + resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} + engines: {node: '>= 0.4'} + dev: false + + /object.assign/4.1.4: + resolution: {integrity: sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + has-symbols: 1.0.3 + object-keys: 1.1.1 + dev: false + + /object.entries/1.1.5: + resolution: {integrity: sha512-TyxmjUoZggd4OrrU1W66FMDG6CuqJxsFvymeyXI51+vQLN67zYfZseptRge703kKQdo4uccgAKebXFcRCzk4+g==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + es-abstract: 1.20.4 + dev: false + + /object.fromentries/2.0.5: + resolution: {integrity: sha512-CAyG5mWQRRiBU57Re4FKoTBjXfDoNwdFVH2Y1tS9PqCsfUTymAohOkEMSG3aRNKmv4lV3O7p1et7c187q6bynw==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + es-abstract: 1.20.4 + dev: false + + /object.hasown/1.1.1: + resolution: {integrity: sha512-LYLe4tivNQzq4JdaWW6WO3HMZZJWzkkH8fnI6EebWl0VZth2wL2Lovm74ep2/gZzlaTdV62JZHEqHQ2yVn8Q/A==} + dependencies: + define-properties: 1.1.4 + es-abstract: 1.20.4 + dev: false + + /object.values/1.1.5: + resolution: {integrity: sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + es-abstract: 1.20.4 + dev: false + + /on-finished/2.4.1: + resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==} + engines: {node: '>= 0.8'} + dependencies: + ee-first: 1.1.1 + dev: false + + /once/1.4.0: + resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} + dependencies: + wrappy: 1.0.2 + + /optionator/0.9.1: + resolution: {integrity: sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==} + engines: {node: '>= 0.8.0'} + dependencies: + deep-is: 0.1.4 + fast-levenshtein: 2.0.6 + levn: 0.4.1 + prelude-ls: 1.2.1 + type-check: 0.4.0 + word-wrap: 1.2.3 + + /parent-module/1.0.1: + resolution: {integrity: sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==} + engines: {node: '>=6'} + dependencies: + callsites: 3.1.0 + + /parseurl/1.3.3: + resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==} + engines: {node: '>= 0.8'} + dev: false + + /path-is-absolute/1.0.1: + resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} + engines: {node: '>=0.10.0'} + + /path-key/3.1.1: + resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} + engines: {node: '>=8'} + + /path-parse/1.0.7: + resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} + dev: false + + /path-to-regexp/0.1.7: + resolution: {integrity: sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==} + dev: false + + /path-type/4.0.0: + resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} + engines: {node: '>=8'} + dev: false + + /picocolors/1.0.0: + resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} + + /picomatch/2.3.1: + resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} + engines: {node: '>=8.6'} + dev: false + + /postcss/8.4.14: + resolution: {integrity: sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig==} + engines: {node: ^10 || ^12 || >=14} + dependencies: + nanoid: 3.3.4 + picocolors: 1.0.0 + source-map-js: 1.0.2 + dev: false + + /prelude-ls/1.2.1: + resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} + engines: {node: '>= 0.8.0'} + + /prettier/2.7.1: + resolution: {integrity: sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==} + engines: {node: '>=10.13.0'} + hasBin: true + dev: true + + /progress/2.0.3: + resolution: {integrity: sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==} + engines: {node: '>=0.4.0'} + + /prop-types/15.8.1: + resolution: {integrity: sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==} + dependencies: + loose-envify: 1.4.0 + object-assign: 4.1.1 + react-is: 16.13.1 + dev: false + + /proxy-addr/2.0.7: + resolution: {integrity: sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==} + engines: {node: '>= 0.10'} + dependencies: + forwarded: 0.2.0 + ipaddr.js: 1.9.1 + dev: false + + /proxy-from-env/1.1.0: + resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} + dev: false + + /punycode/2.1.1: + resolution: {integrity: sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==} + engines: {node: '>=6'} + + /qs/6.11.0: + resolution: {integrity: sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==} + engines: {node: '>=0.6'} + dependencies: + side-channel: 1.0.4 + dev: false + + /queue-microtask/1.2.3: + resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} + dev: false + + /range-parser/1.2.1: + resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==} + engines: {node: '>= 0.6'} + dev: false + + /raw-body/2.5.1: + resolution: {integrity: sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==} + engines: {node: '>= 0.8'} + dependencies: + bytes: 3.1.2 + http-errors: 2.0.0 + iconv-lite: 0.4.24 + unpipe: 1.0.0 + dev: false + + /react-dom/18.2.0_react@18.2.0: + resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} + peerDependencies: + react: ^18.2.0 + dependencies: + loose-envify: 1.4.0 + react: 18.2.0 + scheduler: 0.23.0 + dev: false + + /react-is/16.13.1: + resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==} + dev: false + + /react/18.2.0: + resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} + engines: {node: '>=0.10.0'} + dependencies: + loose-envify: 1.4.0 + + /regenerator-runtime/0.13.10: + resolution: {integrity: sha512-KepLsg4dU12hryUO7bp/axHAKvwGOCV0sGloQtpagJ12ai+ojVDqkeGSiRX1zlq+kjIMZ1t7gpze+26QqtdGqw==} + dev: false + + /regexp.prototype.flags/1.4.3: + resolution: {integrity: sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + functions-have-names: 1.2.3 + dev: false + + /regexpp/3.2.0: + resolution: {integrity: sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==} + engines: {node: '>=8'} + + /require-from-string/2.0.2: + resolution: {integrity: sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==} + engines: {node: '>=0.10.0'} + + /resolve-from/4.0.0: + resolution: {integrity: sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==} + engines: {node: '>=4'} + + /resolve/1.22.1: + resolution: {integrity: sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==} + hasBin: true + dependencies: + is-core-module: 2.11.0 + path-parse: 1.0.7 + supports-preserve-symlinks-flag: 1.0.0 + dev: false + + /resolve/2.0.0-next.4: + resolution: {integrity: sha512-iMDbmAWtfU+MHpxt/I5iWI7cY6YVEZUQ3MBgPQ++XD1PELuJHIl82xBmObyP2KyQmkNB2dsqF7seoQQiAn5yDQ==} + hasBin: true + dependencies: + is-core-module: 2.11.0 + path-parse: 1.0.7 + supports-preserve-symlinks-flag: 1.0.0 + dev: false + + /reusify/1.0.4: + resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} + engines: {iojs: '>=1.0.0', node: '>=0.10.0'} + dev: false + + /rimraf/3.0.2: + resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} + hasBin: true + dependencies: + glob: 7.2.3 + + /run-parallel/1.2.0: + resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} + dependencies: + queue-microtask: 1.2.3 + dev: false + + /safe-buffer/5.2.1: + resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} + dev: false + + /safe-regex-test/1.0.0: + resolution: {integrity: sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==} + dependencies: + call-bind: 1.0.2 + get-intrinsic: 1.1.3 + is-regex: 1.1.4 + dev: false + + /safer-buffer/2.1.2: + resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} + dev: false + + /scheduler/0.23.0: + resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==} + dependencies: + loose-envify: 1.4.0 + dev: false + + /semver/6.3.0: + resolution: {integrity: sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==} + hasBin: true + + /semver/7.3.8: + resolution: {integrity: sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==} + engines: {node: '>=10'} + hasBin: true + dependencies: + lru-cache: 6.0.0 + + /send/0.18.0: + resolution: {integrity: sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==} + engines: {node: '>= 0.8.0'} + dependencies: + debug: 2.6.9 + depd: 2.0.0 + destroy: 1.2.0 + encodeurl: 1.0.2 + escape-html: 1.0.3 + etag: 1.8.1 + fresh: 0.5.2 + http-errors: 2.0.0 + mime: 1.6.0 + ms: 2.1.3 + on-finished: 2.4.1 + range-parser: 1.2.1 + statuses: 2.0.1 + transitivePeerDependencies: + - supports-color + dev: false + + /serve-static/1.15.0: + resolution: {integrity: sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==} + engines: {node: '>= 0.8.0'} + dependencies: + encodeurl: 1.0.2 + escape-html: 1.0.3 + parseurl: 1.3.3 + send: 0.18.0 + transitivePeerDependencies: + - supports-color + dev: false + + /setprototypeof/1.2.0: + resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==} + dev: false + + /shebang-command/2.0.0: + resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} + engines: {node: '>=8'} + dependencies: + shebang-regex: 3.0.0 + + /shebang-regex/3.0.0: + resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} + engines: {node: '>=8'} + + /side-channel/1.0.4: + resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==} + dependencies: + call-bind: 1.0.2 + get-intrinsic: 1.1.3 + object-inspect: 1.12.2 + dev: false + + /slash/3.0.0: + resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} + engines: {node: '>=8'} + dev: false + + /slice-ansi/4.0.0: + resolution: {integrity: sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==} + engines: {node: '>=10'} + dependencies: + ansi-styles: 4.3.0 + astral-regex: 2.0.0 + is-fullwidth-code-point: 3.0.0 + + /source-map-js/1.0.2: + resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} + engines: {node: '>=0.10.0'} + dev: false + + /sprintf-js/1.0.3: + resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} + + /statuses/2.0.1: + resolution: {integrity: sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==} + engines: {node: '>= 0.8'} + dev: false + + /string-width/4.2.3: + resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} + engines: {node: '>=8'} + dependencies: + emoji-regex: 8.0.0 + is-fullwidth-code-point: 3.0.0 + strip-ansi: 6.0.1 + + /string.prototype.matchall/4.0.7: + resolution: {integrity: sha512-f48okCX7JiwVi1NXCVWcFnZgADDC/n2vePlQ/KUCNqCikLLilQvwjMO8+BHVKvgzH0JB0J9LEPgxOGT02RoETg==} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + es-abstract: 1.20.4 + get-intrinsic: 1.1.3 + has-symbols: 1.0.3 + internal-slot: 1.0.3 + regexp.prototype.flags: 1.4.3 + side-channel: 1.0.4 + dev: false + + /string.prototype.trimend/1.0.5: + resolution: {integrity: sha512-I7RGvmjV4pJ7O3kdf+LXFpVfdNOxtCW/2C8f6jNiW4+PQchwxkCDzlk1/7p+Wl4bqFIZeF47qAHXLuHHWKAxog==} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + es-abstract: 1.20.4 + dev: false + + /string.prototype.trimstart/1.0.5: + resolution: {integrity: sha512-THx16TJCGlsN0o6dl2o6ncWUsdgnLRSA23rRE5pyGBw/mLr3Ej/R2LaqCtgP8VNMGZsvMWnf9ooZPyY2bHvUFg==} + dependencies: + call-bind: 1.0.2 + define-properties: 1.1.4 + es-abstract: 1.20.4 + dev: false + + /strip-ansi/6.0.1: + resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} + engines: {node: '>=8'} + dependencies: + ansi-regex: 5.0.1 + + /strip-bom/3.0.0: + resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} + engines: {node: '>=4'} + dev: false + + /strip-json-comments/3.1.1: + resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} + engines: {node: '>=8'} + + /styled-jsx/5.0.7_otspjrsspon4ofp37rshhlhp2y: + resolution: {integrity: sha512-b3sUzamS086YLRuvnaDigdAewz1/EFYlHpYBP5mZovKEdQQOIIYq8lApylub3HHZ6xFjV051kkGU7cudJmrXEA==} + engines: {node: '>= 12.0.0'} + peerDependencies: + '@babel/core': '*' + babel-plugin-macros: '*' + react: '>= 16.8.0 || 17.x.x || ^18.0.0-0' + peerDependenciesMeta: + '@babel/core': + optional: true + babel-plugin-macros: + optional: true + dependencies: + '@babel/core': 7.19.6 + react: 18.2.0 + dev: false + + /styled-jsx/5.1.0_otspjrsspon4ofp37rshhlhp2y: + resolution: {integrity: sha512-/iHaRJt9U7T+5tp6TRelLnqBqiaIT0HsO0+vgyj8hK2KUk7aejFqRrumqPUlAqDwAj8IbS/1hk3IhBAAK/FCUQ==} + engines: {node: '>= 12.0.0'} + peerDependencies: + '@babel/core': '*' + babel-plugin-macros: '*' + react: '>= 16.8.0 || 17.x.x || ^18.0.0-0' + peerDependenciesMeta: + '@babel/core': + optional: true + babel-plugin-macros: + optional: true + dependencies: + '@babel/core': 7.19.6 + client-only: 0.0.1 + react: 18.2.0 + dev: false + + /supports-color/5.5.0: + resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} + engines: {node: '>=4'} + dependencies: + has-flag: 3.0.0 + + /supports-color/7.2.0: + resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} + engines: {node: '>=8'} + dependencies: + has-flag: 4.0.0 + + /supports-preserve-symlinks-flag/1.0.0: + resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} + engines: {node: '>= 0.4'} + dev: false + + /table/6.8.0: + resolution: {integrity: sha512-s/fitrbVeEyHKFa7mFdkuQMWlH1Wgw/yEXMt5xACT4ZpzWFluehAxRtUUQKPuWhaLAWhFcVx6w3oC8VKaUfPGA==} + engines: {node: '>=10.0.0'} + dependencies: + ajv: 8.11.0 + lodash.truncate: 4.4.2 + slice-ansi: 4.0.0 + string-width: 4.2.3 + strip-ansi: 6.0.1 + + /text-table/0.2.0: + resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} + + /to-fast-properties/2.0.0: + resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==} + engines: {node: '>=4'} + + /to-regex-range/5.0.1: + resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} + engines: {node: '>=8.0'} + dependencies: + is-number: 7.0.0 + dev: false + + /toidentifier/1.0.1: + resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==} + engines: {node: '>=0.6'} + dev: false + + /tsconfig-paths/3.14.1: + resolution: {integrity: sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==} + dependencies: + '@types/json5': 0.0.29 + json5: 1.0.1 + minimist: 1.2.7 + strip-bom: 3.0.0 + dev: false + + /tslib/1.14.1: + resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} + dev: false + + /tslib/2.4.0: + resolution: {integrity: sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==} + dev: false + + /tsutils/3.21.0_typescript@4.8.4: + resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} + engines: {node: '>= 6'} + peerDependencies: + typescript: '>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta' + dependencies: + tslib: 1.14.1 + typescript: 4.8.4 + dev: false + + /turbo-darwin-64/1.6.2: + resolution: {integrity: sha512-qzqVdJZcVeu1d0mzeSxffgeOToSgM+Hl1y9yDiJQ4QQjiR/WGCzS9FtydLnk0ori8T1j/lxiiQz2sHjHYfLCTg==} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /turbo-darwin-arm64/1.6.2: + resolution: {integrity: sha512-EJvgWSjLwzJbAsqRuqeaYSdXNKwyiUfOfEOPerYCvwxC+ILiqpladjteMCzzF/z2OmIbPzuqZpyik30TfpIC9A==} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /turbo-linux-64/1.6.2: + resolution: {integrity: sha512-SJ5ThDApOyOavjvkYb6a1MKJbOvX4JEvSYxoZv+ZpN8g7A7x1SE9b7EnxFl26S4eyy0J4+r+YJBDBZ7sFkqRWQ==} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /turbo-linux-arm64/1.6.2: + resolution: {integrity: sha512-0vHojVlvAelsYZo6p/xE9H9Dg8spNjXx+PO5RwP12ui8GuEqHb3Vomdb7AKDnWkIH7bpysNb9GbKEk7awQpGSg==} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /turbo-windows-64/1.6.2: + resolution: {integrity: sha512-j4mJmY5pEt7OaBXDM99BpDnJuSpiLVbVbUl4Ezp8w3gyIcGuxy3wAfLbQyZSLu8ke6R9SdmXIBAM2Y0MjS/Z1g==} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /turbo-windows-arm64/1.6.2: + resolution: {integrity: sha512-AlDYjxPU21YSefP3qMl/Zys5spglXtaBt2ZF5N2+OWcjiJZ/0mIIc69oFdzuAuiyoYkyWMdkoCSGwuljtl31vg==} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /turbo/1.6.2: + resolution: {integrity: sha512-a6UM9HaAjM5ai+vxDFI/z0l4Bf6zWjf7wCf9Ip2iyd4XZkZZnhRtM6FpaUWzorjz9Dsqnfwu3nkWY3wPdH02IQ==} + hasBin: true + requiresBuild: true + optionalDependencies: + turbo-darwin-64: 1.6.2 + turbo-darwin-arm64: 1.6.2 + turbo-linux-64: 1.6.2 + turbo-linux-arm64: 1.6.2 + turbo-windows-64: 1.6.2 + turbo-windows-arm64: 1.6.2 + dev: true + + /type-check/0.4.0: + resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} + engines: {node: '>= 0.8.0'} + dependencies: + prelude-ls: 1.2.1 + + /type-fest/0.20.2: + resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} + engines: {node: '>=10'} + + /type-is/1.6.18: + resolution: {integrity: sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==} + engines: {node: '>= 0.6'} + dependencies: + media-typer: 0.3.0 + mime-types: 2.1.35 + dev: false + + /typescript/4.8.4: + resolution: {integrity: sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ==} + engines: {node: '>=4.2.0'} + hasBin: true + + /unbox-primitive/1.0.2: + resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} + dependencies: + call-bind: 1.0.2 + has-bigints: 1.0.2 + has-symbols: 1.0.3 + which-boxed-primitive: 1.0.2 + dev: false + + /unpipe/1.0.0: + resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} + engines: {node: '>= 0.8'} + dev: false + + /update-browserslist-db/1.0.10_browserslist@4.21.4: + resolution: {integrity: sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==} + hasBin: true + peerDependencies: + browserslist: '>= 4.21.0' + dependencies: + browserslist: 4.21.4 + escalade: 3.1.1 + picocolors: 1.0.0 + + /uri-js/4.4.1: + resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} + dependencies: + punycode: 2.1.1 + + /use-sync-external-store/1.2.0_react@18.2.0: + resolution: {integrity: sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==} + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + dependencies: + react: 18.2.0 + dev: false + + /utils-merge/1.0.1: + resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==} + engines: {node: '>= 0.4.0'} + dev: false + + /v8-compile-cache/2.3.0: + resolution: {integrity: sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==} + + /vary/1.1.2: + resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} + engines: {node: '>= 0.8'} + dev: false + + /which-boxed-primitive/1.0.2: + resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==} + dependencies: + is-bigint: 1.0.4 + is-boolean-object: 1.1.2 + is-number-object: 1.0.7 + is-string: 1.0.7 + is-symbol: 1.0.4 + dev: false + + /which/2.0.2: + resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} + engines: {node: '>= 8'} + hasBin: true + dependencies: + isexe: 2.0.0 + + /word-wrap/1.2.3: + resolution: {integrity: sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==} + engines: {node: '>=0.10.0'} + + /wrappy/1.0.2: + resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} + + /yallist/4.0.0: + resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} + + /zod/3.19.1: + resolution: {integrity: sha512-LYjZsEDhCdYET9ikFu6dVPGp2YH9DegXjdJToSzD9rO6fy4qiRYFoyEYwps88OseJlPyl2NOe2iJuhEhL7IpEA==} + dev: false diff --git a/examples/next-turbo/pnpm-workspace.yaml b/examples/next-turbo/pnpm-workspace.yaml new file mode 100644 index 00000000..3ff5faaa --- /dev/null +++ b/examples/next-turbo/pnpm-workspace.yaml @@ -0,0 +1,3 @@ +packages: + - "apps/*" + - "packages/*" diff --git a/examples/next-turbo/turbo.json b/examples/next-turbo/turbo.json new file mode 100644 index 00000000..c2601a49 --- /dev/null +++ b/examples/next-turbo/turbo.json @@ -0,0 +1,15 @@ +{ + "$schema": "https://turborepo.org/schema.json", + "pipeline": { + "build": { + "dependsOn": ["^build"], + "outputs": ["dist/**", ".next/**"] + }, + "lint": { + "outputs": [] + }, + "dev": { + "cache": false + } + } +} diff --git a/examples/next/.eslintrc.json b/examples/next/.eslintrc.json new file mode 100644 index 00000000..bffb357a --- /dev/null +++ b/examples/next/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "next/core-web-vitals" +} diff --git a/examples/next/.gitignore b/examples/next/.gitignore new file mode 100644 index 00000000..c87c9b39 --- /dev/null +++ b/examples/next/.gitignore @@ -0,0 +1,36 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.js + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* +.pnpm-debug.log* + +# local env files +.env*.local + +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts diff --git a/examples/next/README.md b/examples/next/README.md new file mode 100644 index 00000000..c87e0421 --- /dev/null +++ b/examples/next/README.md @@ -0,0 +1,34 @@ +This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). + +## Getting Started + +First, run the development server: + +```bash +npm run dev +# or +yarn dev +``` + +Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. + +You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file. + +[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`. + +The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages. + +## Learn More + +To learn more about Next.js, take a look at the following resources: + +- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. +- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. + +You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! + +## Deploy on Vercel + +The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. + +Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. diff --git a/examples/next/client/api.ts b/examples/next/client/api.ts new file mode 100644 index 00000000..4e1032d7 --- /dev/null +++ b/examples/next/client/api.ts @@ -0,0 +1,6 @@ +import { Zodios } from "@zodios/core"; +import { ZodiosHooks } from "@zodios/react"; +import { userApi } from "../common/api"; + +export const userClientApi = new Zodios("/api", userApi); +export const userClientHooks = new ZodiosHooks("users", userClientApi); diff --git a/examples/next/common/api.ts b/examples/next/common/api.ts new file mode 100644 index 00000000..1297ee2f --- /dev/null +++ b/examples/next/common/api.ts @@ -0,0 +1,55 @@ +import z from "zod"; +import { makeApi } from "@zodios/core"; + +const user = z.object({ + id: z.number(), + name: z.string(), + age: z.number().positive(), + email: z.string().email(), +}); + +export const userApi = makeApi([ + { + method: "get", + path: "/users", + alias: "getUsers", + response: z.array(user), + }, + { + method: "get", + path: "/users/:id", + alias: "getUser", + parameters: [ + { + name: "id", + type: "Path", + schema: z.number().positive(), + }, + ], + response: user, + errors: [ + { + status: "default", + schema: z.object({ + error: z.object({ + code: z.number(), + message: z.string(), + }), + }), + }, + ], + }, + { + method: "post", + path: "/users", + alias: "createUser", + parameters: [ + { + name: "user", + type: "Body", + schema: user.omit({ id: true }), + }, + ], + response: user, + }, +]); diff --git a/examples/next/next.config.js b/examples/next/next.config.js new file mode 100644 index 00000000..3d3bc999 --- /dev/null +++ b/examples/next/next.config.js @@ -0,0 +1,7 @@ +/** @type {import('next').NextConfig} */ +const nextConfig = { + reactStrictMode: true, + swcMinify: true, +}; + +module.exports = nextConfig; diff --git a/examples/next/package.json b/examples/next/package.json new file mode 100644 index 00000000..b1aa3d68 --- /dev/null +++ b/examples/next/package.json @@ -0,0 +1,32 @@ +{ + "name": "zodios-next-app", + "version": "0.1.0", + "private": true, + "scripts": { + "dev": "next dev", + "build": "next build", + "start": "next start", + "lint": "next lint" + }, + "dependencies": { + "@tanstack/react-query": "4.13.0", + "@zodios/core": "10.7.3", + "@zodios/express": "10.4.4", + "@zodios/react": "10.4.3", + "axios": "1.2.6", + "express": "4.18.2", + "next": "12.2.5", + "react": "18.2.0", + "react-dom": "18.2.0", + "zod": "3.20.2" + }, + "devDependencies": { + "@types/express": "4.17.16", + "@types/node": "18.11.18", + "@types/react": "18.0.27", + "@types/react-dom": "18.0.10", + "eslint": "8.32.0", + "eslint-config-next": "12.2.5", + "typescript": "4.9.4" + } +} diff --git a/examples/next/pages/_app.tsx b/examples/next/pages/_app.tsx new file mode 100644 index 00000000..efb90d6a --- /dev/null +++ b/examples/next/pages/_app.tsx @@ -0,0 +1,15 @@ +import "../styles/globals.css"; +import type { AppProps } from "next/app"; +import { QueryClientProvider, QueryClient } from "@tanstack/react-query"; + +const queryClient = new QueryClient(); + +function MyApp({ Component, pageProps }: AppProps) { + return ( + + + + ); +} + +export default MyApp; diff --git a/examples/next/pages/api/[...zodios].ts b/examples/next/pages/api/[...zodios].ts new file mode 100644 index 00000000..0d172f46 --- /dev/null +++ b/examples/next/pages/api/[...zodios].ts @@ -0,0 +1,3 @@ +import { app } from "../../server/routers/app"; + +export default app; diff --git a/examples/next/pages/index.tsx b/examples/next/pages/index.tsx new file mode 100644 index 00000000..143fa8e4 --- /dev/null +++ b/examples/next/pages/index.tsx @@ -0,0 +1,62 @@ +import type { NextPage } from "next"; +import { useState } from "react"; +import Head from "next/head"; +import styles from "../styles/Home.module.css"; +import { userClientHooks } from "../client/api"; + +const Users = () => { + const [count, setCount] = useState(1); + const { + data: users, + error, + isLoading, + invalidate, + } = userClientHooks.useGetUsers(); + const { mutate } = userClientHooks.useMutation("post", "/users", undefined, { + onSuccess: () => invalidate(), + }); + if (isLoading) { + return
Loading...
; + } + if (error) { + return
{JSON.stringify(error)}
; + } + + return ( +
+ + {users?.map((user) => ( +
+ {user.name} - {user.email} +
+ ))} +
+ ); +}; + +const Home: NextPage = () => { + return ( +
+ + Zodios Example App + + + +

Users

+ +
+ ); +}; + +export default Home; diff --git a/examples/next/public/favicon.ico b/examples/next/public/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..718d6fea4835ec2d246af9800eddb7ffb276240c GIT binary patch literal 25931 zcmeHv30#a{`}aL_*G&7qml|y<+KVaDM2m#dVr!KsA!#An?kSQM(q<_dDNCpjEux83 zLb9Z^XxbDl(w>%i@8hT6>)&Gu{h#Oeyszu?xtw#Zb1mO{pgX9699l+Qppw7jXaYf~-84xW z)w4x8?=youko|}Vr~(D$UXIbiXABHh`p1?nn8Po~fxRJv}|0e(BPs|G`(TT%kKVJAdg5*Z|x0leQq0 zkdUBvb#>9F()jo|T~kx@OM8$9wzs~t2l;K=woNssA3l6|sx2r3+kdfVW@e^8e*E}v zA1y5{bRi+3Z`uD3{F7LgFJDdvm;nJilkzDku>BwXH(8ItVCXk*-lSJnR?-2UN%hJ){&rlvg`CDTj z)Bzo!3v7Ou#83zEDEFcKt(f1E0~=rqeEbTnMvWR#{+9pg%7G8y>u1OVRUSoox-ovF z2Ydma(;=YuBY(eI|04{hXzZD6_f(v~H;C~y5=DhAC{MMS>2fm~1H_t2$56pc$NH8( z5bH|<)71dV-_oCHIrzrT`2s-5w_+2CM0$95I6X8p^r!gHp+j_gd;9O<1~CEQQGS8) zS9Qh3#p&JM-G8rHekNmKVewU;pJRcTAog68KYo^dRo}(M>36U4Us zfgYWSiHZL3;lpWT=zNAW>Dh#mB!_@Lg%$ms8N-;aPqMn+C2HqZgz&9~Eu z4|Kp<`$q)Uw1R?y(~S>ePdonHxpV1#eSP1B;Ogo+-Pk}6#0GsZZ5!||ev2MGdh}_m z{DeR7?0-1^zVs&`AV6Vt;r3`I`OI_wgs*w=eO%_#7Kepl{B@xiyCANc(l zzIyd4y|c6PXWq9-|KM8(zIk8LPk(>a)zyFWjhT!$HJ$qX1vo@d25W<fvZQ2zUz5WRc(UnFMKHwe1| zWmlB1qdbiA(C0jmnV<}GfbKtmcu^2*P^O?MBLZKt|As~ge8&AAO~2K@zbXelK|4T<{|y4`raF{=72kC2Kn(L4YyenWgrPiv z@^mr$t{#X5VuIMeL!7Ab6_kG$&#&5p*Z{+?5U|TZ`B!7llpVmp@skYz&n^8QfPJzL z0G6K_OJM9x+Wu2gfN45phANGt{7=C>i34CV{Xqlx(fWpeAoj^N0Biu`w+MVcCUyU* zDZuzO0>4Z6fbu^T_arWW5n!E45vX8N=bxTVeFoep_G#VmNlQzAI_KTIc{6>c+04vr zx@W}zE5JNSU>!THJ{J=cqjz+4{L4A{Ob9$ZJ*S1?Ggg3klFp!+Y1@K+pK1DqI|_gq z5ZDXVpge8-cs!o|;K73#YXZ3AShj50wBvuq3NTOZ`M&qtjj#GOFfgExjg8Gn8>Vq5 z`85n+9|!iLCZF5$HJ$Iu($dm?8~-ofu}tEc+-pyke=3!im#6pk_Wo8IA|fJwD&~~F zc16osQ)EBo58U7XDuMexaPRjU@h8tXe%S{fA0NH3vGJFhuyyO!Uyl2^&EOpX{9As0 zWj+P>{@}jxH)8|r;2HdupP!vie{sJ28b&bo!8`D^x}TE$%zXNb^X1p@0PJ86`dZyj z%ce7*{^oo+6%&~I!8hQy-vQ7E)0t0ybH4l%KltWOo~8cO`T=157JqL(oq_rC%ea&4 z2NcTJe-HgFjNg-gZ$6!Y`SMHrlj}Etf7?r!zQTPPSv}{so2e>Fjs1{gzk~LGeesX%r(Lh6rbhSo_n)@@G-FTQy93;l#E)hgP@d_SGvyCp0~o(Y;Ee8{ zdVUDbHm5`2taPUOY^MAGOw*>=s7=Gst=D+p+2yON!0%Hk` zz5mAhyT4lS*T3LS^WSxUy86q&GnoHxzQ6vm8)VS}_zuqG?+3td68_x;etQAdu@sc6 zQJ&5|4(I?~3d-QOAODHpZ=hlSg(lBZ!JZWCtHHSj`0Wh93-Uk)_S%zsJ~aD>{`A0~ z9{AG(e|q3g5B%wYKRxiL2Y$8(4w6bzchKuloQW#e&S3n+P- z8!ds-%f;TJ1>)v)##>gd{PdS2Oc3VaR`fr=`O8QIO(6(N!A?pr5C#6fc~Ge@N%Vvu zaoAX2&(a6eWy_q&UwOhU)|P3J0Qc%OdhzW=F4D|pt0E4osw;%<%Dn58hAWD^XnZD= z>9~H(3bmLtxpF?a7su6J7M*x1By7YSUbxGi)Ot0P77`}P3{)&5Un{KD?`-e?r21!4vTTnN(4Y6Lin?UkSM z`MXCTC1@4A4~mvz%Rh2&EwY))LeoT=*`tMoqcEXI>TZU9WTP#l?uFv+@Dn~b(>xh2 z;>B?;Tz2SR&KVb>vGiBSB`@U7VIWFSo=LDSb9F{GF^DbmWAfpms8Sx9OX4CnBJca3 zlj9(x!dIjN?OG1X4l*imJNvRCk}F%!?SOfiOq5y^mZW)jFL@a|r-@d#f7 z2gmU8L3IZq0ynIws=}~m^#@&C%J6QFo~Mo4V`>v7MI-_!EBMMtb%_M&kvAaN)@ZVw z+`toz&WG#HkWDjnZE!6nk{e-oFdL^$YnbOCN}JC&{$#$O27@|Tn-skXr)2ml2~O!5 zX+gYoxhoc7qoU?C^3~&!U?kRFtnSEecWuH0B0OvLodgUAi}8p1 zrO6RSXHH}DMc$&|?D004DiOVMHV8kXCP@7NKB zgaZq^^O<7PoKEp72kby@W0Z!Y*Ay{&vfg#C&gG@YVR9g?FEocMUi1gSN$+V+ayF45{a zuDZDTN}mS|;BO%gEf}pjBfN2-gIrU#G5~cucA;dokXW89%>AyXJJI z9X4UlIWA|ZYHgbI z5?oFk@A=Ik7lrEQPDH!H+b`7_Y~aDb_qa=B2^Y&Ow41cU=4WDd40dp5(QS-WMN-=Y z9g;6_-JdNU;|6cPwf$ak*aJIcwL@1n$#l~zi{c{EW?T;DaW*E8DYq?Umtz{nJ&w-M zEMyTDrC&9K$d|kZe2#ws6)L=7K+{ zQw{XnV6UC$6-rW0emqm8wJoeZK)wJIcV?dST}Z;G0Arq{dVDu0&4kd%N!3F1*;*pW zR&qUiFzK=@44#QGw7k1`3t_d8&*kBV->O##t|tonFc2YWrL7_eqg+=+k;!F-`^b8> z#KWCE8%u4k@EprxqiV$VmmtiWxDLgnGu$Vs<8rppV5EajBXL4nyyZM$SWVm!wnCj-B!Wjqj5-5dNXukI2$$|Bu3Lrw}z65Lc=1G z^-#WuQOj$hwNGG?*CM_TO8Bg-1+qc>J7k5c51U8g?ZU5n?HYor;~JIjoWH-G>AoUP ztrWWLbRNqIjW#RT*WqZgPJXU7C)VaW5}MiijYbABmzoru6EmQ*N8cVK7a3|aOB#O& zBl8JY2WKfmj;h#Q!pN%9o@VNLv{OUL?rixHwOZuvX7{IJ{(EdPpuVFoQqIOa7giLVkBOKL@^smUA!tZ1CKRK}#SSM)iQHk)*R~?M!qkCruaS!#oIL1c z?J;U~&FfH#*98^G?i}pA{ z9Jg36t4=%6mhY(quYq*vSxptes9qy|7xSlH?G=S@>u>Ebe;|LVhs~@+06N<4CViBk zUiY$thvX;>Tby6z9Y1edAMQaiH zm^r3v#$Q#2T=X>bsY#D%s!bhs^M9PMAcHbCc0FMHV{u-dwlL;a1eJ63v5U*?Q_8JO zT#50!RD619#j_Uf))0ooADz~*9&lN!bBDRUgE>Vud-i5ck%vT=r^yD*^?Mp@Q^v+V zG#-?gKlr}Eeqifb{|So?HM&g91P8|av8hQoCmQXkd?7wIJwb z_^v8bbg`SAn{I*4bH$u(RZ6*xUhuA~hc=8czK8SHEKTzSxgbwi~9(OqJB&gwb^l4+m`k*Q;_?>Y-APi1{k zAHQ)P)G)f|AyjSgcCFps)Fh6Bca*Xznq36!pV6Az&m{O8$wGFD? zY&O*3*J0;_EqM#jh6^gMQKpXV?#1?>$ml1xvh8nSN>-?H=V;nJIwB07YX$e6vLxH( zqYwQ>qxwR(i4f)DLd)-$P>T-no_c!LsN@)8`e;W@)-Hj0>nJ-}Kla4-ZdPJzI&Mce zv)V_j;(3ERN3_@I$N<^|4Lf`B;8n+bX@bHbcZTopEmDI*Jfl)-pFDvo6svPRoo@(x z);_{lY<;);XzT`dBFpRmGrr}z5u1=pC^S-{ce6iXQlLGcItwJ^mZx{m$&DA_oEZ)B{_bYPq-HA zcH8WGoBG(aBU_j)vEy+_71T34@4dmSg!|M8Vf92Zj6WH7Q7t#OHQqWgFE3ARt+%!T z?oLovLVlnf?2c7pTc)~cc^($_8nyKwsN`RA-23ed3sdj(ys%pjjM+9JrctL;dy8a( z@en&CQmnV(()bu|Y%G1-4a(6x{aLytn$T-;(&{QIJB9vMox11U-1HpD@d(QkaJdEb zG{)+6Dos_L+O3NpWo^=gR?evp|CqEG?L&Ut#D*KLaRFOgOEK(Kq1@!EGcTfo+%A&I z=dLbB+d$u{sh?u)xP{PF8L%;YPPW53+@{>5W=Jt#wQpN;0_HYdw1{ksf_XhO4#2F= zyPx6Lx2<92L-;L5PD`zn6zwIH`Jk($?Qw({erA$^bC;q33hv!d!>%wRhj# zal^hk+WGNg;rJtb-EB(?czvOM=H7dl=vblBwAv>}%1@{}mnpUznfq1cE^sgsL0*4I zJ##!*B?=vI_OEVis5o+_IwMIRrpQyT_Sq~ZU%oY7c5JMIADzpD!Upz9h@iWg_>>~j zOLS;wp^i$-E?4<_cp?RiS%Rd?i;f*mOz=~(&3lo<=@(nR!_Rqiprh@weZlL!t#NCc zO!QTcInq|%#>OVgobj{~ixEUec`E25zJ~*DofsQdzIa@5^nOXj2T;8O`l--(QyU^$t?TGY^7#&FQ+2SS3B#qK*k3`ye?8jUYSajE5iBbJls75CCc(m3dk{t?- zopcER9{Z?TC)mk~gpi^kbbu>b-+a{m#8-y2^p$ka4n60w;Sc2}HMf<8JUvhCL0B&Btk)T`ctE$*qNW8L$`7!r^9T+>=<=2qaq-;ll2{`{Rg zc5a0ZUI$oG&j-qVOuKa=*v4aY#IsoM+1|c4Z)<}lEDvy;5huB@1RJPquU2U*U-;gu z=En2m+qjBzR#DEJDO`WU)hdd{Vj%^0V*KoyZ|5lzV87&g_j~NCjwv0uQVqXOb*QrQ zy|Qn`hxx(58c70$E;L(X0uZZ72M1!6oeg)(cdKO ze0gDaTz+ohR-#d)NbAH4x{I(21yjwvBQfmpLu$)|m{XolbgF!pmsqJ#D}(ylp6uC> z{bqtcI#hT#HW=wl7>p!38sKsJ`r8}lt-q%Keqy%u(xk=yiIJiUw6|5IvkS+#?JTBl z8H5(Q?l#wzazujH!8o>1xtn8#_w+397*_cy8!pQGP%K(Ga3pAjsaTbbXJlQF_+m+-UpUUent@xM zg%jqLUExj~o^vQ3Gl*>wh=_gOr2*|U64_iXb+-111aH}$TjeajM+I20xw(((>fej-@CIz4S1pi$(#}P7`4({6QS2CaQS4NPENDp>sAqD z$bH4KGzXGffkJ7R>V>)>tC)uax{UsN*dbeNC*v}#8Y#OWYwL4t$ePR?VTyIs!wea+ z5Urmc)X|^`MG~*dS6pGSbU+gPJoq*^a=_>$n4|P^w$sMBBy@f*Z^Jg6?n5?oId6f{ z$LW4M|4m502z0t7g<#Bx%X;9<=)smFolV&(V^(7Cv2-sxbxopQ!)*#ZRhTBpx1)Fc zNm1T%bONzv6@#|dz(w02AH8OXe>kQ#1FMCzO}2J_mST)+ExmBr9cva-@?;wnmWMOk z{3_~EX_xadgJGv&H@zK_8{(x84`}+c?oSBX*Ge3VdfTt&F}yCpFP?CpW+BE^cWY0^ zb&uBN!Ja3UzYHK-CTyA5=L zEMW{l3Usky#ly=7px648W31UNV@K)&Ub&zP1c7%)`{);I4b0Q<)B}3;NMG2JH=X$U zfIW4)4n9ZM`-yRj67I)YSLDK)qfUJ_ij}a#aZN~9EXrh8eZY2&=uY%2N0UFF7<~%M zsB8=erOWZ>Ct_#^tHZ|*q`H;A)5;ycw*IcmVxi8_0Xk}aJA^ath+E;xg!x+As(M#0=)3!NJR6H&9+zd#iP(m0PIW8$ z1Y^VX`>jm`W!=WpF*{ioM?C9`yOR>@0q=u7o>BP-eSHqCgMDj!2anwH?s%i2p+Q7D zzszIf5XJpE)IG4;d_(La-xenmF(tgAxK`Y4sQ}BSJEPs6N_U2vI{8=0C_F?@7<(G; zo$~G=8p+076G;`}>{MQ>t>7cm=zGtfbdDXm6||jUU|?X?CaE?(<6bKDYKeHlz}DA8 zXT={X=yp_R;HfJ9h%?eWvQ!dRgz&Su*JfNt!Wu>|XfU&68iRikRrHRW|ZxzRR^`eIGt zIeiDgVS>IeExKVRWW8-=A=yA`}`)ZkWBrZD`hpWIxBGkh&f#ijr449~m`j6{4jiJ*C!oVA8ZC?$1RM#K(_b zL9TW)kN*Y4%^-qPpMP7d4)o?Nk#>aoYHT(*g)qmRUb?**F@pnNiy6Fv9rEiUqD(^O zzyS?nBrX63BTRYduaG(0VVG2yJRe%o&rVrLjbxTaAFTd8s;<<@Qs>u(<193R8>}2_ zuwp{7;H2a*X7_jryzriZXMg?bTuegABb^87@SsKkr2)0Gyiax8KQWstw^v#ix45EVrcEhr>!NMhprl$InQMzjSFH54x5k9qHc`@9uKQzvL4ihcq{^B zPrVR=o_ic%Y>6&rMN)hTZsI7I<3&`#(nl+3y3ys9A~&^=4?PL&nd8)`OfG#n zwAMN$1&>K++c{^|7<4P=2y(B{jJsQ0a#U;HTo4ZmWZYvI{+s;Td{Yzem%0*k#)vjpB zia;J&>}ICate44SFYY3vEelqStQWFihx%^vQ@Do(sOy7yR2@WNv7Y9I^yL=nZr3mb zXKV5t@=?-Sk|b{XMhA7ZGB@2hqsx}4xwCW!in#C zI@}scZlr3-NFJ@NFaJlhyfcw{k^vvtGl`N9xSo**rDW4S}i zM9{fMPWo%4wYDG~BZ18BD+}h|GQKc-g^{++3MY>}W_uq7jGHx{mwE9fZiPCoxN$+7 zrODGGJrOkcPQUB(FD5aoS4g~7#6NR^ma7-!>mHuJfY5kTe6PpNNKC9GGRiu^L31uG z$7v`*JknQHsYB!Tm_W{a32TM099djW%5e+j0Ve_ct}IM>XLF1Ap+YvcrLV=|CKo6S zb+9Nl3_YdKP6%Cxy@6TxZ>;4&nTneadr z_ES90ydCev)LV!dN=#(*f}|ZORFdvkYBni^aLbUk>BajeWIOcmHP#8S)*2U~QKI%S zyrLmtPqb&TphJ;>yAxri#;{uyk`JJqODDw%(Z=2`1uc}br^V%>j!gS)D*q*f_-qf8&D;W1dJgQMlaH5er zN2U<%Smb7==vE}dDI8K7cKz!vs^73o9f>2sgiTzWcwY|BMYHH5%Vn7#kiw&eItCqa zIkR2~Q}>X=Ar8W|^Ms41Fm8o6IB2_j60eOeBB1Br!boW7JnoeX6Gs)?7rW0^5psc- zjS16yb>dFn>KPOF;imD}e!enuIniFzv}n$m2#gCCv4jM#ArwlzZ$7@9&XkFxZ4n!V zj3dyiwW4Ki2QG{@i>yuZXQizw_OkZI^-3otXC{!(lUpJF33gI60ak;Uqitp74|B6I zgg{b=Iz}WkhCGj1M=hu4#Aw173YxIVbISaoc z-nLZC*6Tgivd5V`K%GxhBsp@SUU60-rfc$=wb>zdJzXS&-5(NRRodFk;Kxk!S(O(a0e7oY=E( zAyS;Ow?6Q&XA+cnkCb{28_1N8H#?J!*$MmIwLq^*T_9-z^&UE@A(z9oGYtFy6EZef LrJugUA?W`A8`#=m literal 0 HcmV?d00001 diff --git a/examples/next/public/vercel.svg b/examples/next/public/vercel.svg new file mode 100644 index 00000000..fbf0e25a --- /dev/null +++ b/examples/next/public/vercel.svg @@ -0,0 +1,4 @@ + + + \ No newline at end of file diff --git a/examples/next/server/context.ts b/examples/next/server/context.ts new file mode 100644 index 00000000..0fa7e09d --- /dev/null +++ b/examples/next/server/context.ts @@ -0,0 +1,10 @@ +import { zodiosContext } from "@zodios/express"; +import z from "zod"; + +const user = z.object({ + id: z.number(), + name: z.string(), + email: z.string().email(), +}); + +export const ctx = zodiosContext(z.object({ user })); diff --git a/examples/next/server/routers/app.ts b/examples/next/server/routers/app.ts new file mode 100644 index 00000000..cf8a07b2 --- /dev/null +++ b/examples/next/server/routers/app.ts @@ -0,0 +1,5 @@ +import { ctx } from "../context"; +import { userRouter } from "./users"; + +export const app = ctx.nextApp(); +app.use("/api", userRouter); diff --git a/examples/next/server/routers/users.ts b/examples/next/server/routers/users.ts new file mode 100644 index 00000000..6929bd1b --- /dev/null +++ b/examples/next/server/routers/users.ts @@ -0,0 +1,37 @@ +import { ctx } from "../context"; +import { userApi } from "../../common/api"; + +const users = [ + { + id: 1, + name: "John Doe", + age: 30, + email: "john.doe@test.com", + }, +]; + +export const userRouter = ctx.router(userApi); + +userRouter.get("/users", (req, res) => { + return res.status(200).json(users); +}); + +userRouter.get("/users/:id", (req, res) => { + const user = users.find((u) => u.id === req.params.id); + if (!user) { + return res.status(404).json({ + error: { + code: 404, + message: "User not found", + }, + }); + } + return res.status(200).json(user); +}); + +userRouter.post("/users", (req, res) => { + const id = users.length + 1; + const user = { ...req.body, id }; + users.push(user); + return res.status(201).json(user); +}); diff --git a/examples/next/styles/Home.module.css b/examples/next/styles/Home.module.css new file mode 100644 index 00000000..bd50f42f --- /dev/null +++ b/examples/next/styles/Home.module.css @@ -0,0 +1,129 @@ +.container { + padding: 0 2rem; +} + +.main { + min-height: 100vh; + padding: 4rem 0; + flex: 1; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; +} + +.footer { + display: flex; + flex: 1; + padding: 2rem 0; + border-top: 1px solid #eaeaea; + justify-content: center; + align-items: center; +} + +.footer a { + display: flex; + justify-content: center; + align-items: center; + flex-grow: 1; +} + +.title a { + color: #0070f3; + text-decoration: none; +} + +.title a:hover, +.title a:focus, +.title a:active { + text-decoration: underline; +} + +.title { + margin: 0; + line-height: 1.15; + font-size: 4rem; +} + +.title, +.description { + text-align: center; +} + +.description { + margin: 4rem 0; + line-height: 1.5; + font-size: 1.5rem; +} + +.code { + background: #fafafa; + border-radius: 5px; + padding: 0.75rem; + font-size: 1.1rem; + font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, + Bitstream Vera Sans Mono, Courier New, monospace; +} + +.grid { + display: flex; + align-items: center; + justify-content: center; + flex-wrap: wrap; + max-width: 800px; +} + +.card { + margin: 1rem; + padding: 1.5rem; + text-align: left; + color: inherit; + text-decoration: none; + border: 1px solid #eaeaea; + border-radius: 10px; + transition: color 0.15s ease, border-color 0.15s ease; + max-width: 300px; +} + +.card:hover, +.card:focus, +.card:active { + color: #0070f3; + border-color: #0070f3; +} + +.card h2 { + margin: 0 0 1rem 0; + font-size: 1.5rem; +} + +.card p { + margin: 0; + font-size: 1.25rem; + line-height: 1.5; +} + +.logo { + height: 1em; + margin-left: 0.5rem; +} + +@media (max-width: 600px) { + .grid { + width: 100%; + flex-direction: column; + } +} + +@media (prefers-color-scheme: dark) { + .card, + .footer { + border-color: #222; + } + .code { + background: #111; + } + .logo img { + filter: invert(1); + } +} diff --git a/examples/next/styles/globals.css b/examples/next/styles/globals.css new file mode 100644 index 00000000..4f184216 --- /dev/null +++ b/examples/next/styles/globals.css @@ -0,0 +1,26 @@ +html, +body { + padding: 0; + margin: 0; + font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, + Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif; +} + +a { + color: inherit; + text-decoration: none; +} + +* { + box-sizing: border-box; +} + +@media (prefers-color-scheme: dark) { + html { + color-scheme: dark; + } + body { + color: white; + background: black; + } +} diff --git a/examples/next/tsconfig.json b/examples/next/tsconfig.json new file mode 100644 index 00000000..99710e85 --- /dev/null +++ b/examples/next/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "target": "es5", + "lib": ["dom", "dom.iterable", "esnext"], + "allowJs": true, + "skipLibCheck": true, + "strict": true, + "forceConsistentCasingInFileNames": true, + "noEmit": true, + "esModuleInterop": true, + "module": "esnext", + "moduleResolution": "node", + "resolveJsonModule": true, + "isolatedModules": true, + "jsx": "preserve", + "incremental": true + }, + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], + "exclude": ["node_modules"] +} diff --git a/examples/next/yarn.lock b/examples/next/yarn.lock new file mode 100644 index 00000000..449d1523 --- /dev/null +++ b/examples/next/yarn.lock @@ -0,0 +1,2225 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@babel/runtime-corejs3@^7.10.2": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/runtime-corejs3/-/runtime-corejs3-7.18.9.tgz#7bacecd1cb2dd694eacd32a91fcf7021c20770ae" + integrity sha512-qZEWeccZCrHA2Au4/X05QW5CMdm4VjUDCrGq5gf1ZDcM4hRqreKrtwAn7yci9zfgAS9apvnsFXiGBHBAxZdK9A== + dependencies: + core-js-pure "^3.20.2" + regenerator-runtime "^0.13.4" + +"@babel/runtime@^7.10.2", "@babel/runtime@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.18.9.tgz#b4fcfce55db3d2e5e080d2490f608a3b9f407f4a" + integrity sha512-lkqXDcvlFT5rvEjiu6+QYO+1GXrEHRo2LOtS7E4GtX5ESIZOgepqsZBVIj6Pv+a6zqsya9VCgiK1KAK4BvJDAw== + dependencies: + regenerator-runtime "^0.13.4" + +"@eslint/eslintrc@^1.4.1": + version "1.4.1" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.4.1.tgz#af58772019a2d271b7e2d4c23ff4ddcba3ccfb3e" + integrity sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA== + dependencies: + ajv "^6.12.4" + debug "^4.3.2" + espree "^9.4.0" + globals "^13.19.0" + ignore "^5.2.0" + import-fresh "^3.2.1" + js-yaml "^4.1.0" + minimatch "^3.1.2" + strip-json-comments "^3.1.1" + +"@humanwhocodes/config-array@^0.11.8": + version "0.11.8" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.8.tgz#03595ac2075a4dc0f191cc2131de14fbd7d410b9" + integrity sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g== + dependencies: + "@humanwhocodes/object-schema" "^1.2.1" + debug "^4.1.1" + minimatch "^3.0.5" + +"@humanwhocodes/module-importer@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" + integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== + +"@humanwhocodes/object-schema@^1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" + integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== + +"@next/env@12.2.5": + version "12.2.5" + resolved "https://registry.yarnpkg.com/@next/env/-/env-12.2.5.tgz#d908c57b35262b94db3e431e869b72ac3e1ad3e3" + integrity sha512-vLPLV3cpPGjUPT3PjgRj7e3nio9t6USkuew3JE/jMeon/9Mvp1WyR18v3iwnCuX7eUAm1HmAbJHHLAbcu/EJcw== + +"@next/eslint-plugin-next@12.2.5": + version "12.2.5" + resolved "https://registry.yarnpkg.com/@next/eslint-plugin-next/-/eslint-plugin-next-12.2.5.tgz#4f3acccd2ed4f9300fbf9fd480cc8a0b261889a8" + integrity sha512-VBjVbmqEzGiOTBq4+wpeVXt/KgknnGB6ahvC/AxiIGnN93/RCSyXhFRI4uSfftM2Ba3w7ZO7076bfKasZsA0fw== + dependencies: + glob "7.1.7" + +"@next/swc-android-arm-eabi@12.2.5": + version "12.2.5" + resolved "https://registry.yarnpkg.com/@next/swc-android-arm-eabi/-/swc-android-arm-eabi-12.2.5.tgz#903a5479ab4c2705d9c08d080907475f7bacf94d" + integrity sha512-cPWClKxGhgn2dLWnspW+7psl3MoLQUcNqJqOHk2BhNcou9ARDtC0IjQkKe5qcn9qg7I7U83Gp1yh2aesZfZJMA== + +"@next/swc-android-arm64@12.2.5": + version "12.2.5" + resolved "https://registry.yarnpkg.com/@next/swc-android-arm64/-/swc-android-arm64-12.2.5.tgz#2f9a98ec4166c7860510963b31bda1f57a77c792" + integrity sha512-vMj0efliXmC5b7p+wfcQCX0AfU8IypjkzT64GiKJD9PgiA3IILNiGJr1fw2lyUDHkjeWx/5HMlMEpLnTsQslwg== + +"@next/swc-darwin-arm64@12.2.5": + version "12.2.5" + resolved "https://registry.yarnpkg.com/@next/swc-darwin-arm64/-/swc-darwin-arm64-12.2.5.tgz#31b1c3c659d54be546120c488a1e1bad21c24a1d" + integrity sha512-VOPWbO5EFr6snla/WcxUKtvzGVShfs302TEMOtzYyWni6f9zuOetijJvVh9CCTzInnXAZMtHyNhefijA4HMYLg== + +"@next/swc-darwin-x64@12.2.5": + version "12.2.5" + resolved "https://registry.yarnpkg.com/@next/swc-darwin-x64/-/swc-darwin-x64-12.2.5.tgz#2e44dd82b2b7fef88238d1bc4d3bead5884cedfd" + integrity sha512-5o8bTCgAmtYOgauO/Xd27vW52G2/m3i5PX7MUYePquxXAnX73AAtqA3WgPXBRitEB60plSKZgOTkcpqrsh546A== + +"@next/swc-freebsd-x64@12.2.5": + version "12.2.5" + resolved "https://registry.yarnpkg.com/@next/swc-freebsd-x64/-/swc-freebsd-x64-12.2.5.tgz#e24e75d8c2581bfebc75e4f08f6ddbd116ce9dbd" + integrity sha512-yYUbyup1JnznMtEBRkK4LT56N0lfK5qNTzr6/DEyDw5TbFVwnuy2hhLBzwCBkScFVjpFdfiC6SQAX3FrAZzuuw== + +"@next/swc-linux-arm-gnueabihf@12.2.5": + version "12.2.5" + resolved "https://registry.yarnpkg.com/@next/swc-linux-arm-gnueabihf/-/swc-linux-arm-gnueabihf-12.2.5.tgz#46d8c514d834d2b5f67086013f0bd5e3081e10b9" + integrity sha512-2ZE2/G921Acks7UopJZVMgKLdm4vN4U0yuzvAMJ6KBavPzqESA2yHJlm85TV/K9gIjKhSk5BVtauIUntFRP8cg== + +"@next/swc-linux-arm64-gnu@12.2.5": + version "12.2.5" + resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-12.2.5.tgz#91f725ac217d3a1f4f9f53b553615ba582fd3d9f" + integrity sha512-/I6+PWVlz2wkTdWqhlSYYJ1pWWgUVva6SgX353oqTh8njNQp1SdFQuWDqk8LnM6ulheVfSsgkDzxrDaAQZnzjQ== + +"@next/swc-linux-arm64-musl@12.2.5": + version "12.2.5" + resolved "https://registry.yarnpkg.com/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-12.2.5.tgz#e627e8c867920995810250303cd9b8e963598383" + integrity sha512-LPQRelfX6asXyVr59p5sTpx5l+0yh2Vjp/R8Wi4X9pnqcayqT4CUJLiHqCvZuLin3IsFdisJL0rKHMoaZLRfmg== + +"@next/swc-linux-x64-gnu@12.2.5": + version "12.2.5" + resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-12.2.5.tgz#83a5e224fbc4d119ef2e0f29d0d79c40cc43887e" + integrity sha512-0szyAo8jMCClkjNK0hknjhmAngUppoRekW6OAezbEYwHXN/VNtsXbfzgYOqjKWxEx3OoAzrT3jLwAF0HdX2MEw== + +"@next/swc-linux-x64-musl@12.2.5": + version "12.2.5" + resolved "https://registry.yarnpkg.com/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-12.2.5.tgz#be700d48471baac1ec2e9539396625584a317e95" + integrity sha512-zg/Y6oBar1yVnW6Il1I/08/2ukWtOG6s3acdJdEyIdsCzyQi4RLxbbhkD/EGQyhqBvd3QrC6ZXQEXighQUAZ0g== + +"@next/swc-win32-arm64-msvc@12.2.5": + version "12.2.5" + resolved "https://registry.yarnpkg.com/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-12.2.5.tgz#a93e958133ad3310373fda33a79aa10af2a0aa97" + integrity sha512-3/90DRNSqeeSRMMEhj4gHHQlLhhKg5SCCoYfE3kBjGpE63EfnblYUqsszGGZ9ekpKL/R4/SGB40iCQr8tR5Jiw== + +"@next/swc-win32-ia32-msvc@12.2.5": + version "12.2.5" + resolved "https://registry.yarnpkg.com/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-12.2.5.tgz#4f5f7ba0a98ff89a883625d4af0125baed8b2e19" + integrity sha512-hGLc0ZRAwnaPL4ulwpp4D2RxmkHQLuI8CFOEEHdzZpS63/hMVzv81g8jzYA0UXbb9pus/iTc3VRbVbAM03SRrw== + +"@next/swc-win32-x64-msvc@12.2.5": + version "12.2.5" + resolved "https://registry.yarnpkg.com/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-12.2.5.tgz#20fed129b04a0d3f632c6d0de135345bb623b1e4" + integrity sha512-7h5/ahY7NeaO2xygqVrSG/Y8Vs4cdjxIjowTZ5W6CKoTKn7tmnuxlUc2h74x06FKmbhAd9agOjr/AOKyxYYm9Q== + +"@nodelib/fs.scandir@2.1.5": + version "2.1.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" + integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== + dependencies: + "@nodelib/fs.stat" "2.0.5" + run-parallel "^1.1.9" + +"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" + integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== + +"@nodelib/fs.walk@^1.2.3", "@nodelib/fs.walk@^1.2.8": + version "1.2.8" + resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" + integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== + dependencies: + "@nodelib/fs.scandir" "2.1.5" + fastq "^1.6.0" + +"@rushstack/eslint-patch@^1.1.3": + version "1.1.4" + resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.1.4.tgz#0c8b74c50f29ee44f423f7416829c0bf8bb5eb27" + integrity sha512-LwzQKA4vzIct1zNZzBmRKI9QuNpLgTQMEjsQLf3BXuGYb3QPTP4Yjf6mkdX+X1mYttZ808QpOwAzZjv28kq7DA== + +"@swc/helpers@0.4.3": + version "0.4.3" + resolved "https://registry.yarnpkg.com/@swc/helpers/-/helpers-0.4.3.tgz#16593dfc248c53b699d4b5026040f88ddb497012" + integrity sha512-6JrF+fdUK2zbGpJIlN7G3v966PQjyx/dPt1T9km2wj+EUBqgrxCk3uX4Kct16MIm9gGxfKRcfax2hVf5jvlTzA== + dependencies: + tslib "^2.4.0" + +"@tanstack/query-core@4.13.0": + version "4.13.0" + resolved "https://registry.yarnpkg.com/@tanstack/query-core/-/query-core-4.13.0.tgz#89153096d1fce42c0294fa1d1ae4b3e72aa5353b" + integrity sha512-PzmLQcEgC4rl2OzkiPHYPC9O79DFcMGaKsOzDEP+U4PJ+tbkcEP+Z+FQDlfvX8mCwYC7UNH7hXrQ5EdkGlJjVg== + +"@tanstack/react-query@4.13.0": + version "4.13.0" + resolved "https://registry.yarnpkg.com/@tanstack/react-query/-/react-query-4.13.0.tgz#13797d590a6c0708545881e38aea5eb39b960c28" + integrity sha512-dI/5hJ/pGQ74P5hxBLC9h6K0/Cap2T3k0ZjjjFLBCNnohDYgl7LNmMopzrRzBHk2mMjf2hgXHIzcKNG8GOZ5hg== + dependencies: + "@tanstack/query-core" "4.13.0" + use-sync-external-store "^1.2.0" + +"@types/body-parser@*": + version "1.19.2" + resolved "https://registry.yarnpkg.com/@types/body-parser/-/body-parser-1.19.2.tgz#aea2059e28b7658639081347ac4fab3de166e6f0" + integrity sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g== + dependencies: + "@types/connect" "*" + "@types/node" "*" + +"@types/connect@*": + version "3.4.35" + resolved "https://registry.yarnpkg.com/@types/connect/-/connect-3.4.35.tgz#5fcf6ae445e4021d1fc2219a4873cc73a3bb2ad1" + integrity sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ== + dependencies: + "@types/node" "*" + +"@types/express-serve-static-core@^4.17.31": + version "4.17.33" + resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.33.tgz#de35d30a9d637dc1450ad18dd583d75d5733d543" + integrity sha512-TPBqmR/HRYI3eC2E5hmiivIzv+bidAfXofM+sbonAGvyDhySGw9/PQZFt2BLOrjUUR++4eJVpx6KnLQK1Fk9tA== + dependencies: + "@types/node" "*" + "@types/qs" "*" + "@types/range-parser" "*" + +"@types/express@4.17.16": + version "4.17.16" + resolved "https://registry.yarnpkg.com/@types/express/-/express-4.17.16.tgz#986caf0b4b850611254505355daa24e1b8323de8" + integrity sha512-LkKpqRZ7zqXJuvoELakaFYuETHjZkSol8EV6cNnyishutDBCCdv6+dsKPbKkCcIk57qRphOLY5sEgClw1bO3gA== + dependencies: + "@types/body-parser" "*" + "@types/express-serve-static-core" "^4.17.31" + "@types/qs" "*" + "@types/serve-static" "*" + +"@types/json5@^0.0.29": + version "0.0.29" + resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" + integrity sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ== + +"@types/mime@*": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@types/mime/-/mime-3.0.1.tgz#5f8f2bca0a5863cb69bc0b0acd88c96cb1d4ae10" + integrity sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA== + +"@types/node@*": + version "18.7.13" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.7.13.tgz#23e6c5168333480d454243378b69e861ab5c011a" + integrity sha512-46yIhxSe5xEaJZXWdIBP7GU4HDTG8/eo0qd9atdiL+lFpA03y8KS+lkTN834TWJj5767GbWv4n/P6efyTFt1Dw== + +"@types/node@18.11.18": + version "18.11.18" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.18.tgz#8dfb97f0da23c2293e554c5a50d61ef134d7697f" + integrity sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA== + +"@types/prop-types@*": + version "15.7.5" + resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.5.tgz#5f19d2b85a98e9558036f6a3cacc8819420f05cf" + integrity sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w== + +"@types/qs@*": + version "6.9.7" + resolved "https://registry.yarnpkg.com/@types/qs/-/qs-6.9.7.tgz#63bb7d067db107cc1e457c303bc25d511febf6cb" + integrity sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw== + +"@types/range-parser@*": + version "1.2.4" + resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.4.tgz#cd667bcfdd025213aafb7ca5915a932590acdcdc" + integrity sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw== + +"@types/react-dom@18.0.10": + version "18.0.10" + resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.0.10.tgz#3b66dec56aa0f16a6cc26da9e9ca96c35c0b4352" + integrity sha512-E42GW/JA4Qv15wQdqJq8DL4JhNpB3prJgjgapN3qJT9K2zO5IIAQh4VXvCEDupoqAwnz0cY4RlXeC/ajX5SFHg== + dependencies: + "@types/react" "*" + +"@types/react@*": + version "18.0.17" + resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.17.tgz#4583d9c322d67efe4b39a935d223edcc7050ccf4" + integrity sha512-38ETy4tL+rn4uQQi7mB81G7V1g0u2ryquNmsVIOKUAEIDK+3CUjZ6rSRpdvS99dNBnkLFL83qfmtLacGOTIhwQ== + dependencies: + "@types/prop-types" "*" + "@types/scheduler" "*" + csstype "^3.0.2" + +"@types/react@18.0.27": + version "18.0.27" + resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.27.tgz#d9425abe187a00f8a5ec182b010d4fd9da703b71" + integrity sha512-3vtRKHgVxu3Jp9t718R9BuzoD4NcQ8YJ5XRzsSKxNDiDonD2MXIT1TmSkenxuCycZJoQT5d2vE8LwWJxBC1gmA== + dependencies: + "@types/prop-types" "*" + "@types/scheduler" "*" + csstype "^3.0.2" + +"@types/scheduler@*": + version "0.16.2" + resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.2.tgz#1a62f89525723dde24ba1b01b092bf5df8ad4d39" + integrity sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew== + +"@types/serve-static@*": + version "1.15.0" + resolved "https://registry.yarnpkg.com/@types/serve-static/-/serve-static-1.15.0.tgz#c7930ff61afb334e121a9da780aac0d9b8f34155" + integrity sha512-z5xyF6uh8CbjAu9760KDKsH2FcDxZ2tFCsA4HIMWE6IkiYMXfVoa+4f9KX+FN0ZLsaMw1WNG2ETLA6N+/YA+cg== + dependencies: + "@types/mime" "*" + "@types/node" "*" + +"@typescript-eslint/parser@^5.21.0": + version "5.35.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.35.1.tgz#bf2ee2ebeaa0a0567213748243fb4eec2857f04f" + integrity sha512-XL2TBTSrh3yWAsMYpKseBYTVpvudNf69rPOWXWVBI08My2JVT5jR66eTt4IgQFHA/giiKJW5dUD4x/ZviCKyGg== + dependencies: + "@typescript-eslint/scope-manager" "5.35.1" + "@typescript-eslint/types" "5.35.1" + "@typescript-eslint/typescript-estree" "5.35.1" + debug "^4.3.4" + +"@typescript-eslint/scope-manager@5.35.1": + version "5.35.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.35.1.tgz#ccb69d54b7fd0f2d0226a11a75a8f311f525ff9e" + integrity sha512-kCYRSAzIW9ByEIzmzGHE50NGAvAP3wFTaZevgWva7GpquDyFPFcmvVkFJGWJJktg/hLwmys/FZwqM9EKr2u24Q== + dependencies: + "@typescript-eslint/types" "5.35.1" + "@typescript-eslint/visitor-keys" "5.35.1" + +"@typescript-eslint/types@5.35.1": + version "5.35.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.35.1.tgz#af355fe52a0cc88301e889bc4ada72f279b63d61" + integrity sha512-FDaujtsH07VHzG0gQ6NDkVVhi1+rhq0qEvzHdJAQjysN+LHDCKDKCBRlZFFE0ec0jKxiv0hN63SNfExy0KrbQQ== + +"@typescript-eslint/typescript-estree@5.35.1": + version "5.35.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.35.1.tgz#db878a39a0dbdc9bb133f11cdad451770bfba211" + integrity sha512-JUqE1+VRTGyoXlDWWjm6MdfpBYVq+hixytrv1oyjYIBEOZhBCwtpp5ZSvBt4wIA1MKWlnaC2UXl2XmYGC3BoQA== + dependencies: + "@typescript-eslint/types" "5.35.1" + "@typescript-eslint/visitor-keys" "5.35.1" + debug "^4.3.4" + globby "^11.1.0" + is-glob "^4.0.3" + semver "^7.3.7" + tsutils "^3.21.0" + +"@typescript-eslint/visitor-keys@5.35.1": + version "5.35.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.35.1.tgz#285e9e34aed7c876f16ff646a3984010035898e6" + integrity sha512-cEB1DvBVo1bxbW/S5axbGPE6b7FIMAbo3w+AGq6zNDA7+NYJOIkKj/sInfTv4edxd4PxJSgdN4t6/pbvgA+n5g== + dependencies: + "@typescript-eslint/types" "5.35.1" + eslint-visitor-keys "^3.3.0" + +"@zodios/core@10.7.3": + version "10.7.3" + resolved "https://registry.yarnpkg.com/@zodios/core/-/core-10.7.3.tgz#813f3c27d42f00ece960941b61626b8d47317554" + integrity sha512-O28q7FbamQP6vkdRH1rRh1JEDGVilDmFBW4HAJKs2DNt/Q25yZHqsegb+plfAMcbVuvU7rfnS0e0pK0LLAOT+g== + +"@zodios/express@10.4.4": + version "10.4.4" + resolved "https://registry.yarnpkg.com/@zodios/express/-/express-10.4.4.tgz#dc21666bb99d1cc18ddcfa97f37767040c0d1590" + integrity sha512-hOVkorK/ORQ5yHQdflhI9mvNG+Pzhp1ZJuL9C39FE8qiIVz0orFAzUAYdBLVAwFptg77bAFcIF2RUx5OuetqKw== + +"@zodios/react@10.4.3": + version "10.4.3" + resolved "https://registry.yarnpkg.com/@zodios/react/-/react-10.4.3.tgz#08c346c859a635a39c9f59bbcc607959aeccbfc6" + integrity sha512-J3Rgnlhr5p+Hv3EFUgeLhg4/YQta3+yMLU+bHw1CH+7tECmVvn1In5Q9Z4TDzczLMArINIGevjAuiNQ/Dwbwfw== + +accepts@~1.3.8: + version "1.3.8" + resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.8.tgz#0bf0be125b67014adcb0b0921e62db7bffe16b2e" + integrity sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw== + dependencies: + mime-types "~2.1.34" + negotiator "0.6.3" + +acorn-jsx@^5.3.2: + version "5.3.2" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" + integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== + +acorn@^8.8.0: + version "8.8.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.0.tgz#88c0187620435c7f6015803f5539dae05a9dbea8" + integrity sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w== + +ajv@^6.10.0, ajv@^6.12.4: + version "6.12.6" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" + integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== + dependencies: + fast-deep-equal "^3.1.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + +ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +argparse@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" + integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== + +aria-query@^4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-4.2.2.tgz#0d2ca6c9aceb56b8977e9fed6aed7e15bbd2f83b" + integrity sha512-o/HelwhuKpTj/frsOsbNLNgnNGVIFsVP/SW2BSF14gVl7kAfMOJ6/8wUAUvG1R1NHKrfG+2sHZTu0yauT1qBrA== + dependencies: + "@babel/runtime" "^7.10.2" + "@babel/runtime-corejs3" "^7.10.2" + +array-flatten@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" + integrity sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg== + +array-includes@^3.1.4, array-includes@^3.1.5: + version "3.1.5" + resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.1.5.tgz#2c320010db8d31031fd2a5f6b3bbd4b1aad31bdb" + integrity sha512-iSDYZMMyTPkiFasVqfuAQnWAYcvO/SeBSCGKePoEthjp4LEMTe4uLc7b025o4jAZpHhihh8xPo99TNWUWWkGDQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.19.5" + get-intrinsic "^1.1.1" + is-string "^1.0.7" + +array-union@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" + integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== + +array.prototype.flat@^1.2.5: + version "1.3.0" + resolved "https://registry.yarnpkg.com/array.prototype.flat/-/array.prototype.flat-1.3.0.tgz#0b0c1567bf57b38b56b4c97b8aa72ab45e4adc7b" + integrity sha512-12IUEkHsAhA4DY5s0FPgNXIdc8VRSqD9Zp78a5au9abH/SOBrsp082JOWFNTjkMozh8mqcdiKuaLGhPeYztxSw== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.19.2" + es-shim-unscopables "^1.0.0" + +array.prototype.flatmap@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/array.prototype.flatmap/-/array.prototype.flatmap-1.3.0.tgz#a7e8ed4225f4788a70cd910abcf0791e76a5534f" + integrity sha512-PZC9/8TKAIxcWKdyeb77EzULHPrIX/tIZebLJUQOMR1OwYosT8yggdfWScfTBCDj5utONvOuPQQumYsU2ULbkg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.19.2" + es-shim-unscopables "^1.0.0" + +ast-types-flow@^0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/ast-types-flow/-/ast-types-flow-0.0.7.tgz#f70b735c6bca1a5c9c22d982c3e39e7feba3bdad" + integrity sha512-eBvWn1lvIApYMhzQMsu9ciLfkBY499mFZlNqG+/9WR7PVlroQw0vG30cOQQbaKz3sCEc44TAOu2ykzqXSNnwag== + +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== + +axe-core@^4.4.3: + version "4.4.3" + resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.4.3.tgz#11c74d23d5013c0fa5d183796729bc3482bd2f6f" + integrity sha512-32+ub6kkdhhWick/UjvEwRchgoetXqTK14INLqbGm5U2TzBkBNF3nQtLYm8ovxSkQWArjEQvftCKryjZaATu3w== + +axios@1.2.6: + version "1.2.6" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.2.6.tgz#eacb6d065baa11bad5959e7ffa0cb6745c65f392" + integrity sha512-rC/7F08XxZwjMV4iuWv+JpD3E0Ksqg9nac4IIg6RwNuF0JTeWoCo/mBNG54+tNhhI11G3/VDRbdDQTs9hGp4pQ== + dependencies: + follow-redirects "^1.15.0" + form-data "^4.0.0" + proxy-from-env "^1.1.0" + +axobject-query@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-2.2.0.tgz#943d47e10c0b704aa42275e20edf3722648989be" + integrity sha512-Td525n+iPOOyUQIeBfcASuG6uJsDOITl7Mds5gFyerkWiX7qhUTdYUBlSgNMyVqtSJqwpt1kXGLdUt6SykLMRA== + +balanced-match@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== + +body-parser@1.20.1: + version "1.20.1" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.1.tgz#b1812a8912c195cd371a3ee5e66faa2338a5c668" + integrity sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw== + dependencies: + bytes "3.1.2" + content-type "~1.0.4" + debug "2.6.9" + depd "2.0.0" + destroy "1.2.0" + http-errors "2.0.0" + iconv-lite "0.4.24" + on-finished "2.4.1" + qs "6.11.0" + raw-body "2.5.1" + type-is "~1.6.18" + unpipe "1.0.0" + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + dependencies: + fill-range "^7.0.1" + +bytes@3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" + integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg== + +call-bind@^1.0.0, call-bind@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" + integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== + dependencies: + function-bind "^1.1.1" + get-intrinsic "^1.0.2" + +callsites@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" + integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== + +caniuse-lite@^1.0.30001332: + version "1.0.30001383" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001383.tgz#aecf317ccd940690725ae3ae4f28293c5fb8050e" + integrity sha512-swMpEoTp5vDoGBZsYZX7L7nXHe6dsHxi9o6/LKf/f0LukVtnrxly5GVb/fWdCDTqi/yw6Km6tiJ0pmBacm0gbg== + +chalk@^4.0.0: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +combined-stream@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" + integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== + dependencies: + delayed-stream "~1.0.0" + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== + +content-disposition@0.5.4: + version "0.5.4" + resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.4.tgz#8b82b4efac82512a02bb0b1dcec9d2c5e8eb5bfe" + integrity sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ== + dependencies: + safe-buffer "5.2.1" + +content-type@~1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" + integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== + +cookie-signature@1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" + integrity sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ== + +cookie@0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.5.0.tgz#d1f5d71adec6558c58f389987c366aa47e994f8b" + integrity sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw== + +core-js-pure@^3.20.2: + version "3.25.0" + resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.25.0.tgz#f8d1f176ff29abbfeb610110de891d5ae5a361d4" + integrity sha512-IeHpLwk3uoci37yoI2Laty59+YqH9x5uR65/yiA0ARAJrTrN4YU0rmauLWfvqOuk77SlNJXj2rM6oT/dBD87+A== + +cross-spawn@^7.0.2: + version "7.0.3" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" + integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + +csstype@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.0.tgz#4ddcac3718d787cf9df0d1b7d15033925c8f29f2" + integrity sha512-uX1KG+x9h5hIJsaKR9xHUeUraxf8IODOwq9JLNPq6BwB04a/xgpq3rcx47l5BZu5zBPlgD342tdke3Hom/nJRA== + +damerau-levenshtein@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/damerau-levenshtein/-/damerau-levenshtein-1.0.8.tgz#b43d286ccbd36bc5b2f7ed41caf2d0aba1f8a6e7" + integrity sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA== + +debug@2.6.9, debug@^2.6.9: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== + dependencies: + ms "2.0.0" + +debug@^3.2.7: + version "3.2.7" + resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" + integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== + dependencies: + ms "^2.1.1" + +debug@^4.1.1, debug@^4.3.2, debug@^4.3.4: + version "4.3.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== + dependencies: + ms "2.1.2" + +deep-is@^0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" + integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== + +define-properties@^1.1.3, define-properties@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.4.tgz#0b14d7bd7fbeb2f3572c3a7eda80ea5d57fb05b1" + integrity sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA== + dependencies: + has-property-descriptors "^1.0.0" + object-keys "^1.1.1" + +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== + +depd@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df" + integrity sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw== + +destroy@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.2.0.tgz#4803735509ad8be552934c67df614f94e66fa015" + integrity sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg== + +dir-glob@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" + integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== + dependencies: + path-type "^4.0.0" + +doctrine@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-2.1.0.tgz#5cd01fc101621b42c4cd7f5d1a66243716d3f39d" + integrity sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw== + dependencies: + esutils "^2.0.2" + +doctrine@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" + integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== + dependencies: + esutils "^2.0.2" + +ee-first@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" + integrity sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow== + +emoji-regex@^9.2.2: + version "9.2.2" + resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72" + integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg== + +encodeurl@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" + integrity sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w== + +es-abstract@^1.19.0, es-abstract@^1.19.1, es-abstract@^1.19.2, es-abstract@^1.19.5: + version "1.20.1" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.20.1.tgz#027292cd6ef44bd12b1913b828116f54787d1814" + integrity sha512-WEm2oBhfoI2sImeM4OF2zE2V3BYdSF+KnSi9Sidz51fQHd7+JuF8Xgcj9/0o+OWeIeIS/MiuNnlruQrJf16GQA== + dependencies: + call-bind "^1.0.2" + es-to-primitive "^1.2.1" + function-bind "^1.1.1" + function.prototype.name "^1.1.5" + get-intrinsic "^1.1.1" + get-symbol-description "^1.0.0" + has "^1.0.3" + has-property-descriptors "^1.0.0" + has-symbols "^1.0.3" + internal-slot "^1.0.3" + is-callable "^1.2.4" + is-negative-zero "^2.0.2" + is-regex "^1.1.4" + is-shared-array-buffer "^1.0.2" + is-string "^1.0.7" + is-weakref "^1.0.2" + object-inspect "^1.12.0" + object-keys "^1.1.1" + object.assign "^4.1.2" + regexp.prototype.flags "^1.4.3" + string.prototype.trimend "^1.0.5" + string.prototype.trimstart "^1.0.5" + unbox-primitive "^1.0.2" + +es-shim-unscopables@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz#702e632193201e3edf8713635d083d378e510241" + integrity sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w== + dependencies: + has "^1.0.3" + +es-to-primitive@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.2.1.tgz#e55cd4c9cdc188bcefb03b366c736323fc5c898a" + integrity sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA== + dependencies: + is-callable "^1.1.4" + is-date-object "^1.0.1" + is-symbol "^1.0.2" + +escape-html@~1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" + integrity sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow== + +escape-string-regexp@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" + integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== + +eslint-config-next@12.2.5: + version "12.2.5" + resolved "https://registry.yarnpkg.com/eslint-config-next/-/eslint-config-next-12.2.5.tgz#76ce83f18cc02f6f42ed407a127f83db54fabd3c" + integrity sha512-SOowilkqPzW6DxKp3a3SYlrfPi5Ajs9MIzp9gVfUDxxH9QFM5ElkR1hX5m/iICJuvCbWgQqFBiA3mCMozluniw== + dependencies: + "@next/eslint-plugin-next" "12.2.5" + "@rushstack/eslint-patch" "^1.1.3" + "@typescript-eslint/parser" "^5.21.0" + eslint-import-resolver-node "^0.3.6" + eslint-import-resolver-typescript "^2.7.1" + eslint-plugin-import "^2.26.0" + eslint-plugin-jsx-a11y "^6.5.1" + eslint-plugin-react "^7.29.4" + eslint-plugin-react-hooks "^4.5.0" + +eslint-import-resolver-node@^0.3.6: + version "0.3.6" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.6.tgz#4048b958395da89668252001dbd9eca6b83bacbd" + integrity sha512-0En0w03NRVMn9Uiyn8YRPDKvWjxCWkslUEhGNTdGx15RvPJYQ+lbOlqrlNI2vEAs4pDYK4f/HN2TbDmk5TP0iw== + dependencies: + debug "^3.2.7" + resolve "^1.20.0" + +eslint-import-resolver-typescript@^2.7.1: + version "2.7.1" + resolved "https://registry.yarnpkg.com/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-2.7.1.tgz#a90a4a1c80da8d632df25994c4c5fdcdd02b8751" + integrity sha512-00UbgGwV8bSgUv34igBDbTOtKhqoRMy9bFjNehT40bXg6585PNIct8HhXZ0SybqB9rWtXj9crcku8ndDn/gIqQ== + dependencies: + debug "^4.3.4" + glob "^7.2.0" + is-glob "^4.0.3" + resolve "^1.22.0" + tsconfig-paths "^3.14.1" + +eslint-module-utils@^2.7.3: + version "2.7.4" + resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.7.4.tgz#4f3e41116aaf13a20792261e61d3a2e7e0583974" + integrity sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA== + dependencies: + debug "^3.2.7" + +eslint-plugin-import@^2.26.0: + version "2.26.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.26.0.tgz#f812dc47be4f2b72b478a021605a59fc6fe8b88b" + integrity sha512-hYfi3FXaM8WPLf4S1cikh/r4IxnO6zrhZbEGz2b660EJRbuxgpDS5gkCuYgGWg2xxh2rBuIr4Pvhve/7c31koA== + dependencies: + array-includes "^3.1.4" + array.prototype.flat "^1.2.5" + debug "^2.6.9" + doctrine "^2.1.0" + eslint-import-resolver-node "^0.3.6" + eslint-module-utils "^2.7.3" + has "^1.0.3" + is-core-module "^2.8.1" + is-glob "^4.0.3" + minimatch "^3.1.2" + object.values "^1.1.5" + resolve "^1.22.0" + tsconfig-paths "^3.14.1" + +eslint-plugin-jsx-a11y@^6.5.1: + version "6.6.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.6.1.tgz#93736fc91b83fdc38cc8d115deedfc3091aef1ff" + integrity sha512-sXgFVNHiWffBq23uiS/JaP6eVR622DqwB4yTzKvGZGcPq6/yZ3WmOZfuBks/vHWo9GaFOqC2ZK4i6+C35knx7Q== + dependencies: + "@babel/runtime" "^7.18.9" + aria-query "^4.2.2" + array-includes "^3.1.5" + ast-types-flow "^0.0.7" + axe-core "^4.4.3" + axobject-query "^2.2.0" + damerau-levenshtein "^1.0.8" + emoji-regex "^9.2.2" + has "^1.0.3" + jsx-ast-utils "^3.3.2" + language-tags "^1.0.5" + minimatch "^3.1.2" + semver "^6.3.0" + +eslint-plugin-react-hooks@^4.5.0: + version "4.6.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.0.tgz#4c3e697ad95b77e93f8646aaa1630c1ba607edd3" + integrity sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g== + +eslint-plugin-react@^7.29.4: + version "7.31.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.31.1.tgz#d29793ed27743f3ed8a473c347b1bf5a0a8fb9af" + integrity sha512-j4/2xWqt/R7AZzG8CakGHA6Xa/u7iR8Q3xCxY+AUghdT92bnIDOBEefV456OeH0QvBcroVc0eyvrrLSyQGYIfg== + dependencies: + array-includes "^3.1.5" + array.prototype.flatmap "^1.3.0" + doctrine "^2.1.0" + estraverse "^5.3.0" + jsx-ast-utils "^2.4.1 || ^3.0.0" + minimatch "^3.1.2" + object.entries "^1.1.5" + object.fromentries "^2.0.5" + object.hasown "^1.1.1" + object.values "^1.1.5" + prop-types "^15.8.1" + resolve "^2.0.0-next.3" + semver "^6.3.0" + string.prototype.matchall "^4.0.7" + +eslint-scope@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.1.1.tgz#fff34894c2f65e5226d3041ac480b4513a163642" + integrity sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw== + dependencies: + esrecurse "^4.3.0" + estraverse "^5.2.0" + +eslint-utils@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-3.0.0.tgz#8aebaface7345bb33559db0a1f13a1d2d48c3672" + integrity sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA== + dependencies: + eslint-visitor-keys "^2.0.0" + +eslint-visitor-keys@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" + integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== + +eslint-visitor-keys@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826" + integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== + +eslint@8.32.0: + version "8.32.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.32.0.tgz#d9690056bb6f1a302bd991e7090f5b68fbaea861" + integrity sha512-nETVXpnthqKPFyuY2FNjz/bEd6nbosRgKbkgS/y1C7LJop96gYHWpiguLecMHQ2XCPxn77DS0P+68WzG6vkZSQ== + dependencies: + "@eslint/eslintrc" "^1.4.1" + "@humanwhocodes/config-array" "^0.11.8" + "@humanwhocodes/module-importer" "^1.0.1" + "@nodelib/fs.walk" "^1.2.8" + ajv "^6.10.0" + chalk "^4.0.0" + cross-spawn "^7.0.2" + debug "^4.3.2" + doctrine "^3.0.0" + escape-string-regexp "^4.0.0" + eslint-scope "^7.1.1" + eslint-utils "^3.0.0" + eslint-visitor-keys "^3.3.0" + espree "^9.4.0" + esquery "^1.4.0" + esutils "^2.0.2" + fast-deep-equal "^3.1.3" + file-entry-cache "^6.0.1" + find-up "^5.0.0" + glob-parent "^6.0.2" + globals "^13.19.0" + grapheme-splitter "^1.0.4" + ignore "^5.2.0" + import-fresh "^3.0.0" + imurmurhash "^0.1.4" + is-glob "^4.0.0" + is-path-inside "^3.0.3" + js-sdsl "^4.1.4" + js-yaml "^4.1.0" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.4.1" + lodash.merge "^4.6.2" + minimatch "^3.1.2" + natural-compare "^1.4.0" + optionator "^0.9.1" + regexpp "^3.2.0" + strip-ansi "^6.0.1" + strip-json-comments "^3.1.0" + text-table "^0.2.0" + +espree@^9.4.0: + version "9.4.0" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.4.0.tgz#cd4bc3d6e9336c433265fc0aa016fc1aaf182f8a" + integrity sha512-DQmnRpLj7f6TgN/NYb0MTzJXL+vJF9h3pHy4JhCIs3zwcgez8xmGg3sXHcEO97BrmO2OSvCwMdfdlyl+E9KjOw== + dependencies: + acorn "^8.8.0" + acorn-jsx "^5.3.2" + eslint-visitor-keys "^3.3.0" + +esquery@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.4.0.tgz#2148ffc38b82e8c7057dfed48425b3e61f0f24a5" + integrity sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w== + dependencies: + estraverse "^5.1.0" + +esrecurse@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" + integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== + dependencies: + estraverse "^5.2.0" + +estraverse@^5.1.0, estraverse@^5.2.0, estraverse@^5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" + integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== + +esutils@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" + integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== + +etag@~1.8.1: + version "1.8.1" + resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" + integrity sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg== + +express@4.18.2: + version "4.18.2" + resolved "https://registry.yarnpkg.com/express/-/express-4.18.2.tgz#3fabe08296e930c796c19e3c516979386ba9fd59" + integrity sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ== + dependencies: + accepts "~1.3.8" + array-flatten "1.1.1" + body-parser "1.20.1" + content-disposition "0.5.4" + content-type "~1.0.4" + cookie "0.5.0" + cookie-signature "1.0.6" + debug "2.6.9" + depd "2.0.0" + encodeurl "~1.0.2" + escape-html "~1.0.3" + etag "~1.8.1" + finalhandler "1.2.0" + fresh "0.5.2" + http-errors "2.0.0" + merge-descriptors "1.0.1" + methods "~1.1.2" + on-finished "2.4.1" + parseurl "~1.3.3" + path-to-regexp "0.1.7" + proxy-addr "~2.0.7" + qs "6.11.0" + range-parser "~1.2.1" + safe-buffer "5.2.1" + send "0.18.0" + serve-static "1.15.0" + setprototypeof "1.2.0" + statuses "2.0.1" + type-is "~1.6.18" + utils-merge "1.0.1" + vary "~1.1.2" + +fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" + integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== + +fast-glob@^3.2.9: + version "3.2.11" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.11.tgz#a1172ad95ceb8a16e20caa5c5e56480e5129c1d9" + integrity sha512-xrO3+1bxSo3ZVHAnqzyuewYT6aMFHRAd4Kcs92MAonjwQZLsK9d0SF1IyQ3k5PoirxTW0Oe/RqFgMQ6TcNE5Ew== + dependencies: + "@nodelib/fs.stat" "^2.0.2" + "@nodelib/fs.walk" "^1.2.3" + glob-parent "^5.1.2" + merge2 "^1.3.0" + micromatch "^4.0.4" + +fast-json-stable-stringify@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" + integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== + +fast-levenshtein@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== + +fastq@^1.6.0: + version "1.13.0" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.13.0.tgz#616760f88a7526bdfc596b7cab8c18938c36b98c" + integrity sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw== + dependencies: + reusify "^1.0.4" + +file-entry-cache@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" + integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== + dependencies: + flat-cache "^3.0.4" + +fill-range@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + dependencies: + to-regex-range "^5.0.1" + +finalhandler@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.2.0.tgz#7d23fe5731b207b4640e4fcd00aec1f9207a7b32" + integrity sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg== + dependencies: + debug "2.6.9" + encodeurl "~1.0.2" + escape-html "~1.0.3" + on-finished "2.4.1" + parseurl "~1.3.3" + statuses "2.0.1" + unpipe "~1.0.0" + +find-up@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" + integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== + dependencies: + locate-path "^6.0.0" + path-exists "^4.0.0" + +flat-cache@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" + integrity sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg== + dependencies: + flatted "^3.1.0" + rimraf "^3.0.2" + +flatted@^3.1.0: + version "3.2.7" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.7.tgz#609f39207cb614b89d0765b477cb2d437fbf9787" + integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ== + +follow-redirects@^1.15.0: + version "1.15.2" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" + integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== + +form-data@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" + integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" + +forwarded@0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.2.0.tgz#2269936428aad4c15c7ebe9779a84bf0b2a81811" + integrity sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow== + +fresh@0.5.2: + version "0.5.2" + resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" + integrity sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q== + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== + +function-bind@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== + +function.prototype.name@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/function.prototype.name/-/function.prototype.name-1.1.5.tgz#cce0505fe1ffb80503e6f9e46cc64e46a12a9621" + integrity sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.19.0" + functions-have-names "^1.2.2" + +functions-have-names@^1.2.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" + integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== + +get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.2.tgz#336975123e05ad0b7ba41f152ee4aadbea6cf598" + integrity sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA== + dependencies: + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.3" + +get-symbol-description@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/get-symbol-description/-/get-symbol-description-1.0.0.tgz#7fdb81c900101fbd564dd5f1a30af5aadc1e58d6" + integrity sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw== + dependencies: + call-bind "^1.0.2" + get-intrinsic "^1.1.1" + +glob-parent@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== + dependencies: + is-glob "^4.0.1" + +glob-parent@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" + integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== + dependencies: + is-glob "^4.0.3" + +glob@7.1.7: + version "7.1.7" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.7.tgz#3b193e9233f01d42d0b3f78294bbeeb418f94a90" + integrity sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +glob@^7.1.3, glob@^7.2.0: + version "7.2.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" + integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.1.1" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globals@^13.19.0: + version "13.20.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.20.0.tgz#ea276a1e508ffd4f1612888f9d1bad1e2717bf82" + integrity sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ== + dependencies: + type-fest "^0.20.2" + +globby@^11.1.0: + version "11.1.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" + integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== + dependencies: + array-union "^2.1.0" + dir-glob "^3.0.1" + fast-glob "^3.2.9" + ignore "^5.2.0" + merge2 "^1.4.1" + slash "^3.0.0" + +grapheme-splitter@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e" + integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ== + +has-bigints@^1.0.1, has-bigints@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/has-bigints/-/has-bigints-1.0.2.tgz#0871bd3e3d51626f6ca0966668ba35d5602d6eaa" + integrity sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ== + +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + +has-property-descriptors@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz#610708600606d36961ed04c196193b6a607fa861" + integrity sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ== + dependencies: + get-intrinsic "^1.1.1" + +has-symbols@^1.0.2, has-symbols@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" + integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== + +has-tostringtag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.0.tgz#7e133818a7d394734f941e73c3d3f9291e658b25" + integrity sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ== + dependencies: + has-symbols "^1.0.2" + +has@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== + dependencies: + function-bind "^1.1.1" + +http-errors@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-2.0.0.tgz#b7774a1486ef73cf7667ac9ae0858c012c57b9d3" + integrity sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ== + dependencies: + depd "2.0.0" + inherits "2.0.4" + setprototypeof "1.2.0" + statuses "2.0.1" + toidentifier "1.0.1" + +iconv-lite@0.4.24: + version "0.4.24" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== + dependencies: + safer-buffer ">= 2.1.2 < 3" + +ignore@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.0.tgz#6d3bac8fa7fe0d45d9f9be7bac2fc279577e345a" + integrity sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ== + +import-fresh@^3.0.0, import-fresh@^3.2.1: + version "3.3.0" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" + integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== + dependencies: + parent-module "^1.0.0" + resolve-from "^4.0.0" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA== + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +internal-slot@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/internal-slot/-/internal-slot-1.0.3.tgz#7347e307deeea2faac2ac6205d4bc7d34967f59c" + integrity sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA== + dependencies: + get-intrinsic "^1.1.0" + has "^1.0.3" + side-channel "^1.0.4" + +ipaddr.js@1.9.1: + version "1.9.1" + resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3" + integrity sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g== + +is-bigint@^1.0.1: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-bigint/-/is-bigint-1.0.4.tgz#08147a1875bc2b32005d41ccd8291dffc6691df3" + integrity sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg== + dependencies: + has-bigints "^1.0.1" + +is-boolean-object@^1.1.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/is-boolean-object/-/is-boolean-object-1.1.2.tgz#5c6dc200246dd9321ae4b885a114bb1f75f63719" + integrity sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA== + dependencies: + call-bind "^1.0.2" + has-tostringtag "^1.0.0" + +is-callable@^1.1.4, is-callable@^1.2.4: + version "1.2.4" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.4.tgz#47301d58dd0259407865547853df6d61fe471945" + integrity sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w== + +is-core-module@^2.8.1, is-core-module@^2.9.0: + version "2.10.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.10.0.tgz#9012ede0a91c69587e647514e1d5277019e728ed" + integrity sha512-Erxj2n/LDAZ7H8WNJXd9tw38GYM3dv8rk8Zcs+jJuxYTW7sozH+SS8NtrSjVL1/vpLvWi1hxy96IzjJ3EHTJJg== + dependencies: + has "^1.0.3" + +is-date-object@^1.0.1: + version "1.0.5" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.5.tgz#0841d5536e724c25597bf6ea62e1bd38298df31f" + integrity sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ== + dependencies: + has-tostringtag "^1.0.0" + +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== + +is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== + dependencies: + is-extglob "^2.1.1" + +is-negative-zero@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/is-negative-zero/-/is-negative-zero-2.0.2.tgz#7bf6f03a28003b8b3965de3ac26f664d765f3150" + integrity sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA== + +is-number-object@^1.0.4: + version "1.0.7" + resolved "https://registry.yarnpkg.com/is-number-object/-/is-number-object-1.0.7.tgz#59d50ada4c45251784e9904f5246c742f07a42fc" + integrity sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ== + dependencies: + has-tostringtag "^1.0.0" + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + +is-path-inside@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" + integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== + +is-regex@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" + integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== + dependencies: + call-bind "^1.0.2" + has-tostringtag "^1.0.0" + +is-shared-array-buffer@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz#8f259c573b60b6a32d4058a1a07430c0a7344c79" + integrity sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA== + dependencies: + call-bind "^1.0.2" + +is-string@^1.0.5, is-string@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/is-string/-/is-string-1.0.7.tgz#0dd12bf2006f255bb58f695110eff7491eebc0fd" + integrity sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg== + dependencies: + has-tostringtag "^1.0.0" + +is-symbol@^1.0.2, is-symbol@^1.0.3: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.4.tgz#a6dac93b635b063ca6872236de88910a57af139c" + integrity sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg== + dependencies: + has-symbols "^1.0.2" + +is-weakref@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/is-weakref/-/is-weakref-1.0.2.tgz#9529f383a9338205e89765e0392efc2f100f06f2" + integrity sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ== + dependencies: + call-bind "^1.0.2" + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== + +js-sdsl@^4.1.4: + version "4.1.5" + resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.1.5.tgz#1ff1645e6b4d1b028cd3f862db88c9d887f26e2a" + integrity sha512-08bOAKweV2NUC1wqTtf3qZlnpOX/R2DU9ikpjOHs0H+ibQv3zpncVQg6um4uYtRtrwIX8M4Nh3ytK4HGlYAq7Q== + +"js-tokens@^3.0.0 || ^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +js-yaml@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" + integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== + dependencies: + argparse "^2.0.1" + +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== + +json-stable-stringify-without-jsonify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" + integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== + +json5@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-1.0.1.tgz#779fb0018604fa854eacbf6252180d83543e3dbe" + integrity sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow== + dependencies: + minimist "^1.2.0" + +"jsx-ast-utils@^2.4.1 || ^3.0.0", jsx-ast-utils@^3.3.2: + version "3.3.3" + resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-3.3.3.tgz#76b3e6e6cece5c69d49a5792c3d01bd1a0cdc7ea" + integrity sha512-fYQHZTZ8jSfmWZ0iyzfwiU4WDX4HpHbMCZ3gPlWYiCl3BoeOTsqKBqnTVfH2rYT7eP5c3sVbeSPHnnJOaTrWiw== + dependencies: + array-includes "^3.1.5" + object.assign "^4.1.3" + +language-subtag-registry@~0.3.2: + version "0.3.22" + resolved "https://registry.yarnpkg.com/language-subtag-registry/-/language-subtag-registry-0.3.22.tgz#2e1500861b2e457eba7e7ae86877cbd08fa1fd1d" + integrity sha512-tN0MCzyWnoz/4nHS6uxdlFWoUZT7ABptwKPQ52Ea7URk6vll88bWBVhodtnlfEuCcKWNGoc+uGbw1cwa9IKh/w== + +language-tags@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/language-tags/-/language-tags-1.0.5.tgz#d321dbc4da30ba8bf3024e040fa5c14661f9193a" + integrity sha512-qJhlO9cGXi6hBGKoxEG/sKZDAHD5Hnu9Hs4WbOY3pCWXDhw0N8x1NenNzm2EnNLkLkk7J2SdxAkDSbb6ftT+UQ== + dependencies: + language-subtag-registry "~0.3.2" + +levn@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" + integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ== + dependencies: + prelude-ls "^1.2.1" + type-check "~0.4.0" + +locate-path@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" + integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== + dependencies: + p-locate "^5.0.0" + +lodash.merge@^4.6.2: + version "4.6.2" + resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" + integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== + +loose-envify@^1.1.0, loose-envify@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== + dependencies: + js-tokens "^3.0.0 || ^4.0.0" + +lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== + dependencies: + yallist "^4.0.0" + +media-typer@0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" + integrity sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ== + +merge-descriptors@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" + integrity sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w== + +merge2@^1.3.0, merge2@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" + integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== + +methods@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" + integrity sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w== + +micromatch@^4.0.4: + version "4.0.5" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" + integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== + dependencies: + braces "^3.0.2" + picomatch "^2.3.1" + +mime-db@1.52.0: + version "1.52.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" + integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== + +mime-types@^2.1.12, mime-types@~2.1.24, mime-types@~2.1.34: + version "2.1.35" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" + integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== + dependencies: + mime-db "1.52.0" + +mime@1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" + integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== + +minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" + integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== + dependencies: + brace-expansion "^1.1.7" + +minimist@^1.2.0, minimist@^1.2.6: + version "1.2.6" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" + integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A== + +ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +ms@2.1.3, ms@^2.1.1: + version "2.1.3" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== + +nanoid@^3.3.4: + version "3.3.4" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.4.tgz#730b67e3cd09e2deacf03c027c81c9d9dbc5e8ab" + integrity sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw== + +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== + +negotiator@0.6.3: + version "0.6.3" + resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.3.tgz#58e323a72fedc0d6f9cd4d31fe49f51479590ccd" + integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg== + +next@12.2.5: + version "12.2.5" + resolved "https://registry.yarnpkg.com/next/-/next-12.2.5.tgz#14fb5975e8841fad09553b8ef41fe1393602b717" + integrity sha512-tBdjqX5XC/oFs/6gxrZhjmiq90YWizUYU6qOWAfat7zJwrwapJ+BYgX2PmiacunXMaRpeVT4vz5MSPSLgNkrpA== + dependencies: + "@next/env" "12.2.5" + "@swc/helpers" "0.4.3" + caniuse-lite "^1.0.30001332" + postcss "8.4.14" + styled-jsx "5.0.4" + use-sync-external-store "1.2.0" + optionalDependencies: + "@next/swc-android-arm-eabi" "12.2.5" + "@next/swc-android-arm64" "12.2.5" + "@next/swc-darwin-arm64" "12.2.5" + "@next/swc-darwin-x64" "12.2.5" + "@next/swc-freebsd-x64" "12.2.5" + "@next/swc-linux-arm-gnueabihf" "12.2.5" + "@next/swc-linux-arm64-gnu" "12.2.5" + "@next/swc-linux-arm64-musl" "12.2.5" + "@next/swc-linux-x64-gnu" "12.2.5" + "@next/swc-linux-x64-musl" "12.2.5" + "@next/swc-win32-arm64-msvc" "12.2.5" + "@next/swc-win32-ia32-msvc" "12.2.5" + "@next/swc-win32-x64-msvc" "12.2.5" + +object-assign@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== + +object-inspect@^1.12.0, object-inspect@^1.9.0: + version "1.12.2" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.2.tgz#c0641f26394532f28ab8d796ab954e43c009a8ea" + integrity sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ== + +object-keys@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" + integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== + +object.assign@^4.1.2, object.assign@^4.1.3: + version "4.1.4" + resolved "https://registry.yarnpkg.com/object.assign/-/object.assign-4.1.4.tgz#9673c7c7c351ab8c4d0b516f4343ebf4dfb7799f" + integrity sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + has-symbols "^1.0.3" + object-keys "^1.1.1" + +object.entries@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.5.tgz#e1acdd17c4de2cd96d5a08487cfb9db84d881861" + integrity sha512-TyxmjUoZggd4OrrU1W66FMDG6CuqJxsFvymeyXI51+vQLN67zYfZseptRge703kKQdo4uccgAKebXFcRCzk4+g== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.19.1" + +object.fromentries@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.5.tgz#7b37b205109c21e741e605727fe8b0ad5fa08251" + integrity sha512-CAyG5mWQRRiBU57Re4FKoTBjXfDoNwdFVH2Y1tS9PqCsfUTymAohOkEMSG3aRNKmv4lV3O7p1et7c187q6bynw== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.19.1" + +object.hasown@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/object.hasown/-/object.hasown-1.1.1.tgz#ad1eecc60d03f49460600430d97f23882cf592a3" + integrity sha512-LYLe4tivNQzq4JdaWW6WO3HMZZJWzkkH8fnI6EebWl0VZth2wL2Lovm74ep2/gZzlaTdV62JZHEqHQ2yVn8Q/A== + dependencies: + define-properties "^1.1.4" + es-abstract "^1.19.5" + +object.values@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.5.tgz#959f63e3ce9ef108720333082131e4a459b716ac" + integrity sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.19.1" + +on-finished@2.4.1: + version "2.4.1" + resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.4.1.tgz#58c8c44116e54845ad57f14ab10b03533184ac3f" + integrity sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg== + dependencies: + ee-first "1.1.1" + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== + dependencies: + wrappy "1" + +optionator@^0.9.1: + version "0.9.1" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.1.tgz#4f236a6373dae0566a6d43e1326674f50c291499" + integrity sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw== + dependencies: + deep-is "^0.1.3" + fast-levenshtein "^2.0.6" + levn "^0.4.1" + prelude-ls "^1.2.1" + type-check "^0.4.0" + word-wrap "^1.2.3" + +p-limit@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== + dependencies: + yocto-queue "^0.1.0" + +p-locate@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" + integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== + dependencies: + p-limit "^3.0.2" + +parent-module@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" + integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== + dependencies: + callsites "^3.0.0" + +parseurl@~1.3.3: + version "1.3.3" + resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" + integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== + +path-exists@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== + +path-key@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" + integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== + +path-parse@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" + integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== + +path-to-regexp@0.1.7: + version "0.1.7" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" + integrity sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ== + +path-type@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" + integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== + +picocolors@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" + integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== + +picomatch@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== + +postcss@8.4.14: + version "8.4.14" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.14.tgz#ee9274d5622b4858c1007a74d76e42e56fd21caf" + integrity sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig== + dependencies: + nanoid "^3.3.4" + picocolors "^1.0.0" + source-map-js "^1.0.2" + +prelude-ls@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" + integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== + +prop-types@^15.8.1: + version "15.8.1" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5" + integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg== + dependencies: + loose-envify "^1.4.0" + object-assign "^4.1.1" + react-is "^16.13.1" + +proxy-addr@~2.0.7: + version "2.0.7" + resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025" + integrity sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg== + dependencies: + forwarded "0.2.0" + ipaddr.js "1.9.1" + +proxy-from-env@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" + integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== + +punycode@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== + +qs@6.11.0: + version "6.11.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.11.0.tgz#fd0d963446f7a65e1367e01abd85429453f0c37a" + integrity sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q== + dependencies: + side-channel "^1.0.4" + +queue-microtask@^1.2.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" + integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== + +range-parser@~1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" + integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== + +raw-body@2.5.1: + version "2.5.1" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.5.1.tgz#fe1b1628b181b700215e5fd42389f98b71392857" + integrity sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig== + dependencies: + bytes "3.1.2" + http-errors "2.0.0" + iconv-lite "0.4.24" + unpipe "1.0.0" + +react-dom@18.2.0: + version "18.2.0" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.2.0.tgz#22aaf38708db2674ed9ada224ca4aa708d821e3d" + integrity sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g== + dependencies: + loose-envify "^1.1.0" + scheduler "^0.23.0" + +react-is@^16.13.1: + version "16.13.1" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" + integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== + +react@18.2.0: + version "18.2.0" + resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5" + integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ== + dependencies: + loose-envify "^1.1.0" + +regenerator-runtime@^0.13.4: + version "0.13.9" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.9.tgz#8925742a98ffd90814988d7566ad30ca3b263b52" + integrity sha512-p3VT+cOEgxFsRRA9X4lkI1E+k2/CtnKtU4gcxyaCUreilL/vqI6CdZ3wxVUx3UOUg+gnUOQQcRI7BmSI656MYA== + +regexp.prototype.flags@^1.4.1, regexp.prototype.flags@^1.4.3: + version "1.4.3" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz#87cab30f80f66660181a3bb7bf5981a872b367ac" + integrity sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + functions-have-names "^1.2.2" + +regexpp@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" + integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== + +resolve-from@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" + integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== + +resolve@^1.20.0, resolve@^1.22.0: + version "1.22.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177" + integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== + dependencies: + is-core-module "^2.9.0" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" + +resolve@^2.0.0-next.3: + version "2.0.0-next.4" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-2.0.0-next.4.tgz#3d37a113d6429f496ec4752d2a2e58efb1fd4660" + integrity sha512-iMDbmAWtfU+MHpxt/I5iWI7cY6YVEZUQ3MBgPQ++XD1PELuJHIl82xBmObyP2KyQmkNB2dsqF7seoQQiAn5yDQ== + dependencies: + is-core-module "^2.9.0" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" + +reusify@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" + integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== + +rimraf@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" + integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== + dependencies: + glob "^7.1.3" + +run-parallel@^1.1.9: + version "1.2.0" + resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" + integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== + dependencies: + queue-microtask "^1.2.2" + +safe-buffer@5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + +"safer-buffer@>= 2.1.2 < 3": + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +scheduler@^0.23.0: + version "0.23.0" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.23.0.tgz#ba8041afc3d30eb206a487b6b384002e4e61fdfe" + integrity sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw== + dependencies: + loose-envify "^1.1.0" + +semver@^6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" + integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== + +semver@^7.3.7: + version "7.3.7" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.7.tgz#12c5b649afdbf9049707796e22a4028814ce523f" + integrity sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g== + dependencies: + lru-cache "^6.0.0" + +send@0.18.0: + version "0.18.0" + resolved "https://registry.yarnpkg.com/send/-/send-0.18.0.tgz#670167cc654b05f5aa4a767f9113bb371bc706be" + integrity sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg== + dependencies: + debug "2.6.9" + depd "2.0.0" + destroy "1.2.0" + encodeurl "~1.0.2" + escape-html "~1.0.3" + etag "~1.8.1" + fresh "0.5.2" + http-errors "2.0.0" + mime "1.6.0" + ms "2.1.3" + on-finished "2.4.1" + range-parser "~1.2.1" + statuses "2.0.1" + +serve-static@1.15.0: + version "1.15.0" + resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.15.0.tgz#faaef08cffe0a1a62f60cad0c4e513cff0ac9540" + integrity sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g== + dependencies: + encodeurl "~1.0.2" + escape-html "~1.0.3" + parseurl "~1.3.3" + send "0.18.0" + +setprototypeof@1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" + integrity sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw== + +shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + dependencies: + shebang-regex "^3.0.0" + +shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + +side-channel@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.0.4.tgz#efce5c8fdc104ee751b25c58d4290011fa5ea2cf" + integrity sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw== + dependencies: + call-bind "^1.0.0" + get-intrinsic "^1.0.2" + object-inspect "^1.9.0" + +slash@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" + integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== + +source-map-js@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" + integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== + +statuses@2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-2.0.1.tgz#55cb000ccf1d48728bd23c685a063998cf1a1b63" + integrity sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ== + +string.prototype.matchall@^4.0.7: + version "4.0.7" + resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.7.tgz#8e6ecb0d8a1fb1fda470d81acecb2dba057a481d" + integrity sha512-f48okCX7JiwVi1NXCVWcFnZgADDC/n2vePlQ/KUCNqCikLLilQvwjMO8+BHVKvgzH0JB0J9LEPgxOGT02RoETg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.19.1" + get-intrinsic "^1.1.1" + has-symbols "^1.0.3" + internal-slot "^1.0.3" + regexp.prototype.flags "^1.4.1" + side-channel "^1.0.4" + +string.prototype.trimend@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.5.tgz#914a65baaab25fbdd4ee291ca7dde57e869cb8d0" + integrity sha512-I7RGvmjV4pJ7O3kdf+LXFpVfdNOxtCW/2C8f6jNiW4+PQchwxkCDzlk1/7p+Wl4bqFIZeF47qAHXLuHHWKAxog== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.19.5" + +string.prototype.trimstart@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.5.tgz#5466d93ba58cfa2134839f81d7f42437e8c01fef" + integrity sha512-THx16TJCGlsN0o6dl2o6ncWUsdgnLRSA23rRE5pyGBw/mLr3Ej/R2LaqCtgP8VNMGZsvMWnf9ooZPyY2bHvUFg== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.4" + es-abstract "^1.19.5" + +strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + integrity sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA== + +strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" + integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== + +styled-jsx@5.0.4: + version "5.0.4" + resolved "https://registry.yarnpkg.com/styled-jsx/-/styled-jsx-5.0.4.tgz#5b1bd0b9ab44caae3dd1361295559706e044aa53" + integrity sha512-sDFWLbg4zR+UkNzfk5lPilyIgtpddfxXEULxhujorr5jtePTUqiPDc5BC0v1NRqTr/WaFBGQQUoYToGlF4B2KQ== + +supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + +supports-preserve-symlinks-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" + integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== + +text-table@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== + +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + +toidentifier@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" + integrity sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA== + +tsconfig-paths@^3.14.1: + version "3.14.1" + resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz#ba0734599e8ea36c862798e920bcf163277b137a" + integrity sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ== + dependencies: + "@types/json5" "^0.0.29" + json5 "^1.0.1" + minimist "^1.2.6" + strip-bom "^3.0.0" + +tslib@^1.8.1: + version "1.14.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" + integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== + +tslib@^2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3" + integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ== + +tsutils@^3.21.0: + version "3.21.0" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" + integrity sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA== + dependencies: + tslib "^1.8.1" + +type-check@^0.4.0, type-check@~0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" + integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew== + dependencies: + prelude-ls "^1.2.1" + +type-fest@^0.20.2: + version "0.20.2" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" + integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== + +type-is@~1.6.18: + version "1.6.18" + resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" + integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== + dependencies: + media-typer "0.3.0" + mime-types "~2.1.24" + +typescript@4.9.4: + version "4.9.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.4.tgz#a2a3d2756c079abda241d75f149df9d561091e78" + integrity sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg== + +unbox-primitive@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.2.tgz#29032021057d5e6cdbd08c5129c226dff8ed6f9e" + integrity sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw== + dependencies: + call-bind "^1.0.2" + has-bigints "^1.0.2" + has-symbols "^1.0.3" + which-boxed-primitive "^1.0.2" + +unpipe@1.0.0, unpipe@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" + integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== + +uri-js@^4.2.2: + version "4.4.1" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" + integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== + dependencies: + punycode "^2.1.0" + +use-sync-external-store@1.2.0, use-sync-external-store@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz#7dbefd6ef3fe4e767a0cf5d7287aacfb5846928a" + integrity sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA== + +utils-merge@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" + integrity sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA== + +vary@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" + integrity sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg== + +which-boxed-primitive@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz#13757bc89b209b049fe5d86430e21cf40a89a8e6" + integrity sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg== + dependencies: + is-bigint "^1.0.1" + is-boolean-object "^1.1.0" + is-number-object "^1.0.4" + is-string "^1.0.5" + is-symbol "^1.0.3" + +which@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + +word-wrap@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" + integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== + +yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== + +yocto-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" + integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== + +zod@3.20.2: + version "3.20.2" + resolved "https://registry.yarnpkg.com/zod/-/zod-3.20.2.tgz#068606642c8f51b3333981f91c0a8ab37dfc2807" + integrity sha512-1MzNQdAvO+54H+EaK5YpyEy0T+Ejo/7YLHS93G3RnYWh5gaotGHwGeN/ZO687qEDU2y4CdStQYXVHIgrUl5UVQ== diff --git a/examples/server.ts b/examples/server.ts new file mode 100644 index 00000000..13d7f51a --- /dev/null +++ b/examples/server.ts @@ -0,0 +1,41 @@ +import { makeApi } from "@zodios/core"; +import { zodiosApp } from "../packages/express/src/index"; +import { z } from "zod"; + +const userApi = makeApi([ + { + method: "get", + path: "/users/:id", + alias: "getUser", + description: "Get a user", + parameters: [ + { + name: "id", + type: "Path", + schema: z.number(), + }, + { + name: "filter", + type: "Query", + schema: z.string().array().default([]), + }, + ], + response: z.object({ + id: z.number(), + name: z.string().nullable(), + }), + }, +]); + +const app = zodiosApp(userApi); + +app.get("/users/:id", async (req, res) => { + const { id } = req.params; + // ^? + const { filter } = req.query; + // ^? + return res.json({ + id: req.params.id, + name: "example", + }); +}); diff --git a/packages/core/src/zodios.types.ts b/packages/core/src/zodios.types.ts index 4da462ce..ea806643 100644 --- a/packages/core/src/zodios.types.ts +++ b/packages/core/src/zodios.types.ts @@ -36,6 +36,7 @@ export const HTTP_MUTATION_METHODS = [ export const HTTP_METHODS = [ ...HTTP_QUERY_METHODS, ...HTTP_MUTATION_METHODS, + "options", ] as const; export type QueryMethod = typeof HTTP_QUERY_METHODS[number]; diff --git a/packages/express/LICENSE b/packages/express/LICENSE new file mode 100644 index 00000000..e5dea986 --- /dev/null +++ b/packages/express/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 ecyrbe + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/express/README.md b/packages/express/README.md new file mode 100644 index 00000000..4e25ef63 --- /dev/null +++ b/packages/express/README.md @@ -0,0 +1,214 @@ +

Zodios Express

+

+ + Zodios logo + +

+

+ Zodios express is a typescript end to end typesafe adapter for express using zod +
+

+ +

+ + langue typescript + + + npm + + + GitHub + + GitHub Workflow Status +

+ +https://user-images.githubusercontent.com/633115/185851987-554f5686-cb78-4096-8ff5-c8d61b645608.mp4 + +# What is it ? + +It's an express adapter for zodios that helps you type your express routes. + +- really simple centralized API declaration +- router endpoints autocompletion +- typescript autocompletion for query, path, header and body input parameters (`req` is fully typed) +- typescript autocompletion for response body (`res.json()`) +- input validation thanks to zod +- openapi specification generation out of the box (using swagger) +- end to end typesafe APIs (a la tRPC when using both @zodios/express and @zodios/core) + +**Table of contents:** + +- [What is it ?](#what-is-it-) +- [Install](#install) +- [How to use it ?](#how-to-use-it-) + - [`zodiosApp` : Declare your API for fullstack end to end type safety](#zodiosapp--declare-your-api-for-fullstack-end-to-end-type-safety) + - [`zodiosRouter` : Split your application with multiple routers](#zodiosrouter--split-your-application-with-multiple-routers) + - [Error Handling](#error-handling) +- [Roadmap](#roadmap) + +# Install + +```bash +> npm install @zodios/express +``` + +or + +```bash +> yarn add @zodios/express +``` + +# How to use it ? + +For an almost complete example on how to use zodios and how to split your APIs declarations, take a look at [dev.to](examples/dev.to/) example. + +## `zodiosApp` : Declare your API for fullstack end to end type safety + +Here is an example of API declaration with Zodios. + +in a common directory (ex: `src/common/api.ts`) : + +```typescript +import { makeApi } from "@zodios/core"; +import { z } from "zod"; + +const userApi = makeApi([ + { + method: "get", + path: "/users/:id", // auto detect :id and ask for it in apiClient get params + alias: "getUser", // optionnal alias to call this endpoint with it + description: "Get a user", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, +]); +``` + +in your frontend (ex: `src/client/api.ts`) : + +```typescript +import { Zodios } from "@zodios/core"; +import { userApi } from "../../common/api"; + +const apiClient = new Zodios( + "https://jsonplaceholder.typicode.com", + userApi +); + +// typed alias auto-complete params +// â–¼ â–¼ â–¼ +const user = await apiClient.getUser({ params: { id: 1 } }); +``` + +in your backend (ex: `src/server/router.ts`) : +```typescript +import { zodiosApp } from "@zodios/express"; +import { userApi } from "../../common/api"; + +// just an express adapter that is aware of your api, app is just an express app with type annotations and validation middlewares +const app = zodiosApp(userApi); + +// auto-complete path fully typed and validated input params (body, query, path, header) +// â–¼ â–¼ â–¼ +app.get("/users/:id", (req, res) => { + // res.json is typed thanks to zod + res.json({ + // auto-complete req.params.id + // â–¼ + id: req.params.id, + name: "John Doe", + }); +}) + +app.listen(3000); +``` + +## `zodiosRouter` : Split your application with multiple routers + +When organizing your express application, you usually want to split your API declarations into separate Routers. +You can use the `zodiosRouter` to do that with a `zodiosApp` without APIs attached. + +```typescript +import { zodiosApp, zodiosRouter } from "@zodios/express"; + +const app = zodiosApp(); // just an axpess app with type annotations +const userRouter = zodiosRouter(userApi); // just an express router with type annotations and validation middlewares +const adminRouter = zodiosRouter(adminApi); // just an express router with type annotations and validation middlewares + +const app.use(userRouter,adminRouter); + +app.listen(3000); +``` +## Error Handling + +Zodios express can infer the status code to match your API error response and also have your errors correctly typed. + +```typescript +import { makeApi } from "@zodios/core"; +import { zodiosApp } from "@zodios/express"; +import { z } from "zod"; + +const userApi = makeApi([ + { + method: "get", + path: "/users/:id", // auto detect :id and ask for it in apiClient get params + alias: "getUser", // optionnal alias to call this endpoint with it + description: "Get a user", + response: z.object({ + id: z.number(), + name: z.string(), + }), + errors: [ + { + status: 404, + response: z.object({ + code: z.string(), + message: z.string(), + id: z.number(), + }), + }, { + status: 'default', // default status code will be used if error is not 404 + response: z.object({ + code: z.string(), + message: z.string(), + }), + }, + ], + }, +]); + +const app = zodiosApp(userApi); +app.get("/users/:id", (req, res) => { + try { + const id = +req.params.id; + const user = service.findUser(id); + if(!user) { + // match error 404 schema with auto-completion + res.status(404).json({ + code: "USER_NOT_FOUND", + message: "User not found", + id, // compile time error if you forget to add id + }); + } else { + // match response schema with auto-completion + res.json(user); + } + } catch(err) { + // match default error schema with auto-completion + res.status(500).json({ + code: "INTERNAL_ERROR", + message: "Internal error", + }); + } +}) + +app.listen(3000); +``` + +# Roadmap + +- [] add support for swagger/openapi generation +- [] add utilities to combine api declarations to match the express router api +- [] add autocompletion for express `app.name()` diff --git a/packages/express/jest.config.ts b/packages/express/jest.config.ts new file mode 100644 index 00000000..d32c0704 --- /dev/null +++ b/packages/express/jest.config.ts @@ -0,0 +1,23 @@ +import type { Config } from "@jest/types"; + +// Objet synchrone +const config: Config.InitialOptions = { + verbose: true, + moduleFileExtensions: ["ts", "js", "json", "node"], + rootDir: "./", + testRegex: ".(spec|test).tsx?$", + transform: { + "^.+\\.tsx?$": "ts-jest", + }, + coverageDirectory: "./coverage", + coverageThreshold: { + global: { + branches: 80, + functions: 80, + lines: 80, + statements: 80, + }, + }, + testEnvironment: "node", +}; +export default config; diff --git a/packages/express/package.json b/packages/express/package.json new file mode 100644 index 00000000..cd05416d --- /dev/null +++ b/packages/express/package.json @@ -0,0 +1,64 @@ +{ + "name": "@zodios/express", + "description": "Typescript express server", + "version": "11.0.0-beta.17", + "main": "lib/index.js", + "module": "lib/index.mjs", + "typings": "lib/index.d.ts", + "exports": { + ".": { + "import": "./lib/index.mjs", + "require": "./lib/index.js", + "types": "./lib/index.d.ts" + }, + "./package.json": "./package.json" + }, + "files": [ + "lib" + ], + "author": { + "name": "ecyrbe", + "email": "ecyrbe@gmail.com" + }, + "homepage": "https://github.com/ecyrbe/zodios", + "repository": { + "type": "git", + "url": "https://github.com/ecyrbe/zodios.git" + }, + "license": "MIT", + "keywords": [ + "express", + "zod", + "rpc", + "validation" + ], + "scripts": { + "prebuild": "rimraf lib", + "build": "tsup", + "test": "jest --coverage" + }, + "peerDependencies": { + "@zodios/core": "11.0.0-beta.17", + "express": "4.x", + "zod": "^3.x" + }, + "devDependencies": { + "@jest/globals": "29.3.1", + "@jest/types": "29.3.1", + "@types/express": "4.17.16", + "@types/jest": "29.4.0", + "@types/node": "18.11.18", + "@types/supertest": "2.0.12", + "@zodios/core": "workspace:*", + "express": "4.18.2", + "jest": "29.4.1", + "rimraf": "4.1.2", + "supertest": "6.3.3", + "ts-jest": "29.0.5", + "ts-node": "10.9.1", + "tsup": "6.3.0", + "typescript": "4.9.4", + "zod": "3.20.2" + }, + "dependencies": {} +} diff --git a/packages/express/renovate.json b/packages/express/renovate.json new file mode 100644 index 00000000..a768665e --- /dev/null +++ b/packages/express/renovate.json @@ -0,0 +1,5 @@ +{ + "extends": ["config:base"], + "ignorePaths": ["examples/**"], + "ignoreDeps": ["tsup"] +} diff --git a/packages/express/src/index.ts b/packages/express/src/index.ts new file mode 100644 index 00000000..a0cf2a9f --- /dev/null +++ b/packages/express/src/index.ts @@ -0,0 +1,22 @@ +export { + zodiosApp, + zodiosRouter, + zodiosNextApp, + zodiosContext, +} from "./zodios"; +export type { ZodiosContext } from "./zodios"; + +export type { + ZodiosApp, + ZodiosAppOptions, + ZodiosHandler, + ZodiosHandlers, + ZodiosRequestHandler, + ZodiosRouter, + ZodiosRouterOptions, + ZodiosRouterContextRequestHandler, + ZodiosValidationOptions, + ZodiosUse, + ZodiosSucessCodes, + WithZodiosContext, +} from "./zodios.types"; diff --git a/packages/express/src/zodios-validator.ts b/packages/express/src/zodios-validator.ts new file mode 100644 index 00000000..70476049 --- /dev/null +++ b/packages/express/src/zodios-validator.ts @@ -0,0 +1,136 @@ +import express from "express"; +import { + ZodiosEndpointDefinition, + ZodiosEndpointDefinitions, +} from "@zodios/core"; +import { isZodType, withoutTransform } from "./zodios.utils"; +import { z } from "zod"; + +const METHODS = ["get", "post", "put", "patch", "delete"] as const; + +async function validateParam(schema: z.ZodType, parameter: unknown) { + if ( + (isZodType(schema, z.ZodFirstPartyTypeKind.ZodNumber) || + isZodType(schema, z.ZodFirstPartyTypeKind.ZodBoolean)) && + parameter && + typeof parameter === "string" + ) { + return z + .preprocess((x) => { + try { + return JSON.parse(x as string); + } catch { + return x; + } + }, schema) + .safeParseAsync(parameter); + } + return schema.safeParseAsync(parameter); +} + +function validateEndpointMiddleware( + endpoint: ZodiosEndpointDefinition, + transform: boolean +) { + return async ( + req: express.Request, + res: express.Response, + next: express.NextFunction + ) => { + for (let parameter of endpoint.parameters!) { + let schema = parameter.schema; + if (!transform) { + schema = withoutTransform(schema); + } + + switch (parameter.type) { + case "Body": + { + const result = await schema.safeParseAsync(req.body); + if (!result.success) { + return res.status(400).json({ + context: "body", + error: result.error.issues, + }); + } + req.body = result.data; + } + break; + case "Path": + { + const result = await validateParam( + schema, + req.params[parameter.name] + ); + if (!result.success) { + return res.status(400).json({ + context: `path.${parameter.name}`, + error: result.error.issues, + }); + } + req.params[parameter.name] = result.data as any; + } + break; + case "Query": + { + const result = await validateParam( + schema, + req.query[parameter.name] + ); + if (!result.success) { + return res.status(400).json({ + context: `query.${parameter.name}`, + error: result.error.issues, + }); + } + req.query[parameter.name] = result.data as any; + } + break; + case "Header": + { + const result = await parameter.schema.safeParseAsync( + req.get(parameter.name) + ); + if (!result.success) { + return res.status(400).json({ + context: `header.${parameter.name}`, + error: result.error.issues, + }); + } + req.headers[parameter.name] = result.data as any; + } + break; + } + } + next(); + }; +} + +/** + * monkey patch express.Router to add inject the validation middlewares after the route is matched + * @param api - the api definition + * @param router - express router to patch + * @param transform - whether to transform the data or not + */ +export function injectParametersValidators( + api: ZodiosEndpointDefinitions, + router: express.Router, + transform: boolean +) { + for (let method of METHODS) { + const savedMethod = router[method].bind(router); + // @ts-ignore + router[method] = (path: string, ...handlers: any[]) => { + const endpoint = api.find( + (endpoint) => endpoint.method === method && endpoint.path === path + ); + if (endpoint && endpoint.parameters) { + handlers = [ + validateEndpointMiddleware(endpoint, transform), + ...handlers, + ]; + } + return savedMethod(path, ...handlers); + }; + } +} diff --git a/packages/express/src/zodios.spec.ts b/packages/express/src/zodios.spec.ts new file mode 100644 index 00000000..eca19730 --- /dev/null +++ b/packages/express/src/zodios.spec.ts @@ -0,0 +1,383 @@ +import request from "supertest"; +import z from "zod"; +import { apiBuilder, makeErrors } from "@zodios/core"; +import { zodiosContext } from "./zodios"; + +const user = z.object({ + id: z.number(), + name: z.string(), + email: z.string().email(), +}); + +const errors = makeErrors([ + { + status: "default", + schema: z.object({ + error: z.object({ + code: z.string(), + message: z.string(), + }), + }), + }, +]); + +const userApi = apiBuilder({ + method: "get", + path: "/users", + parameters: [ + { + name: "limit", + type: "Query", + schema: z.number().min(1).max(Infinity).default(Infinity), + }, + { + name: "offset", + type: "Query", + schema: z.number().min(0).max(Infinity).default(0), + }, + { + name: "active", + type: "Query", + schema: z.boolean().default(true), + }, + ], + response: z.array(user), + errors, +}) + .addEndpoint({ + method: "get", + path: "/users/:id", + parameters: [ + { + name: "id", + type: "Path", + schema: z.number(), + }, + ], + response: user, + errors, + }) + .addEndpoint({ + method: "post", + path: "/users", + parameters: [ + { + name: "user", + type: "Body", + schema: user.omit({ id: true }), + }, + ], + response: user, + }) + .addEndpoint({ + method: "put", + path: "/users/:id", + parameters: [ + { + name: "user", + type: "Body", + schema: user, + }, + { + name: "Authorization", + type: "Header", + schema: z.string().regex(/^Bearer\s+[a-zA-Z0-9]+$/), + }, + ], + response: user, + }) + .addEndpoint({ + method: "delete", + path: "/users/:id", + response: user, + }) + .build(); + +describe("router", () => { + it("should get one user", async () => { + const app = zodiosContext().app(userApi); + app.get("/users/:id", (req, res, next) => { + if (req.params.id >= 10) { + return res.status(404).json({ + error: { + code: "NOT_FOUND", + message: "User not found", + }, + }); + } + res.json({ + id: req.params.id, + name: "john doe", + email: "test@domain.com", + }); + }); + const req = request(app); + const result = await req.get("/users/3").expect(200); + expect(result.body).toEqual({ + id: 3, + name: "john doe", + email: "test@domain.com", + }); + }); + + it("should infer boolean in query params", async () => { + const app = zodiosContext().app(userApi); + app.get("/users", (req, res, next) => { + if (req.query.active) { + return res.status(200).json([ + { + id: 1, + name: "john doe active", + email: "test@domain.com", + }, + ]); + } + res.json([ + { + id: 1, + name: "john doe", + email: "test@domain.com", + }, + ]); + }); + const req = request(app); + const result1 = await req.get("/users?active=false"); + expect(result1.statusCode).toBe(200); + expect(result1.body).toEqual([ + { + id: 1, + name: "john doe", + email: "test@domain.com", + }, + ]); + const result2 = await req.get("/users?active=true"); + expect(result2.statusCode).toBe(200); + expect(result2.body).toEqual([ + { + id: 1, + name: "john doe active", + email: "test@domain.com", + }, + ]); + const result3 = await req.get("/users"); + expect(result3.statusCode).toBe(200); + expect(result3.body).toEqual([ + { + id: 1, + name: "john doe active", + email: "test@domain.com", + }, + ]); + }); + + it("should not find user if id>10", async () => { + const app = zodiosContext().app(userApi); + app.get("/users/:id", (req, res, next) => { + if (req.params.id >= 10) { + return res.status(404).json({ + error: { + code: "NOT_FOUND", + message: "User not found", + }, + }); + } + res.json({ + id: req.params.id, + name: "john doe", + email: "test@domain.com", + }); + }); + const req = request(app); + const result = await req.get("/users/10").expect(404); + expect(result.body).toEqual({ + error: { + code: "NOT_FOUND", + message: "User not found", + }, + }); + }); + + it("should get many users with context", async () => { + const ctx = zodiosContext( + z.object({ + user: z.object({ + id: z.number(), + name: z.string(), + email: z.string().email(), + }), + }) + ); + const app = ctx.app(); + const router = ctx.router(userApi); + router.use((req, res, next) => { + req.user = { + id: 1, + name: "john doe", + email: "john.doe@domain.com", + }; + next(); + }); + app.use(router); + router.get("/users", (req, res, next) => { + res.json([ + req.user, + { + id: 2, + name: "jane doe", + email: "jane.doe@domain.com", + }, + ]); + }); + const req = request(app); + const result = await req.get("/users").expect(200); + expect(result.body).toEqual([ + { + id: 1, + name: "john doe", + email: "john.doe@domain.com", + }, + { + id: 2, + name: "jane doe", + email: "jane.doe@domain.com", + }, + ]); + }); + + it("should return 400 error on bad path params", async () => { + const app = zodiosContext().app(userApi); + app.get("/users/:id", (req, res, next) => { + res.json({ + id: req.params.id, + name: "john doe", + email: "john.doe@domain.com", + }); + }); + const req = request(app); + const result = await req.get("/users/hello").expect(400); + expect(result.body).toEqual({ + context: "path.id", + error: [ + { + code: "invalid_type", + expected: "number", + message: "Expected number, received string", + path: [], + received: "string", + }, + ], + }); + }); + + it("should return 400 error on bad query params", async () => { + const app = zodiosContext().app(userApi); + app.get("/users", (req, res, next) => { + res.json([ + { + id: 1, + name: "john doe", + email: "john.doe@domain.com", + }, + { + id: 2, + name: "jane doe", + email: "jane.doe@domain.com", + }, + ]); + }); + const req = request(app); + const result = await req.get("/users?limit=0").expect(400); + expect(result.body.context).toEqual("query.limit"); + expect(result.body.error).toEqual([ + expect.objectContaining({ + code: "too_small", + inclusive: true, + message: "Number must be greater than or equal to 1", + minimum: 1, + path: [], + type: "number", + }), + ]); + }); + it("should create a user", async () => { + const app = zodiosContext().app(userApi); + app.post("/users", (req, res, next) => { + res.json({ + id: 1, + ...req.body, + }); + }); + const req = request(app); + const result = await req.post("/users").send({ + name: "john doe", + email: "john.doe@domain.com", + }); + expect(result.status).toBe(200); + expect(result.body).toEqual({ + id: 1, + name: "john doe", + email: "john.doe@domain.com", + }); + }); + + it("should return 400 error when sending an invalid user", async () => { + const app = zodiosContext().app(userApi); + app.post("/users", (req, res, next) => { + res.json({ + id: 1, + ...req.body, + }); + }); + const req = request(app); + const result = await req.post("/users").send({ + name: "john doe", + email: "john.doe", + }); + expect(result.status).toBe(400); + expect(result.body).toEqual({ + context: "body", + error: [ + { + validation: "email", + code: "invalid_string", + message: "Invalid email", + path: ["email"], + }, + ], + }); + }); + it("should succeed to put a user if authenticated", async () => { + const app = zodiosContext().app(userApi); + app.put("/users/:id", (req, res) => { + res.json(req.body); + }); + const req = request(app); + const result = await req + .put("/users/1") + .send({ + id: 1, + name: "john doe", + email: "john.doe@domain.com", + }) + .set("Authorization", "Bearer 12345"); + expect(result.status).toBe(200); + expect(result.body).toEqual({ + id: 1, + name: "john doe", + email: "john.doe@domain.com", + }); + }); + it("should fail to put a user if not authenticated", async () => { + const app = zodiosContext().app(userApi); + app.put("/users/:id", (req, res) => { + res.json(req.body); + }); + const req = request(app); + const result = await req.put("/users/1").send({ + id: 1, + name: "john doe", + email: "john.doe@domain.com", + }); + expect(result.status).toBe(400); + }); +}); diff --git a/packages/express/src/zodios.ts b/packages/express/src/zodios.ts new file mode 100644 index 00000000..02146ae7 --- /dev/null +++ b/packages/express/src/zodios.ts @@ -0,0 +1,109 @@ +import express, { RouterOptions } from "express"; +import { ZodObject } from "zod"; +import { ZodiosEndpointDefinitions } from "@zodios/core"; +import { Narrow } from "@zodios/core/lib/utils.types"; +import { + ZodiosApp, + ZodiosRouter, + ZodiosAppOptions, + ZodiosRouterOptions, +} from "./zodios.types"; +import { injectParametersValidators } from "./zodios-validator"; + +/** + * create a zodios app based on the given api and express + * @param api - api definition + * @param options - options to configure the app + * @returns + */ +export function zodiosApp< + Api extends ZodiosEndpointDefinitions = any, + Context extends ZodObject = ZodObject +>( + api?: Narrow, + options: ZodiosAppOptions = {} +): ZodiosApp { + const { + express: app = express(), + enableJsonBodyParser = true, + validate = true, + transform = false, + } = options; + if (enableJsonBodyParser) { + app.use(express.json()); + } + if (api && validate) { + injectParametersValidators(api, app, transform); + } + return app as unknown as ZodiosApp; +} + +/** + * create a zodios router based on the given api and express router + * @param api - api definition + * @param options - options to configure the router + * @returns + */ +export function zodiosRouter< + Api extends ZodiosEndpointDefinitions, + Context extends ZodObject = ZodObject +>( + api: Narrow, + options: RouterOptions & ZodiosRouterOptions = {} +): ZodiosRouter { + const { validate = true, transform = false, ...routerOptions } = options; + const router = options?.router ?? express.Router(routerOptions); + if (validate) { + injectParametersValidators(api, router, transform); + } + return router as unknown as ZodiosRouter; +} + +/** + * create a zodios app for nextjs + * @param options - options to configure the app + * @returns - a zodios app + */ +export function zodiosNextApp< + Api extends ZodiosEndpointDefinitions = any, + Context extends ZodObject = ZodObject +>( + api?: Narrow, + options: ZodiosAppOptions = {} +): ZodiosApp { + return zodiosApp(api, { + ...options, + enableJsonBodyParser: false, + }); +} + +export class ZodiosContext> { + constructor(public context?: Context) {} + + app( + api?: Narrow, + options: ZodiosAppOptions = {} + ): ZodiosApp { + return zodiosApp(api, options); + } + + nextApp( + api?: Narrow, + options: ZodiosAppOptions = {} + ): ZodiosApp { + return zodiosNextApp(api, options); + } + + router( + api: Narrow, + options?: RouterOptions & ZodiosRouterOptions + ): ZodiosRouter { + return zodiosRouter(api, options); + } +} + +export function zodiosContext = ZodObject>( + context?: Context +): ZodiosContext { + return new ZodiosContext(context); +} diff --git a/packages/express/src/zodios.types.ts b/packages/express/src/zodios.types.ts new file mode 100644 index 00000000..581feed1 --- /dev/null +++ b/packages/express/src/zodios.types.ts @@ -0,0 +1,169 @@ +import express from "express"; +import { + ZodiosEndpointDefinitions, + ZodiosEndpointDefinition, + ZodiosErrorByPath, + ZodiosResponseByPath, + ZodiosQueryParamsByPath, + ZodiosBodyByPath, + ZodiosPathsByMethod, + ZodiosPathParamsByPath, + Method, +} from "@zodios/core"; +import { IfEquals } from "@zodios/core/lib/utils.types"; +import { z, ZodAny, ZodObject } from "zod"; + +export type ZodiosSucessCodes = + | 200 + | 201 + | 202 + | 203 + | 204 + | 205 + | 206 + | 207 + | 208 + | 226; + +export type WithZodiosContext< + T, + Context extends ZodObject +> = Context extends ZodAny ? T : T & z.infer; + +export interface ZodiosRequestHandler< + Api extends ZodiosEndpointDefinitions, + Context extends ZodObject, + M extends Method, + Path extends ZodiosPathsByMethod, + ReqPath = ZodiosPathParamsByPath, + ReqBody = ZodiosBodyByPath, + ReqQuery = ZodiosQueryParamsByPath, + Res = ZodiosResponseByPath +> { + ( + req: WithZodiosContext< + express.Request, + Context + >, + res: Omit, "status"> & { + // rebind context to allow for type inference + status< + StatusCode extends number, + API extends ZodiosEndpointDefinition[] = Api, + METHOD extends Method = M, + PATH extends ZodiosPathsByMethod = Path + >( + status: StatusCode + ): StatusCode extends ZodiosSucessCodes + ? express.Response + : express.Response< + ZodiosErrorByPath + >; + }, + next: express.NextFunction + ): void; +} + +export interface ZodiosRouterContextRequestHandler< + Context extends ZodObject +> { + ( + req: WithZodiosContext, + res: express.Response, + next: express.NextFunction + ): void; +} + +export type ZodiosHandler< + Router, + Context extends ZodObject, + Api extends ZodiosEndpointDefinitions, + M extends Method +> = >( + path: Path, + ...handlers: Array> +) => Router; + +export interface ZodiosUse> { + use(...handlers: Array>): this; + use(handlers: Array>): this; + use( + path: string, + ...handlers: Array> + ): this; + use( + path: string, + handlers: Array> + ): this; +} + +export interface ZodiosHandlers< + Api extends ZodiosEndpointDefinitions, + Context extends ZodObject +> extends ZodiosUse { + get: ZodiosHandler; + post: ZodiosHandler; + put: ZodiosHandler; + patch: ZodiosHandler; + delete: ZodiosHandler; + options: ZodiosHandler; + head: ZodiosHandler; +} + +export interface ZodiosValidationOptions { + /** + * validate request parameters - default is true + */ + validate?: boolean; + /** + * transform request parameters - default is false + */ + transform?: boolean; +} + +export interface ZodiosAppOptions> + extends ZodiosValidationOptions { + /** + * express app intance - default is express() + */ + express?: ReturnType; + /** + * enable express json body parser - default is true + */ + enableJsonBodyParser?: boolean; + context?: Context; +} + +export interface ZodiosRouterOptions> + extends ZodiosValidationOptions { + /** + * express router instance - default is express.Router + */ + router?: ReturnType; + context?: Context; +} + +export type ZodiosApp< + Api extends ZodiosEndpointDefinitions, + Context extends ZodObject +> = IfEquals< + Api, + any, + Omit, "use"> & ZodiosUse, + Omit, Method | "use"> & + ZodiosHandlers +>; + +export type ZodiosRouter< + Api extends ZodiosEndpointDefinitions, + Context extends ZodObject +> = IfEquals< + Api, + any, + Omit, "use"> & + ZodiosUse & + ZodiosRouterContextRequestHandler, + Omit, Method | "use"> & + ZodiosHandlers & + ZodiosRouterContextRequestHandler +>; diff --git a/packages/express/src/zodios.utils.spec.ts b/packages/express/src/zodios.utils.spec.ts new file mode 100644 index 00000000..0872f345 --- /dev/null +++ b/packages/express/src/zodios.utils.spec.ts @@ -0,0 +1,54 @@ +import { makeApi } from "@zodios/core"; +import { z } from "zod"; +import { prefixApi } from "./zodios.utils"; +import { Assert } from "@zodios/core/lib/utils.types"; + +const response = z.object({ + id: z.number(), + name: z.string(), +}); + +const api = makeApi([ + { + method: "get", + path: "/", + response, + }, + { + method: "get", + path: "/foo", + response, + }, +]); + +describe("zodios utils", () => { + it("should prefix api", () => { + type Expected = [ + { + method: "get"; + path: "/api/"; + response: typeof response; + }, + { + method: "get"; + path: "/api/foo"; + response: typeof response; + } + ]; + const prefix = "/api"; + const prefixedApi = prefixApi(prefix, api); + const testApi: Assert = true; + expect(prefixedApi).toEqual([ + { + method: "get", + path: "/api/", + response, + }, + { + method: "get", + path: "/api/foo", + response, + }, + ]); + }); +}); diff --git a/packages/express/src/zodios.utils.ts b/packages/express/src/zodios.utils.ts new file mode 100644 index 00000000..4ce4d395 --- /dev/null +++ b/packages/express/src/zodios.utils.ts @@ -0,0 +1,58 @@ +import { z } from "zod"; + +type MapPrefixPath< + T extends readonly unknown[], + PrefixValue extends string, + ACC extends unknown[] = [] +> = T extends readonly [infer Head, ...infer Tail] + ? MapPrefixPath< + Tail, + PrefixValue, + [ + ...ACC, + { + [K in keyof Head]: K extends "path" + ? Head[K] extends string + ? `${PrefixValue}${Head[K]}` + : Head[K] + : Head[K]; + } + ] + > + : ACC; + +export function prefixApi( + prefix: Prefix, + api: Api +) { + return api.map((endpoint) => ({ + ...endpoint, + path: `${prefix}${endpoint.path}`, + })) as MapPrefixPath; +} + +export function isZodType( + t: z.ZodTypeAny, + type: z.ZodFirstPartyTypeKind +): boolean { + if (t._def?.typeName === type) { + return true; + } + if ( + t._def?.typeName === z.ZodFirstPartyTypeKind.ZodEffects && + (t as z.ZodEffects)._def.effect.type === "refinement" + ) { + return isZodType((t as z.ZodEffects).innerType(), type); + } + if (t._def?.innerType) { + return isZodType(t._def?.innerType, type); + } + return false; +} + +export function withoutTransform(t: z.ZodTypeAny): z.ZodTypeAny { + if (t._def?.typeName === z.ZodFirstPartyTypeKind.ZodEffects) { + return withoutTransform((t as z.ZodEffects).innerType()); + } + return t; +} diff --git a/packages/express/tsconfig.build.json b/packages/express/tsconfig.build.json new file mode 100644 index 00000000..e8b555b9 --- /dev/null +++ b/packages/express/tsconfig.build.json @@ -0,0 +1,16 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "target": "ES6", + "sourceMap": false + }, + "exclude": [ + "node_modules", + "lib", + "examples", + "**/*.config.ts", + "**/*.spec.ts", + "**/*.test.ts", + "**/*.d.ts" + ] +} diff --git a/packages/express/tsconfig.json b/packages/express/tsconfig.json new file mode 100644 index 00000000..5d35941d --- /dev/null +++ b/packages/express/tsconfig.json @@ -0,0 +1,16 @@ +{ + // ts config for es 2021 + "compilerOptions": { + "target": "ES2019", + "module": "CommonJS", + "moduleResolution": "Node", + "lib": ["ES2019"], + "outDir": "./lib", + "alwaysStrict": true, + "strict": true, + "esModuleInterop": true, + "sourceMap": true, + "declaration": true + }, + "exclude": ["node_modules", "lib", "../../examples"] +} diff --git a/packages/express/tsup.config.js b/packages/express/tsup.config.js new file mode 100644 index 00000000..899d5e3f --- /dev/null +++ b/packages/express/tsup.config.js @@ -0,0 +1,14 @@ +import { defineConfig } from "tsup"; + +export default defineConfig({ + clean: true, + dts: true, + entry: ["src/index.ts"], + outDir: "lib", + format: ["cjs", "esm"], + minify: true, + treeshake: true, + tsconfig: "tsconfig.build.json", + splitting: true, + sourcemap: false, +}); diff --git a/packages/fetch/package.json b/packages/fetch/package.json index a5dcc6a4..a5e46f32 100644 --- a/packages/fetch/package.json +++ b/packages/fetch/package.json @@ -35,8 +35,6 @@ ], "scripts": { "prebuild": "rimraf lib", - "example": "ts-node examples/jsonplaceholder.ts", - "example:dev.to": "ts-node examples/dev.to/example.ts", "build": "tsup", "test": "NODE_OPTIONS=--experimental-abortcontroller jest --coverage" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1f198720..f551290b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -86,6 +86,42 @@ importers: typescript: 4.9.4 zod: 3.20.1 + packages/express: + specifiers: + '@jest/globals': 29.3.1 + '@jest/types': 29.3.1 + '@types/express': 4.17.16 + '@types/jest': 29.4.0 + '@types/node': 18.11.18 + '@types/supertest': 2.0.12 + '@zodios/core': workspace:* + express: 4.18.2 + jest: 29.4.1 + rimraf: 4.1.2 + supertest: 6.3.3 + ts-jest: 29.0.5 + ts-node: 10.9.1 + tsup: 6.3.0 + typescript: 4.9.4 + zod: 3.20.2 + devDependencies: + '@jest/globals': 29.3.1 + '@jest/types': 29.3.1 + '@types/express': 4.17.16 + '@types/jest': 29.4.0 + '@types/node': 18.11.18 + '@types/supertest': 2.0.12 + '@zodios/core': link:../core + express: 4.18.2 + jest: 29.4.1_zfha7dvnw4nti6zkbsmhmn6xo4 + rimraf: 4.1.2 + supertest: 6.3.3 + ts-jest: 29.0.5_2nqegl6ju5oy2sctmmmle4ucam + ts-node: 10.9.1_awa2wsr5thmg3i7jqycphctjfq + tsup: 6.3.0_z6wznmtyb6ovnulj6iujpct7um + typescript: 4.9.4 + zod: 3.20.2 + packages/fetch: specifiers: '@jest/globals': 29.3.1 @@ -812,11 +848,23 @@ packages: resolution: {integrity: sha512-IRE6GD47KwcqA09RIWrabKdHPiKDGgtAL31xDxbi/RjQMsr+lY+ppxmHwY0dUEV3qvvxZzoe5Hl0RXZJOjQNUg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.3.1 - '@types/node': 18.11.9 + '@jest/types': 29.4.1 + '@types/node': 18.11.18 chalk: 4.1.2 jest-message-util: 29.3.1 - jest-util: 29.3.1 + jest-util: 29.4.1 + slash: 3.0.0 + dev: true + + /@jest/console/29.4.1: + resolution: {integrity: sha512-m+XpwKSi3PPM9znm5NGS8bBReeAJJpSkL1OuFCqaMaJL2YX9YXLkkI+MBchMPwu+ZuM2rynL51sgfkQteQ1CKQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/types': 29.4.1 + '@types/node': 18.11.18 + chalk: 4.1.2 + jest-message-util: 29.4.1 + jest-util: 29.4.1 slash: 3.0.0 dev: true @@ -833,15 +881,15 @@ packages: '@jest/reporters': 29.3.1 '@jest/test-result': 29.3.1 '@jest/transform': 29.3.1 - '@jest/types': 29.3.1 - '@types/node': 18.11.9 + '@jest/types': 29.4.1 + '@types/node': 18.11.18 ansi-escapes: 4.3.2 chalk: 4.1.2 ci-info: 3.5.0 exit: 0.1.2 graceful-fs: 4.2.10 jest-changed-files: 29.2.0 - jest-config: 29.3.1_odkjkoia5xunhxkdrka32ib6vi + jest-config: 29.3.1_zfha7dvnw4nti6zkbsmhmn6xo4 jest-haste-map: 29.3.1 jest-message-util: 29.3.1 jest-regex-util: 29.2.0 @@ -862,14 +910,66 @@ packages: - ts-node dev: true + /@jest/core/29.4.1_ts-node@10.9.1: + resolution: {integrity: sha512-RXFTohpBqpaTebNdg5l3I5yadnKo9zLBajMT0I38D0tDhreVBYv3fA8kywthI00sWxPztWLD3yjiUkewwu/wKA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + dependencies: + '@jest/console': 29.4.1 + '@jest/reporters': 29.4.1 + '@jest/test-result': 29.4.1 + '@jest/transform': 29.4.1 + '@jest/types': 29.4.1 + '@types/node': 18.11.18 + ansi-escapes: 4.3.2 + chalk: 4.1.2 + ci-info: 3.5.0 + exit: 0.1.2 + graceful-fs: 4.2.10 + jest-changed-files: 29.4.0 + jest-config: 29.4.1_zfha7dvnw4nti6zkbsmhmn6xo4 + jest-haste-map: 29.4.1 + jest-message-util: 29.4.1 + jest-regex-util: 29.2.0 + jest-resolve: 29.4.1 + jest-resolve-dependencies: 29.4.1 + jest-runner: 29.4.1 + jest-runtime: 29.4.1 + jest-snapshot: 29.4.1 + jest-util: 29.4.1 + jest-validate: 29.4.1 + jest-watcher: 29.4.1 + micromatch: 4.0.5 + pretty-format: 29.4.1 + slash: 3.0.0 + strip-ansi: 6.0.1 + transitivePeerDependencies: + - supports-color + - ts-node + dev: true + /@jest/environment/29.3.1: resolution: {integrity: sha512-pMmvfOPmoa1c1QpfFW0nXYtNLpofqo4BrCIk6f2kW4JFeNlHV2t3vd+3iDLf31e2ot2Mec0uqZfmI+U0K2CFag==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/fake-timers': 29.3.1 - '@jest/types': 29.3.1 - '@types/node': 18.11.9 - jest-mock: 29.3.1 + '@jest/types': 29.4.1 + '@types/node': 18.11.18 + jest-mock: 29.4.1 + dev: true + + /@jest/environment/29.4.1: + resolution: {integrity: sha512-pJ14dHGSQke7Q3mkL/UZR9ZtTOxqskZaC91NzamEH4dlKRt42W+maRBXiw/LWkdJe+P0f/zDR37+SPMplMRlPg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/fake-timers': 29.4.1 + '@jest/types': 29.4.1 + '@types/node': 18.11.18 + jest-mock: 29.4.1 dev: true /@jest/expect-utils/29.3.1: @@ -879,12 +979,19 @@ packages: jest-get-type: 29.2.0 dev: true - /@jest/expect/29.3.1: - resolution: {integrity: sha512-QivM7GlSHSsIAWzgfyP8dgeExPRZ9BIe2LsdPyEhCGkZkoyA+kGsoIzbKAfZCvvRzfZioKwPtCZIt5SaoxYCvg==} + /@jest/expect-utils/29.4.1: + resolution: {integrity: sha512-w6YJMn5DlzmxjO00i9wu2YSozUYRBhIoJ6nQwpMYcBMtiqMGJm1QBzOf6DDgRao8dbtpDoaqLg6iiQTvv0UHhQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - expect: 29.3.1 - jest-snapshot: 29.3.1 + jest-get-type: 29.2.0 + dev: true + + /@jest/expect/29.4.1: + resolution: {integrity: sha512-ZxKJP5DTUNF2XkpJeZIzvnzF1KkfrhEF6Rz0HGG69fHl6Bgx5/GoU3XyaeFYEjuuKSOOsbqD/k72wFvFxc3iTw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + expect: 29.4.1 + jest-snapshot: 29.4.1 transitivePeerDependencies: - supports-color dev: true @@ -893,22 +1000,46 @@ packages: resolution: {integrity: sha512-iHTL/XpnDlFki9Tq0Q1GGuVeQ8BHZGIYsvCO5eN/O/oJaRzofG9Xndd9HuSDBI/0ZS79pg0iwn07OMTQ7ngF2A==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.3.1 + '@jest/types': 29.4.1 '@sinonjs/fake-timers': 9.1.2 - '@types/node': 18.11.9 + '@types/node': 18.11.18 jest-message-util: 29.3.1 - jest-mock: 29.3.1 - jest-util: 29.3.1 + jest-mock: 29.4.1 + jest-util: 29.4.1 + dev: true + + /@jest/fake-timers/29.4.1: + resolution: {integrity: sha512-/1joI6rfHFmmm39JxNfmNAO3Nwm6Y0VoL5fJDy7H1AtWrD1CgRtqJbN9Ld6rhAkGO76qqp4cwhhxJ9o9kYjQMw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/types': 29.4.1 + '@sinonjs/fake-timers': 10.0.2 + '@types/node': 18.11.18 + jest-message-util: 29.4.1 + jest-mock: 29.4.1 + jest-util: 29.4.1 dev: true /@jest/globals/29.3.1: resolution: {integrity: sha512-cTicd134vOcwO59OPaB6AmdHQMCtWOe+/DitpTZVxWgMJ+YvXL1HNAmPyiGbSHmF/mXVBkvlm8YYtQhyHPnV6Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/environment': 29.3.1 - '@jest/expect': 29.3.1 - '@jest/types': 29.3.1 - jest-mock: 29.3.1 + '@jest/environment': 29.4.1 + '@jest/expect': 29.4.1 + '@jest/types': 29.4.1 + jest-mock: 29.4.1 + transitivePeerDependencies: + - supports-color + dev: true + + /@jest/globals/29.4.1: + resolution: {integrity: sha512-znoK2EuFytbHH0ZSf2mQK2K1xtIgmaw4Da21R2C/NE/+NnItm5mPEFQmn8gmF3f0rfOlmZ3Y3bIf7bFj7DHxAA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/environment': 29.4.1 + '@jest/expect': 29.4.1 + '@jest/types': 29.4.1 + jest-mock: 29.4.1 transitivePeerDependencies: - supports-color dev: true @@ -924,11 +1055,11 @@ packages: dependencies: '@bcoe/v8-coverage': 0.2.3 '@jest/console': 29.3.1 - '@jest/test-result': 29.3.1 + '@jest/test-result': 29.4.1 '@jest/transform': 29.3.1 - '@jest/types': 29.3.1 + '@jest/types': 29.4.1 '@jridgewell/trace-mapping': 0.3.17 - '@types/node': 18.11.9 + '@types/node': 18.11.18 chalk: 4.1.2 collect-v8-coverage: 1.0.1 exit: 0.1.2 @@ -940,7 +1071,7 @@ packages: istanbul-lib-source-maps: 4.0.1 istanbul-reports: 3.1.5 jest-message-util: 29.3.1 - jest-util: 29.3.1 + jest-util: 29.4.1 jest-worker: 29.3.1 slash: 3.0.0 string-length: 4.0.2 @@ -950,6 +1081,43 @@ packages: - supports-color dev: true + /@jest/reporters/29.4.1: + resolution: {integrity: sha512-AISY5xpt2Xpxj9R6y0RF1+O6GRy9JsGa8+vK23Lmzdy1AYcpQn5ItX79wJSsTmfzPKSAcsY1LNt/8Y5Xe5LOSg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + dependencies: + '@bcoe/v8-coverage': 0.2.3 + '@jest/console': 29.4.1 + '@jest/test-result': 29.4.1 + '@jest/transform': 29.4.1 + '@jest/types': 29.4.1 + '@jridgewell/trace-mapping': 0.3.17 + '@types/node': 18.11.18 + chalk: 4.1.2 + collect-v8-coverage: 1.0.1 + exit: 0.1.2 + glob: 7.2.3 + graceful-fs: 4.2.10 + istanbul-lib-coverage: 3.2.0 + istanbul-lib-instrument: 5.2.1 + istanbul-lib-report: 3.0.0 + istanbul-lib-source-maps: 4.0.1 + istanbul-reports: 3.1.5 + jest-message-util: 29.4.1 + jest-util: 29.4.1 + jest-worker: 29.4.1 + slash: 3.0.0 + string-length: 4.0.2 + strip-ansi: 6.0.1 + v8-to-istanbul: 9.0.1 + transitivePeerDependencies: + - supports-color + dev: true + /@jest/schemas/29.0.0: resolution: {integrity: sha512-3Ab5HgYIIAnS0HjqJHQYZS+zXc4tUmTmBH3z83ajI6afXp8X3ZtdLX+nXx+I7LNkJD7uN9LAVhgnjDgZa2z0kA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -957,6 +1125,13 @@ packages: '@sinclair/typebox': 0.24.51 dev: true + /@jest/schemas/29.4.0: + resolution: {integrity: sha512-0E01f/gOZeNTG76i5eWWSupvSHaIINrTie7vCyjiYFKgzNdyEGd12BUv4oNBFHOqlHDbtoJi3HrQ38KCC90NsQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@sinclair/typebox': 0.25.21 + dev: true + /@jest/source-map/29.2.0: resolution: {integrity: sha512-1NX9/7zzI0nqa6+kgpSdKPK+WU1p+SJk3TloWZf5MzPbxri9UEeXX5bWZAPCzbQcyuAzubcdUHA7hcNznmRqWQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -971,7 +1146,17 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/console': 29.3.1 - '@jest/types': 29.3.1 + '@jest/types': 29.4.1 + '@types/istanbul-lib-coverage': 2.0.4 + collect-v8-coverage: 1.0.1 + dev: true + + /@jest/test-result/29.4.1: + resolution: {integrity: sha512-WRt29Lwt+hEgfN8QDrXqXGgCTidq1rLyFqmZ4lmJOpVArC8daXrZWkWjiaijQvgd3aOUj2fM8INclKHsQW9YyQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/console': 29.4.1 + '@jest/types': 29.4.1 '@types/istanbul-lib-coverage': 2.0.4 collect-v8-coverage: 1.0.1 dev: true @@ -980,9 +1165,19 @@ packages: resolution: {integrity: sha512-IqYvLbieTv20ArgKoAMyhLHNrVHJfzO6ARZAbQRlY4UGWfdDnLlZEF0BvKOMd77uIiIjSZRwq3Jb3Fa3I8+2UA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/test-result': 29.3.1 + '@jest/test-result': 29.4.1 graceful-fs: 4.2.10 - jest-haste-map: 29.3.1 + jest-haste-map: 29.4.1 + slash: 3.0.0 + dev: true + + /@jest/test-sequencer/29.4.1: + resolution: {integrity: sha512-v5qLBNSsM0eHzWLXsQ5fiB65xi49A3ILPSFQKPXzGL4Vyux0DPZAIN7NAFJa9b4BiTDP9MBF/Zqc/QA1vuiJ0w==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/test-result': 29.4.1 + graceful-fs: 4.2.10 + jest-haste-map: 29.4.1 slash: 3.0.0 dev: true @@ -991,7 +1186,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@babel/core': 7.20.2 - '@jest/types': 29.3.1 + '@jest/types': 29.4.1 '@jridgewell/trace-mapping': 0.3.17 babel-plugin-istanbul: 6.1.1 chalk: 4.1.2 @@ -1000,7 +1195,7 @@ packages: graceful-fs: 4.2.10 jest-haste-map: 29.3.1 jest-regex-util: 29.2.0 - jest-util: 29.3.1 + jest-util: 29.4.1 micromatch: 4.0.5 pirates: 4.0.5 slash: 3.0.0 @@ -1009,14 +1204,49 @@ packages: - supports-color dev: true + /@jest/transform/29.4.1: + resolution: {integrity: sha512-5w6YJrVAtiAgr0phzKjYd83UPbCXsBRTeYI4BXokv9Er9CcrH9hfXL/crCvP2d2nGOcovPUnlYiLPFLZrkG5Hg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@babel/core': 7.20.2 + '@jest/types': 29.4.1 + '@jridgewell/trace-mapping': 0.3.17 + babel-plugin-istanbul: 6.1.1 + chalk: 4.1.2 + convert-source-map: 2.0.0 + fast-json-stable-stringify: 2.1.0 + graceful-fs: 4.2.10 + jest-haste-map: 29.4.1 + jest-regex-util: 29.2.0 + jest-util: 29.4.1 + micromatch: 4.0.5 + pirates: 4.0.5 + slash: 3.0.0 + write-file-atomic: 5.0.0 + transitivePeerDependencies: + - supports-color + dev: true + /@jest/types/29.3.1: resolution: {integrity: sha512-d0S0jmmTpjnhCmNpApgX3jrUZgZ22ivKJRvL2lli5hpCRoNnp1f85r2/wpKfXuYu8E7Jjh1hGfhPyup1NM5AmA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/schemas': 29.0.0 + '@jest/schemas': 29.4.0 '@types/istanbul-lib-coverage': 2.0.4 '@types/istanbul-reports': 3.0.1 - '@types/node': 18.11.9 + '@types/node': 18.11.18 + '@types/yargs': 17.0.13 + chalk: 4.1.2 + dev: true + + /@jest/types/29.4.1: + resolution: {integrity: sha512-zbrAXDUOnpJ+FMST2rV7QZOgec8rskg2zv8g2ajeqitp4tvZiyqTCYXANrKsM+ryj5o+LI+ZN2EgU9drrkiwSA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/schemas': 29.4.0 + '@types/istanbul-lib-coverage': 2.0.4 + '@types/istanbul-reports': 3.0.1 + '@types/node': 18.11.18 '@types/yargs': 17.0.13 chalk: 4.1.2 dev: true @@ -1111,12 +1341,28 @@ packages: resolution: {integrity: sha512-1P1OROm/rdubP5aFDSZQILU0vrLCJ4fvHt6EoqHEM+2D/G5MK3bIaymUKLit8Js9gbns5UyJnkP/TZROLw4tUA==} dev: true + /@sinclair/typebox/0.25.21: + resolution: {integrity: sha512-gFukHN4t8K4+wVC+ECqeqwzBDeFeTzBXroBTqE6vcWrQGbEUpHO7LYdG0f4xnvYq4VOEwITSlHlp0JBAIFMS/g==} + dev: true + /@sinonjs/commons/1.8.5: resolution: {integrity: sha512-rTpCA0wG1wUxglBSFdMMY0oTrKYvgf4fNgv/sXbfCVAdf+FnPBdKJR/7XbpTCwbCrvCbdPYnlWaUUYz4V2fPDA==} dependencies: type-detect: 4.0.8 dev: true + /@sinonjs/commons/2.0.0: + resolution: {integrity: sha512-uLa0j859mMrg2slwQYdO/AkrOfmH+X6LTVmNTS9CqexuE2IvVORIkSpJLqePAbEnKJ77aMmCwr1NUZ57120Xcg==} + dependencies: + type-detect: 4.0.8 + dev: true + + /@sinonjs/fake-timers/10.0.2: + resolution: {integrity: sha512-SwUDyjWnah1AaNl7kxsa7cfLhlTYoiyhDAIgyh+El30YvXs/o7OLXpYH88Zdhyx9JExKrmHDJ+10bwIcY80Jmw==} + dependencies: + '@sinonjs/commons': 2.0.0 + dev: true + /@sinonjs/fake-timers/9.1.2: resolution: {integrity: sha512-BPS4ynJW/o92PUR4wgriz2Ud5gpST5vz6GQfMixEDK0Z8ZCUv2M7SkBLykH56T++Xs+8ln9zTGbOvNGIe02/jw==} dependencies: @@ -1279,13 +1525,17 @@ packages: resolution: {integrity: sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==} dependencies: '@types/connect': 3.4.35 - '@types/node': 18.11.9 + '@types/node': 18.11.18 dev: true /@types/connect/3.4.35: resolution: {integrity: sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==} dependencies: - '@types/node': 18.11.9 + '@types/node': 18.11.18 + dev: true + + /@types/cookiejar/2.1.2: + resolution: {integrity: sha512-t73xJJrvdTjXrn4jLS9VSGRbz0nUY3cl2DMGDU48lKl+HR9dbbjW2A9r3g40VA++mQpy6uuHg33gy7du2BKpog==} dev: true /@types/cors/2.8.12: @@ -1295,7 +1545,7 @@ packages: /@types/express-serve-static-core/4.17.31: resolution: {integrity: sha512-DxMhY+NAsTwMMFHBTtJFNp5qiHKJ7TeqOo23zVEM9alT1Ml27Q3xcTH0xwxn7Q0BbMcVEJOs/7aQtUWupUQN3Q==} dependencies: - '@types/node': 18.11.9 + '@types/node': 18.11.18 '@types/qs': 6.9.7 '@types/range-parser': 1.2.4 dev: true @@ -1312,7 +1562,7 @@ packages: /@types/graceful-fs/4.1.5: resolution: {integrity: sha512-anKkLmZZ+xm4p8JWBf4hElkM4XR+EZeA2M9BAkkTldmcyDY4mbdIJnRghDJH3Ov5ooY7/UAoENtmdMSkaAd7Cw==} dependencies: - '@types/node': 18.11.9 + '@types/node': 18.11.18 dev: true /@types/is-ci/3.0.0: @@ -1351,10 +1601,17 @@ packages: pretty-format: 29.3.1 dev: true + /@types/jest/29.4.0: + resolution: {integrity: sha512-VaywcGQ9tPorCX/Jkkni7RWGFfI11whqzs8dvxF41P17Z+z872thvEvlIbznjPJ02kl1HMX3LmLOonsj2n7HeQ==} + dependencies: + expect: 29.3.1 + pretty-format: 29.3.1 + dev: true + /@types/jsdom/20.0.1: resolution: {integrity: sha512-d0r18sZPmMQr1eG35u12FZfhIXNrnsPU/g5wvRKCUf/tOGilKKwYMYGqh33BNR6ba+2gkHw1EUiHoN3mn7E5IQ==} dependencies: - '@types/node': 18.11.9 + '@types/node': 18.11.18 '@types/tough-cookie': 4.0.2 parse5: 7.1.2 dev: true @@ -1377,6 +1634,10 @@ packages: resolution: {integrity: sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==} dev: true + /@types/node/18.11.18: + resolution: {integrity: sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA==} + dev: true + /@types/node/18.11.9: resolution: {integrity: sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==} dev: true @@ -1427,17 +1688,30 @@ packages: resolution: {integrity: sha512-z5xyF6uh8CbjAu9760KDKsH2FcDxZ2tFCsA4HIMWE6IkiYMXfVoa+4f9KX+FN0ZLsaMw1WNG2ETLA6N+/YA+cg==} dependencies: '@types/mime': 3.0.1 - '@types/node': 18.11.9 + '@types/node': 18.11.18 dev: true /@types/stack-utils/2.0.1: resolution: {integrity: sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==} dev: true + /@types/superagent/4.1.16: + resolution: {integrity: sha512-tLfnlJf6A5mB6ddqF159GqcDizfzbMUB1/DeT59/wBNqzRTNNKsaw79A/1TZ84X+f/EwWH8FeuSkjlCLyqS/zQ==} + dependencies: + '@types/cookiejar': 2.1.2 + '@types/node': 18.11.18 + dev: true + + /@types/supertest/2.0.12: + resolution: {integrity: sha512-X3HPWTwXRerBZS7Mo1k6vMVR1Z6zmJcDVn5O/31whe0tnjE4te6ZJSJGq1RiqHPjzPdMTfjCFogDJmwng9xHaQ==} + dependencies: + '@types/superagent': 4.1.16 + dev: true + /@types/testing-library__jest-dom/5.14.5: resolution: {integrity: sha512-SBwbxYoyPIvxHbeHxTZX2Pe/74F/tX2/D3mMvzabdeJ25bBojfW0TyB8BHrbq/9zaaKICJZjLP+8r6AeZMFCuQ==} dependencies: - '@types/jest': 29.2.3 + '@types/jest': 29.4.0 dev: true /@types/tough-cookie/4.0.2: @@ -1585,6 +1859,10 @@ packages: engines: {node: '>=0.10.0'} dev: true + /asap/2.0.6: + resolution: {integrity: sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==} + dev: true + /asynckit/0.4.0: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} dev: true @@ -1611,7 +1889,7 @@ packages: '@babel/core': ^7.8.0 dependencies: '@babel/core': 7.20.2 - '@jest/transform': 29.3.1 + '@jest/transform': 29.4.1 '@types/babel__core': 7.1.20 babel-plugin-istanbul: 6.1.1 babel-preset-jest: 29.2.0_@babel+core@7.20.2 @@ -1622,6 +1900,24 @@ packages: - supports-color dev: true + /babel-jest/29.4.1_@babel+core@7.20.2: + resolution: {integrity: sha512-xBZa/pLSsF/1sNpkgsiT3CmY7zV1kAsZ9OxxtrFqYucnOuRftXAfcJqcDVyOPeN4lttWTwhLdu0T9f8uvoPEUg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + '@babel/core': ^7.8.0 + dependencies: + '@babel/core': 7.20.2 + '@jest/transform': 29.4.1 + '@types/babel__core': 7.1.20 + babel-plugin-istanbul: 6.1.1 + babel-preset-jest: 29.4.0_@babel+core@7.20.2 + chalk: 4.1.2 + graceful-fs: 4.2.10 + slash: 3.0.0 + transitivePeerDependencies: + - supports-color + dev: true + /babel-plugin-istanbul/6.1.1: resolution: {integrity: sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==} engines: {node: '>=8'} @@ -1645,6 +1941,16 @@ packages: '@types/babel__traverse': 7.18.2 dev: true + /babel-plugin-jest-hoist/29.4.0: + resolution: {integrity: sha512-a/sZRLQJEmsmejQ2rPEUe35nO1+C9dc9O1gplH1SXmJxveQSRUYdBk8yGZG/VOUuZs1u2aHZJusEGoRMbhhwCg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@babel/template': 7.18.10 + '@babel/types': 7.20.2 + '@types/babel__core': 7.1.20 + '@types/babel__traverse': 7.18.2 + dev: true + /babel-preset-current-node-syntax/1.0.1_@babel+core@7.20.2: resolution: {integrity: sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==} peerDependencies: @@ -1676,6 +1982,17 @@ packages: babel-preset-current-node-syntax: 1.0.1_@babel+core@7.20.2 dev: true + /babel-preset-jest/29.4.0_@babel+core@7.20.2: + resolution: {integrity: sha512-fUB9vZflUSM3dO/6M2TCAepTzvA4VkOvl67PjErcrQMGt9Eve7uazaeyCZ2th3UtI7ljpiBJES0F7A1vBRsLZA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + '@babel/core': ^7.0.0 + dependencies: + '@babel/core': 7.20.2 + babel-plugin-jest-hoist: 29.4.0 + babel-preset-current-node-syntax: 1.0.1_@babel+core@7.20.2 + dev: true + /balanced-match/1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} dev: true @@ -1943,6 +2260,10 @@ packages: engines: {node: '>= 6'} dev: true + /component-emitter/1.3.0: + resolution: {integrity: sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==} + dev: true + /concat-map/0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} dev: true @@ -1986,6 +2307,10 @@ packages: engines: {node: '>= 0.6'} dev: true + /cookiejar/2.1.4: + resolution: {integrity: sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw==} + dev: true + /core-util-is/1.0.3: resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} dev: true @@ -2193,6 +2518,13 @@ packages: engines: {node: '>=8'} dev: true + /dezalgo/1.0.4: + resolution: {integrity: sha512-rXSP0bf+5n0Qonsb+SVVfNfIsimO4HEtmnIpPHY8Q1UCzKlQrDMfdobr8nJOOsRgWCyMRqeSBQzmWUMq7zvVig==} + dependencies: + asap: 2.0.6 + wrappy: 1.0.2 + dev: true + /diff-sequences/29.3.1: resolution: {integrity: sha512-hlM3QR272NXCi4pq+N4Kok4kOp6EsgOM3ZSpJI7Da3UAs+Ttsi8MRmB6trM/lhyzUxGfOgnpkHtgqm5Q/CTcfQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -2613,6 +2945,17 @@ packages: jest-util: 29.3.1 dev: true + /expect/29.4.1: + resolution: {integrity: sha512-OKrGESHOaMxK3b6zxIq9SOW8kEXztKff/Dvg88j4xIJxur1hspEbedVkR3GpHe5LO+WB2Qw7OWN0RMTdp6as5A==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/expect-utils': 29.4.1 + jest-get-type: 29.2.0 + jest-matcher-utils: 29.4.1 + jest-message-util: 29.4.1 + jest-util: 29.4.1 + dev: true + /express/4.18.2: resolution: {integrity: sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==} engines: {node: '>= 0.10.0'} @@ -2684,6 +3027,10 @@ packages: resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} dev: true + /fast-safe-stringify/2.1.1: + resolution: {integrity: sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==} + dev: true + /fastq/1.13.0: resolution: {integrity: sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==} dependencies: @@ -2766,6 +3113,15 @@ packages: mime-types: 2.1.35 dev: true + /formidable/2.1.2: + resolution: {integrity: sha512-CM3GuJ57US06mlpQ47YcunuUZ9jpm8Vx+P2CGt2j7HpgkKZO/DJYQ0Bobim8G6PFQmK5lOqOOdUXboU+h73A4g==} + dependencies: + dezalgo: 1.0.4 + hexoid: 1.0.0 + once: 1.4.0 + qs: 6.11.0 + dev: true + /forwarded/0.2.0: resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==} engines: {node: '>= 0.6'} @@ -2968,6 +3324,11 @@ packages: function-bind: 1.1.1 dev: true + /hexoid/1.0.0: + resolution: {integrity: sha512-QFLV0taWQOZtvIRIAdBChesmogZrtuXvVWsFHZTk2SU+anspqZ2vMnoLg7IE1+Uk16N19APic1BuF8bC8c2m5g==} + engines: {node: '>=8'} + dev: true + /hosted-git-info/2.8.9: resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} dev: true @@ -3348,27 +3709,62 @@ packages: p-limit: 3.1.0 dev: true + /jest-changed-files/29.4.0: + resolution: {integrity: sha512-rnI1oPxgFghoz32Y8eZsGJMjW54UlqT17ycQeCEktcxxwqqKdlj9afl8LNeO0Pbu+h2JQHThQP0BzS67eTRx4w==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + execa: 5.1.1 + p-limit: 3.1.0 + dev: true + /jest-circus/29.3.1: resolution: {integrity: sha512-wpr26sEvwb3qQQbdlmei+gzp6yoSSoSL6GsLPxnuayZSMrSd5Ka7IjAvatpIernBvT2+Ic6RLTg+jSebScmasg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/environment': 29.3.1 - '@jest/expect': 29.3.1 - '@jest/test-result': 29.3.1 - '@jest/types': 29.3.1 - '@types/node': 18.11.9 + '@jest/environment': 29.4.1 + '@jest/expect': 29.4.1 + '@jest/test-result': 29.4.1 + '@jest/types': 29.4.1 + '@types/node': 18.11.18 chalk: 4.1.2 co: 4.6.0 dedent: 0.7.0 is-generator-fn: 2.1.0 jest-each: 29.3.1 jest-matcher-utils: 29.3.1 - jest-message-util: 29.3.1 - jest-runtime: 29.3.1 - jest-snapshot: 29.3.1 - jest-util: 29.3.1 + jest-message-util: 29.4.1 + jest-runtime: 29.4.1 + jest-snapshot: 29.4.1 + jest-util: 29.4.1 p-limit: 3.1.0 - pretty-format: 29.3.1 + pretty-format: 29.4.1 + slash: 3.0.0 + stack-utils: 2.0.6 + transitivePeerDependencies: + - supports-color + dev: true + + /jest-circus/29.4.1: + resolution: {integrity: sha512-v02NuL5crMNY4CGPHBEflLzl4v91NFb85a+dH9a1pUNx6Xjggrd8l9pPy4LZ1VYNRXlb+f65+7O/MSIbLir6pA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/environment': 29.4.1 + '@jest/expect': 29.4.1 + '@jest/test-result': 29.4.1 + '@jest/types': 29.4.1 + '@types/node': 18.11.18 + chalk: 4.1.2 + co: 4.6.0 + dedent: 0.7.0 + is-generator-fn: 2.1.0 + jest-each: 29.4.1 + jest-matcher-utils: 29.4.1 + jest-message-util: 29.4.1 + jest-runtime: 29.4.1 + jest-snapshot: 29.4.1 + jest-util: 29.4.1 + p-limit: 3.1.0 + pretty-format: 29.4.1 slash: 3.0.0 stack-utils: 2.0.6 transitivePeerDependencies: @@ -3387,7 +3783,7 @@ packages: dependencies: '@jest/core': 29.3.1_ts-node@10.9.1 '@jest/test-result': 29.3.1 - '@jest/types': 29.3.1 + '@jest/types': 29.4.1 chalk: 4.1.2 exit: 0.1.2 graceful-fs: 4.2.10 @@ -3403,6 +3799,34 @@ packages: - ts-node dev: true + /jest-cli/29.4.1_zfha7dvnw4nti6zkbsmhmn6xo4: + resolution: {integrity: sha512-jz7GDIhtxQ37M+9dlbv5K+/FVcIo1O/b1sX3cJgzlQUf/3VG25nvuWzlDC4F1FLLzUThJeWLu8I7JF9eWpuURQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + hasBin: true + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + dependencies: + '@jest/core': 29.4.1_ts-node@10.9.1 + '@jest/test-result': 29.4.1 + '@jest/types': 29.4.1 + chalk: 4.1.2 + exit: 0.1.2 + graceful-fs: 4.2.10 + import-local: 3.1.0 + jest-config: 29.4.1_zfha7dvnw4nti6zkbsmhmn6xo4 + jest-util: 29.4.1 + jest-validate: 29.4.1 + prompts: 2.4.2 + yargs: 17.6.2 + transitivePeerDependencies: + - '@types/node' + - supports-color + - ts-node + dev: true + /jest-config/29.3.1_odkjkoia5xunhxkdrka32ib6vi: resolution: {integrity: sha512-y0tFHdj2WnTEhxmGUK1T7fgLen7YK4RtfvpLFBXfQkh2eMJAQq24Vx9472lvn5wg0MAO6B+iPfJfzdR9hJYalg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -3417,7 +3841,7 @@ packages: dependencies: '@babel/core': 7.20.2 '@jest/test-sequencer': 29.3.1 - '@jest/types': 29.3.1 + '@jest/types': 29.4.1 '@types/node': 18.11.9 babel-jest: 29.3.1_@babel+core@7.20.2 chalk: 4.1.2 @@ -3431,11 +3855,11 @@ packages: jest-regex-util: 29.2.0 jest-resolve: 29.3.1 jest-runner: 29.3.1 - jest-util: 29.3.1 - jest-validate: 29.3.1 + jest-util: 29.4.1 + jest-validate: 29.4.1 micromatch: 4.0.5 parse-json: 5.2.0 - pretty-format: 29.3.1 + pretty-format: 29.4.1 slash: 3.0.0 strip-json-comments: 3.1.1 ts-node: 10.9.1_3v2cms72gsblw7jmali7btb3pu @@ -3443,6 +3867,86 @@ packages: - supports-color dev: true + /jest-config/29.3.1_zfha7dvnw4nti6zkbsmhmn6xo4: + resolution: {integrity: sha512-y0tFHdj2WnTEhxmGUK1T7fgLen7YK4RtfvpLFBXfQkh2eMJAQq24Vx9472lvn5wg0MAO6B+iPfJfzdR9hJYalg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + '@types/node': '*' + ts-node: '>=9.0.0' + peerDependenciesMeta: + '@types/node': + optional: true + ts-node: + optional: true + dependencies: + '@babel/core': 7.20.2 + '@jest/test-sequencer': 29.3.1 + '@jest/types': 29.4.1 + '@types/node': 18.11.18 + babel-jest: 29.3.1_@babel+core@7.20.2 + chalk: 4.1.2 + ci-info: 3.5.0 + deepmerge: 4.2.2 + glob: 7.2.3 + graceful-fs: 4.2.10 + jest-circus: 29.3.1 + jest-environment-node: 29.3.1 + jest-get-type: 29.2.0 + jest-regex-util: 29.2.0 + jest-resolve: 29.3.1 + jest-runner: 29.3.1 + jest-util: 29.4.1 + jest-validate: 29.4.1 + micromatch: 4.0.5 + parse-json: 5.2.0 + pretty-format: 29.4.1 + slash: 3.0.0 + strip-json-comments: 3.1.1 + ts-node: 10.9.1_3v2cms72gsblw7jmali7btb3pu + transitivePeerDependencies: + - supports-color + dev: true + + /jest-config/29.4.1_zfha7dvnw4nti6zkbsmhmn6xo4: + resolution: {integrity: sha512-g7p3q4NuXiM4hrS4XFATTkd+2z0Ml2RhFmFPM8c3WyKwVDNszbl4E7cV7WIx1YZeqqCtqbtTtZhGZWJlJqngzg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + peerDependencies: + '@types/node': '*' + ts-node: '>=9.0.0' + peerDependenciesMeta: + '@types/node': + optional: true + ts-node: + optional: true + dependencies: + '@babel/core': 7.20.2 + '@jest/test-sequencer': 29.4.1 + '@jest/types': 29.4.1 + '@types/node': 18.11.18 + babel-jest: 29.4.1_@babel+core@7.20.2 + chalk: 4.1.2 + ci-info: 3.5.0 + deepmerge: 4.2.2 + glob: 7.2.3 + graceful-fs: 4.2.10 + jest-circus: 29.4.1 + jest-environment-node: 29.4.1 + jest-get-type: 29.2.0 + jest-regex-util: 29.2.0 + jest-resolve: 29.4.1 + jest-runner: 29.4.1 + jest-util: 29.4.1 + jest-validate: 29.4.1 + micromatch: 4.0.5 + parse-json: 5.2.0 + pretty-format: 29.4.1 + slash: 3.0.0 + strip-json-comments: 3.1.1 + ts-node: 10.9.1_awa2wsr5thmg3i7jqycphctjfq + transitivePeerDependencies: + - supports-color + dev: true + /jest-diff/29.3.1: resolution: {integrity: sha512-vU8vyiO7568tmin2lA3r2DP8oRvzhvRcD4DjpXc6uGveQodyk7CKLhQlCSiwgx3g0pFaE88/KLZ0yaTWMc4Uiw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -3453,6 +3957,16 @@ packages: pretty-format: 29.3.1 dev: true + /jest-diff/29.4.1: + resolution: {integrity: sha512-uazdl2g331iY56CEyfbNA0Ut7Mn2ulAG5vUaEHXycf1L6IPyuImIxSz4F0VYBKi7LYIuxOwTZzK3wh5jHzASMw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + chalk: 4.1.2 + diff-sequences: 29.3.1 + jest-get-type: 29.2.0 + pretty-format: 29.4.1 + dev: true + /jest-docblock/29.2.0: resolution: {integrity: sha512-bkxUsxTgWQGbXV5IENmfiIuqZhJcyvF7tU4zJ/7ioTutdz4ToB5Yx6JOFBpgI+TphRY4lhOyCWGNH/QFQh5T6A==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -3464,11 +3978,22 @@ packages: resolution: {integrity: sha512-qrZH7PmFB9rEzCSl00BWjZYuS1BSOH8lLuC0azQE9lQrAx3PWGKHTDudQiOSwIy5dGAJh7KA0ScYlCP7JxvFYA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.3.1 + '@jest/types': 29.4.1 chalk: 4.1.2 jest-get-type: 29.2.0 - jest-util: 29.3.1 - pretty-format: 29.3.1 + jest-util: 29.4.1 + pretty-format: 29.4.1 + dev: true + + /jest-each/29.4.1: + resolution: {integrity: sha512-QlYFiX3llJMWUV0BtWht/esGEz9w+0i7BHwODKCze7YzZzizgExB9MOfiivF/vVT0GSQ8wXLhvHXh3x2fVD4QQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/types': 29.4.1 + chalk: 4.1.2 + jest-get-type: 29.2.0 + jest-util: 29.4.1 + pretty-format: 29.4.1 dev: true /jest-environment-jsdom/29.3.1: @@ -3482,9 +4007,9 @@ packages: dependencies: '@jest/environment': 29.3.1 '@jest/fake-timers': 29.3.1 - '@jest/types': 29.3.1 + '@jest/types': 29.4.1 '@types/jsdom': 20.0.1 - '@types/node': 18.11.9 + '@types/node': 18.11.18 jest-mock: 29.3.1 jest-util: 29.3.1 jsdom: 20.0.3 @@ -3498,12 +4023,24 @@ packages: resolution: {integrity: sha512-xm2THL18Xf5sIHoU7OThBPtuH6Lerd+Y1NLYiZJlkE3hbE+7N7r8uvHIl/FkZ5ymKXJe/11SQuf3fv4v6rUMag==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/environment': 29.3.1 + '@jest/environment': 29.4.1 '@jest/fake-timers': 29.3.1 - '@jest/types': 29.3.1 - '@types/node': 18.11.9 - jest-mock: 29.3.1 - jest-util: 29.3.1 + '@jest/types': 29.4.1 + '@types/node': 18.11.18 + jest-mock: 29.4.1 + jest-util: 29.4.1 + dev: true + + /jest-environment-node/29.4.1: + resolution: {integrity: sha512-x/H2kdVgxSkxWAIlIh9MfMuBa0hZySmfsC5lCsWmWr6tZySP44ediRKDUiNggX/eHLH7Cd5ZN10Rw+XF5tXsqg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/environment': 29.4.1 + '@jest/fake-timers': 29.4.1 + '@jest/types': 29.4.1 + '@types/node': 18.11.18 + jest-mock: 29.4.1 + jest-util: 29.4.1 dev: true /jest-get-type/29.2.0: @@ -3515,14 +4052,14 @@ packages: resolution: {integrity: sha512-/FFtvoG1xjbbPXQLFef+WSU4yrc0fc0Dds6aRPBojUid7qlPqZvxdUBA03HW0fnVHXVCnCdkuoghYItKNzc/0A==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.3.1 + '@jest/types': 29.4.1 '@types/graceful-fs': 4.1.5 - '@types/node': 18.11.9 + '@types/node': 18.11.18 anymatch: 3.1.2 fb-watchman: 2.0.2 graceful-fs: 4.2.10 jest-regex-util: 29.2.0 - jest-util: 29.3.1 + jest-util: 29.4.1 jest-worker: 29.3.1 micromatch: 4.0.5 walker: 1.0.8 @@ -3530,12 +4067,39 @@ packages: fsevents: 2.3.2 dev: true + /jest-haste-map/29.4.1: + resolution: {integrity: sha512-imTjcgfVVTvg02khXL11NNLTx9ZaofbAWhilrMg/G8dIkp+HYCswhxf0xxJwBkfhWb3e8dwbjuWburvxmcr58w==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/types': 29.4.1 + '@types/graceful-fs': 4.1.5 + '@types/node': 18.11.18 + anymatch: 3.1.2 + fb-watchman: 2.0.2 + graceful-fs: 4.2.10 + jest-regex-util: 29.2.0 + jest-util: 29.4.1 + jest-worker: 29.4.1 + micromatch: 4.0.5 + walker: 1.0.8 + optionalDependencies: + fsevents: 2.3.2 + dev: true + /jest-leak-detector/29.3.1: resolution: {integrity: sha512-3DA/VVXj4zFOPagGkuqHnSQf1GZBmmlagpguxEERO6Pla2g84Q1MaVIB3YMxgUaFIaYag8ZnTyQgiZ35YEqAQA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: jest-get-type: 29.2.0 - pretty-format: 29.3.1 + pretty-format: 29.4.1 + dev: true + + /jest-leak-detector/29.4.1: + resolution: {integrity: sha512-akpZv7TPyGMnH2RimOCgy+hPmWZf55EyFUvymQ4LMsQP8xSPlZumCPtXGoDhFNhUE2039RApZkTQDKU79p/FiQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + jest-get-type: 29.2.0 + pretty-format: 29.4.1 dev: true /jest-matcher-utils/29.3.1: @@ -3548,17 +4112,42 @@ packages: pretty-format: 29.3.1 dev: true + /jest-matcher-utils/29.4.1: + resolution: {integrity: sha512-k5h0u8V4nAEy6lSACepxL/rw78FLDkBnXhZVgFneVpnJONhb2DhZj/Gv4eNe+1XqQ5IhgUcqj745UwH0HJmMnA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + chalk: 4.1.2 + jest-diff: 29.4.1 + jest-get-type: 29.2.0 + pretty-format: 29.4.1 + dev: true + /jest-message-util/29.3.1: resolution: {integrity: sha512-lMJTbgNcDm5z+6KDxWtqOFWlGQxD6XaYwBqHR8kmpkP+WWWG90I35kdtQHY67Ay5CSuydkTBbJG+tH9JShFCyA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@babel/code-frame': 7.18.6 - '@jest/types': 29.3.1 + '@jest/types': 29.4.1 '@types/stack-utils': 2.0.1 chalk: 4.1.2 graceful-fs: 4.2.10 micromatch: 4.0.5 - pretty-format: 29.3.1 + pretty-format: 29.4.1 + slash: 3.0.0 + stack-utils: 2.0.6 + dev: true + + /jest-message-util/29.4.1: + resolution: {integrity: sha512-H4/I0cXUaLeCw6FM+i4AwCnOwHRgitdaUFOdm49022YD5nfyr8C/DrbXOBEyJaj+w/y0gGJ57klssOaUiLLQGQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@babel/code-frame': 7.18.6 + '@jest/types': 29.4.1 + '@types/stack-utils': 2.0.1 + chalk: 4.1.2 + graceful-fs: 4.2.10 + micromatch: 4.0.5 + pretty-format: 29.4.1 slash: 3.0.0 stack-utils: 2.0.6 dev: true @@ -3567,11 +4156,20 @@ packages: resolution: {integrity: sha512-H8/qFDtDVMFvFP4X8NuOT3XRDzOUTz+FeACjufHzsOIBAxivLqkB1PoLCaJx9iPPQ8dZThHPp/G3WRWyMgA3JA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.3.1 - '@types/node': 18.11.9 + '@jest/types': 29.4.1 + '@types/node': 18.11.18 jest-util: 29.3.1 dev: true + /jest-mock/29.4.1: + resolution: {integrity: sha512-MwA4hQ7zBOcgVCVnsM8TzaFLVUD/pFWTfbkY953Y81L5ret3GFRZtmPmRFAjKQSdCKoJvvqOu6Bvfpqlwwb0dQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/types': 29.4.1 + '@types/node': 18.11.18 + jest-util: 29.4.1 + dev: true + /jest-pnp-resolver/1.2.2_jest-resolve@29.3.1: resolution: {integrity: sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w==} engines: {node: '>=6'} @@ -3584,6 +4182,18 @@ packages: jest-resolve: 29.3.1 dev: true + /jest-pnp-resolver/1.2.2_jest-resolve@29.4.1: + resolution: {integrity: sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w==} + engines: {node: '>=6'} + peerDependencies: + jest-resolve: '*' + peerDependenciesMeta: + jest-resolve: + optional: true + dependencies: + jest-resolve: 29.4.1 + dev: true + /jest-regex-util/29.2.0: resolution: {integrity: sha512-6yXn0kg2JXzH30cr2NlThF+70iuO/3irbaB4mh5WyqNIvLLP+B6sFdluO1/1RJmslyh/f9osnefECflHvTbwVA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -3599,6 +4209,16 @@ packages: - supports-color dev: true + /jest-resolve-dependencies/29.4.1: + resolution: {integrity: sha512-Y3QG3M1ncAMxfjbYgtqNXC5B595zmB6e//p/qpA/58JkQXu/IpLDoLeOa8YoYfsSglBKQQzNUqtfGJJT/qLmJg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + jest-regex-util: 29.2.0 + jest-snapshot: 29.4.1 + transitivePeerDependencies: + - supports-color + dev: true + /jest-resolve/29.3.1: resolution: {integrity: sha512-amXJgH/Ng712w3Uz5gqzFBBjxV8WFLSmNjoreBGMqxgCz5cH7swmBZzgBaCIOsvb0NbpJ0vgaSFdJqMdT+rADw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -3607,23 +4227,38 @@ packages: graceful-fs: 4.2.10 jest-haste-map: 29.3.1 jest-pnp-resolver: 1.2.2_jest-resolve@29.3.1 - jest-util: 29.3.1 - jest-validate: 29.3.1 + jest-util: 29.4.1 + jest-validate: 29.4.1 resolve: 1.22.1 resolve.exports: 1.1.0 slash: 3.0.0 dev: true + /jest-resolve/29.4.1: + resolution: {integrity: sha512-j/ZFNV2lm9IJ2wmlq1uYK0Y/1PiyDq9g4HEGsNTNr3viRbJdV+8Lf1SXIiLZXFvyiisu0qUyIXGBnw+OKWkJwQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + chalk: 4.1.2 + graceful-fs: 4.2.10 + jest-haste-map: 29.4.1 + jest-pnp-resolver: 1.2.2_jest-resolve@29.4.1 + jest-util: 29.4.1 + jest-validate: 29.4.1 + resolve: 1.22.1 + resolve.exports: 2.0.0 + slash: 3.0.0 + dev: true + /jest-runner/29.3.1: resolution: {integrity: sha512-oFvcwRNrKMtE6u9+AQPMATxFcTySyKfLhvso7Sdk/rNpbhg4g2GAGCopiInk1OP4q6gz3n6MajW4+fnHWlU3bA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/console': 29.3.1 - '@jest/environment': 29.3.1 - '@jest/test-result': 29.3.1 + '@jest/environment': 29.4.1 + '@jest/test-result': 29.4.1 '@jest/transform': 29.3.1 - '@jest/types': 29.3.1 - '@types/node': 18.11.9 + '@jest/types': 29.4.1 + '@types/node': 18.11.18 chalk: 4.1.2 emittery: 0.13.1 graceful-fs: 4.2.10 @@ -3634,7 +4269,7 @@ packages: jest-message-util: 29.3.1 jest-resolve: 29.3.1 jest-runtime: 29.3.1 - jest-util: 29.3.1 + jest-util: 29.4.1 jest-watcher: 29.3.1 jest-worker: 29.3.1 p-limit: 3.1.0 @@ -3643,18 +4278,47 @@ packages: - supports-color dev: true + /jest-runner/29.4.1: + resolution: {integrity: sha512-8d6XXXi7GtHmsHrnaqBKWxjKb166Eyj/ksSaUYdcBK09VbjPwIgWov1VwSmtupCIz8q1Xv4Qkzt/BTo3ZqiCeg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/console': 29.4.1 + '@jest/environment': 29.4.1 + '@jest/test-result': 29.4.1 + '@jest/transform': 29.4.1 + '@jest/types': 29.4.1 + '@types/node': 18.11.18 + chalk: 4.1.2 + emittery: 0.13.1 + graceful-fs: 4.2.10 + jest-docblock: 29.2.0 + jest-environment-node: 29.4.1 + jest-haste-map: 29.4.1 + jest-leak-detector: 29.4.1 + jest-message-util: 29.4.1 + jest-resolve: 29.4.1 + jest-runtime: 29.4.1 + jest-util: 29.4.1 + jest-watcher: 29.4.1 + jest-worker: 29.4.1 + p-limit: 3.1.0 + source-map-support: 0.5.13 + transitivePeerDependencies: + - supports-color + dev: true + /jest-runtime/29.3.1: resolution: {integrity: sha512-jLzkIxIqXwBEOZx7wx9OO9sxoZmgT2NhmQKzHQm1xwR1kNW/dn0OjxR424VwHHf1SPN6Qwlb5pp1oGCeFTQ62A==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/environment': 29.3.1 + '@jest/environment': 29.4.1 '@jest/fake-timers': 29.3.1 - '@jest/globals': 29.3.1 + '@jest/globals': 29.4.1 '@jest/source-map': 29.2.0 - '@jest/test-result': 29.3.1 + '@jest/test-result': 29.4.1 '@jest/transform': 29.3.1 - '@jest/types': 29.3.1 - '@types/node': 18.11.9 + '@jest/types': 29.4.1 + '@types/node': 18.11.18 chalk: 4.1.2 cjs-module-lexer: 1.2.2 collect-v8-coverage: 1.0.1 @@ -3662,11 +4326,42 @@ packages: graceful-fs: 4.2.10 jest-haste-map: 29.3.1 jest-message-util: 29.3.1 - jest-mock: 29.3.1 + jest-mock: 29.4.1 jest-regex-util: 29.2.0 jest-resolve: 29.3.1 jest-snapshot: 29.3.1 - jest-util: 29.3.1 + jest-util: 29.4.1 + slash: 3.0.0 + strip-bom: 4.0.0 + transitivePeerDependencies: + - supports-color + dev: true + + /jest-runtime/29.4.1: + resolution: {integrity: sha512-UXTMU9uKu2GjYwTtoAw5rn4STxWw/nadOfW7v1sx6LaJYa3V/iymdCLQM6xy3+7C6mY8GfX22vKpgxY171UIoA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/environment': 29.4.1 + '@jest/fake-timers': 29.4.1 + '@jest/globals': 29.4.1 + '@jest/source-map': 29.2.0 + '@jest/test-result': 29.4.1 + '@jest/transform': 29.4.1 + '@jest/types': 29.4.1 + '@types/node': 18.11.18 + chalk: 4.1.2 + cjs-module-lexer: 1.2.2 + collect-v8-coverage: 1.0.1 + glob: 7.2.3 + graceful-fs: 4.2.10 + jest-haste-map: 29.4.1 + jest-message-util: 29.4.1 + jest-mock: 29.4.1 + jest-regex-util: 29.2.0 + jest-resolve: 29.4.1 + jest-snapshot: 29.4.1 + jest-util: 29.4.1 + semver: 7.3.8 slash: 3.0.0 strip-bom: 4.0.0 transitivePeerDependencies: @@ -3685,7 +4380,7 @@ packages: '@babel/types': 7.20.2 '@jest/expect-utils': 29.3.1 '@jest/transform': 29.3.1 - '@jest/types': 29.3.1 + '@jest/types': 29.4.1 '@types/babel__traverse': 7.18.2 '@types/prettier': 2.7.1 babel-preset-current-node-syntax: 1.0.1_@babel+core@7.20.2 @@ -3705,12 +4400,56 @@ packages: - supports-color dev: true + /jest-snapshot/29.4.1: + resolution: {integrity: sha512-l4iV8EjGgQWVz3ee/LR9sULDk2pCkqb71bjvlqn+qp90lFwpnulHj4ZBT8nm1hA1C5wowXLc7MGnw321u0tsYA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@babel/core': 7.20.2 + '@babel/generator': 7.20.4 + '@babel/plugin-syntax-jsx': 7.18.6_@babel+core@7.20.2 + '@babel/plugin-syntax-typescript': 7.20.0_@babel+core@7.20.2 + '@babel/traverse': 7.20.1 + '@babel/types': 7.20.2 + '@jest/expect-utils': 29.4.1 + '@jest/transform': 29.4.1 + '@jest/types': 29.4.1 + '@types/babel__traverse': 7.18.2 + '@types/prettier': 2.7.1 + babel-preset-current-node-syntax: 1.0.1_@babel+core@7.20.2 + chalk: 4.1.2 + expect: 29.4.1 + graceful-fs: 4.2.10 + jest-diff: 29.4.1 + jest-get-type: 29.2.0 + jest-haste-map: 29.4.1 + jest-matcher-utils: 29.4.1 + jest-message-util: 29.4.1 + jest-util: 29.4.1 + natural-compare: 1.4.0 + pretty-format: 29.4.1 + semver: 7.3.8 + transitivePeerDependencies: + - supports-color + dev: true + /jest-util/29.3.1: resolution: {integrity: sha512-7YOVZaiX7RJLv76ZfHt4nbNEzzTRiMW/IiOG7ZOKmTXmoGBxUDefgMAxQubu6WPVqP5zSzAdZG0FfLcC7HOIFQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.3.1 - '@types/node': 18.11.9 + '@jest/types': 29.4.1 + '@types/node': 18.11.18 + chalk: 4.1.2 + ci-info: 3.5.0 + graceful-fs: 4.2.10 + picomatch: 2.3.1 + dev: true + + /jest-util/29.4.1: + resolution: {integrity: sha512-bQy9FPGxVutgpN4VRc0hk6w7Hx/m6L53QxpDreTZgJd9gfx/AV2MjyPde9tGyZRINAUrSv57p2inGBu2dRLmkQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/types': 29.4.1 + '@types/node': 18.11.18 chalk: 4.1.2 ci-info: 3.5.0 graceful-fs: 4.2.10 @@ -3721,25 +4460,51 @@ packages: resolution: {integrity: sha512-N9Lr3oYR2Mpzuelp1F8negJR3YE+L1ebk1rYA5qYo9TTY3f9OWdptLoNSPP9itOCBIRBqjt/S5XHlzYglLN67g==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.3.1 + '@jest/types': 29.4.1 camelcase: 6.3.0 chalk: 4.1.2 jest-get-type: 29.2.0 leven: 3.1.0 - pretty-format: 29.3.1 + pretty-format: 29.4.1 + dev: true + + /jest-validate/29.4.1: + resolution: {integrity: sha512-qNZXcZQdIQx4SfUB/atWnI4/I2HUvhz8ajOSYUu40CSmf9U5emil8EDHgE7M+3j9/pavtk3knlZBDsgFvv/SWw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/types': 29.4.1 + camelcase: 6.3.0 + chalk: 4.1.2 + jest-get-type: 29.2.0 + leven: 3.1.0 + pretty-format: 29.4.1 dev: true /jest-watcher/29.3.1: resolution: {integrity: sha512-RspXG2BQFDsZSRKGCT/NiNa8RkQ1iKAjrO0//soTMWx/QUt+OcxMqMSBxz23PYGqUuWm2+m2mNNsmj0eIoOaFg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/test-result': 29.3.1 - '@jest/types': 29.3.1 - '@types/node': 18.11.9 + '@jest/test-result': 29.4.1 + '@jest/types': 29.4.1 + '@types/node': 18.11.18 ansi-escapes: 4.3.2 chalk: 4.1.2 emittery: 0.13.1 - jest-util: 29.3.1 + jest-util: 29.4.1 + string-length: 4.0.2 + dev: true + + /jest-watcher/29.4.1: + resolution: {integrity: sha512-vFOzflGFs27nU6h8dpnVRER3O2rFtL+VMEwnG0H3KLHcllLsU8y9DchSh0AL/Rg5nN1/wSiQ+P4ByMGpuybaVw==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/test-result': 29.4.1 + '@jest/types': 29.4.1 + '@types/node': 18.11.18 + ansi-escapes: 4.3.2 + chalk: 4.1.2 + emittery: 0.13.1 + jest-util: 29.4.1 string-length: 4.0.2 dev: true @@ -3747,8 +4512,18 @@ packages: resolution: {integrity: sha512-lY4AnnmsEWeiXirAIA0c9SDPbuCBq8IYuDVL8PMm0MZ2PEs2yPvRA/J64QBXuZp7CYKrDM/rmNrc9/i3KJQncw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@types/node': 18.11.9 - jest-util: 29.3.1 + '@types/node': 18.11.18 + jest-util: 29.4.1 + merge-stream: 2.0.0 + supports-color: 8.1.1 + dev: true + + /jest-worker/29.4.1: + resolution: {integrity: sha512-O9doU/S1EBe+yp/mstQ0VpPwpv0Clgn68TkNwGxL6/usX/KUW9Arnn4ag8C3jc6qHcXznhsT5Na1liYzAsuAbQ==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@types/node': 18.11.18 + jest-util: 29.4.1 merge-stream: 2.0.0 supports-color: 8.1.1 dev: true @@ -3784,7 +4559,7 @@ packages: optional: true dependencies: '@jest/core': 29.3.1_ts-node@10.9.1 - '@jest/types': 29.3.1 + '@jest/types': 29.4.1 import-local: 3.1.0 jest-cli: 29.3.1_odkjkoia5xunhxkdrka32ib6vi transitivePeerDependencies: @@ -3793,6 +4568,26 @@ packages: - ts-node dev: true + /jest/29.4.1_zfha7dvnw4nti6zkbsmhmn6xo4: + resolution: {integrity: sha512-cknimw7gAXPDOmj0QqztlxVtBVCw2lYY9CeIE5N6kD+kET1H4H79HSNISJmijb1HF+qk+G+ploJgiDi5k/fRlg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + hasBin: true + peerDependencies: + node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 + peerDependenciesMeta: + node-notifier: + optional: true + dependencies: + '@jest/core': 29.4.1_ts-node@10.9.1 + '@jest/types': 29.4.1 + import-local: 3.1.0 + jest-cli: 29.4.1_zfha7dvnw4nti6zkbsmhmn6xo4 + transitivePeerDependencies: + - '@types/node' + - supports-color + - ts-node + dev: true + /joycon/3.1.1: resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==} engines: {node: '>=10'} @@ -3867,6 +4662,12 @@ packages: hasBin: true dev: true + /json5/2.2.3: + resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} + engines: {node: '>=6'} + hasBin: true + dev: true + /jsonfile/4.0.0: resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==} optionalDependencies: @@ -4074,6 +4875,12 @@ packages: hasBin: true dev: true + /mime/2.6.0: + resolution: {integrity: sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==} + engines: {node: '>=4.0.0'} + hasBin: true + dev: true + /mimic-fn/2.1.0: resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} engines: {node: '>=6'} @@ -4451,6 +5258,15 @@ packages: react-is: 18.2.0 dev: true + /pretty-format/29.4.1: + resolution: {integrity: sha512-dt/Z761JUVsrIKaY215o1xQJBGlSmTx/h4cSqXqjHLnU1+Kt+mavVE7UgqJJO5ukx5HjSswHfmXz4LjS2oIJfg==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + dependencies: + '@jest/schemas': 29.4.0 + ansi-styles: 5.2.0 + react-is: 18.2.0 + dev: true + /process-nextick-args/2.0.1: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} dev: true @@ -4678,6 +5494,11 @@ packages: engines: {node: '>=10'} dev: true + /resolve.exports/2.0.0: + resolution: {integrity: sha512-6K/gDlqgQscOlg9fSRpWstA8sYe8rbELsSTNpx+3kTrsVCzvSl0zIvRErM7fdl9ERWDsKnrLnwB+Ne89918XOg==} + engines: {node: '>=10'} + dev: true + /resolve/1.22.1: resolution: {integrity: sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==} hasBin: true @@ -4699,6 +5520,12 @@ packages: glob: 7.2.3 dev: true + /rimraf/4.1.2: + resolution: {integrity: sha512-BlIbgFryTbw3Dz6hyoWFhKk+unCcHMSkZGrTFVAx2WmttdBSonsdtRlwiuTbDqTKr+UlXIUqJVS4QT5tUzGENQ==} + engines: {node: '>=14'} + hasBin: true + dev: true + /rollup/2.79.1: resolution: {integrity: sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==} engines: {node: '>=10.0.0'} @@ -5024,6 +5851,34 @@ packages: ts-interface-checker: 0.1.13 dev: true + /superagent/8.0.9: + resolution: {integrity: sha512-4C7Bh5pyHTvU33KpZgwrNKh/VQnvgtCSqPRfJAUdmrtSYePVzVg4E4OzsrbkhJj9O7SO6Bnv75K/F8XVZT8YHA==} + engines: {node: '>=6.4.0 <13 || >=14'} + dependencies: + component-emitter: 1.3.0 + cookiejar: 2.1.4 + debug: 4.3.4 + fast-safe-stringify: 2.1.1 + form-data: 4.0.0 + formidable: 2.1.2 + methods: 1.1.2 + mime: 2.6.0 + qs: 6.11.0 + semver: 7.3.8 + transitivePeerDependencies: + - supports-color + dev: true + + /supertest/6.3.3: + resolution: {integrity: sha512-EMCG6G8gDu5qEqRQ3JjjPs6+FYT1a7Hv5ApHvtSghmOFJYtsU5S+pSb6Y2EUeCEY3CmEL3mmQ8YWlPOzQomabA==} + engines: {node: '>=6.4.0'} + dependencies: + methods: 1.1.2 + superagent: 8.0.9 + transitivePeerDependencies: + - supports-color + dev: true + /supports-color/5.5.0: resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} engines: {node: '>=4'} @@ -5218,6 +6073,40 @@ packages: yargs-parser: 21.1.1 dev: true + /ts-jest/29.0.5_2nqegl6ju5oy2sctmmmle4ucam: + resolution: {integrity: sha512-PL3UciSgIpQ7f6XjVOmbi96vmDHUqAyqDr8YxzopDqX3kfgYtX1cuNeBjP+L9sFXi6nzsGGA6R3fP3DDDJyrxA==} + engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} + hasBin: true + peerDependencies: + '@babel/core': '>=7.0.0-beta.0 <8' + '@jest/types': ^29.0.0 + babel-jest: ^29.0.0 + esbuild: '*' + jest: ^29.0.0 + typescript: '>=4.3' + peerDependenciesMeta: + '@babel/core': + optional: true + '@jest/types': + optional: true + babel-jest: + optional: true + esbuild: + optional: true + dependencies: + '@jest/types': 29.3.1 + bs-logger: 0.2.6 + fast-json-stable-stringify: 2.1.0 + jest: 29.4.1_zfha7dvnw4nti6zkbsmhmn6xo4 + jest-util: 29.3.1 + json5: 2.2.3 + lodash.memoize: 4.1.2 + make-error: 1.3.6 + semver: 7.3.8 + typescript: 4.9.4 + yargs-parser: 21.1.1 + dev: true + /ts-node/10.9.1_3v2cms72gsblw7jmali7btb3pu: resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true @@ -5249,6 +6138,37 @@ packages: yn: 3.1.1 dev: true + /ts-node/10.9.1_awa2wsr5thmg3i7jqycphctjfq: + resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} + hasBin: true + peerDependencies: + '@swc/core': '>=1.2.50' + '@swc/wasm': '>=1.2.50' + '@types/node': '*' + typescript: '>=2.7' + peerDependenciesMeta: + '@swc/core': + optional: true + '@swc/wasm': + optional: true + dependencies: + '@cspotcode/source-map-support': 0.8.1 + '@tsconfig/node10': 1.0.9 + '@tsconfig/node12': 1.0.11 + '@tsconfig/node14': 1.0.3 + '@tsconfig/node16': 1.0.3 + '@types/node': 18.11.18 + acorn: 8.8.1 + acorn-walk: 8.2.0 + arg: 4.1.3 + create-require: 1.1.1 + diff: 4.0.2 + make-error: 1.3.6 + typescript: 4.9.4 + v8-compile-cache-lib: 3.0.1 + yn: 3.1.1 + dev: true + /tsup/6.3.0_z6wznmtyb6ovnulj6iujpct7um: resolution: {integrity: sha512-IaNQO/o1rFgadLhNonVKNCT2cks+vvnWX3DnL8sB87lBDqRvJXHENr5lSPJlqwplUlDxSwZK8dSg87rgBu6Emw==} engines: {node: '>=14'} @@ -5654,6 +6574,14 @@ packages: signal-exit: 3.0.7 dev: true + /write-file-atomic/5.0.0: + resolution: {integrity: sha512-R7NYMnHSlV42K54lwY9lvW6MnSm1HSJqZL3xiSgi9E7//FYaI74r2G0rd+/X6VAMkHEdzxQaU5HUOXWUz5kA/w==} + engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} + dependencies: + imurmurhash: 0.1.4 + signal-exit: 3.0.7 + dev: true + /ws/8.11.0: resolution: {integrity: sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==} engines: {node: '>=10.0.0'} @@ -5759,3 +6687,7 @@ packages: /zod/3.20.1: resolution: {integrity: sha512-At2YngeqktnHk6L9vf6Sdt7IGcRFziasf7JyQfKwxMd2rOWIUvURP6oLUTW6N0WKQ5bcIdI+IZ3+uGZCCcQcQg==} dev: true + + /zod/3.20.2: + resolution: {integrity: sha512-1MzNQdAvO+54H+EaK5YpyEy0T+Ejo/7YLHS93G3RnYWh5gaotGHwGeN/ZO687qEDU2y4CdStQYXVHIgrUl5UVQ==} + dev: true From ff6ba980affae949fe0c801ddfeb1a12aaf907ff Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Thu, 2 Feb 2023 13:34:22 +0100 Subject: [PATCH 116/206] fix(express): do not support options --- packages/core/src/zodios.types.ts | 1 - packages/express/src/zodios-validator.ts | 7 +- packages/express/src/zodios.ts | 108 +++++++++++++++++------ packages/express/src/zodios.types.ts | 40 ++++----- 4 files changed, 101 insertions(+), 55 deletions(-) diff --git a/packages/core/src/zodios.types.ts b/packages/core/src/zodios.types.ts index ea806643..4da462ce 100644 --- a/packages/core/src/zodios.types.ts +++ b/packages/core/src/zodios.types.ts @@ -36,7 +36,6 @@ export const HTTP_MUTATION_METHODS = [ export const HTTP_METHODS = [ ...HTTP_QUERY_METHODS, ...HTTP_MUTATION_METHODS, - "options", ] as const; export type QueryMethod = typeof HTTP_QUERY_METHODS[number]; diff --git a/packages/express/src/zodios-validator.ts b/packages/express/src/zodios-validator.ts index 70476049..f67dd036 100644 --- a/packages/express/src/zodios-validator.ts +++ b/packages/express/src/zodios-validator.ts @@ -39,13 +39,11 @@ function validateEndpointMiddleware( ) => { for (let parameter of endpoint.parameters!) { let schema = parameter.schema; - if (!transform) { - schema = withoutTransform(schema); - } switch (parameter.type) { case "Body": { + // @ts-ignore const result = await schema.safeParseAsync(req.body); if (!result.success) { return res.status(400).json({ @@ -59,6 +57,7 @@ function validateEndpointMiddleware( case "Path": { const result = await validateParam( + // @ts-ignore schema, req.params[parameter.name] ); @@ -74,6 +73,7 @@ function validateEndpointMiddleware( case "Query": { const result = await validateParam( + // @ts-ignore schema, req.query[parameter.name] ); @@ -88,6 +88,7 @@ function validateEndpointMiddleware( break; case "Header": { + // @ts-ignore const result = await parameter.schema.safeParseAsync( req.get(parameter.name) ); diff --git a/packages/express/src/zodios.ts b/packages/express/src/zodios.ts index 02146ae7..91dcaabf 100644 --- a/packages/express/src/zodios.ts +++ b/packages/express/src/zodios.ts @@ -1,6 +1,11 @@ import express, { RouterOptions } from "express"; -import { ZodObject } from "zod"; -import { ZodiosEndpointDefinitions } from "@zodios/core"; +import { z } from "zod"; +import { + ZodiosEndpointDefinitions, + AnyZodiosTypeProvider, + ZodTypeProvider, + InferInputTypeFromSchema, +} from "@zodios/core"; import { Narrow } from "@zodios/core/lib/utils.types"; import { ZodiosApp, @@ -17,12 +22,18 @@ import { injectParametersValidators } from "./zodios-validator"; * @returns */ export function zodiosApp< + ContextSchema, Api extends ZodiosEndpointDefinitions = any, - Context extends ZodObject = ZodObject + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider >( api?: Narrow, - options: ZodiosAppOptions = {} -): ZodiosApp { + options: ZodiosAppOptions = {} +): ZodiosApp< + Api, + [unknown] extends [ContextSchema] + ? unknown + : InferInputTypeFromSchema +> { const { express: app = express(), enableJsonBodyParser = true, @@ -35,7 +46,7 @@ export function zodiosApp< if (api && validate) { injectParametersValidators(api, app, transform); } - return app as unknown as ZodiosApp; + return app as any; } /** @@ -46,17 +57,23 @@ export function zodiosApp< */ export function zodiosRouter< Api extends ZodiosEndpointDefinitions, - Context extends ZodObject = ZodObject + ContextSchema, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider >( api: Narrow, - options: RouterOptions & ZodiosRouterOptions = {} -): ZodiosRouter { + options: RouterOptions & ZodiosRouterOptions = {} +): ZodiosRouter< + Api, + [unknown] extends [ContextSchema] + ? unknown + : InferInputTypeFromSchema +> { const { validate = true, transform = false, ...routerOptions } = options; const router = options?.router ?? express.Router(routerOptions); if (validate) { injectParametersValidators(api, router, transform); } - return router as unknown as ZodiosRouter; + return router as any; } /** @@ -65,45 +82,80 @@ export function zodiosRouter< * @returns - a zodios app */ export function zodiosNextApp< + ContextSchema, Api extends ZodiosEndpointDefinitions = any, - Context extends ZodObject = ZodObject + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider >( api?: Narrow, - options: ZodiosAppOptions = {} -): ZodiosApp { + options: ZodiosAppOptions = {} +): ZodiosApp< + Api, + [unknown] extends [ContextSchema] + ? unknown + : InferInputTypeFromSchema +> { return zodiosApp(api, { ...options, enableJsonBodyParser: false, }); } -export class ZodiosContext> { - constructor(public context?: Context) {} +export class ZodiosContext< + ContextSchema, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +> { + constructor( + public context?: ContextSchema, + options?: { + typeProvider: TypeProvider; + } + ) {} app( api?: Narrow, - options: ZodiosAppOptions = {} - ): ZodiosApp { - return zodiosApp(api, options); + options?: ZodiosAppOptions + ): ZodiosApp< + Api, + [unknown] extends [ContextSchema] + ? unknown + : InferInputTypeFromSchema + > { + return zodiosApp(api, options); } nextApp( api?: Narrow, - options: ZodiosAppOptions = {} - ): ZodiosApp { - return zodiosNextApp(api, options); + options?: ZodiosAppOptions + ): ZodiosApp< + Api, + [unknown] extends [ContextSchema] + ? unknown + : InferInputTypeFromSchema + > { + return zodiosNextApp(api, options); } router( api: Narrow, - options?: RouterOptions & ZodiosRouterOptions - ): ZodiosRouter { - return zodiosRouter(api, options); + options?: RouterOptions & ZodiosRouterOptions + ): ZodiosRouter< + Api, + [unknown] extends [ContextSchema] + ? unknown + : InferInputTypeFromSchema + > { + return zodiosRouter(api, options); } } -export function zodiosContext = ZodObject>( - context?: Context -): ZodiosContext { - return new ZodiosContext(context); +export function zodiosContext< + ContextSchema, + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider +>( + context?: ContextSchema, + options?: { + typeProvider: TypeProvider; + } +): ZodiosContext { + return new ZodiosContext(context, options); } diff --git a/packages/express/src/zodios.types.ts b/packages/express/src/zodios.types.ts index 581feed1..42a6e6ef 100644 --- a/packages/express/src/zodios.types.ts +++ b/packages/express/src/zodios.types.ts @@ -1,4 +1,4 @@ -import express from "express"; +import express, { Request } from "express"; import { ZodiosEndpointDefinitions, ZodiosEndpointDefinition, @@ -10,7 +10,7 @@ import { ZodiosPathParamsByPath, Method, } from "@zodios/core"; -import { IfEquals } from "@zodios/core/lib/utils.types"; +import { IfEquals, Merge } from "@zodios/core/lib/utils.types"; import { z, ZodAny, ZodObject } from "zod"; export type ZodiosSucessCodes = @@ -25,14 +25,13 @@ export type ZodiosSucessCodes = | 208 | 226; -export type WithZodiosContext< - T, - Context extends ZodObject -> = Context extends ZodAny ? T : T & z.infer; +export type WithZodiosContext = T & Context; + +type Test = WithZodiosContext; export interface ZodiosRequestHandler< Api extends ZodiosEndpointDefinitions, - Context extends ZodObject, + Context, M extends Method, Path extends ZodiosPathsByMethod, ReqPath = ZodiosPathParamsByPath, @@ -64,9 +63,7 @@ export interface ZodiosRequestHandler< ): void; } -export interface ZodiosRouterContextRequestHandler< - Context extends ZodObject -> { +export interface ZodiosRouterContextRequestHandler { ( req: WithZodiosContext, res: express.Response, @@ -76,7 +73,7 @@ export interface ZodiosRouterContextRequestHandler< export type ZodiosHandler< Router, - Context extends ZodObject, + Context, Api extends ZodiosEndpointDefinitions, M extends Method > = >( @@ -84,7 +81,7 @@ export type ZodiosHandler< ...handlers: Array> ) => Router; -export interface ZodiosUse> { +export interface ZodiosUse { use(...handlers: Array>): this; use(handlers: Array>): this; use( @@ -97,16 +94,13 @@ export interface ZodiosUse> { ): this; } -export interface ZodiosHandlers< - Api extends ZodiosEndpointDefinitions, - Context extends ZodObject -> extends ZodiosUse { +export interface ZodiosHandlers + extends ZodiosUse { get: ZodiosHandler; post: ZodiosHandler; put: ZodiosHandler; patch: ZodiosHandler; delete: ZodiosHandler; - options: ZodiosHandler; head: ZodiosHandler; } @@ -121,7 +115,7 @@ export interface ZodiosValidationOptions { transform?: boolean; } -export interface ZodiosAppOptions> +export interface ZodiosAppOptions extends ZodiosValidationOptions { /** * express app intance - default is express() @@ -131,21 +125,21 @@ export interface ZodiosAppOptions> * enable express json body parser - default is true */ enableJsonBodyParser?: boolean; - context?: Context; + context?: ContextSchema; } -export interface ZodiosRouterOptions> +export interface ZodiosRouterOptions extends ZodiosValidationOptions { /** * express router instance - default is express.Router */ router?: ReturnType; - context?: Context; + context?: ContextSchema; } export type ZodiosApp< Api extends ZodiosEndpointDefinitions, - Context extends ZodObject + Context > = IfEquals< Api, any, @@ -156,7 +150,7 @@ export type ZodiosApp< export type ZodiosRouter< Api extends ZodiosEndpointDefinitions, - Context extends ZodObject + Context > = IfEquals< Api, any, From 8fe90ef3f464f56cbef72de96387b6384d09a060 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Thu, 2 Feb 2023 13:43:29 +0100 Subject: [PATCH 117/206] test: dix flacky tests --- packages/axios/src/zodios.test.ts | 29 ------------------- packages/core/src/zodios.test.ts | 36 ------------------------ packages/express/src/zodios-validator.ts | 5 ++++ packages/fetch/src/zodios.test.ts | 29 ------------------- 4 files changed, 5 insertions(+), 94 deletions(-) diff --git a/packages/axios/src/zodios.test.ts b/packages/axios/src/zodios.test.ts index 50f785f4..4a5491bb 100644 --- a/packages/axios/src/zodios.test.ts +++ b/packages/axios/src/zodios.test.ts @@ -852,35 +852,6 @@ received: expect(response).toEqual({ id: "4", name: "post" }); }); - it("should send a form data request a second time under 100 ms", async () => { - const zodios = new Zodios(`http://localhost:${port}`, [ - { - method: "post", - path: "/form-data", - requestFormat: "form-data", - parameters: [ - { - name: "body", - type: "Body", - schema: z.object({ - id: z.string(), - name: z.string(), - }), - }, - ], - response: z.object({ - id: z.string(), - name: z.string(), - }), - }, - ]); - const response = await zodios.post("/form-data", { - // @ts-ignore - body: { id: "4", name: "post" }, - }); - expect(response).toEqual({ id: "4", name: "post" }); - }, 100); - it("should not send an array as form data request", async () => { const zodios = new Zodios(`http://localhost:${port}`, [ { diff --git a/packages/core/src/zodios.test.ts b/packages/core/src/zodios.test.ts index ff1c49ac..a72a8558 100644 --- a/packages/core/src/zodios.test.ts +++ b/packages/core/src/zodios.test.ts @@ -1398,42 +1398,6 @@ describe("Zodios", () => { expect(response).toEqual({ id: "4", name: "post" }); }); - it("should send a form data request a second time under 100 ms", async () => { - const zodios = new ZodiosCore( - `http://localhost`, - [ - { - method: "post", - path: "/form-data", - requestFormat: "form-data", - parameters: [ - { - name: "body", - type: "Body", - schema: z.object({ - id: z.string(), - name: z.string(), - }), - }, - ], - response: z.object({ - id: z.string(), - name: z.string(), - }), - }, - ], - { fetcherFactory: mockFetchFactory } - ); - const response = await zodios.post("/form-data", { - body: { id: "4", name: "post" }, - }); - const testResonseType: Assert< - typeof response, - { id: string; name: string } - > = true; - expect(response).toEqual({ id: "4", name: "post" }); - }, 100); - it("should not send an array as form data request", async () => { const zodios = new ZodiosCore( `http://localhost`, diff --git a/packages/express/src/zodios-validator.ts b/packages/express/src/zodios-validator.ts index f67dd036..fb9ed271 100644 --- a/packages/express/src/zodios-validator.ts +++ b/packages/express/src/zodios-validator.ts @@ -40,6 +40,11 @@ function validateEndpointMiddleware( for (let parameter of endpoint.parameters!) { let schema = parameter.schema; + if (!transform) { + // @ts-ignore + schema = withoutTransform(schema); + } + switch (parameter.type) { case "Body": { diff --git a/packages/fetch/src/zodios.test.ts b/packages/fetch/src/zodios.test.ts index 407d94d0..861003f6 100644 --- a/packages/fetch/src/zodios.test.ts +++ b/packages/fetch/src/zodios.test.ts @@ -967,35 +967,6 @@ received: expect(response).toEqual({ id: "4", name: "post" }); }); - it("should send a form data request a second time under 100 ms", async () => { - const zodios = new Zodios(`http://localhost:${port}`, [ - { - method: "post", - path: "/form-data", - requestFormat: "form-data", - parameters: [ - { - name: "body", - type: "Body", - schema: z.object({ - id: z.string(), - name: z.string(), - }), - }, - ], - response: z.object({ - id: z.string(), - name: z.string(), - }), - }, - ]); - const response = await zodios.post("/form-data", { - // @ts-ignore - body: { id: "4", name: "post" }, - }); - expect(response).toEqual({ id: "4", name: "post" }); - }, 100); - it("should not send an array as form data request", async () => { const zodios = new Zodios(`http://localhost:${port}`, [ { From 6610c249e15d485bf7e96fb90cbb02184697fbe3 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Mon, 6 Feb 2023 23:39:44 +0100 Subject: [PATCH 118/206] feat(inference): use nex const keywork for generics instead of custom Narrow --- examples/next/package.json | 2 +- package.json | 2 +- packages/axios/package.json | 2 +- packages/axios/src/zodios.ts | 11 +- packages/core/examples/jsonplaceholder.ts | 2 +- packages/core/package.json | 2 +- packages/core/src/api.ts | 52 ++++--- packages/core/src/utils.types.ts | 53 +++---- packages/core/src/zodios.test.ts | 141 +++++++++++++----- packages/core/src/zodios.ts | 31 ++-- packages/core/src/zodios.types.ts | 96 +++++++----- packages/express/package.json | 2 +- .../src/type-providers/zod.type-provider.ts | 10 ++ packages/fetch/package.json | 2 +- packages/fetch/src/zodios.ts | 11 +- packages/react/package.json | 2 +- packages/testing/package.json | 2 +- pnpm-lock.yaml | 100 ++++++------- 18 files changed, 308 insertions(+), 215 deletions(-) create mode 100644 packages/express/src/type-providers/zod.type-provider.ts diff --git a/examples/next/package.json b/examples/next/package.json index b1aa3d68..60a8d794 100644 --- a/examples/next/package.json +++ b/examples/next/package.json @@ -27,6 +27,6 @@ "@types/react-dom": "18.0.10", "eslint": "8.32.0", "eslint-config-next": "12.2.5", - "typescript": "4.9.4" + "typescript": "5.0.0-dev.20230205" } } diff --git a/package.json b/package.json index 6e9c9b19..a09cb017 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,6 @@ "devDependencies": { "@changesets/cli": "2.25.2", "turbo": "1.6.3", - "typescript": "4.9.4" + "typescript": "5.0.0-dev.20230205" } } diff --git a/packages/axios/package.json b/packages/axios/package.json index b80c76eb..a6c28530 100644 --- a/packages/axios/package.json +++ b/packages/axios/package.json @@ -76,7 +76,7 @@ "ts-jest": "29.0.3", "ts-node": "10.9.1", "tsup": "6.3.0", - "typescript": "4.9.4", + "typescript": "5.0.0-dev.20230205", "zod": "3.20.1" } } diff --git a/packages/axios/src/zodios.ts b/packages/axios/src/zodios.ts index 12d961cb..8575da19 100644 --- a/packages/axios/src/zodios.ts +++ b/packages/axios/src/zodios.ts @@ -1,6 +1,5 @@ -import { Narrow } from "@zodios/core/lib/utils.types"; import type { - ZodiosEndpointDefinitions, + ZodiosEndpointDefinition, ZodiosOptions, AnyZodiosTypeProvider, TypeOfFetcherOptions, @@ -33,10 +32,10 @@ const ZodiosAxios = new Proxy(ZodiosCore, { export interface Zodios { new < - Api extends ZodiosEndpointDefinitions, + const Api extends ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider >( - api: Narrow, + api: Api, options?: Omit< ZodiosOptions, "fetcherFactory" @@ -44,11 +43,11 @@ export interface Zodios { TypeOfFetcherOptions ): ZodiosInstance; new < - Api extends ZodiosEndpointDefinitions, + const Api extends ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider >( baseUrl: string, - api: Narrow, + api: Api, options?: Omit< ZodiosOptions, "fetcherFactory" diff --git a/packages/core/examples/jsonplaceholder.ts b/packages/core/examples/jsonplaceholder.ts index d4d08b20..568cfee6 100644 --- a/packages/core/examples/jsonplaceholder.ts +++ b/packages/core/examples/jsonplaceholder.ts @@ -42,7 +42,7 @@ async function bootstrap() { path: "/users/:id", alias: "deleteUser", description: "Delete a user", - response: z.object({ }), + response: z.object({}), }, { method: "post", diff --git a/packages/core/package.json b/packages/core/package.json index a8bedcc0..11011f8a 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -73,7 +73,7 @@ "ts-jest": "29.0.3", "ts-node": "10.9.1", "tsup": "6.3.0", - "typescript": "4.9.4", + "typescript": "5.0.0-dev.20230205", "zod": "3.20.1" } } diff --git a/packages/core/src/api.ts b/packages/core/src/api.ts index f7a341a5..8a99f74e 100644 --- a/packages/core/src/api.ts +++ b/packages/core/src/api.ts @@ -1,10 +1,8 @@ import type { ZodiosEndpointDefinition, ZodiosEndpointParameter, - ZodiosEndpointDefinitions, ZodiosEndpointError, } from "./zodios.types"; -import type { Narrow } from "./utils.types"; /** * check api for non unique paths @@ -12,8 +10,9 @@ import type { Narrow } from "./utils.types"; * @return - nothing * @throws - error if api has non unique paths */ -export function checkApi(api: T) { - // check if no duplicate path +export function checkApi( + api: T +) { const paths = new Set(); for (let endpoint of api) { const fullpath = `${endpoint.method} ${endpoint.path}`; @@ -53,13 +52,21 @@ export function checkApi(api: T) { * @param api - api definitions * @returns the api definitions */ -export function makeApi( - api: Narrow +export function makeApi( + api: Api ): Api { checkApi(api); - return api as Api; + return api; } +const test = makeApi([ + { + method: "get", + path: "/test", + response: {}, + }, +]); + /** * Simple helper to split your parameter definitions into multiple files * Mandatory to be used when declaring parameters appart from your endpoint definitions @@ -68,9 +75,9 @@ export function makeApi( * @returns the api parameter definitions */ export function makeParameters< - ParameterDescriptions extends ZodiosEndpointParameter[] ->(params: Narrow): ParameterDescriptions { - return params as ParameterDescriptions; + const ParameterDescriptions extends readonly ZodiosEndpointParameter[] +>(params: ParameterDescriptions) { + return params; } export function parametersBuilder() { @@ -182,10 +189,10 @@ class ParametersBuilder { * @param errors - api error definitions * @returns the error definitions */ -export function makeErrors( - errors: Narrow -): ErrorDescription { - return errors as ErrorDescription; +export function makeErrors< + const ErrorDescription extends readonly ZodiosEndpointError[] +>(errors: ErrorDescription) { + return errors; } /** @@ -195,14 +202,15 @@ export function makeErrors( * @param endpoint - api endpoint definition * @returns the endpoint definition */ -export function makeEndpoint( - endpoint: Narrow -): T { - return endpoint as T; +export function makeEndpoint< + const EndpointDescription extends ZodiosEndpointDefinition +>(endpoint: EndpointDescription) { + return endpoint; } -export class Builder { + +export class Builder { constructor(private api: T) {} - addEndpoint(endpoint: Narrow) { + addEndpoint(endpoint: E) { return new Builder<[...T, E]>([...this.api, endpoint] as [...T, E]); } build(): T { @@ -217,8 +225,8 @@ export class Builder { * @param endpoint * @returns - a builder to build your api definitions */ -export function apiBuilder( - endpoint: Narrow +export function apiBuilder( + endpoint: T ): Builder<[T]> { return new Builder([endpoint] as [T]); } diff --git a/packages/core/src/utils.types.ts b/packages/core/src/utils.types.ts index a541f606..5b814140 100644 --- a/packages/core/src/utils.types.ts +++ b/packages/core/src/utils.types.ts @@ -5,15 +5,24 @@ * @details - this is using tail recursion type optimization from typescript 4.5 */ export type FilterArrayByValue< - T extends unknown[] | undefined, + T extends readonly unknown[] | unknown[] | undefined, C, Acc extends unknown[] = [] -> = T extends [infer Head, ...infer Tail] +> = T extends readonly [infer Head, ...infer Tail] + ? Head extends C + ? FilterArrayByValue + : FilterArrayByValue + : T extends [infer Head, ...infer Tail] ? Head extends C ? FilterArrayByValue : FilterArrayByValue : Acc; +type Test = FilterArrayByValue< + readonly [{ hello: "world"; world: "hello" }, { hello: "world" }], + { hello: "world" } +>; + /** * filter an array type by key * @param T - array type @@ -21,10 +30,14 @@ export type FilterArrayByValue< * @details - this is using tail recursion type optimization from typescript 4.5 */ export type FilterArrayByKey< - T extends unknown[], + T extends readonly unknown[] | unknown[], K extends string, Acc extends unknown[] = [] -> = T extends [infer Head, ...infer Tail] +> = T extends readonly [infer Head, ...infer Tail] + ? Head extends { [Key in K]: unknown } + ? FilterArrayByKey + : FilterArrayByKey + : T extends [infer Head, ...infer Tail] ? Head extends { [Key in K]: unknown } ? FilterArrayByKey : FilterArrayByKey @@ -36,38 +49,18 @@ export type FilterArrayByKey< * @details - this is using tail recursion type optimization from typescript 4.5 */ export type DefinedArray< - T extends unknown[], + T extends readonly unknown[] | unknown[], Acc extends unknown[] = [] -> = T extends [infer Head, ...infer Tail] +> = T extends readonly [infer Head, ...infer Tail] + ? Head extends undefined + ? DefinedArray + : DefinedArray + : T extends [infer Head, ...infer Tail] ? Head extends undefined ? DefinedArray : DefinedArray : Acc; -type Try = A extends B ? A : C; - -type NarrowRaw = - | (T extends Function ? T : never) - | (T extends string | number | bigint | boolean ? T : never) - | (T extends [] ? [] : never) - | { - [K in keyof T]: K extends "description" ? T[K] : NarrowNotSchema; - }; - -type NarrowNotSchema = Try< - T, - { parse: (...args: any[]) => any } | { validate: (...args: any[]) => any }, - NarrowRaw ->; - -/** - * Utility to infer the embedded primitive type of any type - * Same as `as const` but without setting the object as readonly and without needing the user to use it - * @param T - type to infer the embedded type of - * @see - thank you tannerlinsley for this idea - */ -export type Narrow = Try>; - /** * merge all union types into a single type * @param T - union type diff --git a/packages/core/src/zodios.test.ts b/packages/core/src/zodios.test.ts index a72a8558..3029da53 100644 --- a/packages/core/src/zodios.test.ts +++ b/packages/core/src/zodios.test.ts @@ -37,6 +37,12 @@ import { apiBuilder, setFetcherHook, clearFetcherHook, + makeApi, + makeParameters, + ApiOf, + ZodTypeProvider, + TypeOfFetcherError, + InferOutputTypeFromSchema, } from "./index"; import type { @@ -46,6 +52,19 @@ import type { ZodiosFetcherFactory, } from "./index"; import type { Assert } from "./utils.types"; +import { + InferFetcherErrors, + ZodiosEndpointDefinitionByPath, + ZodiosMatchingErrorsByPath, +} from "./zodios.types"; + +interface MockError { + status: S; + response: { + status: S; + data: T; + }; +} interface MockProvider extends AnyZodiosFetcherProvider { options: {}; @@ -58,7 +77,7 @@ interface MockProvider extends AnyZodiosFetcherProvider { responseType?: "arraybuffer" | "blob" | "json" | "text" | "stream"; }; response: unknown; - error: unknown; + error: MockError; } const mockFetchFactory: ZodiosFetcherFactory = (options) => ({ @@ -396,6 +415,17 @@ describe("Zodios", () => { }); it("should register a plugin by endpoint", () => { + const api = makeApi([ + { + method: "get", + path: "/:id", + response: z.object({ + id: z.number(), + name: z.string(), + }), + }, + ]); + const zodios = new ZodiosCore(`http://localhost`, [ { method: "get", @@ -475,6 +505,32 @@ describe("Zodios", () => { }); it("should make an http get with standard query arrays", async () => { + const api = makeApi([ + { + method: "get", + path: "/queries", + parameters: makeParameters([ + { + name: "id", + type: "Query", + schema: z.array(z.number()), + }, + ]), + response: z.object({ + queries: z.array(z.string()), + }), + }, + { + method: "get", + path: "/users", + response: z.array( + z.object({ + id: z.number(), + name: z.string(), + }) + ), + }, + ]); const zodios = new ZodiosCore( `http://localhost`, [ @@ -1071,48 +1127,65 @@ describe("Zodios", () => { }); it("should match Expected error", async () => { - const zodios = new ZodiosCore(`http://localhost`, [ - { - method: "get", - alias: "getError502", - path: "/error502", - response: z.void(), - errors: [ - { - status: 502, - schema: z.object({ - error: z.object({ - message: z.string(), + const zodios = new ZodiosCore( + `http://localhost`, + [ + { + method: "get", + alias: "getError502", + path: "/error502", + response: z.void(), + errors: [ + { + status: 502, + schema: z.object({ + error: z.object({ + message: z.string(), + }), }), - }), - }, - { - status: 401, - schema: z.object({ - error: z.object({ - message: z.string(), - _401: z.literal(true), + }, + { + status: 401, + schema: z.object({ + error: z.object({ + message: z.string(), + _401: z.literal(true), + }), }), - }), - }, - { - status: "default", - schema: z.object({ - error: z.object({ - message: z.string(), - _default: z.literal(true), + }, + { + status: "default", + schema: z.object({ + error: z.object({ + message: z.string(), + _default: z.literal(true), + }), }), - }), - }, - ], - }, - ]); + }, + ], + }, + ], + { fetcherFactory: mockFetchFactory } + ); let error; try { await zodios.get("/error502"); } catch (e) { error = e; } + type Test = ZodiosMatchingErrorsByPath< + ApiOf, + "get", + "/error502", + MockProvider, + ZodTypeProvider + >; + type Test2 = ZodiosEndpointDefinitionByPath< + ApiOf, + "get", + "/error502" + >[number]["errors"]; + expect(error).toBeInstanceOf(Error); // @ts-ignore expect(error.response?.status).toBe(502); diff --git a/packages/core/src/zodios.ts b/packages/core/src/zodios.ts index a6dcac56..4141302c 100644 --- a/packages/core/src/zodios.ts +++ b/packages/core/src/zodios.ts @@ -5,7 +5,7 @@ import type { ZodiosPathsByMethod, ZodiosResponseByPath, ZodiosOptions, - ZodiosEndpointDefinitions, + ZodiosEndpointDefinition, ZodiosAliases, ZodiosPlugin, Aliases, @@ -22,12 +22,7 @@ import { formURLPlugin, headerPlugin, } from "./plugins"; -import type { - Narrow, - PickRequired, - ReadonlyDeep, - RequiredKeys, -} from "./utils.types"; +import type { PickRequired, ReadonlyDeep } from "./utils.types"; import { checkApi } from "./api"; import type { AnyZodiosTypeProvider, ZodTypeProvider } from "./type-providers"; import { zodTypeProvider } from "./type-providers"; @@ -50,7 +45,7 @@ import { } from "./plugins/zodios-plugins.types"; export interface ZodiosBase< - Api extends ZodiosEndpointDefinitions, + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], FetcherProvider extends AnyZodiosFetcherProvider, TypeProvider extends AnyZodiosTypeProvider > { @@ -63,7 +58,7 @@ export interface ZodiosBase< * zodios api client */ export class ZodiosCoreImpl< - Api extends ZodiosEndpointDefinitions, + const Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], FetcherProvider extends AnyZodiosFetcherProvider, TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider > implements ZodiosBase @@ -106,13 +101,13 @@ export class ZodiosCoreImpl< * ]); */ constructor( - api: Narrow, + api: Api, options?: ZodiosOptions & TypeOfFetcherOptions ); constructor( baseUrl: string, - api: Narrow, + api: Api, options?: ZodiosOptions & TypeOfFetcherOptions ); @@ -136,10 +131,10 @@ export class ZodiosCoreImpl< let baseURL: string | undefined; if (typeof arg1 === "string" && Array.isArray(arg2)) { baseURL = arg1; - this.api = arg2; + this.api = arg2 as any; options = arg3 || {}; } else if (Array.isArray(arg1) && !Array.isArray(arg2)) { - this.api = arg1; + this.api = arg1 as any; options = arg2 || {}; } else { throw new Error("Zodios: api must be an array"); @@ -452,7 +447,7 @@ export class ZodiosCoreImpl< } export type ZodiosInstance< - Api extends ZodiosEndpointDefinitions, + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], FetcherProvider extends AnyZodiosFetcherProvider, TypeProvider extends AnyZodiosTypeProvider > = ZodiosCoreImpl & @@ -461,21 +456,21 @@ export type ZodiosInstance< export interface ZodiosCore { new < - Api extends ZodiosEndpointDefinitions, + const Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], FetcherProvider extends AnyZodiosFetcherProvider, TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider >( - api: Narrow, + api: Api, options?: ZodiosOptions & TypeOfFetcherOptions ): ZodiosInstance; new < - Api extends ZodiosEndpointDefinitions, + const Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], FetcherProvider extends AnyZodiosFetcherProvider, TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider >( baseUrl: string, - api: Narrow, + api: Api, options?: ZodiosOptions & TypeOfFetcherOptions ): ZodiosInstance; diff --git a/packages/core/src/zodios.types.ts b/packages/core/src/zodios.types.ts index 4da462ce..e43283b1 100644 --- a/packages/core/src/zodios.types.ts +++ b/packages/core/src/zodios.types.ts @@ -50,30 +50,29 @@ export type RequestFormat = | "text"; // for text data type EndpointDefinitionsByMethod< - Api extends ZodiosEndpointDefinition[], + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], M extends Method > = FilterArrayByValue; export type ZodiosEndpointDefinitionByPath< - Api extends ZodiosEndpointDefinition[], + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], M extends Method, Path extends ZodiosPathsByMethod > = FilterArrayByValue; export type ZodiosEndpointDefinitionByAlias< - Api extends ZodiosEndpointDefinition[], + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], Alias extends string > = FilterArrayByValue; export type ZodiosPathsByMethod< - Api extends ZodiosEndpointDefinition[], + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], M extends Method > = EndpointDefinitionsByMethod[number]["path"]; -export type Aliases = FilterArrayByKey< - Api, - "alias" ->[number]["alias"]; +export type Aliases< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[] +> = FilterArrayByKey[number]["alias"]; export type ZodiosResponseForEndpoint< Endpoint extends ZodiosEndpointDefinition, @@ -84,7 +83,7 @@ export type ZodiosResponseForEndpoint< : InferInputTypeFromSchema; export type ZodiosResponseByPath< - Api extends ZodiosEndpointDefinition[], + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], M extends Method, Path extends ZodiosPathsByMethod, Frontend extends boolean = true, @@ -100,7 +99,7 @@ export type ZodiosResponseByPath< >; export type ZodiosResponseByAlias< - Api extends ZodiosEndpointDefinition[], + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], Alias extends string, Frontend extends boolean = true, TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider @@ -124,7 +123,7 @@ export type ZodiosDefaultErrorForEndpoint< >[number]["schema"]; type ZodiosDefaultErrorByPath< - Api extends ZodiosEndpointDefinition[], + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], M extends Method, Path extends ZodiosPathsByMethod > = FilterArrayByValue< @@ -135,7 +134,7 @@ type ZodiosDefaultErrorByPath< >[number]["schema"]; type ZodiosDefaultErrorByAlias< - Api extends ZodiosEndpointDefinition[], + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], Alias extends string > = FilterArrayByValue< ZodiosEndpointDefinitionByAlias[number]["errors"], @@ -178,7 +177,7 @@ export type ZodiosErrorForEndpoint< >; export type ZodiosErrorByPath< - Api extends ZodiosEndpointDefinition[], + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], M extends Method, Path extends ZodiosPathsByMethod, Status extends number, @@ -211,7 +210,7 @@ export type ZodiosErrorByPath< >; export type ZodiosErrorsByPath< - Api extends ZodiosEndpointDefinition[], + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], M extends Method, Path extends ZodiosPathsByMethod, Frontend extends boolean = true, @@ -235,7 +234,7 @@ export type ZodiosErrorsByPath< >; export type ZodiosErrorsByAlias< - Api extends ZodiosEndpointDefinition[], + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], M extends Method, Path extends ZodiosPathsByMethod, Frontend extends boolean = true, @@ -251,11 +250,30 @@ export type ZodiosErrorsByAlias< >; export type InferFetcherErrors< - T, + T extends readonly unknown[] | unknown[], TypeProvider extends AnyZodiosTypeProvider, FetcherProvider extends AnyZodiosFetcherProvider, Acc extends unknown[] = [] -> = T extends [infer Head, ...infer Tail] +> = T extends readonly [infer Head, ...infer Tail] + ? Head extends { + status: infer Status; + schema: infer Schema; + } + ? InferFetcherErrors< + Tail, + TypeProvider, + FetcherProvider, + [ + ...Acc, + TypeOfFetcherError< + FetcherProvider, + InferOutputTypeFromSchema, + Status + > + ] + > + : Acc + : T extends [infer Head, ...infer Tail] ? Head extends { status: infer Status; schema: infer Schema; @@ -277,7 +295,7 @@ export type InferFetcherErrors< : Acc; export type ZodiosMatchingErrorsByPath< - Api extends ZodiosEndpointDefinition[], + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], M extends Method, Path extends ZodiosPathsByMethod, FetcherProvider extends AnyZodiosFetcherProvider, @@ -289,7 +307,7 @@ export type ZodiosMatchingErrorsByPath< >[number]; export type ZodiosMatchingErrorsByAlias< - Api extends ZodiosEndpointDefinition[], + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], Alias extends string, FetcherProvider extends AnyZodiosFetcherProvider, TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider @@ -300,7 +318,7 @@ export type ZodiosMatchingErrorsByAlias< >[number]; export type ZodiosErrorByAlias< - Api extends ZodiosEndpointDefinition[], + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], Alias extends string, Status extends number, Frontend extends boolean = true, @@ -338,7 +356,7 @@ export type BodySchemaForEndpoint = >[number]["schema"]; export type BodySchema< - Api extends ZodiosEndpointDefinition[], + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], M extends Method, Path extends ZodiosPathsByMethod > = FilterArrayByValue< @@ -355,7 +373,7 @@ export type ZodiosBodyForEndpoint< : InferOutputTypeFromSchema>; export type ZodiosBodyByPath< - Api extends ZodiosEndpointDefinition[], + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], M extends Method, Path extends ZodiosPathsByMethod, Frontend extends boolean = true, @@ -365,7 +383,7 @@ export type ZodiosBodyByPath< : InferOutputTypeFromSchema>; export type BodySchemaByAlias< - Api extends ZodiosEndpointDefinition[], + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], Alias extends string > = FilterArrayByValue< ZodiosEndpointDefinitionByAlias[number]["parameters"], @@ -373,7 +391,7 @@ export type BodySchemaByAlias< >[number]["schema"]; export type ZodiosBodyByAlias< - Api extends ZodiosEndpointDefinition[], + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], Alias extends string, Frontend extends boolean = true, TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider @@ -429,7 +447,7 @@ export type ZodiosQueryParamsForEndpoint< >; export type ZodiosQueryParamsByPath< - Api extends ZodiosEndpointDefinition[], + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], M extends Method, Path extends ZodiosPathsByMethod, Frontend extends boolean = true, @@ -448,7 +466,7 @@ export type ZodiosQueryParamsByPath< >; export type ZodiosQueryParamsByAlias< - Api extends ZodiosEndpointDefinition[], + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], Alias extends string, Frontend extends boolean = true, TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider @@ -493,7 +511,7 @@ export type ZodiosPathParamsForEndpoint< * Get path params for a given endpoint by path */ export type ZodiosPathParamsByPath< - Api extends ZodiosEndpointDefinition[], + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], M extends Method, Path extends ZodiosPathsByMethod, Frontend extends boolean = true, @@ -516,7 +534,7 @@ export type ZodiosPathParamsByPath< * Get path params for a given endpoint by alias */ export type ZodiosPathParamByAlias< - Api extends ZodiosEndpointDefinition[], + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], Alias extends string, Frontend extends boolean = true, TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, @@ -551,7 +569,7 @@ export type ZodiosHeaderParamsForEndpoint< >; export type ZodiosHeaderParamsByPath< - Api extends ZodiosEndpointDefinition[], + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], M extends Method, Path extends ZodiosPathsByMethod, Frontend extends boolean = true, @@ -570,7 +588,7 @@ export type ZodiosHeaderParamsByPath< >; export type ZodiosHeaderParamsByAlias< - Api extends ZodiosEndpointDefinition[], + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], Alias extends string, Frontend extends boolean = true, TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider @@ -588,7 +606,7 @@ export type ZodiosHeaderParamsByAlias< >; export type ZodiosRequestOptionsByAlias< - Api extends ZodiosEndpointDefinition[], + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], Alias extends string, FetcherProvider extends AnyZodiosFetcherProvider, Frontend extends boolean = true, @@ -611,7 +629,7 @@ export type ZodiosAliasRequest = : (configOptions: ReadonlyDeep) => Promise; export type ZodiosAliases< - Api extends ZodiosEndpointDefinition[], + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], FetcherProvider extends AnyZodiosFetcherProvider, TypeProvider extends AnyZodiosTypeProvider > = { @@ -628,7 +646,7 @@ export type ZodiosAliases< }; type OptionalRequestOptionsByPathParameters< - Api extends ZodiosEndpointDefinition[], + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], M extends Method, Path extends ZodiosPathsByMethod, FetcherProvider extends AnyZodiosFetcherProvider, @@ -646,7 +664,7 @@ type OptionalRequestOptionsByPathParameters< : [config: ReadonlyDeep]; export type ZodiosVerbs< - Api extends ZodiosEndpointDefinition[], + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], FetcherProvider extends AnyZodiosFetcherProvider, TypeProvider extends AnyZodiosTypeProvider > = { @@ -685,7 +703,7 @@ export type AnyZodiosRequestOptions< * Get the request options for a given endpoint */ export type ZodiosRequestOptionsByPath< - Api extends ZodiosEndpointDefinition[], + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], M extends Method, Path extends ZodiosPathsByMethod, FetcherProvider extends AnyZodiosFetcherProvider, @@ -704,7 +722,7 @@ export type ZodiosRequestOptionsByPath< >; export type ZodiosRequestOptions< - Api extends ZodiosEndpointDefinitions, + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], M extends Method, Path extends ZodiosPathsByMethod, FetcherProvider extends AnyZodiosFetcherProvider, @@ -834,7 +852,7 @@ export interface ZodiosEndpointDefinition { /** * optional parameters of the endpoint */ - parameters?: Array; + parameters?: readonly ZodiosEndpointParameter[] | ZodiosEndpointParameter[]; /** * response of the endpoint * you can use zod `transform` to transform the value of the response before returning it @@ -852,11 +870,9 @@ export interface ZodiosEndpointDefinition { /** * optional errors of the endpoint - only usefull when using @zodios/express */ - errors?: Array; + errors?: readonly ZodiosEndpointError[] | ZodiosEndpointError[]; } -export type ZodiosEndpointDefinitions = ZodiosEndpointDefinition[]; - /** * Zodios plugin that can be used to intercept zodios requests and responses */ diff --git a/packages/express/package.json b/packages/express/package.json index cd05416d..618138e7 100644 --- a/packages/express/package.json +++ b/packages/express/package.json @@ -57,7 +57,7 @@ "ts-jest": "29.0.5", "ts-node": "10.9.1", "tsup": "6.3.0", - "typescript": "4.9.4", + "typescript": "5.0.0-dev.20230205", "zod": "3.20.2" }, "dependencies": {} diff --git a/packages/express/src/type-providers/zod.type-provider.ts b/packages/express/src/type-providers/zod.type-provider.ts new file mode 100644 index 00000000..813d8b4f --- /dev/null +++ b/packages/express/src/type-providers/zod.type-provider.ts @@ -0,0 +1,10 @@ +import type { ZodTypeProvider } from "@zodios/core"; +import { ZodiosExpressTypeProviderFactory } from "./type-provider.types"; +import z from "zod"; + +export const zodTypeFactory: ZodiosExpressTypeProviderFactory = + { + validate: (schema, input) => schema.safeParse(input), + validateAsync: (schema, input) => schema.safeParseAsync(input), + isSchemaBooleanOrNumber: (schema: any) => true, + }; diff --git a/packages/fetch/package.json b/packages/fetch/package.json index a5e46f32..bf80bf15 100644 --- a/packages/fetch/package.json +++ b/packages/fetch/package.json @@ -73,7 +73,7 @@ "ts-jest": "29.0.3", "ts-node": "10.9.1", "tsup": "6.3.0", - "typescript": "4.9.4", + "typescript": "5.0.0-dev.20230205", "zod": "3.20.1" } } diff --git a/packages/fetch/src/zodios.ts b/packages/fetch/src/zodios.ts index c20f1ae5..eb442921 100644 --- a/packages/fetch/src/zodios.ts +++ b/packages/fetch/src/zodios.ts @@ -1,6 +1,5 @@ -import { Narrow } from "@zodios/core/lib/utils.types"; import type { - ZodiosEndpointDefinitions, + ZodiosEndpointDefinition, ZodiosOptions, AnyZodiosTypeProvider, TypeOfFetcherOptions, @@ -33,10 +32,10 @@ const ZodiosFetch = new Proxy(ZodiosCore, { export interface Zodios { new < - Api extends ZodiosEndpointDefinitions, + const Api extends ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider >( - api: Narrow, + api: Api, options?: Omit< ZodiosOptions, "fetcherFactory" @@ -44,11 +43,11 @@ export interface Zodios { TypeOfFetcherOptions ): ZodiosInstance; new < - Api extends ZodiosEndpointDefinitions, + const Api extends ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider >( baseUrl: string, - api: Narrow, + api: Api, options?: Omit< ZodiosOptions, "fetcherFactory" diff --git a/packages/react/package.json b/packages/react/package.json index 8117cc97..08933d33 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -84,7 +84,7 @@ "ts-jest": "29.0.3", "ts-node": "10.9.1", "tsup": "6.3.0", - "typescript": "4.9.4", + "typescript": "5.0.0-dev.20230205", "zod": "3.20.1" }, "resolutions": { diff --git a/packages/testing/package.json b/packages/testing/package.json index 36cc6325..1fb72335 100644 --- a/packages/testing/package.json +++ b/packages/testing/package.json @@ -54,7 +54,7 @@ "ts-jest": "29.0.3", "ts-node": "10.9.1", "tsup": "6.3.0", - "typescript": "4.9.4", + "typescript": "5.0.0-dev.20230205", "zod": "3.20.1" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f551290b..f0ea55a8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,11 +6,11 @@ importers: specifiers: '@changesets/cli': 2.25.2 turbo: 1.6.3 - typescript: 4.9.4 + typescript: 5.0.0-dev.20230205 devDependencies: '@changesets/cli': 2.25.2 turbo: 1.6.3 - typescript: 4.9.4 + typescript: 5.0.0-dev.20230205 packages/axios: specifiers: @@ -31,7 +31,7 @@ importers: ts-jest: 29.0.3 ts-node: 10.9.1 tsup: 6.3.0 - typescript: 4.9.4 + typescript: 5.0.0-dev.20230205 zod: 3.20.1 devDependencies: '@jest/globals': 29.3.1 @@ -48,10 +48,10 @@ importers: jest: 29.3.0_odkjkoia5xunhxkdrka32ib6vi multer: 1.4.5-lts.1 rimraf: 3.0.2 - ts-jest: 29.0.3_ryjyofpljpjsyhyq2nzx6hq6ei - ts-node: 10.9.1_3v2cms72gsblw7jmali7btb3pu - tsup: 6.3.0_z6wznmtyb6ovnulj6iujpct7um - typescript: 4.9.4 + ts-jest: 29.0.3_cixpoxvmfq77ejdo75mal5jgae + ts-node: 10.9.1_clhlce22dgpvbyysh2qtwubany + tsup: 6.3.0_rsclq4gjaebnhigadcukiszgly + typescript: 5.0.0-dev.20230205 zod: 3.20.1 packages/core: @@ -68,7 +68,7 @@ importers: ts-jest: 29.0.3 ts-node: 10.9.1 tsup: 6.3.0 - typescript: 4.9.4 + typescript: 5.0.0-dev.20230205 zod: 3.20.1 devDependencies: '@jest/globals': 29.3.1 @@ -80,10 +80,10 @@ importers: io-ts: 2.2.20_fp-ts@2.13.1 jest: 29.3.0_odkjkoia5xunhxkdrka32ib6vi rimraf: 3.0.2 - ts-jest: 29.0.3_ryjyofpljpjsyhyq2nzx6hq6ei - ts-node: 10.9.1_3v2cms72gsblw7jmali7btb3pu - tsup: 6.3.0_z6wznmtyb6ovnulj6iujpct7um - typescript: 4.9.4 + ts-jest: 29.0.3_cixpoxvmfq77ejdo75mal5jgae + ts-node: 10.9.1_clhlce22dgpvbyysh2qtwubany + tsup: 6.3.0_rsclq4gjaebnhigadcukiszgly + typescript: 5.0.0-dev.20230205 zod: 3.20.1 packages/express: @@ -102,7 +102,7 @@ importers: ts-jest: 29.0.5 ts-node: 10.9.1 tsup: 6.3.0 - typescript: 4.9.4 + typescript: 5.0.0-dev.20230205 zod: 3.20.2 devDependencies: '@jest/globals': 29.3.1 @@ -116,10 +116,10 @@ importers: jest: 29.4.1_zfha7dvnw4nti6zkbsmhmn6xo4 rimraf: 4.1.2 supertest: 6.3.3 - ts-jest: 29.0.5_2nqegl6ju5oy2sctmmmle4ucam - ts-node: 10.9.1_awa2wsr5thmg3i7jqycphctjfq - tsup: 6.3.0_z6wznmtyb6ovnulj6iujpct7um - typescript: 4.9.4 + ts-jest: 29.0.5_xdoexkzcxvnpxfujj7xiclht6y + ts-node: 10.9.1_qnxvsc4w2i6fzzhpuqmc4ahcpm + tsup: 6.3.0_rsclq4gjaebnhigadcukiszgly + typescript: 5.0.0-dev.20230205 zod: 3.20.2 packages/fetch: @@ -141,7 +141,7 @@ importers: ts-jest: 29.0.3 ts-node: 10.9.1 tsup: 6.3.0 - typescript: 4.9.4 + typescript: 5.0.0-dev.20230205 zod: 3.20.1 devDependencies: '@jest/globals': 29.3.1 @@ -158,10 +158,10 @@ importers: jest: 29.3.0_odkjkoia5xunhxkdrka32ib6vi multer: 1.4.5-lts.1 rimraf: 3.0.2 - ts-jest: 29.0.3_ryjyofpljpjsyhyq2nzx6hq6ei - ts-node: 10.9.1_3v2cms72gsblw7jmali7btb3pu - tsup: 6.3.0_z6wznmtyb6ovnulj6iujpct7um - typescript: 4.9.4 + ts-jest: 29.0.3_cixpoxvmfq77ejdo75mal5jgae + ts-node: 10.9.1_clhlce22dgpvbyysh2qtwubany + tsup: 6.3.0_rsclq4gjaebnhigadcukiszgly + typescript: 5.0.0-dev.20230205 zod: 3.20.1 packages/react: @@ -196,7 +196,7 @@ importers: ts-jest: 29.0.3 ts-node: 10.9.1 tsup: 6.3.0 - typescript: 4.9.4 + typescript: 5.0.0-dev.20230205 zod: 3.20.1 devDependencies: '@jest/globals': 29.3.1 @@ -226,10 +226,10 @@ importers: react-dom: 18.2.0_react@18.2.0 react-test-renderer: 18.2.0_react@18.2.0 rimraf: 3.0.2 - ts-jest: 29.0.3_a67wnu7kur6t3xg6vztzc6sc5i - ts-node: 10.9.1_3v2cms72gsblw7jmali7btb3pu - tsup: 6.3.0_z6wznmtyb6ovnulj6iujpct7um - typescript: 4.9.4 + ts-jest: 29.0.3_aisf35gghjn2ysvpjfeucu6fri + ts-node: 10.9.1_clhlce22dgpvbyysh2qtwubany + tsup: 6.3.0_rsclq4gjaebnhigadcukiszgly + typescript: 5.0.0-dev.20230205 zod: 3.20.1 packages/testing: @@ -248,7 +248,7 @@ importers: ts-jest: 29.0.3 ts-node: 10.9.1 tsup: 6.3.0 - typescript: 4.9.4 + typescript: 5.0.0-dev.20230205 zod: 3.20.1 devDependencies: '@jest/globals': 29.3.1 @@ -262,10 +262,10 @@ importers: io-ts: 2.2.20_fp-ts@2.13.1 jest: 29.3.0_odkjkoia5xunhxkdrka32ib6vi rimraf: 3.0.2 - ts-jest: 29.0.3_ryjyofpljpjsyhyq2nzx6hq6ei - ts-node: 10.9.1_3v2cms72gsblw7jmali7btb3pu - tsup: 6.3.0_z6wznmtyb6ovnulj6iujpct7um - typescript: 4.9.4 + ts-jest: 29.0.3_cixpoxvmfq77ejdo75mal5jgae + ts-node: 10.9.1_clhlce22dgpvbyysh2qtwubany + tsup: 6.3.0_rsclq4gjaebnhigadcukiszgly + typescript: 5.0.0-dev.20230205 zod: 3.20.1 packages: @@ -3862,7 +3862,7 @@ packages: pretty-format: 29.4.1 slash: 3.0.0 strip-json-comments: 3.1.1 - ts-node: 10.9.1_3v2cms72gsblw7jmali7btb3pu + ts-node: 10.9.1_clhlce22dgpvbyysh2qtwubany transitivePeerDependencies: - supports-color dev: true @@ -3902,7 +3902,7 @@ packages: pretty-format: 29.4.1 slash: 3.0.0 strip-json-comments: 3.1.1 - ts-node: 10.9.1_3v2cms72gsblw7jmali7btb3pu + ts-node: 10.9.1_clhlce22dgpvbyysh2qtwubany transitivePeerDependencies: - supports-color dev: true @@ -3942,7 +3942,7 @@ packages: pretty-format: 29.4.1 slash: 3.0.0 strip-json-comments: 3.1.1 - ts-node: 10.9.1_awa2wsr5thmg3i7jqycphctjfq + ts-node: 10.9.1_qnxvsc4w2i6fzzhpuqmc4ahcpm transitivePeerDependencies: - supports-color dev: true @@ -5215,7 +5215,7 @@ packages: optional: true dependencies: lilconfig: 2.0.6 - ts-node: 10.9.1_3v2cms72gsblw7jmali7btb3pu + ts-node: 10.9.1_clhlce22dgpvbyysh2qtwubany yaml: 1.10.2 dev: true @@ -6005,7 +6005,7 @@ packages: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} dev: true - /ts-jest/29.0.3_a67wnu7kur6t3xg6vztzc6sc5i: + /ts-jest/29.0.3_aisf35gghjn2ysvpjfeucu6fri: resolution: {integrity: sha512-Ibygvmuyq1qp/z3yTh9QTwVVAbFdDy/+4BtIQR2sp6baF2SJU/8CKK/hhnGIDY2L90Az2jIqTwZPnN2p+BweiQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -6035,11 +6035,11 @@ packages: lodash.memoize: 4.1.2 make-error: 1.3.6 semver: 7.3.8 - typescript: 4.9.4 + typescript: 5.0.0-dev.20230205 yargs-parser: 21.1.1 dev: true - /ts-jest/29.0.3_ryjyofpljpjsyhyq2nzx6hq6ei: + /ts-jest/29.0.3_cixpoxvmfq77ejdo75mal5jgae: resolution: {integrity: sha512-Ibygvmuyq1qp/z3yTh9QTwVVAbFdDy/+4BtIQR2sp6baF2SJU/8CKK/hhnGIDY2L90Az2jIqTwZPnN2p+BweiQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -6069,11 +6069,11 @@ packages: lodash.memoize: 4.1.2 make-error: 1.3.6 semver: 7.3.8 - typescript: 4.9.4 + typescript: 5.0.0-dev.20230205 yargs-parser: 21.1.1 dev: true - /ts-jest/29.0.5_2nqegl6ju5oy2sctmmmle4ucam: + /ts-jest/29.0.5_xdoexkzcxvnpxfujj7xiclht6y: resolution: {integrity: sha512-PL3UciSgIpQ7f6XjVOmbi96vmDHUqAyqDr8YxzopDqX3kfgYtX1cuNeBjP+L9sFXi6nzsGGA6R3fP3DDDJyrxA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -6103,11 +6103,11 @@ packages: lodash.memoize: 4.1.2 make-error: 1.3.6 semver: 7.3.8 - typescript: 4.9.4 + typescript: 5.0.0-dev.20230205 yargs-parser: 21.1.1 dev: true - /ts-node/10.9.1_3v2cms72gsblw7jmali7btb3pu: + /ts-node/10.9.1_clhlce22dgpvbyysh2qtwubany: resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true peerDependencies: @@ -6133,12 +6133,12 @@ packages: create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 4.9.4 + typescript: 5.0.0-dev.20230205 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 dev: true - /ts-node/10.9.1_awa2wsr5thmg3i7jqycphctjfq: + /ts-node/10.9.1_qnxvsc4w2i6fzzhpuqmc4ahcpm: resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true peerDependencies: @@ -6164,12 +6164,12 @@ packages: create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 4.9.4 + typescript: 5.0.0-dev.20230205 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 dev: true - /tsup/6.3.0_z6wznmtyb6ovnulj6iujpct7um: + /tsup/6.3.0_rsclq4gjaebnhigadcukiszgly: resolution: {integrity: sha512-IaNQO/o1rFgadLhNonVKNCT2cks+vvnWX3DnL8sB87lBDqRvJXHENr5lSPJlqwplUlDxSwZK8dSg87rgBu6Emw==} engines: {node: '>=14'} hasBin: true @@ -6199,7 +6199,7 @@ packages: source-map: 0.8.0-beta.0 sucrase: 3.28.0 tree-kill: 1.2.2 - typescript: 4.9.4 + typescript: 5.0.0-dev.20230205 transitivePeerDependencies: - supports-color - ts-node @@ -6324,8 +6324,8 @@ packages: resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} dev: true - /typescript/4.9.4: - resolution: {integrity: sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg==} + /typescript/5.0.0-dev.20230205: + resolution: {integrity: sha512-2JheM588BM/CnAyWEw96WYKV1f0o+dBuh1iOgBdt7BmlYA2YkOe4SvzDWE/Zo3LULAh9TD9TLMtep7qC9LPJhQ==} engines: {node: '>=4.2.0'} hasBin: true dev: true From 4e68e0c5492172c49126f42ff51b3add90e0fc4a Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sat, 11 Feb 2023 18:15:02 +0100 Subject: [PATCH 119/206] feat(type-providers): improve version by not casting --- packages/core/examples/io-ts-types.ts | 4 +- packages/core/examples/typescript-types.ts | 4 +- .../{define-types.ts => zod-types.ts} | 4 +- .../src/fetcher-providers/mock-provider.ts | 130 +++++++++++++++++ .../src/type-providers/type-provider.io-ts.ts | 7 +- .../src/type-providers/type-provider.types.ts | 4 +- .../type-provider.typescript.ts | 11 +- .../src/type-providers/type-provider.zod.ts | 11 +- packages/core/src/zodios.test.ts | 137 +----------------- 9 files changed, 155 insertions(+), 157 deletions(-) rename packages/core/examples/{define-types.ts => zod-types.ts} (90%) create mode 100644 packages/core/src/fetcher-providers/mock-provider.ts diff --git a/packages/core/examples/io-ts-types.ts b/packages/core/examples/io-ts-types.ts index 9c34f6f1..41bf3ad8 100644 --- a/packages/core/examples/io-ts-types.ts +++ b/packages/core/examples/io-ts-types.ts @@ -6,8 +6,8 @@ import { ioTsTypeProvider, } from "../src/index"; import * as t from "io-ts"; -import { fetchProvider } from "../src/fetcher-providers"; import { FetcherProviderOf } from "../src/zodios"; +import { mockFetchFactory } from "../src/fetcher-providers/mock-provider"; // you can define schema before declaring the API to get back the type @@ -58,7 +58,7 @@ const jsonplaceholderApi = makeApi([ async function bootstrap() { const apiClient = new ZodiosCore(jsonplaceholderUrl, jsonplaceholderApi, { typeProvider: ioTsTypeProvider, - fetcherProvider: fetchProvider, + fetcherFactory: mockFetchFactory, }); type Api = ApiOf; diff --git a/packages/core/examples/typescript-types.ts b/packages/core/examples/typescript-types.ts index 14dfc4e0..1393c1a3 100644 --- a/packages/core/examples/typescript-types.ts +++ b/packages/core/examples/typescript-types.ts @@ -1,5 +1,5 @@ import { - Zodios, + ZodiosCore, makeApi, tsFnSchema, ApiOf, @@ -55,7 +55,7 @@ const jsonplaceholderApi = makeApi([ ]); async function bootstrap() { - const apiClient = new Zodios(jsonplaceholderUrl, jsonplaceholderApi, { + const apiClient = new ZodiosCore(jsonplaceholderUrl, jsonplaceholderApi, { typeProvider: tsTypeProvider, }); diff --git a/packages/core/examples/define-types.ts b/packages/core/examples/zod-types.ts similarity index 90% rename from packages/core/examples/define-types.ts rename to packages/core/examples/zod-types.ts index dfcf6e1e..40b58cc7 100644 --- a/packages/core/examples/define-types.ts +++ b/packages/core/examples/zod-types.ts @@ -1,4 +1,4 @@ -import { Zodios, makeApi } from "../src/index"; +import { ZodiosCore, makeApi } from "../src/index"; import { z } from "zod"; // you can define schema before declaring the API to get back the type @@ -48,7 +48,7 @@ const jsonplaceholderApi = makeApi([ // and then use them in your API async function bootstrap() { - const apiClient = new Zodios(jsonplaceholderUrl, jsonplaceholderApi); + const apiClient = new ZodiosCore(jsonplaceholderUrl, jsonplaceholderApi); const users = await apiClient.get("/users", { queries: { q: "Nicholas" } }); console.log(users); diff --git a/packages/core/src/fetcher-providers/mock-provider.ts b/packages/core/src/fetcher-providers/mock-provider.ts new file mode 100644 index 00000000..451c9698 --- /dev/null +++ b/packages/core/src/fetcher-providers/mock-provider.ts @@ -0,0 +1,130 @@ +import { setFetcherHook, clearFetcherHook } from "../index"; + +import type { + AnyZodiosFetcherProvider, + AnyZodiosRequestOptions, + ZodiosFetcherFactory, +} from "../index"; + +interface MockError { + status: S; + response: { + status: S; + data: T; + }; +} + +export interface MockProvider extends AnyZodiosFetcherProvider { + options: {}; + config: { + baseURL?: string; + body?: unknown; + auth?: { username: string; password: string }; + validateStatus?: (status: number) => boolean; + timeout?: number; + responseType?: "arraybuffer" | "blob" | "json" | "text" | "stream"; + }; + response: unknown; + error: MockError; +} + +export const mockFetchFactory: ZodiosFetcherFactory = ( + options +) => ({ + async fetch(config) { + const requestConfig = { + ...config, + baseURL: options?.baseURL, + }; + for (const [{ method, url }, callback] of registeredMocks) { + if (method === requestConfig.method && url === requestConfig.url) { + const result = { + status: 200, + statusText: "OK", + headers: {}, + data: {}, + ...(await callback(requestConfig)), + } as Required; + if ( + (config.validateStatus && !config.validateStatus(result.status)) || + result.status > 299 + ) { + const err = new Error( + `Request failed with status code ${result.status}` + ) as Error & { code: string; config: any; response: any }; + err.code = `ERR_STATUS_${result.status}`; + err.config = requestConfig; + err.response = result; + throw err; + } + return result; + } + } + throw new Error(`No mocks found for ${requestConfig.url}`); + }, +}); + +type MockResponse = { + readonly headers?: Record; + readonly status?: number; + readonly statusText?: string; + readonly data?: Data; +}; + +interface ZodiosMockBase { + install(): void; + uninstall(): void; + reset(): void; + mockRequest( + method: string, + path: string, + callback: ( + config: AnyZodiosRequestOptions + ) => Promise + ): void; + mockResponse(method: string, path: string, response: MockResponse): void; +} + +const registeredMocks = new Map< + { method: string; url: string }, + (config: AnyZodiosRequestOptions) => Promise +>(); + +export const zodiosMocks: ZodiosMockBase = { + install() { + const fetcher = mockFetchFactory(); + setFetcherHook(fetcher); + }, + uninstall() { + registeredMocks.clear(); + clearFetcherHook(); + }, + reset() { + registeredMocks.clear(); + }, + mockRequest( + method: string, + path: string, + callback: ( + config: AnyZodiosRequestOptions + ) => Promise + ) { + registeredMocks.set({ method, url: path }, callback); + }, + mockResponse(method: string, path: string, response: MockResponse) { + registeredMocks.set( + { + method, + url: path, + }, + () => + Promise.resolve({ + headers: {}, + data: {}, + status: 200, + statusText: "OK", + ...response, + }) + ); + }, +}; diff --git a/packages/core/src/type-providers/type-provider.io-ts.ts b/packages/core/src/type-providers/type-provider.io-ts.ts index 90a5f6bd..ded87caa 100644 --- a/packages/core/src/type-providers/type-provider.io-ts.ts +++ b/packages/core/src/type-providers/type-provider.io-ts.ts @@ -3,9 +3,10 @@ import { ZodiosRuntimeTypeProvider, } from "./type-provider.types"; -export interface IoTsTypeProvider extends AnyZodiosTypeProvider { - input: this["schema"] extends { _I: unknown } ? this["schema"]["_I"] : never; - output: this["schema"] extends { _O: unknown } ? this["schema"]["_O"] : never; +export interface IoTsTypeProvider + extends AnyZodiosTypeProvider<{ _A: unknown; _O: unknown }> { + input: this["schema"]["_A"]; + output: this["schema"]["_O"]; } export const ioTsTypeProvider: ZodiosRuntimeTypeProvider = { diff --git a/packages/core/src/type-providers/type-provider.types.ts b/packages/core/src/type-providers/type-provider.types.ts index 7bd4ac5f..8a7b9e14 100644 --- a/packages/core/src/type-providers/type-provider.types.ts +++ b/packages/core/src/type-providers/type-provider.types.ts @@ -1,5 +1,5 @@ -export interface AnyZodiosTypeProvider { - schema: unknown; +export interface AnyZodiosTypeProvider { + schema: Schema; input: unknown; output: unknown; } diff --git a/packages/core/src/type-providers/type-provider.typescript.ts b/packages/core/src/type-providers/type-provider.typescript.ts index e649fadb..5116ee36 100644 --- a/packages/core/src/type-providers/type-provider.typescript.ts +++ b/packages/core/src/type-providers/type-provider.typescript.ts @@ -46,13 +46,10 @@ export const tsFnSchema = ( }, }); -export interface TsTypeProvider extends AnyZodiosTypeProvider { - input: this["schema"] extends { _schema: unknown } - ? this["schema"]["_schema"] - : never; - output: this["schema"] extends { _schema: unknown } - ? this["schema"]["_schema"] - : never; +export interface TsTypeProvider + extends AnyZodiosTypeProvider<{ _schema: unknown }> { + input: this["schema"]["_schema"]; + output: this["schema"]["_schema"]; } /** diff --git a/packages/core/src/type-providers/type-provider.zod.ts b/packages/core/src/type-providers/type-provider.zod.ts index c8d88f03..447a3d81 100644 --- a/packages/core/src/type-providers/type-provider.zod.ts +++ b/packages/core/src/type-providers/type-provider.zod.ts @@ -3,13 +3,10 @@ import { ZodiosRuntimeTypeProvider, } from "./type-provider.types"; -export interface ZodTypeProvider extends AnyZodiosTypeProvider { - input: this["schema"] extends { _input: unknown } - ? this["schema"]["_input"] - : never; - output: this["schema"] extends { _output: unknown } - ? this["schema"]["_output"] - : never; +export interface ZodTypeProvider + extends AnyZodiosTypeProvider<{ _input: unknown; _output: unknown }> { + input: this["schema"]["_input"]; + output: this["schema"]["_output"]; } export const zodTypeProvider: ZodiosRuntimeTypeProvider = { diff --git a/packages/core/src/zodios.test.ts b/packages/core/src/zodios.test.ts index 3029da53..4ffab86c 100644 --- a/packages/core/src/zodios.test.ts +++ b/packages/core/src/zodios.test.ts @@ -35,149 +35,22 @@ import { ZodiosCore, ZodiosError, apiBuilder, - setFetcherHook, - clearFetcherHook, makeApi, makeParameters, ApiOf, ZodTypeProvider, - TypeOfFetcherError, - InferOutputTypeFromSchema, } from "./index"; -import type { - AnyZodiosFetcherProvider, - AnyZodiosRequestOptions, - ZodiosPlugin, - ZodiosFetcherFactory, -} from "./index"; import type { Assert } from "./utils.types"; import { - InferFetcherErrors, ZodiosEndpointDefinitionByPath, ZodiosMatchingErrorsByPath, } from "./zodios.types"; - -interface MockError { - status: S; - response: { - status: S; - data: T; - }; -} - -interface MockProvider extends AnyZodiosFetcherProvider { - options: {}; - config: { - baseURL?: string; - body?: unknown; - auth?: { username: string; password: string }; - validateStatus?: (status: number) => boolean; - timeout?: number; - responseType?: "arraybuffer" | "blob" | "json" | "text" | "stream"; - }; - response: unknown; - error: MockError; -} - -const mockFetchFactory: ZodiosFetcherFactory = (options) => ({ - async fetch(config) { - const requestConfig = { - ...config, - baseURL: options?.baseURL, - }; - for (const [{ method, url }, callback] of registeredMocks) { - if (method === requestConfig.method && url === requestConfig.url) { - const result = { - status: 200, - statusText: "OK", - headers: {}, - data: {}, - ...(await callback(requestConfig)), - } as Required; - if ( - (config.validateStatus && !config.validateStatus(result.status)) || - result.status > 299 - ) { - const err = new Error( - `Request failed with status code ${result.status}` - ) as Error & { code: string; config: any; response: any }; - err.code = `ERR_STATUS_${result.status}`; - err.config = requestConfig; - err.response = result; - throw err; - } - return result; - } - } - throw new Error(`No mocks found for ${requestConfig.url}`); - }, -}); - -type MockResponse = { - readonly headers?: Record; - readonly status?: number; - readonly statusText?: string; - readonly data?: Data; -}; - -interface ZodiosMockBase { - install(): void; - uninstall(): void; - reset(): void; - mockRequest( - method: string, - path: string, - callback: ( - config: AnyZodiosRequestOptions - ) => Promise - ): void; - mockResponse(method: string, path: string, response: MockResponse): void; -} - -const registeredMocks = new Map< - { method: string; url: string }, - (config: AnyZodiosRequestOptions) => Promise ->(); - -const zodiosMocks: ZodiosMockBase = { - install() { - const fetcher = mockFetchFactory(); - setFetcherHook(fetcher); - }, - uninstall() { - registeredMocks.clear(); - clearFetcherHook(); - }, - reset() { - registeredMocks.clear(); - }, - mockRequest( - method: string, - path: string, - callback: ( - config: AnyZodiosRequestOptions - ) => Promise - ) { - registeredMocks.set({ method, url: path }, callback); - }, - mockResponse(method: string, path: string, response: MockResponse) { - registeredMocks.set( - { - method, - url: path, - }, - () => - Promise.resolve({ - headers: {}, - data: {}, - status: 200, - statusText: "OK", - ...response, - }) - ); - }, -}; +import { + zodiosMocks, + MockProvider, + mockFetchFactory, +} from "./fetcher-providers/mock-provider"; describe("Zodios", () => { beforeAll(async () => { From cc5bb3c7c40495e3aa5fea4f7588e91f7f589ecf Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sun, 12 Mar 2023 13:28:01 +0100 Subject: [PATCH 120/206] feat(core): export mergeApis --- packages/core/src/api.test.ts | 454 +----------------------- packages/core/src/api.ts | 107 +----- packages/core/src/index.ts | 1 - packages/fetch/examples/define-types.ts | 4 +- 4 files changed, 24 insertions(+), 542 deletions(-) diff --git a/packages/core/src/api.test.ts b/packages/core/src/api.test.ts index 5012203d..0661a741 100644 --- a/packages/core/src/api.test.ts +++ b/packages/core/src/api.test.ts @@ -1,432 +1,12 @@ -import express from "express"; -import { AddressInfo } from "net"; import z from "zod"; -import { - makeApi, - makeCrudApi, - mergeApis, - Zodios, - parametersBuilder, -} from "./index"; -import { Assert } from "./utils.types"; +import { makeApi, mergeApis } from "./index"; +import { Assert, ReadonlyDeep } from "./utils.types"; const userSchema = z.object({ id: z.number(), name: z.string(), }); -describe("makeApi", () => { - it("should throw on duplicate path", () => { - expect(() => - makeApi([ - { - method: "get", - path: "/users", - alias: "getUsers", - description: "Get all users", - response: z.array(userSchema), - }, - { - method: "get", - path: "/users", - alias: "getUsers2", - description: "Get all users", - response: z.array(userSchema), - }, - ]) - ).toThrowError("Zodios: Duplicate path 'get /users'"); - }); - - it("should throw on duplicate alias", () => { - expect(() => - makeApi([ - { - method: "get", - path: "/users", - alias: "getUsers", - description: "Get all users", - response: z.array(userSchema), - }, - { - method: "get", - path: "/users2", - alias: "getUsers", - description: "Get all users", - response: z.array(userSchema), - }, - ]) - ).toThrowError("Zodios: Duplicate alias 'getUsers'"); - }); - - it("should throw on duplicate Body", () => { - expect(() => - makeApi([ - { - method: "post", - path: "/users", - alias: "createUser", - description: "Create a user", - parameters: [ - { - name: "first", - type: "Body", - description: "The object to create", - schema: userSchema.partial(), - }, - { - name: "second", - type: "Body", - description: "The object to create", - schema: userSchema.partial(), - }, - ], - response: userSchema, - }, - ]) - ).toThrowError("Zodios: Multiple body parameters in endpoint '/users'"); - }); - - it("should build with parameters (Path,Query,Body,Header)", () => { - // get users api with query filter for user name, and path parameter for user id and header parameter for user token - const optionalTrueSchema = z.boolean().default(true).optional(); - const partialUserSchema = userSchema.partial(); - const bearerSchema = z.string().transform((s) => `Bearer ${s}`); - const api = makeApi([ - { - method: "post", - path: "/users/:id", - alias: "createtUser", - description: "Create a user", - parameters: [ - { - name: "id", - type: "Path", - description: "The user id", - schema: z.number(), - }, - { - name: "homonyms", - type: "Query", - description: "Allow homonyms", - schema: optionalTrueSchema, - }, - { - name: "email", - type: "Query", - description: "create an email account for the user", - schema: optionalTrueSchema, - }, - { - name: "body", - type: "Body", - description: "The object to create", - schema: partialUserSchema, - }, - { - name: "Authorization", - type: "Header", - description: "The user token", - schema: bearerSchema, - }, - { - name: "x-custom-header", - type: "Header", - description: "A custom header", - schema: z.string(), - }, - ], - response: userSchema, - }, - ]); - // check narrowing works - const test: Assert< - typeof api, - [ - { - method: "post"; - path: "/users/:id"; - alias: "createtUser"; - description: "Create a user"; - parameters: [ - { - name: "id"; - type: "Path"; - description: string; - schema: z.ZodNumber; - }, - { - name: "homonyms"; - type: "Query"; - description: string; - schema: typeof optionalTrueSchema; - }, - { - name: "email"; - type: "Query"; - description: string; - schema: typeof optionalTrueSchema; - }, - { - name: "body"; - type: "Body"; - description: string; - schema: typeof partialUserSchema; - }, - { - name: "Authorization"; - type: "Header"; - description: string; - schema: typeof bearerSchema; - }, - { - name: "x-custom-header"; - type: "Header"; - description: string; - schema: z.ZodString; - } - ]; - response: typeof userSchema; - } - ] - > = true; - }); -}); - -describe("parametersBuilder", () => { - it("should build parameters (Path,Query,Body,Header)", () => { - // get users api with query filter for user name, and path parameter for user id and header parameter for user token - const optionalTrueSchema = z.boolean().default(true).optional(); - const partialUserSchema = userSchema.partial(); - const bearerSchema = z.string().transform((s) => `Bearer ${s}`); - - const parameters = parametersBuilder() - .addParameters("Path", { - id: z.number(), - }) - .addQueries({ - homonyms: optionalTrueSchema, - email: optionalTrueSchema, - }) - .addBody(partialUserSchema) - .addHeaders({ - Authorization: bearerSchema, - "x-custom-header": z.string(), - }) - .build(); - - const test: Assert< - typeof parameters[number], - | { - name: "id"; - type: "Path"; - description?: string; - schema: z.ZodNumber; - } - | { - name: "homonyms"; - type: "Query"; - description?: string; - schema: typeof optionalTrueSchema; - } - | { - name: "email"; - type: "Query"; - description?: string; - schema: typeof optionalTrueSchema; - } - | { - name: "body"; - type: "Body"; - description?: string; - schema: typeof partialUserSchema; - } - | { - name: "Authorization"; - type: "Header"; - description?: string; - schema: typeof bearerSchema; - } - | { - name: "x-custom-header"; - type: "Header"; - description?: string; - schema: z.ZodString; - } - > = true; - }); -}); - -describe("makeCrudApi", () => { - let app: express.Express; - let server: ReturnType; - let port: number; - - beforeAll(async () => { - app = express(); - app.use(express.json()); - app.get("/users", (req, res) => { - res.status(200).json([{ id: 1, name: "test" }]); - }); - app.get("/users/:id", (req, res) => { - res.status(200).json({ id: Number(req.params.id), name: "test" }); - }); - app.post("/users", (req, res) => { - res.status(200).json({ id: 1, name: "test" }); - }); - app.put("/users/:id", (req, res) => { - res.status(200).json({ id: Number(req.params.id), name: req.body.name }); - }); - app.patch("/users/:id", (req, res) => { - res.status(200).json({ id: Number(req.params.id), name: req.body.name }); - }); - app.delete("/users/:id", (req, res) => { - res.status(200).json({ id: Number(req.params.id), name: "test" }); - }); - server = app.listen(0); - port = (server.address() as AddressInfo).port; - }); - - afterAll(() => { - server.close(); - }); - - it("should create a CRUD api definition", () => { - const api = makeCrudApi("user", userSchema); - - const usersSchema = z.array(userSchema); - - type ExpectedGetEndpoint = { - method: "get"; - path: "/users"; - alias: "getUsers"; - description: "Get all users"; - response: typeof usersSchema; - }; - - // check narrowing works - const testGet: Assert = true; - - expect(JSON.stringify(api)).toEqual( - JSON.stringify([ - { - method: "get", - path: "/users", - alias: "getUsers", - description: "Get all users", - response: z.array(userSchema), - }, - { - method: "get", - path: "/users/:id", - alias: "getUser", - description: "Get a user", - response: userSchema, - }, - { - method: "post", - path: "/users", - alias: "createUser", - description: "Create a user", - parameters: [ - { - name: "body", - type: "Body", - description: "The object to create", - schema: userSchema.partial(), - }, - ], - response: userSchema, - }, - { - method: "put", - path: "/users/:id", - alias: "updateUser", - description: "Update a user", - parameters: [ - { - name: "body", - type: "Body", - description: "The object to update", - schema: userSchema, - }, - ], - response: userSchema, - }, - { - method: "patch", - path: "/users/:id", - alias: "patchUser", - description: "Patch a user", - parameters: [ - { - name: "body", - type: "Body", - description: "The object to patch", - schema: userSchema.partial(), - }, - ], - response: userSchema, - }, - { - method: "delete", - path: "/users/:id", - alias: "deleteUser", - description: "Delete a user", - response: userSchema, - }, - ]) - ); - }); - - it("should get one user", async () => { - const api = makeCrudApi("user", userSchema); - const client = new Zodios(`http://localhost:${port}`, api); - const user = await client.getUser({ params: { id: 1 } }); - expect(user).toEqual({ id: 1, name: "test" }); - }); - - it("should get all users", async () => { - const api = makeCrudApi("user", userSchema); - const client = new Zodios(`http://localhost:${port}`, api); - const users = await client.getUsers(); - expect(users).toEqual([{ id: 1, name: "test" }]); - }); - - it("should create a user", async () => { - const api = makeCrudApi("user", userSchema); - const client = new Zodios(`http://localhost:${port}`, api); - const user = await client.createUser({ name: "test" }); - expect(user).toEqual({ id: 1, name: "test" }); - }); - - it("should update a user", async () => { - const api = makeCrudApi("user", userSchema); - const client = new Zodios(`http://localhost:${port}`, api); - const user = await client.updateUser( - { id: 2, name: "test2" }, - { params: { id: 2 } } - ); - expect(user).toEqual({ id: 2, name: "test2" }); - }); - - it("should patch a user", async () => { - const api = makeCrudApi("user", userSchema); - const client = new Zodios(`http://localhost:${port}`, api); - const user = await client.patchUser( - { name: "test2" }, - { params: { id: 2 } } - ); - expect(user).toEqual({ id: 2, name: "test2" }); - }); - - it("should delete a user", async () => { - const api = makeCrudApi("user", userSchema); - const client = new Zodios(`http://localhost:${port}`, api); - const user = await client.deleteUser(undefined, { params: { id: 2 } }); - expect(user).toEqual({ id: 2, name: "test" }); - }); -}); - describe("mergeApis", () => { it("should merge two apis", () => { const usersSchema = z.array(userSchema); @@ -468,25 +48,25 @@ describe("mergeApis", () => { typeof merged, [ { - method: "get"; - path: "/users"; - alias: "getUsers"; - description: "Get all users"; - response: typeof usersSchema; + readonly method: "get"; + readonly path: "/users"; + readonly alias: "getUsers"; + readonly description: "Get all users"; + readonly response: typeof usersSchema; }, { - method: "get"; - path: "/users/:id"; - alias: "getUser"; - description: "Get a user"; - response: typeof userSchema; + readonly method: "get"; + readonly path: "/users/:id"; + readonly alias: "getUser"; + readonly description: "Get a user"; + readonly response: typeof userSchema; }, { - method: "get"; - path: "/admins"; - alias: "getAdmins"; - description: "Get all admins"; - response: typeof usersSchema; + readonly method: "get"; + readonly path: "/admins"; + readonly alias: "getAdmins"; + readonly description: "Get all admins"; + readonly response: typeof usersSchema; } ] > = true; diff --git a/packages/core/src/api.ts b/packages/core/src/api.ts index 8a99f74e..2139da1e 100644 --- a/packages/core/src/api.ts +++ b/packages/core/src/api.ts @@ -1,3 +1,4 @@ +import { TupleFlat, UnionToTuple } from "./utils.types"; import type { ZodiosEndpointDefinition, ZodiosEndpointParameter, @@ -231,106 +232,6 @@ export function apiBuilder( return new Builder([endpoint] as [T]); } -/** - * Helper to generate a basic CRUD api for a given resource - * @param resource - the resource to generate the api for - * @param schema - the schema of the resource - * @returns - the api definitions - */ -export function makeCrudApi< - T extends string, - S extends z.ZodObject ->(resource: T, schema: S) { - type Schema = z.input; - const capitalizedResource = capitalize(resource); - return makeApi([ - { - method: "get", - // @ts-expect-error - path: `/${resource}s`, - // @ts-expect-error - alias: `get${capitalizedResource}s`, - description: `Get all ${resource}s`, - response: z.array(schema), - }, - { - method: "get", - // @ts-expect-error - path: `/${resource}s/:id`, - // @ts-expect-error - alias: `get${capitalizedResource}`, - description: `Get a ${resource}`, - // @ts-expect-error - response: schema, - }, - { - method: "post", - // @ts-expect-error - path: `/${resource}s`, - // @ts-expect-error - alias: `create${capitalizedResource}`, - description: `Create a ${resource}`, - parameters: [ - { - name: "body", - type: "Body", - description: "The object to create", - schema: schema.partial() as z.Schema>, - }, - ], - // @ts-expect-error - response: schema, - }, - { - method: "put", - // @ts-expect-error - path: `/${resource}s/:id`, - // @ts-expect-error - alias: `update${capitalizedResource}`, - description: `Update a ${resource}`, - parameters: [ - { - name: "body", - type: "Body", - description: "The object to update", - // @ts-expect-error - schema: schema, - }, - ], - // @ts-expect-error - response: schema, - }, - { - method: "patch", - // @ts-expect-error - path: `/${resource}s/:id`, - // @ts-expect-error - alias: `patch${capitalizedResource}`, - description: `Patch a ${resource}`, - parameters: [ - { - name: "body", - type: "Body", - description: "The object to patch", - schema: schema.partial() as z.Schema>, - }, - ], - // @ts-expect-error - response: schema, - }, - { - method: "delete", - // @ts-expect-error - path: `/${resource}s/:id`, - // @ts-expect-error - alias: `delete${capitalizedResource}`, - description: `Delete a ${resource}`, - // @ts-expect-error - response: schema, - }, - ]); -} - type CleanPath = Path extends `${infer PClean}/` ? PClean : Path; @@ -357,7 +258,7 @@ type MapApiPath< : Acc; type MergeApis< - Apis extends Record, + Apis extends Record, MergedPathApis = UnionToTuple< { [K in keyof Apis]: K extends string ? MapApiPath : never; @@ -377,7 +278,7 @@ function cleanPath(path: string) { */ export function prefixApi< Prefix extends string, - Api extends ZodiosEndpointDefinition[] + const Api extends readonly ZodiosEndpointDefinition[] >(prefix: Prefix, api: Api) { return api.map((endpoint) => ({ ...endpoint, @@ -399,7 +300,7 @@ export function prefixApi< * ``` */ export function mergeApis< - Apis extends Record + const Apis extends Record >(apis: Apis): MergeApis { return Object.keys(apis).flatMap((key) => prefixApi(key, apis[key])) as any; } diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 4becee07..423fc46e 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -36,7 +36,6 @@ export type { ZodiosErrorsByPath, ZodiosErrorsByAlias, ZodiosEndpointDefinition, - ZodiosEndpointDefinitions, ZodiosEndpointParameter, ZodiosEndpointParameters, ZodiosEndpointError, diff --git a/packages/fetch/examples/define-types.ts b/packages/fetch/examples/define-types.ts index dfcf6e1e..54bd9a75 100644 --- a/packages/fetch/examples/define-types.ts +++ b/packages/fetch/examples/define-types.ts @@ -48,7 +48,9 @@ const jsonplaceholderApi = makeApi([ // and then use them in your API async function bootstrap() { - const apiClient = new Zodios(jsonplaceholderUrl, jsonplaceholderApi); + const apiClient = new Zodios(jsonplaceholderUrl, jsonplaceholderApi, { + fetchConfig: { credentials: "include" }, + }); const users = await apiClient.get("/users", { queries: { q: "Nicholas" } }); console.log(users); From ac92a07352e7b086f63ab8cd9a8120d81d20b201 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Thu, 16 Mar 2023 22:34:16 +0100 Subject: [PATCH 121/206] docs(website): update docs --- website/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/package.json b/website/package.json index 08cb092d..01f8456d 100644 --- a/website/package.json +++ b/website/package.json @@ -28,7 +28,7 @@ "devDependencies": { "@docusaurus/module-type-aliases": "^2.3.1", "@tsconfig/docusaurus": "1.0.6", - "typescript": "4.8.2" + "typescript": "5.0.1-rc" }, "browserslist": { "production": [ From af2848abe53c1238fff61f9333864bd5170710bf Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sun, 26 Mar 2023 18:52:01 +0200 Subject: [PATCH 122/206] feat: update to ts 5.0 --- examples/next-turbo/apps/docs/package.json | 2 +- examples/next-turbo/apps/web/package.json | 2 +- .../eslint-config-custom/package.json | 2 +- examples/next-turbo/packages/ui/package.json | 2 +- examples/next/package.json | 2 +- package.json | 7 +- packages/axios/package.json | 4 +- packages/axios/src/zodios.ts | 4 +- packages/core/package.json | 4 +- packages/core/src/index.ts | 2 +- packages/core/src/utils.ts | 10 +- packages/core/src/zodios-error.ts | 2 +- packages/core/src/zodios.ts | 2 +- packages/express/package.json | 4 +- packages/express/src/index.ts | 10 +- packages/express/src/type-providers/index.ts | 1 + .../src/type-providers/type-provider.types.ts | 10 + .../src/type-providers/zod.type-provider.ts | 2 +- packages/express/src/zodios-validator.ts | 10 +- packages/express/src/zodios.ts | 73 ++- packages/express/src/zodios.types.ts | 174 +++--- packages/express/src/zodios.utils.spec.ts | 54 -- packages/express/src/zodios.utils.ts | 31 - packages/fetch/package.json | 4 +- packages/fetch/src/zodios.ts | 4 +- packages/react/package.json | 7 +- packages/react/src/hooks.ts | 17 +- packages/testing/package.json | 4 +- packages/testing/src/zodios.ts | 4 +- pnpm-lock.yaml | 563 +++++++++--------- website/package.json | 2 +- 31 files changed, 499 insertions(+), 520 deletions(-) create mode 100644 packages/express/src/type-providers/index.ts create mode 100644 packages/express/src/type-providers/type-provider.types.ts delete mode 100644 packages/express/src/zodios.utils.spec.ts diff --git a/examples/next-turbo/apps/docs/package.json b/examples/next-turbo/apps/docs/package.json index cb77c505..4c1d7760 100644 --- a/examples/next-turbo/apps/docs/package.json +++ b/examples/next-turbo/apps/docs/package.json @@ -22,6 +22,6 @@ "@types/node": "^17.0.12", "@types/react": "^18.0.22", "@types/react-dom": "^18.0.7", - "typescript": "^4.5.3" + "typescript": "5.0.2" } } diff --git a/examples/next-turbo/apps/web/package.json b/examples/next-turbo/apps/web/package.json index 89ce106d..8b068186 100644 --- a/examples/next-turbo/apps/web/package.json +++ b/examples/next-turbo/apps/web/package.json @@ -30,6 +30,6 @@ "eslint": "7.32.0", "eslint-config-custom": "workspace:0.0.0", "tsconfig": "workspace:0.0.0", - "typescript": "^4.8.4" + "typescript": "5.0.2" } } diff --git a/examples/next-turbo/packages/eslint-config-custom/package.json b/examples/next-turbo/packages/eslint-config-custom/package.json index 7f16c312..ee80e8fb 100644 --- a/examples/next-turbo/packages/eslint-config-custom/package.json +++ b/examples/next-turbo/packages/eslint-config-custom/package.json @@ -11,7 +11,7 @@ "eslint-config-turbo": "latest" }, "devDependencies": { - "typescript": "^4.7.4" + "typescript": "5.0.2" }, "publishConfig": { "access": "public" diff --git a/examples/next-turbo/packages/ui/package.json b/examples/next-turbo/packages/ui/package.json index 17b3a320..9cd2ee44 100644 --- a/examples/next-turbo/packages/ui/package.json +++ b/examples/next-turbo/packages/ui/package.json @@ -14,6 +14,6 @@ "eslint-config-custom": "workspace:*", "react": "^18.2.0", "tsconfig": "workspace:*", - "typescript": "^4.5.2" + "typescript": "5.0.2" } } diff --git a/examples/next/package.json b/examples/next/package.json index 60a8d794..5b20c79b 100644 --- a/examples/next/package.json +++ b/examples/next/package.json @@ -27,6 +27,6 @@ "@types/react-dom": "18.0.10", "eslint": "8.32.0", "eslint-config-next": "12.2.5", - "typescript": "5.0.0-dev.20230205" + "typescript": "5.0.2" } } diff --git a/package.json b/package.json index a09cb017..624a6d13 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,11 @@ "devDependencies": { "@changesets/cli": "2.25.2", "turbo": "1.6.3", - "typescript": "5.0.0-dev.20230205" + "typescript": "5.0.2" + }, + "pnpm": { + "overrides": { + "esbuild": "0.17.14" + } } } diff --git a/packages/axios/package.json b/packages/axios/package.json index a6c28530..4ef4e316 100644 --- a/packages/axios/package.json +++ b/packages/axios/package.json @@ -75,8 +75,8 @@ "rimraf": "3.0.2", "ts-jest": "29.0.3", "ts-node": "10.9.1", - "tsup": "6.3.0", - "typescript": "5.0.0-dev.20230205", + "tsup": "6.7.0", + "typescript": "5.0.2", "zod": "3.20.1" } } diff --git a/packages/axios/src/zodios.ts b/packages/axios/src/zodios.ts index 8575da19..f01087ca 100644 --- a/packages/axios/src/zodios.ts +++ b/packages/axios/src/zodios.ts @@ -32,7 +32,7 @@ const ZodiosAxios = new Proxy(ZodiosCore, { export interface Zodios { new < - const Api extends ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + const Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider >( api: Api, @@ -43,7 +43,7 @@ export interface Zodios { TypeOfFetcherOptions ): ZodiosInstance; new < - const Api extends ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + const Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider >( baseUrl: string, diff --git a/packages/core/package.json b/packages/core/package.json index 11011f8a..4bd39a8f 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -72,8 +72,8 @@ "rimraf": "3.0.2", "ts-jest": "29.0.3", "ts-node": "10.9.1", - "tsup": "6.3.0", - "typescript": "5.0.0-dev.20230205", + "tsup": "6.7.0", + "typescript": "5.0.2", "zod": "3.20.1" } } diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index 423fc46e..ae8742fe 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -79,8 +79,8 @@ export type { ZodiosFetcher, } from "./fetcher-providers"; export { setFetcherHook, clearFetcherHook } from "./hooks"; +export type { PluginId } from "./plugins"; export { - PluginId, schemaValidationPlugin, formDataPlugin, formURLPlugin, diff --git a/packages/core/src/utils.ts b/packages/core/src/utils.ts index 5af29912..7dba8b46 100644 --- a/packages/core/src/utils.ts +++ b/packages/core/src/utils.ts @@ -1,6 +1,6 @@ import type { ZodiosEndpointDefinition, - ZodiosEndpointDefinitions, + ZodiosEndpointError, } from "./zodios.types"; /** @@ -40,7 +40,7 @@ export function pick( } export function findEndpoint( - api: ZodiosEndpointDefinitions, + api: ZodiosEndpointDefinition[] | readonly ZodiosEndpointDefinition[], method: string, path: string ) { @@ -48,7 +48,7 @@ export function findEndpoint( } export function findEndpointByAlias( - api: ZodiosEndpointDefinitions, + api: ZodiosEndpointDefinition[] | readonly ZodiosEndpointDefinition[], alias: string ) { return api.find((e) => e.alias === alias); @@ -66,7 +66,7 @@ export function findEndpointErrors( } export function findEndpointErrorsByPath( - api: ZodiosEndpointDefinitions, + api: ZodiosEndpointDefinition[] | readonly ZodiosEndpointDefinition[], method: string, path: string, err: any @@ -82,7 +82,7 @@ export function findEndpointErrorsByPath( } export function findEndpointErrorsByAlias( - api: ZodiosEndpointDefinitions, + api: ZodiosEndpointDefinition[] | readonly ZodiosEndpointDefinition[], alias: string, err: any ) { diff --git a/packages/core/src/zodios-error.ts b/packages/core/src/zodios-error.ts index 4d4b804a..1e86deed 100644 --- a/packages/core/src/zodios-error.ts +++ b/packages/core/src/zodios-error.ts @@ -1,5 +1,5 @@ import { AnyZodiosFetcherProvider } from "./fetcher-providers"; -import type { ReadonlyDeep } from "./utils.types"; +import type { ReadonlyDeep, DeepReadonlyObject } from "./utils.types"; import type { AnyZodiosRequestOptions } from "./zodios.types"; /** diff --git a/packages/core/src/zodios.ts b/packages/core/src/zodios.ts index 4141302c..8ee01cfb 100644 --- a/packages/core/src/zodios.ts +++ b/packages/core/src/zodios.ts @@ -24,7 +24,7 @@ import { } from "./plugins"; import type { PickRequired, ReadonlyDeep } from "./utils.types"; import { checkApi } from "./api"; -import type { AnyZodiosTypeProvider, ZodTypeProvider } from "./type-providers"; +import type { AnyZodiosTypeProvider, ZodTypeProvider,ZodiosRuntimeTypeProvider } from "./type-providers"; import { zodTypeProvider } from "./type-providers"; import { AnyZodiosFetcherProvider, diff --git a/packages/express/package.json b/packages/express/package.json index 618138e7..ac375314 100644 --- a/packages/express/package.json +++ b/packages/express/package.json @@ -56,8 +56,8 @@ "supertest": "6.3.3", "ts-jest": "29.0.5", "ts-node": "10.9.1", - "tsup": "6.3.0", - "typescript": "5.0.0-dev.20230205", + "tsup": "6.7.0", + "typescript": "5.0.2", "zod": "3.20.2" }, "dependencies": {} diff --git a/packages/express/src/index.ts b/packages/express/src/index.ts index a0cf2a9f..290fecf1 100644 --- a/packages/express/src/index.ts +++ b/packages/express/src/index.ts @@ -9,14 +9,14 @@ export type { ZodiosContext } from "./zodios"; export type { ZodiosApp, ZodiosAppOptions, - ZodiosHandler, - ZodiosHandlers, - ZodiosRequestHandler, + ZodiosMethodMiddleware, + ZodiosMiddleware, + ZodiosPathMiddleware, ZodiosRouter, + ZodiosRouterMethodMiddlewares, ZodiosRouterOptions, - ZodiosRouterContextRequestHandler, ZodiosValidationOptions, - ZodiosUse, + ZodiosRouterMiddlewares, ZodiosSucessCodes, WithZodiosContext, } from "./zodios.types"; diff --git a/packages/express/src/type-providers/index.ts b/packages/express/src/type-providers/index.ts new file mode 100644 index 00000000..90c4a6bb --- /dev/null +++ b/packages/express/src/type-providers/index.ts @@ -0,0 +1 @@ +export type { ZodiosExpressTypeProviderFactory } from "./type-provider.types"; diff --git a/packages/express/src/type-providers/type-provider.types.ts b/packages/express/src/type-providers/type-provider.types.ts new file mode 100644 index 00000000..751daa55 --- /dev/null +++ b/packages/express/src/type-providers/type-provider.types.ts @@ -0,0 +1,10 @@ +import { AnyZodiosTypeProvider, ZodiosValidateResult } from "@zodios/core"; + +export interface ZodiosExpressTypeProviderFactory< + TypeProvider extends AnyZodiosTypeProvider +> { + readonly _provider?: TypeProvider; + validate: (schema: any, input: unknown) => ZodiosValidateResult; + validateAsync: (schema: any, input: unknown) => Promise; + isSchemaBooleanOrNumber: (schema: any) => boolean; +} diff --git a/packages/express/src/type-providers/zod.type-provider.ts b/packages/express/src/type-providers/zod.type-provider.ts index 813d8b4f..b1d26914 100644 --- a/packages/express/src/type-providers/zod.type-provider.ts +++ b/packages/express/src/type-providers/zod.type-provider.ts @@ -6,5 +6,5 @@ export const zodTypeFactory: ZodiosExpressTypeProviderFactory = { validate: (schema, input) => schema.safeParse(input), validateAsync: (schema, input) => schema.safeParseAsync(input), - isSchemaBooleanOrNumber: (schema: any) => true, + isSchemaBooleanOrNumber: (schema) => true, }; diff --git a/packages/express/src/zodios-validator.ts b/packages/express/src/zodios-validator.ts index fb9ed271..71184132 100644 --- a/packages/express/src/zodios-validator.ts +++ b/packages/express/src/zodios-validator.ts @@ -1,8 +1,5 @@ import express from "express"; -import { - ZodiosEndpointDefinition, - ZodiosEndpointDefinitions, -} from "@zodios/core"; +import { ZodiosEndpointDefinition } from "@zodios/core"; import { isZodType, withoutTransform } from "./zodios.utils"; import { z } from "zod"; @@ -10,8 +7,7 @@ const METHODS = ["get", "post", "put", "patch", "delete"] as const; async function validateParam(schema: z.ZodType, parameter: unknown) { if ( - (isZodType(schema, z.ZodFirstPartyTypeKind.ZodNumber) || - isZodType(schema, z.ZodFirstPartyTypeKind.ZodBoolean)) && + !isZodType(schema, z.ZodFirstPartyTypeKind.ZodString) && parameter && typeof parameter === "string" ) { @@ -119,7 +115,7 @@ function validateEndpointMiddleware( * @param transform - whether to transform the data or not */ export function injectParametersValidators( - api: ZodiosEndpointDefinitions, + api: readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], router: express.Router, transform: boolean ) { diff --git a/packages/express/src/zodios.ts b/packages/express/src/zodios.ts index 91dcaabf..be83630f 100644 --- a/packages/express/src/zodios.ts +++ b/packages/express/src/zodios.ts @@ -1,19 +1,21 @@ import express, { RouterOptions } from "express"; -import { z } from "zod"; import { - ZodiosEndpointDefinitions, AnyZodiosTypeProvider, ZodTypeProvider, InferInputTypeFromSchema, + InferOutputTypeFromSchema, + ZodiosEndpointDefinition, } from "@zodios/core"; -import { Narrow } from "@zodios/core/lib/utils.types"; import { ZodiosApp, ZodiosRouter, ZodiosAppOptions, ZodiosRouterOptions, + ZodiosMiddleware, } from "./zodios.types"; import { injectParametersValidators } from "./zodios-validator"; +import { ZodiosExpressTypeProviderFactory } from "./type-providers"; +import { zodTypeFactory } from "./type-providers/zod.type-provider"; /** * create a zodios app based on the given api and express @@ -23,16 +25,17 @@ import { injectParametersValidators } from "./zodios-validator"; */ export function zodiosApp< ContextSchema, - Api extends ZodiosEndpointDefinitions = any, + const Api extends readonly ZodiosEndpointDefinition[]|ZodiosEndpointDefinition[] = any, TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider >( - api?: Narrow, - options: ZodiosAppOptions = {} + api?: Api, + options: ZodiosAppOptions = {} ): ZodiosApp< Api, [unknown] extends [ContextSchema] ? unknown - : InferInputTypeFromSchema + : InferInputTypeFromSchema, + TypeProvider > { const { express: app = express(), @@ -56,17 +59,18 @@ export function zodiosApp< * @returns */ export function zodiosRouter< - Api extends ZodiosEndpointDefinitions, + const Api extends readonly ZodiosEndpointDefinition[]|ZodiosEndpointDefinition[], ContextSchema, TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider >( - api: Narrow, - options: RouterOptions & ZodiosRouterOptions = {} + api: Api, + options: RouterOptions & ZodiosRouterOptions = {} ): ZodiosRouter< Api, [unknown] extends [ContextSchema] ? unknown - : InferInputTypeFromSchema + : InferInputTypeFromSchema, + TypeProvider > { const { validate = true, transform = false, ...routerOptions } = options; const router = options?.router ?? express.Router(routerOptions); @@ -83,16 +87,17 @@ export function zodiosRouter< */ export function zodiosNextApp< ContextSchema, - Api extends ZodiosEndpointDefinitions = any, + const Api extends readonly ZodiosEndpointDefinition[]|ZodiosEndpointDefinition[] = any, TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider >( - api?: Narrow, - options: ZodiosAppOptions = {} + api?: Api, + options: ZodiosAppOptions = {} ): ZodiosApp< Api, [unknown] extends [ContextSchema] ? unknown - : InferInputTypeFromSchema + : InferInputTypeFromSchema, + TypeProvider > { return zodiosApp(api, { ...options, @@ -104,57 +109,63 @@ export class ZodiosContext< ContextSchema, TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider > { + typeFactory: ZodiosExpressTypeProviderFactory; constructor( public context?: ContextSchema, options?: { - typeProvider: TypeProvider; + typeFactory: ZodiosExpressTypeProviderFactory; } - ) {} + ) { + this.typeFactory = options?.typeFactory ?? (zodTypeFactory as any); + } - app( - api?: Narrow, - options?: ZodiosAppOptions + app( + api?: Api, + options?: ZodiosAppOptions ): ZodiosApp< Api, [unknown] extends [ContextSchema] ? unknown - : InferInputTypeFromSchema + : InferInputTypeFromSchema, + TypeProvider > { return zodiosApp(api, options); } - nextApp( - api?: Narrow, - options?: ZodiosAppOptions + nextApp( + api?: Api, + options?: ZodiosAppOptions ): ZodiosApp< Api, [unknown] extends [ContextSchema] ? unknown - : InferInputTypeFromSchema + : InferInputTypeFromSchema, + TypeProvider > { return zodiosNextApp(api, options); } - router( - api: Narrow, - options?: RouterOptions & ZodiosRouterOptions + router( + api: Api, + options?: RouterOptions & ZodiosRouterOptions ): ZodiosRouter< Api, [unknown] extends [ContextSchema] ? unknown - : InferInputTypeFromSchema + : InferInputTypeFromSchema, + TypeProvider > { return zodiosRouter(api, options); } } export function zodiosContext< - ContextSchema, + ContextSchema = unknown, TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider >( context?: ContextSchema, options?: { - typeProvider: TypeProvider; + typeFactory: ZodiosExpressTypeProviderFactory; } ): ZodiosContext { return new ZodiosContext(context, options); diff --git a/packages/express/src/zodios.types.ts b/packages/express/src/zodios.types.ts index 42a6e6ef..640e3a56 100644 --- a/packages/express/src/zodios.types.ts +++ b/packages/express/src/zodios.types.ts @@ -1,6 +1,6 @@ -import express, { Request } from "express"; +import express from "express"; +import type { Request, Response, NextFunction } from "express"; import { - ZodiosEndpointDefinitions, ZodiosEndpointDefinition, ZodiosErrorByPath, ZodiosResponseByPath, @@ -9,9 +9,11 @@ import { ZodiosPathsByMethod, ZodiosPathParamsByPath, Method, + AnyZodiosTypeProvider, + ZodTypeProvider, } from "@zodios/core"; -import { IfEquals, Merge } from "@zodios/core/lib/utils.types"; -import { z, ZodAny, ZodObject } from "zod"; +import { IfEquals } from "@zodios/core/lib/utils.types"; +import { ZodiosExpressTypeProviderFactory } from "./type-providers"; export type ZodiosSucessCodes = | 200 @@ -29,79 +31,90 @@ export type WithZodiosContext = T & Context; type Test = WithZodiosContext; -export interface ZodiosRequestHandler< - Api extends ZodiosEndpointDefinitions, +export interface ZodiosPathMiddleware< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], Context, M extends Method, Path extends ZodiosPathsByMethod, - ReqPath = ZodiosPathParamsByPath, - ReqBody = ZodiosBodyByPath, - ReqQuery = ZodiosQueryParamsByPath, - Res = ZodiosResponseByPath + TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, + ReqPath = ZodiosPathParamsByPath, + ReqBody = ZodiosBodyByPath, + ReqQuery = ZodiosQueryParamsByPath, + Res = ZodiosResponseByPath > { ( - req: WithZodiosContext< - express.Request, - Context - >, - res: Omit, "status"> & { + req: WithZodiosContext, Context>, + res: Omit, "status"> & { // rebind context to allow for type inference status< StatusCode extends number, - API extends ZodiosEndpointDefinition[] = Api, + API extends + | readonly ZodiosEndpointDefinition[] + | ZodiosEndpointDefinition[] = Api, METHOD extends Method = M, PATH extends ZodiosPathsByMethod = Path >( status: StatusCode ): StatusCode extends ZodiosSucessCodes - ? express.Response - : express.Response< - ZodiosErrorByPath + ? Response + : Response< + ZodiosErrorByPath< + API, + METHOD, + PATH, + StatusCode, + false, + TypeProvider + > >; }, - next: express.NextFunction + next: NextFunction ): void; } -export interface ZodiosRouterContextRequestHandler { - ( - req: WithZodiosContext, - res: express.Response, - next: express.NextFunction - ): void; -} +export type ZodiosMiddleware = ( + req: WithZodiosContext, + res: Response, + next: NextFunction +) => void; + +export type ZodiosErrorMiddleware = ( + error: unknown, + req: WithZodiosContext, + res: Response, + next: NextFunction +) => void; -export type ZodiosHandler< +export type ZodiosMethodMiddleware< Router, Context, - Api extends ZodiosEndpointDefinitions, - M extends Method + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + M extends Method, + TypeProvider extends AnyZodiosTypeProvider > = >( path: Path, - ...handlers: Array> + ...handlers: Array> ) => Router; -export interface ZodiosUse { - use(...handlers: Array>): this; - use(handlers: Array>): this; - use( - path: string, - ...handlers: Array> - ): this; - use( - path: string, - handlers: Array> - ): this; +export interface ZodiosRouterMiddlewares { + use(handlers: Array>): this; + use(...handlers: Array>): this; + use(...handler: Array>): this; + use(path: string, ...handlers: Array>): this; + use(path: string, handlers: Array>): this; } -export interface ZodiosHandlers - extends ZodiosUse { - get: ZodiosHandler; - post: ZodiosHandler; - put: ZodiosHandler; - patch: ZodiosHandler; - delete: ZodiosHandler; - head: ZodiosHandler; +export interface ZodiosRouterMethodMiddlewares< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + Context, + TypeProvider extends AnyZodiosTypeProvider +> extends ZodiosRouterMiddlewares { + get: ZodiosMethodMiddleware; + post: ZodiosMethodMiddleware; + put: ZodiosMethodMiddleware; + patch: ZodiosMethodMiddleware; + delete: ZodiosMethodMiddleware; + head: ZodiosMethodMiddleware; } export interface ZodiosValidationOptions { @@ -115,8 +128,10 @@ export interface ZodiosValidationOptions { transform?: boolean; } -export interface ZodiosAppOptions - extends ZodiosValidationOptions { +export interface ZodiosAppOptions< + ContextSchema, + TypeProvider extends AnyZodiosTypeProvider +> extends ZodiosValidationOptions { /** * express app intance - default is express() */ @@ -126,38 +141,63 @@ export interface ZodiosAppOptions */ enableJsonBodyParser?: boolean; context?: ContextSchema; + typeFactory?: ZodiosExpressTypeProviderFactory; } -export interface ZodiosRouterOptions - extends ZodiosValidationOptions { +export interface ZodiosRouterOptions< + ContextSchema, + TypeProvider extends AnyZodiosTypeProvider +> extends ZodiosValidationOptions { /** * express router instance - default is express.Router */ router?: ReturnType; context?: ContextSchema; + typeFactory?: ZodiosExpressTypeProviderFactory; } +export interface ZodiosUnknownApp + extends Omit, "use">, + ZodiosRouterMiddlewares {} + +export interface ZodiosApiApp< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + Context, + TypeProvider extends AnyZodiosTypeProvider +> extends Omit, Method | "use">, + ZodiosRouterMethodMiddlewares {} + export type ZodiosApp< - Api extends ZodiosEndpointDefinitions, - Context + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + Context, + TypeProvider extends AnyZodiosTypeProvider > = IfEquals< Api, any, - Omit, "use"> & ZodiosUse, - Omit, Method | "use"> & - ZodiosHandlers + ZodiosUnknownApp, + ZodiosApiApp >; +interface ZodiosUnknownRouter + extends Omit, "use">, + ZodiosRouterMiddlewares, + ZodiosMiddleware {} + +interface ZodiosApiRouter< + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + Context, + TypeProvider extends AnyZodiosTypeProvider +> extends Omit, Method | "use">, + ZodiosRouterMethodMiddlewares, + ZodiosMiddleware {} + export type ZodiosRouter< - Api extends ZodiosEndpointDefinitions, - Context + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + Context, + TypeProvider extends AnyZodiosTypeProvider > = IfEquals< Api, any, - Omit, "use"> & - ZodiosUse & - ZodiosRouterContextRequestHandler, - Omit, Method | "use"> & - ZodiosHandlers & - ZodiosRouterContextRequestHandler + ZodiosUnknownRouter, + ZodiosApiRouter >; diff --git a/packages/express/src/zodios.utils.spec.ts b/packages/express/src/zodios.utils.spec.ts deleted file mode 100644 index 0872f345..00000000 --- a/packages/express/src/zodios.utils.spec.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { makeApi } from "@zodios/core"; -import { z } from "zod"; -import { prefixApi } from "./zodios.utils"; -import { Assert } from "@zodios/core/lib/utils.types"; - -const response = z.object({ - id: z.number(), - name: z.string(), -}); - -const api = makeApi([ - { - method: "get", - path: "/", - response, - }, - { - method: "get", - path: "/foo", - response, - }, -]); - -describe("zodios utils", () => { - it("should prefix api", () => { - type Expected = [ - { - method: "get"; - path: "/api/"; - response: typeof response; - }, - { - method: "get"; - path: "/api/foo"; - response: typeof response; - } - ]; - const prefix = "/api"; - const prefixedApi = prefixApi(prefix, api); - const testApi: Assert = true; - expect(prefixedApi).toEqual([ - { - method: "get", - path: "/api/", - response, - }, - { - method: "get", - path: "/api/foo", - response, - }, - ]); - }); -}); diff --git a/packages/express/src/zodios.utils.ts b/packages/express/src/zodios.utils.ts index 4ce4d395..655a0949 100644 --- a/packages/express/src/zodios.utils.ts +++ b/packages/express/src/zodios.utils.ts @@ -1,36 +1,5 @@ import { z } from "zod"; -type MapPrefixPath< - T extends readonly unknown[], - PrefixValue extends string, - ACC extends unknown[] = [] -> = T extends readonly [infer Head, ...infer Tail] - ? MapPrefixPath< - Tail, - PrefixValue, - [ - ...ACC, - { - [K in keyof Head]: K extends "path" - ? Head[K] extends string - ? `${PrefixValue}${Head[K]}` - : Head[K] - : Head[K]; - } - ] - > - : ACC; - -export function prefixApi( - prefix: Prefix, - api: Api -) { - return api.map((endpoint) => ({ - ...endpoint, - path: `${prefix}${endpoint.path}`, - })) as MapPrefixPath; -} - export function isZodType( t: z.ZodTypeAny, type: z.ZodFirstPartyTypeKind diff --git a/packages/fetch/package.json b/packages/fetch/package.json index bf80bf15..38e06a53 100644 --- a/packages/fetch/package.json +++ b/packages/fetch/package.json @@ -72,8 +72,8 @@ "rimraf": "3.0.2", "ts-jest": "29.0.3", "ts-node": "10.9.1", - "tsup": "6.3.0", - "typescript": "5.0.0-dev.20230205", + "tsup": "6.7.0", + "typescript": "5.0.2", "zod": "3.20.1" } } diff --git a/packages/fetch/src/zodios.ts b/packages/fetch/src/zodios.ts index eb442921..167bb841 100644 --- a/packages/fetch/src/zodios.ts +++ b/packages/fetch/src/zodios.ts @@ -32,7 +32,7 @@ const ZodiosFetch = new Proxy(ZodiosCore, { export interface Zodios { new < - const Api extends ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + const Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider >( api: Api, @@ -43,7 +43,7 @@ export interface Zodios { TypeOfFetcherOptions ): ZodiosInstance; new < - const Api extends ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + const Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider >( baseUrl: string, diff --git a/packages/react/package.json b/packages/react/package.json index 08933d33..470b7240 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -83,11 +83,8 @@ "rimraf": "3.0.2", "ts-jest": "29.0.3", "ts-node": "10.9.1", - "tsup": "6.3.0", - "typescript": "5.0.0-dev.20230205", + "tsup": "6.7.0", + "typescript": "5.0.2", "zod": "3.20.1" - }, - "resolutions": { - "@types/react": "18.0.25" } } diff --git a/packages/react/src/hooks.ts b/packages/react/src/hooks.ts index 809972d6..17861692 100644 --- a/packages/react/src/hooks.ts +++ b/packages/react/src/hooks.ts @@ -22,7 +22,6 @@ import type { ZodiosPathsByMethod, ZodiosResponseByPath, ZodiosResponseByAlias, - ZodiosEndpointDefinitions, ZodiosEndpointDefinition, ZodiosEndpointDefinitionByAlias, ZodiosRequestOptionsByPath, @@ -45,7 +44,7 @@ type UndefinedIfNever = IfEquals; type Errors = Error | ZodiosError; type MutationOptions< - Api extends ZodiosEndpointDefinition[], + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], M extends Method, Path extends ZodiosPathsByMethod, TypeProvider extends AnyZodiosTypeProvider @@ -59,7 +58,7 @@ type MutationOptions< >; type MutationOptionsByAlias< - Api extends ZodiosEndpointDefinition[], + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], Alias extends string, TypeProvider extends AnyZodiosTypeProvider > = Omit< @@ -92,7 +91,7 @@ export type ImmutableInfiniteQueryOptions = Omit< >; export class ZodiosHooksImpl< - Api extends ZodiosEndpointDefinitions, + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], FetcherProvider extends AnyZodiosFetcherProvider, TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider > { @@ -798,7 +797,7 @@ export type ZodiosMutationAliasHook = ) => UseMutationResult, unknown>; export type ZodiosHooksAliases< - Api extends ZodiosEndpointDefinitions, + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], FetcherProvider extends AnyZodiosFetcherProvider, TypeProvider extends AnyZodiosTypeProvider > = { @@ -889,7 +888,7 @@ export type ZodiosHooksAliases< }; export type ZodiosHooksMutations< - Api extends ZodiosEndpointDefinitions, + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], FetcherProvider extends AnyZodiosFetcherProvider, TypeProvider extends AnyZodiosTypeProvider > = { @@ -928,7 +927,7 @@ export type ZodiosHooksMutations< }; export type ZodiosHooksInstance< - Api extends ZodiosEndpointDefinitions, + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], FetcherProvider extends AnyZodiosFetcherProvider, TypeProvider extends AnyZodiosTypeProvider > = ZodiosHooksImpl & @@ -937,7 +936,9 @@ export type ZodiosHooksInstance< export type ZodiosHooks = { new < - Api extends ZodiosEndpointDefinitions, + Api extends + | readonly ZodiosEndpointDefinition[] + | ZodiosEndpointDefinition[], FetcherProvider extends AnyZodiosFetcherProvider, TypeProvider extends AnyZodiosTypeProvider >( diff --git a/packages/testing/package.json b/packages/testing/package.json index 1fb72335..f2b0cb4a 100644 --- a/packages/testing/package.json +++ b/packages/testing/package.json @@ -53,8 +53,8 @@ "rimraf": "3.0.2", "ts-jest": "29.0.3", "ts-node": "10.9.1", - "tsup": "6.3.0", - "typescript": "5.0.0-dev.20230205", + "tsup": "6.7.0", + "typescript": "5.0.2", "zod": "3.20.1" } } diff --git a/packages/testing/src/zodios.ts b/packages/testing/src/zodios.ts index 2d204c6b..3ef6be86 100644 --- a/packages/testing/src/zodios.ts +++ b/packages/testing/src/zodios.ts @@ -1,7 +1,7 @@ import type { ZodiosPathsByMethod, ZodiosResponseByPath, - ZodiosEndpointDefinitions, + ZodiosEndpointDefinition, ZodiosRequestOptionsByPath, AnyZodiosTypeProvider, ZodTypeProvider, @@ -15,7 +15,7 @@ import { zodiosMocks, MockResponse, MaybePromise } from "./mock-provider"; * zodios mock service */ export class ZodiosMocks< - Api extends ZodiosEndpointDefinitions, + Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], FetcherProvider extends AnyZodiosFetcherProvider, TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider > { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f0ea55a8..1131035d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,16 +1,19 @@ lockfileVersion: 5.4 +overrides: + esbuild: 0.17.14 + importers: .: specifiers: '@changesets/cli': 2.25.2 turbo: 1.6.3 - typescript: 5.0.0-dev.20230205 + typescript: 5.0.2 devDependencies: '@changesets/cli': 2.25.2 turbo: 1.6.3 - typescript: 5.0.0-dev.20230205 + typescript: 5.0.2 packages/axios: specifiers: @@ -30,8 +33,8 @@ importers: rimraf: 3.0.2 ts-jest: 29.0.3 ts-node: 10.9.1 - tsup: 6.3.0 - typescript: 5.0.0-dev.20230205 + tsup: 6.7.0 + typescript: 5.0.2 zod: 3.20.1 devDependencies: '@jest/globals': 29.3.1 @@ -48,10 +51,10 @@ importers: jest: 29.3.0_odkjkoia5xunhxkdrka32ib6vi multer: 1.4.5-lts.1 rimraf: 3.0.2 - ts-jest: 29.0.3_cixpoxvmfq77ejdo75mal5jgae - ts-node: 10.9.1_clhlce22dgpvbyysh2qtwubany - tsup: 6.3.0_rsclq4gjaebnhigadcukiszgly - typescript: 5.0.0-dev.20230205 + ts-jest: 29.0.3_scjnbz2tsh6ndqeps4y2s5svpu + ts-node: 10.9.1_e5zagbbrbtuenai5c7d63ieukq + tsup: 6.7.0_b3krtfsdr4o54pb3ito5mirk64 + typescript: 5.0.2 zod: 3.20.1 packages/core: @@ -67,8 +70,8 @@ importers: rimraf: 3.0.2 ts-jest: 29.0.3 ts-node: 10.9.1 - tsup: 6.3.0 - typescript: 5.0.0-dev.20230205 + tsup: 6.7.0 + typescript: 5.0.2 zod: 3.20.1 devDependencies: '@jest/globals': 29.3.1 @@ -80,10 +83,10 @@ importers: io-ts: 2.2.20_fp-ts@2.13.1 jest: 29.3.0_odkjkoia5xunhxkdrka32ib6vi rimraf: 3.0.2 - ts-jest: 29.0.3_cixpoxvmfq77ejdo75mal5jgae - ts-node: 10.9.1_clhlce22dgpvbyysh2qtwubany - tsup: 6.3.0_rsclq4gjaebnhigadcukiszgly - typescript: 5.0.0-dev.20230205 + ts-jest: 29.0.3_scjnbz2tsh6ndqeps4y2s5svpu + ts-node: 10.9.1_e5zagbbrbtuenai5c7d63ieukq + tsup: 6.7.0_b3krtfsdr4o54pb3ito5mirk64 + typescript: 5.0.2 zod: 3.20.1 packages/express: @@ -101,8 +104,8 @@ importers: supertest: 6.3.3 ts-jest: 29.0.5 ts-node: 10.9.1 - tsup: 6.3.0 - typescript: 5.0.0-dev.20230205 + tsup: 6.7.0 + typescript: 5.0.2 zod: 3.20.2 devDependencies: '@jest/globals': 29.3.1 @@ -116,10 +119,10 @@ importers: jest: 29.4.1_zfha7dvnw4nti6zkbsmhmn6xo4 rimraf: 4.1.2 supertest: 6.3.3 - ts-jest: 29.0.5_xdoexkzcxvnpxfujj7xiclht6y - ts-node: 10.9.1_qnxvsc4w2i6fzzhpuqmc4ahcpm - tsup: 6.3.0_rsclq4gjaebnhigadcukiszgly - typescript: 5.0.0-dev.20230205 + ts-jest: 29.0.5_tpjjq25prhfdj3gatfdhfd3u2e + ts-node: 10.9.1_dwbejauar3heyjbavp5dng3rsy + tsup: 6.7.0_b3krtfsdr4o54pb3ito5mirk64 + typescript: 5.0.2 zod: 3.20.2 packages/fetch: @@ -140,8 +143,8 @@ importers: rimraf: 3.0.2 ts-jest: 29.0.3 ts-node: 10.9.1 - tsup: 6.3.0 - typescript: 5.0.0-dev.20230205 + tsup: 6.7.0 + typescript: 5.0.2 zod: 3.20.1 devDependencies: '@jest/globals': 29.3.1 @@ -158,10 +161,10 @@ importers: jest: 29.3.0_odkjkoia5xunhxkdrka32ib6vi multer: 1.4.5-lts.1 rimraf: 3.0.2 - ts-jest: 29.0.3_cixpoxvmfq77ejdo75mal5jgae - ts-node: 10.9.1_clhlce22dgpvbyysh2qtwubany - tsup: 6.3.0_rsclq4gjaebnhigadcukiszgly - typescript: 5.0.0-dev.20230205 + ts-jest: 29.0.3_scjnbz2tsh6ndqeps4y2s5svpu + ts-node: 10.9.1_e5zagbbrbtuenai5c7d63ieukq + tsup: 6.7.0_b3krtfsdr4o54pb3ito5mirk64 + typescript: 5.0.2 zod: 3.20.1 packages/react: @@ -195,8 +198,8 @@ importers: rimraf: 3.0.2 ts-jest: 29.0.3 ts-node: 10.9.1 - tsup: 6.3.0 - typescript: 5.0.0-dev.20230205 + tsup: 6.7.0 + typescript: 5.0.2 zod: 3.20.1 devDependencies: '@jest/globals': 29.3.1 @@ -226,10 +229,10 @@ importers: react-dom: 18.2.0_react@18.2.0 react-test-renderer: 18.2.0_react@18.2.0 rimraf: 3.0.2 - ts-jest: 29.0.3_aisf35gghjn2ysvpjfeucu6fri - ts-node: 10.9.1_clhlce22dgpvbyysh2qtwubany - tsup: 6.3.0_rsclq4gjaebnhigadcukiszgly - typescript: 5.0.0-dev.20230205 + ts-jest: 29.0.3_ff4zxbw2zzokhzk2mi2gk62exe + ts-node: 10.9.1_e5zagbbrbtuenai5c7d63ieukq + tsup: 6.7.0_b3krtfsdr4o54pb3ito5mirk64 + typescript: 5.0.2 zod: 3.20.1 packages/testing: @@ -247,8 +250,8 @@ importers: rimraf: 3.0.2 ts-jest: 29.0.3 ts-node: 10.9.1 - tsup: 6.3.0 - typescript: 5.0.0-dev.20230205 + tsup: 6.7.0 + typescript: 5.0.2 zod: 3.20.1 devDependencies: '@jest/globals': 29.3.1 @@ -262,10 +265,10 @@ importers: io-ts: 2.2.20_fp-ts@2.13.1 jest: 29.3.0_odkjkoia5xunhxkdrka32ib6vi rimraf: 3.0.2 - ts-jest: 29.0.3_cixpoxvmfq77ejdo75mal5jgae - ts-node: 10.9.1_clhlce22dgpvbyysh2qtwubany - tsup: 6.3.0_rsclq4gjaebnhigadcukiszgly - typescript: 5.0.0-dev.20230205 + ts-jest: 29.0.3_scjnbz2tsh6ndqeps4y2s5svpu + ts-node: 10.9.1_e5zagbbrbtuenai5c7d63ieukq + tsup: 6.7.0_b3krtfsdr4o54pb3ito5mirk64 + typescript: 5.0.2 zod: 3.20.1 packages: @@ -810,8 +813,8 @@ packages: '@jridgewell/trace-mapping': 0.3.9 dev: true - /@esbuild/android-arm/0.15.13: - resolution: {integrity: sha512-RY2fVI8O0iFUNvZirXaQ1vMvK0xhCcl0gqRj74Z6yEiO1zAUa7hbsdwZM1kzqbxHK7LFyMizipfXT3JME+12Hw==} + /@esbuild/android-arm/0.17.14: + resolution: {integrity: sha512-0CnlwnjDU8cks0yJLXfkaU/uoLyRf9VZJs4p1PskBr2AlAHeEsFEwJEo0of/Z3g+ilw5mpyDwThlxzNEIxOE4g==} engines: {node: '>=12'} cpu: [arm] os: [android] @@ -819,8 +822,89 @@ packages: dev: true optional: true - /@esbuild/linux-loong64/0.15.13: - resolution: {integrity: sha512-+BoyIm4I8uJmH/QDIH0fu7MG0AEx9OXEDXnqptXCwKOlOqZiS4iraH1Nr7/ObLMokW3sOCeBNyD68ATcV9b9Ag==} + /@esbuild/android-arm64/0.17.14: + resolution: {integrity: sha512-eLOpPO1RvtsP71afiFTvS7tVFShJBCT0txiv/xjFBo5a7R7Gjw7X0IgIaFoLKhqXYAXhahoXm7qAmRXhY4guJg==} + engines: {node: '>=12'} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/android-x64/0.17.14: + resolution: {integrity: sha512-nrfQYWBfLGfSGLvRVlt6xi63B5IbfHm3tZCdu/82zuFPQ7zez4XjmRtF/wIRYbJQ/DsZrxJdEvYFE67avYXyng==} + engines: {node: '>=12'} + cpu: [x64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/darwin-arm64/0.17.14: + resolution: {integrity: sha512-eoSjEuDsU1ROwgBH/c+fZzuSyJUVXQTOIN9xuLs9dE/9HbV/A5IqdXHU1p2OfIMwBwOYJ9SFVGGldxeRCUJFyw==} + engines: {node: '>=12'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@esbuild/darwin-x64/0.17.14: + resolution: {integrity: sha512-zN0U8RWfrDttdFNkHqFYZtOH8hdi22z0pFm0aIJPsNC4QQZv7je8DWCX5iA4Zx6tRhS0CCc0XC2m7wKsbWEo5g==} + engines: {node: '>=12'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@esbuild/freebsd-arm64/0.17.14: + resolution: {integrity: sha512-z0VcD4ibeZWVQCW1O7szaLxGsx54gcCnajEJMdYoYjLiq4g1jrP2lMq6pk71dbS5+7op/L2Aod+erw+EUr28/A==} + engines: {node: '>=12'} + cpu: [arm64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/freebsd-x64/0.17.14: + resolution: {integrity: sha512-hd9mPcxfTgJlolrPlcXkQk9BMwNBvNBsVaUe5eNUqXut6weDQH8whcNaKNF2RO8NbpT6GY8rHOK2A9y++s+ehw==} + engines: {node: '>=12'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-arm/0.17.14: + resolution: {integrity: sha512-BNTl+wSJ1omsH8s3TkQmIIIQHwvwJrU9u1ggb9XU2KTVM4TmthRIVyxSp2qxROJHhZuW/r8fht46/QE8hU8Qvg==} + engines: {node: '>=12'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-arm64/0.17.14: + resolution: {integrity: sha512-FhAMNYOq3Iblcj9i+K0l1Fp/MHt+zBeRu/Qkf0LtrcFu3T45jcwB6A1iMsemQ42vR3GBhjNZJZTaCe3VFPbn9g==} + engines: {node: '>=12'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-ia32/0.17.14: + resolution: {integrity: sha512-91OK/lQ5y2v7AsmnFT+0EyxdPTNhov3y2CWMdizyMfxSxRqHazXdzgBKtlmkU2KYIc+9ZK3Vwp2KyXogEATYxQ==} + engines: {node: '>=12'} + cpu: [ia32] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-loong64/0.17.14: + resolution: {integrity: sha512-vp15H+5NR6hubNgMluqqKza85HcGJgq7t6rMH7O3Y6ApiOWPkvW2AJfNojUQimfTp6OUrACUXfR4hmpcENXoMQ==} engines: {node: '>=12'} cpu: [loong64] os: [linux] @@ -828,6 +912,105 @@ packages: dev: true optional: true + /@esbuild/linux-mips64el/0.17.14: + resolution: {integrity: sha512-90TOdFV7N+fgi6c2+GO9ochEkmm9kBAKnuD5e08GQMgMINOdOFHuYLPQ91RYVrnWwQ5683sJKuLi9l4SsbJ7Hg==} + engines: {node: '>=12'} + cpu: [mips64el] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-ppc64/0.17.14: + resolution: {integrity: sha512-NnBGeoqKkTugpBOBZZoktQQ1Yqb7aHKmHxsw43NddPB2YWLAlpb7THZIzsRsTr0Xw3nqiPxbA1H31ZMOG+VVPQ==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-riscv64/0.17.14: + resolution: {integrity: sha512-0qdlKScLXA8MGVy21JUKvMzCYWovctuP8KKqhtE5A6IVPq4onxXhSuhwDd2g5sRCzNDlDjitc5sX31BzDoL5Fw==} + engines: {node: '>=12'} + cpu: [riscv64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-s390x/0.17.14: + resolution: {integrity: sha512-Hdm2Jo1yaaOro4v3+6/zJk6ygCqIZuSDJHdHaf8nVH/tfOuoEX5Riv03Ka15LmQBYJObUTNS1UdyoMk0WUn9Ww==} + engines: {node: '>=12'} + cpu: [s390x] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-x64/0.17.14: + resolution: {integrity: sha512-8KHF17OstlK4DuzeF/KmSgzrTWQrkWj5boluiiq7kvJCiQVzUrmSkaBvcLB2UgHpKENO2i6BthPkmUhNDaJsVw==} + engines: {node: '>=12'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/netbsd-x64/0.17.14: + resolution: {integrity: sha512-nVwpqvb3yyXztxIT2+VsxJhB5GCgzPdk1n0HHSnchRAcxqKO6ghXwHhJnr0j/B+5FSyEqSxF4q03rbA2fKXtUQ==} + engines: {node: '>=12'} + cpu: [x64] + os: [netbsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/openbsd-x64/0.17.14: + resolution: {integrity: sha512-1RZ7uQQ9zcy/GSAJL1xPdN7NDdOOtNEGiJalg/MOzeakZeTrgH/DoCkbq7TaPDiPhWqnDF+4bnydxRqQD7il6g==} + engines: {node: '>=12'} + cpu: [x64] + os: [openbsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/sunos-x64/0.17.14: + resolution: {integrity: sha512-nqMjDsFwv7vp7msrwWRysnM38Sd44PKmW8EzV01YzDBTcTWUpczQg6mGao9VLicXSgW/iookNK6AxeogNVNDZA==} + engines: {node: '>=12'} + cpu: [x64] + os: [sunos] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-arm64/0.17.14: + resolution: {integrity: sha512-xrD0mccTKRBBIotrITV7WVQAwNJ5+1va6L0H9zN92v2yEdjfAN7864cUaZwJS7JPEs53bDTzKFbfqVlG2HhyKQ==} + engines: {node: '>=12'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-ia32/0.17.14: + resolution: {integrity: sha512-nXpkz9bbJrLLyUTYtRotSS3t5b+FOuljg8LgLdINWFs3FfqZMtbnBCZFUmBzQPyxqU87F8Av+3Nco/M3hEcu1w==} + engines: {node: '>=12'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-x64/0.17.14: + resolution: {integrity: sha512-gPQmsi2DKTaEgG14hc3CHXHp62k8g6qr0Pas+I4lUxRMugGSATh/Bi8Dgusoz9IQ0IfdrvLpco6kujEIBoaogA==} + engines: {node: '>=12'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@istanbuljs/load-nyc-config/1.1.0: resolution: {integrity: sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==} engines: {node: '>=8'} @@ -2077,13 +2260,13 @@ packages: resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} dev: true - /bundle-require/3.1.2_esbuild@0.15.13: - resolution: {integrity: sha512-Of6l6JBAxiyQ5axFxUM6dYeP/W7X2Sozeo/4EYB9sJhL+dqL7TKjg+shwxp6jlu/6ZSERfsYtIpSJ1/x3XkAEA==} + /bundle-require/4.0.1_esbuild@0.17.14: + resolution: {integrity: sha512-9NQkRHlNdNpDBGmLpngF3EFDcwodhMUuLz9PaWYciVcQF9SE4LFjM2DB/xV1Li5JiuDMv7ZUWuC3rGbqR0MAXQ==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} peerDependencies: - esbuild: '>=0.13' + esbuild: '>=0.17' dependencies: - esbuild: 0.15.13 + esbuild: 0.17.14 load-tsconfig: 0.2.3 dev: true @@ -2651,214 +2834,34 @@ packages: is-symbol: 1.0.4 dev: true - /esbuild-android-64/0.15.13: - resolution: {integrity: sha512-yRorukXBlokwTip+Sy4MYskLhJsO0Kn0/Fj43s1krVblfwP+hMD37a4Wmg139GEsMLl+vh8WXp2mq/cTA9J97g==} - engines: {node: '>=12'} - cpu: [x64] - os: [android] - requiresBuild: true - dev: true - optional: true - - /esbuild-android-arm64/0.15.13: - resolution: {integrity: sha512-TKzyymLD6PiVeyYa4c5wdPw87BeAiTXNtK6amWUcXZxkV51gOk5u5qzmDaYSwiWeecSNHamFsaFjLoi32QR5/w==} - engines: {node: '>=12'} - cpu: [arm64] - os: [android] - requiresBuild: true - dev: true - optional: true - - /esbuild-darwin-64/0.15.13: - resolution: {integrity: sha512-WAx7c2DaOS6CrRcoYCgXgkXDliLnFv3pQLV6GeW1YcGEZq2Gnl8s9Pg7ahValZkpOa0iE/ojRVQ87sbUhF1Cbg==} - engines: {node: '>=12'} - cpu: [x64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - - /esbuild-darwin-arm64/0.15.13: - resolution: {integrity: sha512-U6jFsPfSSxC3V1CLiQqwvDuj3GGrtQNB3P3nNC3+q99EKf94UGpsG9l4CQ83zBs1NHrk1rtCSYT0+KfK5LsD8A==} - engines: {node: '>=12'} - cpu: [arm64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - - /esbuild-freebsd-64/0.15.13: - resolution: {integrity: sha512-whItJgDiOXaDG/idy75qqevIpZjnReZkMGCgQaBWZuKHoElDJC1rh7MpoUgupMcdfOd+PgdEwNQW9DAE6i8wyA==} - engines: {node: '>=12'} - cpu: [x64] - os: [freebsd] - requiresBuild: true - dev: true - optional: true - - /esbuild-freebsd-arm64/0.15.13: - resolution: {integrity: sha512-6pCSWt8mLUbPtygv7cufV0sZLeylaMwS5Fznj6Rsx9G2AJJsAjQ9ifA+0rQEIg7DwJmi9it+WjzNTEAzzdoM3Q==} - engines: {node: '>=12'} - cpu: [arm64] - os: [freebsd] - requiresBuild: true - dev: true - optional: true - - /esbuild-linux-32/0.15.13: - resolution: {integrity: sha512-VbZdWOEdrJiYApm2kkxoTOgsoCO1krBZ3quHdYk3g3ivWaMwNIVPIfEE0f0XQQ0u5pJtBsnk2/7OPiCFIPOe/w==} - engines: {node: '>=12'} - cpu: [ia32] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /esbuild-linux-64/0.15.13: - resolution: {integrity: sha512-rXmnArVNio6yANSqDQlIO4WiP+Cv7+9EuAHNnag7rByAqFVuRusLbGi2697A5dFPNXoO//IiogVwi3AdcfPC6A==} - engines: {node: '>=12'} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /esbuild-linux-arm/0.15.13: - resolution: {integrity: sha512-Ac6LpfmJO8WhCMQmO253xX2IU2B3wPDbl4IvR0hnqcPrdfCaUa2j/lLMGTjmQ4W5JsJIdHEdW12dG8lFS0MbxQ==} - engines: {node: '>=12'} - cpu: [arm] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /esbuild-linux-arm64/0.15.13: - resolution: {integrity: sha512-alEMGU4Z+d17U7KQQw2IV8tQycO6T+rOrgW8OS22Ua25x6kHxoG6Ngry6Aq6uranC+pNWNMB6aHFPh7aTQdORQ==} - engines: {node: '>=12'} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /esbuild-linux-mips64le/0.15.13: - resolution: {integrity: sha512-47PgmyYEu+yN5rD/MbwS6DxP2FSGPo4Uxg5LwIdxTiyGC2XKwHhHyW7YYEDlSuXLQXEdTO7mYe8zQ74czP7W8A==} - engines: {node: '>=12'} - cpu: [mips64el] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /esbuild-linux-ppc64le/0.15.13: - resolution: {integrity: sha512-z6n28h2+PC1Ayle9DjKoBRcx/4cxHoOa2e689e2aDJSaKug3jXcQw7mM+GLg+9ydYoNzj8QxNL8ihOv/OnezhA==} - engines: {node: '>=12'} - cpu: [ppc64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /esbuild-linux-riscv64/0.15.13: - resolution: {integrity: sha512-+Lu4zuuXuQhgLUGyZloWCqTslcCAjMZH1k3Xc9MSEJEpEFdpsSU0sRDXAnk18FKOfEjhu4YMGaykx9xjtpA6ow==} - engines: {node: '>=12'} - cpu: [riscv64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /esbuild-linux-s390x/0.15.13: - resolution: {integrity: sha512-BMeXRljruf7J0TMxD5CIXS65y7puiZkAh+s4XFV9qy16SxOuMhxhVIXYLnbdfLrsYGFzx7U9mcdpFWkkvy/Uag==} - engines: {node: '>=12'} - cpu: [s390x] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /esbuild-netbsd-64/0.15.13: - resolution: {integrity: sha512-EHj9QZOTel581JPj7UO3xYbltFTYnHy+SIqJVq6yd3KkCrsHRbapiPb0Lx3EOOtybBEE9EyqbmfW1NlSDsSzvQ==} - engines: {node: '>=12'} - cpu: [x64] - os: [netbsd] - requiresBuild: true - dev: true - optional: true - - /esbuild-openbsd-64/0.15.13: - resolution: {integrity: sha512-nkuDlIjF/sfUhfx8SKq0+U+Fgx5K9JcPq1mUodnxI0x4kBdCv46rOGWbuJ6eof2n3wdoCLccOoJAbg9ba/bT2w==} - engines: {node: '>=12'} - cpu: [x64] - os: [openbsd] - requiresBuild: true - dev: true - optional: true - - /esbuild-sunos-64/0.15.13: - resolution: {integrity: sha512-jVeu2GfxZQ++6lRdY43CS0Tm/r4WuQQ0Pdsrxbw+aOrHQPHV0+LNOLnvbN28M7BSUGnJnHkHm2HozGgNGyeIRw==} - engines: {node: '>=12'} - cpu: [x64] - os: [sunos] - requiresBuild: true - dev: true - optional: true - - /esbuild-windows-32/0.15.13: - resolution: {integrity: sha512-XoF2iBf0wnqo16SDq+aDGi/+QbaLFpkiRarPVssMh9KYbFNCqPLlGAWwDvxEVz+ywX6Si37J2AKm+AXq1kC0JA==} - engines: {node: '>=12'} - cpu: [ia32] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /esbuild-windows-64/0.15.13: - resolution: {integrity: sha512-Et6htEfGycjDrtqb2ng6nT+baesZPYQIW+HUEHK4D1ncggNrDNk3yoboYQ5KtiVrw/JaDMNttz8rrPubV/fvPQ==} - engines: {node: '>=12'} - cpu: [x64] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /esbuild-windows-arm64/0.15.13: - resolution: {integrity: sha512-3bv7tqntThQC9SWLRouMDmZnlOukBhOCTlkzNqzGCmrkCJI7io5LLjwJBOVY6kOUlIvdxbooNZwjtBvj+7uuVg==} - engines: {node: '>=12'} - cpu: [arm64] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /esbuild/0.15.13: - resolution: {integrity: sha512-Cu3SC84oyzzhrK/YyN4iEVy2jZu5t2fz66HEOShHURcjSkOSAVL8C/gfUT+lDJxkVHpg8GZ10DD0rMHRPqMFaQ==} + /esbuild/0.17.14: + resolution: {integrity: sha512-vOO5XhmVj/1XQR9NQ1UPq6qvMYL7QFJU57J5fKBKBKxp17uDt5PgxFDb4A2nEiXhr1qQs4x0F5+66hVVw4ruNw==} engines: {node: '>=12'} hasBin: true requiresBuild: true optionalDependencies: - '@esbuild/android-arm': 0.15.13 - '@esbuild/linux-loong64': 0.15.13 - esbuild-android-64: 0.15.13 - esbuild-android-arm64: 0.15.13 - esbuild-darwin-64: 0.15.13 - esbuild-darwin-arm64: 0.15.13 - esbuild-freebsd-64: 0.15.13 - esbuild-freebsd-arm64: 0.15.13 - esbuild-linux-32: 0.15.13 - esbuild-linux-64: 0.15.13 - esbuild-linux-arm: 0.15.13 - esbuild-linux-arm64: 0.15.13 - esbuild-linux-mips64le: 0.15.13 - esbuild-linux-ppc64le: 0.15.13 - esbuild-linux-riscv64: 0.15.13 - esbuild-linux-s390x: 0.15.13 - esbuild-netbsd-64: 0.15.13 - esbuild-openbsd-64: 0.15.13 - esbuild-sunos-64: 0.15.13 - esbuild-windows-32: 0.15.13 - esbuild-windows-64: 0.15.13 - esbuild-windows-arm64: 0.15.13 + '@esbuild/android-arm': 0.17.14 + '@esbuild/android-arm64': 0.17.14 + '@esbuild/android-x64': 0.17.14 + '@esbuild/darwin-arm64': 0.17.14 + '@esbuild/darwin-x64': 0.17.14 + '@esbuild/freebsd-arm64': 0.17.14 + '@esbuild/freebsd-x64': 0.17.14 + '@esbuild/linux-arm': 0.17.14 + '@esbuild/linux-arm64': 0.17.14 + '@esbuild/linux-ia32': 0.17.14 + '@esbuild/linux-loong64': 0.17.14 + '@esbuild/linux-mips64el': 0.17.14 + '@esbuild/linux-ppc64': 0.17.14 + '@esbuild/linux-riscv64': 0.17.14 + '@esbuild/linux-s390x': 0.17.14 + '@esbuild/linux-x64': 0.17.14 + '@esbuild/netbsd-x64': 0.17.14 + '@esbuild/openbsd-x64': 0.17.14 + '@esbuild/sunos-x64': 0.17.14 + '@esbuild/win32-arm64': 0.17.14 + '@esbuild/win32-ia32': 0.17.14 + '@esbuild/win32-x64': 0.17.14 dev: true /escalade/3.1.1: @@ -3862,7 +3865,7 @@ packages: pretty-format: 29.4.1 slash: 3.0.0 strip-json-comments: 3.1.1 - ts-node: 10.9.1_clhlce22dgpvbyysh2qtwubany + ts-node: 10.9.1_e5zagbbrbtuenai5c7d63ieukq transitivePeerDependencies: - supports-color dev: true @@ -3902,7 +3905,7 @@ packages: pretty-format: 29.4.1 slash: 3.0.0 strip-json-comments: 3.1.1 - ts-node: 10.9.1_clhlce22dgpvbyysh2qtwubany + ts-node: 10.9.1_e5zagbbrbtuenai5c7d63ieukq transitivePeerDependencies: - supports-color dev: true @@ -3942,7 +3945,7 @@ packages: pretty-format: 29.4.1 slash: 3.0.0 strip-json-comments: 3.1.1 - ts-node: 10.9.1_qnxvsc4w2i6fzzhpuqmc4ahcpm + ts-node: 10.9.1_dwbejauar3heyjbavp5dng3rsy transitivePeerDependencies: - supports-color dev: true @@ -5215,7 +5218,7 @@ packages: optional: true dependencies: lilconfig: 2.0.6 - ts-node: 10.9.1_clhlce22dgpvbyysh2qtwubany + ts-node: 10.9.1_e5zagbbrbtuenai5c7d63ieukq yaml: 1.10.2 dev: true @@ -5526,9 +5529,9 @@ packages: hasBin: true dev: true - /rollup/2.79.1: - resolution: {integrity: sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==} - engines: {node: '>=10.0.0'} + /rollup/3.19.1: + resolution: {integrity: sha512-lAbrdN7neYCg/8WaoWn/ckzCtz+jr70GFfYdlf50OF7387HTg+wiuiqJRFYawwSPpqfqDNYqK7smY/ks2iAudg==} + engines: {node: '>=14.18.0', npm: '>=8.0.0'} hasBin: true optionalDependencies: fsevents: 2.3.2 @@ -6005,7 +6008,7 @@ packages: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} dev: true - /ts-jest/29.0.3_aisf35gghjn2ysvpjfeucu6fri: + /ts-jest/29.0.3_ff4zxbw2zzokhzk2mi2gk62exe: resolution: {integrity: sha512-Ibygvmuyq1qp/z3yTh9QTwVVAbFdDy/+4BtIQR2sp6baF2SJU/8CKK/hhnGIDY2L90Az2jIqTwZPnN2p+BweiQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -6035,11 +6038,11 @@ packages: lodash.memoize: 4.1.2 make-error: 1.3.6 semver: 7.3.8 - typescript: 5.0.0-dev.20230205 + typescript: 5.0.2 yargs-parser: 21.1.1 dev: true - /ts-jest/29.0.3_cixpoxvmfq77ejdo75mal5jgae: + /ts-jest/29.0.3_scjnbz2tsh6ndqeps4y2s5svpu: resolution: {integrity: sha512-Ibygvmuyq1qp/z3yTh9QTwVVAbFdDy/+4BtIQR2sp6baF2SJU/8CKK/hhnGIDY2L90Az2jIqTwZPnN2p+BweiQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -6069,11 +6072,11 @@ packages: lodash.memoize: 4.1.2 make-error: 1.3.6 semver: 7.3.8 - typescript: 5.0.0-dev.20230205 + typescript: 5.0.2 yargs-parser: 21.1.1 dev: true - /ts-jest/29.0.5_xdoexkzcxvnpxfujj7xiclht6y: + /ts-jest/29.0.5_tpjjq25prhfdj3gatfdhfd3u2e: resolution: {integrity: sha512-PL3UciSgIpQ7f6XjVOmbi96vmDHUqAyqDr8YxzopDqX3kfgYtX1cuNeBjP+L9sFXi6nzsGGA6R3fP3DDDJyrxA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -6103,11 +6106,11 @@ packages: lodash.memoize: 4.1.2 make-error: 1.3.6 semver: 7.3.8 - typescript: 5.0.0-dev.20230205 + typescript: 5.0.2 yargs-parser: 21.1.1 dev: true - /ts-node/10.9.1_clhlce22dgpvbyysh2qtwubany: + /ts-node/10.9.1_dwbejauar3heyjbavp5dng3rsy: resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true peerDependencies: @@ -6126,19 +6129,19 @@ packages: '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.3 - '@types/node': 18.11.9 + '@types/node': 18.11.18 acorn: 8.8.1 acorn-walk: 8.2.0 arg: 4.1.3 create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 5.0.0-dev.20230205 + typescript: 5.0.2 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 dev: true - /ts-node/10.9.1_qnxvsc4w2i6fzzhpuqmc4ahcpm: + /ts-node/10.9.1_e5zagbbrbtuenai5c7d63ieukq: resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true peerDependencies: @@ -6157,26 +6160,26 @@ packages: '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.3 - '@types/node': 18.11.18 + '@types/node': 18.11.9 acorn: 8.8.1 acorn-walk: 8.2.0 arg: 4.1.3 create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 5.0.0-dev.20230205 + typescript: 5.0.2 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 dev: true - /tsup/6.3.0_rsclq4gjaebnhigadcukiszgly: - resolution: {integrity: sha512-IaNQO/o1rFgadLhNonVKNCT2cks+vvnWX3DnL8sB87lBDqRvJXHENr5lSPJlqwplUlDxSwZK8dSg87rgBu6Emw==} - engines: {node: '>=14'} + /tsup/6.7.0_b3krtfsdr4o54pb3ito5mirk64: + resolution: {integrity: sha512-L3o8hGkaHnu5TdJns+mCqFsDBo83bJ44rlK7e6VdanIvpea4ArPcU3swWGsLVbXak1PqQx/V+SSmFPujBK+zEQ==} + engines: {node: '>=14.18'} hasBin: true peerDependencies: '@swc/core': ^1 postcss: ^8.4.12 - typescript: ^4.1.0 + typescript: '>=4.1.0' peerDependenciesMeta: '@swc/core': optional: true @@ -6185,21 +6188,21 @@ packages: typescript: optional: true dependencies: - bundle-require: 3.1.2_esbuild@0.15.13 + bundle-require: 4.0.1_esbuild@0.17.14 cac: 6.7.14 chokidar: 3.5.3 debug: 4.3.4 - esbuild: 0.15.13 + esbuild: 0.17.14 execa: 5.1.1 globby: 11.1.0 joycon: 3.1.1 postcss-load-config: 3.1.4_ts-node@10.9.1 resolve-from: 5.0.0 - rollup: 2.79.1 + rollup: 3.19.1 source-map: 0.8.0-beta.0 sucrase: 3.28.0 tree-kill: 1.2.2 - typescript: 5.0.0-dev.20230205 + typescript: 5.0.2 transitivePeerDependencies: - supports-color - ts-node @@ -6324,9 +6327,9 @@ packages: resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} dev: true - /typescript/5.0.0-dev.20230205: - resolution: {integrity: sha512-2JheM588BM/CnAyWEw96WYKV1f0o+dBuh1iOgBdt7BmlYA2YkOe4SvzDWE/Zo3LULAh9TD9TLMtep7qC9LPJhQ==} - engines: {node: '>=4.2.0'} + /typescript/5.0.2: + resolution: {integrity: sha512-wVORMBGO/FAs/++blGNeAVdbNKtIh1rbBL2EyQ1+J9lClJ93KiiKe8PmFIVdXhHcyv44SL9oglmfeSsndo0jRw==} + engines: {node: '>=12.20'} hasBin: true dev: true diff --git a/website/package.json b/website/package.json index 01f8456d..b3e14081 100644 --- a/website/package.json +++ b/website/package.json @@ -28,7 +28,7 @@ "devDependencies": { "@docusaurus/module-type-aliases": "^2.3.1", "@tsconfig/docusaurus": "1.0.6", - "typescript": "5.0.1-rc" + "typescript": "5.0.2" }, "browserslist": { "production": [ From 4d6434281ba4c9dd02ab83259de6b9cd2ac6b42a Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sun, 26 Mar 2023 19:03:09 +0200 Subject: [PATCH 123/206] chore(deps): upgrade deps --- package.json | 4 +- packages/axios/package.json | 20 +- packages/core/package.json | 16 +- packages/express/package.json | 19 +- packages/fetch/package.json | 18 +- packages/react/package.json | 34 +- packages/testing/package.json | 16 +- pnpm-lock.yaml | 2819 ++++++++++++--------------------- 8 files changed, 1109 insertions(+), 1837 deletions(-) diff --git a/package.json b/package.json index 624a6d13..c3de7a52 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,8 @@ }, "private": true, "devDependencies": { - "@changesets/cli": "2.25.2", - "turbo": "1.6.3", + "@changesets/cli": "2.26.1", + "turbo": "1.8.5", "typescript": "5.0.2" }, "pnpm": { diff --git a/packages/axios/package.json b/packages/axios/package.json index 4ef4e316..179e51cb 100644 --- a/packages/axios/package.json +++ b/packages/axios/package.json @@ -59,24 +59,24 @@ } }, "devDependencies": { - "@jest/globals": "29.3.1", - "@jest/types": "29.3.1", - "@types/express": "4.17.16", - "@types/jest": "29.2.2", + "@jest/globals": "29.5.0", + "@jest/types": "29.5.0", + "@types/express": "4.17.17", + "@types/jest": "29.5.0", "@types/multer": "1.4.7", - "@types/node": "18.11.9", + "@types/node": "18.15.10", "@zodios/core": "workspace:*", - "axios": "1.2.5", + "axios": "1.3.4", "express": "4.18.2", "fp-ts": "2.13.1", "io-ts": "2.2.20", - "jest": "29.3.0", + "jest": "29.5.0", "multer": "1.4.5-lts.1", - "rimraf": "3.0.2", - "ts-jest": "29.0.3", + "rimraf": "4.4.1", + "ts-jest": "29.0.5", "ts-node": "10.9.1", "tsup": "6.7.0", "typescript": "5.0.2", - "zod": "3.20.1" + "zod": "3.21.4" } } diff --git a/packages/core/package.json b/packages/core/package.json index 4bd39a8f..00f8d0b1 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -61,19 +61,19 @@ } }, "devDependencies": { - "@jest/globals": "29.3.1", - "@jest/types": "29.3.1", - "@types/jest": "29.2.2", - "@types/node": "18.11.9", + "@jest/globals": "29.5.0", + "@jest/types": "29.5.0", + "@types/jest": "29.5.0", + "@types/node": "18.15.10", "form-data": "^4.0.0", "fp-ts": "2.13.1", "io-ts": "2.2.20", - "jest": "29.3.0", - "rimraf": "3.0.2", - "ts-jest": "29.0.3", + "jest": "29.5.0", + "rimraf": "4.4.1", + "ts-jest": "29.0.5", "ts-node": "10.9.1", "tsup": "6.7.0", "typescript": "5.0.2", - "zod": "3.20.1" + "zod": "3.21.4" } } diff --git a/packages/express/package.json b/packages/express/package.json index ac375314..47b578f6 100644 --- a/packages/express/package.json +++ b/packages/express/package.json @@ -43,22 +43,21 @@ "zod": "^3.x" }, "devDependencies": { - "@jest/globals": "29.3.1", - "@jest/types": "29.3.1", - "@types/express": "4.17.16", - "@types/jest": "29.4.0", - "@types/node": "18.11.18", + "@jest/globals": "29.5.0", + "@jest/types": "29.5.0", + "@types/express": "4.17.17", + "@types/jest": "29.5.0", + "@types/node": "18.15.10", "@types/supertest": "2.0.12", "@zodios/core": "workspace:*", "express": "4.18.2", - "jest": "29.4.1", - "rimraf": "4.1.2", + "jest": "29.5.0", + "rimraf": "4.4.1", "supertest": "6.3.3", "ts-jest": "29.0.5", "ts-node": "10.9.1", "tsup": "6.7.0", "typescript": "5.0.2", - "zod": "3.20.2" - }, - "dependencies": {} + "zod": "3.21.4" + } } diff --git a/packages/fetch/package.json b/packages/fetch/package.json index 38e06a53..0c53db08 100644 --- a/packages/fetch/package.json +++ b/packages/fetch/package.json @@ -56,24 +56,24 @@ } }, "devDependencies": { - "@jest/globals": "29.3.1", - "@jest/types": "29.3.1", - "@types/express": "4.17.16", - "@types/jest": "29.2.2", + "@jest/globals": "29.5.0", + "@jest/types": "29.5.0", + "@types/express": "4.17.17", + "@types/jest": "29.5.0", "@types/multer": "1.4.7", - "@types/node": "18.11.9", + "@types/node": "18.15.10", "@zodios/core": "workspace:*", "cross-fetch": "3.1.5", "express": "4.18.2", "fp-ts": "2.13.1", "io-ts": "2.2.20", - "jest": "29.3.0", + "jest": "29.5.0", "multer": "1.4.5-lts.1", - "rimraf": "3.0.2", - "ts-jest": "29.0.3", + "rimraf": "4.4.1", + "ts-jest": "29.0.5", "ts-node": "10.9.1", "tsup": "6.7.0", "typescript": "5.0.2", - "zod": "3.20.1" + "zod": "3.21.4" } } diff --git a/packages/react/package.json b/packages/react/package.json index 470b7240..cf67af6c 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -40,8 +40,8 @@ }, "peerDependencies": { "@tanstack/react-query": "4.x", - "@zodios/core": "11.0.0-beta.17", "@zodios/axios": "11.0.0-beta.17", + "@zodios/core": "11.0.0-beta.17", "@zodios/fetch": "11.0.0-beta.17", "react": ">=16.8.0" }, @@ -54,37 +54,37 @@ } }, "devDependencies": { - "@jest/globals": "29.3.1", - "@jest/types": "29.3.1", - "@tanstack/react-query": "4.18.0", - "@testing-library/dom": "8.19.0", + "@jest/globals": "29.5.0", + "@jest/types": "29.5.0", + "@tanstack/react-query": "4.28.0", + "@testing-library/dom": "9.2.0", "@testing-library/jest-dom": "5.16.5", - "@testing-library/react": "13.4.0", + "@testing-library/react": "14.0.0", "@testing-library/react-hooks": "8.0.1", "@testing-library/user-event": "14.4.3", - "@types/cors": "2.8.12", - "@types/express": "4.17.16", - "@types/jest": "29.2.3", - "@types/node": "18.11.9", - "@types/react": "18.0.25", - "@zodios/core": "workspace:*", + "@types/cors": "2.8.13", + "@types/express": "4.17.17", + "@types/jest": "29.5.0", + "@types/node": "18.15.10", + "@types/react": "18.0.29", "@zodios/axios": "workspace:*", + "@zodios/core": "workspace:*", "@zodios/fetch": "workspace:*", "cors": "2.8.5", "cross-fetch": "3.1.5", "express": "4.18.2", "fp-ts": "2.13.1", "io-ts": "2.2.20", - "jest": "29.3.1", - "jest-environment-jsdom": "29.3.1", + "jest": "29.5.0", + "jest-environment-jsdom": "29.5.0", "react": "18.2.0", "react-dom": "18.2.0", "react-test-renderer": "18.2.0", - "rimraf": "3.0.2", - "ts-jest": "29.0.3", + "rimraf": "4.4.1", + "ts-jest": "29.0.5", "ts-node": "10.9.1", "tsup": "6.7.0", "typescript": "5.0.2", - "zod": "3.20.1" + "zod": "3.21.4" } } diff --git a/packages/testing/package.json b/packages/testing/package.json index f2b0cb4a..c5e0fc05 100644 --- a/packages/testing/package.json +++ b/packages/testing/package.json @@ -40,21 +40,21 @@ "@zodios/core": "11.0.0-beta.17" }, "devDependencies": { - "@jest/globals": "29.3.1", - "@jest/types": "29.3.1", - "@types/jest": "29.2.2", - "@types/node": "18.11.9", + "@jest/globals": "29.5.0", + "@jest/types": "29.5.0", + "@types/jest": "29.5.0", + "@types/node": "18.15.10", "@zodios/core": "workspace:*", "@zodios/fetch": "workspace:*", "form-data": "^4.0.0", "fp-ts": "2.13.1", "io-ts": "2.2.20", - "jest": "29.3.0", - "rimraf": "3.0.2", - "ts-jest": "29.0.3", + "jest": "29.5.0", + "rimraf": "4.4.1", + "ts-jest": "29.0.5", "ts-node": "10.9.1", "tsup": "6.7.0", "typescript": "5.0.2", - "zod": "3.20.1" + "zod": "3.21.4" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1131035d..79b95cd6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -7,181 +7,181 @@ importers: .: specifiers: - '@changesets/cli': 2.25.2 - turbo: 1.6.3 + '@changesets/cli': 2.26.1 + turbo: 1.8.5 typescript: 5.0.2 devDependencies: - '@changesets/cli': 2.25.2 - turbo: 1.6.3 + '@changesets/cli': 2.26.1 + turbo: 1.8.5 typescript: 5.0.2 packages/axios: specifiers: - '@jest/globals': 29.3.1 - '@jest/types': 29.3.1 - '@types/express': 4.17.16 - '@types/jest': 29.2.2 + '@jest/globals': 29.5.0 + '@jest/types': 29.5.0 + '@types/express': 4.17.17 + '@types/jest': 29.5.0 '@types/multer': 1.4.7 - '@types/node': 18.11.9 + '@types/node': 18.15.10 '@zodios/core': workspace:* - axios: 1.2.5 + axios: 1.3.4 express: 4.18.2 fp-ts: 2.13.1 io-ts: 2.2.20 - jest: 29.3.0 + jest: 29.5.0 multer: 1.4.5-lts.1 - rimraf: 3.0.2 - ts-jest: 29.0.3 + rimraf: 4.4.1 + ts-jest: 29.0.5 ts-node: 10.9.1 tsup: 6.7.0 typescript: 5.0.2 - zod: 3.20.1 + zod: 3.21.4 devDependencies: - '@jest/globals': 29.3.1 - '@jest/types': 29.3.1 - '@types/express': 4.17.16 - '@types/jest': 29.2.2 + '@jest/globals': 29.5.0 + '@jest/types': 29.5.0 + '@types/express': 4.17.17 + '@types/jest': 29.5.0 '@types/multer': 1.4.7 - '@types/node': 18.11.9 + '@types/node': 18.15.10 '@zodios/core': link:../core - axios: 1.2.5 + axios: 1.3.4 express: 4.18.2 fp-ts: 2.13.1 io-ts: 2.2.20_fp-ts@2.13.1 - jest: 29.3.0_odkjkoia5xunhxkdrka32ib6vi + jest: 29.5.0_m54q5dse6x3xfnwbnypkikpaee multer: 1.4.5-lts.1 - rimraf: 3.0.2 - ts-jest: 29.0.3_scjnbz2tsh6ndqeps4y2s5svpu - ts-node: 10.9.1_e5zagbbrbtuenai5c7d63ieukq + rimraf: 4.4.1 + ts-jest: 29.0.5_63eeh5l64lewq762rxfh3frani + ts-node: 10.9.1_zd7fjxbseldtiwc6h6ujrbvxuy tsup: 6.7.0_b3krtfsdr4o54pb3ito5mirk64 typescript: 5.0.2 - zod: 3.20.1 + zod: 3.21.4 packages/core: specifiers: - '@jest/globals': 29.3.1 - '@jest/types': 29.3.1 - '@types/jest': 29.2.2 - '@types/node': 18.11.9 + '@jest/globals': 29.5.0 + '@jest/types': 29.5.0 + '@types/jest': 29.5.0 + '@types/node': 18.15.10 form-data: ^4.0.0 fp-ts: 2.13.1 io-ts: 2.2.20 - jest: 29.3.0 - rimraf: 3.0.2 - ts-jest: 29.0.3 + jest: 29.5.0 + rimraf: 4.4.1 + ts-jest: 29.0.5 ts-node: 10.9.1 tsup: 6.7.0 typescript: 5.0.2 - zod: 3.20.1 + zod: 3.21.4 devDependencies: - '@jest/globals': 29.3.1 - '@jest/types': 29.3.1 - '@types/jest': 29.2.2 - '@types/node': 18.11.9 + '@jest/globals': 29.5.0 + '@jest/types': 29.5.0 + '@types/jest': 29.5.0 + '@types/node': 18.15.10 form-data: 4.0.0 fp-ts: 2.13.1 io-ts: 2.2.20_fp-ts@2.13.1 - jest: 29.3.0_odkjkoia5xunhxkdrka32ib6vi - rimraf: 3.0.2 - ts-jest: 29.0.3_scjnbz2tsh6ndqeps4y2s5svpu - ts-node: 10.9.1_e5zagbbrbtuenai5c7d63ieukq + jest: 29.5.0_m54q5dse6x3xfnwbnypkikpaee + rimraf: 4.4.1 + ts-jest: 29.0.5_63eeh5l64lewq762rxfh3frani + ts-node: 10.9.1_zd7fjxbseldtiwc6h6ujrbvxuy tsup: 6.7.0_b3krtfsdr4o54pb3ito5mirk64 typescript: 5.0.2 - zod: 3.20.1 + zod: 3.21.4 packages/express: specifiers: - '@jest/globals': 29.3.1 - '@jest/types': 29.3.1 - '@types/express': 4.17.16 - '@types/jest': 29.4.0 - '@types/node': 18.11.18 + '@jest/globals': 29.5.0 + '@jest/types': 29.5.0 + '@types/express': 4.17.17 + '@types/jest': 29.5.0 + '@types/node': 18.15.10 '@types/supertest': 2.0.12 '@zodios/core': workspace:* express: 4.18.2 - jest: 29.4.1 - rimraf: 4.1.2 + jest: 29.5.0 + rimraf: 4.4.1 supertest: 6.3.3 ts-jest: 29.0.5 ts-node: 10.9.1 tsup: 6.7.0 typescript: 5.0.2 - zod: 3.20.2 + zod: 3.21.4 devDependencies: - '@jest/globals': 29.3.1 - '@jest/types': 29.3.1 - '@types/express': 4.17.16 - '@types/jest': 29.4.0 - '@types/node': 18.11.18 + '@jest/globals': 29.5.0 + '@jest/types': 29.5.0 + '@types/express': 4.17.17 + '@types/jest': 29.5.0 + '@types/node': 18.15.10 '@types/supertest': 2.0.12 '@zodios/core': link:../core express: 4.18.2 - jest: 29.4.1_zfha7dvnw4nti6zkbsmhmn6xo4 - rimraf: 4.1.2 + jest: 29.5.0_m54q5dse6x3xfnwbnypkikpaee + rimraf: 4.4.1 supertest: 6.3.3 - ts-jest: 29.0.5_tpjjq25prhfdj3gatfdhfd3u2e - ts-node: 10.9.1_dwbejauar3heyjbavp5dng3rsy + ts-jest: 29.0.5_63eeh5l64lewq762rxfh3frani + ts-node: 10.9.1_zd7fjxbseldtiwc6h6ujrbvxuy tsup: 6.7.0_b3krtfsdr4o54pb3ito5mirk64 typescript: 5.0.2 - zod: 3.20.2 + zod: 3.21.4 packages/fetch: specifiers: - '@jest/globals': 29.3.1 - '@jest/types': 29.3.1 - '@types/express': 4.17.16 - '@types/jest': 29.2.2 + '@jest/globals': 29.5.0 + '@jest/types': 29.5.0 + '@types/express': 4.17.17 + '@types/jest': 29.5.0 '@types/multer': 1.4.7 - '@types/node': 18.11.9 + '@types/node': 18.15.10 '@zodios/core': workspace:* cross-fetch: 3.1.5 express: 4.18.2 fp-ts: 2.13.1 io-ts: 2.2.20 - jest: 29.3.0 + jest: 29.5.0 multer: 1.4.5-lts.1 - rimraf: 3.0.2 - ts-jest: 29.0.3 + rimraf: 4.4.1 + ts-jest: 29.0.5 ts-node: 10.9.1 tsup: 6.7.0 typescript: 5.0.2 - zod: 3.20.1 + zod: 3.21.4 devDependencies: - '@jest/globals': 29.3.1 - '@jest/types': 29.3.1 - '@types/express': 4.17.16 - '@types/jest': 29.2.2 + '@jest/globals': 29.5.0 + '@jest/types': 29.5.0 + '@types/express': 4.17.17 + '@types/jest': 29.5.0 '@types/multer': 1.4.7 - '@types/node': 18.11.9 + '@types/node': 18.15.10 '@zodios/core': link:../core cross-fetch: 3.1.5 express: 4.18.2 fp-ts: 2.13.1 io-ts: 2.2.20_fp-ts@2.13.1 - jest: 29.3.0_odkjkoia5xunhxkdrka32ib6vi + jest: 29.5.0_m54q5dse6x3xfnwbnypkikpaee multer: 1.4.5-lts.1 - rimraf: 3.0.2 - ts-jest: 29.0.3_scjnbz2tsh6ndqeps4y2s5svpu - ts-node: 10.9.1_e5zagbbrbtuenai5c7d63ieukq + rimraf: 4.4.1 + ts-jest: 29.0.5_63eeh5l64lewq762rxfh3frani + ts-node: 10.9.1_zd7fjxbseldtiwc6h6ujrbvxuy tsup: 6.7.0_b3krtfsdr4o54pb3ito5mirk64 typescript: 5.0.2 - zod: 3.20.1 + zod: 3.21.4 packages/react: specifiers: - '@jest/globals': 29.3.1 - '@jest/types': 29.3.1 - '@tanstack/react-query': 4.18.0 - '@testing-library/dom': 8.19.0 + '@jest/globals': 29.5.0 + '@jest/types': 29.5.0 + '@tanstack/react-query': 4.28.0 + '@testing-library/dom': 9.2.0 '@testing-library/jest-dom': 5.16.5 - '@testing-library/react': 13.4.0 + '@testing-library/react': 14.0.0 '@testing-library/react-hooks': 8.0.1 '@testing-library/user-event': 14.4.3 - '@types/cors': 2.8.12 - '@types/express': 4.17.16 - '@types/jest': 29.2.3 - '@types/node': 18.11.9 - '@types/react': 18.0.25 + '@types/cors': 2.8.13 + '@types/express': 4.17.17 + '@types/jest': 29.5.0 + '@types/node': 18.15.10 + '@types/react': 18.0.29 '@zodios/axios': workspace:* '@zodios/core': workspace:* '@zodios/fetch': workspace:* @@ -190,31 +190,31 @@ importers: express: 4.18.2 fp-ts: 2.13.1 io-ts: 2.2.20 - jest: 29.3.1 - jest-environment-jsdom: 29.3.1 + jest: 29.5.0 + jest-environment-jsdom: 29.5.0 react: 18.2.0 react-dom: 18.2.0 react-test-renderer: 18.2.0 - rimraf: 3.0.2 - ts-jest: 29.0.3 + rimraf: 4.4.1 + ts-jest: 29.0.5 ts-node: 10.9.1 tsup: 6.7.0 typescript: 5.0.2 - zod: 3.20.1 + zod: 3.21.4 devDependencies: - '@jest/globals': 29.3.1 - '@jest/types': 29.3.1 - '@tanstack/react-query': 4.18.0_biqbaboplfbrettd7655fr4n2y - '@testing-library/dom': 8.19.0 + '@jest/globals': 29.5.0 + '@jest/types': 29.5.0 + '@tanstack/react-query': 4.28.0_biqbaboplfbrettd7655fr4n2y + '@testing-library/dom': 9.2.0 '@testing-library/jest-dom': 5.16.5 - '@testing-library/react': 13.4.0_biqbaboplfbrettd7655fr4n2y - '@testing-library/react-hooks': 8.0.1_djah6xjkh3i2bchfafvsnwdbb4 - '@testing-library/user-event': 14.4.3_aaq3sbffpfe3jnxzm2zngsddei - '@types/cors': 2.8.12 - '@types/express': 4.17.16 - '@types/jest': 29.2.3 - '@types/node': 18.11.9 - '@types/react': 18.0.25 + '@testing-library/react': 14.0.0_biqbaboplfbrettd7655fr4n2y + '@testing-library/react-hooks': 8.0.1_fjn3d3aefc35pidgaewxy3ws2e + '@testing-library/user-event': 14.4.3_@testing-library+dom@9.2.0 + '@types/cors': 2.8.13 + '@types/express': 4.17.17 + '@types/jest': 29.5.0 + '@types/node': 18.15.10 + '@types/react': 18.0.29 '@zodios/axios': link:../axios '@zodios/core': link:../core '@zodios/fetch': link:../fetch @@ -223,58 +223,58 @@ importers: express: 4.18.2 fp-ts: 2.13.1 io-ts: 2.2.20_fp-ts@2.13.1 - jest: 29.3.1_odkjkoia5xunhxkdrka32ib6vi - jest-environment-jsdom: 29.3.1 + jest: 29.5.0_m54q5dse6x3xfnwbnypkikpaee + jest-environment-jsdom: 29.5.0 react: 18.2.0 react-dom: 18.2.0_react@18.2.0 react-test-renderer: 18.2.0_react@18.2.0 - rimraf: 3.0.2 - ts-jest: 29.0.3_ff4zxbw2zzokhzk2mi2gk62exe - ts-node: 10.9.1_e5zagbbrbtuenai5c7d63ieukq + rimraf: 4.4.1 + ts-jest: 29.0.5_63eeh5l64lewq762rxfh3frani + ts-node: 10.9.1_zd7fjxbseldtiwc6h6ujrbvxuy tsup: 6.7.0_b3krtfsdr4o54pb3ito5mirk64 typescript: 5.0.2 - zod: 3.20.1 + zod: 3.21.4 packages/testing: specifiers: - '@jest/globals': 29.3.1 - '@jest/types': 29.3.1 - '@types/jest': 29.2.2 - '@types/node': 18.11.9 + '@jest/globals': 29.5.0 + '@jest/types': 29.5.0 + '@types/jest': 29.5.0 + '@types/node': 18.15.10 '@zodios/core': workspace:* '@zodios/fetch': workspace:* form-data: ^4.0.0 fp-ts: 2.13.1 io-ts: 2.2.20 - jest: 29.3.0 - rimraf: 3.0.2 - ts-jest: 29.0.3 + jest: 29.5.0 + rimraf: 4.4.1 + ts-jest: 29.0.5 ts-node: 10.9.1 tsup: 6.7.0 typescript: 5.0.2 - zod: 3.20.1 + zod: 3.21.4 devDependencies: - '@jest/globals': 29.3.1 - '@jest/types': 29.3.1 - '@types/jest': 29.2.2 - '@types/node': 18.11.9 + '@jest/globals': 29.5.0 + '@jest/types': 29.5.0 + '@types/jest': 29.5.0 + '@types/node': 18.15.10 '@zodios/core': link:../core '@zodios/fetch': link:../fetch form-data: 4.0.0 fp-ts: 2.13.1 io-ts: 2.2.20_fp-ts@2.13.1 - jest: 29.3.0_odkjkoia5xunhxkdrka32ib6vi - rimraf: 3.0.2 - ts-jest: 29.0.3_scjnbz2tsh6ndqeps4y2s5svpu - ts-node: 10.9.1_e5zagbbrbtuenai5c7d63ieukq + jest: 29.5.0_m54q5dse6x3xfnwbnypkikpaee + rimraf: 4.4.1 + ts-jest: 29.0.5_63eeh5l64lewq762rxfh3frani + ts-node: 10.9.1_zd7fjxbseldtiwc6h6ujrbvxuy tsup: 6.7.0_b3krtfsdr4o54pb3ito5mirk64 typescript: 5.0.2 - zod: 3.20.1 + zod: 3.21.4 packages: - /@adobe/css-tools/4.0.1: - resolution: {integrity: sha512-+u76oB43nOHrF4DDWRLWDCtci7f3QJoEBigemIdIeTi1ODqjx6Tad9NCVnPRwewWlKkVab5PlK8DCtPTyX7S8g==} + /@adobe/css-tools/4.2.0: + resolution: {integrity: sha512-E09FiIft46CmH5Qnjb0wsW54/YQd69LsxeKUOWawmws1XWvyFGURnAChH0mlr7YPFR1ofwvUQfcL0J3lMxXqPA==} dev: true /@ampproject/remapping/2.2.0: @@ -292,53 +292,55 @@ packages: '@babel/highlight': 7.18.6 dev: true - /@babel/compat-data/7.20.1: - resolution: {integrity: sha512-EWZ4mE2diW3QALKvDMiXnbZpRvlj+nayZ112nK93SnhqOtpdsbVD4W+2tEoT3YNBAG9RBR0ISY758ZkOgsn6pQ==} + /@babel/compat-data/7.21.0: + resolution: {integrity: sha512-gMuZsmsgxk/ENC3O/fRw5QY8A9/uxQbbCEypnLIiYYc/qVJtEV7ouxC3EllIIwNzMqAQee5tanFabWsUOutS7g==} engines: {node: '>=6.9.0'} dev: true - /@babel/core/7.20.2: - resolution: {integrity: sha512-w7DbG8DtMrJcFOi4VrLm+8QM4az8Mo+PuLBKLp2zrYRCow8W/f9xiXm5sN53C8HksCyDQwCKha9JiDoIyPjT2g==} + /@babel/core/7.21.3: + resolution: {integrity: sha512-qIJONzoa/qiHghnm0l1n4i/6IIziDpzqc36FBs4pzMhDUraHqponwJLiAKm1hGLP3OSB/TVNz6rMwVGpwxxySw==} engines: {node: '>=6.9.0'} dependencies: '@ampproject/remapping': 2.2.0 '@babel/code-frame': 7.18.6 - '@babel/generator': 7.20.4 - '@babel/helper-compilation-targets': 7.20.0_@babel+core@7.20.2 - '@babel/helper-module-transforms': 7.20.2 - '@babel/helpers': 7.20.1 - '@babel/parser': 7.20.3 - '@babel/template': 7.18.10 - '@babel/traverse': 7.20.1 - '@babel/types': 7.20.2 + '@babel/generator': 7.21.3 + '@babel/helper-compilation-targets': 7.20.7_@babel+core@7.21.3 + '@babel/helper-module-transforms': 7.21.2 + '@babel/helpers': 7.21.0 + '@babel/parser': 7.21.3 + '@babel/template': 7.20.7 + '@babel/traverse': 7.21.3 + '@babel/types': 7.21.3 convert-source-map: 1.9.0 debug: 4.3.4 gensync: 1.0.0-beta.2 - json5: 2.2.1 + json5: 2.2.3 semver: 6.3.0 transitivePeerDependencies: - supports-color dev: true - /@babel/generator/7.20.4: - resolution: {integrity: sha512-luCf7yk/cm7yab6CAW1aiFnmEfBJplb/JojV56MYEK7ziWfGmFlTfmL9Ehwfy4gFhbjBfWO1wj7/TuSbVNEEtA==} + /@babel/generator/7.21.3: + resolution: {integrity: sha512-QS3iR1GYC/YGUnW7IdggFeN5c1poPUurnGttOV/bZgPGV+izC/D8HnD6DLwod0fsatNyVn1G3EVWMYIF0nHbeA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.20.2 + '@babel/types': 7.21.3 '@jridgewell/gen-mapping': 0.3.2 + '@jridgewell/trace-mapping': 0.3.17 jsesc: 2.5.2 dev: true - /@babel/helper-compilation-targets/7.20.0_@babel+core@7.20.2: - resolution: {integrity: sha512-0jp//vDGp9e8hZzBc6N/KwA5ZK3Wsm/pfm4CrY7vzegkVxc65SgSn6wYOnwHe9Js9HRQ1YTCKLGPzDtaS3RoLQ==} + /@babel/helper-compilation-targets/7.20.7_@babel+core@7.21.3: + resolution: {integrity: sha512-4tGORmfQcrc+bvrjb5y3dG9Mx1IOZjsHqQVUz7XCNHO+iTmqxWnVg3KRygjGmpRLJGdQSKuvFinbIb0CnZwHAQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/compat-data': 7.20.1 - '@babel/core': 7.20.2 - '@babel/helper-validator-option': 7.18.6 - browserslist: 4.21.4 + '@babel/compat-data': 7.21.0 + '@babel/core': 7.21.3 + '@babel/helper-validator-option': 7.21.0 + browserslist: 4.21.5 + lru-cache: 5.1.1 semver: 6.3.0 dev: true @@ -347,30 +349,30 @@ packages: engines: {node: '>=6.9.0'} dev: true - /@babel/helper-function-name/7.19.0: - resolution: {integrity: sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w==} + /@babel/helper-function-name/7.21.0: + resolution: {integrity: sha512-HfK1aMRanKHpxemaY2gqBmL04iAPOPRj7DxtNbiDOrJK+gdwkiNRVpCpUJYbUT+aZyemKN8brqTOxzCaG6ExRg==} engines: {node: '>=6.9.0'} dependencies: - '@babel/template': 7.18.10 - '@babel/types': 7.20.2 + '@babel/template': 7.20.7 + '@babel/types': 7.21.3 dev: true /@babel/helper-hoist-variables/7.18.6: resolution: {integrity: sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.20.2 + '@babel/types': 7.21.3 dev: true /@babel/helper-module-imports/7.18.6: resolution: {integrity: sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.20.2 + '@babel/types': 7.21.3 dev: true - /@babel/helper-module-transforms/7.20.2: - resolution: {integrity: sha512-zvBKyJXRbmK07XhMuujYoJ48B5yvvmM6+wcpv6Ivj4Yg6qO7NOZOSnvZN9CRl1zz1Z4cKf8YejmCMh8clOoOeA==} + /@babel/helper-module-transforms/7.21.2: + resolution: {integrity: sha512-79yj2AR4U/Oqq/WOV7Lx6hUjau1Zfo4cI+JLAVYeMV5XIlbOhmjEk5ulbTc9fMpmlojzZHkUUxAiK+UKn+hNQQ==} engines: {node: '>=6.9.0'} dependencies: '@babel/helper-environment-visitor': 7.18.9 @@ -378,9 +380,9 @@ packages: '@babel/helper-simple-access': 7.20.2 '@babel/helper-split-export-declaration': 7.18.6 '@babel/helper-validator-identifier': 7.19.1 - '@babel/template': 7.18.10 - '@babel/traverse': 7.20.1 - '@babel/types': 7.20.2 + '@babel/template': 7.20.7 + '@babel/traverse': 7.21.3 + '@babel/types': 7.21.3 transitivePeerDependencies: - supports-color dev: true @@ -394,14 +396,14 @@ packages: resolution: {integrity: sha512-+0woI/WPq59IrqDYbVGfshjT5Dmk/nnbdpcF8SnMhhXObpTq2KNBdLFRFrkVdbDOyUmHBCxzm5FHV1rACIkIbA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.20.2 + '@babel/types': 7.21.3 dev: true /@babel/helper-split-export-declaration/7.18.6: resolution: {integrity: sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.20.2 + '@babel/types': 7.21.3 dev: true /@babel/helper-string-parser/7.19.4: @@ -414,18 +416,18 @@ packages: engines: {node: '>=6.9.0'} dev: true - /@babel/helper-validator-option/7.18.6: - resolution: {integrity: sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw==} + /@babel/helper-validator-option/7.21.0: + resolution: {integrity: sha512-rmL/B8/f0mKS2baE9ZpyTcTavvEuWhTTW8amjzXNvYG4AwBsqTLikfXsEofsJEfKHf+HQVQbFOHy6o+4cnC/fQ==} engines: {node: '>=6.9.0'} dev: true - /@babel/helpers/7.20.1: - resolution: {integrity: sha512-J77mUVaDTUJFZ5BpP6mMn6OIl3rEWymk2ZxDBQJUG3P+PbmyMcF3bYWvz0ma69Af1oobDqT/iAsvzhB58xhQUg==} + /@babel/helpers/7.21.0: + resolution: {integrity: sha512-XXve0CBtOW0pd7MRzzmoyuSj0e3SEzj8pgyFxnTT1NJZL38BD1MK7yYrm8yefRPIDvNNe14xR4FdbHwpInD4rA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/template': 7.18.10 - '@babel/traverse': 7.20.1 - '@babel/types': 7.20.2 + '@babel/template': 7.20.7 + '@babel/traverse': 7.21.3 + '@babel/types': 7.21.3 transitivePeerDependencies: - supports-color dev: true @@ -439,179 +441,179 @@ packages: js-tokens: 4.0.0 dev: true - /@babel/parser/7.20.3: - resolution: {integrity: sha512-OP/s5a94frIPXwjzEcv5S/tpQfc6XhxYUnmWpgdqMWGgYCuErA3SzozaRAMQgSZWKeTJxht9aWAkUY+0UzvOFg==} + /@babel/parser/7.21.3: + resolution: {integrity: sha512-lobG0d7aOfQRXh8AyklEAgZGvA4FShxo6xQbUrrT/cNBPUdIDojlokwJsQyCC/eKia7ifqM0yP+2DRZ4WKw2RQ==} engines: {node: '>=6.0.0'} hasBin: true dependencies: - '@babel/types': 7.20.2 + '@babel/types': 7.21.3 dev: true - /@babel/plugin-syntax-async-generators/7.8.4_@babel+core@7.20.2: + /@babel/plugin-syntax-async-generators/7.8.4_@babel+core@7.21.3: resolution: {integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.20.2 + '@babel/core': 7.21.3 '@babel/helper-plugin-utils': 7.20.2 dev: true - /@babel/plugin-syntax-bigint/7.8.3_@babel+core@7.20.2: + /@babel/plugin-syntax-bigint/7.8.3_@babel+core@7.21.3: resolution: {integrity: sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.20.2 + '@babel/core': 7.21.3 '@babel/helper-plugin-utils': 7.20.2 dev: true - /@babel/plugin-syntax-class-properties/7.12.13_@babel+core@7.20.2: + /@babel/plugin-syntax-class-properties/7.12.13_@babel+core@7.21.3: resolution: {integrity: sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.20.2 + '@babel/core': 7.21.3 '@babel/helper-plugin-utils': 7.20.2 dev: true - /@babel/plugin-syntax-import-meta/7.10.4_@babel+core@7.20.2: + /@babel/plugin-syntax-import-meta/7.10.4_@babel+core@7.21.3: resolution: {integrity: sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.20.2 + '@babel/core': 7.21.3 '@babel/helper-plugin-utils': 7.20.2 dev: true - /@babel/plugin-syntax-json-strings/7.8.3_@babel+core@7.20.2: + /@babel/plugin-syntax-json-strings/7.8.3_@babel+core@7.21.3: resolution: {integrity: sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.20.2 + '@babel/core': 7.21.3 '@babel/helper-plugin-utils': 7.20.2 dev: true - /@babel/plugin-syntax-jsx/7.18.6_@babel+core@7.20.2: + /@babel/plugin-syntax-jsx/7.18.6_@babel+core@7.21.3: resolution: {integrity: sha512-6mmljtAedFGTWu2p/8WIORGwy+61PLgOMPOdazc7YoJ9ZCWUyFy3A6CpPkRKLKD1ToAesxX8KGEViAiLo9N+7Q==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.20.2 + '@babel/core': 7.21.3 '@babel/helper-plugin-utils': 7.20.2 dev: true - /@babel/plugin-syntax-logical-assignment-operators/7.10.4_@babel+core@7.20.2: + /@babel/plugin-syntax-logical-assignment-operators/7.10.4_@babel+core@7.21.3: resolution: {integrity: sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.20.2 + '@babel/core': 7.21.3 '@babel/helper-plugin-utils': 7.20.2 dev: true - /@babel/plugin-syntax-nullish-coalescing-operator/7.8.3_@babel+core@7.20.2: + /@babel/plugin-syntax-nullish-coalescing-operator/7.8.3_@babel+core@7.21.3: resolution: {integrity: sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.20.2 + '@babel/core': 7.21.3 '@babel/helper-plugin-utils': 7.20.2 dev: true - /@babel/plugin-syntax-numeric-separator/7.10.4_@babel+core@7.20.2: + /@babel/plugin-syntax-numeric-separator/7.10.4_@babel+core@7.21.3: resolution: {integrity: sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.20.2 + '@babel/core': 7.21.3 '@babel/helper-plugin-utils': 7.20.2 dev: true - /@babel/plugin-syntax-object-rest-spread/7.8.3_@babel+core@7.20.2: + /@babel/plugin-syntax-object-rest-spread/7.8.3_@babel+core@7.21.3: resolution: {integrity: sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.20.2 + '@babel/core': 7.21.3 '@babel/helper-plugin-utils': 7.20.2 dev: true - /@babel/plugin-syntax-optional-catch-binding/7.8.3_@babel+core@7.20.2: + /@babel/plugin-syntax-optional-catch-binding/7.8.3_@babel+core@7.21.3: resolution: {integrity: sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.20.2 + '@babel/core': 7.21.3 '@babel/helper-plugin-utils': 7.20.2 dev: true - /@babel/plugin-syntax-optional-chaining/7.8.3_@babel+core@7.20.2: + /@babel/plugin-syntax-optional-chaining/7.8.3_@babel+core@7.21.3: resolution: {integrity: sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.20.2 + '@babel/core': 7.21.3 '@babel/helper-plugin-utils': 7.20.2 dev: true - /@babel/plugin-syntax-top-level-await/7.14.5_@babel+core@7.20.2: + /@babel/plugin-syntax-top-level-await/7.14.5_@babel+core@7.21.3: resolution: {integrity: sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.20.2 + '@babel/core': 7.21.3 '@babel/helper-plugin-utils': 7.20.2 dev: true - /@babel/plugin-syntax-typescript/7.20.0_@babel+core@7.20.2: + /@babel/plugin-syntax-typescript/7.20.0_@babel+core@7.21.3: resolution: {integrity: sha512-rd9TkG+u1CExzS4SM1BlMEhMXwFLKVjOAFFCDx9PbX5ycJWDoWMcwdJH9RhkPu1dOgn5TrxLot/Gx6lWFuAUNQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.20.2 + '@babel/core': 7.21.3 '@babel/helper-plugin-utils': 7.20.2 dev: true - /@babel/runtime/7.20.1: - resolution: {integrity: sha512-mrzLkl6U9YLF8qpqI7TB82PESyEGjm/0Ly91jG575eVxMMlb8fYfOXFZIJ8XfLrJZQbm7dlKry2bJmXBUEkdFg==} + /@babel/runtime/7.21.0: + resolution: {integrity: sha512-xwII0//EObnq89Ji5AKYQaRYiW/nZ3llSv29d49IuxPhKbtJoLP+9QUUZ4nVragQVtaVGeZrpB+ZtG/Pdy/POw==} engines: {node: '>=6.9.0'} dependencies: - regenerator-runtime: 0.13.10 + regenerator-runtime: 0.13.11 dev: true - /@babel/template/7.18.10: - resolution: {integrity: sha512-TI+rCtooWHr3QJ27kJxfjutghu44DLnasDMwpDqCXVTal9RLp3RSYNh4NdBrRP2cQAoG9A8juOQl6P6oZG4JxA==} + /@babel/template/7.20.7: + resolution: {integrity: sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw==} engines: {node: '>=6.9.0'} dependencies: '@babel/code-frame': 7.18.6 - '@babel/parser': 7.20.3 - '@babel/types': 7.20.2 + '@babel/parser': 7.21.3 + '@babel/types': 7.21.3 dev: true - /@babel/traverse/7.20.1: - resolution: {integrity: sha512-d3tN8fkVJwFLkHkBN479SOsw4DMZnz8cdbL/gvuDuzy3TS6Nfw80HuQqhw1pITbIruHyh7d1fMA47kWzmcUEGA==} + /@babel/traverse/7.21.3: + resolution: {integrity: sha512-XLyopNeaTancVitYZe2MlUEvgKb6YVVPXzofHgqHijCImG33b/uTurMS488ht/Hbsb2XK3U2BnSTxKVNGV3nGQ==} engines: {node: '>=6.9.0'} dependencies: '@babel/code-frame': 7.18.6 - '@babel/generator': 7.20.4 + '@babel/generator': 7.21.3 '@babel/helper-environment-visitor': 7.18.9 - '@babel/helper-function-name': 7.19.0 + '@babel/helper-function-name': 7.21.0 '@babel/helper-hoist-variables': 7.18.6 '@babel/helper-split-export-declaration': 7.18.6 - '@babel/parser': 7.20.3 - '@babel/types': 7.20.2 + '@babel/parser': 7.21.3 + '@babel/types': 7.21.3 debug: 4.3.4 globals: 11.12.0 transitivePeerDependencies: - supports-color dev: true - /@babel/types/7.20.2: - resolution: {integrity: sha512-FnnvsNWgZCr232sqtXggapvlkk/tuwR/qhGzcmxI0GXLCjmPYQPzio2FbdlWuY6y1sHFfQKk+rRbUZ9VStQMog==} + /@babel/types/7.21.3: + resolution: {integrity: sha512-sBGdETxC+/M4o/zKC0sl6sjWv62WFR/uzxrJ6uYyMLZOUlPnwzw0tKgVHOXxaAd5l2g8pEDM5RZ495GPQI77kg==} engines: {node: '>=6.9.0'} dependencies: '@babel/helper-string-parser': 7.19.4 @@ -623,59 +625,59 @@ packages: resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} dev: true - /@changesets/apply-release-plan/6.1.2: - resolution: {integrity: sha512-H8TV9E/WtJsDfoDVbrDGPXmkZFSv7W2KLqp4xX4MKZXshb0hsQZUNowUa8pnus9qb/5OZrFFRVsUsDCVHNW/AQ==} + /@changesets/apply-release-plan/6.1.3: + resolution: {integrity: sha512-ECDNeoc3nfeAe1jqJb5aFQX7CqzQhD2klXRez2JDb/aVpGUbX673HgKrnrgJRuQR/9f2TtLoYIzrGB9qwD77mg==} dependencies: - '@babel/runtime': 7.20.1 - '@changesets/config': 2.2.0 + '@babel/runtime': 7.21.0 + '@changesets/config': 2.3.0 '@changesets/get-version-range-type': 0.3.2 - '@changesets/git': 1.5.0 - '@changesets/types': 5.2.0 + '@changesets/git': 2.0.0 + '@changesets/types': 5.2.1 '@manypkg/get-packages': 1.1.3 detect-indent: 6.1.0 fs-extra: 7.0.1 lodash.startcase: 4.4.0 outdent: 0.5.0 - prettier: 2.7.1 + prettier: 2.8.7 resolve-from: 5.0.0 semver: 5.7.1 dev: true - /@changesets/assemble-release-plan/5.2.2: - resolution: {integrity: sha512-B1qxErQd85AeZgZFZw2bDKyOfdXHhG+X5S+W3Da2yCem8l/pRy4G/S7iOpEcMwg6lH8q2ZhgbZZwZ817D+aLuQ==} + /@changesets/assemble-release-plan/5.2.3: + resolution: {integrity: sha512-g7EVZCmnWz3zMBAdrcKhid4hkHT+Ft1n0mLussFMcB1dE2zCuwcvGoy9ec3yOgPGF4hoMtgHaMIk3T3TBdvU9g==} dependencies: - '@babel/runtime': 7.20.1 + '@babel/runtime': 7.21.0 '@changesets/errors': 0.1.4 - '@changesets/get-dependents-graph': 1.3.4 - '@changesets/types': 5.2.0 + '@changesets/get-dependents-graph': 1.3.5 + '@changesets/types': 5.2.1 '@manypkg/get-packages': 1.1.3 semver: 5.7.1 dev: true - /@changesets/changelog-git/0.1.13: - resolution: {integrity: sha512-zvJ50Q+EUALzeawAxax6nF2WIcSsC5PwbuLeWkckS8ulWnuPYx8Fn/Sjd3rF46OzeKA8t30loYYV6TIzp4DIdg==} + /@changesets/changelog-git/0.1.14: + resolution: {integrity: sha512-+vRfnKtXVWsDDxGctOfzJsPhaCdXRYoe+KyWYoq5X/GqoISREiat0l3L8B0a453B2B4dfHGcZaGyowHbp9BSaA==} dependencies: - '@changesets/types': 5.2.0 + '@changesets/types': 5.2.1 dev: true - /@changesets/cli/2.25.2: - resolution: {integrity: sha512-ACScBJXI3kRyMd2R8n8SzfttDHi4tmKSwVwXBazJOylQItSRSF4cGmej2E4FVf/eNfGy6THkL9GzAahU9ErZrA==} + /@changesets/cli/2.26.1: + resolution: {integrity: sha512-XnTa+b51vt057fyAudvDKGB0Sh72xutQZNAdXkCqPBKO2zvs2yYZx5hFZj1u9cbtpwM6Sxtcr02/FQJfZOzemQ==} hasBin: true dependencies: - '@babel/runtime': 7.20.1 - '@changesets/apply-release-plan': 6.1.2 - '@changesets/assemble-release-plan': 5.2.2 - '@changesets/changelog-git': 0.1.13 - '@changesets/config': 2.2.0 + '@babel/runtime': 7.21.0 + '@changesets/apply-release-plan': 6.1.3 + '@changesets/assemble-release-plan': 5.2.3 + '@changesets/changelog-git': 0.1.14 + '@changesets/config': 2.3.0 '@changesets/errors': 0.1.4 - '@changesets/get-dependents-graph': 1.3.4 - '@changesets/get-release-plan': 3.0.15 - '@changesets/git': 1.5.0 + '@changesets/get-dependents-graph': 1.3.5 + '@changesets/get-release-plan': 3.0.16 + '@changesets/git': 2.0.0 '@changesets/logger': 0.0.5 - '@changesets/pre': 1.0.13 - '@changesets/read': 0.5.8 - '@changesets/types': 5.2.0 - '@changesets/write': 0.2.2 + '@changesets/pre': 1.0.14 + '@changesets/read': 0.5.9 + '@changesets/types': 5.2.1 + '@changesets/write': 0.2.3 '@manypkg/get-packages': 1.1.3 '@types/is-ci': 3.0.0 '@types/semver': 6.2.3 @@ -694,16 +696,16 @@ packages: semver: 5.7.1 spawndamnit: 2.0.0 term-size: 2.2.1 - tty-table: 4.1.6 + tty-table: 4.2.1 dev: true - /@changesets/config/2.2.0: - resolution: {integrity: sha512-GGaokp3nm5FEDk/Fv2PCRcQCOxGKKPRZ7prcMqxEr7VSsG75MnChQE8plaW1k6V8L2bJE+jZWiRm19LbnproOw==} + /@changesets/config/2.3.0: + resolution: {integrity: sha512-EgP/px6mhCx8QeaMAvWtRrgyxW08k/Bx2tpGT+M84jEdX37v3VKfh4Cz1BkwrYKuMV2HZKeHOh8sHvja/HcXfQ==} dependencies: '@changesets/errors': 0.1.4 - '@changesets/get-dependents-graph': 1.3.4 + '@changesets/get-dependents-graph': 1.3.5 '@changesets/logger': 0.0.5 - '@changesets/types': 5.2.0 + '@changesets/types': 5.2.1 '@manypkg/get-packages': 1.1.3 fs-extra: 7.0.1 micromatch: 4.0.5 @@ -715,25 +717,25 @@ packages: extendable-error: 0.1.7 dev: true - /@changesets/get-dependents-graph/1.3.4: - resolution: {integrity: sha512-+C4AOrrFY146ydrgKOo5vTZfj7vetNu1tWshOID+UjPUU9afYGDXI8yLnAeib1ffeBXV3TuGVcyphKpJ3cKe+A==} + /@changesets/get-dependents-graph/1.3.5: + resolution: {integrity: sha512-w1eEvnWlbVDIY8mWXqWuYE9oKhvIaBhzqzo4ITSJY9hgoqQ3RoBqwlcAzg11qHxv/b8ReDWnMrpjpKrW6m1ZTA==} dependencies: - '@changesets/types': 5.2.0 + '@changesets/types': 5.2.1 '@manypkg/get-packages': 1.1.3 chalk: 2.4.2 fs-extra: 7.0.1 semver: 5.7.1 dev: true - /@changesets/get-release-plan/3.0.15: - resolution: {integrity: sha512-W1tFwxE178/en+zSj/Nqbc3mvz88mcdqUMJhRzN1jDYqN3QI4ifVaRF9mcWUU+KI0gyYEtYR65tour690PqTcA==} + /@changesets/get-release-plan/3.0.16: + resolution: {integrity: sha512-OpP9QILpBp1bY2YNIKFzwigKh7Qe9KizRsZomzLe6pK8IUo8onkAAVUD8+JRKSr8R7d4+JRuQrfSSNlEwKyPYg==} dependencies: - '@babel/runtime': 7.20.1 - '@changesets/assemble-release-plan': 5.2.2 - '@changesets/config': 2.2.0 - '@changesets/pre': 1.0.13 - '@changesets/read': 0.5.8 - '@changesets/types': 5.2.0 + '@babel/runtime': 7.21.0 + '@changesets/assemble-release-plan': 5.2.3 + '@changesets/config': 2.3.0 + '@changesets/pre': 1.0.14 + '@changesets/read': 0.5.9 + '@changesets/types': 5.2.1 '@manypkg/get-packages': 1.1.3 dev: true @@ -741,14 +743,15 @@ packages: resolution: {integrity: sha512-SVqwYs5pULYjYT4op21F2pVbcrca4qA/bAA3FmFXKMN7Y+HcO8sbZUTx3TAy2VXulP2FACd1aC7f2nTuqSPbqg==} dev: true - /@changesets/git/1.5.0: - resolution: {integrity: sha512-Xo8AT2G7rQJSwV87c8PwMm6BAc98BnufRMsML7m7Iw8Or18WFvFmxqG5aOL5PBvhgq9KrKvaeIBNIymracSuHg==} + /@changesets/git/2.0.0: + resolution: {integrity: sha512-enUVEWbiqUTxqSnmesyJGWfzd51PY4H7mH9yUw0hPVpZBJ6tQZFMU3F3mT/t9OJ/GjyiM4770i+sehAn6ymx6A==} dependencies: - '@babel/runtime': 7.20.1 + '@babel/runtime': 7.21.0 '@changesets/errors': 0.1.4 - '@changesets/types': 5.2.0 + '@changesets/types': 5.2.1 '@manypkg/get-packages': 1.1.3 is-subdir: 1.2.0 + micromatch: 4.0.5 spawndamnit: 2.0.0 dev: true @@ -758,31 +761,31 @@ packages: chalk: 2.4.2 dev: true - /@changesets/parse/0.3.15: - resolution: {integrity: sha512-3eDVqVuBtp63i+BxEWHPFj2P1s3syk0PTrk2d94W9JD30iG+OER0Y6n65TeLlY8T2yB9Fvj6Ev5Gg0+cKe/ZUA==} + /@changesets/parse/0.3.16: + resolution: {integrity: sha512-127JKNd167ayAuBjUggZBkmDS5fIKsthnr9jr6bdnuUljroiERW7FBTDNnNVyJ4l69PzR57pk6mXQdtJyBCJKg==} dependencies: - '@changesets/types': 5.2.0 + '@changesets/types': 5.2.1 js-yaml: 3.14.1 dev: true - /@changesets/pre/1.0.13: - resolution: {integrity: sha512-jrZc766+kGZHDukjKhpBXhBJjVQMied4Fu076y9guY1D3H622NOw8AQaLV3oQsDtKBTrT2AUFjt9Z2Y9Qx+GfA==} + /@changesets/pre/1.0.14: + resolution: {integrity: sha512-dTsHmxQWEQekHYHbg+M1mDVYFvegDh9j/kySNuDKdylwfMEevTeDouR7IfHNyVodxZXu17sXoJuf2D0vi55FHQ==} dependencies: - '@babel/runtime': 7.20.1 + '@babel/runtime': 7.21.0 '@changesets/errors': 0.1.4 - '@changesets/types': 5.2.0 + '@changesets/types': 5.2.1 '@manypkg/get-packages': 1.1.3 fs-extra: 7.0.1 dev: true - /@changesets/read/0.5.8: - resolution: {integrity: sha512-eYaNfxemgX7f7ELC58e7yqQICW5FB7V+bd1lKt7g57mxUrTveYME+JPaBPpYx02nP53XI6CQp6YxnR9NfmFPKw==} + /@changesets/read/0.5.9: + resolution: {integrity: sha512-T8BJ6JS6j1gfO1HFq50kU3qawYxa4NTbI/ASNVVCBTsKquy2HYwM9r7ZnzkiMe8IEObAJtUVGSrePCOxAK2haQ==} dependencies: - '@babel/runtime': 7.20.1 - '@changesets/git': 1.5.0 + '@babel/runtime': 7.21.0 + '@changesets/git': 2.0.0 '@changesets/logger': 0.0.5 - '@changesets/parse': 0.3.15 - '@changesets/types': 5.2.0 + '@changesets/parse': 0.3.16 + '@changesets/types': 5.2.1 chalk: 2.4.2 fs-extra: 7.0.1 p-filter: 2.1.0 @@ -792,18 +795,18 @@ packages: resolution: {integrity: sha512-LDQvVDv5Kb50ny2s25Fhm3d9QSZimsoUGBsUioj6MC3qbMUCuC8GPIvk/M6IvXx3lYhAs0lwWUQLb+VIEUCECw==} dev: true - /@changesets/types/5.2.0: - resolution: {integrity: sha512-km/66KOqJC+eicZXsm2oq8A8bVTSpkZJ60iPV/Nl5Z5c7p9kk8xxh6XGRTlnludHldxOOfudhnDN2qPxtHmXzA==} + /@changesets/types/5.2.1: + resolution: {integrity: sha512-myLfHbVOqaq9UtUKqR/nZA/OY7xFjQMdfgfqeZIBK4d0hA6pgxArvdv8M+6NUzzBsjWLOtvApv8YHr4qM+Kpfg==} dev: true - /@changesets/write/0.2.2: - resolution: {integrity: sha512-kCYNHyF3xaId1Q/QE+DF3UTrHTyg3Cj/f++T8S8/EkC+jh1uK2LFnM9h+EzV+fsmnZDrs7r0J4LLpeI/VWC5Hg==} + /@changesets/write/0.2.3: + resolution: {integrity: sha512-Dbamr7AIMvslKnNYsLFafaVORx4H0pvCA2MHqgtNCySMe1blImEyAEOzDmcgKAkgz4+uwoLz7demIrX+JBr/Xw==} dependencies: - '@babel/runtime': 7.20.1 - '@changesets/types': 5.2.0 + '@babel/runtime': 7.21.0 + '@changesets/types': 5.2.1 fs-extra: 7.0.1 human-id: 1.0.2 - prettier: 2.7.1 + prettier: 2.8.7 dev: true /@cspotcode/source-map-support/0.8.1: @@ -1027,74 +1030,20 @@ packages: engines: {node: '>=8'} dev: true - /@jest/console/29.3.1: - resolution: {integrity: sha512-IRE6GD47KwcqA09RIWrabKdHPiKDGgtAL31xDxbi/RjQMsr+lY+ppxmHwY0dUEV3qvvxZzoe5Hl0RXZJOjQNUg==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@jest/types': 29.4.1 - '@types/node': 18.11.18 - chalk: 4.1.2 - jest-message-util: 29.3.1 - jest-util: 29.4.1 - slash: 3.0.0 - dev: true - - /@jest/console/29.4.1: - resolution: {integrity: sha512-m+XpwKSi3PPM9znm5NGS8bBReeAJJpSkL1OuFCqaMaJL2YX9YXLkkI+MBchMPwu+ZuM2rynL51sgfkQteQ1CKQ==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@jest/types': 29.4.1 - '@types/node': 18.11.18 - chalk: 4.1.2 - jest-message-util: 29.4.1 - jest-util: 29.4.1 - slash: 3.0.0 - dev: true - - /@jest/core/29.3.1_ts-node@10.9.1: - resolution: {integrity: sha512-0ohVjjRex985w5MmO5L3u5GR1O30DexhBSpuwx2P+9ftyqHdJXnk7IUWiP80oHMvt7ubHCJHxV0a0vlKVuZirw==} + /@jest/console/29.5.0: + resolution: {integrity: sha512-NEpkObxPwyw/XxZVLPmAGKE89IQRp4puc6IQRPru6JKd1M3fW9v1xM1AnzIJE65hbCkzQAdnL8P47e9hzhiYLQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true dependencies: - '@jest/console': 29.3.1 - '@jest/reporters': 29.3.1 - '@jest/test-result': 29.3.1 - '@jest/transform': 29.3.1 - '@jest/types': 29.4.1 - '@types/node': 18.11.18 - ansi-escapes: 4.3.2 + '@jest/types': 29.5.0 + '@types/node': 18.15.10 chalk: 4.1.2 - ci-info: 3.5.0 - exit: 0.1.2 - graceful-fs: 4.2.10 - jest-changed-files: 29.2.0 - jest-config: 29.3.1_zfha7dvnw4nti6zkbsmhmn6xo4 - jest-haste-map: 29.3.1 - jest-message-util: 29.3.1 - jest-regex-util: 29.2.0 - jest-resolve: 29.3.1 - jest-resolve-dependencies: 29.3.1 - jest-runner: 29.3.1 - jest-runtime: 29.3.1 - jest-snapshot: 29.3.1 - jest-util: 29.3.1 - jest-validate: 29.3.1 - jest-watcher: 29.3.1 - micromatch: 4.0.5 - pretty-format: 29.3.1 + jest-message-util: 29.5.0 + jest-util: 29.5.0 slash: 3.0.0 - strip-ansi: 6.0.1 - transitivePeerDependencies: - - supports-color - - ts-node dev: true - /@jest/core/29.4.1_ts-node@10.9.1: - resolution: {integrity: sha512-RXFTohpBqpaTebNdg5l3I5yadnKo9zLBajMT0I38D0tDhreVBYv3fA8kywthI00sWxPztWLD3yjiUkewwu/wKA==} + /@jest/core/29.5.0_ts-node@10.9.1: + resolution: {integrity: sha512-28UzQc7ulUrOQw1IsN/kv1QES3q2kkbl/wGslyhAclqZ/8cMdB5M68BffkIdSJgKBUt50d3hbwJ92XESlE7LiQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 @@ -1102,32 +1051,32 @@ packages: node-notifier: optional: true dependencies: - '@jest/console': 29.4.1 - '@jest/reporters': 29.4.1 - '@jest/test-result': 29.4.1 - '@jest/transform': 29.4.1 - '@jest/types': 29.4.1 - '@types/node': 18.11.18 + '@jest/console': 29.5.0 + '@jest/reporters': 29.5.0 + '@jest/test-result': 29.5.0 + '@jest/transform': 29.5.0 + '@jest/types': 29.5.0 + '@types/node': 18.15.10 ansi-escapes: 4.3.2 chalk: 4.1.2 - ci-info: 3.5.0 + ci-info: 3.8.0 exit: 0.1.2 - graceful-fs: 4.2.10 - jest-changed-files: 29.4.0 - jest-config: 29.4.1_zfha7dvnw4nti6zkbsmhmn6xo4 - jest-haste-map: 29.4.1 - jest-message-util: 29.4.1 - jest-regex-util: 29.2.0 - jest-resolve: 29.4.1 - jest-resolve-dependencies: 29.4.1 - jest-runner: 29.4.1 - jest-runtime: 29.4.1 - jest-snapshot: 29.4.1 - jest-util: 29.4.1 - jest-validate: 29.4.1 - jest-watcher: 29.4.1 + graceful-fs: 4.2.11 + jest-changed-files: 29.5.0 + jest-config: 29.5.0_m54q5dse6x3xfnwbnypkikpaee + jest-haste-map: 29.5.0 + jest-message-util: 29.5.0 + jest-regex-util: 29.4.3 + jest-resolve: 29.5.0 + jest-resolve-dependencies: 29.5.0 + jest-runner: 29.5.0 + jest-runtime: 29.5.0 + jest-snapshot: 29.5.0 + jest-util: 29.5.0 + jest-validate: 29.5.0 + jest-watcher: 29.5.0 micromatch: 4.0.5 - pretty-format: 29.4.1 + pretty-format: 29.5.0 slash: 3.0.0 strip-ansi: 6.0.1 transitivePeerDependencies: @@ -1135,137 +1084,59 @@ packages: - ts-node dev: true - /@jest/environment/29.3.1: - resolution: {integrity: sha512-pMmvfOPmoa1c1QpfFW0nXYtNLpofqo4BrCIk6f2kW4JFeNlHV2t3vd+3iDLf31e2ot2Mec0uqZfmI+U0K2CFag==} + /@jest/environment/29.5.0: + resolution: {integrity: sha512-5FXw2+wD29YU1d4I2htpRX7jYnAyTRjP2CsXQdo9SAM8g3ifxWPSV0HnClSn71xwctr0U3oZIIH+dtbfmnbXVQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/fake-timers': 29.3.1 - '@jest/types': 29.4.1 - '@types/node': 18.11.18 - jest-mock: 29.4.1 + '@jest/fake-timers': 29.5.0 + '@jest/types': 29.5.0 + '@types/node': 18.15.10 + jest-mock: 29.5.0 dev: true - /@jest/environment/29.4.1: - resolution: {integrity: sha512-pJ14dHGSQke7Q3mkL/UZR9ZtTOxqskZaC91NzamEH4dlKRt42W+maRBXiw/LWkdJe+P0f/zDR37+SPMplMRlPg==} + /@jest/expect-utils/29.5.0: + resolution: {integrity: sha512-fmKzsidoXQT2KwnrwE0SQq3uj8Z763vzR8LnLBwC2qYWEFpjX8daRsk6rHUM1QvNlEW/UJXNXm59ztmJJWs2Mg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/fake-timers': 29.4.1 - '@jest/types': 29.4.1 - '@types/node': 18.11.18 - jest-mock: 29.4.1 + jest-get-type: 29.4.3 dev: true - /@jest/expect-utils/29.3.1: - resolution: {integrity: sha512-wlrznINZI5sMjwvUoLVk617ll/UYfGIZNxmbU+Pa7wmkL4vYzhV9R2pwVqUh4NWWuLQWkI8+8mOkxs//prKQ3g==} + /@jest/expect/29.5.0: + resolution: {integrity: sha512-PueDR2HGihN3ciUNGr4uelropW7rqUfTiOn+8u0leg/42UhblPxHkfoh0Ruu3I9Y1962P3u2DY4+h7GVTSVU6g==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - jest-get-type: 29.2.0 - dev: true - - /@jest/expect-utils/29.4.1: - resolution: {integrity: sha512-w6YJMn5DlzmxjO00i9wu2YSozUYRBhIoJ6nQwpMYcBMtiqMGJm1QBzOf6DDgRao8dbtpDoaqLg6iiQTvv0UHhQ==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - jest-get-type: 29.2.0 - dev: true - - /@jest/expect/29.4.1: - resolution: {integrity: sha512-ZxKJP5DTUNF2XkpJeZIzvnzF1KkfrhEF6Rz0HGG69fHl6Bgx5/GoU3XyaeFYEjuuKSOOsbqD/k72wFvFxc3iTw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - expect: 29.4.1 - jest-snapshot: 29.4.1 + expect: 29.5.0 + jest-snapshot: 29.5.0 transitivePeerDependencies: - supports-color dev: true - /@jest/fake-timers/29.3.1: - resolution: {integrity: sha512-iHTL/XpnDlFki9Tq0Q1GGuVeQ8BHZGIYsvCO5eN/O/oJaRzofG9Xndd9HuSDBI/0ZS79pg0iwn07OMTQ7ngF2A==} + /@jest/fake-timers/29.5.0: + resolution: {integrity: sha512-9ARvuAAQcBwDAqOnglWq2zwNIRUDtk/SCkp/ToGEhFv5r86K21l+VEs0qNTaXtyiY0lEePl3kylijSYJQqdbDg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.4.1 - '@sinonjs/fake-timers': 9.1.2 - '@types/node': 18.11.18 - jest-message-util: 29.3.1 - jest-mock: 29.4.1 - jest-util: 29.4.1 - dev: true - - /@jest/fake-timers/29.4.1: - resolution: {integrity: sha512-/1joI6rfHFmmm39JxNfmNAO3Nwm6Y0VoL5fJDy7H1AtWrD1CgRtqJbN9Ld6rhAkGO76qqp4cwhhxJ9o9kYjQMw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@jest/types': 29.4.1 + '@jest/types': 29.5.0 '@sinonjs/fake-timers': 10.0.2 - '@types/node': 18.11.18 - jest-message-util: 29.4.1 - jest-mock: 29.4.1 - jest-util: 29.4.1 - dev: true - - /@jest/globals/29.3.1: - resolution: {integrity: sha512-cTicd134vOcwO59OPaB6AmdHQMCtWOe+/DitpTZVxWgMJ+YvXL1HNAmPyiGbSHmF/mXVBkvlm8YYtQhyHPnV6Q==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@jest/environment': 29.4.1 - '@jest/expect': 29.4.1 - '@jest/types': 29.4.1 - jest-mock: 29.4.1 - transitivePeerDependencies: - - supports-color - dev: true - - /@jest/globals/29.4.1: - resolution: {integrity: sha512-znoK2EuFytbHH0ZSf2mQK2K1xtIgmaw4Da21R2C/NE/+NnItm5mPEFQmn8gmF3f0rfOlmZ3Y3bIf7bFj7DHxAA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@jest/environment': 29.4.1 - '@jest/expect': 29.4.1 - '@jest/types': 29.4.1 - jest-mock: 29.4.1 - transitivePeerDependencies: - - supports-color + '@types/node': 18.15.10 + jest-message-util: 29.5.0 + jest-mock: 29.5.0 + jest-util: 29.5.0 dev: true - /@jest/reporters/29.3.1: - resolution: {integrity: sha512-GhBu3YFuDrcAYW/UESz1JphEAbvUjaY2vShRZRoRY1mxpCMB3yGSJ4j9n0GxVlEOdCf7qjvUfBCrTUUqhVfbRA==} + /@jest/globals/29.5.0: + resolution: {integrity: sha512-S02y0qMWGihdzNbUiqSAiKSpSozSuHX5UYc7QbnHP+D9Lyw8DgGGCinrN9uSuHPeKgSSzvPom2q1nAtBvUsvPQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true dependencies: - '@bcoe/v8-coverage': 0.2.3 - '@jest/console': 29.3.1 - '@jest/test-result': 29.4.1 - '@jest/transform': 29.3.1 - '@jest/types': 29.4.1 - '@jridgewell/trace-mapping': 0.3.17 - '@types/node': 18.11.18 - chalk: 4.1.2 - collect-v8-coverage: 1.0.1 - exit: 0.1.2 - glob: 7.2.3 - graceful-fs: 4.2.10 - istanbul-lib-coverage: 3.2.0 - istanbul-lib-instrument: 5.2.1 - istanbul-lib-report: 3.0.0 - istanbul-lib-source-maps: 4.0.1 - istanbul-reports: 3.1.5 - jest-message-util: 29.3.1 - jest-util: 29.4.1 - jest-worker: 29.3.1 - slash: 3.0.0 - string-length: 4.0.2 - strip-ansi: 6.0.1 - v8-to-istanbul: 9.0.1 + '@jest/environment': 29.5.0 + '@jest/expect': 29.5.0 + '@jest/types': 29.5.0 + jest-mock: 29.5.0 transitivePeerDependencies: - supports-color dev: true - /@jest/reporters/29.4.1: - resolution: {integrity: sha512-AISY5xpt2Xpxj9R6y0RF1+O6GRy9JsGa8+vK23Lmzdy1AYcpQn5ItX79wJSsTmfzPKSAcsY1LNt/8Y5Xe5LOSg==} + /@jest/reporters/29.5.0: + resolution: {integrity: sha512-D05STXqj/M8bP9hQNSICtPqz97u7ffGzZu+9XLucXhkOFBqKcXe04JLZOgIekOxdb73MAoBUFnqvf7MCpKk5OA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 @@ -1274,111 +1145,84 @@ packages: optional: true dependencies: '@bcoe/v8-coverage': 0.2.3 - '@jest/console': 29.4.1 - '@jest/test-result': 29.4.1 - '@jest/transform': 29.4.1 - '@jest/types': 29.4.1 + '@jest/console': 29.5.0 + '@jest/test-result': 29.5.0 + '@jest/transform': 29.5.0 + '@jest/types': 29.5.0 '@jridgewell/trace-mapping': 0.3.17 - '@types/node': 18.11.18 + '@types/node': 18.15.10 chalk: 4.1.2 collect-v8-coverage: 1.0.1 exit: 0.1.2 glob: 7.2.3 - graceful-fs: 4.2.10 + graceful-fs: 4.2.11 istanbul-lib-coverage: 3.2.0 istanbul-lib-instrument: 5.2.1 istanbul-lib-report: 3.0.0 istanbul-lib-source-maps: 4.0.1 istanbul-reports: 3.1.5 - jest-message-util: 29.4.1 - jest-util: 29.4.1 - jest-worker: 29.4.1 + jest-message-util: 29.5.0 + jest-util: 29.5.0 + jest-worker: 29.5.0 slash: 3.0.0 string-length: 4.0.2 strip-ansi: 6.0.1 - v8-to-istanbul: 9.0.1 + v8-to-istanbul: 9.1.0 transitivePeerDependencies: - supports-color dev: true - /@jest/schemas/29.0.0: - resolution: {integrity: sha512-3Ab5HgYIIAnS0HjqJHQYZS+zXc4tUmTmBH3z83ajI6afXp8X3ZtdLX+nXx+I7LNkJD7uN9LAVhgnjDgZa2z0kA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@sinclair/typebox': 0.24.51 - dev: true - - /@jest/schemas/29.4.0: - resolution: {integrity: sha512-0E01f/gOZeNTG76i5eWWSupvSHaIINrTie7vCyjiYFKgzNdyEGd12BUv4oNBFHOqlHDbtoJi3HrQ38KCC90NsQ==} + /@jest/schemas/29.4.3: + resolution: {integrity: sha512-VLYKXQmtmuEz6IxJsrZwzG9NvtkQsWNnWMsKxqWNu3+CnfzJQhp0WDDKWLVV9hLKr0l3SLLFRqcYHjhtyuDVxg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@sinclair/typebox': 0.25.21 + '@sinclair/typebox': 0.25.24 dev: true - /@jest/source-map/29.2.0: - resolution: {integrity: sha512-1NX9/7zzI0nqa6+kgpSdKPK+WU1p+SJk3TloWZf5MzPbxri9UEeXX5bWZAPCzbQcyuAzubcdUHA7hcNznmRqWQ==} + /@jest/source-map/29.4.3: + resolution: {integrity: sha512-qyt/mb6rLyd9j1jUts4EQncvS6Yy3PM9HghnNv86QBlV+zdL2inCdK1tuVlL+J+lpiw2BI67qXOrX3UurBqQ1w==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jridgewell/trace-mapping': 0.3.17 callsites: 3.1.0 - graceful-fs: 4.2.10 - dev: true - - /@jest/test-result/29.3.1: - resolution: {integrity: sha512-qeLa6qc0ddB0kuOZyZIhfN5q0e2htngokyTWsGriedsDhItisW7SDYZ7ceOe57Ii03sL988/03wAcBh3TChMGw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@jest/console': 29.3.1 - '@jest/types': 29.4.1 - '@types/istanbul-lib-coverage': 2.0.4 - collect-v8-coverage: 1.0.1 + graceful-fs: 4.2.11 dev: true - /@jest/test-result/29.4.1: - resolution: {integrity: sha512-WRt29Lwt+hEgfN8QDrXqXGgCTidq1rLyFqmZ4lmJOpVArC8daXrZWkWjiaijQvgd3aOUj2fM8INclKHsQW9YyQ==} + /@jest/test-result/29.5.0: + resolution: {integrity: sha512-fGl4rfitnbfLsrfx1uUpDEESS7zM8JdgZgOCQuxQvL1Sn/I6ijeAVQWGfXI9zb1i9Mzo495cIpVZhA0yr60PkQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/console': 29.4.1 - '@jest/types': 29.4.1 + '@jest/console': 29.5.0 + '@jest/types': 29.5.0 '@types/istanbul-lib-coverage': 2.0.4 collect-v8-coverage: 1.0.1 dev: true - /@jest/test-sequencer/29.3.1: - resolution: {integrity: sha512-IqYvLbieTv20ArgKoAMyhLHNrVHJfzO6ARZAbQRlY4UGWfdDnLlZEF0BvKOMd77uIiIjSZRwq3Jb3Fa3I8+2UA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@jest/test-result': 29.4.1 - graceful-fs: 4.2.10 - jest-haste-map: 29.4.1 - slash: 3.0.0 - dev: true - - /@jest/test-sequencer/29.4.1: - resolution: {integrity: sha512-v5qLBNSsM0eHzWLXsQ5fiB65xi49A3ILPSFQKPXzGL4Vyux0DPZAIN7NAFJa9b4BiTDP9MBF/Zqc/QA1vuiJ0w==} + /@jest/test-sequencer/29.5.0: + resolution: {integrity: sha512-yPafQEcKjkSfDXyvtgiV4pevSeyuA6MQr6ZIdVkWJly9vkqjnFfcfhRQqpD5whjoU8EORki752xQmjaqoFjzMQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/test-result': 29.4.1 - graceful-fs: 4.2.10 - jest-haste-map: 29.4.1 + '@jest/test-result': 29.5.0 + graceful-fs: 4.2.11 + jest-haste-map: 29.5.0 slash: 3.0.0 dev: true - /@jest/transform/29.3.1: - resolution: {integrity: sha512-8wmCFBTVGYqFNLWfcOWoVuMuKYPUBTnTMDkdvFtAYELwDOl9RGwOsvQWGPFxDJ8AWY9xM/8xCXdqmPK3+Q5Lug==} + /@jest/transform/29.5.0: + resolution: {integrity: sha512-8vbeZWqLJOvHaDfeMuoHITGKSz5qWc9u04lnWrQE3VyuSw604PzQM824ZeX9XSjUCeDiE3GuxZe5UKa8J61NQw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@babel/core': 7.20.2 - '@jest/types': 29.4.1 + '@babel/core': 7.21.3 + '@jest/types': 29.5.0 '@jridgewell/trace-mapping': 0.3.17 babel-plugin-istanbul: 6.1.1 chalk: 4.1.2 convert-source-map: 2.0.0 fast-json-stable-stringify: 2.1.0 - graceful-fs: 4.2.10 - jest-haste-map: 29.3.1 - jest-regex-util: 29.2.0 - jest-util: 29.4.1 + graceful-fs: 4.2.11 + jest-haste-map: 29.5.0 + jest-regex-util: 29.4.3 + jest-util: 29.5.0 micromatch: 4.0.5 pirates: 4.0.5 slash: 3.0.0 @@ -1387,50 +1231,15 @@ packages: - supports-color dev: true - /@jest/transform/29.4.1: - resolution: {integrity: sha512-5w6YJrVAtiAgr0phzKjYd83UPbCXsBRTeYI4BXokv9Er9CcrH9hfXL/crCvP2d2nGOcovPUnlYiLPFLZrkG5Hg==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@babel/core': 7.20.2 - '@jest/types': 29.4.1 - '@jridgewell/trace-mapping': 0.3.17 - babel-plugin-istanbul: 6.1.1 - chalk: 4.1.2 - convert-source-map: 2.0.0 - fast-json-stable-stringify: 2.1.0 - graceful-fs: 4.2.10 - jest-haste-map: 29.4.1 - jest-regex-util: 29.2.0 - jest-util: 29.4.1 - micromatch: 4.0.5 - pirates: 4.0.5 - slash: 3.0.0 - write-file-atomic: 5.0.0 - transitivePeerDependencies: - - supports-color - dev: true - - /@jest/types/29.3.1: - resolution: {integrity: sha512-d0S0jmmTpjnhCmNpApgX3jrUZgZ22ivKJRvL2lli5hpCRoNnp1f85r2/wpKfXuYu8E7Jjh1hGfhPyup1NM5AmA==} + /@jest/types/29.5.0: + resolution: {integrity: sha512-qbu7kN6czmVRc3xWFQcAN03RAUamgppVUdXrvl1Wr3jlNF93o9mJbGcDWrwGB6ht44u7efB1qCFgVQmca24Uog==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/schemas': 29.4.0 + '@jest/schemas': 29.4.3 '@types/istanbul-lib-coverage': 2.0.4 '@types/istanbul-reports': 3.0.1 - '@types/node': 18.11.18 - '@types/yargs': 17.0.13 - chalk: 4.1.2 - dev: true - - /@jest/types/29.4.1: - resolution: {integrity: sha512-zbrAXDUOnpJ+FMST2rV7QZOgec8rskg2zv8g2ajeqitp4tvZiyqTCYXANrKsM+ryj5o+LI+ZN2EgU9drrkiwSA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@jest/schemas': 29.4.0 - '@types/istanbul-lib-coverage': 2.0.4 - '@types/istanbul-reports': 3.0.1 - '@types/node': 18.11.18 - '@types/yargs': 17.0.13 + '@types/node': 18.15.10 + '@types/yargs': 17.0.23 chalk: 4.1.2 dev: true @@ -1482,7 +1291,7 @@ packages: /@manypkg/find-root/1.1.0: resolution: {integrity: sha512-mki5uBvhHzO8kYYix/WRy2WX8S3B5wdVSc9D6KcU5lQNglP2yt58/VfLuAK49glRXChosY8ap2oJ1qgma3GUVA==} dependencies: - '@babel/runtime': 7.20.1 + '@babel/runtime': 7.21.0 '@types/node': 12.20.55 find-up: 4.1.0 fs-extra: 8.1.0 @@ -1491,7 +1300,7 @@ packages: /@manypkg/get-packages/1.1.3: resolution: {integrity: sha512-fo+QhuU3qE/2TQMQmbVMqaQ6EWbMhi4ABWP+O4AM1NqPBuy0OrApV5LO6BrrgnhtAHS2NH6RrVk9OL181tTi8A==} dependencies: - '@babel/runtime': 7.20.1 + '@babel/runtime': 7.21.0 '@changesets/types': 4.1.0 '@manypkg/find-root': 1.1.0 fs-extra: 8.1.0 @@ -1517,21 +1326,11 @@ packages: engines: {node: '>= 8'} dependencies: '@nodelib/fs.scandir': 2.1.5 - fastq: 1.13.0 - dev: true - - /@sinclair/typebox/0.24.51: - resolution: {integrity: sha512-1P1OROm/rdubP5aFDSZQILU0vrLCJ4fvHt6EoqHEM+2D/G5MK3bIaymUKLit8Js9gbns5UyJnkP/TZROLw4tUA==} - dev: true - - /@sinclair/typebox/0.25.21: - resolution: {integrity: sha512-gFukHN4t8K4+wVC+ECqeqwzBDeFeTzBXroBTqE6vcWrQGbEUpHO7LYdG0f4xnvYq4VOEwITSlHlp0JBAIFMS/g==} + fastq: 1.15.0 dev: true - /@sinonjs/commons/1.8.5: - resolution: {integrity: sha512-rTpCA0wG1wUxglBSFdMMY0oTrKYvgf4fNgv/sXbfCVAdf+FnPBdKJR/7XbpTCwbCrvCbdPYnlWaUUYz4V2fPDA==} - dependencies: - type-detect: 4.0.8 + /@sinclair/typebox/0.25.24: + resolution: {integrity: sha512-XJfwUVUKDHF5ugKwIcxEgc9k8b7HbznCp6eUfWgu710hMPNIO4aw4/zB5RogDQz8nd6gyCDpU9O/m6qYEWY6yQ==} dev: true /@sinonjs/commons/2.0.0: @@ -1546,18 +1345,12 @@ packages: '@sinonjs/commons': 2.0.0 dev: true - /@sinonjs/fake-timers/9.1.2: - resolution: {integrity: sha512-BPS4ynJW/o92PUR4wgriz2Ud5gpST5vz6GQfMixEDK0Z8ZCUv2M7SkBLykH56T++Xs+8ln9zTGbOvNGIe02/jw==} - dependencies: - '@sinonjs/commons': 1.8.5 - dev: true - - /@tanstack/query-core/4.18.0: - resolution: {integrity: sha512-PP4mG8MD08sq64RZCqMfXMYfaj7+Oulwg7xZ/fJoEOdTZNcPIgaOkHajZvUBsNLbi/0ViMvJB4cFkL2Jg2WPbw==} + /@tanstack/query-core/4.27.0: + resolution: {integrity: sha512-sm+QncWaPmM73IPwFlmWSKPqjdTXZeFf/7aEmWh00z7yl2FjqophPt0dE1EHW9P1giMC5rMviv7OUbSDmWzXXA==} dev: true - /@tanstack/react-query/4.18.0_biqbaboplfbrettd7655fr4n2y: - resolution: {integrity: sha512-s1kdbGMdVcfUIllzsHUqVUdktBT5uuIRgnvrqFNLjl9TSOXEoBSDrhjsGjao0INQZv8cMpQlgOh3YH9YtN6cKw==} + /@tanstack/react-query/4.28.0_biqbaboplfbrettd7655fr4n2y: + resolution: {integrity: sha512-8cGBV5300RHlvYdS4ea+G1JcZIt5CIuprXYFnsWggkmGoC0b5JaqG0fIX3qwDL9PTNkKvG76NGThIWbpXivMrQ==} peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 @@ -1568,23 +1361,23 @@ packages: react-native: optional: true dependencies: - '@tanstack/query-core': 4.18.0 + '@tanstack/query-core': 4.27.0 react: 18.2.0 react-dom: 18.2.0_react@18.2.0 use-sync-external-store: 1.2.0_react@18.2.0 dev: true - /@testing-library/dom/8.19.0: - resolution: {integrity: sha512-6YWYPPpxG3e/xOo6HIWwB/58HukkwIVTOaZ0VwdMVjhRUX/01E4FtQbck9GazOOj7MXHc5RBzMrU86iBJHbI+A==} - engines: {node: '>=12'} + /@testing-library/dom/9.2.0: + resolution: {integrity: sha512-xTEnpUKiV/bMyEsE5bT4oYA0x0Z/colMtxzUY8bKyPXBNLn/e0V4ZjBZkEhms0xE4pv9QsPfSRu9AWS4y5wGvA==} + engines: {node: '>=14'} dependencies: '@babel/code-frame': 7.18.6 - '@babel/runtime': 7.20.1 - '@types/aria-query': 4.2.2 + '@babel/runtime': 7.21.0 + '@types/aria-query': 5.0.1 aria-query: 5.1.3 chalk: 4.1.2 - dom-accessibility-api: 0.5.14 - lz-string: 1.4.4 + dom-accessibility-api: 0.5.16 + lz-string: 1.5.0 pretty-format: 27.5.1 dev: true @@ -1592,18 +1385,18 @@ packages: resolution: {integrity: sha512-N5ixQ2qKpi5OLYfwQmUb/5mSV9LneAcaUfp32pn4yCnpb8r/Yz0pXFPck21dIicKmi+ta5WRAknkZCfA8refMA==} engines: {node: '>=8', npm: '>=6', yarn: '>=1'} dependencies: - '@adobe/css-tools': 4.0.1 - '@babel/runtime': 7.20.1 + '@adobe/css-tools': 4.2.0 + '@babel/runtime': 7.21.0 '@types/testing-library__jest-dom': 5.14.5 aria-query: 5.1.3 chalk: 3.0.0 css.escape: 1.5.1 - dom-accessibility-api: 0.5.14 + dom-accessibility-api: 0.5.16 lodash: 4.17.21 redent: 3.0.0 dev: true - /@testing-library/react-hooks/8.0.1_djah6xjkh3i2bchfafvsnwdbb4: + /@testing-library/react-hooks/8.0.1_fjn3d3aefc35pidgaewxy3ws2e: resolution: {integrity: sha512-Aqhl2IVmLt8IovEVarNDFuJDVWVvhnr9/GCU6UUnrYXwgDFF9h2L2o2P9KBni1AST5sT6riAyoukFLyjQUgD/g==} engines: {node: '>=12'} peerDependencies: @@ -1619,35 +1412,35 @@ packages: react-test-renderer: optional: true dependencies: - '@babel/runtime': 7.20.1 - '@types/react': 18.0.25 + '@babel/runtime': 7.21.0 + '@types/react': 18.0.29 react: 18.2.0 react-dom: 18.2.0_react@18.2.0 react-error-boundary: 3.1.4_react@18.2.0 react-test-renderer: 18.2.0_react@18.2.0 dev: true - /@testing-library/react/13.4.0_biqbaboplfbrettd7655fr4n2y: - resolution: {integrity: sha512-sXOGON+WNTh3MLE9rve97ftaZukN3oNf2KjDy7YTx6hcTO2uuLHuCGynMDhFwGw/jYf4OJ2Qk0i4i79qMNNkyw==} - engines: {node: '>=12'} + /@testing-library/react/14.0.0_biqbaboplfbrettd7655fr4n2y: + resolution: {integrity: sha512-S04gSNJbYE30TlIMLTzv6QCTzt9AqIF5y6s6SzVFILNcNvbV/jU96GeiTPillGQo+Ny64M/5PV7klNYYgv5Dfg==} + engines: {node: '>=14'} peerDependencies: react: ^18.0.0 react-dom: ^18.0.0 dependencies: - '@babel/runtime': 7.20.1 - '@testing-library/dom': 8.19.0 - '@types/react-dom': 18.0.9 + '@babel/runtime': 7.21.0 + '@testing-library/dom': 9.2.0 + '@types/react-dom': 18.0.11 react: 18.2.0 react-dom: 18.2.0_react@18.2.0 dev: true - /@testing-library/user-event/14.4.3_aaq3sbffpfe3jnxzm2zngsddei: + /@testing-library/user-event/14.4.3_@testing-library+dom@9.2.0: resolution: {integrity: sha512-kCUc5MEwaEMakkO5x7aoD+DLi02ehmEM2QCGWvNqAS1dV/fAvORWEjnjsEIvml59M7Y5kCkWN6fCCyPOe8OL6Q==} engines: {node: '>=12', npm: '>=6'} peerDependencies: '@testing-library/dom': '>=7.21.4' dependencies: - '@testing-library/dom': 8.19.0 + '@testing-library/dom': 9.2.0 dev: true /@tootallnate/once/2.0.0: @@ -1671,87 +1464,89 @@ packages: resolution: {integrity: sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==} dev: true - /@types/aria-query/4.2.2: - resolution: {integrity: sha512-HnYpAE1Y6kRyKM/XkEuiRQhTHvkzMBurTHnpFLYLBGPIylZNPs9jJcuOOYWxPLJCSEtmZT0Y8rHDokKN7rRTig==} + /@types/aria-query/5.0.1: + resolution: {integrity: sha512-XTIieEY+gvJ39ChLcB4If5zHtPxt3Syj5rgZR+e1ctpmK8NjPf0zFqsz4JpLJT0xla9GFDKjy8Cpu331nrmE1Q==} dev: true - /@types/babel__core/7.1.20: - resolution: {integrity: sha512-PVb6Bg2QuscZ30FvOU7z4guG6c926D9YRvOxEaelzndpMsvP+YM74Q/dAFASpg2l6+XLalxSGxcq/lrgYWZtyQ==} + /@types/babel__core/7.20.0: + resolution: {integrity: sha512-+n8dL/9GWblDO0iU6eZAwEIJVr5DWigtle+Q6HLOrh/pdbXOhOtqzq8VPPE2zvNJzSKY4vH/z3iT3tn0A3ypiQ==} dependencies: - '@babel/parser': 7.20.3 - '@babel/types': 7.20.2 + '@babel/parser': 7.21.3 + '@babel/types': 7.21.3 '@types/babel__generator': 7.6.4 '@types/babel__template': 7.4.1 - '@types/babel__traverse': 7.18.2 + '@types/babel__traverse': 7.18.3 dev: true /@types/babel__generator/7.6.4: resolution: {integrity: sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==} dependencies: - '@babel/types': 7.20.2 + '@babel/types': 7.21.3 dev: true /@types/babel__template/7.4.1: resolution: {integrity: sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==} dependencies: - '@babel/parser': 7.20.3 - '@babel/types': 7.20.2 + '@babel/parser': 7.21.3 + '@babel/types': 7.21.3 dev: true - /@types/babel__traverse/7.18.2: - resolution: {integrity: sha512-FcFaxOr2V5KZCviw1TnutEMVUVsGt4D2hP1TAfXZAMKuHYW3xQhe3jTxNPWutgCJ3/X1c5yX8ZoGVEItxKbwBg==} + /@types/babel__traverse/7.18.3: + resolution: {integrity: sha512-1kbcJ40lLB7MHsj39U4Sh1uTd2E7rLEa79kmDpI6cy+XiXsteB3POdQomoq4FxszMrO3ZYchkhYJw7A2862b3w==} dependencies: - '@babel/types': 7.20.2 + '@babel/types': 7.21.3 dev: true /@types/body-parser/1.19.2: resolution: {integrity: sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==} dependencies: '@types/connect': 3.4.35 - '@types/node': 18.11.18 + '@types/node': 18.15.10 dev: true /@types/connect/3.4.35: resolution: {integrity: sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==} dependencies: - '@types/node': 18.11.18 + '@types/node': 18.15.10 dev: true /@types/cookiejar/2.1.2: resolution: {integrity: sha512-t73xJJrvdTjXrn4jLS9VSGRbz0nUY3cl2DMGDU48lKl+HR9dbbjW2A9r3g40VA++mQpy6uuHg33gy7du2BKpog==} dev: true - /@types/cors/2.8.12: - resolution: {integrity: sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==} + /@types/cors/2.8.13: + resolution: {integrity: sha512-RG8AStHlUiV5ysZQKq97copd2UmVYw3/pRMLefISZ3S1hK104Cwm7iLQ3fTKx+lsUH2CE8FlLaYeEA2LSeqYUA==} + dependencies: + '@types/node': 18.15.10 dev: true - /@types/express-serve-static-core/4.17.31: - resolution: {integrity: sha512-DxMhY+NAsTwMMFHBTtJFNp5qiHKJ7TeqOo23zVEM9alT1Ml27Q3xcTH0xwxn7Q0BbMcVEJOs/7aQtUWupUQN3Q==} + /@types/express-serve-static-core/4.17.33: + resolution: {integrity: sha512-TPBqmR/HRYI3eC2E5hmiivIzv+bidAfXofM+sbonAGvyDhySGw9/PQZFt2BLOrjUUR++4eJVpx6KnLQK1Fk9tA==} dependencies: - '@types/node': 18.11.18 + '@types/node': 18.15.10 '@types/qs': 6.9.7 '@types/range-parser': 1.2.4 dev: true - /@types/express/4.17.16: - resolution: {integrity: sha512-LkKpqRZ7zqXJuvoELakaFYuETHjZkSol8EV6cNnyishutDBCCdv6+dsKPbKkCcIk57qRphOLY5sEgClw1bO3gA==} + /@types/express/4.17.17: + resolution: {integrity: sha512-Q4FmmuLGBG58btUnfS1c1r/NQdlp3DMfGDGig8WhfpA2YRUtEkxAjkZb0yvplJGYdF1fsQ81iMDcH24sSCNC/Q==} dependencies: '@types/body-parser': 1.19.2 - '@types/express-serve-static-core': 4.17.31 + '@types/express-serve-static-core': 4.17.33 '@types/qs': 6.9.7 - '@types/serve-static': 1.15.0 + '@types/serve-static': 1.15.1 dev: true - /@types/graceful-fs/4.1.5: - resolution: {integrity: sha512-anKkLmZZ+xm4p8JWBf4hElkM4XR+EZeA2M9BAkkTldmcyDY4mbdIJnRghDJH3Ov5ooY7/UAoENtmdMSkaAd7Cw==} + /@types/graceful-fs/4.1.6: + resolution: {integrity: sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw==} dependencies: - '@types/node': 18.11.18 + '@types/node': 18.15.10 dev: true /@types/is-ci/3.0.0: resolution: {integrity: sha512-Q0Op0hdWbYd1iahB+IFNQcWXFq4O0Q5MwQP7uN0souuQ4rPg1vEYcnIOfr1gY+M+6rc8FGoRaBO1mOOvL29sEQ==} dependencies: - ci-info: 3.5.0 + ci-info: 3.8.0 dev: true /@types/istanbul-lib-coverage/2.0.4: @@ -1770,31 +1565,17 @@ packages: '@types/istanbul-lib-report': 3.0.0 dev: true - /@types/jest/29.2.2: - resolution: {integrity: sha512-og1wAmdxKoS71K2ZwSVqWPX6OVn3ihZ6ZT2qvZvZQm90lJVDyXIjYcu4Khx2CNIeaFv12rOU/YObOsI3VOkzog==} - dependencies: - expect: 29.3.1 - pretty-format: 29.3.1 - dev: true - - /@types/jest/29.2.3: - resolution: {integrity: sha512-6XwoEbmatfyoCjWRX7z0fKMmgYKe9+/HrviJ5k0X/tjJWHGAezZOfYaxqQKuzG/TvQyr+ktjm4jgbk0s4/oF2w==} + /@types/jest/29.5.0: + resolution: {integrity: sha512-3Emr5VOl/aoBwnWcH/EFQvlSAmjV+XtV9GGu5mwdYew5vhQh0IUZx/60x0TzHDu09Bi7HMx10t/namdJw5QIcg==} dependencies: - expect: 29.3.1 - pretty-format: 29.3.1 - dev: true - - /@types/jest/29.4.0: - resolution: {integrity: sha512-VaywcGQ9tPorCX/Jkkni7RWGFfI11whqzs8dvxF41P17Z+z872thvEvlIbznjPJ02kl1HMX3LmLOonsj2n7HeQ==} - dependencies: - expect: 29.3.1 - pretty-format: 29.3.1 + expect: 29.5.0 + pretty-format: 29.5.0 dev: true /@types/jsdom/20.0.1: resolution: {integrity: sha512-d0r18sZPmMQr1eG35u12FZfhIXNrnsPU/g5wvRKCUf/tOGilKKwYMYGqh33BNR6ba+2gkHw1EUiHoN3mn7E5IQ==} dependencies: - '@types/node': 18.11.18 + '@types/node': 18.15.10 '@types/tough-cookie': 4.0.2 parse5: 7.1.2 dev: true @@ -1810,27 +1591,23 @@ packages: /@types/multer/1.4.7: resolution: {integrity: sha512-/SNsDidUFCvqqcWDwxv2feww/yqhNeTRL5CVoL3jU4Goc4kKEL10T7Eye65ZqPNi4HRx8sAEX59pV1aEH7drNA==} dependencies: - '@types/express': 4.17.16 + '@types/express': 4.17.17 dev: true /@types/node/12.20.55: resolution: {integrity: sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==} dev: true - /@types/node/18.11.18: - resolution: {integrity: sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA==} - dev: true - - /@types/node/18.11.9: - resolution: {integrity: sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==} + /@types/node/18.15.10: + resolution: {integrity: sha512-9avDaQJczATcXgfmMAW3MIWArOO7A+m90vuCFLr8AotWf8igO/mRoYukrk2cqZVtv38tHs33retzHEilM7FpeQ==} dev: true /@types/normalize-package-data/2.4.1: resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==} dev: true - /@types/prettier/2.7.1: - resolution: {integrity: sha512-ri0UmynRRvZiiUJdiz38MmIblKK+oH30MztdBVR95dv/Ubw6neWSb8u1XpRb72L4qsZOhz+L+z9JD40SJmfWow==} + /@types/prettier/2.7.2: + resolution: {integrity: sha512-KufADq8uQqo1pYKVIYzfKbJfBAc0sOeXqGbFaSpv8MRmC/zXgowNZmFcbngndGk922QDmOASEXUZCaY48gs4cg==} dev: true /@types/prop-types/15.7.5: @@ -1845,33 +1622,33 @@ packages: resolution: {integrity: sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==} dev: true - /@types/react-dom/18.0.9: - resolution: {integrity: sha512-qnVvHxASt/H7i+XG1U1xMiY5t+IHcPGUK7TDMDzom08xa7e86eCeKOiLZezwCKVxJn6NEiiy2ekgX8aQssjIKg==} + /@types/react-dom/18.0.11: + resolution: {integrity: sha512-O38bPbI2CWtgw/OoQoY+BRelw7uysmXbWvw3nLWO21H1HSh+GOlqPuXshJfjmpNlKiiSDG9cc1JZAaMmVdcTlw==} dependencies: - '@types/react': 18.0.25 + '@types/react': 18.0.29 dev: true - /@types/react/18.0.25: - resolution: {integrity: sha512-xD6c0KDT4m7n9uD4ZHi02lzskaiqcBxf4zi+tXZY98a04wvc0hi/TcCPC2FOESZi51Nd7tlUeOJY8RofL799/g==} + /@types/react/18.0.29: + resolution: {integrity: sha512-wXHktgUABxplw1+UnljseDq4+uztQyp2tlWZRIxHlpchsCFqiYkvaDS8JR7eKOQm8wziTH/el5qL7D6gYNkYcw==} dependencies: '@types/prop-types': 15.7.5 - '@types/scheduler': 0.16.2 + '@types/scheduler': 0.16.3 csstype: 3.1.1 dev: true - /@types/scheduler/0.16.2: - resolution: {integrity: sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew==} + /@types/scheduler/0.16.3: + resolution: {integrity: sha512-5cJ8CB4yAx7BH1oMvdU0Jh9lrEXyPkar6F9G/ERswkCuvP4KQZfZkSjcMbAICCpQTN4OuZn8tz0HiKv9TGZgrQ==} dev: true /@types/semver/6.2.3: resolution: {integrity: sha512-KQf+QAMWKMrtBMsB8/24w53tEsxllMj6TuA80TT/5igJalLI/zm0L3oXRbIAl4Ohfc85gyHX/jhMwsVkmhLU4A==} dev: true - /@types/serve-static/1.15.0: - resolution: {integrity: sha512-z5xyF6uh8CbjAu9760KDKsH2FcDxZ2tFCsA4HIMWE6IkiYMXfVoa+4f9KX+FN0ZLsaMw1WNG2ETLA6N+/YA+cg==} + /@types/serve-static/1.15.1: + resolution: {integrity: sha512-NUo5XNiAdULrJENtJXZZ3fHtfMolzZwczzBbnAeBbqBwG+LaG6YaJtuwzwGSQZ2wsCrxjEhNNjAkKigy3n8teQ==} dependencies: '@types/mime': 3.0.1 - '@types/node': 18.11.18 + '@types/node': 18.15.10 dev: true /@types/stack-utils/2.0.1: @@ -1882,7 +1659,7 @@ packages: resolution: {integrity: sha512-tLfnlJf6A5mB6ddqF159GqcDizfzbMUB1/DeT59/wBNqzRTNNKsaw79A/1TZ84X+f/EwWH8FeuSkjlCLyqS/zQ==} dependencies: '@types/cookiejar': 2.1.2 - '@types/node': 18.11.18 + '@types/node': 18.15.10 dev: true /@types/supertest/2.0.12: @@ -1894,7 +1671,7 @@ packages: /@types/testing-library__jest-dom/5.14.5: resolution: {integrity: sha512-SBwbxYoyPIvxHbeHxTZX2Pe/74F/tX2/D3mMvzabdeJ25bBojfW0TyB8BHrbq/9zaaKICJZjLP+8r6AeZMFCuQ==} dependencies: - '@types/jest': 29.4.0 + '@types/jest': 29.5.0 dev: true /@types/tough-cookie/4.0.2: @@ -1905,8 +1682,8 @@ packages: resolution: {integrity: sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==} dev: true - /@types/yargs/17.0.13: - resolution: {integrity: sha512-9sWaruZk2JGxIQU+IhI1fhPYRcQ0UuTNuKuCW9bR5fp7qi2Llf7WDzNa17Cy7TKnh3cdxDOiyTu6gaLS0eDatg==} + /@types/yargs/17.0.23: + resolution: {integrity: sha512-yuogunc04OnzGQCrfHx+Kk883Q4X0aSwmYZhKjI21m+SVYzjIbrWl8dOOwSv5hf2Um2pdCOXWo9isteZTNXUZQ==} dependencies: '@types/yargs-parser': 21.0.0 dev: true @@ -1926,7 +1703,7 @@ packages: /acorn-globals/7.0.1: resolution: {integrity: sha512-umOSDSDrfHbTNPuNpC2NSnnA3LUrqpevPb4T9jRx4MagXNS0rs+gwiTcAvqCRmsD6utzsrzNt+ebm00SNWiC3Q==} dependencies: - acorn: 8.8.1 + acorn: 8.8.2 acorn-walk: 8.2.0 dev: true @@ -1935,8 +1712,8 @@ packages: engines: {node: '>=0.4.0'} dev: true - /acorn/8.8.1: - resolution: {integrity: sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==} + /acorn/8.8.2: + resolution: {integrity: sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==} engines: {node: '>=0.4.0'} hasBin: true dev: true @@ -1990,8 +1767,8 @@ packages: resolution: {integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==} dev: true - /anymatch/3.1.2: - resolution: {integrity: sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==} + /anymatch/3.1.3: + resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} engines: {node: '>= 8'} dependencies: normalize-path: 3.0.0 @@ -2015,7 +1792,14 @@ packages: /aria-query/5.1.3: resolution: {integrity: sha512-R5iJ5lkuHybztUfuOAznmboyjWq8O6sqNqtK7CLOqdydi54VNbORp49mb14KbWgG1QD3JFO9hJdZ+y4KutfdOQ==} dependencies: - deep-equal: 2.1.0 + deep-equal: 2.2.0 + dev: true + + /array-buffer-byte-length/1.0.0: + resolution: {integrity: sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==} + dependencies: + call-bind: 1.0.2 + is-array-buffer: 3.0.2 dev: true /array-flatten/1.1.1: @@ -2032,8 +1816,8 @@ packages: engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.2 - define-properties: 1.1.4 - es-abstract: 1.20.4 + define-properties: 1.2.0 + es-abstract: 1.21.2 es-shim-unscopables: 1.0.0 dev: true @@ -2055,8 +1839,8 @@ packages: engines: {node: '>= 0.4'} dev: true - /axios/1.2.5: - resolution: {integrity: sha512-9pU/8mmjSSOb4CXVsvGIevN+MlO/t9OWtKadTaLuN85Gge3HGorUckgp8A/2FH4V4hJ7JuQ3LIeI7KAV9ITZrQ==} + /axios/1.3.4: + resolution: {integrity: sha512-toYm+Bsyl6VC5wSkfkbbNB6ROv7KY93PEBBL6xyDczaIHasAiv4wPqQ/c4RjoQzipxRD2W5g21cOqQulZ7rHwQ==} dependencies: follow-redirects: 1.15.2 form-data: 4.0.0 @@ -2065,37 +1849,19 @@ packages: - debug dev: true - /babel-jest/29.3.1_@babel+core@7.20.2: - resolution: {integrity: sha512-aard+xnMoxgjwV70t0L6wkW/3HQQtV+O0PEimxKgzNqCJnbYmroPojdP2tqKSOAt8QAKV/uSZU8851M7B5+fcA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - peerDependencies: - '@babel/core': ^7.8.0 - dependencies: - '@babel/core': 7.20.2 - '@jest/transform': 29.4.1 - '@types/babel__core': 7.1.20 - babel-plugin-istanbul: 6.1.1 - babel-preset-jest: 29.2.0_@babel+core@7.20.2 - chalk: 4.1.2 - graceful-fs: 4.2.10 - slash: 3.0.0 - transitivePeerDependencies: - - supports-color - dev: true - - /babel-jest/29.4.1_@babel+core@7.20.2: - resolution: {integrity: sha512-xBZa/pLSsF/1sNpkgsiT3CmY7zV1kAsZ9OxxtrFqYucnOuRftXAfcJqcDVyOPeN4lttWTwhLdu0T9f8uvoPEUg==} + /babel-jest/29.5.0_@babel+core@7.21.3: + resolution: {integrity: sha512-mA4eCDh5mSo2EcA9xQjVTpmbbNk32Zb3Q3QFQsNhaK56Q+yoXowzFodLux30HRgyOho5rsQ6B0P9QpMkvvnJ0Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: '@babel/core': ^7.8.0 dependencies: - '@babel/core': 7.20.2 - '@jest/transform': 29.4.1 - '@types/babel__core': 7.1.20 + '@babel/core': 7.21.3 + '@jest/transform': 29.5.0 + '@types/babel__core': 7.20.0 babel-plugin-istanbul: 6.1.1 - babel-preset-jest: 29.4.0_@babel+core@7.20.2 + babel-preset-jest: 29.5.0_@babel+core@7.21.3 chalk: 4.1.2 - graceful-fs: 4.2.10 + graceful-fs: 4.2.11 slash: 3.0.0 transitivePeerDependencies: - supports-color @@ -2114,66 +1880,45 @@ packages: - supports-color dev: true - /babel-plugin-jest-hoist/29.2.0: - resolution: {integrity: sha512-TnspP2WNiR3GLfCsUNHqeXw0RoQ2f9U5hQ5L3XFpwuO8htQmSrhh8qsB6vi5Yi8+kuynN1yjDjQsPfkebmB6ZA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@babel/template': 7.18.10 - '@babel/types': 7.20.2 - '@types/babel__core': 7.1.20 - '@types/babel__traverse': 7.18.2 - dev: true - - /babel-plugin-jest-hoist/29.4.0: - resolution: {integrity: sha512-a/sZRLQJEmsmejQ2rPEUe35nO1+C9dc9O1gplH1SXmJxveQSRUYdBk8yGZG/VOUuZs1u2aHZJusEGoRMbhhwCg==} + /babel-plugin-jest-hoist/29.5.0: + resolution: {integrity: sha512-zSuuuAlTMT4mzLj2nPnUm6fsE6270vdOfnpbJ+RmruU75UhLFvL0N2NgI7xpeS7NaB6hGqmd5pVpGTDYvi4Q3w==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@babel/template': 7.18.10 - '@babel/types': 7.20.2 - '@types/babel__core': 7.1.20 - '@types/babel__traverse': 7.18.2 + '@babel/template': 7.20.7 + '@babel/types': 7.21.3 + '@types/babel__core': 7.20.0 + '@types/babel__traverse': 7.18.3 dev: true - /babel-preset-current-node-syntax/1.0.1_@babel+core@7.20.2: + /babel-preset-current-node-syntax/1.0.1_@babel+core@7.21.3: resolution: {integrity: sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.20.2 - '@babel/plugin-syntax-async-generators': 7.8.4_@babel+core@7.20.2 - '@babel/plugin-syntax-bigint': 7.8.3_@babel+core@7.20.2 - '@babel/plugin-syntax-class-properties': 7.12.13_@babel+core@7.20.2 - '@babel/plugin-syntax-import-meta': 7.10.4_@babel+core@7.20.2 - '@babel/plugin-syntax-json-strings': 7.8.3_@babel+core@7.20.2 - '@babel/plugin-syntax-logical-assignment-operators': 7.10.4_@babel+core@7.20.2 - '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3_@babel+core@7.20.2 - '@babel/plugin-syntax-numeric-separator': 7.10.4_@babel+core@7.20.2 - '@babel/plugin-syntax-object-rest-spread': 7.8.3_@babel+core@7.20.2 - '@babel/plugin-syntax-optional-catch-binding': 7.8.3_@babel+core@7.20.2 - '@babel/plugin-syntax-optional-chaining': 7.8.3_@babel+core@7.20.2 - '@babel/plugin-syntax-top-level-await': 7.14.5_@babel+core@7.20.2 - dev: true - - /babel-preset-jest/29.2.0_@babel+core@7.20.2: - resolution: {integrity: sha512-z9JmMJppMxNv8N7fNRHvhMg9cvIkMxQBXgFkane3yKVEvEOP+kB50lk8DFRvF9PGqbyXxlmebKWhuDORO8RgdA==} + '@babel/core': 7.21.3 + '@babel/plugin-syntax-async-generators': 7.8.4_@babel+core@7.21.3 + '@babel/plugin-syntax-bigint': 7.8.3_@babel+core@7.21.3 + '@babel/plugin-syntax-class-properties': 7.12.13_@babel+core@7.21.3 + '@babel/plugin-syntax-import-meta': 7.10.4_@babel+core@7.21.3 + '@babel/plugin-syntax-json-strings': 7.8.3_@babel+core@7.21.3 + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4_@babel+core@7.21.3 + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3_@babel+core@7.21.3 + '@babel/plugin-syntax-numeric-separator': 7.10.4_@babel+core@7.21.3 + '@babel/plugin-syntax-object-rest-spread': 7.8.3_@babel+core@7.21.3 + '@babel/plugin-syntax-optional-catch-binding': 7.8.3_@babel+core@7.21.3 + '@babel/plugin-syntax-optional-chaining': 7.8.3_@babel+core@7.21.3 + '@babel/plugin-syntax-top-level-await': 7.14.5_@babel+core@7.21.3 + dev: true + + /babel-preset-jest/29.5.0_@babel+core@7.21.3: + resolution: {integrity: sha512-JOMloxOqdiBSxMAzjRaH023/vvcaSaec49zvg+2LmNsktC7ei39LTJGw02J+9uUtTZUq6xbLyJ4dxe9sSmIuAg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.20.2 - babel-plugin-jest-hoist: 29.2.0 - babel-preset-current-node-syntax: 1.0.1_@babel+core@7.20.2 - dev: true - - /babel-preset-jest/29.4.0_@babel+core@7.20.2: - resolution: {integrity: sha512-fUB9vZflUSM3dO/6M2TCAepTzvA4VkOvl67PjErcrQMGt9Eve7uazaeyCZ2th3UtI7ljpiBJES0F7A1vBRsLZA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - peerDependencies: - '@babel/core': ^7.0.0 - dependencies: - '@babel/core': 7.20.2 - babel-plugin-jest-hoist: 29.4.0 - babel-preset-current-node-syntax: 1.0.1_@babel+core@7.20.2 + '@babel/core': 7.21.3 + babel-plugin-jest-hoist: 29.5.0 + babel-preset-current-node-syntax: 1.0.1_@babel+core@7.21.3 dev: true /balanced-match/1.0.2: @@ -2197,7 +1942,7 @@ packages: engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} dependencies: bytes: 3.1.2 - content-type: 1.0.4 + content-type: 1.0.5 debug: 2.6.9 depd: 2.0.0 destroy: 1.2.0 @@ -2219,6 +1964,12 @@ packages: concat-map: 0.0.1 dev: true + /brace-expansion/2.0.1: + resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} + dependencies: + balanced-match: 1.0.2 + dev: true + /braces/3.0.2: resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} engines: {node: '>=8'} @@ -2232,15 +1983,15 @@ packages: wcwidth: 1.0.1 dev: true - /browserslist/4.21.4: - resolution: {integrity: sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw==} + /browserslist/4.21.5: + resolution: {integrity: sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true dependencies: - caniuse-lite: 1.0.30001431 - electron-to-chromium: 1.4.284 - node-releases: 2.0.6 - update-browserslist-db: 1.0.10_browserslist@4.21.4 + caniuse-lite: 1.0.30001470 + electron-to-chromium: 1.4.340 + node-releases: 2.0.10 + update-browserslist-db: 1.0.10_browserslist@4.21.5 dev: true /bs-logger/0.2.6: @@ -2267,7 +2018,7 @@ packages: esbuild: '>=0.17' dependencies: esbuild: 0.17.14 - load-tsconfig: 0.2.3 + load-tsconfig: 0.2.5 dev: true /busboy/1.6.0: @@ -2291,7 +2042,7 @@ packages: resolution: {integrity: sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==} dependencies: function-bind: 1.1.1 - get-intrinsic: 1.1.3 + get-intrinsic: 1.2.0 dev: true /callsites/3.1.0: @@ -2318,8 +2069,8 @@ packages: engines: {node: '>=10'} dev: true - /caniuse-lite/1.0.30001431: - resolution: {integrity: sha512-zBUoFU0ZcxpvSt9IU66dXVT/3ctO1cy4y9cscs1szkPlcWb6pasYM144GqrUygUbT+k7cmUCW61cvskjcv0enQ==} + /caniuse-lite/1.0.30001470: + resolution: {integrity: sha512-065uNwY6QtHCBOExzbV6m236DDhYCCtPmQUCoQtwkVqzud8v5QPidoMr6CoMkC2nfp6nksjttqWQRRh75LqUmA==} dev: true /chalk/2.4.2: @@ -2360,7 +2111,7 @@ packages: resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==} engines: {node: '>= 8.10.0'} dependencies: - anymatch: 3.1.2 + anymatch: 3.1.3 braces: 3.0.2 glob-parent: 5.1.2 is-binary-path: 2.1.0 @@ -2371,8 +2122,9 @@ packages: fsevents: 2.3.2 dev: true - /ci-info/3.5.0: - resolution: {integrity: sha512-yH4RezKOGlOhxkmhbeNuC4eYZKAUsEaGtBuBzDDP1eFUKiccDWzBABxBfOx31IDwDIXMTxWuwAxUGModvkbuVw==} + /ci-info/3.8.0: + resolution: {integrity: sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==} + engines: {node: '>=8'} dev: true /cjs-module-lexer/1.2.2: @@ -2457,7 +2209,7 @@ packages: dependencies: buffer-from: 1.1.2 inherits: 2.0.4 - readable-stream: 2.3.7 + readable-stream: 2.3.8 typedarray: 0.0.6 dev: true @@ -2468,8 +2220,8 @@ packages: safe-buffer: 5.2.1 dev: true - /content-type/1.0.4: - resolution: {integrity: sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==} + /content-type/1.0.5: + resolution: {integrity: sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==} engines: {node: '>= 0.6'} dev: true @@ -2625,23 +2377,25 @@ packages: engines: {node: '>=0.10.0'} dev: true - /decimal.js/10.4.2: - resolution: {integrity: sha512-ic1yEvwT6GuvaYwBLLY6/aFFgjZdySKTE8en/fkU3QICTmRtgtSlFn0u0BXN06InZwtfCelR7j8LRiDI/02iGA==} + /decimal.js/10.4.3: + resolution: {integrity: sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==} dev: true /dedent/0.7.0: resolution: {integrity: sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==} dev: true - /deep-equal/2.1.0: - resolution: {integrity: sha512-2pxgvWu3Alv1PoWEyVg7HS8YhGlUFUV7N5oOvfL6d+7xAmLSemMwv/c8Zv/i9KFzxV5Kt5CAvQc70fLwVuf4UA==} + /deep-equal/2.2.0: + resolution: {integrity: sha512-RdpzE0Hv4lhowpIUKKMJfeH6C1pXdtT1/it80ubgWqwI3qpuxUBpC1S4hnHg+zjnuOoDkzUtUCEEkG+XG5l3Mw==} dependencies: call-bind: 1.0.2 - es-get-iterator: 1.1.2 - get-intrinsic: 1.1.3 + es-get-iterator: 1.1.3 + get-intrinsic: 1.2.0 is-arguments: 1.1.1 + is-array-buffer: 3.0.2 is-date-object: 1.0.5 is-regex: 1.1.4 + is-shared-array-buffer: 1.0.2 isarray: 2.0.5 object-is: 1.1.5 object-keys: 1.1.1 @@ -2657,8 +2411,8 @@ packages: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} dev: true - /deepmerge/4.2.2: - resolution: {integrity: sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==} + /deepmerge/4.3.1: + resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} engines: {node: '>=0.10.0'} dev: true @@ -2668,8 +2422,8 @@ packages: clone: 1.0.4 dev: true - /define-properties/1.1.4: - resolution: {integrity: sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA==} + /define-properties/1.2.0: + resolution: {integrity: sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==} engines: {node: '>= 0.4'} dependencies: has-property-descriptors: 1.0.0 @@ -2708,8 +2462,8 @@ packages: wrappy: 1.0.2 dev: true - /diff-sequences/29.3.1: - resolution: {integrity: sha512-hlM3QR272NXCi4pq+N4Kok4kOp6EsgOM3ZSpJI7Da3UAs+Ttsi8MRmB6trM/lhyzUxGfOgnpkHtgqm5Q/CTcfQ==} + /diff-sequences/29.4.3: + resolution: {integrity: sha512-ofrBgwpPhCD85kMKtE9RYFFq6OC1A89oW2vvgWZNCwxrUpRUILopY7lsYyMDSjc8g6U6aiO0Qubg6r4Wgt5ZnA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dev: true @@ -2725,8 +2479,8 @@ packages: path-type: 4.0.0 dev: true - /dom-accessibility-api/0.5.14: - resolution: {integrity: sha512-NMt+m9zFMPZe0JcY9gN224Qvk6qLIdqex29clBvc/y75ZBX9YA9wNK3frsYvu2DI1xcCIwxwnX+TlsJ2DSOADg==} + /dom-accessibility-api/0.5.16: + resolution: {integrity: sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==} dev: true /domexception/4.0.0: @@ -2740,8 +2494,8 @@ packages: resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} dev: true - /electron-to-chromium/1.4.284: - resolution: {integrity: sha512-M8WEXFuKXMYMVr45fo8mq0wUrrJHheiKZf6BArTKk9ZBYCKJEOU5H8cdWgDT+qCVZf7Na4lVUaZsA+h6uA9+PA==} + /electron-to-chromium/1.4.340: + resolution: {integrity: sha512-zx8hqumOqltKsv/MF50yvdAlPF9S/4PXbyfzJS6ZGhbddGkRegdwImmfSVqCkEziYzrIGZ/TlrzBND4FysfkDg==} dev: true /emittery/0.13.1: @@ -2776,47 +2530,67 @@ packages: is-arrayish: 0.2.1 dev: true - /es-abstract/1.20.4: - resolution: {integrity: sha512-0UtvRN79eMe2L+UNEF1BwRe364sj/DXhQ/k5FmivgoSdpM90b8Jc0mDzKMGo7QS0BVbOP/bTwBKNnDc9rNzaPA==} + /es-abstract/1.21.2: + resolution: {integrity: sha512-y/B5POM2iBnIxCiernH1G7rC9qQoM77lLIMQLuob0zhp8C56Po81+2Nj0WFKnd0pNReDTnkYryc+zhOzpEIROg==} engines: {node: '>= 0.4'} dependencies: + array-buffer-byte-length: 1.0.0 + available-typed-arrays: 1.0.5 call-bind: 1.0.2 + es-set-tostringtag: 2.0.1 es-to-primitive: 1.2.1 - function-bind: 1.1.1 function.prototype.name: 1.1.5 - get-intrinsic: 1.1.3 + get-intrinsic: 1.2.0 get-symbol-description: 1.0.0 + globalthis: 1.0.3 + gopd: 1.0.1 has: 1.0.3 has-property-descriptors: 1.0.0 + has-proto: 1.0.1 has-symbols: 1.0.3 - internal-slot: 1.0.3 + internal-slot: 1.0.5 + is-array-buffer: 3.0.2 is-callable: 1.2.7 is-negative-zero: 2.0.2 is-regex: 1.1.4 is-shared-array-buffer: 1.0.2 is-string: 1.0.7 + is-typed-array: 1.1.10 is-weakref: 1.0.2 - object-inspect: 1.12.2 + object-inspect: 1.12.3 object-keys: 1.1.1 object.assign: 4.1.4 regexp.prototype.flags: 1.4.3 safe-regex-test: 1.0.0 + string.prototype.trim: 1.2.7 string.prototype.trimend: 1.0.6 string.prototype.trimstart: 1.0.6 + typed-array-length: 1.0.4 unbox-primitive: 1.0.2 + which-typed-array: 1.1.9 dev: true - /es-get-iterator/1.1.2: - resolution: {integrity: sha512-+DTO8GYwbMCwbywjimwZMHp8AuYXOS2JZFWoi2AlPOS3ebnII9w/NLpNZtA7A0YLaVDw+O7KFCeoIV7OPvM7hQ==} + /es-get-iterator/1.1.3: + resolution: {integrity: sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==} dependencies: call-bind: 1.0.2 - get-intrinsic: 1.1.3 + get-intrinsic: 1.2.0 has-symbols: 1.0.3 is-arguments: 1.1.1 is-map: 2.0.2 is-set: 2.0.2 is-string: 1.0.7 isarray: 2.0.5 + stop-iteration-iterator: 1.0.0 + dev: true + + /es-set-tostringtag/2.0.1: + resolution: {integrity: sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==} + engines: {node: '>= 0.4'} + dependencies: + get-intrinsic: 1.2.0 + has: 1.0.3 + has-tostringtag: 1.0.0 dev: true /es-shim-unscopables/1.0.0: @@ -2937,26 +2711,15 @@ packages: engines: {node: '>= 0.8.0'} dev: true - /expect/29.3.1: - resolution: {integrity: sha512-gGb1yTgU30Q0O/tQq+z30KBWv24ApkMgFUpvKBkyLUBL68Wv8dHdJxTBZFl/iT8K/bqDHvUYRH6IIN3rToopPA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@jest/expect-utils': 29.3.1 - jest-get-type: 29.2.0 - jest-matcher-utils: 29.3.1 - jest-message-util: 29.3.1 - jest-util: 29.3.1 - dev: true - - /expect/29.4.1: - resolution: {integrity: sha512-OKrGESHOaMxK3b6zxIq9SOW8kEXztKff/Dvg88j4xIJxur1hspEbedVkR3GpHe5LO+WB2Qw7OWN0RMTdp6as5A==} + /expect/29.5.0: + resolution: {integrity: sha512-yM7xqUrCO2JdpFo4XpM82t+PJBFybdqoQuJLDGeDX2ij8NZzqRHyu3Hp188/JX7SWqud+7t4MUdvcgGBICMHZg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/expect-utils': 29.4.1 - jest-get-type: 29.2.0 - jest-matcher-utils: 29.4.1 - jest-message-util: 29.4.1 - jest-util: 29.4.1 + '@jest/expect-utils': 29.5.0 + jest-get-type: 29.4.3 + jest-matcher-utils: 29.5.0 + jest-message-util: 29.5.0 + jest-util: 29.5.0 dev: true /express/4.18.2: @@ -2967,7 +2730,7 @@ packages: array-flatten: 1.1.1 body-parser: 1.20.1 content-disposition: 0.5.4 - content-type: 1.0.4 + content-type: 1.0.5 cookie: 0.5.0 cookie-signature: 1.0.6 debug: 2.6.9 @@ -3034,8 +2797,8 @@ packages: resolution: {integrity: sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==} dev: true - /fastq/1.13.0: - resolution: {integrity: sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==} + /fastq/1.15.0: + resolution: {integrity: sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==} dependencies: reusify: 1.0.4 dev: true @@ -3122,7 +2885,7 @@ packages: dezalgo: 1.0.4 hexoid: 1.0.0 once: 1.4.0 - qs: 6.11.0 + qs: 6.11.1 dev: true /forwarded/0.2.0: @@ -3143,7 +2906,7 @@ packages: resolution: {integrity: sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==} engines: {node: '>=6 <7 || >=8'} dependencies: - graceful-fs: 4.2.10 + graceful-fs: 4.2.11 jsonfile: 4.0.0 universalify: 0.1.2 dev: true @@ -3152,7 +2915,7 @@ packages: resolution: {integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==} engines: {node: '>=6 <7 || >=8'} dependencies: - graceful-fs: 4.2.10 + graceful-fs: 4.2.11 jsonfile: 4.0.0 universalify: 0.1.2 dev: true @@ -3178,8 +2941,8 @@ packages: engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.2 - define-properties: 1.1.4 - es-abstract: 1.20.4 + define-properties: 1.2.0 + es-abstract: 1.21.2 functions-have-names: 1.2.3 dev: true @@ -3197,8 +2960,8 @@ packages: engines: {node: 6.* || 8.* || >= 10.*} dev: true - /get-intrinsic/1.1.3: - resolution: {integrity: sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A==} + /get-intrinsic/1.2.0: + resolution: {integrity: sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==} dependencies: function-bind: 1.1.1 has: 1.0.3 @@ -3220,7 +2983,7 @@ packages: engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.2 - get-intrinsic: 1.1.3 + get-intrinsic: 1.2.0 dev: true /glob-parent/5.1.2: @@ -3252,11 +3015,28 @@ packages: path-is-absolute: 1.0.1 dev: true + /glob/9.3.2: + resolution: {integrity: sha512-BTv/JhKXFEHsErMte/AnfiSv8yYOLLiyH2lTg8vn02O21zWFgHPTfxtgn1QRe7NRgggUhC8hacR2Re94svHqeA==} + engines: {node: '>=16 || 14 >=14.17'} + dependencies: + fs.realpath: 1.0.0 + minimatch: 7.4.3 + minipass: 4.2.5 + path-scurry: 1.6.3 + dev: true + /globals/11.12.0: resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} engines: {node: '>=4'} dev: true + /globalthis/1.0.3: + resolution: {integrity: sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==} + engines: {node: '>= 0.4'} + dependencies: + define-properties: 1.2.0 + dev: true + /globby/11.1.0: resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} engines: {node: '>=10'} @@ -3264,7 +3044,7 @@ packages: array-union: 2.1.0 dir-glob: 3.0.1 fast-glob: 3.2.12 - ignore: 5.2.0 + ignore: 5.2.4 merge2: 1.4.1 slash: 3.0.0 dev: true @@ -3272,11 +3052,11 @@ packages: /gopd/1.0.1: resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} dependencies: - get-intrinsic: 1.1.3 + get-intrinsic: 1.2.0 dev: true - /graceful-fs/4.2.10: - resolution: {integrity: sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==} + /graceful-fs/4.2.11: + resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} dev: true /grapheme-splitter/1.0.4: @@ -3305,7 +3085,12 @@ packages: /has-property-descriptors/1.0.0: resolution: {integrity: sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==} dependencies: - get-intrinsic: 1.1.3 + get-intrinsic: 1.2.0 + dev: true + + /has-proto/1.0.1: + resolution: {integrity: sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==} + engines: {node: '>= 0.4'} dev: true /has-symbols/1.0.3: @@ -3402,8 +3187,8 @@ packages: safer-buffer: 2.1.2 dev: true - /ignore/5.2.0: - resolution: {integrity: sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==} + /ignore/5.2.4: + resolution: {integrity: sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==} engines: {node: '>= 4'} dev: true @@ -3437,11 +3222,11 @@ packages: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} dev: true - /internal-slot/1.0.3: - resolution: {integrity: sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==} + /internal-slot/1.0.5: + resolution: {integrity: sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==} engines: {node: '>= 0.4'} dependencies: - get-intrinsic: 1.1.3 + get-intrinsic: 1.2.0 has: 1.0.3 side-channel: 1.0.4 dev: true @@ -3467,6 +3252,14 @@ packages: has-tostringtag: 1.0.0 dev: true + /is-array-buffer/3.0.2: + resolution: {integrity: sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==} + dependencies: + call-bind: 1.0.2 + get-intrinsic: 1.2.0 + is-typed-array: 1.1.10 + dev: true + /is-arrayish/0.2.1: resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} dev: true @@ -3501,7 +3294,7 @@ packages: resolution: {integrity: sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==} hasBin: true dependencies: - ci-info: 3.5.0 + ci-info: 3.8.0 dev: true /is-core-module/2.11.0: @@ -3638,7 +3431,7 @@ packages: resolution: {integrity: sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg==} dependencies: call-bind: 1.0.2 - get-intrinsic: 1.1.3 + get-intrinsic: 1.2.0 dev: true /is-windows/1.0.2: @@ -3667,8 +3460,8 @@ packages: resolution: {integrity: sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==} engines: {node: '>=8'} dependencies: - '@babel/core': 7.20.2 - '@babel/parser': 7.20.3 + '@babel/core': 7.21.3 + '@babel/parser': 7.21.3 '@istanbuljs/schema': 0.1.3 istanbul-lib-coverage: 3.2.0 semver: 6.3.0 @@ -3704,106 +3497,44 @@ packages: istanbul-lib-report: 3.0.0 dev: true - /jest-changed-files/29.2.0: - resolution: {integrity: sha512-qPVmLLyBmvF5HJrY7krDisx6Voi8DmlV3GZYX0aFNbaQsZeoz1hfxcCMbqDGuQCxU1dJy9eYc2xscE8QrCCYaA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - execa: 5.1.1 - p-limit: 3.1.0 - dev: true - - /jest-changed-files/29.4.0: - resolution: {integrity: sha512-rnI1oPxgFghoz32Y8eZsGJMjW54UlqT17ycQeCEktcxxwqqKdlj9afl8LNeO0Pbu+h2JQHThQP0BzS67eTRx4w==} + /jest-changed-files/29.5.0: + resolution: {integrity: sha512-IFG34IUMUaNBIxjQXF/iu7g6EcdMrGRRxaUSw92I/2g2YC6vCdTltl4nHvt7Ci5nSJwXIkCu8Ka1DKF+X7Z1Ag==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: execa: 5.1.1 p-limit: 3.1.0 dev: true - /jest-circus/29.3.1: - resolution: {integrity: sha512-wpr26sEvwb3qQQbdlmei+gzp6yoSSoSL6GsLPxnuayZSMrSd5Ka7IjAvatpIernBvT2+Ic6RLTg+jSebScmasg==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@jest/environment': 29.4.1 - '@jest/expect': 29.4.1 - '@jest/test-result': 29.4.1 - '@jest/types': 29.4.1 - '@types/node': 18.11.18 - chalk: 4.1.2 - co: 4.6.0 - dedent: 0.7.0 - is-generator-fn: 2.1.0 - jest-each: 29.3.1 - jest-matcher-utils: 29.3.1 - jest-message-util: 29.4.1 - jest-runtime: 29.4.1 - jest-snapshot: 29.4.1 - jest-util: 29.4.1 - p-limit: 3.1.0 - pretty-format: 29.4.1 - slash: 3.0.0 - stack-utils: 2.0.6 - transitivePeerDependencies: - - supports-color - dev: true - - /jest-circus/29.4.1: - resolution: {integrity: sha512-v02NuL5crMNY4CGPHBEflLzl4v91NFb85a+dH9a1pUNx6Xjggrd8l9pPy4LZ1VYNRXlb+f65+7O/MSIbLir6pA==} + /jest-circus/29.5.0: + resolution: {integrity: sha512-gq/ongqeQKAplVxqJmbeUOJJKkW3dDNPY8PjhJ5G0lBRvu0e3EWGxGy5cI4LAGA7gV2UHCtWBI4EMXK8c9nQKA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/environment': 29.4.1 - '@jest/expect': 29.4.1 - '@jest/test-result': 29.4.1 - '@jest/types': 29.4.1 - '@types/node': 18.11.18 + '@jest/environment': 29.5.0 + '@jest/expect': 29.5.0 + '@jest/test-result': 29.5.0 + '@jest/types': 29.5.0 + '@types/node': 18.15.10 chalk: 4.1.2 co: 4.6.0 dedent: 0.7.0 is-generator-fn: 2.1.0 - jest-each: 29.4.1 - jest-matcher-utils: 29.4.1 - jest-message-util: 29.4.1 - jest-runtime: 29.4.1 - jest-snapshot: 29.4.1 - jest-util: 29.4.1 + jest-each: 29.5.0 + jest-matcher-utils: 29.5.0 + jest-message-util: 29.5.0 + jest-runtime: 29.5.0 + jest-snapshot: 29.5.0 + jest-util: 29.5.0 p-limit: 3.1.0 - pretty-format: 29.4.1 + pretty-format: 29.5.0 + pure-rand: 6.0.1 slash: 3.0.0 stack-utils: 2.0.6 transitivePeerDependencies: - supports-color dev: true - /jest-cli/29.3.1_odkjkoia5xunhxkdrka32ib6vi: - resolution: {integrity: sha512-TO/ewvwyvPOiBBuWZ0gm04z3WWP8TIK8acgPzE4IxgsLKQgb377NYGrQLc3Wl/7ndWzIH2CDNNsUjGxwLL43VQ==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - hasBin: true - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true - dependencies: - '@jest/core': 29.3.1_ts-node@10.9.1 - '@jest/test-result': 29.3.1 - '@jest/types': 29.4.1 - chalk: 4.1.2 - exit: 0.1.2 - graceful-fs: 4.2.10 - import-local: 3.1.0 - jest-config: 29.3.1_odkjkoia5xunhxkdrka32ib6vi - jest-util: 29.3.1 - jest-validate: 29.3.1 - prompts: 2.4.2 - yargs: 17.6.2 - transitivePeerDependencies: - - '@types/node' - - supports-color - - ts-node - dev: true - - /jest-cli/29.4.1_zfha7dvnw4nti6zkbsmhmn6xo4: - resolution: {integrity: sha512-jz7GDIhtxQ37M+9dlbv5K+/FVcIo1O/b1sX3cJgzlQUf/3VG25nvuWzlDC4F1FLLzUThJeWLu8I7JF9eWpuURQ==} + /jest-cli/29.5.0_m54q5dse6x3xfnwbnypkikpaee: + resolution: {integrity: sha512-L1KcP1l4HtfwdxXNFCL5bmUbLQiKrakMUriBEcc1Vfz6gx31ORKdreuWvmQVBit+1ss9NNR3yxjwfwzZNdQXJw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true peerDependencies: @@ -3812,26 +3543,26 @@ packages: node-notifier: optional: true dependencies: - '@jest/core': 29.4.1_ts-node@10.9.1 - '@jest/test-result': 29.4.1 - '@jest/types': 29.4.1 + '@jest/core': 29.5.0_ts-node@10.9.1 + '@jest/test-result': 29.5.0 + '@jest/types': 29.5.0 chalk: 4.1.2 exit: 0.1.2 - graceful-fs: 4.2.10 + graceful-fs: 4.2.11 import-local: 3.1.0 - jest-config: 29.4.1_zfha7dvnw4nti6zkbsmhmn6xo4 - jest-util: 29.4.1 - jest-validate: 29.4.1 + jest-config: 29.5.0_m54q5dse6x3xfnwbnypkikpaee + jest-util: 29.5.0 + jest-validate: 29.5.0 prompts: 2.4.2 - yargs: 17.6.2 + yargs: 17.7.1 transitivePeerDependencies: - '@types/node' - supports-color - ts-node dev: true - /jest-config/29.3.1_odkjkoia5xunhxkdrka32ib6vi: - resolution: {integrity: sha512-y0tFHdj2WnTEhxmGUK1T7fgLen7YK4RtfvpLFBXfQkh2eMJAQq24Vx9472lvn5wg0MAO6B+iPfJfzdR9hJYalg==} + /jest-config/29.5.0_m54q5dse6x3xfnwbnypkikpaee: + resolution: {integrity: sha512-kvDUKBnNJPNBmFFOhDbm59iu1Fii1Q6SxyhXfvylq3UTHbg6o7j/g8k2dZyXWLvfdKB1vAPxNZnMgtKJcmu3kA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: '@types/node': '*' @@ -3842,165 +3573,64 @@ packages: ts-node: optional: true dependencies: - '@babel/core': 7.20.2 - '@jest/test-sequencer': 29.3.1 - '@jest/types': 29.4.1 - '@types/node': 18.11.9 - babel-jest: 29.3.1_@babel+core@7.20.2 + '@babel/core': 7.21.3 + '@jest/test-sequencer': 29.5.0 + '@jest/types': 29.5.0 + '@types/node': 18.15.10 + babel-jest: 29.5.0_@babel+core@7.21.3 chalk: 4.1.2 - ci-info: 3.5.0 - deepmerge: 4.2.2 + ci-info: 3.8.0 + deepmerge: 4.3.1 glob: 7.2.3 - graceful-fs: 4.2.10 - jest-circus: 29.3.1 - jest-environment-node: 29.3.1 - jest-get-type: 29.2.0 - jest-regex-util: 29.2.0 - jest-resolve: 29.3.1 - jest-runner: 29.3.1 - jest-util: 29.4.1 - jest-validate: 29.4.1 + graceful-fs: 4.2.11 + jest-circus: 29.5.0 + jest-environment-node: 29.5.0 + jest-get-type: 29.4.3 + jest-regex-util: 29.4.3 + jest-resolve: 29.5.0 + jest-runner: 29.5.0 + jest-util: 29.5.0 + jest-validate: 29.5.0 micromatch: 4.0.5 parse-json: 5.2.0 - pretty-format: 29.4.1 + pretty-format: 29.5.0 slash: 3.0.0 strip-json-comments: 3.1.1 - ts-node: 10.9.1_e5zagbbrbtuenai5c7d63ieukq + ts-node: 10.9.1_zd7fjxbseldtiwc6h6ujrbvxuy transitivePeerDependencies: - supports-color dev: true - /jest-config/29.3.1_zfha7dvnw4nti6zkbsmhmn6xo4: - resolution: {integrity: sha512-y0tFHdj2WnTEhxmGUK1T7fgLen7YK4RtfvpLFBXfQkh2eMJAQq24Vx9472lvn5wg0MAO6B+iPfJfzdR9hJYalg==} + /jest-diff/29.5.0: + resolution: {integrity: sha512-LtxijLLZBduXnHSniy0WMdaHjmQnt3g5sa16W4p0HqukYTTsyTW3GD1q41TyGl5YFXj/5B2U6dlh5FM1LIMgxw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - peerDependencies: - '@types/node': '*' - ts-node: '>=9.0.0' - peerDependenciesMeta: - '@types/node': - optional: true - ts-node: - optional: true dependencies: - '@babel/core': 7.20.2 - '@jest/test-sequencer': 29.3.1 - '@jest/types': 29.4.1 - '@types/node': 18.11.18 - babel-jest: 29.3.1_@babel+core@7.20.2 chalk: 4.1.2 - ci-info: 3.5.0 - deepmerge: 4.2.2 - glob: 7.2.3 - graceful-fs: 4.2.10 - jest-circus: 29.3.1 - jest-environment-node: 29.3.1 - jest-get-type: 29.2.0 - jest-regex-util: 29.2.0 - jest-resolve: 29.3.1 - jest-runner: 29.3.1 - jest-util: 29.4.1 - jest-validate: 29.4.1 - micromatch: 4.0.5 - parse-json: 5.2.0 - pretty-format: 29.4.1 - slash: 3.0.0 - strip-json-comments: 3.1.1 - ts-node: 10.9.1_e5zagbbrbtuenai5c7d63ieukq - transitivePeerDependencies: - - supports-color + diff-sequences: 29.4.3 + jest-get-type: 29.4.3 + pretty-format: 29.5.0 dev: true - /jest-config/29.4.1_zfha7dvnw4nti6zkbsmhmn6xo4: - resolution: {integrity: sha512-g7p3q4NuXiM4hrS4XFATTkd+2z0Ml2RhFmFPM8c3WyKwVDNszbl4E7cV7WIx1YZeqqCtqbtTtZhGZWJlJqngzg==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - peerDependencies: - '@types/node': '*' - ts-node: '>=9.0.0' - peerDependenciesMeta: - '@types/node': - optional: true - ts-node: - optional: true - dependencies: - '@babel/core': 7.20.2 - '@jest/test-sequencer': 29.4.1 - '@jest/types': 29.4.1 - '@types/node': 18.11.18 - babel-jest: 29.4.1_@babel+core@7.20.2 - chalk: 4.1.2 - ci-info: 3.5.0 - deepmerge: 4.2.2 - glob: 7.2.3 - graceful-fs: 4.2.10 - jest-circus: 29.4.1 - jest-environment-node: 29.4.1 - jest-get-type: 29.2.0 - jest-regex-util: 29.2.0 - jest-resolve: 29.4.1 - jest-runner: 29.4.1 - jest-util: 29.4.1 - jest-validate: 29.4.1 - micromatch: 4.0.5 - parse-json: 5.2.0 - pretty-format: 29.4.1 - slash: 3.0.0 - strip-json-comments: 3.1.1 - ts-node: 10.9.1_dwbejauar3heyjbavp5dng3rsy - transitivePeerDependencies: - - supports-color - dev: true - - /jest-diff/29.3.1: - resolution: {integrity: sha512-vU8vyiO7568tmin2lA3r2DP8oRvzhvRcD4DjpXc6uGveQodyk7CKLhQlCSiwgx3g0pFaE88/KLZ0yaTWMc4Uiw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - chalk: 4.1.2 - diff-sequences: 29.3.1 - jest-get-type: 29.2.0 - pretty-format: 29.3.1 - dev: true - - /jest-diff/29.4.1: - resolution: {integrity: sha512-uazdl2g331iY56CEyfbNA0Ut7Mn2ulAG5vUaEHXycf1L6IPyuImIxSz4F0VYBKi7LYIuxOwTZzK3wh5jHzASMw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - chalk: 4.1.2 - diff-sequences: 29.3.1 - jest-get-type: 29.2.0 - pretty-format: 29.4.1 - dev: true - - /jest-docblock/29.2.0: - resolution: {integrity: sha512-bkxUsxTgWQGbXV5IENmfiIuqZhJcyvF7tU4zJ/7ioTutdz4ToB5Yx6JOFBpgI+TphRY4lhOyCWGNH/QFQh5T6A==} + /jest-docblock/29.4.3: + resolution: {integrity: sha512-fzdTftThczeSD9nZ3fzA/4KkHtnmllawWrXO69vtI+L9WjEIuXWs4AmyME7lN5hU7dB0sHhuPfcKofRsUb/2Fg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: detect-newline: 3.1.0 dev: true - /jest-each/29.3.1: - resolution: {integrity: sha512-qrZH7PmFB9rEzCSl00BWjZYuS1BSOH8lLuC0azQE9lQrAx3PWGKHTDudQiOSwIy5dGAJh7KA0ScYlCP7JxvFYA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@jest/types': 29.4.1 - chalk: 4.1.2 - jest-get-type: 29.2.0 - jest-util: 29.4.1 - pretty-format: 29.4.1 - dev: true - - /jest-each/29.4.1: - resolution: {integrity: sha512-QlYFiX3llJMWUV0BtWht/esGEz9w+0i7BHwODKCze7YzZzizgExB9MOfiivF/vVT0GSQ8wXLhvHXh3x2fVD4QQ==} + /jest-each/29.5.0: + resolution: {integrity: sha512-HM5kIJ1BTnVt+DQZ2ALp3rzXEl+g726csObrW/jpEGl+CDSSQpOJJX2KE/vEg8cxcMXdyEPu6U4QX5eruQv5hA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.4.1 + '@jest/types': 29.5.0 chalk: 4.1.2 - jest-get-type: 29.2.0 - jest-util: 29.4.1 - pretty-format: 29.4.1 + jest-get-type: 29.4.3 + jest-util: 29.5.0 + pretty-format: 29.5.0 dev: true - /jest-environment-jsdom/29.3.1: - resolution: {integrity: sha512-G46nKgiez2Gy4zvYNhayfMEAFlVHhWfncqvqS6yCd0i+a4NsSUD2WtrKSaYQrYiLQaupHXxCRi8xxVL2M9PbhA==} + /jest-environment-jsdom/29.5.0: + resolution: {integrity: sha512-/KG8yEK4aN8ak56yFVdqFDzKNHgF4BAymCx2LbPNPsUshUlfAl0eX402Xm1pt+eoG9SLZEUVifqXtX8SK74KCw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: canvas: ^2.5.0 @@ -4008,13 +3638,13 @@ packages: canvas: optional: true dependencies: - '@jest/environment': 29.3.1 - '@jest/fake-timers': 29.3.1 - '@jest/types': 29.4.1 + '@jest/environment': 29.5.0 + '@jest/fake-timers': 29.5.0 + '@jest/types': 29.5.0 '@types/jsdom': 20.0.1 - '@types/node': 18.11.18 - jest-mock: 29.3.1 - jest-util: 29.3.1 + '@types/node': 18.15.10 + jest-mock: 29.5.0 + jest-util: 29.5.0 jsdom: 20.0.3 transitivePeerDependencies: - bufferutil @@ -4022,171 +3652,86 @@ packages: - utf-8-validate dev: true - /jest-environment-node/29.3.1: - resolution: {integrity: sha512-xm2THL18Xf5sIHoU7OThBPtuH6Lerd+Y1NLYiZJlkE3hbE+7N7r8uvHIl/FkZ5ymKXJe/11SQuf3fv4v6rUMag==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@jest/environment': 29.4.1 - '@jest/fake-timers': 29.3.1 - '@jest/types': 29.4.1 - '@types/node': 18.11.18 - jest-mock: 29.4.1 - jest-util: 29.4.1 - dev: true - - /jest-environment-node/29.4.1: - resolution: {integrity: sha512-x/H2kdVgxSkxWAIlIh9MfMuBa0hZySmfsC5lCsWmWr6tZySP44ediRKDUiNggX/eHLH7Cd5ZN10Rw+XF5tXsqg==} + /jest-environment-node/29.5.0: + resolution: {integrity: sha512-ExxuIK/+yQ+6PRGaHkKewYtg6hto2uGCgvKdb2nfJfKXgZ17DfXjvbZ+jA1Qt9A8EQSfPnt5FKIfnOO3u1h9qw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/environment': 29.4.1 - '@jest/fake-timers': 29.4.1 - '@jest/types': 29.4.1 - '@types/node': 18.11.18 - jest-mock: 29.4.1 - jest-util: 29.4.1 + '@jest/environment': 29.5.0 + '@jest/fake-timers': 29.5.0 + '@jest/types': 29.5.0 + '@types/node': 18.15.10 + jest-mock: 29.5.0 + jest-util: 29.5.0 dev: true - /jest-get-type/29.2.0: - resolution: {integrity: sha512-uXNJlg8hKFEnDgFsrCjznB+sTxdkuqiCL6zMgA75qEbAJjJYTs9XPrvDctrEig2GDow22T/LvHgO57iJhXB/UA==} + /jest-get-type/29.4.3: + resolution: {integrity: sha512-J5Xez4nRRMjk8emnTpWrlkyb9pfRQQanDrvWHhsR1+VUfbwxi30eVcZFlcdGInRibU4G5LwHXpI7IRHU0CY+gg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dev: true - /jest-haste-map/29.3.1: - resolution: {integrity: sha512-/FFtvoG1xjbbPXQLFef+WSU4yrc0fc0Dds6aRPBojUid7qlPqZvxdUBA03HW0fnVHXVCnCdkuoghYItKNzc/0A==} + /jest-haste-map/29.5.0: + resolution: {integrity: sha512-IspOPnnBro8YfVYSw6yDRKh/TiCdRngjxeacCps1cQ9cgVN6+10JUcuJ1EabrgYLOATsIAigxA0rLR9x/YlrSA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.4.1 - '@types/graceful-fs': 4.1.5 - '@types/node': 18.11.18 - anymatch: 3.1.2 + '@jest/types': 29.5.0 + '@types/graceful-fs': 4.1.6 + '@types/node': 18.15.10 + anymatch: 3.1.3 fb-watchman: 2.0.2 - graceful-fs: 4.2.10 - jest-regex-util: 29.2.0 - jest-util: 29.4.1 - jest-worker: 29.3.1 + graceful-fs: 4.2.11 + jest-regex-util: 29.4.3 + jest-util: 29.5.0 + jest-worker: 29.5.0 micromatch: 4.0.5 walker: 1.0.8 optionalDependencies: fsevents: 2.3.2 dev: true - /jest-haste-map/29.4.1: - resolution: {integrity: sha512-imTjcgfVVTvg02khXL11NNLTx9ZaofbAWhilrMg/G8dIkp+HYCswhxf0xxJwBkfhWb3e8dwbjuWburvxmcr58w==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@jest/types': 29.4.1 - '@types/graceful-fs': 4.1.5 - '@types/node': 18.11.18 - anymatch: 3.1.2 - fb-watchman: 2.0.2 - graceful-fs: 4.2.10 - jest-regex-util: 29.2.0 - jest-util: 29.4.1 - jest-worker: 29.4.1 - micromatch: 4.0.5 - walker: 1.0.8 - optionalDependencies: - fsevents: 2.3.2 - dev: true - - /jest-leak-detector/29.3.1: - resolution: {integrity: sha512-3DA/VVXj4zFOPagGkuqHnSQf1GZBmmlagpguxEERO6Pla2g84Q1MaVIB3YMxgUaFIaYag8ZnTyQgiZ35YEqAQA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - jest-get-type: 29.2.0 - pretty-format: 29.4.1 - dev: true - - /jest-leak-detector/29.4.1: - resolution: {integrity: sha512-akpZv7TPyGMnH2RimOCgy+hPmWZf55EyFUvymQ4LMsQP8xSPlZumCPtXGoDhFNhUE2039RApZkTQDKU79p/FiQ==} + /jest-leak-detector/29.5.0: + resolution: {integrity: sha512-u9YdeeVnghBUtpN5mVxjID7KbkKE1QU4f6uUwuxiY0vYRi9BUCLKlPEZfDGR67ofdFmDz9oPAy2G92Ujrntmow==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - jest-get-type: 29.2.0 - pretty-format: 29.4.1 + jest-get-type: 29.4.3 + pretty-format: 29.5.0 dev: true - /jest-matcher-utils/29.3.1: - resolution: {integrity: sha512-fkRMZUAScup3txIKfMe3AIZZmPEjWEdsPJFK3AIy5qRohWqQFg1qrmKfYXR9qEkNc7OdAu2N4KPHibEmy4HPeQ==} + /jest-matcher-utils/29.5.0: + resolution: {integrity: sha512-lecRtgm/rjIK0CQ7LPQwzCs2VwW6WAahA55YBuI+xqmhm7LAaxokSB8C97yJeYyT+HvQkH741StzpU41wohhWw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: chalk: 4.1.2 - jest-diff: 29.3.1 - jest-get-type: 29.2.0 - pretty-format: 29.3.1 + jest-diff: 29.5.0 + jest-get-type: 29.4.3 + pretty-format: 29.5.0 dev: true - /jest-matcher-utils/29.4.1: - resolution: {integrity: sha512-k5h0u8V4nAEy6lSACepxL/rw78FLDkBnXhZVgFneVpnJONhb2DhZj/Gv4eNe+1XqQ5IhgUcqj745UwH0HJmMnA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - chalk: 4.1.2 - jest-diff: 29.4.1 - jest-get-type: 29.2.0 - pretty-format: 29.4.1 - dev: true - - /jest-message-util/29.3.1: - resolution: {integrity: sha512-lMJTbgNcDm5z+6KDxWtqOFWlGQxD6XaYwBqHR8kmpkP+WWWG90I35kdtQHY67Ay5CSuydkTBbJG+tH9JShFCyA==} + /jest-message-util/29.5.0: + resolution: {integrity: sha512-Kijeg9Dag6CKtIDA7O21zNTACqD5MD/8HfIV8pdD94vFyFuer52SigdC3IQMhab3vACxXMiFk+yMHNdbqtyTGA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@babel/code-frame': 7.18.6 - '@jest/types': 29.4.1 + '@jest/types': 29.5.0 '@types/stack-utils': 2.0.1 chalk: 4.1.2 - graceful-fs: 4.2.10 + graceful-fs: 4.2.11 micromatch: 4.0.5 - pretty-format: 29.4.1 + pretty-format: 29.5.0 slash: 3.0.0 stack-utils: 2.0.6 dev: true - /jest-message-util/29.4.1: - resolution: {integrity: sha512-H4/I0cXUaLeCw6FM+i4AwCnOwHRgitdaUFOdm49022YD5nfyr8C/DrbXOBEyJaj+w/y0gGJ57klssOaUiLLQGQ==} + /jest-mock/29.5.0: + resolution: {integrity: sha512-GqOzvdWDE4fAV2bWQLQCkujxYWL7RxjCnj71b5VhDAGOevB3qj3Ovg26A5NI84ZpODxyzaozXLOh2NCgkbvyaw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@babel/code-frame': 7.18.6 - '@jest/types': 29.4.1 - '@types/stack-utils': 2.0.1 - chalk: 4.1.2 - graceful-fs: 4.2.10 - micromatch: 4.0.5 - pretty-format: 29.4.1 - slash: 3.0.0 - stack-utils: 2.0.6 - dev: true - - /jest-mock/29.3.1: - resolution: {integrity: sha512-H8/qFDtDVMFvFP4X8NuOT3XRDzOUTz+FeACjufHzsOIBAxivLqkB1PoLCaJx9iPPQ8dZThHPp/G3WRWyMgA3JA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@jest/types': 29.4.1 - '@types/node': 18.11.18 - jest-util: 29.3.1 + '@jest/types': 29.5.0 + '@types/node': 18.15.10 + jest-util: 29.5.0 dev: true - /jest-mock/29.4.1: - resolution: {integrity: sha512-MwA4hQ7zBOcgVCVnsM8TzaFLVUD/pFWTfbkY953Y81L5ret3GFRZtmPmRFAjKQSdCKoJvvqOu6Bvfpqlwwb0dQ==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@jest/types': 29.4.1 - '@types/node': 18.11.18 - jest-util: 29.4.1 - dev: true - - /jest-pnp-resolver/1.2.2_jest-resolve@29.3.1: - resolution: {integrity: sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w==} - engines: {node: '>=6'} - peerDependencies: - jest-resolve: '*' - peerDependenciesMeta: - jest-resolve: - optional: true - dependencies: - jest-resolve: 29.3.1 - dev: true - - /jest-pnp-resolver/1.2.2_jest-resolve@29.4.1: - resolution: {integrity: sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w==} + /jest-pnp-resolver/1.2.3_jest-resolve@29.5.0: + resolution: {integrity: sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==} engines: {node: '>=6'} peerDependencies: jest-resolve: '*' @@ -4194,365 +3739,179 @@ packages: jest-resolve: optional: true dependencies: - jest-resolve: 29.4.1 + jest-resolve: 29.5.0 dev: true - /jest-regex-util/29.2.0: - resolution: {integrity: sha512-6yXn0kg2JXzH30cr2NlThF+70iuO/3irbaB4mh5WyqNIvLLP+B6sFdluO1/1RJmslyh/f9osnefECflHvTbwVA==} + /jest-regex-util/29.4.3: + resolution: {integrity: sha512-O4FglZaMmWXbGHSQInfXewIsd1LMn9p3ZXB/6r4FOkyhX2/iP/soMG98jGvk/A3HAN78+5VWcBGO0BJAPRh4kg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dev: true - /jest-resolve-dependencies/29.3.1: - resolution: {integrity: sha512-Vk0cYq0byRw2WluNmNWGqPeRnZ3p3hHmjJMp2dyyZeYIfiBskwq4rpiuGFR6QGAdbj58WC7HN4hQHjf2mpvrLA==} + /jest-resolve-dependencies/29.5.0: + resolution: {integrity: sha512-sjV3GFr0hDJMBpYeUuGduP+YeCRbd7S/ck6IvL3kQ9cpySYKqcqhdLLC2rFwrcL7tz5vYibomBrsFYWkIGGjOg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - jest-regex-util: 29.2.0 - jest-snapshot: 29.3.1 + jest-regex-util: 29.4.3 + jest-snapshot: 29.5.0 transitivePeerDependencies: - supports-color dev: true - /jest-resolve-dependencies/29.4.1: - resolution: {integrity: sha512-Y3QG3M1ncAMxfjbYgtqNXC5B595zmB6e//p/qpA/58JkQXu/IpLDoLeOa8YoYfsSglBKQQzNUqtfGJJT/qLmJg==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - jest-regex-util: 29.2.0 - jest-snapshot: 29.4.1 - transitivePeerDependencies: - - supports-color - dev: true - - /jest-resolve/29.3.1: - resolution: {integrity: sha512-amXJgH/Ng712w3Uz5gqzFBBjxV8WFLSmNjoreBGMqxgCz5cH7swmBZzgBaCIOsvb0NbpJ0vgaSFdJqMdT+rADw==} + /jest-resolve/29.5.0: + resolution: {integrity: sha512-1TzxJ37FQq7J10jPtQjcc+MkCkE3GBpBecsSUWJ0qZNJpmg6m0D9/7II03yJulm3H/fvVjgqLh/k2eYg+ui52w==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: chalk: 4.1.2 - graceful-fs: 4.2.10 - jest-haste-map: 29.3.1 - jest-pnp-resolver: 1.2.2_jest-resolve@29.3.1 - jest-util: 29.4.1 - jest-validate: 29.4.1 + graceful-fs: 4.2.11 + jest-haste-map: 29.5.0 + jest-pnp-resolver: 1.2.3_jest-resolve@29.5.0 + jest-util: 29.5.0 + jest-validate: 29.5.0 resolve: 1.22.1 - resolve.exports: 1.1.0 + resolve.exports: 2.0.2 slash: 3.0.0 dev: true - /jest-resolve/29.4.1: - resolution: {integrity: sha512-j/ZFNV2lm9IJ2wmlq1uYK0Y/1PiyDq9g4HEGsNTNr3viRbJdV+8Lf1SXIiLZXFvyiisu0qUyIXGBnw+OKWkJwQ==} + /jest-runner/29.5.0: + resolution: {integrity: sha512-m7b6ypERhFghJsslMLhydaXBiLf7+jXy8FwGRHO3BGV1mcQpPbwiqiKUR2zU2NJuNeMenJmlFZCsIqzJCTeGLQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - chalk: 4.1.2 - graceful-fs: 4.2.10 - jest-haste-map: 29.4.1 - jest-pnp-resolver: 1.2.2_jest-resolve@29.4.1 - jest-util: 29.4.1 - jest-validate: 29.4.1 - resolve: 1.22.1 - resolve.exports: 2.0.0 - slash: 3.0.0 - dev: true - - /jest-runner/29.3.1: - resolution: {integrity: sha512-oFvcwRNrKMtE6u9+AQPMATxFcTySyKfLhvso7Sdk/rNpbhg4g2GAGCopiInk1OP4q6gz3n6MajW4+fnHWlU3bA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@jest/console': 29.3.1 - '@jest/environment': 29.4.1 - '@jest/test-result': 29.4.1 - '@jest/transform': 29.3.1 - '@jest/types': 29.4.1 - '@types/node': 18.11.18 + '@jest/console': 29.5.0 + '@jest/environment': 29.5.0 + '@jest/test-result': 29.5.0 + '@jest/transform': 29.5.0 + '@jest/types': 29.5.0 + '@types/node': 18.15.10 chalk: 4.1.2 emittery: 0.13.1 - graceful-fs: 4.2.10 - jest-docblock: 29.2.0 - jest-environment-node: 29.3.1 - jest-haste-map: 29.3.1 - jest-leak-detector: 29.3.1 - jest-message-util: 29.3.1 - jest-resolve: 29.3.1 - jest-runtime: 29.3.1 - jest-util: 29.4.1 - jest-watcher: 29.3.1 - jest-worker: 29.3.1 + graceful-fs: 4.2.11 + jest-docblock: 29.4.3 + jest-environment-node: 29.5.0 + jest-haste-map: 29.5.0 + jest-leak-detector: 29.5.0 + jest-message-util: 29.5.0 + jest-resolve: 29.5.0 + jest-runtime: 29.5.0 + jest-util: 29.5.0 + jest-watcher: 29.5.0 + jest-worker: 29.5.0 p-limit: 3.1.0 source-map-support: 0.5.13 transitivePeerDependencies: - supports-color dev: true - /jest-runner/29.4.1: - resolution: {integrity: sha512-8d6XXXi7GtHmsHrnaqBKWxjKb166Eyj/ksSaUYdcBK09VbjPwIgWov1VwSmtupCIz8q1Xv4Qkzt/BTo3ZqiCeg==} + /jest-runtime/29.5.0: + resolution: {integrity: sha512-1Hr6Hh7bAgXQP+pln3homOiEZtCDZFqwmle7Ew2j8OlbkIu6uE3Y/etJQG8MLQs3Zy90xrp2C0BRrtPHG4zryw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/console': 29.4.1 - '@jest/environment': 29.4.1 - '@jest/test-result': 29.4.1 - '@jest/transform': 29.4.1 - '@jest/types': 29.4.1 - '@types/node': 18.11.18 - chalk: 4.1.2 - emittery: 0.13.1 - graceful-fs: 4.2.10 - jest-docblock: 29.2.0 - jest-environment-node: 29.4.1 - jest-haste-map: 29.4.1 - jest-leak-detector: 29.4.1 - jest-message-util: 29.4.1 - jest-resolve: 29.4.1 - jest-runtime: 29.4.1 - jest-util: 29.4.1 - jest-watcher: 29.4.1 - jest-worker: 29.4.1 - p-limit: 3.1.0 - source-map-support: 0.5.13 - transitivePeerDependencies: - - supports-color - dev: true - - /jest-runtime/29.3.1: - resolution: {integrity: sha512-jLzkIxIqXwBEOZx7wx9OO9sxoZmgT2NhmQKzHQm1xwR1kNW/dn0OjxR424VwHHf1SPN6Qwlb5pp1oGCeFTQ62A==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@jest/environment': 29.4.1 - '@jest/fake-timers': 29.3.1 - '@jest/globals': 29.4.1 - '@jest/source-map': 29.2.0 - '@jest/test-result': 29.4.1 - '@jest/transform': 29.3.1 - '@jest/types': 29.4.1 - '@types/node': 18.11.18 + '@jest/environment': 29.5.0 + '@jest/fake-timers': 29.5.0 + '@jest/globals': 29.5.0 + '@jest/source-map': 29.4.3 + '@jest/test-result': 29.5.0 + '@jest/transform': 29.5.0 + '@jest/types': 29.5.0 + '@types/node': 18.15.10 chalk: 4.1.2 cjs-module-lexer: 1.2.2 collect-v8-coverage: 1.0.1 glob: 7.2.3 - graceful-fs: 4.2.10 - jest-haste-map: 29.3.1 - jest-message-util: 29.3.1 - jest-mock: 29.4.1 - jest-regex-util: 29.2.0 - jest-resolve: 29.3.1 - jest-snapshot: 29.3.1 - jest-util: 29.4.1 + graceful-fs: 4.2.11 + jest-haste-map: 29.5.0 + jest-message-util: 29.5.0 + jest-mock: 29.5.0 + jest-regex-util: 29.4.3 + jest-resolve: 29.5.0 + jest-snapshot: 29.5.0 + jest-util: 29.5.0 slash: 3.0.0 strip-bom: 4.0.0 transitivePeerDependencies: - supports-color dev: true - /jest-runtime/29.4.1: - resolution: {integrity: sha512-UXTMU9uKu2GjYwTtoAw5rn4STxWw/nadOfW7v1sx6LaJYa3V/iymdCLQM6xy3+7C6mY8GfX22vKpgxY171UIoA==} + /jest-snapshot/29.5.0: + resolution: {integrity: sha512-x7Wolra5V0tt3wRs3/ts3S6ciSQVypgGQlJpz2rsdQYoUKxMxPNaoHMGJN6qAuPJqS+2iQ1ZUn5kl7HCyls84g==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/environment': 29.4.1 - '@jest/fake-timers': 29.4.1 - '@jest/globals': 29.4.1 - '@jest/source-map': 29.2.0 - '@jest/test-result': 29.4.1 - '@jest/transform': 29.4.1 - '@jest/types': 29.4.1 - '@types/node': 18.11.18 + '@babel/core': 7.21.3 + '@babel/generator': 7.21.3 + '@babel/plugin-syntax-jsx': 7.18.6_@babel+core@7.21.3 + '@babel/plugin-syntax-typescript': 7.20.0_@babel+core@7.21.3 + '@babel/traverse': 7.21.3 + '@babel/types': 7.21.3 + '@jest/expect-utils': 29.5.0 + '@jest/transform': 29.5.0 + '@jest/types': 29.5.0 + '@types/babel__traverse': 7.18.3 + '@types/prettier': 2.7.2 + babel-preset-current-node-syntax: 1.0.1_@babel+core@7.21.3 chalk: 4.1.2 - cjs-module-lexer: 1.2.2 - collect-v8-coverage: 1.0.1 - glob: 7.2.3 - graceful-fs: 4.2.10 - jest-haste-map: 29.4.1 - jest-message-util: 29.4.1 - jest-mock: 29.4.1 - jest-regex-util: 29.2.0 - jest-resolve: 29.4.1 - jest-snapshot: 29.4.1 - jest-util: 29.4.1 - semver: 7.3.8 - slash: 3.0.0 - strip-bom: 4.0.0 - transitivePeerDependencies: - - supports-color - dev: true - - /jest-snapshot/29.3.1: - resolution: {integrity: sha512-+3JOc+s28upYLI2OJM4PWRGK9AgpsMs/ekNryUV0yMBClT9B1DF2u2qay8YxcQd338PPYSFNb0lsar1B49sLDA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@babel/core': 7.20.2 - '@babel/generator': 7.20.4 - '@babel/plugin-syntax-jsx': 7.18.6_@babel+core@7.20.2 - '@babel/plugin-syntax-typescript': 7.20.0_@babel+core@7.20.2 - '@babel/traverse': 7.20.1 - '@babel/types': 7.20.2 - '@jest/expect-utils': 29.3.1 - '@jest/transform': 29.3.1 - '@jest/types': 29.4.1 - '@types/babel__traverse': 7.18.2 - '@types/prettier': 2.7.1 - babel-preset-current-node-syntax: 1.0.1_@babel+core@7.20.2 - chalk: 4.1.2 - expect: 29.3.1 - graceful-fs: 4.2.10 - jest-diff: 29.3.1 - jest-get-type: 29.2.0 - jest-haste-map: 29.3.1 - jest-matcher-utils: 29.3.1 - jest-message-util: 29.3.1 - jest-util: 29.3.1 - natural-compare: 1.4.0 - pretty-format: 29.3.1 - semver: 7.3.8 - transitivePeerDependencies: - - supports-color - dev: true - - /jest-snapshot/29.4.1: - resolution: {integrity: sha512-l4iV8EjGgQWVz3ee/LR9sULDk2pCkqb71bjvlqn+qp90lFwpnulHj4ZBT8nm1hA1C5wowXLc7MGnw321u0tsYA==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@babel/core': 7.20.2 - '@babel/generator': 7.20.4 - '@babel/plugin-syntax-jsx': 7.18.6_@babel+core@7.20.2 - '@babel/plugin-syntax-typescript': 7.20.0_@babel+core@7.20.2 - '@babel/traverse': 7.20.1 - '@babel/types': 7.20.2 - '@jest/expect-utils': 29.4.1 - '@jest/transform': 29.4.1 - '@jest/types': 29.4.1 - '@types/babel__traverse': 7.18.2 - '@types/prettier': 2.7.1 - babel-preset-current-node-syntax: 1.0.1_@babel+core@7.20.2 - chalk: 4.1.2 - expect: 29.4.1 - graceful-fs: 4.2.10 - jest-diff: 29.4.1 - jest-get-type: 29.2.0 - jest-haste-map: 29.4.1 - jest-matcher-utils: 29.4.1 - jest-message-util: 29.4.1 - jest-util: 29.4.1 + expect: 29.5.0 + graceful-fs: 4.2.11 + jest-diff: 29.5.0 + jest-get-type: 29.4.3 + jest-matcher-utils: 29.5.0 + jest-message-util: 29.5.0 + jest-util: 29.5.0 natural-compare: 1.4.0 - pretty-format: 29.4.1 + pretty-format: 29.5.0 semver: 7.3.8 transitivePeerDependencies: - supports-color dev: true - /jest-util/29.3.1: - resolution: {integrity: sha512-7YOVZaiX7RJLv76ZfHt4nbNEzzTRiMW/IiOG7ZOKmTXmoGBxUDefgMAxQubu6WPVqP5zSzAdZG0FfLcC7HOIFQ==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@jest/types': 29.4.1 - '@types/node': 18.11.18 - chalk: 4.1.2 - ci-info: 3.5.0 - graceful-fs: 4.2.10 - picomatch: 2.3.1 - dev: true - - /jest-util/29.4.1: - resolution: {integrity: sha512-bQy9FPGxVutgpN4VRc0hk6w7Hx/m6L53QxpDreTZgJd9gfx/AV2MjyPde9tGyZRINAUrSv57p2inGBu2dRLmkQ==} + /jest-util/29.5.0: + resolution: {integrity: sha512-RYMgG/MTadOr5t8KdhejfvUU82MxsCu5MF6KuDUHl+NuwzUt+Sm6jJWxTJVrDR1j5M/gJVCPKQEpWXY+yIQ6lQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.4.1 - '@types/node': 18.11.18 + '@jest/types': 29.5.0 + '@types/node': 18.15.10 chalk: 4.1.2 - ci-info: 3.5.0 - graceful-fs: 4.2.10 + ci-info: 3.8.0 + graceful-fs: 4.2.11 picomatch: 2.3.1 dev: true - /jest-validate/29.3.1: - resolution: {integrity: sha512-N9Lr3oYR2Mpzuelp1F8negJR3YE+L1ebk1rYA5qYo9TTY3f9OWdptLoNSPP9itOCBIRBqjt/S5XHlzYglLN67g==} + /jest-validate/29.5.0: + resolution: {integrity: sha512-pC26etNIi+y3HV8A+tUGr/lph9B18GnzSRAkPaaZJIE1eFdiYm6/CewuiJQ8/RlfHd1u/8Ioi8/sJ+CmbA+zAQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.4.1 + '@jest/types': 29.5.0 camelcase: 6.3.0 chalk: 4.1.2 - jest-get-type: 29.2.0 + jest-get-type: 29.4.3 leven: 3.1.0 - pretty-format: 29.4.1 + pretty-format: 29.5.0 dev: true - /jest-validate/29.4.1: - resolution: {integrity: sha512-qNZXcZQdIQx4SfUB/atWnI4/I2HUvhz8ajOSYUu40CSmf9U5emil8EDHgE7M+3j9/pavtk3knlZBDsgFvv/SWw==} + /jest-watcher/29.5.0: + resolution: {integrity: sha512-KmTojKcapuqYrKDpRwfqcQ3zjMlwu27SYext9pt4GlF5FUgB+7XE1mcCnSm6a4uUpFyQIkb6ZhzZvHl+jiBCiA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/types': 29.4.1 - camelcase: 6.3.0 - chalk: 4.1.2 - jest-get-type: 29.2.0 - leven: 3.1.0 - pretty-format: 29.4.1 - dev: true - - /jest-watcher/29.3.1: - resolution: {integrity: sha512-RspXG2BQFDsZSRKGCT/NiNa8RkQ1iKAjrO0//soTMWx/QUt+OcxMqMSBxz23PYGqUuWm2+m2mNNsmj0eIoOaFg==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@jest/test-result': 29.4.1 - '@jest/types': 29.4.1 - '@types/node': 18.11.18 - ansi-escapes: 4.3.2 - chalk: 4.1.2 - emittery: 0.13.1 - jest-util: 29.4.1 - string-length: 4.0.2 - dev: true - - /jest-watcher/29.4.1: - resolution: {integrity: sha512-vFOzflGFs27nU6h8dpnVRER3O2rFtL+VMEwnG0H3KLHcllLsU8y9DchSh0AL/Rg5nN1/wSiQ+P4ByMGpuybaVw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@jest/test-result': 29.4.1 - '@jest/types': 29.4.1 - '@types/node': 18.11.18 + '@jest/test-result': 29.5.0 + '@jest/types': 29.5.0 + '@types/node': 18.15.10 ansi-escapes: 4.3.2 chalk: 4.1.2 emittery: 0.13.1 - jest-util: 29.4.1 + jest-util: 29.5.0 string-length: 4.0.2 dev: true - /jest-worker/29.3.1: - resolution: {integrity: sha512-lY4AnnmsEWeiXirAIA0c9SDPbuCBq8IYuDVL8PMm0MZ2PEs2yPvRA/J64QBXuZp7CYKrDM/rmNrc9/i3KJQncw==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@types/node': 18.11.18 - jest-util: 29.4.1 - merge-stream: 2.0.0 - supports-color: 8.1.1 - dev: true - - /jest-worker/29.4.1: - resolution: {integrity: sha512-O9doU/S1EBe+yp/mstQ0VpPwpv0Clgn68TkNwGxL6/usX/KUW9Arnn4ag8C3jc6qHcXznhsT5Na1liYzAsuAbQ==} + /jest-worker/29.5.0: + resolution: {integrity: sha512-NcrQnevGoSp4b5kg+akIpthoAFHxPBcb5P6mYPY0fUNT+sSvmtu6jlkEle3anczUKIKEbMxFimk9oTP/tpIPgA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@types/node': 18.11.18 - jest-util: 29.4.1 + '@types/node': 18.15.10 + jest-util: 29.5.0 merge-stream: 2.0.0 supports-color: 8.1.1 dev: true - /jest/29.3.0_odkjkoia5xunhxkdrka32ib6vi: - resolution: {integrity: sha512-lWmHtOcJSjR6FYRw+4oo7456QUe6LN73Lw6HLwOWKTPLcyQF60cMh0EoIHi67dV74SY5tw/kL+jYC+Ji43ScUg==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - hasBin: true - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true - dependencies: - '@jest/core': 29.3.1_ts-node@10.9.1 - '@jest/types': 29.3.1 - import-local: 3.1.0 - jest-cli: 29.3.1_odkjkoia5xunhxkdrka32ib6vi - transitivePeerDependencies: - - '@types/node' - - supports-color - - ts-node - dev: true - - /jest/29.3.1_odkjkoia5xunhxkdrka32ib6vi: - resolution: {integrity: sha512-6iWfL5DTT0Np6UYs/y5Niu7WIfNv/wRTtN5RSXt2DIEft3dx3zPuw/3WJQBCJfmEzvDiEKwoqMbGD9n49+qLSA==} + /jest/29.5.0_m54q5dse6x3xfnwbnypkikpaee: + resolution: {integrity: sha512-juMg3he2uru1QoXX078zTa7pO85QyB9xajZc6bU+d9yEGwrKX6+vGmJQ3UdVZsvTEUARIdObzH68QItim6OSSQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true peerDependencies: @@ -4561,30 +3920,10 @@ packages: node-notifier: optional: true dependencies: - '@jest/core': 29.3.1_ts-node@10.9.1 - '@jest/types': 29.4.1 + '@jest/core': 29.5.0_ts-node@10.9.1 + '@jest/types': 29.5.0 import-local: 3.1.0 - jest-cli: 29.3.1_odkjkoia5xunhxkdrka32ib6vi - transitivePeerDependencies: - - '@types/node' - - supports-color - - ts-node - dev: true - - /jest/29.4.1_zfha7dvnw4nti6zkbsmhmn6xo4: - resolution: {integrity: sha512-cknimw7gAXPDOmj0QqztlxVtBVCw2lYY9CeIE5N6kD+kET1H4H79HSNISJmijb1HF+qk+G+ploJgiDi5k/fRlg==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - hasBin: true - peerDependencies: - node-notifier: ^8.0.1 || ^9.0.0 || ^10.0.0 - peerDependenciesMeta: - node-notifier: - optional: true - dependencies: - '@jest/core': 29.4.1_ts-node@10.9.1 - '@jest/types': 29.4.1 - import-local: 3.1.0 - jest-cli: 29.4.1_zfha7dvnw4nti6zkbsmhmn6xo4 + jest-cli: 29.5.0_m54q5dse6x3xfnwbnypkikpaee transitivePeerDependencies: - '@types/node' - supports-color @@ -4618,12 +3957,12 @@ packages: optional: true dependencies: abab: 2.0.6 - acorn: 8.8.1 + acorn: 8.8.2 acorn-globals: 7.0.1 cssom: 0.5.0 cssstyle: 2.3.0 data-urls: 3.0.2 - decimal.js: 10.4.2 + decimal.js: 10.4.3 domexception: 4.0.0 escodegen: 2.0.0 form-data: 4.0.0 @@ -4641,7 +3980,7 @@ packages: whatwg-encoding: 2.0.0 whatwg-mimetype: 3.0.0 whatwg-url: 11.0.0 - ws: 8.11.0 + ws: 8.13.0 xml-name-validator: 4.0.0 transitivePeerDependencies: - bufferutil @@ -4659,12 +3998,6 @@ packages: resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} dev: true - /json5/2.2.1: - resolution: {integrity: sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA==} - engines: {node: '>=6'} - hasBin: true - dev: true - /json5/2.2.3: resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} engines: {node: '>=6'} @@ -4674,7 +4007,7 @@ packages: /jsonfile/4.0.0: resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==} optionalDependencies: - graceful-fs: 4.2.10 + graceful-fs: 4.2.11 dev: true /kind-of/6.0.3: @@ -4705,8 +4038,8 @@ packages: type-check: 0.3.2 dev: true - /lilconfig/2.0.6: - resolution: {integrity: sha512-9JROoBW7pobfsx+Sq2JsASvCo6Pfo6WWoUW79HuB1BCoBXD4PLWJPqDF6fNj67pqBYTbAHkE57M1kS/+L1neOg==} + /lilconfig/2.1.0: + resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==} engines: {node: '>=10'} dev: true @@ -4714,8 +4047,8 @@ packages: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} dev: true - /load-tsconfig/0.2.3: - resolution: {integrity: sha512-iyT2MXws+dc2Wi6o3grCFtGXpeMvHmJqS27sMPGtV2eUu4PeFnG+33I8BlFK1t1NWMjOpcx9bridn5yxLDX2gQ==} + /load-tsconfig/0.2.5: + resolution: {integrity: sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dev: true @@ -4723,7 +4056,7 @@ packages: resolution: {integrity: sha512-OfCBkGEw4nN6JLtgRidPX6QxjBQGQf72q3si2uvqyFEMbycSFFHwAZeXx6cJgFM9wmLrf9zBwCP3Ivqa+LLZPw==} engines: {node: '>=6'} dependencies: - graceful-fs: 4.2.10 + graceful-fs: 4.2.11 js-yaml: 3.14.1 pify: 4.0.1 strip-bom: 3.0.0 @@ -4773,6 +4106,12 @@ packages: yallist: 2.1.2 dev: true + /lru-cache/5.1.1: + resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} + dependencies: + yallist: 3.1.1 + dev: true + /lru-cache/6.0.0: resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} engines: {node: '>=10'} @@ -4780,8 +4119,13 @@ packages: yallist: 4.0.0 dev: true - /lz-string/1.4.4: - resolution: {integrity: sha512-0ckx7ZHRPqb0oUm8zNr+90mtf9DQB60H1wMCjBtfi62Kl3a7JbHob6gA2bC+xRvZoOL+1hzUK8jeuEIQE8svEQ==} + /lru-cache/7.18.3: + resolution: {integrity: sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==} + engines: {node: '>=12'} + dev: true + + /lz-string/1.5.0: + resolution: {integrity: sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==} hasBin: true dev: true @@ -4900,6 +4244,13 @@ packages: brace-expansion: 1.1.11 dev: true + /minimatch/7.4.3: + resolution: {integrity: sha512-5UB4yYusDtkRPbRiy1cqZ1IpGNcJCGlEMG17RKzPddpyiPKoCdwohbED8g4QXT0ewCt8LTkQXuljsUfQ3FKM4A==} + engines: {node: '>=10'} + dependencies: + brace-expansion: 2.0.1 + dev: true + /minimist-options/4.1.0: resolution: {integrity: sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==} engines: {node: '>= 6'} @@ -4909,12 +4260,17 @@ packages: kind-of: 6.0.3 dev: true - /minimist/1.2.7: - resolution: {integrity: sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==} + /minimist/1.2.8: + resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} + dev: true + + /minipass/4.2.5: + resolution: {integrity: sha512-+yQl7SX3bIT83Lhb4BVorMAHVuqsskxRdlmO9kTpyukp8vsm2Sn/fUOV9xlnG8/a5JsypJzap21lz/y3FBMJ8Q==} + engines: {node: '>=8'} dev: true - /mixme/0.5.4: - resolution: {integrity: sha512-3KYa4m4Vlqx98GPdOHghxSdNtTvcP8E0kkaJ5Dlh+h2DRzF7zpuVVcA8B0QpKd11YJeP9QQ7ASkKzOeu195Wzw==} + /mixme/0.5.9: + resolution: {integrity: sha512-VC5fg6ySUscaWUpI4gxCBTQMH2RdUpNrk+MsbpCYtIvf9SBJdiUey4qE7BXviJsJR4nDQxCZ+3yaYNW3guz/Pw==} engines: {node: '>= 8.0.0'} dev: true @@ -4922,7 +4278,7 @@ packages: resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==} hasBin: true dependencies: - minimist: 1.2.7 + minimist: 1.2.8 dev: true /ms/2.0.0: @@ -4983,8 +4339,8 @@ packages: resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==} dev: true - /node-releases/2.0.6: - resolution: {integrity: sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg==} + /node-releases/2.0.10: + resolution: {integrity: sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w==} dev: true /normalize-package-data/2.5.0: @@ -5017,8 +4373,8 @@ packages: engines: {node: '>=0.10.0'} dev: true - /object-inspect/1.12.2: - resolution: {integrity: sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==} + /object-inspect/1.12.3: + resolution: {integrity: sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==} dev: true /object-is/1.1.5: @@ -5026,7 +4382,7 @@ packages: engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.2 - define-properties: 1.1.4 + define-properties: 1.2.0 dev: true /object-keys/1.1.1: @@ -5039,7 +4395,7 @@ packages: engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.2 - define-properties: 1.1.4 + define-properties: 1.2.0 has-symbols: 1.0.3 object-keys: 1.1.1 dev: true @@ -5170,6 +4526,14 @@ packages: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} dev: true + /path-scurry/1.6.3: + resolution: {integrity: sha512-RAmB+n30SlN+HnNx6EbcpoDy9nwdpcGPnEKrJnu6GZoDWBdIjo1UQMVtW2ybtC7LC2oKLcMq8y5g8WnKLiod9g==} + engines: {node: '>=16 || 14 >=14.17'} + dependencies: + lru-cache: 7.18.3 + minipass: 4.2.5 + dev: true + /path-to-regexp/0.1.7: resolution: {integrity: sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==} dev: true @@ -5217,8 +4581,8 @@ packages: ts-node: optional: true dependencies: - lilconfig: 2.0.6 - ts-node: 10.9.1_e5zagbbrbtuenai5c7d63ieukq + lilconfig: 2.1.0 + ts-node: 10.9.1_zd7fjxbseldtiwc6h6ujrbvxuy yaml: 1.10.2 dev: true @@ -5237,8 +4601,8 @@ packages: engines: {node: '>= 0.8.0'} dev: true - /prettier/2.7.1: - resolution: {integrity: sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==} + /prettier/2.8.7: + resolution: {integrity: sha512-yPngTo3aXUUmyuTjeTUT75txrf+aMh9FiD7q9ZE/i6r0bPb22g4FsE6Y338PQX1bmfy08i9QQCB7/rcUAVntfw==} engines: {node: '>=10.13.0'} hasBin: true dev: true @@ -5252,20 +4616,11 @@ packages: react-is: 17.0.2 dev: true - /pretty-format/29.3.1: - resolution: {integrity: sha512-FyLnmb1cYJV8biEIiRyzRFvs2lry7PPIvOqKVe1GCUEYg4YGmlx1qG9EJNMxArYm7piII4qb8UV1Pncq5dxmcg==} + /pretty-format/29.5.0: + resolution: {integrity: sha512-V2mGkI31qdttvTFX7Mt4efOqHXqJWMu4/r66Xh3Z3BwZaPfPJgp6/gbwoujRpPUtfEF6AUUWx3Jim3GCw5g/Qw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/schemas': 29.0.0 - ansi-styles: 5.2.0 - react-is: 18.2.0 - dev: true - - /pretty-format/29.4.1: - resolution: {integrity: sha512-dt/Z761JUVsrIKaY215o1xQJBGlSmTx/h4cSqXqjHLnU1+Kt+mavVE7UgqJJO5ukx5HjSswHfmXz4LjS2oIJfg==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - dependencies: - '@jest/schemas': 29.4.0 + '@jest/schemas': 29.4.3 ansi-styles: 5.2.0 react-is: 18.2.0 dev: true @@ -5302,11 +4657,15 @@ packages: resolution: {integrity: sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==} dev: true - /punycode/2.1.1: - resolution: {integrity: sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==} + /punycode/2.3.0: + resolution: {integrity: sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==} engines: {node: '>=6'} dev: true + /pure-rand/6.0.1: + resolution: {integrity: sha512-t+x1zEHDjBwkDGY5v5ApnZ/utcd4XYDiJsaQQoptTXgUXX95sDg1elCdJghzicm7n2mbCBJ3uYWr6M22SO19rg==} + dev: true + /qs/6.11.0: resolution: {integrity: sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==} engines: {node: '>=0.6'} @@ -5314,6 +4673,13 @@ packages: side-channel: 1.0.4 dev: true + /qs/6.11.1: + resolution: {integrity: sha512-0wsrzgTz/kAVIeuxSjnpGC56rzYtr6JT/2BwEvMaPhFIoYa1aGO8LbzuU1R0uUYQkLpWBTOj0l/CLAJB64J6nQ==} + engines: {node: '>=0.6'} + dependencies: + side-channel: 1.0.4 + dev: true + /querystringify/2.2.0: resolution: {integrity: sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==} dev: true @@ -5358,7 +4724,7 @@ packages: peerDependencies: react: '>=16.13.1' dependencies: - '@babel/runtime': 7.20.1 + '@babel/runtime': 7.21.0 react: 18.2.0 dev: true @@ -5421,14 +4787,14 @@ packages: resolution: {integrity: sha512-VIMnQi/Z4HT2Fxuwg5KrY174U1VdUIASQVWXXyqtNRtxSr9IYkn1rsI6Tb6HsrHCmB7gVpNwX6JxPTHcH6IoTA==} engines: {node: '>=6'} dependencies: - graceful-fs: 4.2.10 + graceful-fs: 4.2.11 js-yaml: 3.14.1 pify: 4.0.1 strip-bom: 3.0.0 dev: true - /readable-stream/2.3.7: - resolution: {integrity: sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==} + /readable-stream/2.3.8: + resolution: {integrity: sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==} dependencies: core-util-is: 1.0.3 inherits: 2.0.4 @@ -5454,8 +4820,8 @@ packages: strip-indent: 3.0.0 dev: true - /regenerator-runtime/0.13.10: - resolution: {integrity: sha512-KepLsg4dU12hryUO7bp/axHAKvwGOCV0sGloQtpagJ12ai+ojVDqkeGSiRX1zlq+kjIMZ1t7gpze+26QqtdGqw==} + /regenerator-runtime/0.13.11: + resolution: {integrity: sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==} dev: true /regexp.prototype.flags/1.4.3: @@ -5463,7 +4829,7 @@ packages: engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.2 - define-properties: 1.1.4 + define-properties: 1.2.0 functions-have-names: 1.2.3 dev: true @@ -5492,13 +4858,8 @@ packages: engines: {node: '>=8'} dev: true - /resolve.exports/1.1.0: - resolution: {integrity: sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ==} - engines: {node: '>=10'} - dev: true - - /resolve.exports/2.0.0: - resolution: {integrity: sha512-6K/gDlqgQscOlg9fSRpWstA8sYe8rbELsSTNpx+3kTrsVCzvSl0zIvRErM7fdl9ERWDsKnrLnwB+Ne89918XOg==} + /resolve.exports/2.0.2: + resolution: {integrity: sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==} engines: {node: '>=10'} dev: true @@ -5516,21 +4877,16 @@ packages: engines: {iojs: '>=1.0.0', node: '>=0.10.0'} dev: true - /rimraf/3.0.2: - resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - hasBin: true - dependencies: - glob: 7.2.3 - dev: true - - /rimraf/4.1.2: - resolution: {integrity: sha512-BlIbgFryTbw3Dz6hyoWFhKk+unCcHMSkZGrTFVAx2WmttdBSonsdtRlwiuTbDqTKr+UlXIUqJVS4QT5tUzGENQ==} + /rimraf/4.4.1: + resolution: {integrity: sha512-Gk8NlF062+T9CqNGn6h4tls3k6T1+/nXdOcSZVikNVtlRdYpA7wRJJMoXmuvOnLW844rPjdQ7JgXCYM6PPC/og==} engines: {node: '>=14'} hasBin: true + dependencies: + glob: 9.3.2 dev: true - /rollup/3.19.1: - resolution: {integrity: sha512-lAbrdN7neYCg/8WaoWn/ckzCtz+jr70GFfYdlf50OF7387HTg+wiuiqJRFYawwSPpqfqDNYqK7smY/ks2iAudg==} + /rollup/3.20.2: + resolution: {integrity: sha512-3zwkBQl7Ai7MFYQE0y1MeQ15+9jsi7XxfrqwTb/9EK8D9C9+//EBR4M+CuA1KODRaNbFez/lWxA5vhEGZp4MUg==} engines: {node: '>=14.18.0', npm: '>=8.0.0'} hasBin: true optionalDependencies: @@ -5555,7 +4911,7 @@ packages: resolution: {integrity: sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==} dependencies: call-bind: 1.0.2 - get-intrinsic: 1.1.3 + get-intrinsic: 1.2.0 is-regex: 1.1.4 dev: true @@ -5663,8 +5019,8 @@ packages: resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==} dependencies: call-bind: 1.0.2 - get-intrinsic: 1.1.3 - object-inspect: 1.12.2 + get-intrinsic: 1.2.0 + object-inspect: 1.12.3 dev: true /signal-exit/3.0.7: @@ -5719,11 +5075,11 @@ packages: signal-exit: 3.0.7 dev: true - /spdx-correct/3.1.1: - resolution: {integrity: sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==} + /spdx-correct/3.2.0: + resolution: {integrity: sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==} dependencies: spdx-expression-parse: 3.0.1 - spdx-license-ids: 3.0.12 + spdx-license-ids: 3.0.13 dev: true /spdx-exceptions/2.3.0: @@ -5734,11 +5090,11 @@ packages: resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==} dependencies: spdx-exceptions: 2.3.0 - spdx-license-ids: 3.0.12 + spdx-license-ids: 3.0.13 dev: true - /spdx-license-ids/3.0.12: - resolution: {integrity: sha512-rr+VVSXtRhO4OHbXUiAF7xW3Bo9DuuF6C5jH+q/x15j2jniycgKbxU09Hr0WqlSLUs4i4ltHGXqTe7VHclYWyA==} + /spdx-license-ids/3.0.13: + resolution: {integrity: sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w==} dev: true /sprintf-js/1.0.3: @@ -5757,10 +5113,17 @@ packages: engines: {node: '>= 0.8'} dev: true + /stop-iteration-iterator/1.0.0: + resolution: {integrity: sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==} + engines: {node: '>= 0.4'} + dependencies: + internal-slot: 1.0.5 + dev: true + /stream-transform/2.1.3: resolution: {integrity: sha512-9GHUiM5hMiCi6Y03jD2ARC1ettBXkQBoQAe7nJsPknnI0ow10aXjTnew8QtYQmLjzn974BnmWEAJgCY6ZP1DeQ==} dependencies: - mixme: 0.5.4 + mixme: 0.5.9 dev: true /streamsearch/1.1.0: @@ -5785,20 +5148,29 @@ packages: strip-ansi: 6.0.1 dev: true + /string.prototype.trim/1.2.7: + resolution: {integrity: sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.2 + define-properties: 1.2.0 + es-abstract: 1.21.2 + dev: true + /string.prototype.trimend/1.0.6: resolution: {integrity: sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==} dependencies: call-bind: 1.0.2 - define-properties: 1.1.4 - es-abstract: 1.20.4 + define-properties: 1.2.0 + es-abstract: 1.21.2 dev: true /string.prototype.trimstart/1.0.6: resolution: {integrity: sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==} dependencies: call-bind: 1.0.2 - define-properties: 1.1.4 - es-abstract: 1.20.4 + define-properties: 1.2.0 + es-abstract: 1.21.2 dev: true /string_decoder/1.1.1: @@ -5841,8 +5213,8 @@ packages: engines: {node: '>=8'} dev: true - /sucrase/3.28.0: - resolution: {integrity: sha512-TK9600YInjuiIhVM3729rH4ZKPOsGeyXUwY+Ugu9eilNbdTFyHr6XcAGYbRVZPDgWj6tgI7bx95aaJjHnbffag==} + /sucrase/3.30.0: + resolution: {integrity: sha512-7d37d3vLF0IeH2dzvHpzDNDxUqpbDHJXTJOAnQ8jvMW04o2Czps6mxtaSnKWpE+hUS/eczqfWPUgQTrazKZPnQ==} engines: {node: '>=8'} hasBin: true dependencies: @@ -5866,7 +5238,7 @@ packages: formidable: 2.1.2 methods: 1.1.2 mime: 2.6.0 - qs: 6.11.0 + qs: 6.11.1 semver: 7.3.8 transitivePeerDependencies: - supports-color @@ -5972,7 +5344,7 @@ packages: engines: {node: '>=6'} dependencies: psl: 1.9.0 - punycode: 2.1.1 + punycode: 2.3.0 universalify: 0.2.0 url-parse: 1.5.10 dev: true @@ -5984,14 +5356,14 @@ packages: /tr46/1.0.1: resolution: {integrity: sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==} dependencies: - punycode: 2.1.1 + punycode: 2.3.0 dev: true /tr46/3.0.0: resolution: {integrity: sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==} engines: {node: '>=12'} dependencies: - punycode: 2.1.1 + punycode: 2.3.0 dev: true /tree-kill/1.2.2: @@ -6008,75 +5380,7 @@ packages: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} dev: true - /ts-jest/29.0.3_ff4zxbw2zzokhzk2mi2gk62exe: - resolution: {integrity: sha512-Ibygvmuyq1qp/z3yTh9QTwVVAbFdDy/+4BtIQR2sp6baF2SJU/8CKK/hhnGIDY2L90Az2jIqTwZPnN2p+BweiQ==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - hasBin: true - peerDependencies: - '@babel/core': '>=7.0.0-beta.0 <8' - '@jest/types': ^29.0.0 - babel-jest: ^29.0.0 - esbuild: '*' - jest: ^29.0.0 - typescript: '>=4.3' - peerDependenciesMeta: - '@babel/core': - optional: true - '@jest/types': - optional: true - babel-jest: - optional: true - esbuild: - optional: true - dependencies: - '@jest/types': 29.3.1 - bs-logger: 0.2.6 - fast-json-stable-stringify: 2.1.0 - jest: 29.3.1_odkjkoia5xunhxkdrka32ib6vi - jest-util: 29.3.1 - json5: 2.2.1 - lodash.memoize: 4.1.2 - make-error: 1.3.6 - semver: 7.3.8 - typescript: 5.0.2 - yargs-parser: 21.1.1 - dev: true - - /ts-jest/29.0.3_scjnbz2tsh6ndqeps4y2s5svpu: - resolution: {integrity: sha512-Ibygvmuyq1qp/z3yTh9QTwVVAbFdDy/+4BtIQR2sp6baF2SJU/8CKK/hhnGIDY2L90Az2jIqTwZPnN2p+BweiQ==} - engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - hasBin: true - peerDependencies: - '@babel/core': '>=7.0.0-beta.0 <8' - '@jest/types': ^29.0.0 - babel-jest: ^29.0.0 - esbuild: '*' - jest: ^29.0.0 - typescript: '>=4.3' - peerDependenciesMeta: - '@babel/core': - optional: true - '@jest/types': - optional: true - babel-jest: - optional: true - esbuild: - optional: true - dependencies: - '@jest/types': 29.3.1 - bs-logger: 0.2.6 - fast-json-stable-stringify: 2.1.0 - jest: 29.3.0_odkjkoia5xunhxkdrka32ib6vi - jest-util: 29.3.1 - json5: 2.2.1 - lodash.memoize: 4.1.2 - make-error: 1.3.6 - semver: 7.3.8 - typescript: 5.0.2 - yargs-parser: 21.1.1 - dev: true - - /ts-jest/29.0.5_tpjjq25prhfdj3gatfdhfd3u2e: + /ts-jest/29.0.5_63eeh5l64lewq762rxfh3frani: resolution: {integrity: sha512-PL3UciSgIpQ7f6XjVOmbi96vmDHUqAyqDr8YxzopDqX3kfgYtX1cuNeBjP+L9sFXi6nzsGGA6R3fP3DDDJyrxA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -6097,11 +5401,11 @@ packages: esbuild: optional: true dependencies: - '@jest/types': 29.3.1 + '@jest/types': 29.5.0 bs-logger: 0.2.6 fast-json-stable-stringify: 2.1.0 - jest: 29.4.1_zfha7dvnw4nti6zkbsmhmn6xo4 - jest-util: 29.3.1 + jest: 29.5.0_m54q5dse6x3xfnwbnypkikpaee + jest-util: 29.5.0 json5: 2.2.3 lodash.memoize: 4.1.2 make-error: 1.3.6 @@ -6110,7 +5414,7 @@ packages: yargs-parser: 21.1.1 dev: true - /ts-node/10.9.1_dwbejauar3heyjbavp5dng3rsy: + /ts-node/10.9.1_zd7fjxbseldtiwc6h6ujrbvxuy: resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true peerDependencies: @@ -6129,39 +5433,8 @@ packages: '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.3 - '@types/node': 18.11.18 - acorn: 8.8.1 - acorn-walk: 8.2.0 - arg: 4.1.3 - create-require: 1.1.1 - diff: 4.0.2 - make-error: 1.3.6 - typescript: 5.0.2 - v8-compile-cache-lib: 3.0.1 - yn: 3.1.1 - dev: true - - /ts-node/10.9.1_e5zagbbrbtuenai5c7d63ieukq: - resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} - hasBin: true - peerDependencies: - '@swc/core': '>=1.2.50' - '@swc/wasm': '>=1.2.50' - '@types/node': '*' - typescript: '>=2.7' - peerDependenciesMeta: - '@swc/core': - optional: true - '@swc/wasm': - optional: true - dependencies: - '@cspotcode/source-map-support': 0.8.1 - '@tsconfig/node10': 1.0.9 - '@tsconfig/node12': 1.0.11 - '@tsconfig/node14': 1.0.3 - '@tsconfig/node16': 1.0.3 - '@types/node': 18.11.9 - acorn: 8.8.1 + '@types/node': 18.15.10 + acorn: 8.8.2 acorn-walk: 8.2.0 arg: 4.1.3 create-require: 1.1.1 @@ -6198,9 +5471,9 @@ packages: joycon: 3.1.1 postcss-load-config: 3.1.4_ts-node@10.9.1 resolve-from: 5.0.0 - rollup: 3.19.1 + rollup: 3.20.2 source-map: 0.8.0-beta.0 - sucrase: 3.28.0 + sucrase: 3.30.0 tree-kill: 1.2.2 typescript: 5.0.2 transitivePeerDependencies: @@ -6208,8 +5481,8 @@ packages: - ts-node dev: true - /tty-table/4.1.6: - resolution: {integrity: sha512-kRj5CBzOrakV4VRRY5kUWbNYvo/FpOsz65DzI5op9P+cHov3+IqPbo1JE1ZnQGkHdZgNFDsrEjrfqqy/Ply9fw==} + /tty-table/4.2.1: + resolution: {integrity: sha512-xz0uKo+KakCQ+Dxj1D/tKn2FSyreSYWzdkL/BYhgN6oMW808g8QRMuh1atAV9fjTPbWBjfbkKQpI/5rEcnAc7g==} engines: {node: '>=8.0.0'} hasBin: true dependencies: @@ -6219,68 +5492,68 @@ packages: smartwrap: 2.0.2 strip-ansi: 6.0.1 wcwidth: 1.0.1 - yargs: 17.6.2 + yargs: 17.7.1 dev: true - /turbo-darwin-64/1.6.3: - resolution: {integrity: sha512-QmDIX0Yh1wYQl0bUS0gGWwNxpJwrzZU2GIAYt3aOKoirWA2ecnyb3R6ludcS1znfNV2MfunP+l8E3ncxUHwtjA==} + /turbo-darwin-64/1.8.5: + resolution: {integrity: sha512-CAYh56bzeHfnh7jTm03r29bh8p5a/EjQo1Id5yLUH7hS7msTau/+YpxJWPodLbN0UQsUYivUqHQkglJ+eMJ7xA==} cpu: [x64] os: [darwin] requiresBuild: true dev: true optional: true - /turbo-darwin-arm64/1.6.3: - resolution: {integrity: sha512-75DXhFpwE7CinBbtxTxH08EcWrxYSPFow3NaeFwsG8aymkWXF+U2aukYHJA6I12n9/dGqf7yRXzkF0S/9UtdyQ==} + /turbo-darwin-arm64/1.8.5: + resolution: {integrity: sha512-R3jCPOv+lu3dcvMhj8b/Defv6dyUwX6W+tbX7d6YUCA46Plf/bGCQ8+MSbxmr/4E1GyGOVFsn1wRfiYk0us/Dg==} cpu: [arm64] os: [darwin] requiresBuild: true dev: true optional: true - /turbo-linux-64/1.6.3: - resolution: {integrity: sha512-O9uc6J0yoRPWdPg9THRQi69K6E2iZ98cRHNvus05lZbcPzZTxJYkYGb5iagCmCW/pq6fL4T4oLWAd6evg2LGQA==} + /turbo-linux-64/1.8.5: + resolution: {integrity: sha512-YRc/KNRZeUVvth11UO4SDQZR2IqGgl9MSsbzqoHuFz4B4Q5QXH7onHogv9aXWE/BZBBbcrSBTlwBSG0Gg+J8hg==} cpu: [x64] os: [linux] requiresBuild: true dev: true optional: true - /turbo-linux-arm64/1.6.3: - resolution: {integrity: sha512-dCy667qqEtZIhulsRTe8hhWQNCJO0i20uHXv7KjLHuFZGCeMbWxB8rsneRoY+blf8+QNqGuXQJxak7ayjHLxiA==} + /turbo-linux-arm64/1.8.5: + resolution: {integrity: sha512-8exVZb7XBl/V3gHSweuUyG2D9IzfWqwLvlXoeLWlVYSj61Ajgdv+WU7lvUmx+H2s+sSKqmIFmewA5Lw6YY37sg==} cpu: [arm64] os: [linux] requiresBuild: true dev: true optional: true - /turbo-windows-64/1.6.3: - resolution: {integrity: sha512-lKRqwL3mrVF09b9KySSaOwetehmGknV9EcQTF7d2dxngGYYX1WXoQLjFP9YYH8ZV07oPm+RUOAKSCQuDuMNhiA==} + /turbo-windows-64/1.8.5: + resolution: {integrity: sha512-fA8PU5ZNoFnQkapG06WiEqfsVQ5wbIPkIqTwUsd/M2Lp+KgxE79SQbuEI+2vQ9SmwM5qoMi515IPjgvXAJXgCw==} cpu: [x64] os: [win32] requiresBuild: true dev: true optional: true - /turbo-windows-arm64/1.6.3: - resolution: {integrity: sha512-BXY1sDPEA1DgPwuENvDCD8B7Hb0toscjus941WpL8CVd10hg9pk/MWn9CNgwDO5Q9ks0mw+liDv2EMnleEjeNA==} + /turbo-windows-arm64/1.8.5: + resolution: {integrity: sha512-SW/NvIdhckLsAWjU/iqBbCB0S8kXupKscUK3kEW1DZIr3MYcP/yIuaE/IdPuqcoF3VP0I3TLD4VTYCCKAo3tKA==} cpu: [arm64] os: [win32] requiresBuild: true dev: true optional: true - /turbo/1.6.3: - resolution: {integrity: sha512-FtfhJLmEEtHveGxW4Ye/QuY85AnZ2ZNVgkTBswoap7UMHB1+oI4diHPNyqrQLG4K1UFtCkjOlVoLsllUh/9QRw==} + /turbo/1.8.5: + resolution: {integrity: sha512-UBnH2wIFb5g6OQCk8f34Ud15ZXV4xEMmugeDJTU5Ur2LpVRsNEny0isSCYdb3Iu3howoNyyXmtpaxWsAwNYkkg==} hasBin: true requiresBuild: true optionalDependencies: - turbo-darwin-64: 1.6.3 - turbo-darwin-arm64: 1.6.3 - turbo-linux-64: 1.6.3 - turbo-linux-arm64: 1.6.3 - turbo-windows-64: 1.6.3 - turbo-windows-arm64: 1.6.3 + turbo-darwin-64: 1.8.5 + turbo-darwin-arm64: 1.8.5 + turbo-linux-64: 1.8.5 + turbo-linux-arm64: 1.8.5 + turbo-windows-64: 1.8.5 + turbo-windows-arm64: 1.8.5 dev: true /type-check/0.3.2: @@ -6323,6 +5596,14 @@ packages: mime-types: 2.1.35 dev: true + /typed-array-length/1.0.4: + resolution: {integrity: sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==} + dependencies: + call-bind: 1.0.2 + for-each: 0.3.3 + is-typed-array: 1.1.10 + dev: true + /typedarray/0.0.6: resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} dev: true @@ -6357,13 +5638,13 @@ packages: engines: {node: '>= 0.8'} dev: true - /update-browserslist-db/1.0.10_browserslist@4.21.4: + /update-browserslist-db/1.0.10_browserslist@4.21.5: resolution: {integrity: sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==} hasBin: true peerDependencies: browserslist: '>= 4.21.0' dependencies: - browserslist: 4.21.4 + browserslist: 4.21.5 escalade: 3.1.1 picocolors: 1.0.0 dev: true @@ -6396,8 +5677,8 @@ packages: resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} dev: true - /v8-to-istanbul/9.0.1: - resolution: {integrity: sha512-74Y4LqY74kLE6IFyIjPtkSTWzUZmj8tdHT9Ii/26dvQ6K9Dl2NbEfj0XgU2sHCtKgt5VupqhlO/5aWuqS+IY1w==} + /v8-to-istanbul/9.1.0: + resolution: {integrity: sha512-6z3GW9x8G1gd+JIIgQQQxXuiJtCXeAjp6RaPEPLv62mH3iPHPxV6W3robxtCzNErRo6ZwTmzWhsbNvjyEBKzKA==} engines: {node: '>=10.12.0'} dependencies: '@jridgewell/trace-mapping': 0.3.17 @@ -6408,7 +5689,7 @@ packages: /validate-npm-package-license/3.0.4: resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} dependencies: - spdx-correct: 3.1.1 + spdx-correct: 3.2.0 spdx-expression-parse: 3.0.1 dev: true @@ -6577,20 +5858,12 @@ packages: signal-exit: 3.0.7 dev: true - /write-file-atomic/5.0.0: - resolution: {integrity: sha512-R7NYMnHSlV42K54lwY9lvW6MnSm1HSJqZL3xiSgi9E7//FYaI74r2G0rd+/X6VAMkHEdzxQaU5HUOXWUz5kA/w==} - engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - dependencies: - imurmurhash: 0.1.4 - signal-exit: 3.0.7 - dev: true - - /ws/8.11.0: - resolution: {integrity: sha512-HPG3wQd9sNQoT9xHyNCXoDUa+Xw/VevmY9FoHyQ+g+rrMn4j6FB4np7Z0OhdTgjx6MgQLK7jwSy1YecU1+4Asg==} + /ws/8.13.0: + resolution: {integrity: sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==} engines: {node: '>=10.0.0'} peerDependencies: bufferutil: ^4.0.1 - utf-8-validate: ^5.0.2 + utf-8-validate: '>=5.0.2' peerDependenciesMeta: bufferutil: optional: true @@ -6625,6 +5898,10 @@ packages: resolution: {integrity: sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==} dev: true + /yallist/3.1.1: + resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} + dev: true + /yallist/4.0.0: resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} dev: true @@ -6664,8 +5941,8 @@ packages: yargs-parser: 18.1.3 dev: true - /yargs/17.6.2: - resolution: {integrity: sha512-1/9UrdHjDZc0eOU0HxOHoS78C69UD3JRMvzlJ7S79S2nTaWRA/whGCTV8o9e/N/1Va9YIV7Q4sOxD8VV4pCWOw==} + /yargs/17.7.1: + resolution: {integrity: sha512-cwiTb08Xuv5fqF4AovYacTFNxk62th7LKJ6BL9IGUpTJrWoU7/7WdQGTP2SjKf1dUNBGzDd28p/Yfs/GI6JrLw==} engines: {node: '>=12'} dependencies: cliui: 8.0.1 @@ -6687,10 +5964,6 @@ packages: engines: {node: '>=10'} dev: true - /zod/3.20.1: - resolution: {integrity: sha512-At2YngeqktnHk6L9vf6Sdt7IGcRFziasf7JyQfKwxMd2rOWIUvURP6oLUTW6N0WKQ5bcIdI+IZ3+uGZCCcQcQg==} - dev: true - - /zod/3.20.2: - resolution: {integrity: sha512-1MzNQdAvO+54H+EaK5YpyEy0T+Ejo/7YLHS93G3RnYWh5gaotGHwGeN/ZO687qEDU2y4CdStQYXVHIgrUl5UVQ==} + /zod/3.21.4: + resolution: {integrity: sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw==} dev: true From d498a040ff5035c54e7e05195d0fdb21ae29ae71 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sun, 26 Mar 2023 21:06:32 +0200 Subject: [PATCH 124/206] feat(express): activate transform --- .../src/type-providers/type-provider.types.ts | 2 +- .../src/type-providers/zod.type-provider.ts | 25 +++++++- packages/express/src/zodios-validator.ts | 64 +++++++++---------- packages/express/src/zodios.ts | 19 ++++-- packages/express/src/zodios.types.ts | 2 +- packages/express/src/zodios.utils.ts | 27 -------- 6 files changed, 69 insertions(+), 70 deletions(-) delete mode 100644 packages/express/src/zodios.utils.ts diff --git a/packages/express/src/type-providers/type-provider.types.ts b/packages/express/src/type-providers/type-provider.types.ts index 751daa55..5aef1128 100644 --- a/packages/express/src/type-providers/type-provider.types.ts +++ b/packages/express/src/type-providers/type-provider.types.ts @@ -6,5 +6,5 @@ export interface ZodiosExpressTypeProviderFactory< readonly _provider?: TypeProvider; validate: (schema: any, input: unknown) => ZodiosValidateResult; validateAsync: (schema: any, input: unknown) => Promise; - isSchemaBooleanOrNumber: (schema: any) => boolean; + isSchemaString: (schema: any) => boolean; } diff --git a/packages/express/src/type-providers/zod.type-provider.ts b/packages/express/src/type-providers/zod.type-provider.ts index b1d26914..337c4fc2 100644 --- a/packages/express/src/type-providers/zod.type-provider.ts +++ b/packages/express/src/type-providers/zod.type-provider.ts @@ -1,10 +1,31 @@ import type { ZodTypeProvider } from "@zodios/core"; import { ZodiosExpressTypeProviderFactory } from "./type-provider.types"; -import z from "zod"; +import { z } from "zod"; + +// istanbul ignore next +export function isZodType( + t: z.ZodTypeAny, + type: z.ZodFirstPartyTypeKind +): boolean { + if (t._def?.typeName === type) { + return true; + } + if ( + t._def?.typeName === z.ZodFirstPartyTypeKind.ZodEffects && + (t as z.ZodEffects)._def.effect.type === "refinement" + ) { + return isZodType((t as z.ZodEffects).innerType(), type); + } + if (t._def?.innerType) { + return isZodType(t._def?.innerType, type); + } + return false; +} export const zodTypeFactory: ZodiosExpressTypeProviderFactory = { validate: (schema, input) => schema.safeParse(input), validateAsync: (schema, input) => schema.safeParseAsync(input), - isSchemaBooleanOrNumber: (schema) => true, + isSchemaString: (schema) => + isZodType(schema, z.ZodFirstPartyTypeKind.ZodString), }; diff --git a/packages/express/src/zodios-validator.ts b/packages/express/src/zodios-validator.ts index 71184132..5dccd914 100644 --- a/packages/express/src/zodios-validator.ts +++ b/packages/express/src/zodios-validator.ts @@ -1,32 +1,36 @@ import express from "express"; -import { ZodiosEndpointDefinition } from "@zodios/core"; -import { isZodType, withoutTransform } from "./zodios.utils"; -import { z } from "zod"; +import { AnyZodiosTypeProvider, ZodiosEndpointDefinition } from "@zodios/core"; +import { ZodiosExpressTypeProviderFactory } from "./type-providers"; const METHODS = ["get", "post", "put", "patch", "delete"] as const; -async function validateParam(schema: z.ZodType, parameter: unknown) { +function safeJsonParse(str: string) { + try { + return JSON.parse(str); + } catch { + return str; + } +} + +async function validateParam( + schema: unknown, + parameter: unknown, + typeFactory: ZodiosExpressTypeProviderFactory +) { if ( - !isZodType(schema, z.ZodFirstPartyTypeKind.ZodString) && + !typeFactory.isSchemaString(schema) && parameter && typeof parameter === "string" ) { - return z - .preprocess((x) => { - try { - return JSON.parse(x as string); - } catch { - return x; - } - }, schema) - .safeParseAsync(parameter); + return typeFactory.validateAsync(schema, safeJsonParse(parameter)); } - return schema.safeParseAsync(parameter); + return typeFactory.validateAsync(schema, parameter); } function validateEndpointMiddleware( endpoint: ZodiosEndpointDefinition, - transform: boolean + transform: boolean, + typeFactory: ZodiosExpressTypeProviderFactory ) { return async ( req: express.Request, @@ -36,31 +40,26 @@ function validateEndpointMiddleware( for (let parameter of endpoint.parameters!) { let schema = parameter.schema; - if (!transform) { - // @ts-ignore - schema = withoutTransform(schema); - } - switch (parameter.type) { case "Body": { // @ts-ignore - const result = await schema.safeParseAsync(req.body); + const result = await typeFactory.validateAsync(schema, req.body); if (!result.success) { return res.status(400).json({ context: "body", error: result.error.issues, }); } - req.body = result.data; + if (transform) req.body = result.data; } break; case "Path": { const result = await validateParam( - // @ts-ignore schema, - req.params[parameter.name] + req.params[parameter.name], + typeFactory ); if (!result.success) { return res.status(400).json({ @@ -68,15 +67,15 @@ function validateEndpointMiddleware( error: result.error.issues, }); } - req.params[parameter.name] = result.data as any; + if (transform) req.params[parameter.name] = result.data as any; } break; case "Query": { const result = await validateParam( - // @ts-ignore schema, - req.query[parameter.name] + req.query[parameter.name], + typeFactory ); if (!result.success) { return res.status(400).json({ @@ -84,7 +83,7 @@ function validateEndpointMiddleware( error: result.error.issues, }); } - req.query[parameter.name] = result.data as any; + if (transform) req.query[parameter.name] = result.data as any; } break; case "Header": @@ -99,7 +98,7 @@ function validateEndpointMiddleware( error: result.error.issues, }); } - req.headers[parameter.name] = result.data as any; + if (transform) req.headers[parameter.name] = result.data as any; } break; } @@ -117,7 +116,8 @@ function validateEndpointMiddleware( export function injectParametersValidators( api: readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], router: express.Router, - transform: boolean + transform: boolean, + typeFactory: ZodiosExpressTypeProviderFactory ) { for (let method of METHODS) { const savedMethod = router[method].bind(router); @@ -128,7 +128,7 @@ export function injectParametersValidators( ); if (endpoint && endpoint.parameters) { handlers = [ - validateEndpointMiddleware(endpoint, transform), + validateEndpointMiddleware(endpoint, transform, typeFactory), ...handlers, ]; } diff --git a/packages/express/src/zodios.ts b/packages/express/src/zodios.ts index be83630f..be80286a 100644 --- a/packages/express/src/zodios.ts +++ b/packages/express/src/zodios.ts @@ -41,13 +41,14 @@ export function zodiosApp< express: app = express(), enableJsonBodyParser = true, validate = true, - transform = false, + transform = true, + typeFactory = zodTypeFactory, } = options; if (enableJsonBodyParser) { app.use(express.json()); } if (api && validate) { - injectParametersValidators(api, app, transform); + injectParametersValidators(api, app, transform,typeFactory); } return app as any; } @@ -72,10 +73,14 @@ export function zodiosRouter< : InferInputTypeFromSchema, TypeProvider > { - const { validate = true, transform = false, ...routerOptions } = options; + const { + validate = true, + transform = true, + typeFactory = zodTypeFactory, + ...routerOptions } = options; const router = options?.router ?? express.Router(routerOptions); if (validate) { - injectParametersValidators(api, router, transform); + injectParametersValidators(api, router, transform, typeFactory); } return router as any; } @@ -129,7 +134,7 @@ export class ZodiosContext< : InferInputTypeFromSchema, TypeProvider > { - return zodiosApp(api, options); + return zodiosApp(api, {...options, typeFactory: this.typeFactory}); } nextApp( @@ -142,7 +147,7 @@ export class ZodiosContext< : InferInputTypeFromSchema, TypeProvider > { - return zodiosNextApp(api, options); + return zodiosNextApp(api, {...options, typeFactory: this.typeFactory}); } router( @@ -155,7 +160,7 @@ export class ZodiosContext< : InferInputTypeFromSchema, TypeProvider > { - return zodiosRouter(api, options); + return zodiosRouter(api, {...options, typeFactory: this.typeFactory}); } } diff --git a/packages/express/src/zodios.types.ts b/packages/express/src/zodios.types.ts index 640e3a56..d500108d 100644 --- a/packages/express/src/zodios.types.ts +++ b/packages/express/src/zodios.types.ts @@ -123,7 +123,7 @@ export interface ZodiosValidationOptions { */ validate?: boolean; /** - * transform request parameters - default is false + * transform request parameters - default is true */ transform?: boolean; } diff --git a/packages/express/src/zodios.utils.ts b/packages/express/src/zodios.utils.ts deleted file mode 100644 index 655a0949..00000000 --- a/packages/express/src/zodios.utils.ts +++ /dev/null @@ -1,27 +0,0 @@ -import { z } from "zod"; - -export function isZodType( - t: z.ZodTypeAny, - type: z.ZodFirstPartyTypeKind -): boolean { - if (t._def?.typeName === type) { - return true; - } - if ( - t._def?.typeName === z.ZodFirstPartyTypeKind.ZodEffects && - (t as z.ZodEffects)._def.effect.type === "refinement" - ) { - return isZodType((t as z.ZodEffects).innerType(), type); - } - if (t._def?.innerType) { - return isZodType(t._def?.innerType, type); - } - return false; -} - -export function withoutTransform(t: z.ZodTypeAny): z.ZodTypeAny { - if (t._def?.typeName === z.ZodFirstPartyTypeKind.ZodEffects) { - return withoutTransform((t as z.ZodEffects).innerType()); - } - return t; -} From e2bc66b150429ead4d4c74b571c6046f1f9dfeb7 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sat, 8 Apr 2023 13:58:11 +0200 Subject: [PATCH 125/206] RELEASING: Releasing 0 package(s) Releases: [skip ci] From a39510e5c305d51e3418043ed346f3963645ad46 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sat, 8 Apr 2023 13:59:39 +0200 Subject: [PATCH 126/206] feat(types): improve typing --- .changeset/pre.json | 3 +- packages/core/examples/large-api.ts | 5057 +++++++++++++++++++++++++++ packages/core/examples/zod-types.ts | 18 +- packages/core/src/zodios.types.ts | 4 +- 4 files changed, 5078 insertions(+), 4 deletions(-) create mode 100644 packages/core/examples/large-api.ts diff --git a/.changeset/pre.json b/.changeset/pre.json index 7e3c7ec9..97b3152b 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -6,7 +6,8 @@ "@zodios/axios": "11.0.0-beta.0", "@zodios/fetch": "11.0.0-beta.5", "@zodios/testing": "11.0.0-beta.8", - "@zodios/react": "11.0.0-beta.12" + "@zodios/react": "11.0.0-beta.12", + "@zodios/express": "11.0.0-beta.17" }, "changesets": [ "blue-hounds-sort", diff --git a/packages/core/examples/large-api.ts b/packages/core/examples/large-api.ts new file mode 100644 index 00000000..567bb31c --- /dev/null +++ b/packages/core/examples/large-api.ts @@ -0,0 +1,5057 @@ +import { makeApi, ZodiosCore, type ZodiosOptions } from "../src"; +import { z } from "zod"; + +const CategoryEnum = z.enum([ + "hris", + "ats", + "accounting", + "ticketing", + "crm", + "mktg", + "filestorage", +]); +const AccountDetails = z + .object({ + id: z.string().uuid(), + integration: z.string(), + integration_slug: z.string(), + category: CategoryEnum.nullable(), + end_user_origin_id: z.string(), + end_user_organization_name: z.string(), + end_user_email_address: z.string().email(), + status: z.string(), + webhook_listener_url: z.string().url(), + is_duplicate: z.boolean().nullable(), + }) + .partial(); +const CategoriesEnum = z.enum([ + "hris", + "ats", + "accounting", + "ticketing", + "crm", + "mktg", + "filestorage", +]); +const AccountIntegration = z.object({ + name: z.string(), + categories: z.array(CategoriesEnum).optional(), + image: z.string().url().nullish(), + square_image: z.string().url().nullish(), + color: z + .string() + .max(18) + .regex(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/) + .optional(), + slug: z.string().optional(), +}); +const AccountToken = z.object({ + account_token: z.string(), + integration: AccountIntegration, +}); +const ClassificationEnum = z.enum([ + "ASSET", + "EQUITY", + "EXPENSE", + "LIABILITY", + "REVENUE", +]); +const AccountStatusEnum = z.enum(["ACTIVE", "PENDING", "INACTIVE"]); +const CurrencyEnum = z.enum([ + "XUA", + "AFN", + "AFA", + "ALL", + "ALK", + "DZD", + "ADP", + "AOA", + "AOK", + "AON", + "AOR", + "ARA", + "ARS", + "ARM", + "ARP", + "ARL", + "AMD", + "AWG", + "AUD", + "ATS", + "AZN", + "AZM", + "BSD", + "BHD", + "BDT", + "BBD", + "BYN", + "BYB", + "BYR", + "BEF", + "BEC", + "BEL", + "BZD", + "BMD", + "BTN", + "BOB", + "BOL", + "BOV", + "BOP", + "BAM", + "BAD", + "BAN", + "BWP", + "BRC", + "BRZ", + "BRE", + "BRR", + "BRN", + "BRB", + "BRL", + "GBP", + "BND", + "BGL", + "BGN", + "BGO", + "BGM", + "BUK", + "BIF", + "XPF", + "KHR", + "CAD", + "CVE", + "KYD", + "XAF", + "CLE", + "CLP", + "CLF", + "CNX", + "CNY", + "CNH", + "COP", + "COU", + "KMF", + "CDF", + "CRC", + "HRD", + "HRK", + "CUC", + "CUP", + "CYP", + "CZK", + "CSK", + "DKK", + "DJF", + "DOP", + "NLG", + "XCD", + "DDM", + "ECS", + "ECV", + "EGP", + "GQE", + "ERN", + "EEK", + "ETB", + "EUR", + "XBA", + "XEU", + "XBB", + "XBC", + "XBD", + "FKP", + "FJD", + "FIM", + "FRF", + "XFO", + "XFU", + "GMD", + "GEK", + "GEL", + "DEM", + "GHS", + "GHC", + "GIP", + "XAU", + "GRD", + "GTQ", + "GWP", + "GNF", + "GNS", + "GYD", + "HTG", + "HNL", + "HKD", + "HUF", + "IMP", + "ISK", + "ISJ", + "INR", + "IDR", + "IRR", + "IQD", + "IEP", + "ILS", + "ILP", + "ILR", + "ITL", + "JMD", + "JPY", + "JOD", + "KZT", + "KES", + "KWD", + "KGS", + "LAK", + "LVL", + "LVR", + "LBP", + "LSL", + "LRD", + "LYD", + "LTL", + "LTT", + "LUL", + "LUC", + "LUF", + "MOP", + "MKD", + "MKN", + "MGA", + "MGF", + "MWK", + "MYR", + "MVR", + "MVP", + "MLF", + "MTL", + "MTP", + "MRU", + "MRO", + "MUR", + "MXV", + "MXN", + "MXP", + "MDC", + "MDL", + "MCF", + "MNT", + "MAD", + "MAF", + "MZE", + "MZN", + "MZM", + "MMK", + "NAD", + "NPR", + "ANG", + "TWD", + "NZD", + "NIO", + "NIC", + "NGN", + "KPW", + "NOK", + "OMR", + "PKR", + "XPD", + "PAB", + "PGK", + "PYG", + "PEI", + "PEN", + "PES", + "PHP", + "XPT", + "PLN", + "PLZ", + "PTE", + "GWE", + "QAR", + "XRE", + "RHD", + "RON", + "ROL", + "RUB", + "RUR", + "RWF", + "SVC", + "WST", + "SAR", + "RSD", + "CSD", + "SCR", + "SLL", + "XAG", + "SGD", + "SKK", + "SIT", + "SBD", + "SOS", + "ZAR", + "ZAL", + "KRH", + "KRW", + "KRO", + "SSP", + "SUR", + "ESP", + "ESA", + "ESB", + "XDR", + "LKR", + "SHP", + "XSU", + "SDD", + "SDG", + "SDP", + "SRD", + "SRG", + "SZL", + "SEK", + "CHF", + "SYP", + "STN", + "STD", + "TVD", + "TJR", + "TJS", + "TZS", + "XTS", + "THB", + "XXX", + "TPE", + "TOP", + "TTD", + "TND", + "TRY", + "TRL", + "TMT", + "TMM", + "USD", + "USN", + "USS", + "UGX", + "UGS", + "UAH", + "UAK", + "AED", + "UYW", + "UYU", + "UYP", + "UYI", + "UZS", + "VUV", + "VES", + "VEB", + "VEF", + "VND", + "VNN", + "CHE", + "CHW", + "XOF", + "YDD", + "YER", + "YUN", + "YUD", + "YUM", + "YUR", + "ZWN", + "ZRN", + "ZRZ", + "ZMW", + "ZMK", + "ZWD", + "ZWR", + "ZWL", +]); +const RemoteData = z.object({ + path: z.string(), + data: z.object({}).partial().passthrough().optional(), +}); +const Account = z + .object({ + id: z.string().uuid(), + remote_id: z.string().nullable(), + name: z.string().nullable(), + description: z.string().nullable(), + classification: ClassificationEnum.nullable(), + type: z.string().nullable(), + status: AccountStatusEnum.nullable(), + current_balance: z.number().nullable(), + currency: CurrencyEnum.nullable(), + account_number: z.string().nullable(), + parent_account: z.string().uuid().nullable(), + company: z.string().uuid().nullable(), + remote_was_deleted: z.boolean(), + field_mappings: z.object({}).partial().passthrough().nullable(), + remote_data: z.array(RemoteData).nullable(), + }) + .partial(); +const PaginatedAccountList = z + .object({ + next: z.string().nullable(), + previous: z.string().nullable(), + results: z.array(Account), + }) + .partial(); +const AccountRequest = z + .object({ + name: z.string().nullable(), + description: z.string().nullable(), + classification: ClassificationEnum.nullable(), + type: z.string().nullable(), + status: AccountStatusEnum.nullable(), + current_balance: z.number().nullable(), + currency: CurrencyEnum.nullable(), + account_number: z.string().nullable(), + parent_account: z.string().uuid().nullable(), + company: z.string().uuid().nullable(), + integration_params: z.object({}).partial().passthrough().nullable(), + linked_account_params: z.object({}).partial().passthrough().nullable(), + }) + .partial(); +const AccountEndpointRequest = z.object({ model: AccountRequest }); +const ValidationProblemSource = z.object({ pointer: z.string() }); +const WarningValidationProblem = z.object({ + source: ValidationProblemSource.optional(), + title: z.string(), + detail: z.string(), + problem_type: z.string(), +}); +const ErrorValidationProblem = z.object({ + source: ValidationProblemSource.optional(), + title: z.string(), + detail: z.string(), + problem_type: z.string(), +}); +const DebugModelLogSummary = z.object({ + url: z.string(), + method: z.string(), + status_code: z.number().int(), +}); +const DebugModeLog = z.object({ + log_id: z.string(), + dashboard_view: z.string(), + log_summary: DebugModelLogSummary, +}); +const AccountResponse = z.object({ + model: Account, + warnings: z.array(WarningValidationProblem), + errors: z.array(ErrorValidationProblem), + logs: z.array(DebugModeLog).optional(), +}); +const LinkedAccountStatus = z.object({ + linked_account_status: z.string(), + can_make_request: z.boolean(), +}); +const MetaResponse = z.object({ + request_schema: z.object({}).partial().passthrough(), + remote_field_classes: z.object({}).partial().passthrough().optional(), + status: LinkedAccountStatus.optional(), + has_conditional_params: z.boolean(), + has_required_linked_account_params: z.boolean(), +}); +const AddressTypeEnum = z.enum(["BILLING", "SHIPPING"]); +const CountryEnum = z.enum([ + "AF", + "AX", + "AL", + "DZ", + "AS", + "AD", + "AO", + "AI", + "AQ", + "AG", + "AR", + "AM", + "AW", + "AU", + "AT", + "AZ", + "BS", + "BH", + "BD", + "BB", + "BY", + "BE", + "BZ", + "BJ", + "BM", + "BT", + "BO", + "BQ", + "BA", + "BW", + "BV", + "BR", + "IO", + "BN", + "BG", + "BF", + "BI", + "CV", + "KH", + "CM", + "CA", + "KY", + "CF", + "TD", + "CL", + "CN", + "CX", + "CC", + "CO", + "KM", + "CG", + "CD", + "CK", + "CR", + "CI", + "HR", + "CU", + "CW", + "CY", + "CZ", + "DK", + "DJ", + "DM", + "DO", + "EC", + "EG", + "SV", + "GQ", + "ER", + "EE", + "SZ", + "ET", + "FK", + "FO", + "FJ", + "FI", + "FR", + "GF", + "PF", + "TF", + "GA", + "GM", + "GE", + "DE", + "GH", + "GI", + "GR", + "GL", + "GD", + "GP", + "GU", + "GT", + "GG", + "GN", + "GW", + "GY", + "HT", + "HM", + "VA", + "HN", + "HK", + "HU", + "IS", + "IN", + "ID", + "IR", + "IQ", + "IE", + "IM", + "IL", + "IT", + "JM", + "JP", + "JE", + "JO", + "KZ", + "KE", + "KI", + "KW", + "KG", + "LA", + "LV", + "LB", + "LS", + "LR", + "LY", + "LI", + "LT", + "LU", + "MO", + "MG", + "MW", + "MY", + "MV", + "ML", + "MT", + "MH", + "MQ", + "MR", + "MU", + "YT", + "MX", + "FM", + "MD", + "MC", + "MN", + "ME", + "MS", + "MA", + "MZ", + "MM", + "NA", + "NR", + "NP", + "NL", + "NC", + "NZ", + "NI", + "NE", + "NG", + "NU", + "NF", + "KP", + "MK", + "MP", + "NO", + "OM", + "PK", + "PW", + "PS", + "PA", + "PG", + "PY", + "PE", + "PH", + "PN", + "PL", + "PT", + "PR", + "QA", + "RE", + "RO", + "RU", + "RW", + "BL", + "SH", + "KN", + "LC", + "MF", + "PM", + "VC", + "WS", + "SM", + "ST", + "SA", + "SN", + "RS", + "SC", + "SL", + "SG", + "SX", + "SK", + "SI", + "SB", + "SO", + "ZA", + "GS", + "KR", + "SS", + "ES", + "LK", + "SD", + "SR", + "SJ", + "SE", + "CH", + "SY", + "TW", + "TJ", + "TZ", + "TH", + "TL", + "TG", + "TK", + "TO", + "TT", + "TN", + "TR", + "TM", + "TC", + "TV", + "UG", + "UA", + "AE", + "GB", + "UM", + "US", + "UY", + "UZ", + "VU", + "VE", + "VN", + "VG", + "VI", + "WF", + "EH", + "YE", + "ZM", + "ZW", +]); +const Address = z + .object({ + type: AddressTypeEnum.nullable(), + street_1: z.string().nullable(), + street_2: z.string().nullable(), + city: z.string().nullable(), + state: z.unknown().nullable(), + country_subdivision: z.string().nullable(), + country: CountryEnum.nullable(), + zip_code: z.string().nullable(), + }) + .partial(); +const AccountingAttachment = z + .object({ + id: z.string().uuid(), + remote_id: z.string().nullable(), + file_name: z.string().nullable(), + file_url: z.string().max(2000).url().nullable(), + company: z.string().uuid().nullable(), + remote_was_deleted: z.boolean(), + field_mappings: z.object({}).partial().passthrough().nullable(), + remote_data: z.array(RemoteData).nullable(), + }) + .partial(); +const PaginatedAccountingAttachmentList = z + .object({ + next: z.string().nullable(), + previous: z.string().nullable(), + results: z.array(AccountingAttachment), + }) + .partial(); +const AccountingAttachmentRequest = z + .object({ + file_name: z.string().nullable(), + file_url: z.string().max(2000).url().nullable(), + company: z.string().uuid().nullable(), + integration_params: z.object({}).partial().passthrough().nullable(), + linked_account_params: z.object({}).partial().passthrough().nullable(), + }) + .partial(); +const AccountingAttachmentEndpointRequest = z.object({ + model: AccountingAttachmentRequest, +}); +const AccountingAttachmentResponse = z.object({ + model: AccountingAttachment, + warnings: z.array(WarningValidationProblem), + errors: z.array(ErrorValidationProblem), + logs: z.array(DebugModeLog).optional(), +}); +const ModelOperation = z.object({ + model_name: z.string(), + available_operations: z.array(z.string()), + required_post_parameters: z.array(z.string()), + supported_fields: z.array(z.string()), +}); +const AvailableActions = z.object({ + integration: AccountIntegration, + passthrough_available: z.boolean(), + available_model_operations: z.array(ModelOperation).optional(), +}); +const ReportItem = z + .object({ + remote_id: z.string().nullable(), + name: z.string().nullable(), + value: z.number().nullable(), + sub_items: z.object({}).partial().passthrough(), + company: z.string().uuid().nullable(), + }) + .partial(); +const BalanceSheet = z + .object({ + id: z.string().uuid(), + remote_id: z.string().nullable(), + name: z.string().nullable(), + currency: CurrencyEnum.nullable(), + company: z.string().uuid().nullable(), + date: z.string().datetime().nullable(), + net_assets: z.number().nullable(), + assets: z.array(ReportItem), + liabilities: z.array(ReportItem), + equity: z.array(ReportItem), + remote_generated_at: z.string().datetime().nullable(), + remote_was_deleted: z.boolean(), + field_mappings: z.object({}).partial().passthrough().nullable(), + remote_data: z.array(RemoteData).nullable(), + }) + .partial(); +const PaginatedBalanceSheetList = z + .object({ + next: z.string().nullable(), + previous: z.string().nullable(), + results: z.array(BalanceSheet), + }) + .partial(); +const CashFlowStatement = z + .object({ + id: z.string().uuid(), + remote_id: z.string().nullable(), + name: z.string().nullable(), + currency: CurrencyEnum.nullable(), + company: z.string().uuid().nullable(), + start_period: z.string().datetime().nullable(), + end_period: z.string().datetime().nullable(), + cash_at_beginning_of_period: z.number().nullable(), + cash_at_end_of_period: z.number().nullable(), + operating_activities: z.array(ReportItem), + investing_activities: z.array(ReportItem), + financing_activities: z.array(ReportItem), + remote_generated_at: z.string().datetime().nullable(), + remote_was_deleted: z.boolean(), + field_mappings: z.object({}).partial().passthrough().nullable(), + remote_data: z.array(RemoteData).nullable(), + }) + .partial(); +const PaginatedCashFlowStatementList = z + .object({ + next: z.string().nullable(), + previous: z.string().nullable(), + results: z.array(CashFlowStatement), + }) + .partial(); +const CommonModelScopesDisabledModelsEnabledActionsEnum = z.enum([ + "ENABLED_ACTION_READ", + "ENABLED_ACTION_WRITE", +]); +const CommonModelScopesDisabledModels = z.object({ + model_name: z.string(), + model_id: z.string(), + enabled_actions: z.array(CommonModelScopesDisabledModelsEnabledActionsEnum), + is_disabled: z.boolean(), + disabled_fields: z.array(z.string()), +}); +const CommonModelScopeData = z.object({ + common_models: z.array(CommonModelScopesDisabledModels), + linked_account_id: z.string().uuid().optional(), +}); +const CommonModelScopes = z.object({ + organization_level_scopes: CommonModelScopeData.optional(), + scope_overrides: z.array(CommonModelScopeData), +}); +const EnabledActionsEnum = z.enum(["READ", "WRITE"]); +const CommonModelScopesPostInnerDeserializerRequest = z.object({ + model_id: z.string().min(1), + enabled_actions: z.array(EnabledActionsEnum), + disabled_fields: z.array(z.string()), +}); +const CommonModelScopesUpdateSerializer = z.object({ + common_models: z.array(CommonModelScopesPostInnerDeserializerRequest), +}); +const AccountingPhoneNumber = z + .object({ number: z.string().nullable(), type: z.string().nullable() }) + .partial(); +const CompanyInfo = z + .object({ + id: z.string().uuid(), + remote_id: z.string().nullable(), + name: z.string().nullable(), + legal_name: z.string().nullable(), + tax_number: z.string().nullable(), + fiscal_year_end_month: z.number().int().gte(1).lte(12).nullable(), + fiscal_year_end_day: z.number().int().gte(1).lte(31).nullable(), + currency: CurrencyEnum.nullable(), + remote_created_at: z.string().datetime().nullable(), + urls: z.array(z.string()).nullable(), + addresses: z.array(Address), + phone_numbers: z.array(AccountingPhoneNumber), + remote_was_deleted: z.boolean(), + field_mappings: z.object({}).partial().passthrough().nullable(), + remote_data: z.array(RemoteData).nullable(), + }) + .partial(); +const PaginatedCompanyInfoList = z + .object({ + next: z.string().nullable(), + previous: z.string().nullable(), + results: z.array(CompanyInfo), + }) + .partial(); +const Status7d1Enum = z.enum(["ACTIVE", "ARCHIVED"]); +const Contact = z + .object({ + id: z.string().uuid(), + remote_id: z.string().nullable(), + name: z.string().nullable(), + is_supplier: z.boolean().nullable(), + is_customer: z.boolean().nullable(), + email_address: z.string().nullable(), + tax_number: z.string().nullable(), + status: Status7d1Enum.nullable(), + currency: z.string().nullable(), + remote_updated_at: z.string().datetime().nullable(), + company: z.string().uuid().nullable(), + addresses: z.array(z.string()), + phone_numbers: z.array(AccountingPhoneNumber), + remote_was_deleted: z.boolean(), + field_mappings: z.object({}).partial().passthrough().nullable(), + remote_data: z.array(RemoteData).nullable(), + }) + .partial(); +const PaginatedContactList = z + .object({ + next: z.string().nullable(), + previous: z.string().nullable(), + results: z.array(Contact), + }) + .partial(); +const AccountingPhoneNumberRequest = z + .object({ + number: z.string().nullable(), + type: z.string().nullable(), + integration_params: z.object({}).partial().passthrough().nullable(), + linked_account_params: z.object({}).partial().passthrough().nullable(), + }) + .partial(); +const ContactRequest = z + .object({ + name: z.string().nullable(), + is_supplier: z.boolean().nullable(), + is_customer: z.boolean().nullable(), + email_address: z.string().nullable(), + tax_number: z.string().nullable(), + status: Status7d1Enum.nullable(), + currency: z.string().nullable(), + company: z.string().uuid().nullable(), + addresses: z.array(z.string()), + phone_numbers: z.array(AccountingPhoneNumberRequest), + integration_params: z.object({}).partial().passthrough().nullable(), + linked_account_params: z.object({}).partial().passthrough().nullable(), + }) + .partial(); +const ContactEndpointRequest = z.object({ model: ContactRequest }); +const ContactResponse = z.object({ + model: Contact, + warnings: z.array(WarningValidationProblem), + errors: z.array(ErrorValidationProblem), + logs: z.array(DebugModeLog).optional(), +}); +const CreditNoteStatusEnum = z.enum(["SUBMITTED", "AUTHORIZED", "PAID"]); +const CreditNoteLineItem = z.object({ + item: z.string().uuid().nullish(), + name: z.string().nullish(), + description: z.string().nullish(), + quantity: z + .string() + .regex(/^-?\d{0,24}(?:\.\d{0,8})?$/) + .nullish(), + memo: z.string().nullish(), + unit_price: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullish(), + tax_rate: z.string().uuid().nullish(), + total_line_amount: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullish(), + tracking_category: z.string().uuid().nullish(), + tracking_categories: z.array(z.string()), + account: z.string().uuid().nullish(), + company: z.string().uuid().nullish(), + remote_id: z.string().nullish(), +}); +const CreditNote = z + .object({ + id: z.string().uuid(), + remote_id: z.string().nullable(), + transaction_date: z.string().datetime().nullable(), + status: CreditNoteStatusEnum.nullable(), + number: z.string().nullable(), + contact: z.string().uuid().nullable(), + company: z.string().uuid().nullable(), + total_amount: z.number().nullable(), + remaining_credit: z.number().nullable(), + line_items: z.array(CreditNoteLineItem), + currency: CurrencyEnum.nullable(), + remote_created_at: z.string().datetime().nullable(), + remote_updated_at: z.string().datetime().nullable(), + payments: z.array(z.string()), + remote_was_deleted: z.boolean(), + field_mappings: z.object({}).partial().passthrough().nullable(), + remote_data: z.array(RemoteData).nullable(), + }) + .partial(); +const PaginatedCreditNoteList = z + .object({ + next: z.string().nullable(), + previous: z.string().nullable(), + results: z.array(CreditNote), + }) + .partial(); +const ExpenseLine = z + .object({ + remote_id: z.string().nullable(), + item: z.string().uuid().nullable(), + net_amount: z.number().nullable(), + tracking_category: z.string().uuid().nullable(), + tracking_categories: z.array(z.string()), + company: z.string().uuid().nullable(), + account: z.string().uuid().nullable(), + contact: z.string().uuid().nullable(), + description: z.string().nullable(), + }) + .partial(); +const Expense = z + .object({ + transaction_date: z.string().datetime().nullable(), + remote_created_at: z.string().datetime().nullable(), + account: z.string().uuid().nullable(), + contact: z.string().uuid().nullable(), + total_amount: z.number().nullable(), + currency: CurrencyEnum.nullable(), + exchange_rate: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullable(), + company: z.string().uuid().nullable(), + memo: z.string().nullable(), + lines: z.array(ExpenseLine), + remote_was_deleted: z.boolean(), + id: z.string().uuid(), + remote_id: z.string().nullable(), + field_mappings: z.object({}).partial().passthrough().nullable(), + remote_data: z.array(RemoteData).nullable(), + }) + .partial(); +const PaginatedExpenseList = z + .object({ + next: z.string().nullable(), + previous: z.string().nullable(), + results: z.array(Expense), + }) + .partial(); +const ExpenseLineRequest = z + .object({ + remote_id: z.string().nullable(), + item: z.string().uuid().nullable(), + net_amount: z.number().nullable(), + tracking_category: z.string().uuid().nullable(), + tracking_categories: z.array(z.string()), + company: z.string().uuid().nullable(), + account: z.string().uuid().nullable(), + contact: z.string().uuid().nullable(), + description: z.string().nullable(), + integration_params: z.object({}).partial().passthrough().nullable(), + linked_account_params: z.object({}).partial().passthrough().nullable(), + }) + .partial(); +const ExpenseRequest = z + .object({ + transaction_date: z.string().datetime().nullable(), + account: z.string().uuid().nullable(), + contact: z.string().uuid().nullable(), + total_amount: z.number().nullable(), + currency: CurrencyEnum.nullable(), + exchange_rate: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullable(), + company: z.string().uuid().nullable(), + memo: z.string().nullable(), + lines: z.array(ExpenseLineRequest), + integration_params: z.object({}).partial().passthrough().nullable(), + linked_account_params: z.object({}).partial().passthrough().nullable(), + }) + .partial(); +const ExpenseEndpointRequest = z.object({ model: ExpenseRequest }); +const ExpenseResponse = z.object({ + model: Expense, + warnings: z.array(WarningValidationProblem), + errors: z.array(ErrorValidationProblem), + logs: z.array(DebugModeLog).optional(), +}); +const GenerateRemoteKeyRequest = z.object({ name: z.string().min(1) }); +const RemoteKey = z.object({ name: z.string(), key: z.string() }); +const IncomeStatement = z + .object({ + id: z.string().uuid(), + remote_id: z.string().nullable(), + name: z.string().nullable(), + currency: CurrencyEnum.nullable(), + company: z.string().uuid().nullable(), + start_period: z.string().datetime().nullable(), + end_period: z.string().datetime().nullable(), + income: z.array(ReportItem), + cost_of_sales: z.array(ReportItem), + gross_profit: z.number().nullable(), + operating_expenses: z.array(ReportItem), + net_operating_income: z.number().nullable(), + non_operating_expenses: z.array(ReportItem), + net_income: z.number().nullable(), + remote_was_deleted: z.boolean(), + field_mappings: z.object({}).partial().passthrough().nullable(), + remote_data: z.array(RemoteData).nullable(), + }) + .partial(); +const PaginatedIncomeStatementList = z + .object({ + next: z.string().nullable(), + previous: z.string().nullable(), + results: z.array(IncomeStatement), + }) + .partial(); +const InvoiceTypeEnum = z.enum(["ACCOUNTS_RECEIVABLE", "ACCOUNTS_PAYABLE"]); +const InvoiceLineItem = z + .object({ + remote_id: z.string().nullable(), + description: z.string().nullable(), + unit_price: z.number().nullable(), + quantity: z.number().nullable(), + total_amount: z.number().nullable(), + currency: CurrencyEnum.nullable(), + exchange_rate: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullable(), + item: z.string().uuid().nullable(), + account: z.string().uuid().nullable(), + tracking_category: z.string().uuid().nullable(), + tracking_categories: z.array(z.string()), + company: z.string().uuid().nullable(), + id: z.string().uuid(), + field_mappings: z.object({}).partial().passthrough().nullable(), + }) + .partial(); +const Invoice = z + .object({ + type: InvoiceTypeEnum.nullable(), + contact: z.string().uuid().nullable(), + number: z.string().nullable(), + issue_date: z.string().datetime().nullable(), + due_date: z.string().datetime().nullable(), + paid_on_date: z.string().datetime().nullable(), + memo: z.string().nullable(), + company: z.string().uuid().nullable(), + currency: CurrencyEnum.nullable(), + exchange_rate: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullable(), + total_discount: z.number().nullable(), + sub_total: z.number().nullable(), + total_tax_amount: z.number().nullable(), + total_amount: z.number().nullable(), + balance: z.number().nullable(), + remote_updated_at: z.string().datetime().nullable(), + payments: z.array(z.string()), + line_items: z.array(InvoiceLineItem), + remote_was_deleted: z.boolean(), + id: z.string().uuid(), + remote_id: z.string().nullable(), + field_mappings: z.object({}).partial().passthrough().nullable(), + remote_data: z.array(RemoteData).nullable(), + }) + .partial(); +const PaginatedInvoiceList = z + .object({ + next: z.string().nullable(), + previous: z.string().nullable(), + results: z.array(Invoice), + }) + .partial(); +const InvoiceLineItemRequest = z + .object({ + remote_id: z.string().nullable(), + description: z.string().nullable(), + unit_price: z.number().nullable(), + quantity: z.number().nullable(), + total_amount: z.number().nullable(), + currency: CurrencyEnum.nullable(), + exchange_rate: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullable(), + item: z.string().uuid().nullable(), + account: z.string().uuid().nullable(), + tracking_category: z.string().uuid().nullable(), + tracking_categories: z.array(z.string()), + company: z.string().uuid().nullable(), + integration_params: z.object({}).partial().passthrough().nullable(), + linked_account_params: z.object({}).partial().passthrough().nullable(), + }) + .partial(); +const InvoiceRequest = z + .object({ + type: InvoiceTypeEnum.nullable(), + contact: z.string().uuid().nullable(), + number: z.string().nullable(), + issue_date: z.string().datetime().nullable(), + due_date: z.string().datetime().nullable(), + paid_on_date: z.string().datetime().nullable(), + memo: z.string().nullable(), + company: z.string().uuid().nullable(), + currency: CurrencyEnum.nullable(), + exchange_rate: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullable(), + total_discount: z.number().nullable(), + sub_total: z.number().nullable(), + total_tax_amount: z.number().nullable(), + total_amount: z.number().nullable(), + balance: z.number().nullable(), + payments: z.array(z.string()), + line_items: z.array(InvoiceLineItemRequest), + integration_params: z.object({}).partial().passthrough().nullable(), + linked_account_params: z.object({}).partial().passthrough().nullable(), + }) + .partial(); +const InvoiceEndpointRequest = z.object({ model: InvoiceRequest }); +const InvoiceResponse = z.object({ + model: Invoice, + warnings: z.array(WarningValidationProblem), + errors: z.array(ErrorValidationProblem), + logs: z.array(DebugModeLog).optional(), +}); +const IssueStatusEnum = z.enum(["ONGOING", "RESOLVED"]); +const Issue = z.object({ + id: z.string().uuid().optional(), + status: IssueStatusEnum.optional(), + error_description: z.string(), + end_user: z.object({}).partial().passthrough().optional(), + first_incident_time: z.string().datetime().nullish(), + last_incident_time: z.string().datetime().nullish(), + is_muted: z.boolean().optional(), + error_details: z.array(z.string()).optional(), +}); +const PaginatedIssueList = z + .object({ + next: z.string().nullable(), + previous: z.string().nullable(), + results: z.array(Issue), + }) + .partial(); +const Item = z + .object({ + id: z.string().uuid(), + remote_id: z.string().nullable(), + name: z.string().nullable(), + status: Status7d1Enum.nullable(), + unit_price: z.number().nullable(), + purchase_price: z.number().nullable(), + purchase_account: z.string().uuid().nullable(), + sales_account: z.string().uuid().nullable(), + company: z.string().uuid().nullable(), + remote_updated_at: z.string().datetime().nullable(), + remote_was_deleted: z.boolean(), + field_mappings: z.object({}).partial().passthrough().nullable(), + remote_data: z.array(RemoteData).nullable(), + }) + .partial(); +const PaginatedItemList = z + .object({ + next: z.string().nullable(), + previous: z.string().nullable(), + results: z.array(Item), + }) + .partial(); +const JournalLine = z + .object({ + remote_id: z.string().nullable(), + account: z.string().uuid().nullable(), + net_amount: z.number().nullable(), + tracking_category: z.string().uuid().nullable(), + tracking_categories: z.array(z.string()), + contact: z.string().uuid().nullable(), + description: z.string().nullable(), + }) + .partial(); +const PostingStatusEnum = z.enum(["UNPOSTED", "POSTED"]); +const JournalEntry = z + .object({ + transaction_date: z.string().datetime().nullable(), + remote_created_at: z.string().datetime().nullable(), + remote_updated_at: z.string().datetime().nullable(), + payments: z.array(z.string()), + memo: z.string().nullable(), + currency: CurrencyEnum.nullable(), + exchange_rate: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullable(), + company: z.string().uuid().nullable(), + lines: z.array(JournalLine), + remote_was_deleted: z.boolean(), + posting_status: PostingStatusEnum.nullable(), + id: z.string().uuid(), + remote_id: z.string().nullable(), + field_mappings: z.object({}).partial().passthrough().nullable(), + remote_data: z.array(RemoteData).nullable(), + }) + .partial(); +const PaginatedJournalEntryList = z + .object({ + next: z.string().nullable(), + previous: z.string().nullable(), + results: z.array(JournalEntry), + }) + .partial(); +const JournalLineRequest = z + .object({ + remote_id: z.string().nullable(), + account: z.string().uuid().nullable(), + net_amount: z.number().nullable(), + tracking_category: z.string().uuid().nullable(), + tracking_categories: z.array(z.string()), + contact: z.string().uuid().nullable(), + description: z.string().nullable(), + integration_params: z.object({}).partial().passthrough().nullable(), + linked_account_params: z.object({}).partial().passthrough().nullable(), + }) + .partial(); +const JournalEntryRequest = z + .object({ + transaction_date: z.string().datetime().nullable(), + payments: z.array(z.string()), + memo: z.string().nullable(), + currency: CurrencyEnum.nullable(), + exchange_rate: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullable(), + company: z.string().uuid().nullable(), + lines: z.array(JournalLineRequest), + posting_status: PostingStatusEnum.nullable(), + integration_params: z.object({}).partial().passthrough().nullable(), + linked_account_params: z.object({}).partial().passthrough().nullable(), + }) + .partial(); +const JournalEntryEndpointRequest = z.object({ model: JournalEntryRequest }); +const JournalEntryResponse = z.object({ + model: JournalEntry, + warnings: z.array(WarningValidationProblem), + errors: z.array(ErrorValidationProblem), + logs: z.array(DebugModeLog).optional(), +}); +const CommonModelScopesBodyRequest = z.object({ + model_id: z.string().min(1), + enabled_actions: z.array(EnabledActionsEnum), + disabled_fields: z.array(z.string()), +}); +const EndUserDetailsRequest = z.object({ + end_user_email_address: z.string().min(1).max(100), + end_user_organization_name: z.string().min(1).max(100), + end_user_origin_id: z.string().min(1).max(100), + categories: z.array(CategoriesEnum), + integration: z.string().min(1).nullish(), + link_expiry_mins: z.number().int().gte(30).lte(10080).optional().default(30), + should_create_magic_link_url: z.boolean().nullish(), + common_models: z.array(CommonModelScopesBodyRequest).nullish(), +}); +const LinkToken = z.object({ + link_token: z.string(), + integration_name: z.string().optional(), + magic_link_url: z.string().optional(), +}); +const AccountDetailsAndActionsStatusEnum = z.enum([ + "COMPLETE", + "INCOMPLETE", + "RELINK_NEEDED", +]); +const AccountDetailsAndActionsIntegration = z.object({ + name: z.string(), + categories: z.array(CategoriesEnum), + image: z.string().optional(), + square_image: z.string().optional(), + color: z.string(), + slug: z.string(), + passthrough_available: z.boolean(), + available_model_operations: z.array(ModelOperation).optional(), +}); +const AccountDetailsAndActions = z.object({ + id: z.string(), + category: CategoryEnum.optional(), + status: AccountDetailsAndActionsStatusEnum, + status_detail: z.string().optional(), + end_user_origin_id: z.string().optional(), + end_user_organization_name: z.string(), + end_user_email_address: z.string(), + webhook_listener_url: z.string(), + is_duplicate: z.boolean().nullish(), + integration: AccountDetailsAndActionsIntegration.optional(), +}); +const PaginatedAccountDetailsAndActionsList = z + .object({ + next: z.string().nullable(), + previous: z.string().nullable(), + results: z.array(AccountDetailsAndActions), + }) + .partial(); +const MethodEnum = z.enum([ + "GET", + "OPTIONS", + "HEAD", + "POST", + "PUT", + "PATCH", + "DELETE", +]); +const EncodingEnum = z.enum(["RAW", "BASE64", "GZIP_BASE64"]); +const MultipartFormFieldRequest = z.object({ + name: z.string().min(1), + data: z.string().min(1), + encoding: EncodingEnum.nullish().default("RAW"), + file_name: z.string().min(1).nullish(), + content_type: z.string().min(1).nullish(), +}); +const RequestFormatEnum = z.enum(["JSON", "XML", "MULTIPART"]); +const DataPassthroughRequest = z.object({ + method: MethodEnum, + path: z.string().min(1), + base_url_override: z.string().min(1).nullish(), + data: z.string().min(1).nullish(), + multipart_form_data: z.array(MultipartFormFieldRequest).nullish(), + headers: z.object({}).partial().passthrough().nullish(), + request_format: RequestFormatEnum.nullish(), + normalize_response: z.boolean().optional(), +}); +const ResponseTypeEnum = z.enum(["JSON", "BASE64_GZIP"]); +const RemoteResponse = z.object({ + method: z.string(), + path: z.string(), + status: z.number().int(), + response: z.unknown(), + response_headers: z.object({}).partial().passthrough().optional(), + response_type: ResponseTypeEnum.optional(), + headers: z.object({}).partial().passthrough().optional(), +}); +const Payment = z + .object({ + id: z.string().uuid(), + remote_id: z.string().nullable(), + transaction_date: z.string().datetime().nullable(), + contact: z.string().uuid().nullable(), + account: z.string().uuid().nullable(), + currency: CurrencyEnum.nullable(), + exchange_rate: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullable(), + company: z.string().uuid().nullable(), + total_amount: z.number().nullable(), + remote_updated_at: z.string().datetime().nullable(), + remote_was_deleted: z.boolean(), + field_mappings: z.object({}).partial().passthrough().nullable(), + remote_data: z.array(RemoteData).nullable(), + }) + .partial(); +const PaginatedPaymentList = z + .object({ + next: z.string().nullable(), + previous: z.string().nullable(), + results: z.array(Payment), + }) + .partial(); +const PaymentRequest = z + .object({ + transaction_date: z.string().datetime().nullable(), + contact: z.string().uuid().nullable(), + account: z.string().uuid().nullable(), + currency: CurrencyEnum.nullable(), + exchange_rate: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullable(), + company: z.string().uuid().nullable(), + total_amount: z.number().nullable(), + integration_params: z.object({}).partial().passthrough().nullable(), + linked_account_params: z.object({}).partial().passthrough().nullable(), + }) + .partial(); +const PaymentEndpointRequest = z.object({ model: PaymentRequest }); +const PaymentResponse = z.object({ + model: Payment, + warnings: z.array(WarningValidationProblem), + errors: z.array(ErrorValidationProblem), + logs: z.array(DebugModeLog).optional(), +}); +const PurchaseOrderStatusEnum = z.enum([ + "DRAFT", + "SUBMITTED", + "AUTHORIZED", + "BILLED", + "DELETED", +]); +const PurchaseOrderLineItem = z.object({ + remote_id: z.string().nullish(), + description: z.string().nullish(), + unit_price: z.number().nullish(), + quantity: z.number().nullish(), + item: z.string().uuid().nullish(), + account: z.string().uuid().nullish(), + tracking_category: z.string().uuid().nullish(), + tracking_categories: z.array(z.string()), + tax_amount: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullish(), + total_line_amount: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullish(), + currency: CurrencyEnum.nullish(), + exchange_rate: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullish(), + company: z.string().uuid().nullish(), +}); +const PurchaseOrder = z + .object({ + status: PurchaseOrderStatusEnum.nullable(), + issue_date: z.string().datetime().nullable(), + delivery_date: z.string().datetime().nullable(), + delivery_address: z.string().uuid().nullable(), + customer: z.string().uuid().nullable(), + vendor: z.string().uuid().nullable(), + memo: z.string().nullable(), + company: z.string().uuid().nullable(), + total_amount: z.number().nullable(), + currency: CurrencyEnum.nullable(), + exchange_rate: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullable(), + line_items: z.array(PurchaseOrderLineItem), + remote_created_at: z.string().datetime().nullable(), + remote_updated_at: z.string().datetime().nullable(), + remote_was_deleted: z.boolean(), + id: z.string().uuid(), + remote_id: z.string().nullable(), + field_mappings: z.object({}).partial().passthrough().nullable(), + remote_data: z.array(RemoteData).nullable(), + }) + .partial(); +const PaginatedPurchaseOrderList = z + .object({ + next: z.string().nullable(), + previous: z.string().nullable(), + results: z.array(PurchaseOrder), + }) + .partial(); +const PurchaseOrderLineItemRequest = z.object({ + remote_id: z.string().nullish(), + description: z.string().nullish(), + unit_price: z.number().nullish(), + quantity: z.number().nullish(), + item: z.string().uuid().nullish(), + account: z.string().uuid().nullish(), + tracking_category: z.string().uuid().nullish(), + tracking_categories: z.array(z.string()), + tax_amount: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullish(), + total_line_amount: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullish(), + currency: CurrencyEnum.nullish(), + exchange_rate: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullish(), + company: z.string().uuid().nullish(), + integration_params: z.object({}).partial().passthrough().nullish(), + linked_account_params: z.object({}).partial().passthrough().nullish(), +}); +const PurchaseOrderRequest = z + .object({ + status: PurchaseOrderStatusEnum.nullable(), + issue_date: z.string().datetime().nullable(), + delivery_date: z.string().datetime().nullable(), + delivery_address: z.string().uuid().nullable(), + customer: z.string().uuid().nullable(), + vendor: z.string().uuid().nullable(), + memo: z.string().nullable(), + company: z.string().uuid().nullable(), + total_amount: z.number().nullable(), + currency: CurrencyEnum.nullable(), + exchange_rate: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullable(), + line_items: z.array(PurchaseOrderLineItemRequest), + integration_params: z.object({}).partial().passthrough().nullable(), + linked_account_params: z.object({}).partial().passthrough().nullable(), + }) + .partial(); +const PurchaseOrderEndpointRequest = z.object({ model: PurchaseOrderRequest }); +const PurchaseOrderResponse = z.object({ + model: PurchaseOrder, + warnings: z.array(WarningValidationProblem), + errors: z.array(ErrorValidationProblem), + logs: z.array(DebugModeLog).optional(), +}); +const RemoteKeyForRegenerationRequest = z.object({ name: z.string().min(1) }); +const LinkedAccountCondition = z.object({ + condition_schema_id: z.string().uuid(), + common_model: z.string().optional(), + native_name: z.string().nullable(), + operator: z.string(), + value: z.unknown().optional(), + field_name: z.string().nullable(), +}); +const LinkedAccountSelectiveSyncConfiguration = z + .object({ linked_account_conditions: z.array(LinkedAccountCondition) }) + .partial(); +const LinkedAccountConditionRequest = z.object({ + condition_schema_id: z.string().uuid(), + operator: z.string().min(1), + value: z.unknown(), +}); +const LinkedAccountSelectiveSyncConfigurationRequest = z.object({ + linked_account_conditions: z.array(LinkedAccountConditionRequest), +}); +const LinkedAccountSelectiveSyncConfigurationListRequest = z.object({ + sync_configurations: z.array(LinkedAccountSelectiveSyncConfigurationRequest), +}); +const ConditionTypeEnum = z.enum([ + "BOOLEAN", + "DATE", + "DATE_TIME", + "INTEGER", + "FLOAT", + "STRING", + "LIST_OF_STRINGS", +]); +const OperatorSchema = z + .object({ operator: z.string(), is_unique: z.boolean() }) + .partial(); +const ConditionSchema = z.object({ + id: z.string().uuid(), + common_model: z.string().optional(), + native_name: z.string().nullable(), + field_name: z.string().nullable(), + is_unique: z.boolean().optional(), + condition_type: ConditionTypeEnum, + operators: z.array(OperatorSchema), +}); +const PaginatedConditionSchemaList = z + .object({ + next: z.string().nullable(), + previous: z.string().nullable(), + results: z.array(ConditionSchema), + }) + .partial(); +const SyncStatusStatusEnum = z.enum([ + "SYNCING", + "DONE", + "FAILED", + "DISABLED", + "PAUSED", +]); +const SelectiveSyncConfigurationsUsageEnum = z.enum([ + "IN_NEXT_SYNC", + "IN_LAST_SYNC", +]); +const SyncStatus = z.object({ + model_name: z.string(), + model_id: z.string(), + last_sync_start: z.string().datetime().optional(), + next_sync_start: z.string().datetime().optional(), + status: SyncStatusStatusEnum, + is_initial_sync: z.boolean(), + selective_sync_configurations_usage: + SelectiveSyncConfigurationsUsageEnum.optional(), +}); +const PaginatedSyncStatusList = z + .object({ + next: z.string().nullable(), + previous: z.string().nullable(), + results: z.array(SyncStatus), + }) + .partial(); +const TaxRate = z + .object({ + description: z.string().nullable(), + total_tax_rate: z.number().nullable(), + effective_tax_rate: z.number().nullable(), + company: z.string().uuid().nullable(), + remote_was_deleted: z.boolean(), + id: z.string().uuid(), + remote_id: z.string().nullable(), + field_mappings: z.object({}).partial().passthrough().nullable(), + remote_data: z.array(RemoteData).nullable(), + }) + .partial(); +const PaginatedTaxRateList = z + .object({ + next: z.string().nullable(), + previous: z.string().nullable(), + results: z.array(TaxRate), + }) + .partial(); +const CategoryTypeEnum = z.enum(["CLASS", "DEPARTMENT"]); +const TrackingCategory = z + .object({ + name: z.string().nullable(), + status: Status7d1Enum.nullable(), + category_type: CategoryTypeEnum.nullable(), + parent_category: z.string().uuid().nullable(), + company: z.string().uuid().nullable(), + remote_was_deleted: z.boolean(), + id: z.string().uuid(), + remote_id: z.string().nullable(), + field_mappings: z.object({}).partial().passthrough().nullable(), + remote_data: z.array(RemoteData).nullable(), + }) + .partial(); +const PaginatedTrackingCategoryList = z + .object({ + next: z.string().nullable(), + previous: z.string().nullable(), + results: z.array(TrackingCategory), + }) + .partial(); +const TransactionLineItem = z.object({ + remote_id: z.string().nullish(), + memo: z.string().nullish(), + unit_price: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullish(), + quantity: z + .string() + .regex(/^-?\d{0,24}(?:\.\d{0,8})?$/) + .nullish(), + item: z.string().uuid().nullish(), + account: z.string().uuid().nullish(), + tracking_category: z.string().uuid().nullish(), + tracking_categories: z.array(z.string()), + total_line_amount: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullish(), + tax_rate: z.string().uuid().nullish(), + currency: CurrencyEnum.nullish(), + exchange_rate: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullish(), + company: z.string().uuid().nullish(), +}); +const Transaction = z + .object({ + transaction_type: z.string().nullable(), + number: z.string().nullable(), + transaction_date: z.string().datetime().nullable(), + account: z.string().uuid().nullable(), + contact: z.string().uuid().nullable(), + total_amount: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullable(), + currency: CurrencyEnum.nullable(), + exchange_rate: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullable(), + company: z.string().uuid().nullable(), + line_items: z.array(TransactionLineItem), + remote_was_deleted: z.boolean(), + id: z.string().uuid(), + remote_id: z.string().nullable(), + field_mappings: z.object({}).partial().passthrough().nullable(), + remote_data: z.array(RemoteData).nullable(), + }) + .partial(); +const PaginatedTransactionList = z + .object({ + next: z.string().nullable(), + previous: z.string().nullable(), + results: z.array(Transaction), + }) + .partial(); +const VendorCreditLine = z.object({ + remote_id: z.string().nullish(), + net_amount: z.number().nullish(), + tracking_category: z.string().uuid().nullish(), + tracking_categories: z.array(z.string()), + description: z.string().nullish(), + account: z.string().uuid().nullish(), + company: z.string().uuid().nullish(), +}); +const VendorCredit = z + .object({ + id: z.string().uuid(), + remote_id: z.string().nullable(), + number: z.string().nullable(), + transaction_date: z.string().datetime().nullable(), + vendor: z.string().uuid().nullable(), + total_amount: z.number().nullable(), + currency: CurrencyEnum.nullable(), + exchange_rate: z + .string() + .regex(/^-?\d{0,32}(?:\.\d{0,16})?$/) + .nullable(), + company: z.string().uuid().nullable(), + lines: z.array(VendorCreditLine), + remote_was_deleted: z.boolean(), + field_mappings: z.object({}).partial().passthrough().nullable(), + remote_data: z.array(RemoteData).nullable(), + }) + .partial(); +const PaginatedVendorCreditList = z + .object({ + next: z.string().nullable(), + previous: z.string().nullable(), + results: z.array(VendorCredit), + }) + .partial(); +const WebhookReceiver = z.object({ + event: z.string(), + is_active: z.boolean(), + key: z.string().optional(), +}); +const WebhookReceiverRequest = z.object({ + event: z.string().min(1), + is_active: z.boolean(), + key: z.string().min(1).optional(), +}); + +export const schemas = { + CategoryEnum, + AccountDetails, + CategoriesEnum, + AccountIntegration, + AccountToken, + ClassificationEnum, + AccountStatusEnum, + CurrencyEnum, + RemoteData, + Account, + PaginatedAccountList, + AccountRequest, + AccountEndpointRequest, + ValidationProblemSource, + WarningValidationProblem, + ErrorValidationProblem, + DebugModelLogSummary, + DebugModeLog, + AccountResponse, + LinkedAccountStatus, + MetaResponse, + AddressTypeEnum, + CountryEnum, + Address, + AccountingAttachment, + PaginatedAccountingAttachmentList, + AccountingAttachmentRequest, + AccountingAttachmentEndpointRequest, + AccountingAttachmentResponse, + ModelOperation, + AvailableActions, + ReportItem, + BalanceSheet, + PaginatedBalanceSheetList, + CashFlowStatement, + PaginatedCashFlowStatementList, + CommonModelScopesDisabledModelsEnabledActionsEnum, + CommonModelScopesDisabledModels, + CommonModelScopeData, + CommonModelScopes, + EnabledActionsEnum, + CommonModelScopesPostInnerDeserializerRequest, + CommonModelScopesUpdateSerializer, + AccountingPhoneNumber, + CompanyInfo, + PaginatedCompanyInfoList, + Status7d1Enum, + Contact, + PaginatedContactList, + AccountingPhoneNumberRequest, + ContactRequest, + ContactEndpointRequest, + ContactResponse, + CreditNoteStatusEnum, + CreditNoteLineItem, + CreditNote, + PaginatedCreditNoteList, + ExpenseLine, + Expense, + PaginatedExpenseList, + ExpenseLineRequest, + ExpenseRequest, + ExpenseEndpointRequest, + ExpenseResponse, + GenerateRemoteKeyRequest, + RemoteKey, + IncomeStatement, + PaginatedIncomeStatementList, + InvoiceTypeEnum, + InvoiceLineItem, + Invoice, + PaginatedInvoiceList, + InvoiceLineItemRequest, + InvoiceRequest, + InvoiceEndpointRequest, + InvoiceResponse, + IssueStatusEnum, + Issue, + PaginatedIssueList, + Item, + PaginatedItemList, + JournalLine, + PostingStatusEnum, + JournalEntry, + PaginatedJournalEntryList, + JournalLineRequest, + JournalEntryRequest, + JournalEntryEndpointRequest, + JournalEntryResponse, + CommonModelScopesBodyRequest, + EndUserDetailsRequest, + LinkToken, + AccountDetailsAndActionsStatusEnum, + AccountDetailsAndActionsIntegration, + AccountDetailsAndActions, + PaginatedAccountDetailsAndActionsList, + MethodEnum, + EncodingEnum, + MultipartFormFieldRequest, + RequestFormatEnum, + DataPassthroughRequest, + ResponseTypeEnum, + RemoteResponse, + Payment, + PaginatedPaymentList, + PaymentRequest, + PaymentEndpointRequest, + PaymentResponse, + PurchaseOrderStatusEnum, + PurchaseOrderLineItem, + PurchaseOrder, + PaginatedPurchaseOrderList, + PurchaseOrderLineItemRequest, + PurchaseOrderRequest, + PurchaseOrderEndpointRequest, + PurchaseOrderResponse, + RemoteKeyForRegenerationRequest, + LinkedAccountCondition, + LinkedAccountSelectiveSyncConfiguration, + LinkedAccountConditionRequest, + LinkedAccountSelectiveSyncConfigurationRequest, + LinkedAccountSelectiveSyncConfigurationListRequest, + ConditionTypeEnum, + OperatorSchema, + ConditionSchema, + PaginatedConditionSchemaList, + SyncStatusStatusEnum, + SelectiveSyncConfigurationsUsageEnum, + SyncStatus, + PaginatedSyncStatusList, + TaxRate, + PaginatedTaxRateList, + CategoryTypeEnum, + TrackingCategory, + PaginatedTrackingCategoryList, + TransactionLineItem, + Transaction, + PaginatedTransactionList, + VendorCreditLine, + VendorCredit, + PaginatedVendorCreditList, + WebhookReceiver, + WebhookReceiverRequest, +}; + +const endpoints = makeApi([ + { + method: "get", + path: "/account-details", + description: `Get details for a linked account.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + ], + response: AccountDetails, + }, + { + method: "get", + path: "/account-token/:public_token", + description: `Returns the account token for the end user with the provided public token.`, + requestFormat: "json", + parameters: [ + { + name: "public_token", + type: "Path", + schema: z.string(), + }, + ], + response: AccountToken, + }, + { + method: "get", + path: "/accounts", + description: `Returns a list of `Account` objects.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "company_id", + type: "Query", + schema: z.string().optional(), + }, + { + name: "created_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "created_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "cursor", + type: "Query", + schema: z.string().optional(), + }, + { + name: "expand", + type: "Query", + schema: z.literal("company").optional(), + }, + { + name: "include_deleted_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "modified_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "modified_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "page_size", + type: "Query", + schema: z.number().int().optional(), + }, + { + name: "remote_fields", + type: "Query", + schema: z + .enum(["classification", "classification,status", "status"]) + .optional(), + }, + { + name: "remote_id", + type: "Query", + schema: z.string().nullish(), + }, + { + name: "show_enum_origins", + type: "Query", + schema: z + .enum(["classification", "classification,status", "status"]) + .optional(), + }, + ], + response: PaginatedAccountList, + }, + { + method: "post", + path: "/accounts", + description: `Creates an `Account` object with the given values.`, + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: AccountEndpointRequest, + }, + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "is_debug_mode", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "run_async", + type: "Query", + schema: z.boolean().optional(), + }, + ], + response: AccountResponse, + }, + { + method: "get", + path: "/accounts/:id", + description: `Returns an `Account` object with the given `id`.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "expand", + type: "Query", + schema: z.literal("company").optional(), + }, + { + name: "id", + type: "Path", + schema: z.string().uuid(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "remote_fields", + type: "Query", + schema: z + .enum(["classification", "classification,status", "status"]) + .optional(), + }, + { + name: "show_enum_origins", + type: "Query", + schema: z + .enum(["classification", "classification,status", "status"]) + .optional(), + }, + ], + response: Account, + }, + { + method: "get", + path: "/accounts/meta/post", + description: `Returns metadata for `Account` POSTs.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + ], + response: MetaResponse, + }, + { + method: "get", + path: "/addresses/:id", + description: `Returns an `Address` object with the given `id`.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "id", + type: "Path", + schema: z.string().uuid(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "remote_fields", + type: "Query", + schema: z.literal("type").optional(), + }, + { + name: "show_enum_origins", + type: "Query", + schema: z.literal("type").optional(), + }, + ], + response: Address, + }, + { + method: "get", + path: "/attachments", + description: `Returns a list of `AccountingAttachment` objects.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "company_id", + type: "Query", + schema: z.string().optional(), + }, + { + name: "created_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "created_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "cursor", + type: "Query", + schema: z.string().optional(), + }, + { + name: "include_deleted_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "modified_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "modified_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "page_size", + type: "Query", + schema: z.number().int().optional(), + }, + { + name: "remote_id", + type: "Query", + schema: z.string().nullish(), + }, + ], + response: PaginatedAccountingAttachmentList, + }, + { + method: "post", + path: "/attachments", + description: `Creates an `AccountingAttachment` object with the given values.`, + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: AccountingAttachmentEndpointRequest, + }, + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "is_debug_mode", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "run_async", + type: "Query", + schema: z.boolean().optional(), + }, + ], + response: AccountingAttachmentResponse, + }, + { + method: "get", + path: "/attachments/:id", + description: `Returns an `AccountingAttachment` object with the given `id`.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "id", + type: "Path", + schema: z.string().uuid(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + ], + response: AccountingAttachment, + }, + { + method: "get", + path: "/attachments/meta/post", + description: `Returns metadata for `AccountingAttachment` POSTs.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + ], + response: MetaResponse, + }, + { + method: "get", + path: "/available-actions", + description: `Returns a list of models and actions available for an account.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + ], + response: AvailableActions, + }, + { + method: "get", + path: "/balance-sheets", + description: `Returns a list of `BalanceSheet` objects.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "company_id", + type: "Query", + schema: z.string().optional(), + }, + { + name: "created_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "created_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "cursor", + type: "Query", + schema: z.string().optional(), + }, + { + name: "expand", + type: "Query", + schema: z.literal("company").optional(), + }, + { + name: "include_deleted_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "modified_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "modified_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "page_size", + type: "Query", + schema: z.number().int().optional(), + }, + { + name: "remote_id", + type: "Query", + schema: z.string().nullish(), + }, + ], + response: PaginatedBalanceSheetList, + }, + { + method: "get", + path: "/balance-sheets/:id", + description: `Returns a `BalanceSheet` object with the given `id`.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "expand", + type: "Query", + schema: z.literal("company").optional(), + }, + { + name: "id", + type: "Path", + schema: z.string().uuid(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + ], + response: BalanceSheet, + }, + { + method: "get", + path: "/cash-flow-statements", + description: `Returns a list of `CashFlowStatement` objects.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "company_id", + type: "Query", + schema: z.string().optional(), + }, + { + name: "created_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "created_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "cursor", + type: "Query", + schema: z.string().optional(), + }, + { + name: "expand", + type: "Query", + schema: z.literal("company").optional(), + }, + { + name: "include_deleted_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "modified_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "modified_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "page_size", + type: "Query", + schema: z.number().int().optional(), + }, + { + name: "remote_id", + type: "Query", + schema: z.string().nullish(), + }, + ], + response: PaginatedCashFlowStatementList, + }, + { + method: "get", + path: "/cash-flow-statements/:id", + description: `Returns a `CashFlowStatement` object with the given `id`.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "expand", + type: "Query", + schema: z.literal("company").optional(), + }, + { + name: "id", + type: "Path", + schema: z.string().uuid(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + ], + response: CashFlowStatement, + }, + { + method: "get", + path: "/common-model-scopes", + description: `Fetch the configuration of what data is saved by Merge when syncing. Common model scopes are set as a default across all linked accounts, but can be updated to have greater granularity per account.`, + requestFormat: "json", + parameters: [ + { + name: "linked_account_id", + type: "Query", + schema: z.string().optional(), + }, + ], + response: CommonModelScopes, + }, + { + method: "post", + path: "/common-model-scopes", + description: `Update the configuration of what data is saved by Merge when syncing. Common model scopes are set as a default across all linked accounts, but can be updated to have greater granularity per account.`, + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: CommonModelScopesUpdateSerializer, + }, + { + name: "linked_account_id", + type: "Query", + schema: z.string().optional(), + }, + ], + response: CommonModelScopes, + }, + { + method: "get", + path: "/company-info", + description: `Returns a list of `CompanyInfo` objects.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "created_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "created_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "cursor", + type: "Query", + schema: z.string().optional(), + }, + { + name: "expand", + type: "Query", + schema: z + .enum(["addresses", "addresses,phone_numbers", "phone_numbers"]) + .optional(), + }, + { + name: "include_deleted_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "modified_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "modified_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "page_size", + type: "Query", + schema: z.number().int().optional(), + }, + { + name: "remote_id", + type: "Query", + schema: z.string().nullish(), + }, + ], + response: PaginatedCompanyInfoList, + }, + { + method: "get", + path: "/company-info/:id", + description: `Returns a `CompanyInfo` object with the given `id`.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "expand", + type: "Query", + schema: z + .enum(["addresses", "addresses,phone_numbers", "phone_numbers"]) + .optional(), + }, + { + name: "id", + type: "Path", + schema: z.string().uuid(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + ], + response: CompanyInfo, + }, + { + method: "get", + path: "/contacts", + description: `Returns a list of `Contact` objects.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "company_id", + type: "Query", + schema: z.string().optional(), + }, + { + name: "created_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "created_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "cursor", + type: "Query", + schema: z.string().optional(), + }, + { + name: "expand", + type: "Query", + schema: z + .enum([ + "addresses", + "addresses,company", + "addresses,phone_numbers", + "addresses,phone_numbers,company", + "company", + "phone_numbers", + "phone_numbers,company", + ]) + .optional(), + }, + { + name: "include_deleted_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "modified_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "modified_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "page_size", + type: "Query", + schema: z.number().int().optional(), + }, + { + name: "remote_fields", + type: "Query", + schema: z.literal("status").optional(), + }, + { + name: "remote_id", + type: "Query", + schema: z.string().nullish(), + }, + { + name: "show_enum_origins", + type: "Query", + schema: z.literal("status").optional(), + }, + ], + response: PaginatedContactList, + }, + { + method: "post", + path: "/contacts", + description: `Creates a `Contact` object with the given values.`, + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: ContactEndpointRequest, + }, + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "is_debug_mode", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "run_async", + type: "Query", + schema: z.boolean().optional(), + }, + ], + response: ContactResponse, + }, + { + method: "get", + path: "/contacts/:id", + description: `Returns a `Contact` object with the given `id`.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "expand", + type: "Query", + schema: z + .enum([ + "addresses", + "addresses,company", + "addresses,phone_numbers", + "addresses,phone_numbers,company", + "company", + "phone_numbers", + "phone_numbers,company", + ]) + .optional(), + }, + { + name: "id", + type: "Path", + schema: z.string().uuid(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "remote_fields", + type: "Query", + schema: z.literal("status").optional(), + }, + { + name: "show_enum_origins", + type: "Query", + schema: z.literal("status").optional(), + }, + ], + response: Contact, + }, + { + method: "get", + path: "/contacts/meta/post", + description: `Returns metadata for `Contact` POSTs.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + ], + response: MetaResponse, + }, + { + method: "get", + path: "/credit-notes", + description: `Returns a list of `CreditNote` objects.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "company_id", + type: "Query", + schema: z.string().optional(), + }, + { + name: "created_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "created_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "cursor", + type: "Query", + schema: z.string().optional(), + }, + { + name: "expand", + type: "Query", + schema: z + .enum(["line_items", "payments", "payments,line_items"]) + .optional(), + }, + { + name: "include_deleted_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "modified_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "modified_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "page_size", + type: "Query", + schema: z.number().int().optional(), + }, + { + name: "remote_fields", + type: "Query", + schema: z.enum(["status", "status,type", "type"]).optional(), + }, + { + name: "remote_id", + type: "Query", + schema: z.string().nullish(), + }, + { + name: "show_enum_origins", + type: "Query", + schema: z.enum(["status", "status,type", "type"]).optional(), + }, + { + name: "transaction_date_after", + type: "Query", + schema: z.string().datetime().nullish(), + }, + { + name: "transaction_date_before", + type: "Query", + schema: z.string().datetime().nullish(), + }, + ], + response: PaginatedCreditNoteList, + }, + { + method: "get", + path: "/credit-notes/:id", + description: `Returns a `CreditNote` object with the given `id`.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "expand", + type: "Query", + schema: z + .enum(["line_items", "payments", "payments,line_items"]) + .optional(), + }, + { + name: "id", + type: "Path", + schema: z.string().uuid(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "remote_fields", + type: "Query", + schema: z.enum(["status", "status,type", "type"]).optional(), + }, + { + name: "show_enum_origins", + type: "Query", + schema: z.enum(["status", "status,type", "type"]).optional(), + }, + ], + response: CreditNote, + }, + { + method: "post", + path: "/delete-account", + description: `Delete a linked account.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + ], + response: z.void(), + }, + { + method: "get", + path: "/expenses", + description: `Returns a list of `Expense` objects.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "company_id", + type: "Query", + schema: z.string().optional(), + }, + { + name: "created_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "created_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "cursor", + type: "Query", + schema: z.string().optional(), + }, + { + name: "expand", + type: "Query", + schema: z + .enum([ + "account", + "account,company", + "account,contact", + "account,contact,company", + "company", + "contact", + "contact,company", + ]) + .optional(), + }, + { + name: "include_deleted_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "modified_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "modified_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "page_size", + type: "Query", + schema: z.number().int().optional(), + }, + { + name: "remote_id", + type: "Query", + schema: z.string().nullish(), + }, + { + name: "transaction_date_after", + type: "Query", + schema: z.string().datetime().nullish(), + }, + { + name: "transaction_date_before", + type: "Query", + schema: z.string().datetime().nullish(), + }, + ], + response: PaginatedExpenseList, + }, + { + method: "post", + path: "/expenses", + description: `Creates an `Expense` object with the given values.`, + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: ExpenseEndpointRequest, + }, + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "is_debug_mode", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "run_async", + type: "Query", + schema: z.boolean().optional(), + }, + ], + response: ExpenseResponse, + }, + { + method: "get", + path: "/expenses/:id", + description: `Returns an `Expense` object with the given `id`.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "expand", + type: "Query", + schema: z + .enum([ + "account", + "account,company", + "account,contact", + "account,contact,company", + "company", + "contact", + "contact,company", + ]) + .optional(), + }, + { + name: "id", + type: "Path", + schema: z.string().uuid(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + ], + response: Expense, + }, + { + method: "get", + path: "/expenses/meta/post", + description: `Returns metadata for `Expense` POSTs.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + ], + response: MetaResponse, + }, + { + method: "post", + path: "/generate-key", + description: `Create a remote key.`, + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ name: z.string().min(1) }), + }, + ], + response: RemoteKey, + }, + { + method: "get", + path: "/income-statements", + description: `Returns a list of `IncomeStatement` objects.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "company_id", + type: "Query", + schema: z.string().optional(), + }, + { + name: "created_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "created_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "cursor", + type: "Query", + schema: z.string().optional(), + }, + { + name: "expand", + type: "Query", + schema: z.literal("company").optional(), + }, + { + name: "include_deleted_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "modified_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "modified_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "page_size", + type: "Query", + schema: z.number().int().optional(), + }, + { + name: "remote_id", + type: "Query", + schema: z.string().nullish(), + }, + ], + response: PaginatedIncomeStatementList, + }, + { + method: "get", + path: "/income-statements/:id", + description: `Returns an `IncomeStatement` object with the given `id`.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "expand", + type: "Query", + schema: z.literal("company").optional(), + }, + { + name: "id", + type: "Path", + schema: z.string().uuid(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + ], + response: IncomeStatement, + }, + { + method: "get", + path: "/invoices", + description: `Returns a list of `Invoice` objects.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "company_id", + type: "Query", + schema: z.string().optional(), + }, + { + name: "contact_id", + type: "Query", + schema: z.string().optional(), + }, + { + name: "created_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "created_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "cursor", + type: "Query", + schema: z.string().optional(), + }, + { + name: "expand", + type: "Query", + schema: z + .enum([ + "company", + "contact", + "contact,company", + "line_items", + "line_items,company", + "line_items,contact", + "line_items,contact,company", + "payments", + "payments,company", + "payments,contact", + "payments,contact,company", + "payments,line_items", + "payments,line_items,company", + "payments,line_items,contact", + "payments,line_items,contact,company", + ]) + .optional(), + }, + { + name: "include_deleted_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "issue_date_after", + type: "Query", + schema: z.string().datetime().nullish(), + }, + { + name: "issue_date_before", + type: "Query", + schema: z.string().datetime().nullish(), + }, + { + name: "modified_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "modified_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "page_size", + type: "Query", + schema: z.number().int().optional(), + }, + { + name: "remote_fields", + type: "Query", + schema: z.literal("type").optional(), + }, + { + name: "remote_id", + type: "Query", + schema: z.string().nullish(), + }, + { + name: "show_enum_origins", + type: "Query", + schema: z.literal("type").optional(), + }, + { + name: "type", + type: "Query", + schema: z.enum(["ACCOUNTS_PAYABLE", "ACCOUNTS_RECEIVABLE"]).nullish(), + }, + ], + response: PaginatedInvoiceList, + }, + { + method: "post", + path: "/invoices", + description: `Creates an `Invoice` object with the given values.`, + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: InvoiceEndpointRequest, + }, + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "is_debug_mode", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "run_async", + type: "Query", + schema: z.boolean().optional(), + }, + ], + response: InvoiceResponse, + }, + { + method: "get", + path: "/invoices/:id", + description: `Returns an `Invoice` object with the given `id`.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "expand", + type: "Query", + schema: z + .enum([ + "company", + "contact", + "contact,company", + "line_items", + "line_items,company", + "line_items,contact", + "line_items,contact,company", + "payments", + "payments,company", + "payments,contact", + "payments,contact,company", + "payments,line_items", + "payments,line_items,company", + "payments,line_items,contact", + "payments,line_items,contact,company", + ]) + .optional(), + }, + { + name: "id", + type: "Path", + schema: z.string().uuid(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "remote_fields", + type: "Query", + schema: z.literal("type").optional(), + }, + { + name: "show_enum_origins", + type: "Query", + schema: z.literal("type").optional(), + }, + ], + response: Invoice, + }, + { + method: "get", + path: "/invoices/meta/post", + description: `Returns metadata for `Invoice` POSTs.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + ], + response: MetaResponse, + }, + { + method: "get", + path: "/issues", + description: `Gets issues.`, + requestFormat: "json", + parameters: [ + { + name: "account_token", + type: "Query", + schema: z.string().optional(), + }, + { + name: "cursor", + type: "Query", + schema: z.string().optional(), + }, + { + name: "end_date", + type: "Query", + schema: z.string().optional(), + }, + { + name: "end_user_organization_name", + type: "Query", + schema: z.string().optional(), + }, + { + name: "first_incident_time_after", + type: "Query", + schema: z.string().datetime().nullish(), + }, + { + name: "first_incident_time_before", + type: "Query", + schema: z.string().datetime().nullish(), + }, + { + name: "include_muted", + type: "Query", + schema: z.string().optional(), + }, + { + name: "integration_name", + type: "Query", + schema: z.string().optional(), + }, + { + name: "last_incident_time_after", + type: "Query", + schema: z.string().datetime().nullish(), + }, + { + name: "last_incident_time_before", + type: "Query", + schema: z.string().datetime().nullish(), + }, + { + name: "page_size", + type: "Query", + schema: z.number().int().optional(), + }, + { + name: "start_date", + type: "Query", + schema: z.string().optional(), + }, + { + name: "status", + type: "Query", + schema: z.enum(["ONGOING", "RESOLVED"]).optional(), + }, + ], + response: PaginatedIssueList, + }, + { + method: "get", + path: "/issues/:id", + description: `Get a specific issue.`, + requestFormat: "json", + parameters: [ + { + name: "id", + type: "Path", + schema: z.string().uuid(), + }, + ], + response: Issue, + }, + { + method: "get", + path: "/items", + description: `Returns a list of `Item` objects.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "company_id", + type: "Query", + schema: z.string().optional(), + }, + { + name: "created_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "created_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "cursor", + type: "Query", + schema: z.string().optional(), + }, + { + name: "expand", + type: "Query", + schema: z + .enum([ + "company", + "purchase_account", + "purchase_account,company", + "purchase_account,sales_account", + "purchase_account,sales_account,company", + "sales_account", + "sales_account,company", + ]) + .optional(), + }, + { + name: "include_deleted_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "modified_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "modified_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "page_size", + type: "Query", + schema: z.number().int().optional(), + }, + { + name: "remote_fields", + type: "Query", + schema: z.literal("status").optional(), + }, + { + name: "remote_id", + type: "Query", + schema: z.string().nullish(), + }, + { + name: "show_enum_origins", + type: "Query", + schema: z.literal("status").optional(), + }, + ], + response: PaginatedItemList, + }, + { + method: "get", + path: "/items/:id", + description: `Returns an `Item` object with the given `id`.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "expand", + type: "Query", + schema: z + .enum([ + "company", + "purchase_account", + "purchase_account,company", + "purchase_account,sales_account", + "purchase_account,sales_account,company", + "sales_account", + "sales_account,company", + ]) + .optional(), + }, + { + name: "id", + type: "Path", + schema: z.string().uuid(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "remote_fields", + type: "Query", + schema: z.literal("status").optional(), + }, + { + name: "show_enum_origins", + type: "Query", + schema: z.literal("status").optional(), + }, + ], + response: Item, + }, + { + method: "get", + path: "/journal-entries", + description: `Returns a list of `JournalEntry` objects.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "company_id", + type: "Query", + schema: z.string().optional(), + }, + { + name: "created_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "created_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "cursor", + type: "Query", + schema: z.string().optional(), + }, + { + name: "expand", + type: "Query", + schema: z + .enum([ + "company", + "lines", + "lines,company", + "lines,payments", + "lines,payments,company", + "payments", + "payments,company", + ]) + .optional(), + }, + { + name: "include_deleted_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "modified_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "modified_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "page_size", + type: "Query", + schema: z.number().int().optional(), + }, + { + name: "remote_id", + type: "Query", + schema: z.string().nullish(), + }, + { + name: "transaction_date_after", + type: "Query", + schema: z.string().datetime().nullish(), + }, + { + name: "transaction_date_before", + type: "Query", + schema: z.string().datetime().nullish(), + }, + ], + response: PaginatedJournalEntryList, + }, + { + method: "post", + path: "/journal-entries", + description: `Creates a `JournalEntry` object with the given values.`, + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: JournalEntryEndpointRequest, + }, + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "is_debug_mode", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "run_async", + type: "Query", + schema: z.boolean().optional(), + }, + ], + response: JournalEntryResponse, + }, + { + method: "get", + path: "/journal-entries/:id", + description: `Returns a `JournalEntry` object with the given `id`.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "expand", + type: "Query", + schema: z + .enum([ + "company", + "lines", + "lines,company", + "lines,payments", + "lines,payments,company", + "payments", + "payments,company", + ]) + .optional(), + }, + { + name: "id", + type: "Path", + schema: z.string().uuid(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + ], + response: JournalEntry, + }, + { + method: "get", + path: "/journal-entries/meta/post", + description: `Returns metadata for `JournalEntry` POSTs.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + ], + response: MetaResponse, + }, + { + method: "post", + path: "/link-token", + description: `Creates a link token to be used when linking a new end user.`, + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: EndUserDetailsRequest, + }, + ], + response: LinkToken, + }, + { + method: "get", + path: "/linked-accounts", + description: `List linked accounts for your organization.`, + requestFormat: "json", + parameters: [ + { + name: "category", + type: "Query", + schema: z + .enum([ + "accounting", + "ats", + "crm", + "filestorage", + "hris", + "mktg", + "ticketing", + ]) + .nullish(), + }, + { + name: "cursor", + type: "Query", + schema: z.string().optional(), + }, + { + name: "end_user_email_address", + type: "Query", + schema: z.string().optional(), + }, + { + name: "end_user_organization_name", + type: "Query", + schema: z.string().optional(), + }, + { + name: "end_user_origin_id", + type: "Query", + schema: z.string().optional(), + }, + { + name: "end_user_origin_ids", + type: "Query", + schema: z.string().optional(), + }, + { + name: "id", + type: "Query", + schema: z.string().uuid().optional(), + }, + { + name: "ids", + type: "Query", + schema: z.string().optional(), + }, + { + name: "include_duplicates", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "integration_name", + type: "Query", + schema: z.string().optional(), + }, + { + name: "is_test_account", + type: "Query", + schema: z.string().optional(), + }, + { + name: "page_size", + type: "Query", + schema: z.number().int().optional(), + }, + { + name: "status", + type: "Query", + schema: z.string().optional(), + }, + ], + response: PaginatedAccountDetailsAndActionsList, + }, + { + method: "post", + path: "/passthrough", + description: `Pull data from an endpoint not currently supported by Merge.`, + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: DataPassthroughRequest, + }, + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + ], + response: RemoteResponse, + }, + { + method: "get", + path: "/payments", + description: `Returns a list of `Payment` objects.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "account_id", + type: "Query", + schema: z.string().optional(), + }, + { + name: "company_id", + type: "Query", + schema: z.string().optional(), + }, + { + name: "contact_id", + type: "Query", + schema: z.string().optional(), + }, + { + name: "created_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "created_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "cursor", + type: "Query", + schema: z.string().optional(), + }, + { + name: "expand", + type: "Query", + schema: z + .enum([ + "account", + "account,company", + "company", + "contact", + "contact,account", + "contact,account,company", + "contact,company", + ]) + .optional(), + }, + { + name: "include_deleted_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "modified_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "modified_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "page_size", + type: "Query", + schema: z.number().int().optional(), + }, + { + name: "remote_id", + type: "Query", + schema: z.string().nullish(), + }, + { + name: "transaction_date_after", + type: "Query", + schema: z.string().datetime().nullish(), + }, + { + name: "transaction_date_before", + type: "Query", + schema: z.string().datetime().nullish(), + }, + ], + response: PaginatedPaymentList, + }, + { + method: "post", + path: "/payments", + description: `Creates a `Payment` object with the given values.`, + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: PaymentEndpointRequest, + }, + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "is_debug_mode", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "run_async", + type: "Query", + schema: z.boolean().optional(), + }, + ], + response: PaymentResponse, + }, + { + method: "get", + path: "/payments/:id", + description: `Returns a `Payment` object with the given `id`.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "expand", + type: "Query", + schema: z + .enum([ + "account", + "account,company", + "company", + "contact", + "contact,account", + "contact,account,company", + "contact,company", + ]) + .optional(), + }, + { + name: "id", + type: "Path", + schema: z.string().uuid(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + ], + response: Payment, + }, + { + method: "get", + path: "/payments/meta/post", + description: `Returns metadata for `Payment` POSTs.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + ], + response: MetaResponse, + }, + { + method: "get", + path: "/phone-numbers/:id", + description: `Returns an `AccountingPhoneNumber` object with the given `id`.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "id", + type: "Path", + schema: z.string().uuid(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + ], + response: AccountingPhoneNumber, + }, + { + method: "get", + path: "/purchase-orders", + description: `Returns a list of `PurchaseOrder` objects.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "company_id", + type: "Query", + schema: z.string().optional(), + }, + { + name: "created_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "created_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "cursor", + type: "Query", + schema: z.string().optional(), + }, + { + name: "expand", + type: "Query", + schema: z + .enum([ + "company", + "delivery_address", + "delivery_address,company", + "delivery_address,vendor", + "delivery_address,vendor,company", + "line_items", + "line_items,company", + "line_items,delivery_address", + "line_items,delivery_address,company", + "line_items,delivery_address,vendor", + "line_items,delivery_address,vendor,company", + "line_items,vendor", + "line_items,vendor,company", + "vendor", + "vendor,company", + ]) + .optional(), + }, + { + name: "include_deleted_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "issue_date_after", + type: "Query", + schema: z.string().datetime().nullish(), + }, + { + name: "issue_date_before", + type: "Query", + schema: z.string().datetime().nullish(), + }, + { + name: "modified_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "modified_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "page_size", + type: "Query", + schema: z.number().int().optional(), + }, + { + name: "remote_fields", + type: "Query", + schema: z.literal("status").optional(), + }, + { + name: "remote_id", + type: "Query", + schema: z.string().nullish(), + }, + { + name: "show_enum_origins", + type: "Query", + schema: z.literal("status").optional(), + }, + ], + response: PaginatedPurchaseOrderList, + }, + { + method: "post", + path: "/purchase-orders", + description: `Creates a `PurchaseOrder` object with the given values.`, + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: PurchaseOrderEndpointRequest, + }, + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "is_debug_mode", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "run_async", + type: "Query", + schema: z.boolean().optional(), + }, + ], + response: PurchaseOrderResponse, + }, + { + method: "get", + path: "/purchase-orders/:id", + description: `Returns a `PurchaseOrder` object with the given `id`.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "expand", + type: "Query", + schema: z + .enum([ + "company", + "delivery_address", + "delivery_address,company", + "delivery_address,vendor", + "delivery_address,vendor,company", + "line_items", + "line_items,company", + "line_items,delivery_address", + "line_items,delivery_address,company", + "line_items,delivery_address,vendor", + "line_items,delivery_address,vendor,company", + "line_items,vendor", + "line_items,vendor,company", + "vendor", + "vendor,company", + ]) + .optional(), + }, + { + name: "id", + type: "Path", + schema: z.string().uuid(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "remote_fields", + type: "Query", + schema: z.literal("status").optional(), + }, + { + name: "show_enum_origins", + type: "Query", + schema: z.literal("status").optional(), + }, + ], + response: PurchaseOrder, + }, + { + method: "get", + path: "/purchase-orders/meta/post", + description: `Returns metadata for `PurchaseOrder` POSTs.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + ], + response: MetaResponse, + }, + { + method: "post", + path: "/regenerate-key", + description: `Exchange remote keys.`, + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ name: z.string().min(1) }), + }, + ], + response: RemoteKey, + }, + { + method: "get", + path: "/selective-sync/configurations", + description: `Get a linked account's selective syncs.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + ], + response: z.array(LinkedAccountSelectiveSyncConfiguration), + }, + { + method: "put", + path: "/selective-sync/configurations", + description: `Replace a linked account's selective syncs.`, + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: LinkedAccountSelectiveSyncConfigurationListRequest, + }, + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + ], + response: z.array(LinkedAccountSelectiveSyncConfiguration), + }, + { + method: "get", + path: "/selective-sync/meta", + description: `Get metadata for the conditions available to a linked account.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "common_model", + type: "Query", + schema: z.string().optional(), + }, + { + name: "cursor", + type: "Query", + schema: z.string().optional(), + }, + { + name: "page_size", + type: "Query", + schema: z.number().int().optional(), + }, + ], + response: PaginatedConditionSchemaList, + }, + { + method: "get", + path: "/sync-status", + description: `Get syncing status. Possible values: `DISABLED`, `DONE`, `FAILED`, `PAUSED`, `SYNCING``, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "cursor", + type: "Query", + schema: z.string().optional(), + }, + { + name: "page_size", + type: "Query", + schema: z.number().int().optional(), + }, + ], + response: PaginatedSyncStatusList, + }, + { + method: "post", + path: "/sync-status/resync", + description: `Force re-sync of all models. This is available for all organizations via the dashboard. Force re-sync is also available for monthly and quarterly sync frequency customers on the Core, Professional, or Enterprise plans.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + ], + response: z.array(SyncStatus), + }, + { + method: "get", + path: "/tax-rates", + description: `Returns a list of `TaxRate` objects.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "company_id", + type: "Query", + schema: z.string().optional(), + }, + { + name: "created_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "created_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "cursor", + type: "Query", + schema: z.string().optional(), + }, + { + name: "expand", + type: "Query", + schema: z.literal("company").optional(), + }, + { + name: "include_deleted_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "modified_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "modified_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "page_size", + type: "Query", + schema: z.number().int().optional(), + }, + { + name: "remote_id", + type: "Query", + schema: z.string().nullish(), + }, + ], + response: PaginatedTaxRateList, + }, + { + method: "get", + path: "/tax-rates/:id", + description: `Returns a `TaxRate` object with the given `id`.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "expand", + type: "Query", + schema: z.literal("company").optional(), + }, + { + name: "id", + type: "Path", + schema: z.string().uuid(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + ], + response: TaxRate, + }, + { + method: "get", + path: "/tracking-categories", + description: `Returns a list of `TrackingCategory` objects.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "company_id", + type: "Query", + schema: z.string().optional(), + }, + { + name: "created_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "created_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "cursor", + type: "Query", + schema: z.string().optional(), + }, + { + name: "expand", + type: "Query", + schema: z.literal("company").optional(), + }, + { + name: "include_deleted_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "modified_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "modified_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "page_size", + type: "Query", + schema: z.number().int().optional(), + }, + { + name: "remote_fields", + type: "Query", + schema: z.literal("status").optional(), + }, + { + name: "remote_id", + type: "Query", + schema: z.string().nullish(), + }, + { + name: "show_enum_origins", + type: "Query", + schema: z.literal("status").optional(), + }, + ], + response: PaginatedTrackingCategoryList, + }, + { + method: "get", + path: "/tracking-categories/:id", + description: `Returns a `TrackingCategory` object with the given `id`.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "expand", + type: "Query", + schema: z.literal("company").optional(), + }, + { + name: "id", + type: "Path", + schema: z.string().uuid(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "remote_fields", + type: "Query", + schema: z.literal("status").optional(), + }, + { + name: "show_enum_origins", + type: "Query", + schema: z.literal("status").optional(), + }, + ], + response: TrackingCategory, + }, + { + method: "get", + path: "/transactions", + description: `Returns a list of `Transaction` objects.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "company_id", + type: "Query", + schema: z.string().optional(), + }, + { + name: "created_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "created_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "cursor", + type: "Query", + schema: z.string().optional(), + }, + { + name: "expand", + type: "Query", + schema: z + .enum([ + "account", + "contact", + "contact,account", + "line_items", + "line_items,account", + "line_items,contact", + "line_items,contact,account", + ]) + .optional(), + }, + { + name: "include_deleted_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "modified_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "modified_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "page_size", + type: "Query", + schema: z.number().int().optional(), + }, + { + name: "remote_id", + type: "Query", + schema: z.string().nullish(), + }, + { + name: "transaction_date_after", + type: "Query", + schema: z.string().datetime().nullish(), + }, + { + name: "transaction_date_before", + type: "Query", + schema: z.string().datetime().nullish(), + }, + ], + response: PaginatedTransactionList, + }, + { + method: "get", + path: "/transactions/:id", + description: `Returns a `Transaction` object with the given `id`.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "expand", + type: "Query", + schema: z + .enum([ + "account", + "contact", + "contact,account", + "line_items", + "line_items,account", + "line_items,contact", + "line_items,contact,account", + ]) + .optional(), + }, + { + name: "id", + type: "Path", + schema: z.string().uuid(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + ], + response: Transaction, + }, + { + method: "get", + path: "/vendor-credits", + description: `Returns a list of `VendorCredit` objects.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "company_id", + type: "Query", + schema: z.string().optional(), + }, + { + name: "created_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "created_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "cursor", + type: "Query", + schema: z.string().optional(), + }, + { + name: "expand", + type: "Query", + schema: z + .enum([ + "company", + "lines", + "lines,company", + "lines,vendor", + "lines,vendor,company", + "vendor", + "vendor,company", + ]) + .optional(), + }, + { + name: "include_deleted_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + { + name: "modified_after", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "modified_before", + type: "Query", + schema: z.string().datetime().optional(), + }, + { + name: "page_size", + type: "Query", + schema: z.number().int().optional(), + }, + { + name: "remote_id", + type: "Query", + schema: z.string().nullish(), + }, + { + name: "transaction_date_after", + type: "Query", + schema: z.string().datetime().nullish(), + }, + { + name: "transaction_date_before", + type: "Query", + schema: z.string().datetime().nullish(), + }, + ], + response: PaginatedVendorCreditList, + }, + { + method: "get", + path: "/vendor-credits/:id", + description: `Returns a `VendorCredit` object with the given `id`.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + { + name: "expand", + type: "Query", + schema: z + .enum([ + "company", + "lines", + "lines,company", + "lines,vendor", + "lines,vendor,company", + "vendor", + "vendor,company", + ]) + .optional(), + }, + { + name: "id", + type: "Path", + schema: z.string().uuid(), + }, + { + name: "include_remote_data", + type: "Query", + schema: z.boolean().optional(), + }, + ], + response: VendorCredit, + }, + { + method: "get", + path: "/webhook-receivers", + description: `Returns a list of `WebhookReceiver` objects.`, + requestFormat: "json", + parameters: [ + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + ], + response: z.array(WebhookReceiver), + }, + { + method: "post", + path: "/webhook-receivers", + description: `Creates a `WebhookReceiver` object with the given values.`, + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: WebhookReceiverRequest, + }, + { + name: "X-Account-Token", + type: "Header", + schema: z.string(), + }, + ], + response: WebhookReceiver, + }, +]); + +export const api = new ZodiosCore(endpoints); + +api.get("/accounts/:id", { + params: { id: "123" }, + headers: { "X-Account-Token": "abc" }, +}); diff --git a/packages/core/examples/zod-types.ts b/packages/core/examples/zod-types.ts index 40b58cc7..4969efe1 100644 --- a/packages/core/examples/zod-types.ts +++ b/packages/core/examples/zod-types.ts @@ -1,4 +1,4 @@ -import { ZodiosCore, makeApi } from "../src/index"; +import { ZodiosCore, ZodiosErrorByAlias, makeApi } from "../src/index"; import { z } from "zod"; // you can define schema before declaring the API to get back the type @@ -42,10 +42,26 @@ const jsonplaceholderApi = makeApi([ method: "get", path: "/users/:id", description: "Get a user", + alias: "getUser", response: userSchema, + errors: [ + { + status: "default", + schema: z.object({ error: z.string(), message: z.string() }), + }, + { + status: 400, + schema: z.object({ + error: z.string(), + message: z.literal("Bad Request"), + }), + }, + ], }, ]); +type Error400 = ZodiosErrorByAlias; + // and then use them in your API async function bootstrap() { const apiClient = new ZodiosCore(jsonplaceholderUrl, jsonplaceholderApi); diff --git a/packages/core/src/zodios.types.ts b/packages/core/src/zodios.types.ts index e43283b1..c0b15c89 100644 --- a/packages/core/src/zodios.types.ts +++ b/packages/core/src/zodios.types.ts @@ -180,7 +180,7 @@ export type ZodiosErrorByPath< Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], M extends Method, Path extends ZodiosPathsByMethod, - Status extends number, + Status extends number | "default", Frontend extends boolean = true, TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider > = Frontend extends true @@ -320,7 +320,7 @@ export type ZodiosMatchingErrorsByAlias< export type ZodiosErrorByAlias< Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], Alias extends string, - Status extends number, + Status extends number | "default", Frontend extends boolean = true, TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider > = Frontend extends true From 9ca19e150a2af871aef805357ad67224fa97b153 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sat, 8 Apr 2023 14:00:15 +0200 Subject: [PATCH 127/206] docs(changeset): migrate to typescript v11 --- .changeset/few-icons-march.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .changeset/few-icons-march.md diff --git a/.changeset/few-icons-march.md b/.changeset/few-icons-march.md new file mode 100644 index 00000000..7d0dbe2c --- /dev/null +++ b/.changeset/few-icons-march.md @@ -0,0 +1,10 @@ +--- +"@zodios/express": major +"@zodios/testing": major +"@zodios/axios": major +"@zodios/fetch": major +"@zodios/react": major +"@zodios/core": major +--- + +migrate to typescript v11 From 4b15b5e2cf5b637966e1d59d4ddf0e5c45f2a0a4 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sat, 8 Apr 2023 14:00:25 +0200 Subject: [PATCH 128/206] RELEASING: Releasing 6 package(s) Releases: @zodios/express@11.0.0-beta.18 @zodios/testing@11.0.0-beta.18 @zodios/axios@11.0.0-beta.18 @zodios/fetch@11.0.0-beta.18 @zodios/react@11.0.0-beta.18 @zodios/core@11.0.0-beta.18 [skip ci] --- packages/axios/CHANGELOG.md | 11 +++++++++++ packages/axios/package.json | 4 ++-- packages/core/CHANGELOG.md | 6 ++++++ packages/core/package.json | 2 +- packages/express/CHANGELOG.md | 12 ++++++++++++ packages/express/package.json | 4 ++-- packages/fetch/CHANGELOG.md | 11 +++++++++++ packages/fetch/package.json | 4 ++-- packages/react/CHANGELOG.md | 13 +++++++++++++ packages/react/package.json | 8 ++++---- packages/testing/CHANGELOG.md | 11 +++++++++++ packages/testing/package.json | 4 ++-- 12 files changed, 77 insertions(+), 13 deletions(-) create mode 100644 packages/express/CHANGELOG.md diff --git a/packages/axios/CHANGELOG.md b/packages/axios/CHANGELOG.md index 647206c3..49613dd8 100644 --- a/packages/axios/CHANGELOG.md +++ b/packages/axios/CHANGELOG.md @@ -1,5 +1,16 @@ # @zodios/core +## 11.0.0-beta.18 + +### Major Changes + +- 58016f5: migrate to typescript v11 + +### Patch Changes + +- Updated dependencies [58016f5] + - @zodios/core@11.0.0-beta.18 + ## 11.0.0-beta.17 ### Major Changes diff --git a/packages/axios/package.json b/packages/axios/package.json index 179e51cb..d66882d7 100644 --- a/packages/axios/package.json +++ b/packages/axios/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/axios", "description": "Typescript API client with axios", - "version": "11.0.0-beta.17", + "version": "11.0.0-beta.18", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", @@ -41,7 +41,7 @@ "test": "jest --coverage" }, "peerDependencies": { - "@zodios/core": "11.0.0-beta.17", + "@zodios/core": "11.0.0-beta.18", "axios": "^0.x || ^1.0.0", "fp-ts": "2.x", "io-ts": "2.x", diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index 22fdb8a0..f1355e20 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,11 @@ # @zodios/core +## 11.0.0-beta.18 + +### Major Changes + +- 58016f5: migrate to typescript v11 + ## 11.0.0-beta.17 ### Major Changes diff --git a/packages/core/package.json b/packages/core/package.json index 00f8d0b1..bd1fe48b 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/core", "description": "Typescript API client with autocompletion and zod validations", - "version": "11.0.0-beta.17", + "version": "11.0.0-beta.18", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", diff --git a/packages/express/CHANGELOG.md b/packages/express/CHANGELOG.md new file mode 100644 index 00000000..4012f0de --- /dev/null +++ b/packages/express/CHANGELOG.md @@ -0,0 +1,12 @@ +# @zodios/express + +## 11.0.0-beta.18 + +### Major Changes + +- 58016f5: migrate to typescript v11 + +### Patch Changes + +- Updated dependencies [58016f5] + - @zodios/core@11.0.0-beta.18 diff --git a/packages/express/package.json b/packages/express/package.json index 47b578f6..f7fd8841 100644 --- a/packages/express/package.json +++ b/packages/express/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/express", "description": "Typescript express server", - "version": "11.0.0-beta.17", + "version": "11.0.0-beta.18", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", @@ -38,7 +38,7 @@ "test": "jest --coverage" }, "peerDependencies": { - "@zodios/core": "11.0.0-beta.17", + "@zodios/core": "11.0.0-beta.18", "express": "4.x", "zod": "^3.x" }, diff --git a/packages/fetch/CHANGELOG.md b/packages/fetch/CHANGELOG.md index 647206c3..49613dd8 100644 --- a/packages/fetch/CHANGELOG.md +++ b/packages/fetch/CHANGELOG.md @@ -1,5 +1,16 @@ # @zodios/core +## 11.0.0-beta.18 + +### Major Changes + +- 58016f5: migrate to typescript v11 + +### Patch Changes + +- Updated dependencies [58016f5] + - @zodios/core@11.0.0-beta.18 + ## 11.0.0-beta.17 ### Major Changes diff --git a/packages/fetch/package.json b/packages/fetch/package.json index 0c53db08..5e27e1de 100644 --- a/packages/fetch/package.json +++ b/packages/fetch/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/fetch", "description": "Typescript API client with fetch", - "version": "11.0.0-beta.17", + "version": "11.0.0-beta.18", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", @@ -39,7 +39,7 @@ "test": "NODE_OPTIONS=--experimental-abortcontroller jest --coverage" }, "peerDependencies": { - "@zodios/core": "11.0.0-beta.17", + "@zodios/core": "11.0.0-beta.18", "fp-ts": "2.x", "io-ts": "2.x", "zod": "^3.x" diff --git a/packages/react/CHANGELOG.md b/packages/react/CHANGELOG.md index 481ca1a3..664b6fc3 100644 --- a/packages/react/CHANGELOG.md +++ b/packages/react/CHANGELOG.md @@ -1,5 +1,18 @@ # @zodios/react +## 11.0.0-beta.18 + +### Major Changes + +- 58016f5: migrate to typescript v11 + +### Patch Changes + +- Updated dependencies [58016f5] + - @zodios/axios@11.0.0-beta.18 + - @zodios/fetch@11.0.0-beta.18 + - @zodios/core@11.0.0-beta.18 + ## 11.0.0-beta.17 ### Major Changes diff --git a/packages/react/package.json b/packages/react/package.json index cf67af6c..b74aaeb8 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/react", "description": "React hooks for zodios", - "version": "11.0.0-beta.17", + "version": "11.0.0-beta.18", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", @@ -40,9 +40,9 @@ }, "peerDependencies": { "@tanstack/react-query": "4.x", - "@zodios/axios": "11.0.0-beta.17", - "@zodios/core": "11.0.0-beta.17", - "@zodios/fetch": "11.0.0-beta.17", + "@zodios/axios": "11.0.0-beta.18", + "@zodios/core": "11.0.0-beta.18", + "@zodios/fetch": "11.0.0-beta.18", "react": ">=16.8.0" }, "peerDependenciesMeta": { diff --git a/packages/testing/CHANGELOG.md b/packages/testing/CHANGELOG.md index e17b9fb9..dcfed6d9 100644 --- a/packages/testing/CHANGELOG.md +++ b/packages/testing/CHANGELOG.md @@ -1,5 +1,16 @@ # @zodios/core +## 11.0.0-beta.18 + +### Major Changes + +- 58016f5: migrate to typescript v11 + +### Patch Changes + +- Updated dependencies [58016f5] + - @zodios/core@11.0.0-beta.18 + ## 11.0.0-beta.17 ### Major Changes diff --git a/packages/testing/package.json b/packages/testing/package.json index c5e0fc05..f64fe292 100644 --- a/packages/testing/package.json +++ b/packages/testing/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/testing", "description": "Zodios mock library", - "version": "11.0.0-beta.17", + "version": "11.0.0-beta.18", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", @@ -37,7 +37,7 @@ "test": "jest --coverage" }, "peerDependencies": { - "@zodios/core": "11.0.0-beta.17" + "@zodios/core": "11.0.0-beta.18" }, "devDependencies": { "@jest/globals": "29.5.0", From c4b5fdfe99448f352fc511e26097102a5914528d Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sat, 8 Apr 2023 21:30:26 +0200 Subject: [PATCH 129/206] chore: update large api --- packages/core/examples/large-api.ts | 157 ++-------------------------- 1 file changed, 7 insertions(+), 150 deletions(-) diff --git a/packages/core/examples/large-api.ts b/packages/core/examples/large-api.ts index 567bb31c..3375ac6b 100644 --- a/packages/core/examples/large-api.ts +++ b/packages/core/examples/large-api.ts @@ -1826,152 +1826,6 @@ const WebhookReceiverRequest = z.object({ key: z.string().min(1).optional(), }); -export const schemas = { - CategoryEnum, - AccountDetails, - CategoriesEnum, - AccountIntegration, - AccountToken, - ClassificationEnum, - AccountStatusEnum, - CurrencyEnum, - RemoteData, - Account, - PaginatedAccountList, - AccountRequest, - AccountEndpointRequest, - ValidationProblemSource, - WarningValidationProblem, - ErrorValidationProblem, - DebugModelLogSummary, - DebugModeLog, - AccountResponse, - LinkedAccountStatus, - MetaResponse, - AddressTypeEnum, - CountryEnum, - Address, - AccountingAttachment, - PaginatedAccountingAttachmentList, - AccountingAttachmentRequest, - AccountingAttachmentEndpointRequest, - AccountingAttachmentResponse, - ModelOperation, - AvailableActions, - ReportItem, - BalanceSheet, - PaginatedBalanceSheetList, - CashFlowStatement, - PaginatedCashFlowStatementList, - CommonModelScopesDisabledModelsEnabledActionsEnum, - CommonModelScopesDisabledModels, - CommonModelScopeData, - CommonModelScopes, - EnabledActionsEnum, - CommonModelScopesPostInnerDeserializerRequest, - CommonModelScopesUpdateSerializer, - AccountingPhoneNumber, - CompanyInfo, - PaginatedCompanyInfoList, - Status7d1Enum, - Contact, - PaginatedContactList, - AccountingPhoneNumberRequest, - ContactRequest, - ContactEndpointRequest, - ContactResponse, - CreditNoteStatusEnum, - CreditNoteLineItem, - CreditNote, - PaginatedCreditNoteList, - ExpenseLine, - Expense, - PaginatedExpenseList, - ExpenseLineRequest, - ExpenseRequest, - ExpenseEndpointRequest, - ExpenseResponse, - GenerateRemoteKeyRequest, - RemoteKey, - IncomeStatement, - PaginatedIncomeStatementList, - InvoiceTypeEnum, - InvoiceLineItem, - Invoice, - PaginatedInvoiceList, - InvoiceLineItemRequest, - InvoiceRequest, - InvoiceEndpointRequest, - InvoiceResponse, - IssueStatusEnum, - Issue, - PaginatedIssueList, - Item, - PaginatedItemList, - JournalLine, - PostingStatusEnum, - JournalEntry, - PaginatedJournalEntryList, - JournalLineRequest, - JournalEntryRequest, - JournalEntryEndpointRequest, - JournalEntryResponse, - CommonModelScopesBodyRequest, - EndUserDetailsRequest, - LinkToken, - AccountDetailsAndActionsStatusEnum, - AccountDetailsAndActionsIntegration, - AccountDetailsAndActions, - PaginatedAccountDetailsAndActionsList, - MethodEnum, - EncodingEnum, - MultipartFormFieldRequest, - RequestFormatEnum, - DataPassthroughRequest, - ResponseTypeEnum, - RemoteResponse, - Payment, - PaginatedPaymentList, - PaymentRequest, - PaymentEndpointRequest, - PaymentResponse, - PurchaseOrderStatusEnum, - PurchaseOrderLineItem, - PurchaseOrder, - PaginatedPurchaseOrderList, - PurchaseOrderLineItemRequest, - PurchaseOrderRequest, - PurchaseOrderEndpointRequest, - PurchaseOrderResponse, - RemoteKeyForRegenerationRequest, - LinkedAccountCondition, - LinkedAccountSelectiveSyncConfiguration, - LinkedAccountConditionRequest, - LinkedAccountSelectiveSyncConfigurationRequest, - LinkedAccountSelectiveSyncConfigurationListRequest, - ConditionTypeEnum, - OperatorSchema, - ConditionSchema, - PaginatedConditionSchemaList, - SyncStatusStatusEnum, - SelectiveSyncConfigurationsUsageEnum, - SyncStatus, - PaginatedSyncStatusList, - TaxRate, - PaginatedTaxRateList, - CategoryTypeEnum, - TrackingCategory, - PaginatedTrackingCategoryList, - TransactionLineItem, - Transaction, - PaginatedTransactionList, - VendorCreditLine, - VendorCredit, - PaginatedVendorCreditList, - WebhookReceiver, - WebhookReceiverRequest, -}; - const endpoints = makeApi([ { method: "get", @@ -5051,7 +4905,10 @@ const endpoints = makeApi([ export const api = new ZodiosCore(endpoints); -api.get("/accounts/:id", { - params: { id: "123" }, - headers: { "X-Account-Token": "abc" }, -}); +async function main() { + const result = await api.get("/accounts/:id", { + // ^? + params: { id: "123" }, + headers: { "X-Account-Token": "abc" }, + }); +} From f029e087b827ae45c7cd0ee895e8d305e716598e Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sun, 9 Apr 2023 20:07:22 +0200 Subject: [PATCH 130/206] docs(changeset): feat(openapi): add openapi --- .changeset/odd-avocados-prove.md | 11 + .changeset/pre.json | 1 + package.json | 4 +- packages/axios/package.json | 8 +- packages/core/package.json | 6 +- packages/core/src/index.ts | 2 - packages/core/src/zodios.types.ts | 30 +- packages/express/package.json | 6 +- packages/express/renovate.json | 5 - packages/fetch/package.json | 6 +- packages/openapi/LICENSE | 21 + packages/openapi/README.md | 193 +++++ packages/openapi/examples/server.ts | 212 +++++ packages/openapi/jest.config.ts | 23 + packages/openapi/package.json | 68 ++ .../src/__snapshots__/openapi.test.ts.snap | 773 ++++++++++++++++++ packages/openapi/src/index.ts | 1 + packages/openapi/src/openapi.test.ts | 172 ++++ packages/openapi/src/openapi.ts | 330 ++++++++ packages/openapi/src/utils.ts | 20 + packages/openapi/tsconfig.build.json | 16 + packages/openapi/tsconfig.json | 17 + packages/openapi/tsup.config.js | 14 + packages/react/package.json | 8 +- packages/react/renovate.json | 4 - packages/testing/package.json | 6 +- pnpm-lock.yaml | 703 +++++++++------- 27 files changed, 2300 insertions(+), 360 deletions(-) create mode 100644 .changeset/odd-avocados-prove.md delete mode 100644 packages/express/renovate.json create mode 100644 packages/openapi/LICENSE create mode 100644 packages/openapi/README.md create mode 100644 packages/openapi/examples/server.ts create mode 100644 packages/openapi/jest.config.ts create mode 100644 packages/openapi/package.json create mode 100644 packages/openapi/src/__snapshots__/openapi.test.ts.snap create mode 100644 packages/openapi/src/index.ts create mode 100644 packages/openapi/src/openapi.test.ts create mode 100644 packages/openapi/src/openapi.ts create mode 100644 packages/openapi/src/utils.ts create mode 100644 packages/openapi/tsconfig.build.json create mode 100644 packages/openapi/tsconfig.json create mode 100644 packages/openapi/tsup.config.js delete mode 100644 packages/react/renovate.json diff --git a/.changeset/odd-avocados-prove.md b/.changeset/odd-avocados-prove.md new file mode 100644 index 00000000..2933adcc --- /dev/null +++ b/.changeset/odd-avocados-prove.md @@ -0,0 +1,11 @@ +--- +"@zodios/express": major +"@zodios/openapi": major +"@zodios/testing": major +"@zodios/axios": major +"@zodios/fetch": major +"@zodios/react": major +"@zodios/core": major +--- + +feat(openapi): add openapi diff --git a/.changeset/pre.json b/.changeset/pre.json index 97b3152b..a83690b5 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -14,6 +14,7 @@ "chilled-emus-own", "curly-shrimps-destroy", "famous-rules-drop", + "few-icons-march", "five-apricots-breathe", "gentle-ligers-mix", "good-tigers-tie", diff --git a/package.json b/package.json index c3de7a52..f1389263 100644 --- a/package.json +++ b/package.json @@ -11,8 +11,8 @@ "private": true, "devDependencies": { "@changesets/cli": "2.26.1", - "turbo": "1.8.5", - "typescript": "5.0.2" + "turbo": "1.8.8", + "typescript": "5.0.4" }, "pnpm": { "overrides": { diff --git a/packages/axios/package.json b/packages/axios/package.json index d66882d7..90d51758 100644 --- a/packages/axios/package.json +++ b/packages/axios/package.json @@ -64,19 +64,19 @@ "@types/express": "4.17.17", "@types/jest": "29.5.0", "@types/multer": "1.4.7", - "@types/node": "18.15.10", + "@types/node": "18.15.11", "@zodios/core": "workspace:*", - "axios": "1.3.4", + "axios": "1.3.5", "express": "4.18.2", "fp-ts": "2.13.1", "io-ts": "2.2.20", "jest": "29.5.0", "multer": "1.4.5-lts.1", "rimraf": "4.4.1", - "ts-jest": "29.0.5", + "ts-jest": "29.1.0", "ts-node": "10.9.1", "tsup": "6.7.0", - "typescript": "5.0.2", + "typescript": "5.0.4", "zod": "3.21.4" } } diff --git a/packages/core/package.json b/packages/core/package.json index bd1fe48b..f9129f5e 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -64,16 +64,16 @@ "@jest/globals": "29.5.0", "@jest/types": "29.5.0", "@types/jest": "29.5.0", - "@types/node": "18.15.10", + "@types/node": "18.15.11", "form-data": "^4.0.0", "fp-ts": "2.13.1", "io-ts": "2.2.20", "jest": "29.5.0", "rimraf": "4.4.1", - "ts-jest": "29.0.5", + "ts-jest": "29.1.0", "ts-node": "10.9.1", "tsup": "6.7.0", - "typescript": "5.0.2", + "typescript": "5.0.4", "zod": "3.21.4" } } diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index ae8742fe..fecf3ce8 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -37,9 +37,7 @@ export type { ZodiosErrorsByAlias, ZodiosEndpointDefinition, ZodiosEndpointParameter, - ZodiosEndpointParameters, ZodiosEndpointError, - ZodiosEndpointErrors, ZodiosOptions, ZodiosRequestOptions, ZodiosRequestOptionsByPath, diff --git a/packages/core/src/zodios.types.ts b/packages/core/src/zodios.types.ts index c0b15c89..e74ea79e 100644 --- a/packages/core/src/zodios.types.ts +++ b/packages/core/src/zodios.types.ts @@ -38,9 +38,9 @@ export const HTTP_METHODS = [ ...HTTP_MUTATION_METHODS, ] as const; -export type QueryMethod = typeof HTTP_QUERY_METHODS[number]; -export type MutationMethod = typeof HTTP_MUTATION_METHODS[number]; -export type Method = typeof HTTP_METHODS[number]; +export type QueryMethod = (typeof HTTP_QUERY_METHODS)[number]; +export type MutationMethod = (typeof HTTP_MUTATION_METHODS)[number]; +export type Method = (typeof HTTP_METHODS)[number]; export type RequestFormat = | "json" // default @@ -772,7 +772,7 @@ export interface ZodiosOptions< typeProvider?: ZodiosRuntimeTypeProvider; } -export interface ZodiosEndpointParameter { +export interface ZodiosEndpointParameter { /** * name of the parameter */ @@ -789,12 +789,10 @@ export interface ZodiosEndpointParameter { * zod schema of the parameter * you can use zod `transform` to transform the value of the parameter before sending it to the server */ - schema: unknown; + schema: BaseSchemaType; } -export type ZodiosEndpointParameters = ZodiosEndpointParameter[]; - -export interface ZodiosEndpointError { +export interface ZodiosEndpointError { /** * status code of the error * use 'default' to declare a default error @@ -807,15 +805,13 @@ export interface ZodiosEndpointError { /** * schema of the error */ - schema: unknown; + schema: BaseSchemaType; } -export type ZodiosEndpointErrors = ZodiosEndpointError[]; - /** * Zodios enpoint definition that should be used to create a new instance of Zodios */ -export interface ZodiosEndpointDefinition { +export interface ZodiosEndpointDefinition { /** * http method : get, post, put, patch, delete */ @@ -852,12 +848,14 @@ export interface ZodiosEndpointDefinition { /** * optional parameters of the endpoint */ - parameters?: readonly ZodiosEndpointParameter[] | ZodiosEndpointParameter[]; + parameters?: + | readonly ZodiosEndpointParameter[] + | ZodiosEndpointParameter[]; /** * response of the endpoint * you can use zod `transform` to transform the value of the response before returning it */ - response: unknown; + response: BaseSchemaType; /** * optional response status of the endpoint for sucess, default is 200 * customize it if your endpoint returns a different status code and if you need openapi to generate the correct status code @@ -870,7 +868,9 @@ export interface ZodiosEndpointDefinition { /** * optional errors of the endpoint - only usefull when using @zodios/express */ - errors?: readonly ZodiosEndpointError[] | ZodiosEndpointError[]; + errors?: + | readonly ZodiosEndpointError[] + | ZodiosEndpointError[]; } /** diff --git a/packages/express/package.json b/packages/express/package.json index f7fd8841..e38cbd48 100644 --- a/packages/express/package.json +++ b/packages/express/package.json @@ -47,17 +47,17 @@ "@jest/types": "29.5.0", "@types/express": "4.17.17", "@types/jest": "29.5.0", - "@types/node": "18.15.10", + "@types/node": "18.15.11", "@types/supertest": "2.0.12", "@zodios/core": "workspace:*", "express": "4.18.2", "jest": "29.5.0", "rimraf": "4.4.1", "supertest": "6.3.3", - "ts-jest": "29.0.5", + "ts-jest": "29.1.0", "ts-node": "10.9.1", "tsup": "6.7.0", - "typescript": "5.0.2", + "typescript": "5.0.4", "zod": "3.21.4" } } diff --git a/packages/express/renovate.json b/packages/express/renovate.json deleted file mode 100644 index a768665e..00000000 --- a/packages/express/renovate.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "extends": ["config:base"], - "ignorePaths": ["examples/**"], - "ignoreDeps": ["tsup"] -} diff --git a/packages/fetch/package.json b/packages/fetch/package.json index 5e27e1de..dc4fcb4e 100644 --- a/packages/fetch/package.json +++ b/packages/fetch/package.json @@ -61,7 +61,7 @@ "@types/express": "4.17.17", "@types/jest": "29.5.0", "@types/multer": "1.4.7", - "@types/node": "18.15.10", + "@types/node": "18.15.11", "@zodios/core": "workspace:*", "cross-fetch": "3.1.5", "express": "4.18.2", @@ -70,10 +70,10 @@ "jest": "29.5.0", "multer": "1.4.5-lts.1", "rimraf": "4.4.1", - "ts-jest": "29.0.5", + "ts-jest": "29.1.0", "ts-node": "10.9.1", "tsup": "6.7.0", - "typescript": "5.0.2", + "typescript": "5.0.4", "zod": "3.21.4" } } diff --git a/packages/openapi/LICENSE b/packages/openapi/LICENSE new file mode 100644 index 00000000..e5dea986 --- /dev/null +++ b/packages/openapi/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 ecyrbe + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/openapi/README.md b/packages/openapi/README.md new file mode 100644 index 00000000..2e129bc9 --- /dev/null +++ b/packages/openapi/README.md @@ -0,0 +1,193 @@ +

Zodios Openapi

+

+ + Zodios logo + +

+

+ Zodios Openapi is an openapi generator for zodios api description format. +
+

+ +

+ + langue typescript + + + npm + + + GitHub + + GitHub Workflow Status +

+ +# What is it ? + +It's an openapi generator for zodios api description format. + +- really simple centralized API declaration +- generate openapi v3 json schema + +**Table of contents:** + +- [What is it ?](#what-is-it-) +- [Install](#install) +- [How to use it ?](#how-to-use-it-) + - [Declare your API for fullstack end to end type safety](#declare-your-api-for-fullstack-end-to-end-type-safety) + - [Expose your OpenAPI documentation](#expose-your-openapi-documentation) + +# Install + +```bash +> npm install @zodios/openapi +``` + +or + +```bash +> yarn add @zodios/openapi +``` + +# How to use it ? + +Openapi is a specification for describing REST APIs. It's a standard that is widely used in the industry. It's a great way to document your API and zodios-openapi is a tool to generate openapi v3 json schema from zodios api description format. + +## Declare your API for fullstack end to end type safety + +Here is an example of API declaration with Zodios. Splitted between public and admin API. + +in a common directory (ex: `src/api.ts`) : + +```typescript +import { makeApi } from "@zodios/core"; +import { z } from "zod"; + +export const userApi = makeApi([ + { + method: "get", + path: "/users", + alias: "getUsers", + description: "Get all users", + parameters: [ + { + name: "limit", + type: "Query", + description: "Limit the number of users", + schema: z.number().positive(), + }, + { + name: "offset", + type: "Query", + description: "Offset the number of users", + schema: z.number().positive().optional(), + }, + ], + response: z.array(userSchema), + errors, + }, + { + method: "get", + path: "/users/:id", + alias: "getUser", + description: "Get a user by id", + response: userSchema, + errors, + }, + { + method: "get", + path: "/users/:id/comments", + alias: "getComments", + description: "Get all user comments", + response: z.array(commentSchema), + errors, + }, + { + method: "get", + path: "/users/:id/comments/:commentId", + alias: "getComment", + description: "Get a user comment by id", + response: commentSchema, + errors, + }, +]); + +export const adminApi = makeApi([ + { + method: "post", + path: "/users", + alias: "createUser", + description: "Create a user", + parameters: [ + { + name: "user", + type: "Body", + description: "The user to create", + schema: userSchema.omit({ id: true }), + }, + ], + response: userSchema, + errors, + }, + { + method: "put", + path: "/users/:id", + alias: "updateUser", + description: "Update a user", + parameters: [ + { + name: "user", + type: "Body", + description: "The user to update", + schema: userSchema, + }, + ], + response: userSchema, + errors, + }, + { + method: "delete", + path: "/users/:id", + alias: "deleteUser", + description: "Delete a user", + response: z.void(), + status: 204, + errors, + }, +]); +``` + +## Expose your OpenAPI documentation + + +in your backend (ex: `src/server.ts`) : +```typescript +import { serve, setup } from "swagger-ui-express"; +import { makeApi } from "@zodios/core"; +import { zodiosApp, zodiosRouter } from "@zodios/express"; +import { bearerAuthScheme, openApiBuilder } from "@zodios/openapi"; +import { userApi, adminApi } from "./api"; + +const app = zodiosApp(); +const userRouter = zodiosRouter([...userApi, ...adminApi]); + + +app.use("/api/v1", userRouter); + +const document = openApiBuilder({ + title: "User API", + version: "1.0.0", + description: "A simple user API", +}) + .addServer({ url: "/api/v1" }) + .addSecurityScheme("admin", bearerAuthScheme()) + .addPublicApi(api) + .addProtectedApi("admin", adminApi) + .build(); + +app.use(`/docs/swagger.json`, (_, res) => res.json(document)); +app.use("/docs", serve); +app.use("/docs", setup(undefined, { swaggerUrl: "/docs/swagger.json" })); + +app.listen(3000); +``` diff --git a/packages/openapi/examples/server.ts b/packages/openapi/examples/server.ts new file mode 100644 index 00000000..aa7337be --- /dev/null +++ b/packages/openapi/examples/server.ts @@ -0,0 +1,212 @@ +import { makeApi, makeErrors } from "@zodios/core"; +import { zodiosApp, zodiosRouter } from "@zodios/express"; +import { serve, setup } from "swagger-ui-express"; +import { z } from "zod"; +import { bearerAuthScheme, openApiBuilder } from "../src"; + +const userSchema = z.object({ + id: z.string(), + name: z.string(), + email: z.string().email(), +}); + +const commentSchema = z.object({ + id: z.string(), + content: z.string(), + createdAt: z.string(), + modifiedAt: z.string(), +}); + +type User = z.infer; + +const errors = makeErrors([ + { + status: 404, + description: "No users found", + schema: z.object({ + message: z.enum(["No users found", "User not found"]), + }), + }, + { + status: "default", + description: "Default error", + schema: z.object({ + message: z.string(), + }), + }, +]); + +const api = makeApi([ + { + method: "get", + path: "/users", + alias: "getUsers", + description: "Get all users", + parameters: [ + { + name: "limit", + type: "Query", + description: "Limit the number of users", + schema: z.number().positive().default(10), + }, + { + name: "offset", + type: "Query", + description: "Offset the number of users", + schema: z.number().positive().optional(), + }, + { + name: "filter", + type: "Query", + description: "Filter users by name", + schema: z + .array(z.string()) + .refine((array) => array.length === new Set(array).size, { + message: "Duplicate values are not allowed", + }), + }, + ], + response: z.array(userSchema), + errors, + }, + { + method: "get", + path: "/users/:id", + alias: "getUser", + description: "Get a user by id", + response: userSchema, + errors, + }, + { + method: "get", + path: "/users/:id/comments", + alias: "getComments", + description: "Get all user comments", + response: z.array(commentSchema), + errors, + }, + { + method: "get", + path: "/users/:id/comments/:commentId", + alias: "getComment", + description: "Get a user comment by id", + response: commentSchema, + errors, + }, +]); + +const adminApi = makeApi([ + { + method: "post", + path: "/users", + alias: "createUser", + description: "Create a user", + parameters: [ + { + name: "user", + type: "Body", + description: "The user to create", + schema: userSchema.omit({ id: true }), + }, + ], + response: userSchema, + errors, + }, + { + method: "put", + path: "/users/:id", + alias: "updateUser", + description: "Update a user", + parameters: [ + { + name: "user", + type: "Body", + description: "The user to update", + schema: userSchema, + }, + ], + response: userSchema, + errors, + }, + { + method: "delete", + path: "/users/:id", + alias: "deleteUser", + description: "Delete a user", + response: z.void(), + status: 204, + errors, + }, +]); + +const app = zodiosApp(); +const userRouter = zodiosRouter([...api, ...adminApi]); + +const users: User[] = [ + { + id: "1", + name: "John Doe", + email: "john.doe@test.com", + }, + { + id: "2", + name: "John Doe", + email: "john.doe@test.com", + }, +]; + +userRouter.get("/users", (req, res) => { + res.json(users); +}); + +userRouter.get("/users/:id", (req, res) => { + const user = users.find((user) => user.id === req.params.id); + if (!user) { + res.status(404).json({ message: "User not found" }); + } + return res.json(user); +}); + +userRouter.post("/users", (req, res) => { + const user = { ...req.body, id: String(users.length + 1) }; + users.push(user); + return res.json(user); +}); + +userRouter.put("/users/:id", (req, res) => { + const userIdx = users.findIndex((user) => user.id === req.params.id); + if (userIdx < 0) { + res.status(404).json({ message: "User not found" }); + } + const updatedUser = { ...users[userIdx], ...req.body }; + users[userIdx] = updatedUser; + return res.json(updatedUser); +}); + +userRouter.delete("/users/:id", (req, res) => { + const userIdx = users.findIndex((user) => user.id === req.params.id); + if (userIdx < 0) { + res.status(404).json({ message: "User not found" }); + } + users.splice(userIdx, 1); + return res.status(204).send(); +}); + +app.use("/api/v1", userRouter); + +const document = openApiBuilder({ + title: "User API", + version: "1.0.0", + description: "A simple user API", +}) + .addServer({ url: "/api/v1" }) + .addSecurityScheme("admin", bearerAuthScheme()) + .addPublicApi(api) + .addProtectedApi("admin", adminApi) + .build(); + +app.use(`/docs/swagger.json`, (_, res) => res.json(document)); +app.use("/docs", serve); +app.use("/docs", setup(undefined, { swaggerUrl: "/docs/swagger.json" })); + +app.listen(3000); diff --git a/packages/openapi/jest.config.ts b/packages/openapi/jest.config.ts new file mode 100644 index 00000000..d32c0704 --- /dev/null +++ b/packages/openapi/jest.config.ts @@ -0,0 +1,23 @@ +import type { Config } from "@jest/types"; + +// Objet synchrone +const config: Config.InitialOptions = { + verbose: true, + moduleFileExtensions: ["ts", "js", "json", "node"], + rootDir: "./", + testRegex: ".(spec|test).tsx?$", + transform: { + "^.+\\.tsx?$": "ts-jest", + }, + coverageDirectory: "./coverage", + coverageThreshold: { + global: { + branches: 80, + functions: 80, + lines: 80, + statements: 80, + }, + }, + testEnvironment: "node", +}; +export default config; diff --git a/packages/openapi/package.json b/packages/openapi/package.json new file mode 100644 index 00000000..486870d4 --- /dev/null +++ b/packages/openapi/package.json @@ -0,0 +1,68 @@ +{ + "name": "@zodios/openapi", + "description": "Openapi for zodios", + "version": "10.4.7", + "main": "lib/index.js", + "module": "lib/index.mjs", + "typings": "lib/index.d.ts", + "exports": { + ".": { + "import": "./lib/index.mjs", + "require": "./lib/index.js", + "types": "./lib/index.d.ts" + }, + "./package.json": "./package.json" + }, + "files": [ + "lib" + ], + "author": { + "name": "ecyrbe", + "email": "ecyrbe@gmail.com" + }, + "homepage": "https://github.com/ecyrbe/zodios-openapi", + "repository": { + "type": "git", + "url": "https://github.com/ecyrbe/zodios-openapi.git" + }, + "license": "MIT", + "keywords": [ + "zod", + "zodios", + "rest", + "openapi" + ], + "scripts": { + "prebuild": "rimraf lib", + "build": "tsup", + "test": "jest --coverage" + }, + "peerDependencies": { + "@zodios/core": "11.0.0-beta.18", + "zod": "^3.x" + }, + "devDependencies": { + "@jest/globals": "29.5.0", + "@jest/types": "29.5.0", + "@types/jest": "29.5.0", + "@types/multer": "1.4.7", + "@types/node": "18.15.11", + "@types/swagger-ui-express": "4.1.3", + "@zodios/core": "workspace:*", + "@zodios/express": "workspace:*", + "axios": "1.3.5", + "express": "4.18.2", + "jest": "29.5.0", + "rimraf": "4.4.1", + "swagger-ui-express": "4.6.2", + "ts-jest": "29.1.0", + "ts-node": "10.9.1", + "tsup": "6.7.0", + "typescript": "5.0.4", + "zod": "3.21.4" + }, + "dependencies": { + "openapi-types": "12.1.0", + "zod-to-json-schema": "3.20.4" + } +} diff --git a/packages/openapi/src/__snapshots__/openapi.test.ts.snap b/packages/openapi/src/__snapshots__/openapi.test.ts.snap new file mode 100644 index 00000000..ca04f6a3 --- /dev/null +++ b/packages/openapi/src/__snapshots__/openapi.test.ts.snap @@ -0,0 +1,773 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`toOpenApi should convert to openapi with builder 1`] = ` +{ + "info": { + "title": "My API", + "version": "1.0.0", + }, + "openapi": "3.0.0", + "paths": { + "/users": { + "post": { + "description": "Create a user", + "operationId": "createUser", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "email": { + "format": "email", + "type": "string", + }, + "name": { + "type": "string", + }, + }, + "required": [ + "name", + "email", + ], + "type": "object", + }, + }, + }, + "description": "The user to create", + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "email": { + "format": "email", + "type": "string", + }, + "id": { + "type": "string", + }, + "name": { + "type": "string", + }, + }, + "required": [ + "id", + "name", + "email", + ], + "type": "object", + }, + }, + }, + "description": "Success", + }, + }, + "security": undefined, + "summary": "Create a user", + "tags": [ + "users", + ], + }, + }, + "/users/{id}": { + "delete": { + "description": "Delete a user", + "operationId": "deleteUser", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string", + }, + }, + ], + "requestBody": undefined, + "responses": { + "204": { + "content": { + "application/json": { + "schema": {}, + }, + }, + "description": "Success", + }, + }, + "security": undefined, + "summary": "Delete a user", + "tags": [ + "users", + ], + }, + "get": { + "description": "Get a user by id", + "operationId": "getUser", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string", + }, + }, + ], + "requestBody": undefined, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "email": { + "format": "email", + "type": "string", + }, + "id": { + "type": "string", + }, + "name": { + "type": "string", + }, + }, + "required": [ + "id", + "name", + "email", + ], + "type": "object", + }, + }, + }, + "description": "Success", + }, + }, + "security": undefined, + "summary": "Get a user by id", + "tags": [ + "users", + ], + }, + "put": { + "description": "Update a user", + "operationId": "updateUser", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string", + }, + }, + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "email": { + "format": "email", + "type": "string", + }, + "id": { + "type": "string", + }, + "name": { + "type": "string", + }, + }, + "required": [ + "id", + "name", + "email", + ], + "type": "object", + }, + }, + }, + "description": "The user to update", + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "email": { + "format": "email", + "type": "string", + }, + "id": { + "type": "string", + }, + "name": { + "type": "string", + }, + }, + "required": [ + "id", + "name", + "email", + ], + "type": "object", + }, + }, + }, + "description": "Success", + }, + }, + "security": undefined, + "summary": "Update a user", + "tags": [ + "users", + ], + }, + }, + "/users?filter={filter}#fragment": { + "get": { + "description": "Get all users", + "operationId": "getUsers", + "parameters": [ + { + "in": "path", + "name": "filter", + "required": true, + "schema": { + "type": "string", + }, + }, + { + "description": "Limit the number of users", + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 10, + "exclusiveMinimum": true, + "minimum": 0, + "type": "number", + }, + }, + { + "description": "Offset the number of users", + "in": "query", + "name": "offset", + "required": false, + "schema": { + "exclusiveMinimum": true, + "minimum": 0, + "type": "number", + }, + }, + { + "description": "Filter users by name", + "in": "query", + "name": "filter[]", + "required": true, + "schema": { + "items": { + "type": "string", + }, + "type": "array", + }, + }, + ], + "requestBody": undefined, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "additionalProperties": false, + "properties": { + "email": { + "format": "email", + "type": "string", + }, + "id": { + "type": "string", + }, + "name": { + "type": "string", + }, + }, + "required": [ + "id", + "name", + "email", + ], + "type": "object", + }, + "type": "array", + }, + }, + }, + "description": "Success", + }, + "404": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "message": { + "enum": [ + "No users found", + ], + "type": "string", + }, + }, + "required": [ + "message", + ], + "type": "object", + }, + }, + }, + "description": "No users found", + }, + "default": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "message": { + "type": "string", + }, + }, + "required": [ + "message", + ], + "type": "object", + }, + }, + }, + "description": "Default error", + }, + }, + "security": undefined, + "summary": "Get all users", + "tags": [ + "users", + ], + }, + }, + }, + "servers": undefined, +} +`; + +exports[`toOpenApi should convert to openapi with builder with security 1`] = ` +{ + "components": { + "securitySchemes": { + "auth": { + "bearerFormat": "JWT", + "description": undefined, + "scheme": "bearer", + "type": "http", + }, + }, + }, + "info": { + "title": "My API", + "version": "1.0.0", + }, + "openapi": "3.0.0", + "paths": { + "/users": { + "post": { + "description": "Create a user", + "operationId": "createUser", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "email": { + "format": "email", + "type": "string", + }, + "name": { + "type": "string", + }, + }, + "required": [ + "name", + "email", + ], + "type": "object", + }, + }, + }, + "description": "The user to create", + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "email": { + "format": "email", + "type": "string", + }, + "id": { + "type": "string", + }, + "name": { + "type": "string", + }, + }, + "required": [ + "id", + "name", + "email", + ], + "type": "object", + }, + }, + }, + "description": "Success", + }, + }, + "security": [ + { + "auth": [], + }, + ], + "summary": "Create a user", + "tags": [ + "users", + ], + }, + }, + "/users/{id}": { + "delete": { + "description": "Delete a user", + "operationId": "deleteUser", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string", + }, + }, + ], + "requestBody": undefined, + "responses": { + "204": { + "content": { + "application/json": { + "schema": {}, + }, + }, + "description": "Success", + }, + }, + "security": [ + { + "auth": [], + }, + ], + "summary": "Delete a user", + "tags": [ + "users", + ], + }, + "get": { + "description": "Get a user by id", + "operationId": "getUser", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string", + }, + }, + ], + "requestBody": undefined, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "email": { + "format": "email", + "type": "string", + }, + "id": { + "type": "string", + }, + "name": { + "type": "string", + }, + }, + "required": [ + "id", + "name", + "email", + ], + "type": "object", + }, + }, + }, + "description": "Success", + }, + }, + "security": [ + { + "auth": [], + }, + ], + "summary": "Get a user by id", + "tags": [ + "users", + ], + }, + "put": { + "description": "Update a user", + "operationId": "updateUser", + "parameters": [ + { + "in": "path", + "name": "id", + "required": true, + "schema": { + "type": "string", + }, + }, + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "email": { + "format": "email", + "type": "string", + }, + "id": { + "type": "string", + }, + "name": { + "type": "string", + }, + }, + "required": [ + "id", + "name", + "email", + ], + "type": "object", + }, + }, + }, + "description": "The user to update", + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "email": { + "format": "email", + "type": "string", + }, + "id": { + "type": "string", + }, + "name": { + "type": "string", + }, + }, + "required": [ + "id", + "name", + "email", + ], + "type": "object", + }, + }, + }, + "description": "Success", + }, + }, + "security": [ + { + "auth": [], + }, + ], + "summary": "Update a user", + "tags": [ + "users", + ], + }, + }, + "/users?filter={filter}#fragment": { + "get": { + "description": "Get all users", + "operationId": "getUsers", + "parameters": [ + { + "in": "path", + "name": "filter", + "required": true, + "schema": { + "type": "string", + }, + }, + { + "description": "Limit the number of users", + "in": "query", + "name": "limit", + "required": false, + "schema": { + "default": 10, + "exclusiveMinimum": true, + "minimum": 0, + "type": "number", + }, + }, + { + "description": "Offset the number of users", + "in": "query", + "name": "offset", + "required": false, + "schema": { + "exclusiveMinimum": true, + "minimum": 0, + "type": "number", + }, + }, + { + "description": "Filter users by name", + "in": "query", + "name": "filter[]", + "required": true, + "schema": { + "items": { + "type": "string", + }, + "type": "array", + }, + }, + ], + "requestBody": undefined, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "additionalProperties": false, + "properties": { + "email": { + "format": "email", + "type": "string", + }, + "id": { + "type": "string", + }, + "name": { + "type": "string", + }, + }, + "required": [ + "id", + "name", + "email", + ], + "type": "object", + }, + "type": "array", + }, + }, + }, + "description": "Success", + }, + "404": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "message": { + "enum": [ + "No users found", + ], + "type": "string", + }, + }, + "required": [ + "message", + ], + "type": "object", + }, + }, + }, + "description": "No users found", + }, + "default": { + "content": { + "application/json": { + "schema": { + "additionalProperties": false, + "properties": { + "message": { + "type": "string", + }, + }, + "required": [ + "message", + ], + "type": "object", + }, + }, + }, + "description": "Default error", + }, + }, + "security": [ + { + "auth": [], + }, + ], + "summary": "Get all users", + "tags": [ + "users", + ], + }, + }, + }, + "servers": [ + { + "url": "/api/v1", + }, + ], +} +`; diff --git a/packages/openapi/src/index.ts b/packages/openapi/src/index.ts new file mode 100644 index 00000000..cbcf6047 --- /dev/null +++ b/packages/openapi/src/index.ts @@ -0,0 +1 @@ +export * from "./openapi"; diff --git a/packages/openapi/src/openapi.test.ts b/packages/openapi/src/openapi.test.ts new file mode 100644 index 00000000..8745c37c --- /dev/null +++ b/packages/openapi/src/openapi.test.ts @@ -0,0 +1,172 @@ +import { makeApi } from "@zodios/core"; +import { z } from "zod"; +import { + basicAuthScheme, + bearerAuthScheme, + oauth2Scheme, + openApiBuilder, +} from "./openapi"; + +const user = z.object({ + id: z.string(), + name: z.string(), + email: z.string().email(), +}); + +const api = makeApi([ + { + method: "get", + path: "/users?filter=:filter#fragment", + alias: "getUsers", + description: "Get all users", + parameters: [ + { + name: "limit", + type: "Query", + description: "Limit the number of users", + schema: z.number().positive().default(10), + }, + { + name: "offset", + type: "Query", + description: "Offset the number of users", + schema: z.number().positive().optional(), + }, + { + name: "filter", + type: "Query", + description: "Filter users by name", + schema: z + .array(z.string()) + .refine((a) => new Set(a).size === a.length, "No duplicates allowed"), + }, + ], + response: z.array(user), + errors: [ + { + status: 404, + description: "No users found", + schema: z.object({ + message: z.literal("No users found"), + }), + }, + { + status: "default", + description: "Default error", + schema: z.object({ + message: z.string(), + }), + }, + ], + }, + { + method: "get", + path: "/users/:id", + alias: "getUser", + description: "Get a user by id", + response: user, + }, + { + method: "post", + path: "/users", + alias: "createUser", + description: "Create a user", + parameters: [ + { + name: "user", + type: "Body", + description: "The user to create", + schema: user.omit({ id: true }), + }, + ], + response: user, + }, + { + method: "put", + path: "/users/:id", + alias: "updateUser", + description: "Update a user", + parameters: [ + { + name: "user", + type: "Body", + description: "The user to update", + schema: user, + }, + ], + response: user, + }, + { + method: "delete", + path: "/users/:id", + alias: "deleteUser", + description: "Delete a user", + response: z.void(), + status: 204, + }, +]); + +describe("toOpenApi", () => { + it("should generate bearer scheme", () => { + const scheme = bearerAuthScheme(); + expect(scheme).toEqual({ + type: "http", + scheme: "bearer", + bearerFormat: "JWT", + }); + }); + + it("should generate basic scheme", () => { + const scheme = basicAuthScheme(); + expect(scheme).toEqual({ + type: "http", + scheme: "basic", + }); + }); + + it("should generate oauth2 scheme", () => { + const scheme = oauth2Scheme({ + implicit: { + authorizationUrl: "https://example.com/oauth2/authorize", + scopes: { + read: "Read access", + write: "Write access", + }, + }, + }); + expect(scheme).toEqual({ + type: "oauth2", + flows: { + implicit: { + authorizationUrl: "https://example.com/oauth2/authorize", + scopes: { + read: "Read access", + write: "Write access", + }, + }, + }, + }); + }); + + it("should convert to openapi with builder", () => { + const openApi = openApiBuilder({ + title: "My API", + version: "1.0.0", + }) + .addPublicApi(api) + .build(); + expect(openApi).toMatchSnapshot(); + }); + + it("should convert to openapi with builder with security", () => { + const openApi = openApiBuilder({ + title: "My API", + version: "1.0.0", + }) + .addServer({ url: "/api/v1" }) + .addSecurityScheme("auth", bearerAuthScheme()) + .addProtectedApi("auth", api) + .build(); + expect(openApi).toMatchSnapshot(); + }); +}); diff --git a/packages/openapi/src/openapi.ts b/packages/openapi/src/openapi.ts new file mode 100644 index 00000000..fe4b32c8 --- /dev/null +++ b/packages/openapi/src/openapi.ts @@ -0,0 +1,330 @@ +import { zodToJsonSchema } from "zod-to-json-schema"; +import type { OpenAPIV3 } from "openapi-types"; +import type { ZodiosEndpointDefinition } from "@zodios/core"; +import { ZodTypeAny, z } from "zod"; +import { isZodType } from "./utils"; + +const pathRegExp = /:([a-zA-Z_][a-zA-Z0-9_]*)/g; +const expludedParamTypes = ["Body", "Path"]; + +function pathWithoutParams(path: string) { + return path.indexOf("?") > -1 + ? path.split("?")[0] + : path.indexOf("#") > -1 + ? path.split("#")[0] + : path; +} + +function tagsFromPath(path: string): string[] | undefined { + const resources = pathWithoutParams(path) + .replace(pathRegExp, "") + .split("/") + .filter((part) => part !== ""); + return resources ? [resources[resources.length - 1]] : undefined; +} + +export function bearerAuthScheme( + description?: string +): OpenAPIV3.SecuritySchemeObject { + return { + type: "http", + scheme: "bearer", + bearerFormat: "JWT", + description, + }; +} + +export function basicAuthScheme( + description?: string +): OpenAPIV3.SecuritySchemeObject { + return { + type: "http", + scheme: "basic", + description, + }; +} + +export function apiKeyAuthScheme( + options: Omit, + description?: string +): OpenAPIV3.SecuritySchemeObject { + return { + type: "apiKey", + description, + ...options, + }; +} + +export function oauth2Scheme( + flows: OpenAPIV3.OAuth2SecurityScheme["flows"], + description?: string +): OpenAPIV3.SecuritySchemeObject { + return { + type: "oauth2", + description, + flows, + }; +} + +function findPathParam( + endpoint: ZodiosEndpointDefinition, + paramName: string +) { + return endpoint.parameters?.find( + (param) => param.type === "Path" && param.name === paramName + ); +} + +function makeJsonSchema(schema: z.ZodTypeAny) { + return zodToJsonSchema(schema, { + target: "openApi3", + $refStrategy: "none", + }) as OpenAPIV3.SchemaObject; +} + +/** + * Create an openapi V3 document from a list of api definitions + * Use this function if you want to define multiple apis protected by different security schemes + * @param options - the parameters to create the document + * @returns - the openapi V3 document + */ +function makeOpenApi(options: { + apis: Array< + | { + definitions: + | readonly ZodiosEndpointDefinition[] + | ZodiosEndpointDefinition[]; + } + | { + scheme: string; + securityRequirement?: string[]; + definitions: + | readonly ZodiosEndpointDefinition[] + | ZodiosEndpointDefinition[]; + } + >; + info?: OpenAPIV3.InfoObject; + servers?: OpenAPIV3.ServerObject[]; + securitySchemes?: Record; + tagsFromPathFn?: (path: string) => string[]; +}) { + const { tagsFromPathFn = tagsFromPath } = options; + const openApi: OpenAPIV3.Document = { + openapi: "3.0.0", + info: options.info ?? { + title: "Zodios : add an info object to 'toOpenApi' options", + version: "1.0.0", + }, + servers: options.servers, + paths: {}, + }; + if (options.securitySchemes) { + openApi.components = { + securitySchemes: options.securitySchemes, + }; + } + for (let api of options.apis) { + for (let endpoint of api.definitions) { + const responses: OpenAPIV3.ResponsesObject = { + [`${endpoint.status ?? 200}`]: { + description: endpoint.responseDescription ?? "Success", + content: { + "application/json": { + schema: makeJsonSchema(endpoint.response), + }, + }, + }, + }; + for (let error of endpoint.errors ?? []) { + responses[`${error.status}`] = { + description: error.description ?? "Error", + content: { + "application/json": { + schema: makeJsonSchema(error.schema), + }, + }, + }; + } + const parameters: OpenAPIV3.ParameterObject[] = []; + // extract path parameters from endpoint path + const pathParams = endpoint.path.match(pathRegExp); + if (pathParams) { + for (let pathParam of pathParams) { + const paramName = pathParam.slice(1); + const param = findPathParam(endpoint, paramName); + if (param) { + parameters.push({ + name: paramName, + description: param.description, + in: "path", + schema: makeJsonSchema(param.schema), + required: true, + }); + } else { + parameters.push({ + name: paramName, + in: "path", + schema: { + type: "string", + }, + required: true, + }); + } + } + } + // extract all other parameters from endpoint + for (let param of endpoint.parameters ?? []) { + if (!expludedParamTypes.includes(param.type)) { + const required = !param.schema.isOptional(); + const schema = + required || + !isZodType(param.schema, z.ZodFirstPartyTypeKind.ZodOptional) + ? param.schema + : (param.schema as z.ZodOptional).unwrap(); + parameters.push({ + name: + param.type === "Query" && + isZodType(param.schema, z.ZodFirstPartyTypeKind.ZodArray) + ? `${param.name}[]` + : param.name, + in: param.type.toLowerCase(), + schema: makeJsonSchema(schema), + description: param.description, + required, + } as OpenAPIV3.ParameterObject); + } + } + const path = endpoint.path.replace(pathRegExp, "{$1}"); + const body = endpoint.parameters?.find((param) => param.type === "Body"); + + const operation: OpenAPIV3.OperationObject = { + operationId: endpoint.alias, + summary: endpoint.description, + description: endpoint.description, + tags: tagsFromPathFn(endpoint.path), + security: + "scheme" in api && api.scheme + ? [{ [api.scheme]: api.securityRequirement ?? ([] as string[]) }] + : undefined, + requestBody: body + ? { + description: body.description, + content: { + "application/json": { + schema: makeJsonSchema(body.schema), + }, + }, + } + : undefined, + parameters, + responses, + }; + openApi.paths[path] = { + ...openApi.paths[path], + [endpoint.method]: operation, + }; + } + } + return openApi; +} + +export class OpenApiBuilder { + apis: Array< + | { + definitions: + | readonly ZodiosEndpointDefinition[] + | ZodiosEndpointDefinition[]; + } + | { + scheme: string; + securityRequirement?: string[]; + definitions: + | readonly ZodiosEndpointDefinition[] + | ZodiosEndpointDefinition[]; + } + > = []; + options: { + info: OpenAPIV3.InfoObject; + servers?: OpenAPIV3.ServerObject[]; + securitySchemes?: Record; + tagsFromPathFn?: (path: string) => string[]; + }; + constructor(info: OpenAPIV3.InfoObject) { + this.options = { info }; + } + + /** + * add a security scheme to proctect the apis + * @param name - the name of the security scheme + * @param securityScheme - the security scheme object + */ + addSecurityScheme( + name: string, + securityScheme: OpenAPIV3.SecuritySchemeObject + ) { + this.options.securitySchemes ??= {}; + this.options.securitySchemes[name] = securityScheme; + return this; + } + /** + * add an api with public endpoints + * @param definitions - the endpoint definitions + * @returns + */ + addPublicApi( + definitions: + | readonly ZodiosEndpointDefinition[] + | ZodiosEndpointDefinition[] + ) { + this.apis.push({ definitions }); + return this; + } + /** + * add an api protected by a security scheme + * @param scheme - the name of the security scheme to use + * @param definitions - the endpoints API + * @param securityRequirement - optional security requirement to use for this API (oauth2 scopes for example) + */ + addProtectedApi( + scheme: string, + definitions: + | readonly ZodiosEndpointDefinition[] + | ZodiosEndpointDefinition[], + securityRequirement?: string[] + ) { + this.apis.push({ scheme, definitions, securityRequirement }); + return this; + } + /** + * add a server to the openapi document + * @param server - the server to add + */ + addServer(server: OpenAPIV3.ServerObject) { + this.options.servers ??= []; + this.options.servers.push(server); + return this; + } + /** + * ovveride the default tagsFromPathFn + * @param tagsFromPathFn - a function that takes a path and returns the tags to use for this path + */ + setCustomTagsFn(tagsFromPathFn: (path: string) => string[]) { + this.options.tagsFromPathFn = tagsFromPathFn; + return this; + } + build() { + return makeOpenApi({ + apis: this.apis, + ...this.options, + }); + } +} + +/** + * Builder to easily create an openapi V3 document from zodios api definitions + * @param info - the info object to add to the document + * @returns - the openapi V3 builder + */ +export function openApiBuilder(info: OpenAPIV3.InfoObject) { + return new OpenApiBuilder(info); +} diff --git a/packages/openapi/src/utils.ts b/packages/openapi/src/utils.ts new file mode 100644 index 00000000..3aa3f6ef --- /dev/null +++ b/packages/openapi/src/utils.ts @@ -0,0 +1,20 @@ +import { z } from "zod"; + +export function isZodType( + t: z.ZodTypeAny, + type: z.ZodFirstPartyTypeKind +): boolean { + if (t._def?.typeName === type) { + return true; + } + if ( + t._def?.typeName === z.ZodFirstPartyTypeKind.ZodEffects && + (t as z.ZodEffects)._def.effect.type === "refinement" + ) { + return isZodType((t as z.ZodEffects).innerType(), type); + } + if (t._def?.innerType) { + return isZodType(t._def.innerType, type); + } + return false; +} diff --git a/packages/openapi/tsconfig.build.json b/packages/openapi/tsconfig.build.json new file mode 100644 index 00000000..e8b555b9 --- /dev/null +++ b/packages/openapi/tsconfig.build.json @@ -0,0 +1,16 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "target": "ES6", + "sourceMap": false + }, + "exclude": [ + "node_modules", + "lib", + "examples", + "**/*.config.ts", + "**/*.spec.ts", + "**/*.test.ts", + "**/*.d.ts" + ] +} diff --git a/packages/openapi/tsconfig.json b/packages/openapi/tsconfig.json new file mode 100644 index 00000000..125f9093 --- /dev/null +++ b/packages/openapi/tsconfig.json @@ -0,0 +1,17 @@ +{ + // ts config for es 2021 + "compilerOptions": { + "target": "ES2019", + "module": "CommonJS", + "moduleResolution": "Node", + "lib": ["ES2019"], + "outDir": "./lib", + "alwaysStrict": true, + "strict": true, + "esModuleInterop": true, + "sourceMap": true, + "declaration": true, + "jsx": "react-jsx" + }, + "exclude": ["node_modules", "lib"] +} diff --git a/packages/openapi/tsup.config.js b/packages/openapi/tsup.config.js new file mode 100644 index 00000000..899d5e3f --- /dev/null +++ b/packages/openapi/tsup.config.js @@ -0,0 +1,14 @@ +import { defineConfig } from "tsup"; + +export default defineConfig({ + clean: true, + dts: true, + entry: ["src/index.ts"], + outDir: "lib", + format: ["cjs", "esm"], + minify: true, + treeshake: true, + tsconfig: "tsconfig.build.json", + splitting: true, + sourcemap: false, +}); diff --git a/packages/react/package.json b/packages/react/package.json index b74aaeb8..b2cddc70 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -65,8 +65,8 @@ "@types/cors": "2.8.13", "@types/express": "4.17.17", "@types/jest": "29.5.0", - "@types/node": "18.15.10", - "@types/react": "18.0.29", + "@types/node": "18.15.11", + "@types/react": "18.0.33", "@zodios/axios": "workspace:*", "@zodios/core": "workspace:*", "@zodios/fetch": "workspace:*", @@ -81,10 +81,10 @@ "react-dom": "18.2.0", "react-test-renderer": "18.2.0", "rimraf": "4.4.1", - "ts-jest": "29.0.5", + "ts-jest": "29.1.0", "ts-node": "10.9.1", "tsup": "6.7.0", - "typescript": "5.0.2", + "typescript": "5.0.4", "zod": "3.21.4" } } diff --git a/packages/react/renovate.json b/packages/react/renovate.json deleted file mode 100644 index 24494837..00000000 --- a/packages/react/renovate.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "extends": ["config:base"], - "ignoreDeps": ["tsup"] -} diff --git a/packages/testing/package.json b/packages/testing/package.json index f64fe292..611d390e 100644 --- a/packages/testing/package.json +++ b/packages/testing/package.json @@ -43,7 +43,7 @@ "@jest/globals": "29.5.0", "@jest/types": "29.5.0", "@types/jest": "29.5.0", - "@types/node": "18.15.10", + "@types/node": "18.15.11", "@zodios/core": "workspace:*", "@zodios/fetch": "workspace:*", "form-data": "^4.0.0", @@ -51,10 +51,10 @@ "io-ts": "2.2.20", "jest": "29.5.0", "rimraf": "4.4.1", - "ts-jest": "29.0.5", + "ts-jest": "29.1.0", "ts-node": "10.9.1", "tsup": "6.7.0", - "typescript": "5.0.2", + "typescript": "5.0.4", "zod": "3.21.4" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 79b95cd6..6f12cd18 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,12 +8,12 @@ importers: .: specifiers: '@changesets/cli': 2.26.1 - turbo: 1.8.5 - typescript: 5.0.2 + turbo: 1.8.8 + typescript: 5.0.4 devDependencies: '@changesets/cli': 2.26.1 - turbo: 1.8.5 - typescript: 5.0.2 + turbo: 1.8.8 + typescript: 5.0.4 packages/axios: specifiers: @@ -22,19 +22,19 @@ importers: '@types/express': 4.17.17 '@types/jest': 29.5.0 '@types/multer': 1.4.7 - '@types/node': 18.15.10 + '@types/node': 18.15.11 '@zodios/core': workspace:* - axios: 1.3.4 + axios: 1.3.5 express: 4.18.2 fp-ts: 2.13.1 io-ts: 2.2.20 jest: 29.5.0 multer: 1.4.5-lts.1 rimraf: 4.4.1 - ts-jest: 29.0.5 + ts-jest: 29.1.0 ts-node: 10.9.1 tsup: 6.7.0 - typescript: 5.0.2 + typescript: 5.0.4 zod: 3.21.4 devDependencies: '@jest/globals': 29.5.0 @@ -42,19 +42,19 @@ importers: '@types/express': 4.17.17 '@types/jest': 29.5.0 '@types/multer': 1.4.7 - '@types/node': 18.15.10 + '@types/node': 18.15.11 '@zodios/core': link:../core - axios: 1.3.4 + axios: 1.3.5 express: 4.18.2 fp-ts: 2.13.1 io-ts: 2.2.20_fp-ts@2.13.1 - jest: 29.5.0_m54q5dse6x3xfnwbnypkikpaee + jest: 29.5.0_rrli7kzx2akox3oq6aahu3rvje multer: 1.4.5-lts.1 rimraf: 4.4.1 - ts-jest: 29.0.5_63eeh5l64lewq762rxfh3frani - ts-node: 10.9.1_zd7fjxbseldtiwc6h6ujrbvxuy - tsup: 6.7.0_b3krtfsdr4o54pb3ito5mirk64 - typescript: 5.0.2 + ts-jest: 29.1.0_sye3n7rnony6rzpy3o3kwkrynm + ts-node: 10.9.1_bhanhq442dy43ncydsavgi4jfi + tsup: 6.7.0_pyqfhkbboucpxgvrs7ocxwodkm + typescript: 5.0.4 zod: 3.21.4 packages/core: @@ -62,31 +62,31 @@ importers: '@jest/globals': 29.5.0 '@jest/types': 29.5.0 '@types/jest': 29.5.0 - '@types/node': 18.15.10 + '@types/node': 18.15.11 form-data: ^4.0.0 fp-ts: 2.13.1 io-ts: 2.2.20 jest: 29.5.0 rimraf: 4.4.1 - ts-jest: 29.0.5 + ts-jest: 29.1.0 ts-node: 10.9.1 tsup: 6.7.0 - typescript: 5.0.2 + typescript: 5.0.4 zod: 3.21.4 devDependencies: '@jest/globals': 29.5.0 '@jest/types': 29.5.0 '@types/jest': 29.5.0 - '@types/node': 18.15.10 + '@types/node': 18.15.11 form-data: 4.0.0 fp-ts: 2.13.1 io-ts: 2.2.20_fp-ts@2.13.1 - jest: 29.5.0_m54q5dse6x3xfnwbnypkikpaee + jest: 29.5.0_rrli7kzx2akox3oq6aahu3rvje rimraf: 4.4.1 - ts-jest: 29.0.5_63eeh5l64lewq762rxfh3frani - ts-node: 10.9.1_zd7fjxbseldtiwc6h6ujrbvxuy - tsup: 6.7.0_b3krtfsdr4o54pb3ito5mirk64 - typescript: 5.0.2 + ts-jest: 29.1.0_sye3n7rnony6rzpy3o3kwkrynm + ts-node: 10.9.1_bhanhq442dy43ncydsavgi4jfi + tsup: 6.7.0_pyqfhkbboucpxgvrs7ocxwodkm + typescript: 5.0.4 zod: 3.21.4 packages/express: @@ -95,34 +95,34 @@ importers: '@jest/types': 29.5.0 '@types/express': 4.17.17 '@types/jest': 29.5.0 - '@types/node': 18.15.10 + '@types/node': 18.15.11 '@types/supertest': 2.0.12 '@zodios/core': workspace:* express: 4.18.2 jest: 29.5.0 rimraf: 4.4.1 supertest: 6.3.3 - ts-jest: 29.0.5 + ts-jest: 29.1.0 ts-node: 10.9.1 tsup: 6.7.0 - typescript: 5.0.2 + typescript: 5.0.4 zod: 3.21.4 devDependencies: '@jest/globals': 29.5.0 '@jest/types': 29.5.0 '@types/express': 4.17.17 '@types/jest': 29.5.0 - '@types/node': 18.15.10 + '@types/node': 18.15.11 '@types/supertest': 2.0.12 '@zodios/core': link:../core express: 4.18.2 - jest: 29.5.0_m54q5dse6x3xfnwbnypkikpaee + jest: 29.5.0_rrli7kzx2akox3oq6aahu3rvje rimraf: 4.4.1 supertest: 6.3.3 - ts-jest: 29.0.5_63eeh5l64lewq762rxfh3frani - ts-node: 10.9.1_zd7fjxbseldtiwc6h6ujrbvxuy - tsup: 6.7.0_b3krtfsdr4o54pb3ito5mirk64 - typescript: 5.0.2 + ts-jest: 29.1.0_sye3n7rnony6rzpy3o3kwkrynm + ts-node: 10.9.1_bhanhq442dy43ncydsavgi4jfi + tsup: 6.7.0_pyqfhkbboucpxgvrs7ocxwodkm + typescript: 5.0.4 zod: 3.21.4 packages/fetch: @@ -132,7 +132,7 @@ importers: '@types/express': 4.17.17 '@types/jest': 29.5.0 '@types/multer': 1.4.7 - '@types/node': 18.15.10 + '@types/node': 18.15.11 '@zodios/core': workspace:* cross-fetch: 3.1.5 express: 4.18.2 @@ -141,10 +141,10 @@ importers: jest: 29.5.0 multer: 1.4.5-lts.1 rimraf: 4.4.1 - ts-jest: 29.0.5 + ts-jest: 29.1.0 ts-node: 10.9.1 tsup: 6.7.0 - typescript: 5.0.2 + typescript: 5.0.4 zod: 3.21.4 devDependencies: '@jest/globals': 29.5.0 @@ -152,19 +152,64 @@ importers: '@types/express': 4.17.17 '@types/jest': 29.5.0 '@types/multer': 1.4.7 - '@types/node': 18.15.10 + '@types/node': 18.15.11 '@zodios/core': link:../core cross-fetch: 3.1.5 express: 4.18.2 fp-ts: 2.13.1 io-ts: 2.2.20_fp-ts@2.13.1 - jest: 29.5.0_m54q5dse6x3xfnwbnypkikpaee + jest: 29.5.0_rrli7kzx2akox3oq6aahu3rvje multer: 1.4.5-lts.1 rimraf: 4.4.1 - ts-jest: 29.0.5_63eeh5l64lewq762rxfh3frani - ts-node: 10.9.1_zd7fjxbseldtiwc6h6ujrbvxuy - tsup: 6.7.0_b3krtfsdr4o54pb3ito5mirk64 - typescript: 5.0.2 + ts-jest: 29.1.0_sye3n7rnony6rzpy3o3kwkrynm + ts-node: 10.9.1_bhanhq442dy43ncydsavgi4jfi + tsup: 6.7.0_pyqfhkbboucpxgvrs7ocxwodkm + typescript: 5.0.4 + zod: 3.21.4 + + packages/openapi: + specifiers: + '@jest/globals': 29.5.0 + '@jest/types': 29.5.0 + '@types/jest': 29.5.0 + '@types/multer': 1.4.7 + '@types/node': 18.15.11 + '@types/swagger-ui-express': 4.1.3 + '@zodios/core': workspace:* + '@zodios/express': workspace:* + axios: 1.3.5 + express: 4.18.2 + jest: 29.5.0 + openapi-types: 12.1.0 + rimraf: 4.4.1 + swagger-ui-express: 4.6.2 + ts-jest: 29.1.0 + ts-node: 10.9.1 + tsup: 6.7.0 + typescript: 5.0.4 + zod: 3.21.4 + zod-to-json-schema: 3.20.4 + dependencies: + openapi-types: 12.1.0 + zod-to-json-schema: 3.20.4_zod@3.21.4 + devDependencies: + '@jest/globals': 29.5.0 + '@jest/types': 29.5.0 + '@types/jest': 29.5.0 + '@types/multer': 1.4.7 + '@types/node': 18.15.11 + '@types/swagger-ui-express': 4.1.3 + '@zodios/core': link:../core + '@zodios/express': link:../express + axios: 1.3.5 + express: 4.18.2 + jest: 29.5.0_rrli7kzx2akox3oq6aahu3rvje + rimraf: 4.4.1 + swagger-ui-express: 4.6.2_express@4.18.2 + ts-jest: 29.1.0_sye3n7rnony6rzpy3o3kwkrynm + ts-node: 10.9.1_bhanhq442dy43ncydsavgi4jfi + tsup: 6.7.0_pyqfhkbboucpxgvrs7ocxwodkm + typescript: 5.0.4 zod: 3.21.4 packages/react: @@ -180,8 +225,8 @@ importers: '@types/cors': 2.8.13 '@types/express': 4.17.17 '@types/jest': 29.5.0 - '@types/node': 18.15.10 - '@types/react': 18.0.29 + '@types/node': 18.15.11 + '@types/react': 18.0.33 '@zodios/axios': workspace:* '@zodios/core': workspace:* '@zodios/fetch': workspace:* @@ -196,10 +241,10 @@ importers: react-dom: 18.2.0 react-test-renderer: 18.2.0 rimraf: 4.4.1 - ts-jest: 29.0.5 + ts-jest: 29.1.0 ts-node: 10.9.1 tsup: 6.7.0 - typescript: 5.0.2 + typescript: 5.0.4 zod: 3.21.4 devDependencies: '@jest/globals': 29.5.0 @@ -208,13 +253,13 @@ importers: '@testing-library/dom': 9.2.0 '@testing-library/jest-dom': 5.16.5 '@testing-library/react': 14.0.0_biqbaboplfbrettd7655fr4n2y - '@testing-library/react-hooks': 8.0.1_fjn3d3aefc35pidgaewxy3ws2e + '@testing-library/react-hooks': 8.0.1_j67ni4i6zsa7gdqctpxigdgcuy '@testing-library/user-event': 14.4.3_@testing-library+dom@9.2.0 '@types/cors': 2.8.13 '@types/express': 4.17.17 '@types/jest': 29.5.0 - '@types/node': 18.15.10 - '@types/react': 18.0.29 + '@types/node': 18.15.11 + '@types/react': 18.0.33 '@zodios/axios': link:../axios '@zodios/core': link:../core '@zodios/fetch': link:../fetch @@ -223,16 +268,16 @@ importers: express: 4.18.2 fp-ts: 2.13.1 io-ts: 2.2.20_fp-ts@2.13.1 - jest: 29.5.0_m54q5dse6x3xfnwbnypkikpaee + jest: 29.5.0_rrli7kzx2akox3oq6aahu3rvje jest-environment-jsdom: 29.5.0 react: 18.2.0 react-dom: 18.2.0_react@18.2.0 react-test-renderer: 18.2.0_react@18.2.0 rimraf: 4.4.1 - ts-jest: 29.0.5_63eeh5l64lewq762rxfh3frani - ts-node: 10.9.1_zd7fjxbseldtiwc6h6ujrbvxuy - tsup: 6.7.0_b3krtfsdr4o54pb3ito5mirk64 - typescript: 5.0.2 + ts-jest: 29.1.0_sye3n7rnony6rzpy3o3kwkrynm + ts-node: 10.9.1_bhanhq442dy43ncydsavgi4jfi + tsup: 6.7.0_pyqfhkbboucpxgvrs7ocxwodkm + typescript: 5.0.4 zod: 3.21.4 packages/testing: @@ -240,7 +285,7 @@ importers: '@jest/globals': 29.5.0 '@jest/types': 29.5.0 '@types/jest': 29.5.0 - '@types/node': 18.15.10 + '@types/node': 18.15.11 '@zodios/core': workspace:* '@zodios/fetch': workspace:* form-data: ^4.0.0 @@ -248,27 +293,27 @@ importers: io-ts: 2.2.20 jest: 29.5.0 rimraf: 4.4.1 - ts-jest: 29.0.5 + ts-jest: 29.1.0 ts-node: 10.9.1 tsup: 6.7.0 - typescript: 5.0.2 + typescript: 5.0.4 zod: 3.21.4 devDependencies: '@jest/globals': 29.5.0 '@jest/types': 29.5.0 '@types/jest': 29.5.0 - '@types/node': 18.15.10 + '@types/node': 18.15.11 '@zodios/core': link:../core '@zodios/fetch': link:../fetch form-data: 4.0.0 fp-ts: 2.13.1 io-ts: 2.2.20_fp-ts@2.13.1 - jest: 29.5.0_m54q5dse6x3xfnwbnypkikpaee + jest: 29.5.0_rrli7kzx2akox3oq6aahu3rvje rimraf: 4.4.1 - ts-jest: 29.0.5_63eeh5l64lewq762rxfh3frani - ts-node: 10.9.1_zd7fjxbseldtiwc6h6ujrbvxuy - tsup: 6.7.0_b3krtfsdr4o54pb3ito5mirk64 - typescript: 5.0.2 + ts-jest: 29.1.0_sye3n7rnony6rzpy3o3kwkrynm + ts-node: 10.9.1_bhanhq442dy43ncydsavgi4jfi + tsup: 6.7.0_pyqfhkbboucpxgvrs7ocxwodkm + typescript: 5.0.4 zod: 3.21.4 packages: @@ -277,40 +322,40 @@ packages: resolution: {integrity: sha512-E09FiIft46CmH5Qnjb0wsW54/YQd69LsxeKUOWawmws1XWvyFGURnAChH0mlr7YPFR1ofwvUQfcL0J3lMxXqPA==} dev: true - /@ampproject/remapping/2.2.0: - resolution: {integrity: sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w==} + /@ampproject/remapping/2.2.1: + resolution: {integrity: sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==} engines: {node: '>=6.0.0'} dependencies: - '@jridgewell/gen-mapping': 0.1.1 - '@jridgewell/trace-mapping': 0.3.17 + '@jridgewell/gen-mapping': 0.3.3 + '@jridgewell/trace-mapping': 0.3.18 dev: true - /@babel/code-frame/7.18.6: - resolution: {integrity: sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==} + /@babel/code-frame/7.21.4: + resolution: {integrity: sha512-LYvhNKfwWSPpocw8GI7gpK2nq3HSDuEPC/uSYaALSJu9xjsalaaYFOq0Pwt5KmVqwEbZlDu81aLXwBOmD/Fv9g==} engines: {node: '>=6.9.0'} dependencies: '@babel/highlight': 7.18.6 dev: true - /@babel/compat-data/7.21.0: - resolution: {integrity: sha512-gMuZsmsgxk/ENC3O/fRw5QY8A9/uxQbbCEypnLIiYYc/qVJtEV7ouxC3EllIIwNzMqAQee5tanFabWsUOutS7g==} + /@babel/compat-data/7.21.4: + resolution: {integrity: sha512-/DYyDpeCfaVinT40FPGdkkb+lYSKvsVuMjDAG7jPOWWiM1ibOaB9CXJAlc4d1QpP/U2q2P9jbrSlClKSErd55g==} engines: {node: '>=6.9.0'} dev: true - /@babel/core/7.21.3: - resolution: {integrity: sha512-qIJONzoa/qiHghnm0l1n4i/6IIziDpzqc36FBs4pzMhDUraHqponwJLiAKm1hGLP3OSB/TVNz6rMwVGpwxxySw==} + /@babel/core/7.21.4: + resolution: {integrity: sha512-qt/YV149Jman/6AfmlxJ04LMIu8bMoyl3RB91yTFrxQmgbrSvQMy7cI8Q62FHx1t8wJ8B5fu0UDoLwHAhUo1QA==} engines: {node: '>=6.9.0'} dependencies: - '@ampproject/remapping': 2.2.0 - '@babel/code-frame': 7.18.6 - '@babel/generator': 7.21.3 - '@babel/helper-compilation-targets': 7.20.7_@babel+core@7.21.3 + '@ampproject/remapping': 2.2.1 + '@babel/code-frame': 7.21.4 + '@babel/generator': 7.21.4 + '@babel/helper-compilation-targets': 7.21.4_@babel+core@7.21.4 '@babel/helper-module-transforms': 7.21.2 '@babel/helpers': 7.21.0 - '@babel/parser': 7.21.3 + '@babel/parser': 7.21.4 '@babel/template': 7.20.7 - '@babel/traverse': 7.21.3 - '@babel/types': 7.21.3 + '@babel/traverse': 7.21.4 + '@babel/types': 7.21.4 convert-source-map: 1.9.0 debug: 4.3.4 gensync: 1.0.0-beta.2 @@ -320,24 +365,24 @@ packages: - supports-color dev: true - /@babel/generator/7.21.3: - resolution: {integrity: sha512-QS3iR1GYC/YGUnW7IdggFeN5c1poPUurnGttOV/bZgPGV+izC/D8HnD6DLwod0fsatNyVn1G3EVWMYIF0nHbeA==} + /@babel/generator/7.21.4: + resolution: {integrity: sha512-NieM3pVIYW2SwGzKoqfPrQsf4xGs9M9AIG3ThppsSRmO+m7eQhmI6amajKMUeIO37wFfsvnvcxQFx6x6iqxDnA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.21.3 - '@jridgewell/gen-mapping': 0.3.2 - '@jridgewell/trace-mapping': 0.3.17 + '@babel/types': 7.21.4 + '@jridgewell/gen-mapping': 0.3.3 + '@jridgewell/trace-mapping': 0.3.18 jsesc: 2.5.2 dev: true - /@babel/helper-compilation-targets/7.20.7_@babel+core@7.21.3: - resolution: {integrity: sha512-4tGORmfQcrc+bvrjb5y3dG9Mx1IOZjsHqQVUz7XCNHO+iTmqxWnVg3KRygjGmpRLJGdQSKuvFinbIb0CnZwHAQ==} + /@babel/helper-compilation-targets/7.21.4_@babel+core@7.21.4: + resolution: {integrity: sha512-Fa0tTuOXZ1iL8IeDFUWCzjZcn+sJGd9RZdH9esYVjEejGmzf+FFYQpMi/kZUk2kPy/q1H3/GPw7np8qar/stfg==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/compat-data': 7.21.0 - '@babel/core': 7.21.3 + '@babel/compat-data': 7.21.4 + '@babel/core': 7.21.4 '@babel/helper-validator-option': 7.21.0 browserslist: 4.21.5 lru-cache: 5.1.1 @@ -354,21 +399,21 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/template': 7.20.7 - '@babel/types': 7.21.3 + '@babel/types': 7.21.4 dev: true /@babel/helper-hoist-variables/7.18.6: resolution: {integrity: sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.21.3 + '@babel/types': 7.21.4 dev: true - /@babel/helper-module-imports/7.18.6: - resolution: {integrity: sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA==} + /@babel/helper-module-imports/7.21.4: + resolution: {integrity: sha512-orajc5T2PsRYUN3ZryCEFeMDYwyw09c/pZeaQEZPH0MpKzSvn3e0uXsDBu3k03VI+9DBiRo+l22BfKTpKwa/Wg==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.21.3 + '@babel/types': 7.21.4 dev: true /@babel/helper-module-transforms/7.21.2: @@ -376,13 +421,13 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/helper-environment-visitor': 7.18.9 - '@babel/helper-module-imports': 7.18.6 + '@babel/helper-module-imports': 7.21.4 '@babel/helper-simple-access': 7.20.2 '@babel/helper-split-export-declaration': 7.18.6 '@babel/helper-validator-identifier': 7.19.1 '@babel/template': 7.20.7 - '@babel/traverse': 7.21.3 - '@babel/types': 7.21.3 + '@babel/traverse': 7.21.4 + '@babel/types': 7.21.4 transitivePeerDependencies: - supports-color dev: true @@ -396,14 +441,14 @@ packages: resolution: {integrity: sha512-+0woI/WPq59IrqDYbVGfshjT5Dmk/nnbdpcF8SnMhhXObpTq2KNBdLFRFrkVdbDOyUmHBCxzm5FHV1rACIkIbA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.21.3 + '@babel/types': 7.21.4 dev: true /@babel/helper-split-export-declaration/7.18.6: resolution: {integrity: sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.21.3 + '@babel/types': 7.21.4 dev: true /@babel/helper-string-parser/7.19.4: @@ -426,8 +471,8 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@babel/template': 7.20.7 - '@babel/traverse': 7.21.3 - '@babel/types': 7.21.3 + '@babel/traverse': 7.21.4 + '@babel/types': 7.21.4 transitivePeerDependencies: - supports-color dev: true @@ -441,140 +486,140 @@ packages: js-tokens: 4.0.0 dev: true - /@babel/parser/7.21.3: - resolution: {integrity: sha512-lobG0d7aOfQRXh8AyklEAgZGvA4FShxo6xQbUrrT/cNBPUdIDojlokwJsQyCC/eKia7ifqM0yP+2DRZ4WKw2RQ==} + /@babel/parser/7.21.4: + resolution: {integrity: sha512-alVJj7k7zIxqBZ7BTRhz0IqJFxW1VJbm6N8JbcYhQ186df9ZBPbZBmWSqAMXwHGsCJdYks7z/voa3ibiS5bCIw==} engines: {node: '>=6.0.0'} hasBin: true dependencies: - '@babel/types': 7.21.3 + '@babel/types': 7.21.4 dev: true - /@babel/plugin-syntax-async-generators/7.8.4_@babel+core@7.21.3: + /@babel/plugin-syntax-async-generators/7.8.4_@babel+core@7.21.4: resolution: {integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.21.3 + '@babel/core': 7.21.4 '@babel/helper-plugin-utils': 7.20.2 dev: true - /@babel/plugin-syntax-bigint/7.8.3_@babel+core@7.21.3: + /@babel/plugin-syntax-bigint/7.8.3_@babel+core@7.21.4: resolution: {integrity: sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.21.3 + '@babel/core': 7.21.4 '@babel/helper-plugin-utils': 7.20.2 dev: true - /@babel/plugin-syntax-class-properties/7.12.13_@babel+core@7.21.3: + /@babel/plugin-syntax-class-properties/7.12.13_@babel+core@7.21.4: resolution: {integrity: sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.21.3 + '@babel/core': 7.21.4 '@babel/helper-plugin-utils': 7.20.2 dev: true - /@babel/plugin-syntax-import-meta/7.10.4_@babel+core@7.21.3: + /@babel/plugin-syntax-import-meta/7.10.4_@babel+core@7.21.4: resolution: {integrity: sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.21.3 + '@babel/core': 7.21.4 '@babel/helper-plugin-utils': 7.20.2 dev: true - /@babel/plugin-syntax-json-strings/7.8.3_@babel+core@7.21.3: + /@babel/plugin-syntax-json-strings/7.8.3_@babel+core@7.21.4: resolution: {integrity: sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.21.3 + '@babel/core': 7.21.4 '@babel/helper-plugin-utils': 7.20.2 dev: true - /@babel/plugin-syntax-jsx/7.18.6_@babel+core@7.21.3: - resolution: {integrity: sha512-6mmljtAedFGTWu2p/8WIORGwy+61PLgOMPOdazc7YoJ9ZCWUyFy3A6CpPkRKLKD1ToAesxX8KGEViAiLo9N+7Q==} + /@babel/plugin-syntax-jsx/7.21.4_@babel+core@7.21.4: + resolution: {integrity: sha512-5hewiLct5OKyh6PLKEYaFclcqtIgCb6bmELouxjF6up5q3Sov7rOayW4RwhbaBL0dit8rA80GNfY+UuDp2mBbQ==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.21.3 + '@babel/core': 7.21.4 '@babel/helper-plugin-utils': 7.20.2 dev: true - /@babel/plugin-syntax-logical-assignment-operators/7.10.4_@babel+core@7.21.3: + /@babel/plugin-syntax-logical-assignment-operators/7.10.4_@babel+core@7.21.4: resolution: {integrity: sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.21.3 + '@babel/core': 7.21.4 '@babel/helper-plugin-utils': 7.20.2 dev: true - /@babel/plugin-syntax-nullish-coalescing-operator/7.8.3_@babel+core@7.21.3: + /@babel/plugin-syntax-nullish-coalescing-operator/7.8.3_@babel+core@7.21.4: resolution: {integrity: sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.21.3 + '@babel/core': 7.21.4 '@babel/helper-plugin-utils': 7.20.2 dev: true - /@babel/plugin-syntax-numeric-separator/7.10.4_@babel+core@7.21.3: + /@babel/plugin-syntax-numeric-separator/7.10.4_@babel+core@7.21.4: resolution: {integrity: sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.21.3 + '@babel/core': 7.21.4 '@babel/helper-plugin-utils': 7.20.2 dev: true - /@babel/plugin-syntax-object-rest-spread/7.8.3_@babel+core@7.21.3: + /@babel/plugin-syntax-object-rest-spread/7.8.3_@babel+core@7.21.4: resolution: {integrity: sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.21.3 + '@babel/core': 7.21.4 '@babel/helper-plugin-utils': 7.20.2 dev: true - /@babel/plugin-syntax-optional-catch-binding/7.8.3_@babel+core@7.21.3: + /@babel/plugin-syntax-optional-catch-binding/7.8.3_@babel+core@7.21.4: resolution: {integrity: sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.21.3 + '@babel/core': 7.21.4 '@babel/helper-plugin-utils': 7.20.2 dev: true - /@babel/plugin-syntax-optional-chaining/7.8.3_@babel+core@7.21.3: + /@babel/plugin-syntax-optional-chaining/7.8.3_@babel+core@7.21.4: resolution: {integrity: sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.21.3 + '@babel/core': 7.21.4 '@babel/helper-plugin-utils': 7.20.2 dev: true - /@babel/plugin-syntax-top-level-await/7.14.5_@babel+core@7.21.3: + /@babel/plugin-syntax-top-level-await/7.14.5_@babel+core@7.21.4: resolution: {integrity: sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.21.3 + '@babel/core': 7.21.4 '@babel/helper-plugin-utils': 7.20.2 dev: true - /@babel/plugin-syntax-typescript/7.20.0_@babel+core@7.21.3: - resolution: {integrity: sha512-rd9TkG+u1CExzS4SM1BlMEhMXwFLKVjOAFFCDx9PbX5ycJWDoWMcwdJH9RhkPu1dOgn5TrxLot/Gx6lWFuAUNQ==} + /@babel/plugin-syntax-typescript/7.21.4_@babel+core@7.21.4: + resolution: {integrity: sha512-xz0D39NvhQn4t4RNsHmDnnsaQizIlUkdtYvLs8La1BlfjQ6JEwxkJGeqJMW2tAXx+q6H+WFuUTXNdYVpEya0YA==} engines: {node: '>=6.9.0'} peerDependencies: '@babel/core': ^7.0.0-0 dependencies: - '@babel/core': 7.21.3 + '@babel/core': 7.21.4 '@babel/helper-plugin-utils': 7.20.2 dev: true @@ -589,31 +634,31 @@ packages: resolution: {integrity: sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/code-frame': 7.18.6 - '@babel/parser': 7.21.3 - '@babel/types': 7.21.3 + '@babel/code-frame': 7.21.4 + '@babel/parser': 7.21.4 + '@babel/types': 7.21.4 dev: true - /@babel/traverse/7.21.3: - resolution: {integrity: sha512-XLyopNeaTancVitYZe2MlUEvgKb6YVVPXzofHgqHijCImG33b/uTurMS488ht/Hbsb2XK3U2BnSTxKVNGV3nGQ==} + /@babel/traverse/7.21.4: + resolution: {integrity: sha512-eyKrRHKdyZxqDm+fV1iqL9UAHMoIg0nDaGqfIOd8rKH17m5snv7Gn4qgjBoFfLz9APvjFU/ICT00NVCv1Epp8Q==} engines: {node: '>=6.9.0'} dependencies: - '@babel/code-frame': 7.18.6 - '@babel/generator': 7.21.3 + '@babel/code-frame': 7.21.4 + '@babel/generator': 7.21.4 '@babel/helper-environment-visitor': 7.18.9 '@babel/helper-function-name': 7.21.0 '@babel/helper-hoist-variables': 7.18.6 '@babel/helper-split-export-declaration': 7.18.6 - '@babel/parser': 7.21.3 - '@babel/types': 7.21.3 + '@babel/parser': 7.21.4 + '@babel/types': 7.21.4 debug: 4.3.4 globals: 11.12.0 transitivePeerDependencies: - supports-color dev: true - /@babel/types/7.21.3: - resolution: {integrity: sha512-sBGdETxC+/M4o/zKC0sl6sjWv62WFR/uzxrJ6uYyMLZOUlPnwzw0tKgVHOXxaAd5l2g8pEDM5RZ495GPQI77kg==} + /@babel/types/7.21.4: + resolution: {integrity: sha512-rU2oY501qDxE8Pyo7i/Orqma4ziCOrby0/9mvbDUGEfvZjb279Nk9k19e2fiCxHbRRpY2ZyrgW1eq22mvmOIzA==} engines: {node: '>=6.9.0'} dependencies: '@babel/helper-string-parser': 7.19.4 @@ -1035,7 +1080,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.5.0 - '@types/node': 18.15.10 + '@types/node': 18.15.11 chalk: 4.1.2 jest-message-util: 29.5.0 jest-util: 29.5.0 @@ -1056,14 +1101,14 @@ packages: '@jest/test-result': 29.5.0 '@jest/transform': 29.5.0 '@jest/types': 29.5.0 - '@types/node': 18.15.10 + '@types/node': 18.15.11 ansi-escapes: 4.3.2 chalk: 4.1.2 ci-info: 3.8.0 exit: 0.1.2 graceful-fs: 4.2.11 jest-changed-files: 29.5.0 - jest-config: 29.5.0_m54q5dse6x3xfnwbnypkikpaee + jest-config: 29.5.0_rrli7kzx2akox3oq6aahu3rvje jest-haste-map: 29.5.0 jest-message-util: 29.5.0 jest-regex-util: 29.4.3 @@ -1090,7 +1135,7 @@ packages: dependencies: '@jest/fake-timers': 29.5.0 '@jest/types': 29.5.0 - '@types/node': 18.15.10 + '@types/node': 18.15.11 jest-mock: 29.5.0 dev: true @@ -1117,7 +1162,7 @@ packages: dependencies: '@jest/types': 29.5.0 '@sinonjs/fake-timers': 10.0.2 - '@types/node': 18.15.10 + '@types/node': 18.15.11 jest-message-util: 29.5.0 jest-mock: 29.5.0 jest-util: 29.5.0 @@ -1149,8 +1194,8 @@ packages: '@jest/test-result': 29.5.0 '@jest/transform': 29.5.0 '@jest/types': 29.5.0 - '@jridgewell/trace-mapping': 0.3.17 - '@types/node': 18.15.10 + '@jridgewell/trace-mapping': 0.3.18 + '@types/node': 18.15.11 chalk: 4.1.2 collect-v8-coverage: 1.0.1 exit: 0.1.2 @@ -1183,7 +1228,7 @@ packages: resolution: {integrity: sha512-qyt/mb6rLyd9j1jUts4EQncvS6Yy3PM9HghnNv86QBlV+zdL2inCdK1tuVlL+J+lpiw2BI67qXOrX3UurBqQ1w==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jridgewell/trace-mapping': 0.3.17 + '@jridgewell/trace-mapping': 0.3.18 callsites: 3.1.0 graceful-fs: 4.2.11 dev: true @@ -1212,9 +1257,9 @@ packages: resolution: {integrity: sha512-8vbeZWqLJOvHaDfeMuoHITGKSz5qWc9u04lnWrQE3VyuSw604PzQM824ZeX9XSjUCeDiE3GuxZe5UKa8J61NQw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@babel/core': 7.21.3 + '@babel/core': 7.21.4 '@jest/types': 29.5.0 - '@jridgewell/trace-mapping': 0.3.17 + '@jridgewell/trace-mapping': 0.3.18 babel-plugin-istanbul: 6.1.1 chalk: 4.1.2 convert-source-map: 2.0.0 @@ -1238,30 +1283,27 @@ packages: '@jest/schemas': 29.4.3 '@types/istanbul-lib-coverage': 2.0.4 '@types/istanbul-reports': 3.0.1 - '@types/node': 18.15.10 - '@types/yargs': 17.0.23 + '@types/node': 18.15.11 + '@types/yargs': 17.0.24 chalk: 4.1.2 dev: true - /@jridgewell/gen-mapping/0.1.1: - resolution: {integrity: sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w==} + /@jridgewell/gen-mapping/0.3.3: + resolution: {integrity: sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==} engines: {node: '>=6.0.0'} dependencies: '@jridgewell/set-array': 1.1.2 - '@jridgewell/sourcemap-codec': 1.4.14 + '@jridgewell/sourcemap-codec': 1.4.15 + '@jridgewell/trace-mapping': 0.3.18 dev: true - /@jridgewell/gen-mapping/0.3.2: - resolution: {integrity: sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==} + /@jridgewell/resolve-uri/3.1.0: + resolution: {integrity: sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==} engines: {node: '>=6.0.0'} - dependencies: - '@jridgewell/set-array': 1.1.2 - '@jridgewell/sourcemap-codec': 1.4.14 - '@jridgewell/trace-mapping': 0.3.17 dev: true - /@jridgewell/resolve-uri/3.1.0: - resolution: {integrity: sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==} + /@jridgewell/resolve-uri/3.1.1: + resolution: {integrity: sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==} engines: {node: '>=6.0.0'} dev: true @@ -1274,8 +1316,12 @@ packages: resolution: {integrity: sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==} dev: true - /@jridgewell/trace-mapping/0.3.17: - resolution: {integrity: sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g==} + /@jridgewell/sourcemap-codec/1.4.15: + resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} + dev: true + + /@jridgewell/trace-mapping/0.3.18: + resolution: {integrity: sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==} dependencies: '@jridgewell/resolve-uri': 3.1.0 '@jridgewell/sourcemap-codec': 1.4.14 @@ -1284,8 +1330,8 @@ packages: /@jridgewell/trace-mapping/0.3.9: resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} dependencies: - '@jridgewell/resolve-uri': 3.1.0 - '@jridgewell/sourcemap-codec': 1.4.14 + '@jridgewell/resolve-uri': 3.1.1 + '@jridgewell/sourcemap-codec': 1.4.15 dev: true /@manypkg/find-root/1.1.0: @@ -1371,7 +1417,7 @@ packages: resolution: {integrity: sha512-xTEnpUKiV/bMyEsE5bT4oYA0x0Z/colMtxzUY8bKyPXBNLn/e0V4ZjBZkEhms0xE4pv9QsPfSRu9AWS4y5wGvA==} engines: {node: '>=14'} dependencies: - '@babel/code-frame': 7.18.6 + '@babel/code-frame': 7.21.4 '@babel/runtime': 7.21.0 '@types/aria-query': 5.0.1 aria-query: 5.1.3 @@ -1396,7 +1442,7 @@ packages: redent: 3.0.0 dev: true - /@testing-library/react-hooks/8.0.1_fjn3d3aefc35pidgaewxy3ws2e: + /@testing-library/react-hooks/8.0.1_j67ni4i6zsa7gdqctpxigdgcuy: resolution: {integrity: sha512-Aqhl2IVmLt8IovEVarNDFuJDVWVvhnr9/GCU6UUnrYXwgDFF9h2L2o2P9KBni1AST5sT6riAyoukFLyjQUgD/g==} engines: {node: '>=12'} peerDependencies: @@ -1413,7 +1459,7 @@ packages: optional: true dependencies: '@babel/runtime': 7.21.0 - '@types/react': 18.0.29 + '@types/react': 18.0.33 react: 18.2.0 react-dom: 18.2.0_react@18.2.0 react-error-boundary: 3.1.4_react@18.2.0 @@ -1471,8 +1517,8 @@ packages: /@types/babel__core/7.20.0: resolution: {integrity: sha512-+n8dL/9GWblDO0iU6eZAwEIJVr5DWigtle+Q6HLOrh/pdbXOhOtqzq8VPPE2zvNJzSKY4vH/z3iT3tn0A3ypiQ==} dependencies: - '@babel/parser': 7.21.3 - '@babel/types': 7.21.3 + '@babel/parser': 7.21.4 + '@babel/types': 7.21.4 '@types/babel__generator': 7.6.4 '@types/babel__template': 7.4.1 '@types/babel__traverse': 7.18.3 @@ -1481,33 +1527,33 @@ packages: /@types/babel__generator/7.6.4: resolution: {integrity: sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==} dependencies: - '@babel/types': 7.21.3 + '@babel/types': 7.21.4 dev: true /@types/babel__template/7.4.1: resolution: {integrity: sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==} dependencies: - '@babel/parser': 7.21.3 - '@babel/types': 7.21.3 + '@babel/parser': 7.21.4 + '@babel/types': 7.21.4 dev: true /@types/babel__traverse/7.18.3: resolution: {integrity: sha512-1kbcJ40lLB7MHsj39U4Sh1uTd2E7rLEa79kmDpI6cy+XiXsteB3POdQomoq4FxszMrO3ZYchkhYJw7A2862b3w==} dependencies: - '@babel/types': 7.21.3 + '@babel/types': 7.21.4 dev: true /@types/body-parser/1.19.2: resolution: {integrity: sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==} dependencies: '@types/connect': 3.4.35 - '@types/node': 18.15.10 + '@types/node': 18.15.11 dev: true /@types/connect/3.4.35: resolution: {integrity: sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==} dependencies: - '@types/node': 18.15.10 + '@types/node': 18.15.11 dev: true /@types/cookiejar/2.1.2: @@ -1517,13 +1563,13 @@ packages: /@types/cors/2.8.13: resolution: {integrity: sha512-RG8AStHlUiV5ysZQKq97copd2UmVYw3/pRMLefISZ3S1hK104Cwm7iLQ3fTKx+lsUH2CE8FlLaYeEA2LSeqYUA==} dependencies: - '@types/node': 18.15.10 + '@types/node': 18.15.11 dev: true /@types/express-serve-static-core/4.17.33: resolution: {integrity: sha512-TPBqmR/HRYI3eC2E5hmiivIzv+bidAfXofM+sbonAGvyDhySGw9/PQZFt2BLOrjUUR++4eJVpx6KnLQK1Fk9tA==} dependencies: - '@types/node': 18.15.10 + '@types/node': 18.15.11 '@types/qs': 6.9.7 '@types/range-parser': 1.2.4 dev: true @@ -1540,7 +1586,7 @@ packages: /@types/graceful-fs/4.1.6: resolution: {integrity: sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw==} dependencies: - '@types/node': 18.15.10 + '@types/node': 18.15.11 dev: true /@types/is-ci/3.0.0: @@ -1575,7 +1621,7 @@ packages: /@types/jsdom/20.0.1: resolution: {integrity: sha512-d0r18sZPmMQr1eG35u12FZfhIXNrnsPU/g5wvRKCUf/tOGilKKwYMYGqh33BNR6ba+2gkHw1EUiHoN3mn7E5IQ==} dependencies: - '@types/node': 18.15.10 + '@types/node': 18.15.11 '@types/tough-cookie': 4.0.2 parse5: 7.1.2 dev: true @@ -1598,8 +1644,8 @@ packages: resolution: {integrity: sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==} dev: true - /@types/node/18.15.10: - resolution: {integrity: sha512-9avDaQJczATcXgfmMAW3MIWArOO7A+m90vuCFLr8AotWf8igO/mRoYukrk2cqZVtv38tHs33retzHEilM7FpeQ==} + /@types/node/18.15.11: + resolution: {integrity: sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q==} dev: true /@types/normalize-package-data/2.4.1: @@ -1625,15 +1671,15 @@ packages: /@types/react-dom/18.0.11: resolution: {integrity: sha512-O38bPbI2CWtgw/OoQoY+BRelw7uysmXbWvw3nLWO21H1HSh+GOlqPuXshJfjmpNlKiiSDG9cc1JZAaMmVdcTlw==} dependencies: - '@types/react': 18.0.29 + '@types/react': 18.0.33 dev: true - /@types/react/18.0.29: - resolution: {integrity: sha512-wXHktgUABxplw1+UnljseDq4+uztQyp2tlWZRIxHlpchsCFqiYkvaDS8JR7eKOQm8wziTH/el5qL7D6gYNkYcw==} + /@types/react/18.0.33: + resolution: {integrity: sha512-sHxzVxeanvQyQ1lr8NSHaj0kDzcNiGpILEVt69g9S31/7PfMvNCKLKcsHw4lYKjs3cGNJjXSP4mYzX43QlnjNA==} dependencies: '@types/prop-types': 15.7.5 '@types/scheduler': 0.16.3 - csstype: 3.1.1 + csstype: 3.1.2 dev: true /@types/scheduler/0.16.3: @@ -1648,7 +1694,7 @@ packages: resolution: {integrity: sha512-NUo5XNiAdULrJENtJXZZ3fHtfMolzZwczzBbnAeBbqBwG+LaG6YaJtuwzwGSQZ2wsCrxjEhNNjAkKigy3n8teQ==} dependencies: '@types/mime': 3.0.1 - '@types/node': 18.15.10 + '@types/node': 18.15.11 dev: true /@types/stack-utils/2.0.1: @@ -1659,7 +1705,7 @@ packages: resolution: {integrity: sha512-tLfnlJf6A5mB6ddqF159GqcDizfzbMUB1/DeT59/wBNqzRTNNKsaw79A/1TZ84X+f/EwWH8FeuSkjlCLyqS/zQ==} dependencies: '@types/cookiejar': 2.1.2 - '@types/node': 18.15.10 + '@types/node': 18.15.11 dev: true /@types/supertest/2.0.12: @@ -1668,6 +1714,13 @@ packages: '@types/superagent': 4.1.16 dev: true + /@types/swagger-ui-express/4.1.3: + resolution: {integrity: sha512-jqCjGU/tGEaqIplPy3WyQg+Nrp6y80DCFnDEAvVKWkJyv0VivSSDCChkppHRHAablvInZe6pijDFMnavtN0vqA==} + dependencies: + '@types/express': 4.17.17 + '@types/serve-static': 1.15.1 + dev: true + /@types/testing-library__jest-dom/5.14.5: resolution: {integrity: sha512-SBwbxYoyPIvxHbeHxTZX2Pe/74F/tX2/D3mMvzabdeJ25bBojfW0TyB8BHrbq/9zaaKICJZjLP+8r6AeZMFCuQ==} dependencies: @@ -1682,8 +1735,8 @@ packages: resolution: {integrity: sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==} dev: true - /@types/yargs/17.0.23: - resolution: {integrity: sha512-yuogunc04OnzGQCrfHx+Kk883Q4X0aSwmYZhKjI21m+SVYzjIbrWl8dOOwSv5hf2Um2pdCOXWo9isteZTNXUZQ==} + /@types/yargs/17.0.24: + resolution: {integrity: sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==} dependencies: '@types/yargs-parser': 21.0.0 dev: true @@ -1839,8 +1892,8 @@ packages: engines: {node: '>= 0.4'} dev: true - /axios/1.3.4: - resolution: {integrity: sha512-toYm+Bsyl6VC5wSkfkbbNB6ROv7KY93PEBBL6xyDczaIHasAiv4wPqQ/c4RjoQzipxRD2W5g21cOqQulZ7rHwQ==} + /axios/1.3.5: + resolution: {integrity: sha512-glL/PvG/E+xCWwV8S6nCHcrfg1exGx7vxyUIivIA1iL7BIh6bePylCfVHwp6k13ao7SATxB6imau2kqY+I67kw==} dependencies: follow-redirects: 1.15.2 form-data: 4.0.0 @@ -1849,17 +1902,17 @@ packages: - debug dev: true - /babel-jest/29.5.0_@babel+core@7.21.3: + /babel-jest/29.5.0_@babel+core@7.21.4: resolution: {integrity: sha512-mA4eCDh5mSo2EcA9xQjVTpmbbNk32Zb3Q3QFQsNhaK56Q+yoXowzFodLux30HRgyOho5rsQ6B0P9QpMkvvnJ0Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: '@babel/core': ^7.8.0 dependencies: - '@babel/core': 7.21.3 + '@babel/core': 7.21.4 '@jest/transform': 29.5.0 '@types/babel__core': 7.20.0 babel-plugin-istanbul: 6.1.1 - babel-preset-jest: 29.5.0_@babel+core@7.21.3 + babel-preset-jest: 29.5.0_@babel+core@7.21.4 chalk: 4.1.2 graceful-fs: 4.2.11 slash: 3.0.0 @@ -1885,40 +1938,40 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@babel/template': 7.20.7 - '@babel/types': 7.21.3 + '@babel/types': 7.21.4 '@types/babel__core': 7.20.0 '@types/babel__traverse': 7.18.3 dev: true - /babel-preset-current-node-syntax/1.0.1_@babel+core@7.21.3: + /babel-preset-current-node-syntax/1.0.1_@babel+core@7.21.4: resolution: {integrity: sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.21.3 - '@babel/plugin-syntax-async-generators': 7.8.4_@babel+core@7.21.3 - '@babel/plugin-syntax-bigint': 7.8.3_@babel+core@7.21.3 - '@babel/plugin-syntax-class-properties': 7.12.13_@babel+core@7.21.3 - '@babel/plugin-syntax-import-meta': 7.10.4_@babel+core@7.21.3 - '@babel/plugin-syntax-json-strings': 7.8.3_@babel+core@7.21.3 - '@babel/plugin-syntax-logical-assignment-operators': 7.10.4_@babel+core@7.21.3 - '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3_@babel+core@7.21.3 - '@babel/plugin-syntax-numeric-separator': 7.10.4_@babel+core@7.21.3 - '@babel/plugin-syntax-object-rest-spread': 7.8.3_@babel+core@7.21.3 - '@babel/plugin-syntax-optional-catch-binding': 7.8.3_@babel+core@7.21.3 - '@babel/plugin-syntax-optional-chaining': 7.8.3_@babel+core@7.21.3 - '@babel/plugin-syntax-top-level-await': 7.14.5_@babel+core@7.21.3 - dev: true - - /babel-preset-jest/29.5.0_@babel+core@7.21.3: + '@babel/core': 7.21.4 + '@babel/plugin-syntax-async-generators': 7.8.4_@babel+core@7.21.4 + '@babel/plugin-syntax-bigint': 7.8.3_@babel+core@7.21.4 + '@babel/plugin-syntax-class-properties': 7.12.13_@babel+core@7.21.4 + '@babel/plugin-syntax-import-meta': 7.10.4_@babel+core@7.21.4 + '@babel/plugin-syntax-json-strings': 7.8.3_@babel+core@7.21.4 + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4_@babel+core@7.21.4 + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3_@babel+core@7.21.4 + '@babel/plugin-syntax-numeric-separator': 7.10.4_@babel+core@7.21.4 + '@babel/plugin-syntax-object-rest-spread': 7.8.3_@babel+core@7.21.4 + '@babel/plugin-syntax-optional-catch-binding': 7.8.3_@babel+core@7.21.4 + '@babel/plugin-syntax-optional-chaining': 7.8.3_@babel+core@7.21.4 + '@babel/plugin-syntax-top-level-await': 7.14.5_@babel+core@7.21.4 + dev: true + + /babel-preset-jest/29.5.0_@babel+core@7.21.4: resolution: {integrity: sha512-JOMloxOqdiBSxMAzjRaH023/vvcaSaec49zvg+2LmNsktC7ei39LTJGw02J+9uUtTZUq6xbLyJ4dxe9sSmIuAg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: '@babel/core': ^7.0.0 dependencies: - '@babel/core': 7.21.3 + '@babel/core': 7.21.4 babel-plugin-jest-hoist: 29.5.0 - babel-preset-current-node-syntax: 1.0.1_@babel+core@7.21.3 + babel-preset-current-node-syntax: 1.0.1_@babel+core@7.21.4 dev: true /balanced-match/1.0.2: @@ -1988,8 +2041,8 @@ packages: engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true dependencies: - caniuse-lite: 1.0.30001470 - electron-to-chromium: 1.4.340 + caniuse-lite: 1.0.30001476 + electron-to-chromium: 1.4.356 node-releases: 2.0.10 update-browserslist-db: 1.0.10_browserslist@4.21.5 dev: true @@ -2069,8 +2122,8 @@ packages: engines: {node: '>=10'} dev: true - /caniuse-lite/1.0.30001470: - resolution: {integrity: sha512-065uNwY6QtHCBOExzbV6m236DDhYCCtPmQUCoQtwkVqzud8v5QPidoMr6CoMkC2nfp6nksjttqWQRRh75LqUmA==} + /caniuse-lite/1.0.30001476: + resolution: {integrity: sha512-JmpktFppVSvyUN4gsLS0bShY2L9ZUslHLE72vgemBkS43JD2fOvKTKs+GtRwuxrtRGnwJFW0ye7kWRRlLJS9vQ==} dev: true /chalk/2.4.2: @@ -2306,8 +2359,8 @@ packages: cssom: 0.3.8 dev: true - /csstype/3.1.1: - resolution: {integrity: sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==} + /csstype/3.1.2: + resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} dev: true /csv-generate/3.4.3: @@ -2494,8 +2547,8 @@ packages: resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} dev: true - /electron-to-chromium/1.4.340: - resolution: {integrity: sha512-zx8hqumOqltKsv/MF50yvdAlPF9S/4PXbyfzJS6ZGhbddGkRegdwImmfSVqCkEziYzrIGZ/TlrzBND4FysfkDg==} + /electron-to-chromium/1.4.356: + resolution: {integrity: sha512-nEftV1dRX3omlxAj42FwqRZT0i4xd2dIg39sog/CnCJeCcL1TRd2Uh0i9Oebgv8Ou0vzTPw++xc+Z20jzS2B6A==} dev: true /emittery/0.13.1: @@ -3015,12 +3068,12 @@ packages: path-is-absolute: 1.0.1 dev: true - /glob/9.3.2: - resolution: {integrity: sha512-BTv/JhKXFEHsErMte/AnfiSv8yYOLLiyH2lTg8vn02O21zWFgHPTfxtgn1QRe7NRgggUhC8hacR2Re94svHqeA==} + /glob/9.3.4: + resolution: {integrity: sha512-qaSc49hojMOv1EPM4EuyITjDSgSKI0rthoHnvE81tcOi1SCVndHko7auqxdQ14eiQG2NDBJBE86+2xIrbIvrbA==} engines: {node: '>=16 || 14 >=14.17'} dependencies: fs.realpath: 1.0.0 - minimatch: 7.4.3 + minimatch: 8.0.3 minipass: 4.2.5 path-scurry: 1.6.3 dev: true @@ -3460,8 +3513,8 @@ packages: resolution: {integrity: sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==} engines: {node: '>=8'} dependencies: - '@babel/core': 7.21.3 - '@babel/parser': 7.21.3 + '@babel/core': 7.21.4 + '@babel/parser': 7.21.4 '@istanbuljs/schema': 0.1.3 istanbul-lib-coverage: 3.2.0 semver: 6.3.0 @@ -3513,7 +3566,7 @@ packages: '@jest/expect': 29.5.0 '@jest/test-result': 29.5.0 '@jest/types': 29.5.0 - '@types/node': 18.15.10 + '@types/node': 18.15.11 chalk: 4.1.2 co: 4.6.0 dedent: 0.7.0 @@ -3533,7 +3586,7 @@ packages: - supports-color dev: true - /jest-cli/29.5.0_m54q5dse6x3xfnwbnypkikpaee: + /jest-cli/29.5.0_rrli7kzx2akox3oq6aahu3rvje: resolution: {integrity: sha512-L1KcP1l4HtfwdxXNFCL5bmUbLQiKrakMUriBEcc1Vfz6gx31ORKdreuWvmQVBit+1ss9NNR3yxjwfwzZNdQXJw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -3550,7 +3603,7 @@ packages: exit: 0.1.2 graceful-fs: 4.2.11 import-local: 3.1.0 - jest-config: 29.5.0_m54q5dse6x3xfnwbnypkikpaee + jest-config: 29.5.0_rrli7kzx2akox3oq6aahu3rvje jest-util: 29.5.0 jest-validate: 29.5.0 prompts: 2.4.2 @@ -3561,7 +3614,7 @@ packages: - ts-node dev: true - /jest-config/29.5.0_m54q5dse6x3xfnwbnypkikpaee: + /jest-config/29.5.0_rrli7kzx2akox3oq6aahu3rvje: resolution: {integrity: sha512-kvDUKBnNJPNBmFFOhDbm59iu1Fii1Q6SxyhXfvylq3UTHbg6o7j/g8k2dZyXWLvfdKB1vAPxNZnMgtKJcmu3kA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: @@ -3573,11 +3626,11 @@ packages: ts-node: optional: true dependencies: - '@babel/core': 7.21.3 + '@babel/core': 7.21.4 '@jest/test-sequencer': 29.5.0 '@jest/types': 29.5.0 - '@types/node': 18.15.10 - babel-jest: 29.5.0_@babel+core@7.21.3 + '@types/node': 18.15.11 + babel-jest: 29.5.0_@babel+core@7.21.4 chalk: 4.1.2 ci-info: 3.8.0 deepmerge: 4.3.1 @@ -3596,7 +3649,7 @@ packages: pretty-format: 29.5.0 slash: 3.0.0 strip-json-comments: 3.1.1 - ts-node: 10.9.1_zd7fjxbseldtiwc6h6ujrbvxuy + ts-node: 10.9.1_bhanhq442dy43ncydsavgi4jfi transitivePeerDependencies: - supports-color dev: true @@ -3642,7 +3695,7 @@ packages: '@jest/fake-timers': 29.5.0 '@jest/types': 29.5.0 '@types/jsdom': 20.0.1 - '@types/node': 18.15.10 + '@types/node': 18.15.11 jest-mock: 29.5.0 jest-util: 29.5.0 jsdom: 20.0.3 @@ -3659,7 +3712,7 @@ packages: '@jest/environment': 29.5.0 '@jest/fake-timers': 29.5.0 '@jest/types': 29.5.0 - '@types/node': 18.15.10 + '@types/node': 18.15.11 jest-mock: 29.5.0 jest-util: 29.5.0 dev: true @@ -3675,7 +3728,7 @@ packages: dependencies: '@jest/types': 29.5.0 '@types/graceful-fs': 4.1.6 - '@types/node': 18.15.10 + '@types/node': 18.15.11 anymatch: 3.1.3 fb-watchman: 2.0.2 graceful-fs: 4.2.11 @@ -3710,7 +3763,7 @@ packages: resolution: {integrity: sha512-Kijeg9Dag6CKtIDA7O21zNTACqD5MD/8HfIV8pdD94vFyFuer52SigdC3IQMhab3vACxXMiFk+yMHNdbqtyTGA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@babel/code-frame': 7.18.6 + '@babel/code-frame': 7.21.4 '@jest/types': 29.5.0 '@types/stack-utils': 2.0.1 chalk: 4.1.2 @@ -3726,7 +3779,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.5.0 - '@types/node': 18.15.10 + '@types/node': 18.15.11 jest-util: 29.5.0 dev: true @@ -3767,7 +3820,7 @@ packages: jest-pnp-resolver: 1.2.3_jest-resolve@29.5.0 jest-util: 29.5.0 jest-validate: 29.5.0 - resolve: 1.22.1 + resolve: 1.22.2 resolve.exports: 2.0.2 slash: 3.0.0 dev: true @@ -3781,7 +3834,7 @@ packages: '@jest/test-result': 29.5.0 '@jest/transform': 29.5.0 '@jest/types': 29.5.0 - '@types/node': 18.15.10 + '@types/node': 18.15.11 chalk: 4.1.2 emittery: 0.13.1 graceful-fs: 4.2.11 @@ -3812,7 +3865,7 @@ packages: '@jest/test-result': 29.5.0 '@jest/transform': 29.5.0 '@jest/types': 29.5.0 - '@types/node': 18.15.10 + '@types/node': 18.15.11 chalk: 4.1.2 cjs-module-lexer: 1.2.2 collect-v8-coverage: 1.0.1 @@ -3835,18 +3888,18 @@ packages: resolution: {integrity: sha512-x7Wolra5V0tt3wRs3/ts3S6ciSQVypgGQlJpz2rsdQYoUKxMxPNaoHMGJN6qAuPJqS+2iQ1ZUn5kl7HCyls84g==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@babel/core': 7.21.3 - '@babel/generator': 7.21.3 - '@babel/plugin-syntax-jsx': 7.18.6_@babel+core@7.21.3 - '@babel/plugin-syntax-typescript': 7.20.0_@babel+core@7.21.3 - '@babel/traverse': 7.21.3 - '@babel/types': 7.21.3 + '@babel/core': 7.21.4 + '@babel/generator': 7.21.4 + '@babel/plugin-syntax-jsx': 7.21.4_@babel+core@7.21.4 + '@babel/plugin-syntax-typescript': 7.21.4_@babel+core@7.21.4 + '@babel/traverse': 7.21.4 + '@babel/types': 7.21.4 '@jest/expect-utils': 29.5.0 '@jest/transform': 29.5.0 '@jest/types': 29.5.0 '@types/babel__traverse': 7.18.3 '@types/prettier': 2.7.2 - babel-preset-current-node-syntax: 1.0.1_@babel+core@7.21.3 + babel-preset-current-node-syntax: 1.0.1_@babel+core@7.21.4 chalk: 4.1.2 expect: 29.5.0 graceful-fs: 4.2.11 @@ -3867,7 +3920,7 @@ packages: engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@jest/types': 29.5.0 - '@types/node': 18.15.10 + '@types/node': 18.15.11 chalk: 4.1.2 ci-info: 3.8.0 graceful-fs: 4.2.11 @@ -3892,7 +3945,7 @@ packages: dependencies: '@jest/test-result': 29.5.0 '@jest/types': 29.5.0 - '@types/node': 18.15.10 + '@types/node': 18.15.11 ansi-escapes: 4.3.2 chalk: 4.1.2 emittery: 0.13.1 @@ -3904,13 +3957,13 @@ packages: resolution: {integrity: sha512-NcrQnevGoSp4b5kg+akIpthoAFHxPBcb5P6mYPY0fUNT+sSvmtu6jlkEle3anczUKIKEbMxFimk9oTP/tpIPgA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@types/node': 18.15.10 + '@types/node': 18.15.11 jest-util: 29.5.0 merge-stream: 2.0.0 supports-color: 8.1.1 dev: true - /jest/29.5.0_m54q5dse6x3xfnwbnypkikpaee: + /jest/29.5.0_rrli7kzx2akox3oq6aahu3rvje: resolution: {integrity: sha512-juMg3he2uru1QoXX078zTa7pO85QyB9xajZc6bU+d9yEGwrKX6+vGmJQ3UdVZsvTEUARIdObzH68QItim6OSSQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -3923,7 +3976,7 @@ packages: '@jest/core': 29.5.0_ts-node@10.9.1 '@jest/types': 29.5.0 import-local: 3.1.0 - jest-cli: 29.5.0_m54q5dse6x3xfnwbnypkikpaee + jest-cli: 29.5.0_rrli7kzx2akox3oq6aahu3rvje transitivePeerDependencies: - '@types/node' - supports-color @@ -3970,7 +4023,7 @@ packages: http-proxy-agent: 5.0.0 https-proxy-agent: 5.0.1 is-potential-custom-element-name: 1.0.1 - nwsapi: 2.2.2 + nwsapi: 2.2.3 parse5: 7.1.2 saxes: 6.0.0 symbol-tree: 3.2.4 @@ -4244,9 +4297,9 @@ packages: brace-expansion: 1.1.11 dev: true - /minimatch/7.4.3: - resolution: {integrity: sha512-5UB4yYusDtkRPbRiy1cqZ1IpGNcJCGlEMG17RKzPddpyiPKoCdwohbED8g4QXT0ewCt8LTkQXuljsUfQ3FKM4A==} - engines: {node: '>=10'} + /minimatch/8.0.3: + resolution: {integrity: sha512-tEEvU9TkZgnFDCtpnrEYnPsjT7iUx42aXfs4bzmQ5sMA09/6hZY0jeZcGkXyDagiBOvkUjNo8Viom+Me6+2x7g==} + engines: {node: '>=16 || 14 >=14.17'} dependencies: brace-expansion: 2.0.1 dev: true @@ -4347,7 +4400,7 @@ packages: resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} dependencies: hosted-git-info: 2.8.9 - resolve: 1.22.1 + resolve: 1.22.2 semver: 5.7.1 validate-npm-package-license: 3.0.4 dev: true @@ -4364,8 +4417,8 @@ packages: path-key: 3.1.1 dev: true - /nwsapi/2.2.2: - resolution: {integrity: sha512-90yv+6538zuvUMnN+zCr8LuV6bPFdq50304114vJYJ8RDyK8D5O9Phpbd6SZWgI7PwzmmfN1upeOJlvybDSgCw==} + /nwsapi/2.2.3: + resolution: {integrity: sha512-jscxIO4/VKScHlbmFBdV1Z6LXnLO+ZR4VMtypudUdfwtKxUN3TQcNFIHLwKtrUbDyHN4/GycY9+oRGZ2XMXYPw==} dev: true /object-assign/4.1.1: @@ -4420,6 +4473,10 @@ packages: mimic-fn: 2.1.0 dev: true + /openapi-types/12.1.0: + resolution: {integrity: sha512-XpeCy01X6L5EpP+6Hc3jWN7rMZJ+/k1lwki/kTmWzbVhdPie3jd5O2ZtedEx8Yp58icJ0osVldLMrTB/zslQXA==} + dev: false + /optionator/0.8.3: resolution: {integrity: sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==} engines: {node: '>= 0.8.0'} @@ -4490,7 +4547,7 @@ packages: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} engines: {node: '>=8'} dependencies: - '@babel/code-frame': 7.18.6 + '@babel/code-frame': 7.21.4 error-ex: 1.3.2 json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 @@ -4582,7 +4639,7 @@ packages: optional: true dependencies: lilconfig: 2.1.0 - ts-node: 10.9.1_zd7fjxbseldtiwc6h6ujrbvxuy + ts-node: 10.9.1_bhanhq442dy43ncydsavgi4jfi yaml: 1.10.2 dev: true @@ -4863,8 +4920,8 @@ packages: engines: {node: '>=10'} dev: true - /resolve/1.22.1: - resolution: {integrity: sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==} + /resolve/1.22.2: + resolution: {integrity: sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==} hasBin: true dependencies: is-core-module: 2.11.0 @@ -4882,7 +4939,7 @@ packages: engines: {node: '>=14'} hasBin: true dependencies: - glob: 9.3.2 + glob: 9.3.4 dev: true /rollup/3.20.2: @@ -5213,11 +5270,12 @@ packages: engines: {node: '>=8'} dev: true - /sucrase/3.30.0: - resolution: {integrity: sha512-7d37d3vLF0IeH2dzvHpzDNDxUqpbDHJXTJOAnQ8jvMW04o2Czps6mxtaSnKWpE+hUS/eczqfWPUgQTrazKZPnQ==} + /sucrase/3.32.0: + resolution: {integrity: sha512-ydQOU34rpSyj2TGyz4D2p8rbktIOZ8QY9s+DGLvFU1i5pWJE8vkpruCjGCMHsdXwnD7JDcS+noSwM/a7zyNFDQ==} engines: {node: '>=8'} hasBin: true dependencies: + '@jridgewell/gen-mapping': 0.3.3 commander: 4.1.1 glob: 7.1.6 lines-and-columns: 1.2.4 @@ -5280,6 +5338,20 @@ packages: engines: {node: '>= 0.4'} dev: true + /swagger-ui-dist/4.18.2: + resolution: {integrity: sha512-oVBoBl9Dg+VJw8uRWDxlyUyHoNEDC0c1ysT6+Boy6CTgr2rUcLcfPon4RvxgS2/taNW6O0+US+Z/dlAsWFjOAQ==} + dev: true + + /swagger-ui-express/4.6.2_express@4.18.2: + resolution: {integrity: sha512-MHIOaq9JrTTB3ygUJD+08PbjM5Tt/q7x80yz9VTFIatw8j5uIWKcr90S0h5NLMzFEDC6+eVprtoeA5MDZXCUKQ==} + engines: {node: '>= v0.10.32'} + peerDependencies: + express: '>=4.0.0' + dependencies: + express: 4.18.2 + swagger-ui-dist: 4.18.2 + dev: true + /symbol-tree/3.2.4: resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==} dev: true @@ -5380,8 +5452,8 @@ packages: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} dev: true - /ts-jest/29.0.5_63eeh5l64lewq762rxfh3frani: - resolution: {integrity: sha512-PL3UciSgIpQ7f6XjVOmbi96vmDHUqAyqDr8YxzopDqX3kfgYtX1cuNeBjP+L9sFXi6nzsGGA6R3fP3DDDJyrxA==} + /ts-jest/29.1.0_sye3n7rnony6rzpy3o3kwkrynm: + resolution: {integrity: sha512-ZhNr7Z4PcYa+JjMl62ir+zPiNJfXJN6E8hSLnaUKhOgqcn8vb3e537cpkd0FuAfRK3sR1LSqM1MOhliXNgOFPA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true peerDependencies: @@ -5390,7 +5462,7 @@ packages: babel-jest: ^29.0.0 esbuild: '*' jest: ^29.0.0 - typescript: '>=4.3' + typescript: '>=4.3 <6' peerDependenciesMeta: '@babel/core': optional: true @@ -5404,17 +5476,17 @@ packages: '@jest/types': 29.5.0 bs-logger: 0.2.6 fast-json-stable-stringify: 2.1.0 - jest: 29.5.0_m54q5dse6x3xfnwbnypkikpaee + jest: 29.5.0_rrli7kzx2akox3oq6aahu3rvje jest-util: 29.5.0 json5: 2.2.3 lodash.memoize: 4.1.2 make-error: 1.3.6 semver: 7.3.8 - typescript: 5.0.2 + typescript: 5.0.4 yargs-parser: 21.1.1 dev: true - /ts-node/10.9.1_zd7fjxbseldtiwc6h6ujrbvxuy: + /ts-node/10.9.1_bhanhq442dy43ncydsavgi4jfi: resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true peerDependencies: @@ -5433,19 +5505,19 @@ packages: '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.3 - '@types/node': 18.15.10 + '@types/node': 18.15.11 acorn: 8.8.2 acorn-walk: 8.2.0 arg: 4.1.3 create-require: 1.1.1 diff: 4.0.2 make-error: 1.3.6 - typescript: 5.0.2 + typescript: 5.0.4 v8-compile-cache-lib: 3.0.1 yn: 3.1.1 dev: true - /tsup/6.7.0_b3krtfsdr4o54pb3ito5mirk64: + /tsup/6.7.0_pyqfhkbboucpxgvrs7ocxwodkm: resolution: {integrity: sha512-L3o8hGkaHnu5TdJns+mCqFsDBo83bJ44rlK7e6VdanIvpea4ArPcU3swWGsLVbXak1PqQx/V+SSmFPujBK+zEQ==} engines: {node: '>=14.18'} hasBin: true @@ -5473,9 +5545,9 @@ packages: resolve-from: 5.0.0 rollup: 3.20.2 source-map: 0.8.0-beta.0 - sucrase: 3.30.0 + sucrase: 3.32.0 tree-kill: 1.2.2 - typescript: 5.0.2 + typescript: 5.0.4 transitivePeerDependencies: - supports-color - ts-node @@ -5495,65 +5567,65 @@ packages: yargs: 17.7.1 dev: true - /turbo-darwin-64/1.8.5: - resolution: {integrity: sha512-CAYh56bzeHfnh7jTm03r29bh8p5a/EjQo1Id5yLUH7hS7msTau/+YpxJWPodLbN0UQsUYivUqHQkglJ+eMJ7xA==} + /turbo-darwin-64/1.8.8: + resolution: {integrity: sha512-18cSeIm7aeEvIxGyq7PVoFyEnPpWDM/0CpZvXKHpQ6qMTkfNt517qVqUTAwsIYqNS8xazcKAqkNbvU1V49n65Q==} cpu: [x64] os: [darwin] requiresBuild: true dev: true optional: true - /turbo-darwin-arm64/1.8.5: - resolution: {integrity: sha512-R3jCPOv+lu3dcvMhj8b/Defv6dyUwX6W+tbX7d6YUCA46Plf/bGCQ8+MSbxmr/4E1GyGOVFsn1wRfiYk0us/Dg==} + /turbo-darwin-arm64/1.8.8: + resolution: {integrity: sha512-ruGRI9nHxojIGLQv1TPgN7ud4HO4V8mFBwSgO6oDoZTNuk5ybWybItGR+yu6fni5vJoyMHXOYA2srnxvOc7hjQ==} cpu: [arm64] os: [darwin] requiresBuild: true dev: true optional: true - /turbo-linux-64/1.8.5: - resolution: {integrity: sha512-YRc/KNRZeUVvth11UO4SDQZR2IqGgl9MSsbzqoHuFz4B4Q5QXH7onHogv9aXWE/BZBBbcrSBTlwBSG0Gg+J8hg==} + /turbo-linux-64/1.8.8: + resolution: {integrity: sha512-N/GkHTHeIQogXB1/6ZWfxHx+ubYeb8Jlq3b/3jnU4zLucpZzTQ8XkXIAfJG/TL3Q7ON7xQ8yGOyGLhHL7MpFRg==} cpu: [x64] os: [linux] requiresBuild: true dev: true optional: true - /turbo-linux-arm64/1.8.5: - resolution: {integrity: sha512-8exVZb7XBl/V3gHSweuUyG2D9IzfWqwLvlXoeLWlVYSj61Ajgdv+WU7lvUmx+H2s+sSKqmIFmewA5Lw6YY37sg==} + /turbo-linux-arm64/1.8.8: + resolution: {integrity: sha512-hKqLbBHgUkYf2Ww8uBL9UYdBFQ5677a7QXdsFhONXoACbDUPvpK4BKlz3NN7G4NZ+g9dGju+OJJjQP0VXRHb5w==} cpu: [arm64] os: [linux] requiresBuild: true dev: true optional: true - /turbo-windows-64/1.8.5: - resolution: {integrity: sha512-fA8PU5ZNoFnQkapG06WiEqfsVQ5wbIPkIqTwUsd/M2Lp+KgxE79SQbuEI+2vQ9SmwM5qoMi515IPjgvXAJXgCw==} + /turbo-windows-64/1.8.8: + resolution: {integrity: sha512-2ndjDJyzkNslXxLt+PQuU21AHJWc8f6MnLypXy3KsN4EyX/uKKGZS0QJWz27PeHg0JS75PVvhfFV+L9t9i+Yyg==} cpu: [x64] os: [win32] requiresBuild: true dev: true optional: true - /turbo-windows-arm64/1.8.5: - resolution: {integrity: sha512-SW/NvIdhckLsAWjU/iqBbCB0S8kXupKscUK3kEW1DZIr3MYcP/yIuaE/IdPuqcoF3VP0I3TLD4VTYCCKAo3tKA==} + /turbo-windows-arm64/1.8.8: + resolution: {integrity: sha512-xCA3oxgmW9OMqpI34AAmKfOVsfDljhD5YBwgs0ZDsn5h3kCHhC4x9W5dDk1oyQ4F5EXSH3xVym5/xl1J6WRpUg==} cpu: [arm64] os: [win32] requiresBuild: true dev: true optional: true - /turbo/1.8.5: - resolution: {integrity: sha512-UBnH2wIFb5g6OQCk8f34Ud15ZXV4xEMmugeDJTU5Ur2LpVRsNEny0isSCYdb3Iu3howoNyyXmtpaxWsAwNYkkg==} + /turbo/1.8.8: + resolution: {integrity: sha512-qYJ5NjoTX+591/x09KgsDOPVDUJfU9GoS+6jszQQlLp1AHrf1wRFA3Yps8U+/HTG03q0M4qouOfOLtRQP4QypA==} hasBin: true requiresBuild: true optionalDependencies: - turbo-darwin-64: 1.8.5 - turbo-darwin-arm64: 1.8.5 - turbo-linux-64: 1.8.5 - turbo-linux-arm64: 1.8.5 - turbo-windows-64: 1.8.5 - turbo-windows-arm64: 1.8.5 + turbo-darwin-64: 1.8.8 + turbo-darwin-arm64: 1.8.8 + turbo-linux-64: 1.8.8 + turbo-linux-arm64: 1.8.8 + turbo-windows-64: 1.8.8 + turbo-windows-arm64: 1.8.8 dev: true /type-check/0.3.2: @@ -5608,8 +5680,8 @@ packages: resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} dev: true - /typescript/5.0.2: - resolution: {integrity: sha512-wVORMBGO/FAs/++blGNeAVdbNKtIh1rbBL2EyQ1+J9lClJ93KiiKe8PmFIVdXhHcyv44SL9oglmfeSsndo0jRw==} + /typescript/5.0.4: + resolution: {integrity: sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==} engines: {node: '>=12.20'} hasBin: true dev: true @@ -5681,7 +5753,7 @@ packages: resolution: {integrity: sha512-6z3GW9x8G1gd+JIIgQQQxXuiJtCXeAjp6RaPEPLv62mH3iPHPxV6W3robxtCzNErRo6ZwTmzWhsbNvjyEBKzKA==} engines: {node: '>=10.12.0'} dependencies: - '@jridgewell/trace-mapping': 0.3.17 + '@jridgewell/trace-mapping': 0.3.18 '@types/istanbul-lib-coverage': 2.0.4 convert-source-map: 1.9.0 dev: true @@ -5964,6 +6036,13 @@ packages: engines: {node: '>=10'} dev: true + /zod-to-json-schema/3.20.4_zod@3.21.4: + resolution: {integrity: sha512-Un9+kInJ2Zt63n6Z7mLqBifzzPcOyX+b+Exuzf7L1+xqck9Q2EPByyTRduV3kmSPaXaRer1JCsucubpgL1fipg==} + peerDependencies: + zod: ^3.20.0 + dependencies: + zod: 3.21.4 + dev: false + /zod/3.21.4: resolution: {integrity: sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw==} - dev: true From 34e4a4151d7734bb2a68ae8098841f44df704adc Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sun, 9 Apr 2023 20:07:58 +0200 Subject: [PATCH 131/206] RELEASING: Releasing 7 package(s) Releases: @zodios/express@11.0.0-beta.19 @zodios/openapi@11.0.0-beta.19 @zodios/testing@11.0.0-beta.19 @zodios/axios@11.0.0-beta.19 @zodios/fetch@11.0.0-beta.19 @zodios/react@11.0.0-beta.19 @zodios/core@11.0.0-beta.19 [skip ci] --- packages/axios/CHANGELOG.md | 11 +++++++++++ packages/axios/package.json | 4 ++-- packages/core/CHANGELOG.md | 6 ++++++ packages/core/package.json | 2 +- packages/express/CHANGELOG.md | 11 +++++++++++ packages/express/package.json | 4 ++-- packages/fetch/CHANGELOG.md | 11 +++++++++++ packages/fetch/package.json | 4 ++-- packages/openapi/CHANGELOG.md | 12 ++++++++++++ packages/openapi/package.json | 4 ++-- packages/react/CHANGELOG.md | 13 +++++++++++++ packages/react/package.json | 8 ++++---- packages/testing/CHANGELOG.md | 11 +++++++++++ packages/testing/package.json | 4 ++-- 14 files changed, 90 insertions(+), 15 deletions(-) create mode 100644 packages/openapi/CHANGELOG.md diff --git a/packages/axios/CHANGELOG.md b/packages/axios/CHANGELOG.md index 49613dd8..eb55e9c1 100644 --- a/packages/axios/CHANGELOG.md +++ b/packages/axios/CHANGELOG.md @@ -1,5 +1,16 @@ # @zodios/core +## 11.0.0-beta.19 + +### Major Changes + +- 583775e: feat(openapi): add openapi + +### Patch Changes + +- Updated dependencies [583775e] + - @zodios/core@11.0.0-beta.19 + ## 11.0.0-beta.18 ### Major Changes diff --git a/packages/axios/package.json b/packages/axios/package.json index 90d51758..d779b33d 100644 --- a/packages/axios/package.json +++ b/packages/axios/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/axios", "description": "Typescript API client with axios", - "version": "11.0.0-beta.18", + "version": "11.0.0-beta.19", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", @@ -41,7 +41,7 @@ "test": "jest --coverage" }, "peerDependencies": { - "@zodios/core": "11.0.0-beta.18", + "@zodios/core": "11.0.0-beta.19", "axios": "^0.x || ^1.0.0", "fp-ts": "2.x", "io-ts": "2.x", diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index f1355e20..3315087c 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,11 @@ # @zodios/core +## 11.0.0-beta.19 + +### Major Changes + +- 583775e: feat(openapi): add openapi + ## 11.0.0-beta.18 ### Major Changes diff --git a/packages/core/package.json b/packages/core/package.json index f9129f5e..d40e2f5c 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/core", "description": "Typescript API client with autocompletion and zod validations", - "version": "11.0.0-beta.18", + "version": "11.0.0-beta.19", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", diff --git a/packages/express/CHANGELOG.md b/packages/express/CHANGELOG.md index 4012f0de..25466a3a 100644 --- a/packages/express/CHANGELOG.md +++ b/packages/express/CHANGELOG.md @@ -1,5 +1,16 @@ # @zodios/express +## 11.0.0-beta.19 + +### Major Changes + +- 583775e: feat(openapi): add openapi + +### Patch Changes + +- Updated dependencies [583775e] + - @zodios/core@11.0.0-beta.19 + ## 11.0.0-beta.18 ### Major Changes diff --git a/packages/express/package.json b/packages/express/package.json index e38cbd48..6a2139e4 100644 --- a/packages/express/package.json +++ b/packages/express/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/express", "description": "Typescript express server", - "version": "11.0.0-beta.18", + "version": "11.0.0-beta.19", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", @@ -38,7 +38,7 @@ "test": "jest --coverage" }, "peerDependencies": { - "@zodios/core": "11.0.0-beta.18", + "@zodios/core": "11.0.0-beta.19", "express": "4.x", "zod": "^3.x" }, diff --git a/packages/fetch/CHANGELOG.md b/packages/fetch/CHANGELOG.md index 49613dd8..eb55e9c1 100644 --- a/packages/fetch/CHANGELOG.md +++ b/packages/fetch/CHANGELOG.md @@ -1,5 +1,16 @@ # @zodios/core +## 11.0.0-beta.19 + +### Major Changes + +- 583775e: feat(openapi): add openapi + +### Patch Changes + +- Updated dependencies [583775e] + - @zodios/core@11.0.0-beta.19 + ## 11.0.0-beta.18 ### Major Changes diff --git a/packages/fetch/package.json b/packages/fetch/package.json index dc4fcb4e..2ef0f629 100644 --- a/packages/fetch/package.json +++ b/packages/fetch/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/fetch", "description": "Typescript API client with fetch", - "version": "11.0.0-beta.18", + "version": "11.0.0-beta.19", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", @@ -39,7 +39,7 @@ "test": "NODE_OPTIONS=--experimental-abortcontroller jest --coverage" }, "peerDependencies": { - "@zodios/core": "11.0.0-beta.18", + "@zodios/core": "11.0.0-beta.19", "fp-ts": "2.x", "io-ts": "2.x", "zod": "^3.x" diff --git a/packages/openapi/CHANGELOG.md b/packages/openapi/CHANGELOG.md new file mode 100644 index 00000000..681c287a --- /dev/null +++ b/packages/openapi/CHANGELOG.md @@ -0,0 +1,12 @@ +# @zodios/openapi + +## 11.0.0-beta.19 + +### Major Changes + +- 583775e: feat(openapi): add openapi + +### Patch Changes + +- Updated dependencies [583775e] + - @zodios/core@11.0.0-beta.19 diff --git a/packages/openapi/package.json b/packages/openapi/package.json index 486870d4..691ecd26 100644 --- a/packages/openapi/package.json +++ b/packages/openapi/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/openapi", "description": "Openapi for zodios", - "version": "10.4.7", + "version": "11.0.0-beta.19", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", @@ -38,7 +38,7 @@ "test": "jest --coverage" }, "peerDependencies": { - "@zodios/core": "11.0.0-beta.18", + "@zodios/core": "11.0.0-beta.19", "zod": "^3.x" }, "devDependencies": { diff --git a/packages/react/CHANGELOG.md b/packages/react/CHANGELOG.md index 664b6fc3..49c439df 100644 --- a/packages/react/CHANGELOG.md +++ b/packages/react/CHANGELOG.md @@ -1,5 +1,18 @@ # @zodios/react +## 11.0.0-beta.19 + +### Major Changes + +- 583775e: feat(openapi): add openapi + +### Patch Changes + +- Updated dependencies [583775e] + - @zodios/axios@11.0.0-beta.19 + - @zodios/fetch@11.0.0-beta.19 + - @zodios/core@11.0.0-beta.19 + ## 11.0.0-beta.18 ### Major Changes diff --git a/packages/react/package.json b/packages/react/package.json index b2cddc70..fb8de341 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/react", "description": "React hooks for zodios", - "version": "11.0.0-beta.18", + "version": "11.0.0-beta.19", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", @@ -40,9 +40,9 @@ }, "peerDependencies": { "@tanstack/react-query": "4.x", - "@zodios/axios": "11.0.0-beta.18", - "@zodios/core": "11.0.0-beta.18", - "@zodios/fetch": "11.0.0-beta.18", + "@zodios/axios": "11.0.0-beta.19", + "@zodios/core": "11.0.0-beta.19", + "@zodios/fetch": "11.0.0-beta.19", "react": ">=16.8.0" }, "peerDependenciesMeta": { diff --git a/packages/testing/CHANGELOG.md b/packages/testing/CHANGELOG.md index dcfed6d9..fa4f14fc 100644 --- a/packages/testing/CHANGELOG.md +++ b/packages/testing/CHANGELOG.md @@ -1,5 +1,16 @@ # @zodios/core +## 11.0.0-beta.19 + +### Major Changes + +- 583775e: feat(openapi): add openapi + +### Patch Changes + +- Updated dependencies [583775e] + - @zodios/core@11.0.0-beta.19 + ## 11.0.0-beta.18 ### Major Changes diff --git a/packages/testing/package.json b/packages/testing/package.json index 611d390e..2740d6be 100644 --- a/packages/testing/package.json +++ b/packages/testing/package.json @@ -1,7 +1,7 @@ { "name": "@zodios/testing", "description": "Zodios mock library", - "version": "11.0.0-beta.18", + "version": "11.0.0-beta.19", "main": "lib/index.js", "module": "lib/index.mjs", "typings": "lib/index.d.ts", @@ -37,7 +37,7 @@ "test": "jest --coverage" }, "peerDependencies": { - "@zodios/core": "11.0.0-beta.18" + "@zodios/core": "11.0.0-beta.19" }, "devDependencies": { "@jest/globals": "29.5.0", From b124b1fbaf786d20c676790c2b4eb2438e15b5a4 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Thu, 13 Apr 2023 19:51:19 +0200 Subject: [PATCH 132/206] feat(perf): improve autocompletion perf for finding endpoints --- .changeset/pre.json | 4 +- packages/core/examples/airbytes-api.ts | 3012 +++++++++++++++++++++ packages/core/examples/aitbytes-test.ts | 11 + packages/core/examples/jsonplaceholder.ts | 21 +- packages/core/src/index.ts | 4 +- packages/core/src/utils.types.ts | 22 +- packages/core/src/zodios.test.ts | 6 +- packages/core/src/zodios.types.ts | 80 +- 8 files changed, 3097 insertions(+), 63 deletions(-) create mode 100644 packages/core/examples/airbytes-api.ts create mode 100644 packages/core/examples/aitbytes-test.ts diff --git a/.changeset/pre.json b/.changeset/pre.json index a83690b5..69e29fde 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -7,7 +7,8 @@ "@zodios/fetch": "11.0.0-beta.5", "@zodios/testing": "11.0.0-beta.8", "@zodios/react": "11.0.0-beta.12", - "@zodios/express": "11.0.0-beta.17" + "@zodios/express": "11.0.0-beta.17", + "@zodios/openapi": "10.4.7" }, "changesets": [ "blue-hounds-sort", @@ -24,6 +25,7 @@ "nervous-kings-bow", "nice-kids-attend", "nice-wombats-boil", + "odd-avocados-prove", "polite-bugs-confess", "polite-points-float", "quiet-rockets-dream", diff --git a/packages/core/examples/airbytes-api.ts b/packages/core/examples/airbytes-api.ts new file mode 100644 index 00000000..4df707ef --- /dev/null +++ b/packages/core/examples/airbytes-api.ts @@ -0,0 +1,3012 @@ +import { makeApi, ZodiosCore, type ZodiosOptions } from "../src"; +import { z } from "zod"; + +const NotificationType = z.enum(["slack", "customerio"]); +const SlackNotificationConfiguration = z.object({ webhook: z.string() }); +const CustomerioNotificationConfiguration = z.object({}).partial(); +const Notification = z.object({ + notificationType: NotificationType, + sendOnSuccess: z.boolean(), + sendOnFailure: z.boolean().default(true), + slackConfiguration: SlackNotificationConfiguration.optional(), + customerioConfiguration: CustomerioNotificationConfiguration.optional(), +}); +const Geography = z.enum(["auto", "us", "eu"]); +const WebhookConfigWrite = z + .object({ + name: z.string(), + authToken: z.string(), + validationUrl: z.string(), + }) + .partial(); +const WorkspaceCreate = z.object({ + email: z.string().email().optional(), + anonymousDataCollection: z.boolean().optional(), + name: z.string(), + news: z.boolean().optional(), + securityUpdates: z.boolean().optional(), + notifications: z.array(Notification).optional(), + displaySetupWizard: z.boolean().optional(), + defaultGeography: Geography.optional(), + webhookConfigs: z.array(WebhookConfigWrite).optional(), +}); +const WorkspaceId = z.string(); +const CustomerId = z.string(); +const WebhookConfigRead = z.object({ + id: z.string().uuid(), + name: z.string().optional(), +}); +const WorkspaceRead = z.object({ + workspaceId: WorkspaceId.uuid(), + customerId: CustomerId.uuid(), + email: z.string().email().optional(), + name: z.string(), + slug: z.string(), + initialSetupComplete: z.boolean(), + displaySetupWizard: z.boolean().optional(), + anonymousDataCollection: z.boolean().optional(), + news: z.boolean().optional(), + securityUpdates: z.boolean().optional(), + notifications: z.array(Notification).optional(), + firstCompletedSync: z.boolean().optional(), + feedbackDone: z.boolean().optional(), + defaultGeography: Geography.optional(), + webhookConfigs: z.array(WebhookConfigRead).optional(), +}); +const WorkspaceIdRequestBody = z.object({ workspaceId: WorkspaceId.uuid() }); +const WorkspaceReadList = z.object({ workspaces: z.array(WorkspaceRead) }); +const SlugRequestBody = z.object({ slug: z.string() }); +const ConnectionId = z.string(); +const ConnectionIdRequestBody = z.object({ connectionId: ConnectionId.uuid() }); +const WorkspaceUpdate = z.object({ + workspaceId: WorkspaceId.uuid(), + email: z.string().email().optional(), + initialSetupComplete: z.boolean().optional(), + displaySetupWizard: z.boolean().optional(), + anonymousDataCollection: z.boolean().optional(), + news: z.boolean().optional(), + securityUpdates: z.boolean().optional(), + notifications: z.array(Notification).optional(), + defaultGeography: Geography.optional(), + webhookConfigs: z.array(WebhookConfigWrite).optional(), +}); +const WorkspaceUpdateName = z.object({ + workspaceId: WorkspaceId.uuid(), + name: z.string(), +}); +const WorkspaceGiveFeedback = z.object({ workspaceId: WorkspaceId.uuid() }); +const NotificationRead = z.object({ + status: z.enum(["succeeded", "failed"]), + message: z.string().optional(), +}); +const SourceDefinitionId = z.string(); +const ResourceRequirements = z + .object({ + cpu_request: z.string(), + cpu_limit: z.string(), + memory_request: z.string(), + memory_limit: z.string(), + }) + .partial(); +const JobType = z.enum([ + "get_spec", + "check_connection", + "discover_schema", + "sync", + "reset_connection", + "connection_updater", + "replicate", +]); +const JobTypeResourceLimit = z.object({ + jobType: JobType, + resourceRequirements: ResourceRequirements, +}); +const ActorDefinitionResourceRequirements = z + .object({ + default: ResourceRequirements, + jobSpecific: z.array(JobTypeResourceLimit), + }) + .partial(); +const SourceDefinitionUpdate = z.object({ + sourceDefinitionId: SourceDefinitionId.uuid(), + dockerImageTag: z.string(), + resourceRequirements: ActorDefinitionResourceRequirements.optional(), +}); +const ReleaseStage = z.enum(["alpha", "beta", "generally_available", "custom"]); +const SourceDefinitionRead = z.object({ + sourceDefinitionId: SourceDefinitionId.uuid(), + name: z.string(), + dockerRepository: z.string(), + dockerImageTag: z.string(), + documentationUrl: z.string().url().optional(), + icon: z.string().optional(), + protocolVersion: z.string().optional(), + releaseStage: ReleaseStage.optional(), + releaseDate: z.string().optional(), + sourceType: z.enum(["api", "file", "database", "custom"]).optional(), + resourceRequirements: ActorDefinitionResourceRequirements.optional(), +}); +const SourceDefinitionReadList = z.object({ + sourceDefinitions: z.array(SourceDefinitionRead), +}); +const SourceDefinitionIdRequestBody = z.object({ + sourceDefinitionId: SourceDefinitionId.uuid(), +}); +const PrivateSourceDefinitionRead = z.object({ + sourceDefinition: SourceDefinitionRead, + granted: z.boolean(), +}); +const PrivateSourceDefinitionReadList = z.object({ + sourceDefinitions: z.array(PrivateSourceDefinitionRead), +}); +const SourceDefinitionCreate = z.object({ + name: z.string(), + dockerRepository: z.string(), + dockerImageTag: z.string(), + documentationUrl: z.string().url(), + icon: z.string().optional(), + resourceRequirements: ActorDefinitionResourceRequirements.optional(), +}); +const CustomSourceDefinitionCreate = z.object({ + workspaceId: WorkspaceId.uuid(), + sourceDefinition: SourceDefinitionCreate, +}); +const SourceDefinitionIdWithWorkspaceId = z.object({ + sourceDefinitionId: SourceDefinitionId.uuid(), + workspaceId: WorkspaceId.uuid(), +}); +const SourceDefinitionSpecification = z.object({}).partial(); +const OAuth2Specification = z.object({ + rootObject: z.array(z.unknown()), + oauthFlowInitParameters: z.array(z.array(z.string())), + oauthFlowOutputParameters: z.array(z.array(z.string())), +}); +const AuthSpecification = z + .object({ + auth_type: z.literal("oauth2.0"), + oauth2Specification: OAuth2Specification, + }) + .partial(); +const SourceAuthSpecification = AuthSpecification; +const OAuthConfiguration = z.unknown(); +const OAuthConfigSpecification = z + .object({ + oauthUserInputFromConnectorConfigSpecification: OAuthConfiguration, + completeOAuthOutputSpecification: OAuthConfiguration, + completeOAuthServerInputSpecification: OAuthConfiguration, + completeOAuthServerOutputSpecification: OAuthConfiguration, + }) + .partial(); +const AdvancedAuth = z + .object({ + authFlowType: z.enum(["oauth2.0", "oauth1.0"]), + predicateKey: z.array(z.string()), + predicateValue: z.string(), + oauthConfigSpecification: OAuthConfigSpecification, + }) + .partial(); +const JobConfigType = z.enum([ + "check_connection_source", + "check_connection_destination", + "discover_schema", + "get_spec", + "sync", + "reset_connection", +]); +const LogRead = z.object({ logLines: z.array(z.string()) }); +const SynchronousJobRead = z.object({ + id: z.string().uuid(), + configType: JobConfigType, + configId: z.string().optional(), + createdAt: z.number().int(), + endedAt: z.number().int(), + succeeded: z.boolean(), + connectorConfigurationUpdated: z.boolean().optional(), + logs: LogRead.optional(), +}); +const SourceDefinitionSpecificationRead = z.object({ + sourceDefinitionId: SourceDefinitionId.uuid(), + documentationUrl: z.string().optional(), + connectionSpecification: SourceDefinitionSpecification.optional(), + authSpecification: SourceAuthSpecification.optional(), + advancedAuth: AdvancedAuth.optional(), + jobInfo: SynchronousJobRead, +}); +const SourceConfiguration = z.unknown(); +const SourceCreate = z.object({ + sourceDefinitionId: SourceDefinitionId.uuid(), + connectionConfiguration: SourceConfiguration, + workspaceId: WorkspaceId.uuid(), + name: z.string(), +}); +const SourceId = z.string(); +const SourceRead = z.object({ + sourceDefinitionId: SourceDefinitionId.uuid(), + sourceId: SourceId.uuid(), + workspaceId: WorkspaceId.uuid(), + connectionConfiguration: SourceConfiguration, + name: z.string(), + sourceName: z.string(), + icon: z.string().optional(), +}); +const SourceUpdate = z.object({ + sourceId: SourceId.uuid(), + connectionConfiguration: SourceConfiguration, + name: z.string(), +}); +const SourceReadList = z.object({ sources: z.array(SourceRead) }); +const SourceIdRequestBody = z.object({ sourceId: SourceId.uuid() }); +const ActorCatalogWithUpdatedAt = z + .object({ updatedAt: z.number().int(), catalog: z.object({}).partial() }) + .partial(); +const SourceSearch = z + .object({ + sourceDefinitionId: SourceDefinitionId.uuid(), + sourceId: SourceId.uuid(), + workspaceId: WorkspaceId.uuid(), + connectionConfiguration: SourceConfiguration, + name: z.string(), + sourceName: z.string(), + }) + .partial(); +const SourceCloneConfiguration = z + .object({ connectionConfiguration: SourceConfiguration, name: z.string() }) + .partial(); +const SourceCloneRequestBody = z.object({ + sourceCloneId: SourceId.uuid(), + sourceConfiguration: SourceCloneConfiguration.optional(), +}); +const CheckConnectionRead = z.object({ + status: z.enum(["succeeded", "failed"]), + message: z.string().optional(), + jobInfo: SynchronousJobRead, +}); +const SourceDiscoverSchemaRequestBody = z.object({ + sourceId: SourceId.uuid(), + connectionId: z.string().uuid().optional(), + disable_cache: z.boolean().optional(), + notifySchemaChange: z.boolean().optional(), +}); +const StreamJsonSchema = z.object({}).partial(); +const SyncMode = z.enum(["full_refresh", "incremental"]); +const AirbyteStream = z.object({ + name: z.string(), + jsonSchema: StreamJsonSchema.optional(), + supportedSyncModes: z.array(SyncMode).optional(), + sourceDefinedCursor: z.boolean().optional(), + defaultCursorField: z.array(z.string()).optional(), + sourceDefinedPrimaryKey: z.array(z.array(z.string())).optional(), + namespace: z.string().optional(), +}); +const DestinationSyncMode = z.enum(["append", "overwrite", "append_dedup"]); +const SelectedFieldInfo = z + .object({ fieldPath: z.array(z.string()) }) + .partial(); +const AirbyteStreamConfiguration = z.object({ + syncMode: SyncMode, + cursorField: z.array(z.string()).optional(), + destinationSyncMode: DestinationSyncMode, + primaryKey: z.array(z.array(z.string())).optional(), + aliasName: z.string().optional(), + selected: z.boolean().optional(), + suggested: z.boolean().optional(), + fieldSelectionEnabled: z.boolean().optional(), + selectedFields: z.array(SelectedFieldInfo).optional(), +}); +const AirbyteStreamAndConfiguration = z + .object({ stream: AirbyteStream, config: AirbyteStreamConfiguration }) + .partial(); +const AirbyteCatalog = z.object({ + streams: z.array(AirbyteStreamAndConfiguration), +}); +const StreamDescriptor = z.object({ + name: z.string(), + namespace: z.string().optional(), +}); +const FieldName = z.array(z.string()); +const FieldSchema = z.object({}).partial(); +const FieldAdd = z.object({ schema: FieldSchema }).partial(); +const FieldRemove = z.object({ schema: FieldSchema }).partial(); +const FieldSchemaUpdate = z.object({ + oldSchema: FieldSchema, + newSchema: FieldSchema, +}); +const FieldTransform = z.object({ + transformType: z.enum(["add_field", "remove_field", "update_field_schema"]), + fieldName: FieldName, + breaking: z.boolean(), + addField: FieldAdd.optional(), + removeField: FieldRemove.optional(), + updateFieldSchema: FieldSchemaUpdate.optional(), +}); +const StreamTransform = z.object({ + transformType: z.enum(["add_stream", "remove_stream", "update_stream"]), + streamDescriptor: StreamDescriptor, + updateStream: z.array(FieldTransform).optional(), +}); +const CatalogDiff = z.object({ transforms: z.array(StreamTransform) }); +const ConnectionStatus = z.enum(["active", "inactive", "deprecated"]); +const SourceDiscoverSchemaRead = z.object({ + catalog: AirbyteCatalog.optional(), + jobInfo: SynchronousJobRead, + catalogId: z.string().uuid().optional(), + catalogDiff: CatalogDiff.optional(), + breakingChange: z.boolean().optional(), + connectionStatus: ConnectionStatus.optional(), +}); +const SourceDiscoverSchemaWriteRequestBody = z.object({ + catalog: AirbyteCatalog, + sourceId: SourceId.uuid().optional(), + connectorVersion: z.string().optional(), + configurationHash: z.string().optional(), +}); +const DiscoverCatalogResult = z.object({ catalogId: z.string().uuid() }); +const DestinationDefinitionId = z.string(); +const DestinationDefinitionUpdate = z.object({ + destinationDefinitionId: DestinationDefinitionId.uuid(), + dockerImageTag: z.string().optional(), + resourceRequirements: ActorDefinitionResourceRequirements.optional(), +}); +const NormalizationDestinationDefinitionConfig = z.object({ + supported: z.boolean(), + normalizationRepository: z.string().optional(), + normalizationTag: z.string().optional(), + normalizationIntegrationType: z.string().optional(), +}); +const DestinationDefinitionRead = z.object({ + destinationDefinitionId: DestinationDefinitionId.uuid(), + name: z.string(), + dockerRepository: z.string(), + dockerImageTag: z.string(), + documentationUrl: z.string().url(), + icon: z.string().optional(), + protocolVersion: z.string().optional(), + releaseStage: ReleaseStage.optional(), + releaseDate: z.string().optional(), + resourceRequirements: ActorDefinitionResourceRequirements.optional(), + supportsDbt: z.boolean(), + normalizationConfig: NormalizationDestinationDefinitionConfig, +}); +const DestinationDefinitionReadList = z.object({ + destinationDefinitions: z.array(DestinationDefinitionRead), +}); +const DestinationDefinitionIdRequestBody = z.object({ + destinationDefinitionId: DestinationDefinitionId.uuid(), +}); +const PrivateDestinationDefinitionRead = z.object({ + destinationDefinition: DestinationDefinitionRead, + granted: z.boolean(), +}); +const PrivateDestinationDefinitionReadList = z.object({ + destinationDefinitions: z.array(PrivateDestinationDefinitionRead), +}); +const DestinationDefinitionCreate = z.object({ + name: z.string(), + dockerRepository: z.string(), + dockerImageTag: z.string(), + documentationUrl: z.string().url(), + icon: z.string().optional(), + resourceRequirements: ActorDefinitionResourceRequirements.optional(), +}); +const CustomDestinationDefinitionCreate = z.object({ + workspaceId: WorkspaceId.uuid(), + destinationDefinition: DestinationDefinitionCreate, +}); +const DestinationDefinitionIdWithWorkspaceId = z.object({ + destinationDefinitionId: DestinationDefinitionId.uuid(), + workspaceId: WorkspaceId.uuid(), +}); +const DestinationDefinitionSpecification = z.unknown(); +const DestinationAuthSpecification = AuthSpecification; +const DestinationDefinitionSpecificationRead = z.object({ + destinationDefinitionId: DestinationDefinitionId.uuid(), + documentationUrl: z.string().optional(), + connectionSpecification: DestinationDefinitionSpecification.optional(), + authSpecification: DestinationAuthSpecification.optional(), + advancedAuth: AdvancedAuth.optional(), + jobInfo: SynchronousJobRead, + supportedDestinationSyncModes: z.array(DestinationSyncMode).optional(), +}); +const DestinationConfiguration = z.unknown(); +const DestinationCreate = z.object({ + workspaceId: WorkspaceId.uuid(), + name: z.string(), + destinationDefinitionId: DestinationDefinitionId.uuid(), + connectionConfiguration: DestinationConfiguration, +}); +const DestinationId = z.string(); +const DestinationRead = z.object({ + destinationDefinitionId: DestinationDefinitionId.uuid(), + destinationId: DestinationId.uuid(), + workspaceId: WorkspaceId.uuid(), + connectionConfiguration: DestinationConfiguration, + name: z.string(), + destinationName: z.string(), + icon: z.string().optional(), +}); +const DestinationUpdate = z.object({ + destinationId: DestinationId.uuid(), + connectionConfiguration: DestinationConfiguration, + name: z.string(), +}); +const DestinationReadList = z.object({ + destinations: z.array(DestinationRead), +}); +const DestinationIdRequestBody = z.object({ + destinationId: DestinationId.uuid(), +}); +const DestinationSearch = z + .object({ + destinationDefinitionId: DestinationDefinitionId.uuid(), + destinationId: DestinationId.uuid(), + workspaceId: WorkspaceId.uuid(), + connectionConfiguration: DestinationConfiguration, + name: z.string(), + destinationName: z.string(), + }) + .partial(); +const DestinationCloneConfiguration = z + .object({ + connectionConfiguration: DestinationConfiguration, + name: z.string(), + }) + .partial(); +const DestinationCloneRequestBody = z.object({ + destinationCloneId: DestinationId.uuid(), + destinationConfiguration: DestinationCloneConfiguration.optional(), +}); +const NamespaceDefinitionType = z.enum([ + "source", + "destination", + "customformat", +]); +const OperationId = z.string(); +const ConnectionSchedule = z.object({ + units: z.number().int(), + timeUnit: z.enum(["minutes", "hours", "days", "weeks", "months"]), +}); +const ConnectionScheduleType = z.enum(["manual", "basic", "cron"]); +const ConnectionScheduleData = z + .object({ + basicSchedule: z.object({ + timeUnit: z.enum(["minutes", "hours", "days", "weeks", "months"]), + units: z.number().int(), + }), + cron: z.object({ cronExpression: z.string(), cronTimeZone: z.string() }), + }) + .partial(); +const NonBreakingChangesPreference = z.enum(["ignore", "disable"]); +const ConnectionCreate = z.object({ + name: z.string().optional(), + namespaceDefinition: NamespaceDefinitionType.optional(), + namespaceFormat: z.string().optional(), + prefix: z.string().optional(), + sourceId: SourceId.uuid(), + destinationId: DestinationId.uuid(), + operationIds: z.array(OperationId).optional(), + syncCatalog: AirbyteCatalog.optional(), + schedule: ConnectionSchedule.optional(), + scheduleType: ConnectionScheduleType.optional(), + scheduleData: ConnectionScheduleData.optional(), + status: ConnectionStatus, + resourceRequirements: ResourceRequirements.optional(), + sourceCatalogId: z.string().uuid().optional(), + geography: Geography.optional(), + notifySchemaChanges: z.boolean().optional(), + nonBreakingChangesPreference: NonBreakingChangesPreference.optional(), +}); +const ConnectionRead = z.object({ + connectionId: ConnectionId.uuid(), + name: z.string(), + namespaceDefinition: NamespaceDefinitionType.optional(), + namespaceFormat: z.string().optional(), + prefix: z.string().optional(), + sourceId: SourceId.uuid(), + destinationId: DestinationId.uuid(), + operationIds: z.array(OperationId).optional(), + syncCatalog: AirbyteCatalog, + schedule: ConnectionSchedule.optional(), + scheduleType: ConnectionScheduleType.optional(), + scheduleData: ConnectionScheduleData.optional(), + status: ConnectionStatus, + resourceRequirements: ResourceRequirements.optional(), + sourceCatalogId: z.string().uuid().optional(), + geography: Geography.optional(), + breakingChange: z.boolean(), + notifySchemaChanges: z.boolean().optional(), + nonBreakingChangesPreference: NonBreakingChangesPreference.optional(), +}); +const ConnectionUpdate = z.object({ + connectionId: ConnectionId.uuid(), + namespaceDefinition: NamespaceDefinitionType.optional(), + namespaceFormat: z.string().optional(), + name: z.string().optional(), + prefix: z.string().optional(), + operationIds: z.array(OperationId).optional(), + syncCatalog: AirbyteCatalog.optional(), + schedule: ConnectionSchedule.optional(), + scheduleType: ConnectionScheduleType.optional(), + scheduleData: ConnectionScheduleData.optional(), + status: ConnectionStatus.optional(), + resourceRequirements: ResourceRequirements.optional(), + sourceCatalogId: z.string().uuid().optional(), + geography: Geography.optional(), + notifySchemaChanges: z.boolean().optional(), + nonBreakingChangesPreference: NonBreakingChangesPreference.optional(), + breakingChange: z.boolean().optional(), +}); +const ConnectionReadList = z.object({ connections: z.array(ConnectionRead) }); +const ConnectionStateType = z.enum(["global", "stream", "legacy", "not_set"]); +const StateBlob = z.object({}).partial(); +const StreamState = z.object({ + streamDescriptor: StreamDescriptor, + streamState: StateBlob.optional(), +}); +const GlobalState = z.object({ + shared_state: StateBlob.optional(), + streamStates: z.array(StreamState), +}); +const ConnectionState = z.object({ + stateType: ConnectionStateType, + connectionId: ConnectionId.uuid(), + state: StateBlob.optional(), + streamState: z.array(StreamState).optional(), + globalState: GlobalState.optional(), +}); +const ConnectionStateCreateOrUpdate = z.object({ + connectionId: ConnectionId.uuid(), + connectionState: ConnectionState, +}); +const ConnectionSearch = z + .object({ + connectionId: ConnectionId.uuid(), + name: z.string(), + namespaceDefinition: NamespaceDefinitionType, + namespaceFormat: z.string(), + prefix: z.string(), + sourceId: SourceId.uuid(), + destinationId: DestinationId.uuid(), + schedule: ConnectionSchedule, + scheduleType: ConnectionScheduleType, + scheduleData: ConnectionScheduleData, + status: ConnectionStatus, + source: SourceSearch, + destination: DestinationSearch, + }) + .partial(); +const JobId = z.number(); +const JobStatus = z.enum([ + "pending", + "running", + "incomplete", + "failed", + "succeeded", + "cancelled", +]); +const ResetConfig = z + .object({ streamsToReset: z.array(StreamDescriptor) }) + .partial(); +const JobRead = z.object({ + id: JobId.int(), + configType: JobConfigType, + configId: z.string(), + createdAt: z.number().int(), + updatedAt: z.number().int(), + startedAt: z.number().int().optional(), + status: JobStatus, + resetConfig: ResetConfig.optional(), +}); +const AttemptStatus = z.enum(["running", "failed", "succeeded"]); +const AttemptStats = z + .object({ + recordsEmitted: z.number().int(), + bytesEmitted: z.number().int(), + stateMessagesEmitted: z.number().int(), + recordsCommitted: z.number().int(), + estimatedRecords: z.number().int(), + estimatedBytes: z.number().int(), + }) + .partial(); +const AttemptStreamStats = z.object({ + streamName: z.string(), + streamNamespace: z.string().optional(), + stats: AttemptStats, +}); +const AttemptFailureOrigin = z.enum([ + "source", + "destination", + "replication", + "persistence", + "normalization", + "dbt", + "airbyte_platform", + "unknown", +]); +const AttemptFailureType = z.enum([ + "config_error", + "system_error", + "manual_cancellation", + "refresh_schema", +]); +const AttemptFailureReason = z.object({ + failureOrigin: AttemptFailureOrigin.optional(), + failureType: AttemptFailureType.optional(), + externalMessage: z.string().optional(), + internalMessage: z.string().optional(), + stacktrace: z.string().optional(), + retryable: z.boolean().optional(), + timestamp: z.number().int(), +}); +const AttemptFailureSummary = z.object({ + failures: z.array(AttemptFailureReason), + partialSuccess: z.boolean().optional(), +}); +const AttemptRead = z.object({ + id: z.number().int(), + status: AttemptStatus, + createdAt: z.number().int(), + updatedAt: z.number().int(), + endedAt: z.number().int().optional(), + bytesSynced: z.number().int().optional(), + recordsSynced: z.number().int().optional(), + totalStats: AttemptStats.optional(), + streamStats: z.array(AttemptStreamStats).optional(), + failureSummary: AttemptFailureSummary.optional(), +}); +const AttemptInfoRead = z.object({ attempt: AttemptRead, logs: LogRead }); +const JobInfoRead = z.object({ + job: JobRead, + attempts: z.array(AttemptInfoRead), +}); +const OperatorType = z.enum(["normalization", "dbt", "webhook"]); +const OperatorNormalization = z + .object({ option: z.literal("basic") }) + .partial(); +const OperatorDbt = z.object({ + gitRepoUrl: z.string(), + gitRepoBranch: z.string().optional(), + dockerImage: z.string().optional(), + dbtArguments: z.string().optional(), +}); +const OperatorWebhook = z + .object({ + webhookConfigId: z.string().uuid(), + webhookType: z.literal("dbtCloud"), + dbtCloud: z.object({ + accountId: z.number().int(), + jobId: z.number().int(), + }), + executionUrl: z.string(), + executionBody: z.string(), + }) + .partial(); +const OperatorConfiguration = z.object({ + operatorType: OperatorType, + normalization: OperatorNormalization.optional(), + dbt: OperatorDbt.optional(), + webhook: OperatorWebhook.optional(), +}); +const CheckOperationRead = z.object({ + status: z.enum(["succeeded", "failed"]), + message: z.string().optional(), +}); +const OperationCreate = z.object({ + workspaceId: WorkspaceId.uuid(), + name: z.string(), + operatorConfiguration: OperatorConfiguration, +}); +const OperationRead = z.object({ + workspaceId: WorkspaceId.uuid(), + operationId: OperationId.uuid(), + name: z.string(), + operatorConfiguration: OperatorConfiguration, +}); +const OperationUpdate = z.object({ + operationId: OperationId.uuid(), + name: z.string(), + operatorConfiguration: OperatorConfiguration, +}); +const OperationReadList = z.object({ operations: z.array(OperationRead) }); +const OperationIdRequestBody = z.object({ operationId: OperationId.uuid() }); +const SourceCoreConfig = z.object({ + sourceId: SourceId.uuid().optional(), + sourceDefinitionId: SourceDefinitionId.uuid(), + connectionConfiguration: SourceConfiguration, + workspaceId: WorkspaceId.uuid(), +}); +const DestinationCoreConfig = z.object({ + destinationId: DestinationId.uuid().optional(), + destinationDefinitionId: DestinationDefinitionId.uuid(), + connectionConfiguration: DestinationConfiguration, + workspaceId: WorkspaceId.uuid(), +}); +const SetInstancewideSourceOauthParamsRequestBody = z.object({ + sourceDefinitionId: SourceDefinitionId.uuid(), + params: z.object({}).partial().passthrough(), +}); +const OAuthInputConfiguration = OAuthConfiguration; +const SourceOauthConsentRequest = z.object({ + sourceDefinitionId: SourceDefinitionId.uuid(), + workspaceId: WorkspaceId.uuid(), + redirectUrl: z.string(), + oAuthInputConfiguration: OAuthInputConfiguration.optional(), + sourceId: SourceId.uuid().optional(), +}); +const OAuthConsentRead = z.object({ consentUrl: z.string() }); +const CompleteSourceOauthRequest = z.object({ + sourceDefinitionId: SourceDefinitionId.uuid(), + workspaceId: WorkspaceId.uuid(), + redirectUrl: z.string().optional(), + queryParams: z.object({}).partial().passthrough().optional(), + oAuthInputConfiguration: OAuthInputConfiguration.optional(), + sourceId: SourceId.uuid().optional(), +}); +const CompleteOAuthResponse = z.object({}).partial().passthrough(); +const DestinationOauthConsentRequest = z.object({ + destinationDefinitionId: DestinationDefinitionId.uuid(), + workspaceId: WorkspaceId.uuid(), + redirectUrl: z.string(), + oAuthInputConfiguration: OAuthInputConfiguration.optional(), + destinationId: DestinationId.uuid().optional(), +}); +const CompleteDestinationOAuthRequest = z.object({ + destinationDefinitionId: DestinationDefinitionId.uuid(), + workspaceId: WorkspaceId.uuid(), + redirectUrl: z.string().optional(), + queryParams: z.object({}).partial().passthrough().optional(), + oAuthInputConfiguration: OAuthInputConfiguration.optional(), + destinationId: DestinationId.uuid().optional(), +}); +const SetInstancewideDestinationOauthParamsRequestBody = z.object({ + destinationDefinitionId: DestinationDefinitionId.uuid(), + params: z.object({}).partial().passthrough(), +}); +const WebBackendCheckUpdatesRead = z.object({ + destinationDefinitions: z.number().int(), + sourceDefinitions: z.number().int(), +}); +const WebBackendConnectionListRequestBody = z.object({ + workspaceId: WorkspaceId.uuid(), + sourceId: z.array(SourceId).optional(), + destinationId: z.array(DestinationId).optional(), +}); +const SourceSnippetRead = z.object({ + sourceId: SourceId.uuid(), + name: z.string(), + sourceDefinitionId: SourceDefinitionId.uuid(), + sourceName: z.string(), + icon: z.string().optional(), +}); +const DestinationSnippetRead = z.object({ + destinationId: DestinationId.uuid(), + name: z.string(), + destinationDefinitionId: DestinationDefinitionId.uuid(), + destinationName: z.string(), + icon: z.string().optional(), +}); +const JobCreatedAt = z.number(); +const SchemaChange = z.enum(["no_change", "non_breaking", "breaking"]); +const WebBackendConnectionListItem = z.object({ + connectionId: ConnectionId.uuid(), + name: z.string(), + scheduleType: ConnectionScheduleType.optional(), + scheduleData: ConnectionScheduleData.optional(), + status: ConnectionStatus, + source: SourceSnippetRead, + destination: DestinationSnippetRead, + latestSyncJobCreatedAt: JobCreatedAt.int().optional(), + latestSyncJobStatus: JobStatus.optional(), + isSyncing: z.boolean(), + schemaChange: SchemaChange, +}); +const WebBackendConnectionReadList = z.object({ + connections: z.array(WebBackendConnectionListItem), +}); +const WebBackendConnectionRequestBody = z.object({ + withRefreshedCatalog: z.boolean().optional(), + connectionId: ConnectionId.uuid(), +}); +const WebBackendConnectionRead = z.object({ + connectionId: ConnectionId.uuid(), + name: z.string(), + namespaceDefinition: NamespaceDefinitionType.optional(), + namespaceFormat: z.string().optional(), + prefix: z.string().optional(), + sourceId: SourceId.uuid(), + destinationId: DestinationId.uuid(), + syncCatalog: AirbyteCatalog, + schedule: ConnectionSchedule.optional(), + scheduleType: ConnectionScheduleType.optional(), + scheduleData: ConnectionScheduleData.optional(), + status: ConnectionStatus, + operationIds: z.array(OperationId).optional(), + source: SourceRead, + destination: DestinationRead, + operations: z.array(OperationRead).optional(), + latestSyncJobCreatedAt: JobCreatedAt.int().optional(), + latestSyncJobStatus: JobStatus.optional(), + isSyncing: z.boolean(), + resourceRequirements: ResourceRequirements.optional(), + catalogId: z.string().uuid().optional(), + catalogDiff: CatalogDiff.optional(), + geography: Geography.optional(), + schemaChange: SchemaChange, + notifySchemaChanges: z.boolean(), + nonBreakingChangesPreference: NonBreakingChangesPreference, +}); +const WebBackendConnectionCreate = z.object({ + name: z.string().optional(), + namespaceDefinition: NamespaceDefinitionType.optional(), + namespaceFormat: z.string().optional(), + prefix: z.string().optional(), + sourceId: SourceId.uuid(), + destinationId: DestinationId.uuid(), + operationIds: z.array(OperationId).optional(), + syncCatalog: AirbyteCatalog.optional(), + schedule: ConnectionSchedule.optional(), + scheduleType: ConnectionScheduleType.optional(), + scheduleData: ConnectionScheduleData.optional(), + status: ConnectionStatus, + resourceRequirements: ResourceRequirements.optional(), + operations: z.array(OperationCreate).optional(), + sourceCatalogId: z.string().uuid().optional(), + geography: Geography.optional(), + nonBreakingChangesPreference: NonBreakingChangesPreference.optional(), +}); +const WebBackendOperationCreateOrUpdate = z.object({ + operationId: OperationId.uuid().optional(), + workspaceId: WorkspaceId.uuid(), + name: z.string(), + operatorConfiguration: OperatorConfiguration, +}); +const WebBackendConnectionUpdate = z.object({ + name: z.string().optional(), + connectionId: ConnectionId.uuid(), + namespaceDefinition: NamespaceDefinitionType.optional(), + namespaceFormat: z.string().optional(), + prefix: z.string().optional(), + syncCatalog: AirbyteCatalog.optional(), + schedule: ConnectionSchedule.optional(), + scheduleType: ConnectionScheduleType.optional(), + scheduleData: ConnectionScheduleData.optional(), + status: ConnectionStatus.optional(), + resourceRequirements: ResourceRequirements.optional(), + skipReset: z.boolean().optional(), + operations: z.array(WebBackendOperationCreateOrUpdate).optional(), + sourceCatalogId: z.string().uuid().optional(), + geography: Geography.optional(), + notifySchemaChanges: z.boolean().optional(), + nonBreakingChangesPreference: NonBreakingChangesPreference.optional(), +}); +const WebBackendWorkspaceState = z.object({ workspaceId: WorkspaceId.uuid() }); +const WebBackendWorkspaceStateResult = z.object({ + hasConnections: z.boolean(), + hasSources: z.boolean(), + hasDestinations: z.boolean(), +}); +const WebBackendGeographiesListResult = z.object({ + geographies: z.array(Geography), +}); +const Pagination = z + .object({ pageSize: z.number().int(), rowOffset: z.number().int() }) + .partial(); +const JobListRequestBody = z.object({ + configTypes: z.array(JobConfigType), + configId: z.string(), + includingJobId: JobId.int().optional(), + pagination: Pagination.optional(), +}); +const JobWithAttemptsRead = z + .object({ job: JobRead, attempts: z.array(AttemptRead) }) + .partial(); +const JobReadList = z.object({ + jobs: z.array(JobWithAttemptsRead), + totalJobCount: z.number().int(), +}); +const JobIdRequestBody = z.object({ id: JobId.int() }); +const JobOptionalRead = z.object({ job: JobRead }).partial(); +const JobInfoLightRead = z.object({ job: JobRead }); +const JobDebugRead = z.object({ + id: JobId.int(), + configType: JobConfigType, + configId: z.string(), + status: JobStatus, + airbyteVersion: z.string(), + sourceDefinition: SourceDefinitionRead, + destinationDefinition: DestinationDefinitionRead, +}); +const WorkflowStateRead = z.object({ running: z.boolean() }); +const JobDebugInfoRead = z.object({ + job: JobDebugRead, + attempts: z.array(AttemptInfoRead), + workflowState: WorkflowStateRead.optional(), +}); +const AttemptNumber = z.number(); +const AttemptNormalizationStatusRead = z + .object({ + attemptNumber: AttemptNumber.int(), + hasRecordsCommitted: z.boolean(), + recordsCommitted: z.number().int(), + hasNormalizationFailed: z.boolean(), + }) + .partial(); +const AttemptNormalizationStatusReadList = z + .object({ + attemptNormalizationStatuses: z.array(AttemptNormalizationStatusRead), + }) + .partial(); +const HealthCheckRead = z.object({ available: z.boolean() }); +const LogType = z.enum(["server", "scheduler"]); +const LogsRequestBody = z.object({ logType: LogType }); +const WorkflowId = z.string(); +const SetWorkflowInAttemptRequestBody = z.object({ + jobId: JobId.int(), + attemptNumber: AttemptNumber.int(), + workflowId: WorkflowId, + processingTaskQueue: z.string().optional(), +}); +const InternalOperationResult = z.object({ succeeded: z.boolean() }); +const SaveStatsRequestBody = z.object({ + jobId: JobId.int(), + attemptNumber: AttemptNumber.int(), + stats: AttemptStats, + streamStats: z.array(AttemptStreamStats).optional(), +}); +const AttemptSyncConfig = z.object({ + sourceConfiguration: SourceConfiguration, + destinationConfiguration: DestinationConfiguration, + state: ConnectionState.optional(), +}); +const SaveAttemptSyncConfigRequestBody = z.object({ + jobId: JobId.int(), + attemptNumber: AttemptNumber.int(), + syncConfig: AttemptSyncConfig, +}); + +const endpoints = makeApi([ + { + method: "post", + path: "/v1/attempt/save_stats", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SaveStatsRequestBody, + }, + ], + response: z.object({ succeeded: z.boolean() }), + }, + { + method: "post", + path: "/v1/attempt/save_sync_config", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SaveAttemptSyncConfigRequestBody, + }, + ], + response: z.object({ succeeded: z.boolean() }), + }, + { + method: "post", + path: "/v1/attempt/set_workflow_in_attempt", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SetWorkflowInAttemptRequestBody, + }, + ], + response: z.object({ succeeded: z.boolean() }), + }, + { + method: "post", + path: "/v1/connections/create", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: ConnectionCreate, + }, + ], + response: ConnectionRead, + errors: [ + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/connections/delete", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: ConnectionIdRequestBody, + }, + ], + response: z.void(), + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/connections/get", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: ConnectionIdRequestBody, + }, + ], + response: ConnectionRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/connections/list", + description: `List connections for workspace. Does not return deleted connections.`, + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: WorkspaceIdRequestBody, + }, + ], + response: ConnectionReadList, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/connections/list_all", + description: `List connections for workspace, including deleted connections.`, + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: WorkspaceIdRequestBody, + }, + ], + response: ConnectionReadList, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/connections/reset", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: ConnectionIdRequestBody, + }, + ], + response: JobInfoRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/connections/search", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: ConnectionSearch, + }, + ], + response: ConnectionReadList, + errors: [ + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/connections/sync", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: ConnectionIdRequestBody, + }, + ], + response: JobInfoRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/connections/update", + description: `Apply a patch-style update to a connection. Only fields present on the update request body will be updated. +Note that if a catalog is present in the request body, the connection's entire catalog will be replaced +with the catalog from the request. This means that to modify a single stream, the entire new catalog +containing the updated stream needs to be sent. +`, + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: ConnectionUpdate, + }, + ], + response: ConnectionRead, + errors: [ + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/destination_definition_specifications/get", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: DestinationDefinitionIdWithWorkspaceId, + }, + ], + response: DestinationDefinitionSpecificationRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/destination_definitions/create_custom", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: CustomDestinationDefinitionCreate, + }, + ], + response: DestinationDefinitionRead, + errors: [ + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/destination_definitions/delete", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: DestinationDefinitionIdRequestBody, + }, + ], + response: z.void(), + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/destination_definitions/get", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: DestinationDefinitionIdRequestBody, + }, + ], + response: DestinationDefinitionRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/destination_definitions/get_for_workspace", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: DestinationDefinitionIdWithWorkspaceId, + }, + ], + response: DestinationDefinitionRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/destination_definitions/grant_definition", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: DestinationDefinitionIdWithWorkspaceId, + }, + ], + response: PrivateDestinationDefinitionRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/destination_definitions/list", + requestFormat: "json", + response: DestinationDefinitionReadList, + }, + { + method: "post", + path: "/v1/destination_definitions/list_for_workspace", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: WorkspaceIdRequestBody, + }, + ], + response: DestinationDefinitionReadList, + }, + { + method: "post", + path: "/v1/destination_definitions/list_latest", + description: `Guaranteed to retrieve the latest information on supported destinations.`, + requestFormat: "json", + response: DestinationDefinitionReadList, + }, + { + method: "post", + path: "/v1/destination_definitions/list_private", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: WorkspaceIdRequestBody, + }, + ], + response: PrivateDestinationDefinitionReadList, + }, + { + method: "post", + path: "/v1/destination_definitions/revoke_definition", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: DestinationDefinitionIdWithWorkspaceId, + }, + ], + response: z.void(), + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/destination_definitions/update", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: DestinationDefinitionUpdate, + }, + ], + response: DestinationDefinitionRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/destination_oauths/complete_oauth", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: CompleteDestinationOAuthRequest, + }, + ], + response: z.object({}).partial().passthrough(), + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/destination_oauths/get_consent_url", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: DestinationOauthConsentRequest, + }, + ], + response: z.object({ consentUrl: z.string() }), + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/destination_oauths/oauth_params/create", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SetInstancewideDestinationOauthParamsRequestBody, + }, + ], + response: z.void(), + errors: [ + { + status: 400, + schema: z.void(), + }, + { + status: 404, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/destinations/check_connection", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: DestinationIdRequestBody, + }, + ], + response: CheckConnectionRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/destinations/check_connection_for_update", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: DestinationUpdate, + }, + ], + response: CheckConnectionRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/destinations/clone", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: DestinationCloneRequestBody, + }, + ], + response: DestinationRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/destinations/create", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: DestinationCreate, + }, + ], + response: DestinationRead, + errors: [ + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/destinations/delete", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: DestinationIdRequestBody, + }, + ], + response: z.void(), + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/destinations/get", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: DestinationIdRequestBody, + }, + ], + response: DestinationRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/destinations/list", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: WorkspaceIdRequestBody, + }, + ], + response: DestinationReadList, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/destinations/search", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: DestinationSearch, + }, + ], + response: DestinationReadList, + errors: [ + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/destinations/update", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: DestinationUpdate, + }, + ], + response: DestinationRead, + errors: [ + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "get", + path: "/v1/health", + requestFormat: "json", + response: z.object({ available: z.boolean() }), + }, + { + method: "post", + path: "/v1/jobs/cancel", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: JobIdRequestBody, + }, + ], + response: JobInfoRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/jobs/get", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: JobIdRequestBody, + }, + ], + response: JobInfoRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/jobs/get_debug_info", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: JobIdRequestBody, + }, + ], + response: JobDebugInfoRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/jobs/get_last_replication_job", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: ConnectionIdRequestBody, + }, + ], + response: JobOptionalRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/jobs/get_light", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: JobIdRequestBody, + }, + ], + response: JobInfoLightRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/jobs/get_normalization_status", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: JobIdRequestBody, + }, + ], + response: AttemptNormalizationStatusReadList, + }, + { + method: "post", + path: "/v1/jobs/list", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: JobListRequestBody, + }, + ], + response: JobReadList, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/logs/get", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: LogsRequestBody, + }, + ], + response: z.void(), + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/notifications/try", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: Notification, + }, + ], + response: NotificationRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "get", + path: "/v1/openapi", + requestFormat: "json", + response: z.void(), + }, + { + method: "post", + path: "/v1/operations/check", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: OperatorConfiguration, + }, + ], + response: CheckOperationRead, + errors: [ + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/operations/create", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: OperationCreate, + }, + ], + response: OperationRead, + errors: [ + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/operations/delete", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: OperationIdRequestBody, + }, + ], + response: z.void(), + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/operations/get", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: OperationIdRequestBody, + }, + ], + response: OperationRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/operations/list", + description: `List operations for connection.`, + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: ConnectionIdRequestBody, + }, + ], + response: OperationReadList, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/operations/update", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: OperationUpdate, + }, + ], + response: OperationRead, + errors: [ + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/scheduler/destinations/check_connection", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: DestinationCoreConfig, + }, + ], + response: CheckConnectionRead, + errors: [ + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/scheduler/sources/check_connection", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SourceCoreConfig, + }, + ], + response: CheckConnectionRead, + errors: [ + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/scheduler/sources/discover_schema", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SourceCoreConfig, + }, + ], + response: SourceDiscoverSchemaRead, + errors: [ + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/source_definition_specifications/get", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SourceDefinitionIdWithWorkspaceId, + }, + ], + response: SourceDefinitionSpecificationRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/source_definitions/create_custom", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: CustomSourceDefinitionCreate, + }, + ], + response: SourceDefinitionRead, + errors: [ + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/source_definitions/delete", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SourceDefinitionIdRequestBody, + }, + ], + response: z.void(), + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/source_definitions/get", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SourceDefinitionIdRequestBody, + }, + ], + response: SourceDefinitionRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/source_definitions/get_for_workspace", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SourceDefinitionIdWithWorkspaceId, + }, + ], + response: SourceDefinitionRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/source_definitions/grant_definition", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SourceDefinitionIdWithWorkspaceId, + }, + ], + response: PrivateSourceDefinitionRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/source_definitions/list", + requestFormat: "json", + response: SourceDefinitionReadList, + }, + { + method: "post", + path: "/v1/source_definitions/list_for_workspace", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: WorkspaceIdRequestBody, + }, + ], + response: SourceDefinitionReadList, + }, + { + method: "post", + path: "/v1/source_definitions/list_latest", + description: `Guaranteed to retrieve the latest information on supported sources.`, + requestFormat: "json", + response: SourceDefinitionReadList, + }, + { + method: "post", + path: "/v1/source_definitions/list_private", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: WorkspaceIdRequestBody, + }, + ], + response: PrivateSourceDefinitionReadList, + }, + { + method: "post", + path: "/v1/source_definitions/revoke_definition", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SourceDefinitionIdWithWorkspaceId, + }, + ], + response: z.void(), + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/source_definitions/update", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SourceDefinitionUpdate, + }, + ], + response: SourceDefinitionRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/source_oauths/complete_oauth", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: CompleteSourceOauthRequest, + }, + ], + response: z.object({}).partial().passthrough(), + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/source_oauths/get_consent_url", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SourceOauthConsentRequest, + }, + ], + response: z.object({ consentUrl: z.string() }), + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/source_oauths/oauth_params/create", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SetInstancewideSourceOauthParamsRequestBody, + }, + ], + response: z.void(), + errors: [ + { + status: 400, + schema: z.void(), + }, + { + status: 404, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/sources/check_connection", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SourceIdRequestBody, + }, + ], + response: CheckConnectionRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/sources/check_connection_for_update", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SourceUpdate, + }, + ], + response: CheckConnectionRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/sources/clone", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SourceCloneRequestBody, + }, + ], + response: SourceRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/sources/create", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SourceCreate, + }, + ], + response: SourceRead, + errors: [ + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/sources/delete", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SourceIdRequestBody, + }, + ], + response: z.void(), + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/sources/discover_schema", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SourceDiscoverSchemaRequestBody, + }, + ], + response: SourceDiscoverSchemaRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/sources/get", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SourceIdRequestBody, + }, + ], + response: SourceRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/sources/list", + description: `List sources for workspace. Does not return deleted sources.`, + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: WorkspaceIdRequestBody, + }, + ], + response: SourceReadList, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/sources/most_recent_source_actor_catalog", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SourceIdRequestBody, + }, + ], + response: ActorCatalogWithUpdatedAt, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/sources/search", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SourceSearch, + }, + ], + response: SourceReadList, + errors: [ + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/sources/update", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SourceUpdate, + }, + ], + response: SourceRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/sources/write_discover_catalog_result", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: SourceDiscoverSchemaWriteRequestBody, + }, + ], + response: z.object({ catalogId: z.string().uuid() }), + }, + { + method: "post", + path: "/v1/state/create_or_update", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: ConnectionStateCreateOrUpdate, + }, + ], + response: ConnectionState, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/state/get", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: ConnectionIdRequestBody, + }, + ], + response: ConnectionState, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/web_backend/check_updates", + requestFormat: "json", + response: WebBackendCheckUpdatesRead, + }, + { + method: "post", + path: "/v1/web_backend/connections/create", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: WebBackendConnectionCreate, + }, + ], + response: WebBackendConnectionRead, + errors: [ + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/web_backend/connections/get", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: WebBackendConnectionRequestBody, + }, + ], + response: WebBackendConnectionRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/web_backend/connections/list", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: WebBackendConnectionListRequestBody, + }, + ], + response: WebBackendConnectionReadList, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/web_backend/connections/update", + description: `Apply a patch-style update to a connection. Only fields present on the update request body will be updated. +Any operations that lack an ID will be created. Then, the newly created operationId will be applied to the +connection along with the rest of the operationIds in the request body. +Apply a patch-style update to a connection. Only fields present on the update request body will be updated. +Note that if a catalog is present in the request body, the connection's entire catalog will be replaced +with the catalog from the request. This means that to modify a single stream, the entire new catalog +containing the updated stream needs to be sent. +`, + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: WebBackendConnectionUpdate, + }, + ], + response: WebBackendConnectionRead, + errors: [ + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/web_backend/geographies/list", + description: `Returns all available geographies in which a data sync can run.`, + requestFormat: "json", + response: WebBackendGeographiesListResult, + }, + { + method: "post", + path: "/v1/web_backend/state/get_type", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: ConnectionIdRequestBody, + }, + ], + response: z.enum(["global", "stream", "legacy", "not_set"]), + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/web_backend/workspace/state", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: WebBackendWorkspaceState, + }, + ], + response: WebBackendWorkspaceStateResult, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/workspaces/create", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: WorkspaceCreate, + }, + ], + response: WorkspaceRead, + errors: [ + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/workspaces/delete", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: WorkspaceIdRequestBody, + }, + ], + response: z.void(), + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/workspaces/get", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: WorkspaceIdRequestBody, + }, + ], + response: WorkspaceRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/workspaces/get_by_connection_id", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: ConnectionIdRequestBody, + }, + ], + response: WorkspaceRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/workspaces/get_by_slug", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: z.object({ slug: z.string() }), + }, + ], + response: WorkspaceRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/workspaces/list", + requestFormat: "json", + response: WorkspaceReadList, + }, + { + method: "post", + path: "/v1/workspaces/tag_feedback_status_as_done", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: WorkspaceGiveFeedback, + }, + ], + response: z.void(), + errors: [ + { + status: 404, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/workspaces/update", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: WorkspaceUpdate, + }, + ], + response: WorkspaceRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, + { + method: "post", + path: "/v1/workspaces/update_name", + requestFormat: "json", + parameters: [ + { + name: "body", + type: "Body", + schema: WorkspaceUpdateName, + }, + ], + response: WorkspaceRead, + errors: [ + { + status: 404, + schema: z.void(), + }, + { + status: 422, + schema: z.void(), + }, + ], + }, +]); + +export const api = new ZodiosCore(endpoints); diff --git a/packages/core/examples/aitbytes-test.ts b/packages/core/examples/aitbytes-test.ts new file mode 100644 index 00000000..83db1d60 --- /dev/null +++ b/packages/core/examples/aitbytes-test.ts @@ -0,0 +1,11 @@ +import { api } from "./airbytes-api"; + +api + .post("/v1/connections/list", { + body: { + workspaceId: "123", + }, + }) + .then((res) => { + console.log(res); + }); diff --git a/packages/core/examples/jsonplaceholder.ts b/packages/core/examples/jsonplaceholder.ts index 568cfee6..401cf085 100644 --- a/packages/core/examples/jsonplaceholder.ts +++ b/packages/core/examples/jsonplaceholder.ts @@ -2,12 +2,12 @@ import { ApiOf, ZodiosResponseByAlias, ZodiosHeaderParamsByAlias, - Zodios, + ZodiosCore, } from "../src/index"; import { z } from "zod"; async function bootstrap() { - const apiClient = new Zodios("https://jsonplaceholder.typicode.com", [ + const apiClient = new ZodiosCore("https://jsonplaceholder.typicode.com", [ { method: "get", path: "/users", @@ -78,17 +78,14 @@ async function bootstrap() { console.log(users); const user = await apiClient.getUser({ params: { id: 7 } }); console.log(user); - const createdUser = await apiClient.createUser( - { name: "john doe" }, - { - headers: { - "Content-Type": "application/json", - Accept: "application/json", - }, - } - ); + const createdUser = await apiClient.createUser({ + body: { name: "john doe" }, + headers: { + "Content-Type": "application/json", + }, + }); console.log(createdUser); - const deletedUser = await apiClient.deleteUser(undefined, { + const deletedUser = await apiClient.deleteUser({ params: { id: 7 }, }); console.log(deletedUser); diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index fecf3ce8..127e094b 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -28,8 +28,8 @@ export type { ZodiosQueryParamsForEndpoint, ZodiosQueryParamsByPath, ZodiosQueryParamsByAlias, - ZodiosEndpointDefinitionByPath, - ZodiosEndpointDefinitionByAlias, + FindZodiosEndpointDefinitionByPath, + FindZodiosEndpointDefinitionByAlias, ZodiosErrorForEndpoint, ZodiosErrorByPath, ZodiosErrorByAlias, diff --git a/packages/core/src/utils.types.ts b/packages/core/src/utils.types.ts index 5b814140..313bba4a 100644 --- a/packages/core/src/utils.types.ts +++ b/packages/core/src/utils.types.ts @@ -18,10 +18,24 @@ export type FilterArrayByValue< : FilterArrayByValue : Acc; -type Test = FilterArrayByValue< - readonly [{ hello: "world"; world: "hello" }, { hello: "world" }], - { hello: "world" } ->; +/** + * find the first value in an array type that matches a predicate + * @param T - array type + * @param C - predicate object to match + * @details - this is using tail recursion type optimization from typescript 4.5 + */ +export type ArrayFindByValue< + T extends readonly unknown[] | unknown[] | undefined, + C +> = T extends readonly [infer Head, ...infer Tail] + ? Head extends C + ? Head + : ArrayFindByValue + : T extends [infer Head, ...infer Tail] + ? Head extends C + ? Head + : ArrayFindByValue + : never; /** * filter an array type by key diff --git a/packages/core/src/zodios.test.ts b/packages/core/src/zodios.test.ts index 4ffab86c..359700ea 100644 --- a/packages/core/src/zodios.test.ts +++ b/packages/core/src/zodios.test.ts @@ -43,7 +43,7 @@ import { import type { Assert } from "./utils.types"; import { - ZodiosEndpointDefinitionByPath, + FindZodiosEndpointDefinitionByPath, ZodiosMatchingErrorsByPath, } from "./zodios.types"; import { @@ -1053,11 +1053,11 @@ describe("Zodios", () => { MockProvider, ZodTypeProvider >; - type Test2 = ZodiosEndpointDefinitionByPath< + type Test2 = FindZodiosEndpointDefinitionByPath< ApiOf, "get", "/error502" - >[number]["errors"]; + >["errors"]; expect(error).toBeInstanceOf(Error); // @ts-ignore diff --git a/packages/core/src/zodios.types.ts b/packages/core/src/zodios.types.ts index e74ea79e..68623288 100644 --- a/packages/core/src/zodios.types.ts +++ b/packages/core/src/zodios.types.ts @@ -10,6 +10,7 @@ import type { FilterArrayByKey, IfEquals, RequiredKeys, + ArrayFindByValue, } from "./utils.types"; import type { AnyZodiosTypeProvider, @@ -54,16 +55,16 @@ type EndpointDefinitionsByMethod< M extends Method > = FilterArrayByValue; -export type ZodiosEndpointDefinitionByPath< +export type FindZodiosEndpointDefinitionByPath< Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], M extends Method, Path extends ZodiosPathsByMethod -> = FilterArrayByValue; +> = ArrayFindByValue; -export type ZodiosEndpointDefinitionByAlias< +export type FindZodiosEndpointDefinitionByAlias< Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], Alias extends string -> = FilterArrayByValue; +> = ArrayFindByValue; export type ZodiosPathsByMethod< Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], @@ -91,11 +92,11 @@ export type ZodiosResponseByPath< > = Frontend extends true ? InferOutputTypeFromSchema< TypeProvider, - ZodiosEndpointDefinitionByPath[number]["response"] + FindZodiosEndpointDefinitionByPath["response"] > : InferInputTypeFromSchema< TypeProvider, - ZodiosEndpointDefinitionByPath[number]["response"] + FindZodiosEndpointDefinitionByPath["response"] >; export type ZodiosResponseByAlias< @@ -106,11 +107,11 @@ export type ZodiosResponseByAlias< > = Frontend extends true ? InferOutputTypeFromSchema< TypeProvider, - ZodiosEndpointDefinitionByAlias[number]["response"] + FindZodiosEndpointDefinitionByAlias["response"] > : InferInputTypeFromSchema< TypeProvider, - ZodiosEndpointDefinitionByAlias[number]["response"] + FindZodiosEndpointDefinitionByAlias["response"] >; export type ZodiosDefaultErrorForEndpoint< @@ -127,7 +128,7 @@ type ZodiosDefaultErrorByPath< M extends Method, Path extends ZodiosPathsByMethod > = FilterArrayByValue< - ZodiosEndpointDefinitionByPath[number]["errors"], + FindZodiosEndpointDefinitionByPath["errors"], { status: "default"; } @@ -137,7 +138,7 @@ type ZodiosDefaultErrorByAlias< Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], Alias extends string > = FilterArrayByValue< - ZodiosEndpointDefinitionByAlias[number]["errors"], + FindZodiosEndpointDefinitionByAlias["errors"], { status: "default"; } @@ -188,7 +189,7 @@ export type ZodiosErrorByPath< TypeProvider, IfNever< FilterArrayByValue< - ZodiosEndpointDefinitionByPath[number]["errors"], + FindZodiosEndpointDefinitionByPath["errors"], { status: Status; } @@ -200,7 +201,7 @@ export type ZodiosErrorByPath< TypeProvider, IfNever< FilterArrayByValue< - ZodiosEndpointDefinitionByPath[number]["errors"], + FindZodiosEndpointDefinitionByPath["errors"], { status: Status; } @@ -218,19 +219,19 @@ export type ZodiosErrorsByPath< > = Frontend extends true ? InferOutputTypeFromSchema< TypeProvider, - ZodiosEndpointDefinitionByPath< + FindZodiosEndpointDefinitionByPath< Api, M, Path - >[number]["errors"][number]["schema"] + >["errors"][number]["schema"] > : InferInputTypeFromSchema< TypeProvider, - ZodiosEndpointDefinitionByPath< + FindZodiosEndpointDefinitionByPath< Api, M, Path - >[number]["errors"][number]["schema"] + >["errors"][number]["schema"] >; export type ZodiosErrorsByAlias< @@ -242,11 +243,11 @@ export type ZodiosErrorsByAlias< > = Frontend extends true ? InferOutputTypeFromSchema< TypeProvider, - ZodiosEndpointDefinitionByAlias[number]["errors"] + FindZodiosEndpointDefinitionByAlias["errors"] > : InferInputTypeFromSchema< TypeProvider, - ZodiosEndpointDefinitionByAlias[number]["errors"] + FindZodiosEndpointDefinitionByAlias["errors"] >; export type InferFetcherErrors< @@ -301,7 +302,7 @@ export type ZodiosMatchingErrorsByPath< FetcherProvider extends AnyZodiosFetcherProvider, TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider > = InferFetcherErrors< - ZodiosEndpointDefinitionByPath[number]["errors"], + FindZodiosEndpointDefinitionByPath["errors"], TypeProvider, FetcherProvider >[number]; @@ -312,7 +313,7 @@ export type ZodiosMatchingErrorsByAlias< FetcherProvider extends AnyZodiosFetcherProvider, TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider > = InferFetcherErrors< - ZodiosEndpointDefinitionByAlias[number]["errors"], + FindZodiosEndpointDefinitionByAlias["errors"], TypeProvider, FetcherProvider >[number]; @@ -328,7 +329,7 @@ export type ZodiosErrorByAlias< TypeProvider, IfNever< FilterArrayByValue< - ZodiosEndpointDefinitionByAlias[number]["errors"], + FindZodiosEndpointDefinitionByAlias["errors"], { status: Status; } @@ -340,7 +341,7 @@ export type ZodiosErrorByAlias< TypeProvider, IfNever< FilterArrayByValue< - ZodiosEndpointDefinitionByAlias[number]["errors"], + FindZodiosEndpointDefinitionByAlias["errors"], { status: Status; } @@ -349,20 +350,17 @@ export type ZodiosErrorByAlias< > >; -export type BodySchemaForEndpoint = - FilterArrayByValue< - Endpoint["parameters"], - { type: "Body" } - >[number]["schema"]; +type BodySchemaForEndpoint = + ArrayFindByValue["schema"]; -export type BodySchema< +type BodySchema< Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], M extends Method, Path extends ZodiosPathsByMethod -> = FilterArrayByValue< - ZodiosEndpointDefinitionByPath[number]["parameters"], +> = ArrayFindByValue< + FindZodiosEndpointDefinitionByPath["parameters"], { type: "Body" } ->[number]["schema"]; +>["schema"]; export type ZodiosBodyForEndpoint< Endpoint extends ZodiosEndpointDefinition, @@ -385,10 +383,10 @@ export type ZodiosBodyByPath< export type BodySchemaByAlias< Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], Alias extends string -> = FilterArrayByValue< - ZodiosEndpointDefinitionByAlias[number]["parameters"], +> = ArrayFindByValue< + FindZodiosEndpointDefinitionByAlias["parameters"], { type: "Body" } ->[number]["schema"]; +>["schema"]; export type ZodiosBodyByAlias< Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], @@ -456,7 +454,7 @@ export type ZodiosQueryParamsByPath< UndefinedToOptional< MapSchemaParameters< FilterArrayByValue< - ZodiosEndpointDefinitionByPath[number]["parameters"], + FindZodiosEndpointDefinitionByPath["parameters"], { type: "Query" } >, Frontend, @@ -474,7 +472,7 @@ export type ZodiosQueryParamsByAlias< UndefinedToOptional< MapSchemaParameters< FilterArrayByValue< - ZodiosEndpointDefinitionByAlias[number]["parameters"], + FindZodiosEndpointDefinitionByAlias["parameters"], { type: "Query" } >, Frontend, @@ -518,7 +516,7 @@ export type ZodiosPathParamsByPath< TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, PathParameters = MapSchemaParameters< FilterArrayByValue< - ZodiosEndpointDefinitionByPath[number]["parameters"], + FindZodiosEndpointDefinitionByPath["parameters"], { type: "Path" } >, Frontend, @@ -538,10 +536,10 @@ export type ZodiosPathParamByAlias< Alias extends string, Frontend extends boolean = true, TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, - EndpointDefinition extends ZodiosEndpointDefinition = ZodiosEndpointDefinitionByAlias< + EndpointDefinition extends ZodiosEndpointDefinition = FindZodiosEndpointDefinitionByAlias< Api, Alias - >[number], + >, Path = EndpointDefinition["path"], PathParameters = MapSchemaParameters< FilterArrayByValue, @@ -578,7 +576,7 @@ export type ZodiosHeaderParamsByPath< UndefinedToOptional< MapSchemaParameters< FilterArrayByValue< - ZodiosEndpointDefinitionByPath[number]["parameters"], + FindZodiosEndpointDefinitionByPath["parameters"], { type: "Header" } >, Frontend, @@ -596,7 +594,7 @@ export type ZodiosHeaderParamsByAlias< UndefinedToOptional< MapSchemaParameters< FilterArrayByValue< - ZodiosEndpointDefinitionByAlias[number]["parameters"], + FindZodiosEndpointDefinitionByAlias["parameters"], { type: "Header" } >, Frontend, From 99aa78b8be19cb17d8d909a1ac35e9fcf9fa681a Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sun, 16 Apr 2023 14:34:10 +0200 Subject: [PATCH 133/206] fix(express): node create server compatibility --- .../{aitbytes-test.ts => aitbytes.ts} | 0 packages/express/src/zodios.ts | 47 +++++++++++++------ packages/express/src/zodios.types.ts | 15 +++++- 3 files changed, 46 insertions(+), 16 deletions(-) rename packages/core/examples/{aitbytes-test.ts => aitbytes.ts} (100%) diff --git a/packages/core/examples/aitbytes-test.ts b/packages/core/examples/aitbytes.ts similarity index 100% rename from packages/core/examples/aitbytes-test.ts rename to packages/core/examples/aitbytes.ts diff --git a/packages/express/src/zodios.ts b/packages/express/src/zodios.ts index be80286a..0cf269c8 100644 --- a/packages/express/src/zodios.ts +++ b/packages/express/src/zodios.ts @@ -25,7 +25,9 @@ import { zodTypeFactory } from "./type-providers/zod.type-provider"; */ export function zodiosApp< ContextSchema, - const Api extends readonly ZodiosEndpointDefinition[]|ZodiosEndpointDefinition[] = any, + const Api extends + | readonly ZodiosEndpointDefinition[] + | ZodiosEndpointDefinition[] = any, TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider >( api?: Api, @@ -48,7 +50,7 @@ export function zodiosApp< app.use(express.json()); } if (api && validate) { - injectParametersValidators(api, app, transform,typeFactory); + injectParametersValidators(api, app, transform, typeFactory); } return app as any; } @@ -60,7 +62,9 @@ export function zodiosApp< * @returns */ export function zodiosRouter< - const Api extends readonly ZodiosEndpointDefinition[]|ZodiosEndpointDefinition[], + const Api extends + | readonly ZodiosEndpointDefinition[] + | ZodiosEndpointDefinition[], ContextSchema, TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider >( @@ -73,11 +77,12 @@ export function zodiosRouter< : InferInputTypeFromSchema, TypeProvider > { - const { - validate = true, - transform = true, + const { + validate = true, + transform = true, typeFactory = zodTypeFactory, - ...routerOptions } = options; + ...routerOptions + } = options; const router = options?.router ?? express.Router(routerOptions); if (validate) { injectParametersValidators(api, router, transform, typeFactory); @@ -92,7 +97,9 @@ export function zodiosRouter< */ export function zodiosNextApp< ContextSchema, - const Api extends readonly ZodiosEndpointDefinition[]|ZodiosEndpointDefinition[] = any, + const Api extends + | readonly ZodiosEndpointDefinition[] + | ZodiosEndpointDefinition[] = any, TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider >( api?: Api, @@ -124,7 +131,11 @@ export class ZodiosContext< this.typeFactory = options?.typeFactory ?? (zodTypeFactory as any); } - app( + app< + const Api extends + | readonly ZodiosEndpointDefinition[] + | ZodiosEndpointDefinition[] = any + >( api?: Api, options?: ZodiosAppOptions ): ZodiosApp< @@ -134,10 +145,14 @@ export class ZodiosContext< : InferInputTypeFromSchema, TypeProvider > { - return zodiosApp(api, {...options, typeFactory: this.typeFactory}); + return zodiosApp(api, { ...options, typeFactory: this.typeFactory }); } - nextApp( + nextApp< + const Api extends + | readonly ZodiosEndpointDefinition[] + | ZodiosEndpointDefinition[] = any + >( api?: Api, options?: ZodiosAppOptions ): ZodiosApp< @@ -147,10 +162,14 @@ export class ZodiosContext< : InferInputTypeFromSchema, TypeProvider > { - return zodiosNextApp(api, {...options, typeFactory: this.typeFactory}); + return zodiosNextApp(api, { ...options, typeFactory: this.typeFactory }); } - router( + router< + const Api extends + | readonly ZodiosEndpointDefinition[] + | ZodiosEndpointDefinition[] + >( api: Api, options?: RouterOptions & ZodiosRouterOptions ): ZodiosRouter< @@ -160,7 +179,7 @@ export class ZodiosContext< : InferInputTypeFromSchema, TypeProvider > { - return zodiosRouter(api, {...options, typeFactory: this.typeFactory}); + return zodiosRouter(api, { ...options, typeFactory: this.typeFactory }); } } diff --git a/packages/express/src/zodios.types.ts b/packages/express/src/zodios.types.ts index d500108d..bf4f9b24 100644 --- a/packages/express/src/zodios.types.ts +++ b/packages/express/src/zodios.types.ts @@ -1,5 +1,6 @@ import express from "express"; import type { Request, Response, NextFunction } from "express"; +import http from "node:http"; import { ZodiosEndpointDefinition, ZodiosErrorByPath, @@ -158,14 +159,24 @@ export interface ZodiosRouterOptions< export interface ZodiosUnknownApp extends Omit, "use">, - ZodiosRouterMiddlewares {} + ZodiosRouterMiddlewares { + ( + req: Request | http.IncomingMessage, + res: Response | http.ServerResponse + ): any; +} export interface ZodiosApiApp< Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], Context, TypeProvider extends AnyZodiosTypeProvider > extends Omit, Method | "use">, - ZodiosRouterMethodMiddlewares {} + ZodiosRouterMethodMiddlewares { + ( + req: Request | http.IncomingMessage, + res: Response | http.ServerResponse + ): any; +} export type ZodiosApp< Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], From 398f791c5b038385bb40fb8498193f36a6ac7b60 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sun, 16 Apr 2023 20:06:57 +0200 Subject: [PATCH 134/206] fix: match errors --- packages/core/src/api.test.ts | 245 ++++++++++++++++++++++++++++++- packages/core/src/api.ts | 43 ++---- packages/core/src/utils.ts | 21 +-- packages/core/src/zodios.test.ts | 67 +++++++-- packages/react/src/hooks.ts | 15 +- 5 files changed, 327 insertions(+), 64 deletions(-) diff --git a/packages/core/src/api.test.ts b/packages/core/src/api.test.ts index 0661a741..567b00f9 100644 --- a/packages/core/src/api.test.ts +++ b/packages/core/src/api.test.ts @@ -1,12 +1,253 @@ import z from "zod"; -import { makeApi, mergeApis } from "./index"; -import { Assert, ReadonlyDeep } from "./utils.types"; +import { makeApi, mergeApis, parametersBuilder } from "./index"; +import { Assert } from "./utils.types"; const userSchema = z.object({ id: z.number(), name: z.string(), }); +describe("makeApi", () => { + it("should throw on duplicate path", () => { + expect(() => + makeApi([ + { + method: "get", + path: "/users", + alias: "getUsers", + description: "Get all users", + response: z.array(userSchema), + }, + { + method: "get", + path: "/users", + alias: "getUsers2", + description: "Get all users", + response: z.array(userSchema), + }, + ]) + ).toThrowError("Zodios: Duplicate path 'get /users'"); + }); + + it("should throw on duplicate alias", () => { + expect(() => + makeApi([ + { + method: "get", + path: "/users", + alias: "getUsers", + description: "Get all users", + response: z.array(userSchema), + }, + { + method: "get", + path: "/users2", + alias: "getUsers", + description: "Get all users", + response: z.array(userSchema), + }, + ]) + ).toThrowError("Zodios: Duplicate alias 'getUsers'"); + }); + + it("should throw on duplicate Body", () => { + expect(() => + makeApi([ + { + method: "post", + path: "/users", + alias: "createUser", + description: "Create a user", + parameters: [ + { + name: "first", + type: "Body", + description: "The object to create", + schema: userSchema.partial(), + }, + { + name: "second", + type: "Body", + description: "The object to create", + schema: userSchema.partial(), + }, + ], + response: userSchema, + }, + ]) + ).toThrowError("Zodios: Multiple body parameters in endpoint '/users'"); + }); + + it("should build with parameters (Path,Query,Body,Header)", () => { + // get users api with query filter for user name, and path parameter for user id and header parameter for user token + const optionalTrueSchema = z.boolean().default(true).optional(); + const partialUserSchema = userSchema.partial(); + const bearerSchema = z.string().transform((s) => `Bearer ${s}`); + const api = makeApi([ + { + method: "post", + path: "/users/:id", + alias: "createtUser", + description: "Create a user", + parameters: [ + { + name: "id", + type: "Path", + description: "The user id", + schema: z.number(), + }, + { + name: "homonyms", + type: "Query", + description: "Allow homonyms", + schema: optionalTrueSchema, + }, + { + name: "email", + type: "Query", + description: "create an email account for the user", + schema: optionalTrueSchema, + }, + { + name: "body", + type: "Body", + description: "The object to create", + schema: partialUserSchema, + }, + { + name: "Authorization", + type: "Header", + description: "The user token", + schema: bearerSchema, + }, + { + name: "x-custom-header", + type: "Header", + description: "A custom header", + schema: z.string(), + }, + ], + response: userSchema, + }, + ]); + // check narrowing works + const test: Assert< + typeof api, + readonly [ + { + readonly method: "post"; + readonly path: "/users/:id"; + readonly alias: "createtUser"; + readonly description: "Create a user"; + readonly parameters: readonly [ + { + readonly name: "id"; + readonly type: "Path"; + readonly description: "The user id"; + readonly schema: z.ZodNumber; + }, + { + readonly name: "homonyms"; + readonly type: "Query"; + readonly description: "Allow homonyms"; + readonly schema: typeof optionalTrueSchema; + }, + { + readonly name: "email"; + readonly type: "Query"; + readonly description: "create an email account for the user"; + readonly schema: typeof optionalTrueSchema; + }, + { + readonly name: "body"; + readonly type: "Body"; + readonly description: "The object to create"; + readonly schema: typeof partialUserSchema; + }, + { + readonly name: "Authorization"; + readonly type: "Header"; + readonly description: "The user token"; + readonly schema: typeof bearerSchema; + }, + { + readonly name: "x-custom-header"; + readonly type: "Header"; + readonly description: "A custom header"; + readonly schema: z.ZodString; + } + ]; + readonly response: typeof userSchema; + } + ] + > = true; + }); +}); + +describe("parametersBuilder", () => { + it("should build parameters (Path,Query,Body,Header)", () => { + // get users api with query filter for user name, and path parameter for user id and header parameter for user token + const optionalTrueSchema = z.boolean().default(true).optional(); + const partialUserSchema = userSchema.partial(); + const bearerSchema = z.string().transform((s) => `Bearer ${s}`); + + const parameters = parametersBuilder() + .addParameters("Path", { + id: z.number(), + }) + .addQueries({ + homonyms: optionalTrueSchema, + email: optionalTrueSchema, + }) + .addBody(partialUserSchema) + .addHeaders({ + Authorization: bearerSchema, + "x-custom-header": z.string(), + }) + .build(); + + const test: Assert< + (typeof parameters)[number], + | { + name: "id"; + type: "Path"; + description?: string; + schema: z.ZodNumber; + } + | { + name: "homonyms"; + type: "Query"; + description?: string; + schema: typeof optionalTrueSchema; + } + | { + name: "email"; + type: "Query"; + description?: string; + schema: typeof optionalTrueSchema; + } + | { + name: "body"; + type: "Body"; + description?: string; + schema: typeof partialUserSchema; + } + | { + name: "Authorization"; + type: "Header"; + description?: string; + schema: typeof bearerSchema; + } + | { + name: "x-custom-header"; + type: "Header"; + description?: string; + schema: z.ZodString; + } + > = true; + }); +}); + describe("mergeApis", () => { it("should merge two apis", () => { const usersSchema = z.array(userSchema); diff --git a/packages/core/src/api.ts b/packages/core/src/api.ts index 2139da1e..b92ee2a8 100644 --- a/packages/core/src/api.ts +++ b/packages/core/src/api.ts @@ -87,7 +87,7 @@ export function parametersBuilder() { type ObjectToQueryParameters< Type extends "Query" | "Path" | "Header", - T extends Record>, + T extends Record, Keys = UnionToTuple > = { [Index in keyof Keys]: { @@ -104,24 +104,20 @@ class ParametersBuilder { addParameter< Name extends string, Type extends "Path" | "Query" | "Body" | "Header", - Schema extends z.ZodType - >(name: Name, type: Type, schema: Schema) { + Schema + >(name: Name, type: Type, schema: Schema, description?: string) { return new ParametersBuilder< [...T, { name: Name; type: Type; description?: string; schema: Schema }] - >([ - ...this.params, - { name, type, description: schema.description, schema }, - ]); + >([...this.params, { name, type, description, schema }]); } addParameters< Type extends "Query" | "Path" | "Header", - Schemas extends Record> + Schemas extends Record >(type: Type, schemas: Schemas) { const parameters = Object.keys(schemas).map((key) => ({ name: key, type, - description: schemas[key].description, schema: schemas[key], })); return new ParametersBuilder< @@ -135,46 +131,31 @@ class ParametersBuilder { >([...this.params, ...parameters] as any); } - addBody>(schema: Schema) { + addBody(schema: Schema) { return this.addParameter("body", "Body", schema); } - addQuery>( - name: Name, - schema: Schema - ) { + addQuery(name: Name, schema: Schema) { return this.addParameter(name, "Query", schema); } - addPath>( - name: Name, - schema: Schema - ) { + addPath(name: Name, schema: Schema) { return this.addParameter(name, "Path", schema); } - addHeader>( - name: Name, - schema: Schema - ) { + addHeader(name: Name, schema: Schema) { return this.addParameter(name, "Header", schema); } - addQueries>>( - schemas: Schemas - ) { + addQueries>(schemas: Schemas) { return this.addParameters("Query", schemas); } - addPaths>>( - schemas: Schemas - ) { + addPaths>(schemas: Schemas) { return this.addParameters("Path", schemas); } - addHeaders>>( - schemas: Schemas - ) { + addHeaders>(schemas: Schemas) { return this.addParameters("Header", schemas); } diff --git a/packages/core/src/utils.ts b/packages/core/src/utils.ts index 7dba8b46..2ab75e59 100644 --- a/packages/core/src/utils.ts +++ b/packages/core/src/utils.ts @@ -1,7 +1,4 @@ -import type { - ZodiosEndpointDefinition, - ZodiosEndpointError, -} from "./zodios.types"; +import type { ZodiosEndpointDefinition } from "./zodios.types"; /** * omit properties from an object @@ -54,6 +51,14 @@ export function findEndpointByAlias( return api.find((e) => e.alias === alias); } +const paramsRegExp = /:([a-zA-Z_][a-zA-Z0-9_]*)/g; + +export function pathMatchesUrl(path: string, url: string) { + return new RegExp(`^${path.replace(paramsRegExp, () => "([^/]*)")}$`).test( + url + ); +} + export function findEndpointErrors( endpoint: ZodiosEndpointDefinition, err: any @@ -87,6 +92,8 @@ export function findEndpointErrorsByAlias( err: any ) { const endpoint = findEndpointByAlias(api, alias); + console.log("For Alias: ", alias); + console.log("Found Endpoint: ", endpoint); return endpoint && err.config && @@ -96,9 +103,3 @@ export function findEndpointErrorsByAlias( ? findEndpointErrors(endpoint, err) : undefined; } - -export function pathMatchesUrl(path: string, url: string) { - return new RegExp(`^${path.replace(paramsRegExp, () => "([^/]*)")}$`).test( - url - ); -} diff --git a/packages/core/src/zodios.test.ts b/packages/core/src/zodios.test.ts index 359700ea..4fd8414a 100644 --- a/packages/core/src/zodios.test.ts +++ b/packages/core/src/zodios.test.ts @@ -70,6 +70,20 @@ describe("Zodios", () => { statusText: "Unauthorized", data: {}, })); + zodiosMocks.mockRequest("get", "/error/:id/error401", async (conf) => ({ + status: 401, + statusText: "Unauthorized", + data: {}, + })); + zodiosMocks.mockRequest( + "get", + "/error/:id/error401/:message", + async (conf) => ({ + status: 401, + statusText: "Unauthorized", + data: {}, + }) + ); zodiosMocks.mockRequest("get", "/error502", async (conf) => ({ status: 502, statusText: "Bad Gateway", @@ -1077,7 +1091,7 @@ describe("Zodios", () => { }); it("should match error with params", async () => { - const zodios = new Zodios(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost`, [ { method: "get", alias: "getError401", @@ -1113,21 +1127,26 @@ describe("Zodios", () => { await zodios.getError401({ params }); } catch (e) { error = e; + console.log("Match Error params", e); } - expect(isErrorFromAlias(zodios.api, "getError401", error)).toBe(true); - expect(isErrorFromAlias(zodios.api, "getError404", error)).toBe(false); + expect(zodios.isErrorFromAlias(zodios.api, "getError401", error)).toBe( + true + ); + expect(zodios.isErrorFromAlias(zodios.api, "getError404", error)).toBe( + false + ); expect( - isErrorFromPath(zodios.api, "get", "/error/:id/error401", error) + zodios.isErrorFromPath(zodios.api, "get", "/error/:id/error401", error) ).toBe(true); expect( - isErrorFromPath(zodios.api, "get", "/error/:id/error404", error) + zodios.isErrorFromPath(zodios.api, "get", "/error/:id/error404", error) ).toBe(false); }); it("should match error with empty params", async () => { - const zodios = new Zodios(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost`, [ { method: "get", alias: "getError401", @@ -1165,19 +1184,23 @@ describe("Zodios", () => { error = e; } - expect(isErrorFromAlias(zodios.api, "getError401", error)).toBe(true); - expect(isErrorFromAlias(zodios.api, "getError404", error)).toBe(false); + expect(zodios.isErrorFromAlias(zodios.api, "getError401", error)).toBe( + true + ); + expect(zodios.isErrorFromAlias(zodios.api, "getError404", error)).toBe( + false + ); expect( - isErrorFromPath(zodios.api, "get", "/error/:id/error401", error) + zodios.isErrorFromPath(zodios.api, "get", "/error/:id/error401", error) ).toBe(true); expect( - isErrorFromPath(zodios.api, "get", "/error/:id/error404", error) + zodios.isErrorFromPath(zodios.api, "get", "/error/:id/error404", error) ).toBe(false); }); it("should match error with optional params at the end", async () => { - const zodios = new Zodios(`http://localhost:${port}`, [ + const zodios = new ZodiosCore(`http://localhost`, [ { method: "get", alias: "getError401", @@ -1216,14 +1239,28 @@ describe("Zodios", () => { error = e; } - expect(isErrorFromAlias(zodios.api, "getError401", error)).toBe(true); - expect(isErrorFromAlias(zodios.api, "getError404", error)).toBe(false); + expect(zodios.isErrorFromAlias(zodios.api, "getError401", error)).toBe( + true + ); + expect(zodios.isErrorFromAlias(zodios.api, "getError404", error)).toBe( + false + ); expect( - isErrorFromPath(zodios.api, "get", "/error/:id/error401/:message", error) + zodios.isErrorFromPath( + zodios.api, + "get", + "/error/:id/error401/:message", + error + ) ).toBe(true); expect( - isErrorFromPath(zodios.api, "get", "/error/:id/error404/:message", error) + zodios.isErrorFromPath( + zodios.api, + "get", + "/error/:id/error404/:message", + error + ) ).toBe(false); }); diff --git a/packages/react/src/hooks.ts b/packages/react/src/hooks.ts index 17861692..7686df19 100644 --- a/packages/react/src/hooks.ts +++ b/packages/react/src/hooks.ts @@ -12,7 +12,11 @@ import { QueryKey, UseInfiniteQueryResult, } from "@tanstack/react-query"; -import { ZodiosError, HTTP_MUTATION_METHODS } from "@zodios/core"; +import { + ZodiosError, + HTTP_MUTATION_METHODS, + FindZodiosEndpointDefinitionByAlias, +} from "@zodios/core"; import type { AnyZodiosFetcherProvider, AnyZodiosMethodOptions, @@ -23,7 +27,6 @@ import type { ZodiosResponseByPath, ZodiosResponseByAlias, ZodiosEndpointDefinition, - ZodiosEndpointDefinitionByAlias, ZodiosRequestOptionsByPath, ZodiosBodyByPath, ZodiosBodyByAlias, @@ -801,16 +804,16 @@ export type ZodiosHooksAliases< FetcherProvider extends AnyZodiosFetcherProvider, TypeProvider extends AnyZodiosTypeProvider > = { - [Alias in Aliases as `use${Capitalize}`]: ZodiosEndpointDefinitionByAlias< + [Alias in Aliases as `use${Capitalize}`]: FindZodiosEndpointDefinitionByAlias< Api, Alias - >[number]["method"] extends infer AliasMethod + >["method"] extends infer AliasMethod ? AliasMethod extends MutationMethod ? { - immutable: ZodiosEndpointDefinitionByAlias< + immutable: FindZodiosEndpointDefinitionByAlias< Api, Alias - >[number]["immutable"]; + >["immutable"]; method: AliasMethod; } extends { immutable: true; method: "post" } ? // immutable query From 75b549383c136094d0c79ed95fe7b0f1e07a4800 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sun, 6 Aug 2023 16:55:21 +0200 Subject: [PATCH 135/206] feat(batch): add fetch batch project --- packages/fetch-batch/LICENSE | 21 + packages/fetch-batch/README.md | 35 + packages/fetch-batch/jest.config.ts | 24 + packages/fetch-batch/package.json | 28 + .../src/__snapshots__/batching.test.ts.snap | 23 + packages/fetch-batch/src/batching.test.ts | 69 + packages/fetch-batch/src/batching.ts | 83 + packages/fetch-batch/src/index.ts | 1 + packages/fetch-batch/tsconfig.json | 109 + packages/react/src/hooks.ts | 26 +- pnpm-lock.yaml | 2346 +++++++++-------- 11 files changed, 1664 insertions(+), 1101 deletions(-) create mode 100644 packages/fetch-batch/LICENSE create mode 100644 packages/fetch-batch/README.md create mode 100644 packages/fetch-batch/jest.config.ts create mode 100644 packages/fetch-batch/package.json create mode 100644 packages/fetch-batch/src/__snapshots__/batching.test.ts.snap create mode 100644 packages/fetch-batch/src/batching.test.ts create mode 100644 packages/fetch-batch/src/batching.ts create mode 100644 packages/fetch-batch/src/index.ts create mode 100644 packages/fetch-batch/tsconfig.json diff --git a/packages/fetch-batch/LICENSE b/packages/fetch-batch/LICENSE new file mode 100644 index 00000000..e5dea986 --- /dev/null +++ b/packages/fetch-batch/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 ecyrbe + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/fetch-batch/README.md b/packages/fetch-batch/README.md new file mode 100644 index 00000000..42e3f185 --- /dev/null +++ b/packages/fetch-batch/README.md @@ -0,0 +1,35 @@ +# Batch support for fetch + +```ts + const getUser1 = new Request(`http://localhost:${port}/get`, { + method: "GET", + headers: new Headers({ + Accept: "application/json; charset=utf-8", + }), + }); + + const renameUser2 = new Request(`http://localhost:${port}/patch`, { + method: "PATCH", + headers: new Headers({ + Accept: "application/json; charset=utf-8", + "Content-Type": "application/json; charset=utf-8", + }), + body: JSON.stringify({ + name: "John Doe", + }), + }); + + const body = new BatchData(); + body.addRequest(getUser1); + body.addRequest(renameUser2); + + const batched = await fetch(`http://localhost:${port}/batch`, { + method: "POST", + headers: body.getHeaders(), + body: body.stream(), + }).then((response) => new BatchResponse(response)); + + for await (const response of batched) { + console.log(response); + } +``` \ No newline at end of file diff --git a/packages/fetch-batch/jest.config.ts b/packages/fetch-batch/jest.config.ts new file mode 100644 index 00000000..d0da3728 --- /dev/null +++ b/packages/fetch-batch/jest.config.ts @@ -0,0 +1,24 @@ +import type { Config } from "@jest/types"; + +// Objet synchrone +const config: Config.InitialOptions = { + verbose: true, + moduleFileExtensions: ["ts", "js", "json", "node"], + rootDir: "./", + testRegex: ".(spec|test).tsx?$", + transform: { + "^.+\\.tsx?$": "ts-jest", + }, + coveragePathIgnorePatterns: ["/node_modules/", "index\\.ts"], + coverageDirectory: "./coverage", + coverageThreshold: { + global: { + branches: 80, + functions: 85, + lines: 85, + statements: 85, + }, + }, + testEnvironment: "node", +}; +export default config; diff --git a/packages/fetch-batch/package.json b/packages/fetch-batch/package.json new file mode 100644 index 00000000..3c90709b --- /dev/null +++ b/packages/fetch-batch/package.json @@ -0,0 +1,28 @@ +{ + "name": "@zodios/fetch-batch", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "prebuild": "rimraf lib", + "build": "tsup", + "test": "jest --coverage" + }, + "keywords": [], + "author": "", + "license": "ISC", + "devDependencies": { + "@jest/globals": "29.5.0", + "@jest/types": "29.5.0", + "@types/express": "4.17.17", + "@types/jest": "29.5.0", + "@types/node": "18.15.11", + "express": "4.18.2", + "jest": "29.5.0", + "rimraf": "4.4.1", + "ts-jest": "29.1.0", + "ts-node": "10.9.1", + "tsup": "6.7.0", + "typescript": "5.0.4" + } +} \ No newline at end of file diff --git a/packages/fetch-batch/src/__snapshots__/batching.test.ts.snap b/packages/fetch-batch/src/__snapshots__/batching.test.ts.snap new file mode 100644 index 00000000..aad553e7 --- /dev/null +++ b/packages/fetch-batch/src/__snapshots__/batching.test.ts.snap @@ -0,0 +1,23 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`BatchData should be able to batch requests 1`] = ` +"--batch__1675206000000__batch +content-id: +content-type: application/http; msgtype=request + +GET /get HTTP/1.1 +accept: application/json; charset=utf-8 + + +--batch__1675206000000__batch +content-id: +content-type: application/http; msgtype=request + +PATCH /patch HTTP/1.1 +accept: application/json; charset=utf-8 +content-type: application/json; charset=utf-8 + +{"name":"John Doe"} +--batch__1675206000000__batch-- +" +`; diff --git a/packages/fetch-batch/src/batching.test.ts b/packages/fetch-batch/src/batching.test.ts new file mode 100644 index 00000000..60b03514 --- /dev/null +++ b/packages/fetch-batch/src/batching.test.ts @@ -0,0 +1,69 @@ +import express from "express"; +import type { AddressInfo } from "net"; +import { BatchData } from "./batching"; + +describe("BatchData", () => { + let app: express.Express; + let server: ReturnType; + let port: number; + + beforeAll(() => { + const app = express(); + app.use(express.raw({ type: "multipart/mixed" })); + + app.post("/batch", (req, res) => { + console.log("received batch request"); + res.json({ + url: req.url, + method: req.method, + headers: req.headers, + data: req.body.toString(), + }); + }); + + server = app.listen(0); + port = (server.address() as AddressInfo).port; + }); + + afterAll(() => { + server.close(); + }); + + it("should be able to batch requests", async () => { + jest.useFakeTimers(); + jest.setSystemTime(new Date(2023, 1, 1)); + const getUser1 = new Request(`http://localhost:${port}/get`, { + method: "GET", + headers: new Headers({ + Accept: "application/json; charset=utf-8", + }), + }); + + const renameUser2 = new Request(`http://localhost:${port}/patch`, { + method: "PATCH", + headers: new Headers({ + Accept: "application/json; charset=utf-8", + "Content-Type": "application/json; charset=utf-8", + }), + body: JSON.stringify({ + name: "John Doe", + }), + }); + + const body = new BatchData(); + body.addRequest(getUser1); + body.addRequest(renameUser2); + + const batched = await fetch(`http://localhost:${port}/batch`, { + method: "POST", + headers: body.getHeaders(), + body: body.stream(), + }).then((response) => response.json()); + + expect(batched.url).toBe("/batch"); + expect(batched.method).toBe("POST"); + expect(batched.headers["content-type"]).toContain("multipart/mixed"); + expect(batched.data).toMatchSnapshot(); + jest.useRealTimers(); + }); +}); diff --git a/packages/fetch-batch/src/batching.ts b/packages/fetch-batch/src/batching.ts new file mode 100644 index 00000000..af2e3e43 --- /dev/null +++ b/packages/fetch-batch/src/batching.ts @@ -0,0 +1,83 @@ +export class BatchData { + #requests = new Map(); + #contentIdSuffix = `${Date.now()}@zodios.org`; + #boundary = `batch__${Date.now()}__batch`; + #encoder = new TextEncoder(); + + constructor() {} + + addRequest(request: Request) { + const contentId = `request-${this.#requests.size + 1}-${ + this.#contentIdSuffix + }`; + this.#requests.set(contentId, request); + return contentId; + } + + getHeaders(init?: HeadersInit) { + const headers = new Headers(init); + headers.set("Content-Type", `multipart/mixed; boundary=${this.#boundary}`); + return headers; + } + + stream() { + const iterator = this[Symbol.asyncIterator](); + return new ReadableStream({ + async pull(controller) { + const { value, done } = await iterator.next(); + if (done) { + controller.close(); + } else { + controller.enqueue(value); + } + }, + }); + } + + formatHeaders(headers: Headers) { + let result = ""; + for (const [name, value] of headers) { + result += `${name}: ${value}\r\n`; + } + result += "\r\n"; + return result; + } + + *encodePart(contentId: string) { + const headers = new Headers(); + headers.set("Content-ID", `<${contentId}>`); + headers.set("Content-Type", "application/http; msgtype=request"); + yield this.#encoder.encode(this.formatHeaders(headers)); + } + + async *encodeRequest(request: Request) { + const url = new URL(request.url); + yield this.#encoder.encode( + `${request.method} ${url.pathname}${url.search}${url.hash} HTTP/1.1\r\n` + ); + yield this.#encoder.encode(this.formatHeaders(request.headers)); + if (request.body) { + const reader = request.body.getReader(); + while (true) { + const { done, value } = await reader.read(); + if (done) { + break; + } + yield value; + } + } + } + + async *[Symbol.asyncIterator]() { + const boundary = this.#encoder.encode(`--${this.#boundary}\r\n`); + const boundaryClose = this.#encoder.encode(`--${this.#boundary}--\r\n`); + + for (const [contentId, request] of this.#requests) { + yield boundary; + yield* this.encodePart(contentId); + yield* this.encodeRequest(request); + yield this.#encoder.encode("\r\n"); + } + yield boundaryClose; + } +} diff --git a/packages/fetch-batch/src/index.ts b/packages/fetch-batch/src/index.ts new file mode 100644 index 00000000..7ec7a2f0 --- /dev/null +++ b/packages/fetch-batch/src/index.ts @@ -0,0 +1 @@ +export { BatchData } from "./batching"; diff --git a/packages/fetch-batch/tsconfig.json b/packages/fetch-batch/tsconfig.json new file mode 100644 index 00000000..523cf7bb --- /dev/null +++ b/packages/fetch-batch/tsconfig.json @@ -0,0 +1,109 @@ +{ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig to read more about this file */ + + /* Projects */ + // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ + // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ + // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ + // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ + // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ + // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ + + /* Language and Environment */ + "target": "ES2020" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */, + // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ + // "jsx": "preserve", /* Specify what JSX code is generated. */ + // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ + // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ + // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ + // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ + // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ + // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ + // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ + // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ + // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ + + /* Modules */ + "module": "commonjs" /* Specify what module code is generated. */, + // "rootDir": "./", /* Specify the root folder within your source files. */ + // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ + // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ + // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ + // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ + // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ + // "types": [], /* Specify type package names to be included without being referenced in a source file. */ + // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ + // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ + // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */ + // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ + // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ + // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ + // "resolveJsonModule": true, /* Enable importing .json files. */ + // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ + // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ + + /* JavaScript Support */ + // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ + // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ + // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ + + /* Emit */ + "declaration": true /* Generate .d.ts files from TypeScript and JavaScript files in your project. */, + // "declarationMap": true, /* Create sourcemaps for d.ts files. */ + // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ + // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ + // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ + // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ + "outDir": "./build" /* Specify an output folder for all emitted files. */, + // "removeComments": true, /* Disable emitting comments. */ + // "noEmit": true, /* Disable emitting files from a compilation. */ + // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ + // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ + // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ + // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ + // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ + // "newLine": "crlf", /* Set the newline character for emitting files. */ + // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ + // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ + // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ + // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ + // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ + // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ + + /* Interop Constraints */ + // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ + // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */ + // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ + "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */, + // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ + "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */, + + /* Type Checking */ + "strict": true /* Enable all strict type-checking options. */, + // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ + // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ + // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ + // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ + // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ + // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ + // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ + // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ + // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ + // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ + // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ + // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ + // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ + // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ + // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ + // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ + // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ + + /* Completeness */ + // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ + "skipLibCheck": true /* Skip type checking all .d.ts files. */ + } +} diff --git a/packages/react/src/hooks.ts b/packages/react/src/hooks.ts index 7686df19..b1011996 100644 --- a/packages/react/src/hooks.ts +++ b/packages/react/src/hooks.ts @@ -192,9 +192,10 @@ export class ZodiosHooksImpl< config as AnyZodiosMethodOptions | undefined, ["params", "queries", "body"] ); - return [{ api: this.apiName, path: endpoint.path }, params] as QueryKey; + if (Object.keys(params).length > 0) + return [this.apiName, endpoint.path, params] as QueryKey; } - return [{ api: this.apiName, path: endpoint.path }] as QueryKey; + return [this.apiName, endpoint.path] as QueryKey; } /** @@ -222,9 +223,10 @@ export class ZodiosHooksImpl< config as AnyZodiosMethodOptions | undefined, ["params", "queries", "body"] ); - return [{ api: this.apiName, path: endpoint.path }, params] as QueryKey; + if (Object.keys(params).length > 0) + return [this.apiName, endpoint.path, params] as QueryKey; } - return [{ api: this.apiName, path: endpoint.path }] as QueryKey; + return [this.apiName, endpoint.path] as QueryKey; } useQuery< @@ -254,11 +256,7 @@ export class ZodiosHooksImpl< invalidate: () => Promise; key: QueryKey; } { - const params = pick( - config as AnyZodiosMethodOptions | undefined, - ["params", "queries", "body"] - ); - const key = [{ api: this.apiName, path }, params] as QueryKey; + const key = this.getKeyByPath("get", path, config as any); const query = (queryParams: QueryFunctionContext) => this.zodios.get(path, { ...(config as any), @@ -303,11 +301,7 @@ export class ZodiosHooksImpl< invalidate: () => Promise; key: QueryKey; } { - const params = pick( - config as AnyZodiosMethodOptions | undefined, - ["params", "queries", "body"] - ); - const key = [{ api: this.apiName, path }, params] as QueryKey; + const key = this.getKeyByPath("post", path, config as any); const query = (queryParams: QueryFunctionContext) => this.zodios.post(path, { ...(config as any), @@ -393,7 +387,7 @@ export class ZodiosHooksImpl< queryOptions.getPageParamList() as string[] ); } - const key = [{ api: this.apiName, path }, params]; + const key = [this.apiName, path, params]; const query = (queryParams: QueryFunctionContext) => this.zodios.get(path, { ...config, @@ -508,7 +502,7 @@ export class ZodiosHooksImpl< queryOptions.getPageParamList() as string[] ); } - const key = [{ api: this.apiName, path }, params]; + const key = [this.apiName, path, params]; const query = (queryParams: QueryFunctionContext) => this.zodios.post(path, { ...config, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6f12cd18..d35fe410 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,4 +1,8 @@ -lockfileVersion: 5.4 +lockfileVersion: '6.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false overrides: esbuild: 0.17.14 @@ -6,323 +10,493 @@ overrides: importers: .: - specifiers: - '@changesets/cli': 2.26.1 - turbo: 1.8.8 - typescript: 5.0.4 devDependencies: - '@changesets/cli': 2.26.1 - turbo: 1.8.8 - typescript: 5.0.4 + '@changesets/cli': + specifier: 2.26.1 + version: 2.26.1 + turbo: + specifier: 1.8.8 + version: 1.8.8 + typescript: + specifier: 5.0.4 + version: 5.0.4 packages/axios: - specifiers: - '@jest/globals': 29.5.0 - '@jest/types': 29.5.0 - '@types/express': 4.17.17 - '@types/jest': 29.5.0 - '@types/multer': 1.4.7 - '@types/node': 18.15.11 - '@zodios/core': workspace:* - axios: 1.3.5 - express: 4.18.2 - fp-ts: 2.13.1 - io-ts: 2.2.20 - jest: 29.5.0 - multer: 1.4.5-lts.1 - rimraf: 4.4.1 - ts-jest: 29.1.0 - ts-node: 10.9.1 - tsup: 6.7.0 - typescript: 5.0.4 - zod: 3.21.4 devDependencies: - '@jest/globals': 29.5.0 - '@jest/types': 29.5.0 - '@types/express': 4.17.17 - '@types/jest': 29.5.0 - '@types/multer': 1.4.7 - '@types/node': 18.15.11 - '@zodios/core': link:../core - axios: 1.3.5 - express: 4.18.2 - fp-ts: 2.13.1 - io-ts: 2.2.20_fp-ts@2.13.1 - jest: 29.5.0_rrli7kzx2akox3oq6aahu3rvje - multer: 1.4.5-lts.1 - rimraf: 4.4.1 - ts-jest: 29.1.0_sye3n7rnony6rzpy3o3kwkrynm - ts-node: 10.9.1_bhanhq442dy43ncydsavgi4jfi - tsup: 6.7.0_pyqfhkbboucpxgvrs7ocxwodkm - typescript: 5.0.4 - zod: 3.21.4 + '@jest/globals': + specifier: 29.5.0 + version: 29.5.0 + '@jest/types': + specifier: 29.5.0 + version: 29.5.0 + '@types/express': + specifier: 4.17.17 + version: 4.17.17 + '@types/jest': + specifier: 29.5.0 + version: 29.5.0 + '@types/multer': + specifier: 1.4.7 + version: 1.4.7 + '@types/node': + specifier: 18.15.11 + version: 18.15.11 + '@zodios/core': + specifier: workspace:* + version: link:../core + axios: + specifier: 1.3.5 + version: 1.3.5 + express: + specifier: 4.18.2 + version: 4.18.2 + fp-ts: + specifier: 2.13.1 + version: 2.13.1 + io-ts: + specifier: 2.2.20 + version: 2.2.20(fp-ts@2.13.1) + jest: + specifier: 29.5.0 + version: 29.5.0(@types/node@18.15.11)(ts-node@10.9.1) + multer: + specifier: 1.4.5-lts.1 + version: 1.4.5-lts.1 + rimraf: + specifier: 4.4.1 + version: 4.4.1 + ts-jest: + specifier: 29.1.0 + version: 29.1.0(@babel/core@7.21.4)(@jest/types@29.5.0)(esbuild@0.17.14)(jest@29.5.0)(typescript@5.0.4) + ts-node: + specifier: 10.9.1 + version: 10.9.1(@types/node@18.15.11)(typescript@5.0.4) + tsup: + specifier: 6.7.0 + version: 6.7.0(ts-node@10.9.1)(typescript@5.0.4) + typescript: + specifier: 5.0.4 + version: 5.0.4 + zod: + specifier: 3.21.4 + version: 3.21.4 packages/core: - specifiers: - '@jest/globals': 29.5.0 - '@jest/types': 29.5.0 - '@types/jest': 29.5.0 - '@types/node': 18.15.11 - form-data: ^4.0.0 - fp-ts: 2.13.1 - io-ts: 2.2.20 - jest: 29.5.0 - rimraf: 4.4.1 - ts-jest: 29.1.0 - ts-node: 10.9.1 - tsup: 6.7.0 - typescript: 5.0.4 - zod: 3.21.4 devDependencies: - '@jest/globals': 29.5.0 - '@jest/types': 29.5.0 - '@types/jest': 29.5.0 - '@types/node': 18.15.11 - form-data: 4.0.0 - fp-ts: 2.13.1 - io-ts: 2.2.20_fp-ts@2.13.1 - jest: 29.5.0_rrli7kzx2akox3oq6aahu3rvje - rimraf: 4.4.1 - ts-jest: 29.1.0_sye3n7rnony6rzpy3o3kwkrynm - ts-node: 10.9.1_bhanhq442dy43ncydsavgi4jfi - tsup: 6.7.0_pyqfhkbboucpxgvrs7ocxwodkm - typescript: 5.0.4 - zod: 3.21.4 + '@jest/globals': + specifier: 29.5.0 + version: 29.5.0 + '@jest/types': + specifier: 29.5.0 + version: 29.5.0 + '@types/jest': + specifier: 29.5.0 + version: 29.5.0 + '@types/node': + specifier: 18.15.11 + version: 18.15.11 + form-data: + specifier: ^4.0.0 + version: 4.0.0 + fp-ts: + specifier: 2.13.1 + version: 2.13.1 + io-ts: + specifier: 2.2.20 + version: 2.2.20(fp-ts@2.13.1) + jest: + specifier: 29.5.0 + version: 29.5.0(@types/node@18.15.11)(ts-node@10.9.1) + rimraf: + specifier: 4.4.1 + version: 4.4.1 + ts-jest: + specifier: 29.1.0 + version: 29.1.0(@babel/core@7.21.4)(@jest/types@29.5.0)(esbuild@0.17.14)(jest@29.5.0)(typescript@5.0.4) + ts-node: + specifier: 10.9.1 + version: 10.9.1(@types/node@18.15.11)(typescript@5.0.4) + tsup: + specifier: 6.7.0 + version: 6.7.0(ts-node@10.9.1)(typescript@5.0.4) + typescript: + specifier: 5.0.4 + version: 5.0.4 + zod: + specifier: 3.21.4 + version: 3.21.4 packages/express: - specifiers: - '@jest/globals': 29.5.0 - '@jest/types': 29.5.0 - '@types/express': 4.17.17 - '@types/jest': 29.5.0 - '@types/node': 18.15.11 - '@types/supertest': 2.0.12 - '@zodios/core': workspace:* - express: 4.18.2 - jest: 29.5.0 - rimraf: 4.4.1 - supertest: 6.3.3 - ts-jest: 29.1.0 - ts-node: 10.9.1 - tsup: 6.7.0 - typescript: 5.0.4 - zod: 3.21.4 devDependencies: - '@jest/globals': 29.5.0 - '@jest/types': 29.5.0 - '@types/express': 4.17.17 - '@types/jest': 29.5.0 - '@types/node': 18.15.11 - '@types/supertest': 2.0.12 - '@zodios/core': link:../core - express: 4.18.2 - jest: 29.5.0_rrli7kzx2akox3oq6aahu3rvje - rimraf: 4.4.1 - supertest: 6.3.3 - ts-jest: 29.1.0_sye3n7rnony6rzpy3o3kwkrynm - ts-node: 10.9.1_bhanhq442dy43ncydsavgi4jfi - tsup: 6.7.0_pyqfhkbboucpxgvrs7ocxwodkm - typescript: 5.0.4 - zod: 3.21.4 + '@jest/globals': + specifier: 29.5.0 + version: 29.5.0 + '@jest/types': + specifier: 29.5.0 + version: 29.5.0 + '@types/express': + specifier: 4.17.17 + version: 4.17.17 + '@types/jest': + specifier: 29.5.0 + version: 29.5.0 + '@types/node': + specifier: 18.15.11 + version: 18.15.11 + '@types/supertest': + specifier: 2.0.12 + version: 2.0.12 + '@zodios/core': + specifier: workspace:* + version: link:../core + express: + specifier: 4.18.2 + version: 4.18.2 + jest: + specifier: 29.5.0 + version: 29.5.0(@types/node@18.15.11)(ts-node@10.9.1) + rimraf: + specifier: 4.4.1 + version: 4.4.1 + supertest: + specifier: 6.3.3 + version: 6.3.3 + ts-jest: + specifier: 29.1.0 + version: 29.1.0(@babel/core@7.21.4)(@jest/types@29.5.0)(esbuild@0.17.14)(jest@29.5.0)(typescript@5.0.4) + ts-node: + specifier: 10.9.1 + version: 10.9.1(@types/node@18.15.11)(typescript@5.0.4) + tsup: + specifier: 6.7.0 + version: 6.7.0(ts-node@10.9.1)(typescript@5.0.4) + typescript: + specifier: 5.0.4 + version: 5.0.4 + zod: + specifier: 3.21.4 + version: 3.21.4 packages/fetch: - specifiers: - '@jest/globals': 29.5.0 - '@jest/types': 29.5.0 - '@types/express': 4.17.17 - '@types/jest': 29.5.0 - '@types/multer': 1.4.7 - '@types/node': 18.15.11 - '@zodios/core': workspace:* - cross-fetch: 3.1.5 - express: 4.18.2 - fp-ts: 2.13.1 - io-ts: 2.2.20 - jest: 29.5.0 - multer: 1.4.5-lts.1 - rimraf: 4.4.1 - ts-jest: 29.1.0 - ts-node: 10.9.1 - tsup: 6.7.0 - typescript: 5.0.4 - zod: 3.21.4 devDependencies: - '@jest/globals': 29.5.0 - '@jest/types': 29.5.0 - '@types/express': 4.17.17 - '@types/jest': 29.5.0 - '@types/multer': 1.4.7 - '@types/node': 18.15.11 - '@zodios/core': link:../core - cross-fetch: 3.1.5 - express: 4.18.2 - fp-ts: 2.13.1 - io-ts: 2.2.20_fp-ts@2.13.1 - jest: 29.5.0_rrli7kzx2akox3oq6aahu3rvje - multer: 1.4.5-lts.1 - rimraf: 4.4.1 - ts-jest: 29.1.0_sye3n7rnony6rzpy3o3kwkrynm - ts-node: 10.9.1_bhanhq442dy43ncydsavgi4jfi - tsup: 6.7.0_pyqfhkbboucpxgvrs7ocxwodkm - typescript: 5.0.4 - zod: 3.21.4 + '@jest/globals': + specifier: 29.5.0 + version: 29.5.0 + '@jest/types': + specifier: 29.5.0 + version: 29.5.0 + '@types/express': + specifier: 4.17.17 + version: 4.17.17 + '@types/jest': + specifier: 29.5.0 + version: 29.5.0 + '@types/multer': + specifier: 1.4.7 + version: 1.4.7 + '@types/node': + specifier: 18.15.11 + version: 18.15.11 + '@zodios/core': + specifier: workspace:* + version: link:../core + cross-fetch: + specifier: 3.1.5 + version: 3.1.5 + express: + specifier: 4.18.2 + version: 4.18.2 + fp-ts: + specifier: 2.13.1 + version: 2.13.1 + io-ts: + specifier: 2.2.20 + version: 2.2.20(fp-ts@2.13.1) + jest: + specifier: 29.5.0 + version: 29.5.0(@types/node@18.15.11)(ts-node@10.9.1) + multer: + specifier: 1.4.5-lts.1 + version: 1.4.5-lts.1 + rimraf: + specifier: 4.4.1 + version: 4.4.1 + ts-jest: + specifier: 29.1.0 + version: 29.1.0(@babel/core@7.21.4)(@jest/types@29.5.0)(esbuild@0.17.14)(jest@29.5.0)(typescript@5.0.4) + ts-node: + specifier: 10.9.1 + version: 10.9.1(@types/node@18.15.11)(typescript@5.0.4) + tsup: + specifier: 6.7.0 + version: 6.7.0(ts-node@10.9.1)(typescript@5.0.4) + typescript: + specifier: 5.0.4 + version: 5.0.4 + zod: + specifier: 3.21.4 + version: 3.21.4 + + packages/fetch-batch: + devDependencies: + '@jest/globals': + specifier: 29.5.0 + version: 29.5.0 + '@jest/types': + specifier: 29.5.0 + version: 29.5.0 + '@types/express': + specifier: 4.17.17 + version: 4.17.17 + '@types/jest': + specifier: 29.5.0 + version: 29.5.0 + '@types/node': + specifier: 18.15.11 + version: 18.15.11 + express: + specifier: 4.18.2 + version: 4.18.2 + jest: + specifier: 29.5.0 + version: 29.5.0(@types/node@18.15.11)(ts-node@10.9.1) + rimraf: + specifier: 4.4.1 + version: 4.4.1 + ts-jest: + specifier: 29.1.0 + version: 29.1.0(@babel/core@7.21.4)(@jest/types@29.5.0)(esbuild@0.17.14)(jest@29.5.0)(typescript@5.0.4) + ts-node: + specifier: 10.9.1 + version: 10.9.1(@types/node@18.15.11)(typescript@5.0.4) + tsup: + specifier: 6.7.0 + version: 6.7.0(ts-node@10.9.1)(typescript@5.0.4) + typescript: + specifier: 5.0.4 + version: 5.0.4 packages/openapi: - specifiers: - '@jest/globals': 29.5.0 - '@jest/types': 29.5.0 - '@types/jest': 29.5.0 - '@types/multer': 1.4.7 - '@types/node': 18.15.11 - '@types/swagger-ui-express': 4.1.3 - '@zodios/core': workspace:* - '@zodios/express': workspace:* - axios: 1.3.5 - express: 4.18.2 - jest: 29.5.0 - openapi-types: 12.1.0 - rimraf: 4.4.1 - swagger-ui-express: 4.6.2 - ts-jest: 29.1.0 - ts-node: 10.9.1 - tsup: 6.7.0 - typescript: 5.0.4 - zod: 3.21.4 - zod-to-json-schema: 3.20.4 dependencies: - openapi-types: 12.1.0 - zod-to-json-schema: 3.20.4_zod@3.21.4 + openapi-types: + specifier: 12.1.0 + version: 12.1.0 + zod-to-json-schema: + specifier: 3.20.4 + version: 3.20.4(zod@3.21.4) devDependencies: - '@jest/globals': 29.5.0 - '@jest/types': 29.5.0 - '@types/jest': 29.5.0 - '@types/multer': 1.4.7 - '@types/node': 18.15.11 - '@types/swagger-ui-express': 4.1.3 - '@zodios/core': link:../core - '@zodios/express': link:../express - axios: 1.3.5 - express: 4.18.2 - jest: 29.5.0_rrli7kzx2akox3oq6aahu3rvje - rimraf: 4.4.1 - swagger-ui-express: 4.6.2_express@4.18.2 - ts-jest: 29.1.0_sye3n7rnony6rzpy3o3kwkrynm - ts-node: 10.9.1_bhanhq442dy43ncydsavgi4jfi - tsup: 6.7.0_pyqfhkbboucpxgvrs7ocxwodkm - typescript: 5.0.4 - zod: 3.21.4 + '@jest/globals': + specifier: 29.5.0 + version: 29.5.0 + '@jest/types': + specifier: 29.5.0 + version: 29.5.0 + '@types/jest': + specifier: 29.5.0 + version: 29.5.0 + '@types/multer': + specifier: 1.4.7 + version: 1.4.7 + '@types/node': + specifier: 18.15.11 + version: 18.15.11 + '@types/swagger-ui-express': + specifier: 4.1.3 + version: 4.1.3 + '@zodios/core': + specifier: workspace:* + version: link:../core + '@zodios/express': + specifier: workspace:* + version: link:../express + axios: + specifier: 1.3.5 + version: 1.3.5 + express: + specifier: 4.18.2 + version: 4.18.2 + jest: + specifier: 29.5.0 + version: 29.5.0(@types/node@18.15.11)(ts-node@10.9.1) + rimraf: + specifier: 4.4.1 + version: 4.4.1 + swagger-ui-express: + specifier: 4.6.2 + version: 4.6.2(express@4.18.2) + ts-jest: + specifier: 29.1.0 + version: 29.1.0(@babel/core@7.21.4)(@jest/types@29.5.0)(esbuild@0.17.14)(jest@29.5.0)(typescript@5.0.4) + ts-node: + specifier: 10.9.1 + version: 10.9.1(@types/node@18.15.11)(typescript@5.0.4) + tsup: + specifier: 6.7.0 + version: 6.7.0(ts-node@10.9.1)(typescript@5.0.4) + typescript: + specifier: 5.0.4 + version: 5.0.4 + zod: + specifier: 3.21.4 + version: 3.21.4 packages/react: - specifiers: - '@jest/globals': 29.5.0 - '@jest/types': 29.5.0 - '@tanstack/react-query': 4.28.0 - '@testing-library/dom': 9.2.0 - '@testing-library/jest-dom': 5.16.5 - '@testing-library/react': 14.0.0 - '@testing-library/react-hooks': 8.0.1 - '@testing-library/user-event': 14.4.3 - '@types/cors': 2.8.13 - '@types/express': 4.17.17 - '@types/jest': 29.5.0 - '@types/node': 18.15.11 - '@types/react': 18.0.33 - '@zodios/axios': workspace:* - '@zodios/core': workspace:* - '@zodios/fetch': workspace:* - cors: 2.8.5 - cross-fetch: 3.1.5 - express: 4.18.2 - fp-ts: 2.13.1 - io-ts: 2.2.20 - jest: 29.5.0 - jest-environment-jsdom: 29.5.0 - react: 18.2.0 - react-dom: 18.2.0 - react-test-renderer: 18.2.0 - rimraf: 4.4.1 - ts-jest: 29.1.0 - ts-node: 10.9.1 - tsup: 6.7.0 - typescript: 5.0.4 - zod: 3.21.4 devDependencies: - '@jest/globals': 29.5.0 - '@jest/types': 29.5.0 - '@tanstack/react-query': 4.28.0_biqbaboplfbrettd7655fr4n2y - '@testing-library/dom': 9.2.0 - '@testing-library/jest-dom': 5.16.5 - '@testing-library/react': 14.0.0_biqbaboplfbrettd7655fr4n2y - '@testing-library/react-hooks': 8.0.1_j67ni4i6zsa7gdqctpxigdgcuy - '@testing-library/user-event': 14.4.3_@testing-library+dom@9.2.0 - '@types/cors': 2.8.13 - '@types/express': 4.17.17 - '@types/jest': 29.5.0 - '@types/node': 18.15.11 - '@types/react': 18.0.33 - '@zodios/axios': link:../axios - '@zodios/core': link:../core - '@zodios/fetch': link:../fetch - cors: 2.8.5 - cross-fetch: 3.1.5 - express: 4.18.2 - fp-ts: 2.13.1 - io-ts: 2.2.20_fp-ts@2.13.1 - jest: 29.5.0_rrli7kzx2akox3oq6aahu3rvje - jest-environment-jsdom: 29.5.0 - react: 18.2.0 - react-dom: 18.2.0_react@18.2.0 - react-test-renderer: 18.2.0_react@18.2.0 - rimraf: 4.4.1 - ts-jest: 29.1.0_sye3n7rnony6rzpy3o3kwkrynm - ts-node: 10.9.1_bhanhq442dy43ncydsavgi4jfi - tsup: 6.7.0_pyqfhkbboucpxgvrs7ocxwodkm - typescript: 5.0.4 - zod: 3.21.4 + '@jest/globals': + specifier: 29.5.0 + version: 29.5.0 + '@jest/types': + specifier: 29.5.0 + version: 29.5.0 + '@tanstack/react-query': + specifier: 4.28.0 + version: 4.28.0(react-dom@18.2.0)(react@18.2.0) + '@testing-library/dom': + specifier: 9.2.0 + version: 9.2.0 + '@testing-library/jest-dom': + specifier: 5.16.5 + version: 5.16.5 + '@testing-library/react': + specifier: 14.0.0 + version: 14.0.0(react-dom@18.2.0)(react@18.2.0) + '@testing-library/react-hooks': + specifier: 8.0.1 + version: 8.0.1(@types/react@18.0.33)(react-dom@18.2.0)(react-test-renderer@18.2.0)(react@18.2.0) + '@testing-library/user-event': + specifier: 14.4.3 + version: 14.4.3(@testing-library/dom@9.2.0) + '@types/cors': + specifier: 2.8.13 + version: 2.8.13 + '@types/express': + specifier: 4.17.17 + version: 4.17.17 + '@types/jest': + specifier: 29.5.0 + version: 29.5.0 + '@types/node': + specifier: 18.15.11 + version: 18.15.11 + '@types/react': + specifier: 18.0.33 + version: 18.0.33 + '@zodios/axios': + specifier: workspace:* + version: link:../axios + '@zodios/core': + specifier: workspace:* + version: link:../core + '@zodios/fetch': + specifier: workspace:* + version: link:../fetch + cors: + specifier: 2.8.5 + version: 2.8.5 + cross-fetch: + specifier: 3.1.5 + version: 3.1.5 + express: + specifier: 4.18.2 + version: 4.18.2 + fp-ts: + specifier: 2.13.1 + version: 2.13.1 + io-ts: + specifier: 2.2.20 + version: 2.2.20(fp-ts@2.13.1) + jest: + specifier: 29.5.0 + version: 29.5.0(@types/node@18.15.11)(ts-node@10.9.1) + jest-environment-jsdom: + specifier: 29.5.0 + version: 29.5.0 + react: + specifier: 18.2.0 + version: 18.2.0 + react-dom: + specifier: 18.2.0 + version: 18.2.0(react@18.2.0) + react-test-renderer: + specifier: 18.2.0 + version: 18.2.0(react@18.2.0) + rimraf: + specifier: 4.4.1 + version: 4.4.1 + ts-jest: + specifier: 29.1.0 + version: 29.1.0(@babel/core@7.21.4)(@jest/types@29.5.0)(esbuild@0.17.14)(jest@29.5.0)(typescript@5.0.4) + ts-node: + specifier: 10.9.1 + version: 10.9.1(@types/node@18.15.11)(typescript@5.0.4) + tsup: + specifier: 6.7.0 + version: 6.7.0(ts-node@10.9.1)(typescript@5.0.4) + typescript: + specifier: 5.0.4 + version: 5.0.4 + zod: + specifier: 3.21.4 + version: 3.21.4 packages/testing: - specifiers: - '@jest/globals': 29.5.0 - '@jest/types': 29.5.0 - '@types/jest': 29.5.0 - '@types/node': 18.15.11 - '@zodios/core': workspace:* - '@zodios/fetch': workspace:* - form-data: ^4.0.0 - fp-ts: 2.13.1 - io-ts: 2.2.20 - jest: 29.5.0 - rimraf: 4.4.1 - ts-jest: 29.1.0 - ts-node: 10.9.1 - tsup: 6.7.0 - typescript: 5.0.4 - zod: 3.21.4 devDependencies: - '@jest/globals': 29.5.0 - '@jest/types': 29.5.0 - '@types/jest': 29.5.0 - '@types/node': 18.15.11 - '@zodios/core': link:../core - '@zodios/fetch': link:../fetch - form-data: 4.0.0 - fp-ts: 2.13.1 - io-ts: 2.2.20_fp-ts@2.13.1 - jest: 29.5.0_rrli7kzx2akox3oq6aahu3rvje - rimraf: 4.4.1 - ts-jest: 29.1.0_sye3n7rnony6rzpy3o3kwkrynm - ts-node: 10.9.1_bhanhq442dy43ncydsavgi4jfi - tsup: 6.7.0_pyqfhkbboucpxgvrs7ocxwodkm - typescript: 5.0.4 - zod: 3.21.4 + '@jest/globals': + specifier: 29.5.0 + version: 29.5.0 + '@jest/types': + specifier: 29.5.0 + version: 29.5.0 + '@types/jest': + specifier: 29.5.0 + version: 29.5.0 + '@types/node': + specifier: 18.15.11 + version: 18.15.11 + '@zodios/core': + specifier: workspace:* + version: link:../core + '@zodios/fetch': + specifier: workspace:* + version: link:../fetch + form-data: + specifier: ^4.0.0 + version: 4.0.0 + fp-ts: + specifier: 2.13.1 + version: 2.13.1 + io-ts: + specifier: 2.2.20 + version: 2.2.20(fp-ts@2.13.1) + jest: + specifier: 29.5.0 + version: 29.5.0(@types/node@18.15.11)(ts-node@10.9.1) + rimraf: + specifier: 4.4.1 + version: 4.4.1 + ts-jest: + specifier: 29.1.0 + version: 29.1.0(@babel/core@7.21.4)(@jest/types@29.5.0)(esbuild@0.17.14)(jest@29.5.0)(typescript@5.0.4) + ts-node: + specifier: 10.9.1 + version: 10.9.1(@types/node@18.15.11)(typescript@5.0.4) + tsup: + specifier: 6.7.0 + version: 6.7.0(ts-node@10.9.1)(typescript@5.0.4) + typescript: + specifier: 5.0.4 + version: 5.0.4 + zod: + specifier: 3.21.4 + version: 3.21.4 packages: - /@adobe/css-tools/4.2.0: + /@adobe/css-tools@4.2.0: resolution: {integrity: sha512-E09FiIft46CmH5Qnjb0wsW54/YQd69LsxeKUOWawmws1XWvyFGURnAChH0mlr7YPFR1ofwvUQfcL0J3lMxXqPA==} dev: true - /@ampproject/remapping/2.2.1: + /@ampproject/remapping@2.2.1: resolution: {integrity: sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==} engines: {node: '>=6.0.0'} dependencies: @@ -330,26 +504,26 @@ packages: '@jridgewell/trace-mapping': 0.3.18 dev: true - /@babel/code-frame/7.21.4: + /@babel/code-frame@7.21.4: resolution: {integrity: sha512-LYvhNKfwWSPpocw8GI7gpK2nq3HSDuEPC/uSYaALSJu9xjsalaaYFOq0Pwt5KmVqwEbZlDu81aLXwBOmD/Fv9g==} engines: {node: '>=6.9.0'} dependencies: '@babel/highlight': 7.18.6 dev: true - /@babel/compat-data/7.21.4: + /@babel/compat-data@7.21.4: resolution: {integrity: sha512-/DYyDpeCfaVinT40FPGdkkb+lYSKvsVuMjDAG7jPOWWiM1ibOaB9CXJAlc4d1QpP/U2q2P9jbrSlClKSErd55g==} engines: {node: '>=6.9.0'} dev: true - /@babel/core/7.21.4: + /@babel/core@7.21.4: resolution: {integrity: sha512-qt/YV149Jman/6AfmlxJ04LMIu8bMoyl3RB91yTFrxQmgbrSvQMy7cI8Q62FHx1t8wJ8B5fu0UDoLwHAhUo1QA==} engines: {node: '>=6.9.0'} dependencies: '@ampproject/remapping': 2.2.1 '@babel/code-frame': 7.21.4 '@babel/generator': 7.21.4 - '@babel/helper-compilation-targets': 7.21.4_@babel+core@7.21.4 + '@babel/helper-compilation-targets': 7.21.4(@babel/core@7.21.4) '@babel/helper-module-transforms': 7.21.2 '@babel/helpers': 7.21.0 '@babel/parser': 7.21.4 @@ -365,7 +539,7 @@ packages: - supports-color dev: true - /@babel/generator/7.21.4: + /@babel/generator@7.21.4: resolution: {integrity: sha512-NieM3pVIYW2SwGzKoqfPrQsf4xGs9M9AIG3ThppsSRmO+m7eQhmI6amajKMUeIO37wFfsvnvcxQFx6x6iqxDnA==} engines: {node: '>=6.9.0'} dependencies: @@ -375,7 +549,7 @@ packages: jsesc: 2.5.2 dev: true - /@babel/helper-compilation-targets/7.21.4_@babel+core@7.21.4: + /@babel/helper-compilation-targets@7.21.4(@babel/core@7.21.4): resolution: {integrity: sha512-Fa0tTuOXZ1iL8IeDFUWCzjZcn+sJGd9RZdH9esYVjEejGmzf+FFYQpMi/kZUk2kPy/q1H3/GPw7np8qar/stfg==} engines: {node: '>=6.9.0'} peerDependencies: @@ -389,12 +563,12 @@ packages: semver: 6.3.0 dev: true - /@babel/helper-environment-visitor/7.18.9: + /@babel/helper-environment-visitor@7.18.9: resolution: {integrity: sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg==} engines: {node: '>=6.9.0'} dev: true - /@babel/helper-function-name/7.21.0: + /@babel/helper-function-name@7.21.0: resolution: {integrity: sha512-HfK1aMRanKHpxemaY2gqBmL04iAPOPRj7DxtNbiDOrJK+gdwkiNRVpCpUJYbUT+aZyemKN8brqTOxzCaG6ExRg==} engines: {node: '>=6.9.0'} dependencies: @@ -402,21 +576,21 @@ packages: '@babel/types': 7.21.4 dev: true - /@babel/helper-hoist-variables/7.18.6: + /@babel/helper-hoist-variables@7.18.6: resolution: {integrity: sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==} engines: {node: '>=6.9.0'} dependencies: '@babel/types': 7.21.4 dev: true - /@babel/helper-module-imports/7.21.4: + /@babel/helper-module-imports@7.21.4: resolution: {integrity: sha512-orajc5T2PsRYUN3ZryCEFeMDYwyw09c/pZeaQEZPH0MpKzSvn3e0uXsDBu3k03VI+9DBiRo+l22BfKTpKwa/Wg==} engines: {node: '>=6.9.0'} dependencies: '@babel/types': 7.21.4 dev: true - /@babel/helper-module-transforms/7.21.2: + /@babel/helper-module-transforms@7.21.2: resolution: {integrity: sha512-79yj2AR4U/Oqq/WOV7Lx6hUjau1Zfo4cI+JLAVYeMV5XIlbOhmjEk5ulbTc9fMpmlojzZHkUUxAiK+UKn+hNQQ==} engines: {node: '>=6.9.0'} dependencies: @@ -432,41 +606,41 @@ packages: - supports-color dev: true - /@babel/helper-plugin-utils/7.20.2: + /@babel/helper-plugin-utils@7.20.2: resolution: {integrity: sha512-8RvlJG2mj4huQ4pZ+rU9lqKi9ZKiRmuvGuM2HlWmkmgOhbs6zEAw6IEiJ5cQqGbDzGZOhwuOQNtZMi/ENLjZoQ==} engines: {node: '>=6.9.0'} dev: true - /@babel/helper-simple-access/7.20.2: + /@babel/helper-simple-access@7.20.2: resolution: {integrity: sha512-+0woI/WPq59IrqDYbVGfshjT5Dmk/nnbdpcF8SnMhhXObpTq2KNBdLFRFrkVdbDOyUmHBCxzm5FHV1rACIkIbA==} engines: {node: '>=6.9.0'} dependencies: '@babel/types': 7.21.4 dev: true - /@babel/helper-split-export-declaration/7.18.6: + /@babel/helper-split-export-declaration@7.18.6: resolution: {integrity: sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==} engines: {node: '>=6.9.0'} dependencies: '@babel/types': 7.21.4 dev: true - /@babel/helper-string-parser/7.19.4: + /@babel/helper-string-parser@7.19.4: resolution: {integrity: sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw==} engines: {node: '>=6.9.0'} dev: true - /@babel/helper-validator-identifier/7.19.1: + /@babel/helper-validator-identifier@7.19.1: resolution: {integrity: sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==} engines: {node: '>=6.9.0'} dev: true - /@babel/helper-validator-option/7.21.0: + /@babel/helper-validator-option@7.21.0: resolution: {integrity: sha512-rmL/B8/f0mKS2baE9ZpyTcTavvEuWhTTW8amjzXNvYG4AwBsqTLikfXsEofsJEfKHf+HQVQbFOHy6o+4cnC/fQ==} engines: {node: '>=6.9.0'} dev: true - /@babel/helpers/7.21.0: + /@babel/helpers@7.21.0: resolution: {integrity: sha512-XXve0CBtOW0pd7MRzzmoyuSj0e3SEzj8pgyFxnTT1NJZL38BD1MK7yYrm8yefRPIDvNNe14xR4FdbHwpInD4rA==} engines: {node: '>=6.9.0'} dependencies: @@ -477,7 +651,7 @@ packages: - supports-color dev: true - /@babel/highlight/7.18.6: + /@babel/highlight@7.18.6: resolution: {integrity: sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==} engines: {node: '>=6.9.0'} dependencies: @@ -486,7 +660,7 @@ packages: js-tokens: 4.0.0 dev: true - /@babel/parser/7.21.4: + /@babel/parser@7.21.4: resolution: {integrity: sha512-alVJj7k7zIxqBZ7BTRhz0IqJFxW1VJbm6N8JbcYhQ186df9ZBPbZBmWSqAMXwHGsCJdYks7z/voa3ibiS5bCIw==} engines: {node: '>=6.0.0'} hasBin: true @@ -494,7 +668,7 @@ packages: '@babel/types': 7.21.4 dev: true - /@babel/plugin-syntax-async-generators/7.8.4_@babel+core@7.21.4: + /@babel/plugin-syntax-async-generators@7.8.4(@babel/core@7.21.4): resolution: {integrity: sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==} peerDependencies: '@babel/core': ^7.0.0-0 @@ -503,7 +677,7 @@ packages: '@babel/helper-plugin-utils': 7.20.2 dev: true - /@babel/plugin-syntax-bigint/7.8.3_@babel+core@7.21.4: + /@babel/plugin-syntax-bigint@7.8.3(@babel/core@7.21.4): resolution: {integrity: sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==} peerDependencies: '@babel/core': ^7.0.0-0 @@ -512,7 +686,7 @@ packages: '@babel/helper-plugin-utils': 7.20.2 dev: true - /@babel/plugin-syntax-class-properties/7.12.13_@babel+core@7.21.4: + /@babel/plugin-syntax-class-properties@7.12.13(@babel/core@7.21.4): resolution: {integrity: sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA==} peerDependencies: '@babel/core': ^7.0.0-0 @@ -521,7 +695,7 @@ packages: '@babel/helper-plugin-utils': 7.20.2 dev: true - /@babel/plugin-syntax-import-meta/7.10.4_@babel+core@7.21.4: + /@babel/plugin-syntax-import-meta@7.10.4(@babel/core@7.21.4): resolution: {integrity: sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==} peerDependencies: '@babel/core': ^7.0.0-0 @@ -530,7 +704,7 @@ packages: '@babel/helper-plugin-utils': 7.20.2 dev: true - /@babel/plugin-syntax-json-strings/7.8.3_@babel+core@7.21.4: + /@babel/plugin-syntax-json-strings@7.8.3(@babel/core@7.21.4): resolution: {integrity: sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==} peerDependencies: '@babel/core': ^7.0.0-0 @@ -539,7 +713,7 @@ packages: '@babel/helper-plugin-utils': 7.20.2 dev: true - /@babel/plugin-syntax-jsx/7.21.4_@babel+core@7.21.4: + /@babel/plugin-syntax-jsx@7.21.4(@babel/core@7.21.4): resolution: {integrity: sha512-5hewiLct5OKyh6PLKEYaFclcqtIgCb6bmELouxjF6up5q3Sov7rOayW4RwhbaBL0dit8rA80GNfY+UuDp2mBbQ==} engines: {node: '>=6.9.0'} peerDependencies: @@ -549,7 +723,7 @@ packages: '@babel/helper-plugin-utils': 7.20.2 dev: true - /@babel/plugin-syntax-logical-assignment-operators/7.10.4_@babel+core@7.21.4: + /@babel/plugin-syntax-logical-assignment-operators@7.10.4(@babel/core@7.21.4): resolution: {integrity: sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==} peerDependencies: '@babel/core': ^7.0.0-0 @@ -558,7 +732,7 @@ packages: '@babel/helper-plugin-utils': 7.20.2 dev: true - /@babel/plugin-syntax-nullish-coalescing-operator/7.8.3_@babel+core@7.21.4: + /@babel/plugin-syntax-nullish-coalescing-operator@7.8.3(@babel/core@7.21.4): resolution: {integrity: sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==} peerDependencies: '@babel/core': ^7.0.0-0 @@ -567,7 +741,7 @@ packages: '@babel/helper-plugin-utils': 7.20.2 dev: true - /@babel/plugin-syntax-numeric-separator/7.10.4_@babel+core@7.21.4: + /@babel/plugin-syntax-numeric-separator@7.10.4(@babel/core@7.21.4): resolution: {integrity: sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==} peerDependencies: '@babel/core': ^7.0.0-0 @@ -576,7 +750,7 @@ packages: '@babel/helper-plugin-utils': 7.20.2 dev: true - /@babel/plugin-syntax-object-rest-spread/7.8.3_@babel+core@7.21.4: + /@babel/plugin-syntax-object-rest-spread@7.8.3(@babel/core@7.21.4): resolution: {integrity: sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==} peerDependencies: '@babel/core': ^7.0.0-0 @@ -585,7 +759,7 @@ packages: '@babel/helper-plugin-utils': 7.20.2 dev: true - /@babel/plugin-syntax-optional-catch-binding/7.8.3_@babel+core@7.21.4: + /@babel/plugin-syntax-optional-catch-binding@7.8.3(@babel/core@7.21.4): resolution: {integrity: sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==} peerDependencies: '@babel/core': ^7.0.0-0 @@ -594,7 +768,7 @@ packages: '@babel/helper-plugin-utils': 7.20.2 dev: true - /@babel/plugin-syntax-optional-chaining/7.8.3_@babel+core@7.21.4: + /@babel/plugin-syntax-optional-chaining@7.8.3(@babel/core@7.21.4): resolution: {integrity: sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==} peerDependencies: '@babel/core': ^7.0.0-0 @@ -603,7 +777,7 @@ packages: '@babel/helper-plugin-utils': 7.20.2 dev: true - /@babel/plugin-syntax-top-level-await/7.14.5_@babel+core@7.21.4: + /@babel/plugin-syntax-top-level-await@7.14.5(@babel/core@7.21.4): resolution: {integrity: sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw==} engines: {node: '>=6.9.0'} peerDependencies: @@ -613,7 +787,7 @@ packages: '@babel/helper-plugin-utils': 7.20.2 dev: true - /@babel/plugin-syntax-typescript/7.21.4_@babel+core@7.21.4: + /@babel/plugin-syntax-typescript@7.21.4(@babel/core@7.21.4): resolution: {integrity: sha512-xz0D39NvhQn4t4RNsHmDnnsaQizIlUkdtYvLs8La1BlfjQ6JEwxkJGeqJMW2tAXx+q6H+WFuUTXNdYVpEya0YA==} engines: {node: '>=6.9.0'} peerDependencies: @@ -623,14 +797,14 @@ packages: '@babel/helper-plugin-utils': 7.20.2 dev: true - /@babel/runtime/7.21.0: + /@babel/runtime@7.21.0: resolution: {integrity: sha512-xwII0//EObnq89Ji5AKYQaRYiW/nZ3llSv29d49IuxPhKbtJoLP+9QUUZ4nVragQVtaVGeZrpB+ZtG/Pdy/POw==} engines: {node: '>=6.9.0'} dependencies: regenerator-runtime: 0.13.11 dev: true - /@babel/template/7.20.7: + /@babel/template@7.20.7: resolution: {integrity: sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw==} engines: {node: '>=6.9.0'} dependencies: @@ -639,7 +813,7 @@ packages: '@babel/types': 7.21.4 dev: true - /@babel/traverse/7.21.4: + /@babel/traverse@7.21.4: resolution: {integrity: sha512-eyKrRHKdyZxqDm+fV1iqL9UAHMoIg0nDaGqfIOd8rKH17m5snv7Gn4qgjBoFfLz9APvjFU/ICT00NVCv1Epp8Q==} engines: {node: '>=6.9.0'} dependencies: @@ -657,7 +831,7 @@ packages: - supports-color dev: true - /@babel/types/7.21.4: + /@babel/types@7.21.4: resolution: {integrity: sha512-rU2oY501qDxE8Pyo7i/Orqma4ziCOrby0/9mvbDUGEfvZjb279Nk9k19e2fiCxHbRRpY2ZyrgW1eq22mvmOIzA==} engines: {node: '>=6.9.0'} dependencies: @@ -666,11 +840,11 @@ packages: to-fast-properties: 2.0.0 dev: true - /@bcoe/v8-coverage/0.2.3: + /@bcoe/v8-coverage@0.2.3: resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} dev: true - /@changesets/apply-release-plan/6.1.3: + /@changesets/apply-release-plan@6.1.3: resolution: {integrity: sha512-ECDNeoc3nfeAe1jqJb5aFQX7CqzQhD2klXRez2JDb/aVpGUbX673HgKrnrgJRuQR/9f2TtLoYIzrGB9qwD77mg==} dependencies: '@babel/runtime': 7.21.0 @@ -688,7 +862,7 @@ packages: semver: 5.7.1 dev: true - /@changesets/assemble-release-plan/5.2.3: + /@changesets/assemble-release-plan@5.2.3: resolution: {integrity: sha512-g7EVZCmnWz3zMBAdrcKhid4hkHT+Ft1n0mLussFMcB1dE2zCuwcvGoy9ec3yOgPGF4hoMtgHaMIk3T3TBdvU9g==} dependencies: '@babel/runtime': 7.21.0 @@ -699,13 +873,13 @@ packages: semver: 5.7.1 dev: true - /@changesets/changelog-git/0.1.14: + /@changesets/changelog-git@0.1.14: resolution: {integrity: sha512-+vRfnKtXVWsDDxGctOfzJsPhaCdXRYoe+KyWYoq5X/GqoISREiat0l3L8B0a453B2B4dfHGcZaGyowHbp9BSaA==} dependencies: '@changesets/types': 5.2.1 dev: true - /@changesets/cli/2.26.1: + /@changesets/cli@2.26.1: resolution: {integrity: sha512-XnTa+b51vt057fyAudvDKGB0Sh72xutQZNAdXkCqPBKO2zvs2yYZx5hFZj1u9cbtpwM6Sxtcr02/FQJfZOzemQ==} hasBin: true dependencies: @@ -744,7 +918,7 @@ packages: tty-table: 4.2.1 dev: true - /@changesets/config/2.3.0: + /@changesets/config@2.3.0: resolution: {integrity: sha512-EgP/px6mhCx8QeaMAvWtRrgyxW08k/Bx2tpGT+M84jEdX37v3VKfh4Cz1BkwrYKuMV2HZKeHOh8sHvja/HcXfQ==} dependencies: '@changesets/errors': 0.1.4 @@ -756,13 +930,13 @@ packages: micromatch: 4.0.5 dev: true - /@changesets/errors/0.1.4: + /@changesets/errors@0.1.4: resolution: {integrity: sha512-HAcqPF7snsUJ/QzkWoKfRfXushHTu+K5KZLJWPb34s4eCZShIf8BFO3fwq6KU8+G7L5KdtN2BzQAXOSXEyiY9Q==} dependencies: extendable-error: 0.1.7 dev: true - /@changesets/get-dependents-graph/1.3.5: + /@changesets/get-dependents-graph@1.3.5: resolution: {integrity: sha512-w1eEvnWlbVDIY8mWXqWuYE9oKhvIaBhzqzo4ITSJY9hgoqQ3RoBqwlcAzg11qHxv/b8ReDWnMrpjpKrW6m1ZTA==} dependencies: '@changesets/types': 5.2.1 @@ -772,7 +946,7 @@ packages: semver: 5.7.1 dev: true - /@changesets/get-release-plan/3.0.16: + /@changesets/get-release-plan@3.0.16: resolution: {integrity: sha512-OpP9QILpBp1bY2YNIKFzwigKh7Qe9KizRsZomzLe6pK8IUo8onkAAVUD8+JRKSr8R7d4+JRuQrfSSNlEwKyPYg==} dependencies: '@babel/runtime': 7.21.0 @@ -784,11 +958,11 @@ packages: '@manypkg/get-packages': 1.1.3 dev: true - /@changesets/get-version-range-type/0.3.2: + /@changesets/get-version-range-type@0.3.2: resolution: {integrity: sha512-SVqwYs5pULYjYT4op21F2pVbcrca4qA/bAA3FmFXKMN7Y+HcO8sbZUTx3TAy2VXulP2FACd1aC7f2nTuqSPbqg==} dev: true - /@changesets/git/2.0.0: + /@changesets/git@2.0.0: resolution: {integrity: sha512-enUVEWbiqUTxqSnmesyJGWfzd51PY4H7mH9yUw0hPVpZBJ6tQZFMU3F3mT/t9OJ/GjyiM4770i+sehAn6ymx6A==} dependencies: '@babel/runtime': 7.21.0 @@ -800,20 +974,20 @@ packages: spawndamnit: 2.0.0 dev: true - /@changesets/logger/0.0.5: + /@changesets/logger@0.0.5: resolution: {integrity: sha512-gJyZHomu8nASHpaANzc6bkQMO9gU/ib20lqew1rVx753FOxffnCrJlGIeQVxNWCqM+o6OOleCo/ivL8UAO5iFw==} dependencies: chalk: 2.4.2 dev: true - /@changesets/parse/0.3.16: + /@changesets/parse@0.3.16: resolution: {integrity: sha512-127JKNd167ayAuBjUggZBkmDS5fIKsthnr9jr6bdnuUljroiERW7FBTDNnNVyJ4l69PzR57pk6mXQdtJyBCJKg==} dependencies: '@changesets/types': 5.2.1 js-yaml: 3.14.1 dev: true - /@changesets/pre/1.0.14: + /@changesets/pre@1.0.14: resolution: {integrity: sha512-dTsHmxQWEQekHYHbg+M1mDVYFvegDh9j/kySNuDKdylwfMEevTeDouR7IfHNyVodxZXu17sXoJuf2D0vi55FHQ==} dependencies: '@babel/runtime': 7.21.0 @@ -823,7 +997,7 @@ packages: fs-extra: 7.0.1 dev: true - /@changesets/read/0.5.9: + /@changesets/read@0.5.9: resolution: {integrity: sha512-T8BJ6JS6j1gfO1HFq50kU3qawYxa4NTbI/ASNVVCBTsKquy2HYwM9r7ZnzkiMe8IEObAJtUVGSrePCOxAK2haQ==} dependencies: '@babel/runtime': 7.21.0 @@ -836,15 +1010,15 @@ packages: p-filter: 2.1.0 dev: true - /@changesets/types/4.1.0: + /@changesets/types@4.1.0: resolution: {integrity: sha512-LDQvVDv5Kb50ny2s25Fhm3d9QSZimsoUGBsUioj6MC3qbMUCuC8GPIvk/M6IvXx3lYhAs0lwWUQLb+VIEUCECw==} dev: true - /@changesets/types/5.2.1: + /@changesets/types@5.2.1: resolution: {integrity: sha512-myLfHbVOqaq9UtUKqR/nZA/OY7xFjQMdfgfqeZIBK4d0hA6pgxArvdv8M+6NUzzBsjWLOtvApv8YHr4qM+Kpfg==} dev: true - /@changesets/write/0.2.3: + /@changesets/write@0.2.3: resolution: {integrity: sha512-Dbamr7AIMvslKnNYsLFafaVORx4H0pvCA2MHqgtNCySMe1blImEyAEOzDmcgKAkgz4+uwoLz7demIrX+JBr/Xw==} dependencies: '@babel/runtime': 7.21.0 @@ -854,32 +1028,32 @@ packages: prettier: 2.8.7 dev: true - /@cspotcode/source-map-support/0.8.1: + /@cspotcode/source-map-support@0.8.1: resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} engines: {node: '>=12'} dependencies: '@jridgewell/trace-mapping': 0.3.9 dev: true - /@esbuild/android-arm/0.17.14: - resolution: {integrity: sha512-0CnlwnjDU8cks0yJLXfkaU/uoLyRf9VZJs4p1PskBr2AlAHeEsFEwJEo0of/Z3g+ilw5mpyDwThlxzNEIxOE4g==} + /@esbuild/android-arm64@0.17.14: + resolution: {integrity: sha512-eLOpPO1RvtsP71afiFTvS7tVFShJBCT0txiv/xjFBo5a7R7Gjw7X0IgIaFoLKhqXYAXhahoXm7qAmRXhY4guJg==} engines: {node: '>=12'} - cpu: [arm] + cpu: [arm64] os: [android] requiresBuild: true dev: true optional: true - /@esbuild/android-arm64/0.17.14: - resolution: {integrity: sha512-eLOpPO1RvtsP71afiFTvS7tVFShJBCT0txiv/xjFBo5a7R7Gjw7X0IgIaFoLKhqXYAXhahoXm7qAmRXhY4guJg==} + /@esbuild/android-arm@0.17.14: + resolution: {integrity: sha512-0CnlwnjDU8cks0yJLXfkaU/uoLyRf9VZJs4p1PskBr2AlAHeEsFEwJEo0of/Z3g+ilw5mpyDwThlxzNEIxOE4g==} engines: {node: '>=12'} - cpu: [arm64] + cpu: [arm] os: [android] requiresBuild: true dev: true optional: true - /@esbuild/android-x64/0.17.14: + /@esbuild/android-x64@0.17.14: resolution: {integrity: sha512-nrfQYWBfLGfSGLvRVlt6xi63B5IbfHm3tZCdu/82zuFPQ7zez4XjmRtF/wIRYbJQ/DsZrxJdEvYFE67avYXyng==} engines: {node: '>=12'} cpu: [x64] @@ -888,7 +1062,7 @@ packages: dev: true optional: true - /@esbuild/darwin-arm64/0.17.14: + /@esbuild/darwin-arm64@0.17.14: resolution: {integrity: sha512-eoSjEuDsU1ROwgBH/c+fZzuSyJUVXQTOIN9xuLs9dE/9HbV/A5IqdXHU1p2OfIMwBwOYJ9SFVGGldxeRCUJFyw==} engines: {node: '>=12'} cpu: [arm64] @@ -897,7 +1071,7 @@ packages: dev: true optional: true - /@esbuild/darwin-x64/0.17.14: + /@esbuild/darwin-x64@0.17.14: resolution: {integrity: sha512-zN0U8RWfrDttdFNkHqFYZtOH8hdi22z0pFm0aIJPsNC4QQZv7je8DWCX5iA4Zx6tRhS0CCc0XC2m7wKsbWEo5g==} engines: {node: '>=12'} cpu: [x64] @@ -906,7 +1080,7 @@ packages: dev: true optional: true - /@esbuild/freebsd-arm64/0.17.14: + /@esbuild/freebsd-arm64@0.17.14: resolution: {integrity: sha512-z0VcD4ibeZWVQCW1O7szaLxGsx54gcCnajEJMdYoYjLiq4g1jrP2lMq6pk71dbS5+7op/L2Aod+erw+EUr28/A==} engines: {node: '>=12'} cpu: [arm64] @@ -915,7 +1089,7 @@ packages: dev: true optional: true - /@esbuild/freebsd-x64/0.17.14: + /@esbuild/freebsd-x64@0.17.14: resolution: {integrity: sha512-hd9mPcxfTgJlolrPlcXkQk9BMwNBvNBsVaUe5eNUqXut6weDQH8whcNaKNF2RO8NbpT6GY8rHOK2A9y++s+ehw==} engines: {node: '>=12'} cpu: [x64] @@ -924,25 +1098,25 @@ packages: dev: true optional: true - /@esbuild/linux-arm/0.17.14: - resolution: {integrity: sha512-BNTl+wSJ1omsH8s3TkQmIIIQHwvwJrU9u1ggb9XU2KTVM4TmthRIVyxSp2qxROJHhZuW/r8fht46/QE8hU8Qvg==} + /@esbuild/linux-arm64@0.17.14: + resolution: {integrity: sha512-FhAMNYOq3Iblcj9i+K0l1Fp/MHt+zBeRu/Qkf0LtrcFu3T45jcwB6A1iMsemQ42vR3GBhjNZJZTaCe3VFPbn9g==} engines: {node: '>=12'} - cpu: [arm] + cpu: [arm64] os: [linux] requiresBuild: true dev: true optional: true - /@esbuild/linux-arm64/0.17.14: - resolution: {integrity: sha512-FhAMNYOq3Iblcj9i+K0l1Fp/MHt+zBeRu/Qkf0LtrcFu3T45jcwB6A1iMsemQ42vR3GBhjNZJZTaCe3VFPbn9g==} + /@esbuild/linux-arm@0.17.14: + resolution: {integrity: sha512-BNTl+wSJ1omsH8s3TkQmIIIQHwvwJrU9u1ggb9XU2KTVM4TmthRIVyxSp2qxROJHhZuW/r8fht46/QE8hU8Qvg==} engines: {node: '>=12'} - cpu: [arm64] + cpu: [arm] os: [linux] requiresBuild: true dev: true optional: true - /@esbuild/linux-ia32/0.17.14: + /@esbuild/linux-ia32@0.17.14: resolution: {integrity: sha512-91OK/lQ5y2v7AsmnFT+0EyxdPTNhov3y2CWMdizyMfxSxRqHazXdzgBKtlmkU2KYIc+9ZK3Vwp2KyXogEATYxQ==} engines: {node: '>=12'} cpu: [ia32] @@ -951,7 +1125,7 @@ packages: dev: true optional: true - /@esbuild/linux-loong64/0.17.14: + /@esbuild/linux-loong64@0.17.14: resolution: {integrity: sha512-vp15H+5NR6hubNgMluqqKza85HcGJgq7t6rMH7O3Y6ApiOWPkvW2AJfNojUQimfTp6OUrACUXfR4hmpcENXoMQ==} engines: {node: '>=12'} cpu: [loong64] @@ -960,7 +1134,7 @@ packages: dev: true optional: true - /@esbuild/linux-mips64el/0.17.14: + /@esbuild/linux-mips64el@0.17.14: resolution: {integrity: sha512-90TOdFV7N+fgi6c2+GO9ochEkmm9kBAKnuD5e08GQMgMINOdOFHuYLPQ91RYVrnWwQ5683sJKuLi9l4SsbJ7Hg==} engines: {node: '>=12'} cpu: [mips64el] @@ -969,7 +1143,7 @@ packages: dev: true optional: true - /@esbuild/linux-ppc64/0.17.14: + /@esbuild/linux-ppc64@0.17.14: resolution: {integrity: sha512-NnBGeoqKkTugpBOBZZoktQQ1Yqb7aHKmHxsw43NddPB2YWLAlpb7THZIzsRsTr0Xw3nqiPxbA1H31ZMOG+VVPQ==} engines: {node: '>=12'} cpu: [ppc64] @@ -978,7 +1152,7 @@ packages: dev: true optional: true - /@esbuild/linux-riscv64/0.17.14: + /@esbuild/linux-riscv64@0.17.14: resolution: {integrity: sha512-0qdlKScLXA8MGVy21JUKvMzCYWovctuP8KKqhtE5A6IVPq4onxXhSuhwDd2g5sRCzNDlDjitc5sX31BzDoL5Fw==} engines: {node: '>=12'} cpu: [riscv64] @@ -987,7 +1161,7 @@ packages: dev: true optional: true - /@esbuild/linux-s390x/0.17.14: + /@esbuild/linux-s390x@0.17.14: resolution: {integrity: sha512-Hdm2Jo1yaaOro4v3+6/zJk6ygCqIZuSDJHdHaf8nVH/tfOuoEX5Riv03Ka15LmQBYJObUTNS1UdyoMk0WUn9Ww==} engines: {node: '>=12'} cpu: [s390x] @@ -996,7 +1170,7 @@ packages: dev: true optional: true - /@esbuild/linux-x64/0.17.14: + /@esbuild/linux-x64@0.17.14: resolution: {integrity: sha512-8KHF17OstlK4DuzeF/KmSgzrTWQrkWj5boluiiq7kvJCiQVzUrmSkaBvcLB2UgHpKENO2i6BthPkmUhNDaJsVw==} engines: {node: '>=12'} cpu: [x64] @@ -1005,7 +1179,7 @@ packages: dev: true optional: true - /@esbuild/netbsd-x64/0.17.14: + /@esbuild/netbsd-x64@0.17.14: resolution: {integrity: sha512-nVwpqvb3yyXztxIT2+VsxJhB5GCgzPdk1n0HHSnchRAcxqKO6ghXwHhJnr0j/B+5FSyEqSxF4q03rbA2fKXtUQ==} engines: {node: '>=12'} cpu: [x64] @@ -1014,7 +1188,7 @@ packages: dev: true optional: true - /@esbuild/openbsd-x64/0.17.14: + /@esbuild/openbsd-x64@0.17.14: resolution: {integrity: sha512-1RZ7uQQ9zcy/GSAJL1xPdN7NDdOOtNEGiJalg/MOzeakZeTrgH/DoCkbq7TaPDiPhWqnDF+4bnydxRqQD7il6g==} engines: {node: '>=12'} cpu: [x64] @@ -1023,7 +1197,7 @@ packages: dev: true optional: true - /@esbuild/sunos-x64/0.17.14: + /@esbuild/sunos-x64@0.17.14: resolution: {integrity: sha512-nqMjDsFwv7vp7msrwWRysnM38Sd44PKmW8EzV01YzDBTcTWUpczQg6mGao9VLicXSgW/iookNK6AxeogNVNDZA==} engines: {node: '>=12'} cpu: [x64] @@ -1032,7 +1206,7 @@ packages: dev: true optional: true - /@esbuild/win32-arm64/0.17.14: + /@esbuild/win32-arm64@0.17.14: resolution: {integrity: sha512-xrD0mccTKRBBIotrITV7WVQAwNJ5+1va6L0H9zN92v2yEdjfAN7864cUaZwJS7JPEs53bDTzKFbfqVlG2HhyKQ==} engines: {node: '>=12'} cpu: [arm64] @@ -1041,7 +1215,7 @@ packages: dev: true optional: true - /@esbuild/win32-ia32/0.17.14: + /@esbuild/win32-ia32@0.17.14: resolution: {integrity: sha512-nXpkz9bbJrLLyUTYtRotSS3t5b+FOuljg8LgLdINWFs3FfqZMtbnBCZFUmBzQPyxqU87F8Av+3Nco/M3hEcu1w==} engines: {node: '>=12'} cpu: [ia32] @@ -1050,7 +1224,7 @@ packages: dev: true optional: true - /@esbuild/win32-x64/0.17.14: + /@esbuild/win32-x64@0.17.14: resolution: {integrity: sha512-gPQmsi2DKTaEgG14hc3CHXHp62k8g6qr0Pas+I4lUxRMugGSATh/Bi8Dgusoz9IQ0IfdrvLpco6kujEIBoaogA==} engines: {node: '>=12'} cpu: [x64] @@ -1059,7 +1233,7 @@ packages: dev: true optional: true - /@istanbuljs/load-nyc-config/1.1.0: + /@istanbuljs/load-nyc-config@1.1.0: resolution: {integrity: sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==} engines: {node: '>=8'} dependencies: @@ -1070,12 +1244,12 @@ packages: resolve-from: 5.0.0 dev: true - /@istanbuljs/schema/0.1.3: + /@istanbuljs/schema@0.1.3: resolution: {integrity: sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==} engines: {node: '>=8'} dev: true - /@jest/console/29.5.0: + /@jest/console@29.5.0: resolution: {integrity: sha512-NEpkObxPwyw/XxZVLPmAGKE89IQRp4puc6IQRPru6JKd1M3fW9v1xM1AnzIJE65hbCkzQAdnL8P47e9hzhiYLQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: @@ -1087,7 +1261,7 @@ packages: slash: 3.0.0 dev: true - /@jest/core/29.5.0_ts-node@10.9.1: + /@jest/core@29.5.0(ts-node@10.9.1): resolution: {integrity: sha512-28UzQc7ulUrOQw1IsN/kv1QES3q2kkbl/wGslyhAclqZ/8cMdB5M68BffkIdSJgKBUt50d3hbwJ92XESlE7LiQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: @@ -1108,7 +1282,7 @@ packages: exit: 0.1.2 graceful-fs: 4.2.11 jest-changed-files: 29.5.0 - jest-config: 29.5.0_rrli7kzx2akox3oq6aahu3rvje + jest-config: 29.5.0(@types/node@18.15.11)(ts-node@10.9.1) jest-haste-map: 29.5.0 jest-message-util: 29.5.0 jest-regex-util: 29.4.3 @@ -1129,7 +1303,7 @@ packages: - ts-node dev: true - /@jest/environment/29.5.0: + /@jest/environment@29.5.0: resolution: {integrity: sha512-5FXw2+wD29YU1d4I2htpRX7jYnAyTRjP2CsXQdo9SAM8g3ifxWPSV0HnClSn71xwctr0U3oZIIH+dtbfmnbXVQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: @@ -1139,14 +1313,14 @@ packages: jest-mock: 29.5.0 dev: true - /@jest/expect-utils/29.5.0: + /@jest/expect-utils@29.5.0: resolution: {integrity: sha512-fmKzsidoXQT2KwnrwE0SQq3uj8Z763vzR8LnLBwC2qYWEFpjX8daRsk6rHUM1QvNlEW/UJXNXm59ztmJJWs2Mg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: jest-get-type: 29.4.3 dev: true - /@jest/expect/29.5.0: + /@jest/expect@29.5.0: resolution: {integrity: sha512-PueDR2HGihN3ciUNGr4uelropW7rqUfTiOn+8u0leg/42UhblPxHkfoh0Ruu3I9Y1962P3u2DY4+h7GVTSVU6g==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: @@ -1156,7 +1330,7 @@ packages: - supports-color dev: true - /@jest/fake-timers/29.5.0: + /@jest/fake-timers@29.5.0: resolution: {integrity: sha512-9ARvuAAQcBwDAqOnglWq2zwNIRUDtk/SCkp/ToGEhFv5r86K21l+VEs0qNTaXtyiY0lEePl3kylijSYJQqdbDg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: @@ -1168,7 +1342,7 @@ packages: jest-util: 29.5.0 dev: true - /@jest/globals/29.5.0: + /@jest/globals@29.5.0: resolution: {integrity: sha512-S02y0qMWGihdzNbUiqSAiKSpSozSuHX5UYc7QbnHP+D9Lyw8DgGGCinrN9uSuHPeKgSSzvPom2q1nAtBvUsvPQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: @@ -1180,7 +1354,7 @@ packages: - supports-color dev: true - /@jest/reporters/29.5.0: + /@jest/reporters@29.5.0: resolution: {integrity: sha512-D05STXqj/M8bP9hQNSICtPqz97u7ffGzZu+9XLucXhkOFBqKcXe04JLZOgIekOxdb73MAoBUFnqvf7MCpKk5OA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: @@ -1217,14 +1391,14 @@ packages: - supports-color dev: true - /@jest/schemas/29.4.3: + /@jest/schemas@29.4.3: resolution: {integrity: sha512-VLYKXQmtmuEz6IxJsrZwzG9NvtkQsWNnWMsKxqWNu3+CnfzJQhp0WDDKWLVV9hLKr0l3SLLFRqcYHjhtyuDVxg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@sinclair/typebox': 0.25.24 dev: true - /@jest/source-map/29.4.3: + /@jest/source-map@29.4.3: resolution: {integrity: sha512-qyt/mb6rLyd9j1jUts4EQncvS6Yy3PM9HghnNv86QBlV+zdL2inCdK1tuVlL+J+lpiw2BI67qXOrX3UurBqQ1w==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: @@ -1233,7 +1407,7 @@ packages: graceful-fs: 4.2.11 dev: true - /@jest/test-result/29.5.0: + /@jest/test-result@29.5.0: resolution: {integrity: sha512-fGl4rfitnbfLsrfx1uUpDEESS7zM8JdgZgOCQuxQvL1Sn/I6ijeAVQWGfXI9zb1i9Mzo495cIpVZhA0yr60PkQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: @@ -1243,7 +1417,7 @@ packages: collect-v8-coverage: 1.0.1 dev: true - /@jest/test-sequencer/29.5.0: + /@jest/test-sequencer@29.5.0: resolution: {integrity: sha512-yPafQEcKjkSfDXyvtgiV4pevSeyuA6MQr6ZIdVkWJly9vkqjnFfcfhRQqpD5whjoU8EORki752xQmjaqoFjzMQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: @@ -1253,7 +1427,7 @@ packages: slash: 3.0.0 dev: true - /@jest/transform/29.5.0: + /@jest/transform@29.5.0: resolution: {integrity: sha512-8vbeZWqLJOvHaDfeMuoHITGKSz5qWc9u04lnWrQE3VyuSw604PzQM824ZeX9XSjUCeDiE3GuxZe5UKa8J61NQw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: @@ -1276,7 +1450,7 @@ packages: - supports-color dev: true - /@jest/types/29.5.0: + /@jest/types@29.5.0: resolution: {integrity: sha512-qbu7kN6czmVRc3xWFQcAN03RAUamgppVUdXrvl1Wr3jlNF93o9mJbGcDWrwGB6ht44u7efB1qCFgVQmca24Uog==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: @@ -1288,7 +1462,7 @@ packages: chalk: 4.1.2 dev: true - /@jridgewell/gen-mapping/0.3.3: + /@jridgewell/gen-mapping@0.3.3: resolution: {integrity: sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==} engines: {node: '>=6.0.0'} dependencies: @@ -1297,44 +1471,44 @@ packages: '@jridgewell/trace-mapping': 0.3.18 dev: true - /@jridgewell/resolve-uri/3.1.0: + /@jridgewell/resolve-uri@3.1.0: resolution: {integrity: sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==} engines: {node: '>=6.0.0'} dev: true - /@jridgewell/resolve-uri/3.1.1: + /@jridgewell/resolve-uri@3.1.1: resolution: {integrity: sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==} engines: {node: '>=6.0.0'} dev: true - /@jridgewell/set-array/1.1.2: + /@jridgewell/set-array@1.1.2: resolution: {integrity: sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==} engines: {node: '>=6.0.0'} dev: true - /@jridgewell/sourcemap-codec/1.4.14: + /@jridgewell/sourcemap-codec@1.4.14: resolution: {integrity: sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==} dev: true - /@jridgewell/sourcemap-codec/1.4.15: + /@jridgewell/sourcemap-codec@1.4.15: resolution: {integrity: sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==} dev: true - /@jridgewell/trace-mapping/0.3.18: + /@jridgewell/trace-mapping@0.3.18: resolution: {integrity: sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==} dependencies: '@jridgewell/resolve-uri': 3.1.0 '@jridgewell/sourcemap-codec': 1.4.14 dev: true - /@jridgewell/trace-mapping/0.3.9: + /@jridgewell/trace-mapping@0.3.9: resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} dependencies: '@jridgewell/resolve-uri': 3.1.1 '@jridgewell/sourcemap-codec': 1.4.15 dev: true - /@manypkg/find-root/1.1.0: + /@manypkg/find-root@1.1.0: resolution: {integrity: sha512-mki5uBvhHzO8kYYix/WRy2WX8S3B5wdVSc9D6KcU5lQNglP2yt58/VfLuAK49glRXChosY8ap2oJ1qgma3GUVA==} dependencies: '@babel/runtime': 7.21.0 @@ -1343,7 +1517,7 @@ packages: fs-extra: 8.1.0 dev: true - /@manypkg/get-packages/1.1.3: + /@manypkg/get-packages@1.1.3: resolution: {integrity: sha512-fo+QhuU3qE/2TQMQmbVMqaQ6EWbMhi4ABWP+O4AM1NqPBuy0OrApV5LO6BrrgnhtAHS2NH6RrVk9OL181tTi8A==} dependencies: '@babel/runtime': 7.21.0 @@ -1354,7 +1528,7 @@ packages: read-yaml-file: 1.1.0 dev: true - /@nodelib/fs.scandir/2.1.5: + /@nodelib/fs.scandir@2.1.5: resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} engines: {node: '>= 8'} dependencies: @@ -1362,12 +1536,12 @@ packages: run-parallel: 1.2.0 dev: true - /@nodelib/fs.stat/2.0.5: + /@nodelib/fs.stat@2.0.5: resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} engines: {node: '>= 8'} dev: true - /@nodelib/fs.walk/1.2.8: + /@nodelib/fs.walk@1.2.8: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} engines: {node: '>= 8'} dependencies: @@ -1375,27 +1549,27 @@ packages: fastq: 1.15.0 dev: true - /@sinclair/typebox/0.25.24: + /@sinclair/typebox@0.25.24: resolution: {integrity: sha512-XJfwUVUKDHF5ugKwIcxEgc9k8b7HbznCp6eUfWgu710hMPNIO4aw4/zB5RogDQz8nd6gyCDpU9O/m6qYEWY6yQ==} dev: true - /@sinonjs/commons/2.0.0: + /@sinonjs/commons@2.0.0: resolution: {integrity: sha512-uLa0j859mMrg2slwQYdO/AkrOfmH+X6LTVmNTS9CqexuE2IvVORIkSpJLqePAbEnKJ77aMmCwr1NUZ57120Xcg==} dependencies: type-detect: 4.0.8 dev: true - /@sinonjs/fake-timers/10.0.2: + /@sinonjs/fake-timers@10.0.2: resolution: {integrity: sha512-SwUDyjWnah1AaNl7kxsa7cfLhlTYoiyhDAIgyh+El30YvXs/o7OLXpYH88Zdhyx9JExKrmHDJ+10bwIcY80Jmw==} dependencies: '@sinonjs/commons': 2.0.0 dev: true - /@tanstack/query-core/4.27.0: + /@tanstack/query-core@4.27.0: resolution: {integrity: sha512-sm+QncWaPmM73IPwFlmWSKPqjdTXZeFf/7aEmWh00z7yl2FjqophPt0dE1EHW9P1giMC5rMviv7OUbSDmWzXXA==} dev: true - /@tanstack/react-query/4.28.0_biqbaboplfbrettd7655fr4n2y: + /@tanstack/react-query@4.28.0(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-8cGBV5300RHlvYdS4ea+G1JcZIt5CIuprXYFnsWggkmGoC0b5JaqG0fIX3qwDL9PTNkKvG76NGThIWbpXivMrQ==} peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 @@ -1409,11 +1583,11 @@ packages: dependencies: '@tanstack/query-core': 4.27.0 react: 18.2.0 - react-dom: 18.2.0_react@18.2.0 - use-sync-external-store: 1.2.0_react@18.2.0 + react-dom: 18.2.0(react@18.2.0) + use-sync-external-store: 1.2.0(react@18.2.0) dev: true - /@testing-library/dom/9.2.0: + /@testing-library/dom@9.2.0: resolution: {integrity: sha512-xTEnpUKiV/bMyEsE5bT4oYA0x0Z/colMtxzUY8bKyPXBNLn/e0V4ZjBZkEhms0xE4pv9QsPfSRu9AWS4y5wGvA==} engines: {node: '>=14'} dependencies: @@ -1427,7 +1601,7 @@ packages: pretty-format: 27.5.1 dev: true - /@testing-library/jest-dom/5.16.5: + /@testing-library/jest-dom@5.16.5: resolution: {integrity: sha512-N5ixQ2qKpi5OLYfwQmUb/5mSV9LneAcaUfp32pn4yCnpb8r/Yz0pXFPck21dIicKmi+ta5WRAknkZCfA8refMA==} engines: {node: '>=8', npm: '>=6', yarn: '>=1'} dependencies: @@ -1442,7 +1616,7 @@ packages: redent: 3.0.0 dev: true - /@testing-library/react-hooks/8.0.1_j67ni4i6zsa7gdqctpxigdgcuy: + /@testing-library/react-hooks@8.0.1(@types/react@18.0.33)(react-dom@18.2.0)(react-test-renderer@18.2.0)(react@18.2.0): resolution: {integrity: sha512-Aqhl2IVmLt8IovEVarNDFuJDVWVvhnr9/GCU6UUnrYXwgDFF9h2L2o2P9KBni1AST5sT6riAyoukFLyjQUgD/g==} engines: {node: '>=12'} peerDependencies: @@ -1461,12 +1635,12 @@ packages: '@babel/runtime': 7.21.0 '@types/react': 18.0.33 react: 18.2.0 - react-dom: 18.2.0_react@18.2.0 - react-error-boundary: 3.1.4_react@18.2.0 - react-test-renderer: 18.2.0_react@18.2.0 + react-dom: 18.2.0(react@18.2.0) + react-error-boundary: 3.1.4(react@18.2.0) + react-test-renderer: 18.2.0(react@18.2.0) dev: true - /@testing-library/react/14.0.0_biqbaboplfbrettd7655fr4n2y: + /@testing-library/react@14.0.0(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-S04gSNJbYE30TlIMLTzv6QCTzt9AqIF5y6s6SzVFILNcNvbV/jU96GeiTPillGQo+Ny64M/5PV7klNYYgv5Dfg==} engines: {node: '>=14'} peerDependencies: @@ -1477,10 +1651,10 @@ packages: '@testing-library/dom': 9.2.0 '@types/react-dom': 18.0.11 react: 18.2.0 - react-dom: 18.2.0_react@18.2.0 + react-dom: 18.2.0(react@18.2.0) dev: true - /@testing-library/user-event/14.4.3_@testing-library+dom@9.2.0: + /@testing-library/user-event@14.4.3(@testing-library/dom@9.2.0): resolution: {integrity: sha512-kCUc5MEwaEMakkO5x7aoD+DLi02ehmEM2QCGWvNqAS1dV/fAvORWEjnjsEIvml59M7Y5kCkWN6fCCyPOe8OL6Q==} engines: {node: '>=12', npm: '>=6'} peerDependencies: @@ -1489,32 +1663,32 @@ packages: '@testing-library/dom': 9.2.0 dev: true - /@tootallnate/once/2.0.0: + /@tootallnate/once@2.0.0: resolution: {integrity: sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==} engines: {node: '>= 10'} dev: true - /@tsconfig/node10/1.0.9: + /@tsconfig/node10@1.0.9: resolution: {integrity: sha512-jNsYVVxU8v5g43Erja32laIDHXeoNvFEpX33OK4d6hljo3jDhCBDhx5dhCCTMWUojscpAagGiRkBKxpdl9fxqA==} dev: true - /@tsconfig/node12/1.0.11: + /@tsconfig/node12@1.0.11: resolution: {integrity: sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==} dev: true - /@tsconfig/node14/1.0.3: + /@tsconfig/node14@1.0.3: resolution: {integrity: sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==} dev: true - /@tsconfig/node16/1.0.3: + /@tsconfig/node16@1.0.3: resolution: {integrity: sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==} dev: true - /@types/aria-query/5.0.1: + /@types/aria-query@5.0.1: resolution: {integrity: sha512-XTIieEY+gvJ39ChLcB4If5zHtPxt3Syj5rgZR+e1ctpmK8NjPf0zFqsz4JpLJT0xla9GFDKjy8Cpu331nrmE1Q==} dev: true - /@types/babel__core/7.20.0: + /@types/babel__core@7.20.0: resolution: {integrity: sha512-+n8dL/9GWblDO0iU6eZAwEIJVr5DWigtle+Q6HLOrh/pdbXOhOtqzq8VPPE2zvNJzSKY4vH/z3iT3tn0A3ypiQ==} dependencies: '@babel/parser': 7.21.4 @@ -1524,49 +1698,49 @@ packages: '@types/babel__traverse': 7.18.3 dev: true - /@types/babel__generator/7.6.4: + /@types/babel__generator@7.6.4: resolution: {integrity: sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==} dependencies: '@babel/types': 7.21.4 dev: true - /@types/babel__template/7.4.1: + /@types/babel__template@7.4.1: resolution: {integrity: sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==} dependencies: '@babel/parser': 7.21.4 '@babel/types': 7.21.4 dev: true - /@types/babel__traverse/7.18.3: + /@types/babel__traverse@7.18.3: resolution: {integrity: sha512-1kbcJ40lLB7MHsj39U4Sh1uTd2E7rLEa79kmDpI6cy+XiXsteB3POdQomoq4FxszMrO3ZYchkhYJw7A2862b3w==} dependencies: '@babel/types': 7.21.4 dev: true - /@types/body-parser/1.19.2: + /@types/body-parser@1.19.2: resolution: {integrity: sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==} dependencies: '@types/connect': 3.4.35 '@types/node': 18.15.11 dev: true - /@types/connect/3.4.35: + /@types/connect@3.4.35: resolution: {integrity: sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==} dependencies: '@types/node': 18.15.11 dev: true - /@types/cookiejar/2.1.2: + /@types/cookiejar@2.1.2: resolution: {integrity: sha512-t73xJJrvdTjXrn4jLS9VSGRbz0nUY3cl2DMGDU48lKl+HR9dbbjW2A9r3g40VA++mQpy6uuHg33gy7du2BKpog==} dev: true - /@types/cors/2.8.13: + /@types/cors@2.8.13: resolution: {integrity: sha512-RG8AStHlUiV5ysZQKq97copd2UmVYw3/pRMLefISZ3S1hK104Cwm7iLQ3fTKx+lsUH2CE8FlLaYeEA2LSeqYUA==} dependencies: '@types/node': 18.15.11 dev: true - /@types/express-serve-static-core/4.17.33: + /@types/express-serve-static-core@4.17.33: resolution: {integrity: sha512-TPBqmR/HRYI3eC2E5hmiivIzv+bidAfXofM+sbonAGvyDhySGw9/PQZFt2BLOrjUUR++4eJVpx6KnLQK1Fk9tA==} dependencies: '@types/node': 18.15.11 @@ -1574,7 +1748,7 @@ packages: '@types/range-parser': 1.2.4 dev: true - /@types/express/4.17.17: + /@types/express@4.17.17: resolution: {integrity: sha512-Q4FmmuLGBG58btUnfS1c1r/NQdlp3DMfGDGig8WhfpA2YRUtEkxAjkZb0yvplJGYdF1fsQ81iMDcH24sSCNC/Q==} dependencies: '@types/body-parser': 1.19.2 @@ -1583,42 +1757,42 @@ packages: '@types/serve-static': 1.15.1 dev: true - /@types/graceful-fs/4.1.6: + /@types/graceful-fs@4.1.6: resolution: {integrity: sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw==} dependencies: '@types/node': 18.15.11 dev: true - /@types/is-ci/3.0.0: + /@types/is-ci@3.0.0: resolution: {integrity: sha512-Q0Op0hdWbYd1iahB+IFNQcWXFq4O0Q5MwQP7uN0souuQ4rPg1vEYcnIOfr1gY+M+6rc8FGoRaBO1mOOvL29sEQ==} dependencies: ci-info: 3.8.0 dev: true - /@types/istanbul-lib-coverage/2.0.4: + /@types/istanbul-lib-coverage@2.0.4: resolution: {integrity: sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==} dev: true - /@types/istanbul-lib-report/3.0.0: + /@types/istanbul-lib-report@3.0.0: resolution: {integrity: sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==} dependencies: '@types/istanbul-lib-coverage': 2.0.4 dev: true - /@types/istanbul-reports/3.0.1: + /@types/istanbul-reports@3.0.1: resolution: {integrity: sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==} dependencies: '@types/istanbul-lib-report': 3.0.0 dev: true - /@types/jest/29.5.0: + /@types/jest@29.5.0: resolution: {integrity: sha512-3Emr5VOl/aoBwnWcH/EFQvlSAmjV+XtV9GGu5mwdYew5vhQh0IUZx/60x0TzHDu09Bi7HMx10t/namdJw5QIcg==} dependencies: expect: 29.5.0 pretty-format: 29.5.0 dev: true - /@types/jsdom/20.0.1: + /@types/jsdom@20.0.1: resolution: {integrity: sha512-d0r18sZPmMQr1eG35u12FZfhIXNrnsPU/g5wvRKCUf/tOGilKKwYMYGqh33BNR6ba+2gkHw1EUiHoN3mn7E5IQ==} dependencies: '@types/node': 18.15.11 @@ -1626,55 +1800,55 @@ packages: parse5: 7.1.2 dev: true - /@types/mime/3.0.1: + /@types/mime@3.0.1: resolution: {integrity: sha512-Y4XFY5VJAuw0FgAqPNd6NNoV44jbq9Bz2L7Rh/J6jLTiHBSBJa9fxqQIvkIld4GsoDOcCbvzOUAbLPsSKKg+uA==} dev: true - /@types/minimist/1.2.2: + /@types/minimist@1.2.2: resolution: {integrity: sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==} dev: true - /@types/multer/1.4.7: + /@types/multer@1.4.7: resolution: {integrity: sha512-/SNsDidUFCvqqcWDwxv2feww/yqhNeTRL5CVoL3jU4Goc4kKEL10T7Eye65ZqPNi4HRx8sAEX59pV1aEH7drNA==} dependencies: '@types/express': 4.17.17 dev: true - /@types/node/12.20.55: + /@types/node@12.20.55: resolution: {integrity: sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==} dev: true - /@types/node/18.15.11: + /@types/node@18.15.11: resolution: {integrity: sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q==} dev: true - /@types/normalize-package-data/2.4.1: + /@types/normalize-package-data@2.4.1: resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==} dev: true - /@types/prettier/2.7.2: + /@types/prettier@2.7.2: resolution: {integrity: sha512-KufADq8uQqo1pYKVIYzfKbJfBAc0sOeXqGbFaSpv8MRmC/zXgowNZmFcbngndGk922QDmOASEXUZCaY48gs4cg==} dev: true - /@types/prop-types/15.7.5: + /@types/prop-types@15.7.5: resolution: {integrity: sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w==} dev: true - /@types/qs/6.9.7: + /@types/qs@6.9.7: resolution: {integrity: sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==} dev: true - /@types/range-parser/1.2.4: + /@types/range-parser@1.2.4: resolution: {integrity: sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==} dev: true - /@types/react-dom/18.0.11: + /@types/react-dom@18.0.11: resolution: {integrity: sha512-O38bPbI2CWtgw/OoQoY+BRelw7uysmXbWvw3nLWO21H1HSh+GOlqPuXshJfjmpNlKiiSDG9cc1JZAaMmVdcTlw==} dependencies: '@types/react': 18.0.33 dev: true - /@types/react/18.0.33: + /@types/react@18.0.33: resolution: {integrity: sha512-sHxzVxeanvQyQ1lr8NSHaj0kDzcNiGpILEVt69g9S31/7PfMvNCKLKcsHw4lYKjs3cGNJjXSP4mYzX43QlnjNA==} dependencies: '@types/prop-types': 15.7.5 @@ -1682,70 +1856,70 @@ packages: csstype: 3.1.2 dev: true - /@types/scheduler/0.16.3: + /@types/scheduler@0.16.3: resolution: {integrity: sha512-5cJ8CB4yAx7BH1oMvdU0Jh9lrEXyPkar6F9G/ERswkCuvP4KQZfZkSjcMbAICCpQTN4OuZn8tz0HiKv9TGZgrQ==} dev: true - /@types/semver/6.2.3: + /@types/semver@6.2.3: resolution: {integrity: sha512-KQf+QAMWKMrtBMsB8/24w53tEsxllMj6TuA80TT/5igJalLI/zm0L3oXRbIAl4Ohfc85gyHX/jhMwsVkmhLU4A==} dev: true - /@types/serve-static/1.15.1: + /@types/serve-static@1.15.1: resolution: {integrity: sha512-NUo5XNiAdULrJENtJXZZ3fHtfMolzZwczzBbnAeBbqBwG+LaG6YaJtuwzwGSQZ2wsCrxjEhNNjAkKigy3n8teQ==} dependencies: '@types/mime': 3.0.1 '@types/node': 18.15.11 dev: true - /@types/stack-utils/2.0.1: + /@types/stack-utils@2.0.1: resolution: {integrity: sha512-Hl219/BT5fLAaz6NDkSuhzasy49dwQS/DSdu4MdggFB8zcXv7vflBI3xp7FEmkmdDkBUI2bPUNeMttp2knYdxw==} dev: true - /@types/superagent/4.1.16: + /@types/superagent@4.1.16: resolution: {integrity: sha512-tLfnlJf6A5mB6ddqF159GqcDizfzbMUB1/DeT59/wBNqzRTNNKsaw79A/1TZ84X+f/EwWH8FeuSkjlCLyqS/zQ==} dependencies: '@types/cookiejar': 2.1.2 '@types/node': 18.15.11 dev: true - /@types/supertest/2.0.12: + /@types/supertest@2.0.12: resolution: {integrity: sha512-X3HPWTwXRerBZS7Mo1k6vMVR1Z6zmJcDVn5O/31whe0tnjE4te6ZJSJGq1RiqHPjzPdMTfjCFogDJmwng9xHaQ==} dependencies: '@types/superagent': 4.1.16 dev: true - /@types/swagger-ui-express/4.1.3: + /@types/swagger-ui-express@4.1.3: resolution: {integrity: sha512-jqCjGU/tGEaqIplPy3WyQg+Nrp6y80DCFnDEAvVKWkJyv0VivSSDCChkppHRHAablvInZe6pijDFMnavtN0vqA==} dependencies: '@types/express': 4.17.17 '@types/serve-static': 1.15.1 dev: true - /@types/testing-library__jest-dom/5.14.5: + /@types/testing-library__jest-dom@5.14.5: resolution: {integrity: sha512-SBwbxYoyPIvxHbeHxTZX2Pe/74F/tX2/D3mMvzabdeJ25bBojfW0TyB8BHrbq/9zaaKICJZjLP+8r6AeZMFCuQ==} dependencies: '@types/jest': 29.5.0 dev: true - /@types/tough-cookie/4.0.2: + /@types/tough-cookie@4.0.2: resolution: {integrity: sha512-Q5vtl1W5ue16D+nIaW8JWebSSraJVlK+EthKn7e7UcD4KWsaSJ8BqGPXNaPghgtcn/fhvrN17Tv8ksUsQpiplw==} dev: true - /@types/yargs-parser/21.0.0: + /@types/yargs-parser@21.0.0: resolution: {integrity: sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==} dev: true - /@types/yargs/17.0.24: + /@types/yargs@17.0.24: resolution: {integrity: sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw==} dependencies: '@types/yargs-parser': 21.0.0 dev: true - /abab/2.0.6: + /abab@2.0.6: resolution: {integrity: sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==} dev: true - /accepts/1.3.8: + /accepts@1.3.8: resolution: {integrity: sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==} engines: {node: '>= 0.6'} dependencies: @@ -1753,25 +1927,25 @@ packages: negotiator: 0.6.3 dev: true - /acorn-globals/7.0.1: + /acorn-globals@7.0.1: resolution: {integrity: sha512-umOSDSDrfHbTNPuNpC2NSnnA3LUrqpevPb4T9jRx4MagXNS0rs+gwiTcAvqCRmsD6utzsrzNt+ebm00SNWiC3Q==} dependencies: acorn: 8.8.2 acorn-walk: 8.2.0 dev: true - /acorn-walk/8.2.0: + /acorn-walk@8.2.0: resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==} engines: {node: '>=0.4.0'} dev: true - /acorn/8.8.2: + /acorn@8.8.2: resolution: {integrity: sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==} engines: {node: '>=0.4.0'} hasBin: true dev: true - /agent-base/6.0.2: + /agent-base@6.0.2: resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} engines: {node: '>= 6.0.0'} dependencies: @@ -1780,47 +1954,47 @@ packages: - supports-color dev: true - /ansi-colors/4.1.3: + /ansi-colors@4.1.3: resolution: {integrity: sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==} engines: {node: '>=6'} dev: true - /ansi-escapes/4.3.2: + /ansi-escapes@4.3.2: resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} engines: {node: '>=8'} dependencies: type-fest: 0.21.3 dev: true - /ansi-regex/5.0.1: + /ansi-regex@5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} dev: true - /ansi-styles/3.2.1: + /ansi-styles@3.2.1: resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==} engines: {node: '>=4'} dependencies: color-convert: 1.9.3 dev: true - /ansi-styles/4.3.0: + /ansi-styles@4.3.0: resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} engines: {node: '>=8'} dependencies: color-convert: 2.0.1 dev: true - /ansi-styles/5.2.0: + /ansi-styles@5.2.0: resolution: {integrity: sha512-Cxwpt2SfTzTtXcfOlzGEee8O+c+MmUgGrNiBcXnuWxuFJHe6a5Hz7qwhwe5OgaSYI0IJvkLqWX1ASG+cJOkEiA==} engines: {node: '>=10'} dev: true - /any-promise/1.3.0: + /any-promise@1.3.0: resolution: {integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==} dev: true - /anymatch/3.1.3: + /anymatch@3.1.3: resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} engines: {node: '>= 8'} dependencies: @@ -1828,43 +2002,43 @@ packages: picomatch: 2.3.1 dev: true - /append-field/1.0.0: + /append-field@1.0.0: resolution: {integrity: sha512-klpgFSWLW1ZEs8svjfb7g4qWY0YS5imI82dTg+QahUvJ8YqAY0P10Uk8tTyh9ZGuYEZEMaeJYCF5BFuX552hsw==} dev: true - /arg/4.1.3: + /arg@4.1.3: resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} dev: true - /argparse/1.0.10: + /argparse@1.0.10: resolution: {integrity: sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==} dependencies: sprintf-js: 1.0.3 dev: true - /aria-query/5.1.3: + /aria-query@5.1.3: resolution: {integrity: sha512-R5iJ5lkuHybztUfuOAznmboyjWq8O6sqNqtK7CLOqdydi54VNbORp49mb14KbWgG1QD3JFO9hJdZ+y4KutfdOQ==} dependencies: deep-equal: 2.2.0 dev: true - /array-buffer-byte-length/1.0.0: + /array-buffer-byte-length@1.0.0: resolution: {integrity: sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==} dependencies: call-bind: 1.0.2 is-array-buffer: 3.0.2 dev: true - /array-flatten/1.1.1: + /array-flatten@1.1.1: resolution: {integrity: sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==} dev: true - /array-union/2.1.0: + /array-union@2.1.0: resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} engines: {node: '>=8'} dev: true - /array.prototype.flat/1.3.1: + /array.prototype.flat@1.3.1: resolution: {integrity: sha512-roTU0KWIOmJ4DRLmwKd19Otg0/mT3qPNt0Qb3GWW8iObuZXxrjB/pzn0R3hqpRSWg4HCwqx+0vwOnWnvlOyeIA==} engines: {node: '>= 0.4'} dependencies: @@ -1874,25 +2048,25 @@ packages: es-shim-unscopables: 1.0.0 dev: true - /arrify/1.0.1: + /arrify@1.0.1: resolution: {integrity: sha512-3CYzex9M9FGQjCGMGyi6/31c8GJbgb0qGyrx5HWxPd0aCwh4cB2YjMb2Xf9UuoogrMrlO9cTqnB5rI5GHZTcUA==} engines: {node: '>=0.10.0'} dev: true - /asap/2.0.6: + /asap@2.0.6: resolution: {integrity: sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==} dev: true - /asynckit/0.4.0: + /asynckit@0.4.0: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} dev: true - /available-typed-arrays/1.0.5: + /available-typed-arrays@1.0.5: resolution: {integrity: sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==} engines: {node: '>= 0.4'} dev: true - /axios/1.3.5: + /axios@1.3.5: resolution: {integrity: sha512-glL/PvG/E+xCWwV8S6nCHcrfg1exGx7vxyUIivIA1iL7BIh6bePylCfVHwp6k13ao7SATxB6imau2kqY+I67kw==} dependencies: follow-redirects: 1.15.2 @@ -1902,7 +2076,7 @@ packages: - debug dev: true - /babel-jest/29.5.0_@babel+core@7.21.4: + /babel-jest@29.5.0(@babel/core@7.21.4): resolution: {integrity: sha512-mA4eCDh5mSo2EcA9xQjVTpmbbNk32Zb3Q3QFQsNhaK56Q+yoXowzFodLux30HRgyOho5rsQ6B0P9QpMkvvnJ0Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: @@ -1912,7 +2086,7 @@ packages: '@jest/transform': 29.5.0 '@types/babel__core': 7.20.0 babel-plugin-istanbul: 6.1.1 - babel-preset-jest: 29.5.0_@babel+core@7.21.4 + babel-preset-jest: 29.5.0(@babel/core@7.21.4) chalk: 4.1.2 graceful-fs: 4.2.11 slash: 3.0.0 @@ -1920,7 +2094,7 @@ packages: - supports-color dev: true - /babel-plugin-istanbul/6.1.1: + /babel-plugin-istanbul@6.1.1: resolution: {integrity: sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==} engines: {node: '>=8'} dependencies: @@ -1933,7 +2107,7 @@ packages: - supports-color dev: true - /babel-plugin-jest-hoist/29.5.0: + /babel-plugin-jest-hoist@29.5.0: resolution: {integrity: sha512-zSuuuAlTMT4mzLj2nPnUm6fsE6270vdOfnpbJ+RmruU75UhLFvL0N2NgI7xpeS7NaB6hGqmd5pVpGTDYvi4Q3w==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: @@ -1943,27 +2117,27 @@ packages: '@types/babel__traverse': 7.18.3 dev: true - /babel-preset-current-node-syntax/1.0.1_@babel+core@7.21.4: + /babel-preset-current-node-syntax@1.0.1(@babel/core@7.21.4): resolution: {integrity: sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==} peerDependencies: '@babel/core': ^7.0.0 dependencies: '@babel/core': 7.21.4 - '@babel/plugin-syntax-async-generators': 7.8.4_@babel+core@7.21.4 - '@babel/plugin-syntax-bigint': 7.8.3_@babel+core@7.21.4 - '@babel/plugin-syntax-class-properties': 7.12.13_@babel+core@7.21.4 - '@babel/plugin-syntax-import-meta': 7.10.4_@babel+core@7.21.4 - '@babel/plugin-syntax-json-strings': 7.8.3_@babel+core@7.21.4 - '@babel/plugin-syntax-logical-assignment-operators': 7.10.4_@babel+core@7.21.4 - '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3_@babel+core@7.21.4 - '@babel/plugin-syntax-numeric-separator': 7.10.4_@babel+core@7.21.4 - '@babel/plugin-syntax-object-rest-spread': 7.8.3_@babel+core@7.21.4 - '@babel/plugin-syntax-optional-catch-binding': 7.8.3_@babel+core@7.21.4 - '@babel/plugin-syntax-optional-chaining': 7.8.3_@babel+core@7.21.4 - '@babel/plugin-syntax-top-level-await': 7.14.5_@babel+core@7.21.4 - dev: true - - /babel-preset-jest/29.5.0_@babel+core@7.21.4: + '@babel/plugin-syntax-async-generators': 7.8.4(@babel/core@7.21.4) + '@babel/plugin-syntax-bigint': 7.8.3(@babel/core@7.21.4) + '@babel/plugin-syntax-class-properties': 7.12.13(@babel/core@7.21.4) + '@babel/plugin-syntax-import-meta': 7.10.4(@babel/core@7.21.4) + '@babel/plugin-syntax-json-strings': 7.8.3(@babel/core@7.21.4) + '@babel/plugin-syntax-logical-assignment-operators': 7.10.4(@babel/core@7.21.4) + '@babel/plugin-syntax-nullish-coalescing-operator': 7.8.3(@babel/core@7.21.4) + '@babel/plugin-syntax-numeric-separator': 7.10.4(@babel/core@7.21.4) + '@babel/plugin-syntax-object-rest-spread': 7.8.3(@babel/core@7.21.4) + '@babel/plugin-syntax-optional-catch-binding': 7.8.3(@babel/core@7.21.4) + '@babel/plugin-syntax-optional-chaining': 7.8.3(@babel/core@7.21.4) + '@babel/plugin-syntax-top-level-await': 7.14.5(@babel/core@7.21.4) + dev: true + + /babel-preset-jest@29.5.0(@babel/core@7.21.4): resolution: {integrity: sha512-JOMloxOqdiBSxMAzjRaH023/vvcaSaec49zvg+2LmNsktC7ei39LTJGw02J+9uUtTZUq6xbLyJ4dxe9sSmIuAg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: @@ -1971,26 +2145,26 @@ packages: dependencies: '@babel/core': 7.21.4 babel-plugin-jest-hoist: 29.5.0 - babel-preset-current-node-syntax: 1.0.1_@babel+core@7.21.4 + babel-preset-current-node-syntax: 1.0.1(@babel/core@7.21.4) dev: true - /balanced-match/1.0.2: + /balanced-match@1.0.2: resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==} dev: true - /better-path-resolve/1.0.0: + /better-path-resolve@1.0.0: resolution: {integrity: sha512-pbnl5XzGBdrFU/wT4jqmJVPn2B6UHPBOhzMQkY/SPUPB6QtUXtmBHBIwCbXJol93mOpGMnQyP/+BB19q04xj7g==} engines: {node: '>=4'} dependencies: is-windows: 1.0.2 dev: true - /binary-extensions/2.2.0: + /binary-extensions@2.2.0: resolution: {integrity: sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==} engines: {node: '>=8'} dev: true - /body-parser/1.20.1: + /body-parser@1.20.1: resolution: {integrity: sha512-jWi7abTbYwajOytWCQc37VulmWiRae5RyTpaCyDcS5/lMdtwSz5lOpDE67srw/HYe35f1z3fDQw+3txg7gNtWw==} engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} dependencies: @@ -2010,33 +2184,33 @@ packages: - supports-color dev: true - /brace-expansion/1.1.11: + /brace-expansion@1.1.11: resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} dependencies: balanced-match: 1.0.2 concat-map: 0.0.1 dev: true - /brace-expansion/2.0.1: + /brace-expansion@2.0.1: resolution: {integrity: sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==} dependencies: balanced-match: 1.0.2 dev: true - /braces/3.0.2: + /braces@3.0.2: resolution: {integrity: sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==} engines: {node: '>=8'} dependencies: fill-range: 7.0.1 dev: true - /breakword/1.0.5: + /breakword@1.0.5: resolution: {integrity: sha512-ex5W9DoOQ/LUEU3PMdLs9ua/CYZl1678NUkKOdUSi8Aw5F1idieaiRURCBFJCwVcrD1J8Iy3vfWSloaMwO2qFg==} dependencies: wcwidth: 1.0.1 dev: true - /browserslist/4.21.5: + /browserslist@4.21.5: resolution: {integrity: sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true @@ -2044,27 +2218,27 @@ packages: caniuse-lite: 1.0.30001476 electron-to-chromium: 1.4.356 node-releases: 2.0.10 - update-browserslist-db: 1.0.10_browserslist@4.21.5 + update-browserslist-db: 1.0.10(browserslist@4.21.5) dev: true - /bs-logger/0.2.6: + /bs-logger@0.2.6: resolution: {integrity: sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==} engines: {node: '>= 6'} dependencies: fast-json-stable-stringify: 2.1.0 dev: true - /bser/2.1.1: + /bser@2.1.1: resolution: {integrity: sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==} dependencies: node-int64: 0.4.0 dev: true - /buffer-from/1.1.2: + /buffer-from@1.1.2: resolution: {integrity: sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==} dev: true - /bundle-require/4.0.1_esbuild@0.17.14: + /bundle-require@4.0.1(esbuild@0.17.14): resolution: {integrity: sha512-9NQkRHlNdNpDBGmLpngF3EFDcwodhMUuLz9PaWYciVcQF9SE4LFjM2DB/xV1Li5JiuDMv7ZUWuC3rGbqR0MAXQ==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} peerDependencies: @@ -2074,36 +2248,36 @@ packages: load-tsconfig: 0.2.5 dev: true - /busboy/1.6.0: + /busboy@1.6.0: resolution: {integrity: sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==} engines: {node: '>=10.16.0'} dependencies: streamsearch: 1.1.0 dev: true - /bytes/3.1.2: + /bytes@3.1.2: resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==} engines: {node: '>= 0.8'} dev: true - /cac/6.7.14: + /cac@6.7.14: resolution: {integrity: sha512-b6Ilus+c3RrdDk+JhLKUAQfzzgLEPy6wcXqS7f/xe1EETvsDP6GORG7SFuOs6cID5YkqchW/LXZbX5bc8j7ZcQ==} engines: {node: '>=8'} dev: true - /call-bind/1.0.2: + /call-bind@1.0.2: resolution: {integrity: sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==} dependencies: function-bind: 1.1.1 get-intrinsic: 1.2.0 dev: true - /callsites/3.1.0: + /callsites@3.1.0: resolution: {integrity: sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==} engines: {node: '>=6'} dev: true - /camelcase-keys/6.2.2: + /camelcase-keys@6.2.2: resolution: {integrity: sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==} engines: {node: '>=8'} dependencies: @@ -2112,21 +2286,21 @@ packages: quick-lru: 4.0.1 dev: true - /camelcase/5.3.1: + /camelcase@5.3.1: resolution: {integrity: sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==} engines: {node: '>=6'} dev: true - /camelcase/6.3.0: + /camelcase@6.3.0: resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} engines: {node: '>=10'} dev: true - /caniuse-lite/1.0.30001476: + /caniuse-lite@1.0.30001476: resolution: {integrity: sha512-JmpktFppVSvyUN4gsLS0bShY2L9ZUslHLE72vgemBkS43JD2fOvKTKs+GtRwuxrtRGnwJFW0ye7kWRRlLJS9vQ==} dev: true - /chalk/2.4.2: + /chalk@2.4.2: resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} engines: {node: '>=4'} dependencies: @@ -2135,7 +2309,7 @@ packages: supports-color: 5.5.0 dev: true - /chalk/3.0.0: + /chalk@3.0.0: resolution: {integrity: sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==} engines: {node: '>=8'} dependencies: @@ -2143,7 +2317,7 @@ packages: supports-color: 7.2.0 dev: true - /chalk/4.1.2: + /chalk@4.1.2: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} dependencies: @@ -2151,16 +2325,16 @@ packages: supports-color: 7.2.0 dev: true - /char-regex/1.0.2: + /char-regex@1.0.2: resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} engines: {node: '>=10'} dev: true - /chardet/0.7.0: + /chardet@0.7.0: resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} dev: true - /chokidar/3.5.3: + /chokidar@3.5.3: resolution: {integrity: sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==} engines: {node: '>= 8.10.0'} dependencies: @@ -2175,16 +2349,16 @@ packages: fsevents: 2.3.2 dev: true - /ci-info/3.8.0: + /ci-info@3.8.0: resolution: {integrity: sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw==} engines: {node: '>=8'} dev: true - /cjs-module-lexer/1.2.2: + /cjs-module-lexer@1.2.2: resolution: {integrity: sha512-cOU9usZw8/dXIXKtwa8pM0OTJQuJkxMN6w30csNRUerHfeQ5R6U3kkU/FtJeIf3M202OHfY2U8ccInBG7/xogA==} dev: true - /cliui/6.0.0: + /cliui@6.0.0: resolution: {integrity: sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==} dependencies: string-width: 4.2.3 @@ -2192,7 +2366,7 @@ packages: wrap-ansi: 6.2.0 dev: true - /cliui/8.0.1: + /cliui@8.0.1: resolution: {integrity: sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==} engines: {node: '>=12'} dependencies: @@ -2201,62 +2375,62 @@ packages: wrap-ansi: 7.0.0 dev: true - /clone/1.0.4: + /clone@1.0.4: resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==} engines: {node: '>=0.8'} dev: true - /co/4.6.0: + /co@4.6.0: resolution: {integrity: sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==} engines: {iojs: '>= 1.0.0', node: '>= 0.12.0'} dev: true - /collect-v8-coverage/1.0.1: + /collect-v8-coverage@1.0.1: resolution: {integrity: sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg==} dev: true - /color-convert/1.9.3: + /color-convert@1.9.3: resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==} dependencies: color-name: 1.1.3 dev: true - /color-convert/2.0.1: + /color-convert@2.0.1: resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==} engines: {node: '>=7.0.0'} dependencies: color-name: 1.1.4 dev: true - /color-name/1.1.3: + /color-name@1.1.3: resolution: {integrity: sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==} dev: true - /color-name/1.1.4: + /color-name@1.1.4: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} dev: true - /combined-stream/1.0.8: + /combined-stream@1.0.8: resolution: {integrity: sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==} engines: {node: '>= 0.8'} dependencies: delayed-stream: 1.0.0 dev: true - /commander/4.1.1: + /commander@4.1.1: resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==} engines: {node: '>= 6'} dev: true - /component-emitter/1.3.0: + /component-emitter@1.3.0: resolution: {integrity: sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==} dev: true - /concat-map/0.0.1: + /concat-map@0.0.1: resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} dev: true - /concat-stream/1.6.2: + /concat-stream@1.6.2: resolution: {integrity: sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==} engines: {'0': node >= 0.8} dependencies: @@ -2266,44 +2440,44 @@ packages: typedarray: 0.0.6 dev: true - /content-disposition/0.5.4: + /content-disposition@0.5.4: resolution: {integrity: sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==} engines: {node: '>= 0.6'} dependencies: safe-buffer: 5.2.1 dev: true - /content-type/1.0.5: + /content-type@1.0.5: resolution: {integrity: sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==} engines: {node: '>= 0.6'} dev: true - /convert-source-map/1.9.0: + /convert-source-map@1.9.0: resolution: {integrity: sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==} dev: true - /convert-source-map/2.0.0: + /convert-source-map@2.0.0: resolution: {integrity: sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==} dev: true - /cookie-signature/1.0.6: + /cookie-signature@1.0.6: resolution: {integrity: sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==} dev: true - /cookie/0.5.0: + /cookie@0.5.0: resolution: {integrity: sha512-YZ3GUyn/o8gfKJlnlX7g7xq4gyO6OSuhGPKaaGssGB2qgDUS0gPgtTvoyZLTt9Ab6dC4hfc9dV5arkvc/OCmrw==} engines: {node: '>= 0.6'} dev: true - /cookiejar/2.1.4: + /cookiejar@2.1.4: resolution: {integrity: sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw==} dev: true - /core-util-is/1.0.3: + /core-util-is@1.0.3: resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} dev: true - /cors/2.8.5: + /cors@2.8.5: resolution: {integrity: sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==} engines: {node: '>= 0.10'} dependencies: @@ -2311,11 +2485,11 @@ packages: vary: 1.1.2 dev: true - /create-require/1.1.1: + /create-require@1.1.1: resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} dev: true - /cross-fetch/3.1.5: + /cross-fetch@3.1.5: resolution: {integrity: sha512-lvb1SBsI0Z7GDwmuid+mU3kWVBwTVUbe7S0H52yaaAdQOXq2YktTCZdlAcNKFzE6QtRz0snpw9bNiPeOIkkQvw==} dependencies: node-fetch: 2.6.7 @@ -2323,7 +2497,7 @@ packages: - encoding dev: true - /cross-spawn/5.1.0: + /cross-spawn@5.1.0: resolution: {integrity: sha512-pTgQJ5KC0d2hcY8eyL1IzlBPYjTkyH72XRZPnLyKus2mBfNjQs3klqbJU2VILqZryAZUt9JOb3h/mWMy23/f5A==} dependencies: lru-cache: 4.1.5 @@ -2331,7 +2505,7 @@ packages: which: 1.3.1 dev: true - /cross-spawn/7.0.3: + /cross-spawn@7.0.3: resolution: {integrity: sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==} engines: {node: '>= 8'} dependencies: @@ -2340,42 +2514,42 @@ packages: which: 2.0.2 dev: true - /css.escape/1.5.1: + /css.escape@1.5.1: resolution: {integrity: sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg==} dev: true - /cssom/0.3.8: + /cssom@0.3.8: resolution: {integrity: sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==} dev: true - /cssom/0.5.0: + /cssom@0.5.0: resolution: {integrity: sha512-iKuQcq+NdHqlAcwUY0o/HL69XQrUaQdMjmStJ8JFmUaiiQErlhrmuigkg/CU4E2J0IyUKUrMAgl36TvN67MqTw==} dev: true - /cssstyle/2.3.0: + /cssstyle@2.3.0: resolution: {integrity: sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==} engines: {node: '>=8'} dependencies: cssom: 0.3.8 dev: true - /csstype/3.1.2: + /csstype@3.1.2: resolution: {integrity: sha512-I7K1Uu0MBPzaFKg4nI5Q7Vs2t+3gWWW648spaF+Rg7pI9ds18Ugn+lvg4SHczUdKlHI5LWBXyqfS8+DufyBsgQ==} dev: true - /csv-generate/3.4.3: + /csv-generate@3.4.3: resolution: {integrity: sha512-w/T+rqR0vwvHqWs/1ZyMDWtHHSJaN06klRqJXBEpDJaM/+dZkso0OKh1VcuuYvK3XM53KysVNq8Ko/epCK8wOw==} dev: true - /csv-parse/4.16.3: + /csv-parse@4.16.3: resolution: {integrity: sha512-cO1I/zmz4w2dcKHVvpCr7JVRu8/FymG5OEpmvsZYlccYolPBLoVGKUHgNoc4ZGkFeFlWGEDmMyBM+TTqRdW/wg==} dev: true - /csv-stringify/5.6.5: + /csv-stringify@5.6.5: resolution: {integrity: sha512-PjiQ659aQ+fUTQqSrd1XEDnOr52jh30RBurfzkscaE2tPaFsDH5wOAHJiw8XAHphRknCwMUE9KRayc4K/NbO8A==} dev: true - /csv/5.5.3: + /csv@5.5.3: resolution: {integrity: sha512-QTaY0XjjhTQOdguARF0lGKm5/mEq9PD9/VhZZegHDIBq2tQwgNpHc3dneD4mGo2iJs+fTKv5Bp0fZ+BRuY3Z0g==} engines: {node: '>= 0.1.90'} dependencies: @@ -2385,7 +2559,7 @@ packages: stream-transform: 2.1.3 dev: true - /data-urls/3.0.2: + /data-urls@3.0.2: resolution: {integrity: sha512-Jy/tj3ldjZJo63sVAvg6LHt2mHvl4V6AgRAmNDtLdm7faqtsx+aJG42rsyCo9JCoRVKwPFzKlIPx3DIibwSIaQ==} engines: {node: '>=12'} dependencies: @@ -2394,7 +2568,7 @@ packages: whatwg-url: 11.0.0 dev: true - /debug/2.6.9: + /debug@2.6.9: resolution: {integrity: sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==} peerDependencies: supports-color: '*' @@ -2405,7 +2579,7 @@ packages: ms: 2.0.0 dev: true - /debug/4.3.4: + /debug@4.3.4: resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} engines: {node: '>=6.0'} peerDependencies: @@ -2417,7 +2591,7 @@ packages: ms: 2.1.2 dev: true - /decamelize-keys/1.1.1: + /decamelize-keys@1.1.1: resolution: {integrity: sha512-WiPxgEirIV0/eIOMcnFBA3/IJZAZqKnwAwWyvvdi4lsr1WCN22nhdf/3db3DoZcUjTV2SqfzIwNyp6y2xs3nmg==} engines: {node: '>=0.10.0'} dependencies: @@ -2425,20 +2599,20 @@ packages: map-obj: 1.0.1 dev: true - /decamelize/1.2.0: + /decamelize@1.2.0: resolution: {integrity: sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==} engines: {node: '>=0.10.0'} dev: true - /decimal.js/10.4.3: + /decimal.js@10.4.3: resolution: {integrity: sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==} dev: true - /dedent/0.7.0: + /dedent@0.7.0: resolution: {integrity: sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA==} dev: true - /deep-equal/2.2.0: + /deep-equal@2.2.0: resolution: {integrity: sha512-RdpzE0Hv4lhowpIUKKMJfeH6C1pXdtT1/it80ubgWqwI3qpuxUBpC1S4hnHg+zjnuOoDkzUtUCEEkG+XG5l3Mw==} dependencies: call-bind: 1.0.2 @@ -2460,22 +2634,22 @@ packages: which-typed-array: 1.1.9 dev: true - /deep-is/0.1.4: + /deep-is@0.1.4: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} dev: true - /deepmerge/4.3.1: + /deepmerge@4.3.1: resolution: {integrity: sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==} engines: {node: '>=0.10.0'} dev: true - /defaults/1.0.4: + /defaults@1.0.4: resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} dependencies: clone: 1.0.4 dev: true - /define-properties/1.2.0: + /define-properties@1.2.0: resolution: {integrity: sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==} engines: {node: '>= 0.4'} dependencies: @@ -2483,107 +2657,107 @@ packages: object-keys: 1.1.1 dev: true - /delayed-stream/1.0.0: + /delayed-stream@1.0.0: resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} engines: {node: '>=0.4.0'} dev: true - /depd/2.0.0: + /depd@2.0.0: resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==} engines: {node: '>= 0.8'} dev: true - /destroy/1.2.0: + /destroy@1.2.0: resolution: {integrity: sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==} engines: {node: '>= 0.8', npm: 1.2.8000 || >= 1.4.16} dev: true - /detect-indent/6.1.0: + /detect-indent@6.1.0: resolution: {integrity: sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==} engines: {node: '>=8'} dev: true - /detect-newline/3.1.0: + /detect-newline@3.1.0: resolution: {integrity: sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==} engines: {node: '>=8'} dev: true - /dezalgo/1.0.4: + /dezalgo@1.0.4: resolution: {integrity: sha512-rXSP0bf+5n0Qonsb+SVVfNfIsimO4HEtmnIpPHY8Q1UCzKlQrDMfdobr8nJOOsRgWCyMRqeSBQzmWUMq7zvVig==} dependencies: asap: 2.0.6 wrappy: 1.0.2 dev: true - /diff-sequences/29.4.3: + /diff-sequences@29.4.3: resolution: {integrity: sha512-ofrBgwpPhCD85kMKtE9RYFFq6OC1A89oW2vvgWZNCwxrUpRUILopY7lsYyMDSjc8g6U6aiO0Qubg6r4Wgt5ZnA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dev: true - /diff/4.0.2: + /diff@4.0.2: resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} engines: {node: '>=0.3.1'} dev: true - /dir-glob/3.0.1: + /dir-glob@3.0.1: resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} engines: {node: '>=8'} dependencies: path-type: 4.0.0 dev: true - /dom-accessibility-api/0.5.16: + /dom-accessibility-api@0.5.16: resolution: {integrity: sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==} dev: true - /domexception/4.0.0: + /domexception@4.0.0: resolution: {integrity: sha512-A2is4PLG+eeSfoTMA95/s4pvAoSo2mKtiM5jlHkAVewmiO8ISFTFKZjH7UAM1Atli/OT/7JHOrJRJiMKUZKYBw==} engines: {node: '>=12'} dependencies: webidl-conversions: 7.0.0 dev: true - /ee-first/1.1.1: + /ee-first@1.1.1: resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} dev: true - /electron-to-chromium/1.4.356: + /electron-to-chromium@1.4.356: resolution: {integrity: sha512-nEftV1dRX3omlxAj42FwqRZT0i4xd2dIg39sog/CnCJeCcL1TRd2Uh0i9Oebgv8Ou0vzTPw++xc+Z20jzS2B6A==} dev: true - /emittery/0.13.1: + /emittery@0.13.1: resolution: {integrity: sha512-DeWwawk6r5yR9jFgnDKYt4sLS0LmHJJi3ZOnb5/JdbYwj3nW+FxQnHIjhBKz8YLC7oRNPVM9NQ47I3CVx34eqQ==} engines: {node: '>=12'} dev: true - /emoji-regex/8.0.0: + /emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} dev: true - /encodeurl/1.0.2: + /encodeurl@1.0.2: resolution: {integrity: sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==} engines: {node: '>= 0.8'} dev: true - /enquirer/2.3.6: + /enquirer@2.3.6: resolution: {integrity: sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==} engines: {node: '>=8.6'} dependencies: ansi-colors: 4.1.3 dev: true - /entities/4.4.0: + /entities@4.4.0: resolution: {integrity: sha512-oYp7156SP8LkeGD0GF85ad1X9Ai79WtRsZ2gxJqtBuzH+98YUV6jkHEKlZkMbcrjJjIVJNIDP/3WL9wQkoPbWA==} engines: {node: '>=0.12'} dev: true - /error-ex/1.3.2: + /error-ex@1.3.2: resolution: {integrity: sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==} dependencies: is-arrayish: 0.2.1 dev: true - /es-abstract/1.21.2: + /es-abstract@1.21.2: resolution: {integrity: sha512-y/B5POM2iBnIxCiernH1G7rC9qQoM77lLIMQLuob0zhp8C56Po81+2Nj0WFKnd0pNReDTnkYryc+zhOzpEIROg==} engines: {node: '>= 0.4'} dependencies: @@ -2623,7 +2797,7 @@ packages: which-typed-array: 1.1.9 dev: true - /es-get-iterator/1.1.3: + /es-get-iterator@1.1.3: resolution: {integrity: sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw==} dependencies: call-bind: 1.0.2 @@ -2637,7 +2811,7 @@ packages: stop-iteration-iterator: 1.0.0 dev: true - /es-set-tostringtag/2.0.1: + /es-set-tostringtag@2.0.1: resolution: {integrity: sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==} engines: {node: '>= 0.4'} dependencies: @@ -2646,13 +2820,13 @@ packages: has-tostringtag: 1.0.0 dev: true - /es-shim-unscopables/1.0.0: + /es-shim-unscopables@1.0.0: resolution: {integrity: sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==} dependencies: has: 1.0.3 dev: true - /es-to-primitive/1.2.1: + /es-to-primitive@1.2.1: resolution: {integrity: sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==} engines: {node: '>= 0.4'} dependencies: @@ -2661,7 +2835,7 @@ packages: is-symbol: 1.0.4 dev: true - /esbuild/0.17.14: + /esbuild@0.17.14: resolution: {integrity: sha512-vOO5XhmVj/1XQR9NQ1UPq6qvMYL7QFJU57J5fKBKBKxp17uDt5PgxFDb4A2nEiXhr1qQs4x0F5+66hVVw4ruNw==} engines: {node: '>=12'} hasBin: true @@ -2691,26 +2865,26 @@ packages: '@esbuild/win32-x64': 0.17.14 dev: true - /escalade/3.1.1: + /escalade@3.1.1: resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} engines: {node: '>=6'} dev: true - /escape-html/1.0.3: + /escape-html@1.0.3: resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==} dev: true - /escape-string-regexp/1.0.5: + /escape-string-regexp@1.0.5: resolution: {integrity: sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==} engines: {node: '>=0.8.0'} dev: true - /escape-string-regexp/2.0.0: + /escape-string-regexp@2.0.0: resolution: {integrity: sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==} engines: {node: '>=8'} dev: true - /escodegen/2.0.0: + /escodegen@2.0.0: resolution: {integrity: sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==} engines: {node: '>=6.0'} hasBin: true @@ -2723,28 +2897,28 @@ packages: source-map: 0.6.1 dev: true - /esprima/4.0.1: + /esprima@4.0.1: resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} engines: {node: '>=4'} hasBin: true dev: true - /estraverse/5.3.0: + /estraverse@5.3.0: resolution: {integrity: sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==} engines: {node: '>=4.0'} dev: true - /esutils/2.0.3: + /esutils@2.0.3: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} engines: {node: '>=0.10.0'} dev: true - /etag/1.8.1: + /etag@1.8.1: resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==} engines: {node: '>= 0.6'} dev: true - /execa/5.1.1: + /execa@5.1.1: resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} engines: {node: '>=10'} dependencies: @@ -2759,12 +2933,12 @@ packages: strip-final-newline: 2.0.0 dev: true - /exit/0.1.2: + /exit@0.1.2: resolution: {integrity: sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==} engines: {node: '>= 0.8.0'} dev: true - /expect/29.5.0: + /expect@29.5.0: resolution: {integrity: sha512-yM7xqUrCO2JdpFo4XpM82t+PJBFybdqoQuJLDGeDX2ij8NZzqRHyu3Hp188/JX7SWqud+7t4MUdvcgGBICMHZg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: @@ -2775,7 +2949,7 @@ packages: jest-util: 29.5.0 dev: true - /express/4.18.2: + /express@4.18.2: resolution: {integrity: sha512-5/PsL6iGPdfQ/lKM1UuielYgv3BUoJfz1aUwU9vHZ+J7gyvwdQXFEBIEIaxeGf0GIcreATNyBExtalisDbuMqQ==} engines: {node: '>= 0.10.0'} dependencies: @@ -2814,11 +2988,11 @@ packages: - supports-color dev: true - /extendable-error/0.1.7: + /extendable-error@0.1.7: resolution: {integrity: sha512-UOiS2in6/Q0FK0R0q6UY9vYpQ21mr/Qn1KOnte7vsACuNJf514WvCCUHSRCPcgjPT2bAhNIJdlE6bVap1GKmeg==} dev: true - /external-editor/3.1.0: + /external-editor@3.1.0: resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} engines: {node: '>=4'} dependencies: @@ -2827,7 +3001,7 @@ packages: tmp: 0.0.33 dev: true - /fast-glob/3.2.12: + /fast-glob@3.2.12: resolution: {integrity: sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==} engines: {node: '>=8.6.0'} dependencies: @@ -2838,38 +3012,38 @@ packages: micromatch: 4.0.5 dev: true - /fast-json-stable-stringify/2.1.0: + /fast-json-stable-stringify@2.1.0: resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} dev: true - /fast-levenshtein/2.0.6: + /fast-levenshtein@2.0.6: resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} dev: true - /fast-safe-stringify/2.1.1: + /fast-safe-stringify@2.1.1: resolution: {integrity: sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==} dev: true - /fastq/1.15.0: + /fastq@1.15.0: resolution: {integrity: sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==} dependencies: reusify: 1.0.4 dev: true - /fb-watchman/2.0.2: + /fb-watchman@2.0.2: resolution: {integrity: sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==} dependencies: bser: 2.1.1 dev: true - /fill-range/7.0.1: + /fill-range@7.0.1: resolution: {integrity: sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==} engines: {node: '>=8'} dependencies: to-regex-range: 5.0.1 dev: true - /finalhandler/1.2.0: + /finalhandler@1.2.0: resolution: {integrity: sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==} engines: {node: '>= 0.8'} dependencies: @@ -2884,7 +3058,7 @@ packages: - supports-color dev: true - /find-up/4.1.0: + /find-up@4.1.0: resolution: {integrity: sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==} engines: {node: '>=8'} dependencies: @@ -2892,7 +3066,7 @@ packages: path-exists: 4.0.0 dev: true - /find-up/5.0.0: + /find-up@5.0.0: resolution: {integrity: sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==} engines: {node: '>=10'} dependencies: @@ -2900,14 +3074,14 @@ packages: path-exists: 4.0.0 dev: true - /find-yarn-workspace-root2/1.2.16: + /find-yarn-workspace-root2@1.2.16: resolution: {integrity: sha512-hr6hb1w8ePMpPVUK39S4RlwJzi+xPLuVuG8XlwXU3KD5Yn3qgBWVfy3AzNlDhWvE1EORCE65/Qm26rFQt3VLVA==} dependencies: micromatch: 4.0.5 pkg-dir: 4.2.0 dev: true - /follow-redirects/1.15.2: + /follow-redirects@1.15.2: resolution: {integrity: sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==} engines: {node: '>=4.0'} peerDependencies: @@ -2917,13 +3091,13 @@ packages: optional: true dev: true - /for-each/0.3.3: + /for-each@0.3.3: resolution: {integrity: sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==} dependencies: is-callable: 1.2.7 dev: true - /form-data/4.0.0: + /form-data@4.0.0: resolution: {integrity: sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==} engines: {node: '>= 6'} dependencies: @@ -2932,7 +3106,7 @@ packages: mime-types: 2.1.35 dev: true - /formidable/2.1.2: + /formidable@2.1.2: resolution: {integrity: sha512-CM3GuJ57US06mlpQ47YcunuUZ9jpm8Vx+P2CGt2j7HpgkKZO/DJYQ0Bobim8G6PFQmK5lOqOOdUXboU+h73A4g==} dependencies: dezalgo: 1.0.4 @@ -2941,21 +3115,21 @@ packages: qs: 6.11.1 dev: true - /forwarded/0.2.0: + /forwarded@0.2.0: resolution: {integrity: sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==} engines: {node: '>= 0.6'} dev: true - /fp-ts/2.13.1: + /fp-ts@2.13.1: resolution: {integrity: sha512-0eu5ULPS2c/jsa1lGFneEFFEdTbembJv8e4QKXeVJ3lm/5hyve06dlKZrpxmMwJt6rYen7sxmHHK2CLaXvWuWQ==} dev: true - /fresh/0.5.2: + /fresh@0.5.2: resolution: {integrity: sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==} engines: {node: '>= 0.6'} dev: true - /fs-extra/7.0.1: + /fs-extra@7.0.1: resolution: {integrity: sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==} engines: {node: '>=6 <7 || >=8'} dependencies: @@ -2964,7 +3138,7 @@ packages: universalify: 0.1.2 dev: true - /fs-extra/8.1.0: + /fs-extra@8.1.0: resolution: {integrity: sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==} engines: {node: '>=6 <7 || >=8'} dependencies: @@ -2973,11 +3147,11 @@ packages: universalify: 0.1.2 dev: true - /fs.realpath/1.0.0: + /fs.realpath@1.0.0: resolution: {integrity: sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==} dev: true - /fsevents/2.3.2: + /fsevents@2.3.2: resolution: {integrity: sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==} engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] @@ -2985,11 +3159,11 @@ packages: dev: true optional: true - /function-bind/1.1.1: + /function-bind@1.1.1: resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} dev: true - /function.prototype.name/1.1.5: + /function.prototype.name@1.1.5: resolution: {integrity: sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==} engines: {node: '>= 0.4'} dependencies: @@ -2999,21 +3173,21 @@ packages: functions-have-names: 1.2.3 dev: true - /functions-have-names/1.2.3: + /functions-have-names@1.2.3: resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} dev: true - /gensync/1.0.0-beta.2: + /gensync@1.0.0-beta.2: resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} engines: {node: '>=6.9.0'} dev: true - /get-caller-file/2.0.5: + /get-caller-file@2.0.5: resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} engines: {node: 6.* || 8.* || >= 10.*} dev: true - /get-intrinsic/1.2.0: + /get-intrinsic@1.2.0: resolution: {integrity: sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==} dependencies: function-bind: 1.1.1 @@ -3021,17 +3195,17 @@ packages: has-symbols: 1.0.3 dev: true - /get-package-type/0.1.0: + /get-package-type@0.1.0: resolution: {integrity: sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==} engines: {node: '>=8.0.0'} dev: true - /get-stream/6.0.1: + /get-stream@6.0.1: resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} engines: {node: '>=10'} dev: true - /get-symbol-description/1.0.0: + /get-symbol-description@1.0.0: resolution: {integrity: sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==} engines: {node: '>= 0.4'} dependencies: @@ -3039,14 +3213,14 @@ packages: get-intrinsic: 1.2.0 dev: true - /glob-parent/5.1.2: + /glob-parent@5.1.2: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} engines: {node: '>= 6'} dependencies: is-glob: 4.0.3 dev: true - /glob/7.1.6: + /glob@7.1.6: resolution: {integrity: sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==} dependencies: fs.realpath: 1.0.0 @@ -3057,7 +3231,7 @@ packages: path-is-absolute: 1.0.1 dev: true - /glob/7.2.3: + /glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} dependencies: fs.realpath: 1.0.0 @@ -3068,7 +3242,7 @@ packages: path-is-absolute: 1.0.1 dev: true - /glob/9.3.4: + /glob@9.3.4: resolution: {integrity: sha512-qaSc49hojMOv1EPM4EuyITjDSgSKI0rthoHnvE81tcOi1SCVndHko7auqxdQ14eiQG2NDBJBE86+2xIrbIvrbA==} engines: {node: '>=16 || 14 >=14.17'} dependencies: @@ -3078,19 +3252,19 @@ packages: path-scurry: 1.6.3 dev: true - /globals/11.12.0: + /globals@11.12.0: resolution: {integrity: sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==} engines: {node: '>=4'} dev: true - /globalthis/1.0.3: + /globalthis@1.0.3: resolution: {integrity: sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==} engines: {node: '>= 0.4'} dependencies: define-properties: 1.2.0 dev: true - /globby/11.1.0: + /globby@11.1.0: resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} engines: {node: '>=10'} dependencies: @@ -3102,90 +3276,90 @@ packages: slash: 3.0.0 dev: true - /gopd/1.0.1: + /gopd@1.0.1: resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} dependencies: get-intrinsic: 1.2.0 dev: true - /graceful-fs/4.2.11: + /graceful-fs@4.2.11: resolution: {integrity: sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==} dev: true - /grapheme-splitter/1.0.4: + /grapheme-splitter@1.0.4: resolution: {integrity: sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==} dev: true - /hard-rejection/2.1.0: + /hard-rejection@2.1.0: resolution: {integrity: sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==} engines: {node: '>=6'} dev: true - /has-bigints/1.0.2: + /has-bigints@1.0.2: resolution: {integrity: sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==} dev: true - /has-flag/3.0.0: + /has-flag@3.0.0: resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==} engines: {node: '>=4'} dev: true - /has-flag/4.0.0: + /has-flag@4.0.0: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} dev: true - /has-property-descriptors/1.0.0: + /has-property-descriptors@1.0.0: resolution: {integrity: sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==} dependencies: get-intrinsic: 1.2.0 dev: true - /has-proto/1.0.1: + /has-proto@1.0.1: resolution: {integrity: sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==} engines: {node: '>= 0.4'} dev: true - /has-symbols/1.0.3: + /has-symbols@1.0.3: resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} engines: {node: '>= 0.4'} dev: true - /has-tostringtag/1.0.0: + /has-tostringtag@1.0.0: resolution: {integrity: sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==} engines: {node: '>= 0.4'} dependencies: has-symbols: 1.0.3 dev: true - /has/1.0.3: + /has@1.0.3: resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==} engines: {node: '>= 0.4.0'} dependencies: function-bind: 1.1.1 dev: true - /hexoid/1.0.0: + /hexoid@1.0.0: resolution: {integrity: sha512-QFLV0taWQOZtvIRIAdBChesmogZrtuXvVWsFHZTk2SU+anspqZ2vMnoLg7IE1+Uk16N19APic1BuF8bC8c2m5g==} engines: {node: '>=8'} dev: true - /hosted-git-info/2.8.9: + /hosted-git-info@2.8.9: resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} dev: true - /html-encoding-sniffer/3.0.0: + /html-encoding-sniffer@3.0.0: resolution: {integrity: sha512-oWv4T4yJ52iKrufjnyZPkrN0CH3QnrUqdB6In1g5Fe1mia8GmF36gnfNySxoZtxD5+NmYw1EElVXiBk93UeskA==} engines: {node: '>=12'} dependencies: whatwg-encoding: 2.0.0 dev: true - /html-escaper/2.0.2: + /html-escaper@2.0.2: resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} dev: true - /http-errors/2.0.0: + /http-errors@2.0.0: resolution: {integrity: sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==} engines: {node: '>= 0.8'} dependencies: @@ -3196,7 +3370,7 @@ packages: toidentifier: 1.0.1 dev: true - /http-proxy-agent/5.0.0: + /http-proxy-agent@5.0.0: resolution: {integrity: sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==} engines: {node: '>= 6'} dependencies: @@ -3207,7 +3381,7 @@ packages: - supports-color dev: true - /https-proxy-agent/5.0.1: + /https-proxy-agent@5.0.1: resolution: {integrity: sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==} engines: {node: '>= 6'} dependencies: @@ -3217,35 +3391,35 @@ packages: - supports-color dev: true - /human-id/1.0.2: + /human-id@1.0.2: resolution: {integrity: sha512-UNopramDEhHJD+VR+ehk8rOslwSfByxPIZyJRfV739NDhN5LF1fa1MqnzKm2lGTQRjNrjK19Q5fhkgIfjlVUKw==} dev: true - /human-signals/2.1.0: + /human-signals@2.1.0: resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} engines: {node: '>=10.17.0'} dev: true - /iconv-lite/0.4.24: + /iconv-lite@0.4.24: resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} engines: {node: '>=0.10.0'} dependencies: safer-buffer: 2.1.2 dev: true - /iconv-lite/0.6.3: + /iconv-lite@0.6.3: resolution: {integrity: sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==} engines: {node: '>=0.10.0'} dependencies: safer-buffer: 2.1.2 dev: true - /ignore/5.2.4: + /ignore@5.2.4: resolution: {integrity: sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==} engines: {node: '>= 4'} dev: true - /import-local/3.1.0: + /import-local@3.1.0: resolution: {integrity: sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==} engines: {node: '>=8'} hasBin: true @@ -3254,28 +3428,28 @@ packages: resolve-cwd: 3.0.0 dev: true - /imurmurhash/0.1.4: + /imurmurhash@0.1.4: resolution: {integrity: sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==} engines: {node: '>=0.8.19'} dev: true - /indent-string/4.0.0: + /indent-string@4.0.0: resolution: {integrity: sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==} engines: {node: '>=8'} dev: true - /inflight/1.0.6: + /inflight@1.0.6: resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} dependencies: once: 1.4.0 wrappy: 1.0.2 dev: true - /inherits/2.0.4: + /inherits@2.0.4: resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} dev: true - /internal-slot/1.0.5: + /internal-slot@1.0.5: resolution: {integrity: sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==} engines: {node: '>= 0.4'} dependencies: @@ -3284,7 +3458,7 @@ packages: side-channel: 1.0.4 dev: true - /io-ts/2.2.20_fp-ts@2.13.1: + /io-ts@2.2.20(fp-ts@2.13.1): resolution: {integrity: sha512-Rq2BsYmtwS5vVttie4rqrOCIfHCS9TgpRLFpKQCM1wZBBRY9nWVGmEvm2FnDbSE2un1UE39DvFpTR5UL47YDcA==} peerDependencies: fp-ts: ^2.5.0 @@ -3292,12 +3466,12 @@ packages: fp-ts: 2.13.1 dev: true - /ipaddr.js/1.9.1: + /ipaddr.js@1.9.1: resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==} engines: {node: '>= 0.10'} dev: true - /is-arguments/1.1.1: + /is-arguments@1.1.1: resolution: {integrity: sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==} engines: {node: '>= 0.4'} dependencies: @@ -3305,7 +3479,7 @@ packages: has-tostringtag: 1.0.0 dev: true - /is-array-buffer/3.0.2: + /is-array-buffer@3.0.2: resolution: {integrity: sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==} dependencies: call-bind: 1.0.2 @@ -3313,24 +3487,24 @@ packages: is-typed-array: 1.1.10 dev: true - /is-arrayish/0.2.1: + /is-arrayish@0.2.1: resolution: {integrity: sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==} dev: true - /is-bigint/1.0.4: + /is-bigint@1.0.4: resolution: {integrity: sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==} dependencies: has-bigints: 1.0.2 dev: true - /is-binary-path/2.1.0: + /is-binary-path@2.1.0: resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} engines: {node: '>=8'} dependencies: binary-extensions: 2.2.0 dev: true - /is-boolean-object/1.1.2: + /is-boolean-object@1.1.2: resolution: {integrity: sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==} engines: {node: '>= 0.4'} dependencies: @@ -3338,84 +3512,84 @@ packages: has-tostringtag: 1.0.0 dev: true - /is-callable/1.2.7: + /is-callable@1.2.7: resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} engines: {node: '>= 0.4'} dev: true - /is-ci/3.0.1: + /is-ci@3.0.1: resolution: {integrity: sha512-ZYvCgrefwqoQ6yTyYUbQu64HsITZ3NfKX1lzaEYdkTDcfKzzCI/wthRRYKkdjHKFVgNiXKAKm65Zo1pk2as/QQ==} hasBin: true dependencies: ci-info: 3.8.0 dev: true - /is-core-module/2.11.0: + /is-core-module@2.11.0: resolution: {integrity: sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw==} dependencies: has: 1.0.3 dev: true - /is-date-object/1.0.5: + /is-date-object@1.0.5: resolution: {integrity: sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==} engines: {node: '>= 0.4'} dependencies: has-tostringtag: 1.0.0 dev: true - /is-extglob/2.1.1: + /is-extglob@2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} dev: true - /is-fullwidth-code-point/3.0.0: + /is-fullwidth-code-point@3.0.0: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} engines: {node: '>=8'} dev: true - /is-generator-fn/2.1.0: + /is-generator-fn@2.1.0: resolution: {integrity: sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==} engines: {node: '>=6'} dev: true - /is-glob/4.0.3: + /is-glob@4.0.3: resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==} engines: {node: '>=0.10.0'} dependencies: is-extglob: 2.1.1 dev: true - /is-map/2.0.2: + /is-map@2.0.2: resolution: {integrity: sha512-cOZFQQozTha1f4MxLFzlgKYPTyj26picdZTx82hbc/Xf4K/tZOOXSCkMvU4pKioRXGDLJRn0GM7Upe7kR721yg==} dev: true - /is-negative-zero/2.0.2: + /is-negative-zero@2.0.2: resolution: {integrity: sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==} engines: {node: '>= 0.4'} dev: true - /is-number-object/1.0.7: + /is-number-object@1.0.7: resolution: {integrity: sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==} engines: {node: '>= 0.4'} dependencies: has-tostringtag: 1.0.0 dev: true - /is-number/7.0.0: + /is-number@7.0.0: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} dev: true - /is-plain-obj/1.1.0: + /is-plain-obj@1.1.0: resolution: {integrity: sha512-yvkRyxmFKEOQ4pNXCmJG5AEQNlXJS5LaONXo5/cLdTZdWvsZ1ioJEonLGAosKlMWE8lwUy/bJzMjcw8az73+Fg==} engines: {node: '>=0.10.0'} dev: true - /is-potential-custom-element-name/1.0.1: + /is-potential-custom-element-name@1.0.1: resolution: {integrity: sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==} dev: true - /is-regex/1.1.4: + /is-regex@1.1.4: resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==} engines: {node: '>= 0.4'} dependencies: @@ -3423,43 +3597,43 @@ packages: has-tostringtag: 1.0.0 dev: true - /is-set/2.0.2: + /is-set@2.0.2: resolution: {integrity: sha512-+2cnTEZeY5z/iXGbLhPrOAaK/Mau5k5eXq9j14CpRTftq0pAJu2MwVRSZhyZWBzx3o6X795Lz6Bpb6R0GKf37g==} dev: true - /is-shared-array-buffer/1.0.2: + /is-shared-array-buffer@1.0.2: resolution: {integrity: sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==} dependencies: call-bind: 1.0.2 dev: true - /is-stream/2.0.1: + /is-stream@2.0.1: resolution: {integrity: sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==} engines: {node: '>=8'} dev: true - /is-string/1.0.7: + /is-string@1.0.7: resolution: {integrity: sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==} engines: {node: '>= 0.4'} dependencies: has-tostringtag: 1.0.0 dev: true - /is-subdir/1.2.0: + /is-subdir@1.2.0: resolution: {integrity: sha512-2AT6j+gXe/1ueqbW6fLZJiIw3F8iXGJtt0yDrZaBhAZEG1raiTxKWU+IPqMCzQAXOUCKdA4UDMgacKH25XG2Cw==} engines: {node: '>=4'} dependencies: better-path-resolve: 1.0.0 dev: true - /is-symbol/1.0.4: + /is-symbol@1.0.4: resolution: {integrity: sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==} engines: {node: '>= 0.4'} dependencies: has-symbols: 1.0.3 dev: true - /is-typed-array/1.1.10: + /is-typed-array@1.1.10: resolution: {integrity: sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==} engines: {node: '>= 0.4'} dependencies: @@ -3470,46 +3644,46 @@ packages: has-tostringtag: 1.0.0 dev: true - /is-weakmap/2.0.1: + /is-weakmap@2.0.1: resolution: {integrity: sha512-NSBR4kH5oVj1Uwvv970ruUkCV7O1mzgVFO4/rev2cLRda9Tm9HrL70ZPut4rOHgY0FNrUu9BCbXA2sdQ+x0chA==} dev: true - /is-weakref/1.0.2: + /is-weakref@1.0.2: resolution: {integrity: sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==} dependencies: call-bind: 1.0.2 dev: true - /is-weakset/2.0.2: + /is-weakset@2.0.2: resolution: {integrity: sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg==} dependencies: call-bind: 1.0.2 get-intrinsic: 1.2.0 dev: true - /is-windows/1.0.2: + /is-windows@1.0.2: resolution: {integrity: sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==} engines: {node: '>=0.10.0'} dev: true - /isarray/1.0.0: + /isarray@1.0.0: resolution: {integrity: sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==} dev: true - /isarray/2.0.5: + /isarray@2.0.5: resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==} dev: true - /isexe/2.0.0: + /isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} dev: true - /istanbul-lib-coverage/3.2.0: + /istanbul-lib-coverage@3.2.0: resolution: {integrity: sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==} engines: {node: '>=8'} dev: true - /istanbul-lib-instrument/5.2.1: + /istanbul-lib-instrument@5.2.1: resolution: {integrity: sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg==} engines: {node: '>=8'} dependencies: @@ -3522,7 +3696,7 @@ packages: - supports-color dev: true - /istanbul-lib-report/3.0.0: + /istanbul-lib-report@3.0.0: resolution: {integrity: sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==} engines: {node: '>=8'} dependencies: @@ -3531,7 +3705,7 @@ packages: supports-color: 7.2.0 dev: true - /istanbul-lib-source-maps/4.0.1: + /istanbul-lib-source-maps@4.0.1: resolution: {integrity: sha512-n3s8EwkdFIJCG3BPKBYvskgXGoy88ARzvegkitk60NxRdwltLOTaH7CUiMRXvwYorl0Q712iEjcWB+fK/MrWVw==} engines: {node: '>=10'} dependencies: @@ -3542,7 +3716,7 @@ packages: - supports-color dev: true - /istanbul-reports/3.1.5: + /istanbul-reports@3.1.5: resolution: {integrity: sha512-nUsEMa9pBt/NOHqbcbeJEgqIlY/K7rVWUX6Lql2orY5e9roQOthbR3vtY4zzf2orPELg80fnxxk9zUyPlgwD1w==} engines: {node: '>=8'} dependencies: @@ -3550,7 +3724,7 @@ packages: istanbul-lib-report: 3.0.0 dev: true - /jest-changed-files/29.5.0: + /jest-changed-files@29.5.0: resolution: {integrity: sha512-IFG34IUMUaNBIxjQXF/iu7g6EcdMrGRRxaUSw92I/2g2YC6vCdTltl4nHvt7Ci5nSJwXIkCu8Ka1DKF+X7Z1Ag==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: @@ -3558,7 +3732,7 @@ packages: p-limit: 3.1.0 dev: true - /jest-circus/29.5.0: + /jest-circus@29.5.0: resolution: {integrity: sha512-gq/ongqeQKAplVxqJmbeUOJJKkW3dDNPY8PjhJ5G0lBRvu0e3EWGxGy5cI4LAGA7gV2UHCtWBI4EMXK8c9nQKA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: @@ -3586,7 +3760,7 @@ packages: - supports-color dev: true - /jest-cli/29.5.0_rrli7kzx2akox3oq6aahu3rvje: + /jest-cli@29.5.0(@types/node@18.15.11)(ts-node@10.9.1): resolution: {integrity: sha512-L1KcP1l4HtfwdxXNFCL5bmUbLQiKrakMUriBEcc1Vfz6gx31ORKdreuWvmQVBit+1ss9NNR3yxjwfwzZNdQXJw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -3596,14 +3770,14 @@ packages: node-notifier: optional: true dependencies: - '@jest/core': 29.5.0_ts-node@10.9.1 + '@jest/core': 29.5.0(ts-node@10.9.1) '@jest/test-result': 29.5.0 '@jest/types': 29.5.0 chalk: 4.1.2 exit: 0.1.2 graceful-fs: 4.2.11 import-local: 3.1.0 - jest-config: 29.5.0_rrli7kzx2akox3oq6aahu3rvje + jest-config: 29.5.0(@types/node@18.15.11)(ts-node@10.9.1) jest-util: 29.5.0 jest-validate: 29.5.0 prompts: 2.4.2 @@ -3614,7 +3788,7 @@ packages: - ts-node dev: true - /jest-config/29.5.0_rrli7kzx2akox3oq6aahu3rvje: + /jest-config@29.5.0(@types/node@18.15.11)(ts-node@10.9.1): resolution: {integrity: sha512-kvDUKBnNJPNBmFFOhDbm59iu1Fii1Q6SxyhXfvylq3UTHbg6o7j/g8k2dZyXWLvfdKB1vAPxNZnMgtKJcmu3kA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: @@ -3630,7 +3804,7 @@ packages: '@jest/test-sequencer': 29.5.0 '@jest/types': 29.5.0 '@types/node': 18.15.11 - babel-jest: 29.5.0_@babel+core@7.21.4 + babel-jest: 29.5.0(@babel/core@7.21.4) chalk: 4.1.2 ci-info: 3.8.0 deepmerge: 4.3.1 @@ -3649,12 +3823,12 @@ packages: pretty-format: 29.5.0 slash: 3.0.0 strip-json-comments: 3.1.1 - ts-node: 10.9.1_bhanhq442dy43ncydsavgi4jfi + ts-node: 10.9.1(@types/node@18.15.11)(typescript@5.0.4) transitivePeerDependencies: - supports-color dev: true - /jest-diff/29.5.0: + /jest-diff@29.5.0: resolution: {integrity: sha512-LtxijLLZBduXnHSniy0WMdaHjmQnt3g5sa16W4p0HqukYTTsyTW3GD1q41TyGl5YFXj/5B2U6dlh5FM1LIMgxw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: @@ -3664,14 +3838,14 @@ packages: pretty-format: 29.5.0 dev: true - /jest-docblock/29.4.3: + /jest-docblock@29.4.3: resolution: {integrity: sha512-fzdTftThczeSD9nZ3fzA/4KkHtnmllawWrXO69vtI+L9WjEIuXWs4AmyME7lN5hU7dB0sHhuPfcKofRsUb/2Fg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: detect-newline: 3.1.0 dev: true - /jest-each/29.5.0: + /jest-each@29.5.0: resolution: {integrity: sha512-HM5kIJ1BTnVt+DQZ2ALp3rzXEl+g726csObrW/jpEGl+CDSSQpOJJX2KE/vEg8cxcMXdyEPu6U4QX5eruQv5hA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: @@ -3682,7 +3856,7 @@ packages: pretty-format: 29.5.0 dev: true - /jest-environment-jsdom/29.5.0: + /jest-environment-jsdom@29.5.0: resolution: {integrity: sha512-/KG8yEK4aN8ak56yFVdqFDzKNHgF4BAymCx2LbPNPsUshUlfAl0eX402Xm1pt+eoG9SLZEUVifqXtX8SK74KCw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} peerDependencies: @@ -3705,7 +3879,7 @@ packages: - utf-8-validate dev: true - /jest-environment-node/29.5.0: + /jest-environment-node@29.5.0: resolution: {integrity: sha512-ExxuIK/+yQ+6PRGaHkKewYtg6hto2uGCgvKdb2nfJfKXgZ17DfXjvbZ+jA1Qt9A8EQSfPnt5FKIfnOO3u1h9qw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: @@ -3717,12 +3891,12 @@ packages: jest-util: 29.5.0 dev: true - /jest-get-type/29.4.3: + /jest-get-type@29.4.3: resolution: {integrity: sha512-J5Xez4nRRMjk8emnTpWrlkyb9pfRQQanDrvWHhsR1+VUfbwxi30eVcZFlcdGInRibU4G5LwHXpI7IRHU0CY+gg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dev: true - /jest-haste-map/29.5.0: + /jest-haste-map@29.5.0: resolution: {integrity: sha512-IspOPnnBro8YfVYSw6yDRKh/TiCdRngjxeacCps1cQ9cgVN6+10JUcuJ1EabrgYLOATsIAigxA0rLR9x/YlrSA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: @@ -3741,7 +3915,7 @@ packages: fsevents: 2.3.2 dev: true - /jest-leak-detector/29.5.0: + /jest-leak-detector@29.5.0: resolution: {integrity: sha512-u9YdeeVnghBUtpN5mVxjID7KbkKE1QU4f6uUwuxiY0vYRi9BUCLKlPEZfDGR67ofdFmDz9oPAy2G92Ujrntmow==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: @@ -3749,7 +3923,7 @@ packages: pretty-format: 29.5.0 dev: true - /jest-matcher-utils/29.5.0: + /jest-matcher-utils@29.5.0: resolution: {integrity: sha512-lecRtgm/rjIK0CQ7LPQwzCs2VwW6WAahA55YBuI+xqmhm7LAaxokSB8C97yJeYyT+HvQkH741StzpU41wohhWw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: @@ -3759,7 +3933,7 @@ packages: pretty-format: 29.5.0 dev: true - /jest-message-util/29.5.0: + /jest-message-util@29.5.0: resolution: {integrity: sha512-Kijeg9Dag6CKtIDA7O21zNTACqD5MD/8HfIV8pdD94vFyFuer52SigdC3IQMhab3vACxXMiFk+yMHNdbqtyTGA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: @@ -3774,7 +3948,7 @@ packages: stack-utils: 2.0.6 dev: true - /jest-mock/29.5.0: + /jest-mock@29.5.0: resolution: {integrity: sha512-GqOzvdWDE4fAV2bWQLQCkujxYWL7RxjCnj71b5VhDAGOevB3qj3Ovg26A5NI84ZpODxyzaozXLOh2NCgkbvyaw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: @@ -3783,7 +3957,7 @@ packages: jest-util: 29.5.0 dev: true - /jest-pnp-resolver/1.2.3_jest-resolve@29.5.0: + /jest-pnp-resolver@1.2.3(jest-resolve@29.5.0): resolution: {integrity: sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==} engines: {node: '>=6'} peerDependencies: @@ -3795,12 +3969,12 @@ packages: jest-resolve: 29.5.0 dev: true - /jest-regex-util/29.4.3: + /jest-regex-util@29.4.3: resolution: {integrity: sha512-O4FglZaMmWXbGHSQInfXewIsd1LMn9p3ZXB/6r4FOkyhX2/iP/soMG98jGvk/A3HAN78+5VWcBGO0BJAPRh4kg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dev: true - /jest-resolve-dependencies/29.5.0: + /jest-resolve-dependencies@29.5.0: resolution: {integrity: sha512-sjV3GFr0hDJMBpYeUuGduP+YeCRbd7S/ck6IvL3kQ9cpySYKqcqhdLLC2rFwrcL7tz5vYibomBrsFYWkIGGjOg==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: @@ -3810,14 +3984,14 @@ packages: - supports-color dev: true - /jest-resolve/29.5.0: + /jest-resolve@29.5.0: resolution: {integrity: sha512-1TzxJ37FQq7J10jPtQjcc+MkCkE3GBpBecsSUWJ0qZNJpmg6m0D9/7II03yJulm3H/fvVjgqLh/k2eYg+ui52w==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: chalk: 4.1.2 graceful-fs: 4.2.11 jest-haste-map: 29.5.0 - jest-pnp-resolver: 1.2.3_jest-resolve@29.5.0 + jest-pnp-resolver: 1.2.3(jest-resolve@29.5.0) jest-util: 29.5.0 jest-validate: 29.5.0 resolve: 1.22.2 @@ -3825,7 +3999,7 @@ packages: slash: 3.0.0 dev: true - /jest-runner/29.5.0: + /jest-runner@29.5.0: resolution: {integrity: sha512-m7b6ypERhFghJsslMLhydaXBiLf7+jXy8FwGRHO3BGV1mcQpPbwiqiKUR2zU2NJuNeMenJmlFZCsIqzJCTeGLQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: @@ -3854,7 +4028,7 @@ packages: - supports-color dev: true - /jest-runtime/29.5.0: + /jest-runtime@29.5.0: resolution: {integrity: sha512-1Hr6Hh7bAgXQP+pln3homOiEZtCDZFqwmle7Ew2j8OlbkIu6uE3Y/etJQG8MLQs3Zy90xrp2C0BRrtPHG4zryw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: @@ -3884,14 +4058,14 @@ packages: - supports-color dev: true - /jest-snapshot/29.5.0: + /jest-snapshot@29.5.0: resolution: {integrity: sha512-x7Wolra5V0tt3wRs3/ts3S6ciSQVypgGQlJpz2rsdQYoUKxMxPNaoHMGJN6qAuPJqS+2iQ1ZUn5kl7HCyls84g==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@babel/core': 7.21.4 '@babel/generator': 7.21.4 - '@babel/plugin-syntax-jsx': 7.21.4_@babel+core@7.21.4 - '@babel/plugin-syntax-typescript': 7.21.4_@babel+core@7.21.4 + '@babel/plugin-syntax-jsx': 7.21.4(@babel/core@7.21.4) + '@babel/plugin-syntax-typescript': 7.21.4(@babel/core@7.21.4) '@babel/traverse': 7.21.4 '@babel/types': 7.21.4 '@jest/expect-utils': 29.5.0 @@ -3899,7 +4073,7 @@ packages: '@jest/types': 29.5.0 '@types/babel__traverse': 7.18.3 '@types/prettier': 2.7.2 - babel-preset-current-node-syntax: 1.0.1_@babel+core@7.21.4 + babel-preset-current-node-syntax: 1.0.1(@babel/core@7.21.4) chalk: 4.1.2 expect: 29.5.0 graceful-fs: 4.2.11 @@ -3915,7 +4089,7 @@ packages: - supports-color dev: true - /jest-util/29.5.0: + /jest-util@29.5.0: resolution: {integrity: sha512-RYMgG/MTadOr5t8KdhejfvUU82MxsCu5MF6KuDUHl+NuwzUt+Sm6jJWxTJVrDR1j5M/gJVCPKQEpWXY+yIQ6lQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: @@ -3927,7 +4101,7 @@ packages: picomatch: 2.3.1 dev: true - /jest-validate/29.5.0: + /jest-validate@29.5.0: resolution: {integrity: sha512-pC26etNIi+y3HV8A+tUGr/lph9B18GnzSRAkPaaZJIE1eFdiYm6/CewuiJQ8/RlfHd1u/8Ioi8/sJ+CmbA+zAQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: @@ -3939,7 +4113,7 @@ packages: pretty-format: 29.5.0 dev: true - /jest-watcher/29.5.0: + /jest-watcher@29.5.0: resolution: {integrity: sha512-KmTojKcapuqYrKDpRwfqcQ3zjMlwu27SYext9pt4GlF5FUgB+7XE1mcCnSm6a4uUpFyQIkb6ZhzZvHl+jiBCiA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: @@ -3953,7 +4127,7 @@ packages: string-length: 4.0.2 dev: true - /jest-worker/29.5.0: + /jest-worker@29.5.0: resolution: {integrity: sha512-NcrQnevGoSp4b5kg+akIpthoAFHxPBcb5P6mYPY0fUNT+sSvmtu6jlkEle3anczUKIKEbMxFimk9oTP/tpIPgA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: @@ -3963,7 +4137,7 @@ packages: supports-color: 8.1.1 dev: true - /jest/29.5.0_rrli7kzx2akox3oq6aahu3rvje: + /jest@29.5.0(@types/node@18.15.11)(ts-node@10.9.1): resolution: {integrity: sha512-juMg3he2uru1QoXX078zTa7pO85QyB9xajZc6bU+d9yEGwrKX6+vGmJQ3UdVZsvTEUARIdObzH68QItim6OSSQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -3973,26 +4147,26 @@ packages: node-notifier: optional: true dependencies: - '@jest/core': 29.5.0_ts-node@10.9.1 + '@jest/core': 29.5.0(ts-node@10.9.1) '@jest/types': 29.5.0 import-local: 3.1.0 - jest-cli: 29.5.0_rrli7kzx2akox3oq6aahu3rvje + jest-cli: 29.5.0(@types/node@18.15.11)(ts-node@10.9.1) transitivePeerDependencies: - '@types/node' - supports-color - ts-node dev: true - /joycon/3.1.1: + /joycon@3.1.1: resolution: {integrity: sha512-34wB/Y7MW7bzjKRjUKTa46I2Z7eV62Rkhva+KkopW7Qvv/OSWBqvkSY7vusOPrNuZcUG3tApvdVgNB8POj3SPw==} engines: {node: '>=10'} dev: true - /js-tokens/4.0.0: + /js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} dev: true - /js-yaml/3.14.1: + /js-yaml@3.14.1: resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} hasBin: true dependencies: @@ -4000,7 +4174,7 @@ packages: esprima: 4.0.1 dev: true - /jsdom/20.0.3: + /jsdom@20.0.3: resolution: {integrity: sha512-SYhBvTh89tTfCD/CRdSOm13mOBa42iTaTyfyEWBdKcGdPxPtLFBXuHR8XHb33YNYaP+lLbmSvBTsnoesCNJEsQ==} engines: {node: '>=14'} peerDependencies: @@ -4041,49 +4215,49 @@ packages: - utf-8-validate dev: true - /jsesc/2.5.2: + /jsesc@2.5.2: resolution: {integrity: sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==} engines: {node: '>=4'} hasBin: true dev: true - /json-parse-even-better-errors/2.3.1: + /json-parse-even-better-errors@2.3.1: resolution: {integrity: sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==} dev: true - /json5/2.2.3: + /json5@2.2.3: resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} engines: {node: '>=6'} hasBin: true dev: true - /jsonfile/4.0.0: + /jsonfile@4.0.0: resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==} optionalDependencies: graceful-fs: 4.2.11 dev: true - /kind-of/6.0.3: + /kind-of@6.0.3: resolution: {integrity: sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==} engines: {node: '>=0.10.0'} dev: true - /kleur/3.0.3: + /kleur@3.0.3: resolution: {integrity: sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==} engines: {node: '>=6'} dev: true - /kleur/4.1.5: + /kleur@4.1.5: resolution: {integrity: sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==} engines: {node: '>=6'} dev: true - /leven/3.1.0: + /leven@3.1.0: resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==} engines: {node: '>=6'} dev: true - /levn/0.3.0: + /levn@0.3.0: resolution: {integrity: sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==} engines: {node: '>= 0.8.0'} dependencies: @@ -4091,21 +4265,21 @@ packages: type-check: 0.3.2 dev: true - /lilconfig/2.1.0: + /lilconfig@2.1.0: resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==} engines: {node: '>=10'} dev: true - /lines-and-columns/1.2.4: + /lines-and-columns@1.2.4: resolution: {integrity: sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==} dev: true - /load-tsconfig/0.2.5: + /load-tsconfig@0.2.5: resolution: {integrity: sha512-IXO6OCs9yg8tMKzfPZ1YmheJbZCiEsnBdcB03l0OcfK9prKnJb96siuHCr5Fl37/yo9DnKU+TLpxzTUspw9shg==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dev: true - /load-yaml-file/0.2.0: + /load-yaml-file@0.2.0: resolution: {integrity: sha512-OfCBkGEw4nN6JLtgRidPX6QxjBQGQf72q3si2uvqyFEMbycSFFHwAZeXx6cJgFM9wmLrf9zBwCP3Ivqa+LLZPw==} engines: {node: '>=6'} dependencies: @@ -4115,106 +4289,106 @@ packages: strip-bom: 3.0.0 dev: true - /locate-path/5.0.0: + /locate-path@5.0.0: resolution: {integrity: sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==} engines: {node: '>=8'} dependencies: p-locate: 4.1.0 dev: true - /locate-path/6.0.0: + /locate-path@6.0.0: resolution: {integrity: sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==} engines: {node: '>=10'} dependencies: p-locate: 5.0.0 dev: true - /lodash.memoize/4.1.2: + /lodash.memoize@4.1.2: resolution: {integrity: sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==} dev: true - /lodash.sortby/4.7.0: + /lodash.sortby@4.7.0: resolution: {integrity: sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==} dev: true - /lodash.startcase/4.4.0: + /lodash.startcase@4.4.0: resolution: {integrity: sha512-+WKqsK294HMSc2jEbNgpHpd0JfIBhp7rEV4aqXWqFr6AlXov+SlcgB1Fv01y2kGe3Gc8nMW7VA0SrGuSkRfIEg==} dev: true - /lodash/4.17.21: + /lodash@4.17.21: resolution: {integrity: sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==} dev: true - /loose-envify/1.4.0: + /loose-envify@1.4.0: resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} hasBin: true dependencies: js-tokens: 4.0.0 dev: true - /lru-cache/4.1.5: + /lru-cache@4.1.5: resolution: {integrity: sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==} dependencies: pseudomap: 1.0.2 yallist: 2.1.2 dev: true - /lru-cache/5.1.1: + /lru-cache@5.1.1: resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} dependencies: yallist: 3.1.1 dev: true - /lru-cache/6.0.0: + /lru-cache@6.0.0: resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==} engines: {node: '>=10'} dependencies: yallist: 4.0.0 dev: true - /lru-cache/7.18.3: + /lru-cache@7.18.3: resolution: {integrity: sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==} engines: {node: '>=12'} dev: true - /lz-string/1.5.0: + /lz-string@1.5.0: resolution: {integrity: sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==} hasBin: true dev: true - /make-dir/3.1.0: + /make-dir@3.1.0: resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} engines: {node: '>=8'} dependencies: semver: 6.3.0 dev: true - /make-error/1.3.6: + /make-error@1.3.6: resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} dev: true - /makeerror/1.0.12: + /makeerror@1.0.12: resolution: {integrity: sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==} dependencies: tmpl: 1.0.5 dev: true - /map-obj/1.0.1: + /map-obj@1.0.1: resolution: {integrity: sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==} engines: {node: '>=0.10.0'} dev: true - /map-obj/4.3.0: + /map-obj@4.3.0: resolution: {integrity: sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ==} engines: {node: '>=8'} dev: true - /media-typer/0.3.0: + /media-typer@0.3.0: resolution: {integrity: sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==} engines: {node: '>= 0.6'} dev: true - /meow/6.1.1: + /meow@6.1.1: resolution: {integrity: sha512-3YffViIt2QWgTy6Pale5QpopX/IvU3LPL03jOTqp6pGj3VjesdO/U8CuHMKpnQr4shCNCM5fd5XFFvIIl6JBHg==} engines: {node: '>=8'} dependencies: @@ -4231,25 +4405,25 @@ packages: yargs-parser: 18.1.3 dev: true - /merge-descriptors/1.0.1: + /merge-descriptors@1.0.1: resolution: {integrity: sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==} dev: true - /merge-stream/2.0.0: + /merge-stream@2.0.0: resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} dev: true - /merge2/1.4.1: + /merge2@1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} dev: true - /methods/1.1.2: + /methods@1.1.2: resolution: {integrity: sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==} engines: {node: '>= 0.6'} dev: true - /micromatch/4.0.5: + /micromatch@4.0.5: resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} engines: {node: '>=8.6'} dependencies: @@ -4257,54 +4431,54 @@ packages: picomatch: 2.3.1 dev: true - /mime-db/1.52.0: + /mime-db@1.52.0: resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} engines: {node: '>= 0.6'} dev: true - /mime-types/2.1.35: + /mime-types@2.1.35: resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} engines: {node: '>= 0.6'} dependencies: mime-db: 1.52.0 dev: true - /mime/1.6.0: + /mime@1.6.0: resolution: {integrity: sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==} engines: {node: '>=4'} hasBin: true dev: true - /mime/2.6.0: + /mime@2.6.0: resolution: {integrity: sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==} engines: {node: '>=4.0.0'} hasBin: true dev: true - /mimic-fn/2.1.0: + /mimic-fn@2.1.0: resolution: {integrity: sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==} engines: {node: '>=6'} dev: true - /min-indent/1.0.1: + /min-indent@1.0.1: resolution: {integrity: sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==} engines: {node: '>=4'} dev: true - /minimatch/3.1.2: + /minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} dependencies: brace-expansion: 1.1.11 dev: true - /minimatch/8.0.3: + /minimatch@8.0.3: resolution: {integrity: sha512-tEEvU9TkZgnFDCtpnrEYnPsjT7iUx42aXfs4bzmQ5sMA09/6hZY0jeZcGkXyDagiBOvkUjNo8Viom+Me6+2x7g==} engines: {node: '>=16 || 14 >=14.17'} dependencies: brace-expansion: 2.0.1 dev: true - /minimist-options/4.1.0: + /minimist-options@4.1.0: resolution: {integrity: sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==} engines: {node: '>= 6'} dependencies: @@ -4313,40 +4487,40 @@ packages: kind-of: 6.0.3 dev: true - /minimist/1.2.8: + /minimist@1.2.8: resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} dev: true - /minipass/4.2.5: + /minipass@4.2.5: resolution: {integrity: sha512-+yQl7SX3bIT83Lhb4BVorMAHVuqsskxRdlmO9kTpyukp8vsm2Sn/fUOV9xlnG8/a5JsypJzap21lz/y3FBMJ8Q==} engines: {node: '>=8'} dev: true - /mixme/0.5.9: + /mixme@0.5.9: resolution: {integrity: sha512-VC5fg6ySUscaWUpI4gxCBTQMH2RdUpNrk+MsbpCYtIvf9SBJdiUey4qE7BXviJsJR4nDQxCZ+3yaYNW3guz/Pw==} engines: {node: '>= 8.0.0'} dev: true - /mkdirp/0.5.6: + /mkdirp@0.5.6: resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==} hasBin: true dependencies: minimist: 1.2.8 dev: true - /ms/2.0.0: + /ms@2.0.0: resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} dev: true - /ms/2.1.2: + /ms@2.1.2: resolution: {integrity: sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==} dev: true - /ms/2.1.3: + /ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} dev: true - /multer/1.4.5-lts.1: + /multer@1.4.5-lts.1: resolution: {integrity: sha512-ywPWvcDMeH+z9gQq5qYHCCy+ethsk4goepZ45GLD63fOu0YcNecQxi64nDs3qluZB+murG3/D4dJ7+dGctcCQQ==} engines: {node: '>= 6.0.0'} dependencies: @@ -4359,7 +4533,7 @@ packages: xtend: 4.0.2 dev: true - /mz/2.7.0: + /mz@2.7.0: resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==} dependencies: any-promise: 1.3.0 @@ -4367,16 +4541,16 @@ packages: thenify-all: 1.6.0 dev: true - /natural-compare/1.4.0: + /natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} dev: true - /negotiator/0.6.3: + /negotiator@0.6.3: resolution: {integrity: sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==} engines: {node: '>= 0.6'} dev: true - /node-fetch/2.6.7: + /node-fetch@2.6.7: resolution: {integrity: sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==} engines: {node: 4.x || >=6.0.0} peerDependencies: @@ -4388,15 +4562,15 @@ packages: whatwg-url: 5.0.0 dev: true - /node-int64/0.4.0: + /node-int64@0.4.0: resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==} dev: true - /node-releases/2.0.10: + /node-releases@2.0.10: resolution: {integrity: sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w==} dev: true - /normalize-package-data/2.5.0: + /normalize-package-data@2.5.0: resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} dependencies: hosted-git-info: 2.8.9 @@ -4405,32 +4579,32 @@ packages: validate-npm-package-license: 3.0.4 dev: true - /normalize-path/3.0.0: + /normalize-path@3.0.0: resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} engines: {node: '>=0.10.0'} dev: true - /npm-run-path/4.0.1: + /npm-run-path@4.0.1: resolution: {integrity: sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==} engines: {node: '>=8'} dependencies: path-key: 3.1.1 dev: true - /nwsapi/2.2.3: + /nwsapi@2.2.3: resolution: {integrity: sha512-jscxIO4/VKScHlbmFBdV1Z6LXnLO+ZR4VMtypudUdfwtKxUN3TQcNFIHLwKtrUbDyHN4/GycY9+oRGZ2XMXYPw==} dev: true - /object-assign/4.1.1: + /object-assign@4.1.1: resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} engines: {node: '>=0.10.0'} dev: true - /object-inspect/1.12.3: + /object-inspect@1.12.3: resolution: {integrity: sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==} dev: true - /object-is/1.1.5: + /object-is@1.1.5: resolution: {integrity: sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw==} engines: {node: '>= 0.4'} dependencies: @@ -4438,12 +4612,12 @@ packages: define-properties: 1.2.0 dev: true - /object-keys/1.1.1: + /object-keys@1.1.1: resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} engines: {node: '>= 0.4'} dev: true - /object.assign/4.1.4: + /object.assign@4.1.4: resolution: {integrity: sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==} engines: {node: '>= 0.4'} dependencies: @@ -4453,31 +4627,31 @@ packages: object-keys: 1.1.1 dev: true - /on-finished/2.4.1: + /on-finished@2.4.1: resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==} engines: {node: '>= 0.8'} dependencies: ee-first: 1.1.1 dev: true - /once/1.4.0: + /once@1.4.0: resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} dependencies: wrappy: 1.0.2 dev: true - /onetime/5.1.2: + /onetime@5.1.2: resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} engines: {node: '>=6'} dependencies: mimic-fn: 2.1.0 dev: true - /openapi-types/12.1.0: + /openapi-types@12.1.0: resolution: {integrity: sha512-XpeCy01X6L5EpP+6Hc3jWN7rMZJ+/k1lwki/kTmWzbVhdPie3jd5O2ZtedEx8Yp58icJ0osVldLMrTB/zslQXA==} dev: false - /optionator/0.8.3: + /optionator@0.8.3: resolution: {integrity: sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==} engines: {node: '>= 0.8.0'} dependencies: @@ -4489,61 +4663,61 @@ packages: word-wrap: 1.2.3 dev: true - /os-tmpdir/1.0.2: + /os-tmpdir@1.0.2: resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} engines: {node: '>=0.10.0'} dev: true - /outdent/0.5.0: + /outdent@0.5.0: resolution: {integrity: sha512-/jHxFIzoMXdqPzTaCpFzAAWhpkSjZPF4Vsn6jAfNpmbH/ymsmd7Qc6VE9BGn0L6YMj6uwpQLxCECpus4ukKS9Q==} dev: true - /p-filter/2.1.0: + /p-filter@2.1.0: resolution: {integrity: sha512-ZBxxZ5sL2HghephhpGAQdoskxplTwr7ICaehZwLIlfL6acuVgZPm8yBNuRAFBGEqtD/hmUeq9eqLg2ys9Xr/yw==} engines: {node: '>=8'} dependencies: p-map: 2.1.0 dev: true - /p-limit/2.3.0: + /p-limit@2.3.0: resolution: {integrity: sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==} engines: {node: '>=6'} dependencies: p-try: 2.2.0 dev: true - /p-limit/3.1.0: + /p-limit@3.1.0: resolution: {integrity: sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==} engines: {node: '>=10'} dependencies: yocto-queue: 0.1.0 dev: true - /p-locate/4.1.0: + /p-locate@4.1.0: resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} engines: {node: '>=8'} dependencies: p-limit: 2.3.0 dev: true - /p-locate/5.0.0: + /p-locate@5.0.0: resolution: {integrity: sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==} engines: {node: '>=10'} dependencies: p-limit: 3.1.0 dev: true - /p-map/2.1.0: + /p-map@2.1.0: resolution: {integrity: sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==} engines: {node: '>=6'} dev: true - /p-try/2.2.0: + /p-try@2.2.0: resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} engines: {node: '>=6'} dev: true - /parse-json/5.2.0: + /parse-json@5.2.0: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} engines: {node: '>=8'} dependencies: @@ -4553,37 +4727,37 @@ packages: lines-and-columns: 1.2.4 dev: true - /parse5/7.1.2: + /parse5@7.1.2: resolution: {integrity: sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==} dependencies: entities: 4.4.0 dev: true - /parseurl/1.3.3: + /parseurl@1.3.3: resolution: {integrity: sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==} engines: {node: '>= 0.8'} dev: true - /path-exists/4.0.0: + /path-exists@4.0.0: resolution: {integrity: sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==} engines: {node: '>=8'} dev: true - /path-is-absolute/1.0.1: + /path-is-absolute@1.0.1: resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} engines: {node: '>=0.10.0'} dev: true - /path-key/3.1.1: + /path-key@3.1.1: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} engines: {node: '>=8'} dev: true - /path-parse/1.0.7: + /path-parse@1.0.7: resolution: {integrity: sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==} dev: true - /path-scurry/1.6.3: + /path-scurry@1.6.3: resolution: {integrity: sha512-RAmB+n30SlN+HnNx6EbcpoDy9nwdpcGPnEKrJnu6GZoDWBdIjo1UQMVtW2ybtC7LC2oKLcMq8y5g8WnKLiod9g==} engines: {node: '>=16 || 14 >=14.17'} dependencies: @@ -4591,42 +4765,42 @@ packages: minipass: 4.2.5 dev: true - /path-to-regexp/0.1.7: + /path-to-regexp@0.1.7: resolution: {integrity: sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==} dev: true - /path-type/4.0.0: + /path-type@4.0.0: resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} engines: {node: '>=8'} dev: true - /picocolors/1.0.0: + /picocolors@1.0.0: resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} dev: true - /picomatch/2.3.1: + /picomatch@2.3.1: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} dev: true - /pify/4.0.1: + /pify@4.0.1: resolution: {integrity: sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==} engines: {node: '>=6'} dev: true - /pirates/4.0.5: + /pirates@4.0.5: resolution: {integrity: sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ==} engines: {node: '>= 6'} dev: true - /pkg-dir/4.2.0: + /pkg-dir@4.2.0: resolution: {integrity: sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==} engines: {node: '>=8'} dependencies: find-up: 4.1.0 dev: true - /postcss-load-config/3.1.4_ts-node@10.9.1: + /postcss-load-config@3.1.4(ts-node@10.9.1): resolution: {integrity: sha512-6DiM4E7v4coTE4uzA8U//WhtPwyhiim3eyjEMFCnUpzbrkK9wJHgKDT2mR+HbtSrd/NubVaYTOpSpjUl8NQeRg==} engines: {node: '>= 10'} peerDependencies: @@ -4639,11 +4813,11 @@ packages: optional: true dependencies: lilconfig: 2.1.0 - ts-node: 10.9.1_bhanhq442dy43ncydsavgi4jfi + ts-node: 10.9.1(@types/node@18.15.11)(typescript@5.0.4) yaml: 1.10.2 dev: true - /preferred-pm/3.0.3: + /preferred-pm@3.0.3: resolution: {integrity: sha512-+wZgbxNES/KlJs9q40F/1sfOd/j7f1O9JaHcW5Dsn3aUUOZg3L2bjpVUcKV2jvtElYfoTuQiNeMfQJ4kwUAhCQ==} engines: {node: '>=10'} dependencies: @@ -4653,18 +4827,18 @@ packages: which-pm: 2.0.0 dev: true - /prelude-ls/1.1.2: + /prelude-ls@1.1.2: resolution: {integrity: sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==} engines: {node: '>= 0.8.0'} dev: true - /prettier/2.8.7: + /prettier@2.8.7: resolution: {integrity: sha512-yPngTo3aXUUmyuTjeTUT75txrf+aMh9FiD7q9ZE/i6r0bPb22g4FsE6Y338PQX1bmfy08i9QQCB7/rcUAVntfw==} engines: {node: '>=10.13.0'} hasBin: true dev: true - /pretty-format/27.5.1: + /pretty-format@27.5.1: resolution: {integrity: sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==} engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} dependencies: @@ -4673,7 +4847,7 @@ packages: react-is: 17.0.2 dev: true - /pretty-format/29.5.0: + /pretty-format@29.5.0: resolution: {integrity: sha512-V2mGkI31qdttvTFX7Mt4efOqHXqJWMu4/r66Xh3Z3BwZaPfPJgp6/gbwoujRpPUtfEF6AUUWx3Jim3GCw5g/Qw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: @@ -4682,11 +4856,11 @@ packages: react-is: 18.2.0 dev: true - /process-nextick-args/2.0.1: + /process-nextick-args@2.0.1: resolution: {integrity: sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==} dev: true - /prompts/2.4.2: + /prompts@2.4.2: resolution: {integrity: sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==} engines: {node: '>= 6'} dependencies: @@ -4694,7 +4868,7 @@ packages: sisteransi: 1.0.5 dev: true - /proxy-addr/2.0.7: + /proxy-addr@2.0.7: resolution: {integrity: sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==} engines: {node: '>= 0.10'} dependencies: @@ -4702,60 +4876,60 @@ packages: ipaddr.js: 1.9.1 dev: true - /proxy-from-env/1.1.0: + /proxy-from-env@1.1.0: resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} dev: true - /pseudomap/1.0.2: + /pseudomap@1.0.2: resolution: {integrity: sha512-b/YwNhb8lk1Zz2+bXXpS/LK9OisiZZ1SNsSLxN1x2OXVEhW2Ckr/7mWE5vrC1ZTiJlD9g19jWszTmJsB+oEpFQ==} dev: true - /psl/1.9.0: + /psl@1.9.0: resolution: {integrity: sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==} dev: true - /punycode/2.3.0: + /punycode@2.3.0: resolution: {integrity: sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==} engines: {node: '>=6'} dev: true - /pure-rand/6.0.1: + /pure-rand@6.0.1: resolution: {integrity: sha512-t+x1zEHDjBwkDGY5v5ApnZ/utcd4XYDiJsaQQoptTXgUXX95sDg1elCdJghzicm7n2mbCBJ3uYWr6M22SO19rg==} dev: true - /qs/6.11.0: + /qs@6.11.0: resolution: {integrity: sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==} engines: {node: '>=0.6'} dependencies: side-channel: 1.0.4 dev: true - /qs/6.11.1: + /qs@6.11.1: resolution: {integrity: sha512-0wsrzgTz/kAVIeuxSjnpGC56rzYtr6JT/2BwEvMaPhFIoYa1aGO8LbzuU1R0uUYQkLpWBTOj0l/CLAJB64J6nQ==} engines: {node: '>=0.6'} dependencies: side-channel: 1.0.4 dev: true - /querystringify/2.2.0: + /querystringify@2.2.0: resolution: {integrity: sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==} dev: true - /queue-microtask/1.2.3: + /queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} dev: true - /quick-lru/4.0.1: + /quick-lru@4.0.1: resolution: {integrity: sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==} engines: {node: '>=8'} dev: true - /range-parser/1.2.1: + /range-parser@1.2.1: resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==} engines: {node: '>= 0.6'} dev: true - /raw-body/2.5.1: + /raw-body@2.5.1: resolution: {integrity: sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig==} engines: {node: '>= 0.8'} dependencies: @@ -4765,7 +4939,7 @@ packages: unpipe: 1.0.0 dev: true - /react-dom/18.2.0_react@18.2.0: + /react-dom@18.2.0(react@18.2.0): resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} peerDependencies: react: ^18.2.0 @@ -4775,7 +4949,7 @@ packages: scheduler: 0.23.0 dev: true - /react-error-boundary/3.1.4_react@18.2.0: + /react-error-boundary@3.1.4(react@18.2.0): resolution: {integrity: sha512-uM9uPzZJTF6wRQORmSrvOIgt4lJ9MC1sNgEOj2XGsDTRE4kmpWxg7ENK9EWNKJRMAOY9z0MuF4yIfl6gp4sotA==} engines: {node: '>=10', npm: '>=6'} peerDependencies: @@ -4785,15 +4959,15 @@ packages: react: 18.2.0 dev: true - /react-is/17.0.2: + /react-is@17.0.2: resolution: {integrity: sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==} dev: true - /react-is/18.2.0: + /react-is@18.2.0: resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==} dev: true - /react-shallow-renderer/16.15.0_react@18.2.0: + /react-shallow-renderer@16.15.0(react@18.2.0): resolution: {integrity: sha512-oScf2FqQ9LFVQgA73vr86xl2NaOIX73rh+YFqcOp68CWj56tSfgtGKrEbyhCj0rSijyG9M1CYprTh39fBi5hzA==} peerDependencies: react: ^16.0.0 || ^17.0.0 || ^18.0.0 @@ -4803,25 +4977,25 @@ packages: react-is: 18.2.0 dev: true - /react-test-renderer/18.2.0_react@18.2.0: + /react-test-renderer@18.2.0(react@18.2.0): resolution: {integrity: sha512-JWD+aQ0lh2gvh4NM3bBM42Kx+XybOxCpgYK7F8ugAlpaTSnWsX+39Z4XkOykGZAHrjwwTZT3x3KxswVWxHPUqA==} peerDependencies: react: ^18.2.0 dependencies: react: 18.2.0 react-is: 18.2.0 - react-shallow-renderer: 16.15.0_react@18.2.0 + react-shallow-renderer: 16.15.0(react@18.2.0) scheduler: 0.23.0 dev: true - /react/18.2.0: + /react@18.2.0: resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} engines: {node: '>=0.10.0'} dependencies: loose-envify: 1.4.0 dev: true - /read-pkg-up/7.0.1: + /read-pkg-up@7.0.1: resolution: {integrity: sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==} engines: {node: '>=8'} dependencies: @@ -4830,7 +5004,7 @@ packages: type-fest: 0.8.1 dev: true - /read-pkg/5.2.0: + /read-pkg@5.2.0: resolution: {integrity: sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==} engines: {node: '>=8'} dependencies: @@ -4840,7 +5014,7 @@ packages: type-fest: 0.6.0 dev: true - /read-yaml-file/1.1.0: + /read-yaml-file@1.1.0: resolution: {integrity: sha512-VIMnQi/Z4HT2Fxuwg5KrY174U1VdUIASQVWXXyqtNRtxSr9IYkn1rsI6Tb6HsrHCmB7gVpNwX6JxPTHcH6IoTA==} engines: {node: '>=6'} dependencies: @@ -4850,7 +5024,7 @@ packages: strip-bom: 3.0.0 dev: true - /readable-stream/2.3.8: + /readable-stream@2.3.8: resolution: {integrity: sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==} dependencies: core-util-is: 1.0.3 @@ -4862,14 +5036,14 @@ packages: util-deprecate: 1.0.2 dev: true - /readdirp/3.6.0: + /readdirp@3.6.0: resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} engines: {node: '>=8.10.0'} dependencies: picomatch: 2.3.1 dev: true - /redent/3.0.0: + /redent@3.0.0: resolution: {integrity: sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==} engines: {node: '>=8'} dependencies: @@ -4877,11 +5051,11 @@ packages: strip-indent: 3.0.0 dev: true - /regenerator-runtime/0.13.11: + /regenerator-runtime@0.13.11: resolution: {integrity: sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg==} dev: true - /regexp.prototype.flags/1.4.3: + /regexp.prototype.flags@1.4.3: resolution: {integrity: sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA==} engines: {node: '>= 0.4'} dependencies: @@ -4890,37 +5064,37 @@ packages: functions-have-names: 1.2.3 dev: true - /require-directory/2.1.1: + /require-directory@2.1.1: resolution: {integrity: sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==} engines: {node: '>=0.10.0'} dev: true - /require-main-filename/2.0.0: + /require-main-filename@2.0.0: resolution: {integrity: sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==} dev: true - /requires-port/1.0.0: + /requires-port@1.0.0: resolution: {integrity: sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==} dev: true - /resolve-cwd/3.0.0: + /resolve-cwd@3.0.0: resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} engines: {node: '>=8'} dependencies: resolve-from: 5.0.0 dev: true - /resolve-from/5.0.0: + /resolve-from@5.0.0: resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} engines: {node: '>=8'} dev: true - /resolve.exports/2.0.2: + /resolve.exports@2.0.2: resolution: {integrity: sha512-X2UW6Nw3n/aMgDVy+0rSqgHlv39WZAlZrXCdnbyEiKm17DSqHX4MmQMaST3FbeWR5FTuRcUwYAziZajji0Y7mg==} engines: {node: '>=10'} dev: true - /resolve/1.22.2: + /resolve@1.22.2: resolution: {integrity: sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g==} hasBin: true dependencies: @@ -4929,12 +5103,12 @@ packages: supports-preserve-symlinks-flag: 1.0.0 dev: true - /reusify/1.0.4: + /reusify@1.0.4: resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} dev: true - /rimraf/4.4.1: + /rimraf@4.4.1: resolution: {integrity: sha512-Gk8NlF062+T9CqNGn6h4tls3k6T1+/nXdOcSZVikNVtlRdYpA7wRJJMoXmuvOnLW844rPjdQ7JgXCYM6PPC/og==} engines: {node: '>=14'} hasBin: true @@ -4942,7 +5116,7 @@ packages: glob: 9.3.4 dev: true - /rollup/3.20.2: + /rollup@3.20.2: resolution: {integrity: sha512-3zwkBQl7Ai7MFYQE0y1MeQ15+9jsi7XxfrqwTb/9EK8D9C9+//EBR4M+CuA1KODRaNbFez/lWxA5vhEGZp4MUg==} engines: {node: '>=14.18.0', npm: '>=8.0.0'} hasBin: true @@ -4950,21 +5124,21 @@ packages: fsevents: 2.3.2 dev: true - /run-parallel/1.2.0: + /run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} dependencies: queue-microtask: 1.2.3 dev: true - /safe-buffer/5.1.2: + /safe-buffer@5.1.2: resolution: {integrity: sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==} dev: true - /safe-buffer/5.2.1: + /safe-buffer@5.2.1: resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} dev: true - /safe-regex-test/1.0.0: + /safe-regex-test@1.0.0: resolution: {integrity: sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==} dependencies: call-bind: 1.0.2 @@ -4972,34 +5146,34 @@ packages: is-regex: 1.1.4 dev: true - /safer-buffer/2.1.2: + /safer-buffer@2.1.2: resolution: {integrity: sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==} dev: true - /saxes/6.0.0: + /saxes@6.0.0: resolution: {integrity: sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==} engines: {node: '>=v12.22.7'} dependencies: xmlchars: 2.2.0 dev: true - /scheduler/0.23.0: + /scheduler@0.23.0: resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==} dependencies: loose-envify: 1.4.0 dev: true - /semver/5.7.1: + /semver@5.7.1: resolution: {integrity: sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==} hasBin: true dev: true - /semver/6.3.0: + /semver@6.3.0: resolution: {integrity: sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==} hasBin: true dev: true - /semver/7.3.8: + /semver@7.3.8: resolution: {integrity: sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==} engines: {node: '>=10'} hasBin: true @@ -5007,7 +5181,7 @@ packages: lru-cache: 6.0.0 dev: true - /send/0.18.0: + /send@0.18.0: resolution: {integrity: sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==} engines: {node: '>= 0.8.0'} dependencies: @@ -5028,7 +5202,7 @@ packages: - supports-color dev: true - /serve-static/1.15.0: + /serve-static@1.15.0: resolution: {integrity: sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==} engines: {node: '>= 0.8.0'} dependencies: @@ -5040,39 +5214,39 @@ packages: - supports-color dev: true - /set-blocking/2.0.0: + /set-blocking@2.0.0: resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} dev: true - /setprototypeof/1.2.0: + /setprototypeof@1.2.0: resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==} dev: true - /shebang-command/1.2.0: + /shebang-command@1.2.0: resolution: {integrity: sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==} engines: {node: '>=0.10.0'} dependencies: shebang-regex: 1.0.0 dev: true - /shebang-command/2.0.0: + /shebang-command@2.0.0: resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} engines: {node: '>=8'} dependencies: shebang-regex: 3.0.0 dev: true - /shebang-regex/1.0.0: + /shebang-regex@1.0.0: resolution: {integrity: sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==} engines: {node: '>=0.10.0'} dev: true - /shebang-regex/3.0.0: + /shebang-regex@3.0.0: resolution: {integrity: sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==} engines: {node: '>=8'} dev: true - /side-channel/1.0.4: + /side-channel@1.0.4: resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==} dependencies: call-bind: 1.0.2 @@ -5080,20 +5254,20 @@ packages: object-inspect: 1.12.3 dev: true - /signal-exit/3.0.7: + /signal-exit@3.0.7: resolution: {integrity: sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==} dev: true - /sisteransi/1.0.5: + /sisteransi@1.0.5: resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} dev: true - /slash/3.0.0: + /slash@3.0.0: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} engines: {node: '>=8'} dev: true - /smartwrap/2.0.2: + /smartwrap@2.0.2: resolution: {integrity: sha512-vCsKNQxb7PnCNd2wY1WClWifAc2lwqsG8OaswpJkVJsvMGcnEntdTCDajZCkk93Ay1U3t/9puJmb525Rg5MZBA==} engines: {node: '>=6'} hasBin: true @@ -5106,89 +5280,89 @@ packages: yargs: 15.4.1 dev: true - /source-map-support/0.5.13: + /source-map-support@0.5.13: resolution: {integrity: sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==} dependencies: buffer-from: 1.1.2 source-map: 0.6.1 dev: true - /source-map/0.6.1: + /source-map@0.6.1: resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} engines: {node: '>=0.10.0'} dev: true - /source-map/0.8.0-beta.0: + /source-map@0.8.0-beta.0: resolution: {integrity: sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA==} engines: {node: '>= 8'} dependencies: whatwg-url: 7.1.0 dev: true - /spawndamnit/2.0.0: + /spawndamnit@2.0.0: resolution: {integrity: sha512-j4JKEcncSjFlqIwU5L/rp2N5SIPsdxaRsIv678+TZxZ0SRDJTm8JrxJMjE/XuiEZNEir3S8l0Fa3Ke339WI4qA==} dependencies: cross-spawn: 5.1.0 signal-exit: 3.0.7 dev: true - /spdx-correct/3.2.0: + /spdx-correct@3.2.0: resolution: {integrity: sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==} dependencies: spdx-expression-parse: 3.0.1 spdx-license-ids: 3.0.13 dev: true - /spdx-exceptions/2.3.0: + /spdx-exceptions@2.3.0: resolution: {integrity: sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==} dev: true - /spdx-expression-parse/3.0.1: + /spdx-expression-parse@3.0.1: resolution: {integrity: sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==} dependencies: spdx-exceptions: 2.3.0 spdx-license-ids: 3.0.13 dev: true - /spdx-license-ids/3.0.13: + /spdx-license-ids@3.0.13: resolution: {integrity: sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w==} dev: true - /sprintf-js/1.0.3: + /sprintf-js@1.0.3: resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} dev: true - /stack-utils/2.0.6: + /stack-utils@2.0.6: resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} engines: {node: '>=10'} dependencies: escape-string-regexp: 2.0.0 dev: true - /statuses/2.0.1: + /statuses@2.0.1: resolution: {integrity: sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==} engines: {node: '>= 0.8'} dev: true - /stop-iteration-iterator/1.0.0: + /stop-iteration-iterator@1.0.0: resolution: {integrity: sha512-iCGQj+0l0HOdZ2AEeBADlsRC+vsnDsZsbdSiH1yNSjcfKM7fdpCMfqAL/dwF5BLiw/XhRft/Wax6zQbhq2BcjQ==} engines: {node: '>= 0.4'} dependencies: internal-slot: 1.0.5 dev: true - /stream-transform/2.1.3: + /stream-transform@2.1.3: resolution: {integrity: sha512-9GHUiM5hMiCi6Y03jD2ARC1ettBXkQBoQAe7nJsPknnI0ow10aXjTnew8QtYQmLjzn974BnmWEAJgCY6ZP1DeQ==} dependencies: mixme: 0.5.9 dev: true - /streamsearch/1.1.0: + /streamsearch@1.1.0: resolution: {integrity: sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==} engines: {node: '>=10.0.0'} dev: true - /string-length/4.0.2: + /string-length@4.0.2: resolution: {integrity: sha512-+l6rNN5fYHNhZZy41RXsYptCjA2Igmq4EG7kZAYFQI1E1VTXarr6ZPXBg6eq7Y6eK4FEhY6AJlyuFIb/v/S0VQ==} engines: {node: '>=10'} dependencies: @@ -5196,7 +5370,7 @@ packages: strip-ansi: 6.0.1 dev: true - /string-width/4.2.3: + /string-width@4.2.3: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} engines: {node: '>=8'} dependencies: @@ -5205,7 +5379,7 @@ packages: strip-ansi: 6.0.1 dev: true - /string.prototype.trim/1.2.7: + /string.prototype.trim@1.2.7: resolution: {integrity: sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg==} engines: {node: '>= 0.4'} dependencies: @@ -5214,7 +5388,7 @@ packages: es-abstract: 1.21.2 dev: true - /string.prototype.trimend/1.0.6: + /string.prototype.trimend@1.0.6: resolution: {integrity: sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==} dependencies: call-bind: 1.0.2 @@ -5222,7 +5396,7 @@ packages: es-abstract: 1.21.2 dev: true - /string.prototype.trimstart/1.0.6: + /string.prototype.trimstart@1.0.6: resolution: {integrity: sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==} dependencies: call-bind: 1.0.2 @@ -5230,47 +5404,47 @@ packages: es-abstract: 1.21.2 dev: true - /string_decoder/1.1.1: + /string_decoder@1.1.1: resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==} dependencies: safe-buffer: 5.1.2 dev: true - /strip-ansi/6.0.1: + /strip-ansi@6.0.1: resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} engines: {node: '>=8'} dependencies: ansi-regex: 5.0.1 dev: true - /strip-bom/3.0.0: + /strip-bom@3.0.0: resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==} engines: {node: '>=4'} dev: true - /strip-bom/4.0.0: + /strip-bom@4.0.0: resolution: {integrity: sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==} engines: {node: '>=8'} dev: true - /strip-final-newline/2.0.0: + /strip-final-newline@2.0.0: resolution: {integrity: sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==} engines: {node: '>=6'} dev: true - /strip-indent/3.0.0: + /strip-indent@3.0.0: resolution: {integrity: sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==} engines: {node: '>=8'} dependencies: min-indent: 1.0.1 dev: true - /strip-json-comments/3.1.1: + /strip-json-comments@3.1.1: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} dev: true - /sucrase/3.32.0: + /sucrase@3.32.0: resolution: {integrity: sha512-ydQOU34rpSyj2TGyz4D2p8rbktIOZ8QY9s+DGLvFU1i5pWJE8vkpruCjGCMHsdXwnD7JDcS+noSwM/a7zyNFDQ==} engines: {node: '>=8'} hasBin: true @@ -5284,7 +5458,7 @@ packages: ts-interface-checker: 0.1.13 dev: true - /superagent/8.0.9: + /superagent@8.0.9: resolution: {integrity: sha512-4C7Bh5pyHTvU33KpZgwrNKh/VQnvgtCSqPRfJAUdmrtSYePVzVg4E4OzsrbkhJj9O7SO6Bnv75K/F8XVZT8YHA==} engines: {node: '>=6.4.0 <13 || >=14'} dependencies: @@ -5302,7 +5476,7 @@ packages: - supports-color dev: true - /supertest/6.3.3: + /supertest@6.3.3: resolution: {integrity: sha512-EMCG6G8gDu5qEqRQ3JjjPs6+FYT1a7Hv5ApHvtSghmOFJYtsU5S+pSb6Y2EUeCEY3CmEL3mmQ8YWlPOzQomabA==} engines: {node: '>=6.4.0'} dependencies: @@ -5312,37 +5486,37 @@ packages: - supports-color dev: true - /supports-color/5.5.0: + /supports-color@5.5.0: resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==} engines: {node: '>=4'} dependencies: has-flag: 3.0.0 dev: true - /supports-color/7.2.0: + /supports-color@7.2.0: resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} engines: {node: '>=8'} dependencies: has-flag: 4.0.0 dev: true - /supports-color/8.1.1: + /supports-color@8.1.1: resolution: {integrity: sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==} engines: {node: '>=10'} dependencies: has-flag: 4.0.0 dev: true - /supports-preserve-symlinks-flag/1.0.0: + /supports-preserve-symlinks-flag@1.0.0: resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==} engines: {node: '>= 0.4'} dev: true - /swagger-ui-dist/4.18.2: + /swagger-ui-dist@4.18.2: resolution: {integrity: sha512-oVBoBl9Dg+VJw8uRWDxlyUyHoNEDC0c1ysT6+Boy6CTgr2rUcLcfPon4RvxgS2/taNW6O0+US+Z/dlAsWFjOAQ==} dev: true - /swagger-ui-express/4.6.2_express@4.18.2: + /swagger-ui-express@4.6.2(express@4.18.2): resolution: {integrity: sha512-MHIOaq9JrTTB3ygUJD+08PbjM5Tt/q7x80yz9VTFIatw8j5uIWKcr90S0h5NLMzFEDC6+eVprtoeA5MDZXCUKQ==} engines: {node: '>= v0.10.32'} peerDependencies: @@ -5352,16 +5526,16 @@ packages: swagger-ui-dist: 4.18.2 dev: true - /symbol-tree/3.2.4: + /symbol-tree@3.2.4: resolution: {integrity: sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==} dev: true - /term-size/2.2.1: + /term-size@2.2.1: resolution: {integrity: sha512-wK0Ri4fOGjv/XPy8SBHZChl8CM7uMc5VML7SqiQ0zG7+J5Vr+RMQDoHa2CNT6KHUnTGIXH34UDMkPzAUyapBZg==} engines: {node: '>=8'} dev: true - /test-exclude/6.0.0: + /test-exclude@6.0.0: resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==} engines: {node: '>=8'} dependencies: @@ -5370,48 +5544,48 @@ packages: minimatch: 3.1.2 dev: true - /thenify-all/1.6.0: + /thenify-all@1.6.0: resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==} engines: {node: '>=0.8'} dependencies: thenify: 3.3.1 dev: true - /thenify/3.3.1: + /thenify@3.3.1: resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==} dependencies: any-promise: 1.3.0 dev: true - /tmp/0.0.33: + /tmp@0.0.33: resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} engines: {node: '>=0.6.0'} dependencies: os-tmpdir: 1.0.2 dev: true - /tmpl/1.0.5: + /tmpl@1.0.5: resolution: {integrity: sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==} dev: true - /to-fast-properties/2.0.0: + /to-fast-properties@2.0.0: resolution: {integrity: sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==} engines: {node: '>=4'} dev: true - /to-regex-range/5.0.1: + /to-regex-range@5.0.1: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} dependencies: is-number: 7.0.0 dev: true - /toidentifier/1.0.1: + /toidentifier@1.0.1: resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==} engines: {node: '>=0.6'} dev: true - /tough-cookie/4.1.2: + /tough-cookie@4.1.2: resolution: {integrity: sha512-G9fqXWoYFZgTc2z8Q5zaHy/vJMjm+WV0AkAeHxVCQiEB1b+dGvWzFW6QV07cY5jQ5gRkeid2qIkzkxUnmoQZUQ==} engines: {node: '>=6'} dependencies: @@ -5421,38 +5595,38 @@ packages: url-parse: 1.5.10 dev: true - /tr46/0.0.3: + /tr46@0.0.3: resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} dev: true - /tr46/1.0.1: + /tr46@1.0.1: resolution: {integrity: sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==} dependencies: punycode: 2.3.0 dev: true - /tr46/3.0.0: + /tr46@3.0.0: resolution: {integrity: sha512-l7FvfAHlcmulp8kr+flpQZmVwtu7nfRV7NZujtN0OqES8EL4O4e0qqzL0DC5gAvx/ZC/9lk6rhcUwYvkBnBnYA==} engines: {node: '>=12'} dependencies: punycode: 2.3.0 dev: true - /tree-kill/1.2.2: + /tree-kill@1.2.2: resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==} hasBin: true dev: true - /trim-newlines/3.0.1: + /trim-newlines@3.0.1: resolution: {integrity: sha512-c1PTsA3tYrIsLGkJkzHF+w9F2EyxfXGo4UyJc4pFL++FMjnq0HJS69T3M7d//gKrFKwy429bouPescbjecU+Zw==} engines: {node: '>=8'} dev: true - /ts-interface-checker/0.1.13: + /ts-interface-checker@0.1.13: resolution: {integrity: sha512-Y/arvbn+rrz3JCKl9C4kVNfTfSm2/mEp5FSz5EsZSANGPSlQrpRI5M4PKF+mJnE52jOO90PnPSc3Ur3bTQw0gA==} dev: true - /ts-jest/29.1.0_sye3n7rnony6rzpy3o3kwkrynm: + /ts-jest@29.1.0(@babel/core@7.21.4)(@jest/types@29.5.0)(esbuild@0.17.14)(jest@29.5.0)(typescript@5.0.4): resolution: {integrity: sha512-ZhNr7Z4PcYa+JjMl62ir+zPiNJfXJN6E8hSLnaUKhOgqcn8vb3e537cpkd0FuAfRK3sR1LSqM1MOhliXNgOFPA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} hasBin: true @@ -5473,10 +5647,12 @@ packages: esbuild: optional: true dependencies: + '@babel/core': 7.21.4 '@jest/types': 29.5.0 bs-logger: 0.2.6 + esbuild: 0.17.14 fast-json-stable-stringify: 2.1.0 - jest: 29.5.0_rrli7kzx2akox3oq6aahu3rvje + jest: 29.5.0(@types/node@18.15.11)(ts-node@10.9.1) jest-util: 29.5.0 json5: 2.2.3 lodash.memoize: 4.1.2 @@ -5486,7 +5662,7 @@ packages: yargs-parser: 21.1.1 dev: true - /ts-node/10.9.1_bhanhq442dy43ncydsavgi4jfi: + /ts-node@10.9.1(@types/node@18.15.11)(typescript@5.0.4): resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} hasBin: true peerDependencies: @@ -5517,7 +5693,7 @@ packages: yn: 3.1.1 dev: true - /tsup/6.7.0_pyqfhkbboucpxgvrs7ocxwodkm: + /tsup@6.7.0(ts-node@10.9.1)(typescript@5.0.4): resolution: {integrity: sha512-L3o8hGkaHnu5TdJns+mCqFsDBo83bJ44rlK7e6VdanIvpea4ArPcU3swWGsLVbXak1PqQx/V+SSmFPujBK+zEQ==} engines: {node: '>=14.18'} hasBin: true @@ -5533,7 +5709,7 @@ packages: typescript: optional: true dependencies: - bundle-require: 4.0.1_esbuild@0.17.14 + bundle-require: 4.0.1(esbuild@0.17.14) cac: 6.7.14 chokidar: 3.5.3 debug: 4.3.4 @@ -5541,7 +5717,7 @@ packages: execa: 5.1.1 globby: 11.1.0 joycon: 3.1.1 - postcss-load-config: 3.1.4_ts-node@10.9.1 + postcss-load-config: 3.1.4(ts-node@10.9.1) resolve-from: 5.0.0 rollup: 3.20.2 source-map: 0.8.0-beta.0 @@ -5553,7 +5729,7 @@ packages: - ts-node dev: true - /tty-table/4.2.1: + /tty-table@4.2.1: resolution: {integrity: sha512-xz0uKo+KakCQ+Dxj1D/tKn2FSyreSYWzdkL/BYhgN6oMW808g8QRMuh1atAV9fjTPbWBjfbkKQpI/5rEcnAc7g==} engines: {node: '>=8.0.0'} hasBin: true @@ -5567,7 +5743,7 @@ packages: yargs: 17.7.1 dev: true - /turbo-darwin-64/1.8.8: + /turbo-darwin-64@1.8.8: resolution: {integrity: sha512-18cSeIm7aeEvIxGyq7PVoFyEnPpWDM/0CpZvXKHpQ6qMTkfNt517qVqUTAwsIYqNS8xazcKAqkNbvU1V49n65Q==} cpu: [x64] os: [darwin] @@ -5575,7 +5751,7 @@ packages: dev: true optional: true - /turbo-darwin-arm64/1.8.8: + /turbo-darwin-arm64@1.8.8: resolution: {integrity: sha512-ruGRI9nHxojIGLQv1TPgN7ud4HO4V8mFBwSgO6oDoZTNuk5ybWybItGR+yu6fni5vJoyMHXOYA2srnxvOc7hjQ==} cpu: [arm64] os: [darwin] @@ -5583,7 +5759,7 @@ packages: dev: true optional: true - /turbo-linux-64/1.8.8: + /turbo-linux-64@1.8.8: resolution: {integrity: sha512-N/GkHTHeIQogXB1/6ZWfxHx+ubYeb8Jlq3b/3jnU4zLucpZzTQ8XkXIAfJG/TL3Q7ON7xQ8yGOyGLhHL7MpFRg==} cpu: [x64] os: [linux] @@ -5591,7 +5767,7 @@ packages: dev: true optional: true - /turbo-linux-arm64/1.8.8: + /turbo-linux-arm64@1.8.8: resolution: {integrity: sha512-hKqLbBHgUkYf2Ww8uBL9UYdBFQ5677a7QXdsFhONXoACbDUPvpK4BKlz3NN7G4NZ+g9dGju+OJJjQP0VXRHb5w==} cpu: [arm64] os: [linux] @@ -5599,7 +5775,7 @@ packages: dev: true optional: true - /turbo-windows-64/1.8.8: + /turbo-windows-64@1.8.8: resolution: {integrity: sha512-2ndjDJyzkNslXxLt+PQuU21AHJWc8f6MnLypXy3KsN4EyX/uKKGZS0QJWz27PeHg0JS75PVvhfFV+L9t9i+Yyg==} cpu: [x64] os: [win32] @@ -5607,7 +5783,7 @@ packages: dev: true optional: true - /turbo-windows-arm64/1.8.8: + /turbo-windows-arm64@1.8.8: resolution: {integrity: sha512-xCA3oxgmW9OMqpI34AAmKfOVsfDljhD5YBwgs0ZDsn5h3kCHhC4x9W5dDk1oyQ4F5EXSH3xVym5/xl1J6WRpUg==} cpu: [arm64] os: [win32] @@ -5615,7 +5791,7 @@ packages: dev: true optional: true - /turbo/1.8.8: + /turbo@1.8.8: resolution: {integrity: sha512-qYJ5NjoTX+591/x09KgsDOPVDUJfU9GoS+6jszQQlLp1AHrf1wRFA3Yps8U+/HTG03q0M4qouOfOLtRQP4QypA==} hasBin: true requiresBuild: true @@ -5628,39 +5804,39 @@ packages: turbo-windows-arm64: 1.8.8 dev: true - /type-check/0.3.2: + /type-check@0.3.2: resolution: {integrity: sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==} engines: {node: '>= 0.8.0'} dependencies: prelude-ls: 1.1.2 dev: true - /type-detect/4.0.8: + /type-detect@4.0.8: resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} engines: {node: '>=4'} dev: true - /type-fest/0.13.1: + /type-fest@0.13.1: resolution: {integrity: sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==} engines: {node: '>=10'} dev: true - /type-fest/0.21.3: + /type-fest@0.21.3: resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} engines: {node: '>=10'} dev: true - /type-fest/0.6.0: + /type-fest@0.6.0: resolution: {integrity: sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==} engines: {node: '>=8'} dev: true - /type-fest/0.8.1: + /type-fest@0.8.1: resolution: {integrity: sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==} engines: {node: '>=8'} dev: true - /type-is/1.6.18: + /type-is@1.6.18: resolution: {integrity: sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==} engines: {node: '>= 0.6'} dependencies: @@ -5668,7 +5844,7 @@ packages: mime-types: 2.1.35 dev: true - /typed-array-length/1.0.4: + /typed-array-length@1.0.4: resolution: {integrity: sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==} dependencies: call-bind: 1.0.2 @@ -5676,17 +5852,17 @@ packages: is-typed-array: 1.1.10 dev: true - /typedarray/0.0.6: + /typedarray@0.0.6: resolution: {integrity: sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==} dev: true - /typescript/5.0.4: + /typescript@5.0.4: resolution: {integrity: sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==} engines: {node: '>=12.20'} hasBin: true dev: true - /unbox-primitive/1.0.2: + /unbox-primitive@1.0.2: resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} dependencies: call-bind: 1.0.2 @@ -5695,22 +5871,22 @@ packages: which-boxed-primitive: 1.0.2 dev: true - /universalify/0.1.2: + /universalify@0.1.2: resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} engines: {node: '>= 4.0.0'} dev: true - /universalify/0.2.0: + /universalify@0.2.0: resolution: {integrity: sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==} engines: {node: '>= 4.0.0'} dev: true - /unpipe/1.0.0: + /unpipe@1.0.0: resolution: {integrity: sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==} engines: {node: '>= 0.8'} dev: true - /update-browserslist-db/1.0.10_browserslist@4.21.5: + /update-browserslist-db@1.0.10(browserslist@4.21.5): resolution: {integrity: sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ==} hasBin: true peerDependencies: @@ -5721,14 +5897,14 @@ packages: picocolors: 1.0.0 dev: true - /url-parse/1.5.10: + /url-parse@1.5.10: resolution: {integrity: sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==} dependencies: querystringify: 2.2.0 requires-port: 1.0.0 dev: true - /use-sync-external-store/1.2.0_react@18.2.0: + /use-sync-external-store@1.2.0(react@18.2.0): resolution: {integrity: sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==} peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 @@ -5736,20 +5912,20 @@ packages: react: 18.2.0 dev: true - /util-deprecate/1.0.2: + /util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} dev: true - /utils-merge/1.0.1: + /utils-merge@1.0.1: resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==} engines: {node: '>= 0.4.0'} dev: true - /v8-compile-cache-lib/3.0.1: + /v8-compile-cache-lib@3.0.1: resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} dev: true - /v8-to-istanbul/9.1.0: + /v8-to-istanbul@9.1.0: resolution: {integrity: sha512-6z3GW9x8G1gd+JIIgQQQxXuiJtCXeAjp6RaPEPLv62mH3iPHPxV6W3robxtCzNErRo6ZwTmzWhsbNvjyEBKzKA==} engines: {node: '>=10.12.0'} dependencies: @@ -5758,63 +5934,63 @@ packages: convert-source-map: 1.9.0 dev: true - /validate-npm-package-license/3.0.4: + /validate-npm-package-license@3.0.4: resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} dependencies: spdx-correct: 3.2.0 spdx-expression-parse: 3.0.1 dev: true - /vary/1.1.2: + /vary@1.1.2: resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} engines: {node: '>= 0.8'} dev: true - /w3c-xmlserializer/4.0.0: + /w3c-xmlserializer@4.0.0: resolution: {integrity: sha512-d+BFHzbiCx6zGfz0HyQ6Rg69w9k19nviJspaj4yNscGjrHu94sVP+aRm75yEbCh+r2/yR+7q6hux9LVtbuTGBw==} engines: {node: '>=14'} dependencies: xml-name-validator: 4.0.0 dev: true - /walker/1.0.8: + /walker@1.0.8: resolution: {integrity: sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==} dependencies: makeerror: 1.0.12 dev: true - /wcwidth/1.0.1: + /wcwidth@1.0.1: resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} dependencies: defaults: 1.0.4 dev: true - /webidl-conversions/3.0.1: + /webidl-conversions@3.0.1: resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==} dev: true - /webidl-conversions/4.0.2: + /webidl-conversions@4.0.2: resolution: {integrity: sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==} dev: true - /webidl-conversions/7.0.0: + /webidl-conversions@7.0.0: resolution: {integrity: sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==} engines: {node: '>=12'} dev: true - /whatwg-encoding/2.0.0: + /whatwg-encoding@2.0.0: resolution: {integrity: sha512-p41ogyeMUrw3jWclHWTQg1k05DSVXPLcVxRTYsXUk+ZooOCZLcoYgPZ/HL/D/N+uQPOtcp1me1WhBEaX02mhWg==} engines: {node: '>=12'} dependencies: iconv-lite: 0.6.3 dev: true - /whatwg-mimetype/3.0.0: + /whatwg-mimetype@3.0.0: resolution: {integrity: sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==} engines: {node: '>=12'} dev: true - /whatwg-url/11.0.0: + /whatwg-url@11.0.0: resolution: {integrity: sha512-RKT8HExMpoYx4igMiVMY83lN6UeITKJlBQ+vR/8ZJ8OCdSiN3RwCq+9gH0+Xzj0+5IrM6i4j/6LuvzbZIQgEcQ==} engines: {node: '>=12'} dependencies: @@ -5822,14 +5998,14 @@ packages: webidl-conversions: 7.0.0 dev: true - /whatwg-url/5.0.0: + /whatwg-url@5.0.0: resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==} dependencies: tr46: 0.0.3 webidl-conversions: 3.0.1 dev: true - /whatwg-url/7.1.0: + /whatwg-url@7.1.0: resolution: {integrity: sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==} dependencies: lodash.sortby: 4.7.0 @@ -5837,7 +6013,7 @@ packages: webidl-conversions: 4.0.2 dev: true - /which-boxed-primitive/1.0.2: + /which-boxed-primitive@1.0.2: resolution: {integrity: sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==} dependencies: is-bigint: 1.0.4 @@ -5847,7 +6023,7 @@ packages: is-symbol: 1.0.4 dev: true - /which-collection/1.0.1: + /which-collection@1.0.1: resolution: {integrity: sha512-W8xeTUwaln8i3K/cY1nGXzdnVZlidBcagyNFtBdD5kxnb4TvGKR7FfSIS3mYpwWS1QUCutfKz8IY8RjftB0+1A==} dependencies: is-map: 2.0.2 @@ -5856,11 +6032,11 @@ packages: is-weakset: 2.0.2 dev: true - /which-module/2.0.0: + /which-module@2.0.0: resolution: {integrity: sha512-B+enWhmw6cjfVC7kS8Pj9pCrKSc5txArRyaYGe088shv/FGWH+0Rjx/xPgtsWfsUtS27FkP697E4DDhgrgoc0Q==} dev: true - /which-pm/2.0.0: + /which-pm@2.0.0: resolution: {integrity: sha512-Lhs9Pmyph0p5n5Z3mVnN0yWcbQYUAD7rbQUiMsQxOJ3T57k7RFe35SUwWMf7dsbDZks1uOmw4AecB/JMDj3v/w==} engines: {node: '>=8.15'} dependencies: @@ -5868,7 +6044,7 @@ packages: path-exists: 4.0.0 dev: true - /which-typed-array/1.1.9: + /which-typed-array@1.1.9: resolution: {integrity: sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==} engines: {node: '>= 0.4'} dependencies: @@ -5880,14 +6056,14 @@ packages: is-typed-array: 1.1.10 dev: true - /which/1.3.1: + /which@1.3.1: resolution: {integrity: sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==} hasBin: true dependencies: isexe: 2.0.0 dev: true - /which/2.0.2: + /which@2.0.2: resolution: {integrity: sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==} engines: {node: '>= 8'} hasBin: true @@ -5895,12 +6071,12 @@ packages: isexe: 2.0.0 dev: true - /word-wrap/1.2.3: + /word-wrap@1.2.3: resolution: {integrity: sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==} engines: {node: '>=0.10.0'} dev: true - /wrap-ansi/6.2.0: + /wrap-ansi@6.2.0: resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==} engines: {node: '>=8'} dependencies: @@ -5909,7 +6085,7 @@ packages: strip-ansi: 6.0.1 dev: true - /wrap-ansi/7.0.0: + /wrap-ansi@7.0.0: resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==} engines: {node: '>=10'} dependencies: @@ -5918,11 +6094,11 @@ packages: strip-ansi: 6.0.1 dev: true - /wrappy/1.0.2: + /wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} dev: true - /write-file-atomic/4.0.2: + /write-file-atomic@4.0.2: resolution: {integrity: sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg==} engines: {node: ^12.13.0 || ^14.15.0 || >=16.0.0} dependencies: @@ -5930,7 +6106,7 @@ packages: signal-exit: 3.0.7 dev: true - /ws/8.13.0: + /ws@8.13.0: resolution: {integrity: sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==} engines: {node: '>=10.0.0'} peerDependencies: @@ -5943,47 +6119,47 @@ packages: optional: true dev: true - /xml-name-validator/4.0.0: + /xml-name-validator@4.0.0: resolution: {integrity: sha512-ICP2e+jsHvAj2E2lIHxa5tjXRlKDJo4IdvPvCXbXQGdzSfmSpNVyIKMvoZHjDY9DP0zV17iI85o90vRFXNccRw==} engines: {node: '>=12'} dev: true - /xmlchars/2.2.0: + /xmlchars@2.2.0: resolution: {integrity: sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==} dev: true - /xtend/4.0.2: + /xtend@4.0.2: resolution: {integrity: sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==} engines: {node: '>=0.4'} dev: true - /y18n/4.0.3: + /y18n@4.0.3: resolution: {integrity: sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==} dev: true - /y18n/5.0.8: + /y18n@5.0.8: resolution: {integrity: sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==} engines: {node: '>=10'} dev: true - /yallist/2.1.2: + /yallist@2.1.2: resolution: {integrity: sha512-ncTzHV7NvsQZkYe1DW7cbDLm0YpzHmZF5r/iyP3ZnQtMiJ+pjzisCiMNI+Sj+xQF5pXhSHxSB3uDbsBTzY/c2A==} dev: true - /yallist/3.1.1: + /yallist@3.1.1: resolution: {integrity: sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==} dev: true - /yallist/4.0.0: + /yallist@4.0.0: resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} dev: true - /yaml/1.10.2: + /yaml@1.10.2: resolution: {integrity: sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==} engines: {node: '>= 6'} dev: true - /yargs-parser/18.1.3: + /yargs-parser@18.1.3: resolution: {integrity: sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==} engines: {node: '>=6'} dependencies: @@ -5991,12 +6167,12 @@ packages: decamelize: 1.2.0 dev: true - /yargs-parser/21.1.1: + /yargs-parser@21.1.1: resolution: {integrity: sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==} engines: {node: '>=12'} dev: true - /yargs/15.4.1: + /yargs@15.4.1: resolution: {integrity: sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==} engines: {node: '>=8'} dependencies: @@ -6013,7 +6189,7 @@ packages: yargs-parser: 18.1.3 dev: true - /yargs/17.7.1: + /yargs@17.7.1: resolution: {integrity: sha512-cwiTb08Xuv5fqF4AovYacTFNxk62th7LKJ6BL9IGUpTJrWoU7/7WdQGTP2SjKf1dUNBGzDd28p/Yfs/GI6JrLw==} engines: {node: '>=12'} dependencies: @@ -6026,17 +6202,17 @@ packages: yargs-parser: 21.1.1 dev: true - /yn/3.1.1: + /yn@3.1.1: resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} engines: {node: '>=6'} dev: true - /yocto-queue/0.1.0: + /yocto-queue@0.1.0: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} engines: {node: '>=10'} dev: true - /zod-to-json-schema/3.20.4_zod@3.21.4: + /zod-to-json-schema@3.20.4(zod@3.21.4): resolution: {integrity: sha512-Un9+kInJ2Zt63n6Z7mLqBifzzPcOyX+b+Exuzf7L1+xqck9Q2EPByyTRduV3kmSPaXaRer1JCsucubpgL1fipg==} peerDependencies: zod: ^3.20.0 @@ -6044,5 +6220,5 @@ packages: zod: 3.21.4 dev: false - /zod/3.21.4: + /zod@3.21.4: resolution: {integrity: sha512-m46AKbrzKVzOzs/DZgVnG5H55N1sv1M8qZU3A8RIKbs3mrACDNeIOeilDymVb2HdmP8uwshOCF4uJ8uM9rCqJw==} From c0fc97446ccd6b62bdca8b5d5d010dc69f39720c Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sun, 6 Aug 2023 18:28:51 +0200 Subject: [PATCH 136/206] chore(fetch-batch): add lbuild --- packages/fetch-batch/package.json | 36 +++++- packages/fetch-batch/src/batching.test.ts | 4 +- packages/fetch-batch/src/batching.ts | 14 +-- packages/fetch-batch/tsconfig.build.json | 16 +++ packages/fetch-batch/tsconfig.json | 127 ++++------------------ packages/fetch-batch/tsup.config.js | 14 +++ 6 files changed, 89 insertions(+), 122 deletions(-) create mode 100644 packages/fetch-batch/tsconfig.build.json create mode 100644 packages/fetch-batch/tsup.config.js diff --git a/packages/fetch-batch/package.json b/packages/fetch-batch/package.json index 3c90709b..f9d7fcc3 100644 --- a/packages/fetch-batch/package.json +++ b/packages/fetch-batch/package.json @@ -1,16 +1,40 @@ { "name": "@zodios/fetch-batch", - "version": "1.0.0", - "description": "", - "main": "index.js", + "version": "11.0.0-beta.19", + "main": "lib/index.js", + "module": "lib/index.mjs", + "typings": "lib/index.d.ts", + "exports": { + ".": { + "import": "./lib/index.mjs", + "require": "./lib/index.js", + "types": "./lib/index.d.ts" + }, + "./package.json": "./package.json" + }, + "files": [ + "lib" + ], + "author": { + "name": "ecyrbe", + "email": "ecyrbe@gmail.com" + }, + "homepage": "https://github.com/ecyrbe/zodios", + "repository": { + "type": "git", + "url": "https://github.com/ecyrbe/zodios.git" + }, + "license": "MIT", + "keywords": [ + "zodios", + "mock", + "testing" + ], "scripts": { "prebuild": "rimraf lib", "build": "tsup", "test": "jest --coverage" }, - "keywords": [], - "author": "", - "license": "ISC", "devDependencies": { "@jest/globals": "29.5.0", "@jest/types": "29.5.0", diff --git a/packages/fetch-batch/src/batching.test.ts b/packages/fetch-batch/src/batching.test.ts index 60b03514..08826b97 100644 --- a/packages/fetch-batch/src/batching.test.ts +++ b/packages/fetch-batch/src/batching.test.ts @@ -25,8 +25,8 @@ describe("BatchData", () => { port = (server.address() as AddressInfo).port; }); - afterAll(() => { - server.close(); + afterAll((done) => { + server.close(done); }); it("should be able to batch requests", async () => { diff --git a/packages/fetch-batch/src/batching.ts b/packages/fetch-batch/src/batching.ts index af2e3e43..c95b78b9 100644 --- a/packages/fetch-batch/src/batching.ts +++ b/packages/fetch-batch/src/batching.ts @@ -34,7 +34,7 @@ export class BatchData { }); } - formatHeaders(headers: Headers) { + #formatHeaders(headers: Headers) { let result = ""; for (const [name, value] of headers) { result += `${name}: ${value}\r\n`; @@ -43,19 +43,19 @@ export class BatchData { return result; } - *encodePart(contentId: string) { + *#encodePart(contentId: string) { const headers = new Headers(); headers.set("Content-ID", `<${contentId}>`); headers.set("Content-Type", "application/http; msgtype=request"); - yield this.#encoder.encode(this.formatHeaders(headers)); + yield this.#encoder.encode(this.#formatHeaders(headers)); } - async *encodeRequest(request: Request) { + async *#encodeRequest(request: Request) { const url = new URL(request.url); yield this.#encoder.encode( `${request.method} ${url.pathname}${url.search}${url.hash} HTTP/1.1\r\n` ); - yield this.#encoder.encode(this.formatHeaders(request.headers)); + yield this.#encoder.encode(this.#formatHeaders(request.headers)); if (request.body) { const reader = request.body.getReader(); while (true) { @@ -74,8 +74,8 @@ export class BatchData { for (const [contentId, request] of this.#requests) { yield boundary; - yield* this.encodePart(contentId); - yield* this.encodeRequest(request); + yield* this.#encodePart(contentId); + yield* this.#encodeRequest(request); yield this.#encoder.encode("\r\n"); } yield boundaryClose; diff --git a/packages/fetch-batch/tsconfig.build.json b/packages/fetch-batch/tsconfig.build.json new file mode 100644 index 00000000..2bfb6f53 --- /dev/null +++ b/packages/fetch-batch/tsconfig.build.json @@ -0,0 +1,16 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "target": "ES2020", + "sourceMap": false + }, + "exclude": [ + "node_modules", + "lib", + "examples", + "**/*.config.ts", + "**/*.spec.ts", + "**/*.test.ts", + "**/*.d.ts" + ] +} diff --git a/packages/fetch-batch/tsconfig.json b/packages/fetch-batch/tsconfig.json index 523cf7bb..fab9c4ab 100644 --- a/packages/fetch-batch/tsconfig.json +++ b/packages/fetch-batch/tsconfig.json @@ -1,109 +1,22 @@ { "compilerOptions": { - /* Visit https://aka.ms/tsconfig to read more about this file */ - - /* Projects */ - // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ - // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ - // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ - // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ - // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ - // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ - - /* Language and Environment */ - "target": "ES2020" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */, - // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ - // "jsx": "preserve", /* Specify what JSX code is generated. */ - // "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ - // "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ - // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ - // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ - // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ - // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ - // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ - // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ - // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ - - /* Modules */ - "module": "commonjs" /* Specify what module code is generated. */, - // "rootDir": "./", /* Specify the root folder within your source files. */ - // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ - // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ - // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ - // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ - // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ - // "types": [], /* Specify type package names to be included without being referenced in a source file. */ - // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ - // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ - // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */ - // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ - // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ - // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ - // "resolveJsonModule": true, /* Enable importing .json files. */ - // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ - // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ - - /* JavaScript Support */ - // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ - // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ - // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ - - /* Emit */ - "declaration": true /* Generate .d.ts files from TypeScript and JavaScript files in your project. */, - // "declarationMap": true, /* Create sourcemaps for d.ts files. */ - // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ - // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ - // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ - // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ - "outDir": "./build" /* Specify an output folder for all emitted files. */, - // "removeComments": true, /* Disable emitting comments. */ - // "noEmit": true, /* Disable emitting files from a compilation. */ - // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ - // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ - // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ - // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ - // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ - // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ - // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ - // "newLine": "crlf", /* Set the newline character for emitting files. */ - // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ - // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ - // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ - // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ - // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ - // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ - - /* Interop Constraints */ - // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ - // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */ - // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ - "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */, - // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ - "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */, - - /* Type Checking */ - "strict": true /* Enable all strict type-checking options. */, - // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ - // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ - // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ - // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ - // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ - // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ - // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ - // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ - // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ - // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ - // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ - // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ - // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ - // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ - // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ - // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ - // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ - // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ - - /* Completeness */ - // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ - "skipLibCheck": true /* Skip type checking all .d.ts files. */ - } -} + "target": "ES2020", + "module": "CommonJS", + "moduleResolution": "Node", + "outDir": "./lib", + "alwaysStrict": true, + "strict": true, + "esModuleInterop": true, + "sourceMap": true, + "declaration": true, + "jsx": "react-jsx", + "types": [ + "jest", + "node" + ] + }, + "exclude": [ + "node_modules", + "lib" + ] +} \ No newline at end of file diff --git a/packages/fetch-batch/tsup.config.js b/packages/fetch-batch/tsup.config.js new file mode 100644 index 00000000..899d5e3f --- /dev/null +++ b/packages/fetch-batch/tsup.config.js @@ -0,0 +1,14 @@ +import { defineConfig } from "tsup"; + +export default defineConfig({ + clean: true, + dts: true, + entry: ["src/index.ts"], + outDir: "lib", + format: ["cjs", "esm"], + minify: true, + treeshake: true, + tsconfig: "tsconfig.build.json", + splitting: true, + sourcemap: false, +}); From 6207e8636858644f46e6a12cdb8be54ebc355c7a Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sun, 6 Aug 2023 19:04:31 +0200 Subject: [PATCH 137/206] chore(fetch-batch): rename batching --- .../fetch-batch/src/{batching.test.ts => batch-data.test.ts} | 2 +- packages/fetch-batch/src/{batching.ts => batch-data.ts} | 0 packages/fetch-batch/src/index.ts | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename packages/fetch-batch/src/{batching.test.ts => batch-data.test.ts} (97%) rename packages/fetch-batch/src/{batching.ts => batch-data.ts} (100%) diff --git a/packages/fetch-batch/src/batching.test.ts b/packages/fetch-batch/src/batch-data.test.ts similarity index 97% rename from packages/fetch-batch/src/batching.test.ts rename to packages/fetch-batch/src/batch-data.test.ts index 08826b97..a5759098 100644 --- a/packages/fetch-batch/src/batching.test.ts +++ b/packages/fetch-batch/src/batch-data.test.ts @@ -1,6 +1,6 @@ import express from "express"; import type { AddressInfo } from "net"; -import { BatchData } from "./batching"; +import { BatchData } from "./batch-data"; describe("BatchData", () => { let app: express.Express; diff --git a/packages/fetch-batch/src/batching.ts b/packages/fetch-batch/src/batch-data.ts similarity index 100% rename from packages/fetch-batch/src/batching.ts rename to packages/fetch-batch/src/batch-data.ts diff --git a/packages/fetch-batch/src/index.ts b/packages/fetch-batch/src/index.ts index 7ec7a2f0..ddf9ad44 100644 --- a/packages/fetch-batch/src/index.ts +++ b/packages/fetch-batch/src/index.ts @@ -1 +1 @@ -export { BatchData } from "./batching"; +export { BatchData } from "./batch-data"; From 91c737c9f55ca40a80ef1b20d2e7e8dd6ad24990 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sun, 6 Aug 2023 19:40:16 +0200 Subject: [PATCH 138/206] feat(fetch-batch): add helpers to BatchData --- packages/fetch-batch/src/batch-data.ts | 48 ++++++++++++++++++++++++-- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/packages/fetch-batch/src/batch-data.ts b/packages/fetch-batch/src/batch-data.ts index c95b78b9..f3ffcd11 100644 --- a/packages/fetch-batch/src/batch-data.ts +++ b/packages/fetch-batch/src/batch-data.ts @@ -1,3 +1,9 @@ +type BatchDataForeachCallback = ( + request: Request, + contentId: string, + batchdata: BatchData +) => void; + export class BatchData { #requests = new Map(); #contentIdSuffix = `${Date.now()}@zodios.org`; @@ -20,8 +26,46 @@ export class BatchData { return headers; } + [Symbol.iterator]() { + return this.#requests.entries(); + } + + hasRequest(contentId: string) { + return this.#requests.has(contentId); + } + + requests() { + return this.#requests.values(); + } + + contentIds() { + return this.#requests.keys(); + } + + entries() { + return this.#requests.entries(); + } + + getRequest(contentId: string) { + return this.#requests.get(contentId); + } + + forEach(callback: BatchDataForeachCallback) { + this.#requests.forEach((request, contentId) => + callback(request, contentId, this) + ); + } + + find(request: Request) { + for (const [contentId, req] of this.#requests.entries()) { + if (req === request) { + return contentId; + } + } + } + stream() { - const iterator = this[Symbol.asyncIterator](); + const iterator = this.#encodedIterator(); return new ReadableStream({ async pull(controller) { const { value, done } = await iterator.next(); @@ -68,7 +112,7 @@ export class BatchData { } } - async *[Symbol.asyncIterator]() { + async *#encodedIterator() { const boundary = this.#encoder.encode(`--${this.#boundary}\r\n`); const boundaryClose = this.#encoder.encode(`--${this.#boundary}--\r\n`); From 32cb3e1fcffb0521a59bb2f655fb20194f38e149 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sun, 6 Aug 2023 19:42:36 +0200 Subject: [PATCH 139/206] refactor(fetch-batch): rename snapshot --- .../{batching.test.ts.snap => batch-data.test.ts.snap} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename packages/fetch-batch/src/__snapshots__/{batching.test.ts.snap => batch-data.test.ts.snap} (100%) diff --git a/packages/fetch-batch/src/__snapshots__/batching.test.ts.snap b/packages/fetch-batch/src/__snapshots__/batch-data.test.ts.snap similarity index 100% rename from packages/fetch-batch/src/__snapshots__/batching.test.ts.snap rename to packages/fetch-batch/src/__snapshots__/batch-data.test.ts.snap From 93f76c3fb9483041c08110920846813f4a6a0ce7 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sun, 6 Aug 2023 19:44:58 +0200 Subject: [PATCH 140/206] feat(fetch-batch): expose boundary getter --- packages/fetch-batch/src/batch-data.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/fetch-batch/src/batch-data.ts b/packages/fetch-batch/src/batch-data.ts index f3ffcd11..4b92eafa 100644 --- a/packages/fetch-batch/src/batch-data.ts +++ b/packages/fetch-batch/src/batch-data.ts @@ -12,6 +12,10 @@ export class BatchData { constructor() {} + get boundary() { + return this.#boundary; + } + addRequest(request: Request) { const contentId = `request-${this.#requests.size + 1}-${ this.#contentIdSuffix From a09f2454973f8175df8560a203ccbf9aee7a0018 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Mon, 7 Aug 2023 02:46:22 +0200 Subject: [PATCH 141/206] feat(fetch-batch): add KMP algorithms to handle Uint8Array --- packages/fetch-batch/src/utils.test.ts | 170 +++++++++++++++++++++++++ packages/fetch-batch/src/utils.ts | 129 +++++++++++++++++++ 2 files changed, 299 insertions(+) create mode 100644 packages/fetch-batch/src/utils.test.ts create mode 100644 packages/fetch-batch/src/utils.ts diff --git a/packages/fetch-batch/src/utils.test.ts b/packages/fetch-batch/src/utils.test.ts new file mode 100644 index 00000000..9a55151d --- /dev/null +++ b/packages/fetch-batch/src/utils.test.ts @@ -0,0 +1,170 @@ +import { findIndexOf, findAllIndexOf, getLPS, concat } from "./utils"; + +describe("utils", () => { + describe("concat", () => { + it("should concat two arrays", () => { + let a = new Uint8Array([1, 2, 3]); + let b = new Uint8Array([4, 5, 6]); + let result = concat([a, b]); + expect(result).toEqual(new Uint8Array([1, 2, 3, 4, 5, 6])); + }); + + it("should concat three arrays", () => { + let a = new Uint8Array([1, 2, 3]); + let b = new Uint8Array([4, 5, 6]); + let c = new Uint8Array([7, 8, 9]); + let result = concat([a, b, c]); + expect(result).toEqual(new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8, 9])); + }); + + it("should concat empty arrays", () => { + let a = new Uint8Array([]); + let b = new Uint8Array([]); + let result = concat([a, b]); + expect(result).toEqual(new Uint8Array([])); + }); + + it("should concat empty array with non-empty array", () => { + let a = new Uint8Array([]); + let b = new Uint8Array([1, 2, 3]); + let result = concat([a, b]); + expect(result).toEqual(new Uint8Array([1, 2, 3])); + }); + }); + + describe("Knuth-Morris-Pratt algorithm", () => { + describe("findIndexOf", () => { + it("should match simple pattern", () => { + let text = new Uint8Array([1, 2, 3, 4, 5, 6, 7]); + let pattern = new Uint8Array([2, 3, 4]); + let result = findIndexOf(text, pattern); + expect(result).toBe(1); + }); + + it("should match pattern at the end", () => { + let text = new Uint8Array([1, 2, 3, 4, 5, 6, 7]); + let pattern = new Uint8Array([6, 7]); + let result = findIndexOf(text, pattern); + expect(result).toBe(5); + }); + + it("should match pattern at the beginning", () => { + let text = new Uint8Array([1, 2, 3, 4, 5, 6, 7]); + let pattern = new Uint8Array([1, 2]); + let result = findIndexOf(text, pattern); + expect(result).toBe(0); + }); + + it("should match first when pattern appears more than once", () => { + let text = new Uint8Array([3, 4, 5, 1, 2, 6, 7, 1, 2]); + let pattern = new Uint8Array([1, 2]); + let result = findIndexOf(text, pattern); + expect(result).toBe(3); + }); + + it("should match long pattern and text almost matches multiple times", () => { + let text = new Uint8Array([ + 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 7, 1, 3, 4, + 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 1, 3, 4, 5, + ]); + let pattern = new Uint8Array([1, 2, 3, 4, 5, 6, 7, 1, 3]); + let result = findIndexOf(text, pattern); + expect(result).toEqual(13); + }); + + it("should not match when pattern not in source", () => { + let text = new Uint8Array([1, 2, 3, 4, 5, 6, 7]); + let pattern = new Uint8Array([8, 9]); + let result = findIndexOf(text, pattern); + expect(result).toBe(-1); + }); + }); + + describe("findAllIndexOf", () => { + it("should match simple pattern", () => { + let text = new Uint8Array([1, 2, 3, 4, 5, 6, 7]); + let pattern = new Uint8Array([2, 3, 4]); + let result = findAllIndexOf(text, pattern); + expect(result).toEqual([1]); + }); + + it("should match pattern at the end", () => { + let text = new Uint8Array([1, 2, 3, 4, 5, 6, 7]); + let pattern = new Uint8Array([6, 7]); + let result = findAllIndexOf(text, pattern); + expect(result).toEqual([5]); + }); + + it("should match pattern at the beginning", () => { + let text = new Uint8Array([1, 2, 3, 4, 5, 6, 7]); + let pattern = new Uint8Array([1, 2]); + let result = findAllIndexOf(text, pattern); + expect(result).toEqual([0]); + }); + + it("should match multiple occurrences", () => { + let text = new Uint8Array([3, 4, 5, 1, 2, 6, 7, 1, 2]); + let pattern = new Uint8Array([1, 2]); + let result = findAllIndexOf(text, pattern); + expect(result).toEqual([3, 7]); + }); + + it("should match overlapping occurrences", () => { + let text = new Uint8Array([1, 2, 1, 2, 1, 2]); + let pattern = new Uint8Array([1, 2, 1, 2]); + let result = findAllIndexOf(text, pattern); + expect(result).toEqual([0, 2]); + }); + + it("should match overlapping occurrences at the end", () => { + let text = new Uint8Array([1, 2, 1, 2, 1, 2]); + let pattern = new Uint8Array([1, 2, 1]); + let result = findAllIndexOf(text, pattern); + expect(result).toEqual([0, 2]); + }); + + it("should match long pattern and text almost matches multiple times", () => { + let text = new Uint8Array([ + 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 7, 1, 3, 4, + 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 1, 3, 4, 5, + ]); + let pattern = new Uint8Array([1, 2, 3, 4, 5, 6, 7, 1, 3]); + let result = findAllIndexOf(text, pattern); + expect(result).toEqual([13, 26]); + }); + + it("should not match when pattern not in source", () => { + let text = new Uint8Array([1, 2, 3, 4, 5, 6, 7]); + let pattern = new Uint8Array([8, 9]); + let result = findAllIndexOf(text, pattern); + expect(result).toEqual([]); + }); + }); + + describe("getLSP", () => { + it("should return one item 0 array for empty pattern", () => { + let pattern = new Uint8Array([]); + let result = getLPS(pattern); + expect(result).toEqual([0]); + }); + + it("should return zero filled array for pattern without repeated sequences", () => { + let pattern = new Uint8Array([1, 2, 3, 4, 5, 6, 7]); + let result = getLPS(pattern); + expect(result).toEqual([0, 0, 0, 0, 0, 0, 0]); + }); + + it("should return non zero filled array for pattern with repeated sequences", () => { + let pattern = new Uint8Array([1, 2, 1, 2, 1, 2]); + let result = getLPS(pattern); + expect(result).toEqual([0, 0, 1, 2, 3, 4]); + }); + + it("should return non zero filled array for pattern with repeated sequences within repeated sequences", () => { + let pattern = new Uint8Array([1, 2, 1, 2, 1, 2, 3, 2]); + let result = getLPS(pattern); + expect(result).toEqual([0, 0, 1, 2, 3, 4, 0, 0]); + }); + }); + }); +}); diff --git a/packages/fetch-batch/src/utils.ts b/packages/fetch-batch/src/utils.ts new file mode 100644 index 00000000..9f91b591 --- /dev/null +++ b/packages/fetch-batch/src/utils.ts @@ -0,0 +1,129 @@ +export function concat(arrays: Uint8Array[]) { + let length = 0; + for (const arr of arrays) { + length += arr.length; + } + const result = new Uint8Array(length); + let offset = 0; + for (const arr of arrays) { + result.set(arr, offset); + offset += arr.length; + } + return result; +} + +/** + * Knuth-Morris-Pratt algorithm that finds all occurrences of pattern in a Uint8Array + * + * complexity: O(n + m) where n is the length of text and m is the length of pattern + * + * The algorithm is based on the fact that when a mismatch occurs, the pattern itself + * embodies sufficient information to determine where the next match could begin, thus + * bypassing re-examination of previously matched characters. + * + * The algorithm is described in detail here: https://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm + * + * @param source - the array to search in + * @param pattern - the pattern to search for + * @returns the array of indices where the pattern occurs in the source array + */ +export function findAllIndexOf( + source: Uint8Array, + pattern: Uint8Array +): number[] { + const result: number[] = []; + let i = 0; + let j = 0; + const patternLength = pattern.length; + const srcLength = source.length; + const lps = getLPS(pattern); + while (i < srcLength) { + if (pattern[j] === source[i]) { + j++; + i++; + } + if (j === patternLength) { + result.push(i - j); + j = lps[j - 1]; + } else if (i < srcLength && pattern[j] !== source[i]) { + if (j !== 0) { + j = lps[j - 1]; + } else { + i++; + } + } + } + return result; +} + +/** + * Knuth-Morris-Pratt algorithm that finds the first occurrence of pattern in a Uint8Array + * + * complexity: O(n + m) where n is the length of text and m is the length of pattern + * + * The algorithm is based on the fact that when a mismatch occurs, the pattern itself + * embodies sufficient information to determine where the next match could begin, thus + * bypassing re-examination of previously matched characters. + * + * The algorithm is described in detail here: https://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm + * + * @param source - the array to search in + * @param pattern - the pattern to search for + * @returns the index where the pattern occurs in the source array or -1 if it does not occur + */ +export function findIndexOf(source: Uint8Array, pattern: Uint8Array): number { + let i = 0; + let j = 0; + const patternLength = pattern.length; + const srcLength = source.length; + const lps = getLPS(pattern); + while (i < srcLength) { + if (pattern[j] === source[i]) { + j++; + i++; + } + if (j === patternLength) { + return i - j; + } else if (i < srcLength && pattern[j] !== source[i]) { + if (j !== 0) { + j = lps[j - 1]; + } else { + i++; + } + } + } + return -1; +} + +/** + * Knuth-Morris-Pratt algorithm to compute the longest prefix that is also a suffix + * + * complexity: O(m) where m is the length of pattern + * + * The longest prefix that is also a suffix is used to determine where the next match + * could begin, thus bypassing re-examination of previously matched characters. + * + * The algorithm is described in detail here: https://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm + * + * @param pattern - the pattern to search for + * @returns an array of length where the value at index i is the length of the longest prefix that is also a suffix of pattern[0..i] + */ +export function getLPS(pattern: Uint8Array): number[] { + const result = [0]; + let len = 0; + let i = 1; + const length = pattern.length; + while (i < length) { + if (pattern[i] === pattern[len]) { + len++; + result[i] = len; + i++; + } else if (len !== 0) { + len = result[len - 1]; + } else { + result[i] = 0; + i++; + } + } + return result; +} From fdaa34cc00b27ced971ee3668ec76710a4515c9d Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Mon, 7 Aug 2023 03:18:21 +0200 Subject: [PATCH 142/206] test(fetch-batch): add more tests --- packages/fetch-batch/src/utils.test.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/packages/fetch-batch/src/utils.test.ts b/packages/fetch-batch/src/utils.test.ts index 9a55151d..c93e09d1 100644 --- a/packages/fetch-batch/src/utils.test.ts +++ b/packages/fetch-batch/src/utils.test.ts @@ -62,6 +62,16 @@ describe("utils", () => { expect(result).toBe(3); }); + it("should match first when pattern is self repeating", () => { + let text = new Uint8Array([ + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, + 1, + ]); + let pattern = new Uint8Array([1, 1, 1]); + let result = findIndexOf(text, pattern); + expect(result).toBe(10); + }); + it("should match long pattern and text almost matches multiple times", () => { let text = new Uint8Array([ 1, 2, 3, 4, 5, 6, 7, 1, 2, 3, 4, 5, 6, 1, 2, 3, 4, 5, 6, 7, 1, 3, 4, @@ -133,6 +143,16 @@ describe("utils", () => { expect(result).toEqual([13, 26]); }); + it("should match first when pattern is self repeating", () => { + let text = new Uint8Array([ + 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, + 1, + ]); + let pattern = new Uint8Array([1, 1, 1]); + let result = findAllIndexOf(text, pattern); + expect(result).toEqual([10, 16, 17, 18, 19, 20, 21]); + }); + it("should not match when pattern not in source", () => { let text = new Uint8Array([1, 2, 3, 4, 5, 6, 7]); let pattern = new Uint8Array([8, 9]); From 665154f3205ea32265487dd3c7a7cf5b8e042d6b Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Mon, 7 Aug 2023 11:31:38 +0200 Subject: [PATCH 143/206] refactor(fetch-batch): better naming --- packages/fetch-batch/src/utils.ts | 50 +++++++++++++++---------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/packages/fetch-batch/src/utils.ts b/packages/fetch-batch/src/utils.ts index 9f91b591..f77946a1 100644 --- a/packages/fetch-batch/src/utils.ts +++ b/packages/fetch-batch/src/utils.ts @@ -33,21 +33,21 @@ export function findAllIndexOf( ): number[] { const result: number[] = []; let i = 0; - let j = 0; + let matchingLength = 0; const patternLength = pattern.length; const srcLength = source.length; const lps = getLPS(pattern); while (i < srcLength) { - if (pattern[j] === source[i]) { - j++; + if (pattern[matchingLength] === source[i]) { + matchingLength++; i++; } - if (j === patternLength) { - result.push(i - j); - j = lps[j - 1]; - } else if (i < srcLength && pattern[j] !== source[i]) { - if (j !== 0) { - j = lps[j - 1]; + if (matchingLength === patternLength) { + result.push(i - matchingLength); + matchingLength = lps[matchingLength - 1]; + } else if (i < srcLength && pattern[matchingLength] !== source[i]) { + if (matchingLength !== 0) { + matchingLength = lps[matchingLength - 1]; } else { i++; } @@ -73,20 +73,20 @@ export function findAllIndexOf( */ export function findIndexOf(source: Uint8Array, pattern: Uint8Array): number { let i = 0; - let j = 0; + let matchingLength = 0; const patternLength = pattern.length; const srcLength = source.length; const lps = getLPS(pattern); while (i < srcLength) { - if (pattern[j] === source[i]) { - j++; + if (pattern[matchingLength] === source[i]) { + matchingLength++; i++; } - if (j === patternLength) { - return i - j; - } else if (i < srcLength && pattern[j] !== source[i]) { - if (j !== 0) { - j = lps[j - 1]; + if (matchingLength === patternLength) { + return i - matchingLength; + } else if (i < srcLength && pattern[matchingLength] !== source[i]) { + if (matchingLength !== 0) { + matchingLength = lps[matchingLength - 1]; } else { i++; } @@ -110,16 +110,16 @@ export function findIndexOf(source: Uint8Array, pattern: Uint8Array): number { */ export function getLPS(pattern: Uint8Array): number[] { const result = [0]; - let len = 0; + let selfMatchingLength = 0; let i = 1; - const length = pattern.length; - while (i < length) { - if (pattern[i] === pattern[len]) { - len++; - result[i] = len; + const patternLength = pattern.length; + while (i < patternLength) { + if (pattern[i] === pattern[selfMatchingLength]) { + selfMatchingLength++; + result[i] = selfMatchingLength; i++; - } else if (len !== 0) { - len = result[len - 1]; + } else if (selfMatchingLength !== 0) { + selfMatchingLength = result[selfMatchingLength - 1]; } else { result[i] = 0; i++; From eb47ffde241513e63fb20b497d84c8fa4a3f9b4e Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Mon, 7 Aug 2023 12:06:48 +0200 Subject: [PATCH 144/206] feat(batch): release lock on reader when finished --- packages/fetch-batch/src/batch-data.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/fetch-batch/src/batch-data.ts b/packages/fetch-batch/src/batch-data.ts index 4b92eafa..033b37cd 100644 --- a/packages/fetch-batch/src/batch-data.ts +++ b/packages/fetch-batch/src/batch-data.ts @@ -109,6 +109,7 @@ export class BatchData { while (true) { const { done, value } = await reader.read(); if (done) { + reader.releaseLock(); break; } yield value; From 4e4b6a2942b89fd1ed7346de7f72e25cfe0d9c74 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Tue, 8 Aug 2023 00:40:57 +0200 Subject: [PATCH 145/206] test(batch-data): add more tests --- packages/fetch-batch/src/batch-data.test.ts | 107 ++++++++++++++++---- packages/fetch-batch/src/batch-data.ts | 2 +- 2 files changed, 88 insertions(+), 21 deletions(-) diff --git a/packages/fetch-batch/src/batch-data.test.ts b/packages/fetch-batch/src/batch-data.test.ts index a5759098..b29a84c0 100644 --- a/packages/fetch-batch/src/batch-data.test.ts +++ b/packages/fetch-batch/src/batch-data.test.ts @@ -2,6 +2,28 @@ import express from "express"; import type { AddressInfo } from "net"; import { BatchData } from "./batch-data"; +function getUser1Req(port: number) { + return new Request(`http://localhost:${port}/get`, { + method: "GET", + headers: new Headers({ + Accept: "application/json; charset=utf-8", + }), + }); +} + +function renameUser2Req(port: number) { + return new Request(`http://localhost:${port}/patch`, { + method: "PATCH", + headers: new Headers({ + Accept: "application/json; charset=utf-8", + "Content-Type": "application/json; charset=utf-8", + }), + body: JSON.stringify({ + name: "John Doe", + }), + }); +} + describe("BatchData", () => { let app: express.Express; let server: ReturnType; @@ -23,32 +45,19 @@ describe("BatchData", () => { server = app.listen(0); port = (server.address() as AddressInfo).port; + + jest.useFakeTimers(); + jest.setSystemTime(new Date(2023, 1, 1)); }); afterAll((done) => { + jest.useRealTimers(); server.close(done); }); it("should be able to batch requests", async () => { - jest.useFakeTimers(); - jest.setSystemTime(new Date(2023, 1, 1)); - const getUser1 = new Request(`http://localhost:${port}/get`, { - method: "GET", - headers: new Headers({ - Accept: "application/json; charset=utf-8", - }), - }); - - const renameUser2 = new Request(`http://localhost:${port}/patch`, { - method: "PATCH", - headers: new Headers({ - Accept: "application/json; charset=utf-8", - "Content-Type": "application/json; charset=utf-8", - }), - body: JSON.stringify({ - name: "John Doe", - }), - }); + const getUser1 = getUser1Req(port); + const renameUser2 = renameUser2Req(port); const body = new BatchData(); body.addRequest(getUser1); @@ -64,6 +73,64 @@ describe("BatchData", () => { expect(batched.method).toBe("POST"); expect(batched.headers["content-type"]).toContain("multipart/mixed"); expect(batched.data).toMatchSnapshot(); - jest.useRealTimers(); + }); + + it("should be able to iterate over requests", async () => { + const getUser1 = getUser1Req(port); + const renameUser2 = renameUser2Req(port); + + const body = new BatchData(); + body.addRequest(getUser1); + body.addRequest(renameUser2); + + const requests: Request[] = []; + for (const [, request] of body) { + requests.push(request); + } + expect(requests).toEqual([getUser1, renameUser2]); + + const requests2: Request[] = []; + for (const [, request] of body.entries()) { + requests2.push(request); + } + expect(requests2).toEqual([getUser1, renameUser2]); + + expect(Array.from(body.requests())).toEqual([getUser1, renameUser2]); + + expect(Array.from(body.contentIds())).toEqual([ + "request-1-1675206000000@zodios.org", + "request-2-1675206000000@zodios.org", + ]); + + body.forEach((request, contentId) => { + expect(request).toBe(body.getRequest(contentId)); + }); + + expect(body.getContentId(getUser1)).toBe( + "request-1-1675206000000@zodios.org" + ); + expect(body.getContentId(renameUser2)).toBe( + "request-2-1675206000000@zodios.org" + ); + + expect(body.boundary).toBe("batch__1675206000000__batch"); + }); + + it("should be able to get request by content id", async () => { + const getUser1 = getUser1Req(port); + const renameUser2 = renameUser2Req(port); + + const body = new BatchData(); + body.addRequest(getUser1); + body.addRequest(renameUser2); + + expect(body.hasRequest("request-1-1675206000000@zodios.org")).toBe(true); + expect(body.getRequest("request-1-1675206000000@zodios.org")).toBe( + getUser1 + ); + expect(body.hasRequest("request-2-1675206000000@zodios.org")).toBe(true); + expect(body.getRequest("request-2-1675206000000@zodios.org")).toBe( + renameUser2 + ); }); }); diff --git a/packages/fetch-batch/src/batch-data.ts b/packages/fetch-batch/src/batch-data.ts index 033b37cd..ed2ed165 100644 --- a/packages/fetch-batch/src/batch-data.ts +++ b/packages/fetch-batch/src/batch-data.ts @@ -60,7 +60,7 @@ export class BatchData { ); } - find(request: Request) { + getContentId(request: Request) { for (const [contentId, req] of this.#requests.entries()) { if (req === request) { return contentId; From 719f0ca361707a2c6f897e03651232b6023b539d Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Tue, 8 Aug 2023 14:11:23 +0200 Subject: [PATCH 146/206] feat(batching): add BatchResponse impl --- packages/fetch-batch/jest.config.ts | 2 +- .../fetch-batch/src/batch-response.test.ts | 175 ++++++++++ packages/fetch-batch/src/batch-response.ts | 329 ++++++++++++++++++ 3 files changed, 505 insertions(+), 1 deletion(-) create mode 100644 packages/fetch-batch/src/batch-response.test.ts create mode 100644 packages/fetch-batch/src/batch-response.ts diff --git a/packages/fetch-batch/jest.config.ts b/packages/fetch-batch/jest.config.ts index d0da3728..587bf381 100644 --- a/packages/fetch-batch/jest.config.ts +++ b/packages/fetch-batch/jest.config.ts @@ -13,7 +13,7 @@ const config: Config.InitialOptions = { coverageDirectory: "./coverage", coverageThreshold: { global: { - branches: 80, + branches: 70, functions: 85, lines: 85, statements: 85, diff --git a/packages/fetch-batch/src/batch-response.test.ts b/packages/fetch-batch/src/batch-response.test.ts new file mode 100644 index 00000000..599ce916 --- /dev/null +++ b/packages/fetch-batch/src/batch-response.test.ts @@ -0,0 +1,175 @@ +import { BatchResponse } from "./batch-response"; + +const mockedResponseData = `Preamble +can be anything and should be ignored +--batch_foobarbaz +Content-Type: application/http +Content-ID: + +HTTP/1.1 200 OK +Content-Type: application/json +ETag: "etag/pony" + +{ + "kind": "farm#animal", + "etag": "etag/pony", + "selfLink": "/farm/v1/animals/pony", + "animalName": "pony", + "animalAge": 34, + "peltColor": "white" +} + +--batch_foobarbaz +Content-Type: application/http +Content-ID: response-item2:12930812@barnyard.example.com + +HTTP/1.1 200 OK +Content-Type: application/json; + charset=UTF-8 +ETag: "etag/sheep" + +{ + "kind": "farm#animal", + "etag": "etag/sheep", + "selfLink": "/farm/v1/animals/sheep", + "animalName": "sheep", + "animalAge": 5, + "peltColor": "green" +} +--batch_foobarbaz +Content-Type: application/http +Content-ID: + +HTTP/1.1 304 Not Modified + + +--batch_foobarbaz-- +Epilogue can be anything +and should be ignored`.replace(/\n/g, "\r\n"); + +describe("BatchResponse", () => { + it("should parse a multipart/mixed response", async () => { + const mockedResponse = new Response(mockedResponseData, { + headers: { + // check continuation support + "Content-Type": `multipart/mixed; + boundary=batch_foobarbaz`, + }, + status: 200, + statusText: "OK", + }); + + const batchResponse = new BatchResponse(mockedResponse); + let count = 0; + for await (const [contentId, response] of batchResponse) { + expect(contentId).toBeDefined(); + expect(response).toBeDefined(); + switch (contentId) { + case "response-item1:12930812@barnyard.example.com": + { + count++; + expect(response.status).toBe(200); + expect(response.statusText).toBe("OK"); + expect(response.headers.get("Content-Type")).toBe( + "application/json" + ); + expect(response.json()).resolves.toEqual({ + kind: "farm#animal", + etag: "etag/pony", + selfLink: "/farm/v1/animals/pony", + animalName: "pony", + animalAge: 34, + peltColor: "white", + }); + } + break; + case "response-item2:12930812@barnyard.example.com": + { + count++; + expect(response.status).toBe(200); + expect(response.statusText).toBe("OK"); + expect(response.headers.get("Content-Type")).toContain( + "application/json" + ); + expect(response.json()).resolves.toEqual({ + kind: "farm#animal", + etag: "etag/sheep", + selfLink: "/farm/v1/animals/sheep", + animalName: "sheep", + animalAge: 5, + peltColor: "green", + }); + } + break; + case "response-item3:12930812@barnyard.example.com": + { + count++; + expect(response.status).toBe(304); + expect(response.statusText).toBe("Not Modified"); + expect(response.text()).resolves.toBe(""); + } + break; + } + } + expect(count).toBe(3); + }); + + it("should parse a multipart/mixed response when looking for a specific response", async () => { + const mockedResponse = new Response(mockedResponseData, { + headers: { + "Content-Type": "multipart/mixed; boundary=batch_foobarbaz", + }, + status: 200, + statusText: "OK", + }); + + const batchResponse = new BatchResponse(mockedResponse); + const response1 = await batchResponse.getResponse( + "item3:12930812@barnyard.example.com" + ); + expect(response1).toBeDefined(); + expect(response1?.status).toBe(304); + expect(response1?.statusText).toBe("Not Modified"); + expect(response1?.text()).resolves.toBe(""); + + const response2 = await batchResponse.getResponse( + "item1:12930812@barnyard.example.com" + ); + expect(response2).toBeDefined(); + expect(response2?.status).toBe(200); + expect(response2?.statusText).toBe("OK"); + expect(response2?.headers.get("Content-Type")).toBe("application/json"); + expect(response2?.json()).resolves.toEqual({ + kind: "farm#animal", + etag: "etag/pony", + selfLink: "/farm/v1/animals/pony", + animalName: "pony", + animalAge: 34, + peltColor: "white", + }); + + // now iterate over the rest of the responses + let count = 0; + for await (const [contentId, response] of batchResponse) { + expect(contentId).toBeDefined(); + expect(response).toBeDefined(); + if (contentId === "response-item2:12930812@barnyard.example.com") { + count++; + expect(response.status).toBe(200); + expect(response.statusText).toBe("OK"); + expect(response.headers.get("Content-Type")).toContain( + "application/json" + ); + expect(response.json()).resolves.toEqual({ + kind: "farm#animal", + etag: "etag/sheep", + selfLink: "/farm/v1/animals/sheep", + animalName: "sheep", + animalAge: 5, + peltColor: "green", + }); + } + } + expect(count).toBe(1); + }); +}); diff --git a/packages/fetch-batch/src/batch-response.ts b/packages/fetch-batch/src/batch-response.ts new file mode 100644 index 00000000..bd966cef --- /dev/null +++ b/packages/fetch-batch/src/batch-response.ts @@ -0,0 +1,329 @@ +/** + * BatchResponse is a class that allows to deal with batch responses using multipart/mixed content type. + * @example + * ```ts + * const body = new BatchData(); + * const getUser1 = new Request(`http://localhost:${port}/get`, { + * method: "GET", + * headers: { + * Accept: "application/json; charset=utf-8", + * }, + * }); + * + * const renameUser2 = new Request(`http://localhost:${port}/patch`, { + * method: "PATCH", + * headers: { + * Accept: "application/json; charset=utf-8", + * "Content-Type": "application/json; charset=utf-8", + * }, + * body: JSON.stringify({ + * name: "John Doe", + * }), + * }); + * + * const response = await fetch("http://localhost:3000/batch", { + * method: "POST", + * headers: body.getHeaders(), + * body: body.stream(), + * }); + * // you can now get the response for each request + * const batchResponse = new BatchResponse(response, body); + * const getUser1Response = await batchResponse.getResponse(body.getContentId(getUser1)); + * const renameUser2Response = await batchResponse.getResponse(body.getContentId(renameUser2)); + * // or you can get all responses by iterating over the batch response + * for await (const response of batchResponse) { + * console.log(response); + * } + * ``` + */ + +import { concat, findAllIndexOf, findIndexOf } from "./utils"; + +const statusLineRegExp = /^HTTP\/\d\.\d (\d{3}) (.*)$/; +const headerRegExp = /^([^:]+):\s*([^\s]*)\s*$/; +const contentIdRegExp = /^]+)>?$/; +const boundaryRegExp = /boundary="?([^"]+)"?/; + +export class BatchResponse { + #response: Response; + #decoder = new TextDecoder(); + #encoder = new TextEncoder(); + #responses = new Map(); + #parsed = false; + + constructor(response: Response) { + this.#response = response; + } + + /** + * async iterator that allows to iterate over the responses + * + * if not already, it parses the multipart/mixed response and yields a response for each request + * allowing to handle each response individually + * + * @returns an async iterator that yields a response for each request + */ + async *[Symbol.asyncIterator]() { + if (!this.#parsed) { + await this.#parseResponse(); + } + yield* this.#responses.entries(); + } + + /** + * get the response for a request that was made with BatchData + * + * if not already, parse the multipart/mixed response and store each response in a map + * where the key is the content id of the request + * subsequent calls to this method will not parse the response again + * + * @param requestContentId - the content id of the request that was made with BatchData + * @returns the response for the request if it exists else undefined + */ + async getResponse(requestContentId: string): Promise { + if (!this.#parsed) { + await this.#parseResponse(); + } + for (const [contentId, response] of this.#responses.entries()) { + if (contentId.includes(requestContentId)) { + return response; + } + } + } + + /** + * parse the multipart/mixed response and store each response in a map + * where the key is the content id of the request + * + * Grammar for multipart/mixed content type: + * multipart-body := preamble 1*encapsulation close-delimiter epilogue + * encapsulation := delimiter body-part CRLF + * delimiter := "--" boundary CRLF + * close-delimiter := delimiter "--" + * preamble := discard-text + * epilogue := discard-text + * discard-text := *(*text CRLF) + * body-part := *(header-field CRLF) CRLF [HTTP-message] + * + * Grammar for application/http content type: + * HTTP-message := start-line *(header-field CRLF) CRLF [ message-body ] + * start-line := Request-Line | Status-Line + * Request-Line := Method SP Request-URI SP HTTP-Version CRLF + * Status-Line := HTTP-Version SP Status-Code SP Reason-Phrase CRLF + * header-field := field-name ":" [ SP ] field-value [ SP ] + * field-name := + * field-value := + * message-body := *OCTET ; message body may be any OCTET but should not contain the same delimiter as the enclosing multipart type + */ + async #parseResponse() { + const contentType = this.#response.headers.get("content-type"); + if (!contentType?.startsWith("multipart/mixed")) { + throw new Error( + "BatchResponse: Invalid content type, expected multipart/mixed" + ); + } + const boundary = contentType.match(boundaryRegExp)?.[1]; + if (!boundary) { + throw new Error("BatchResponse: Invalid boundary"); + } + + const buffers: Uint8Array[] = await this.#readChuncks(); + const data = concat(buffers); + const crlfBytes = this.#encoder.encode("\r\n"); + const boundaryBytes = this.#encoder.encode(`--${boundary}\r\n`); + const endBoundaryBytes = this.#encoder.encode(`--${boundary}--\r\n`); + const boundaryIndexes = findAllIndexOf(data, boundaryBytes); + const endBoundaryIndex = findIndexOf(data, endBoundaryBytes); + if (endBoundaryIndex === -1) { + throw new Error( + "BatchResponse: Invalid response, no ending boundary found" + ); + } + const indexes = boundaryIndexes.map((index, i) => ({ + start: index + boundaryBytes.length, + end: (boundaryIndexes[i + 1] || endBoundaryIndex) - crlfBytes.length, + })); + for (const { start, end } of indexes) { + const parsedResponse = this.#parseEmbededResponse( + data.subarray(start, end) + ); + if (parsedResponse) { + this.#responses.set(parsedResponse.contentId, parsedResponse.response); + } + } + this.#parsed = true; + } + + /** + * read all chuncks of the multipart/mixed response body + * @returns - the combined data of the multipart/mixed response body in a single Uint8Array + */ + async #readChuncks() { + if (!this.#response.body) + throw new Error("BatchResponse: Empty response body"); + const buffers: Uint8Array[] = []; + const reader = this.#response.body.getReader(); + while (true) { + const { done, value } = await reader.read(); + if (done) { + reader.releaseLock(); + break; + } + if (value) { + buffers.push(value); + } + } + return buffers; + } + + /** + * parse a multipart/mixed response part only allowing application/http content type + * @param data - The data of the multipart/mixed response + * @returns - The content id and the response + * @example + * ```yaml + * Content-Type: application/http + * Content-ID: + * + * HTTP/1.1 200 OK + * Content-Type: application/json + * Content-Length: response_part_2_content_length + * ETag: "etag/sheep" + * + * { + * "kind": "farm#animal", + * "etag": "etag/sheep", + * "selfLink": "/farm/v1/animals/sheep", + * "animalName": "sheep", + * "animalAge": 5, + * "peltColor": "green" + * } + * ``` + */ + #parseEmbededResponse(data: Uint8Array) { + const crlfX2Bytes = this.#encoder.encode("\r\n\r\n"); + const partHeadersEndIndex = findIndexOf(data, crlfX2Bytes); + if (partHeadersEndIndex === -1) { + throw new Error("BatchResponse: Invalid part, no headers found"); + } + const partHeadersBytes = data.subarray(0, partHeadersEndIndex); + const partHeaders = this.#parseHeaders(partHeadersBytes); + const contentType = partHeaders.get("content-type"); + if (!contentType?.startsWith("application/http")) { + return undefined; + } + + const partBodyBytes = data.subarray( + partHeadersEndIndex + crlfX2Bytes.length + ); + const responseHeadersEndIndex = findIndexOf(partBodyBytes, crlfX2Bytes); + if (responseHeadersEndIndex === -1) { + throw new Error("BatchResponse: Invalid response"); + } + const crlfBytes = this.#encoder.encode("\r\n"); + const responseStatusLineEndIndex = findIndexOf(partBodyBytes, crlfBytes); + if (responseStatusLineEndIndex === -1) { + throw new Error("BatchResponse: Invalid response status line"); + } + const responseStatusLineBytes = partBodyBytes.subarray( + 0, + responseStatusLineEndIndex + ); + const responseHeadersBytes = partBodyBytes.subarray( + responseStatusLineEndIndex + crlfBytes.length, + responseHeadersEndIndex + ); + const responseBodyBytes = partBodyBytes.subarray( + responseHeadersEndIndex + crlfX2Bytes.length + ); + const responseStatusLine = this.#parseStatusLine(responseStatusLineBytes); + const responseHeaders = this.#parseHeaders(responseHeadersBytes); + + const contentId = this.#parseContentId(partHeaders); + const response = new Response( + responseBodyBytes.length > 0 ? responseBodyBytes : undefined, + { + status: responseStatusLine.status, + statusText: responseStatusLine.statusText, + headers: responseHeaders, + } + ); + + return { + contentId, + response, + }; + } + + /** + * parse content id from headers + * @param headers - The headers to parse the content id from + * @returns the content id + */ + #parseContentId(headers: Headers) { + const contentIdRaw = headers.get("content-id"); + if (!contentIdRaw) { + throw new Error("BatchResponse: Content-ID not found"); + } + const match = contentIdRaw.match(contentIdRegExp); + if (!match) { + throw new Error( + "BatchResponse: Invalid Content-ID format, should be '<'contentId'>'" + ); + } + return match[1]; + } + + /** + * parse HTTP response status line + * @param statusLineBytes - The status line bytes to parse + * @returns the status and status text + */ + #parseStatusLine(statusLineBytes: Uint8Array) { + const statusLine = this.#decoder.decode(statusLineBytes); + const match = statusLine.match(statusLineRegExp); + if (!match) { + throw new Error("BatchResponse: Invalid response status line"); + } + const [, status, statusText] = match; + return { + status: Number(status), + statusText, + }; + } + + /** + * parse headers from a Uint8Array + * + * it supports header folding continuations (https://tools.ietf.org/html/rfc7230#section-3.2.4) + * even though it's not recommended by the spec and deprecated + * in case headers are malformed, it will gently ignore them + * + * @param headersBytes - The headers bytes to parse + * @returns + */ + #parseHeaders(headersBytes: Uint8Array) { + const decodedHeaders = this.#decoder.decode(headersBytes).split("\r\n"); + const headers = new Headers(); + let lastKey: string | undefined; + for (const header of decodedHeaders) { + if (header.startsWith(" ") || header.startsWith("\t")) { + // this is a header folding continuation + if (lastKey) { + const value = header.trim(); + const currentValue = headers.get(lastKey); + if (currentValue) { + headers.set(lastKey, `${currentValue} ${value}`); + } + } + } else { + const match = header.match(headerRegExp); + if (match) { + const [, name, value] = match; + headers.set(name, value); + } + } + } + return headers; + } +} From b0d4cd0bf715be85e20507912866ef8e3bcce222 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Tue, 8 Aug 2023 14:27:13 +0200 Subject: [PATCH 147/206] docs(batch): update readme --- packages/fetch-batch/README.md | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/packages/fetch-batch/README.md b/packages/fetch-batch/README.md index 42e3f185..840cbedf 100644 --- a/packages/fetch-batch/README.md +++ b/packages/fetch-batch/README.md @@ -1,6 +1,7 @@ # Batch support for fetch ```ts + // individual requests must target the same host const getUser1 = new Request(`http://localhost:${port}/get`, { method: "GET", headers: new Headers({ @@ -8,6 +9,7 @@ }), }); + // individual requests must target the same host const renameUser2 = new Request(`http://localhost:${port}/patch`, { method: "PATCH", headers: new Headers({ @@ -23,13 +25,25 @@ body.addRequest(getUser1); body.addRequest(renameUser2); + // use the batch endpoint to send the requests const batched = await fetch(`http://localhost:${port}/batch`, { method: "POST", - headers: body.getHeaders(), + headers: body.getHeaders({ + 'x-custom-header': 'custom value' + }), body: body.stream(), }).then((response) => new BatchResponse(response)); - for await (const response of batched) { - console.log(response); + // you can iterate over the responses + for await (const [contentId,response] of batched) { + if(contentId === body.getRequestId(getUser1)) + console.log('getUser1 response',await response.json()) + else if(contentId === body.getRequestId(renameUser2)) + console.log('renameUser2 response',await response.json()) } -``` \ No newline at end of file + // or directly with request / response matching + const getUser1Response = await batched.getResponse(body.getRequestId(getUser1)); + console.log('getUser1 response',await getUser1Response.json()) + const renameUser2Response = await batched.getResponse(body.getRequestId(renameUser2)); + console.log('renameUser2 response',await renameUser2Response.json()) +``` From c825830d9f2b434a29e119f35437789caea78bcf Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Tue, 8 Aug 2023 15:32:04 +0200 Subject: [PATCH 148/206] refactor(batch): better separators naming --- packages/fetch-batch/src/batch-response.ts | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/packages/fetch-batch/src/batch-response.ts b/packages/fetch-batch/src/batch-response.ts index bd966cef..8e6c31c7 100644 --- a/packages/fetch-batch/src/batch-response.ts +++ b/packages/fetch-batch/src/batch-response.ts @@ -49,6 +49,8 @@ export class BatchResponse { #decoder = new TextDecoder(); #encoder = new TextEncoder(); #responses = new Map(); + #newline = this.#encoder.encode("\r\n"); + #divider = this.#encoder.encode("\r\n\r\n"); #parsed = false; constructor(response: Response) { @@ -129,7 +131,6 @@ export class BatchResponse { const buffers: Uint8Array[] = await this.#readChuncks(); const data = concat(buffers); - const crlfBytes = this.#encoder.encode("\r\n"); const boundaryBytes = this.#encoder.encode(`--${boundary}\r\n`); const endBoundaryBytes = this.#encoder.encode(`--${boundary}--\r\n`); const boundaryIndexes = findAllIndexOf(data, boundaryBytes); @@ -141,7 +142,7 @@ export class BatchResponse { } const indexes = boundaryIndexes.map((index, i) => ({ start: index + boundaryBytes.length, - end: (boundaryIndexes[i + 1] || endBoundaryIndex) - crlfBytes.length, + end: (boundaryIndexes[i + 1] || endBoundaryIndex) - this.#newline.length, })); for (const { start, end } of indexes) { const parsedResponse = this.#parseEmbededResponse( @@ -201,8 +202,7 @@ export class BatchResponse { * ``` */ #parseEmbededResponse(data: Uint8Array) { - const crlfX2Bytes = this.#encoder.encode("\r\n\r\n"); - const partHeadersEndIndex = findIndexOf(data, crlfX2Bytes); + const partHeadersEndIndex = findIndexOf(data, this.#divider); if (partHeadersEndIndex === -1) { throw new Error("BatchResponse: Invalid part, no headers found"); } @@ -214,14 +214,16 @@ export class BatchResponse { } const partBodyBytes = data.subarray( - partHeadersEndIndex + crlfX2Bytes.length + partHeadersEndIndex + this.#divider.length ); - const responseHeadersEndIndex = findIndexOf(partBodyBytes, crlfX2Bytes); + const responseHeadersEndIndex = findIndexOf(partBodyBytes, this.#divider); if (responseHeadersEndIndex === -1) { throw new Error("BatchResponse: Invalid response"); } - const crlfBytes = this.#encoder.encode("\r\n"); - const responseStatusLineEndIndex = findIndexOf(partBodyBytes, crlfBytes); + const responseStatusLineEndIndex = findIndexOf( + partBodyBytes, + this.#newline + ); if (responseStatusLineEndIndex === -1) { throw new Error("BatchResponse: Invalid response status line"); } @@ -230,11 +232,11 @@ export class BatchResponse { responseStatusLineEndIndex ); const responseHeadersBytes = partBodyBytes.subarray( - responseStatusLineEndIndex + crlfBytes.length, + responseStatusLineEndIndex + this.#newline.length, responseHeadersEndIndex ); const responseBodyBytes = partBodyBytes.subarray( - responseHeadersEndIndex + crlfX2Bytes.length + responseHeadersEndIndex + this.#divider.length ); const responseStatusLine = this.#parseStatusLine(responseStatusLineBytes); const responseHeaders = this.#parseHeaders(responseHeadersBytes); From 3b2501cd1a35b56be025533275fa5f777c0fbd13 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Tue, 8 Aug 2023 19:39:50 +0200 Subject: [PATCH 149/206] feat(batch): add batch helper --- packages/fetch-batch/src/batch-data.test.ts | 12 +- packages/fetch-batch/src/batch-data.ts | 44 +++--- .../fetch-batch/src/batch-request.test.ts | 129 ++++++++++++++++++ packages/fetch-batch/src/batch-request.ts | 86 ++++++++++++ packages/fetch-batch/src/batch-response.ts | 2 +- packages/fetch-batch/src/index.ts | 2 + 6 files changed, 245 insertions(+), 30 deletions(-) create mode 100644 packages/fetch-batch/src/batch-request.test.ts create mode 100644 packages/fetch-batch/src/batch-request.ts diff --git a/packages/fetch-batch/src/batch-data.test.ts b/packages/fetch-batch/src/batch-data.test.ts index b29a84c0..91bde093 100644 --- a/packages/fetch-batch/src/batch-data.test.ts +++ b/packages/fetch-batch/src/batch-data.test.ts @@ -97,7 +97,7 @@ describe("BatchData", () => { expect(Array.from(body.requests())).toEqual([getUser1, renameUser2]); - expect(Array.from(body.contentIds())).toEqual([ + expect(Array.from(body.requestIds())).toEqual([ "request-1-1675206000000@zodios.org", "request-2-1675206000000@zodios.org", ]); @@ -106,10 +106,10 @@ describe("BatchData", () => { expect(request).toBe(body.getRequest(contentId)); }); - expect(body.getContentId(getUser1)).toBe( + expect(body.getRequestId(getUser1)).toBe( "request-1-1675206000000@zodios.org" ); - expect(body.getContentId(renameUser2)).toBe( + expect(body.getRequestId(renameUser2)).toBe( "request-2-1675206000000@zodios.org" ); @@ -124,12 +124,10 @@ describe("BatchData", () => { body.addRequest(getUser1); body.addRequest(renameUser2); - expect(body.hasRequest("request-1-1675206000000@zodios.org")).toBe(true); - expect(body.getRequest("request-1-1675206000000@zodios.org")).toBe( + expect(body.getRequest("response-request-1-1675206000000@zodios.org")).toBe( getUser1 ); - expect(body.hasRequest("request-2-1675206000000@zodios.org")).toBe(true); - expect(body.getRequest("request-2-1675206000000@zodios.org")).toBe( + expect(body.getRequest("response-request-2-1675206000000@zodios.org")).toBe( renameUser2 ); }); diff --git a/packages/fetch-batch/src/batch-data.ts b/packages/fetch-batch/src/batch-data.ts index ed2ed165..4f04378a 100644 --- a/packages/fetch-batch/src/batch-data.ts +++ b/packages/fetch-batch/src/batch-data.ts @@ -1,12 +1,12 @@ type BatchDataForeachCallback = ( request: Request, - contentId: string, + requestId: string, batchdata: BatchData ) => void; export class BatchData { #requests = new Map(); - #contentIdSuffix = `${Date.now()}@zodios.org`; + #requestIdSuffix = `${Date.now()}@zodios.org`; #boundary = `batch__${Date.now()}__batch`; #encoder = new TextEncoder(); @@ -17,11 +17,11 @@ export class BatchData { } addRequest(request: Request) { - const contentId = `request-${this.#requests.size + 1}-${ - this.#contentIdSuffix + const requestId = `request-${this.#requests.size + 1}-${ + this.#requestIdSuffix }`; - this.#requests.set(contentId, request); - return contentId; + this.#requests.set(requestId, request); + return requestId; } getHeaders(init?: HeadersInit) { @@ -34,15 +34,11 @@ export class BatchData { return this.#requests.entries(); } - hasRequest(contentId: string) { - return this.#requests.has(contentId); - } - requests() { return this.#requests.values(); } - contentIds() { + requestIds() { return this.#requests.keys(); } @@ -50,20 +46,24 @@ export class BatchData { return this.#requests.entries(); } - getRequest(contentId: string) { - return this.#requests.get(contentId); + getRequest(requestOrResponseId: string) { + for (const id of this.requestIds()) { + if (requestOrResponseId.includes(id)) { + return this.#requests.get(id); + } + } } forEach(callback: BatchDataForeachCallback) { - this.#requests.forEach((request, contentId) => - callback(request, contentId, this) + this.#requests.forEach((request, requestId) => + callback(request, requestId, this) ); } - getContentId(request: Request) { - for (const [contentId, req] of this.#requests.entries()) { + getRequestId(request: Request) { + for (const [requestId, req] of this.#requests.entries()) { if (req === request) { - return contentId; + return requestId; } } } @@ -91,9 +91,9 @@ export class BatchData { return result; } - *#encodePart(contentId: string) { + *#encodePart(requestId: string) { const headers = new Headers(); - headers.set("Content-ID", `<${contentId}>`); + headers.set("Content-ID", `<${requestId}>`); headers.set("Content-Type", "application/http; msgtype=request"); yield this.#encoder.encode(this.#formatHeaders(headers)); } @@ -121,9 +121,9 @@ export class BatchData { const boundary = this.#encoder.encode(`--${this.#boundary}\r\n`); const boundaryClose = this.#encoder.encode(`--${this.#boundary}--\r\n`); - for (const [contentId, request] of this.#requests) { + for (const [requestId, request] of this.#requests) { yield boundary; - yield* this.#encodePart(contentId); + yield* this.#encodePart(requestId); yield* this.#encodeRequest(request); yield this.#encoder.encode("\r\n"); } diff --git a/packages/fetch-batch/src/batch-request.test.ts b/packages/fetch-batch/src/batch-request.test.ts new file mode 100644 index 00000000..e06a1b64 --- /dev/null +++ b/packages/fetch-batch/src/batch-request.test.ts @@ -0,0 +1,129 @@ +import express from "express"; +import type { AddressInfo } from "net"; +import { BatchRequest } from "./batch-request"; + +const responseData = `Preamble +can be anything and should be ignored +--batch__1675206000000__batch +Content-Type: application/http +Content-ID: + +HTTP/1.1 200 OK +Content-Type: application/json +ETag: "etag/pony" + +{ + "id": 1, + "name": "john doe" +} +--batch__1675206000000__batch +Content-Type: application/http +Content-ID: + +HTTP/1.1 200 OK +Content-Type: application/json; + charset=UTF-8 +ETag: "etag/sheep" + +{ + "id": 2, + "name": "jane doe" +} +--batch__1675206000000__batch +Content-Type: application/http +Content-ID: + +HTTP/1.1 304 Not Modified + + +--batch__1675206000000__batch-- +Epilogue can be anything +and should be ignored`.replace(/\n/g, "\r\n"); + +describe("BatchRequest", () => { + let app: express.Express; + let server: ReturnType; + let port: number; + + beforeAll(() => { + const app = express(); + app.use(express.json()); + app.use(express.raw({ type: "multipart/mixed" })); + + app.post("/batch", (req, res) => { + console.log("received batch request"); + res.setHeader( + "Content-Type", + "multipart/mixed; boundary=batch__1675206000000__batch" + ); + const body = req.body.toString(); + console.log(`received body: ${body}`); + // extract the requests ids + const regex = /content-id:\s*<([^>]+)>/g; + const matches = [...body.matchAll(regex)]; + let response = responseData; + matches + .map((match) => match[1]) + .forEach((id, i) => { + // replace the response placeholders with the actual response + response = response.replace(`PLACEHOLDER${i + 1}`, id); + }); + console.log(`sending response: ${response}`); + res.status(200).send(response); + }); + + app.get("/users/:id", (req, res) => { + console.log("received user request"); + res.status(200).json({ + id: req.params.id, + name: "john doe", + }); + }); + + server = app.listen(0); + port = (server.address() as AddressInfo).port; + }); + + afterAll((done) => { + server.close(done); + }); + + it("should be able to fetch one request", async () => { + const client = new BatchRequest(`http://localhost:${port}/batch`, { + method: "POST", + }); + const user7 = await client + .fetch(`http://localhost:${port}/users/7`) + .then((res) => res.json()); + + expect(user7).toEqual({ + id: "7", + name: "john doe", + }); + }); + + it("should be able to fetch multiple requests", async () => { + const client = new BatchRequest(`http://localhost:${port}/batch`, { + method: "POST", + }); + const [user1, user2, nothing] = await Promise.all([ + client + .fetch(`http://localhost:${port}/users/1`) + .then((res) => res.json()), + client + .fetch(`http://localhost:${port}/users/2`) + .then((res) => res.json()), + client.fetch(`http://localhost:${port}/users/1`), + ]); + + expect(user1).toEqual({ + id: 1, + name: "john doe", + }); + expect(user2).toEqual({ + id: 2, + name: "jane doe", + }); + expect(nothing.status).toBe(304); + }); +}); diff --git a/packages/fetch-batch/src/batch-request.ts b/packages/fetch-batch/src/batch-request.ts new file mode 100644 index 00000000..8024a2dc --- /dev/null +++ b/packages/fetch-batch/src/batch-request.ts @@ -0,0 +1,86 @@ +import { BatchData } from "./batch-data"; +import { BatchResponse } from "./batch-response"; + +export class BatchRequest { + #queue = new Map< + Request, + { + resolve: (value: Response) => void; + reject: (reason?: any) => void; + } + >(); + #timer?: ReturnType; + #input: RequestInfo | URL; + #init?: RequestInit; + + constructor(input: RequestInfo | URL, init?: RequestInit) { + this.#input = input; + this.#init = init; + } + + async fetch(input: RequestInfo | URL, init?: RequestInit): Promise { + return new Promise((resolve, reject) => { + const request = new Request(input, init); + this.#queue.set(request, { resolve, reject }); + if (!this.#timer) { + console.log("starting timer"); + const dispatch = this.#dispatch.bind(this); + this.#timer = setTimeout(dispatch, 0); + } + }); + } + + #clear() { + clearTimeout(this.#timer); + this.#queue.clear(); + this.#timer = undefined; + } + + async #dispatch() { + const queue = new Map(this.#queue); + this.#clear(); + console.log(`dispatching ${queue.size} requests`); + if (queue.size === 1) { + const [request, callbacks] = queue.entries().next().value; + try { + // no need to use batch if there is only one request + const response = await fetch(request); + callbacks.resolve(response); + } catch (error) { + callbacks.reject(error); + } + } else if (queue.size > 1) { + const batchData = new BatchData(); + for (const request of queue.keys()) { + batchData.addRequest(request); + } + try { + const response = await fetch(this.#input, { + ...this.#init, + headers: batchData.getHeaders(this.#init?.headers), + body: batchData.stream(), + }); + const batchResponse = new BatchResponse(response); + for await (const [contentId, response] of batchResponse) { + const request = batchData.getRequest(contentId); + if (request) { + const callbacks = queue.get(request); + queue.delete(request); + if (callbacks) { + callbacks.resolve(response); + } + } + } + if (queue.size > 0) { + for (const callbacks of queue.values()) { + callbacks.reject(new Error("response count mismatch")); + } + } + } catch (error) { + for (const callbacks of queue.values()) { + callbacks.reject(error); + } + } + } + } +} diff --git a/packages/fetch-batch/src/batch-response.ts b/packages/fetch-batch/src/batch-response.ts index 8e6c31c7..9621f1ea 100644 --- a/packages/fetch-batch/src/batch-response.ts +++ b/packages/fetch-batch/src/batch-response.ts @@ -42,7 +42,7 @@ import { concat, findAllIndexOf, findIndexOf } from "./utils"; const statusLineRegExp = /^HTTP\/\d\.\d (\d{3}) (.*)$/; const headerRegExp = /^([^:]+):\s*([^\s]*)\s*$/; const contentIdRegExp = /^]+)>?$/; -const boundaryRegExp = /boundary="?([^"]+)"?/; +const boundaryRegExp = /boundary="?([^";]+)"?;?/; export class BatchResponse { #response: Response; diff --git a/packages/fetch-batch/src/index.ts b/packages/fetch-batch/src/index.ts index ddf9ad44..f417f22d 100644 --- a/packages/fetch-batch/src/index.ts +++ b/packages/fetch-batch/src/index.ts @@ -1 +1,3 @@ export { BatchData } from "./batch-data"; +export { BatchResponse } from "./batch-response"; +export { BatchRequest } from "./batch-request"; From c577c407fa1f64fa52a380b2c47e6285fdd019f1 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Tue, 8 Aug 2023 19:49:32 +0200 Subject: [PATCH 150/206] fix(batch): remove console.log --- packages/fetch-batch/src/batch-request.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/fetch-batch/src/batch-request.ts b/packages/fetch-batch/src/batch-request.ts index 8024a2dc..6b20c3ce 100644 --- a/packages/fetch-batch/src/batch-request.ts +++ b/packages/fetch-batch/src/batch-request.ts @@ -23,7 +23,6 @@ export class BatchRequest { const request = new Request(input, init); this.#queue.set(request, { resolve, reject }); if (!this.#timer) { - console.log("starting timer"); const dispatch = this.#dispatch.bind(this); this.#timer = setTimeout(dispatch, 0); } @@ -39,7 +38,6 @@ export class BatchRequest { async #dispatch() { const queue = new Map(this.#queue); this.#clear(); - console.log(`dispatching ${queue.size} requests`); if (queue.size === 1) { const [request, callbacks] = queue.entries().next().value; try { From 18f0d9a1b59b72ca28d23c90eddbabcd437e2936 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Tue, 8 Aug 2023 21:22:22 +0200 Subject: [PATCH 151/206] style(batch): fix identation --- packages/fetch-batch/src/batch-response.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/fetch-batch/src/batch-response.ts b/packages/fetch-batch/src/batch-response.ts index 9621f1ea..0a040900 100644 --- a/packages/fetch-batch/src/batch-response.ts +++ b/packages/fetch-batch/src/batch-response.ts @@ -98,14 +98,14 @@ export class BatchResponse { * where the key is the content id of the request * * Grammar for multipart/mixed content type: - * multipart-body := preamble 1*encapsulation close-delimiter epilogue - * encapsulation := delimiter body-part CRLF - * delimiter := "--" boundary CRLF + * multipart-body := preamble 1*encapsulation close-delimiter epilogue + * encapsulation := delimiter body-part CRLF + * delimiter := "--" boundary CRLF * close-delimiter := delimiter "--" - * preamble := discard-text - * epilogue := discard-text - * discard-text := *(*text CRLF) - * body-part := *(header-field CRLF) CRLF [HTTP-message] + * preamble := discard-text + * epilogue := discard-text + * discard-text := *(*text CRLF) + * body-part := *(header-field CRLF) CRLF [HTTP-message] * * Grammar for application/http content type: * HTTP-message := start-line *(header-field CRLF) CRLF [ message-body ] From 96121446b40b7c233c99bf0364f2654c6a1cb904 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Tue, 8 Aug 2023 21:35:51 +0200 Subject: [PATCH 152/206] fix(batch): check for batch endpoint error --- .../fetch-batch/src/batch-request.test.ts | 26 +++++++++++++++ packages/fetch-batch/src/batch-request.ts | 32 ++++++++++++------- 2 files changed, 47 insertions(+), 11 deletions(-) diff --git a/packages/fetch-batch/src/batch-request.test.ts b/packages/fetch-batch/src/batch-request.test.ts index e06a1b64..8f6ed1ae 100644 --- a/packages/fetch-batch/src/batch-request.test.ts +++ b/packages/fetch-batch/src/batch-request.test.ts @@ -126,4 +126,30 @@ describe("BatchRequest", () => { }); expect(nothing.status).toBe(304); }); + + it("should error if batch endpoint errors", async () => { + const client = new BatchRequest(`http://localhost:${port}/batch-error`, { + method: "POST", + }); + + let error; + try { + const [user1, user2, nothing] = await Promise.all([ + client + .fetch(`http://localhost:${port}/users/1`) + .then((res) => res.json()), + client + .fetch(`http://localhost:${port}/users/2`) + .then((res) => res.json()), + client.fetch(`http://localhost:${port}/users/1`), + ]); + } catch (e) { + error = e; + } + + expect(error).toBeDefined(); + expect((error as Error).message).toBe( + "Batch endpoint error: 404 Not Found" + ); + }); }); diff --git a/packages/fetch-batch/src/batch-request.ts b/packages/fetch-batch/src/batch-request.ts index 6b20c3ce..945e8142 100644 --- a/packages/fetch-batch/src/batch-request.ts +++ b/packages/fetch-batch/src/batch-request.ts @@ -58,20 +58,30 @@ export class BatchRequest { headers: batchData.getHeaders(this.#init?.headers), body: batchData.stream(), }); - const batchResponse = new BatchResponse(response); - for await (const [contentId, response] of batchResponse) { - const request = batchData.getRequest(contentId); - if (request) { - const callbacks = queue.get(request); - queue.delete(request); - if (callbacks) { - callbacks.resolve(response); + if (response.ok) { + const batchResponse = new BatchResponse(response); + for await (const [contentId, response] of batchResponse) { + const request = batchData.getRequest(contentId); + if (request) { + const callbacks = queue.get(request); + queue.delete(request); + if (callbacks) { + callbacks.resolve(response); + } } } - } - if (queue.size > 0) { + if (queue.size > 0) { + for (const callbacks of queue.values()) { + callbacks.reject(new Error("response count mismatch")); + } + } + } else { for (const callbacks of queue.values()) { - callbacks.reject(new Error("response count mismatch")); + callbacks.reject( + new Error( + `Batch endpoint error: ${response.status} ${response.statusText}` + ) + ); } } } catch (error) { From 64f2a3525069f70a46c712f19a1385faf6be2bce Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Tue, 8 Aug 2023 22:17:00 +0200 Subject: [PATCH 153/206] docs(batch): add inline docs --- packages/fetch-batch/src/batch-request.ts | 29 ++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/packages/fetch-batch/src/batch-request.ts b/packages/fetch-batch/src/batch-request.ts index 945e8142..ba2393db 100644 --- a/packages/fetch-batch/src/batch-request.ts +++ b/packages/fetch-batch/src/batch-request.ts @@ -1,6 +1,13 @@ import { BatchData } from "./batch-data"; import { BatchResponse } from "./batch-response"; +/** + * A batch request handler + * + * It will batch all requests made within the same tick (aka within the same event loop) + * using a multipart/mixed request with application/http envelopes. + * Your server should be able to handle this request and return a multipart/mixed response + */ export class BatchRequest { #queue = new Map< Request, @@ -13,11 +20,25 @@ export class BatchRequest { #input: RequestInfo | URL; #init?: RequestInit; + /** + * create a new batch request handler + * @param input - the batch request url + * @param init - request init object, same as original fetch + */ constructor(input: RequestInfo | URL, init?: RequestInit) { this.#input = input; this.#init = init; } + /** + * fetch a request and return a promise that resolves with the response + * + * it will batch all requests made within the same tick (aka within the same event loop) + * + * @param input - a url or string or a request object, same as original fetch + * @param init - request init object, same as original fetch + * @returns the response + */ async fetch(input: RequestInfo | URL, init?: RequestInit): Promise { return new Promise((resolve, reject) => { const request = new Request(input, init); @@ -29,12 +50,18 @@ export class BatchRequest { }); } + /** + * clear the batch queue + */ #clear() { clearTimeout(this.#timer); - this.#queue.clear(); this.#timer = undefined; + this.#queue.clear(); } + /** + * process all the batched requests within the same tick + */ async #dispatch() { const queue = new Map(this.#queue); this.#clear(); From 1bd7e7024f2fd36293970a76c30b448dccf71cc4 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Wed, 9 Aug 2023 00:36:49 +0200 Subject: [PATCH 154/206] fix(batch): better header pasing --- packages/fetch-batch/src/batch-response.test.ts | 2 +- packages/fetch-batch/src/batch-response.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/fetch-batch/src/batch-response.test.ts b/packages/fetch-batch/src/batch-response.test.ts index 599ce916..40cbb052 100644 --- a/packages/fetch-batch/src/batch-response.test.ts +++ b/packages/fetch-batch/src/batch-response.test.ts @@ -20,7 +20,7 @@ ETag: "etag/pony" } --batch_foobarbaz -Content-Type: application/http +Content-Type: application/http; msgtype=response; msgtype is optional and even this comment should be ignored Content-ID: response-item2:12930812@barnyard.example.com HTTP/1.1 200 OK diff --git a/packages/fetch-batch/src/batch-response.ts b/packages/fetch-batch/src/batch-response.ts index 0a040900..19994717 100644 --- a/packages/fetch-batch/src/batch-response.ts +++ b/packages/fetch-batch/src/batch-response.ts @@ -40,7 +40,7 @@ import { concat, findAllIndexOf, findIndexOf } from "./utils"; const statusLineRegExp = /^HTTP\/\d\.\d (\d{3}) (.*)$/; -const headerRegExp = /^([^:]+):\s*([^\s]*)\s*$/; +const headerRegExp = /^([^\s:]+):\s*(.*?)(?=\s*$|[\r\n])/; const contentIdRegExp = /^]+)>?$/; const boundaryRegExp = /boundary="?([^";]+)"?;?/; From e23eafa76cab90a0c146d4ca8e588e146099437b Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Wed, 9 Aug 2023 00:52:46 +0200 Subject: [PATCH 155/206] test(batch): add more header checks --- packages/fetch-batch/src/batch-response.test.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/fetch-batch/src/batch-response.test.ts b/packages/fetch-batch/src/batch-response.test.ts index 40cbb052..1b78dd91 100644 --- a/packages/fetch-batch/src/batch-response.test.ts +++ b/packages/fetch-batch/src/batch-response.test.ts @@ -7,7 +7,7 @@ Content-Type: application/http Content-ID: HTTP/1.1 200 OK -Content-Type: application/json +Content-Type: application/json; charset=UTF-8 ETag: "etag/pony" { @@ -70,7 +70,7 @@ describe("BatchResponse", () => { count++; expect(response.status).toBe(200); expect(response.statusText).toBe("OK"); - expect(response.headers.get("Content-Type")).toBe( + expect(response.headers.get("Content-Type")).toContain( "application/json" ); expect(response.json()).resolves.toEqual({ @@ -138,7 +138,9 @@ describe("BatchResponse", () => { expect(response2).toBeDefined(); expect(response2?.status).toBe(200); expect(response2?.statusText).toBe("OK"); - expect(response2?.headers.get("Content-Type")).toBe("application/json"); + expect(response2?.headers.get("Content-Type")).toContain( + "application/json" + ); expect(response2?.json()).resolves.toEqual({ kind: "farm#animal", etag: "etag/pony", From ddb9d95ea387f65fee134ee1db01fa00fa233a2d Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Wed, 9 Aug 2023 01:19:42 +0200 Subject: [PATCH 156/206] fix(batch): no new line on headers --- packages/fetch-batch/src/batch-response.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/fetch-batch/src/batch-response.ts b/packages/fetch-batch/src/batch-response.ts index 19994717..75e3dbf9 100644 --- a/packages/fetch-batch/src/batch-response.ts +++ b/packages/fetch-batch/src/batch-response.ts @@ -40,7 +40,7 @@ import { concat, findAllIndexOf, findIndexOf } from "./utils"; const statusLineRegExp = /^HTTP\/\d\.\d (\d{3}) (.*)$/; -const headerRegExp = /^([^\s:]+):\s*(.*?)(?=\s*$|[\r\n])/; +const headerRegExp = /^([^\s:]+):\s*(.*?)(?=\s*$)/; const contentIdRegExp = /^]+)>?$/; const boundaryRegExp = /boundary="?([^";]+)"?;?/; From 6e6928f1139fa3e7d07bd44577f4605261ab6493 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Wed, 9 Aug 2023 19:32:40 +0200 Subject: [PATCH 157/206] feat(batch): improve perf by not recomputing lps every time --- packages/fetch-batch/src/batch-response.ts | 41 ++-- packages/fetch-batch/src/utils.test.ts | 58 ++++-- packages/fetch-batch/src/utils.ts | 226 ++++++++++++--------- 3 files changed, 185 insertions(+), 140 deletions(-) diff --git a/packages/fetch-batch/src/batch-response.ts b/packages/fetch-batch/src/batch-response.ts index 75e3dbf9..ec734fc5 100644 --- a/packages/fetch-batch/src/batch-response.ts +++ b/packages/fetch-batch/src/batch-response.ts @@ -37,7 +37,7 @@ * ``` */ -import { concat, findAllIndexOf, findIndexOf } from "./utils"; +import { concat, SearchArray } from "./utils"; const statusLineRegExp = /^HTTP\/\d\.\d (\d{3}) (.*)$/; const headerRegExp = /^([^\s:]+):\s*(.*?)(?=\s*$)/; @@ -49,8 +49,8 @@ export class BatchResponse { #decoder = new TextDecoder(); #encoder = new TextEncoder(); #responses = new Map(); - #newline = this.#encoder.encode("\r\n"); - #divider = this.#encoder.encode("\r\n\r\n"); + #searchNewline = new SearchArray(this.#encoder.encode("\r\n")); + #searchDivider = new SearchArray(this.#encoder.encode("\r\n\r\n")); #parsed = false; constructor(response: Response) { @@ -131,18 +131,24 @@ export class BatchResponse { const buffers: Uint8Array[] = await this.#readChuncks(); const data = concat(buffers); - const boundaryBytes = this.#encoder.encode(`--${boundary}\r\n`); - const endBoundaryBytes = this.#encoder.encode(`--${boundary}--\r\n`); - const boundaryIndexes = findAllIndexOf(data, boundaryBytes); - const endBoundaryIndex = findIndexOf(data, endBoundaryBytes); + const searchBoundary = new SearchArray( + this.#encoder.encode(`--${boundary}\r\n`) + ); + const searchEndBoundary = new SearchArray( + this.#encoder.encode(`--${boundary}--\r\n`) + ); + const boundaryIndexes = searchBoundary.findAllIndexOf(data); + const endBoundaryIndex = searchEndBoundary.findIndexOf(data); if (endBoundaryIndex === -1) { throw new Error( "BatchResponse: Invalid response, no ending boundary found" ); } const indexes = boundaryIndexes.map((index, i) => ({ - start: index + boundaryBytes.length, - end: (boundaryIndexes[i + 1] || endBoundaryIndex) - this.#newline.length, + start: index + searchBoundary.pattern.length, + end: + (boundaryIndexes[i + 1] || endBoundaryIndex) - + this.#searchNewline.pattern.length, })); for (const { start, end } of indexes) { const parsedResponse = this.#parseEmbededResponse( @@ -202,7 +208,7 @@ export class BatchResponse { * ``` */ #parseEmbededResponse(data: Uint8Array) { - const partHeadersEndIndex = findIndexOf(data, this.#divider); + const partHeadersEndIndex = this.#searchDivider.findIndexOf(data); if (partHeadersEndIndex === -1) { throw new Error("BatchResponse: Invalid part, no headers found"); } @@ -214,16 +220,15 @@ export class BatchResponse { } const partBodyBytes = data.subarray( - partHeadersEndIndex + this.#divider.length + partHeadersEndIndex + this.#searchDivider.pattern.length ); - const responseHeadersEndIndex = findIndexOf(partBodyBytes, this.#divider); + const responseHeadersEndIndex = + this.#searchDivider.findIndexOf(partBodyBytes); if (responseHeadersEndIndex === -1) { throw new Error("BatchResponse: Invalid response"); } - const responseStatusLineEndIndex = findIndexOf( - partBodyBytes, - this.#newline - ); + const responseStatusLineEndIndex = + this.#searchNewline.findIndexOf(partBodyBytes); if (responseStatusLineEndIndex === -1) { throw new Error("BatchResponse: Invalid response status line"); } @@ -232,11 +237,11 @@ export class BatchResponse { responseStatusLineEndIndex ); const responseHeadersBytes = partBodyBytes.subarray( - responseStatusLineEndIndex + this.#newline.length, + responseStatusLineEndIndex + this.#searchNewline.pattern.length, responseHeadersEndIndex ); const responseBodyBytes = partBodyBytes.subarray( - responseHeadersEndIndex + this.#divider.length + responseHeadersEndIndex + this.#searchDivider.pattern.length ); const responseStatusLine = this.#parseStatusLine(responseStatusLineBytes); const responseHeaders = this.#parseHeaders(responseHeadersBytes); diff --git a/packages/fetch-batch/src/utils.test.ts b/packages/fetch-batch/src/utils.test.ts index c93e09d1..492c9310 100644 --- a/packages/fetch-batch/src/utils.test.ts +++ b/packages/fetch-batch/src/utils.test.ts @@ -1,4 +1,4 @@ -import { findIndexOf, findAllIndexOf, getLPS, concat } from "./utils"; +import { SearchArray, concat } from "./utils"; describe("utils", () => { describe("concat", () => { @@ -37,28 +37,32 @@ describe("utils", () => { it("should match simple pattern", () => { let text = new Uint8Array([1, 2, 3, 4, 5, 6, 7]); let pattern = new Uint8Array([2, 3, 4]); - let result = findIndexOf(text, pattern); + const search = new SearchArray(pattern); + let result = search.findIndexOf(text); expect(result).toBe(1); }); it("should match pattern at the end", () => { let text = new Uint8Array([1, 2, 3, 4, 5, 6, 7]); let pattern = new Uint8Array([6, 7]); - let result = findIndexOf(text, pattern); + const search = new SearchArray(pattern); + let result = search.findIndexOf(text); expect(result).toBe(5); }); it("should match pattern at the beginning", () => { let text = new Uint8Array([1, 2, 3, 4, 5, 6, 7]); let pattern = new Uint8Array([1, 2]); - let result = findIndexOf(text, pattern); + const search = new SearchArray(pattern); + let result = search.findIndexOf(text); expect(result).toBe(0); }); it("should match first when pattern appears more than once", () => { let text = new Uint8Array([3, 4, 5, 1, 2, 6, 7, 1, 2]); let pattern = new Uint8Array([1, 2]); - let result = findIndexOf(text, pattern); + const search = new SearchArray(pattern); + let result = search.findIndexOf(text); expect(result).toBe(3); }); @@ -68,7 +72,8 @@ describe("utils", () => { 1, ]); let pattern = new Uint8Array([1, 1, 1]); - let result = findIndexOf(text, pattern); + const search = new SearchArray(pattern); + let result = search.findIndexOf(text); expect(result).toBe(10); }); @@ -78,14 +83,16 @@ describe("utils", () => { 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 1, 3, 4, 5, ]); let pattern = new Uint8Array([1, 2, 3, 4, 5, 6, 7, 1, 3]); - let result = findIndexOf(text, pattern); + const search = new SearchArray(pattern); + let result = search.findIndexOf(text); expect(result).toEqual(13); }); it("should not match when pattern not in source", () => { let text = new Uint8Array([1, 2, 3, 4, 5, 6, 7]); let pattern = new Uint8Array([8, 9]); - let result = findIndexOf(text, pattern); + const search = new SearchArray(pattern); + let result = search.findIndexOf(text); expect(result).toBe(-1); }); }); @@ -94,42 +101,48 @@ describe("utils", () => { it("should match simple pattern", () => { let text = new Uint8Array([1, 2, 3, 4, 5, 6, 7]); let pattern = new Uint8Array([2, 3, 4]); - let result = findAllIndexOf(text, pattern); + const search = new SearchArray(pattern); + let result = search.findAllIndexOf(text); expect(result).toEqual([1]); }); it("should match pattern at the end", () => { let text = new Uint8Array([1, 2, 3, 4, 5, 6, 7]); let pattern = new Uint8Array([6, 7]); - let result = findAllIndexOf(text, pattern); + const search = new SearchArray(pattern); + let result = search.findAllIndexOf(text); expect(result).toEqual([5]); }); it("should match pattern at the beginning", () => { let text = new Uint8Array([1, 2, 3, 4, 5, 6, 7]); let pattern = new Uint8Array([1, 2]); - let result = findAllIndexOf(text, pattern); + const search = new SearchArray(pattern); + let result = search.findAllIndexOf(text); expect(result).toEqual([0]); }); it("should match multiple occurrences", () => { let text = new Uint8Array([3, 4, 5, 1, 2, 6, 7, 1, 2]); let pattern = new Uint8Array([1, 2]); - let result = findAllIndexOf(text, pattern); + const search = new SearchArray(pattern); + let result = search.findAllIndexOf(text); expect(result).toEqual([3, 7]); }); it("should match overlapping occurrences", () => { let text = new Uint8Array([1, 2, 1, 2, 1, 2]); let pattern = new Uint8Array([1, 2, 1, 2]); - let result = findAllIndexOf(text, pattern); + const search = new SearchArray(pattern); + let result = search.findAllIndexOf(text); expect(result).toEqual([0, 2]); }); it("should match overlapping occurrences at the end", () => { let text = new Uint8Array([1, 2, 1, 2, 1, 2]); let pattern = new Uint8Array([1, 2, 1]); - let result = findAllIndexOf(text, pattern); + const search = new SearchArray(pattern); + let result = search.findAllIndexOf(text); expect(result).toEqual([0, 2]); }); @@ -139,7 +152,8 @@ describe("utils", () => { 5, 6, 7, 1, 2, 3, 4, 5, 6, 7, 1, 3, 4, 5, ]); let pattern = new Uint8Array([1, 2, 3, 4, 5, 6, 7, 1, 3]); - let result = findAllIndexOf(text, pattern); + const search = new SearchArray(pattern); + let result = search.findAllIndexOf(text); expect(result).toEqual([13, 26]); }); @@ -149,14 +163,16 @@ describe("utils", () => { 1, ]); let pattern = new Uint8Array([1, 1, 1]); - let result = findAllIndexOf(text, pattern); + const search = new SearchArray(pattern); + let result = search.findAllIndexOf(text); expect(result).toEqual([10, 16, 17, 18, 19, 20, 21]); }); it("should not match when pattern not in source", () => { let text = new Uint8Array([1, 2, 3, 4, 5, 6, 7]); let pattern = new Uint8Array([8, 9]); - let result = findAllIndexOf(text, pattern); + const search = new SearchArray(pattern); + let result = search.findAllIndexOf(text); expect(result).toEqual([]); }); }); @@ -164,25 +180,25 @@ describe("utils", () => { describe("getLSP", () => { it("should return one item 0 array for empty pattern", () => { let pattern = new Uint8Array([]); - let result = getLPS(pattern); + let result = new SearchArray(pattern).lps; expect(result).toEqual([0]); }); it("should return zero filled array for pattern without repeated sequences", () => { let pattern = new Uint8Array([1, 2, 3, 4, 5, 6, 7]); - let result = getLPS(pattern); + let result = new SearchArray(pattern).lps; expect(result).toEqual([0, 0, 0, 0, 0, 0, 0]); }); it("should return non zero filled array for pattern with repeated sequences", () => { let pattern = new Uint8Array([1, 2, 1, 2, 1, 2]); - let result = getLPS(pattern); + let result = new SearchArray(pattern).lps; expect(result).toEqual([0, 0, 1, 2, 3, 4]); }); it("should return non zero filled array for pattern with repeated sequences within repeated sequences", () => { let pattern = new Uint8Array([1, 2, 1, 2, 1, 2, 3, 2]); - let result = getLPS(pattern); + let result = new SearchArray(pattern).lps; expect(result).toEqual([0, 0, 1, 2, 3, 4, 0, 0]); }); }); diff --git a/packages/fetch-batch/src/utils.ts b/packages/fetch-batch/src/utils.ts index f77946a1..f76e5320 100644 --- a/packages/fetch-batch/src/utils.ts +++ b/packages/fetch-batch/src/utils.ts @@ -12,118 +12,142 @@ export function concat(arrays: Uint8Array[]) { return result; } -/** - * Knuth-Morris-Pratt algorithm that finds all occurrences of pattern in a Uint8Array - * - * complexity: O(n + m) where n is the length of text and m is the length of pattern - * - * The algorithm is based on the fact that when a mismatch occurs, the pattern itself - * embodies sufficient information to determine where the next match could begin, thus - * bypassing re-examination of previously matched characters. - * - * The algorithm is described in detail here: https://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm - * - * @param source - the array to search in - * @param pattern - the pattern to search for - * @returns the array of indices where the pattern occurs in the source array - */ -export function findAllIndexOf( - source: Uint8Array, - pattern: Uint8Array -): number[] { - const result: number[] = []; - let i = 0; - let matchingLength = 0; - const patternLength = pattern.length; - const srcLength = source.length; - const lps = getLPS(pattern); - while (i < srcLength) { - if (pattern[matchingLength] === source[i]) { - matchingLength++; - i++; - } - if (matchingLength === patternLength) { - result.push(i - matchingLength); - matchingLength = lps[matchingLength - 1]; - } else if (i < srcLength && pattern[matchingLength] !== source[i]) { - if (matchingLength !== 0) { - matchingLength = lps[matchingLength - 1]; +type TypedArray = + | Uint8Array + | Uint8ClampedArray + | Uint16Array + | Uint32Array + | Int8Array + | Int16Array + | Int32Array + | BigUint64Array + | BigInt64Array + | Float32Array + | Float64Array; + +export class SearchArray { + #pattern: TArray; + #lps: number[]; + + constructor(pattern: TArray) { + this.#pattern = pattern; + this.#lps = this.#getLPS(pattern); + } + + get pattern() { + return this.#pattern; + } + + get lps() { + return this.#lps; + } + + /** + * Knuth-Morris-Pratt algorithm to compute the longest prefix that is also a suffix + * + * complexity: O(m) where m is the length of pattern + * + * The longest prefix that is also a suffix is used to determine where the next match + * could begin, thus bypassing re-examination of previously matched characters. + * + * The algorithm is described in detail here: https://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm + * + * @param pattern - the pattern to search for + * @returns an array of length where the value at index i is the length of the longest prefix that is also a suffix of pattern[0..i] + */ + #getLPS(pattern: TArray): number[] { + const result = [0]; + let selfMatchingLength = 0; + let i = 1; + const patternLength = pattern.length; + while (i < patternLength) { + if (pattern[i] === pattern[selfMatchingLength]) { + selfMatchingLength++; + result[i] = selfMatchingLength; + i++; + } else if (selfMatchingLength !== 0) { + selfMatchingLength = result[selfMatchingLength - 1]; } else { + result[i] = 0; i++; } } + return result; } - return result; -} -/** - * Knuth-Morris-Pratt algorithm that finds the first occurrence of pattern in a Uint8Array - * - * complexity: O(n + m) where n is the length of text and m is the length of pattern - * - * The algorithm is based on the fact that when a mismatch occurs, the pattern itself - * embodies sufficient information to determine where the next match could begin, thus - * bypassing re-examination of previously matched characters. - * - * The algorithm is described in detail here: https://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm - * - * @param source - the array to search in - * @param pattern - the pattern to search for - * @returns the index where the pattern occurs in the source array or -1 if it does not occur - */ -export function findIndexOf(source: Uint8Array, pattern: Uint8Array): number { - let i = 0; - let matchingLength = 0; - const patternLength = pattern.length; - const srcLength = source.length; - const lps = getLPS(pattern); - while (i < srcLength) { - if (pattern[matchingLength] === source[i]) { - matchingLength++; - i++; - } - if (matchingLength === patternLength) { - return i - matchingLength; - } else if (i < srcLength && pattern[matchingLength] !== source[i]) { - if (matchingLength !== 0) { - matchingLength = lps[matchingLength - 1]; - } else { + /** + * Knuth-Morris-Pratt algorithm that finds the first occurrence of pattern in a Uint8Array + * + * complexity: O(n + m) where n is the length of text and m is the length of pattern + * + * The algorithm is based on the fact that when a mismatch occurs, the pattern itself + * embodies sufficient information to determine where the next match could begin, thus + * bypassing re-examination of previously matched characters. + * + * The algorithm is described in detail here: https://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm + * + * @param source - the array to search in + * @param pattern - the pattern to search for + * @returns the index where the pattern occurs in the source array or -1 if it does not occur + */ + findIndexOf(source: TArray): number { + let i = 0; + let matchingLength = 0; + const srcLength = source.length; + while (i < srcLength) { + if (this.#pattern[matchingLength] === source[i]) { + matchingLength++; i++; } + if (matchingLength === this.#pattern.length) { + return i - matchingLength; + } else if (i < srcLength && this.#pattern[matchingLength] !== source[i]) { + if (matchingLength !== 0) { + matchingLength = this.#lps[matchingLength - 1]; + } else { + i++; + } + } } + return -1; } - return -1; -} -/** - * Knuth-Morris-Pratt algorithm to compute the longest prefix that is also a suffix - * - * complexity: O(m) where m is the length of pattern - * - * The longest prefix that is also a suffix is used to determine where the next match - * could begin, thus bypassing re-examination of previously matched characters. - * - * The algorithm is described in detail here: https://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm - * - * @param pattern - the pattern to search for - * @returns an array of length where the value at index i is the length of the longest prefix that is also a suffix of pattern[0..i] - */ -export function getLPS(pattern: Uint8Array): number[] { - const result = [0]; - let selfMatchingLength = 0; - let i = 1; - const patternLength = pattern.length; - while (i < patternLength) { - if (pattern[i] === pattern[selfMatchingLength]) { - selfMatchingLength++; - result[i] = selfMatchingLength; - i++; - } else if (selfMatchingLength !== 0) { - selfMatchingLength = result[selfMatchingLength - 1]; - } else { - result[i] = 0; - i++; + /** + * Knuth-Morris-Pratt algorithm that finds all occurrences of pattern in a Uint8Array + * + * complexity: O(n + m) where n is the length of text and m is the length of pattern + * + * The algorithm is based on the fact that when a mismatch occurs, the pattern itself + * embodies sufficient information to determine where the next match could begin, thus + * bypassing re-examination of previously matched characters. + * + * The algorithm is described in detail here: https://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm + * + * @param source - the array to search in + * @param pattern - the pattern to search for + * @returns the array of indices where the pattern occurs in the source array + */ + findAllIndexOf(source: TArray): number[] { + const result: number[] = []; + let i = 0; + let matchingLength = 0; + const srcLength = source.length; + while (i < srcLength) { + if (this.#pattern[matchingLength] === source[i]) { + matchingLength++; + i++; + } + if (matchingLength === this.#pattern.length) { + result.push(i - matchingLength); + matchingLength = this.#lps[matchingLength - 1]; + } else if (i < srcLength && this.#pattern[matchingLength] !== source[i]) { + if (matchingLength !== 0) { + matchingLength = this.#lps[matchingLength - 1]; + } else { + i++; + } + } } + return result; } - return result; } From 37ce4981ac2f4bfdb352fe01c624754c366dcee8 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Wed, 9 Aug 2023 21:41:17 +0200 Subject: [PATCH 158/206] refactor(batch): rename search functions --- packages/fetch-batch/src/batch-data.test.ts | 1 - .../fetch-batch/src/batch-request.test.ts | 4 --- packages/fetch-batch/src/batch-response.ts | 11 +++--- packages/fetch-batch/src/utils.test.ts | 36 +++++++++---------- packages/fetch-batch/src/utils.ts | 17 +++++---- 5 files changed, 34 insertions(+), 35 deletions(-) diff --git a/packages/fetch-batch/src/batch-data.test.ts b/packages/fetch-batch/src/batch-data.test.ts index 91bde093..e600f632 100644 --- a/packages/fetch-batch/src/batch-data.test.ts +++ b/packages/fetch-batch/src/batch-data.test.ts @@ -34,7 +34,6 @@ describe("BatchData", () => { app.use(express.raw({ type: "multipart/mixed" })); app.post("/batch", (req, res) => { - console.log("received batch request"); res.json({ url: req.url, method: req.method, diff --git a/packages/fetch-batch/src/batch-request.test.ts b/packages/fetch-batch/src/batch-request.test.ts index 8f6ed1ae..903a8820 100644 --- a/packages/fetch-batch/src/batch-request.test.ts +++ b/packages/fetch-batch/src/batch-request.test.ts @@ -51,13 +51,11 @@ describe("BatchRequest", () => { app.use(express.raw({ type: "multipart/mixed" })); app.post("/batch", (req, res) => { - console.log("received batch request"); res.setHeader( "Content-Type", "multipart/mixed; boundary=batch__1675206000000__batch" ); const body = req.body.toString(); - console.log(`received body: ${body}`); // extract the requests ids const regex = /content-id:\s*<([^>]+)>/g; const matches = [...body.matchAll(regex)]; @@ -68,12 +66,10 @@ describe("BatchRequest", () => { // replace the response placeholders with the actual response response = response.replace(`PLACEHOLDER${i + 1}`, id); }); - console.log(`sending response: ${response}`); res.status(200).send(response); }); app.get("/users/:id", (req, res) => { - console.log("received user request"); res.status(200).json({ id: req.params.id, name: "john doe", diff --git a/packages/fetch-batch/src/batch-response.ts b/packages/fetch-batch/src/batch-response.ts index ec734fc5..29160b03 100644 --- a/packages/fetch-batch/src/batch-response.ts +++ b/packages/fetch-batch/src/batch-response.ts @@ -137,8 +137,8 @@ export class BatchResponse { const searchEndBoundary = new SearchArray( this.#encoder.encode(`--${boundary}--\r\n`) ); - const boundaryIndexes = searchBoundary.findAllIndexOf(data); - const endBoundaryIndex = searchEndBoundary.findIndexOf(data); + const boundaryIndexes = searchBoundary.searchAll(data); + const endBoundaryIndex = searchEndBoundary.search(data); if (endBoundaryIndex === -1) { throw new Error( "BatchResponse: Invalid response, no ending boundary found" @@ -208,7 +208,7 @@ export class BatchResponse { * ``` */ #parseEmbededResponse(data: Uint8Array) { - const partHeadersEndIndex = this.#searchDivider.findIndexOf(data); + const partHeadersEndIndex = this.#searchDivider.search(data); if (partHeadersEndIndex === -1) { throw new Error("BatchResponse: Invalid part, no headers found"); } @@ -222,13 +222,12 @@ export class BatchResponse { const partBodyBytes = data.subarray( partHeadersEndIndex + this.#searchDivider.pattern.length ); - const responseHeadersEndIndex = - this.#searchDivider.findIndexOf(partBodyBytes); + const responseHeadersEndIndex = this.#searchDivider.search(partBodyBytes); if (responseHeadersEndIndex === -1) { throw new Error("BatchResponse: Invalid response"); } const responseStatusLineEndIndex = - this.#searchNewline.findIndexOf(partBodyBytes); + this.#searchNewline.search(partBodyBytes); if (responseStatusLineEndIndex === -1) { throw new Error("BatchResponse: Invalid response status line"); } diff --git a/packages/fetch-batch/src/utils.test.ts b/packages/fetch-batch/src/utils.test.ts index 492c9310..012ae57a 100644 --- a/packages/fetch-batch/src/utils.test.ts +++ b/packages/fetch-batch/src/utils.test.ts @@ -33,12 +33,12 @@ describe("utils", () => { }); describe("Knuth-Morris-Pratt algorithm", () => { - describe("findIndexOf", () => { + describe("search", () => { it("should match simple pattern", () => { let text = new Uint8Array([1, 2, 3, 4, 5, 6, 7]); let pattern = new Uint8Array([2, 3, 4]); const search = new SearchArray(pattern); - let result = search.findIndexOf(text); + let result = search.search(text); expect(result).toBe(1); }); @@ -46,7 +46,7 @@ describe("utils", () => { let text = new Uint8Array([1, 2, 3, 4, 5, 6, 7]); let pattern = new Uint8Array([6, 7]); const search = new SearchArray(pattern); - let result = search.findIndexOf(text); + let result = search.search(text); expect(result).toBe(5); }); @@ -54,7 +54,7 @@ describe("utils", () => { let text = new Uint8Array([1, 2, 3, 4, 5, 6, 7]); let pattern = new Uint8Array([1, 2]); const search = new SearchArray(pattern); - let result = search.findIndexOf(text); + let result = search.search(text); expect(result).toBe(0); }); @@ -62,7 +62,7 @@ describe("utils", () => { let text = new Uint8Array([3, 4, 5, 1, 2, 6, 7, 1, 2]); let pattern = new Uint8Array([1, 2]); const search = new SearchArray(pattern); - let result = search.findIndexOf(text); + let result = search.search(text); expect(result).toBe(3); }); @@ -73,7 +73,7 @@ describe("utils", () => { ]); let pattern = new Uint8Array([1, 1, 1]); const search = new SearchArray(pattern); - let result = search.findIndexOf(text); + let result = search.search(text); expect(result).toBe(10); }); @@ -84,7 +84,7 @@ describe("utils", () => { ]); let pattern = new Uint8Array([1, 2, 3, 4, 5, 6, 7, 1, 3]); const search = new SearchArray(pattern); - let result = search.findIndexOf(text); + let result = search.search(text); expect(result).toEqual(13); }); @@ -92,17 +92,17 @@ describe("utils", () => { let text = new Uint8Array([1, 2, 3, 4, 5, 6, 7]); let pattern = new Uint8Array([8, 9]); const search = new SearchArray(pattern); - let result = search.findIndexOf(text); + let result = search.search(text); expect(result).toBe(-1); }); }); - describe("findAllIndexOf", () => { + describe("searchAll", () => { it("should match simple pattern", () => { let text = new Uint8Array([1, 2, 3, 4, 5, 6, 7]); let pattern = new Uint8Array([2, 3, 4]); const search = new SearchArray(pattern); - let result = search.findAllIndexOf(text); + let result = search.searchAll(text); expect(result).toEqual([1]); }); @@ -110,7 +110,7 @@ describe("utils", () => { let text = new Uint8Array([1, 2, 3, 4, 5, 6, 7]); let pattern = new Uint8Array([6, 7]); const search = new SearchArray(pattern); - let result = search.findAllIndexOf(text); + let result = search.searchAll(text); expect(result).toEqual([5]); }); @@ -118,7 +118,7 @@ describe("utils", () => { let text = new Uint8Array([1, 2, 3, 4, 5, 6, 7]); let pattern = new Uint8Array([1, 2]); const search = new SearchArray(pattern); - let result = search.findAllIndexOf(text); + let result = search.searchAll(text); expect(result).toEqual([0]); }); @@ -126,7 +126,7 @@ describe("utils", () => { let text = new Uint8Array([3, 4, 5, 1, 2, 6, 7, 1, 2]); let pattern = new Uint8Array([1, 2]); const search = new SearchArray(pattern); - let result = search.findAllIndexOf(text); + let result = search.searchAll(text); expect(result).toEqual([3, 7]); }); @@ -134,7 +134,7 @@ describe("utils", () => { let text = new Uint8Array([1, 2, 1, 2, 1, 2]); let pattern = new Uint8Array([1, 2, 1, 2]); const search = new SearchArray(pattern); - let result = search.findAllIndexOf(text); + let result = search.searchAll(text); expect(result).toEqual([0, 2]); }); @@ -142,7 +142,7 @@ describe("utils", () => { let text = new Uint8Array([1, 2, 1, 2, 1, 2]); let pattern = new Uint8Array([1, 2, 1]); const search = new SearchArray(pattern); - let result = search.findAllIndexOf(text); + let result = search.searchAll(text); expect(result).toEqual([0, 2]); }); @@ -153,7 +153,7 @@ describe("utils", () => { ]); let pattern = new Uint8Array([1, 2, 3, 4, 5, 6, 7, 1, 3]); const search = new SearchArray(pattern); - let result = search.findAllIndexOf(text); + let result = search.searchAll(text); expect(result).toEqual([13, 26]); }); @@ -164,7 +164,7 @@ describe("utils", () => { ]); let pattern = new Uint8Array([1, 1, 1]); const search = new SearchArray(pattern); - let result = search.findAllIndexOf(text); + let result = search.searchAll(text); expect(result).toEqual([10, 16, 17, 18, 19, 20, 21]); }); @@ -172,7 +172,7 @@ describe("utils", () => { let text = new Uint8Array([1, 2, 3, 4, 5, 6, 7]); let pattern = new Uint8Array([8, 9]); const search = new SearchArray(pattern); - let result = search.findAllIndexOf(text); + let result = search.searchAll(text); expect(result).toEqual([]); }); }); diff --git a/packages/fetch-batch/src/utils.ts b/packages/fetch-batch/src/utils.ts index f76e5320..82d3ae7d 100644 --- a/packages/fetch-batch/src/utils.ts +++ b/packages/fetch-batch/src/utils.ts @@ -43,17 +43,22 @@ export class SearchArray { } /** - * Knuth-Morris-Pratt algorithm to compute the longest prefix that is also a suffix + * Knuth-Morris-Pratt algorithm to compute the failure array * * complexity: O(m) where m is the length of pattern * - * The longest prefix that is also a suffix is used to determine where the next match - * could begin, thus bypassing re-examination of previously matched characters. + * The algorithm is based on the fact that when a mismatch occurs, + * the pattern itself embodies sufficient information to determine + * where the next match could begin, thus bypassing re-examination + * of previously matched characters. + * + * The failure array is an array of integers where the value at index i denotes the length + * of the longest proper prefix of the substring pattern[0..i] which is also a suffix of this substring. * * The algorithm is described in detail here: https://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm * * @param pattern - the pattern to search for - * @returns an array of length where the value at index i is the length of the longest prefix that is also a suffix of pattern[0..i] + * @returns */ #getLPS(pattern: TArray): number[] { const result = [0]; @@ -90,7 +95,7 @@ export class SearchArray { * @param pattern - the pattern to search for * @returns the index where the pattern occurs in the source array or -1 if it does not occur */ - findIndexOf(source: TArray): number { + search(source: TArray): number { let i = 0; let matchingLength = 0; const srcLength = source.length; @@ -127,7 +132,7 @@ export class SearchArray { * @param pattern - the pattern to search for * @returns the array of indices where the pattern occurs in the source array */ - findAllIndexOf(source: TArray): number[] { + searchAll(source: TArray): number[] { const result: number[] = []; let i = 0; let matchingLength = 0; From 533d18bb3e2031e767e24d2bb861c8a08110d6da Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Wed, 9 Aug 2023 22:43:32 +0200 Subject: [PATCH 159/206] docs(batch): update readme --- packages/fetch-batch/README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/packages/fetch-batch/README.md b/packages/fetch-batch/README.md index 840cbedf..92be664b 100644 --- a/packages/fetch-batch/README.md +++ b/packages/fetch-batch/README.md @@ -1,5 +1,25 @@ # Batch support for fetch +## Main interface + +This allows to batch automatically all requests made within the same tick (aka the same event loop cycle) + +```ts + const client = new BatchRequest(`http://localhost:${port}/batch`, { + method: "POST", + }); + const [user1, user2, nothing] = await Promise.all([ + client + .fetch(`http://localhost:${port}/users/1`) + .then((res) => res.json()), + client + .fetch(`http://localhost:${port}/users/2`) + .then((res) => res.json()), + ]); +``` + +## Behind the scenes + ```ts // individual requests must target the same host const getUser1 = new Request(`http://localhost:${port}/get`, { From 6ac9ae901281aea6e5aaadc43481db8fe0035b51 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Thu, 10 Aug 2023 12:01:32 +0200 Subject: [PATCH 160/206] feat(batch): allow to cancel individual requests --- .../fetch-batch/src/batch-request.test.ts | 59 +++++++++++++++++++ packages/fetch-batch/src/batch-request.ts | 6 +- 2 files changed, 64 insertions(+), 1 deletion(-) diff --git a/packages/fetch-batch/src/batch-request.test.ts b/packages/fetch-batch/src/batch-request.test.ts index 903a8820..7cfecad3 100644 --- a/packages/fetch-batch/src/batch-request.test.ts +++ b/packages/fetch-batch/src/batch-request.test.ts @@ -148,4 +148,63 @@ describe("BatchRequest", () => { "Batch endpoint error: 404 Not Found" ); }); + + it("should cancel one request if asked to", async () => { + // use signal to cancel the request 2 + + const controller = new AbortController(); + const client = new BatchRequest(`http://localhost:${port}/batch`, { + method: "POST", + }); + + const [user1Promise, user2Promise, nothingPromise] = [ + client + .fetch(`http://localhost:${port}/users/1`) + .then((res) => res.json()), + client.fetch(`http://localhost:${port}/users/2`, { + signal: controller.signal, + }), + client.fetch(`http://localhost:${port}/users/1`), + ]; + controller.abort(); + + const [user1, user2, nothing] = await Promise.allSettled([ + user1Promise, + user2Promise, + nothingPromise, + ]); + + expect(user1.status).toBe("fulfilled"); + expect(user2.status).toBe("rejected"); + expect(nothing.status).toBe("fulfilled"); + }); + + it("should cancel all requests if asked to", async () => { + // use signal to cancel the BatchRequest + + const controller = new AbortController(); + const client = new BatchRequest(`http://localhost:${port}/batch`, { + method: "POST", + signal: controller.signal, + }); + + const [user1Promise, user2Promise, nothingPromise] = [ + client + .fetch(`http://localhost:${port}/users/1`) + .then((res) => res.json()), + client.fetch(`http://localhost:${port}/users/2`), + client.fetch(`http://localhost:${port}/users/1`), + ]; + controller.abort(); + + const [user1, user2, nothing] = await Promise.allSettled([ + user1Promise, + user2Promise, + nothingPromise, + ]); + + expect(user1.status).toBe("rejected"); + expect(user2.status).toBe("rejected"); + expect(nothing.status).toBe("rejected"); + }); }); diff --git a/packages/fetch-batch/src/batch-request.ts b/packages/fetch-batch/src/batch-request.ts index ba2393db..670728b8 100644 --- a/packages/fetch-batch/src/batch-request.ts +++ b/packages/fetch-batch/src/batch-request.ts @@ -93,7 +93,11 @@ export class BatchRequest { const callbacks = queue.get(request); queue.delete(request); if (callbacks) { - callbacks.resolve(response); + if (request.signal.aborted) { + callbacks.reject(new Error("request aborted")); + } else { + callbacks.resolve(response); + } } } } From 4e016d098a5161fefb55c9dfbe24d155b7af8e74 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Thu, 10 Aug 2023 12:16:00 +0200 Subject: [PATCH 161/206] feat(batch): allow to cancel even before batching --- .../fetch-batch/src/batch-request.test.ts | 59 +++++++++++++++++-- packages/fetch-batch/src/batch-request.ts | 23 +++++--- 2 files changed, 71 insertions(+), 11 deletions(-) diff --git a/packages/fetch-batch/src/batch-request.test.ts b/packages/fetch-batch/src/batch-request.test.ts index 7cfecad3..538eaad4 100644 --- a/packages/fetch-batch/src/batch-request.test.ts +++ b/packages/fetch-batch/src/batch-request.test.ts @@ -149,9 +149,35 @@ describe("BatchRequest", () => { ); }); - it("should cancel one request if asked to", async () => { - // use signal to cancel the request 2 + it("should cancel one request if asked to before batching", async () => { + const controller = new AbortController(); + controller.abort(); + const client = new BatchRequest(`http://localhost:${port}/batch`, { + method: "POST", + }); + + const [user1Promise, user2Promise, nothingPromise] = [ + client + .fetch(`http://localhost:${port}/users/1`) + .then((res) => res.json()), + client.fetch(`http://localhost:${port}/users/2`, { + signal: controller.signal, + }), + client.fetch(`http://localhost:${port}/users/1`), + ]; + + const [user1, user2, nothing] = await Promise.allSettled([ + user1Promise, + user2Promise, + nothingPromise, + ]); + + expect(user1.status).toBe("fulfilled"); + expect(user2.status).toBe("rejected"); + expect(nothing.status).toBe("fulfilled"); + }); + it("should cancel one request if asked to after batching", async () => { const controller = new AbortController(); const client = new BatchRequest(`http://localhost:${port}/batch`, { method: "POST", @@ -179,9 +205,34 @@ describe("BatchRequest", () => { expect(nothing.status).toBe("fulfilled"); }); - it("should cancel all requests if asked to", async () => { - // use signal to cancel the BatchRequest + it("should cancel all requests if asked to before batching", async () => { + const controller = new AbortController(); + controller.abort(); + const client = new BatchRequest(`http://localhost:${port}/batch`, { + method: "POST", + signal: controller.signal, + }); + + const [user1Promise, user2Promise, nothingPromise] = [ + client + .fetch(`http://localhost:${port}/users/1`) + .then((res) => res.json()), + client.fetch(`http://localhost:${port}/users/2`), + client.fetch(`http://localhost:${port}/users/1`), + ]; + + const [user1, user2, nothing] = await Promise.allSettled([ + user1Promise, + user2Promise, + nothingPromise, + ]); + + expect(user1.status).toBe("rejected"); + expect(user2.status).toBe("rejected"); + expect(nothing.status).toBe("rejected"); + }); + it("should cancel all requests if asked to after batching", async () => { const controller = new AbortController(); const client = new BatchRequest(`http://localhost:${port}/batch`, { method: "POST", diff --git a/packages/fetch-batch/src/batch-request.ts b/packages/fetch-batch/src/batch-request.ts index 670728b8..d5d2efea 100644 --- a/packages/fetch-batch/src/batch-request.ts +++ b/packages/fetch-batch/src/batch-request.ts @@ -1,6 +1,20 @@ import { BatchData } from "./batch-data"; import { BatchResponse } from "./batch-response"; +type BatchCallbacks = { + resolve: (value: Response) => void; + reject: (reason?: unknown) => void; +}; + +function cancelAbortedRequests(queue: Map) { + for (const [request, callbacks] of queue.entries()) { + if (request.signal.aborted) { + queue.delete(request); + callbacks.reject(new Error("request aborted")); + } + } +} + /** * A batch request handler * @@ -9,13 +23,7 @@ import { BatchResponse } from "./batch-response"; * Your server should be able to handle this request and return a multipart/mixed response */ export class BatchRequest { - #queue = new Map< - Request, - { - resolve: (value: Response) => void; - reject: (reason?: any) => void; - } - >(); + #queue = new Map(); #timer?: ReturnType; #input: RequestInfo | URL; #init?: RequestInit; @@ -65,6 +73,7 @@ export class BatchRequest { async #dispatch() { const queue = new Map(this.#queue); this.#clear(); + cancelAbortedRequests(queue); if (queue.size === 1) { const [request, callbacks] = queue.entries().next().value; try { From 651acf132e54e79bcd6b8eba1781ad2c35850591 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Thu, 10 Aug 2023 14:18:02 +0200 Subject: [PATCH 162/206] feat(batch): allow to cancel all pending batched requests --- .../fetch-batch/src/batch-request.test.ts | 35 +++++++++++++------ packages/fetch-batch/src/batch-request.ts | 15 ++++++++ 2 files changed, 40 insertions(+), 10 deletions(-) diff --git a/packages/fetch-batch/src/batch-request.test.ts b/packages/fetch-batch/src/batch-request.test.ts index 538eaad4..de83396c 100644 --- a/packages/fetch-batch/src/batch-request.test.ts +++ b/packages/fetch-batch/src/batch-request.test.ts @@ -205,14 +205,13 @@ describe("BatchRequest", () => { expect(nothing.status).toBe("fulfilled"); }); - it("should cancel all requests if asked to before batching", async () => { - const controller = new AbortController(); - controller.abort(); + it("should not cancel requests if asked to before batching", async () => { const client = new BatchRequest(`http://localhost:${port}/batch`, { method: "POST", - signal: controller.signal, }); + client.cancel(); + const [user1Promise, user2Promise, nothingPromise] = [ client .fetch(`http://localhost:${port}/users/1`) @@ -227,16 +226,14 @@ describe("BatchRequest", () => { nothingPromise, ]); - expect(user1.status).toBe("rejected"); - expect(user2.status).toBe("rejected"); - expect(nothing.status).toBe("rejected"); + expect(user1.status).toBe("fulfilled"); + expect(user2.status).toBe("fulfilled"); + expect(nothing.status).toBe("fulfilled"); }); it("should cancel all requests if asked to after batching", async () => { - const controller = new AbortController(); const client = new BatchRequest(`http://localhost:${port}/batch`, { method: "POST", - signal: controller.signal, }); const [user1Promise, user2Promise, nothingPromise] = [ @@ -246,7 +243,7 @@ describe("BatchRequest", () => { client.fetch(`http://localhost:${port}/users/2`), client.fetch(`http://localhost:${port}/users/1`), ]; - controller.abort(); + client.cancel(); const [user1, user2, nothing] = await Promise.allSettled([ user1Promise, @@ -257,5 +254,23 @@ describe("BatchRequest", () => { expect(user1.status).toBe("rejected"); expect(user2.status).toBe("rejected"); expect(nothing.status).toBe("rejected"); + + const [user1Promise2, user2Promise2, nothingPromise2] = [ + client + .fetch(`http://localhost:${port}/users/1`) + .then((res) => res.json()), + client.fetch(`http://localhost:${port}/users/2`), + client.fetch(`http://localhost:${port}/users/1`), + ]; + + const [user12, user22, nothing2] = await Promise.allSettled([ + user1Promise2, + user2Promise2, + nothingPromise2, + ]); + + expect(user12.status).toBe("fulfilled"); + expect(user22.status).toBe("fulfilled"); + expect(nothing2.status).toBe("fulfilled"); }); }); diff --git a/packages/fetch-batch/src/batch-request.ts b/packages/fetch-batch/src/batch-request.ts index d5d2efea..640a8de3 100644 --- a/packages/fetch-batch/src/batch-request.ts +++ b/packages/fetch-batch/src/batch-request.ts @@ -27,6 +27,7 @@ export class BatchRequest { #timer?: ReturnType; #input: RequestInfo | URL; #init?: RequestInit; + #controller?: AbortController; /** * create a new batch request handler @@ -38,6 +39,16 @@ export class BatchRequest { this.#init = init; } + /** + * cancel all pending requests + * if no request is pending, it does nothing + */ + cancel() { + if (this.#controller) { + this.#controller.abort(); + } + } + /** * fetch a request and return a promise that resolves with the response * @@ -53,6 +64,7 @@ export class BatchRequest { this.#queue.set(request, { resolve, reject }); if (!this.#timer) { const dispatch = this.#dispatch.bind(this); + this.#controller = new AbortController(); this.#timer = setTimeout(dispatch, 0); } }); @@ -64,6 +76,7 @@ export class BatchRequest { #clear() { clearTimeout(this.#timer); this.#timer = undefined; + this.#controller = undefined; this.#queue.clear(); } @@ -72,6 +85,7 @@ export class BatchRequest { */ async #dispatch() { const queue = new Map(this.#queue); + const controller = this.#controller; this.#clear(); cancelAbortedRequests(queue); if (queue.size === 1) { @@ -93,6 +107,7 @@ export class BatchRequest { ...this.#init, headers: batchData.getHeaders(this.#init?.headers), body: batchData.stream(), + signal: controller?.signal, }); if (response.ok) { const batchResponse = new BatchResponse(response); From 4a36a29fdd22665a699e75a29f6c72c1ca33936f Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Thu, 10 Aug 2023 16:38:07 +0200 Subject: [PATCH 163/206] fix(batch): reject with DomException --- packages/fetch-batch/src/batch-request.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/fetch-batch/src/batch-request.ts b/packages/fetch-batch/src/batch-request.ts index 640a8de3..1ddcb91d 100644 --- a/packages/fetch-batch/src/batch-request.ts +++ b/packages/fetch-batch/src/batch-request.ts @@ -10,7 +10,7 @@ function cancelAbortedRequests(queue: Map) { for (const [request, callbacks] of queue.entries()) { if (request.signal.aborted) { queue.delete(request); - callbacks.reject(new Error("request aborted")); + callbacks.reject(new DOMException("Aborted", "AbortError")); } } } @@ -118,7 +118,9 @@ export class BatchRequest { queue.delete(request); if (callbacks) { if (request.signal.aborted) { - callbacks.reject(new Error("request aborted")); + callbacks.reject( + new DOMException("request aborted", "AbortError") + ); } else { callbacks.resolve(response); } From 4f6249955e29060fd1e4a9444847e8250dc45060 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Thu, 10 Aug 2023 17:04:17 +0200 Subject: [PATCH 164/206] chore(batch): cancel batched requests as soon as possible --- packages/fetch-batch/src/batch-request.ts | 26 +++++++++++++++-------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/packages/fetch-batch/src/batch-request.ts b/packages/fetch-batch/src/batch-request.ts index 1ddcb91d..c819bb1b 100644 --- a/packages/fetch-batch/src/batch-request.ts +++ b/packages/fetch-batch/src/batch-request.ts @@ -63,9 +63,8 @@ export class BatchRequest { const request = new Request(input, init); this.#queue.set(request, { resolve, reject }); if (!this.#timer) { - const dispatch = this.#dispatch.bind(this); this.#controller = new AbortController(); - this.#timer = setTimeout(dispatch, 0); + this.#timer = setTimeout(() => this.#dispatch(), 0); } }); } @@ -101,6 +100,9 @@ export class BatchRequest { const batchData = new BatchData(); for (const request of queue.keys()) { batchData.addRequest(request); + request.signal?.addEventListener("abort", () => + this.#cancelRequestInQueue(queue, request) + ); } try { const response = await fetch(this.#input, { @@ -117,13 +119,7 @@ export class BatchRequest { const callbacks = queue.get(request); queue.delete(request); if (callbacks) { - if (request.signal.aborted) { - callbacks.reject( - new DOMException("request aborted", "AbortError") - ); - } else { - callbacks.resolve(response); - } + callbacks.resolve(response); } } } @@ -148,4 +144,16 @@ export class BatchRequest { } } } + + #cancelRequestInQueue(queue: Map, request: Request) { + const callbacks = queue.get(request); + if (callbacks) { + queue.delete(request); + callbacks.reject(new DOMException("Aborted", "AbortError")); + if (queue.size === 0) { + // abort the batch request if all requests are aborted + this.#controller?.abort(); + } + } + } } From 9e2bd2e6faec51b03151d5e239a437ecf84d0340 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Thu, 10 Aug 2023 17:05:22 +0200 Subject: [PATCH 165/206] doc(batch): document cancelling --- packages/fetch-batch/README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/packages/fetch-batch/README.md b/packages/fetch-batch/README.md index 92be664b..42661386 100644 --- a/packages/fetch-batch/README.md +++ b/packages/fetch-batch/README.md @@ -18,6 +18,32 @@ This allows to batch automatically all requests made within the same tick (aka t ]); ``` +## canceling individual requests + +You can cancel requests individually using standard AborController. +If all requests are canceled, the batched request is canceled as well to return as soon as possible. + +```ts + const controller = new AbortController(); + const client = new BatchRequest(`http://localhost:${port}/batch`, { + method: "POST", + }); + const [user1, user2, nothing] = [ + client + .fetch(`http://localhost:${port}/users/1`, { + signal: controller.signal, + }) + .then((res) => res.json()), + client + .fetch(`http://localhost:${port}/users/2`) + .then((res) => res.json()), + ]; + controller.abort(); + Promise.all([user1, user2]).catch((err) => { + expect(err.name).toBe("AbortError"); + }); +``` + ## Behind the scenes ```ts From cb23bbb5b95563d661b69d060680e9377b2cdc42 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Thu, 10 Aug 2023 21:57:57 +0200 Subject: [PATCH 166/206] feat(batch): batch request on http error should be dispatched --- .../fetch-batch/src/batch-request.test.ts | 124 +++++++++++++++--- packages/fetch-batch/src/batch-request.ts | 6 +- 2 files changed, 106 insertions(+), 24 deletions(-) diff --git a/packages/fetch-batch/src/batch-request.test.ts b/packages/fetch-batch/src/batch-request.test.ts index de83396c..0cdc36bf 100644 --- a/packages/fetch-batch/src/batch-request.test.ts +++ b/packages/fetch-batch/src/batch-request.test.ts @@ -40,6 +40,8 @@ HTTP/1.1 304 Not Modified Epilogue can be anything and should be ignored`.replace(/\n/g, "\r\n"); +const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); + describe("BatchRequest", () => { let app: express.Express; let server: ReturnType; @@ -69,6 +71,13 @@ describe("BatchRequest", () => { res.status(200).send(response); }); + app.post("/batch-pending", async (req, res) => { + await sleep(1000); + res.status(504).json({ + error: "timeout", + }); + }); + app.get("/users/:id", (req, res) => { res.status(200).json({ id: req.params.id, @@ -76,6 +85,12 @@ describe("BatchRequest", () => { }); }); + app.post("/batch-error", (req, res) => { + res.status(500).json({ + error: "internal server error", + }); + }); + server = app.listen(0); port = (server.address() as AddressInfo).port; }); @@ -128,25 +143,22 @@ describe("BatchRequest", () => { method: "POST", }); - let error; - try { - const [user1, user2, nothing] = await Promise.all([ - client - .fetch(`http://localhost:${port}/users/1`) - .then((res) => res.json()), - client - .fetch(`http://localhost:${port}/users/2`) - .then((res) => res.json()), - client.fetch(`http://localhost:${port}/users/1`), - ]); - } catch (e) { - error = e; - } - - expect(error).toBeDefined(); - expect((error as Error).message).toBe( - "Batch endpoint error: 404 Not Found" - ); + const [user1, user2, nothing] = await Promise.all([ + client + .fetch(`http://localhost:${port}/users/1`) + .then((res) => res.json()), + client + .fetch(`http://localhost:${port}/users/2`) + .then((res) => res.json()), + client.fetch(`http://localhost:${port}/users/1`), + ]); + expect(user1).toEqual({ + error: "internal server error", + }); + expect(user2).toEqual({ + error: "internal server error", + }); + expect(nothing.status).toBe(500); }); it("should cancel one request if asked to before batching", async () => { @@ -273,4 +285,78 @@ describe("BatchRequest", () => { expect(user22.status).toBe("fulfilled"); expect(nothing2.status).toBe("fulfilled"); }); + + it("should cancel all individual requests if asked to after batching", async () => { + const client = new BatchRequest(`http://localhost:${port}/batch-pending`, { + method: "POST", + }); + + const controller = new AbortController(); + + const [user1Promise, user2Promise, nothingPromise] = [ + client + .fetch(`http://localhost:${port}/users/1`, { + signal: controller.signal, + }) + .then((res) => res.json()), + client.fetch(`http://localhost:${port}/users/2`, { + signal: controller.signal, + }), + client.fetch(`http://localhost:${port}/users/1`, { + signal: controller.signal, + }), + ]; + await sleep(100); + controller.abort(); + + const [user1, user2, nothing] = await Promise.allSettled([ + user1Promise, + user2Promise, + nothingPromise, + ]); + + expect(user1.status).toBe("rejected"); + expect((user1 as PromiseRejectedResult).reason).toBeInstanceOf( + DOMException + ); + expect(user2.status).toBe("rejected"); + expect((user2 as PromiseRejectedResult).reason).toBeInstanceOf( + DOMException + ); + expect(nothing.status).toBe("rejected"); + expect((nothing as PromiseRejectedResult).reason).toBeInstanceOf( + DOMException + ); + + const [user12, user22, nothing2] = await Promise.allSettled([ + client + .fetch(`http://localhost:${port}/users/1`) + .then((res) => res.json()), + client + .fetch(`http://localhost:${port}/users/2`) + .then((res) => res.json()), + client + .fetch(`http://localhost:${port}/users/1`) + .then((res) => res.json()), + ]); + + expect(user12.status).toBe("fulfilled"); + expect((user12 as PromiseFulfilledResult<{ error: string }>).value).toEqual( + { + error: "timeout", + } + ); + expect(user22.status).toBe("fulfilled"); + expect((user22 as PromiseFulfilledResult<{ error: string }>).value).toEqual( + { + error: "timeout", + } + ); + expect(nothing2.status).toBe("fulfilled"); + expect( + (nothing2 as PromiseFulfilledResult<{ error: string }>).value + ).toEqual({ + error: "timeout", + }); + }); }); diff --git a/packages/fetch-batch/src/batch-request.ts b/packages/fetch-batch/src/batch-request.ts index c819bb1b..e211111b 100644 --- a/packages/fetch-batch/src/batch-request.ts +++ b/packages/fetch-batch/src/batch-request.ts @@ -130,11 +130,7 @@ export class BatchRequest { } } else { for (const callbacks of queue.values()) { - callbacks.reject( - new Error( - `Batch endpoint error: ${response.status} ${response.statusText}` - ) - ); + callbacks.resolve(response.clone()); } } } catch (error) { From 69e08fb82ec60c038a23c8206ceeb98311b5e084 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Thu, 10 Aug 2023 22:10:36 +0200 Subject: [PATCH 167/206] docs(batch): better cancel example --- packages/fetch-batch/README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/fetch-batch/README.md b/packages/fetch-batch/README.md index 42661386..9a9358eb 100644 --- a/packages/fetch-batch/README.md +++ b/packages/fetch-batch/README.md @@ -39,9 +39,8 @@ If all requests are canceled, the batched request is canceled as well to return .then((res) => res.json()), ]; controller.abort(); - Promise.all([user1, user2]).catch((err) => { - expect(err.name).toBe("AbortError"); - }); + await expect(user1).rejects.toThrow("Aborted"); + await expect(user2).resolves.toEqual({ id: 2, name: "Jane Doe" }); ``` ## Behind the scenes From 13cdfa9da4c6a8c3acbacb66dc489418f9342e80 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Thu, 10 Aug 2023 22:19:31 +0200 Subject: [PATCH 168/206] test(batch): simplify tests --- .../fetch-batch/src/batch-request.test.ts | 62 +++++++------------ 1 file changed, 21 insertions(+), 41 deletions(-) diff --git a/packages/fetch-batch/src/batch-request.test.ts b/packages/fetch-batch/src/batch-request.test.ts index 0cdc36bf..a5217f90 100644 --- a/packages/fetch-batch/src/batch-request.test.ts +++ b/packages/fetch-batch/src/batch-request.test.ts @@ -299,36 +299,25 @@ describe("BatchRequest", () => { signal: controller.signal, }) .then((res) => res.json()), - client.fetch(`http://localhost:${port}/users/2`, { - signal: controller.signal, - }), - client.fetch(`http://localhost:${port}/users/1`, { - signal: controller.signal, - }), + client + .fetch(`http://localhost:${port}/users/2`, { + signal: controller.signal, + }) + .then((res) => res.json()), + client + .fetch(`http://localhost:${port}/users/1`, { + signal: controller.signal, + }) + .then((res) => res.json()), ]; await sleep(100); controller.abort(); - const [user1, user2, nothing] = await Promise.allSettled([ - user1Promise, - user2Promise, - nothingPromise, - ]); - - expect(user1.status).toBe("rejected"); - expect((user1 as PromiseRejectedResult).reason).toBeInstanceOf( - DOMException - ); - expect(user2.status).toBe("rejected"); - expect((user2 as PromiseRejectedResult).reason).toBeInstanceOf( - DOMException - ); - expect(nothing.status).toBe("rejected"); - expect((nothing as PromiseRejectedResult).reason).toBeInstanceOf( - DOMException - ); + await expect(user1Promise).rejects.toThrow("Aborted"); + await expect(user2Promise).rejects.toThrow("Aborted"); + await expect(nothingPromise).rejects.toThrow("Aborted"); - const [user12, user22, nothing2] = await Promise.allSettled([ + const [user12, user22, nothing2] = await Promise.all([ client .fetch(`http://localhost:${port}/users/1`) .then((res) => res.json()), @@ -340,22 +329,13 @@ describe("BatchRequest", () => { .then((res) => res.json()), ]); - expect(user12.status).toBe("fulfilled"); - expect((user12 as PromiseFulfilledResult<{ error: string }>).value).toEqual( - { - error: "timeout", - } - ); - expect(user22.status).toBe("fulfilled"); - expect((user22 as PromiseFulfilledResult<{ error: string }>).value).toEqual( - { - error: "timeout", - } - ); - expect(nothing2.status).toBe("fulfilled"); - expect( - (nothing2 as PromiseFulfilledResult<{ error: string }>).value - ).toEqual({ + expect(user12).toEqual({ + error: "timeout", + }); + expect(user22).toEqual({ + error: "timeout", + }); + expect(nothing2).toEqual({ error: "timeout", }); }); From 4d3b0ee6ce469044bf60ce4443e452dd38772a7d Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Thu, 10 Aug 2023 22:28:40 +0200 Subject: [PATCH 169/206] test(batch): simplify tests --- packages/fetch-batch/README.md | 26 +++++++-------- .../fetch-batch/src/batch-request.test.ts | 32 +++++++++---------- 2 files changed, 28 insertions(+), 30 deletions(-) diff --git a/packages/fetch-batch/README.md b/packages/fetch-batch/README.md index 9a9358eb..28c39cae 100644 --- a/packages/fetch-batch/README.md +++ b/packages/fetch-batch/README.md @@ -24,21 +24,21 @@ You can cancel requests individually using standard AborController. If all requests are canceled, the batched request is canceled as well to return as soon as possible. ```ts - const controller = new AbortController(); - const client = new BatchRequest(`http://localhost:${port}/batch`, { + const client = new BatchRequest(`http://localhost:${port}/batch-pending`, { method: "POST", }); - const [user1, user2, nothing] = [ - client - .fetch(`http://localhost:${port}/users/1`, { - signal: controller.signal, - }) - .then((res) => res.json()), - client - .fetch(`http://localhost:${port}/users/2`) - .then((res) => res.json()), - ]; - controller.abort(); + + const controller = new AbortController(); + + const user1 = client + .fetch(`http://localhost:${port}/users/1`, { signal: controller.signal }).then((res) => res.json()); + + const user2 = client + .fetch(`http://localhost:${port}/users/2`, { signal: controller.signal }).then((res) => res.json()); + + await sleep(100); // be sure requests are sent + controller.abort(); // abort all requests afterwards + await expect(user1).rejects.toThrow("Aborted"); await expect(user2).resolves.toEqual({ id: 2, name: "Jane Doe" }); ``` diff --git a/packages/fetch-batch/src/batch-request.test.ts b/packages/fetch-batch/src/batch-request.test.ts index a5217f90..53475a92 100644 --- a/packages/fetch-batch/src/batch-request.test.ts +++ b/packages/fetch-batch/src/batch-request.test.ts @@ -293,23 +293,21 @@ describe("BatchRequest", () => { const controller = new AbortController(); - const [user1Promise, user2Promise, nothingPromise] = [ - client - .fetch(`http://localhost:${port}/users/1`, { - signal: controller.signal, - }) - .then((res) => res.json()), - client - .fetch(`http://localhost:${port}/users/2`, { - signal: controller.signal, - }) - .then((res) => res.json()), - client - .fetch(`http://localhost:${port}/users/1`, { - signal: controller.signal, - }) - .then((res) => res.json()), - ]; + const user1Promise = client + .fetch(`http://localhost:${port}/users/1`, { + signal: controller.signal, + }) + .then((res) => res.json()); + const user2Promise = client + .fetch(`http://localhost:${port}/users/2`, { + signal: controller.signal, + }) + .then((res) => res.json()); + const nothingPromise = client + .fetch(`http://localhost:${port}/users/1`, { + signal: controller.signal, + }) + .then((res) => res.json()); await sleep(100); controller.abort(); From 42243aed3572f8dc3beed093664d552a1a290078 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Thu, 10 Aug 2023 22:32:13 +0200 Subject: [PATCH 170/206] docs(batch): simplify example --- packages/fetch-batch/README.md | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/packages/fetch-batch/README.md b/packages/fetch-batch/README.md index 28c39cae..d315817b 100644 --- a/packages/fetch-batch/README.md +++ b/packages/fetch-batch/README.md @@ -5,17 +5,21 @@ This allows to batch automatically all requests made within the same tick (aka the same event loop cycle) ```ts - const client = new BatchRequest(`http://localhost:${port}/batch`, { + const client = new BatchRequest(`/batch`, { method: "POST", }); - const [user1, user2, nothing] = await Promise.all([ + + const [user1, user2] = await Promise.all([ client - .fetch(`http://localhost:${port}/users/1`) + .fetch(`/users/1`) .then((res) => res.json()), client - .fetch(`http://localhost:${port}/users/2`) + .fetch(`/users/2`) .then((res) => res.json()), ]); + + expect(user1).toEqual({ id: 1, name: "John Doe" }); + expect(user2).toEqual({ id: 2, name: "Jane Doe" }); ``` ## canceling individual requests @@ -24,20 +28,22 @@ You can cancel requests individually using standard AborController. If all requests are canceled, the batched request is canceled as well to return as soon as possible. ```ts - const client = new BatchRequest(`http://localhost:${port}/batch-pending`, { + const client = new BatchRequest(`/batch`, { method: "POST", }); const controller = new AbortController(); const user1 = client - .fetch(`http://localhost:${port}/users/1`, { signal: controller.signal }).then((res) => res.json()); + .fetch(`/users/1`, { signal: controller.signal }).then((res) => res.json()); const user2 = client - .fetch(`http://localhost:${port}/users/2`, { signal: controller.signal }).then((res) => res.json()); + .fetch(`/users/2`, { signal: controller.signal }).then((res) => res.json()); - await sleep(100); // be sure requests are sent - controller.abort(); // abort all requests afterwards + // be sure requests are sent + await sleep(100); + // abort all requests afterwards + controller.abort(); await expect(user1).rejects.toThrow("Aborted"); await expect(user2).resolves.toEqual({ id: 2, name: "Jane Doe" }); From ee7cc7461d69d0e07d4ecd4b81d482b7f8d20783 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Thu, 10 Aug 2023 22:33:52 +0200 Subject: [PATCH 171/206] docs(batch): fix example --- packages/fetch-batch/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/fetch-batch/README.md b/packages/fetch-batch/README.md index d315817b..71fa7f2c 100644 --- a/packages/fetch-batch/README.md +++ b/packages/fetch-batch/README.md @@ -42,7 +42,7 @@ If all requests are canceled, the batched request is canceled as well to return // be sure requests are sent await sleep(100); - // abort all requests afterwards + // abort request 2 afterwards controller.abort(); await expect(user1).rejects.toThrow("Aborted"); From a61bf61159d952609a390df893b04f64e8cbcd9b Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Thu, 10 Aug 2023 22:50:01 +0200 Subject: [PATCH 172/206] fix(batch): only handle batch response if it's multipart/mixed --- packages/fetch-batch/src/batch-request.test.ts | 14 ++++++++------ packages/fetch-batch/src/batch-request.ts | 8 +++++++- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/packages/fetch-batch/src/batch-request.test.ts b/packages/fetch-batch/src/batch-request.test.ts index 53475a92..6e91c27b 100644 --- a/packages/fetch-batch/src/batch-request.test.ts +++ b/packages/fetch-batch/src/batch-request.test.ts @@ -71,6 +71,7 @@ describe("BatchRequest", () => { res.status(200).send(response); }); + // simulate a proxy timeout that don't handle multipart/mixed app.post("/batch-pending", async (req, res) => { await sleep(1000); res.status(504).json({ @@ -78,6 +79,13 @@ describe("BatchRequest", () => { }); }); + // simulate an internal server error that don't send back multipart/mixed + app.post("/batch-error", (req, res) => { + res.status(500).json({ + error: "internal server error", + }); + }); + app.get("/users/:id", (req, res) => { res.status(200).json({ id: req.params.id, @@ -85,12 +93,6 @@ describe("BatchRequest", () => { }); }); - app.post("/batch-error", (req, res) => { - res.status(500).json({ - error: "internal server error", - }); - }); - server = app.listen(0); port = (server.address() as AddressInfo).port; }); diff --git a/packages/fetch-batch/src/batch-request.ts b/packages/fetch-batch/src/batch-request.ts index e211111b..cf5d2f2e 100644 --- a/packages/fetch-batch/src/batch-request.ts +++ b/packages/fetch-batch/src/batch-request.ts @@ -111,7 +111,9 @@ export class BatchRequest { body: batchData.stream(), signal: controller?.signal, }); - if (response.ok) { + if ( + response.headers.get("Content-Type")?.startsWith("multipart/mixed") + ) { const batchResponse = new BatchResponse(response); for await (const [contentId, response] of batchResponse) { const request = batchData.getRequest(contentId); @@ -129,6 +131,10 @@ export class BatchRequest { } } } else { + // response is not not multipart/mixed, so it's probably an error by an intermediary proxy + // let's just resolve all requests with the same response + // this is not ideal, but it's better than rejecting all requests + // it allows the user to handle the error in a more granular way for (const callbacks of queue.values()) { callbacks.resolve(response.clone()); } From 260a32eee49862497c48711717c05e393229d2e3 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Thu, 10 Aug 2023 23:36:39 +0200 Subject: [PATCH 173/206] feat(batch): add customisation options --- packages/fetch-batch/README.md | 42 +++++- .../fetch-batch/src/batch-request.test.ts | 56 +++++--- packages/fetch-batch/src/batch-request.ts | 121 +++++++++++------- 3 files changed, 151 insertions(+), 68 deletions(-) diff --git a/packages/fetch-batch/README.md b/packages/fetch-batch/README.md index 71fa7f2c..a34a556d 100644 --- a/packages/fetch-batch/README.md +++ b/packages/fetch-batch/README.md @@ -5,8 +5,9 @@ This allows to batch automatically all requests made within the same tick (aka the same event loop cycle) ```ts - const client = new BatchRequest(`/batch`, { - method: "POST", + const client = new BatchRequest({ + input: `/batch`, + init: { method: "POST" } }); const [user1, user2] = await Promise.all([ @@ -22,14 +23,47 @@ This allows to batch automatically all requests made within the same tick (aka t expect(user2).toEqual({ id: 2, name: "Jane Doe" }); ``` +## Always Batch + +By default if only one request is pending, the request is sent immediately to the final endpoint without using the batch endpoint. +If you want to always use the batch endpoint, you can use the `alwaysBatch` option. + +```ts + const client = new BatchRequest({ + input: `/batch`, + init: { + method: "POST", + }, + alwaysBatch: true + }); +``` + +## Custom fetch + +If the platform you are running does not support fetch, but library has a 100% compatible one, you can use it instead. +Or if you have a fetch with intrumented telemetry, you can use it as well. + +```ts + const client = new BatchRequest({ + input: `/batch`, + init: { + method: "POST", + }, + fetch: myFetch + }); +``` + ## canceling individual requests You can cancel requests individually using standard AborController. If all requests are canceled, the batched request is canceled as well to return as soon as possible. ```ts - const client = new BatchRequest(`/batch`, { - method: "POST", + const client = new BatchRequest({ + input: `/batch`, + init: { + method: "POST", + } }); const controller = new AbortController(); diff --git a/packages/fetch-batch/src/batch-request.test.ts b/packages/fetch-batch/src/batch-request.test.ts index 6e91c27b..f8899a39 100644 --- a/packages/fetch-batch/src/batch-request.test.ts +++ b/packages/fetch-batch/src/batch-request.test.ts @@ -102,8 +102,11 @@ describe("BatchRequest", () => { }); it("should be able to fetch one request", async () => { - const client = new BatchRequest(`http://localhost:${port}/batch`, { - method: "POST", + const client = new BatchRequest({ + input: `http://localhost:${port}/batch`, + init: { + method: "POST", + }, }); const user7 = await client .fetch(`http://localhost:${port}/users/7`) @@ -116,8 +119,11 @@ describe("BatchRequest", () => { }); it("should be able to fetch multiple requests", async () => { - const client = new BatchRequest(`http://localhost:${port}/batch`, { - method: "POST", + const client = new BatchRequest({ + input: `http://localhost:${port}/batch`, + init: { + method: "POST", + }, }); const [user1, user2, nothing] = await Promise.all([ client @@ -141,8 +147,11 @@ describe("BatchRequest", () => { }); it("should error if batch endpoint errors", async () => { - const client = new BatchRequest(`http://localhost:${port}/batch-error`, { - method: "POST", + const client = new BatchRequest({ + input: `http://localhost:${port}/batch-error`, + init: { + method: "POST", + }, }); const [user1, user2, nothing] = await Promise.all([ @@ -166,8 +175,11 @@ describe("BatchRequest", () => { it("should cancel one request if asked to before batching", async () => { const controller = new AbortController(); controller.abort(); - const client = new BatchRequest(`http://localhost:${port}/batch`, { - method: "POST", + const client = new BatchRequest({ + input: `http://localhost:${port}/batch`, + init: { + method: "POST", + }, }); const [user1Promise, user2Promise, nothingPromise] = [ @@ -193,8 +205,11 @@ describe("BatchRequest", () => { it("should cancel one request if asked to after batching", async () => { const controller = new AbortController(); - const client = new BatchRequest(`http://localhost:${port}/batch`, { - method: "POST", + const client = new BatchRequest({ + input: `http://localhost:${port}/batch`, + init: { + method: "POST", + }, }); const [user1Promise, user2Promise, nothingPromise] = [ @@ -220,8 +235,11 @@ describe("BatchRequest", () => { }); it("should not cancel requests if asked to before batching", async () => { - const client = new BatchRequest(`http://localhost:${port}/batch`, { - method: "POST", + const client = new BatchRequest({ + input: `http://localhost:${port}/batch`, + init: { + method: "POST", + }, }); client.cancel(); @@ -246,8 +264,11 @@ describe("BatchRequest", () => { }); it("should cancel all requests if asked to after batching", async () => { - const client = new BatchRequest(`http://localhost:${port}/batch`, { - method: "POST", + const client = new BatchRequest({ + input: `http://localhost:${port}/batch`, + init: { + method: "POST", + }, }); const [user1Promise, user2Promise, nothingPromise] = [ @@ -289,8 +310,11 @@ describe("BatchRequest", () => { }); it("should cancel all individual requests if asked to after batching", async () => { - const client = new BatchRequest(`http://localhost:${port}/batch-pending`, { - method: "POST", + const client = new BatchRequest({ + input: `http://localhost:${port}/batch-pending`, + init: { + method: "POST", + }, }); const controller = new AbortController(); diff --git a/packages/fetch-batch/src/batch-request.ts b/packages/fetch-batch/src/batch-request.ts index cf5d2f2e..778f733b 100644 --- a/packages/fetch-batch/src/batch-request.ts +++ b/packages/fetch-batch/src/batch-request.ts @@ -6,6 +6,16 @@ type BatchCallbacks = { reject: (reason?: unknown) => void; }; +type BatchRequestOptions = { + fetch?: typeof fetch; + alwaysBatch?: boolean; +}; + +type BatchRequestEndpoint = { + input: RequestInfo | URL; + init?: RequestInit; +}; + function cancelAbortedRequests(queue: Map) { for (const [request, callbacks] of queue.entries()) { if (request.signal.aborted) { @@ -15,6 +25,10 @@ function cancelAbortedRequests(queue: Map) { } } +function isMultipartMixed(headers: Headers) { + return headers.get("Content-Type")?.startsWith("multipart/mixed"); +} + /** * A batch request handler * @@ -27,16 +41,25 @@ export class BatchRequest { #timer?: ReturnType; #input: RequestInfo | URL; #init?: RequestInit; + #fetch: typeof fetch; #controller?: AbortController; + #alwaysBatch: boolean; /** * create a new batch request handler - * @param input - the batch request url - * @param init - request init object, same as original fetch + * @param batchEndpoint - the endpoint to send the batch request to with it's fetch init options + * @param options - options to allow to use a custom fetch function or to allways batch requests even if there is only one request pending. + * + * @details allwaysBatch set to false by default, meaning it will not batch requests if there is only one request pending. */ - constructor(input: RequestInfo | URL, init?: RequestInit) { - this.#input = input; - this.#init = init; + constructor( + batchEndpoint: BatchRequestEndpoint, + options?: BatchRequestOptions + ) { + this.#input = batchEndpoint.input; + this.#init = batchEndpoint.init; + this.#fetch = options?.fetch ?? fetch; + this.#alwaysBatch = options?.alwaysBatch ?? false; } /** @@ -87,63 +110,65 @@ export class BatchRequest { const controller = this.#controller; this.#clear(); cancelAbortedRequests(queue); - if (queue.size === 1) { + + if (queue.size === 0) { + return; + } + if (queue.size === 1 && !this.#alwaysBatch) { const [request, callbacks] = queue.entries().next().value; try { - // no need to use batch if there is only one request - const response = await fetch(request); + const response = await this.#fetch(request); callbacks.resolve(response); } catch (error) { callbacks.reject(error); } - } else if (queue.size > 1) { - const batchData = new BatchData(); - for (const request of queue.keys()) { - batchData.addRequest(request); - request.signal?.addEventListener("abort", () => - this.#cancelRequestInQueue(queue, request) - ); - } - try { - const response = await fetch(this.#input, { - ...this.#init, - headers: batchData.getHeaders(this.#init?.headers), - body: batchData.stream(), - signal: controller?.signal, - }); - if ( - response.headers.get("Content-Type")?.startsWith("multipart/mixed") - ) { - const batchResponse = new BatchResponse(response); - for await (const [contentId, response] of batchResponse) { - const request = batchData.getRequest(contentId); - if (request) { - const callbacks = queue.get(request); - queue.delete(request); - if (callbacks) { - callbacks.resolve(response); - } - } - } - if (queue.size > 0) { - for (const callbacks of queue.values()) { - callbacks.reject(new Error("response count mismatch")); + return; + } + + const batchData = new BatchData(); + for (const request of queue.keys()) { + batchData.addRequest(request); + request.signal?.addEventListener("abort", () => + this.#cancelRequestInQueue(queue, request) + ); + } + try { + const response = await this.#fetch(this.#input, { + ...this.#init, + headers: batchData.getHeaders(this.#init?.headers), + body: batchData.stream(), + signal: controller?.signal, + }); + if (isMultipartMixed(response.headers)) { + const batchResponse = new BatchResponse(response); + for await (const [contentId, response] of batchResponse) { + const request = batchData.getRequest(contentId); + if (request) { + const callbacks = queue.get(request); + queue.delete(request); + if (callbacks) { + callbacks.resolve(response); } } - } else { - // response is not not multipart/mixed, so it's probably an error by an intermediary proxy - // let's just resolve all requests with the same response - // this is not ideal, but it's better than rejecting all requests - // it allows the user to handle the error in a more granular way + } + if (queue.size > 0) { for (const callbacks of queue.values()) { - callbacks.resolve(response.clone()); + callbacks.reject(new Error("response count mismatch")); } } - } catch (error) { + } else { + // response is not not multipart/mixed, so it's probably an error by an intermediary proxy + // let's just resolve all requests with the same response + // this is not ideal, but it's better than rejecting all requests + // it allows the user to handle the error in a more granular way for (const callbacks of queue.values()) { - callbacks.reject(error); + callbacks.resolve(response.clone()); } } + } catch (error) { + for (const callbacks of queue.values()) { + callbacks.reject(error); + } } } From da2d27c43ff6b813b1602b1cf58e97a000538426 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Thu, 10 Aug 2023 23:52:22 +0200 Subject: [PATCH 174/206] update readme about custom fetch --- packages/fetch-batch/README.md | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) diff --git a/packages/fetch-batch/README.md b/packages/fetch-batch/README.md index a34a556d..1b5e23dc 100644 --- a/packages/fetch-batch/README.md +++ b/packages/fetch-batch/README.md @@ -29,28 +29,27 @@ By default if only one request is pending, the request is sent immediately to th If you want to always use the batch endpoint, you can use the `alwaysBatch` option. ```ts - const client = new BatchRequest({ - input: `/batch`, - init: { - method: "POST", - }, - alwaysBatch: true - }); + const client = new BatchRequest({input: `/batch`, init: { method: "POST" }}, { alwaysBatch: true }); ``` ## Custom fetch -If the platform you are running does not support fetch, but library has a 100% compatible one, you can use it instead. -Or if you have a fetch with intrumented telemetry, you can use it as well. +If the platform you are running does not support fetch, but a library has a 100% compatible one, you should use it as a polyfill. +Batch request assumes there is a fetch implementation that is 100% compatible with the standard one. + +You can't just provite a custom fetch because behind the scene batch request uses the following objects : +- Request +- Response +- AbortSignal +- AbortController +- ReadStream + +All of which are part of the standard fetch API. + +👉 Custom fetch should only be used for intrumented fetch, A.K.A a fetch overload that adds caching, telemetry, logs, etc. ```ts - const client = new BatchRequest({ - input: `/batch`, - init: { - method: "POST", - }, - fetch: myFetch - }); + const client = new BatchRequest({input: `/batch`, init: { method: "POST" }}, { fetch: myFetch }); ``` ## canceling individual requests From 73471ae48a643db8071cb480e21f2ebb76e424ea Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Fri, 11 Aug 2023 00:08:08 +0200 Subject: [PATCH 175/206] docs(batch): improve docs --- packages/fetch-batch/README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/packages/fetch-batch/README.md b/packages/fetch-batch/README.md index 1b5e23dc..388c1eda 100644 --- a/packages/fetch-batch/README.md +++ b/packages/fetch-batch/README.md @@ -1,5 +1,17 @@ # Batch support for fetch +Batching is a technique that allows to send multiple requests in a single HTTP request. +This is useful to reduce the number of roundtrips between the client and the server and to reduce the number of requests on the server. +Because HTTPS requests are expensive, batching can greatly improve the performance of your application. +It also allows to bypass browser limitations on the number of concurrent requests. + +However, if your service is already using HTTP/2, you should not use this library as HTTP/2 already supports multiplexing in a better way. +Indeed it also does supports interleaving the data of multiple requests allowing a slower request to be received before a faster one if it has fewer data to send. + +These features are not supported by this library, that does batching in a FIFO way. This should be OK for most REST APIs. + +So it's advised to not updload or download large files using this library, since one large file could block the response of a REST api that took longer to start sending data. + ## Main interface This allows to batch automatically all requests made within the same tick (aka the same event loop cycle) @@ -84,6 +96,10 @@ If all requests are canceled, the batched request is canceled as well to return ## Behind the scenes +Fetch batch uses multipart/mixed to send multiple requests in a single HTTP request. +Each individual request is sent as a part of the multipart/mixed request with application/http content type. +Each part is separated by a boundary. And each part starts with a Content-ID header that is used to match the response to the request. + ```ts // individual requests must target the same host const getUser1 = new Request(`http://localhost:${port}/get`, { From ad02b9137ee31919bd43049026e05948ed5cae34 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Fri, 11 Aug 2023 01:05:28 +0200 Subject: [PATCH 176/206] feat(batch): make cancel utils isolated --- packages/fetch-batch/src/batch-request.ts | 30 +++++++++++++---------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/packages/fetch-batch/src/batch-request.ts b/packages/fetch-batch/src/batch-request.ts index 778f733b..9d7b1b55 100644 --- a/packages/fetch-batch/src/batch-request.ts +++ b/packages/fetch-batch/src/batch-request.ts @@ -25,6 +25,22 @@ function cancelAbortedRequests(queue: Map) { } } +function cancelRequestInQueue( + queue: Map, + request: Request, + controller?: AbortController +) { + const callbacks = queue.get(request); + if (callbacks) { + queue.delete(request); + callbacks.reject(new DOMException("Aborted", "AbortError")); + if (queue.size === 0) { + // abort the batch request if all requests are aborted + controller?.abort(); + } + } +} + function isMultipartMixed(headers: Headers) { return headers.get("Content-Type")?.startsWith("multipart/mixed"); } @@ -129,7 +145,7 @@ export class BatchRequest { for (const request of queue.keys()) { batchData.addRequest(request); request.signal?.addEventListener("abort", () => - this.#cancelRequestInQueue(queue, request) + cancelRequestInQueue(queue, request, controller) ); } try { @@ -171,16 +187,4 @@ export class BatchRequest { } } } - - #cancelRequestInQueue(queue: Map, request: Request) { - const callbacks = queue.get(request); - if (callbacks) { - queue.delete(request); - callbacks.reject(new DOMException("Aborted", "AbortError")); - if (queue.size === 0) { - // abort the batch request if all requests are aborted - this.#controller?.abort(); - } - } - } } From b5f469de861101f6d9dee0c87224c4771babcb15 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Fri, 11 Aug 2023 01:16:16 +0200 Subject: [PATCH 177/206] refactor(batch): split files --- packages/fetch-batch/src/batch-data.ts | 2 +- packages/fetch-batch/src/batch-request.ts | 53 ++++--------------- .../fetch-batch/src/batch-request.types.ts | 14 +++++ .../fetch-batch/src/batch-request.utils.ts | 30 +++++++++++ packages/fetch-batch/src/index.ts | 6 ++- 5 files changed, 60 insertions(+), 45 deletions(-) create mode 100644 packages/fetch-batch/src/batch-request.types.ts create mode 100644 packages/fetch-batch/src/batch-request.utils.ts diff --git a/packages/fetch-batch/src/batch-data.ts b/packages/fetch-batch/src/batch-data.ts index 4f04378a..7ad8831a 100644 --- a/packages/fetch-batch/src/batch-data.ts +++ b/packages/fetch-batch/src/batch-data.ts @@ -1,4 +1,4 @@ -type BatchDataForeachCallback = ( +export type BatchDataForeachCallback = ( request: Request, requestId: string, batchdata: BatchData diff --git a/packages/fetch-batch/src/batch-request.ts b/packages/fetch-batch/src/batch-request.ts index 9d7b1b55..9c605839 100644 --- a/packages/fetch-batch/src/batch-request.ts +++ b/packages/fetch-batch/src/batch-request.ts @@ -1,49 +1,16 @@ import { BatchData } from "./batch-data"; import { BatchResponse } from "./batch-response"; +import { + cancelAbortedRequests, + cancelRequestInQueue, + isMultipartMixed, +} from "./batch-request.utils"; -type BatchCallbacks = { - resolve: (value: Response) => void; - reject: (reason?: unknown) => void; -}; - -type BatchRequestOptions = { - fetch?: typeof fetch; - alwaysBatch?: boolean; -}; - -type BatchRequestEndpoint = { - input: RequestInfo | URL; - init?: RequestInit; -}; - -function cancelAbortedRequests(queue: Map) { - for (const [request, callbacks] of queue.entries()) { - if (request.signal.aborted) { - queue.delete(request); - callbacks.reject(new DOMException("Aborted", "AbortError")); - } - } -} - -function cancelRequestInQueue( - queue: Map, - request: Request, - controller?: AbortController -) { - const callbacks = queue.get(request); - if (callbacks) { - queue.delete(request); - callbacks.reject(new DOMException("Aborted", "AbortError")); - if (queue.size === 0) { - // abort the batch request if all requests are aborted - controller?.abort(); - } - } -} - -function isMultipartMixed(headers: Headers) { - return headers.get("Content-Type")?.startsWith("multipart/mixed"); -} +import type { + BatchCallbacks, + BatchRequestEndpoint, + BatchRequestOptions, +} from "./batch-request.types"; /** * A batch request handler diff --git a/packages/fetch-batch/src/batch-request.types.ts b/packages/fetch-batch/src/batch-request.types.ts new file mode 100644 index 00000000..f8aba1c7 --- /dev/null +++ b/packages/fetch-batch/src/batch-request.types.ts @@ -0,0 +1,14 @@ +export type BatchCallbacks = { + resolve: (value: Response) => void; + reject: (reason?: unknown) => void; +}; + +export type BatchRequestOptions = { + fetch?: typeof fetch; + alwaysBatch?: boolean; +}; + +export type BatchRequestEndpoint = { + input: RequestInfo | URL; + init?: RequestInit; +}; diff --git a/packages/fetch-batch/src/batch-request.utils.ts b/packages/fetch-batch/src/batch-request.utils.ts new file mode 100644 index 00000000..6baf10b3 --- /dev/null +++ b/packages/fetch-batch/src/batch-request.utils.ts @@ -0,0 +1,30 @@ +import { BatchCallbacks } from "./batch-request.types"; + +export function cancelAbortedRequests(queue: Map) { + for (const [request, callbacks] of queue.entries()) { + if (request.signal.aborted) { + queue.delete(request); + callbacks.reject(new DOMException("Aborted", "AbortError")); + } + } +} + +export function cancelRequestInQueue( + queue: Map, + request: Request, + controller?: AbortController +) { + const callbacks = queue.get(request); + if (callbacks) { + queue.delete(request); + callbacks.reject(new DOMException("Aborted", "AbortError")); + if (queue.size === 0) { + // abort the batch request if all requests are aborted + controller?.abort(); + } + } +} + +export function isMultipartMixed(headers: Headers) { + return headers.get("Content-Type")?.startsWith("multipart/mixed"); +} diff --git a/packages/fetch-batch/src/index.ts b/packages/fetch-batch/src/index.ts index f417f22d..cc9969db 100644 --- a/packages/fetch-batch/src/index.ts +++ b/packages/fetch-batch/src/index.ts @@ -1,3 +1,7 @@ -export { BatchData } from "./batch-data"; +export { BatchData, BatchDataForeachCallback } from "./batch-data"; export { BatchResponse } from "./batch-response"; export { BatchRequest } from "./batch-request"; +export type { + BatchRequestEndpoint, + BatchRequestOptions, +} from "./batch-request.types"; From f9165b8342a4794b1832b903fa422a80b0c19183 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Fri, 11 Aug 2023 01:41:28 +0200 Subject: [PATCH 178/206] docs(batch): fix readme --- packages/fetch-batch/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/fetch-batch/README.md b/packages/fetch-batch/README.md index 388c1eda..85b0ed8e 100644 --- a/packages/fetch-batch/README.md +++ b/packages/fetch-batch/README.md @@ -83,11 +83,11 @@ If all requests are canceled, the batched request is canceled as well to return .fetch(`/users/1`, { signal: controller.signal }).then((res) => res.json()); const user2 = client - .fetch(`/users/2`, { signal: controller.signal }).then((res) => res.json()); + .fetch(`/users/2`).then((res) => res.json()); // be sure requests are sent await sleep(100); - // abort request 2 afterwards + // abort request 1 afterwards controller.abort(); await expect(user1).rejects.toThrow("Aborted"); From 9d0de95dab70afb4d0b54f9c90b158978e956c26 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Fri, 11 Aug 2023 17:11:07 +0200 Subject: [PATCH 179/206] examples: some example tests --- packages/core/examples/airbytes-api.ts | 7 +++++++ packages/core/examples/dev.to/example.ts | 10 +++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/packages/core/examples/airbytes-api.ts b/packages/core/examples/airbytes-api.ts index 4df707ef..9030c662 100644 --- a/packages/core/examples/airbytes-api.ts +++ b/packages/core/examples/airbytes-api.ts @@ -3010,3 +3010,10 @@ containing the updated stream needs to be sent. ]); export const api = new ZodiosCore(endpoints); +const result = api.post("/v1/connections/create", { + body: { + destinationId: "123", + sourceId: "123", + status: "active", + }, +}); diff --git a/packages/core/examples/dev.to/example.ts b/packages/core/examples/dev.to/example.ts index 4d8ad015..79c65ef9 100644 --- a/packages/core/examples/dev.to/example.ts +++ b/packages/core/examples/dev.to/example.ts @@ -1,4 +1,4 @@ -import { Zodios } from "../../src/index"; +import { ZodiosCore } from "../../src"; import { articlesApi } from "./articles"; import { commentsApi } from "./comments"; import { followsApi } from "./follows"; @@ -6,7 +6,7 @@ import { followersApi } from "./followers"; import { userApi } from "./users"; import { pluginApiKey } from "./api-key-plugin"; -export const devTo = new Zodios("https://dev.to/api", [ +export const devTo = new ZodiosCore("https://dev.to/api", [ ...articlesApi, ...commentsApi, ...followsApi, @@ -20,4 +20,8 @@ devTo.use( }) ); -devTo.get("/articles/me/all").then(console.log); +const result = devTo.get("/comments/:id", { + params: { + id: "7", + }, +}); From ce50125ffc50074620bb43bc0cb9d5c4662abd31 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Fri, 11 Aug 2023 20:13:35 +0200 Subject: [PATCH 180/206] feat(core): fix type inference for params --- packages/core/src/zodios.types.ts | 48 ++++++++++++++++--------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/packages/core/src/zodios.types.ts b/packages/core/src/zodios.types.ts index 68623288..63960222 100644 --- a/packages/core/src/zodios.types.ts +++ b/packages/core/src/zodios.types.ts @@ -496,14 +496,14 @@ export type ZodiosPathParamsForEndpoint< FilterArrayByValue, Frontend, TypeProvider - > -> = NeverIfEmpty<{ - [K in PathParamNames]: PathParameters extends { - [Key in K]: any; - } - ? PathParameters[K] - : string | number; -}>; + >, + Path = Endpoint["path"], + $PathParamNames extends string = PathParamNames +> = NeverIfEmpty< + { + [K in $PathParamNames]: string | number | boolean; + } & PathParameters +>; /** * Get path params for a given endpoint by path @@ -521,12 +521,13 @@ export type ZodiosPathParamsByPath< >, Frontend, TypeProvider - > -> = NeverIfEmpty<{ - [K in PathParamNames]: PathParameters extends { [Key in K]: any } - ? PathParameters[K] - : string | number; -}>; + >, + $PathParamNames extends string = PathParamNames +> = NeverIfEmpty< + { + [K in $PathParamNames]: string | number | boolean; + } & PathParameters +>; /** * Get path params for a given endpoint by alias @@ -536,21 +537,22 @@ export type ZodiosPathParamByAlias< Alias extends string, Frontend extends boolean = true, TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider, - EndpointDefinition extends ZodiosEndpointDefinition = FindZodiosEndpointDefinitionByAlias< + Endpoint extends ZodiosEndpointDefinition = FindZodiosEndpointDefinitionByAlias< Api, Alias >, - Path = EndpointDefinition["path"], + Path = Endpoint["path"], PathParameters = MapSchemaParameters< - FilterArrayByValue, + FilterArrayByValue, Frontend, TypeProvider - > -> = NeverIfEmpty<{ - [K in PathParamNames]: PathParameters extends { [Key in K]: any } - ? PathParameters[K] - : string | number; -}>; + >, + $PathParamNames extends string = PathParamNames +> = NeverIfEmpty< + { + [K in $PathParamNames]: string | number | boolean; + } & PathParameters +>; export type ZodiosHeaderParamsForEndpoint< Endpoint extends ZodiosEndpointDefinition, From 82d183b6d09553089931980aa974a8e64067f22a Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Fri, 11 Aug 2023 22:09:53 +0200 Subject: [PATCH 181/206] fix(core): error detection should not need to pass api --- packages/core/src/plugins/header.plugin.ts | 7 ++- packages/core/src/zodios.test.ts | 62 +++++++--------------- packages/core/src/zodios.ts | 20 ++++--- packages/core/src/zodios.types.ts | 6 +++ 4 files changed, 39 insertions(+), 56 deletions(-) diff --git a/packages/core/src/plugins/header.plugin.ts b/packages/core/src/plugins/header.plugin.ts index 6752e143..580b51f7 100644 --- a/packages/core/src/plugins/header.plugin.ts +++ b/packages/core/src/plugins/header.plugin.ts @@ -1,10 +1,9 @@ import { AnyZodiosFetcherProvider } from "../fetcher-providers"; import type { ZodiosPlugin } from "../zodios.types"; -export function headerPlugin( - key: string, - value: string -): ZodiosPlugin { +export function headerPlugin< + FetcherProvider extends AnyZodiosFetcherProvider = AnyZodiosFetcherProvider +>(key: string, value: string): ZodiosPlugin { return { request: async (_, config) => { return { diff --git a/packages/core/src/zodios.test.ts b/packages/core/src/zodios.test.ts index 4fd8414a..46d72fa8 100644 --- a/packages/core/src/zodios.test.ts +++ b/packages/core/src/zodios.test.ts @@ -1076,13 +1076,13 @@ describe("Zodios", () => { expect(error).toBeInstanceOf(Error); // @ts-ignore expect(error.response?.status).toBe(502); - if (zodios.isErrorFromPath(zodios.api, "get", "/error502", error)) { + if (zodios.isErrorFromPath("get", "/error502", error)) { expect(error.response.status).toBe(502); expect(error.response?.data).toEqual({ error: { message: "bad gateway" }, }); } - if (zodios.isErrorFromAlias(zodios.api, "getError502", error)) { + if (zodios.isErrorFromAlias("getError502", error)) { expect(error.response.status).toBe(502); expect(error.response?.data).toEqual({ error: { message: "bad gateway" }, @@ -1130,19 +1130,15 @@ describe("Zodios", () => { console.log("Match Error params", e); } - expect(zodios.isErrorFromAlias(zodios.api, "getError401", error)).toBe( + expect(zodios.isErrorFromAlias("getError401", error)).toBe(true); + expect(zodios.isErrorFromAlias("getError404", error)).toBe(false); + + expect(zodios.isErrorFromPath("get", "/error/:id/error401", error)).toBe( true ); - expect(zodios.isErrorFromAlias(zodios.api, "getError404", error)).toBe( + expect(zodios.isErrorFromPath("get", "/error/:id/error404", error)).toBe( false ); - - expect( - zodios.isErrorFromPath(zodios.api, "get", "/error/:id/error401", error) - ).toBe(true); - expect( - zodios.isErrorFromPath(zodios.api, "get", "/error/:id/error404", error) - ).toBe(false); }); it("should match error with empty params", async () => { @@ -1184,19 +1180,15 @@ describe("Zodios", () => { error = e; } - expect(zodios.isErrorFromAlias(zodios.api, "getError401", error)).toBe( + expect(zodios.isErrorFromAlias("getError401", error)).toBe(true); + expect(zodios.isErrorFromAlias("getError404", error)).toBe(false); + + expect(zodios.isErrorFromPath("get", "/error/:id/error401", error)).toBe( true ); - expect(zodios.isErrorFromAlias(zodios.api, "getError404", error)).toBe( + expect(zodios.isErrorFromPath("get", "/error/:id/error404", error)).toBe( false ); - - expect( - zodios.isErrorFromPath(zodios.api, "get", "/error/:id/error401", error) - ).toBe(true); - expect( - zodios.isErrorFromPath(zodios.api, "get", "/error/:id/error404", error) - ).toBe(false); }); it("should match error with optional params at the end", async () => { @@ -1239,28 +1231,14 @@ describe("Zodios", () => { error = e; } - expect(zodios.isErrorFromAlias(zodios.api, "getError401", error)).toBe( - true - ); - expect(zodios.isErrorFromAlias(zodios.api, "getError404", error)).toBe( - false - ); + expect(zodios.isErrorFromAlias("getError401", error)).toBe(true); + expect(zodios.isErrorFromAlias("getError404", error)).toBe(false); expect( - zodios.isErrorFromPath( - zodios.api, - "get", - "/error/:id/error401/:message", - error - ) + zodios.isErrorFromPath("get", "/error/:id/error401/:message", error) ).toBe(true); expect( - zodios.isErrorFromPath( - zodios.api, - "get", - "/error/:id/error404/:message", - error - ) + zodios.isErrorFromPath("get", "/error/:id/error404/:message", error) ).toBe(false); }); @@ -1283,12 +1261,8 @@ describe("Zodios", () => { expect(error).toBeInstanceOf(Error); // @ts-ignore expect(error.response?.status).toBe(502); - expect(zodios.isErrorFromPath(zodios.api, "get", "/error502", error)).toBe( - false - ); - expect(zodios.isErrorFromAlias(zodios.api, "getError502", error)).toBe( - false - ); + expect(zodios.isErrorFromPath("get", "/error502", error)).toBe(false); + expect(zodios.isErrorFromAlias("getError502", error)).toBe(false); }); it("should return response when disabling validation", async () => { diff --git a/packages/core/src/zodios.ts b/packages/core/src/zodios.ts index 8ee01cfb..eca0ff60 100644 --- a/packages/core/src/zodios.ts +++ b/packages/core/src/zodios.ts @@ -24,7 +24,7 @@ import { } from "./plugins"; import type { PickRequired, ReadonlyDeep } from "./utils.types"; import { checkApi } from "./api"; -import type { AnyZodiosTypeProvider, ZodTypeProvider,ZodiosRuntimeTypeProvider } from "./type-providers"; +import type { AnyZodiosTypeProvider, ZodTypeProvider } from "./type-providers"; import { zodTypeProvider } from "./type-providers"; import { AnyZodiosFetcherProvider, @@ -58,7 +58,9 @@ export interface ZodiosBase< * zodios api client */ export class ZodiosCoreImpl< - const Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + const Api extends + | readonly ZodiosEndpointDefinition[] + | ZodiosEndpointDefinition[], FetcherProvider extends AnyZodiosFetcherProvider, TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider > implements ZodiosBase @@ -407,7 +409,6 @@ export class ZodiosCoreImpl< * @returns - if true, the error type is narrowed to the matching endpoint errors */ isErrorFromPath>( - api: Api, method: M, path: Path, error: unknown @@ -419,7 +420,7 @@ export class ZodiosCoreImpl< TypeProvider > { return this.isDefinedError(error, (err) => - findEndpointErrorsByPath(api, method, path, err) + findEndpointErrorsByPath(this.api, method, path, err) ); } @@ -431,7 +432,6 @@ export class ZodiosCoreImpl< * @returns - if true, the error type is narrowed to the matching endpoint errors */ isErrorFromAlias>( - api: Api, alias: Alias, error: unknown ): error is ZodiosMatchingErrorsByAlias< @@ -441,7 +441,7 @@ export class ZodiosCoreImpl< TypeProvider > { return this.isDefinedError(error, (err) => - findEndpointErrorsByAlias(api, alias, err) + findEndpointErrorsByAlias(this.api, alias, err) ); } } @@ -456,7 +456,9 @@ export type ZodiosInstance< export interface ZodiosCore { new < - const Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + const Api extends + | readonly ZodiosEndpointDefinition[] + | ZodiosEndpointDefinition[], FetcherProvider extends AnyZodiosFetcherProvider, TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider >( @@ -465,7 +467,9 @@ export interface ZodiosCore { TypeOfFetcherOptions ): ZodiosInstance; new < - const Api extends readonly ZodiosEndpointDefinition[] | ZodiosEndpointDefinition[], + const Api extends + | readonly ZodiosEndpointDefinition[] + | ZodiosEndpointDefinition[], FetcherProvider extends AnyZodiosFetcherProvider, TypeProvider extends AnyZodiosTypeProvider = ZodTypeProvider >( diff --git a/packages/core/src/zodios.types.ts b/packages/core/src/zodios.types.ts index 63960222..3e758183 100644 --- a/packages/core/src/zodios.types.ts +++ b/packages/core/src/zodios.types.ts @@ -764,6 +764,12 @@ export interface ZodiosOptions< */ sendDefaults?: boolean; + /** + * Should zodios throw on error? Default: true + * if false, zodios will return the error in the response else it will throw + */ + throwOnError?: boolean; + fetcherFactory?: ZodiosFetcherFactory; /** From 38561de52874f7b780fae8cafbd59748cdab4adc Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sat, 12 Aug 2023 01:32:09 +0200 Subject: [PATCH 182/206] fix: input type of io-ts is output type --- .../src/type-providers/type-provider.io-ts.ts | 4 ++-- packages/fetch/examples/dev.to/example.ts | 5 +++- packages/fetch/examples/io-ts-types.ts | 24 +++++++++++++++++++ packages/fetch/examples/jsonplaceholder.ts | 18 +++++++------- 4 files changed, 38 insertions(+), 13 deletions(-) diff --git a/packages/core/src/type-providers/type-provider.io-ts.ts b/packages/core/src/type-providers/type-provider.io-ts.ts index ded87caa..fd75c90d 100644 --- a/packages/core/src/type-providers/type-provider.io-ts.ts +++ b/packages/core/src/type-providers/type-provider.io-ts.ts @@ -5,8 +5,8 @@ import { export interface IoTsTypeProvider extends AnyZodiosTypeProvider<{ _A: unknown; _O: unknown }> { - input: this["schema"]["_A"]; - output: this["schema"]["_O"]; + input: this["schema"]["_O"]; + output: this["schema"]["_A"]; } export const ioTsTypeProvider: ZodiosRuntimeTypeProvider = { diff --git a/packages/fetch/examples/dev.to/example.ts b/packages/fetch/examples/dev.to/example.ts index 4d8ad015..0ffcd255 100644 --- a/packages/fetch/examples/dev.to/example.ts +++ b/packages/fetch/examples/dev.to/example.ts @@ -20,4 +20,7 @@ devTo.use( }) ); -devTo.get("/articles/me/all").then(console.log); +devTo + .get("/articles/:id", { params: { id: 2 } }) + .then((user) => console.log(user)); +// ^? diff --git a/packages/fetch/examples/io-ts-types.ts b/packages/fetch/examples/io-ts-types.ts index a2d64de4..3a914737 100644 --- a/packages/fetch/examples/io-ts-types.ts +++ b/packages/fetch/examples/io-ts-types.ts @@ -52,6 +52,25 @@ const jsonplaceholderApi = makeApi([ description: "Get a user", response: userSchema, }, + { + method: "post", + path: "/users", + description: "Create a user", + alias: "createUser", + parameters: [ + { + name: "body", + type: "Body", + schema: t.type({ name: t.string }), + }, + { + name: "Content-Type", + type: "Header", + schema: t.string, + }, + ], + response: userSchema, + }, ]); async function bootstrap() { @@ -73,6 +92,11 @@ async function bootstrap() { const user = await apiClient.get("/users/:id", { params: { id: 7 } }); // ^? console.log(user); + const user2 = await apiClient.createUser({ + // ^? + body: { name: "Nicholas" }, + headers: { "Content-Type": "application/json" }, + }); } bootstrap(); diff --git a/packages/fetch/examples/jsonplaceholder.ts b/packages/fetch/examples/jsonplaceholder.ts index 5bd28b12..93baae2b 100644 --- a/packages/fetch/examples/jsonplaceholder.ts +++ b/packages/fetch/examples/jsonplaceholder.ts @@ -78,17 +78,15 @@ async function bootstrap() { console.log(users); const user = await apiClient.getUser({ params: { id: 7 } }); console.log(user); - const createdUser = await apiClient.createUser( - { name: "john doe" }, - { - headers: { - "Content-Type": "application/json", - Accept: "application/json", - }, - } - ); + const createdUser = await apiClient.createUser({ + body: { name: "john doe" }, + headers: { + "Content-Type": "application/json", + Accept: "application/json", + }, + }); console.log(createdUser); - const deletedUser = await apiClient.deleteUser(undefined, { + const deletedUser = await apiClient.deleteUser({ params: { id: 7 }, }); console.log(deletedUser); From b4e6cb23a836908c7d614957d2543ff72b82215d Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sat, 12 Aug 2023 02:05:18 +0200 Subject: [PATCH 183/206] tests: fix tests --- packages/axios/src/zodios.test.ts | 12 ++++-------- packages/fetch/src/zodios.test.ts | 12 ++++-------- packages/react/src/hooks.spec.tsx | 16 +++++----------- 3 files changed, 13 insertions(+), 27 deletions(-) diff --git a/packages/axios/src/zodios.test.ts b/packages/axios/src/zodios.test.ts index 4a5491bb..2c49d2d6 100644 --- a/packages/axios/src/zodios.test.ts +++ b/packages/axios/src/zodios.test.ts @@ -714,7 +714,7 @@ received: } expect(error).toBeInstanceOf(Error); expect((error as AxiosError).response?.status).toBe(502); - if (zodios.isErrorFromPath(zodios.api, "get", "/error502", error)) { + if (zodios.isErrorFromPath("get", "/error502", error)) { expect(error.response.status).toBe(502); if (error.response.status === 502) { const data = error.response.data; @@ -724,7 +724,7 @@ received: error: { message: "bad gateway" }, }); } - if (zodios.isErrorFromAlias(zodios.api, "getError502", error)) { + if (zodios.isErrorFromAlias("getError502", error)) { expect(error.response.status).toBe(502); if (error.response.status === 502) { const data = error.response.data; @@ -771,12 +771,8 @@ received: expect(error).toBeInstanceOf(Error); expect((error as AxiosError).response?.status).toBe(502); - expect(zodios.isErrorFromPath(zodios.api, "get", "/error502", error)).toBe( - false - ); - expect(zodios.isErrorFromAlias(zodios.api, "getError502", error)).toBe( - false - ); + expect(zodios.isErrorFromPath("get", "/error502", error)).toBe(false); + expect(zodios.isErrorFromAlias("getError502", error)).toBe(false); }); it("should return response when disabling validation", async () => { diff --git a/packages/fetch/src/zodios.test.ts b/packages/fetch/src/zodios.test.ts index 861003f6..1911d33d 100644 --- a/packages/fetch/src/zodios.test.ts +++ b/packages/fetch/src/zodios.test.ts @@ -829,7 +829,7 @@ received: } expect(error).toBeInstanceOf(Error); expect((error as any).response?.status).toBe(502); - if (zodios.isErrorFromPath(zodios.api, "get", "/error502", error)) { + if (zodios.isErrorFromPath("get", "/error502", error)) { expect(error.response.status).toBe(502); if (error.response.status === 502) { const data = error.response.data; @@ -839,7 +839,7 @@ received: error: { message: "bad gateway" }, }); } - if (zodios.isErrorFromAlias(zodios.api, "getError502", error)) { + if (zodios.isErrorFromAlias("getError502", error)) { expect(error.response.status).toBe(502); if (error.response.status === 502) { const data = error.response.data; @@ -886,12 +886,8 @@ received: expect(error).toBeInstanceOf(Error); expect((error as any).response?.status).toBe(502); - expect(zodios.isErrorFromPath(zodios.api, "get", "/error502", error)).toBe( - false - ); - expect(zodios.isErrorFromAlias(zodios.api, "getError502", error)).toBe( - false - ); + expect(zodios.isErrorFromPath("get", "/error502", error)).toBe(false); + expect(zodios.isErrorFromAlias("getError502", error)).toBe(false); }); it("should return response when disabling validation", async () => { diff --git a/packages/react/src/hooks.spec.tsx b/packages/react/src/hooks.spec.tsx index 5f5e8475..9116c684 100644 --- a/packages/react/src/hooks.spec.tsx +++ b/packages/react/src/hooks.spec.tsx @@ -191,10 +191,7 @@ describe("zodios hooks", () => { const key = apiHooks.getKeyByPath("get", "/users/:id", { params: { id: 1 }, }); - expect(key).toEqual([ - { api: "test", path: "/users/:id" }, - { params: { id: 1 } }, - ]); + expect(key).toEqual(["test", "/users/:id", { params: { id: 1 } }]); }); it("should be serialisable", () => { @@ -203,7 +200,7 @@ describe("zodios hooks", () => { }); expect( JSON.stringify(key, (k, v) => (v === undefined ? null : v)) - ).toEqual('[{"api":"test","path":"/users/:id"},{"params":{"id":1}}]'); + ).toEqual('["test","/users/:id",{"params":{"id":1}}]'); }); it("should throw on invalid endpoint", () => { @@ -217,7 +214,7 @@ describe("zodios hooks", () => { it("should get back endpoint invalidation key", () => { const key = apiHooks.getKeyByPath("get", "/users/:id"); - expect(key).toEqual([{ api: "test", path: "/users/:id" }]); + expect(key).toEqual(["test", "/users/:id"]); }); it("should throw on invalid invalidation endpoint", () => { @@ -231,10 +228,7 @@ describe("zodios hooks", () => { const key = apiHooks.getKeyByAlias("getUser", { params: { id: 1 }, }); - expect(key).toEqual([ - { api: "test", path: "/users/:id" }, - { params: { id: 1 } }, - ]); + expect(key).toEqual(["test", "/users/:id", { params: { id: 1 } }]); }); it("should throw on invalid alias", () => { @@ -248,7 +242,7 @@ describe("zodios hooks", () => { it("should get back alias invalidation key", () => { const key = apiHooks.getKeyByAlias("getUser"); - expect(key).toEqual([{ api: "test", path: "/users/:id" }]); + expect(key).toEqual(["test", "/users/:id"]); }); it("should throw on invalid invalidation alias", () => { From 3af9ede2ed575e82519efc7eff41e0cdd1c5ab06 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sun, 13 Aug 2023 23:09:12 +0200 Subject: [PATCH 184/206] refactor(batch): rename --- packages/fetch-batch/src/utils.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/fetch-batch/src/utils.ts b/packages/fetch-batch/src/utils.ts index 82d3ae7d..5a67c143 100644 --- a/packages/fetch-batch/src/utils.ts +++ b/packages/fetch-batch/src/utils.ts @@ -62,16 +62,16 @@ export class SearchArray { */ #getLPS(pattern: TArray): number[] { const result = [0]; - let selfMatchingLength = 0; + let matchingLength = 0; let i = 1; const patternLength = pattern.length; while (i < patternLength) { - if (pattern[i] === pattern[selfMatchingLength]) { - selfMatchingLength++; - result[i] = selfMatchingLength; + if (pattern[i] === pattern[matchingLength]) { + matchingLength++; + result[i] = matchingLength; i++; - } else if (selfMatchingLength !== 0) { - selfMatchingLength = result[selfMatchingLength - 1]; + } else if (matchingLength !== 0) { + matchingLength = result[matchingLength - 1]; } else { result[i] = 0; i++; From 3f5dfd786606a55729913f71de9d8b99427b2b81 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Sun, 13 Aug 2023 23:12:34 +0200 Subject: [PATCH 185/206] chore(express): target es2020 --- packages/express/tsconfig.build.json | 2 +- packages/express/tsconfig.json | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/express/tsconfig.build.json b/packages/express/tsconfig.build.json index e8b555b9..2bfb6f53 100644 --- a/packages/express/tsconfig.build.json +++ b/packages/express/tsconfig.build.json @@ -1,7 +1,7 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "target": "ES6", + "target": "ES2020", "sourceMap": false }, "exclude": [ diff --git a/packages/express/tsconfig.json b/packages/express/tsconfig.json index 5d35941d..de72eda7 100644 --- a/packages/express/tsconfig.json +++ b/packages/express/tsconfig.json @@ -1,10 +1,9 @@ { // ts config for es 2021 "compilerOptions": { - "target": "ES2019", + "target": "ES2020", "module": "CommonJS", "moduleResolution": "Node", - "lib": ["ES2019"], "outDir": "./lib", "alwaysStrict": true, "strict": true, From c5fe9275f5e8f082971ba64b550221c6e65be39f Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Tue, 15 Aug 2023 18:30:05 +0200 Subject: [PATCH 186/206] feat(batch): add support for streaming --- .../fetch-batch/src/batch-request.test.ts | 193 +++++--- packages/fetch-batch/src/batch-request.ts | 12 +- .../src/batch-response-stream.test.ts | 324 ++++++++++++ .../fetch-batch/src/batch-response-stream.ts | 466 ++++++++++++++++++ .../fetch-batch/src/batch-response.test.ts | 61 --- packages/fetch-batch/src/batch-response.ts | 119 +---- .../fetch-batch/src/batch-response.utils.ts | 76 +++ 7 files changed, 1026 insertions(+), 225 deletions(-) create mode 100644 packages/fetch-batch/src/batch-response-stream.test.ts create mode 100644 packages/fetch-batch/src/batch-response-stream.ts create mode 100644 packages/fetch-batch/src/batch-response.utils.ts diff --git a/packages/fetch-batch/src/batch-request.test.ts b/packages/fetch-batch/src/batch-request.test.ts index f8899a39..faea61e3 100644 --- a/packages/fetch-batch/src/batch-request.test.ts +++ b/packages/fetch-batch/src/batch-request.test.ts @@ -1,48 +1,67 @@ import express from "express"; import type { AddressInfo } from "net"; import { BatchRequest } from "./batch-request"; +import { makeBatchResponse } from "./batch-response"; +import { makeBatchStreamResponse } from "./batch-response-stream"; -const responseData = `Preamble +const responseDatas = [ + `Preamble can be anything and should be ignored --batch__1675206000000__batch Content-Type: application/http Content-ID: -HTTP/1.1 200 OK +`, + `HTTP/1.1 200 OK Content-Type: application/json ETag: "etag/pony" -{ +`, + `{ "id": 1, "name": "john doe" } ---batch__1675206000000__batch +`, + `--batch__1675206000000__batch Content-Type: application/http Content-ID: -HTTP/1.1 200 OK +`, + `HTTP/1.1 200 OK Content-Type: application/json; charset=UTF-8 ETag: "etag/sheep" -{ +`, + `{ "id": 2, "name": "jane doe" } ---batch__1675206000000__batch +`, + `--batch__1675206000000__batch Content-Type: application/http Content-ID: -HTTP/1.1 304 Not Modified +`, + `HTTP/1.1 304 Not Modified ---batch__1675206000000__batch-- +`, + `--batch__1675206000000__batch-- Epilogue can be anything -and should be ignored`.replace(/\n/g, "\r\n"); +and should be ignored`, +]; + +const responseData = responseDatas.join("").replace(/\n/g, "\r\n"); const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); -describe("BatchRequest", () => { +describe.each([ + { make: makeBatchResponse, batch: "/batch" }, + { make: makeBatchResponse, batch: "/batch-stream" }, + { make: makeBatchStreamResponse, batch: "/batch" }, + { make: makeBatchStreamResponse, batch: "/batch-stream" }, +])(`BatchRequest $make.name with endpoint '$batch'`, ({ make, batch }) => { let app: express.Express; let server: ReturnType; let port: number; @@ -71,6 +90,34 @@ describe("BatchRequest", () => { res.status(200).send(response); }); + app.post("/batch-stream", async (req, res) => { + res.setHeader( + "Content-Type", + "multipart/mixed; boundary=batch__1675206000000__batch" + ); + const body = req.body.toString(); + // extract the requests ids + const regex = /content-id:\s*<([^>]+)>/g; + const matches = [...body.matchAll(regex)]; + let responses = responseDatas.map((response) => + response.replace(/\n/g, "\r\n") + ); + matches + .map((match) => match[1]) + .forEach((id, i) => { + // replace the response placeholders with the actual response + responses = responses.map((response) => + response.replace(`PLACEHOLDER${i + 1}`, id) + ); + }); + res.writeHead(200); + for await (const response of responses) { + res.write(response); + await sleep(100); + } + res.end(); + }); + // simulate a proxy timeout that don't handle multipart/mixed app.post("/batch-pending", async (req, res) => { await sleep(1000); @@ -102,12 +149,15 @@ describe("BatchRequest", () => { }); it("should be able to fetch one request", async () => { - const client = new BatchRequest({ - input: `http://localhost:${port}/batch`, - init: { - method: "POST", + const client = new BatchRequest( + { + input: `http://localhost:${port}${batch}`, + init: { + method: "POST", + }, }, - }); + make + ); const user7 = await client .fetch(`http://localhost:${port}/users/7`) .then((res) => res.json()); @@ -119,12 +169,15 @@ describe("BatchRequest", () => { }); it("should be able to fetch multiple requests", async () => { - const client = new BatchRequest({ - input: `http://localhost:${port}/batch`, - init: { - method: "POST", + const client = new BatchRequest( + { + input: `http://localhost:${port}${batch}`, + init: { + method: "POST", + }, }, - }); + make + ); const [user1, user2, nothing] = await Promise.all([ client .fetch(`http://localhost:${port}/users/1`) @@ -147,12 +200,15 @@ describe("BatchRequest", () => { }); it("should error if batch endpoint errors", async () => { - const client = new BatchRequest({ - input: `http://localhost:${port}/batch-error`, - init: { - method: "POST", + const client = new BatchRequest( + { + input: `http://localhost:${port}/batch-error`, + init: { + method: "POST", + }, }, - }); + make + ); const [user1, user2, nothing] = await Promise.all([ client @@ -175,12 +231,15 @@ describe("BatchRequest", () => { it("should cancel one request if asked to before batching", async () => { const controller = new AbortController(); controller.abort(); - const client = new BatchRequest({ - input: `http://localhost:${port}/batch`, - init: { - method: "POST", + const client = new BatchRequest( + { + input: `http://localhost:${port}${batch}`, + init: { + method: "POST", + }, }, - }); + make + ); const [user1Promise, user2Promise, nothingPromise] = [ client @@ -205,23 +264,30 @@ describe("BatchRequest", () => { it("should cancel one request if asked to after batching", async () => { const controller = new AbortController(); - const client = new BatchRequest({ - input: `http://localhost:${port}/batch`, - init: { - method: "POST", + const client = new BatchRequest( + { + input: `http://localhost:${port}/batch-stream`, + init: { + method: "POST", + }, }, - }); + make + ); const [user1Promise, user2Promise, nothingPromise] = [ client .fetch(`http://localhost:${port}/users/1`) .then((res) => res.json()), - client.fetch(`http://localhost:${port}/users/2`, { - signal: controller.signal, - }), + client + .fetch(`http://localhost:${port}/users/2`, { + signal: controller.signal, + }) + .then((res) => { + controller.abort(); + return res.json(); + }), client.fetch(`http://localhost:${port}/users/1`), ]; - controller.abort(); const [user1, user2, nothing] = await Promise.allSettled([ user1Promise, @@ -229,18 +295,25 @@ describe("BatchRequest", () => { nothingPromise, ]); + if (nothing.status === "rejected") { + expect(nothing.reason).toEqual(""); + } + expect(user1.status).toBe("fulfilled"); expect(user2.status).toBe("rejected"); expect(nothing.status).toBe("fulfilled"); }); it("should not cancel requests if asked to before batching", async () => { - const client = new BatchRequest({ - input: `http://localhost:${port}/batch`, - init: { - method: "POST", + const client = new BatchRequest( + { + input: `http://localhost:${port}${batch}`, + init: { + method: "POST", + }, }, - }); + make + ); client.cancel(); @@ -264,12 +337,15 @@ describe("BatchRequest", () => { }); it("should cancel all requests if asked to after batching", async () => { - const client = new BatchRequest({ - input: `http://localhost:${port}/batch`, - init: { - method: "POST", + const client = new BatchRequest( + { + input: `http://localhost:${port}${batch}`, + init: { + method: "POST", + }, }, - }); + make + ); const [user1Promise, user2Promise, nothingPromise] = [ client @@ -291,9 +367,7 @@ describe("BatchRequest", () => { expect(nothing.status).toBe("rejected"); const [user1Promise2, user2Promise2, nothingPromise2] = [ - client - .fetch(`http://localhost:${port}/users/1`) - .then((res) => res.json()), + client.fetch(`http://localhost:${port}/users/1`), client.fetch(`http://localhost:${port}/users/2`), client.fetch(`http://localhost:${port}/users/1`), ]; @@ -310,12 +384,15 @@ describe("BatchRequest", () => { }); it("should cancel all individual requests if asked to after batching", async () => { - const client = new BatchRequest({ - input: `http://localhost:${port}/batch-pending`, - init: { - method: "POST", + const client = new BatchRequest( + { + input: `http://localhost:${port}/batch-pending`, + init: { + method: "POST", + }, }, - }); + make + ); const controller = new AbortController(); diff --git a/packages/fetch-batch/src/batch-request.ts b/packages/fetch-batch/src/batch-request.ts index 9c605839..38f00bf5 100644 --- a/packages/fetch-batch/src/batch-request.ts +++ b/packages/fetch-batch/src/batch-request.ts @@ -1,5 +1,4 @@ import { BatchData } from "./batch-data"; -import { BatchResponse } from "./batch-response"; import { cancelAbortedRequests, cancelRequestInQueue, @@ -27,6 +26,7 @@ export class BatchRequest { #fetch: typeof fetch; #controller?: AbortController; #alwaysBatch: boolean; + #makeBatchResponse: (response: Response) => AsyncIterable<[string, Response]>; /** * create a new batch request handler @@ -37,12 +37,16 @@ export class BatchRequest { */ constructor( batchEndpoint: BatchRequestEndpoint, + makeBatchResponse: ( + response: Response + ) => AsyncIterable<[string, Response]>, options?: BatchRequestOptions ) { this.#input = batchEndpoint.input; this.#init = batchEndpoint.init; this.#fetch = options?.fetch ?? fetch; this.#alwaysBatch = options?.alwaysBatch ?? false; + this.#makeBatchResponse = makeBatchResponse; } /** @@ -123,10 +127,14 @@ export class BatchRequest { signal: controller?.signal, }); if (isMultipartMixed(response.headers)) { - const batchResponse = new BatchResponse(response); + const batchResponse = this.#makeBatchResponse(response); for await (const [contentId, response] of batchResponse) { const request = batchData.getRequest(contentId); if (request) { + request.signal?.addEventListener("abort", () => { + console.log("aborting response"); + response.body?.cancel(); + }); const callbacks = queue.get(request); queue.delete(request); if (callbacks) { diff --git a/packages/fetch-batch/src/batch-response-stream.test.ts b/packages/fetch-batch/src/batch-response-stream.test.ts new file mode 100644 index 00000000..d26ec8e8 --- /dev/null +++ b/packages/fetch-batch/src/batch-response-stream.test.ts @@ -0,0 +1,324 @@ +import { + BatchStreamResponse, + HttpBatchTansformer, +} from "./batch-response-stream"; + +const mockedResponseData = `Preamble +can be anything and should be ignored +--batch_foobarbaz +Content-Type: application/http +Content-ID: + +HTTP/1.1 200 OK +Content-Type: application/json; charset=UTF-8 +ETag: "etag/pony" + +{ + "kind": "farm#animal", + "etag": "etag/pony", + "selfLink": "/farm/v1/animals/pony", + "animalName": "pony", + "animalAge": 34, + "peltColor": "white" +} +--batch_foobarbaz +Content-Type: application/http; msgtype=response; msgtype is optional and even this comment should be ignored +Content-ID: + +HTTP/1.1 304 Not Modified +ETag: "etag/pony" + + +--batch_foobarbaz +Content-ID: response-item2:12930812@barnyard.example.com +Content-Type: application/http + +HTTP/1.1 200 OK +Content-Type: application/json; + charset=UTF-8 +ETag: "etag/sheep" + +{ + "kind": "farm#animal", + "etag": "etag/sheep", + "selfLink": "/farm/v1/animals/sheep", + "animalName": "sheep", + "animalAge": 5, + "peltColor": "green" +} + +--batch_foobarbaz-- +Epilogue can be anything +and should be ignored`.replace(/\n/g, "\r\n"); + +describe("BatchResponseStream", () => { + describe("HttpBatchTansformer", () => { + it("should parse a multipart/mixed response in one buffer", async () => { + const stream = new ReadableStream({ + async pull(controller) { + controller.enqueue(new TextEncoder().encode(mockedResponseData)); + controller.close(); + }, + }); + const httpStream = new TransformStream( + new HttpBatchTansformer("batch_foobarbaz") + ); + + await stream.pipeThrough(httpStream).pipeTo( + new WritableStream({ + write(chunk) { + console.log( + `http type: '${chunk.type}'\ndata: '${new TextDecoder().decode( + chunk.data + )}'` + ); + }, + }) + ); + }); + + it("should parse a multipart/mixed response cut line by line", async () => { + const chuncks = mockedResponseData.split(/(?=\r)/g); + const chunckedStream = new ReadableStream({ + async pull(controller) { + const chunck = chuncks.shift(); + if (chunck) { + controller.enqueue(new TextEncoder().encode(chunck)); + } else { + controller.close(); + } + }, + }); + const httpStream = new TransformStream( + new HttpBatchTansformer("batch_foobarbaz") + ); + + await chunckedStream.pipeThrough(httpStream).pipeTo( + new WritableStream({ + write(chunk) { + console.log( + `http type: '${chunk.type}'\ndata: '${new TextDecoder().decode( + chunk.data + )}'` + ); + }, + }) + ); + }); + it("should parse a multipart/mixed response even if cut in the middle of crlf", async () => { + const chuncks = mockedResponseData.split(/(?=\r)/g); + const chunckedStream = new ReadableStream({ + async pull(controller) { + const chunck = chuncks.shift(); + if (chunck) { + controller.enqueue(new TextEncoder().encode(chunck)); + } else { + controller.close(); + } + }, + }); + const httpStream = new TransformStream( + new HttpBatchTansformer("batch_foobarbaz") + ); + + await chunckedStream.pipeThrough(httpStream).pipeTo( + new WritableStream({ + write(chunk) { + console.log( + `http type: '${chunk.type}'\ndata: '${new TextDecoder().decode( + chunk.data + )}'` + ); + }, + }) + ); + }); + + it("should throw if preamble size is too big", async () => { + const stream = new ReadableStream({ + async pull(controller) { + controller.enqueue(new TextEncoder().encode("Preamble".repeat(100))); + }, + }); + const httpStream = new TransformStream( + new HttpBatchTansformer("batch_foobarbaz") + ); + + await expect( + stream.pipeThrough(httpStream).pipeTo( + new WritableStream({ + write(chunk) { + console.log( + `http type: '${chunk.type}'\ndata: '${new TextDecoder().decode( + chunk.data + )}'` + ); + }, + }) + ) + ).rejects.toThrowError("Preamble too large"); + }); + }); + + describe("BatchStreamResponse", () => { + it("should parse a multipart/mixed response", async () => { + const chuncks = mockedResponseData.split(/(?=\r)/g); + const chunckedStream = new ReadableStream({ + async pull(controller) { + const chunck = chuncks.shift(); + if (chunck) { + controller.enqueue(new TextEncoder().encode(chunck)); + // simulate a slow stream + await new Promise((resolve) => setTimeout(resolve, 100)); + } else { + controller.close(); + } + }, + }); + + const mockedResponse = new Response(chunckedStream, { + headers: { + // check continuation support + "Content-Type": `multipart/mixed; + boundary=batch_foobarbaz`, + }, + status: 200, + statusText: "OK", + }); + + const batchResponse = new BatchStreamResponse(mockedResponse); + let count = 0; + for await (const [contentId, response] of batchResponse) { + expect(contentId).toBeDefined(); + expect(response).toBeDefined(); + switch (contentId) { + case "response-item1:12930812@barnyard.example.com": + { + count++; + expect(response.status).toBe(200); + expect(response.statusText).toBe("OK"); + expect(response.headers.get("Content-Type")).toContain( + "application/json" + ); + console.time("json item 1"); + // await expect(response.json()).resolves.toEqual({ + // kind: "farm#animal", + // etag: "etag/pony", + // selfLink: "/farm/v1/animals/pony", + // animalName: "pony", + // animalAge: 34, + // peltColor: "white", + // }); + await response.body?.cancel(); + console.timeEnd("json item 1"); + } + break; + case "response-item2:12930812@barnyard.example.com": + { + count++; + expect(response.status).toBe(200); + expect(response.statusText).toBe("OK"); + expect(response.headers.get("Content-Type")).toContain( + "application/json" + ); + console.time("json item 2"); + await expect(response.json()).resolves.toEqual({ + kind: "farm#animal", + etag: "etag/sheep", + selfLink: "/farm/v1/animals/sheep", + animalName: "sheep", + animalAge: 5, + peltColor: "green", + }); + console.timeEnd("json item 2"); + } + break; + case "response-item3:12930812@barnyard.example.com": + { + count++; + expect(response.status).toBe(304); + expect(response.statusText).toBe("Not Modified"); + console.time("text item 3"); + await expect(response.text()).resolves.toBe(""); + console.timeEnd("text item 3"); + } + break; + } + } + expect(count).toBe(3); + }); + + it("should parse a multipart/mixed response when cancelled", async () => { + const chuncks = mockedResponseData.split(/(?=\r)/g); + const chunckedStream = new ReadableStream({ + async pull(controller) { + const chunck = chuncks.shift(); + if (chunck) { + controller.enqueue(new TextEncoder().encode(chunck)); + // simulate a slow stream + await new Promise((resolve) => setTimeout(resolve, 100)); + } else { + controller.close(); + } + }, + }); + + const mockedResponse = new Response(chunckedStream, { + headers: { + // check continuation support + "Content-Type": `multipart/mixed; + boundary=batch_foobarbaz`, + }, + status: 200, + statusText: "OK", + }); + + const batchResponse = new BatchStreamResponse(mockedResponse); + let count = 0; + for await (const [contentId, response] of batchResponse) { + expect(contentId).toBeDefined(); + expect(response).toBeDefined(); + switch (contentId) { + case "response-item1:12930812@barnyard.example.com": + { + count++; + expect(response.status).toBe(200); + expect(response.statusText).toBe("OK"); + expect(response.headers.get("Content-Type")).toContain( + "application/json" + ); + await response.body?.cancel(); + } + break; + case "response-item2:12930812@barnyard.example.com": + { + count++; + expect(response.status).toBe(200); + expect(response.statusText).toBe("OK"); + expect(response.headers.get("Content-Type")).toContain( + "application/json" + ); + await expect(response.json()).resolves.toEqual({ + kind: "farm#animal", + etag: "etag/sheep", + selfLink: "/farm/v1/animals/sheep", + animalName: "sheep", + animalAge: 5, + peltColor: "green", + }); + } + break; + case "response-item3:12930812@barnyard.example.com": + { + count++; + expect(response.status).toBe(304); + expect(response.statusText).toBe("Not Modified"); + await expect(response.text()).resolves.toBe(""); + } + break; + } + } + expect(count).toBe(3); + }); + }); +}); diff --git a/packages/fetch-batch/src/batch-response-stream.ts b/packages/fetch-batch/src/batch-response-stream.ts new file mode 100644 index 00000000..caadee8b --- /dev/null +++ b/packages/fetch-batch/src/batch-response-stream.ts @@ -0,0 +1,466 @@ +import { concat, SearchArray } from "./utils"; +import { + boundaryRegExp, + parseContentId, + parseHeaders, + parseStatusLine, +} from "./batch-response.utils"; + +type ChunkType = "multipart-header" | "statusline" | "header" | "body"; + +type HttpMultipartChunk = { + type: ChunkType; + data: Uint8Array; + done?: boolean; +}; + +const STATUS_PREAMBLE = "preamble"; +const STATUS_MULTIPART_HEADER = "multipart-header"; +const STATUS_STATUSLINE = "statusline"; +const STATUS_HEADER = "header"; +const STATUS_BODY = "body"; +const STATUS_EPILOGUE = "epilogue"; + +export interface HttpBatchTansformerOptions { + /** + * max discard size for preamble and epilogue + * protect against preamble attacks, default to 16kb + */ + maxDiscardSize?: number; + /** + * max status line size + * protect against status line overflow attacks, default to 1kb + */ + masStatusLineSize?: number; + /** + * max header size + * protect against header overflow attacks, default to 16kb + */ + maxHeaderSize?: number; + /** + * max body size + * protect against body overflow attacks, default to 1mb + */ + maxChunkBodySize?: number; +} + +/** + * Grammar for multipart/mixed content type: + * multipart-body := preamble 1*encapsulation close-delimiter epilogue + * encapsulation := delimiter body-part CRLF + * delimiter := "--" boundary CRLF + * close-delimiter := delimiter "--" + * preamble := discard-text + * epilogue := discard-text + * discard-text := *(*text CRLF) + * body-part := *(header-field CRLF) CRLF [HTTP-message] + * + * Grammar for application/http content type: + * HTTP-message := start-line *(header-field CRLF) CRLF [ message-body ] + * start-line := Request-Line | Status-Line + * Request-Line := Method SP Request-URI SP HTTP-Version CRLF + * Status-Line := HTTP-Version SP Status-Code SP Reason-Phrase CRLF + * header-field := field-name ":" [ SP ] field-value [ SP ] + * field-name := + * field-value := + * message-body := *OCTET ; message body may be any OCTET but should not contain the same delimiter as the enclosing multipart type + */ +export class HttpBatchTansformer + implements Transformer +{ + #state: ChunkType | "preamble" | "epilogue" = STATUS_PREAMBLE; + #boundary: string; + #buffer?: Uint8Array; + #encoder = new TextEncoder(); + #searchStartBoundary: SearchArray; + #searchBoundary: SearchArray; + #searchEndBoundary: SearchArray; + #searchNewline = new SearchArray(this.#encoder.encode("\r\n")); + #searchDivider = new SearchArray(this.#encoder.encode("\r\n\r\n")); + #maxDiscardSize: number; + #maxStatusLineSize: number; + #maxHeaderSize: number; + #maxChunkBodySize: number; + #epilogueSize = 0; + + constructor(boundary: string, options?: HttpBatchTansformerOptions) { + this.#boundary = boundary; + this.#searchStartBoundary = new SearchArray( + this.#encoder.encode(`--${this.#boundary}\r\n`) + ); + this.#searchBoundary = new SearchArray( + this.#encoder.encode(`\r\n--${this.#boundary}\r\n`) + ); + this.#searchEndBoundary = new SearchArray( + this.#encoder.encode(`\r\n--${this.#boundary}--\r\n`) + ); + this.#maxDiscardSize = options?.maxDiscardSize ?? 16 * 1024; + this.#maxStatusLineSize = options?.masStatusLineSize ?? 1 * 1024; + this.#maxHeaderSize = options?.maxHeaderSize ?? 16 * 1024; + this.#maxChunkBodySize = options?.maxChunkBodySize ?? 1 * 1024 * 1024; + } + + transform( + chunk: Uint8Array, + controller: TransformStreamDefaultController + ) { + if (this.#buffer) { + this.#buffer = concat([this.#buffer, chunk]); + } else { + this.#buffer = chunk; + } + + while (this.#buffer?.length > 0) { + switch (this.#state) { + case STATUS_PREAMBLE: + if (!this.#parsePreamble()) return; + break; + case STATUS_MULTIPART_HEADER: + if (!this.#parseMultipart(controller)) return; + break; + case STATUS_STATUSLINE: + if (!this.#parseStatusLine(controller)) return; + break; + case STATUS_HEADER: + if (!this.#parseHeader(controller)) return; + break; + case STATUS_BODY: + if (!this.#parseBody(controller)) return; + break; + case STATUS_EPILOGUE: + if (!this.#parseEpilogue()) return; + break; + } + } + } + + /** + * we just discard the preamble + * @param controller - transform stream controller + * @returns true if preamble is parsed and advance to next state + */ + #parsePreamble() { + const index = this.#searchStartBoundary.search(this.#buffer!); + if (index !== -1) { + this.#state = STATUS_MULTIPART_HEADER; + this.#buffer = this.#buffer!.subarray( + index + this.#searchStartBoundary.pattern.length + ); + return true; + } + if (this.#buffer!.length > this.#maxDiscardSize) { + throw new Error("Preamble too large"); + } + return false; + } + + #parseMultipart( + controller: TransformStreamDefaultController + ) { + const index = this.#searchDivider.search(this.#buffer!); + if (index !== -1) { + const header = this.#buffer!.subarray(0, index); + controller.enqueue({ type: STATUS_MULTIPART_HEADER, data: header }); + this.#state = STATUS_STATUSLINE; + this.#buffer = this.#buffer!.subarray( + index + this.#searchDivider.pattern.length + ); + return true; + } + if (this.#buffer!.length > this.#maxHeaderSize) { + throw new Error( + `Header size exceeded maxHeaderSize : ${this.#maxHeaderSize} bytes` + ); + } + return false; + } + + #parseStatusLine( + controller: TransformStreamDefaultController + ) { + const index = this.#searchNewline.search(this.#buffer!); + if (index !== -1) { + const statusLine = this.#buffer!.subarray(0, index); + controller.enqueue({ type: STATUS_STATUSLINE, data: statusLine }); + this.#state = STATUS_HEADER; + this.#buffer = this.#buffer!.subarray( + index + this.#searchNewline.pattern.length + ); + return true; + } + if (this.#buffer!.length > this.#maxStatusLineSize) { + throw new Error( + `Header size exceeded maxHeaderSize : ${this.#maxHeaderSize} bytes` + ); + } + return false; + } + + #parseHeader( + controller: TransformStreamDefaultController + ) { + const index = this.#searchDivider.search(this.#buffer!); + if (index !== -1) { + const header = this.#buffer!.subarray(0, index); + controller.enqueue({ type: STATUS_HEADER, data: header }); + this.#state = STATUS_BODY; + this.#buffer = this.#buffer!.subarray( + index + this.#searchDivider.pattern.length + ); + return true; + } + if (this.#buffer!.length > this.#maxHeaderSize) { + throw new Error( + `Header size exceeded maxHeaderSize : ${this.#maxHeaderSize} bytes` + ); + } + + return false; + } + + /** + * parse http body + * + * It will try to not accumulate the whole body in memory + * but it will return a body chunk if it can guarantee that + * the last bytes of body chunk does not contain a CR + * the last bytes being the size of the end boundary + * this allows to stream the body chunks to as a ReadableStream + * + * @param controller + * @returns + */ + #parseBody(controller: TransformStreamDefaultController) { + const index = this.#searchBoundary.search(this.#buffer!); + if (index !== -1) { + const body = this.#buffer!.subarray(0, index); + controller.enqueue({ type: STATUS_BODY, data: body, done: true }); + this.#state = STATUS_MULTIPART_HEADER; + this.#buffer = this.#buffer!.subarray( + index + this.#searchBoundary.pattern.length + ); + return true; + } else { + const index = this.#searchEndBoundary.search(this.#buffer!); + if (index !== -1) { + const body = this.#buffer!.subarray(0, index); + controller.enqueue({ type: STATUS_BODY, data: body, done: true }); + this.#state = STATUS_EPILOGUE; + this.#buffer = this.#buffer!.subarray( + index + this.#searchEndBoundary.pattern.length + ); + return true; + } + // 13 is CR in CRLF that may be the start of a boundary + else if ( + this.#buffer!.indexOf(13, -this.#searchEndBoundary.pattern.length) === + -1 + ) { + controller.enqueue({ + type: STATUS_BODY, + data: this.#buffer!, + done: false, + }); + this.#buffer = undefined; + return false; + } + } + + if (this.#buffer!.length > this.#maxChunkBodySize) { + throw new Error( + `Chunk body size exceeded maxChunkBodySize : ${ + this.#maxChunkBodySize + } bytes` + ); + } + return false; + } + + /** + * we just discard the epilogue + * @param controller - the controller of the transform stream + * @returns true + */ + #parseEpilogue() { + this.#epilogueSize += this.#buffer!.length; + if (this.#epilogueSize > this.#maxDiscardSize) { + throw new Error(`Epilogue too large`); + } + this.#buffer = undefined; + return true; + } +} + +class HttpBodyStreamSource implements UnderlyingDefaultSource { + #reader: ReadableStreamDefaultReader; + #completed = false; + #reading = false; + #cancelled = false; + #completedPromise: Promise; + #completedPromiseResolve!: () => void; + constructor(reader: ReadableStreamDefaultReader) { + this.#reader = reader; + this.#completedPromise = new Promise((resolve) => { + this.#completedPromiseResolve = resolve; + }); + } + completed() { + return this.#completedPromise; + } + + async #consumeAllBody() { + while (true) { + const { value, done } = await this.#reader.read(); + if (done || value.done) break; + } + } + + async pull(controller: ReadableStreamDefaultController) { + if (this.#completed) return controller.close(); + this.#reading = true; + if (this.#cancelled) { + // cancel is still pending else pull would not have been called + // just close without reading + this.#completed = true; + this.#completedPromiseResolve(); + this.#reading = false; + return controller.close(); + } + + const { value: body, done: bodyDone } = await this.#reader.read(); + if (this.#cancelled) { + if (body && !body?.done) { + await this.#consumeAllBody(); + } + this.#completed = true; + this.#completedPromiseResolve(); + this.#reading = false; + return controller.close(); + } + if (body?.type !== STATUS_BODY) { + this.#completed = true; + this.#completedPromiseResolve(); + this.#reading = false; + controller.close(); + throw new Error(`Unexpected body type ${body?.type}`); + } + if (bodyDone || body.done) { + this.#completed = true; + if (body.data) controller.enqueue(body.data); + this.#completedPromiseResolve(); + this.#reading = false; + return controller.close(); + } else { + controller.enqueue(body.data); + this.#reading = false; + } + } + async cancel() { + this.#cancelled = true; + if (!this.#completed && !this.#reading) { + this.#reading = true; + await this.#consumeAllBody(); + this.#completed = true; + this.#completedPromiseResolve(); + this.#reading = false; + } + } +} + +export class BatchStreamResponse implements AsyncIterable<[string, Response]> { + #response: Response; + #responses = new Map(); + + constructor(response: Response) { + this.#response = response; + } + + /** + * async iterator that allows to iterate over the responses + * + * if not already, it parses the multipart/mixed response and yields a response for each request + * allowing to handle each response individually + * + * @returns an async iterator that yields a response for each request + */ + async *[Symbol.asyncIterator]() { + const contentType = this.#response.headers.get("content-type"); + if (!contentType?.startsWith("multipart/mixed")) { + throw new Error( + "BatchResponse: Invalid content type, expected multipart/mixed" + ); + } + const boundary = contentType.match(boundaryRegExp)?.[1]; + if (!boundary) { + throw new Error("BatchResponse: Invalid boundary"); + } + if (!this.#response.body) + throw new Error("BatchResponse: Empty response body"); + + const stream = this.#response.body.pipeThrough( + new TransformStream(new HttpBatchTansformer(boundary)) + ); + const reader = stream.getReader(); + let currentBodyStreamSource: HttpBodyStreamSource | undefined; + + while (true) { + // we wait until previous body is consumed or cancelled + await currentBodyStreamSource?.completed(); + const { value: part, done: partDone } = await reader.read(); + if (partDone) { + break; + } + if (part.type !== STATUS_MULTIPART_HEADER) { + throw new Error("BatchResponse: Invalid multipart header"); + } + const partHeaders = parseHeaders(part.data); + const contentId = parseContentId(partHeaders); + const contentType = partHeaders.get("content-type"); + if (!contentType?.startsWith("application/http")) { + throw new Error( + "BatchResponse: Invalid content type, expected application/http" + ); + } + const { value: statusLine, done: statusLineDone } = await reader.read(); + if (statusLineDone || statusLine.type !== STATUS_STATUSLINE) { + throw new Error("BatchResponse: Invalid status line"); + } + const { status, statusText } = parseStatusLine(statusLine.data); + const { value: headers, done: headersDone } = await reader.read(); + if (headersDone || headers.type !== STATUS_HEADER) { + throw new Error("BatchResponse: Invalid headers"); + } + const responseHeaders = parseHeaders(headers.data); + if (status === 204 || status === 304) { + const { value: body, done: bodyDone } = await reader.read(); + if (body && (body.type !== STATUS_BODY || !body.done)) { + throw new Error("BatchResponse: Body not empty"); + } + currentBodyStreamSource = undefined; + const response = new Response(undefined, { + status, + statusText, + headers: responseHeaders, + }); + this.#responses.set(contentId, response); + yield [contentId, response] as [string, Response]; + } else { + currentBodyStreamSource = new HttpBodyStreamSource(reader); + const bodyStream = new ReadableStream(currentBodyStreamSource); + const response = new Response(bodyStream, { + status, + statusText, + headers: responseHeaders, + }); + this.#responses.set(contentId, response); + yield [contentId, response] as [string, Response]; + } + } + } +} + +export function makeBatchStreamResponse( + response: Response +): BatchStreamResponse { + return new BatchStreamResponse(response); +} diff --git a/packages/fetch-batch/src/batch-response.test.ts b/packages/fetch-batch/src/batch-response.test.ts index 1b78dd91..e4d80019 100644 --- a/packages/fetch-batch/src/batch-response.test.ts +++ b/packages/fetch-batch/src/batch-response.test.ts @@ -113,65 +113,4 @@ describe("BatchResponse", () => { } expect(count).toBe(3); }); - - it("should parse a multipart/mixed response when looking for a specific response", async () => { - const mockedResponse = new Response(mockedResponseData, { - headers: { - "Content-Type": "multipart/mixed; boundary=batch_foobarbaz", - }, - status: 200, - statusText: "OK", - }); - - const batchResponse = new BatchResponse(mockedResponse); - const response1 = await batchResponse.getResponse( - "item3:12930812@barnyard.example.com" - ); - expect(response1).toBeDefined(); - expect(response1?.status).toBe(304); - expect(response1?.statusText).toBe("Not Modified"); - expect(response1?.text()).resolves.toBe(""); - - const response2 = await batchResponse.getResponse( - "item1:12930812@barnyard.example.com" - ); - expect(response2).toBeDefined(); - expect(response2?.status).toBe(200); - expect(response2?.statusText).toBe("OK"); - expect(response2?.headers.get("Content-Type")).toContain( - "application/json" - ); - expect(response2?.json()).resolves.toEqual({ - kind: "farm#animal", - etag: "etag/pony", - selfLink: "/farm/v1/animals/pony", - animalName: "pony", - animalAge: 34, - peltColor: "white", - }); - - // now iterate over the rest of the responses - let count = 0; - for await (const [contentId, response] of batchResponse) { - expect(contentId).toBeDefined(); - expect(response).toBeDefined(); - if (contentId === "response-item2:12930812@barnyard.example.com") { - count++; - expect(response.status).toBe(200); - expect(response.statusText).toBe("OK"); - expect(response.headers.get("Content-Type")).toContain( - "application/json" - ); - expect(response.json()).resolves.toEqual({ - kind: "farm#animal", - etag: "etag/sheep", - selfLink: "/farm/v1/animals/sheep", - animalName: "sheep", - animalAge: 5, - peltColor: "green", - }); - } - } - expect(count).toBe(1); - }); }); diff --git a/packages/fetch-batch/src/batch-response.ts b/packages/fetch-batch/src/batch-response.ts index 29160b03..b0eb4cbb 100644 --- a/packages/fetch-batch/src/batch-response.ts +++ b/packages/fetch-batch/src/batch-response.ts @@ -38,15 +38,15 @@ */ import { concat, SearchArray } from "./utils"; - -const statusLineRegExp = /^HTTP\/\d\.\d (\d{3}) (.*)$/; -const headerRegExp = /^([^\s:]+):\s*(.*?)(?=\s*$)/; -const contentIdRegExp = /^]+)>?$/; -const boundaryRegExp = /boundary="?([^";]+)"?;?/; - -export class BatchResponse { +import { + boundaryRegExp, + parseContentId, + parseHeaders, + parseStatusLine, +} from "./batch-response.utils"; + +export class BatchResponse implements AsyncIterable<[string, Response]> { #response: Response; - #decoder = new TextDecoder(); #encoder = new TextEncoder(); #responses = new Map(); #searchNewline = new SearchArray(this.#encoder.encode("\r\n")); @@ -72,27 +72,6 @@ export class BatchResponse { yield* this.#responses.entries(); } - /** - * get the response for a request that was made with BatchData - * - * if not already, parse the multipart/mixed response and store each response in a map - * where the key is the content id of the request - * subsequent calls to this method will not parse the response again - * - * @param requestContentId - the content id of the request that was made with BatchData - * @returns the response for the request if it exists else undefined - */ - async getResponse(requestContentId: string): Promise { - if (!this.#parsed) { - await this.#parseResponse(); - } - for (const [contentId, response] of this.#responses.entries()) { - if (contentId.includes(requestContentId)) { - return response; - } - } - } - /** * parse the multipart/mixed response and store each response in a map * where the key is the content id of the request @@ -213,7 +192,7 @@ export class BatchResponse { throw new Error("BatchResponse: Invalid part, no headers found"); } const partHeadersBytes = data.subarray(0, partHeadersEndIndex); - const partHeaders = this.#parseHeaders(partHeadersBytes); + const partHeaders = parseHeaders(partHeadersBytes); const contentType = partHeaders.get("content-type"); if (!contentType?.startsWith("application/http")) { return undefined; @@ -242,10 +221,10 @@ export class BatchResponse { const responseBodyBytes = partBodyBytes.subarray( responseHeadersEndIndex + this.#searchDivider.pattern.length ); - const responseStatusLine = this.#parseStatusLine(responseStatusLineBytes); - const responseHeaders = this.#parseHeaders(responseHeadersBytes); + const responseStatusLine = parseStatusLine(responseStatusLineBytes); + const responseHeaders = parseHeaders(responseHeadersBytes); - const contentId = this.#parseContentId(partHeaders); + const contentId = parseContentId(partHeaders); const response = new Response( responseBodyBytes.length > 0 ? responseBodyBytes : undefined, { @@ -260,76 +239,8 @@ export class BatchResponse { response, }; } +} - /** - * parse content id from headers - * @param headers - The headers to parse the content id from - * @returns the content id - */ - #parseContentId(headers: Headers) { - const contentIdRaw = headers.get("content-id"); - if (!contentIdRaw) { - throw new Error("BatchResponse: Content-ID not found"); - } - const match = contentIdRaw.match(contentIdRegExp); - if (!match) { - throw new Error( - "BatchResponse: Invalid Content-ID format, should be '<'contentId'>'" - ); - } - return match[1]; - } - - /** - * parse HTTP response status line - * @param statusLineBytes - The status line bytes to parse - * @returns the status and status text - */ - #parseStatusLine(statusLineBytes: Uint8Array) { - const statusLine = this.#decoder.decode(statusLineBytes); - const match = statusLine.match(statusLineRegExp); - if (!match) { - throw new Error("BatchResponse: Invalid response status line"); - } - const [, status, statusText] = match; - return { - status: Number(status), - statusText, - }; - } - - /** - * parse headers from a Uint8Array - * - * it supports header folding continuations (https://tools.ietf.org/html/rfc7230#section-3.2.4) - * even though it's not recommended by the spec and deprecated - * in case headers are malformed, it will gently ignore them - * - * @param headersBytes - The headers bytes to parse - * @returns - */ - #parseHeaders(headersBytes: Uint8Array) { - const decodedHeaders = this.#decoder.decode(headersBytes).split("\r\n"); - const headers = new Headers(); - let lastKey: string | undefined; - for (const header of decodedHeaders) { - if (header.startsWith(" ") || header.startsWith("\t")) { - // this is a header folding continuation - if (lastKey) { - const value = header.trim(); - const currentValue = headers.get(lastKey); - if (currentValue) { - headers.set(lastKey, `${currentValue} ${value}`); - } - } - } else { - const match = header.match(headerRegExp); - if (match) { - const [, name, value] = match; - headers.set(name, value); - } - } - } - return headers; - } +export function makeBatchResponse(response: Response) { + return new BatchResponse(response); } diff --git a/packages/fetch-batch/src/batch-response.utils.ts b/packages/fetch-batch/src/batch-response.utils.ts new file mode 100644 index 00000000..7b72743b --- /dev/null +++ b/packages/fetch-batch/src/batch-response.utils.ts @@ -0,0 +1,76 @@ +export const statusLineRegExp = /^HTTP\/\d\.\d (\d{3}) (.*)$/; +export const headerRegExp = /^([^\s:]+):\s*(.*?)(?=\s*$)/; +export const contentIdRegExp = /^]+)>?$/; +export const boundaryRegExp = /boundary="?([^";]+)"?;?/; + +/** + * parse content id from headers + * @param headers - The headers to parse the content id from + * @returns the content id + */ +export function parseContentId(headers: Headers) { + const contentIdRaw = headers.get("content-id"); + if (!contentIdRaw) { + throw new Error("BatchResponse: Content-ID not found"); + } + const match = contentIdRaw.match(contentIdRegExp); + if (!match) { + throw new Error( + "BatchResponse: Invalid Content-ID format, should be '<'contentId'>'" + ); + } + return match[1]; +} + +/** + * parse HTTP response status line + * @param statusLineBytes - The status line bytes to parse + * @returns the status and status text + */ +export function parseStatusLine(statusLineBytes: Uint8Array) { + const statusLine = new TextDecoder().decode(statusLineBytes); + const match = statusLine.match(statusLineRegExp); + if (!match) { + throw new Error("BatchResponse: Invalid response status line"); + } + const [, status, statusText] = match; + return { + status: Number(status), + statusText, + }; +} + +/** + * parse headers from a Uint8Array + * + * it supports header folding continuations (https://tools.ietf.org/html/rfc7230#section-3.2.4) + * even though it's not recommended by the spec and deprecated + * in case headers are malformed, it will gently ignore them + * + * @param headersBytes - The headers bytes to parse + * @returns + */ +export function parseHeaders(headersBytes: Uint8Array) { + const decodedHeaders = new TextDecoder().decode(headersBytes).split("\r\n"); + const headers = new Headers(); + let lastKey: string | undefined; + for (const header of decodedHeaders) { + if (header.startsWith(" ") || header.startsWith("\t")) { + // this is a header folding continuation + if (lastKey) { + const value = header.trim(); + const currentValue = headers.get(lastKey); + if (currentValue) { + headers.set(lastKey, `${currentValue} ${value}`); + } + } + } else { + const match = header.match(headerRegExp); + if (match) { + const [, name, value] = match; + headers.set(name, value); + } + } + } + return headers; +} From c38e711fe588e93ccced70ee5ede72eb41b8e0a9 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Tue, 15 Aug 2023 18:59:29 +0200 Subject: [PATCH 187/206] fix(batch): cleanup --- packages/fetch-batch/src/batch-request.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/fetch-batch/src/batch-request.ts b/packages/fetch-batch/src/batch-request.ts index 38f00bf5..b2f89013 100644 --- a/packages/fetch-batch/src/batch-request.ts +++ b/packages/fetch-batch/src/batch-request.ts @@ -131,10 +131,9 @@ export class BatchRequest { for await (const [contentId, response] of batchResponse) { const request = batchData.getRequest(contentId); if (request) { - request.signal?.addEventListener("abort", () => { - console.log("aborting response"); - response.body?.cancel(); - }); + request.signal?.addEventListener("abort", () => + response.body?.cancel() + ); const callbacks = queue.get(request); queue.delete(request); if (callbacks) { From 462cc77710be8af194bc99610a9de300ebdf8530 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Tue, 15 Aug 2023 19:46:25 +0200 Subject: [PATCH 188/206] docs(batch): add streaming docs --- packages/fetch-batch/README.md | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/packages/fetch-batch/README.md b/packages/fetch-batch/README.md index 85b0ed8e..3630fe11 100644 --- a/packages/fetch-batch/README.md +++ b/packages/fetch-batch/README.md @@ -20,7 +20,8 @@ This allows to batch automatically all requests made within the same tick (aka t const client = new BatchRequest({ input: `/batch`, init: { method: "POST" } - }); + }, + (response) => new BatchResponse(response)); const [user1, user2] = await Promise.all([ client @@ -41,7 +42,7 @@ By default if only one request is pending, the request is sent immediately to th If you want to always use the batch endpoint, you can use the `alwaysBatch` option. ```ts - const client = new BatchRequest({input: `/batch`, init: { method: "POST" }}, { alwaysBatch: true }); + const client = new BatchRequest({input: `/batch`, init: { method: "POST" }}, (response) => new BatchResponse(response), { alwaysBatch: true }); ``` ## Custom fetch @@ -61,7 +62,18 @@ All of which are part of the standard fetch API. 👉 Custom fetch should only be used for intrumented fetch, A.K.A a fetch overload that adds caching, telemetry, logs, etc. ```ts - const client = new BatchRequest({input: `/batch`, init: { method: "POST" }}, { fetch: myFetch }); + const client = new BatchRequest({input: `/batch`, init: { method: "POST" }}, (response) => new BatchResponse(response), { fetch: myFetch }); +``` + +## Streaming + +Batch request supports streaming, for the request body nothing to do, it's supported out the box. and for the response body you can replace the BatchResponse contructor +by BatchStreamResponse. +Streaming is useful to reduce the memory footprint of your application, especially if you are downloading large contents. +Also it allows to handle the one response from a batched request as soon as it's available, instead of waiting for the whole batch to be completed. + +```ts + const client = new BatchRequest({input: `/batch`, init: { method: "POST" }}, (response) => new BatchStreamResponse(response)); ``` ## canceling individual requests @@ -75,7 +87,7 @@ If all requests are canceled, the batched request is canceled as well to return init: { method: "POST", } - }); + }, (response) => new BatchResponse(response)); const controller = new AbortController(); From 257dfd430bf1915ad7176e20a26698e02bfc819a Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Tue, 15 Aug 2023 19:56:19 +0200 Subject: [PATCH 189/206] feat(batch): export streaming variant --- packages/fetch-batch/src/batch-response-stream.ts | 11 +++++++---- packages/fetch-batch/src/index.ts | 6 +++++- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/packages/fetch-batch/src/batch-response-stream.ts b/packages/fetch-batch/src/batch-response-stream.ts index caadee8b..04381a0a 100644 --- a/packages/fetch-batch/src/batch-response-stream.ts +++ b/packages/fetch-batch/src/batch-response-stream.ts @@ -370,9 +370,11 @@ class HttpBodyStreamSource implements UnderlyingDefaultSource { export class BatchStreamResponse implements AsyncIterable<[string, Response]> { #response: Response; #responses = new Map(); + #options?: HttpBatchTansformerOptions; - constructor(response: Response) { + constructor(response: Response, options?: HttpBatchTansformerOptions) { this.#response = response; + this.#options = options; } /** @@ -398,7 +400,7 @@ export class BatchStreamResponse implements AsyncIterable<[string, Response]> { throw new Error("BatchResponse: Empty response body"); const stream = this.#response.body.pipeThrough( - new TransformStream(new HttpBatchTansformer(boundary)) + new TransformStream(new HttpBatchTansformer(boundary, this.#options)) ); const reader = stream.getReader(); let currentBodyStreamSource: HttpBodyStreamSource | undefined; @@ -460,7 +462,8 @@ export class BatchStreamResponse implements AsyncIterable<[string, Response]> { } export function makeBatchStreamResponse( - response: Response + response: Response, + options?: HttpBatchTansformerOptions ): BatchStreamResponse { - return new BatchStreamResponse(response); + return new BatchStreamResponse(response, options); } diff --git a/packages/fetch-batch/src/index.ts b/packages/fetch-batch/src/index.ts index cc9969db..8605ea6f 100644 --- a/packages/fetch-batch/src/index.ts +++ b/packages/fetch-batch/src/index.ts @@ -1,5 +1,9 @@ export { BatchData, BatchDataForeachCallback } from "./batch-data"; -export { BatchResponse } from "./batch-response"; +export { BatchResponse, makeBatchResponse } from "./batch-response"; +export { + BatchStreamResponse, + makeBatchStreamResponse, +} from "./batch-response-stream"; export { BatchRequest } from "./batch-request"; export type { BatchRequestEndpoint, From ab02b070f7ea4fa5d581945e10704396b667f480 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Tue, 15 Aug 2023 20:31:09 +0200 Subject: [PATCH 190/206] feat(batch): remove internal map --- .../fetch-batch/src/batch-response-stream.ts | 3 --- packages/fetch-batch/src/batch-response.ts | 22 ++++++------------- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/packages/fetch-batch/src/batch-response-stream.ts b/packages/fetch-batch/src/batch-response-stream.ts index 04381a0a..ffb0087e 100644 --- a/packages/fetch-batch/src/batch-response-stream.ts +++ b/packages/fetch-batch/src/batch-response-stream.ts @@ -369,7 +369,6 @@ class HttpBodyStreamSource implements UnderlyingDefaultSource { export class BatchStreamResponse implements AsyncIterable<[string, Response]> { #response: Response; - #responses = new Map(); #options?: HttpBatchTansformerOptions; constructor(response: Response, options?: HttpBatchTansformerOptions) { @@ -444,7 +443,6 @@ export class BatchStreamResponse implements AsyncIterable<[string, Response]> { statusText, headers: responseHeaders, }); - this.#responses.set(contentId, response); yield [contentId, response] as [string, Response]; } else { currentBodyStreamSource = new HttpBodyStreamSource(reader); @@ -454,7 +452,6 @@ export class BatchStreamResponse implements AsyncIterable<[string, Response]> { statusText, headers: responseHeaders, }); - this.#responses.set(contentId, response); yield [contentId, response] as [string, Response]; } } diff --git a/packages/fetch-batch/src/batch-response.ts b/packages/fetch-batch/src/batch-response.ts index b0eb4cbb..f3a3e526 100644 --- a/packages/fetch-batch/src/batch-response.ts +++ b/packages/fetch-batch/src/batch-response.ts @@ -48,10 +48,8 @@ import { export class BatchResponse implements AsyncIterable<[string, Response]> { #response: Response; #encoder = new TextEncoder(); - #responses = new Map(); #searchNewline = new SearchArray(this.#encoder.encode("\r\n")); #searchDivider = new SearchArray(this.#encoder.encode("\r\n\r\n")); - #parsed = false; constructor(response: Response) { this.#response = response; @@ -63,16 +61,6 @@ export class BatchResponse implements AsyncIterable<[string, Response]> { * if not already, it parses the multipart/mixed response and yields a response for each request * allowing to handle each response individually * - * @returns an async iterator that yields a response for each request - */ - async *[Symbol.asyncIterator]() { - if (!this.#parsed) { - await this.#parseResponse(); - } - yield* this.#responses.entries(); - } - - /** * parse the multipart/mixed response and store each response in a map * where the key is the content id of the request * @@ -95,8 +83,10 @@ export class BatchResponse implements AsyncIterable<[string, Response]> { * field-name := * field-value := * message-body := *OCTET ; message body may be any OCTET but should not contain the same delimiter as the enclosing multipart type + * + * @returns an async iterator that yields a response for each request */ - async #parseResponse() { + async *[Symbol.asyncIterator]() { const contentType = this.#response.headers.get("content-type"); if (!contentType?.startsWith("multipart/mixed")) { throw new Error( @@ -134,10 +124,12 @@ export class BatchResponse implements AsyncIterable<[string, Response]> { data.subarray(start, end) ); if (parsedResponse) { - this.#responses.set(parsedResponse.contentId, parsedResponse.response); + yield [parsedResponse.contentId, parsedResponse.response] as [ + string, + Response + ]; } } - this.#parsed = true; } /** From c8a0d36a57132a35e0904eb647d38ca0d2bf9237 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Tue, 15 Aug 2023 20:50:16 +0200 Subject: [PATCH 191/206] refactor(batch): factor completed state handling --- .../fetch-batch/src/batch-response-stream.ts | 36 +++++++++---------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/packages/fetch-batch/src/batch-response-stream.ts b/packages/fetch-batch/src/batch-response-stream.ts index ffb0087e..4c864b11 100644 --- a/packages/fetch-batch/src/batch-response-stream.ts +++ b/packages/fetch-batch/src/batch-response-stream.ts @@ -304,10 +304,17 @@ class HttpBodyStreamSource implements UnderlyingDefaultSource { this.#completedPromiseResolve = resolve; }); } + completed() { return this.#completedPromise; } + #setCompleted() { + this.#completed = true; + this.#completedPromiseResolve(); + this.#reading = false; + } + async #consumeAllBody() { while (true) { const { value, done } = await this.#reader.read(); @@ -317,13 +324,11 @@ class HttpBodyStreamSource implements UnderlyingDefaultSource { async pull(controller: ReadableStreamDefaultController) { if (this.#completed) return controller.close(); + this.#reading = true; + if (this.#cancelled) { - // cancel is still pending else pull would not have been called - // just close without reading - this.#completed = true; - this.#completedPromiseResolve(); - this.#reading = false; + this.#setCompleted(); return controller.close(); } @@ -332,37 +337,28 @@ class HttpBodyStreamSource implements UnderlyingDefaultSource { if (body && !body?.done) { await this.#consumeAllBody(); } - this.#completed = true; - this.#completedPromiseResolve(); - this.#reading = false; + this.#setCompleted(); return controller.close(); } if (body?.type !== STATUS_BODY) { - this.#completed = true; - this.#completedPromiseResolve(); - this.#reading = false; + this.#setCompleted(); controller.close(); throw new Error(`Unexpected body type ${body?.type}`); } if (bodyDone || body.done) { - this.#completed = true; if (body.data) controller.enqueue(body.data); - this.#completedPromiseResolve(); - this.#reading = false; + this.#setCompleted(); return controller.close(); - } else { - controller.enqueue(body.data); - this.#reading = false; } + controller.enqueue(body.data); + this.#reading = false; } async cancel() { this.#cancelled = true; if (!this.#completed && !this.#reading) { this.#reading = true; await this.#consumeAllBody(); - this.#completed = true; - this.#completedPromiseResolve(); - this.#reading = false; + this.#setCompleted(); } } } From 8ca6a290e642e49b25add707147a7074588bf5ba Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Tue, 15 Aug 2023 21:07:28 +0200 Subject: [PATCH 192/206] docs(batch): add more inlined docs --- .../fetch-batch/src/batch-response-stream.ts | 63 +++++++++++++++++-- 1 file changed, 58 insertions(+), 5 deletions(-) diff --git a/packages/fetch-batch/src/batch-response-stream.ts b/packages/fetch-batch/src/batch-response-stream.ts index 4c864b11..c599c546 100644 --- a/packages/fetch-batch/src/batch-response-stream.ts +++ b/packages/fetch-batch/src/batch-response-stream.ts @@ -83,6 +83,11 @@ export class HttpBatchTansformer #maxChunkBodySize: number; #epilogueSize = 0; + /** + * create a transformer for multipart/mixed content type that handle application/http envelop + * @param boundary - boundary string to separate each part + * @param options - options for the transformer to protect against overflow attacks + */ constructor(boundary: string, options?: HttpBatchTansformerOptions) { this.#boundary = boundary; this.#searchStartBoundary = new SearchArray( @@ -100,6 +105,12 @@ export class HttpBatchTansformer this.#maxChunkBodySize = options?.maxChunkBodySize ?? 1 * 1024 * 1024; } + /** + * transform readable stream of Uint8Array to an stream of HttpMultipartChunk + * @param chunk - chunk of data to parse + * @param controller - transform stream controller + * @returns void + */ transform( chunk: Uint8Array, controller: TransformStreamDefaultController @@ -154,6 +165,11 @@ export class HttpBatchTansformer return false; } + /** + * parse the multipart/mixed header + * @param controller - transform stream controller + * @returns true if header is parsed and advance to next state + */ #parseMultipart( controller: TransformStreamDefaultController ) { @@ -175,6 +191,11 @@ export class HttpBatchTansformer return false; } + /** + * parse http status line - keep in mind that status line is terminated by newline + * @param controller - transform stream controller + * @returns true if status line is parsed and advance to next state + */ #parseStatusLine( controller: TransformStreamDefaultController ) { @@ -196,6 +217,11 @@ export class HttpBatchTansformer return false; } + /** + * parse http header block - keep in mind that header block is terminated by an empty line + * @param controller - transform stream controller + * @returns true if header is completly parsed and advance to next state + */ #parseHeader( controller: TransformStreamDefaultController ) { @@ -227,8 +253,8 @@ export class HttpBatchTansformer * the last bytes being the size of the end boundary * this allows to stream the body chunks to as a ReadableStream * - * @param controller - * @returns + * @param controller - transform stream controller + * @returns true if body end is found and advance to next state */ #parseBody(controller: TransformStreamDefaultController) { const index = this.#searchBoundary.search(this.#buffer!); @@ -298,6 +324,16 @@ class HttpBodyStreamSource implements UnderlyingDefaultSource { #cancelled = false; #completedPromise: Promise; #completedPromiseResolve!: () => void; + + /** + * Create a new HttpBodyStreamSource + * + * The HttpBodyStreamSource is a ReadableStreamSource that will + * read the body of a multipart stream that will complete when + * a boundary is found + * + * @param reader - the reader of the multipart stream + */ constructor(reader: ReadableStreamDefaultReader) { this.#reader = reader; this.#completedPromise = new Promise((resolve) => { @@ -305,23 +341,40 @@ class HttpBodyStreamSource implements UnderlyingDefaultSource { }); } + /** + * a promise fired when the body is completely read + * @returns a promise that will resolve when the body is completly read from the stream + */ completed() { return this.#completedPromise; } + /** + * resolve the completed promise and set the completed flags + */ #setCompleted() { this.#completed = true; this.#completedPromiseResolve(); this.#reading = false; } - async #consumeAllBody() { + /** + * consume the body until a boundary is found + * this is used when the stream is cancelled + * to discard the rest of the body + */ + async #consumeBody() { while (true) { const { value, done } = await this.#reader.read(); if (done || value.done) break; } } + /** + * pull one chunk from the body at a time + * @param controller - the controller of the readable stream + * @returns void + */ async pull(controller: ReadableStreamDefaultController) { if (this.#completed) return controller.close(); @@ -335,7 +388,7 @@ class HttpBodyStreamSource implements UnderlyingDefaultSource { const { value: body, done: bodyDone } = await this.#reader.read(); if (this.#cancelled) { if (body && !body?.done) { - await this.#consumeAllBody(); + await this.#consumeBody(); } this.#setCompleted(); return controller.close(); @@ -357,7 +410,7 @@ class HttpBodyStreamSource implements UnderlyingDefaultSource { this.#cancelled = true; if (!this.#completed && !this.#reading) { this.#reading = true; - await this.#consumeAllBody(); + await this.#consumeBody(); this.#setCompleted(); } } From 1fa76107d01315eacd6ebb2506f7a6eab5d61731 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Wed, 16 Aug 2023 14:17:13 +0200 Subject: [PATCH 193/206] fix(batch): typo --- packages/fetch-batch/src/batch-response-stream.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/fetch-batch/src/batch-response-stream.ts b/packages/fetch-batch/src/batch-response-stream.ts index c599c546..4de81f93 100644 --- a/packages/fetch-batch/src/batch-response-stream.ts +++ b/packages/fetch-batch/src/batch-response-stream.ts @@ -31,7 +31,7 @@ export interface HttpBatchTansformerOptions { * max status line size * protect against status line overflow attacks, default to 1kb */ - masStatusLineSize?: number; + maxStatusLineSize?: number; /** * max header size * protect against header overflow attacks, default to 16kb @@ -100,7 +100,7 @@ export class HttpBatchTansformer this.#encoder.encode(`\r\n--${this.#boundary}--\r\n`) ); this.#maxDiscardSize = options?.maxDiscardSize ?? 16 * 1024; - this.#maxStatusLineSize = options?.masStatusLineSize ?? 1 * 1024; + this.#maxStatusLineSize = options?.maxStatusLineSize ?? 1 * 1024; this.#maxHeaderSize = options?.maxHeaderSize ?? 16 * 1024; this.#maxChunkBodySize = options?.maxChunkBodySize ?? 1 * 1024 * 1024; } From 9ec561284dd7f47a38cc80d585195b720cc2bc46 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Wed, 16 Aug 2023 14:17:42 +0200 Subject: [PATCH 194/206] test(batch): split stream a little more --- packages/fetch-batch/src/batch-request.test.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/fetch-batch/src/batch-request.test.ts b/packages/fetch-batch/src/batch-request.test.ts index faea61e3..d0ec5418 100644 --- a/packages/fetch-batch/src/batch-request.test.ts +++ b/packages/fetch-batch/src/batch-request.test.ts @@ -18,7 +18,8 @@ ETag: "etag/pony" `, `{ - "id": 1, + "id": 1,`, + ` "name": "john doe" } `, @@ -28,13 +29,15 @@ Content-ID: `, `HTTP/1.1 200 OK -Content-Type: application/json; +Content-Type: application/json;`, + ` charset=UTF-8 ETag: "etag/sheep" `, `{ - "id": 2, + "id": 2,`, + ` "name": "jane doe" } `, From 070528b5617c648943f1e9cd85bc59b50fd8ec2e Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Wed, 16 Aug 2023 14:23:59 +0200 Subject: [PATCH 195/206] chore(batch): fix grammar --- packages/fetch-batch/src/batch-response-stream.ts | 2 +- packages/fetch-batch/src/batch-response.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/fetch-batch/src/batch-response-stream.ts b/packages/fetch-batch/src/batch-response-stream.ts index 4de81f93..57b321a9 100644 --- a/packages/fetch-batch/src/batch-response-stream.ts +++ b/packages/fetch-batch/src/batch-response-stream.ts @@ -49,7 +49,7 @@ export interface HttpBatchTansformerOptions { * multipart-body := preamble 1*encapsulation close-delimiter epilogue * encapsulation := delimiter body-part CRLF * delimiter := "--" boundary CRLF - * close-delimiter := delimiter "--" + * close-delimiter := "--" boundary "--" CRLF * preamble := discard-text * epilogue := discard-text * discard-text := *(*text CRLF) diff --git a/packages/fetch-batch/src/batch-response.ts b/packages/fetch-batch/src/batch-response.ts index f3a3e526..d4686cd0 100644 --- a/packages/fetch-batch/src/batch-response.ts +++ b/packages/fetch-batch/src/batch-response.ts @@ -68,7 +68,7 @@ export class BatchResponse implements AsyncIterable<[string, Response]> { * multipart-body := preamble 1*encapsulation close-delimiter epilogue * encapsulation := delimiter body-part CRLF * delimiter := "--" boundary CRLF - * close-delimiter := delimiter "--" + * close-delimiter := "--" boundary "--" CRLF * preamble := discard-text * epilogue := discard-text * discard-text := *(*text CRLF) From 48eeb3600aadd963fa00cd9c8263742aeecf9304 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Wed, 16 Aug 2023 16:35:14 +0200 Subject: [PATCH 196/206] refactor(batch): put parse boundary on utils --- .../fetch-batch/src/batch-response-stream.ts | 119 +++++++++--------- packages/fetch-batch/src/batch-response.ts | 22 +--- .../fetch-batch/src/batch-response.utils.ts | 29 ++++- 3 files changed, 90 insertions(+), 80 deletions(-) diff --git a/packages/fetch-batch/src/batch-response-stream.ts b/packages/fetch-batch/src/batch-response-stream.ts index 57b321a9..3d0a7ded 100644 --- a/packages/fetch-batch/src/batch-response-stream.ts +++ b/packages/fetch-batch/src/batch-response-stream.ts @@ -1,6 +1,6 @@ import { concat, SearchArray } from "./utils"; import { - boundaryRegExp, + parseBoundary, parseContentId, parseHeaders, parseStatusLine, @@ -434,20 +434,8 @@ export class BatchStreamResponse implements AsyncIterable<[string, Response]> { * @returns an async iterator that yields a response for each request */ async *[Symbol.asyncIterator]() { - const contentType = this.#response.headers.get("content-type"); - if (!contentType?.startsWith("multipart/mixed")) { - throw new Error( - "BatchResponse: Invalid content type, expected multipart/mixed" - ); - } - const boundary = contentType.match(boundaryRegExp)?.[1]; - if (!boundary) { - throw new Error("BatchResponse: Invalid boundary"); - } - if (!this.#response.body) - throw new Error("BatchResponse: Empty response body"); - - const stream = this.#response.body.pipeThrough( + const boundary = parseBoundary(this.#response); + const stream = this.#response.body!.pipeThrough( new TransformStream(new HttpBatchTansformer(boundary, this.#options)) ); const reader = stream.getReader(); @@ -456,57 +444,70 @@ export class BatchStreamResponse implements AsyncIterable<[string, Response]> { while (true) { // we wait until previous body is consumed or cancelled await currentBodyStreamSource?.completed(); - const { value: part, done: partDone } = await reader.read(); - if (partDone) { - break; - } - if (part.type !== STATUS_MULTIPART_HEADER) { - throw new Error("BatchResponse: Invalid multipart header"); - } - const partHeaders = parseHeaders(part.data); - const contentId = parseContentId(partHeaders); - const contentType = partHeaders.get("content-type"); - if (!contentType?.startsWith("application/http")) { - throw new Error( - "BatchResponse: Invalid content type, expected application/http" - ); - } - const { value: statusLine, done: statusLineDone } = await reader.read(); - if (statusLineDone || statusLine.type !== STATUS_STATUSLINE) { - throw new Error("BatchResponse: Invalid status line"); - } - const { status, statusText } = parseStatusLine(statusLine.data); - const { value: headers, done: headersDone } = await reader.read(); - if (headersDone || headers.type !== STATUS_HEADER) { - throw new Error("BatchResponse: Invalid headers"); + const multipart = await this.#parseMultipartHeader(reader); + if (multipart.done) break; + const embedded = await this.#parseEmbeddedResponse(reader); + currentBodyStreamSource = embedded.bodyStreamSource; + yield [multipart.contentId, embedded.response] as [string, Response]; + } + } + + async #parseMultipartHeader( + reader: ReadableStreamDefaultReader + ) { + const { value, done } = await reader.read(); + + if (done) return { done }; + if (value.type !== STATUS_MULTIPART_HEADER) { + throw new Error("BatchResponse: Invalid multipart header"); + } + const partHeaders = parseHeaders(value.data); + const contentId = parseContentId(partHeaders); + const contentType = partHeaders.get("content-type"); + if (!contentType || !contentType.startsWith("application/http")) { + throw new Error( + "BatchResponse: Invalid content type, expected application/http" + ); + } + return { done, contentId }; + } + + async #parseEmbeddedResponse( + reader: ReadableStreamDefaultReader + ) { + const { value: statusLine, done: statusLineDone } = await reader.read(); + if (statusLineDone || statusLine.type !== STATUS_STATUSLINE) { + throw new Error("BatchResponse: Invalid status line"); + } + const { status, statusText } = parseStatusLine(statusLine.data); + const { value: headers, done: headersDone } = await reader.read(); + if (headersDone || headers.type !== STATUS_HEADER) { + throw new Error("BatchResponse: Invalid headers"); + } + const responseHeaders = parseHeaders(headers.data); + if (status === 204 || status === 304) { + const { value: body, done: bodyDone } = await reader.read(); + if (body && (body.type !== STATUS_BODY || !body.done)) { + throw new Error("BatchResponse: Body not empty"); } - const responseHeaders = parseHeaders(headers.data); - if (status === 204 || status === 304) { - const { value: body, done: bodyDone } = await reader.read(); - if (body && (body.type !== STATUS_BODY || !body.done)) { - throw new Error("BatchResponse: Body not empty"); - } - currentBodyStreamSource = undefined; - const response = new Response(undefined, { + return { + response: new Response(undefined, { status, statusText, headers: responseHeaders, - }); - yield [contentId, response] as [string, Response]; - } else { - currentBodyStreamSource = new HttpBodyStreamSource(reader); - const bodyStream = new ReadableStream(currentBodyStreamSource); - const response = new Response(bodyStream, { - status, - statusText, - headers: responseHeaders, - }); - yield [contentId, response] as [string, Response]; - } + }), + }; } + const bodyStreamSource = new HttpBodyStreamSource(reader); + const bodyStream = new ReadableStream(bodyStreamSource); + const response = new Response(bodyStream, { + status, + statusText, + headers: responseHeaders, + }); + return { bodyStreamSource, response }; } } - export function makeBatchStreamResponse( response: Response, options?: HttpBatchTansformerOptions diff --git a/packages/fetch-batch/src/batch-response.ts b/packages/fetch-batch/src/batch-response.ts index d4686cd0..ef363118 100644 --- a/packages/fetch-batch/src/batch-response.ts +++ b/packages/fetch-batch/src/batch-response.ts @@ -39,7 +39,7 @@ import { concat, SearchArray } from "./utils"; import { - boundaryRegExp, + parseBoundary, parseContentId, parseHeaders, parseStatusLine, @@ -87,17 +87,7 @@ export class BatchResponse implements AsyncIterable<[string, Response]> { * @returns an async iterator that yields a response for each request */ async *[Symbol.asyncIterator]() { - const contentType = this.#response.headers.get("content-type"); - if (!contentType?.startsWith("multipart/mixed")) { - throw new Error( - "BatchResponse: Invalid content type, expected multipart/mixed" - ); - } - const boundary = contentType.match(boundaryRegExp)?.[1]; - if (!boundary) { - throw new Error("BatchResponse: Invalid boundary"); - } - + const boundary = parseBoundary(this.#response); const buffers: Uint8Array[] = await this.#readChuncks(); const data = concat(buffers); const searchBoundary = new SearchArray( @@ -120,7 +110,7 @@ export class BatchResponse implements AsyncIterable<[string, Response]> { this.#searchNewline.pattern.length, })); for (const { start, end } of indexes) { - const parsedResponse = this.#parseEmbededResponse( + const parsedResponse = this.#parseEmbeddedResponse( data.subarray(start, end) ); if (parsedResponse) { @@ -137,10 +127,8 @@ export class BatchResponse implements AsyncIterable<[string, Response]> { * @returns - the combined data of the multipart/mixed response body in a single Uint8Array */ async #readChuncks() { - if (!this.#response.body) - throw new Error("BatchResponse: Empty response body"); const buffers: Uint8Array[] = []; - const reader = this.#response.body.getReader(); + const reader = this.#response.body!.getReader(); while (true) { const { done, value } = await reader.read(); if (done) { @@ -178,7 +166,7 @@ export class BatchResponse implements AsyncIterable<[string, Response]> { * } * ``` */ - #parseEmbededResponse(data: Uint8Array) { + #parseEmbeddedResponse(data: Uint8Array) { const partHeadersEndIndex = this.#searchDivider.search(data); if (partHeadersEndIndex === -1) { throw new Error("BatchResponse: Invalid part, no headers found"); diff --git a/packages/fetch-batch/src/batch-response.utils.ts b/packages/fetch-batch/src/batch-response.utils.ts index 7b72743b..d0a7e831 100644 --- a/packages/fetch-batch/src/batch-response.utils.ts +++ b/packages/fetch-batch/src/batch-response.utils.ts @@ -1,7 +1,28 @@ -export const statusLineRegExp = /^HTTP\/\d\.\d (\d{3}) (.*)$/; -export const headerRegExp = /^([^\s:]+):\s*(.*?)(?=\s*$)/; -export const contentIdRegExp = /^]+)>?$/; -export const boundaryRegExp = /boundary="?([^";]+)"?;?/; +const statusLineRegExp = /^HTTP\/\d\.\d (\d{3}) (.*)$/; +const headerRegExp = /^([^\s:]+):\s*(.*?)(?=\s*$)/; +const contentIdRegExp = /^]+)>?$/; +const boundaryRegExp = /boundary="?([^";]+)"?;?/; + +/** + * parse the headers from a multipart/mixed response and extract the boundary + * @param response - The response to parse the boundary from + * @returns the boundary + * @throws if the response is not multipart/mixed or if the boundary is not found or if there is no response body + */ +export function parseBoundary(response: Response) { + const contentType = response.headers.get("content-type"); + if (!contentType?.startsWith("multipart/mixed")) { + throw new Error( + "BatchResponse: Invalid content type, expected multipart/mixed" + ); + } + const boundary = contentType.match(boundaryRegExp)?.[1]; + if (!boundary) { + throw new Error("BatchResponse: Invalid boundary"); + } + if (!response.body) throw new Error("BatchResponse: Empty response body"); + return boundary; +} /** * parse content id from headers From 9f748fad12d42d208d554a00ce7b2555bb8214ee Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Wed, 16 Aug 2023 16:50:30 +0200 Subject: [PATCH 197/206] refactor(batch): add ensure body in separate util --- packages/fetch-batch/src/batch-response-stream.ts | 4 +++- packages/fetch-batch/src/batch-response.ts | 6 ++++-- packages/fetch-batch/src/batch-response.utils.ts | 9 ++++++++- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/packages/fetch-batch/src/batch-response-stream.ts b/packages/fetch-batch/src/batch-response-stream.ts index 3d0a7ded..84e367e4 100644 --- a/packages/fetch-batch/src/batch-response-stream.ts +++ b/packages/fetch-batch/src/batch-response-stream.ts @@ -1,5 +1,6 @@ import { concat, SearchArray } from "./utils"; import { + ensureBody, parseBoundary, parseContentId, parseHeaders, @@ -435,7 +436,8 @@ export class BatchStreamResponse implements AsyncIterable<[string, Response]> { */ async *[Symbol.asyncIterator]() { const boundary = parseBoundary(this.#response); - const stream = this.#response.body!.pipeThrough( + ensureBody(this.#response.body); + const stream = this.#response.body.pipeThrough( new TransformStream(new HttpBatchTansformer(boundary, this.#options)) ); const reader = stream.getReader(); diff --git a/packages/fetch-batch/src/batch-response.ts b/packages/fetch-batch/src/batch-response.ts index ef363118..9745abd5 100644 --- a/packages/fetch-batch/src/batch-response.ts +++ b/packages/fetch-batch/src/batch-response.ts @@ -39,6 +39,7 @@ import { concat, SearchArray } from "./utils"; import { + ensureBody, parseBoundary, parseContentId, parseHeaders, @@ -88,7 +89,7 @@ export class BatchResponse implements AsyncIterable<[string, Response]> { */ async *[Symbol.asyncIterator]() { const boundary = parseBoundary(this.#response); - const buffers: Uint8Array[] = await this.#readChuncks(); + const buffers = await this.#readChuncks(); const data = concat(buffers); const searchBoundary = new SearchArray( this.#encoder.encode(`--${boundary}\r\n`) @@ -127,8 +128,9 @@ export class BatchResponse implements AsyncIterable<[string, Response]> { * @returns - the combined data of the multipart/mixed response body in a single Uint8Array */ async #readChuncks() { + ensureBody(this.#response.body); const buffers: Uint8Array[] = []; - const reader = this.#response.body!.getReader(); + const reader = this.#response.body.getReader(); while (true) { const { done, value } = await reader.read(); if (done) { diff --git a/packages/fetch-batch/src/batch-response.utils.ts b/packages/fetch-batch/src/batch-response.utils.ts index d0a7e831..90665cf0 100644 --- a/packages/fetch-batch/src/batch-response.utils.ts +++ b/packages/fetch-batch/src/batch-response.utils.ts @@ -20,10 +20,17 @@ export function parseBoundary(response: Response) { if (!boundary) { throw new Error("BatchResponse: Invalid boundary"); } - if (!response.body) throw new Error("BatchResponse: Empty response body"); return boundary; } +export function ensureBody( + body: ReadableStream | null +): asserts body is ReadableStream { + if (!body) { + throw new Error("BatchResponse: Empty response body"); + } +} + /** * parse content id from headers * @param headers - The headers to parse the content id from From 0f896be701a17c6d2c8814a46d4045f4b07d91fb Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Wed, 16 Aug 2023 17:04:33 +0200 Subject: [PATCH 198/206] refactor(batch): parse boundary from headers --- packages/fetch-batch/src/batch-response-stream.ts | 2 +- packages/fetch-batch/src/batch-response.ts | 2 +- packages/fetch-batch/src/batch-response.utils.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/fetch-batch/src/batch-response-stream.ts b/packages/fetch-batch/src/batch-response-stream.ts index 84e367e4..54344794 100644 --- a/packages/fetch-batch/src/batch-response-stream.ts +++ b/packages/fetch-batch/src/batch-response-stream.ts @@ -435,7 +435,7 @@ export class BatchStreamResponse implements AsyncIterable<[string, Response]> { * @returns an async iterator that yields a response for each request */ async *[Symbol.asyncIterator]() { - const boundary = parseBoundary(this.#response); + const boundary = parseBoundary(this.#response.headers); ensureBody(this.#response.body); const stream = this.#response.body.pipeThrough( new TransformStream(new HttpBatchTansformer(boundary, this.#options)) diff --git a/packages/fetch-batch/src/batch-response.ts b/packages/fetch-batch/src/batch-response.ts index 9745abd5..21065782 100644 --- a/packages/fetch-batch/src/batch-response.ts +++ b/packages/fetch-batch/src/batch-response.ts @@ -88,7 +88,7 @@ export class BatchResponse implements AsyncIterable<[string, Response]> { * @returns an async iterator that yields a response for each request */ async *[Symbol.asyncIterator]() { - const boundary = parseBoundary(this.#response); + const boundary = parseBoundary(this.#response.headers); const buffers = await this.#readChuncks(); const data = concat(buffers); const searchBoundary = new SearchArray( diff --git a/packages/fetch-batch/src/batch-response.utils.ts b/packages/fetch-batch/src/batch-response.utils.ts index 90665cf0..1e2631cd 100644 --- a/packages/fetch-batch/src/batch-response.utils.ts +++ b/packages/fetch-batch/src/batch-response.utils.ts @@ -9,8 +9,8 @@ const boundaryRegExp = /boundary="?([^";]+)"?;?/; * @returns the boundary * @throws if the response is not multipart/mixed or if the boundary is not found or if there is no response body */ -export function parseBoundary(response: Response) { - const contentType = response.headers.get("content-type"); +export function parseBoundary(headers: Headers) { + const contentType = headers.get("content-type"); if (!contentType?.startsWith("multipart/mixed")) { throw new Error( "BatchResponse: Invalid content type, expected multipart/mixed" From 409d0a519c90ea50c1d43a044ecc68c5988b4358 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Wed, 16 Aug 2023 17:20:23 +0200 Subject: [PATCH 199/206] docs(batch): clean readme --- packages/fetch-batch/README.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/packages/fetch-batch/README.md b/packages/fetch-batch/README.md index 3630fe11..59217a58 100644 --- a/packages/fetch-batch/README.md +++ b/packages/fetch-batch/README.md @@ -153,9 +153,4 @@ Each part is separated by a boundary. And each part starts with a Content-ID hea else if(contentId === body.getRequestId(renameUser2)) console.log('renameUser2 response',await response.json()) } - // or directly with request / response matching - const getUser1Response = await batched.getResponse(body.getRequestId(getUser1)); - console.log('getUser1 response',await getUser1Response.json()) - const renameUser2Response = await batched.getResponse(body.getRequestId(renameUser2)); - console.log('renameUser2 response',await renameUser2Response.json()) ``` From da4d153346fa886bacc93dfcc70bb7071719b3c0 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Wed, 16 Aug 2023 20:46:16 +0200 Subject: [PATCH 200/206] feat(batch): add react-native support for responses --- .../fetch-batch/src/batch-request.test.ts | 3 + .../src/batch-response-react-native.ts | 175 ++++++++++++++++++ .../fetch-batch/src/batch-response.utils.ts | 11 +- packages/fetch-batch/src/index.ts | 4 + 4 files changed, 191 insertions(+), 2 deletions(-) create mode 100644 packages/fetch-batch/src/batch-response-react-native.ts diff --git a/packages/fetch-batch/src/batch-request.test.ts b/packages/fetch-batch/src/batch-request.test.ts index d0ec5418..cbdb0620 100644 --- a/packages/fetch-batch/src/batch-request.test.ts +++ b/packages/fetch-batch/src/batch-request.test.ts @@ -3,6 +3,7 @@ import type { AddressInfo } from "net"; import { BatchRequest } from "./batch-request"; import { makeBatchResponse } from "./batch-response"; import { makeBatchStreamResponse } from "./batch-response-stream"; +import { makeReactNativeBatchResponse } from "./batch-response-react-native"; const responseDatas = [ `Preamble @@ -64,6 +65,8 @@ describe.each([ { make: makeBatchResponse, batch: "/batch-stream" }, { make: makeBatchStreamResponse, batch: "/batch" }, { make: makeBatchStreamResponse, batch: "/batch-stream" }, + { make: makeReactNativeBatchResponse, batch: "/batch" }, + { make: makeReactNativeBatchResponse, batch: "/batch-stream" }, ])(`BatchRequest $make.name with endpoint '$batch'`, ({ make, batch }) => { let app: express.Express; let server: ReturnType; diff --git a/packages/fetch-batch/src/batch-response-react-native.ts b/packages/fetch-batch/src/batch-response-react-native.ts new file mode 100644 index 00000000..e2d0ca7e --- /dev/null +++ b/packages/fetch-batch/src/batch-response-react-native.ts @@ -0,0 +1,175 @@ +import { + parseBoundary, + parseContentId, + parseHeadersString, + parseStatusLineString, +} from "./batch-response.utils"; + +/** + * A BatchResponse implementation for react native not using streams + * it's less efficient than the stream implementation but it's the only way to make it work on react native + * since it only supports .text() and .json() methods on the response + */ +export class ReactNativeBatchResponse + implements AsyncIterable<[string, Response]> +{ + #response: Response; + + constructor(response: Response) { + this.#response = response; + } + + /** + * async iterator that allows to iterate over the responses + * + * if not already, it parses the multipart/mixed response and yields a response for each request + * allowing to handle each response individually + * + * parse the multipart/mixed response and store each response in a map + * where the key is the content id of the request + * + * Grammar for multipart/mixed content type: + * multipart-body := preamble 1*encapsulation close-delimiter epilogue + * encapsulation := delimiter body-part CRLF + * delimiter := "--" boundary CRLF + * close-delimiter := "--" boundary "--" CRLF + * preamble := discard-text + * epilogue := discard-text + * discard-text := *(*text CRLF) + * body-part := *(header-field CRLF) CRLF [HTTP-message] + * + * Grammar for application/http content type: + * HTTP-message := start-line *(header-field CRLF) CRLF [ message-body ] + * start-line := Request-Line | Status-Line + * Request-Line := Method SP Request-URI SP HTTP-Version CRLF + * Status-Line := HTTP-Version SP Status-Code SP Reason-Phrase CRLF + * header-field := field-name ":" [ SP ] field-value [ SP ] + * field-name := + * field-value := + * message-body := *OCTET ; message body may be any OCTET but should not contain the same delimiter as the enclosing multipart type + * + * @returns an async iterator that yields a response for each request + */ + async *[Symbol.asyncIterator]() { + const boundary = parseBoundary(this.#response.headers); + const data = await this.#response.text(); + + const boundaryPattern = `--${boundary}\r\n`; + const endBoundaryPattern = `--${boundary}--\r\n`; + const boundaryIndexes = this.#findAllIndexes(data, boundaryPattern); + const endBoundaryIndex = data.indexOf(endBoundaryPattern); + if (endBoundaryIndex === -1) { + throw new Error( + "BatchResponse: Invalid response, no ending boundary found" + ); + } + const indexes = boundaryIndexes.map((index, i) => ({ + start: index + boundaryPattern.length, + end: (boundaryIndexes[i + 1] || endBoundaryIndex) - 2, + })); + for (const { start, end } of indexes) { + const parsedResponse = this.#parseEmbeddedResponse( + data.substring(start, end) + ); + if (parsedResponse) { + yield [parsedResponse.contentId, parsedResponse.response] as [ + string, + Response + ]; + } + } + } + + #findAllIndexes(data: string, pattern: string) { + const indexes = []; + let index = data.indexOf(pattern); + while (index !== -1) { + indexes.push(index); + index = data.indexOf(pattern, index + pattern.length); + } + return indexes; + } + + /** + * parse a multipart/mixed response part only allowing application/http content type + * @param data - The data of the multipart/mixed response + * @returns - The content id and the response + * @example + * ```yaml + * Content-Type: application/http + * Content-ID: + * + * HTTP/1.1 200 OK + * Content-Type: application/json + * Content-Length: response_part_2_content_length + * ETag: "etag/sheep" + * + * { + * "kind": "farm#animal", + * "etag": "etag/sheep", + * "selfLink": "/farm/v1/animals/sheep", + * "animalName": "sheep", + * "animalAge": 5, + * "peltColor": "green" + * } + * ``` + */ + #parseEmbeddedResponse(data: string) { + const dividerPattern = "\r\n\r\n"; + const newLinePattern = "\r\n"; + const partHeadersEndIndex = data.indexOf(dividerPattern); + if (partHeadersEndIndex === -1) { + throw new Error("BatchResponse: Invalid part, no headers found"); + } + const partHeadersString = data.substring(0, partHeadersEndIndex); + const partHeaders = parseHeadersString(partHeadersString); + const contentType = partHeaders.get("content-type"); + if (!contentType?.startsWith("application/http")) { + return undefined; + } + + const partBodyString = data.substring( + partHeadersEndIndex + dividerPattern.length + ); + const responseHeadersEndIndex = partBodyString.indexOf(dividerPattern); + if (responseHeadersEndIndex === -1) { + throw new Error("BatchResponse: Invalid response"); + } + const responseStatusLineEndIndex = partBodyString.indexOf(newLinePattern); + if (responseStatusLineEndIndex === -1) { + throw new Error("BatchResponse: Invalid response status line"); + } + const responseStatusLineString = partBodyString.substring( + 0, + responseStatusLineEndIndex + ); + const responseHeadersString = partBodyString.substring( + responseStatusLineEndIndex + newLinePattern.length, + responseHeadersEndIndex + ); + const responseBodyString = partBodyString.substring( + responseHeadersEndIndex + dividerPattern.length + ); + const responseStatusLine = parseStatusLineString(responseStatusLineString); + const responseHeaders = parseHeadersString(responseHeadersString); + + const contentId = parseContentId(partHeaders); + const response = new Response( + responseBodyString.length > 0 ? responseBodyString : undefined, + { + status: responseStatusLine.status, + statusText: responseStatusLine.statusText, + headers: responseHeaders, + } + ); + + return { + contentId, + response, + }; + } +} + +export function makeReactNativeBatchResponse(response: Response) { + return new ReactNativeBatchResponse(response); +} diff --git a/packages/fetch-batch/src/batch-response.utils.ts b/packages/fetch-batch/src/batch-response.utils.ts index 1e2631cd..89c2db10 100644 --- a/packages/fetch-batch/src/batch-response.utils.ts +++ b/packages/fetch-batch/src/batch-response.utils.ts @@ -56,7 +56,10 @@ export function parseContentId(headers: Headers) { * @returns the status and status text */ export function parseStatusLine(statusLineBytes: Uint8Array) { - const statusLine = new TextDecoder().decode(statusLineBytes); + return parseStatusLineString(new TextDecoder().decode(statusLineBytes)); +} + +export function parseStatusLineString(statusLine: string) { const match = statusLine.match(statusLineRegExp); if (!match) { throw new Error("BatchResponse: Invalid response status line"); @@ -79,7 +82,11 @@ export function parseStatusLine(statusLineBytes: Uint8Array) { * @returns */ export function parseHeaders(headersBytes: Uint8Array) { - const decodedHeaders = new TextDecoder().decode(headersBytes).split("\r\n"); + return parseHeadersString(new TextDecoder().decode(headersBytes)); +} + +export function parseHeadersString(headersStr: string) { + const decodedHeaders = headersStr.split("\r\n"); const headers = new Headers(); let lastKey: string | undefined; for (const header of decodedHeaders) { diff --git a/packages/fetch-batch/src/index.ts b/packages/fetch-batch/src/index.ts index 8605ea6f..21dc2af0 100644 --- a/packages/fetch-batch/src/index.ts +++ b/packages/fetch-batch/src/index.ts @@ -4,6 +4,10 @@ export { BatchStreamResponse, makeBatchStreamResponse, } from "./batch-response-stream"; +export { + ReactNativeBatchResponse, + makeReactNativeBatchResponse, +} from "./batch-response-react-native"; export { BatchRequest } from "./batch-request"; export type { BatchRequestEndpoint, From f703e732c213c70ae7d0fd7f7e2c86c58cd98d55 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Wed, 16 Aug 2023 21:48:38 +0200 Subject: [PATCH 201/206] feat(batch): add support for react-native --- .../src/batch-data-react-native.ts | 112 +++ packages/fetch-batch/src/batch-data.test.ts | 2 +- packages/fetch-batch/src/batch-data.ts | 14 +- packages/fetch-batch/src/batch-data.types.ts | 19 + .../fetch-batch/src/batch-request.test.ts | 769 ++++++++++-------- packages/fetch-batch/src/batch-request.ts | 27 +- .../fetch-batch/src/batch-request.types.ts | 4 + packages/fetch-batch/src/index.ts | 7 +- 8 files changed, 577 insertions(+), 377 deletions(-) create mode 100644 packages/fetch-batch/src/batch-data-react-native.ts create mode 100644 packages/fetch-batch/src/batch-data.types.ts diff --git a/packages/fetch-batch/src/batch-data-react-native.ts b/packages/fetch-batch/src/batch-data-react-native.ts new file mode 100644 index 00000000..ff65d8d0 --- /dev/null +++ b/packages/fetch-batch/src/batch-data-react-native.ts @@ -0,0 +1,112 @@ +import { IBatchData, BatchDataForeachCallback } from "./batch-data.types"; + +export class ReactNativeBatchData implements IBatchData { + #requests = new Map(); + #requestIdSuffix = `${Date.now()}@zodios.org`; + #boundary = `batch__${Date.now()}__batch`; + + constructor() {} + + get boundary() { + return this.#boundary; + } + + addRequest(request: Request) { + const requestId = `request-${this.#requests.size + 1}-${ + this.#requestIdSuffix + }`; + this.#requests.set(requestId, request); + return requestId; + } + + getHeaders(init?: HeadersInit) { + const headers = new Headers(init); + headers.set("Content-Type", `multipart/mixed; boundary=${this.#boundary}`); + return headers; + } + + [Symbol.iterator]() { + return this.#requests.entries(); + } + + requests() { + return this.#requests.values(); + } + + requestIds() { + return this.#requests.keys(); + } + + entries() { + return this.#requests.entries(); + } + + getRequest(requestOrResponseId: string) { + for (const id of this.requestIds()) { + if (requestOrResponseId.includes(id)) { + return this.#requests.get(id); + } + } + } + + forEach(callback: BatchDataForeachCallback) { + this.#requests.forEach((request, requestId) => + callback(request, requestId, this) + ); + } + + getRequestId(request: Request) { + for (const [requestId, req] of this.#requests.entries()) { + if (req === request) { + return requestId; + } + } + } + + async body() { + return this.#format(); + } + + #formatHeaders(headers: Headers) { + let result = ""; + for (const [name, value] of headers) { + result += `${name}: ${value}\r\n`; + } + result += "\r\n"; + return result; + } + + #formatPart(requestId: string) { + const headers = new Headers(); + headers.set("Content-ID", `<${requestId}>`); + headers.set("Content-Type", "application/http; msgtype=request"); + return this.#formatHeaders(headers); + } + + async #formatRequest(request: Request) { + const url = new URL(request.url); + return ( + `${request.method} ${url.pathname}${url.search}${url.hash} HTTP/1.1\r\n` + + this.#formatHeaders(request.headers) + + (await request.text()) + ); + } + + async #format() { + let result = ""; + const boundary = `--${this.#boundary}\r\n`; + const boundaryClose = `--${this.#boundary}--\r\n`; + for (const [requestId, request] of this.#requests) { + result += boundary; + result += this.#formatPart(requestId); + result += await this.#formatRequest(request); + result += "\r\n"; + } + result += boundaryClose; + return result; + } +} + +export function makeReactNativeBatchData() { + return new ReactNativeBatchData(); +} diff --git a/packages/fetch-batch/src/batch-data.test.ts b/packages/fetch-batch/src/batch-data.test.ts index e600f632..40f5d0f7 100644 --- a/packages/fetch-batch/src/batch-data.test.ts +++ b/packages/fetch-batch/src/batch-data.test.ts @@ -65,7 +65,7 @@ describe("BatchData", () => { const batched = await fetch(`http://localhost:${port}/batch`, { method: "POST", headers: body.getHeaders(), - body: body.stream(), + body: body.body(), }).then((response) => response.json()); expect(batched.url).toBe("/batch"); diff --git a/packages/fetch-batch/src/batch-data.ts b/packages/fetch-batch/src/batch-data.ts index 7ad8831a..efb93b1f 100644 --- a/packages/fetch-batch/src/batch-data.ts +++ b/packages/fetch-batch/src/batch-data.ts @@ -1,10 +1,6 @@ -export type BatchDataForeachCallback = ( - request: Request, - requestId: string, - batchdata: BatchData -) => void; +import { IBatchData, BatchDataForeachCallback } from "./batch-data.types"; -export class BatchData { +export class BatchData implements IBatchData { #requests = new Map(); #requestIdSuffix = `${Date.now()}@zodios.org`; #boundary = `batch__${Date.now()}__batch`; @@ -68,7 +64,7 @@ export class BatchData { } } - stream() { + body() { const iterator = this.#encodedIterator(); return new ReadableStream({ async pull(controller) { @@ -130,3 +126,7 @@ export class BatchData { yield boundaryClose; } } + +export function makeBatchData() { + return new BatchData(); +} diff --git a/packages/fetch-batch/src/batch-data.types.ts b/packages/fetch-batch/src/batch-data.types.ts new file mode 100644 index 00000000..41299eda --- /dev/null +++ b/packages/fetch-batch/src/batch-data.types.ts @@ -0,0 +1,19 @@ +export type BatchDataForeachCallback = ( + request: Request, + requestId: string, + batchdata: IBatchData +) => void; + +export interface IBatchData { + get boundary(): string; + addRequest(request: Request): string; + getHeaders(init?: HeadersInit): Headers; + requests(): IterableIterator; + requestIds(): IterableIterator; + entries(): IterableIterator<[string, Request]>; + getRequest(requestOrResponseId: string): Request | undefined; + forEach(callback: BatchDataForeachCallback): void; + getRequestId(request: Request): string | undefined; + body(): ReadableStream | Promise | undefined; + [Symbol.iterator](): IterableIterator<[string, Request]>; +} diff --git a/packages/fetch-batch/src/batch-request.test.ts b/packages/fetch-batch/src/batch-request.test.ts index cbdb0620..d881aa95 100644 --- a/packages/fetch-batch/src/batch-request.test.ts +++ b/packages/fetch-batch/src/batch-request.test.ts @@ -4,6 +4,8 @@ import { BatchRequest } from "./batch-request"; import { makeBatchResponse } from "./batch-response"; import { makeBatchStreamResponse } from "./batch-response-stream"; import { makeReactNativeBatchResponse } from "./batch-response-react-native"; +import { makeBatchData } from "./batch-data"; +import { makeReactNativeBatchData } from "./batch-data-react-native"; const responseDatas = [ `Preamble @@ -61,389 +63,440 @@ const responseData = responseDatas.join("").replace(/\n/g, "\r\n"); const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); describe.each([ - { make: makeBatchResponse, batch: "/batch" }, - { make: makeBatchResponse, batch: "/batch-stream" }, - { make: makeBatchStreamResponse, batch: "/batch" }, - { make: makeBatchStreamResponse, batch: "/batch-stream" }, - { make: makeReactNativeBatchResponse, batch: "/batch" }, - { make: makeReactNativeBatchResponse, batch: "/batch-stream" }, -])(`BatchRequest $make.name with endpoint '$batch'`, ({ make, batch }) => { - let app: express.Express; - let server: ReturnType; - let port: number; - - beforeAll(() => { - const app = express(); - app.use(express.json()); - app.use(express.raw({ type: "multipart/mixed" })); - - app.post("/batch", (req, res) => { - res.setHeader( - "Content-Type", - "multipart/mixed; boundary=batch__1675206000000__batch" - ); - const body = req.body.toString(); - // extract the requests ids - const regex = /content-id:\s*<([^>]+)>/g; - const matches = [...body.matchAll(regex)]; - let response = responseData; - matches - .map((match) => match[1]) - .forEach((id, i) => { - // replace the response placeholders with the actual response - response = response.replace(`PLACEHOLDER${i + 1}`, id); + { + makeBatchedResponse: makeBatchResponse, + makeBatchedData: makeBatchData, + batch: "/batch", + }, + { + makeBatchedResponse: makeBatchResponse, + makeBatchedData: makeBatchData, + batch: "/batch-stream", + }, + { + makeBatchedResponse: makeBatchStreamResponse, + makeBatchedData: makeBatchData, + batch: "/batch", + }, + { + makeBatchedResponse: makeBatchStreamResponse, + makeBatchedData: makeBatchData, + batch: "/batch-stream", + }, + { + makeBatchedResponse: makeReactNativeBatchResponse, + makeBatchedData: makeReactNativeBatchData, + batch: "/batch", + }, + { + makeBatchedResponse: makeReactNativeBatchResponse, + makeBatchedData: makeReactNativeBatchData, + batch: "/batch-stream", + }, +])( + `BatchRequest $make.name with endpoint '$batch'`, + ({ makeBatchedResponse, makeBatchedData, batch }) => { + let app: express.Express; + let server: ReturnType; + let port: number; + + beforeAll(() => { + const app = express(); + app.use(express.json()); + app.use(express.raw({ type: "multipart/mixed" })); + + app.post("/batch", (req, res) => { + res.setHeader( + "Content-Type", + "multipart/mixed; boundary=batch__1675206000000__batch" + ); + const body = req.body.toString(); + // extract the requests ids + const regex = /content-id:\s*<([^>]+)>/g; + const matches = [...body.matchAll(regex)]; + let response = responseData; + matches + .map((match) => match[1]) + .forEach((id, i) => { + // replace the response placeholders with the actual response + response = response.replace(`PLACEHOLDER${i + 1}`, id); + }); + res.status(200).send(response); + }); + + app.post("/batch-stream", async (req, res) => { + res.setHeader( + "Content-Type", + "multipart/mixed; boundary=batch__1675206000000__batch" + ); + const body = req.body.toString(); + // extract the requests ids + const regex = /content-id:\s*<([^>]+)>/g; + const matches = [...body.matchAll(regex)]; + let responses = responseDatas.map((response) => + response.replace(/\n/g, "\r\n") + ); + matches + .map((match) => match[1]) + .forEach((id, i) => { + // replace the response placeholders with the actual response + responses = responses.map((response) => + response.replace(`PLACEHOLDER${i + 1}`, id) + ); + }); + res.writeHead(200); + for await (const response of responses) { + res.write(response); + await sleep(100); + } + res.end(); + }); + + // simulate a proxy timeout that don't handle multipart/mixed + app.post("/batch-pending", async (req, res) => { + await sleep(1000); + res.status(504).json({ + error: "timeout", }); - res.status(200).send(response); - }); + }); - app.post("/batch-stream", async (req, res) => { - res.setHeader( - "Content-Type", - "multipart/mixed; boundary=batch__1675206000000__batch" - ); - const body = req.body.toString(); - // extract the requests ids - const regex = /content-id:\s*<([^>]+)>/g; - const matches = [...body.matchAll(regex)]; - let responses = responseDatas.map((response) => - response.replace(/\n/g, "\r\n") - ); - matches - .map((match) => match[1]) - .forEach((id, i) => { - // replace the response placeholders with the actual response - responses = responses.map((response) => - response.replace(`PLACEHOLDER${i + 1}`, id) - ); + // simulate an internal server error that don't send back multipart/mixed + app.post("/batch-error", (req, res) => { + res.status(500).json({ + error: "internal server error", }); - res.writeHead(200); - for await (const response of responses) { - res.write(response); - await sleep(100); - } - res.end(); - }); + }); - // simulate a proxy timeout that don't handle multipart/mixed - app.post("/batch-pending", async (req, res) => { - await sleep(1000); - res.status(504).json({ - error: "timeout", + app.get("/users/:id", (req, res) => { + res.status(200).json({ + id: req.params.id, + name: "john doe", + }); }); + + server = app.listen(0); + port = (server.address() as AddressInfo).port; }); - // simulate an internal server error that don't send back multipart/mixed - app.post("/batch-error", (req, res) => { - res.status(500).json({ - error: "internal server error", + afterAll((done) => { + server.close(done); + }); + + it("should be able to fetch one request", async () => { + const client = new BatchRequest( + { + input: `http://localhost:${port}${batch}`, + init: { + method: "POST", + }, + }, + { + makeBatchResponse: makeBatchedResponse, + makeBatchData: makeBatchedData, + } + ); + const user7 = await client + .fetch(`http://localhost:${port}/users/7`) + .then((res) => res.json()); + + expect(user7).toEqual({ + id: "7", + name: "john doe", }); }); - app.get("/users/:id", (req, res) => { - res.status(200).json({ - id: req.params.id, + it("should be able to fetch multiple requests", async () => { + const client = new BatchRequest( + { + input: `http://localhost:${port}${batch}`, + init: { + method: "POST", + }, + }, + { + makeBatchResponse: makeBatchedResponse, + makeBatchData: makeBatchedData, + } + ); + const [user1, user2, nothing] = await Promise.all([ + client + .fetch(`http://localhost:${port}/users/1`) + .then((res) => res.json()), + client + .fetch(`http://localhost:${port}/users/2`) + .then((res) => res.json()), + client.fetch(`http://localhost:${port}/users/1`), + ]); + + expect(user1).toEqual({ + id: 1, name: "john doe", }); + expect(user2).toEqual({ + id: 2, + name: "jane doe", + }); + expect(nothing.status).toBe(304); }); - server = app.listen(0); - port = (server.address() as AddressInfo).port; - }); + it("should error if batch endpoint errors", async () => { + const client = new BatchRequest( + { + input: `http://localhost:${port}/batch-error`, + init: { + method: "POST", + }, + }, + { + makeBatchResponse: makeBatchedResponse, + makeBatchData: makeBatchedData, + } + ); - afterAll((done) => { - server.close(done); - }); + const [user1, user2, nothing] = await Promise.all([ + client + .fetch(`http://localhost:${port}/users/1`) + .then((res) => res.json()), + client + .fetch(`http://localhost:${port}/users/2`) + .then((res) => res.json()), + client.fetch(`http://localhost:${port}/users/1`), + ]); + expect(user1).toEqual({ + error: "internal server error", + }); + expect(user2).toEqual({ + error: "internal server error", + }); + expect(nothing.status).toBe(500); + }); - it("should be able to fetch one request", async () => { - const client = new BatchRequest( - { - input: `http://localhost:${port}${batch}`, - init: { - method: "POST", + it("should cancel one request if asked to before batching", async () => { + const controller = new AbortController(); + controller.abort(); + const client = new BatchRequest( + { + input: `http://localhost:${port}${batch}`, + init: { + method: "POST", + }, }, - }, - make - ); - const user7 = await client - .fetch(`http://localhost:${port}/users/7`) - .then((res) => res.json()); - - expect(user7).toEqual({ - id: "7", - name: "john doe", + { + makeBatchResponse: makeBatchedResponse, + makeBatchData: makeBatchedData, + } + ); + + const [user1Promise, user2Promise, nothingPromise] = [ + client + .fetch(`http://localhost:${port}/users/1`) + .then((res) => res.json()), + client.fetch(`http://localhost:${port}/users/2`, { + signal: controller.signal, + }), + client.fetch(`http://localhost:${port}/users/1`), + ]; + + const [user1, user2, nothing] = await Promise.allSettled([ + user1Promise, + user2Promise, + nothingPromise, + ]); + + expect(user1.status).toBe("fulfilled"); + expect(user2.status).toBe("rejected"); + expect(nothing.status).toBe("fulfilled"); }); - }); - - it("should be able to fetch multiple requests", async () => { - const client = new BatchRequest( - { - input: `http://localhost:${port}${batch}`, - init: { - method: "POST", + + it("should cancel one request if asked to after batching", async () => { + const controller = new AbortController(); + const client = new BatchRequest( + { + input: `http://localhost:${port}/batch-stream`, + init: { + method: "POST", + }, }, - }, - make - ); - const [user1, user2, nothing] = await Promise.all([ - client - .fetch(`http://localhost:${port}/users/1`) - .then((res) => res.json()), - client - .fetch(`http://localhost:${port}/users/2`) - .then((res) => res.json()), - client.fetch(`http://localhost:${port}/users/1`), - ]); - - expect(user1).toEqual({ - id: 1, - name: "john doe", - }); - expect(user2).toEqual({ - id: 2, - name: "jane doe", + { + makeBatchResponse: makeBatchedResponse, + makeBatchData: makeBatchedData, + } + ); + + const [user1Promise, user2Promise, nothingPromise] = [ + client + .fetch(`http://localhost:${port}/users/1`) + .then((res) => res.json()), + client + .fetch(`http://localhost:${port}/users/2`, { + signal: controller.signal, + }) + .then((res) => { + controller.abort(); + return res.json(); + }), + client.fetch(`http://localhost:${port}/users/1`), + ]; + + const [user1, user2, nothing] = await Promise.allSettled([ + user1Promise, + user2Promise, + nothingPromise, + ]); + + if (nothing.status === "rejected") { + expect(nothing.reason).toEqual(""); + } + + expect(user1.status).toBe("fulfilled"); + expect(user2.status).toBe("rejected"); + expect(nothing.status).toBe("fulfilled"); }); - expect(nothing.status).toBe(304); - }); - - it("should error if batch endpoint errors", async () => { - const client = new BatchRequest( - { - input: `http://localhost:${port}/batch-error`, - init: { - method: "POST", + + it("should not cancel requests if asked to before batching", async () => { + const client = new BatchRequest( + { + input: `http://localhost:${port}${batch}`, + init: { + method: "POST", + }, }, - }, - make - ); - - const [user1, user2, nothing] = await Promise.all([ - client - .fetch(`http://localhost:${port}/users/1`) - .then((res) => res.json()), - client - .fetch(`http://localhost:${port}/users/2`) - .then((res) => res.json()), - client.fetch(`http://localhost:${port}/users/1`), - ]); - expect(user1).toEqual({ - error: "internal server error", - }); - expect(user2).toEqual({ - error: "internal server error", + { + makeBatchResponse: makeBatchedResponse, + makeBatchData: makeBatchedData, + } + ); + + client.cancel(); + + const [user1Promise, user2Promise, nothingPromise] = [ + client + .fetch(`http://localhost:${port}/users/1`) + .then((res) => res.json()), + client.fetch(`http://localhost:${port}/users/2`), + client.fetch(`http://localhost:${port}/users/1`), + ]; + + const [user1, user2, nothing] = await Promise.allSettled([ + user1Promise, + user2Promise, + nothingPromise, + ]); + + expect(user1.status).toBe("fulfilled"); + expect(user2.status).toBe("fulfilled"); + expect(nothing.status).toBe("fulfilled"); }); - expect(nothing.status).toBe(500); - }); - - it("should cancel one request if asked to before batching", async () => { - const controller = new AbortController(); - controller.abort(); - const client = new BatchRequest( - { - input: `http://localhost:${port}${batch}`, - init: { - method: "POST", + + it("should cancel all requests if asked to after batching", async () => { + const client = new BatchRequest( + { + input: `http://localhost:${port}${batch}`, + init: { + method: "POST", + }, }, - }, - make - ); - - const [user1Promise, user2Promise, nothingPromise] = [ - client - .fetch(`http://localhost:${port}/users/1`) - .then((res) => res.json()), - client.fetch(`http://localhost:${port}/users/2`, { - signal: controller.signal, - }), - client.fetch(`http://localhost:${port}/users/1`), - ]; - - const [user1, user2, nothing] = await Promise.allSettled([ - user1Promise, - user2Promise, - nothingPromise, - ]); - - expect(user1.status).toBe("fulfilled"); - expect(user2.status).toBe("rejected"); - expect(nothing.status).toBe("fulfilled"); - }); - - it("should cancel one request if asked to after batching", async () => { - const controller = new AbortController(); - const client = new BatchRequest( - { - input: `http://localhost:${port}/batch-stream`, - init: { - method: "POST", + { + makeBatchResponse: makeBatchedResponse, + makeBatchData: makeBatchedData, + } + ); + + const [user1Promise, user2Promise, nothingPromise] = [ + client + .fetch(`http://localhost:${port}/users/1`) + .then((res) => res.json()), + client.fetch(`http://localhost:${port}/users/2`), + client.fetch(`http://localhost:${port}/users/1`), + ]; + client.cancel(); + + const [user1, user2, nothing] = await Promise.allSettled([ + user1Promise, + user2Promise, + nothingPromise, + ]); + + expect(user1.status).toBe("rejected"); + expect(user2.status).toBe("rejected"); + expect(nothing.status).toBe("rejected"); + + const [user1Promise2, user2Promise2, nothingPromise2] = [ + client.fetch(`http://localhost:${port}/users/1`), + client.fetch(`http://localhost:${port}/users/2`), + client.fetch(`http://localhost:${port}/users/1`), + ]; + + const [user12, user22, nothing2] = await Promise.allSettled([ + user1Promise2, + user2Promise2, + nothingPromise2, + ]); + + expect(user12.status).toBe("fulfilled"); + expect(user22.status).toBe("fulfilled"); + expect(nothing2.status).toBe("fulfilled"); + }); + + it("should cancel all individual requests if asked to after batching", async () => { + const client = new BatchRequest( + { + input: `http://localhost:${port}/batch-pending`, + init: { + method: "POST", + }, }, - }, - make - ); - - const [user1Promise, user2Promise, nothingPromise] = [ - client - .fetch(`http://localhost:${port}/users/1`) - .then((res) => res.json()), - client + { + makeBatchResponse: makeBatchedResponse, + makeBatchData: makeBatchedData, + } + ); + + const controller = new AbortController(); + + const user1Promise = client + .fetch(`http://localhost:${port}/users/1`, { + signal: controller.signal, + }) + .then((res) => res.json()); + const user2Promise = client .fetch(`http://localhost:${port}/users/2`, { signal: controller.signal, }) - .then((res) => { - controller.abort(); - return res.json(); - }), - client.fetch(`http://localhost:${port}/users/1`), - ]; - - const [user1, user2, nothing] = await Promise.allSettled([ - user1Promise, - user2Promise, - nothingPromise, - ]); - - if (nothing.status === "rejected") { - expect(nothing.reason).toEqual(""); - } - - expect(user1.status).toBe("fulfilled"); - expect(user2.status).toBe("rejected"); - expect(nothing.status).toBe("fulfilled"); - }); - - it("should not cancel requests if asked to before batching", async () => { - const client = new BatchRequest( - { - input: `http://localhost:${port}${batch}`, - init: { - method: "POST", - }, - }, - make - ); - - client.cancel(); - - const [user1Promise, user2Promise, nothingPromise] = [ - client - .fetch(`http://localhost:${port}/users/1`) - .then((res) => res.json()), - client.fetch(`http://localhost:${port}/users/2`), - client.fetch(`http://localhost:${port}/users/1`), - ]; - - const [user1, user2, nothing] = await Promise.allSettled([ - user1Promise, - user2Promise, - nothingPromise, - ]); - - expect(user1.status).toBe("fulfilled"); - expect(user2.status).toBe("fulfilled"); - expect(nothing.status).toBe("fulfilled"); - }); - - it("should cancel all requests if asked to after batching", async () => { - const client = new BatchRequest( - { - input: `http://localhost:${port}${batch}`, - init: { - method: "POST", - }, - }, - make - ); - - const [user1Promise, user2Promise, nothingPromise] = [ - client - .fetch(`http://localhost:${port}/users/1`) - .then((res) => res.json()), - client.fetch(`http://localhost:${port}/users/2`), - client.fetch(`http://localhost:${port}/users/1`), - ]; - client.cancel(); - - const [user1, user2, nothing] = await Promise.allSettled([ - user1Promise, - user2Promise, - nothingPromise, - ]); - - expect(user1.status).toBe("rejected"); - expect(user2.status).toBe("rejected"); - expect(nothing.status).toBe("rejected"); - - const [user1Promise2, user2Promise2, nothingPromise2] = [ - client.fetch(`http://localhost:${port}/users/1`), - client.fetch(`http://localhost:${port}/users/2`), - client.fetch(`http://localhost:${port}/users/1`), - ]; - - const [user12, user22, nothing2] = await Promise.allSettled([ - user1Promise2, - user2Promise2, - nothingPromise2, - ]); - - expect(user12.status).toBe("fulfilled"); - expect(user22.status).toBe("fulfilled"); - expect(nothing2.status).toBe("fulfilled"); - }); - - it("should cancel all individual requests if asked to after batching", async () => { - const client = new BatchRequest( - { - input: `http://localhost:${port}/batch-pending`, - init: { - method: "POST", - }, - }, - make - ); - - const controller = new AbortController(); - - const user1Promise = client - .fetch(`http://localhost:${port}/users/1`, { - signal: controller.signal, - }) - .then((res) => res.json()); - const user2Promise = client - .fetch(`http://localhost:${port}/users/2`, { - signal: controller.signal, - }) - .then((res) => res.json()); - const nothingPromise = client - .fetch(`http://localhost:${port}/users/1`, { - signal: controller.signal, - }) - .then((res) => res.json()); - await sleep(100); - controller.abort(); - - await expect(user1Promise).rejects.toThrow("Aborted"); - await expect(user2Promise).rejects.toThrow("Aborted"); - await expect(nothingPromise).rejects.toThrow("Aborted"); - - const [user12, user22, nothing2] = await Promise.all([ - client - .fetch(`http://localhost:${port}/users/1`) - .then((res) => res.json()), - client - .fetch(`http://localhost:${port}/users/2`) - .then((res) => res.json()), - client - .fetch(`http://localhost:${port}/users/1`) - .then((res) => res.json()), - ]); - - expect(user12).toEqual({ - error: "timeout", - }); - expect(user22).toEqual({ - error: "timeout", - }); - expect(nothing2).toEqual({ - error: "timeout", + .then((res) => res.json()); + const nothingPromise = client + .fetch(`http://localhost:${port}/users/1`, { + signal: controller.signal, + }) + .then((res) => res.json()); + await sleep(100); + controller.abort(); + + await expect(user1Promise).rejects.toThrow("Aborted"); + await expect(user2Promise).rejects.toThrow("Aborted"); + await expect(nothingPromise).rejects.toThrow("Aborted"); + + const [user12, user22, nothing2] = await Promise.all([ + client + .fetch(`http://localhost:${port}/users/1`) + .then((res) => res.json()), + client + .fetch(`http://localhost:${port}/users/2`) + .then((res) => res.json()), + client + .fetch(`http://localhost:${port}/users/1`) + .then((res) => res.json()), + ]); + + expect(user12).toEqual({ + error: "timeout", + }); + expect(user22).toEqual({ + error: "timeout", + }); + expect(nothing2).toEqual({ + error: "timeout", + }); }); - }); -}); + } +); diff --git a/packages/fetch-batch/src/batch-request.ts b/packages/fetch-batch/src/batch-request.ts index b2f89013..612bfe25 100644 --- a/packages/fetch-batch/src/batch-request.ts +++ b/packages/fetch-batch/src/batch-request.ts @@ -1,4 +1,4 @@ -import { BatchData } from "./batch-data"; +import type { IBatchData } from "./batch-data.types"; import { cancelAbortedRequests, cancelRequestInQueue, @@ -26,6 +26,7 @@ export class BatchRequest { #fetch: typeof fetch; #controller?: AbortController; #alwaysBatch: boolean; + #makeBatchData: () => IBatchData; #makeBatchResponse: (response: Response) => AsyncIterable<[string, Response]>; /** @@ -37,16 +38,14 @@ export class BatchRequest { */ constructor( batchEndpoint: BatchRequestEndpoint, - makeBatchResponse: ( - response: Response - ) => AsyncIterable<[string, Response]>, - options?: BatchRequestOptions + options: BatchRequestOptions ) { this.#input = batchEndpoint.input; this.#init = batchEndpoint.init; - this.#fetch = options?.fetch ?? fetch; - this.#alwaysBatch = options?.alwaysBatch ?? false; - this.#makeBatchResponse = makeBatchResponse; + this.#fetch = options.fetch ?? fetch; + this.#alwaysBatch = options.alwaysBatch ?? false; + this.#makeBatchData = options.makeBatchData; + this.#makeBatchResponse = options.makeBatchResponse; } /** @@ -112,18 +111,26 @@ export class BatchRequest { return; } - const batchData = new BatchData(); + const batchData = this.#makeBatchData(); for (const request of queue.keys()) { batchData.addRequest(request); request.signal?.addEventListener("abort", () => cancelRequestInQueue(queue, request, controller) ); } + let body: ReadableStream | string | undefined; + const batchBody = batchData.body(); + if (batchBody instanceof ReadableStream) { + body = batchBody; + } else if (batchBody instanceof Promise) { + body = await batchBody; + } + try { const response = await this.#fetch(this.#input, { ...this.#init, headers: batchData.getHeaders(this.#init?.headers), - body: batchData.stream(), + body, signal: controller?.signal, }); if (isMultipartMixed(response.headers)) { diff --git a/packages/fetch-batch/src/batch-request.types.ts b/packages/fetch-batch/src/batch-request.types.ts index f8aba1c7..dc1dc8e2 100644 --- a/packages/fetch-batch/src/batch-request.types.ts +++ b/packages/fetch-batch/src/batch-request.types.ts @@ -1,3 +1,5 @@ +import { IBatchData } from "./batch-data.types"; + export type BatchCallbacks = { resolve: (value: Response) => void; reject: (reason?: unknown) => void; @@ -6,6 +8,8 @@ export type BatchCallbacks = { export type BatchRequestOptions = { fetch?: typeof fetch; alwaysBatch?: boolean; + makeBatchData: () => IBatchData; + makeBatchResponse: (response: Response) => AsyncIterable<[string, Response]>; }; export type BatchRequestEndpoint = { diff --git a/packages/fetch-batch/src/index.ts b/packages/fetch-batch/src/index.ts index 21dc2af0..f73a4172 100644 --- a/packages/fetch-batch/src/index.ts +++ b/packages/fetch-batch/src/index.ts @@ -1,4 +1,9 @@ -export { BatchData, BatchDataForeachCallback } from "./batch-data"; +export { BatchData, makeBatchData } from "./batch-data"; +export { + ReactNativeBatchData, + makeReactNativeBatchData, +} from "./batch-data-react-native"; +export { BatchDataForeachCallback, IBatchData } from "./batch-data.types"; export { BatchResponse, makeBatchResponse } from "./batch-response"; export { BatchStreamResponse, From 6aac5e5a5582a09abcedc62d9bc9151a0bc67778 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Wed, 16 Aug 2023 22:06:11 +0200 Subject: [PATCH 202/206] refactor(batch): make format reaquest more readable --- packages/fetch-batch/src/batch-data-react-native.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/fetch-batch/src/batch-data-react-native.ts b/packages/fetch-batch/src/batch-data-react-native.ts index ff65d8d0..016c4ba2 100644 --- a/packages/fetch-batch/src/batch-data-react-native.ts +++ b/packages/fetch-batch/src/batch-data-react-native.ts @@ -85,11 +85,10 @@ export class ReactNativeBatchData implements IBatchData { async #formatRequest(request: Request) { const url = new URL(request.url); - return ( - `${request.method} ${url.pathname}${url.search}${url.hash} HTTP/1.1\r\n` + - this.#formatHeaders(request.headers) + - (await request.text()) - ); + let result = `${request.method} ${url.pathname}${url.search}${url.hash} HTTP/1.1\r\n`; + result += this.#formatHeaders(request.headers); + result += await request.text(); + return result; } async #format() { From 5cd6a2a39f5ac2ab74b66c7605cb8ec5affd1e1c Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Wed, 16 Aug 2023 22:18:46 +0200 Subject: [PATCH 203/206] docs(batch): update readme with new options interface --- packages/fetch-batch/README.md | 38 +++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/packages/fetch-batch/README.md b/packages/fetch-batch/README.md index 59217a58..45ad2fb0 100644 --- a/packages/fetch-batch/README.md +++ b/packages/fetch-batch/README.md @@ -21,7 +21,10 @@ This allows to batch automatically all requests made within the same tick (aka t input: `/batch`, init: { method: "POST" } }, - (response) => new BatchResponse(response)); + { + makeBatchData: () => new BatchData(), + makeBatchResponse: (response) => new BatchStreamResponse(response)) + }); const [user1, user2] = await Promise.all([ client @@ -42,7 +45,11 @@ By default if only one request is pending, the request is sent immediately to th If you want to always use the batch endpoint, you can use the `alwaysBatch` option. ```ts - const client = new BatchRequest({input: `/batch`, init: { method: "POST" }}, (response) => new BatchResponse(response), { alwaysBatch: true }); + const client = new BatchRequest({input: `/batch`, init: { method: "POST" }}, { + makeBatchData: () => new BatchData(), + makeBatchResponse: (response) => new BatchStreamResponse(response)), + alwaysBatch: true + }); ``` ## Custom fetch @@ -62,7 +69,11 @@ All of which are part of the standard fetch API. 👉 Custom fetch should only be used for intrumented fetch, A.K.A a fetch overload that adds caching, telemetry, logs, etc. ```ts - const client = new BatchRequest({input: `/batch`, init: { method: "POST" }}, (response) => new BatchResponse(response), { fetch: myFetch }); + const client = new BatchRequest({input: `/batch`, init: { method: "POST" }}, { + makeBatchData: () => new BatchData(), + makeBatchResponse: (response) => new BatchStreamResponse(response)), + fetch: myFetch + }); ``` ## Streaming @@ -73,7 +84,21 @@ Streaming is useful to reduce the memory footprint of your application, especial Also it allows to handle the one response from a batched request as soon as it's available, instead of waiting for the whole batch to be completed. ```ts - const client = new BatchRequest({input: `/batch`, init: { method: "POST" }}, (response) => new BatchStreamResponse(response)); + const client = new BatchRequest({input: `/batch`, init: { method: "POST" }}, { + makeBatchData: () => new BatchData(), + makeBatchResponse: (response) => new BatchStreamResponse(response)) + }); +``` + +## React Native + +React Native does not support ReadableStream, so you need to use a polyfill or use dedicated react native implementation for BatchData and BatchResponse. + +```ts + const client = new BatchRequest({input: `/batch`, init: { method: "POST" }}, { + makeBatchData: () => new ReactNativeBatchData(), + makeBatchResponse: (response) => new ReactNativeBatchResponse(response)) + }); ``` ## canceling individual requests @@ -87,7 +112,10 @@ If all requests are canceled, the batched request is canceled as well to return init: { method: "POST", } - }, (response) => new BatchResponse(response)); + }, { + makeBatchData: () => new BatchData(), + makeBatchResponse: (response) => new BatchStreamResponse(response)) + }); const controller = new AbortController(); From 71ebe683791f4de667f071c97299413ecae23ea5 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Wed, 16 Aug 2023 22:33:36 +0200 Subject: [PATCH 204/206] test(batch): add react-native to tests --- .../src/__snapshots__/batch-data.test.ts.snap | 24 ++- packages/fetch-batch/src/batch-data.test.ts | 180 +++++++++--------- .../fetch-batch/src/batch-request.test.ts | 2 +- 3 files changed, 116 insertions(+), 90 deletions(-) diff --git a/packages/fetch-batch/src/__snapshots__/batch-data.test.ts.snap b/packages/fetch-batch/src/__snapshots__/batch-data.test.ts.snap index aad553e7..48e52a6b 100644 --- a/packages/fetch-batch/src/__snapshots__/batch-data.test.ts.snap +++ b/packages/fetch-batch/src/__snapshots__/batch-data.test.ts.snap @@ -1,6 +1,28 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`BatchData should be able to batch requests 1`] = ` +exports[`BatchData makeBatchData should be able to batch requests 1`] = ` +"--batch__1675206000000__batch +content-id: +content-type: application/http; msgtype=request + +GET /get HTTP/1.1 +accept: application/json; charset=utf-8 + + +--batch__1675206000000__batch +content-id: +content-type: application/http; msgtype=request + +PATCH /patch HTTP/1.1 +accept: application/json; charset=utf-8 +content-type: application/json; charset=utf-8 + +{"name":"John Doe"} +--batch__1675206000000__batch-- +" +`; + +exports[`BatchData makeReactNativeBatchData should be able to batch requests 1`] = ` "--batch__1675206000000__batch content-id: content-type: application/http; msgtype=request diff --git a/packages/fetch-batch/src/batch-data.test.ts b/packages/fetch-batch/src/batch-data.test.ts index 40f5d0f7..05da3dc4 100644 --- a/packages/fetch-batch/src/batch-data.test.ts +++ b/packages/fetch-batch/src/batch-data.test.ts @@ -1,6 +1,7 @@ import express from "express"; import type { AddressInfo } from "net"; -import { BatchData } from "./batch-data"; +import { makeBatchData } from "./batch-data"; +import { makeReactNativeBatchData } from "./batch-data-react-native"; function getUser1Req(port: number) { return new Request(`http://localhost:${port}/get`, { @@ -24,110 +25,113 @@ function renameUser2Req(port: number) { }); } -describe("BatchData", () => { - let app: express.Express; - let server: ReturnType; - let port: number; - - beforeAll(() => { - const app = express(); - app.use(express.raw({ type: "multipart/mixed" })); - - app.post("/batch", (req, res) => { - res.json({ - url: req.url, - method: req.method, - headers: req.headers, - data: req.body.toString(), +describe.each([{ make: makeBatchData }, { make: makeReactNativeBatchData }])( + "BatchData $make.name", + ({ make }) => { + let app: express.Express; + let server: ReturnType; + let port: number; + + beforeAll(() => { + const app = express(); + app.use(express.raw({ type: "multipart/mixed" })); + + app.post("/batch", (req, res) => { + res.json({ + url: req.url, + method: req.method, + headers: req.headers, + data: req.body.toString(), + }); }); - }); - server = app.listen(0); - port = (server.address() as AddressInfo).port; + server = app.listen(0); + port = (server.address() as AddressInfo).port; - jest.useFakeTimers(); - jest.setSystemTime(new Date(2023, 1, 1)); - }); + jest.useFakeTimers(); + jest.setSystemTime(new Date(2023, 1, 1)); + }); - afterAll((done) => { - jest.useRealTimers(); - server.close(done); - }); + afterAll((done) => { + jest.useRealTimers(); + server.close(done); + }); - it("should be able to batch requests", async () => { - const getUser1 = getUser1Req(port); - const renameUser2 = renameUser2Req(port); + it("should be able to batch requests", async () => { + const getUser1 = getUser1Req(port); + const renameUser2 = renameUser2Req(port); - const body = new BatchData(); - body.addRequest(getUser1); - body.addRequest(renameUser2); + const body = make(); + body.addRequest(getUser1); + body.addRequest(renameUser2); - const batched = await fetch(`http://localhost:${port}/batch`, { - method: "POST", - headers: body.getHeaders(), - body: body.body(), - }).then((response) => response.json()); + const batched = await fetch(`http://localhost:${port}/batch`, { + method: "POST", + headers: body.getHeaders(), + body: await body.body(), + }).then((response) => response.json()); - expect(batched.url).toBe("/batch"); - expect(batched.method).toBe("POST"); - expect(batched.headers["content-type"]).toContain("multipart/mixed"); - expect(batched.data).toMatchSnapshot(); - }); + expect(batched.url).toBe("/batch"); + expect(batched.method).toBe("POST"); + expect(batched.headers["content-type"]).toContain("multipart/mixed"); + expect(batched.data).toMatchSnapshot(); + }); - it("should be able to iterate over requests", async () => { - const getUser1 = getUser1Req(port); - const renameUser2 = renameUser2Req(port); + it("should be able to iterate over requests", async () => { + const getUser1 = getUser1Req(port); + const renameUser2 = renameUser2Req(port); - const body = new BatchData(); - body.addRequest(getUser1); - body.addRequest(renameUser2); + const body = make(); + body.addRequest(getUser1); + body.addRequest(renameUser2); - const requests: Request[] = []; - for (const [, request] of body) { - requests.push(request); - } - expect(requests).toEqual([getUser1, renameUser2]); + const requests: Request[] = []; + for (const [, request] of body) { + requests.push(request); + } + expect(requests).toEqual([getUser1, renameUser2]); - const requests2: Request[] = []; - for (const [, request] of body.entries()) { - requests2.push(request); - } - expect(requests2).toEqual([getUser1, renameUser2]); + const requests2: Request[] = []; + for (const [, request] of body.entries()) { + requests2.push(request); + } + expect(requests2).toEqual([getUser1, renameUser2]); - expect(Array.from(body.requests())).toEqual([getUser1, renameUser2]); + expect(Array.from(body.requests())).toEqual([getUser1, renameUser2]); - expect(Array.from(body.requestIds())).toEqual([ - "request-1-1675206000000@zodios.org", - "request-2-1675206000000@zodios.org", - ]); + expect(Array.from(body.requestIds())).toEqual([ + "request-1-1675206000000@zodios.org", + "request-2-1675206000000@zodios.org", + ]); - body.forEach((request, contentId) => { - expect(request).toBe(body.getRequest(contentId)); - }); + body.forEach((request, contentId) => { + expect(request).toBe(body.getRequest(contentId)); + }); - expect(body.getRequestId(getUser1)).toBe( - "request-1-1675206000000@zodios.org" - ); - expect(body.getRequestId(renameUser2)).toBe( - "request-2-1675206000000@zodios.org" - ); + expect(body.getRequestId(getUser1)).toBe( + "request-1-1675206000000@zodios.org" + ); + expect(body.getRequestId(renameUser2)).toBe( + "request-2-1675206000000@zodios.org" + ); - expect(body.boundary).toBe("batch__1675206000000__batch"); - }); + expect(body.boundary).toBe("batch__1675206000000__batch"); + }); - it("should be able to get request by content id", async () => { - const getUser1 = getUser1Req(port); - const renameUser2 = renameUser2Req(port); + it("should be able to get request by content id", async () => { + const getUser1 = getUser1Req(port); + const renameUser2 = renameUser2Req(port); - const body = new BatchData(); - body.addRequest(getUser1); - body.addRequest(renameUser2); + const body = make(); + body.addRequest(getUser1); + body.addRequest(renameUser2); - expect(body.getRequest("response-request-1-1675206000000@zodios.org")).toBe( - getUser1 - ); - expect(body.getRequest("response-request-2-1675206000000@zodios.org")).toBe( - renameUser2 - ); - }); -}); + expect( + body.getRequest("response-request-1-1675206000000@zodios.org") + ).toBe(getUser1); + expect( + body.getRequest("response-request-2-1675206000000@zodios.org") + ).toBe(renameUser2); + }); + } +); diff --git a/packages/fetch-batch/src/batch-request.test.ts b/packages/fetch-batch/src/batch-request.test.ts index d881aa95..067f2a50 100644 --- a/packages/fetch-batch/src/batch-request.test.ts +++ b/packages/fetch-batch/src/batch-request.test.ts @@ -94,7 +94,7 @@ describe.each([ batch: "/batch-stream", }, ])( - `BatchRequest $make.name with endpoint '$batch'`, + `BatchRequest $makeBatchedData.name $makeBatchedData.name with endpoint '$batch'`, ({ makeBatchedResponse, makeBatchedData, batch }) => { let app: express.Express; let server: ReturnType; From e4600526f7619f15e511eedba9d00cc18da4d2f4 Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Wed, 16 Aug 2023 22:46:11 +0200 Subject: [PATCH 205/206] docs(batch): update readme --- packages/fetch-batch/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/fetch-batch/README.md b/packages/fetch-batch/README.md index 45ad2fb0..944a8c1a 100644 --- a/packages/fetch-batch/README.md +++ b/packages/fetch-batch/README.md @@ -171,7 +171,7 @@ Each part is separated by a boundary. And each part starts with a Content-ID hea headers: body.getHeaders({ 'x-custom-header': 'custom value' }), - body: body.stream(), + body: body.body(), }).then((response) => new BatchResponse(response)); // you can iterate over the responses From bc1c08ca26ccf6ebd67b172e90bf3fe265fb6c6d Mon Sep 17 00:00:00 2001 From: ecyrbe Date: Wed, 16 Aug 2023 22:48:41 +0200 Subject: [PATCH 206/206] docs(batch): update readme --- packages/fetch-batch/README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/fetch-batch/README.md b/packages/fetch-batch/README.md index 944a8c1a..0d40edd7 100644 --- a/packages/fetch-batch/README.md +++ b/packages/fetch-batch/README.md @@ -23,7 +23,7 @@ This allows to batch automatically all requests made within the same tick (aka t }, { makeBatchData: () => new BatchData(), - makeBatchResponse: (response) => new BatchStreamResponse(response)) + makeBatchResponse: (response) => new BatchResponse(response)) }); const [user1, user2] = await Promise.all([ @@ -47,7 +47,7 @@ If you want to always use the batch endpoint, you can use the `alwaysBatch` opti ```ts const client = new BatchRequest({input: `/batch`, init: { method: "POST" }}, { makeBatchData: () => new BatchData(), - makeBatchResponse: (response) => new BatchStreamResponse(response)), + makeBatchResponse: (response) => new BatchResponse(response)), alwaysBatch: true }); ``` @@ -71,7 +71,7 @@ All of which are part of the standard fetch API. ```ts const client = new BatchRequest({input: `/batch`, init: { method: "POST" }}, { makeBatchData: () => new BatchData(), - makeBatchResponse: (response) => new BatchStreamResponse(response)), + makeBatchResponse: (response) => new BatchResponse(response)), fetch: myFetch }); ```