@geekmidas/client 0.1.0 → 0.1.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.
@@ -1,4 +1,4 @@
1
- import { FetcherOptions, TypedApiFunction } from "./types-DVVUpwI4.cjs";
1
+ import { FetcherOptions, TypedApiFunction } from "./types-D4OSWveN.cjs";
2
2
 
3
3
  //#region src/auth-fetcher.d.ts
4
4
 
@@ -1,4 +1,4 @@
1
- import { FetcherOptions, TypedApiFunction } from "./types-CyMkwV3g.mjs";
1
+ import { FetcherOptions, TypedApiFunction } from "./types-Cdv1XAWr.mjs";
2
2
 
3
3
  //#region src/auth-fetcher.d.ts
4
4
 
@@ -1,4 +1,4 @@
1
- import { ExtractEndpointResponse, FilteredRequestConfig, IsConfigRequired, MutationEndpoint, QueryEndpoint, TypedApiFunction } from "./types-DVVUpwI4.cjs";
1
+ import { ExtractEndpointResponse, FilteredRequestConfig, IsConfigRequired, MutationEndpoint, QueryEndpoint, TypedApiFunction } from "./types-D4OSWveN.cjs";
2
2
  import { QueryClient, UseMutationOptions, UseQueryOptions, useMutation, useQuery } from "@tanstack/react-query";
3
3
 
4
4
  //#region src/endpoint-hooks.d.ts
@@ -1,4 +1,4 @@
1
- import { ExtractEndpointResponse, FilteredRequestConfig, IsConfigRequired, MutationEndpoint, QueryEndpoint, TypedApiFunction } from "./types-CyMkwV3g.mjs";
1
+ import { ExtractEndpointResponse, FilteredRequestConfig, IsConfigRequired, MutationEndpoint, QueryEndpoint, TypedApiFunction } from "./types-Cdv1XAWr.mjs";
2
2
  import { QueryClient, UseMutationOptions, UseQueryOptions, useMutation, useQuery } from "@tanstack/react-query";
3
3
 
4
4
  //#region src/endpoint-hooks.d.ts
@@ -1,4 +1,4 @@
1
- import { ExtractEndpointResponse, FetcherOptions, FilteredRequestConfig, TypedEndpoint } from "./types-DVVUpwI4.cjs";
1
+ import { ExtractEndpointResponse, FetcherOptions, FilteredRequestConfig, TypedEndpoint } from "./types-D4OSWveN.cjs";
2
2
 
3
3
  //#region src/fetcher.d.ts
