@zayne-labs/callapi-plugins 4.0.29 → 4.0.30

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.
@@ -9,7 +9,7 @@ declare const fallBackRouteSchemaKey = "@default";
9
9
  type FallBackRouteSchemaKey = typeof fallBackRouteSchemaKey;
10
10
  //#endregion
11
11
  //#endregion
12
- //#region ../callapi/dist/index-CrJL7qOL.d.ts
12
+ //#region ../callapi/dist/index-DvEQIgL-.d.ts
13
13
  //#region src/types/type-helpers.d.ts
14
14
  type AnyString = string & NonNullable<unknown>;
15
15
  type AnyNumber = number & NonNullable<unknown>;
@@ -26,8 +26,16 @@ type ArrayOrObject = Record<number | string | symbol, unknown> | unknown[] | rea
26
26
  type Writeable<TObject, TLevel extends WriteableLevel = "shallow"> = TObject extends ArrayOrObject ? { -readonly [Key in keyof TObject]: TLevel extends "deep" ? NonNullable<TObject[Key]> extends ArrayOrObject ? Writeable<TObject[Key], "deep"> : TObject[Key] : TObject[Key] } : TObject;
27
27
  type UnionToIntersection<TUnion> = (TUnion extends unknown ? (param: TUnion) => void : never) extends ((param: infer TParam) => void) ? TParam : never;
28
28
  type UnmaskType<TValue> = {
29
- _: TValue;
30
- }["_"];
29
+ value: TValue;
30
+ }["value"];
31
+ /**
32
+ * @description Userland implementation of NoInfer intrinsic type, but this one doesn't show up on hover like the intrinsic one
33
+ *
34
+ * Prevents TypeScript from inferring `TGeneric` at this position by creating a circular dependency.
35
+ * The tuple index `[TGeneric extends unknown ? 0 : never]` depends on `TGeneric`, forcing TS to
36
+ * skip this site for inference and use other arguments or defaults instead.
37
+ */
38
+ type NoInferUnMasked<TGeneric> = [TGeneric][TGeneric extends unknown ? 0 : never];
31
39
  type RemovePrefix<TPrefix extends "dedupe" | "retry", TKey extends string> = TKey extends `${TPrefix}${infer TRest}` ? Uncapitalize<TRest> : TKey;
32
40
  type Awaitable<TValue> = Promise<TValue> | TValue;
33
41
  type DistributiveOmit<TObject, TKeysToOmit extends keyof TObject> = TObject extends unknown ? Omit<TObject, TKeysToOmit> : never;
@@ -93,15 +101,10 @@ type StreamProgressEvent = {
93
101
  */
94
102
  transferredBytes: number;
95
103
  };
96
- declare global {
97
- interface ReadableStream<R$1 = any> {
98
- [Symbol.asyncIterator]: () => AsyncIterableIterator<R$1>;
99
- }
100
- }
101
104
  //#endregion
102
105
  //#region src/middlewares.d.ts
103
106
  type FetchImpl = UnmaskType<(input: string | Request | URL, init?: RequestInit) => Promise<Response>>;
