Files
grafana/scripts/generate-rtk-apis.ts
T
cd1998e66a Provisioning: Add config page (#96550)
* Add baseAPI

* Restore schemaFile

* Generate endpoints

* Cleanup endpoints

* Update endpoints

* Set up config page

* Add hook

* Rename to provisioning

* Register reducer and middleware

* Separate List and New pages

* Add GitHub config

* Save data

* Fix types

* Display list

* Fix redirect

* Update tags

* Common folder

* Cleanup

* Update public/app/routes/routes.tsx

Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com>

* Add token permissions instructions

* Add EditPage

* load data for edit

* Update hook

* Show api errors

* Add title and token

* Use test name

* Update token field state

* Add delete button

* Add feedback for delete action

* Sort list

* Do not load items for new page

* Prettier

* Disable type change for edit

* Add title field

* Update pkg/services/navtree/navtreeimpl/admin.go

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>

* Update public/app/features/provisioning/ConfigForm.tsx

Co-authored-by: Ryan McKinley <ryantxu@gmail.com>

---------

Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com>
Co-authored-by: Ryan McKinley <ryantxu@gmail.com>
2024-11-21 09:36:02 +02: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;