| 
									
										
										
										
											2024-04-02 23:01:33 +08:00
										 |  |  | // Generates Redux Toolkit API slices for certain APIs from the OpenAPI spec
 | 
					
						
							|  |  |  | import type { ConfigFile } from '@rtk-query/codegen-openapi'; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | const config: ConfigFile = { | 
					
						
							| 
									
										
										
										
											2025-02-03 23:26:23 +08:00
										 |  |  |   schemaFile: '', // leave this empty, and instead populate the outputFiles object below
 | 
					
						
							| 
									
										
										
										
											2024-04-02 23:01:33 +08:00
										 |  |  |   apiFile: '', // leave this empty, and instead populate the outputFiles object below
 | 
					
						
							| 
									
										
										
										
											2024-04-04 01:47:02 +08:00
										 |  |  |   exportName: 'generatedAPI', | 
					
						
							| 
									
										
										
										
											2024-04-02 23:01:33 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |   outputFiles: { | 
					
						
							|  |  |  |     '../public/app/features/migrate-to-cloud/api/endpoints.gen.ts': { | 
					
						
							| 
									
										
										
										
											2025-02-03 23:26:23 +08:00
										 |  |  |       schemaFile: '../public/openapi3.json', | 
					
						
							| 
									
										
										
										
											2024-04-02 23:01:33 +08:00
										 |  |  |       apiFile: '../public/app/features/migrate-to-cloud/api/baseAPI.ts', | 
					
						
							|  |  |  |       apiImport: 'baseAPI', | 
					
						
							| 
									
										
										
										
											2025-02-03 23:26:23 +08:00
										 |  |  |       hooks: true, | 
					
						
							| 
									
										
										
										
											2024-04-02 23:01:33 +08:00
										 |  |  |       filterEndpoints: [ | 
					
						
							| 
									
										
										
										
											2024-06-14 01:58:59 +08:00
										 |  |  |         'getSessionList', | 
					
						
							|  |  |  |         'getSession', | 
					
						
							|  |  |  |         'deleteSession', | 
					
						
							| 
									
										
										
										
											2024-07-03 18:42:00 +08:00
										 |  |  |         'createSession', | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         'getShapshotList', | 
					
						
							|  |  |  |         'getSnapshot', | 
					
						
							|  |  |  |         'uploadSnapshot', | 
					
						
							|  |  |  |         'createSnapshot', | 
					
						
							|  |  |  |         'cancelSnapshot', | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         'createCloudMigrationToken', | 
					
						
							|  |  |  |         'deleteCloudMigrationToken', | 
					
						
							|  |  |  |         'getCloudMigrationToken', | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-04-04 01:47:02 +08:00
										 |  |  |         'getDashboardByUid', | 
					
						
							| 
									
										
										
										
											2024-10-03 17:54:54 +08:00
										 |  |  |         'getLibraryElementByUid', | 
					
						
							| 
									
										
										
										
											2025-04-08 23:46:25 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |         'getResourceDependencies', | 
					
						
							| 
									
										
										
										
											2024-04-02 23:01:33 +08:00
										 |  |  |       ], | 
					
						
							|  |  |  |     }, | 
					
						
							| 
									
										
										
										
											2024-07-05 21:01:10 +08:00
										 |  |  |     '../public/app/features/preferences/api/user/endpoints.gen.ts': { | 
					
						
							| 
									
										
										
										
											2025-02-03 23:26:23 +08:00
										 |  |  |       schemaFile: '../public/openapi3.json', | 
					
						
							|  |  |  |       hooks: true, | 
					
						
							| 
									
										
										
										
											2024-07-05 21:01:10 +08:00
										 |  |  |       apiFile: '../public/app/features/preferences/api/user/baseAPI.ts', | 
					
						
							|  |  |  |       apiImport: 'baseAPI', | 
					
						
							|  |  |  |       filterEndpoints: ['getUserPreferences', 'updateUserPreferences', 'patchUserPreferences'], | 
					
						
							|  |  |  |     }, | 
					
						
							| 
									
										
										
										
											2025-06-13 18:24:37 +08:00
										 |  |  |     '../public/app/api/clients/iam/v0alpha1/endpoints.gen.ts': { | 
					
						
							| 
									
										
										
										
											2025-02-03 23:26:23 +08:00
										 |  |  |       schemaFile: '../data/openapi/iam.grafana.app-v0alpha1.json', | 
					
						
							| 
									
										
										
										
											2025-06-13 18:24:37 +08:00
										 |  |  |       apiFile: '../public/app/api/clients/iam/v0alpha1/baseAPI.ts', | 
					
						
							| 
									
										
										
										
											2025-02-03 23:26:23 +08:00
										 |  |  |       filterEndpoints: ['getDisplayMapping'], | 
					
						
							|  |  |  |       tag: true, | 
					
						
							|  |  |  |     }, | 
					
						
							| 
									
										
										
										
											2025-06-13 18:24:37 +08:00
										 |  |  |     '../public/app/api/clients/provisioning/v0alpha1/endpoints.gen.ts': { | 
					
						
							|  |  |  |       apiFile: '../public/app/api/clients/provisioning/v0alpha1/baseAPI.ts', | 
					
						
							| 
									
										
										
										
											2025-03-07 15:57:13 +08:00
										 |  |  |       schemaFile: '../data/openapi/provisioning.grafana.app-v0alpha1.json', | 
					
						
							|  |  |  |       filterEndpoints, | 
					
						
							|  |  |  |       tag: true, | 
					
						
							|  |  |  |       hooks: true, | 
					
						
							|  |  |  |     }, | 
					
						
							| 
									
										
										
										
											2025-06-13 18:24:37 +08:00
										 |  |  |     '../public/app/api/clients/folder/v1beta1/endpoints.gen.ts': { | 
					
						
							|  |  |  |       apiFile: '../public/app/api/clients/folder/v1beta1/baseAPI.ts', | 
					
						
							| 
									
										
										
										
											2025-04-15 04:20:10 +08:00
										 |  |  |       schemaFile: '../data/openapi/folder.grafana.app-v1beta1.json', | 
					
						
							| 
									
										
										
										
											2025-03-10 19:19:14 +08:00
										 |  |  |       tag: true, | 
					
						
							|  |  |  |     }, | 
					
						
							| 
									
										
										
										
											2025-06-13 18:24:37 +08:00
										 |  |  |     '../public/app/api/clients/advisor/v0alpha1/endpoints.gen.ts': { | 
					
						
							|  |  |  |       apiFile: '../public/app/api/clients/advisor/v0alpha1/baseAPI.ts', | 
					
						
							| 
									
										
										
										
											2025-04-08 22:38:19 +08:00
										 |  |  |       schemaFile: '../data/openapi/advisor.grafana.app-v0alpha1.json', | 
					
						
							| 
									
										
										
										
											2025-05-15 22:58:45 +08:00
										 |  |  |       filterEndpoints: [ | 
					
						
							|  |  |  |         'createCheck', | 
					
						
							|  |  |  |         'getCheck', | 
					
						
							|  |  |  |         'listCheck', | 
					
						
							|  |  |  |         'deleteCheck', | 
					
						
							|  |  |  |         'updateCheck', | 
					
						
							|  |  |  |         'listCheckType', | 
					
						
							|  |  |  |         'updateCheckType', | 
					
						
							|  |  |  |       ], | 
					
						
							| 
									
										
										
										
											2025-04-08 22:38:19 +08:00
										 |  |  |       tag: true, | 
					
						
							|  |  |  |     }, | 
					
						
							| 
									
										
										
										
											2025-06-13 18:24:37 +08:00
										 |  |  |     '../public/app/api/clients/playlist/v0alpha1/endpoints.gen.ts': { | 
					
						
							|  |  |  |       apiFile: '../public/app/api/clients/playlist/v0alpha1/baseAPI.ts', | 
					
						
							| 
									
										
										
										
											2025-04-16 20:27:52 +08:00
										 |  |  |       schemaFile: '../data/openapi/playlist.grafana.app-v0alpha1.json', | 
					
						
							|  |  |  |       filterEndpoints: ['listPlaylist', 'getPlaylist', 'createPlaylist', 'deletePlaylist', 'replacePlaylist'], | 
					
						
							|  |  |  |       tag: true, | 
					
						
							|  |  |  |     }, | 
					
						
							| 
									
										
										
										
											2025-04-25 14:42:37 +08:00
										 |  |  |     // PLOP_INJECT_API_CLIENT - Used by the API client generator
 | 
					
						
							| 
									
										
										
										
											2024-04-02 23:01:33 +08:00
										 |  |  |   }, | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-03-07 15:57:13 +08:00
										 |  |  | function filterEndpoints(name: string) { | 
					
						
							|  |  |  |   return !name.toLowerCase().includes('getapiresources') && !name.toLowerCase().includes('update'); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-04-02 23:01:33 +08:00
										 |  |  | export default config; |