@zayne-labs/callapi 1.14.0 → 1.14.1
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/{conditional-types-BXgYQJ5q.d.ts → conditional-types-BFeM4YSg.d.ts} +73 -73
- package/dist/constants/index.d.ts +1 -2
- package/dist/constants/index.js +1 -1
- package/dist/{constants-CQmUuQDT.js → constants-DB6Z7gFB.js} +12 -7
- package/dist/{constants-CQmUuQDT.js.map → constants-DB6Z7gFB.js.map} +1 -1
- package/dist/index-DuBaw9km.d.ts +186 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -4
- 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/package.json +12 -10
- package/dist/index-D-LyaiZE.d.ts +0 -91
package/dist/index-D-LyaiZE.d.ts
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { Bt as DistributiveOmit, C as GetBaseSchemaRoutes, Ct as ResponseTypeMap, E as GlobalMeta, Ft as InferSchemaResult, Ht as Writeable, Mt as CallApiSchemaConfig, Ot as BaseCallApiSchemaAndConfig, Pt as InferSchemaOutput, S as GetBaseSchemaConfig, Tt as ResultModeType, Vt as NoInferUnMasked, _t as CallApiResultSuccessVariant, a as GetCurrentRouteSchemaKey, at as DefaultCallApiContext, b as CallApiResult, c as InferInitURL, ct as CallApiPlugin, d as SerializableObject, f as ThrowOnErrorBoolean, g as CallApiContext, gt as CallApiResultSuccessOrErrorVariant, h as CallApiConfig, i as GetCurrentRouteSchema, jt as CallApiSchema, kt as BaseCallApiSchemaRoutes, n as ApplyURLBasedConfig, ot as DefaultDataType, p as BaseCallApiConfig, r as Body, st as DefaultPluginArray, t as ApplyStrictConfig, u as SerializableArray, vt as GetResponseType, wt as ResponseTypeType, yt as InferCallApiResult, zt as AnyString } from "./conditional-types-BXgYQJ5q.js";
|
|
2
|
-
|
|
3
|
-
//#region src/createFetchClient.d.ts
|
|
4
|
-
declare const createFetchClientWithContext: <TOuterCallApiContext extends CallApiContext = DefaultCallApiContext>() => <TBaseCallApiContext extends CallApiContext = TOuterCallApiContext, TBaseData = TBaseCallApiContext["Data"], TBaseErrorData = TBaseCallApiContext["ErrorData"], TBaseResultMode extends ResultModeType = (TBaseCallApiContext["ResultMode"] extends ResultModeType ? TBaseCallApiContext["ResultMode"] : ResultModeType), TBaseThrowOnError extends ThrowOnErrorBoolean = 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>) => <TData = TBaseData, TErrorData = TBaseErrorData, TResultMode extends ResultModeType = TBaseResultMode, TCallApiContext extends CallApiContext = TBaseCallApiContext, TThrowOnError extends ThrowOnErrorBoolean = 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>, TBody extends InferSchemaOutput<TSchema["body"], Body> = InferSchemaOutput<TSchema["body"], SerializableObject | BodyInit | SerializableArray | null>, const TPluginArray extends CallApiPlugin[] = TBasePluginArray, TComputedData = InferSchemaOutput<TSchema["data"], GetResponseType<TData, TResponseType>>, TComputedErrorData = InferSchemaOutput<TSchema["errorData"], GetResponseType<TErrorData, TResponseType>>, TComputedResult = CallApiResult<TComputedData, TComputedErrorData, TResultMode, TThrowOnError>>(initURL: TInitURL, initConfig?: CallApiConfig<TCallApiContext, TComputedData, TComputedErrorData, TResultMode, TThrowOnError, TResponseType, TComputedBaseSchemaRoutes, TSchema, TComputedBaseSchemaConfig, TSchemaConfig, TInitURL, TCurrentRouteSchemaKey, TBody, TBasePluginArray, TPluginArray>) => Promise<TComputedResult>;
|
|
5
|
-
declare const createFetchClient: <TBaseCallApiContext extends CallApiContext = {
|
|
6
|
-
InferredExtraOptions: unknown;
|
|
7
|
-
Data: DefaultDataType;
|
|
8
|
-
ErrorData: DefaultDataType;
|
|
9
|
-
ResultMode: ResultModeType;
|
|
10
|
-
Meta: GlobalMeta;
|
|
11
|
-
}, TBaseData = TBaseCallApiContext["Data"], TBaseErrorData = TBaseCallApiContext["ErrorData"], TBaseResultMode extends ResultModeType = (TBaseCallApiContext["ResultMode"] extends ResultModeType ? TBaseCallApiContext["ResultMode"] : ResultModeType), TBaseThrowOnError extends ThrowOnErrorBoolean = 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>) => <TData = TBaseData, TErrorData = TBaseErrorData, TResultMode extends ResultModeType = TBaseResultMode, TCallApiContext extends CallApiContext = TBaseCallApiContext, TThrowOnError extends ThrowOnErrorBoolean = 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]>>, TBody extends InferSchemaResult<TSchema["body"], SerializableObject | BodyInit | SerializableArray | null, "infer-output"> = InferSchemaResult<TSchema["body"], SerializableObject | BodyInit | SerializableArray | null, "infer-output">, const TPluginArray extends CallApiPlugin[] = TBasePluginArray, TComputedData = InferSchemaResult<TSchema["data"], GetResponseType<TData, TResponseType, ResponseTypeMap<TData>>, "infer-output">, TComputedErrorData = InferSchemaResult<TSchema["errorData"], GetResponseType<TErrorData, TResponseType, ResponseTypeMap<TErrorData>>, "infer-output">, TComputedResult = InferCallApiResult<TComputedData, TComputedErrorData, TResultMode, TThrowOnError, {
|
|
12
|
-
all: CallApiResultSuccessVariant<TComputedData>;
|
|
13
|
-
fetchApi: Response;
|
|
14
|
-
onlyData: NoInferUnMasked<TComputedData>;
|
|
15
|
-
onlyResponse: Response;
|
|
16
|
-
withoutResponse: {
|
|
17
|
-
data: NoInferUnMasked<TComputedData>;
|
|
18
|
-
error: null;
|
|
19
|
-
};
|
|
20
|
-
}, {
|
|
21
|
-
all: TThrowOnError extends true ? CallApiResultSuccessVariant<TComputedData> : CallApiResultSuccessOrErrorVariant<TComputedData, TComputedErrorData>;
|
|
22
|
-
fetchApi: (TThrowOnError extends true ? CallApiResultSuccessVariant<TComputedData> : CallApiResultSuccessOrErrorVariant<TComputedData, TComputedErrorData>)["response"];
|
|
23
|
-
onlyData: (TThrowOnError extends true ? CallApiResultSuccessVariant<TComputedData> : CallApiResultSuccessOrErrorVariant<TComputedData, TComputedErrorData>)["data"];
|
|
24
|
-
onlyResponse: (TThrowOnError extends true ? CallApiResultSuccessVariant<TComputedData> : CallApiResultSuccessOrErrorVariant<TComputedData, TComputedErrorData>)["response"];
|
|
25
|
-
withoutResponse: DistributiveOmit<TThrowOnError extends true ? CallApiResultSuccessVariant<TComputedData> : CallApiResultSuccessOrErrorVariant<TComputedData, TComputedErrorData>, "response"> extends infer T ? { [Key in keyof T]: T[Key] } : never;
|
|
26
|
-
}>>(initURL: TInitURL, initConfig?: CallApiConfig<TCallApiContext, TComputedData, TComputedErrorData, TResultMode, TThrowOnError, TResponseType, TComputedBaseSchemaRoutes, TSchema, TComputedBaseSchemaConfig, TSchemaConfig, TInitURL, TCurrentRouteSchemaKey, TBody, TBasePluginArray, TPluginArray>) => Promise<TComputedResult>;
|
|
27
|
-
declare const callApi: <TData = unknown, TErrorData = unknown, TResultMode extends ResultModeType = ResultModeType, TCallApiContext extends CallApiContext = {
|
|
28
|
-
InferredExtraOptions: unknown;
|
|
29
|
-
Data: DefaultDataType;
|
|
30
|
-
ErrorData: DefaultDataType;
|
|
31
|
-
ResultMode: ResultModeType;
|
|
32
|
-
Meta: GlobalMeta;
|
|
33
|
-
}, TThrowOnError extends ThrowOnErrorBoolean = 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<{
|
|
34
|
-
[x: AnyString]: CallApiSchema | undefined;
|
|
35
|
-
"@default"?: CallApiSchema | undefined;
|
|
36
|
-
"@delete/"?: CallApiSchema | undefined;
|
|
37
|
-
"@get/"?: CallApiSchema | undefined;
|
|
38
|
-
"@patch/"?: CallApiSchema | undefined;
|
|
39
|
-
"@post/"?: CallApiSchema | undefined;
|
|
40
|
-
"@put/"?: CallApiSchema | undefined;
|
|
41
|
-
}, TCurrentRouteSchemaKey, CallApiSchema | undefined, {
|
|
42
|
-
[x: AnyString]: CallApiSchema | undefined;
|
|
43
|
-
"@default"?: CallApiSchema | undefined;
|
|
44
|
-
"@delete/"?: CallApiSchema | undefined;
|
|
45
|
-
"@get/"?: CallApiSchema | undefined;
|
|
46
|
-
"@patch/"?: CallApiSchema | undefined;
|
|
47
|
-
"@post/"?: CallApiSchema | undefined;
|
|
48
|
-
"@put/"?: CallApiSchema | undefined;
|
|
49
|
-
}[TCurrentRouteSchemaKey], NonNullable<Omit<CallApiSchema | undefined, keyof {
|
|
50
|
-
[x: AnyString]: CallApiSchema | undefined;
|
|
51
|
-
"@default"?: CallApiSchema | undefined;
|
|
52
|
-
"@delete/"?: CallApiSchema | undefined;
|
|
53
|
-
"@get/"?: CallApiSchema | undefined;
|
|
54
|
-
"@patch/"?: CallApiSchema | undefined;
|
|
55
|
-
"@post/"?: CallApiSchema | undefined;
|
|
56
|
-
"@put/"?: CallApiSchema | undefined;
|
|
57
|
-
}[TCurrentRouteSchemaKey]> & {
|
|
58
|
-
[x: AnyString]: CallApiSchema | undefined;
|
|
59
|
-
"@default"?: CallApiSchema | undefined;
|
|
60
|
-
"@delete/"?: CallApiSchema | undefined;
|
|
61
|
-
"@get/"?: CallApiSchema | undefined;
|
|
62
|
-
"@patch/"?: CallApiSchema | undefined;
|
|
63
|
-
"@post/"?: CallApiSchema | undefined;
|
|
64
|
-
"@put/"?: CallApiSchema | undefined;
|
|
65
|
-
}[TCurrentRouteSchemaKey]>>, TBody extends InferSchemaResult<TSchema["body"], SerializableObject | BodyInit | SerializableArray | null, "infer-output"> = InferSchemaResult<TSchema["body"], SerializableObject | BodyInit | SerializableArray | null, "infer-output">, const TPluginArray extends CallApiPlugin[] = DefaultPluginArray, TComputedData = InferSchemaResult<TSchema["data"], GetResponseType<TData, TResponseType, ResponseTypeMap<TData>>, "infer-output">, TComputedErrorData = InferSchemaResult<TSchema["errorData"], GetResponseType<TErrorData, TResponseType, ResponseTypeMap<TErrorData>>, "infer-output">, TComputedResult = InferCallApiResult<TComputedData, TComputedErrorData, TResultMode, TThrowOnError, {
|
|
66
|
-
all: CallApiResultSuccessVariant<TComputedData>;
|
|
67
|
-
fetchApi: Response;
|
|
68
|
-
onlyData: NoInferUnMasked<TComputedData>;
|
|
69
|
-
onlyResponse: Response;
|
|
70
|
-
withoutResponse: {
|
|
71
|
-
data: NoInferUnMasked<TComputedData>;
|
|
72
|
-
error: null;
|
|
73
|
-
};
|
|
74
|
-
}, {
|
|
75
|
-
all: TThrowOnError extends true ? CallApiResultSuccessVariant<TComputedData> : CallApiResultSuccessOrErrorVariant<TComputedData, TComputedErrorData>;
|
|
76
|
-
fetchApi: (TThrowOnError extends true ? CallApiResultSuccessVariant<TComputedData> : CallApiResultSuccessOrErrorVariant<TComputedData, TComputedErrorData>)["response"];
|
|
77
|
-
onlyData: (TThrowOnError extends true ? CallApiResultSuccessVariant<TComputedData> : CallApiResultSuccessOrErrorVariant<TComputedData, TComputedErrorData>)["data"];
|
|
78
|
-
onlyResponse: (TThrowOnError extends true ? CallApiResultSuccessVariant<TComputedData> : CallApiResultSuccessOrErrorVariant<TComputedData, TComputedErrorData>)["response"];
|
|
79
|
-
withoutResponse: DistributiveOmit<TThrowOnError extends true ? CallApiResultSuccessVariant<TComputedData> : CallApiResultSuccessOrErrorVariant<TComputedData, TComputedErrorData>, "response"> extends infer T ? { [Key in keyof T]: T[Key] } : never;
|
|
80
|
-
}>>(initURL: TInitURL, initConfig?: CallApiConfig<TCallApiContext, TComputedData, TComputedErrorData, TResultMode, TThrowOnError, TResponseType, {
|
|
81
|
-
[x: AnyString]: CallApiSchema | undefined;
|
|
82
|
-
"@default"?: CallApiSchema | undefined;
|
|
83
|
-
"@delete/"?: CallApiSchema | undefined;
|
|
84
|
-
"@get/"?: CallApiSchema | undefined;
|
|
85
|
-
"@patch/"?: CallApiSchema | undefined;
|
|
86
|
-
"@post/"?: CallApiSchema | undefined;
|
|
87
|
-
"@put/"?: CallApiSchema | undefined;
|
|
88
|
-
}, TSchema, CallApiSchemaConfig, TSchemaConfig, TInitURL, TCurrentRouteSchemaKey, TBody, DefaultPluginArray, TPluginArray>) => Promise<TComputedResult>;
|
|
89
|
-
//#endregion
|
|
90
|
-
export { createFetchClient as n, createFetchClientWithContext as r, callApi as t };
|
|
91
|
-
//# sourceMappingURL=index-D-LyaiZE.d.ts.map
|