@zayne-labs/callapi 1.11.25 → 1.11.27

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/index.d.ts CHANGED
@@ -1,61 +1,3 @@
1
1
  import "./validation-Dq--Q5zC.js";
2
- import { A as InferInitURL, B as RequestContext, C as InferExtendSchemaConfigContext, Ct as DefaultPluginArray, D as ApplyURLBasedConfig, Dt as Writeable, E as ApplyStrictConfig, Et as AnyString, F as DedupeOptions, G as SuccessContext, H as ResponseContext, I as ErrorContext, L as Hooks, M as Register, N as ThrowOnErrorUnion, O as GetCurrentRouteSchema, P as RetryOptions, R as HooksOrHooksArray, S as GetBaseSchemaRoutes, T as InstanceContext, U as ResponseErrorContext, V as RequestStreamContext, W as ResponseStreamContext, _ as CallApiRequestOptions, _t as ResponseTypeMap, a as CallApiSchemaConfig, at as PluginHooksWithMoreOptions, b as CallApiResultLoose, bt as ResultModeType, c as InferSchemaResult, ct as CallApiResultErrorVariant, d as BlankCallApiEnv, dt as GetCallApiResult, f as CallApiConfig, ft as GetResponseType, g as CallApiParameters, gt as PossibleValidationError, h as CallApiExtraOptionsForHooks, ht as PossibleJavaScriptOrValidationError, i as CallApiSchema, it as PluginHooks, j as InferParamsFromRoute, k as GetCurrentRouteSchemaKey, l as BaseCallApiConfig, lt as CallApiResultSuccessVariant, m as CallApiExtraOptions, mt as PossibleJavaScriptError, n as BaseCallApiSchemaRoutes, o as InferSchemaInput, ot as PluginSetupContext, p as CallApiEnv, pt as PossibleHTTPError, r as BaseSchemaRouteKeyPrefixes, rt as CallApiPlugin, s as InferSchemaOutput, st as URLOptions, t as BaseCallApiSchemaAndConfig, u as BaseCallApiExtraOptions, ut as CallApiSuccessOrErrorVariant, v as CallApiRequestOptionsForHooks, vt as ResponseTypeType, w as InferExtendSchemaContext, x as GetBaseSchemaConfig, y as CallApiResult, yt as ResultModeMap, z as PluginExtraOptions } from "./validation-BXtphXvQ.js";
3
-
4
- //#region src/createFetchClient.d.ts
5
-
6
- declare const createFetchClientWithEnv: <TOuterCallApiEnv extends CallApiEnv = BlankCallApiEnv>() => <TBaseData = unknown, TBaseErrorData = unknown, TBaseResultMode extends ResultModeType = ResultModeType, TBaseCallApiEnv extends CallApiEnv = TOuterCallApiEnv, 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<TBaseData, TBaseErrorData, TBaseResultMode, TBaseCallApiEnv, TBaseThrowOnError, TBaseResponseType, TBaseSchemaAndConfig, TBasePluginArray>) => <TData = TBaseData, TErrorData = TBaseErrorData, TResultMode extends ResultModeType = TBaseResultMode, TCallApiEnv extends CallApiEnv = TBaseCallApiEnv, 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<InferSchemaOutput<TSchema["data"], GetResponseType<TData, TResponseType>>, InferSchemaOutput<TSchema["errorData"], GetResponseType<TErrorData, TResponseType>>, TResultMode, TCallApiEnv, TThrowOnError, TResponseType, TComputedBaseSchemaRoutes, TSchema, TComputedBaseSchemaConfig, TSchemaConfig, TInitURL, TCurrentRouteSchemaKey, TBasePluginArray, TPluginArray>) => Promise<TComputedResult>;
7
- declare const createFetchClient: <TBaseData = unknown, TBaseErrorData = unknown, TBaseResultMode extends ResultModeType = ResultModeType, TBaseCallApiEnv extends CallApiEnv = BlankCallApiEnv, 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<TBaseData, TBaseErrorData, TBaseResultMode, TBaseCallApiEnv, TBaseThrowOnError, TBaseResponseType, TBaseSchemaAndConfig, TBasePluginArray>) => <TData = TBaseData, TErrorData = TBaseErrorData, TResultMode extends ResultModeType = TBaseResultMode, TCallApiEnv extends CallApiEnv = TBaseCallApiEnv, 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<InferSchemaResult<TSchema["data"], GetResponseType<TData, TResponseType, ResponseTypeMap<TData>>, "infer-output">, InferSchemaResult<TSchema["errorData"], GetResponseType<TErrorData, TResponseType, ResponseTypeMap<TErrorData>>, "infer-output">, TResultMode, TCallApiEnv, TThrowOnError, TResponseType, TComputedBaseSchemaRoutes, TSchema, TComputedBaseSchemaConfig, TSchemaConfig, TInitURL, TCurrentRouteSchemaKey, TBasePluginArray, TPluginArray>) => Promise<TComputedResult>;
13
- declare const callApi: <TData = unknown, TErrorData = unknown, TResultMode extends ResultModeType = ResultModeType, TCallApiEnv extends CallApiEnv = BlankCallApiEnv, 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<InferSchemaResult<TSchema["data"], GetResponseType<TData, TResponseType, ResponseTypeMap<TData>>, "infer-output">, InferSchemaResult<TSchema["errorData"], GetResponseType<TErrorData, TResponseType, ResponseTypeMap<TErrorData>>, "infer-output">, TResultMode, TCallApiEnv, 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, createFetchClientWithEnv };
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-HHFgKKcn.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
@@ -977,7 +977,7 @@ const createRetryManager = (ctx) => {
977
977
  //#endregion
978
978
  //#region src/createFetchClient.ts
979
979
  const $GlobalRequestInfoCache = /* @__PURE__ */ new Map();
980
- const createFetchClientWithEnv = () => {
980
+ const createFetchClientWithContext = () => {
981
981
  const createFetchClient$1 = (initBaseConfig = {}) => {
982
982
  const $LocalRequestInfoCache = /* @__PURE__ */ new Map();
983
983
  const callApi$1 = async (initURL, initConfig = {}) => {
@@ -1185,9 +1185,9 @@ const createFetchClientWithEnv = () => {
1185
1185
  };
1186
1186
  return createFetchClient$1;
1187
1187
  };
1188
- const createFetchClient = createFetchClientWithEnv();
1188
+ const createFetchClient = createFetchClientWithContext();
1189
1189
  const callApi = createFetchClient();
1190
1190
 
1191
1191
  //#endregion
1192
- export { callApi, createFetchClient, createFetchClientWithEnv };
1192
+ export { callApi, createFetchClient, createFetchClientWithContext };
1193
1193
  //# sourceMappingURL=index.js.map