Something went wrong. Try again.
fork of hey-api/openapi-ts because I need some additional things
Something went wrong. Try again.
2.1 kB · 56 lines
TypeScript
at main
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657import sdk from '@stackblitz/sdk';
// https://api.npmjs.org/versions/@hey-api%2Fopenapi-ts/last-week
export const embedProject = (projectId: string) => async (event: Event) => { const container = document.createElement('div');
if (event.target) { const node = event.target as HTMLElement; node.replaceWith(container); }
switch (projectId) { case 'hey-api-client-axios-example': return await sdk.embedProjectId(container, projectId, { height: 700, openFile: 'openapi-ts.config.ts,src/client/schemas.gen.ts,src/client/sdk.gen.ts,src/client/types.gen.ts,src/App.tsx', view: 'editor', }); case 'hey-api-client-fetch-example': return await sdk.embedProjectId(container, projectId, { height: 700, openFile: 'openapi-ts.config.ts,src/client/schemas.gen.ts,src/client/sdk.gen.ts,src/client/types.gen.ts,src/App.tsx', view: 'editor', }); case 'hey-api-client-fetch-plugin-fastify-example': return await sdk.embedProjectId(container, projectId, { height: 700, openFile: 'openapi-ts.config.ts,src/client/fastify.gen.ts,src/client/types.gen.ts,src/server.ts', view: 'editor', }); case 'hey-api-client-fetch-plugin-tanstack-react-query-example': return await sdk.embedProjectId(container, projectId, { height: 700, openFile: 'openapi-ts.config.ts,src/client/@tanstack/react-query.gen.ts,src/client/types.gen.ts,src/App.tsx', view: 'editor', }); case 'hey-api-client-fetch-plugin-zod-example': return await sdk.embedProjectId(container, projectId, { height: 700, openFile: 'openapi-ts.config.ts,src/client/zod.gen.ts,src/App.tsx', view: 'editor', }); case 'hey-api-example': return await sdk.embedProjectId(container, projectId, { height: 700, openFile: 'openapi-ts.config.ts,src/client/schemas.gen.ts,src/client/sdk.gen.ts,src/client/types.gen.ts', view: 'editor', }); }};