fork of hey-api/openapi-ts because I need some additional things
1import type { DefinePlugin, IR } from '@hey-api/openapi-ts';
2
3import { authSet } from './.gen/index.ts';
4
5type MyPluginConfig = { readonly name: 'myplugin' };
6type MyPlugin = DefinePlugin<MyPluginConfig>;
7
8export function f(schema: IR.SchemaObject, plugin: MyPlugin['Instance']) {
9 plugin.context.resolveIrRef(schema.$ref!);
10}
11
12export const handler: MyPlugin['Handler'] = ({ plugin }) => {
13 plugin.forEach('schema', 'operation', (event) => {
14 console.log(event);
15 });
16};
17
18console.log(
19 authSet({
20 auth: {
21 access: '',
22 expires: 1,
23 refresh: '',
24 type: 'oauth',
25 },
26 id: '123',
27 }),
28);