@zayne-labs/callapi 1.11.26 → 1.11.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{guards-5Ij_loC1.js → guards-DvOwVtmd.js} +1 -8
- package/dist/guards-DvOwVtmd.js.map +1 -0
- package/dist/{validation-BeCBQ6_6.d.ts → index-j55-O6zR.d.ts} +1283 -1262
- package/dist/index.d.ts +2 -60
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/utils/external/index.d.ts +1 -1
- package/dist/utils/external/index.js +1 -1
- package/dist/utils/external/index.js.map +1 -1
- package/dist/validation-8gwacxHw.js.map +1 -1
- package/package.json +4 -4
- package/dist/guards-5Ij_loC1.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,61 +1,3 @@
|
|
|
1
1
|
import "./validation-Dq--Q5zC.js";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
//#region src/createFetchClient.d.ts
|
|
5
|
-
|
|
6
|
-
declare const createFetchClientWithContext: <TOuterCallApiContext extends CallApiContext = DefaultCallApiContext>() => <TBaseData = unknown, TBaseErrorData = unknown, TBaseResultMode extends ResultModeType = ResultModeType, TBaseCallApiContext extends CallApiContext = TOuterCallApiContext, TBaseThrowOnError extends ThrowOnErrorUnion = boolean, TBaseResponseType extends ResponseTypeType = ResponseTypeType, const TBaseSchemaAndConfig extends BaseCallApiSchemaAndConfig = BaseCallApiSchemaAndConfig, const TBasePluginArray extends CallApiPlugin[] = DefaultPluginArray, TComputedBaseSchemaConfig extends CallApiSchemaConfig = GetBaseSchemaConfig<TBaseSchemaAndConfig>, TComputedBaseSchemaRoutes extends BaseCallApiSchemaRoutes = GetBaseSchemaRoutes<TBaseSchemaAndConfig>>(initBaseConfig?: BaseCallApiConfig<TBaseCallApiContext, TBaseData, TBaseErrorData, TBaseResultMode, TBaseThrowOnError, TBaseResponseType, TBaseSchemaAndConfig, TBasePluginArray>) => <TCallApiContext extends CallApiContext = TBaseCallApiContext, TData = TBaseData, TErrorData = TBaseErrorData, TResultMode extends ResultModeType = TBaseResultMode, TThrowOnError extends ThrowOnErrorUnion = TBaseThrowOnError, TResponseType extends ResponseTypeType = TBaseResponseType, const TSchemaConfig extends CallApiSchemaConfig = TComputedBaseSchemaConfig, TInitURL extends InferInitURL<TComputedBaseSchemaRoutes, TSchemaConfig> = InferInitURL<TComputedBaseSchemaRoutes, TSchemaConfig>, TCurrentRouteSchemaKey extends GetCurrentRouteSchemaKey<TSchemaConfig, TInitURL> = GetCurrentRouteSchemaKey<TSchemaConfig, TInitURL>, const TSchema extends CallApiSchema = GetCurrentRouteSchema<TComputedBaseSchemaRoutes, TCurrentRouteSchemaKey>, const TPluginArray extends CallApiPlugin[] = TBasePluginArray, TComputedResult = CallApiResult<InferSchemaOutput<TSchema["data"], TData>, InferSchemaOutput<TSchema["errorData"], TErrorData>, TResultMode, TThrowOnError, TResponseType>>(initURL: TInitURL, initConfig?: CallApiConfig<TCallApiContext, InferSchemaOutput<TSchema["data"], GetResponseType<TData, TResponseType>>, InferSchemaOutput<TSchema["errorData"], GetResponseType<TErrorData, TResponseType>>, TResultMode, TThrowOnError, TResponseType, TComputedBaseSchemaRoutes, TSchema, TComputedBaseSchemaConfig, TSchemaConfig, TInitURL, TCurrentRouteSchemaKey, TBasePluginArray, TPluginArray>) => Promise<TComputedResult>;
|
|
7
|
-
declare const createFetchClient: <TBaseData = unknown, TBaseErrorData = unknown, TBaseResultMode extends ResultModeType = ResultModeType, TBaseCallApiContext extends CallApiContext = DefaultCallApiContext, TBaseThrowOnError extends ThrowOnErrorUnion = boolean, TBaseResponseType extends ResponseTypeType = ResponseTypeType, const TBaseSchemaAndConfig extends BaseCallApiSchemaAndConfig = BaseCallApiSchemaAndConfig, const TBasePluginArray extends CallApiPlugin[] = DefaultPluginArray, TComputedBaseSchemaConfig extends CallApiSchemaConfig = Writeable<NonNullable<TBaseSchemaAndConfig["config"]>, "deep">, TComputedBaseSchemaRoutes extends BaseCallApiSchemaRoutes = Writeable<TBaseSchemaAndConfig["routes"], "deep">>(initBaseConfig?: BaseCallApiConfig<TBaseCallApiContext, TBaseData, TBaseErrorData, TBaseResultMode, TBaseThrowOnError, TBaseResponseType, TBaseSchemaAndConfig, TBasePluginArray>) => <TCallApiContext extends CallApiContext = TBaseCallApiContext, TData = TBaseData, TErrorData = TBaseErrorData, TResultMode extends ResultModeType = TBaseResultMode, TThrowOnError extends ThrowOnErrorUnion = TBaseThrowOnError, TResponseType extends ResponseTypeType = TBaseResponseType, const TSchemaConfig extends CallApiSchemaConfig = TComputedBaseSchemaConfig, TInitURL extends InferInitURL<TComputedBaseSchemaRoutes, TSchemaConfig> = InferInitURL<TComputedBaseSchemaRoutes, TSchemaConfig>, TCurrentRouteSchemaKey extends GetCurrentRouteSchemaKey<TSchemaConfig, TInitURL> = GetCurrentRouteSchemaKey<TSchemaConfig, TInitURL>, const TSchema extends CallApiSchema = GetCurrentRouteSchema<TComputedBaseSchemaRoutes, TCurrentRouteSchemaKey, TComputedBaseSchemaRoutes["@default"], TComputedBaseSchemaRoutes[TCurrentRouteSchemaKey], NonNullable<Omit<TComputedBaseSchemaRoutes["@default"], keyof TComputedBaseSchemaRoutes[TCurrentRouteSchemaKey]> & TComputedBaseSchemaRoutes[TCurrentRouteSchemaKey]>>, const TPluginArray extends CallApiPlugin[] = TBasePluginArray, TComputedResult = GetCallApiResult<InferSchemaResult<TSchema["data"], TData, "infer-output">, InferSchemaResult<TSchema["errorData"], TErrorData, "infer-output">, TResultMode, TThrowOnError, TResponseType, {
|
|
8
|
-
all: CallApiResultSuccessVariant<GetResponseType<InferSchemaResult<TSchema["data"], TData, "infer-output">, TResponseType, ResponseTypeMap<InferSchemaResult<TSchema["data"], TData, "infer-output">>>>;
|
|
9
|
-
onlyData: NoInfer<GetResponseType<InferSchemaResult<TSchema["data"], TData, "infer-output">, TResponseType, ResponseTypeMap<InferSchemaResult<TSchema["data"], TData, "infer-output">>>>;
|
|
10
|
-
onlyResponse: Response;
|
|
11
|
-
withoutResponse: Omit<CallApiResultSuccessVariant<GetResponseType<InferSchemaResult<TSchema["data"], TData, "infer-output">, TResponseType, ResponseTypeMap<InferSchemaResult<TSchema["data"], TData, "infer-output">>>>, "response">;
|
|
12
|
-
}, ResultModeMap<InferSchemaResult<TSchema["data"], TData, "infer-output">, InferSchemaResult<TSchema["errorData"], TErrorData, "infer-output">, TResponseType, TThrowOnError>>>(initURL: TInitURL, initConfig?: CallApiConfig<TCallApiContext, InferSchemaResult<TSchema["data"], GetResponseType<TData, TResponseType, ResponseTypeMap<TData>>, "infer-output">, InferSchemaResult<TSchema["errorData"], GetResponseType<TErrorData, TResponseType, ResponseTypeMap<TErrorData>>, "infer-output">, TResultMode, TThrowOnError, TResponseType, TComputedBaseSchemaRoutes, TSchema, TComputedBaseSchemaConfig, TSchemaConfig, TInitURL, TCurrentRouteSchemaKey, TBasePluginArray, TPluginArray>) => Promise<TComputedResult>;
|
|
13
|
-
declare const callApi: <TCallApiContext extends CallApiContext = DefaultCallApiContext, TData = unknown, TErrorData = unknown, TResultMode extends ResultModeType = ResultModeType, TThrowOnError extends ThrowOnErrorUnion = boolean, TResponseType extends ResponseTypeType = ResponseTypeType, const TSchemaConfig extends CallApiSchemaConfig = CallApiSchemaConfig, TInitURL extends ApplyStrictConfig<TSchemaConfig, ApplyURLBasedConfig<TSchemaConfig, AnyString | "@delete/" | "@get/" | "@patch/" | "@post/" | "@put/">> = ApplyStrictConfig<TSchemaConfig, ApplyURLBasedConfig<TSchemaConfig, AnyString | "@delete/" | "@get/" | "@patch/" | "@post/" | "@put/">>, TCurrentRouteSchemaKey extends GetCurrentRouteSchemaKey<TSchemaConfig, TInitURL> = GetCurrentRouteSchemaKey<TSchemaConfig, TInitURL>, const TSchema extends CallApiSchema = GetCurrentRouteSchema<{
|
|
14
|
-
[x: AnyString]: CallApiSchema | undefined;
|
|
15
|
-
"@default"?: CallApiSchema | undefined;
|
|
16
|
-
"@delete/"?: CallApiSchema | undefined;
|
|
17
|
-
"@get/"?: CallApiSchema | undefined;
|
|
18
|
-
"@patch/"?: CallApiSchema | undefined;
|
|
19
|
-
"@post/"?: CallApiSchema | undefined;
|
|
20
|
-
"@put/"?: CallApiSchema | undefined;
|
|
21
|
-
}, TCurrentRouteSchemaKey, CallApiSchema | undefined, {
|
|
22
|
-
[x: AnyString]: CallApiSchema | undefined;
|
|
23
|
-
"@default"?: CallApiSchema | undefined;
|
|
24
|
-
"@delete/"?: CallApiSchema | undefined;
|
|
25
|
-
"@get/"?: CallApiSchema | undefined;
|
|
26
|
-
"@patch/"?: CallApiSchema | undefined;
|
|
27
|
-
"@post/"?: CallApiSchema | undefined;
|
|
28
|
-
"@put/"?: CallApiSchema | undefined;
|
|
29
|
-
}[TCurrentRouteSchemaKey], NonNullable<Omit<CallApiSchema | undefined, keyof {
|
|
30
|
-
[x: AnyString]: CallApiSchema | undefined;
|
|
31
|
-
"@default"?: CallApiSchema | undefined;
|
|
32
|
-
"@delete/"?: CallApiSchema | undefined;
|
|
33
|
-
"@get/"?: CallApiSchema | undefined;
|
|
34
|
-
"@patch/"?: CallApiSchema | undefined;
|
|
35
|
-
"@post/"?: CallApiSchema | undefined;
|
|
36
|
-
"@put/"?: CallApiSchema | undefined;
|
|
37
|
-
}[TCurrentRouteSchemaKey]> & {
|
|
38
|
-
[x: AnyString]: CallApiSchema | undefined;
|
|
39
|
-
"@default"?: CallApiSchema | undefined;
|
|
40
|
-
"@delete/"?: CallApiSchema | undefined;
|
|
41
|
-
"@get/"?: CallApiSchema | undefined;
|
|
42
|
-
"@patch/"?: CallApiSchema | undefined;
|
|
43
|
-
"@post/"?: CallApiSchema | undefined;
|
|
44
|
-
"@put/"?: CallApiSchema | undefined;
|
|
45
|
-
}[TCurrentRouteSchemaKey]>>, const TPluginArray extends CallApiPlugin[] = DefaultPluginArray, TComputedResult = GetCallApiResult<InferSchemaResult<TSchema["data"], TData, "infer-output">, InferSchemaResult<TSchema["errorData"], TErrorData, "infer-output">, TResultMode, TThrowOnError, TResponseType, {
|
|
46
|
-
all: CallApiResultSuccessVariant<GetResponseType<InferSchemaResult<TSchema["data"], TData, "infer-output">, TResponseType, ResponseTypeMap<InferSchemaResult<TSchema["data"], TData, "infer-output">>>>;
|
|
47
|
-
onlyData: NoInfer<GetResponseType<InferSchemaResult<TSchema["data"], TData, "infer-output">, TResponseType, ResponseTypeMap<InferSchemaResult<TSchema["data"], TData, "infer-output">>>>;
|
|
48
|
-
onlyResponse: Response;
|
|
49
|
-
withoutResponse: Omit<CallApiResultSuccessVariant<GetResponseType<InferSchemaResult<TSchema["data"], TData, "infer-output">, TResponseType, ResponseTypeMap<InferSchemaResult<TSchema["data"], TData, "infer-output">>>>, "response">;
|
|
50
|
-
}, ResultModeMap<InferSchemaResult<TSchema["data"], TData, "infer-output">, InferSchemaResult<TSchema["errorData"], TErrorData, "infer-output">, TResponseType, TThrowOnError>>>(initURL: TInitURL, initConfig?: CallApiConfig<TCallApiContext, InferSchemaResult<TSchema["data"], GetResponseType<TData, TResponseType, ResponseTypeMap<TData>>, "infer-output">, InferSchemaResult<TSchema["errorData"], GetResponseType<TErrorData, TResponseType, ResponseTypeMap<TErrorData>>, "infer-output">, TResultMode, TThrowOnError, TResponseType, {
|
|
51
|
-
[x: AnyString]: CallApiSchema | undefined;
|
|
52
|
-
"@default"?: CallApiSchema | undefined;
|
|
53
|
-
"@delete/"?: CallApiSchema | undefined;
|
|
54
|
-
"@get/"?: CallApiSchema | undefined;
|
|
55
|
-
"@patch/"?: CallApiSchema | undefined;
|
|
56
|
-
"@post/"?: CallApiSchema | undefined;
|
|
57
|
-
"@put/"?: CallApiSchema | undefined;
|
|
58
|
-
}, TSchema, CallApiSchemaConfig, TSchemaConfig, TInitURL, TCurrentRouteSchemaKey, DefaultPluginArray, TPluginArray>) => Promise<TComputedResult>;
|
|
59
|
-
//#endregion
|
|
60
|
-
export { type BaseCallApiConfig, type BaseCallApiExtraOptions, type BaseCallApiSchemaRoutes, type BaseSchemaRouteKeyPrefixes, type CallApiConfig, type CallApiExtraOptions, type CallApiExtraOptionsForHooks, type CallApiParameters, type CallApiPlugin, type CallApiRequestOptions, type CallApiRequestOptionsForHooks, type CallApiResultLoose as CallApiResult, type CallApiResultErrorVariant, type CallApiResultSuccessVariant, type CallApiSchema, type CallApiSchemaConfig, type CallApiSuccessOrErrorVariant, type DedupeOptions, type ErrorContext, type Hooks, type HooksOrHooksArray, type InferExtendSchemaConfigContext, type InferExtendSchemaContext, type InferParamsFromRoute, type InferSchemaInput, type InferSchemaOutput, type InstanceContext, type PluginExtraOptions, type PluginHooks, type PluginHooksWithMoreOptions, type PluginSetupContext, type PossibleHTTPError, type PossibleJavaScriptError, type PossibleJavaScriptOrValidationError, type PossibleValidationError, type Register, type RequestContext, type RequestStreamContext, type ResponseContext, type ResponseErrorContext, type ResponseStreamContext, type ResponseTypeType, type ResultModeType, type RetryOptions, type SuccessContext, type URLOptions, callApi, createFetchClient, createFetchClientWithContext };
|
|
61
|
-
//# sourceMappingURL=index.d.ts.map
|
|
2
|
+
import { $ as PossibleHTTPError, B as CallApiExtraOptionsForHooks, G as GetExtendSchemaConfigContext, H as CallApiRequestOptions, I as BaseCallApiConfig, J as Register, K as InferExtendSchemaContext, L as BaseCallApiExtraOptions, Q as CallApiSuccessOrErrorVariant, R as CallApiConfig, S as SuccessContext, U as CallApiRequestOptionsForHooks, V as CallApiParameters, W as CallApiResultLoose, X as CallApiResultErrorVariant, Y as RetryOptions, Z as CallApiResultSuccessVariant, _ as RequestContext, a as BaseSchemaRouteKeyPrefixes, b as ResponseErrorContext, c as InferSchemaInput, ct as URLOptions, d as CallApiPlugin, et as PossibleJavaScriptError, f as PluginHooks, g as HooksOrHooksArray, h as Hooks, i as BaseCallApiSchemaRoutes, it as ResultModeType, l as InferSchemaOutput, lt as DedupeOptions, m as ErrorContext, n as createFetchClient, nt as PossibleValidationError, o as CallApiSchema, p as PluginSetupContext, q as InstanceContext, r as createFetchClientWithContext, rt as ResponseTypeType, s as CallApiSchemaConfig, st as InferParamsFromRoute, t as callApi, tt as PossibleJavaScriptOrValidationError, u as DefaultCallApiContext, v as RequestStreamContext, x as ResponseStreamContext, y as ResponseContext, z as CallApiExtraOptions } from "./index-j55-O6zR.js";
|
|
3
|
+
export { BaseCallApiConfig, BaseCallApiExtraOptions, BaseCallApiSchemaRoutes, BaseSchemaRouteKeyPrefixes, CallApiConfig, CallApiExtraOptions, CallApiExtraOptionsForHooks, CallApiParameters, CallApiPlugin, CallApiRequestOptions, CallApiRequestOptionsForHooks, CallApiResultLoose as CallApiResult, CallApiResultErrorVariant, CallApiResultSuccessVariant, CallApiSchema, CallApiSchemaConfig, CallApiSuccessOrErrorVariant, DedupeOptions, DefaultCallApiContext, ErrorContext, GetExtendSchemaConfigContext, Hooks, HooksOrHooksArray, InferExtendSchemaContext, InferParamsFromRoute, InferSchemaInput, InferSchemaOutput, InstanceContext, PluginHooks, PluginSetupContext, PossibleHTTPError, PossibleJavaScriptError, PossibleJavaScriptOrValidationError, PossibleValidationError, Register, RequestContext, RequestStreamContext, ResponseContext, ResponseErrorContext, ResponseStreamContext, ResponseTypeType, ResultModeType, RetryOptions, SuccessContext, URLOptions, callApi, createFetchClient, createFetchClientWithContext };
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { n as requestOptionDefaults, r as defineEnum, t as extraOptionDefaults } from "./defaults-C6WKIXsf.js";
|
|
2
|
-
import { _ as isReadableStream, a as isValidationErrorInstance, b as isValidJsonString, d as isBoolean, f as isFunction, g as isQueryString, h as isPromise, l as toQueryString, m as isPlainObject, n as isHTTPErrorInstance, o as HTTPError, p as isObject, s as ValidationError, u as isArray, v as isSerializable, y as isString } from "./guards-
|
|
2
|
+
import { _ as isReadableStream, a as isValidationErrorInstance, b as isValidJsonString, d as isBoolean, f as isFunction, g as isQueryString, h as isPromise, l as toQueryString, m as isPlainObject, n as isHTTPErrorInstance, o as HTTPError, p as isObject, s as ValidationError, u as isArray, v as isSerializable, y as isString } from "./guards-DvOwVtmd.js";
|
|
3
3
|
import { n as fetchSpecificKeys, t as fallBackRouteSchemaKey } from "./validation-8gwacxHw.js";
|
|
4
4
|
|
|
5
5
|
//#region src/auth.ts
|