Files
grafana/scripts/generate-rtk-apis.ts
T
Ryan McKinleyandClarity-89 3482e3ae8b POC/Provisioning: Show file list on status page (#97104)
* show stub

* Update status page

* Use table for file list

* Update desc

---------

Co-authored-by: Clarity-89 <homes89@ukr.net>
2024-11-28 10:40:22 +03:00

48 lines
1.5 KiB
TypeScript

// 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,
exportName: 'generatedAPI',
outputFiles: {
'../public/app/features/migrate-to-cloud/api/endpoints.gen.ts': {
apiFile: '../public/app/features/migrate-to-cloud/api/baseAPI.ts',
apiImport: 'baseAPI',
filterEndpoints: [
'getSessionList',
'getSession',
'deleteSession',
'createSession',
'getShapshotList',
'getSnapshot',
'uploadSnapshot',
'createSnapshot',
'cancelSnapshot',
'createCloudMigrationToken',
'deleteCloudMigrationToken',
'getCloudMigrationToken',
'getDashboardByUid',
'getLibraryElementByUid',
],
},
'../public/app/features/preferences/api/user/endpoints.gen.ts': {
apiFile: '../public/app/features/preferences/api/user/baseAPI.ts',
apiImport: 'baseAPI',
filterEndpoints: ['getUserPreferences', 'updateUserPreferences', 'patchUserPreferences'],
},
'../public/app/features/provisioning/api/endpoints.gen.ts': {
apiFile: '../public/app/features/provisioning/api/baseAPI.ts',
schemaFile: '../public/app/features/provisioning/api/spec.json',
apiImport: 'baseAPI',
},
},
};
export default config;