mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
E2C: Generate RTK Query API slice from swagger spec (#85463)
* add deps and script * add codegen rtk api clise for cloud migration * rename all the mock exports to mock * Reset changes to package.json and yarn.lock * codeowners
This commit is contained in:
27
scripts/generate-rtk-apis.ts
Normal file
27
scripts/generate-rtk-apis.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
// Generates Redux Toolkit API slices for certain APIs from the OpenAPI spec
|
||||
import type { ConfigFile } from '@rtk-query/codegen-openapi';
|
||||
|
||||
const config: ConfigFile = {
|
||||
schemaFile: '../public/openapi3.json',
|
||||
apiFile: '', // leave this empty, and instead populate the outputFiles object below
|
||||
hooks: true,
|
||||
|
||||
outputFiles: {
|
||||
'../public/app/features/migrate-to-cloud/api/endpoints.gen.ts': {
|
||||
apiFile: '../public/app/features/migrate-to-cloud/api/baseAPI.ts',
|
||||
apiImport: 'baseAPI',
|
||||
filterEndpoints: [
|
||||
'createCloudMigrationToken',
|
||||
'getMigrationList',
|
||||
'getCloudMigration',
|
||||
'createMigration',
|
||||
'runCloudMigration',
|
||||
'getCloudMigrationRun',
|
||||
'getCloudMigrationRunList',
|
||||
'deleteCloudMigration',
|
||||
],
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default config;
|
||||
Reference in New Issue
Block a user