mirror of https://github.com/grafana/grafana
API: Support versioned frontend clients (#106545)
* Update the generator to include version * Add versioned APIs * Update imports * Prettierpull/106403/head^2
parent
3e3fa18118
commit
6a11d462cb
@ -1,8 +1,8 @@ |
||||
import { generatedAPI } from './endpoints.gen'; |
||||
|
||||
export const folderAPI = generatedAPI.enhanceEndpoints({}); |
||||
export const folderAPIv1beta1 = generatedAPI.enhanceEndpoints({}); |
||||
|
||||
export const { useGetFolderQuery } = folderAPI; |
||||
export const { useGetFolderQuery } = folderAPIv1beta1; |
||||
|
||||
// eslint-disable-next-line no-barrel-files/no-barrel-files
|
||||
export { type Folder } from './endpoints.gen'; |
||||
@ -1,12 +1,12 @@ |
||||
import { createApi } from '@reduxjs/toolkit/query/react'; |
||||
|
||||
import { createBaseQuery } from '../../createBaseQuery'; |
||||
import { getAPIBaseURL } from '../../utils'; |
||||
import { createBaseQuery } from 'app/api/createBaseQuery'; |
||||
import { getAPIBaseURL } from 'app/api/utils'; |
||||
|
||||
export const BASE_URL = getAPIBaseURL('iam.grafana.app', 'v0alpha1'); |
||||
|
||||
export const api = createApi({ |
||||
baseQuery: createBaseQuery({ baseURL: BASE_URL }), |
||||
reducerPath: 'iamAPI', |
||||
reducerPath: 'iamAPIv0alpha1', |
||||
endpoints: () => ({}), |
||||
}); |
||||
@ -1,5 +1,5 @@ |
||||
import { generatedAPI } from './endpoints.gen'; |
||||
|
||||
export const iamAPI = generatedAPI.enhanceEndpoints({}); |
||||
export const iamAPIv0alpha1 = generatedAPI.enhanceEndpoints({}); |
||||
|
||||
export const { useGetDisplayMappingQuery } = generatedAPI; |
||||
@ -1,12 +1,13 @@ |
||||
import { t } from '@grafana/i18n'; |
||||
import { isFetchError } from '@grafana/runtime'; |
||||
import { notifyApp } from 'app/core/actions'; |
||||
import { createSuccessNotification, createErrorNotification } from 'app/core/copy/appNotification'; |
||||
|
||||
import { notifyApp } from '../../../../core/actions'; |
||||
import { createSuccessNotification, createErrorNotification } from '../../../../core/copy/appNotification'; |
||||
import { createOnCacheEntryAdded } from '../utils/createOnCacheEntryAdded'; |
||||
|
||||
import { generatedAPI, JobSpec, JobStatus, RepositorySpec, RepositoryStatus, ErrorDetails } from './endpoints.gen'; |
||||
import { createOnCacheEntryAdded } from './utils/createOnCacheEntryAdded'; |
||||
|
||||
export const provisioningAPI = generatedAPI.enhanceEndpoints({ |
||||
export const provisioningAPIv0alpha1 = generatedAPI.enhanceEndpoints({ |
||||
endpoints: { |
||||
listJob: { |
||||
// Do not include 'watch' in the first query, so we can get the initial list of jobs
|
||||
Loading…
Reference in new issue