@grafana/alerting 13.2.0-28985753600 → 13.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/fakes/Receivers.cjs +3 -3
- package/dist/cjs/grafana/api/notifications/v1beta1/mocks/fakes/Receivers.cjs.map +1 -0
- package/dist/cjs/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/fakes/Routes.cjs +3 -3
- package/dist/cjs/grafana/api/notifications/v1beta1/mocks/fakes/Routes.cjs.map +1 -0
- package/dist/cjs/grafana/api/notifications/v1beta1/mocks/fakes/common.cjs.map +1 -0
- package/dist/cjs/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/ReceiverHandlers/createReceiverHandler.cjs +2 -2
- package/dist/cjs/grafana/api/notifications/v1beta1/mocks/handlers/ReceiverHandlers/createReceiverHandler.cjs.map +1 -0
- package/dist/cjs/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/ReceiverHandlers/deleteReceiverHandler.cjs +2 -2
- package/dist/cjs/grafana/api/notifications/v1beta1/mocks/handlers/ReceiverHandlers/deleteReceiverHandler.cjs.map +1 -0
- package/dist/cjs/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/ReceiverHandlers/deletecollectionReceiverHandler.cjs +2 -2
- package/dist/cjs/grafana/api/notifications/v1beta1/mocks/handlers/ReceiverHandlers/deletecollectionReceiverHandler.cjs.map +1 -0
- package/dist/cjs/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/ReceiverHandlers/getReceiverHandler.cjs +2 -2
- package/dist/cjs/grafana/api/notifications/v1beta1/mocks/handlers/ReceiverHandlers/getReceiverHandler.cjs.map +1 -0
- package/dist/cjs/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/ReceiverHandlers/listReceiverHandler.cjs +2 -2
- package/dist/cjs/grafana/api/notifications/v1beta1/mocks/handlers/ReceiverHandlers/listReceiverHandler.cjs.map +1 -0
- package/dist/cjs/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/ReceiverHandlers/replaceReceiverHandler.cjs +2 -2
- package/dist/cjs/grafana/api/notifications/v1beta1/mocks/handlers/ReceiverHandlers/replaceReceiverHandler.cjs.map +1 -0
- package/dist/cjs/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/ReceiverHandlers/updateReceiverHandler.cjs +2 -2
- package/dist/cjs/grafana/api/notifications/v1beta1/mocks/handlers/ReceiverHandlers/updateReceiverHandler.cjs.map +1 -0
- package/dist/cjs/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/RoutingTreeHandlers/listRoutingTreeHandler.cjs +2 -2
- package/dist/cjs/grafana/api/notifications/v1beta1/mocks/handlers/RoutingTreeHandlers/listRoutingTreeHandler.cjs.map +1 -0
- package/dist/cjs/grafana/contactPoints/components/ContactPointSelector/ContactPointSelector.cjs +1 -1
- package/dist/cjs/grafana/contactPoints/components/ContactPointSelector/ContactPointSelector.cjs.map +1 -1
- package/dist/cjs/grafana/contactPoints/components/ContactPointSelector/ContactPointSelector.scenario.cjs +2 -2
- package/dist/cjs/grafana/contactPoints/components/ContactPointSelector/ContactPointSelector.scenario.cjs.map +1 -1
- package/dist/cjs/grafana/contactPoints/hooks/{v0alpha1 → v1beta1}/useContactPoints.cjs +2 -2
- package/dist/cjs/grafana/contactPoints/hooks/v1beta1/useContactPoints.cjs.map +1 -0
- package/dist/cjs/grafana/contactPoints/utils.cjs.map +1 -1
- package/dist/cjs/grafana/notificationPolicies/components/RoutingTreeSelector/RoutingTreeSelector.cjs.map +1 -1
- package/dist/cjs/grafana/notificationPolicies/components/RoutingTreeSelector/RoutingTreeSelector.scenario.cjs +2 -2
- package/dist/cjs/grafana/notificationPolicies/components/RoutingTreeSelector/RoutingTreeSelector.scenario.cjs.map +1 -1
- package/dist/cjs/grafana/notificationPolicies/hooks/useMatchPolicies.cjs +2 -2
- package/dist/cjs/grafana/notificationPolicies/hooks/useMatchPolicies.cjs.map +1 -1
- package/dist/cjs/grafana/notificationPolicies/hooks/useRoutingTrees.cjs +2 -2
- package/dist/cjs/grafana/notificationPolicies/hooks/useRoutingTrees.cjs.map +1 -1
- package/dist/cjs/grafana/notificationPolicies/routingTrees.cjs +1 -1
- package/dist/cjs/grafana/notificationPolicies/routingTrees.cjs.map +1 -1
- package/dist/cjs/grafana/notificationPolicies/utils.cjs.map +1 -1
- package/dist/cjs/testing.cjs +12 -12
- package/dist/cjs/unstable.cjs +7 -7
- package/dist/esm/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/fakes/Receivers.mjs +1 -1
- package/dist/esm/grafana/api/notifications/v1beta1/mocks/fakes/Receivers.mjs.map +1 -0
- package/dist/esm/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/fakes/Routes.mjs +1 -1
- package/dist/esm/grafana/api/notifications/v1beta1/mocks/fakes/Routes.mjs.map +1 -0
- package/dist/esm/grafana/api/notifications/v1beta1/mocks/fakes/common.mjs.map +1 -0
- package/dist/esm/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/ReceiverHandlers/createReceiverHandler.mjs +1 -1
- package/dist/esm/grafana/api/notifications/v1beta1/mocks/handlers/ReceiverHandlers/createReceiverHandler.mjs.map +1 -0
- package/dist/esm/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/ReceiverHandlers/deleteReceiverHandler.mjs +1 -1
- package/dist/esm/grafana/api/notifications/v1beta1/mocks/handlers/ReceiverHandlers/deleteReceiverHandler.mjs.map +1 -0
- package/dist/esm/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/ReceiverHandlers/deletecollectionReceiverHandler.mjs +1 -1
- package/dist/esm/grafana/api/notifications/v1beta1/mocks/handlers/ReceiverHandlers/deletecollectionReceiverHandler.mjs.map +1 -0
- package/dist/esm/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/ReceiverHandlers/getReceiverHandler.mjs +1 -1
- package/dist/esm/grafana/api/notifications/v1beta1/mocks/handlers/ReceiverHandlers/getReceiverHandler.mjs.map +1 -0
- package/dist/esm/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/ReceiverHandlers/listReceiverHandler.mjs +1 -1
- package/dist/esm/grafana/api/notifications/v1beta1/mocks/handlers/ReceiverHandlers/listReceiverHandler.mjs.map +1 -0
- package/dist/esm/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/ReceiverHandlers/replaceReceiverHandler.mjs +1 -1
- package/dist/esm/grafana/api/notifications/v1beta1/mocks/handlers/ReceiverHandlers/replaceReceiverHandler.mjs.map +1 -0
- package/dist/esm/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/ReceiverHandlers/updateReceiverHandler.mjs +1 -1
- package/dist/esm/grafana/api/notifications/v1beta1/mocks/handlers/ReceiverHandlers/updateReceiverHandler.mjs.map +1 -0
- package/dist/esm/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/RoutingTreeHandlers/listRoutingTreeHandler.mjs +1 -1
- package/dist/esm/grafana/api/notifications/v1beta1/mocks/handlers/RoutingTreeHandlers/listRoutingTreeHandler.mjs.map +1 -0
- package/dist/esm/grafana/contactPoints/components/ContactPointSelector/ContactPointSelector.mjs +1 -1
- package/dist/esm/grafana/contactPoints/components/ContactPointSelector/ContactPointSelector.mjs.map +1 -1
- package/dist/esm/grafana/contactPoints/components/ContactPointSelector/ContactPointSelector.scenario.mjs +2 -2
- package/dist/esm/grafana/contactPoints/components/ContactPointSelector/ContactPointSelector.scenario.mjs.map +1 -1
- package/dist/esm/grafana/contactPoints/hooks/{v0alpha1 → v1beta1}/useContactPoints.mjs +1 -1
- package/dist/esm/grafana/contactPoints/hooks/v1beta1/useContactPoints.mjs.map +1 -0
- package/dist/esm/grafana/contactPoints/utils.mjs.map +1 -1
- package/dist/esm/grafana/notificationPolicies/components/RoutingTreeSelector/RoutingTreeSelector.mjs.map +1 -1
- package/dist/esm/grafana/notificationPolicies/components/RoutingTreeSelector/RoutingTreeSelector.scenario.mjs +2 -2
- package/dist/esm/grafana/notificationPolicies/components/RoutingTreeSelector/RoutingTreeSelector.scenario.mjs.map +1 -1
- package/dist/esm/grafana/notificationPolicies/hooks/useMatchPolicies.mjs +1 -1
- package/dist/esm/grafana/notificationPolicies/hooks/useMatchPolicies.mjs.map +1 -1
- package/dist/esm/grafana/notificationPolicies/hooks/useRoutingTrees.mjs +1 -1
- package/dist/esm/grafana/notificationPolicies/hooks/useRoutingTrees.mjs.map +1 -1
- package/dist/esm/grafana/notificationPolicies/routingTrees.mjs +1 -1
- package/dist/esm/grafana/notificationPolicies/routingTrees.mjs.map +1 -1
- package/dist/esm/grafana/notificationPolicies/utils.mjs.map +1 -1
- package/dist/esm/testing.mjs +12 -12
- package/dist/esm/unstable.mjs +3 -3
- package/dist/types/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/fakes/Receivers.d.ts +108 -108
- package/dist/types/grafana/api/notifications/v1beta1/mocks/fakes/Routes.d.ts +41 -0
- package/dist/types/grafana/api/notifications/v1beta1/mocks/fakes/common.d.ts +20 -0
- package/dist/types/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/ReceiverHandlers/createReceiverHandler.d.ts +1 -1
- package/dist/types/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/ReceiverHandlers/deleteReceiverHandler.d.ts +1 -1
- package/dist/types/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/ReceiverHandlers/deletecollectionReceiverHandler.d.ts +1 -1
- package/dist/types/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/ReceiverHandlers/getReceiverHandler.d.ts +1 -1
- package/dist/types/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/ReceiverHandlers/replaceReceiverHandler.d.ts +1 -1
- package/dist/types/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/ReceiverHandlers/updateReceiverHandler.d.ts +1 -1
- package/dist/types/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/RoutingTreeHandlers/listRoutingTreeHandler.d.ts +1 -1
- package/dist/types/grafana/api/notifications/{v0alpha1 → v1beta1}/types.d.ts +1 -1
- package/dist/types/grafana/contactPoints/components/ContactPointSelector/ContactPointSelector.d.ts +2 -2
- package/dist/types/grafana/contactPoints/components/ContactPointSelector/ContactPointSelector.scenario.d.ts +6 -6
- package/dist/types/grafana/contactPoints/hooks/{v0alpha1 → v1beta1}/useContactPoints.d.ts +5 -5
- package/dist/types/grafana/contactPoints/utils.d.ts +2 -2
- package/dist/types/grafana/matchers/types.d.ts +1 -1
- package/dist/types/grafana/mocks/util.d.ts +1 -1
- package/dist/types/grafana/notificationPolicies/components/RoutingTreeSelector/RoutingTreeSelector.d.ts +2 -6
- package/dist/types/grafana/notificationPolicies/components/RoutingTreeSelector/RoutingTreeSelector.scenario.d.ts +3 -3
- package/dist/types/grafana/notificationPolicies/hooks/useMatchPolicies.d.ts +2 -2
- package/dist/types/grafana/notificationPolicies/hooks/useRoutingTrees.d.ts +5 -6
- package/dist/types/grafana/notificationPolicies/routingTrees.d.ts +2 -2
- package/dist/types/grafana/notificationPolicies/types.d.ts +1 -1
- package/dist/types/grafana/notificationPolicies/utils.d.ts +2 -2
- package/dist/types/grafana/rules/components/labels/AlertLabel.d.ts +1 -1
- package/dist/types/grafana/rules/components/labels/AlertLabels.d.ts +1 -1
- package/dist/types/grafana/rules/components/state/StateDot.d.ts +1 -1
- package/dist/types/grafana/rules/components/state/StateIcon.d.ts +1 -1
- package/dist/types/grafana/rules/components/state/StateText.d.ts +1 -1
- package/dist/types/testing.d.ts +4 -4
- package/dist/types/unstable.d.ts +3 -3
- package/package.json +14 -12
- package/dist/cjs/grafana/api/notifications/v0alpha1/mocks/fakes/Receivers.cjs.map +0 -1
- package/dist/cjs/grafana/api/notifications/v0alpha1/mocks/fakes/Routes.cjs.map +0 -1
- package/dist/cjs/grafana/api/notifications/v0alpha1/mocks/fakes/common.cjs.map +0 -1
- package/dist/cjs/grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/createReceiverHandler.cjs.map +0 -1
- package/dist/cjs/grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/deleteReceiverHandler.cjs.map +0 -1
- package/dist/cjs/grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/deletecollectionReceiverHandler.cjs.map +0 -1
- package/dist/cjs/grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/getReceiverHandler.cjs.map +0 -1
- package/dist/cjs/grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/listReceiverHandler.cjs.map +0 -1
- package/dist/cjs/grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/replaceReceiverHandler.cjs.map +0 -1
- package/dist/cjs/grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/updateReceiverHandler.cjs.map +0 -1
- package/dist/cjs/grafana/api/notifications/v0alpha1/mocks/handlers/RoutingTreeHandlers/listRoutingTreeHandler.cjs.map +0 -1
- package/dist/cjs/grafana/contactPoints/hooks/v0alpha1/useContactPoints.cjs.map +0 -1
- package/dist/esm/grafana/api/notifications/v0alpha1/mocks/fakes/Receivers.mjs.map +0 -1
- package/dist/esm/grafana/api/notifications/v0alpha1/mocks/fakes/Routes.mjs.map +0 -1
- package/dist/esm/grafana/api/notifications/v0alpha1/mocks/fakes/common.mjs.map +0 -1
- package/dist/esm/grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/createReceiverHandler.mjs.map +0 -1
- package/dist/esm/grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/deleteReceiverHandler.mjs.map +0 -1
- package/dist/esm/grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/deletecollectionReceiverHandler.mjs.map +0 -1
- package/dist/esm/grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/getReceiverHandler.mjs.map +0 -1
- package/dist/esm/grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/listReceiverHandler.mjs.map +0 -1
- package/dist/esm/grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/replaceReceiverHandler.mjs.map +0 -1
- package/dist/esm/grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/updateReceiverHandler.mjs.map +0 -1
- package/dist/esm/grafana/api/notifications/v0alpha1/mocks/handlers/RoutingTreeHandlers/listRoutingTreeHandler.mjs.map +0 -1
- package/dist/esm/grafana/contactPoints/hooks/v0alpha1/useContactPoints.mjs.map +0 -1
- package/dist/types/grafana/api/notifications/v0alpha1/mocks/fakes/Routes.d.ts +0 -41
- package/dist/types/grafana/api/notifications/v0alpha1/mocks/fakes/common.d.ts +0 -20
- /package/dist/cjs/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/fakes/common.cjs +0 -0
- /package/dist/cjs/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/index.cjs +0 -0
- /package/dist/cjs/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/index.cjs.map +0 -0
- /package/dist/cjs/grafana/api/notifications/{v0alpha1 → v1beta1}/types.cjs +0 -0
- /package/dist/cjs/grafana/api/notifications/{v0alpha1 → v1beta1}/types.cjs.map +0 -0
- /package/dist/esm/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/fakes/common.mjs +0 -0
- /package/dist/esm/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/index.mjs +0 -0
- /package/dist/esm/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/index.mjs.map +0 -0
- /package/dist/esm/grafana/api/notifications/{v0alpha1 → v1beta1}/types.mjs +0 -0
- /package/dist/esm/grafana/api/notifications/{v0alpha1 → v1beta1}/types.mjs.map +0 -0
- /package/dist/types/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/ReceiverHandlers/listReceiverHandler.d.ts +0 -0
- /package/dist/types/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/index.d.ts +0 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* This file contains enhanced and type-narrowed versions of the types generated by the RTKQ codegen package.
|
|
3
3
|
*/
|
|
4
4
|
import { type MergeDeep, type MergeExclusive, type OverrideProperties } from 'type-fest';
|
|
5
|
-
import type { ListReceiverApiResponse, Receiver, ReceiverIntegration } from '@grafana/api-clients/rtkq/notifications.alerting/
|
|
5
|
+
import type { ListReceiverApiResponse, Receiver, ReceiverIntegration } from '@grafana/api-clients/rtkq/notifications.alerting/v1beta1';
|
|
6
6
|
type GenericIntegration = OverrideProperties<ReceiverIntegration, {
|
|
7
7
|
settings: Record<string, unknown>;
|
|
8
8
|
}>;
|
package/dist/types/grafana/contactPoints/components/ContactPointSelector/ContactPointSelector.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ContactPoint } from '../../../api/notifications/
|
|
1
|
+
import type { ContactPoint } from '../../../api/notifications/v1beta1/types';
|
|
2
2
|
import { type CustomComboBoxProps } from '../../../common/ComboBox.types';
|
|
3
3
|
export type ContactPointSelectorProps = CustomComboBoxProps<ContactPoint> & {
|
|
4
4
|
/**
|
|
@@ -13,5 +13,5 @@ export type ContactPointSelectorProps = CustomComboBoxProps<ContactPoint> & {
|
|
|
13
13
|
* By default, only shows contact points that can be used (have `grafana.com/canUse: true`).
|
|
14
14
|
* Set `includeUnusable` to `true` to show all contact points including imported ones.
|
|
15
15
|
*/
|
|
16
|
-
declare function ContactPointSelector(props: ContactPointSelectorProps): import("react
|
|
16
|
+
declare function ContactPointSelector(props: ContactPointSelectorProps): import("react").JSX.Element;
|
|
17
17
|
export { ContactPointSelector };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
export declare const simpleContactPointsList: {
|
|
2
|
-
apiVersion?: string
|
|
3
|
-
kind?: string
|
|
4
|
-
metadata: import("@grafana/api-clients/rtkq/notifications.alerting/
|
|
2
|
+
apiVersion?: string;
|
|
3
|
+
kind?: string;
|
|
4
|
+
metadata: import("@grafana/api-clients/rtkq/notifications.alerting/v1beta1").ListMeta;
|
|
5
5
|
items: import("../../../../unstable").ContactPoint[];
|
|
6
6
|
};
|
|
7
7
|
export declare const simpleContactPointsListScenario: import("msw").HttpHandler[];
|
|
8
8
|
export declare const withErrorScenario: import("msw").HttpHandler[];
|
|
9
9
|
export declare const contactPointsListWithUnusableItems: {
|
|
10
|
-
apiVersion?: string
|
|
11
|
-
kind?: string
|
|
12
|
-
metadata: import("@grafana/api-clients/rtkq/notifications.alerting/
|
|
10
|
+
apiVersion?: string;
|
|
11
|
+
kind?: string;
|
|
12
|
+
metadata: import("@grafana/api-clients/rtkq/notifications.alerting/v1beta1").ListMeta;
|
|
13
13
|
items: import("../../../../unstable").ContactPoint[];
|
|
14
14
|
};
|
|
15
15
|
export declare const contactPointsListWithUnusableItemsScenario: import("msw").HttpHandler[];
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { type TypedUseQueryHookResult, type fetchBaseQuery } from '@reduxjs/toolkit/query/react';
|
|
2
|
-
import { type ListReceiverApiArg, generatedAPI as
|
|
3
|
-
import type { EnhancedListReceiverApiResponse } from '../../../api/notifications/
|
|
2
|
+
import { type ListReceiverApiArg, generatedAPI as notificationsAPIv1beta1 } from '@grafana/api-clients/rtkq/notifications.alerting/v1beta1';
|
|
3
|
+
import type { EnhancedListReceiverApiResponse } from '../../../api/notifications/v1beta1/types';
|
|
4
4
|
type ListContactPointsHookResult = TypedUseQueryHookResult<EnhancedListReceiverApiResponse, ListReceiverApiArg, ReturnType<typeof fetchBaseQuery>>;
|
|
5
|
-
type ListContactPointsQueryArgs = Parameters<typeof
|
|
6
|
-
type ListContactPointsQueryOptions = Parameters<typeof
|
|
5
|
+
type ListContactPointsQueryArgs = Parameters<typeof notificationsAPIv1beta1.endpoints.listReceiver.useQuery<ListContactPointsHookResult>>[0];
|
|
6
|
+
type ListContactPointsQueryOptions = Parameters<typeof notificationsAPIv1beta1.endpoints.listReceiver.useQuery<ListContactPointsHookResult>>[1];
|
|
7
7
|
/**
|
|
8
8
|
* useListContactPoints is a hook that fetches a list of contact points
|
|
9
9
|
*
|
|
10
|
-
* This function wraps the
|
|
10
|
+
* This function wraps the notificationsAPIv1beta1.useListReceiverQuery with proper typing
|
|
11
11
|
* to ensure that the returned ContactPoints are correctly typed in the data.items array.
|
|
12
12
|
*
|
|
13
13
|
* It automatically uses the configured namespace for the query.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type Receiver } from '@grafana/api-clients/rtkq/notifications.alerting/
|
|
2
|
-
import { type ContactPoint, type ContactPointMetadataAnnotations } from '../api/notifications/
|
|
1
|
+
import { type Receiver } from '@grafana/api-clients/rtkq/notifications.alerting/v1beta1';
|
|
2
|
+
import { type ContactPoint, type ContactPointMetadataAnnotations } from '../api/notifications/v1beta1/types';
|
|
3
3
|
/**
|
|
4
4
|
* Minimal structural type that any k8s alerting entity satisfies.
|
|
5
5
|
* Accepts ContactPoint, Receiver, and the app-internal EntityToCheck type alike.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { type RoutingTreeMatcher } from '@grafana/api-clients/rtkq/notifications.alerting/
|
|
1
|
+
import { type RoutingTreeMatcher } from '@grafana/api-clients/rtkq/notifications.alerting/v1beta1';
|
|
2
2
|
export type Label = [string, string];
|
|
3
3
|
export type LabelMatcher = RoutingTreeMatcher;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const DEFAULT_NAMESPACE:
|
|
1
|
+
export declare const DEFAULT_NAMESPACE: 'default';
|
|
2
2
|
export declare const getAPIBaseURLForMocks: (group: string, version: string, path?: `/${string}`) => `/apis/${string}/${string}/namespaces/default/${string}`;
|
|
3
3
|
export declare const generateTitle: () => `${Capitalize<string>} ${string}`;
|
|
4
4
|
export declare const generateResourceVersion: () => string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ComponentProps } from 'react';
|
|
2
|
-
import { type RoutingTree } from '@grafana/api-clients/rtkq/notifications.alerting/
|
|
2
|
+
import { type RoutingTree } from '@grafana/api-clients/rtkq/notifications.alerting/v1beta1';
|
|
3
3
|
import { MultiCombobox } from '@grafana/ui';
|
|
4
4
|
import { type CustomComboBoxProps } from '../../../common/ComboBox.types';
|
|
5
5
|
type SingleSelectProps = CustomComboBoxProps<RoutingTree> & {
|
|
@@ -13,10 +13,6 @@ export type RoutingTreeSelectorProps = SingleSelectProps | MultiSelectProps;
|
|
|
13
13
|
/**
|
|
14
14
|
* Routing Tree Combobox which lists all available notification policy trees.
|
|
15
15
|
*
|
|
16
|
-
* When the `alertingMultiplePolicies` feature toggle is enabled on the backend,
|
|
17
|
-
* this shows all available routing trees. Otherwise, it shows only the default
|
|
18
|
-
* "user-defined" tree.
|
|
19
|
-
*
|
|
20
16
|
* The default routing tree (named "user-defined") is displayed as "Default policy"
|
|
21
17
|
* and is always listed first.
|
|
22
18
|
*
|
|
@@ -38,5 +34,5 @@ export type RoutingTreeSelectorProps = SingleSelectProps | MultiSelectProps;
|
|
|
38
34
|
* />
|
|
39
35
|
* ```
|
|
40
36
|
*/
|
|
41
|
-
declare function RoutingTreeSelector(props: RoutingTreeSelectorProps): import("react
|
|
37
|
+
declare function RoutingTreeSelector(props: RoutingTreeSelectorProps): import("react").JSX.Element;
|
|
42
38
|
export { RoutingTreeSelector };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export declare const simpleRoutingTreesList: import("@grafana/api-clients/rtkq/notifications.alerting/
|
|
1
|
+
export declare const simpleRoutingTreesList: import("@grafana/api-clients/rtkq/notifications.alerting/v1beta1").RoutingTreeList;
|
|
2
2
|
export declare const simpleRoutingTreesListScenario: import("msw").HttpHandler[];
|
|
3
|
-
export declare const singleDefaultTreeList: import("@grafana/api-clients/rtkq/notifications.alerting/
|
|
3
|
+
export declare const singleDefaultTreeList: import("@grafana/api-clients/rtkq/notifications.alerting/v1beta1").RoutingTreeList;
|
|
4
4
|
export declare const singleDefaultTreeScenario: import("msw").HttpHandler[];
|
|
5
|
-
export declare const simpleRoutingTreesListDefaultAlias: import("@grafana/api-clients/rtkq/notifications.alerting/
|
|
5
|
+
export declare const simpleRoutingTreesListDefaultAlias: import("@grafana/api-clients/rtkq/notifications.alerting/v1beta1").RoutingTreeList;
|
|
6
6
|
export declare const simpleRoutingTreesListDefaultAliasScenario: import("msw").HttpHandler[];
|
|
7
7
|
export declare const routingTreeWithErrorScenario: import("msw").HttpHandler[];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type RoutingTree, generatedAPI as
|
|
1
|
+
import { type RoutingTree, generatedAPI as notificationsAPIv1beta1 } from '@grafana/api-clients/rtkq/notifications.alerting/v1beta1';
|
|
2
2
|
import { type Label } from '../../matchers/types';
|
|
3
3
|
import { type Route, type RouteWithID } from '../types';
|
|
4
4
|
import { type RouteMatchResult, type TreeMatch } from '../utils';
|
|
@@ -14,7 +14,7 @@ export type InstanceMatchResult = {
|
|
|
14
14
|
labels: Label[];
|
|
15
15
|
matchedRoutes: RouteMatch[];
|
|
16
16
|
};
|
|
17
|
-
interface UseMatchInstancesToRouteTreesReturnType extends ReturnType<typeof
|
|
17
|
+
interface UseMatchInstancesToRouteTreesReturnType extends ReturnType<typeof notificationsAPIv1beta1.endpoints.listRoutingTree.useQuery> {
|
|
18
18
|
matchInstancesToRouteTrees: (instances: Label[][]) => InstanceMatchResult[];
|
|
19
19
|
}
|
|
20
20
|
/**
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { type TypedUseQueryHookResult, type fetchBaseQuery } from '@reduxjs/toolkit/query/react';
|
|
2
|
-
import { type ListRoutingTreeApiArg, type ListRoutingTreeApiResponse, generatedAPI as
|
|
2
|
+
import { type ListRoutingTreeApiArg, type ListRoutingTreeApiResponse, generatedAPI as notificationsAPIv1beta1 } from '@grafana/api-clients/rtkq/notifications.alerting/v1beta1';
|
|
3
3
|
type ListRoutingTreesHookResult = TypedUseQueryHookResult<ListRoutingTreeApiResponse, ListRoutingTreeApiArg, ReturnType<typeof fetchBaseQuery>>;
|
|
4
|
-
type ListRoutingTreesQueryArgs = Parameters<typeof
|
|
5
|
-
type ListRoutingTreesQueryOptions = Parameters<typeof
|
|
4
|
+
type ListRoutingTreesQueryArgs = Parameters<typeof notificationsAPIv1beta1.endpoints.listRoutingTree.useQuery<ListRoutingTreesHookResult>>[0];
|
|
5
|
+
type ListRoutingTreesQueryOptions = Parameters<typeof notificationsAPIv1beta1.endpoints.listRoutingTree.useQuery<ListRoutingTreesHookResult>>[1];
|
|
6
6
|
/**
|
|
7
7
|
* useListRoutingTrees is a hook that fetches a list of routing trees (notification policy trees).
|
|
8
8
|
*
|
|
9
|
-
* This function wraps the
|
|
9
|
+
* This function wraps the notificationsAPIv1beta1.useListRoutingTreeQuery with proper typing.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
* available routing trees. Otherwise, it returns only the default "user-defined" tree.
|
|
11
|
+
* The backend returns all available routing trees.
|
|
13
12
|
*
|
|
14
13
|
* @param queryArgs - Optional query arguments for filtering, pagination, etc.
|
|
15
14
|
* @param queryOptions - Optional query options (refetchOnFocus, skip, etc.)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type RoutingTree } from '@grafana/api-clients/rtkq/notifications.alerting/
|
|
1
|
+
import { type RoutingTree } from '@grafana/api-clients/rtkq/notifications.alerting/v1beta1';
|
|
2
2
|
/** The name the backend emits for the default (root) routing tree and the name the frontend SENDS. */
|
|
3
3
|
export declare const USER_DEFINED_TREE_NAME = "user-defined";
|
|
4
4
|
/** Future canonical name the backend may emit for the default (root) routing tree; accepted on the read side. */
|
|
@@ -10,7 +10,7 @@ export declare const DEFAULT_ROUTING_TREE_NAME_ALIAS = "default";
|
|
|
10
10
|
* backend's IsDefaultRoutingTreeName. Also treats an absent name (empty string / undefined) as the default,
|
|
11
11
|
* because the frontend uses "no name" to mean the root route.
|
|
12
12
|
*/
|
|
13
|
-
export declare function isDefaultRoutingTreeName(name?: string
|
|
13
|
+
export declare function isDefaultRoutingTreeName(name?: string): boolean;
|
|
14
14
|
/**
|
|
15
15
|
* Check if the given routing tree is the default (root) policy tree.
|
|
16
16
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type OverrideProperties } from 'type-fest';
|
|
2
|
-
import { type RoutingTreeRoute } from '@grafana/api-clients/rtkq/notifications.alerting/
|
|
2
|
+
import { type RoutingTreeRoute } from '@grafana/api-clients/rtkq/notifications.alerting/v1beta1';
|
|
3
3
|
import { type LabelMatcher } from '../matchers/types';
|
|
4
4
|
export type Route = OverrideProperties<RoutingTreeRoute, {
|
|
5
5
|
matchers?: LabelMatcher[];
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type RoutingTree } from '@grafana/api-clients/rtkq/notifications.alerting/
|
|
1
|
+
import { type RoutingTree } from '@grafana/api-clients/rtkq/notifications.alerting/v1beta1';
|
|
2
2
|
import { type Label } from '../matchers/types';
|
|
3
3
|
import { type LabelMatchDetails } from '../matchers/utils';
|
|
4
4
|
import { type Route, type RouteWithID } from './types';
|
|
5
|
-
export declare const INHERITABLE_KEYS: readonly [
|
|
5
|
+
export declare const INHERITABLE_KEYS: readonly ['receiver', 'group_by', 'group_wait', 'group_interval', 'repeat_interval'];
|
|
6
6
|
type InheritableKeys = typeof INHERITABLE_KEYS;
|
|
7
7
|
export type InheritableProperties = Pick<Route, InheritableKeys[number]>;
|
|
8
8
|
export type RouteMatchInfo<T extends Route> = {
|
|
@@ -14,6 +14,6 @@ type Props = BaseProps & MergeExclusive<{
|
|
|
14
14
|
}, {
|
|
15
15
|
colorBy?: 'key' | 'value' | 'both';
|
|
16
16
|
}>;
|
|
17
|
-
declare const AlertLabel: (props: Props) => import("react
|
|
17
|
+
declare const AlertLabel: (props: Props) => import("react").JSX.Element;
|
|
18
18
|
export { AlertLabel };
|
|
19
19
|
export type AlertLabelProps = Props;
|
|
@@ -7,4 +7,4 @@ export interface AlertLabelsProps {
|
|
|
7
7
|
onClick?: ([value, key]: [string | undefined, string | undefined]) => void;
|
|
8
8
|
commonLabelsMode?: 'expand' | 'tooltip';
|
|
9
9
|
}
|
|
10
|
-
export declare const AlertLabels: ({ labels, displayCommonLabels, labelSets, size, onClick, commonLabelsMode, }: AlertLabelsProps) => import("react
|
|
10
|
+
export declare const AlertLabels: ({ labels, displayCommonLabels, labelSets, size, onClick, commonLabelsMode, }: AlertLabelsProps) => import("react").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
interface DotStylesProps {
|
|
2
2
|
color: 'success' | 'error' | 'warning' | 'unknown' | 'info';
|
|
3
3
|
}
|
|
4
|
-
declare const StateDot: ({ color }: DotStylesProps) => import("react
|
|
4
|
+
declare const StateDot: ({ color }: DotStylesProps) => import("react").JSX.Element;
|
|
5
5
|
export { StateDot };
|
|
@@ -21,5 +21,5 @@ type RuleOperation = 'creating' | 'deleting';
|
|
|
21
21
|
*
|
|
22
22
|
* @TODO support translations
|
|
23
23
|
*/
|
|
24
|
-
export declare const StateIcon: import("react").MemoExoticComponent<({ state, health, type, isPaused, operation, }: StateIconProps) => import("react
|
|
24
|
+
export declare const StateIcon: import("react").MemoExoticComponent<({ state, health, type, isPaused, operation, }: StateIconProps) => import("react").JSX.Element>;
|
|
25
25
|
export {};
|
|
@@ -12,5 +12,5 @@ interface RecordingStateTextProps extends CommonStateTextProps {
|
|
|
12
12
|
state?: never;
|
|
13
13
|
}
|
|
14
14
|
type StateTextProps = AlertingStateTextProps | RecordingStateTextProps;
|
|
15
|
-
export declare const StateText: ({ state, health, type, isPaused }: StateTextProps) => import("react
|
|
15
|
+
export declare const StateText: ({ state, health, type, isPaused }: StateTextProps) => import("react").JSX.Element;
|
|
16
16
|
export {};
|
package/dist/types/testing.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './grafana/api/notifications/
|
|
2
|
-
export * from './grafana/api/notifications/
|
|
3
|
-
export * from './grafana/api/notifications/
|
|
4
|
-
export * from './grafana/api/notifications/
|
|
1
|
+
export * from './grafana/api/notifications/v1beta1/mocks/handlers';
|
|
2
|
+
export * from './grafana/api/notifications/v1beta1/mocks/fakes/common';
|
|
3
|
+
export * from './grafana/api/notifications/v1beta1/mocks/fakes/Receivers';
|
|
4
|
+
export * from './grafana/api/notifications/v1beta1/mocks/fakes/Routes';
|
|
5
5
|
export * from './grafana/contactPoints/components/ContactPointSelector/ContactPointSelector.scenario';
|
|
6
6
|
export * from './grafana/notificationPolicies/components/RoutingTreeSelector/RoutingTreeSelector.scenario';
|
package/dist/types/unstable.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Export things here that you want to be available under @grafana/alerting/unstable
|
|
3
3
|
*/
|
|
4
|
-
export * from './grafana/api/notifications/
|
|
5
|
-
export { useListContactPoints } from './grafana/contactPoints/hooks/
|
|
4
|
+
export * from './grafana/api/notifications/v1beta1/types';
|
|
5
|
+
export { useListContactPoints } from './grafana/contactPoints/hooks/v1beta1/useContactPoints';
|
|
6
6
|
export { ContactPointSelector } from './grafana/contactPoints/components/ContactPointSelector/ContactPointSelector';
|
|
7
7
|
export { getContactPointDescription, getContactPointInUse, getContactPointInUseRoutes, getContactPointInUseRules, } from './grafana/contactPoints/utils';
|
|
8
8
|
export { useListRoutingTrees } from './grafana/notificationPolicies/hooks/useRoutingTrees';
|
|
@@ -15,6 +15,6 @@ export { AlertLabel, type AlertLabelProps } from './grafana/rules/components/lab
|
|
|
15
15
|
export { AlertLabels, type AlertLabelsProps } from './grafana/rules/components/labels/AlertLabels';
|
|
16
16
|
export { type LabelMatcher, type Label } from './grafana/matchers/types';
|
|
17
17
|
export { matchLabelsSet, matchLabels, isLabelMatch, type LabelMatchDetails } from './grafana/matchers/utils';
|
|
18
|
-
export { generatedAPI as
|
|
18
|
+
export { generatedAPI as notificationsAPIv1beta1 } from '@grafana/api-clients/rtkq/notifications.alerting/v1beta1';
|
|
19
19
|
export { generatedAPI as rulesAPIv0alpha1 } from '@grafana/api-clients/rtkq/rules.alerting/v0alpha1';
|
|
20
20
|
export { generatedAPI as historianAPIv0alpha1 } from '@grafana/api-clients/rtkq/historian.alerting/v0alpha1';
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"author": "Grafana Labs",
|
|
3
3
|
"license": "Apache-2.0",
|
|
4
4
|
"name": "@grafana/alerting",
|
|
5
|
-
"version": "13.2.0
|
|
5
|
+
"version": "13.2.0",
|
|
6
6
|
"description": "Grafana Alerting Library – Build vertical integrations on top of the industry-leading alerting solution",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"typescript",
|
|
@@ -60,41 +60,43 @@
|
|
|
60
60
|
"i18n-extract": "i18next-cli extract --sync-primary"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"@grafana/test-utils": "13.2.0
|
|
63
|
+
"@grafana/test-utils": "13.2.0",
|
|
64
64
|
"@testing-library/jest-dom": "^6.6.3",
|
|
65
65
|
"@testing-library/react": "^16.3.0",
|
|
66
66
|
"@testing-library/user-event": "^14.6.1",
|
|
67
67
|
"@types/lodash": "^4",
|
|
68
|
-
"@types/react": "
|
|
69
|
-
"@types/react-dom": "
|
|
68
|
+
"@types/react": "19.2.18",
|
|
69
|
+
"@types/react-dom": "19.2.4",
|
|
70
70
|
"@types/tinycolor2": "^1",
|
|
71
|
+
"@typescript/native": "npm:typescript@^7.0.2",
|
|
71
72
|
"i18next-cli": "^1.48.0",
|
|
72
|
-
"react": "
|
|
73
|
-
"react-dom": "
|
|
73
|
+
"react": "19.2.8",
|
|
74
|
+
"react-dom": "19.2.8",
|
|
74
75
|
"react-redux": "^9.2.0",
|
|
75
76
|
"rimraf": "^6.0.1",
|
|
76
77
|
"rollup": "^4.60.1",
|
|
77
78
|
"rollup-plugin-esbuild": "6.2.1",
|
|
78
79
|
"rollup-plugin-node-externals": "^8.0.0",
|
|
79
80
|
"type-fest": "^4.40.0",
|
|
80
|
-
"typescript": "6.0.2"
|
|
81
|
+
"typescript": "npm:@typescript/typescript6@^6.0.2"
|
|
81
82
|
},
|
|
82
83
|
"peerDependencies": {
|
|
83
84
|
"@grafana/data": ">=11.6 <= 12.x",
|
|
84
85
|
"@grafana/runtime": ">=11.6 <= 12.x",
|
|
85
86
|
"@grafana/ui": ">=11.6 <= 12.x",
|
|
86
87
|
"msw": "^2.0.0",
|
|
87
|
-
"react": "
|
|
88
|
-
"react-dom": "
|
|
88
|
+
"react": ">=19",
|
|
89
|
+
"react-dom": ">=19"
|
|
89
90
|
},
|
|
90
91
|
"dependencies": {
|
|
91
92
|
"@emotion/css": "^11.13.5",
|
|
92
93
|
"@faker-js/faker": "^9.8.0",
|
|
93
|
-
"@grafana/api-clients": "13.2.0
|
|
94
|
-
"@grafana/i18n": "13.2.0
|
|
94
|
+
"@grafana/api-clients": "13.2.0",
|
|
95
|
+
"@grafana/i18n": "13.2.0",
|
|
95
96
|
"@reduxjs/toolkit": "^2.10.1",
|
|
96
97
|
"fishery": "^2.3.1",
|
|
97
98
|
"lodash": "^4.17.21",
|
|
98
99
|
"tinycolor2": "^1.6.0"
|
|
99
|
-
}
|
|
100
|
+
},
|
|
101
|
+
"gitHead": "f681b1359f6a0b8ecb9f2c49a88ac72b75bde73b"
|
|
100
102
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Receivers.cjs","sources":["../../../../../../../../src/grafana/api/notifications/v0alpha1/mocks/fakes/Receivers.ts"],"sourcesContent":["import { faker } from '@faker-js/faker';\nimport { Factory } from 'fishery';\n\nimport { API_GROUP, API_VERSION } from '@grafana/api-clients/rtkq/notifications.alerting/v0alpha1';\n\nimport { DEFAULT_NAMESPACE, generateResourceVersion, generateTitle, generateUID } from '../../../../../mocks/util';\nimport {\n type ContactPoint,\n type ContactPointMetadataAnnotations,\n type EnhancedListReceiverApiResponse,\n type Integration,\n} from '../../types';\n\nimport { AlertingEntityMetadataAnnotationsFactory } from './common';\n\nexport const ListReceiverApiResponseFactory = Factory.define<EnhancedListReceiverApiResponse>(() => ({\n kind: 'ReceiverList',\n apiVersion: `${API_GROUP}/${API_VERSION}`,\n metadata: {\n resourceVersion: generateResourceVersion(),\n },\n items: ContactPointFactory.buildList(5),\n}));\n\nexport const ContactPointFactory = Factory.define<ContactPoint>(() => {\n const title = generateTitle();\n\n return {\n kind: 'Receiver',\n apiVersion: `${API_GROUP}/${API_VERSION}`,\n metadata: {\n name: btoa(title),\n namespace: DEFAULT_NAMESPACE,\n uid: generateUID(),\n resourceVersion: generateResourceVersion(),\n annotations: ContactPointMetadataAnnotationsFactory.build(),\n },\n spec: ContactPointSpecFactory.build({ title }),\n status: {},\n };\n});\n\nexport const ContactPointSpecFactory = Factory.define<ContactPoint['spec']>(() => ({\n title: generateTitle(),\n // use two unique random integrations by default\n integrations: faker.helpers.uniqueArray(IntegrationUnion, 2).map((integration) => integration.build()),\n}));\n\nexport const GenericIntegrationFactory = Factory.define<Integration>(() => ({\n type: 'generic',\n version: '1',\n disableResolveMessage: false,\n settings: {\n foo: 'bar',\n },\n}));\n\nexport const EmailIntegrationFactory = Factory.define<Integration>(() => ({\n type: 'email',\n version: '1',\n secureFields: {},\n settings: {\n addresses: faker.internet.email(),\n },\n}));\n\nexport const SlackIntegrationFactory = Factory.define<Integration>(() => ({\n type: 'slack',\n version: '1',\n secureFields: { token: true },\n settings: {\n mentionChannel: '#alerts',\n },\n}));\n\nconst IntegrationUnion = [EmailIntegrationFactory, SlackIntegrationFactory];\n\n// by default the contact points will be in use by a route and a rule\nexport const ContactPointMetadataAnnotationsFactory = Factory.define<ContactPointMetadataAnnotations>(() => ({\n 'grafana.com/access/canReadSecrets': 'true',\n 'grafana.com/inUse/routes': '1',\n 'grafana.com/inUse/rules': '1',\n 'grafana.com/canUse': 'true',\n ...AlertingEntityMetadataAnnotationsFactory.build(),\n}));\n"],"names":["Factory","API_GROUP","API_VERSION","generateResourceVersion","generateTitle","DEFAULT_NAMESPACE","generateUID","faker","AlertingEntityMetadataAnnotationsFactory"],"mappings":";;;;;;;;;;;AAeO,MAAM,8BAAA,GAAiCA,eAAA,CAAQ,MAAA,CAAwC,OAAO;AAAA,EACnG,IAAA,EAAM,cAAA;AAAA,EACN,UAAA,EAAY,CAAA,EAAGC,kBAAS,CAAA,CAAA,EAAIC,oBAAW,CAAA,CAAA;AAAA,EACvC,QAAA,EAAU;AAAA,IACR,iBAAiBC,4BAAA;AAAwB,GAC3C;AAAA,EACA,KAAA,EAAO,mBAAA,CAAoB,SAAA,CAAU,CAAC;AACxC,CAAA,CAAE;AAEK,MAAM,mBAAA,GAAsBH,eAAA,CAAQ,MAAA,CAAqB,MAAM;AACpE,EAAA,MAAM,QAAQI,kBAAA,EAAc;AAE5B,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,UAAA;AAAA,IACN,UAAA,EAAY,CAAA,EAAGH,kBAAS,CAAA,CAAA,EAAIC,oBAAW,CAAA,CAAA;AAAA,IACvC,QAAA,EAAU;AAAA,MACR,IAAA,EAAM,KAAK,KAAK,CAAA;AAAA,MAChB,SAAA,EAAWG,sBAAA;AAAA,MACX,KAAKC,gBAAA,EAAY;AAAA,MACjB,iBAAiBH,4BAAA,EAAwB;AAAA,MACzC,WAAA,EAAa,uCAAuC,KAAA;AAAM,KAC5D;AAAA,IACA,IAAA,EAAM,uBAAA,CAAwB,KAAA,CAAM,EAAE,OAAO,CAAA;AAAA,IAC7C,QAAQ;AAAC,GACX;AACF,CAAC;AAEM,MAAM,uBAAA,GAA0BH,eAAA,CAAQ,MAAA,CAA6B,OAAO;AAAA,EACjF,OAAOI,kBAAA,EAAc;AAAA;AAAA,EAErB,YAAA,EAAcG,WAAA,CAAM,OAAA,CAAQ,WAAA,CAAY,gBAAA,EAAkB,CAAC,CAAA,CAAE,GAAA,CAAI,CAAC,WAAA,KAAgB,WAAA,CAAY,KAAA,EAAO;AACvG,CAAA,CAAE;AAEK,MAAM,yBAAA,GAA4BP,eAAA,CAAQ,MAAA,CAAoB,OAAO;AAAA,EAC1E,IAAA,EAAM,SAAA;AAAA,EACN,OAAA,EAAS,GAAA;AAAA,EACT,qBAAA,EAAuB,KAAA;AAAA,EACvB,QAAA,EAAU;AAAA,IACR,GAAA,EAAK;AAAA;AAET,CAAA,CAAE;AAEK,MAAM,uBAAA,GAA0BA,eAAA,CAAQ,MAAA,CAAoB,OAAO;AAAA,EACxE,IAAA,EAAM,OAAA;AAAA,EACN,OAAA,EAAS,GAAA;AAAA,EACT,cAAc,EAAC;AAAA,EACf,QAAA,EAAU;AAAA,IACR,SAAA,EAAWO,WAAA,CAAM,QAAA,CAAS,KAAA;AAAM;AAEpC,CAAA,CAAE;AAEK,MAAM,uBAAA,GAA0BP,eAAA,CAAQ,MAAA,CAAoB,OAAO;AAAA,EACxE,IAAA,EAAM,OAAA;AAAA,EACN,OAAA,EAAS,GAAA;AAAA,EACT,YAAA,EAAc,EAAE,KAAA,EAAO,IAAA,EAAK;AAAA,EAC5B,QAAA,EAAU;AAAA,IACR,cAAA,EAAgB;AAAA;AAEpB,CAAA,CAAE;AAEF,MAAM,gBAAA,GAAmB,CAAC,uBAAA,EAAyB,uBAAuB,CAAA;AAGnE,MAAM,sCAAA,GAAyCA,eAAA,CAAQ,MAAA,CAAwC,OAAO;AAAA,EAC3G,mCAAA,EAAqC,MAAA;AAAA,EACrC,0BAAA,EAA4B,GAAA;AAAA,EAC5B,yBAAA,EAA2B,GAAA;AAAA,EAC3B,oBAAA,EAAsB,MAAA;AAAA,EACtB,GAAGQ,gDAAyC,KAAA;AAC9C,CAAA,CAAE;;;;;;;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Routes.cjs","sources":["../../../../../../../../src/grafana/api/notifications/v0alpha1/mocks/fakes/Routes.ts"],"sourcesContent":["import { faker } from '@faker-js/faker';\nimport { Factory } from 'fishery';\n\nimport {\n API_GROUP,\n API_VERSION,\n type ListRoutingTreeApiResponse,\n type RoutingTree,\n} from '@grafana/api-clients/rtkq/notifications.alerting/v0alpha1';\n\nimport { type LabelMatcher } from '../../../../../matchers/types';\nimport { DEFAULT_NAMESPACE, generateResourceVersion } from '../../../../../mocks/util';\nimport { USER_DEFINED_TREE_NAME } from '../../../../../notificationPolicies/routingTrees';\nimport { type Route } from '../../../../../notificationPolicies/types';\n\nexport const LabelMatcherFactory = Factory.define<LabelMatcher>(() => {\n const operators: Array<LabelMatcher['type']> = ['=', '!=', '=~', '!~'];\n\n return {\n label: faker.helpers.arrayElement(['service', 'env', 'team', 'severity', 'region', 'instance']),\n type: faker.helpers.arrayElement(operators),\n value: faker.helpers.arrayElement(['web', 'api', 'prod', 'staging', 'critical', 'warning', 'us-east', 'us-west']),\n };\n});\n\nexport const RouteFactory = Factory.define<Route>(() => ({\n continue: faker.datatype.boolean(),\n receiver: faker.helpers.arrayElement(['web-team', 'api-team', 'critical-alerts', 'dev-team']),\n matchers: LabelMatcherFactory.buildList(faker.number.int({ min: 1, max: 3 })),\n group_by: faker.helpers.arrayElements(['alertname', 'service', 'severity'], { min: 1, max: 2 }),\n group_wait: faker.helpers.arrayElement(['10s', '30s', '1m']),\n group_interval: faker.helpers.arrayElement(['5m', '10m', '15m']),\n repeat_interval: faker.helpers.arrayElement(['1h', '4h', '12h']),\n active_time_intervals: faker.helpers.arrayElements(['business-hours', 'weekends', 'maintenance'], { min: 1, max: 2 }),\n mute_time_intervals: faker.helpers.arrayElements(['lunch-break', 'night-hours'], { min: 1, max: 2 }),\n routes: [],\n}));\n\nexport const RoutingTreeFactory = Factory.define<RoutingTree>(({ sequence }) => {\n const name = sequence === 1 ? USER_DEFINED_TREE_NAME : `policy-tree-${sequence}`;\n\n return {\n kind: 'RoutingTree',\n apiVersion: `${API_GROUP}/${API_VERSION}`,\n metadata: {\n name,\n namespace: DEFAULT_NAMESPACE,\n resourceVersion: generateResourceVersion(),\n },\n spec: {\n defaults: {\n receiver: faker.helpers.arrayElement(['web-team', 'api-team', 'critical-alerts', 'dev-team']),\n group_by: ['alertname'],\n group_wait: '30s',\n group_interval: '5m',\n repeat_interval: '4h',\n },\n routes: [],\n },\n };\n});\n\nexport const ListRoutingTreeApiResponseFactory = Factory.define<ListRoutingTreeApiResponse>(() => ({\n kind: 'RoutingTreeList',\n apiVersion: `${API_GROUP}/${API_VERSION}`,\n metadata: {\n resourceVersion: generateResourceVersion(),\n },\n items: RoutingTreeFactory.buildList(3),\n}));\n"],"names":["Factory","faker","USER_DEFINED_TREE_NAME","API_GROUP","API_VERSION","DEFAULT_NAMESPACE","generateResourceVersion"],"mappings":"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"common.cjs","sources":["../../../../../../../../src/grafana/api/notifications/v0alpha1/mocks/fakes/common.ts"],"sourcesContent":["import { Factory } from 'fishery';\n\nimport { type AlertingEntityMetadataAnnotations } from '../../types';\n\nexport const AlertingEntityMetadataAnnotationsFactory = Factory.define<AlertingEntityMetadataAnnotations>(() => ({\n 'grafana.com/access/canAdmin': 'true',\n 'grafana.com/access/canDelete': 'true',\n 'grafana.com/access/canWrite': 'true',\n 'grafana.com/provenance': '',\n}));\n"],"names":["Factory"],"mappings":";;;;;;;AAIO,MAAM,wCAAA,GAA2CA,eAAA,CAAQ,MAAA,CAA0C,OAAO;AAAA,EAC/G,6BAAA,EAA+B,MAAA;AAAA,EAC/B,8BAAA,EAAgC,MAAA;AAAA,EAChC,6BAAA,EAA+B,MAAA;AAAA,EAC/B,wBAAA,EAA0B;AAC5B,CAAA,CAAE;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createReceiverHandler.cjs","sources":["../../../../../../../../../src/grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/createReceiverHandler.ts"],"sourcesContent":["import { HttpResponse, http } from 'msw';\n\nimport {\n API_GROUP,\n API_VERSION,\n type CreateReceiverApiResponse,\n} from '@grafana/api-clients/rtkq/notifications.alerting/v0alpha1';\n\nimport { getAPIBaseURLForMocks } from '../../../../../../mocks/util';\n\nexport function createReceiverHandler(\n data: CreateReceiverApiResponse | ((info: Parameters<Parameters<typeof http.post>[1]>[0]) => Response)\n) {\n return http.post(getAPIBaseURLForMocks(API_GROUP, API_VERSION, '/receivers'), function handler(info) {\n if (typeof data === 'function') {\n return data(info);\n }\n\n return HttpResponse.json(data);\n });\n}\n"],"names":["http","getAPIBaseURLForMocks","API_GROUP","API_VERSION","HttpResponse"],"mappings":";;;;;;;;;AAUO,SAAS,sBACd,IAAA,EACA;AACA,EAAA,OAAOA,QAAA,CAAK,KAAKC,0BAAA,CAAsBC,kBAAA,EAAWC,sBAAa,YAAY,CAAA,EAAG,SAAS,OAAA,CAAQ,IAAA,EAAM;AACnG,IAAA,IAAI,OAAO,SAAS,UAAA,EAAY;AAC9B,MAAA,OAAO,KAAK,IAAI,CAAA;AAAA,IAClB;AAEA,IAAA,OAAOC,gBAAA,CAAa,KAAK,IAAI,CAAA;AAAA,EAC/B,CAAC,CAAA;AACH;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deleteReceiverHandler.cjs","sources":["../../../../../../../../../src/grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/deleteReceiverHandler.ts"],"sourcesContent":["import { HttpResponse, http } from 'msw';\n\nimport {\n API_GROUP,\n API_VERSION,\n type DeleteReceiverApiResponse,\n} from '@grafana/api-clients/rtkq/notifications.alerting/v0alpha1';\n\nimport { getAPIBaseURLForMocks } from '../../../../../../mocks/util';\n\nexport function deleteReceiverHandler(\n data: DeleteReceiverApiResponse | ((info: Parameters<Parameters<typeof http.delete>[1]>[0]) => Response)\n) {\n return http.delete(getAPIBaseURLForMocks(API_GROUP, API_VERSION, '/receivers/:name'), function handler(info) {\n if (typeof data === 'function') {\n return data(info);\n }\n\n return HttpResponse.json(data);\n });\n}\n"],"names":["http","getAPIBaseURLForMocks","API_GROUP","API_VERSION","HttpResponse"],"mappings":";;;;;;;;;AAUO,SAAS,sBACd,IAAA,EACA;AACA,EAAA,OAAOA,QAAA,CAAK,OAAOC,0BAAA,CAAsBC,kBAAA,EAAWC,sBAAa,kBAAkB,CAAA,EAAG,SAAS,OAAA,CAAQ,IAAA,EAAM;AAC3G,IAAA,IAAI,OAAO,SAAS,UAAA,EAAY;AAC9B,MAAA,OAAO,KAAK,IAAI,CAAA;AAAA,IAClB;AAEA,IAAA,OAAOC,gBAAA,CAAa,KAAK,IAAI,CAAA;AAAA,EAC/B,CAAC,CAAA;AACH;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deletecollectionReceiverHandler.cjs","sources":["../../../../../../../../../src/grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/deletecollectionReceiverHandler.ts"],"sourcesContent":["import { HttpResponse, http } from 'msw';\n\nimport {\n API_GROUP,\n API_VERSION,\n type DeletecollectionReceiverApiResponse,\n} from '@grafana/api-clients/rtkq/notifications.alerting/v0alpha1';\n\nimport { getAPIBaseURLForMocks } from '../../../../../../mocks/util';\n\nexport function deletecollectionReceiverHandler(\n data: DeletecollectionReceiverApiResponse | ((info: Parameters<Parameters<typeof http.delete>[1]>[0]) => Response)\n) {\n return http.delete(getAPIBaseURLForMocks(API_GROUP, API_VERSION, '/receivers'), function handler(info) {\n if (typeof data === 'function') {\n return data(info);\n }\n\n return HttpResponse.json(data);\n });\n}\n"],"names":["http","getAPIBaseURLForMocks","API_GROUP","API_VERSION","HttpResponse"],"mappings":";;;;;;;;;AAUO,SAAS,gCACd,IAAA,EACA;AACA,EAAA,OAAOA,QAAA,CAAK,OAAOC,0BAAA,CAAsBC,kBAAA,EAAWC,sBAAa,YAAY,CAAA,EAAG,SAAS,OAAA,CAAQ,IAAA,EAAM;AACrG,IAAA,IAAI,OAAO,SAAS,UAAA,EAAY;AAC9B,MAAA,OAAO,KAAK,IAAI,CAAA;AAAA,IAClB;AAEA,IAAA,OAAOC,gBAAA,CAAa,KAAK,IAAI,CAAA;AAAA,EAC/B,CAAC,CAAA;AACH;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getReceiverHandler.cjs","sources":["../../../../../../../../../src/grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/getReceiverHandler.ts"],"sourcesContent":["import { HttpResponse, http } from 'msw';\n\nimport {\n API_GROUP,\n API_VERSION,\n type GetReceiverApiResponse,\n} from '@grafana/api-clients/rtkq/notifications.alerting/v0alpha1';\n\nimport { getAPIBaseURLForMocks } from '../../../../../../mocks/util';\n\nexport function getReceiverHandler(\n data: GetReceiverApiResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Response)\n) {\n return http.get(getAPIBaseURLForMocks(API_GROUP, API_VERSION, '/receivers/:name'), function handler(info) {\n if (typeof data === 'function') {\n return data(info);\n }\n\n return HttpResponse.json(data);\n });\n}\n"],"names":["http","getAPIBaseURLForMocks","API_GROUP","API_VERSION","HttpResponse"],"mappings":";;;;;;;;;AAUO,SAAS,mBACd,IAAA,EACA;AACA,EAAA,OAAOA,QAAA,CAAK,IAAIC,0BAAA,CAAsBC,kBAAA,EAAWC,sBAAa,kBAAkB,CAAA,EAAG,SAAS,OAAA,CAAQ,IAAA,EAAM;AACxG,IAAA,IAAI,OAAO,SAAS,UAAA,EAAY;AAC9B,MAAA,OAAO,KAAK,IAAI,CAAA;AAAA,IAClB;AAEA,IAAA,OAAOC,gBAAA,CAAa,KAAK,IAAI,CAAA;AAAA,EAC/B,CAAC,CAAA;AACH;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"listReceiverHandler.cjs","sources":["../../../../../../../../../src/grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/listReceiverHandler.ts"],"sourcesContent":["import { HttpResponse, http } from 'msw';\n\nimport { API_GROUP, API_VERSION } from '@grafana/api-clients/rtkq/notifications.alerting/v0alpha1';\n\nimport { getAPIBaseURLForMocks } from '../../../../../../mocks/util';\nimport { type EnhancedListReceiverApiResponse } from '../../../types';\n\nexport function listReceiverHandler(\n data: EnhancedListReceiverApiResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Response)\n) {\n return http.get(getAPIBaseURLForMocks(API_GROUP, API_VERSION, '/receivers'), function handler(info) {\n if (typeof data === 'function') {\n return data(info);\n }\n\n return HttpResponse.json(data);\n });\n}\n"],"names":["http","getAPIBaseURLForMocks","API_GROUP","API_VERSION","HttpResponse"],"mappings":";;;;;;;;;AAOO,SAAS,oBACd,IAAA,EACA;AACA,EAAA,OAAOA,QAAA,CAAK,IAAIC,0BAAA,CAAsBC,kBAAA,EAAWC,sBAAa,YAAY,CAAA,EAAG,SAAS,OAAA,CAAQ,IAAA,EAAM;AAClG,IAAA,IAAI,OAAO,SAAS,UAAA,EAAY;AAC9B,MAAA,OAAO,KAAK,IAAI,CAAA;AAAA,IAClB;AAEA,IAAA,OAAOC,gBAAA,CAAa,KAAK,IAAI,CAAA;AAAA,EAC/B,CAAC,CAAA;AACH;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"replaceReceiverHandler.cjs","sources":["../../../../../../../../../src/grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/replaceReceiverHandler.ts"],"sourcesContent":["import { HttpResponse, http } from 'msw';\n\nimport {\n API_GROUP,\n API_VERSION,\n type ReplaceReceiverApiResponse,\n} from '@grafana/api-clients/rtkq/notifications.alerting/v0alpha1';\n\nimport { getAPIBaseURLForMocks } from '../../../../../../mocks/util';\n\nexport function replaceReceiverHandler(\n data: ReplaceReceiverApiResponse | ((info: Parameters<Parameters<typeof http.put>[1]>[0]) => Response)\n) {\n return http.put(getAPIBaseURLForMocks(API_GROUP, API_VERSION, '/receivers/:name'), function handler(info) {\n if (typeof data === 'function') {\n return data(info);\n }\n\n return HttpResponse.json(data);\n });\n}\n"],"names":["http","getAPIBaseURLForMocks","API_GROUP","API_VERSION","HttpResponse"],"mappings":";;;;;;;;;AAUO,SAAS,uBACd,IAAA,EACA;AACA,EAAA,OAAOA,QAAA,CAAK,IAAIC,0BAAA,CAAsBC,kBAAA,EAAWC,sBAAa,kBAAkB,CAAA,EAAG,SAAS,OAAA,CAAQ,IAAA,EAAM;AACxG,IAAA,IAAI,OAAO,SAAS,UAAA,EAAY;AAC9B,MAAA,OAAO,KAAK,IAAI,CAAA;AAAA,IAClB;AAEA,IAAA,OAAOC,gBAAA,CAAa,KAAK,IAAI,CAAA;AAAA,EAC/B,CAAC,CAAA;AACH;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"updateReceiverHandler.cjs","sources":["../../../../../../../../../src/grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/updateReceiverHandler.ts"],"sourcesContent":["import { HttpResponse, http } from 'msw';\n\nimport {\n API_GROUP,\n API_VERSION,\n type UpdateReceiverApiResponse,\n} from '@grafana/api-clients/rtkq/notifications.alerting/v0alpha1';\n\nimport { getAPIBaseURLForMocks } from '../../../../../../mocks/util';\n\nexport function updateReceiverHandler(\n data: UpdateReceiverApiResponse | ((info: Parameters<Parameters<typeof http.patch>[1]>[0]) => Response)\n) {\n return http.patch(getAPIBaseURLForMocks(API_GROUP, API_VERSION, '/receivers/:name'), function handler(info) {\n if (typeof data === 'function') {\n return data(info);\n }\n\n return HttpResponse.json(data);\n });\n}\n"],"names":["http","getAPIBaseURLForMocks","API_GROUP","API_VERSION","HttpResponse"],"mappings":";;;;;;;;;AAUO,SAAS,sBACd,IAAA,EACA;AACA,EAAA,OAAOA,QAAA,CAAK,MAAMC,0BAAA,CAAsBC,kBAAA,EAAWC,sBAAa,kBAAkB,CAAA,EAAG,SAAS,OAAA,CAAQ,IAAA,EAAM;AAC1G,IAAA,IAAI,OAAO,SAAS,UAAA,EAAY;AAC9B,MAAA,OAAO,KAAK,IAAI,CAAA;AAAA,IAClB;AAEA,IAAA,OAAOC,gBAAA,CAAa,KAAK,IAAI,CAAA;AAAA,EAC/B,CAAC,CAAA;AACH;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"listRoutingTreeHandler.cjs","sources":["../../../../../../../../../src/grafana/api/notifications/v0alpha1/mocks/handlers/RoutingTreeHandlers/listRoutingTreeHandler.ts"],"sourcesContent":["import { HttpResponse, http } from 'msw';\n\nimport {\n API_GROUP,\n API_VERSION,\n type ListRoutingTreeApiResponse,\n} from '@grafana/api-clients/rtkq/notifications.alerting/v0alpha1';\n\nimport { getAPIBaseURLForMocks } from '../../../../../../mocks/util';\n\nexport function listRoutingTreeHandler(\n data: ListRoutingTreeApiResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Response)\n) {\n return http.get(getAPIBaseURLForMocks(API_GROUP, API_VERSION, '/routingtrees'), function handler(info) {\n if (typeof data === 'function') {\n return data(info);\n }\n\n return HttpResponse.json(data);\n });\n}\n"],"names":["http","getAPIBaseURLForMocks","API_GROUP","API_VERSION","HttpResponse"],"mappings":";;;;;;;;;AAUO,SAAS,uBACd,IAAA,EACA;AACA,EAAA,OAAOA,QAAA,CAAK,IAAIC,0BAAA,CAAsBC,kBAAA,EAAWC,sBAAa,eAAe,CAAA,EAAG,SAAS,OAAA,CAAQ,IAAA,EAAM;AACrG,IAAA,IAAI,OAAO,SAAS,UAAA,EAAY;AAC9B,MAAA,OAAO,KAAK,IAAI,CAAA;AAAA,IAClB;AAEA,IAAA,OAAOC,gBAAA,CAAa,KAAK,IAAI,CAAA;AAAA,EAC/B,CAAC,CAAA;AACH;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useContactPoints.cjs","sources":["../../../../../../src/grafana/contactPoints/hooks/v0alpha1/useContactPoints.tsx"],"sourcesContent":["import { type TypedUseQueryHookResult, type fetchBaseQuery } from '@reduxjs/toolkit/query/react';\n\nimport {\n type ListReceiverApiArg,\n generatedAPI as notificationsAPIv0alpha1,\n} from '@grafana/api-clients/rtkq/notifications.alerting/v0alpha1';\n\nimport type { EnhancedListReceiverApiResponse } from '../../../api/notifications/v0alpha1/types';\n\n// this is a workaround for the fact that the generated types are not narrow enough\ntype ListContactPointsHookResult = TypedUseQueryHookResult<\n EnhancedListReceiverApiResponse,\n ListReceiverApiArg,\n ReturnType<typeof fetchBaseQuery>\n>;\n\n// Type for the options that can be passed to the hook\n// Based on the pattern used for mutation options in this file\ntype ListContactPointsQueryArgs = Parameters<\n typeof notificationsAPIv0alpha1.endpoints.listReceiver.useQuery<ListContactPointsHookResult>\n>[0];\n\ntype ListContactPointsQueryOptions = Parameters<\n typeof notificationsAPIv0alpha1.endpoints.listReceiver.useQuery<ListContactPointsHookResult>\n>[1];\n\n/**\n * useListContactPoints is a hook that fetches a list of contact points\n *\n * This function wraps the notificationsAPIv0alpha1.useListReceiverQuery with proper typing\n * to ensure that the returned ContactPoints are correctly typed in the data.items array.\n *\n * It automatically uses the configured namespace for the query.\n *\n * @param queryOptions - Optional query options that will be passed to the underlying useListReceiverQuery hook.\n * These options can include refetchOnFocus, refetchOnMountOrArgChange, skip, etc.\n */\nexport function useListContactPoints(\n queryArgs: ListContactPointsQueryArgs = {},\n queryOptions: ListContactPointsQueryOptions = {}\n): ListContactPointsHookResult {\n return notificationsAPIv0alpha1.useListReceiverQuery<ListContactPointsHookResult>(queryArgs, queryOptions);\n}\n"],"names":["notificationsAPIv0alpha1"],"mappings":";;;;;;;AAqCO,SAAS,qBACd,SAAA,GAAwC,EAAC,EACzC,YAAA,GAA8C,EAAC,EAClB;AAC7B,EAAA,OAAOA,qBAAA,CAAyB,oBAAA,CAAkD,SAAA,EAAW,YAAY,CAAA;AAC3G;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Receivers.mjs","sources":["../../../../../../../../src/grafana/api/notifications/v0alpha1/mocks/fakes/Receivers.ts"],"sourcesContent":["import { faker } from '@faker-js/faker';\nimport { Factory } from 'fishery';\n\nimport { API_GROUP, API_VERSION } from '@grafana/api-clients/rtkq/notifications.alerting/v0alpha1';\n\nimport { DEFAULT_NAMESPACE, generateResourceVersion, generateTitle, generateUID } from '../../../../../mocks/util';\nimport {\n type ContactPoint,\n type ContactPointMetadataAnnotations,\n type EnhancedListReceiverApiResponse,\n type Integration,\n} from '../../types';\n\nimport { AlertingEntityMetadataAnnotationsFactory } from './common';\n\nexport const ListReceiverApiResponseFactory = Factory.define<EnhancedListReceiverApiResponse>(() => ({\n kind: 'ReceiverList',\n apiVersion: `${API_GROUP}/${API_VERSION}`,\n metadata: {\n resourceVersion: generateResourceVersion(),\n },\n items: ContactPointFactory.buildList(5),\n}));\n\nexport const ContactPointFactory = Factory.define<ContactPoint>(() => {\n const title = generateTitle();\n\n return {\n kind: 'Receiver',\n apiVersion: `${API_GROUP}/${API_VERSION}`,\n metadata: {\n name: btoa(title),\n namespace: DEFAULT_NAMESPACE,\n uid: generateUID(),\n resourceVersion: generateResourceVersion(),\n annotations: ContactPointMetadataAnnotationsFactory.build(),\n },\n spec: ContactPointSpecFactory.build({ title }),\n status: {},\n };\n});\n\nexport const ContactPointSpecFactory = Factory.define<ContactPoint['spec']>(() => ({\n title: generateTitle(),\n // use two unique random integrations by default\n integrations: faker.helpers.uniqueArray(IntegrationUnion, 2).map((integration) => integration.build()),\n}));\n\nexport const GenericIntegrationFactory = Factory.define<Integration>(() => ({\n type: 'generic',\n version: '1',\n disableResolveMessage: false,\n settings: {\n foo: 'bar',\n },\n}));\n\nexport const EmailIntegrationFactory = Factory.define<Integration>(() => ({\n type: 'email',\n version: '1',\n secureFields: {},\n settings: {\n addresses: faker.internet.email(),\n },\n}));\n\nexport const SlackIntegrationFactory = Factory.define<Integration>(() => ({\n type: 'slack',\n version: '1',\n secureFields: { token: true },\n settings: {\n mentionChannel: '#alerts',\n },\n}));\n\nconst IntegrationUnion = [EmailIntegrationFactory, SlackIntegrationFactory];\n\n// by default the contact points will be in use by a route and a rule\nexport const ContactPointMetadataAnnotationsFactory = Factory.define<ContactPointMetadataAnnotations>(() => ({\n 'grafana.com/access/canReadSecrets': 'true',\n 'grafana.com/inUse/routes': '1',\n 'grafana.com/inUse/rules': '1',\n 'grafana.com/canUse': 'true',\n ...AlertingEntityMetadataAnnotationsFactory.build(),\n}));\n"],"names":[],"mappings":";;;;;;;AAeO,MAAM,8BAAA,GAAiC,OAAA,CAAQ,MAAA,CAAwC,OAAO;AAAA,EACnG,IAAA,EAAM,cAAA;AAAA,EACN,UAAA,EAAY,CAAA,EAAG,SAAS,CAAA,CAAA,EAAI,WAAW,CAAA,CAAA;AAAA,EACvC,QAAA,EAAU;AAAA,IACR,iBAAiB,uBAAA;AAAwB,GAC3C;AAAA,EACA,KAAA,EAAO,mBAAA,CAAoB,SAAA,CAAU,CAAC;AACxC,CAAA,CAAE;AAEK,MAAM,mBAAA,GAAsB,OAAA,CAAQ,MAAA,CAAqB,MAAM;AACpE,EAAA,MAAM,QAAQ,aAAA,EAAc;AAE5B,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,UAAA;AAAA,IACN,UAAA,EAAY,CAAA,EAAG,SAAS,CAAA,CAAA,EAAI,WAAW,CAAA,CAAA;AAAA,IACvC,QAAA,EAAU;AAAA,MACR,IAAA,EAAM,KAAK,KAAK,CAAA;AAAA,MAChB,SAAA,EAAW,iBAAA;AAAA,MACX,KAAK,WAAA,EAAY;AAAA,MACjB,iBAAiB,uBAAA,EAAwB;AAAA,MACzC,WAAA,EAAa,uCAAuC,KAAA;AAAM,KAC5D;AAAA,IACA,IAAA,EAAM,uBAAA,CAAwB,KAAA,CAAM,EAAE,OAAO,CAAA;AAAA,IAC7C,QAAQ;AAAC,GACX;AACF,CAAC;AAEM,MAAM,uBAAA,GAA0B,OAAA,CAAQ,MAAA,CAA6B,OAAO;AAAA,EACjF,OAAO,aAAA,EAAc;AAAA;AAAA,EAErB,YAAA,EAAc,KAAA,CAAM,OAAA,CAAQ,WAAA,CAAY,gBAAA,EAAkB,CAAC,CAAA,CAAE,GAAA,CAAI,CAAC,WAAA,KAAgB,WAAA,CAAY,KAAA,EAAO;AACvG,CAAA,CAAE;AAEK,MAAM,yBAAA,GAA4B,OAAA,CAAQ,MAAA,CAAoB,OAAO;AAAA,EAC1E,IAAA,EAAM,SAAA;AAAA,EACN,OAAA,EAAS,GAAA;AAAA,EACT,qBAAA,EAAuB,KAAA;AAAA,EACvB,QAAA,EAAU;AAAA,IACR,GAAA,EAAK;AAAA;AAET,CAAA,CAAE;AAEK,MAAM,uBAAA,GAA0B,OAAA,CAAQ,MAAA,CAAoB,OAAO;AAAA,EACxE,IAAA,EAAM,OAAA;AAAA,EACN,OAAA,EAAS,GAAA;AAAA,EACT,cAAc,EAAC;AAAA,EACf,QAAA,EAAU;AAAA,IACR,SAAA,EAAW,KAAA,CAAM,QAAA,CAAS,KAAA;AAAM;AAEpC,CAAA,CAAE;AAEK,MAAM,uBAAA,GAA0B,OAAA,CAAQ,MAAA,CAAoB,OAAO;AAAA,EACxE,IAAA,EAAM,OAAA;AAAA,EACN,OAAA,EAAS,GAAA;AAAA,EACT,YAAA,EAAc,EAAE,KAAA,EAAO,IAAA,EAAK;AAAA,EAC5B,QAAA,EAAU;AAAA,IACR,cAAA,EAAgB;AAAA;AAEpB,CAAA,CAAE;AAEF,MAAM,gBAAA,GAAmB,CAAC,uBAAA,EAAyB,uBAAuB,CAAA;AAGnE,MAAM,sCAAA,GAAyC,OAAA,CAAQ,MAAA,CAAwC,OAAO;AAAA,EAC3G,mCAAA,EAAqC,MAAA;AAAA,EACrC,0BAAA,EAA4B,GAAA;AAAA,EAC5B,yBAAA,EAA2B,GAAA;AAAA,EAC3B,oBAAA,EAAsB,MAAA;AAAA,EACtB,GAAG,yCAAyC,KAAA;AAC9C,CAAA,CAAE;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Routes.mjs","sources":["../../../../../../../../src/grafana/api/notifications/v0alpha1/mocks/fakes/Routes.ts"],"sourcesContent":["import { faker } from '@faker-js/faker';\nimport { Factory } from 'fishery';\n\nimport {\n API_GROUP,\n API_VERSION,\n type ListRoutingTreeApiResponse,\n type RoutingTree,\n} from '@grafana/api-clients/rtkq/notifications.alerting/v0alpha1';\n\nimport { type LabelMatcher } from '../../../../../matchers/types';\nimport { DEFAULT_NAMESPACE, generateResourceVersion } from '../../../../../mocks/util';\nimport { USER_DEFINED_TREE_NAME } from '../../../../../notificationPolicies/routingTrees';\nimport { type Route } from '../../../../../notificationPolicies/types';\n\nexport const LabelMatcherFactory = Factory.define<LabelMatcher>(() => {\n const operators: Array<LabelMatcher['type']> = ['=', '!=', '=~', '!~'];\n\n return {\n label: faker.helpers.arrayElement(['service', 'env', 'team', 'severity', 'region', 'instance']),\n type: faker.helpers.arrayElement(operators),\n value: faker.helpers.arrayElement(['web', 'api', 'prod', 'staging', 'critical', 'warning', 'us-east', 'us-west']),\n };\n});\n\nexport const RouteFactory = Factory.define<Route>(() => ({\n continue: faker.datatype.boolean(),\n receiver: faker.helpers.arrayElement(['web-team', 'api-team', 'critical-alerts', 'dev-team']),\n matchers: LabelMatcherFactory.buildList(faker.number.int({ min: 1, max: 3 })),\n group_by: faker.helpers.arrayElements(['alertname', 'service', 'severity'], { min: 1, max: 2 }),\n group_wait: faker.helpers.arrayElement(['10s', '30s', '1m']),\n group_interval: faker.helpers.arrayElement(['5m', '10m', '15m']),\n repeat_interval: faker.helpers.arrayElement(['1h', '4h', '12h']),\n active_time_intervals: faker.helpers.arrayElements(['business-hours', 'weekends', 'maintenance'], { min: 1, max: 2 }),\n mute_time_intervals: faker.helpers.arrayElements(['lunch-break', 'night-hours'], { min: 1, max: 2 }),\n routes: [],\n}));\n\nexport const RoutingTreeFactory = Factory.define<RoutingTree>(({ sequence }) => {\n const name = sequence === 1 ? USER_DEFINED_TREE_NAME : `policy-tree-${sequence}`;\n\n return {\n kind: 'RoutingTree',\n apiVersion: `${API_GROUP}/${API_VERSION}`,\n metadata: {\n name,\n namespace: DEFAULT_NAMESPACE,\n resourceVersion: generateResourceVersion(),\n },\n spec: {\n defaults: {\n receiver: faker.helpers.arrayElement(['web-team', 'api-team', 'critical-alerts', 'dev-team']),\n group_by: ['alertname'],\n group_wait: '30s',\n group_interval: '5m',\n repeat_interval: '4h',\n },\n routes: [],\n },\n };\n});\n\nexport const ListRoutingTreeApiResponseFactory = Factory.define<ListRoutingTreeApiResponse>(() => ({\n kind: 'RoutingTreeList',\n apiVersion: `${API_GROUP}/${API_VERSION}`,\n metadata: {\n resourceVersion: generateResourceVersion(),\n },\n items: RoutingTreeFactory.buildList(3),\n}));\n"],"names":[],"mappings":"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"common.mjs","sources":["../../../../../../../../src/grafana/api/notifications/v0alpha1/mocks/fakes/common.ts"],"sourcesContent":["import { Factory } from 'fishery';\n\nimport { type AlertingEntityMetadataAnnotations } from '../../types';\n\nexport const AlertingEntityMetadataAnnotationsFactory = Factory.define<AlertingEntityMetadataAnnotations>(() => ({\n 'grafana.com/access/canAdmin': 'true',\n 'grafana.com/access/canDelete': 'true',\n 'grafana.com/access/canWrite': 'true',\n 'grafana.com/provenance': '',\n}));\n"],"names":[],"mappings":";;;AAIO,MAAM,wCAAA,GAA2C,OAAA,CAAQ,MAAA,CAA0C,OAAO;AAAA,EAC/G,6BAAA,EAA+B,MAAA;AAAA,EAC/B,8BAAA,EAAgC,MAAA;AAAA,EAChC,6BAAA,EAA+B,MAAA;AAAA,EAC/B,wBAAA,EAA0B;AAC5B,CAAA,CAAE;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createReceiverHandler.mjs","sources":["../../../../../../../../../src/grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/createReceiverHandler.ts"],"sourcesContent":["import { HttpResponse, http } from 'msw';\n\nimport {\n API_GROUP,\n API_VERSION,\n type CreateReceiverApiResponse,\n} from '@grafana/api-clients/rtkq/notifications.alerting/v0alpha1';\n\nimport { getAPIBaseURLForMocks } from '../../../../../../mocks/util';\n\nexport function createReceiverHandler(\n data: CreateReceiverApiResponse | ((info: Parameters<Parameters<typeof http.post>[1]>[0]) => Response)\n) {\n return http.post(getAPIBaseURLForMocks(API_GROUP, API_VERSION, '/receivers'), function handler(info) {\n if (typeof data === 'function') {\n return data(info);\n }\n\n return HttpResponse.json(data);\n });\n}\n"],"names":[],"mappings":";;;;;AAUO,SAAS,sBACd,IAAA,EACA;AACA,EAAA,OAAO,IAAA,CAAK,KAAK,qBAAA,CAAsB,SAAA,EAAW,aAAa,YAAY,CAAA,EAAG,SAAS,OAAA,CAAQ,IAAA,EAAM;AACnG,IAAA,IAAI,OAAO,SAAS,UAAA,EAAY;AAC9B,MAAA,OAAO,KAAK,IAAI,CAAA;AAAA,IAClB;AAEA,IAAA,OAAO,YAAA,CAAa,KAAK,IAAI,CAAA;AAAA,EAC/B,CAAC,CAAA;AACH;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deleteReceiverHandler.mjs","sources":["../../../../../../../../../src/grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/deleteReceiverHandler.ts"],"sourcesContent":["import { HttpResponse, http } from 'msw';\n\nimport {\n API_GROUP,\n API_VERSION,\n type DeleteReceiverApiResponse,\n} from '@grafana/api-clients/rtkq/notifications.alerting/v0alpha1';\n\nimport { getAPIBaseURLForMocks } from '../../../../../../mocks/util';\n\nexport function deleteReceiverHandler(\n data: DeleteReceiverApiResponse | ((info: Parameters<Parameters<typeof http.delete>[1]>[0]) => Response)\n) {\n return http.delete(getAPIBaseURLForMocks(API_GROUP, API_VERSION, '/receivers/:name'), function handler(info) {\n if (typeof data === 'function') {\n return data(info);\n }\n\n return HttpResponse.json(data);\n });\n}\n"],"names":[],"mappings":";;;;;AAUO,SAAS,sBACd,IAAA,EACA;AACA,EAAA,OAAO,IAAA,CAAK,OAAO,qBAAA,CAAsB,SAAA,EAAW,aAAa,kBAAkB,CAAA,EAAG,SAAS,OAAA,CAAQ,IAAA,EAAM;AAC3G,IAAA,IAAI,OAAO,SAAS,UAAA,EAAY;AAC9B,MAAA,OAAO,KAAK,IAAI,CAAA;AAAA,IAClB;AAEA,IAAA,OAAO,YAAA,CAAa,KAAK,IAAI,CAAA;AAAA,EAC/B,CAAC,CAAA;AACH;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deletecollectionReceiverHandler.mjs","sources":["../../../../../../../../../src/grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/deletecollectionReceiverHandler.ts"],"sourcesContent":["import { HttpResponse, http } from 'msw';\n\nimport {\n API_GROUP,\n API_VERSION,\n type DeletecollectionReceiverApiResponse,\n} from '@grafana/api-clients/rtkq/notifications.alerting/v0alpha1';\n\nimport { getAPIBaseURLForMocks } from '../../../../../../mocks/util';\n\nexport function deletecollectionReceiverHandler(\n data: DeletecollectionReceiverApiResponse | ((info: Parameters<Parameters<typeof http.delete>[1]>[0]) => Response)\n) {\n return http.delete(getAPIBaseURLForMocks(API_GROUP, API_VERSION, '/receivers'), function handler(info) {\n if (typeof data === 'function') {\n return data(info);\n }\n\n return HttpResponse.json(data);\n });\n}\n"],"names":[],"mappings":";;;;;AAUO,SAAS,gCACd,IAAA,EACA;AACA,EAAA,OAAO,IAAA,CAAK,OAAO,qBAAA,CAAsB,SAAA,EAAW,aAAa,YAAY,CAAA,EAAG,SAAS,OAAA,CAAQ,IAAA,EAAM;AACrG,IAAA,IAAI,OAAO,SAAS,UAAA,EAAY;AAC9B,MAAA,OAAO,KAAK,IAAI,CAAA;AAAA,IAClB;AAEA,IAAA,OAAO,YAAA,CAAa,KAAK,IAAI,CAAA;AAAA,EAC/B,CAAC,CAAA;AACH;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getReceiverHandler.mjs","sources":["../../../../../../../../../src/grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/getReceiverHandler.ts"],"sourcesContent":["import { HttpResponse, http } from 'msw';\n\nimport {\n API_GROUP,\n API_VERSION,\n type GetReceiverApiResponse,\n} from '@grafana/api-clients/rtkq/notifications.alerting/v0alpha1';\n\nimport { getAPIBaseURLForMocks } from '../../../../../../mocks/util';\n\nexport function getReceiverHandler(\n data: GetReceiverApiResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Response)\n) {\n return http.get(getAPIBaseURLForMocks(API_GROUP, API_VERSION, '/receivers/:name'), function handler(info) {\n if (typeof data === 'function') {\n return data(info);\n }\n\n return HttpResponse.json(data);\n });\n}\n"],"names":[],"mappings":";;;;;AAUO,SAAS,mBACd,IAAA,EACA;AACA,EAAA,OAAO,IAAA,CAAK,IAAI,qBAAA,CAAsB,SAAA,EAAW,aAAa,kBAAkB,CAAA,EAAG,SAAS,OAAA,CAAQ,IAAA,EAAM;AACxG,IAAA,IAAI,OAAO,SAAS,UAAA,EAAY;AAC9B,MAAA,OAAO,KAAK,IAAI,CAAA;AAAA,IAClB;AAEA,IAAA,OAAO,YAAA,CAAa,KAAK,IAAI,CAAA;AAAA,EAC/B,CAAC,CAAA;AACH;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"listReceiverHandler.mjs","sources":["../../../../../../../../../src/grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/listReceiverHandler.ts"],"sourcesContent":["import { HttpResponse, http } from 'msw';\n\nimport { API_GROUP, API_VERSION } from '@grafana/api-clients/rtkq/notifications.alerting/v0alpha1';\n\nimport { getAPIBaseURLForMocks } from '../../../../../../mocks/util';\nimport { type EnhancedListReceiverApiResponse } from '../../../types';\n\nexport function listReceiverHandler(\n data: EnhancedListReceiverApiResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Response)\n) {\n return http.get(getAPIBaseURLForMocks(API_GROUP, API_VERSION, '/receivers'), function handler(info) {\n if (typeof data === 'function') {\n return data(info);\n }\n\n return HttpResponse.json(data);\n });\n}\n"],"names":[],"mappings":";;;;;AAOO,SAAS,oBACd,IAAA,EACA;AACA,EAAA,OAAO,IAAA,CAAK,IAAI,qBAAA,CAAsB,SAAA,EAAW,aAAa,YAAY,CAAA,EAAG,SAAS,OAAA,CAAQ,IAAA,EAAM;AAClG,IAAA,IAAI,OAAO,SAAS,UAAA,EAAY;AAC9B,MAAA,OAAO,KAAK,IAAI,CAAA;AAAA,IAClB;AAEA,IAAA,OAAO,YAAA,CAAa,KAAK,IAAI,CAAA;AAAA,EAC/B,CAAC,CAAA;AACH;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"replaceReceiverHandler.mjs","sources":["../../../../../../../../../src/grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/replaceReceiverHandler.ts"],"sourcesContent":["import { HttpResponse, http } from 'msw';\n\nimport {\n API_GROUP,\n API_VERSION,\n type ReplaceReceiverApiResponse,\n} from '@grafana/api-clients/rtkq/notifications.alerting/v0alpha1';\n\nimport { getAPIBaseURLForMocks } from '../../../../../../mocks/util';\n\nexport function replaceReceiverHandler(\n data: ReplaceReceiverApiResponse | ((info: Parameters<Parameters<typeof http.put>[1]>[0]) => Response)\n) {\n return http.put(getAPIBaseURLForMocks(API_GROUP, API_VERSION, '/receivers/:name'), function handler(info) {\n if (typeof data === 'function') {\n return data(info);\n }\n\n return HttpResponse.json(data);\n });\n}\n"],"names":[],"mappings":";;;;;AAUO,SAAS,uBACd,IAAA,EACA;AACA,EAAA,OAAO,IAAA,CAAK,IAAI,qBAAA,CAAsB,SAAA,EAAW,aAAa,kBAAkB,CAAA,EAAG,SAAS,OAAA,CAAQ,IAAA,EAAM;AACxG,IAAA,IAAI,OAAO,SAAS,UAAA,EAAY;AAC9B,MAAA,OAAO,KAAK,IAAI,CAAA;AAAA,IAClB;AAEA,IAAA,OAAO,YAAA,CAAa,KAAK,IAAI,CAAA;AAAA,EAC/B,CAAC,CAAA;AACH;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"updateReceiverHandler.mjs","sources":["../../../../../../../../../src/grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/updateReceiverHandler.ts"],"sourcesContent":["import { HttpResponse, http } from 'msw';\n\nimport {\n API_GROUP,\n API_VERSION,\n type UpdateReceiverApiResponse,\n} from '@grafana/api-clients/rtkq/notifications.alerting/v0alpha1';\n\nimport { getAPIBaseURLForMocks } from '../../../../../../mocks/util';\n\nexport function updateReceiverHandler(\n data: UpdateReceiverApiResponse | ((info: Parameters<Parameters<typeof http.patch>[1]>[0]) => Response)\n) {\n return http.patch(getAPIBaseURLForMocks(API_GROUP, API_VERSION, '/receivers/:name'), function handler(info) {\n if (typeof data === 'function') {\n return data(info);\n }\n\n return HttpResponse.json(data);\n });\n}\n"],"names":[],"mappings":";;;;;AAUO,SAAS,sBACd,IAAA,EACA;AACA,EAAA,OAAO,IAAA,CAAK,MAAM,qBAAA,CAAsB,SAAA,EAAW,aAAa,kBAAkB,CAAA,EAAG,SAAS,OAAA,CAAQ,IAAA,EAAM;AAC1G,IAAA,IAAI,OAAO,SAAS,UAAA,EAAY;AAC9B,MAAA,OAAO,KAAK,IAAI,CAAA;AAAA,IAClB;AAEA,IAAA,OAAO,YAAA,CAAa,KAAK,IAAI,CAAA;AAAA,EAC/B,CAAC,CAAA;AACH;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"listRoutingTreeHandler.mjs","sources":["../../../../../../../../../src/grafana/api/notifications/v0alpha1/mocks/handlers/RoutingTreeHandlers/listRoutingTreeHandler.ts"],"sourcesContent":["import { HttpResponse, http } from 'msw';\n\nimport {\n API_GROUP,\n API_VERSION,\n type ListRoutingTreeApiResponse,\n} from '@grafana/api-clients/rtkq/notifications.alerting/v0alpha1';\n\nimport { getAPIBaseURLForMocks } from '../../../../../../mocks/util';\n\nexport function listRoutingTreeHandler(\n data: ListRoutingTreeApiResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Response)\n) {\n return http.get(getAPIBaseURLForMocks(API_GROUP, API_VERSION, '/routingtrees'), function handler(info) {\n if (typeof data === 'function') {\n return data(info);\n }\n\n return HttpResponse.json(data);\n });\n}\n"],"names":[],"mappings":";;;;;AAUO,SAAS,uBACd,IAAA,EACA;AACA,EAAA,OAAO,IAAA,CAAK,IAAI,qBAAA,CAAsB,SAAA,EAAW,aAAa,eAAe,CAAA,EAAG,SAAS,OAAA,CAAQ,IAAA,EAAM;AACrG,IAAA,IAAI,OAAO,SAAS,UAAA,EAAY;AAC9B,MAAA,OAAO,KAAK,IAAI,CAAA;AAAA,IAClB;AAEA,IAAA,OAAO,YAAA,CAAa,KAAK,IAAI,CAAA;AAAA,EAC/B,CAAC,CAAA;AACH;;;;"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useContactPoints.mjs","sources":["../../../../../../src/grafana/contactPoints/hooks/v0alpha1/useContactPoints.tsx"],"sourcesContent":["import { type TypedUseQueryHookResult, type fetchBaseQuery } from '@reduxjs/toolkit/query/react';\n\nimport {\n type ListReceiverApiArg,\n generatedAPI as notificationsAPIv0alpha1,\n} from '@grafana/api-clients/rtkq/notifications.alerting/v0alpha1';\n\nimport type { EnhancedListReceiverApiResponse } from '../../../api/notifications/v0alpha1/types';\n\n// this is a workaround for the fact that the generated types are not narrow enough\ntype ListContactPointsHookResult = TypedUseQueryHookResult<\n EnhancedListReceiverApiResponse,\n ListReceiverApiArg,\n ReturnType<typeof fetchBaseQuery>\n>;\n\n// Type for the options that can be passed to the hook\n// Based on the pattern used for mutation options in this file\ntype ListContactPointsQueryArgs = Parameters<\n typeof notificationsAPIv0alpha1.endpoints.listReceiver.useQuery<ListContactPointsHookResult>\n>[0];\n\ntype ListContactPointsQueryOptions = Parameters<\n typeof notificationsAPIv0alpha1.endpoints.listReceiver.useQuery<ListContactPointsHookResult>\n>[1];\n\n/**\n * useListContactPoints is a hook that fetches a list of contact points\n *\n * This function wraps the notificationsAPIv0alpha1.useListReceiverQuery with proper typing\n * to ensure that the returned ContactPoints are correctly typed in the data.items array.\n *\n * It automatically uses the configured namespace for the query.\n *\n * @param queryOptions - Optional query options that will be passed to the underlying useListReceiverQuery hook.\n * These options can include refetchOnFocus, refetchOnMountOrArgChange, skip, etc.\n */\nexport function useListContactPoints(\n queryArgs: ListContactPointsQueryArgs = {},\n queryOptions: ListContactPointsQueryOptions = {}\n): ListContactPointsHookResult {\n return notificationsAPIv0alpha1.useListReceiverQuery<ListContactPointsHookResult>(queryArgs, queryOptions);\n}\n"],"names":["notificationsAPIv0alpha1"],"mappings":";;;AAqCO,SAAS,qBACd,SAAA,GAAwC,EAAC,EACzC,YAAA,GAA8C,EAAC,EAClB;AAC7B,EAAA,OAAOA,YAAA,CAAyB,oBAAA,CAAkD,SAAA,EAAW,YAAY,CAAA;AAC3G;;;;"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { Factory } from 'fishery';
|
|
2
|
-
import { type RoutingTree } from '@grafana/api-clients/rtkq/notifications.alerting/v0alpha1';
|
|
3
|
-
import { type LabelMatcher } from '../../../../../matchers/types';
|
|
4
|
-
import { type Route } from '../../../../../notificationPolicies/types';
|
|
5
|
-
export declare const LabelMatcherFactory: Factory<import("@grafana/api-clients/rtkq/notifications.alerting/v0alpha1").RoutingTreeMatcher, any, import("@grafana/api-clients/rtkq/notifications.alerting/v0alpha1").RoutingTreeMatcher, import("fishery").DeepPartialObject<import("@grafana/api-clients/rtkq/notifications.alerting/v0alpha1").RoutingTreeMatcher>>;
|
|
6
|
-
export declare const RouteFactory: Factory<{
|
|
7
|
-
active_time_intervals?: string[] | undefined;
|
|
8
|
-
continue: boolean;
|
|
9
|
-
group_by?: string[] | undefined;
|
|
10
|
-
group_interval?: string | undefined;
|
|
11
|
-
group_wait?: string | undefined;
|
|
12
|
-
mute_time_intervals?: string[] | undefined;
|
|
13
|
-
receiver?: string | undefined;
|
|
14
|
-
repeat_interval?: string | undefined;
|
|
15
|
-
matchers?: LabelMatcher[] | undefined;
|
|
16
|
-
routes: Route[];
|
|
17
|
-
}, any, {
|
|
18
|
-
active_time_intervals?: string[] | undefined;
|
|
19
|
-
continue: boolean;
|
|
20
|
-
group_by?: string[] | undefined;
|
|
21
|
-
group_interval?: string | undefined;
|
|
22
|
-
group_wait?: string | undefined;
|
|
23
|
-
mute_time_intervals?: string[] | undefined;
|
|
24
|
-
receiver?: string | undefined;
|
|
25
|
-
repeat_interval?: string | undefined;
|
|
26
|
-
matchers?: LabelMatcher[] | undefined;
|
|
27
|
-
routes: Route[];
|
|
28
|
-
}, import("fishery").DeepPartialObject<{
|
|
29
|
-
active_time_intervals?: string[] | undefined;
|
|
30
|
-
continue: boolean;
|
|
31
|
-
group_by?: string[] | undefined;
|
|
32
|
-
group_interval?: string | undefined;
|
|
33
|
-
group_wait?: string | undefined;
|
|
34
|
-
mute_time_intervals?: string[] | undefined;
|
|
35
|
-
receiver?: string | undefined;
|
|
36
|
-
repeat_interval?: string | undefined;
|
|
37
|
-
matchers?: LabelMatcher[] | undefined;
|
|
38
|
-
routes: Route[];
|
|
39
|
-
}>>;
|
|
40
|
-
export declare const RoutingTreeFactory: Factory<RoutingTree, any, RoutingTree, import("fishery").DeepPartialObject<RoutingTree>>;
|
|
41
|
-
export declare const ListRoutingTreeApiResponseFactory: Factory<import("@grafana/api-clients/rtkq/notifications.alerting/v0alpha1").RoutingTreeList, any, import("@grafana/api-clients/rtkq/notifications.alerting/v0alpha1").RoutingTreeList, import("fishery").DeepPartialObject<import("@grafana/api-clients/rtkq/notifications.alerting/v0alpha1").RoutingTreeList>>;
|