From 53b4112abe567a0e16f14e37b319d38e125eab9c Mon Sep 17 00:00:00 2001 From: Gilles De Mey Date: Thu, 8 May 2025 16:17:28 +0200 Subject: [PATCH] Alerting: Add versioning to the API client (#104944) --- packages/grafana-alerting/package.json | 4 +- packages/grafana-alerting/scripts/README.md | 4 + packages/grafana-alerting/scripts/codegen.ts | 52 +- packages/grafana-alerting/src/grafana/api.ts | 11 - .../src/grafana/api/README.md | 6 + .../grafana-alerting/src/grafana/api/util.ts | 13 + .../src/grafana/{ => api/v0alpha1}/api.gen.ts | 528 ++++++------------ .../src/grafana/api/v0alpha1/api.ts | 17 + .../{contactPoints => api/v0alpha1}/types.ts | 12 +- .../components/ContactPointSelector.tsx | 8 +- .../contactPoints/hooks/useContactPoints.tsx | 16 +- .../src/grafana/contactPoints/utils.ts | 2 +- packages/grafana-alerting/src/internal.ts | 2 - packages/grafana-alerting/src/unstable.ts | 7 +- yarn.lock | 10 +- 15 files changed, 284 insertions(+), 408 deletions(-) create mode 100644 packages/grafana-alerting/scripts/README.md delete mode 100644 packages/grafana-alerting/src/grafana/api.ts create mode 100644 packages/grafana-alerting/src/grafana/api/README.md create mode 100644 packages/grafana-alerting/src/grafana/api/util.ts rename packages/grafana-alerting/src/grafana/{ => api/v0alpha1}/api.gen.ts (84%) create mode 100644 packages/grafana-alerting/src/grafana/api/v0alpha1/api.ts rename packages/grafana-alerting/src/grafana/{contactPoints => api/v0alpha1}/types.ts (82%) diff --git a/packages/grafana-alerting/package.json b/packages/grafana-alerting/package.json index b52ef4b1139..1b454a3277b 100644 --- a/packages/grafana-alerting/package.json +++ b/packages/grafana-alerting/package.json @@ -37,7 +37,7 @@ }, "scripts": { "typecheck": "tsc --emitDeclarationOnly false --noEmit", - "codegen": "yarn run rtk-query-codegen-openapi ./scripts/codegen.ts" + "codegen": "rtk-query-codegen-openapi ./scripts/codegen.ts" }, "devDependencies": { "@grafana/tsconfig": "^2.0.0", @@ -57,7 +57,7 @@ "react-dom": "^18.0.0" }, "dependencies": { - "@reduxjs/toolkit": "^2.7.0", + "@reduxjs/toolkit": "^2.8.0", "lodash": "^4.17.21" } } diff --git a/packages/grafana-alerting/scripts/README.md b/packages/grafana-alerting/scripts/README.md new file mode 100644 index 00000000000..c27d22246a8 --- /dev/null +++ b/packages/grafana-alerting/scripts/README.md @@ -0,0 +1,4 @@ +These files are built using the `yarn run codegen` command. +API clients will be written to `src/grafana/api//api.gen.ts`. + +Make sure to create a versioned API client for each API version – see `src/grafana/api/v0alpha1/api.ts` as an example. diff --git a/packages/grafana-alerting/scripts/codegen.ts b/packages/grafana-alerting/scripts/codegen.ts index 1af5010092f..4eec25b2564 100644 --- a/packages/grafana-alerting/scripts/codegen.ts +++ b/packages/grafana-alerting/scripts/codegen.ts @@ -1,21 +1,47 @@ /** - * This script will generate TypeScript type definitions and a RTKQ client for the alerting k8s APIs. - * It downloads the OpenAPI schema from a running Grafana instance and generates the types. + * This script will generate TypeScript type definitions and a RTKQ clients for the alerting k8s APIs. * * Run `yarn run codegen` from the "grafana-alerting" package to invoke this script. + * + * API clients will be placed in "src/grafana/api//api.gen.ts" */ -import { type ConfigFile } from '@rtk-query/codegen-openapi'; -import { resolve } from 'node:path'; +import type { ConfigFile } from '@rtk-query/codegen-openapi'; -// these snapshots are generated by running "go test pkg/tests/apis/openapi_test.go", see the README in the "openapi_snapshots" directory -const OPENAPI_SCHEMA_LOCATION = resolve( - '../../../pkg/tests/apis/openapi_snapshots/notifications.alerting.grafana.app-v0alpha1.json' -); +// ℹ️ append versions here to generate additional API clients +const VERSIONS = ['v0alpha1'] as const; + +type OutputFile = Omit; +type OutputFiles = Record; + +const outputFiles = VERSIONS.reduce((acc, version) => { + // we append the version here so we export versioned API clients from this package without having to re-export with an alias + const exportName = 'alertingAPI'; + + // ℹ️ these snapshots are generated by running "go test pkg/tests/apis/openapi_test.go" and "scripts/process-specs.ts", + // see the README in the "openapi_snapshots" directory + const schemaFile = `../../../data/openapi/notifications.alerting.grafana.app-${version}.json`; + + // ℹ️ make sure there is a API file in each versioned directory + const apiFile = `../src/grafana/api/${version}/api.ts`; + + // output each api client into a versioned directory + const outputPath = `../src/grafana/api/${version}/api.gen.ts`; + + acc[outputPath] = { + exportName, + schemaFile, + apiFile, + tag: true, // generate tags for cache invalidation + } satisfies OutputFile; + + return acc; +}, {}); export default { - exportName: 'alertingAPI', - schemaFile: OPENAPI_SCHEMA_LOCATION, - apiFile: '../src/grafana/api.ts', - outputFile: resolve('../src/grafana/api.gen.ts'), - tag: true, + // these are intentionally empty but will be set for each versioned config file + exportName: '', + schemaFile: '', + apiFile: '', + + outputFiles, } satisfies ConfigFile; diff --git a/packages/grafana-alerting/src/grafana/api.ts b/packages/grafana-alerting/src/grafana/api.ts deleted file mode 100644 index 813a3623b2b..00000000000 --- a/packages/grafana-alerting/src/grafana/api.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react'; - -const BASE_URL = '/'; - -export const api = createApi({ - reducerPath: 'grafanaAlertingAPI', - baseQuery: fetchBaseQuery({ - baseUrl: BASE_URL, - }), - endpoints: () => ({}), -}); diff --git a/packages/grafana-alerting/src/grafana/api/README.md b/packages/grafana-alerting/src/grafana/api/README.md new file mode 100644 index 00000000000..403634e29ee --- /dev/null +++ b/packages/grafana-alerting/src/grafana/api/README.md @@ -0,0 +1,6 @@ +# Versioned Alerting API clients + +1. create a new folder for your new API version +2. create a `api.ts` file in the new folder, see existing ones +3. run `yarn codegen` to generate the `api.get.ts` file, which is your new RTKQ client +4. (optional) create a `types.ts` file in the new folder, see existing ones to enhance the types that are auto-generated. diff --git a/packages/grafana-alerting/src/grafana/api/util.ts b/packages/grafana-alerting/src/grafana/api/util.ts new file mode 100644 index 00000000000..fa9a623d592 --- /dev/null +++ b/packages/grafana-alerting/src/grafana/api/util.ts @@ -0,0 +1,13 @@ +/** + * @TODO move this to some shared package, currently copied from Grafana core (app/api/utils) + */ + +import { config } from '@grafana/runtime'; + +export const getAPINamespace = () => config.namespace; + +export const getAPIBaseURL = (group: string, version: string) => + `/apis/${group}/${version}/namespaces/${getAPINamespace()}` as const; + +// By including the version in the reducer path we can prevent cache bugs when different versions of the API are used for the same entities +export const getAPIReducerPath = (group: string, version: string) => `${group}/${version}` as const; diff --git a/packages/grafana-alerting/src/grafana/api.gen.ts b/packages/grafana-alerting/src/grafana/api/v0alpha1/api.gen.ts similarity index 84% rename from packages/grafana-alerting/src/grafana/api.gen.ts rename to packages/grafana-alerting/src/grafana/api/v0alpha1/api.gen.ts index dd6ebf30830..b1370c9b7fb 100644 --- a/packages/grafana-alerting/src/grafana/api.gen.ts +++ b/packages/grafana-alerting/src/grafana/api/v0alpha1/api.gen.ts @@ -12,7 +12,7 @@ const injectedRtkApi = api }), listReceiver: build.query({ query: (queryArg) => ({ - url: `/apis/notifications.alerting.grafana.app/v0alpha1/namespaces/${queryArg['namespace']}/receivers`, + url: `/receivers`, params: { pretty: queryArg.pretty, allowWatchBookmarks: queryArg.allowWatchBookmarks, @@ -31,9 +31,9 @@ const injectedRtkApi = api }), createReceiver: build.mutation({ query: (queryArg) => ({ - url: `/apis/notifications.alerting.grafana.app/v0alpha1/namespaces/${queryArg['namespace']}/receivers`, + url: `/receivers`, method: 'POST', - body: queryArg.comGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisReceiverV0Alpha1Receiver, + body: queryArg.receiver, params: { pretty: queryArg.pretty, dryRun: queryArg.dryRun, @@ -45,7 +45,7 @@ const injectedRtkApi = api }), deletecollectionReceiver: build.mutation({ query: (queryArg) => ({ - url: `/apis/notifications.alerting.grafana.app/v0alpha1/namespaces/${queryArg['namespace']}/receivers`, + url: `/receivers`, method: 'DELETE', params: { pretty: queryArg.pretty, @@ -68,7 +68,7 @@ const injectedRtkApi = api }), getReceiver: build.query({ query: (queryArg) => ({ - url: `/apis/notifications.alerting.grafana.app/v0alpha1/namespaces/${queryArg['namespace']}/receivers/${queryArg.name}`, + url: `/receivers/${queryArg.name}`, params: { pretty: queryArg.pretty, }, @@ -77,9 +77,9 @@ const injectedRtkApi = api }), replaceReceiver: build.mutation({ query: (queryArg) => ({ - url: `/apis/notifications.alerting.grafana.app/v0alpha1/namespaces/${queryArg['namespace']}/receivers/${queryArg.name}`, + url: `/receivers/${queryArg.name}`, method: 'PUT', - body: queryArg.comGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisReceiverV0Alpha1Receiver, + body: queryArg.receiver, params: { pretty: queryArg.pretty, dryRun: queryArg.dryRun, @@ -91,7 +91,7 @@ const injectedRtkApi = api }), deleteReceiver: build.mutation({ query: (queryArg) => ({ - url: `/apis/notifications.alerting.grafana.app/v0alpha1/namespaces/${queryArg['namespace']}/receivers/${queryArg.name}`, + url: `/receivers/${queryArg.name}`, method: 'DELETE', params: { pretty: queryArg.pretty, @@ -106,9 +106,9 @@ const injectedRtkApi = api }), updateReceiver: build.mutation({ query: (queryArg) => ({ - url: `/apis/notifications.alerting.grafana.app/v0alpha1/namespaces/${queryArg['namespace']}/receivers/${queryArg.name}`, + url: `/receivers/${queryArg.name}`, method: 'PATCH', - body: queryArg.ioK8SApimachineryPkgApisMetaV1Patch, + body: queryArg.patch, params: { pretty: queryArg.pretty, dryRun: queryArg.dryRun, @@ -121,7 +121,7 @@ const injectedRtkApi = api }), listRoutingTree: build.query({ query: (queryArg) => ({ - url: `/apis/notifications.alerting.grafana.app/v0alpha1/namespaces/${queryArg['namespace']}/routingtrees`, + url: `/routingtrees`, params: { pretty: queryArg.pretty, allowWatchBookmarks: queryArg.allowWatchBookmarks, @@ -140,9 +140,9 @@ const injectedRtkApi = api }), createRoutingTree: build.mutation({ query: (queryArg) => ({ - url: `/apis/notifications.alerting.grafana.app/v0alpha1/namespaces/${queryArg['namespace']}/routingtrees`, + url: `/routingtrees`, method: 'POST', - body: queryArg.comGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisRoutingtreeV0Alpha1RoutingTree, + body: queryArg.routingTree, params: { pretty: queryArg.pretty, dryRun: queryArg.dryRun, @@ -157,7 +157,7 @@ const injectedRtkApi = api DeletecollectionRoutingTreeApiArg >({ query: (queryArg) => ({ - url: `/apis/notifications.alerting.grafana.app/v0alpha1/namespaces/${queryArg['namespace']}/routingtrees`, + url: `/routingtrees`, method: 'DELETE', params: { pretty: queryArg.pretty, @@ -180,7 +180,7 @@ const injectedRtkApi = api }), getRoutingTree: build.query({ query: (queryArg) => ({ - url: `/apis/notifications.alerting.grafana.app/v0alpha1/namespaces/${queryArg['namespace']}/routingtrees/${queryArg.name}`, + url: `/routingtrees/${queryArg.name}`, params: { pretty: queryArg.pretty, }, @@ -189,9 +189,9 @@ const injectedRtkApi = api }), replaceRoutingTree: build.mutation({ query: (queryArg) => ({ - url: `/apis/notifications.alerting.grafana.app/v0alpha1/namespaces/${queryArg['namespace']}/routingtrees/${queryArg.name}`, + url: `/routingtrees/${queryArg.name}`, method: 'PUT', - body: queryArg.comGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisRoutingtreeV0Alpha1RoutingTree, + body: queryArg.routingTree, params: { pretty: queryArg.pretty, dryRun: queryArg.dryRun, @@ -203,7 +203,7 @@ const injectedRtkApi = api }), deleteRoutingTree: build.mutation({ query: (queryArg) => ({ - url: `/apis/notifications.alerting.grafana.app/v0alpha1/namespaces/${queryArg['namespace']}/routingtrees/${queryArg.name}`, + url: `/routingtrees/${queryArg.name}`, method: 'DELETE', params: { pretty: queryArg.pretty, @@ -218,9 +218,9 @@ const injectedRtkApi = api }), updateRoutingTree: build.mutation({ query: (queryArg) => ({ - url: `/apis/notifications.alerting.grafana.app/v0alpha1/namespaces/${queryArg['namespace']}/routingtrees/${queryArg.name}`, + url: `/routingtrees/${queryArg.name}`, method: 'PATCH', - body: queryArg.ioK8SApimachineryPkgApisMetaV1Patch, + body: queryArg.patch, params: { pretty: queryArg.pretty, dryRun: queryArg.dryRun, @@ -233,7 +233,7 @@ const injectedRtkApi = api }), listTemplateGroup: build.query({ query: (queryArg) => ({ - url: `/apis/notifications.alerting.grafana.app/v0alpha1/namespaces/${queryArg['namespace']}/templategroups`, + url: `/templategroups`, params: { pretty: queryArg.pretty, allowWatchBookmarks: queryArg.allowWatchBookmarks, @@ -252,9 +252,9 @@ const injectedRtkApi = api }), createTemplateGroup: build.mutation({ query: (queryArg) => ({ - url: `/apis/notifications.alerting.grafana.app/v0alpha1/namespaces/${queryArg['namespace']}/templategroups`, + url: `/templategroups`, method: 'POST', - body: queryArg.comGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTemplategroupV0Alpha1TemplateGroup, + body: queryArg.templateGroup, params: { pretty: queryArg.pretty, dryRun: queryArg.dryRun, @@ -269,7 +269,7 @@ const injectedRtkApi = api DeletecollectionTemplateGroupApiArg >({ query: (queryArg) => ({ - url: `/apis/notifications.alerting.grafana.app/v0alpha1/namespaces/${queryArg['namespace']}/templategroups`, + url: `/templategroups`, method: 'DELETE', params: { pretty: queryArg.pretty, @@ -292,7 +292,7 @@ const injectedRtkApi = api }), getTemplateGroup: build.query({ query: (queryArg) => ({ - url: `/apis/notifications.alerting.grafana.app/v0alpha1/namespaces/${queryArg['namespace']}/templategroups/${queryArg.name}`, + url: `/templategroups/${queryArg.name}`, params: { pretty: queryArg.pretty, }, @@ -301,9 +301,9 @@ const injectedRtkApi = api }), replaceTemplateGroup: build.mutation({ query: (queryArg) => ({ - url: `/apis/notifications.alerting.grafana.app/v0alpha1/namespaces/${queryArg['namespace']}/templategroups/${queryArg.name}`, + url: `/templategroups/${queryArg.name}`, method: 'PUT', - body: queryArg.comGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTemplategroupV0Alpha1TemplateGroup, + body: queryArg.templateGroup, params: { pretty: queryArg.pretty, dryRun: queryArg.dryRun, @@ -315,7 +315,7 @@ const injectedRtkApi = api }), deleteTemplateGroup: build.mutation({ query: (queryArg) => ({ - url: `/apis/notifications.alerting.grafana.app/v0alpha1/namespaces/${queryArg['namespace']}/templategroups/${queryArg.name}`, + url: `/templategroups/${queryArg.name}`, method: 'DELETE', params: { pretty: queryArg.pretty, @@ -330,9 +330,9 @@ const injectedRtkApi = api }), updateTemplateGroup: build.mutation({ query: (queryArg) => ({ - url: `/apis/notifications.alerting.grafana.app/v0alpha1/namespaces/${queryArg['namespace']}/templategroups/${queryArg.name}`, + url: `/templategroups/${queryArg.name}`, method: 'PATCH', - body: queryArg.ioK8SApimachineryPkgApisMetaV1Patch, + body: queryArg.patch, params: { pretty: queryArg.pretty, dryRun: queryArg.dryRun, @@ -345,7 +345,7 @@ const injectedRtkApi = api }), listTimeInterval: build.query({ query: (queryArg) => ({ - url: `/apis/notifications.alerting.grafana.app/v0alpha1/namespaces/${queryArg['namespace']}/timeintervals`, + url: `/timeintervals`, params: { pretty: queryArg.pretty, allowWatchBookmarks: queryArg.allowWatchBookmarks, @@ -364,9 +364,9 @@ const injectedRtkApi = api }), createTimeInterval: build.mutation({ query: (queryArg) => ({ - url: `/apis/notifications.alerting.grafana.app/v0alpha1/namespaces/${queryArg['namespace']}/timeintervals`, + url: `/timeintervals`, method: 'POST', - body: queryArg.comGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTimeintervalV0Alpha1TimeInterval, + body: queryArg.timeInterval, params: { pretty: queryArg.pretty, dryRun: queryArg.dryRun, @@ -381,7 +381,7 @@ const injectedRtkApi = api DeletecollectionTimeIntervalApiArg >({ query: (queryArg) => ({ - url: `/apis/notifications.alerting.grafana.app/v0alpha1/namespaces/${queryArg['namespace']}/timeintervals`, + url: `/timeintervals`, method: 'DELETE', params: { pretty: queryArg.pretty, @@ -404,7 +404,7 @@ const injectedRtkApi = api }), getTimeInterval: build.query({ query: (queryArg) => ({ - url: `/apis/notifications.alerting.grafana.app/v0alpha1/namespaces/${queryArg['namespace']}/timeintervals/${queryArg.name}`, + url: `/timeintervals/${queryArg.name}`, params: { pretty: queryArg.pretty, }, @@ -413,9 +413,9 @@ const injectedRtkApi = api }), replaceTimeInterval: build.mutation({ query: (queryArg) => ({ - url: `/apis/notifications.alerting.grafana.app/v0alpha1/namespaces/${queryArg['namespace']}/timeintervals/${queryArg.name}`, + url: `/timeintervals/${queryArg.name}`, method: 'PUT', - body: queryArg.comGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTimeintervalV0Alpha1TimeInterval, + body: queryArg.timeInterval, params: { pretty: queryArg.pretty, dryRun: queryArg.dryRun, @@ -427,7 +427,7 @@ const injectedRtkApi = api }), deleteTimeInterval: build.mutation({ query: (queryArg) => ({ - url: `/apis/notifications.alerting.grafana.app/v0alpha1/namespaces/${queryArg['namespace']}/timeintervals/${queryArg.name}`, + url: `/timeintervals/${queryArg.name}`, method: 'DELETE', params: { pretty: queryArg.pretty, @@ -442,9 +442,9 @@ const injectedRtkApi = api }), updateTimeInterval: build.mutation({ query: (queryArg) => ({ - url: `/apis/notifications.alerting.grafana.app/v0alpha1/namespaces/${queryArg['namespace']}/timeintervals/${queryArg.name}`, + url: `/timeintervals/${queryArg.name}`, method: 'PATCH', - body: queryArg.ioK8SApimachineryPkgApisMetaV1Patch, + body: queryArg.patch, params: { pretty: queryArg.pretty, dryRun: queryArg.dryRun, @@ -459,13 +459,10 @@ const injectedRtkApi = api overrideExisting: false, }); export { injectedRtkApi as alertingAPI }; -export type GetApiResourcesApiResponse = /** status 200 OK */ IoK8SApimachineryPkgApisMetaV1ApiResourceList; +export type GetApiResourcesApiResponse = /** status 200 OK */ ApiResourceList; export type GetApiResourcesApiArg = void; -export type ListReceiverApiResponse = - /** status 200 OK */ ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisReceiverV0Alpha1ReceiverList; +export type ListReceiverApiResponse = /** status 200 OK */ ReceiverList; export type ListReceiverApiArg = { - /** object name and auth scope, such as for teams and projects */ - namespace: string; /** If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). */ pretty?: string; /** allowWatchBookmarks requests watch events with type "BOOKMARK". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. */ @@ -510,12 +507,10 @@ export type ListReceiverApiArg = { watch?: boolean; }; export type CreateReceiverApiResponse = /** status 200 OK */ - | ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisReceiverV0Alpha1Receiver - | /** status 201 Created */ ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisReceiverV0Alpha1Receiver - | /** status 202 Accepted */ ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisReceiverV0Alpha1Receiver; + | Receiver + | /** status 201 Created */ Receiver + | /** status 202 Accepted */ Receiver; export type CreateReceiverApiArg = { - /** object name and auth scope, such as for teams and projects */ - namespace: string; /** If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). */ pretty?: string; /** When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed */ @@ -524,12 +519,10 @@ export type CreateReceiverApiArg = { fieldManager?: string; /** fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. */ fieldValidation?: string; - comGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisReceiverV0Alpha1Receiver: ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisReceiverV0Alpha1Receiver; + receiver: Receiver; }; -export type DeletecollectionReceiverApiResponse = /** status 200 OK */ IoK8SApimachineryPkgApisMetaV1Status; +export type DeletecollectionReceiverApiResponse = /** status 200 OK */ Status; export type DeletecollectionReceiverApiArg = { - /** object name and auth scope, such as for teams and projects */ - namespace: string; /** If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). */ pretty?: string; /** The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the "next key". @@ -579,24 +572,17 @@ export type DeletecollectionReceiverApiArg = { /** Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. */ timeoutSeconds?: number; }; -export type GetReceiverApiResponse = - /** status 200 OK */ ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisReceiverV0Alpha1Receiver; +export type GetReceiverApiResponse = /** status 200 OK */ Receiver; export type GetReceiverApiArg = { /** name of the Receiver */ name: string; - /** object name and auth scope, such as for teams and projects */ - namespace: string; /** If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). */ pretty?: string; }; -export type ReplaceReceiverApiResponse = /** status 200 OK */ - | ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisReceiverV0Alpha1Receiver - | /** status 201 Created */ ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisReceiverV0Alpha1Receiver; +export type ReplaceReceiverApiResponse = /** status 200 OK */ Receiver | /** status 201 Created */ Receiver; export type ReplaceReceiverApiArg = { /** name of the Receiver */ name: string; - /** object name and auth scope, such as for teams and projects */ - namespace: string; /** If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). */ pretty?: string; /** When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed */ @@ -605,16 +591,12 @@ export type ReplaceReceiverApiArg = { fieldManager?: string; /** fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. */ fieldValidation?: string; - comGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisReceiverV0Alpha1Receiver: ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisReceiverV0Alpha1Receiver; + receiver: Receiver; }; -export type DeleteReceiverApiResponse = /** status 200 OK */ - | IoK8SApimachineryPkgApisMetaV1Status - | /** status 202 Accepted */ IoK8SApimachineryPkgApisMetaV1Status; +export type DeleteReceiverApiResponse = /** status 200 OK */ Status | /** status 202 Accepted */ Status; export type DeleteReceiverApiArg = { /** name of the Receiver */ name: string; - /** object name and auth scope, such as for teams and projects */ - namespace: string; /** If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). */ pretty?: string; /** When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed */ @@ -628,14 +610,10 @@ export type DeleteReceiverApiArg = { /** Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. */ propagationPolicy?: string; }; -export type UpdateReceiverApiResponse = /** status 200 OK */ - | ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisReceiverV0Alpha1Receiver - | /** status 201 Created */ ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisReceiverV0Alpha1Receiver; +export type UpdateReceiverApiResponse = /** status 200 OK */ Receiver | /** status 201 Created */ Receiver; export type UpdateReceiverApiArg = { /** name of the Receiver */ name: string; - /** object name and auth scope, such as for teams and projects */ - namespace: string; /** If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). */ pretty?: string; /** When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed */ @@ -646,13 +624,10 @@ export type UpdateReceiverApiArg = { fieldValidation?: string; /** Force is going to "force" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ force?: boolean; - ioK8SApimachineryPkgApisMetaV1Patch: IoK8SApimachineryPkgApisMetaV1Patch; + patch: Patch; }; -export type ListRoutingTreeApiResponse = - /** status 200 OK */ ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisRoutingtreeV0Alpha1RoutingTreeList; +export type ListRoutingTreeApiResponse = /** status 200 OK */ RoutingTreeList; export type ListRoutingTreeApiArg = { - /** object name and auth scope, such as for teams and projects */ - namespace: string; /** If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). */ pretty?: string; /** allowWatchBookmarks requests watch events with type "BOOKMARK". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. */ @@ -697,12 +672,10 @@ export type ListRoutingTreeApiArg = { watch?: boolean; }; export type CreateRoutingTreeApiResponse = /** status 200 OK */ - | ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisRoutingtreeV0Alpha1RoutingTree - | /** status 201 Created */ ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisRoutingtreeV0Alpha1RoutingTree - | /** status 202 Accepted */ ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisRoutingtreeV0Alpha1RoutingTree; + | RoutingTree + | /** status 201 Created */ RoutingTree + | /** status 202 Accepted */ RoutingTree; export type CreateRoutingTreeApiArg = { - /** object name and auth scope, such as for teams and projects */ - namespace: string; /** If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). */ pretty?: string; /** When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed */ @@ -711,12 +684,10 @@ export type CreateRoutingTreeApiArg = { fieldManager?: string; /** fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. */ fieldValidation?: string; - comGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisRoutingtreeV0Alpha1RoutingTree: ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisRoutingtreeV0Alpha1RoutingTree; + routingTree: RoutingTree; }; -export type DeletecollectionRoutingTreeApiResponse = /** status 200 OK */ IoK8SApimachineryPkgApisMetaV1Status; +export type DeletecollectionRoutingTreeApiResponse = /** status 200 OK */ Status; export type DeletecollectionRoutingTreeApiArg = { - /** object name and auth scope, such as for teams and projects */ - namespace: string; /** If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). */ pretty?: string; /** The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the "next key". @@ -766,24 +737,17 @@ export type DeletecollectionRoutingTreeApiArg = { /** Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. */ timeoutSeconds?: number; }; -export type GetRoutingTreeApiResponse = - /** status 200 OK */ ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisRoutingtreeV0Alpha1RoutingTree; +export type GetRoutingTreeApiResponse = /** status 200 OK */ RoutingTree; export type GetRoutingTreeApiArg = { /** name of the RoutingTree */ name: string; - /** object name and auth scope, such as for teams and projects */ - namespace: string; /** If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). */ pretty?: string; }; -export type ReplaceRoutingTreeApiResponse = /** status 200 OK */ - | ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisRoutingtreeV0Alpha1RoutingTree - | /** status 201 Created */ ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisRoutingtreeV0Alpha1RoutingTree; +export type ReplaceRoutingTreeApiResponse = /** status 200 OK */ RoutingTree | /** status 201 Created */ RoutingTree; export type ReplaceRoutingTreeApiArg = { /** name of the RoutingTree */ name: string; - /** object name and auth scope, such as for teams and projects */ - namespace: string; /** If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). */ pretty?: string; /** When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed */ @@ -792,16 +756,12 @@ export type ReplaceRoutingTreeApiArg = { fieldManager?: string; /** fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. */ fieldValidation?: string; - comGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisRoutingtreeV0Alpha1RoutingTree: ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisRoutingtreeV0Alpha1RoutingTree; + routingTree: RoutingTree; }; -export type DeleteRoutingTreeApiResponse = /** status 200 OK */ - | IoK8SApimachineryPkgApisMetaV1Status - | /** status 202 Accepted */ IoK8SApimachineryPkgApisMetaV1Status; +export type DeleteRoutingTreeApiResponse = /** status 200 OK */ Status | /** status 202 Accepted */ Status; export type DeleteRoutingTreeApiArg = { /** name of the RoutingTree */ name: string; - /** object name and auth scope, such as for teams and projects */ - namespace: string; /** If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). */ pretty?: string; /** When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed */ @@ -815,14 +775,10 @@ export type DeleteRoutingTreeApiArg = { /** Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. */ propagationPolicy?: string; }; -export type UpdateRoutingTreeApiResponse = /** status 200 OK */ - | ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisRoutingtreeV0Alpha1RoutingTree - | /** status 201 Created */ ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisRoutingtreeV0Alpha1RoutingTree; +export type UpdateRoutingTreeApiResponse = /** status 200 OK */ RoutingTree | /** status 201 Created */ RoutingTree; export type UpdateRoutingTreeApiArg = { /** name of the RoutingTree */ name: string; - /** object name and auth scope, such as for teams and projects */ - namespace: string; /** If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). */ pretty?: string; /** When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed */ @@ -833,13 +789,10 @@ export type UpdateRoutingTreeApiArg = { fieldValidation?: string; /** Force is going to "force" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ force?: boolean; - ioK8SApimachineryPkgApisMetaV1Patch: IoK8SApimachineryPkgApisMetaV1Patch; + patch: Patch; }; -export type ListTemplateGroupApiResponse = - /** status 200 OK */ ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTemplategroupV0Alpha1TemplateGroupList; +export type ListTemplateGroupApiResponse = /** status 200 OK */ TemplateGroupList; export type ListTemplateGroupApiArg = { - /** object name and auth scope, such as for teams and projects */ - namespace: string; /** If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). */ pretty?: string; /** allowWatchBookmarks requests watch events with type "BOOKMARK". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. */ @@ -884,12 +837,10 @@ export type ListTemplateGroupApiArg = { watch?: boolean; }; export type CreateTemplateGroupApiResponse = /** status 200 OK */ - | ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTemplategroupV0Alpha1TemplateGroup - | /** status 201 Created */ ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTemplategroupV0Alpha1TemplateGroup - | /** status 202 Accepted */ ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTemplategroupV0Alpha1TemplateGroup; + | TemplateGroup + | /** status 201 Created */ TemplateGroup + | /** status 202 Accepted */ TemplateGroup; export type CreateTemplateGroupApiArg = { - /** object name and auth scope, such as for teams and projects */ - namespace: string; /** If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). */ pretty?: string; /** When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed */ @@ -898,12 +849,10 @@ export type CreateTemplateGroupApiArg = { fieldManager?: string; /** fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. */ fieldValidation?: string; - comGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTemplategroupV0Alpha1TemplateGroup: ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTemplategroupV0Alpha1TemplateGroup; + templateGroup: TemplateGroup; }; -export type DeletecollectionTemplateGroupApiResponse = /** status 200 OK */ IoK8SApimachineryPkgApisMetaV1Status; +export type DeletecollectionTemplateGroupApiResponse = /** status 200 OK */ Status; export type DeletecollectionTemplateGroupApiArg = { - /** object name and auth scope, such as for teams and projects */ - namespace: string; /** If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). */ pretty?: string; /** The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the "next key". @@ -953,24 +902,19 @@ export type DeletecollectionTemplateGroupApiArg = { /** Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. */ timeoutSeconds?: number; }; -export type GetTemplateGroupApiResponse = - /** status 200 OK */ ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTemplategroupV0Alpha1TemplateGroup; +export type GetTemplateGroupApiResponse = /** status 200 OK */ TemplateGroup; export type GetTemplateGroupApiArg = { /** name of the TemplateGroup */ name: string; - /** object name and auth scope, such as for teams and projects */ - namespace: string; /** If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). */ pretty?: string; }; export type ReplaceTemplateGroupApiResponse = /** status 200 OK */ - | ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTemplategroupV0Alpha1TemplateGroup - | /** status 201 Created */ ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTemplategroupV0Alpha1TemplateGroup; + | TemplateGroup + | /** status 201 Created */ TemplateGroup; export type ReplaceTemplateGroupApiArg = { /** name of the TemplateGroup */ name: string; - /** object name and auth scope, such as for teams and projects */ - namespace: string; /** If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). */ pretty?: string; /** When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed */ @@ -979,16 +923,12 @@ export type ReplaceTemplateGroupApiArg = { fieldManager?: string; /** fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. */ fieldValidation?: string; - comGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTemplategroupV0Alpha1TemplateGroup: ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTemplategroupV0Alpha1TemplateGroup; + templateGroup: TemplateGroup; }; -export type DeleteTemplateGroupApiResponse = /** status 200 OK */ - | IoK8SApimachineryPkgApisMetaV1Status - | /** status 202 Accepted */ IoK8SApimachineryPkgApisMetaV1Status; +export type DeleteTemplateGroupApiResponse = /** status 200 OK */ Status | /** status 202 Accepted */ Status; export type DeleteTemplateGroupApiArg = { /** name of the TemplateGroup */ name: string; - /** object name and auth scope, such as for teams and projects */ - namespace: string; /** If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). */ pretty?: string; /** When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed */ @@ -1003,13 +943,11 @@ export type DeleteTemplateGroupApiArg = { propagationPolicy?: string; }; export type UpdateTemplateGroupApiResponse = /** status 200 OK */ - | ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTemplategroupV0Alpha1TemplateGroup - | /** status 201 Created */ ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTemplategroupV0Alpha1TemplateGroup; + | TemplateGroup + | /** status 201 Created */ TemplateGroup; export type UpdateTemplateGroupApiArg = { /** name of the TemplateGroup */ name: string; - /** object name and auth scope, such as for teams and projects */ - namespace: string; /** If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). */ pretty?: string; /** When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed */ @@ -1020,13 +958,10 @@ export type UpdateTemplateGroupApiArg = { fieldValidation?: string; /** Force is going to "force" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ force?: boolean; - ioK8SApimachineryPkgApisMetaV1Patch: IoK8SApimachineryPkgApisMetaV1Patch; + patch: Patch; }; -export type ListTimeIntervalApiResponse = - /** status 200 OK */ ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTimeintervalV0Alpha1TimeIntervalList; +export type ListTimeIntervalApiResponse = /** status 200 OK */ TimeIntervalList; export type ListTimeIntervalApiArg = { - /** object name and auth scope, such as for teams and projects */ - namespace: string; /** If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). */ pretty?: string; /** allowWatchBookmarks requests watch events with type "BOOKMARK". Servers that do not implement bookmarks may ignore this flag and bookmarks are sent at the server's discretion. Clients should not assume bookmarks are returned at any specific interval, nor may they assume the server will send any BOOKMARK event during a session. If this is not a watch, this field is ignored. */ @@ -1071,12 +1006,10 @@ export type ListTimeIntervalApiArg = { watch?: boolean; }; export type CreateTimeIntervalApiResponse = /** status 200 OK */ - | ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTimeintervalV0Alpha1TimeInterval - | /** status 201 Created */ ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTimeintervalV0Alpha1TimeInterval - | /** status 202 Accepted */ ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTimeintervalV0Alpha1TimeInterval; + | TimeInterval + | /** status 201 Created */ TimeInterval + | /** status 202 Accepted */ TimeInterval; export type CreateTimeIntervalApiArg = { - /** object name and auth scope, such as for teams and projects */ - namespace: string; /** If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). */ pretty?: string; /** When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed */ @@ -1085,12 +1018,10 @@ export type CreateTimeIntervalApiArg = { fieldManager?: string; /** fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. */ fieldValidation?: string; - comGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTimeintervalV0Alpha1TimeInterval: ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTimeintervalV0Alpha1TimeInterval; + timeInterval: TimeInterval; }; -export type DeletecollectionTimeIntervalApiResponse = /** status 200 OK */ IoK8SApimachineryPkgApisMetaV1Status; +export type DeletecollectionTimeIntervalApiResponse = /** status 200 OK */ Status; export type DeletecollectionTimeIntervalApiArg = { - /** object name and auth scope, such as for teams and projects */ - namespace: string; /** If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). */ pretty?: string; /** The continue option should be set when retrieving more results from the server. Since this value is server defined, clients may only use the continue value from a previous query result with identical query parameters (except for the value of continue) and the server may reject a continue value it does not recognize. If the specified continue value is no longer valid whether due to expiration (generally five to fifteen minutes) or a configuration change on the server, the server will respond with a 410 ResourceExpired error together with a continue token. If the client needs a consistent list, it must restart their list without the continue field. Otherwise, the client may send another list request with the token received with the 410 error, the server will respond with a list starting from the next key, but from the latest snapshot, which is inconsistent from the previous list results - objects that are created, modified, or deleted after the first list request will be included in the response, as long as their keys are after the "next key". @@ -1140,24 +1071,17 @@ export type DeletecollectionTimeIntervalApiArg = { /** Timeout for the list/watch call. This limits the duration of the call, regardless of any activity or inactivity. */ timeoutSeconds?: number; }; -export type GetTimeIntervalApiResponse = - /** status 200 OK */ ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTimeintervalV0Alpha1TimeInterval; +export type GetTimeIntervalApiResponse = /** status 200 OK */ TimeInterval; export type GetTimeIntervalApiArg = { /** name of the TimeInterval */ name: string; - /** object name and auth scope, such as for teams and projects */ - namespace: string; /** If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). */ pretty?: string; }; -export type ReplaceTimeIntervalApiResponse = /** status 200 OK */ - | ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTimeintervalV0Alpha1TimeInterval - | /** status 201 Created */ ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTimeintervalV0Alpha1TimeInterval; +export type ReplaceTimeIntervalApiResponse = /** status 200 OK */ TimeInterval | /** status 201 Created */ TimeInterval; export type ReplaceTimeIntervalApiArg = { /** name of the TimeInterval */ name: string; - /** object name and auth scope, such as for teams and projects */ - namespace: string; /** If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). */ pretty?: string; /** When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed */ @@ -1166,16 +1090,12 @@ export type ReplaceTimeIntervalApiArg = { fieldManager?: string; /** fieldValidation instructs the server on how to handle objects in the request (POST/PUT/PATCH) containing unknown or duplicate fields. Valid values are: - Ignore: This will ignore any unknown fields that are silently dropped from the object, and will ignore all but the last duplicate field that the decoder encounters. This is the default behavior prior to v1.23. - Warn: This will send a warning via the standard warning response header for each unknown field that is dropped from the object, and for each duplicate field that is encountered. The request will still succeed if there are no other errors, and will only persist the last of any duplicate fields. This is the default in v1.23+ - Strict: This will fail the request with a BadRequest error if any unknown fields would be dropped from the object, or if any duplicate fields are present. The error returned from the server will contain all unknown and duplicate fields encountered. */ fieldValidation?: string; - comGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTimeintervalV0Alpha1TimeInterval: ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTimeintervalV0Alpha1TimeInterval; + timeInterval: TimeInterval; }; -export type DeleteTimeIntervalApiResponse = /** status 200 OK */ - | IoK8SApimachineryPkgApisMetaV1Status - | /** status 202 Accepted */ IoK8SApimachineryPkgApisMetaV1Status; +export type DeleteTimeIntervalApiResponse = /** status 200 OK */ Status | /** status 202 Accepted */ Status; export type DeleteTimeIntervalApiArg = { /** name of the TimeInterval */ name: string; - /** object name and auth scope, such as for teams and projects */ - namespace: string; /** If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). */ pretty?: string; /** When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed */ @@ -1189,14 +1109,10 @@ export type DeleteTimeIntervalApiArg = { /** Whether and how garbage collection will be performed. Either this field or OrphanDependents may be set, but not both. The default policy is decided by the existing finalizer set in the metadata.finalizers and the resource-specific default policy. Acceptable values are: 'Orphan' - orphan the dependents; 'Background' - allow the garbage collector to delete the dependents in the background; 'Foreground' - a cascading policy that deletes all dependents in the foreground. */ propagationPolicy?: string; }; -export type UpdateTimeIntervalApiResponse = /** status 200 OK */ - | ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTimeintervalV0Alpha1TimeInterval - | /** status 201 Created */ ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTimeintervalV0Alpha1TimeInterval; +export type UpdateTimeIntervalApiResponse = /** status 200 OK */ TimeInterval | /** status 201 Created */ TimeInterval; export type UpdateTimeIntervalApiArg = { /** name of the TimeInterval */ name: string; - /** object name and auth scope, such as for teams and projects */ - namespace: string; /** If 'true', then the output is pretty printed. Defaults to 'false' unless the user-agent indicates a browser or command-line HTTP tool (curl and wget). */ pretty?: string; /** When present, indicates that modifications should not be persisted. An invalid or unrecognized dryRun directive will result in an error response and no further processing of the request. Valid values are: - All: all dry run stages will be processed */ @@ -1207,9 +1123,9 @@ export type UpdateTimeIntervalApiArg = { fieldValidation?: string; /** Force is going to "force" Apply requests. It means user will re-acquire conflicting fields owned by other people. Force flag must be unset for non-apply patch requests. */ force?: boolean; - ioK8SApimachineryPkgApisMetaV1Patch: IoK8SApimachineryPkgApisMetaV1Patch; + patch: Patch; }; -export type IoK8SApimachineryPkgApisMetaV1ApiResource = { +export type ApiResource = { /** categories is a list of the grouped resources this resource belongs to (e.g. 'all') */ categories?: string[]; /** group is the preferred group of the resource. Empty implies the group of the containing resource list. For subresources, this may have a different value, for example: Scale". */ @@ -1231,7 +1147,7 @@ export type IoK8SApimachineryPkgApisMetaV1ApiResource = { /** version is the preferred version of the resource. Empty implies the version of the containing resource list For subresources, this may have a different value, for example: v1 (while inside a v1beta1 version of the core resource's group)". */ version?: string; }; -export type IoK8SApimachineryPkgApisMetaV1ApiResourceList = { +export type ApiResourceList = { /** APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources */ apiVersion?: string; /** groupVersion is the group and version this APIResourceList is for. */ @@ -1239,17 +1155,17 @@ export type IoK8SApimachineryPkgApisMetaV1ApiResourceList = { /** Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds */ kind?: string; /** resources contains the name of the resources and if they are namespaced. */ - resources: IoK8SApimachineryPkgApisMetaV1ApiResource[]; + resources: ApiResource[]; }; -export type IoK8SApimachineryPkgApisMetaV1Time = string; -export type IoK8SApimachineryPkgApisMetaV1FieldsV1 = object; -export type IoK8SApimachineryPkgApisMetaV1ManagedFieldsEntry = { +export type Time = string; +export type FieldsV1 = object; +export type ManagedFieldsEntry = { /** APIVersion defines the version of this resource that this field set applies to. The format is "group/version" just like the top-level APIVersion field. It is necessary to track the version of a field set because it cannot be automatically converted. */ apiVersion?: string; /** FieldsType is the discriminator for the different fields format and version. There is currently only one possible value: "FieldsV1" */ fieldsType?: string; /** FieldsV1 holds the first JSON version format as described in the "FieldsV1" type. */ - fieldsV1?: IoK8SApimachineryPkgApisMetaV1FieldsV1; + fieldsV1?: FieldsV1; /** Manager is an identifier of the workflow managing these fields. */ manager?: string; /** Operation is the type of operation which lead to this ManagedFieldsEntry being created. The only valid values for this field are 'Apply' and 'Update'. */ @@ -1257,9 +1173,9 @@ export type IoK8SApimachineryPkgApisMetaV1ManagedFieldsEntry = { /** Subresource is the name of the subresource used to update that object, or empty string if the object was updated through the main resource. The value of this field is used to distinguish between managers, even if they share the same name. For example, a status update will be distinct from a regular update using the same manager name. Note that the APIVersion field is not related to the Subresource field and it always corresponds to the version of the main resource. */ subresource?: string; /** Time is the timestamp of when the ManagedFields entry was added. The timestamp will also be updated if a field is added, the manager changes any of the owned fields value or removes a field. The timestamp does not update when a field is removed from the entry because another manager took it over. */ - time?: IoK8SApimachineryPkgApisMetaV1Time; + time?: Time; }; -export type IoK8SApimachineryPkgApisMetaV1OwnerReference = { +export type OwnerReference = { /** API version of the referent. */ apiVersion: string; /** If true, AND if the owner has the "foregroundDeletion" finalizer, then the owner cannot be deleted from the key-value store until this reference is removed. See https://kubernetes.io/docs/concepts/architecture/garbage-collection/#foreground-deletion for how the garbage collector interacts with this field and enforces the foreground deletion. Defaults to false. To set this field, a user needs "delete" permission of the owner, otherwise 422 (Unprocessable Entity) will be returned. */ @@ -1273,7 +1189,7 @@ export type IoK8SApimachineryPkgApisMetaV1OwnerReference = { /** UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids */ uid: string; }; -export type IoK8SApimachineryPkgApisMetaV1ObjectMeta = { +export type ObjectMeta = { /** Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations */ annotations?: { [key: string]: string; @@ -1281,13 +1197,13 @@ export type IoK8SApimachineryPkgApisMetaV1ObjectMeta = { /** CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC. Populated by the system. Read-only. Null for lists. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata */ - creationTimestamp?: IoK8SApimachineryPkgApisMetaV1Time; + creationTimestamp?: Time; /** Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only. */ deletionGracePeriodSeconds?: number; /** DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field, once the finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. Once the deletionTimestamp is set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested. Populated by the system when a graceful deletion is requested. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata */ - deletionTimestamp?: IoK8SApimachineryPkgApisMetaV1Time; + deletionTimestamp?: Time; /** Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed. Finalizers may be processed and removed in any order. Order is NOT enforced because it introduces significant risk of stuck finalizers. finalizers is a shared field, any actor with permission can reorder it. If the finalizer list is processed in order, then this can lead to a situation in which the component responsible for the first finalizer in the list is waiting for a signal (field value, external system, or other) produced by a component responsible for a finalizer later in the list, resulting in a deadlock. Without enforced ordering finalizers are free to order amongst themselves and are not vulnerable to ordering changes in the list. */ finalizers?: string[]; /** GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server. @@ -1303,7 +1219,7 @@ export type IoK8SApimachineryPkgApisMetaV1ObjectMeta = { [key: string]: string; }; /** ManagedFields maps workflow-id and version to the set of fields that are managed by that workflow. This is mostly for internal housekeeping, and users typically shouldn't need to set or understand this field. A workflow can be the user's name, a controller's name, or the name of a specific apply path like "ci-cd". The set of fields is always in the version that the workflow used when modifying the object. */ - managedFields?: IoK8SApimachineryPkgApisMetaV1ManagedFieldsEntry[]; + managedFields?: ManagedFieldsEntry[]; /** Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names */ name?: string; /** Namespace defines the space within which each name must be unique. An empty namespace is equivalent to the "default" namespace, but "default" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty. @@ -1311,7 +1227,7 @@ export type IoK8SApimachineryPkgApisMetaV1ObjectMeta = { Must be a DNS_LABEL. Cannot be updated. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces */ namespace?: string; /** List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller. */ - ownerReferences?: IoK8SApimachineryPkgApisMetaV1OwnerReference[]; + ownerReferences?: OwnerReference[]; /** An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources. Populated by the system. Read-only. Value must be treated as opaque by clients and . More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency */ @@ -1323,7 +1239,7 @@ export type IoK8SApimachineryPkgApisMetaV1ObjectMeta = { Populated by the system. Read-only. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids */ uid?: string; }; -export type ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisReceiverV0Alpha1Integration = { +export type Integration = { disableResolveMessage?: boolean; secureFields?: { [key: string]: boolean; @@ -1334,61 +1250,11 @@ export type ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisReceiverV0Alp type: string; uid?: string; }; -export type ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisReceiverV0Alpha1Spec = { - integrations: ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisReceiverV0Alpha1Integration[]; +export type ReceiverSpec = { + integrations: Integration[]; title: string; }; -export type ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisReceiverV0Alpha1StatusOperatorState = { - /** descriptiveState is an optional more descriptive state field which has no requirements on format */ - descriptiveState?: string; - /** details contains any extra information that is operator-specific */ - details?: { - [key: string]: object; - }; - /** lastEvaluation is the ResourceVersion last evaluated */ - lastEvaluation: string; - /** state describes the state of the lastEvaluation. It is limited to three possible states for machine evaluation. */ - state: string; -}; -export type ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisReceiverV0Alpha1Status = { - /** additionalFields is reserved for future use */ - additionalFields?: { - [key: string]: object; - }; - /** operatorStates is a map of operator ID to operator state evaluations. Any operator which consumes this kind SHOULD add its state evaluation information to this field. */ - operatorStates?: { - [key: string]: ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisReceiverV0Alpha1StatusOperatorState; - }; -}; -export type ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisReceiverV0Alpha1Receiver = { - /** APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources */ - apiVersion?: string; - /** Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds */ - kind?: string; - metadata: IoK8SApimachineryPkgApisMetaV1ObjectMeta; - /** Spec is the spec of the Receiver */ - spec: ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisReceiverV0Alpha1Spec; - status: ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisReceiverV0Alpha1Status; -}; -export type IoK8SApimachineryPkgApisMetaV1ListMeta = { - /** continue may be set if the user set a limit on the number of items returned, and indicates that the server has more data available. The value is opaque and may be used to issue another request to the endpoint that served this list to retrieve the next set of available objects. Continuing a consistent list may not be possible if the server configuration has changed or more than a few minutes have passed. The resourceVersion field returned when using this continue value will be identical to the value in the first response, unless you have received this token from an error message. */ - continue?: string; - /** remainingItemCount is the number of subsequent items in the list which are not included in this list response. If the list request contained label or field selectors, then the number of remaining items is unknown and the field will be left unset and omitted during serialization. If the list is complete (either because it is not chunking or because this is the last chunk), then there are no more remaining items and this field will be left unset and omitted during serialization. Servers older than v1.15 do not set this field. The intended use of the remainingItemCount is *estimating* the size of a collection. Clients should not rely on the remainingItemCount to be set or to be exact. */ - remainingItemCount?: number; - /** String that identifies the server's internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency */ - resourceVersion?: string; - /** Deprecated: selfLink is a legacy read-only field that is no longer populated by the system. */ - selfLink?: string; -}; -export type ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisReceiverV0Alpha1ReceiverList = { - /** APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources */ - apiVersion?: string; - items: ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisReceiverV0Alpha1Receiver[]; - /** Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds */ - kind?: string; - metadata: IoK8SApimachineryPkgApisMetaV1ListMeta; -}; -export type IoK8SApimachineryPkgApisMetaV1StatusCause = { +export type StatusCause = { /** The field of the resource that has caused this error, as named by its JSON serialization. May include dot and postfix notation for nested attributes. Arrays are zero-indexed. Fields may appear more than once in an array of causes due to fields having multiple errors. Optional. Examples: @@ -1400,9 +1266,9 @@ export type IoK8SApimachineryPkgApisMetaV1StatusCause = { /** A machine-readable description of the cause of the error. If this value is empty there is no information available. */ reason?: string; }; -export type IoK8SApimachineryPkgApisMetaV1StatusDetails = { +export type StatusDetails = { /** The Causes array includes more details associated with the StatusReason failure. Not all StatusReasons may provide detailed causes. */ - causes?: IoK8SApimachineryPkgApisMetaV1StatusCause[]; + causes?: StatusCause[]; /** The group attribute of the resource associated with the status StatusReason. */ group?: string; /** The kind attribute of the resource associated with the status StatusReason. On some operations may differ from the requested resource Kind. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds */ @@ -1414,189 +1280,151 @@ export type IoK8SApimachineryPkgApisMetaV1StatusDetails = { /** UID of the resource. (when there is a single resource which can be described). More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids */ uid?: string; }; -export type IoK8SApimachineryPkgApisMetaV1Status = { +export type ListMeta = { + /** continue may be set if the user set a limit on the number of items returned, and indicates that the server has more data available. The value is opaque and may be used to issue another request to the endpoint that served this list to retrieve the next set of available objects. Continuing a consistent list may not be possible if the server configuration has changed or more than a few minutes have passed. The resourceVersion field returned when using this continue value will be identical to the value in the first response, unless you have received this token from an error message. */ + continue?: string; + /** remainingItemCount is the number of subsequent items in the list which are not included in this list response. If the list request contained label or field selectors, then the number of remaining items is unknown and the field will be left unset and omitted during serialization. If the list is complete (either because it is not chunking or because this is the last chunk), then there are no more remaining items and this field will be left unset and omitted during serialization. Servers older than v1.15 do not set this field. The intended use of the remainingItemCount is *estimating* the size of a collection. Clients should not rely on the remainingItemCount to be set or to be exact. */ + remainingItemCount?: number; + /** String that identifies the server's internal version of this object that can be used by clients to determine when objects have changed. Value must be treated as opaque by clients and passed unmodified back to the server. Populated by the system. Read-only. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency */ + resourceVersion?: string; + /** Deprecated: selfLink is a legacy read-only field that is no longer populated by the system. */ + selfLink?: string; +}; +export type Status = { /** APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources */ apiVersion?: string; /** Suggested HTTP return code for this status, 0 if not set. */ code?: number; /** Extended data associated with the reason. Each reason may define its own extended details. This field is optional and the data returned is not guaranteed to conform to any schema except that defined by the reason type. */ - details?: IoK8SApimachineryPkgApisMetaV1StatusDetails; + details?: StatusDetails; /** Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds */ kind?: string; /** A human-readable description of the status of this operation. */ message?: string; /** Standard list metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds */ - metadata?: IoK8SApimachineryPkgApisMetaV1ListMeta; + metadata?: ListMeta; /** A machine-readable description of why this operation is in the "Failure" status. If this value is empty there is no information available. A Reason clarifies an HTTP status code but does not override it. */ reason?: string; /** Status of the operation. One of: "Success" or "Failure". More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status */ status?: string; }; -export type IoK8SApimachineryPkgApisMetaV1Patch = object; -export type ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisRoutingtreeV0Alpha1RouteDefaults = { +export type Receiver = { + /** APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources */ + apiVersion?: string; + /** Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds */ + kind?: string; + metadata: ObjectMeta; + /** Spec is the spec of the Receiver */ + spec: ReceiverSpec; + status: Status; +}; +export type ReceiverList = { + /** APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources */ + apiVersion?: string; + items: Receiver[]; + /** Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds */ + kind?: string; + metadata: ListMeta; +}; +export type Patch = object; +export type RouteDefaults = { group_by?: string[]; group_interval?: string; group_wait?: string; receiver: string; repeat_interval?: string; }; -export type ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisRoutingtreeV0Alpha1Matcher = { +export type Matcher = { label: string; type: string; value: string; }; -export type ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisRoutingtreeV0Alpha1Route = { +export type Route = { continue: boolean; group_by?: string[]; group_interval?: string; group_wait?: string; - matchers?: ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisRoutingtreeV0Alpha1Matcher[]; + matchers?: Matcher[]; mute_time_intervals?: string[]; receiver?: string; repeat_interval?: string; - routes?: ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisRoutingtreeV0Alpha1Route[]; + routes?: Route[]; }; -export type ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisRoutingtreeV0Alpha1Spec = { - defaults: ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisRoutingtreeV0Alpha1RouteDefaults; - routes: ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisRoutingtreeV0Alpha1Route[]; +export type RoutingtreeSpec = { + defaults: RouteDefaults; + routes: Route[]; }; -export type ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisRoutingtreeV0Alpha1StatusOperatorState = { - /** descriptiveState is an optional more descriptive state field which has no requirements on format */ - descriptiveState?: string; - /** details contains any extra information that is operator-specific */ - details?: { - [key: string]: object; - }; - /** lastEvaluation is the ResourceVersion last evaluated */ - lastEvaluation: string; - /** state describes the state of the lastEvaluation. It is limited to three possible states for machine evaluation. */ - state: string; -}; -export type ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisRoutingtreeV0Alpha1Status = { - /** additionalFields is reserved for future use */ - additionalFields?: { - [key: string]: object; - }; - /** operatorStates is a map of operator ID to operator state evaluations. Any operator which consumes this kind SHOULD add its state evaluation information to this field. */ - operatorStates?: { - [key: string]: ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisRoutingtreeV0Alpha1StatusOperatorState; - }; -}; -export type ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisRoutingtreeV0Alpha1RoutingTree = { +export type RoutingTree = { /** APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources */ apiVersion?: string; /** Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds */ kind?: string; - metadata: IoK8SApimachineryPkgApisMetaV1ObjectMeta; + metadata: ObjectMeta; /** Spec is the spec of the RoutingTree */ - spec: ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisRoutingtreeV0Alpha1Spec; - status: ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisRoutingtreeV0Alpha1Status; + spec: RoutingtreeSpec; + status: Status; }; -export type ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisRoutingtreeV0Alpha1RoutingTreeList = { +export type RoutingTreeList = { /** APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources */ apiVersion?: string; - items: ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisRoutingtreeV0Alpha1RoutingTree[]; + items: RoutingTree[]; /** Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds */ kind?: string; - metadata: IoK8SApimachineryPkgApisMetaV1ListMeta; + metadata: ListMeta; }; -export type ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTemplategroupV0Alpha1Spec = { +export type TemplategroupSpec = { content: string; title: string; }; -export type ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTemplategroupV0Alpha1StatusOperatorState = { - /** descriptiveState is an optional more descriptive state field which has no requirements on format */ - descriptiveState?: string; - /** details contains any extra information that is operator-specific */ - details?: { - [key: string]: object; - }; - /** lastEvaluation is the ResourceVersion last evaluated */ - lastEvaluation: string; - /** state describes the state of the lastEvaluation. It is limited to three possible states for machine evaluation. */ - state: string; -}; -export type ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTemplategroupV0Alpha1Status = { - /** additionalFields is reserved for future use */ - additionalFields?: { - [key: string]: object; - }; - /** operatorStates is a map of operator ID to operator state evaluations. Any operator which consumes this kind SHOULD add its state evaluation information to this field. */ - operatorStates?: { - [key: string]: ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTemplategroupV0Alpha1StatusOperatorState; - }; -}; -export type ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTemplategroupV0Alpha1TemplateGroup = { +export type TemplateGroup = { /** APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources */ apiVersion?: string; /** Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds */ kind?: string; - metadata: IoK8SApimachineryPkgApisMetaV1ObjectMeta; + metadata: ObjectMeta; /** Spec is the spec of the TemplateGroup */ - spec: ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTemplategroupV0Alpha1Spec; - status: ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTemplategroupV0Alpha1Status; + spec: TemplategroupSpec; + status: Status; }; -export type ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTemplategroupV0Alpha1TemplateGroupList = { +export type TemplateGroupList = { /** APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources */ apiVersion?: string; - items: ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTemplategroupV0Alpha1TemplateGroup[]; + items: TemplateGroup[]; /** Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds */ kind?: string; - metadata: IoK8SApimachineryPkgApisMetaV1ListMeta; + metadata: ListMeta; }; -export type ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTimeintervalV0Alpha1TimeRange = { +export type TimeRange = { end_time: string; start_time: string; }; -export type ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTimeintervalV0Alpha1Interval = { +export type Interval = { days_of_month?: string[]; location?: string; months?: string[]; - times?: ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTimeintervalV0Alpha1TimeRange[]; + times?: TimeRange[]; weekdays?: string[]; years?: string[]; }; -export type ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTimeintervalV0Alpha1Spec = { +export type TimeintervalSpec = { name: string; - time_intervals: ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTimeintervalV0Alpha1Interval[]; + time_intervals: Interval[]; }; -export type ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTimeintervalV0Alpha1StatusOperatorState = { - /** descriptiveState is an optional more descriptive state field which has no requirements on format */ - descriptiveState?: string; - /** details contains any extra information that is operator-specific */ - details?: { - [key: string]: object; - }; - /** lastEvaluation is the ResourceVersion last evaluated */ - lastEvaluation: string; - /** state describes the state of the lastEvaluation. It is limited to three possible states for machine evaluation. */ - state: string; -}; -export type ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTimeintervalV0Alpha1Status = { - /** additionalFields is reserved for future use */ - additionalFields?: { - [key: string]: object; - }; - /** operatorStates is a map of operator ID to operator state evaluations. Any operator which consumes this kind SHOULD add its state evaluation information to this field. */ - operatorStates?: { - [key: string]: ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTimeintervalV0Alpha1StatusOperatorState; - }; -}; -export type ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTimeintervalV0Alpha1TimeInterval = { +export type TimeInterval = { /** APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources */ apiVersion?: string; /** Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds */ kind?: string; - metadata: IoK8SApimachineryPkgApisMetaV1ObjectMeta; + metadata: ObjectMeta; /** Spec is the spec of the TimeInterval */ - spec: ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTimeintervalV0Alpha1Spec; - status: ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTimeintervalV0Alpha1Status; + spec: TimeintervalSpec; + status: Status; }; -export type ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTimeintervalV0Alpha1TimeIntervalList = { +export type TimeIntervalList = { /** APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources */ apiVersion?: string; - items: ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisTimeintervalV0Alpha1TimeInterval[]; + items: TimeInterval[]; /** Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds */ kind?: string; - metadata: IoK8SApimachineryPkgApisMetaV1ListMeta; + metadata: ListMeta; }; diff --git a/packages/grafana-alerting/src/grafana/api/v0alpha1/api.ts b/packages/grafana-alerting/src/grafana/api/v0alpha1/api.ts new file mode 100644 index 00000000000..32983acc230 --- /dev/null +++ b/packages/grafana-alerting/src/grafana/api/v0alpha1/api.ts @@ -0,0 +1,17 @@ +import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react'; + +import { getAPIBaseURL, getAPIReducerPath } from '../util'; + +const VERSION = 'v0alpha1'; +const GROUP = 'notifications.alerting.grafana.app'; + +const baseUrl = getAPIBaseURL(GROUP, VERSION); +const reducerPath = getAPIReducerPath(GROUP, VERSION); + +export const api = createApi({ + reducerPath, + baseQuery: fetchBaseQuery({ + baseUrl, + }), + endpoints: () => ({}), +}); diff --git a/packages/grafana-alerting/src/grafana/contactPoints/types.ts b/packages/grafana-alerting/src/grafana/api/v0alpha1/types.ts similarity index 82% rename from packages/grafana-alerting/src/grafana/contactPoints/types.ts rename to packages/grafana-alerting/src/grafana/api/v0alpha1/types.ts index ade85597d83..c7947b9151c 100644 --- a/packages/grafana-alerting/src/grafana/contactPoints/types.ts +++ b/packages/grafana-alerting/src/grafana/api/v0alpha1/types.ts @@ -3,14 +3,10 @@ */ import { MergeDeep, MergeExclusive, OverrideProperties } from 'type-fest'; -import { - ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisReceiverV0Alpha1Receiver as ContactPointV0Alpha1, - ComGithubGrafanaGrafanaAppsAlertingNotificationsPkgApisReceiverV0Alpha1Integration as IntegrationV0Alpha1, - ListReceiverApiResponse, -} from '../api.gen'; +import type { Receiver, Integration as ReceiverIntegration, ListReceiverApiResponse } from './api.gen'; type GenericIntegration = OverrideProperties< - IntegrationV0Alpha1, + ReceiverIntegration, { settings: Record; } @@ -60,7 +56,7 @@ export type Integration = EmailIntegration | SlackIntegration | GenericIntegrati // Enhanced version of ContactPoint with typed integrations // ⚠️ MergeDeep does not check if the property you are overriding exists in the base type and there is no "DeepOverrideProperties" helper export type ContactPoint = MergeDeep< - ContactPointV0Alpha1, + Receiver, { spec: { integrations: Integration[]; @@ -68,7 +64,7 @@ export type ContactPoint = MergeDeep< } >; -export type EnhancedListReceiverResponse = OverrideProperties< +export type EnhancedListReceiverApiResponse = OverrideProperties< ListReceiverApiResponse, { items: ContactPoint[]; diff --git a/packages/grafana-alerting/src/grafana/contactPoints/components/ContactPointSelector.tsx b/packages/grafana-alerting/src/grafana/contactPoints/components/ContactPointSelector.tsx index 02a781719c9..91983b84434 100644 --- a/packages/grafana-alerting/src/grafana/contactPoints/components/ContactPointSelector.tsx +++ b/packages/grafana-alerting/src/grafana/contactPoints/components/ContactPointSelector.tsx @@ -2,8 +2,8 @@ import { chain } from 'lodash'; import { Combobox, ComboboxOption } from '@grafana/ui'; -import { useListContactPoints } from '../hooks/useContactPoints'; -import { ContactPoint } from '../types'; +import { ContactPoint } from '../../api/v0alpha1/types'; +import { useListContactPointsv0alpha1 } from '../hooks/useContactPoints'; import { getContactPointDescription } from '../utils'; const collator = new Intl.Collator('en', { sensitivity: 'accent' }); @@ -17,7 +17,7 @@ type ContactPointSelectorProps = { * @TODO make ComboBox accept a ReactNode so we can use icons and such */ function ContactPointSelector({ onChange }: ContactPointSelectorProps) { - const { currentData: contactPoints, isLoading } = useListContactPoints(); + const { currentData: contactPoints, isLoading } = useListContactPointsv0alpha1(); // Create a mapping of options with their corresponding contact points const contactPointOptions = chain(contactPoints?.items) @@ -27,7 +27,7 @@ function ContactPointSelector({ onChange }: ContactPointSelectorProps) { label: contactPoint.spec.title, value: contactPoint.metadata.uid ?? contactPoint.spec.title, description: getContactPointDescription(contactPoint), - }, + } satisfies ComboboxOption, contactPoint, })) .value() diff --git a/packages/grafana-alerting/src/grafana/contactPoints/hooks/useContactPoints.tsx b/packages/grafana-alerting/src/grafana/contactPoints/hooks/useContactPoints.tsx index 354c34fe490..8c574c3be25 100644 --- a/packages/grafana-alerting/src/grafana/contactPoints/hooks/useContactPoints.tsx +++ b/packages/grafana-alerting/src/grafana/contactPoints/hooks/useContactPoints.tsx @@ -1,15 +1,11 @@ import { fetchBaseQuery, TypedUseQueryHookResult } from '@reduxjs/toolkit/query/react'; -import { config } from '@grafana/runtime'; - -import { alertingAPI, ListReceiverApiArg } from '../../api.gen'; -import { EnhancedListReceiverResponse } from '../types'; - -const { namespace } = config; +import { alertingAPI, type ListReceiverApiArg } from '../../api/v0alpha1/api.gen'; +import type { EnhancedListReceiverApiResponse } from '../../api/v0alpha1/types'; // this is a workaround for the fact that the generated types are not narrow enough type EnhancedHookResult = TypedUseQueryHookResult< - EnhancedListReceiverResponse, + EnhancedListReceiverApiResponse, ListReceiverApiArg, ReturnType >; @@ -22,8 +18,8 @@ type EnhancedHookResult = TypedUseQueryHookResult< * * It automatically uses the configured namespace for the query. */ -function useListContactPoints() { - return alertingAPI.useListReceiverQuery({ namespace }); +function useListContactPointsv0alpha1() { + return alertingAPI.useListReceiverQuery({}); } -export { useListContactPoints }; +export { useListContactPointsv0alpha1 }; diff --git a/packages/grafana-alerting/src/grafana/contactPoints/utils.ts b/packages/grafana-alerting/src/grafana/contactPoints/utils.ts index 871dbb4fd87..d32f7d7ecfe 100644 --- a/packages/grafana-alerting/src/grafana/contactPoints/utils.ts +++ b/packages/grafana-alerting/src/grafana/contactPoints/utils.ts @@ -1,6 +1,6 @@ import { countBy, isEmpty } from 'lodash'; -import { ContactPoint } from './types'; +import { ContactPoint } from '../api/v0alpha1/types'; /** * Generates a human-readable description of a ContactPoint by summarizing its integrations. diff --git a/packages/grafana-alerting/src/internal.ts b/packages/grafana-alerting/src/internal.ts index 800a6a5ee91..9ad812acd3b 100644 --- a/packages/grafana-alerting/src/internal.ts +++ b/packages/grafana-alerting/src/internal.ts @@ -1,6 +1,4 @@ /** * Export things here that you want to be available under @grafana/alerting/internal */ -export { alertingAPI } from './grafana/api.gen'; - export default {}; diff --git a/packages/grafana-alerting/src/unstable.ts b/packages/grafana-alerting/src/unstable.ts index 005c320eaa8..5f1d9d8b0a1 100644 --- a/packages/grafana-alerting/src/unstable.ts +++ b/packages/grafana-alerting/src/unstable.ts @@ -3,6 +3,9 @@ */ // Contact Points -export * from './grafana/contactPoints/types'; -export { useListContactPoints } from './grafana/contactPoints/hooks/useContactPoints'; +export * from './grafana/api/v0alpha1/types'; +export { useListContactPointsv0alpha1 } from './grafana/contactPoints/hooks/useContactPoints'; export { ContactPointSelector } from './grafana/contactPoints/components/ContactPointSelector'; + +// Low-level API hooks +export { alertingAPI as alertingAPIv0alpha1 } from './grafana/api/v0alpha1/api.gen'; diff --git a/yarn.lock b/yarn.lock index bde2aee7087..0c7571f1a24 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2915,7 +2915,7 @@ __metadata: resolution: "@grafana/alerting@workspace:packages/grafana-alerting" dependencies: "@grafana/tsconfig": "npm:^2.0.0" - "@reduxjs/toolkit": "npm:^2.7.0" + "@reduxjs/toolkit": "npm:^2.8.0" "@rtk-query/codegen-openapi": "npm:^2.0.0" "@types/lodash": "npm:^4" "@types/react": "npm:18.3.18" @@ -6517,9 +6517,9 @@ __metadata: languageName: node linkType: hard -"@reduxjs/toolkit@npm:^2.7.0": - version: 2.7.0 - resolution: "@reduxjs/toolkit@npm:2.7.0" +"@reduxjs/toolkit@npm:^2.8.0": + version: 2.8.0 + resolution: "@reduxjs/toolkit@npm:2.8.0" dependencies: "@standard-schema/spec": "npm:^1.0.0" "@standard-schema/utils": "npm:^0.3.0" @@ -6535,7 +6535,7 @@ __metadata: optional: true react-redux: optional: true - checksum: 10/cc264efc95f9ebeafa469bf1040d106a33768a802e6f46aa678bf9f26822d049c18b5f10864aa8badb2e62febe58e242860256174528e62b09e8f897d32cd182 + checksum: 10/22a97393e6d8688edacea748efeff2e5c8165c61aa05239192cca8856dbbf175c49e8dd9fcf954e0c09014acaefcf56dcd61303b905e4e0eb47e77ad09f230d8 languageName: node linkType: hard