@hey-api/openapi-ts 0.97.1 → 0.97.3

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.
@@ -212,12 +212,13 @@ type MethodFn = <
212
212
 
213
213
  type SseFn = <
214
214
  TData = unknown,
215
- TError = unknown,
215
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
216
+ _TError = unknown,
216
217
  ThrowOnError extends boolean = false,
217
218
  TResponseStyle extends ResponseStyle = 'fields',
218
219
  >(
219
220
  options: Omit<RequestOptions<never, TResponseStyle, ThrowOnError>, 'method'>,
220
- ) => Promise<ServerSentEventsResult<TData, TError>>;
221
+ ) => Promise<ServerSentEventsResult<TData>>;
221
222
 
222
223
  type RequestFn = <
223
224
  TData = unknown,
@@ -147,14 +147,12 @@ const checkForExistence = (
147
147
  return false;
148
148
  };
149
149
 
150
- export const setAuthParams = async ({
151
- security,
152
- ...options
153
- }: Pick<Required<RequestOptions>, 'security'> &
154
- Pick<RequestOptions, 'auth' | 'query'> & {
150
+ export async function setAuthParams(
151
+ options: Pick<RequestOptions, 'auth' | 'query' | 'security'> & {
155
152
  headers: Headers;
156
- }) => {
157
- for (const auth of security) {
153
+ },
154
+ ): Promise<void> {
155
+ for (const auth of options.security ?? []) {
158
156
  if (checkForExistence(options, auth.name)) {
159
157
  continue;
160
158
  }
@@ -183,7 +181,7 @@ export const setAuthParams = async ({
183
181
  break;
184
182
  }
185
183
  }
186
- };
184
+ }
187
185
 
188
186
  export const buildUrl: Client['buildUrl'] = (options) =>
189
187
  getUrl({