4
4
  declare class TypedFetcher<Paths> {
@@ -1,4 +1,4 @@
1
- import { ExtractEndpointResponse, FetcherOptions, FilteredRequestConfig, TypedEndpoint } from "./types-CyMkwV3g.mjs";
1
+ import { ExtractEndpointResponse, FetcherOptions, FilteredRequestConfig, TypedEndpoint } from "./types-Cdv1XAWr.mjs";
2
2
 
3
3
  //#region src/fetcher.d.ts
4
4
  declare class TypedFetcher<Paths> {
@@ -1,5 +1,5 @@
1
- import { FetcherOptions } from "./types-DVVUpwI4.cjs";
2
- import * as _tanstack_react_query0 from "@tanstack/react-query";
1
+ import { FetcherOptions } from "./types-D4OSWveN.cjs";
2
+ import * as _tanstack_react_query8 from "@tanstack/react-query";
3
3
  import { UseMutationOptions, UseQueryOptions } from "@tanstack/react-query";
4
4
 
5
5
  //#region src/openapi-hooks.d.ts
@@ -91,8 +91,8 @@ interface OperationRegistry {
91
91
  declare function createOpenAPIHooks<Paths>(options?: FetcherOptions & {
92
92
  operations?: OperationRegistry;
93
93
  }): {
94
- useQuery: <OpId extends OperationsByMethod<Paths, "get">>(operationId: OpId, config?: RemoveNever<OperationParams<Paths, OpId>>, options?: Omit<UseQueryOptions<OperationResponse<Paths, OpId>, Error>, "queryKey" | "queryFn">) => _tanstack_react_query0.UseQueryResult<_tanstack_react_query0.NoInfer<OperationResponse<Paths, OpId>>, Error>;
95
- useMutation: <OpId extends Exclude<OperationId<Paths>, OperationsByMethod<Paths, "get">>>(operationId: OpId, options?: Omit<UseMutationOptions<OperationResponse<Paths, OpId>, Error, RemoveNever<OperationParams<Paths, OpId>>>, "mutationFn">) => _tanstack_react_query0.UseMutationResult<OperationResponse<Paths, OpId>, Error, RemoveNever<OperationParams<Paths, OpId>>, unknown>;
94
+ useQuery: <OpId extends OperationsByMethod<Paths, "get">>(operationId: OpId, config?: RemoveNever<OperationParams<Paths, OpId>>, options?: Omit<UseQueryOptions<OperationResponse<Paths, OpId>, Error>, "queryKey" | "queryFn">) => _tanstack_react_query8.UseQueryResult<_tanstack_react_query8.NoInfer<OperationResponse<Paths, OpId>>, Error>;
95
+ useMutation: <OpId extends Exclude<OperationId<Paths>, OperationsByMethod<Paths, "get">>>(operationId: OpId, options?: Omit<UseMutationOptions<OperationResponse<Paths, OpId>, Error, RemoveNever<OperationParams<Paths, OpId>>>, "mutationFn">) => _tanstack_react_query8.UseMutationResult<OperationResponse<Paths, OpId>, Error, RemoveNever<OperationParams<Paths, OpId>>, unknown>;
96
96
  };
97
97
  //#endregion
98
98
  export { createOpenAPIHooks };
@@ -1,4 +1,4 @@
1
- import { FetcherOptions } from "./types-CyMkwV3g.mjs";
1
+ import { FetcherOptions } from "./types-Cdv1XAWr.mjs";
2
2
  import * as _tanstack_react_query0 from "@tanstack/react-query";
3
3
  import { UseMutationOptions, UseQueryOptions } from "@tanstack/react-query";
4
4
 
@@ -1,5 +1,5 @@
1
- import { ExtractEndpointResponse, FetcherOptions, FilteredRequestConfig, MutationEndpoint, QueryEndpoint, TypedEndpoint } from "./types-DVVUpwI4.cjs";
2
- import * as _tanstack_react_query3 from "@tanstack/react-query";
1
+ import { ExtractEndpointResponse, FetcherOptions, FilteredRequestConfig, MutationEndpoint, QueryEndpoint, TypedEndpoint } from "./types-D4OSWveN.cjs";
2
+ import * as _tanstack_react_query0 from "@tanstack/react-query";
3
3
  import { QueryClient, UseInfiniteQueryOptions, UseMutationOptions, UseQueryOptions } from "@tanstack/react-query";
4
4
 
5
5
  //#region src/react-query.d.ts
@@ -10,15 +10,15 @@ declare class TypedQueryClient<Paths> {
10
10
  private fetcher;
11
11
  private queryClient?;
12
12
  constructor(options?: TypedQueryClientOptions);
13
- useQuery<T extends QueryEndpoint<Paths>>(endpoint: T, config?: FilteredRequestConfig<Paths, T>, options?: Omit<UseQueryOptions<ExtractEndpointResponse<Paths, T>, Response>, 'queryKey' | 'queryFn'>): _tanstack_react_query3.UseQueryResult<_tanstack_react_query3.NoInfer<ExtractEndpointResponse<Paths, T>>, Response>;
14
- useMutation<T extends MutationEndpoint<Paths>>(endpoint: T, options?: Omit<UseMutationOptions<ExtractEndpointResponse<Paths, T>, Response, FilteredRequestConfig<Paths, T>>, 'mutationFn'>): _tanstack_react_query3.UseMutationResult<ExtractEndpointResponse<Paths, T>, Response, FilteredRequestConfig<Paths, T>, unknown>;
13
+ useQuery<T extends QueryEndpoint<Paths>>(endpoint: T, config?: FilteredRequestConfig<Paths, T>, options?: Omit<UseQueryOptions<ExtractEndpointResponse<Paths, T>, Response>, 'queryKey' | 'queryFn'>): _tanstack_react_query0.UseQueryResult<_tanstack_react_query0.NoInfer<ExtractEndpointResponse<Paths, T>>, Response>;
14
+ useMutation<T extends MutationEndpoint<Paths>>(endpoint: T, options?: Omit<UseMutationOptions<ExtractEndpointResponse<Paths, T>, Response, FilteredRequestConfig<Paths, T>>, 'mutationFn'>): _tanstack_react_query0.UseMutationResult<ExtractEndpointResponse<Paths, T>, Response, FilteredRequestConfig<Paths, T>, unknown>;
15
15
  useInfiniteQuery<T extends QueryEndpoint<Paths>, TPageData = ExtractEndpointResponse<Paths, T>, TPageParam = unknown>(endpoint: T, options: Omit<UseInfiniteQueryOptions<TPageData, Response, {
16
16
  pages: TPageData[];
17
17
  pageParams: TPageParam[];
18
18
  }, unknown[], TPageParam>, 'queryKey' | 'queryFn' | 'getNextPageParam' | 'initialPageParam'> & {
19
19
  getNextPageParam: (lastPage: TPageData, allPages: TPageData[], lastPageParam: TPageParam, allPageParams: TPageParam[]) => TPageParam | undefined;
20
20
  initialPageParam: TPageParam;
21
- }, config?: FilteredRequestConfig<Paths, T>): _tanstack_react_query3.UseInfiniteQueryResult<{
21
+ }, config?: FilteredRequestConfig<Paths, T>): _tanstack_react_query0.UseInfiniteQueryResult<{
22
22
  pages: TPageData[];
23
23
  pageParams: TPageParam[];
24
24
  }, Response>;
@@ -47,15 +47,15 @@ declare class TypedQueryClient<Paths> {
47
47
  setQueryClient(queryClient: QueryClient): void;
48
48
  }
49
49
  declare function createTypedQueryClient<Paths>(options?: TypedQueryClientOptions): TypedQueryClient<Paths>;
50
- declare function useTypedQuery<Paths, T extends QueryEndpoint<Paths>>(client: TypedQueryClient<Paths>, endpoint: T, config?: FilteredRequestConfig<Paths, T>, options?: Omit<UseQueryOptions<ExtractEndpointResponse<Paths, T>, Response>, 'queryKey' | 'queryFn'>): _tanstack_react_query3.UseQueryResult<_tanstack_react_query3.NoInfer<ExtractEndpointResponse<Paths, T>>, Response>;
51
- declare function useTypedMutation<Paths, T extends MutationEndpoint<Paths>>(client: TypedQueryClient<Paths>, endpoint: T, options?: Omit<UseMutationOptions<ExtractEndpointResponse<Paths, T>, Response, FilteredRequestConfig<Paths, T>>, 'mutationFn'>): _tanstack_react_query3.UseMutationResult<ExtractEndpointResponse<Paths, T>, Response, FilteredRequestConfig<Paths, T>, unknown>;
50
+ declare function useTypedQuery<Paths, T extends QueryEndpoint<Paths>>(client: TypedQueryClient<Paths>, endpoint: T, config?: FilteredRequestConfig<Paths, T>, options?: Omit<UseQueryOptions<ExtractEndpointResponse<Paths, T>, Response>, 'queryKey' | 'queryFn'>): _tanstack_react_query0.UseQueryResult<_tanstack_react_query0.NoInfer<ExtractEndpointResponse<Paths, T>>, Response>;
51
+ declare function useTypedMutation<Paths, T extends MutationEndpoint<Paths>>(client: TypedQueryClient<Paths>, endpoint: T, options?: Omit<UseMutationOptions<ExtractEndpointResponse<Paths, T>, Response, FilteredRequestConfig<Paths, T>>, 'mutationFn'>): _tanstack_react_query0.UseMutationResult<ExtractEndpointResponse<Paths, T>, Response, FilteredRequestConfig<Paths, T>, unknown>;
52
52
  declare function useTypedInfiniteQuery<Paths, T extends QueryEndpoint<Paths>, TPageData = ExtractEndpointResponse<Paths, T>, TPageParam = unknown>(client: TypedQueryClient<Paths>, endpoint: T, options: Omit<UseInfiniteQueryOptions<TPageData, Response, {
53
53
  pages: TPageData[];
54
54
  pageParams: TPageParam[];
55
55
  }, unknown[], TPageParam>, 'queryKey' | 'queryFn' | 'getNextPageParam' | 'initialPageParam'> & {
56
56
  getNextPageParam: (lastPage: TPageData, allPages: TPageData[], lastPageParam: TPageParam, allPageParams: TPageParam[]) => TPageParam | undefined;
57
57
  initialPageParam: TPageParam;
58
- }, config?: FilteredRequestConfig<Paths, T>): _tanstack_react_query3.UseInfiniteQueryResult<{
58
+ }, config?: FilteredRequestConfig<Paths, T>): _tanstack_react_query0.UseInfiniteQueryResult<{
59
59
  pages: TPageData[];
60
60
  pageParams: TPageParam[];
61
61
  }, Response>;
@@ -1,4 +1,4 @@
1
- import { ExtractEndpointResponse, FetcherOptions, FilteredRequestConfig, MutationEndpoint, QueryEndpoint, TypedEndpoint } from "./types-CyMkwV3g.mjs";
1
+ import { ExtractEndpointResponse, FetcherOptions, FilteredRequestConfig, MutationEndpoint, QueryEndpoint, TypedEndpoint } from "./types-Cdv1XAWr.mjs";
2
2
  import * as _tanstack_react_query3 from "@tanstack/react-query";
3
3
  import { QueryClient, UseInfiniteQueryOptions, UseMutationOptions, UseQueryOptions } from "@tanstack/react-query";
4
4
 
@@ -1,6 +1,7 @@
1
1
  //#region src/types.d.ts
2
2
  type OpenAPIRoutes<Paths> = keyof Paths;
3
- type ExtractMethod<Paths, Route extends OpenAPIRoutes<Paths>> = keyof Paths[Route];
3
+ type HttpMethod = 'get' | 'post' | 'put' | 'patch' | 'delete' | 'head' | 'options';
4
+ type ExtractMethod<Paths, Route extends OpenAPIRoutes<Paths>> = Extract<keyof Paths[Route], HttpMethod>;
4
5
  type ExtractPathParams<Paths, Route extends OpenAPIRoutes<Paths>> = Paths[Route] extends {
5
6
  parameters?: {
6
7
  path?: infer P;
@@ -42,8 +43,7 @@ type RequestConfig<Paths, Route extends OpenAPIRoutes<Paths>, Method extends Ext
42
43
  headers?: Record<string, string>;
43
44
  };
44
45
  type EndpointString = `${Uppercase<string>} ${string}`;
45
- type FilterNeverMethods<T> = { [K in keyof T as T[K] extends never | undefined ? never : K]: T[K] extends undefined ? never : T[K] };
46
- type ValidEndpoint<Paths> = { [Route in keyof Paths]: { [Method in keyof FilterNeverMethods<Paths[Route]>]: `${Uppercase<string & Method>} ${string & Route}` }[keyof FilterNeverMethods<Paths[Route]>] }[keyof Paths];
46
+ type ValidEndpoint<Paths> = { [Route in keyof Paths]: { [Method in Extract<keyof Paths[Route], HttpMethod>]: `${Uppercase<string & Method>} ${string & Route}` }[Extract<keyof Paths[Route], HttpMethod>] }[keyof Paths];
47
47
  type TypedEndpoint<Paths> = ValidEndpoint<Paths> extends infer E ? E extends string ? E : never : never;
48
48
  type FilterEndpointByMethod<Paths, Method extends string> = ValidEndpoint<Paths> extends infer E ? E extends `${Method} ${string}` ? E : never : never;
49
49
  type QueryEndpoint<Paths> = FilterEndpointByMethod<Paths, 'GET'>;
@@ -96,4 +96,4 @@ interface FetcherOptions {
96
96
  }
97
97
  //#endregion
98
98
  export { EndpointString, ExtractEndpointConfig, ExtractEndpointResponse, ExtractMethod, ExtractPathParams, ExtractQueryParams, ExtractRequestBody, ExtractResponse, FetcherOptions, FilterEndpointByMethod, FilteredRequestConfig, IsConfigRequired, MutationEndpoint, OpenAPIRoutes, ParseEndpoint, QueryEndpoint, RequestConfig, TypedApiFunction, TypedEndpoint, ValidEndpoint };
99
- //# sourceMappingURL=types-CyMkwV3g.d.mts.map
99
+ //# sourceMappingURL=types-Cdv1XAWr.d.mts.map
@@ -1,6 +1,7 @@
1
1
  //#region src/types.d.ts
2
2
  type OpenAPIRoutes<Paths> = keyof Paths;
3
- type ExtractMethod<Paths, Route extends OpenAPIRoutes<Paths>> = keyof Paths[Route];
3
+ type HttpMethod = 'get' | 'post' | 'put' | 'patch' | 'delete' | 'head' | 'options';
4
+ type ExtractMethod<Paths, Route extends OpenAPIRoutes<Paths>> = Extract<keyof Paths[Route], HttpMethod>;
4
5
  type ExtractPathParams<Paths, Route extends OpenAPIRoutes<Paths>> = Paths[Route] extends {
5
6
  parameters?: {
6
7
  path?: infer P;
@@ -42,8 +43,7 @@ type RequestConfig<Paths, Route extends OpenAPIRoutes<Paths>, Method extends Ext
42
43
  headers?: Record<string, string>;
43
44
  };
44
45
  type EndpointString = `${Uppercase<string>} ${string}`;
45
- type FilterNeverMethods<T> = { [K in keyof T as T[K] extends never | undefined ? never : K]: T[K] extends undefined ? never : T[K] };
46
- type ValidEndpoint<Paths> = { [Route in keyof Paths]: { [Method in keyof FilterNeverMethods<Paths[Route]>]: `${Uppercase<string & Method>} ${string & Route}` }[keyof FilterNeverMethods<Paths[Route]>] }[keyof Paths];
46
+ type ValidEndpoint<Paths> = { [Route in keyof Paths]: { [Method in Extract<keyof Paths[Route], HttpMethod>]: `${Uppercase<string & Method>} ${string & Route}` }[Extract<keyof Paths[Route], HttpMethod>] }[keyof Paths];
47
47
  type TypedEndpoint<Paths> = ValidEndpoint<Paths> extends infer E ? E extends string ? E : never : never;
48
48
  type FilterEndpointByMethod<Paths, Method extends string> = ValidEndpoint<Paths> extends infer E ? E extends `${Method} ${string}` ? E : never : never;
49
49
  type QueryEndpoint<Paths> = FilterEndpointByMethod<Paths, 'GET'>;
@@ -96,4 +96,4 @@ interface FetcherOptions {
96
96
  }
97
97
  //#endregion
98
98
  export { EndpointString, ExtractEndpointConfig, ExtractEndpointResponse, ExtractMethod, ExtractPathParams, ExtractQueryParams, ExtractRequestBody, ExtractResponse, FetcherOptions, FilterEndpointByMethod, FilteredRequestConfig, IsConfigRequired, MutationEndpoint, OpenAPIRoutes, ParseEndpoint, QueryEndpoint, RequestConfig, TypedApiFunction, TypedEndpoint, ValidEndpoint };
99
- //# sourceMappingURL=types-DVVUpwI4.d.cts.map
99
+ //# sourceMappingURL=types-D4OSWveN.d.cts.map
package/dist/types.d.cts CHANGED
@@ -1,2 +1,2 @@
1
- import { EndpointString, ExtractEndpointConfig, ExtractEndpointResponse, ExtractMethod, ExtractPathParams, ExtractQueryParams, ExtractRequestBody, ExtractResponse, FetcherOptions, FilterEndpointByMethod, FilteredRequestConfig, IsConfigRequired, MutationEndpoint, OpenAPIRoutes, ParseEndpoint, QueryEndpoint, RequestConfig, TypedApiFunction, TypedEndpoint, ValidEndpoint } from "./types-DVVUpwI4.cjs";
1
+ import { EndpointString, ExtractEndpointConfig, ExtractEndpointResponse, ExtractMethod, ExtractPathParams, ExtractQueryParams, ExtractRequestBody, ExtractResponse, FetcherOptions, FilterEndpointByMethod, FilteredRequestConfig, IsConfigRequired, MutationEndpoint, OpenAPIRoutes, ParseEndpoint, QueryEndpoint, RequestConfig, TypedApiFunction, TypedEndpoint, ValidEndpoint } from "./types-D4OSWveN.cjs";
2
2
  export { EndpointString, ExtractEndpointConfig, ExtractEndpointResponse, ExtractMethod, ExtractPathParams, ExtractQueryParams, ExtractRequestBody, ExtractResponse, FetcherOptions, FilterEndpointByMethod, FilteredRequestConfig, IsConfigRequired, MutationEndpoint, OpenAPIRoutes, ParseEndpoint, QueryEndpoint, RequestConfig, TypedApiFunction, TypedEndpoint, ValidEndpoint };
package/dist/types.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { EndpointString, ExtractEndpointConfig, ExtractEndpointResponse, ExtractMethod, ExtractPathParams, ExtractQueryParams, ExtractRequestBody, ExtractResponse, FetcherOptions, FilterEndpointByMethod, FilteredRequestConfig, IsConfigRequired, MutationEndpoint, OpenAPIRoutes, ParseEndpoint, QueryEndpoint, RequestConfig, TypedApiFunction, TypedEndpoint, ValidEndpoint } from "./types-CyMkwV3g.mjs";
1
+ import { EndpointString, ExtractEndpointConfig, ExtractEndpointResponse, ExtractMethod, ExtractPathParams, ExtractQueryParams, ExtractRequestBody, ExtractResponse, FetcherOptions, FilterEndpointByMethod, FilteredRequestConfig, IsConfigRequired, MutationEndpoint, OpenAPIRoutes, ParseEndpoint, QueryEndpoint, RequestConfig, TypedApiFunction, TypedEndpoint, ValidEndpoint } from "./types-Cdv1XAWr.mjs";
2
2
  export { EndpointString, ExtractEndpointConfig, ExtractEndpointResponse, ExtractMethod, ExtractPathParams, ExtractQueryParams, ExtractRequestBody, ExtractResponse, FetcherOptions, FilterEndpointByMethod, FilteredRequestConfig, IsConfigRequired, MutationEndpoint, OpenAPIRoutes, ParseEndpoint, QueryEndpoint, RequestConfig, TypedApiFunction, TypedEndpoint, ValidEndpoint };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geekmidas/client",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "exports": {
@@ -55,7 +55,7 @@
55
55
  },
56
56
  "dependencies": {
57
57
  "@standard-schema/spec": "^1.0.0",
58
- "@geekmidas/schema": "0.0.2"
58
+ "@geekmidas/schema": "0.0.3"
59
59
  },
60
60
  "devDependencies": {
61
61
  "@testing-library/jest-dom": "~6.6.3",
@@ -72,7 +72,7 @@
72
72
  "react": ">=18.0.0",
73
73
  "react-dom": ">=18.0.0",
74
74
  "zod": "~4.1.13",
75
- "@geekmidas/constructs": "0.2.0"
75
+ "@geekmidas/constructs": "0.2.3"
76
76
  },
77
77
  "peerDependenciesMeta": {
78
78
  "@geekmidas/constructs": {
package/src/types.ts CHANGED
@@ -1,9 +1,18 @@
1
1
  export type OpenAPIRoutes<Paths> = keyof Paths;
2
2
 
3
- export type ExtractMethod<
4
- Paths,
5
- Route extends OpenAPIRoutes<Paths>,
6
- > = keyof Paths[Route];
3
+ type HttpMethod =
4
+ | 'get'
5
+ | 'post'
6
+ | 'put'
7
+ | 'patch'
8
+ | 'delete'
9
+ | 'head'
10
+ | 'options';
11
+
12
+ export type ExtractMethod<Paths, Route extends OpenAPIRoutes<Paths>> = Extract<
13
+ keyof Paths[Route],
14
+ HttpMethod
15
+ >;
7
16
 
8
17
  export type ExtractPathParams<
9
18
  Paths,
@@ -59,21 +68,14 @@ export type RequestConfig<
59
68
 
60
69
  export type EndpointString = `${Uppercase<string>} ${string}`;
61
70
 
62
- // Filter out methods that are never to avoid showing them in autocomplete
63
- // This handles both explicit never and optional never (?: never)
64
- type FilterNeverMethods<T> = {
65
- [K in keyof T as T[K] extends never | undefined
66
- ? never
67
- : K]: T[K] extends undefined ? never : T[K];
68
- };
69
-
70
71
  // Generate all valid endpoint strings from OpenAPI paths
72
+ // Uses Extract with HttpMethod to filter out non-HTTP keys like 'parameters'
71
73
  export type ValidEndpoint<Paths> = {
72
74
  [Route in keyof Paths]: {
73
- [Method in keyof FilterNeverMethods<Paths[Route]>]: `${Uppercase<
75
+ [Method in Extract<keyof Paths[Route], HttpMethod>]: `${Uppercase<
74
76
  string & Method
75
77
  >} ${string & Route}`;
76
- }[keyof FilterNeverMethods<Paths[Route]>];
78
+ }[Extract<keyof Paths[Route], HttpMethod>];
77
79
  }[keyof Paths];
78
80
 
79
81
  // Helper type to get autocomplete for endpoint strings