mirror of https://github.com/grafana/grafana.git
				
				
				
			
		
			
				
	
	
		
			55 lines
		
	
	
		
			1.7 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
			
		
		
	
	
			55 lines
		
	
	
		
			1.7 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: '', // leave this empty, and instead populate the outputFiles object below
 | |
|   apiFile: '', // leave this empty, and instead populate the outputFiles object below
 | |
|   exportName: 'generatedAPI',
 | |
| 
 | |
|   outputFiles: {
 | |
|     '../public/app/features/migrate-to-cloud/api/endpoints.gen.ts': {
 | |
|       schemaFile: '../public/openapi3.json',
 | |
|       apiFile: '../public/app/features/migrate-to-cloud/api/baseAPI.ts',
 | |
|       apiImport: 'baseAPI',
 | |
|       hooks: true,
 | |
|       filterEndpoints: [
 | |
|         'getSessionList',
 | |
|         'getSession',
 | |
|         'deleteSession',
 | |
|         'createSession',
 | |
| 
 | |
|         'getShapshotList',
 | |
|         'getSnapshot',
 | |
|         'uploadSnapshot',
 | |
|         'createSnapshot',
 | |
|         'cancelSnapshot',
 | |
| 
 | |
|         'createCloudMigrationToken',
 | |
|         'deleteCloudMigrationToken',
 | |
|         'getCloudMigrationToken',
 | |
| 
 | |
|         'getDashboardByUid',
 | |
|         'getLibraryElementByUid',
 | |
|       ],
 | |
|     },
 | |
|     '../public/app/features/preferences/api/user/endpoints.gen.ts': {
 | |
|       schemaFile: '../public/openapi3.json',
 | |
|       hooks: true,
 | |
|       apiFile: '../public/app/features/preferences/api/user/baseAPI.ts',
 | |
|       apiImport: 'baseAPI',
 | |
|       filterEndpoints: ['getUserPreferences', 'updateUserPreferences', 'patchUserPreferences'],
 | |
|     },
 | |
|     '../public/app/features/iam/api/endpoints.gen.ts': {
 | |
|       schemaFile: '../data/openapi/iam.grafana.app-v0alpha1.json',
 | |
|       apiFile: '../public/app/features/iam/api/api.ts',
 | |
|       apiImport: 'iamApi',
 | |
|       filterEndpoints: ['getDisplayMapping'],
 | |
|       exportName: 'generatedIamApi',
 | |
|       flattenArg: false,
 | |
|       tag: true,
 | |
|     },
 | |
|   },
 | |
| };
 | |
| 
 | |
| export default config;
 |