Skip to content

Commit bc436c2

Browse files
committed
chore: disable auth/security emission in generated SDK, regenerate client
1 parent 1a6447e commit bc436c2

7 files changed

Lines changed: 15 additions & 444 deletions

File tree

openapi-ts.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const sharedPlugins = [
88
},
99
{
1010
name: '@hey-api/sdk',
11+
auth: false,
1112
operations: { strategy: 'flat' },
1213
responseStyle: 'data',
1314
},

src/lib/api/internal/v1/client/client.gen.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,7 @@ export const createClient = (config: Config = {}): Client => {
4848
};
4949

5050
if (opts.security) {
51-
await setAuthParams({
52-
...opts,
53-
security: opts.security,
54-
});
51+
await setAuthParams(opts);
5552
}
5653

5754
if (opts.requestValidator) {

src/lib/api/internal/v1/client/utils.gen.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,12 @@ const checkForExistence = (
118118
return false;
119119
};
120120

121-
export const setAuthParams = async ({
122-
security,
123-
...options
124-
}: Pick<Required<RequestOptions>, 'security'> &
125-
Pick<RequestOptions, 'auth' | 'query'> & {
121+
export async function setAuthParams(
122+
options: Pick<RequestOptions, 'auth' | 'query' | 'security'> & {
126123
headers: Headers;
127-
}) => {
128-
for (const auth of security) {
124+
},
125+
): Promise<void> {
126+
for (const auth of options.security ?? []) {
129127
if (checkForExistence(options, auth.name)) {
130128
continue;
131129
}
@@ -154,7 +152,7 @@ export const setAuthParams = async ({
154152
break;
155153
}
156154
}
157-
};
155+
}
158156

159157
export const buildUrl: Client['buildUrl'] = (options) =>
160158
getUrl({

0 commit comments

Comments
 (0)