@hey-api/openapi-ts 0.78.3 → 0.79.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,6 +1,7 @@
1
1
  import type {
2
2
  AxiosError,
3
3
  AxiosInstance,
4
+ AxiosRequestHeaders,
4
5
  AxiosResponse,
5
6
  AxiosStatic,
6
7
  CreateAxiosDefaults,
@@ -33,7 +34,7 @@ export interface Config<T extends ClientOptions = ClientOptions>
33
34
  * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more}
34
35
  */
35
36
  headers?:
36
- | CreateAxiosDefaults['headers']
37
+ | AxiosRequestHeaders
37
38
  | Record<
38
39
  string,
39
40
  | string
@@ -3,11 +3,21 @@ type Slot = 'body' | 'headers' | 'path' | 'query';
3
3
  export type Field =
4
4
  | {
5
5
  in: Exclude<Slot, 'body'>;
6
+ /**
7
+ * Field name. This is the name we want the user to see and use.
8
+ */
6
9
  key: string;
10
+ /**
11
+ * Field mapped name. This is the name we want to use in the request.
12
+ * If omitted, we use the same value as `key`.
13
+ */
7
14
  map?: string;
8
15
  }
9
16
  | {
10
17
  in: Extract<Slot, 'body'>;
18
+ /**
19
+ * Key isn't required for bodies.
20
+ */
11
21
  key?: string;
12
22
  map?: string;
13
23
  };
@@ -102,3 +102,17 @@ export interface Config {
102
102
  */
103
103
  responseValidator?: (data: unknown) => Promise<unknown>;
104
104
  }
105
+
106
+ type IsExactlyNeverOrNeverUndefined<T> = [T] extends [never]
107
+ ? true
108
+ : [T] extends [never | undefined]
109
+ ? [undefined] extends [T]
110
+ ? false
111
+ : true
112
+ : false;
113
+
114
+ export type OmitNever<T extends Record<string, unknown>> = {
115
+ [K in keyof T as IsExactlyNeverOrNeverUndefined<T[K]> extends true
116
+ ? never
117
+ : K]: T[K];
118
+ };