104
- interface Middlewares<TCallApiContext extends CallApiContext = DefaultCallApiContext> {
107
+ interface Middlewares<TCallApiContext extends NoInfer<CallApiContext> = DefaultCallApiContext> {
105
108
  /**
106
109
  * Wraps the fetch implementation to intercept requests at the network layer.
107
110
  *
@@ -738,7 +741,7 @@ interface Hooks<TCallApiContext extends CallApiContext = DefaultCallApiContext>
738
741
  */
739
742
  onValidationError?: (context: ValidationErrorContext<TCallApiContext>) => Awaitable<unknown>;
740
743
  }
741
- type HooksOrHooksArray<TCallApiContext extends CallApiContext = DefaultCallApiContext> = { [Key in keyof Hooks<TCallApiContext>]: Hooks<TCallApiContext>[Key] | Array<Hooks<TCallApiContext>[Key]> };
744
+ type HooksOrHooksArray<TCallApiContext extends NoInfer<CallApiContext> = DefaultCallApiContext> = { [Key in keyof Hooks<TCallApiContext>]: Hooks<TCallApiContext>[Key] | Array<Hooks<TCallApiContext>[Key]> };
742
745
  interface HookConfigOptions {
743
746
  /**
744
747
  * Controls the execution mode of all composed hooks (main + plugin hooks).
@@ -789,7 +792,7 @@ type ValidationErrorContext<TCallApiContext extends Pick<CallApiContext, "Inferr
789
792
  response: Response | null;
790
793
  };
791
794
  type SuccessContext<TCallApiContext extends Pick<CallApiContext, "Data" | "InferredExtraOptions" | "Meta"> = DefaultCallApiContext> = RequestContext<TCallApiContext> & {
792
- data: NoInfer<TCallApiContext["Data"]>;
795
+ data: TCallApiContext["Data"];
793
796
  response: Response;
794
797
  };
795
798
  type ResponseContext<TCallApiContext extends Pick<CallApiContext, "Data" | "ErrorData" | "InferredExtraOptions" | "Meta"> = DefaultCallApiContext> = RequestContext<TCallApiContext> & (Prettify<CallApiResultSuccessVariant<TCallApiContext["Data"]>> | Prettify<Extract<CallApiResultErrorVariant<TCallApiContext["ErrorData"]>, {
@@ -1190,7 +1193,7 @@ type SharedExtraOptions<TCallApiContext extends CallApiContext = DefaultCallApiC
1190
1193
  ErrorData: TErrorData;
1191
1194
  InferredExtraOptions: TComputedMergedPluginExtraOptions;
1192
1195
  ResultMode: TResultMode;
1193
- }>> = DedupeOptions & HookConfigOptions & HooksOrHooksArray<TComputedCallApiContext> & Middlewares<TComputedCallApiContext> & ResultModeOption<TErrorData, TResultMode> & RetryOptions<TErrorData> & TComputedMergedPluginExtraOptions & ThrowOnErrorOption<TErrorData, TThrowOnError> & URLOptions & {
1196
+ }>> = DedupeOptions & HookConfigOptions & HooksOrHooksArray<NoInferUnMasked<TComputedCallApiContext>> & Middlewares<NoInferUnMasked<TComputedCallApiContext>> & ResultModeOption<TErrorData, TResultMode> & RetryOptions<TErrorData> & TComputedMergedPluginExtraOptions & ThrowOnErrorOption<TErrorData, TThrowOnError> & URLOptions & {
1194
1197
  /**
1195
1198
  * Automatically add an Authorization header value.
1196
1199
  *
@@ -1726,7 +1729,7 @@ type ResponseTypeUnion = keyof InitResponseTypeMap;
1726
1729
  type ResponseTypePlaceholder = null;
1727
1730
  type ResponseTypeType = ResponseTypePlaceholder | ResponseTypeUnion;
1728
1731
  type CallApiResultSuccessVariant<TData> = {
1729
- data: NoInfer<TData>;
1732
+ data: NoInferUnMasked<TData>;
1730
1733
  error: null;
1731
1734
  response: Response;
1732
1735
  };
@@ -1737,7 +1740,7 @@ type PossibleJavaScriptError = UnmaskType<{
1737
1740
  originalError: DOMException | Error | SyntaxError | TypeError;
1738
1741
  }>;
1739
1742
  type PossibleHTTPError<TErrorData> = UnmaskType<{
1740
- errorData: NoInfer<TErrorData>;
1743
+ errorData: NoInferUnMasked<TErrorData>;
1741
1744
  message: string;
1742
1745
  name: "HTTPError";
1743
1746
  originalError: HTTPError;
@@ -1851,4 +1854,4 @@ declare const loggerPlugin: (options?: LoggerOptions) => {
1851
1854
  };
1852
1855
  //#endregion
1853
1856
  export { defaultConsoleObject as n, loggerPlugin as r, LoggerOptions as t };
1854
- //# sourceMappingURL=index-BiLuTHUF.d.ts.map
1857
+ //# sourceMappingURL=index-4Ly8sBk-.d.ts.map
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { n as defaultConsoleObject, r as loggerPlugin, t as LoggerOptions } from "./index-BiLuTHUF.js";
1
+ import { n as defaultConsoleObject, r as loggerPlugin, t as LoggerOptions } from "./index-4Ly8sBk-.js";
2
2
  export { LoggerOptions, defaultConsoleObject, loggerPlugin };
@@ -1,2 +1,2 @@
1
- import { n as defaultConsoleObject, r as loggerPlugin, t as LoggerOptions } from "../../index-BiLuTHUF.js";
1
+ import { n as defaultConsoleObject, r as loggerPlugin, t as LoggerOptions } from "../../index-4Ly8sBk-.js";
2
2
  export { LoggerOptions, defaultConsoleObject, loggerPlugin };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@zayne-labs/callapi-plugins",
3
3
  "type": "module",
4
- "version": "4.0.29",
4
+ "version": "4.0.30",
5
5
  "description": "A collection of plugins for callapi",
6
6
  "author": "Ryan Zayne",
7
7
  "license": "MIT",
@@ -24,7 +24,7 @@
24
24
  "peerDependencies": {
25
25
  "@zayne-labs/toolkit-type-helpers": ">=0.11.17",
26
26
  "consola": "3.x.x",
27
- "@zayne-labs/callapi": "1.11.29"
27
+ "@zayne-labs/callapi": "1.11.30"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@arethetypeswrong/cli": "0.18.2",
@@ -41,7 +41,7 @@
41
41
  "tsdown": "0.17.0-beta.4",
42
42
  "typescript": "5.9.3",
43
43
  "vitest": "^4.0.14",
44
- "@zayne-labs/callapi": "1.11.29"
44
+ "@zayne-labs/callapi": "1.11.30"
45
45
  },
46
46
  "publishConfig": {
47
47
  "access": "public",