Export group and version from api clients
CodeQL checks / Detect whether code changed (push) Waiting to run Details
CodeQL checks / Analyze (actions) (push) Blocked by required conditions Details
CodeQL checks / Analyze (go) (push) Blocked by required conditions Details
CodeQL checks / Analyze (javascript) (push) Blocked by required conditions Details

This commit is contained in:
Tom Ratcliffe 2025-10-02 20:35:39 +01:00
parent 03251b31a3
commit 2872bc1514
18 changed files with 39 additions and 19 deletions

View File

@ -3,7 +3,9 @@ import { createApi } from '@reduxjs/toolkit/query/react';
import { createBaseQuery } from '../../../utils/createBaseQuery'; import { createBaseQuery } from '../../../utils/createBaseQuery';
import { getAPIBaseURL } from '../../../utils/utils'; import { getAPIBaseURL } from '../../../utils/utils';
export const BASE_URL = getAPIBaseURL('dashboard.grafana.app', 'v0alpha1'); export const API_GROUP = 'dashboard.grafana.app' as const;
export const API_VERSION = 'v0alpha1' as const;
export const BASE_URL = getAPIBaseURL(API_GROUP, API_VERSION);
export const api = createApi({ export const api = createApi({
reducerPath: 'dashboardAPIv0alpha1', reducerPath: 'dashboardAPIv0alpha1',

View File

@ -1,4 +1,4 @@
export { BASE_URL } from './baseAPI'; export { BASE_URL, API_GROUP, API_VERSION } from './baseAPI';
import { generatedAPI as rawAPI } from './endpoints.gen'; import { generatedAPI as rawAPI } from './endpoints.gen';
export * from './endpoints.gen'; export * from './endpoints.gen';

View File

@ -3,7 +3,9 @@ import { createApi } from '@reduxjs/toolkit/query/react';
import { createBaseQuery } from '../../../utils/createBaseQuery'; import { createBaseQuery } from '../../../utils/createBaseQuery';
import { getAPIBaseURL } from '../../../utils/utils'; import { getAPIBaseURL } from '../../../utils/utils';
export const BASE_URL = getAPIBaseURL('folder.grafana.app', 'v1beta1'); export const API_GROUP = 'folder.grafana.app' as const;
export const API_VERSION = 'v1beta1' as const;
export const BASE_URL = getAPIBaseURL(API_GROUP, API_VERSION);
export const api = createApi({ export const api = createApi({
reducerPath: 'folderAPIv1beta1', reducerPath: 'folderAPIv1beta1',

View File

@ -1,4 +1,4 @@
export { BASE_URL } from './baseAPI'; export { BASE_URL, API_GROUP, API_VERSION } from './baseAPI';
import { generatedAPI as rawAPI } from './endpoints.gen'; import { generatedAPI as rawAPI } from './endpoints.gen';
export * from './endpoints.gen'; export * from './endpoints.gen';

View File

@ -3,10 +3,14 @@ import { createApi } from '@reduxjs/toolkit/query/react';
import { createBaseQuery } from '../../../utils/createBaseQuery'; import { createBaseQuery } from '../../../utils/createBaseQuery';
import { getAPIBaseURL } from '../../../utils/utils'; import { getAPIBaseURL } from '../../../utils/utils';
export const BASE_URL = getAPIBaseURL('iam.grafana.app', 'v0alpha1'); export const API_GROUP = 'iam.grafana.app' as const;
export const API_VERSION = 'v0alpha1' as const;
export const BASE_URL = getAPIBaseURL(API_GROUP, API_VERSION);
export const api = createApi({ export const api = createApi({
baseQuery: createBaseQuery({ baseURL: BASE_URL }),
reducerPath: 'iamAPIv0alpha1', reducerPath: 'iamAPIv0alpha1',
baseQuery: createBaseQuery({
baseURL: BASE_URL,
}),
endpoints: () => ({}), endpoints: () => ({}),
}); });

View File

@ -1,4 +1,4 @@
export { BASE_URL } from './baseAPI'; export { BASE_URL, API_GROUP, API_VERSION } from './baseAPI';
import { generatedAPI as rawAPI } from './endpoints.gen'; import { generatedAPI as rawAPI } from './endpoints.gen';
export * from './endpoints.gen'; export * from './endpoints.gen';

View File

@ -3,7 +3,9 @@ import { createApi } from '@reduxjs/toolkit/query/react';
import { createBaseQuery } from '../../../utils/createBaseQuery'; import { createBaseQuery } from '../../../utils/createBaseQuery';
import { getAPIBaseURL } from '../../../utils/utils'; import { getAPIBaseURL } from '../../../utils/utils';
export const BASE_URL = getAPIBaseURL('playlist.grafana.app', 'v0alpha1'); export const API_GROUP = 'playlist.grafana.app' as const;
export const API_VERSION = 'v0alpha1' as const;
export const BASE_URL = getAPIBaseURL(API_GROUP, API_VERSION);
export const api = createApi({ export const api = createApi({
reducerPath: 'playlistAPIv0alpha1', reducerPath: 'playlistAPIv0alpha1',

View File

@ -1,4 +1,4 @@
export { BASE_URL } from './baseAPI'; export { BASE_URL, API_GROUP, API_VERSION } from './baseAPI';
import { generatedAPI as rawAPI } from './endpoints.gen'; import { generatedAPI as rawAPI } from './endpoints.gen';
export * from './endpoints.gen'; export * from './endpoints.gen';

View File

@ -3,7 +3,9 @@ import { createApi } from '@reduxjs/toolkit/query/react';
import { createBaseQuery } from '../../../utils/createBaseQuery'; import { createBaseQuery } from '../../../utils/createBaseQuery';
import { getAPIBaseURL } from '../../../utils/utils'; import { getAPIBaseURL } from '../../../utils/utils';
export const BASE_URL = getAPIBaseURL('preferences.grafana.app', 'v1alpha1'); export const API_GROUP = 'preferences.grafana.app' as const;
export const API_VERSION = 'v1alpha1' as const;
export const BASE_URL = getAPIBaseURL(API_GROUP, API_VERSION);
export const api = createApi({ export const api = createApi({
reducerPath: 'preferencesAPIv1alpha1', reducerPath: 'preferencesAPIv1alpha1',

View File

@ -1,4 +1,4 @@
export { BASE_URL } from './baseAPI'; export { BASE_URL, API_GROUP, API_VERSION } from './baseAPI';
import { generatedAPI as rawAPI } from './endpoints.gen'; import { generatedAPI as rawAPI } from './endpoints.gen';
export * from './endpoints.gen'; export * from './endpoints.gen';

View File

@ -3,7 +3,9 @@ import { createApi } from '@reduxjs/toolkit/query/react';
import { createBaseQuery } from '../../../utils/createBaseQuery'; import { createBaseQuery } from '../../../utils/createBaseQuery';
import { getAPIBaseURL } from '../../../utils/utils'; import { getAPIBaseURL } from '../../../utils/utils';
export const BASE_URL = getAPIBaseURL('provisioning.grafana.app', 'v0alpha1'); export const API_GROUP = 'provisioning.grafana.app' as const;
export const API_VERSION = 'v0alpha1' as const;
export const BASE_URL = getAPIBaseURL(API_GROUP, API_VERSION);
export const api = createApi({ export const api = createApi({
reducerPath: 'provisioningAPIv0alpha1', reducerPath: 'provisioningAPIv0alpha1',

View File

@ -1,4 +1,4 @@
export { BASE_URL } from './baseAPI'; export { BASE_URL, API_GROUP, API_VERSION } from './baseAPI';
import { generatedAPI as rawAPI } from './endpoints.gen'; import { generatedAPI as rawAPI } from './endpoints.gen';
export * from './endpoints.gen'; export * from './endpoints.gen';

View File

@ -3,7 +3,9 @@ import { createApi } from '@reduxjs/toolkit/query/react';
import { createBaseQuery } from '../../../utils/createBaseQuery'; import { createBaseQuery } from '../../../utils/createBaseQuery';
import { getAPIBaseURL } from '../../../utils/utils'; import { getAPIBaseURL } from '../../../utils/utils';
export const BASE_URL = getAPIBaseURL('rules.alerting.grafana.app', 'v0alpha1'); export const API_GROUP = 'rules.alerting.grafana.app' as const;
export const API_VERSION = 'v0alpha1' as const;
export const BASE_URL = getAPIBaseURL(API_GROUP, API_VERSION);
export const api = createApi({ export const api = createApi({
reducerPath: 'rulesAPIv0alpha1', reducerPath: 'rulesAPIv0alpha1',

View File

@ -1,4 +1,4 @@
export { BASE_URL } from './baseAPI'; export { BASE_URL, API_GROUP, API_VERSION } from './baseAPI';
import { generatedAPI as rawAPI } from './endpoints.gen'; import { generatedAPI as rawAPI } from './endpoints.gen';
export * from './endpoints.gen'; export * from './endpoints.gen';

View File

@ -3,7 +3,9 @@ import { createApi } from '@reduxjs/toolkit/query/react';
import { createBaseQuery } from '../../../utils/createBaseQuery'; import { createBaseQuery } from '../../../utils/createBaseQuery';
import { getAPIBaseURL } from '../../../utils/utils'; import { getAPIBaseURL } from '../../../utils/utils';
export const BASE_URL = getAPIBaseURL('shorturl.grafana.app', 'v1alpha1'); export const API_GROUP = 'shorturl.grafana.app' as const;
export const API_VERSION = 'v1alpha1' as const;
export const BASE_URL = getAPIBaseURL(API_GROUP, API_VERSION);
export const api = createApi({ export const api = createApi({
reducerPath: 'shortURLAPIv1alpha1', reducerPath: 'shortURLAPIv1alpha1',

View File

@ -1,4 +1,4 @@
export { BASE_URL } from './baseAPI'; export { BASE_URL, API_GROUP, API_VERSION } from './baseAPI';
import { generatedAPI as rawAPI } from './endpoints.gen'; import { generatedAPI as rawAPI } from './endpoints.gen';
export * from './endpoints.gen'; export * from './endpoints.gen';

View File

@ -3,7 +3,9 @@ import { createApi } from '@reduxjs/toolkit/query/react';
import { createBaseQuery } from '../../../utils/createBaseQuery'; import { createBaseQuery } from '../../../utils/createBaseQuery';
import { getAPIBaseURL } from '../../../utils/utils'; import { getAPIBaseURL } from '../../../utils/utils';
export const BASE_URL = getAPIBaseURL('{{group}}', '{{version}}'); export const API_GROUP = '{{group}}' as const;
export const API_VERSION = '{{version}}' as const;
export const BASE_URL = getAPIBaseURL(API_GROUP, API_VERSION);
export const api = createApi({ export const api = createApi({
reducerPath: '{{reducerPath}}', reducerPath: '{{reducerPath}}',

View File

@ -1,4 +1,4 @@
export { BASE_URL } from './baseAPI'; export { BASE_URL, API_GROUP, API_VERSION } from './baseAPI';
import { generatedAPI as rawAPI } from './endpoints.gen'; import { generatedAPI as rawAPI } from './endpoints.gen';
export * from './endpoints.gen'; export * from './endpoints.gen';