@grafana/alerting 13.2.0-28908703397 → 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.
Files changed (150) hide show
  1. package/dist/cjs/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/fakes/Receivers.cjs +3 -3
  2. package/dist/cjs/grafana/api/notifications/v1beta1/mocks/fakes/Receivers.cjs.map +1 -0
  3. package/dist/cjs/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/fakes/Routes.cjs +3 -3
  4. package/dist/cjs/grafana/api/notifications/v1beta1/mocks/fakes/Routes.cjs.map +1 -0
  5. package/dist/cjs/grafana/api/notifications/v1beta1/mocks/fakes/common.cjs.map +1 -0
  6. package/dist/cjs/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/ReceiverHandlers/createReceiverHandler.cjs +2 -2
  7. package/dist/cjs/grafana/api/notifications/v1beta1/mocks/handlers/ReceiverHandlers/createReceiverHandler.cjs.map +1 -0
  8. package/dist/cjs/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/ReceiverHandlers/deleteReceiverHandler.cjs +2 -2
  9. package/dist/cjs/grafana/api/notifications/v1beta1/mocks/handlers/ReceiverHandlers/deleteReceiverHandler.cjs.map +1 -0
  10. package/dist/cjs/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/ReceiverHandlers/deletecollectionReceiverHandler.cjs +2 -2
  11. package/dist/cjs/grafana/api/notifications/v1beta1/mocks/handlers/ReceiverHandlers/deletecollectionReceiverHandler.cjs.map +1 -0
  12. package/dist/cjs/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/ReceiverHandlers/getReceiverHandler.cjs +2 -2
  13. package/dist/cjs/grafana/api/notifications/v1beta1/mocks/handlers/ReceiverHandlers/getReceiverHandler.cjs.map +1 -0
  14. package/dist/cjs/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/ReceiverHandlers/listReceiverHandler.cjs +2 -2
  15. package/dist/cjs/grafana/api/notifications/v1beta1/mocks/handlers/ReceiverHandlers/listReceiverHandler.cjs.map +1 -0
  16. package/dist/cjs/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/ReceiverHandlers/replaceReceiverHandler.cjs +2 -2
  17. package/dist/cjs/grafana/api/notifications/v1beta1/mocks/handlers/ReceiverHandlers/replaceReceiverHandler.cjs.map +1 -0
  18. package/dist/cjs/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/ReceiverHandlers/updateReceiverHandler.cjs +2 -2
  19. package/dist/cjs/grafana/api/notifications/v1beta1/mocks/handlers/ReceiverHandlers/updateReceiverHandler.cjs.map +1 -0
  20. package/dist/cjs/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/RoutingTreeHandlers/listRoutingTreeHandler.cjs +2 -2
  21. package/dist/cjs/grafana/api/notifications/v1beta1/mocks/handlers/RoutingTreeHandlers/listRoutingTreeHandler.cjs.map +1 -0
  22. package/dist/cjs/grafana/contactPoints/components/ContactPointSelector/ContactPointSelector.cjs +1 -1
  23. package/dist/cjs/grafana/contactPoints/components/ContactPointSelector/ContactPointSelector.cjs.map +1 -1
  24. package/dist/cjs/grafana/contactPoints/components/ContactPointSelector/ContactPointSelector.scenario.cjs +2 -2
  25. package/dist/cjs/grafana/contactPoints/components/ContactPointSelector/ContactPointSelector.scenario.cjs.map +1 -1
  26. package/dist/cjs/grafana/contactPoints/hooks/{v0alpha1 → v1beta1}/useContactPoints.cjs +2 -2
  27. package/dist/cjs/grafana/contactPoints/hooks/v1beta1/useContactPoints.cjs.map +1 -0
  28. package/dist/cjs/grafana/contactPoints/utils.cjs.map +1 -1
  29. package/dist/cjs/grafana/notificationPolicies/components/RoutingTreeSelector/RoutingTreeSelector.cjs.map +1 -1
  30. package/dist/cjs/grafana/notificationPolicies/components/RoutingTreeSelector/RoutingTreeSelector.scenario.cjs +2 -2
  31. package/dist/cjs/grafana/notificationPolicies/components/RoutingTreeSelector/RoutingTreeSelector.scenario.cjs.map +1 -1
  32. package/dist/cjs/grafana/notificationPolicies/hooks/useMatchPolicies.cjs +2 -2
  33. package/dist/cjs/grafana/notificationPolicies/hooks/useMatchPolicies.cjs.map +1 -1
  34. package/dist/cjs/grafana/notificationPolicies/hooks/useRoutingTrees.cjs +2 -2
  35. package/dist/cjs/grafana/notificationPolicies/hooks/useRoutingTrees.cjs.map +1 -1
  36. package/dist/cjs/grafana/notificationPolicies/routingTrees.cjs +1 -1
  37. package/dist/cjs/grafana/notificationPolicies/routingTrees.cjs.map +1 -1
  38. package/dist/cjs/grafana/notificationPolicies/utils.cjs.map +1 -1
  39. package/dist/cjs/testing.cjs +12 -12
  40. package/dist/cjs/unstable.cjs +7 -7
  41. package/dist/esm/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/fakes/Receivers.mjs +1 -1
  42. package/dist/esm/grafana/api/notifications/v1beta1/mocks/fakes/Receivers.mjs.map +1 -0
  43. package/dist/esm/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/fakes/Routes.mjs +1 -1
  44. package/dist/esm/grafana/api/notifications/v1beta1/mocks/fakes/Routes.mjs.map +1 -0
  45. package/dist/esm/grafana/api/notifications/v1beta1/mocks/fakes/common.mjs.map +1 -0
  46. package/dist/esm/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/ReceiverHandlers/createReceiverHandler.mjs +1 -1
  47. package/dist/esm/grafana/api/notifications/v1beta1/mocks/handlers/ReceiverHandlers/createReceiverHandler.mjs.map +1 -0
  48. package/dist/esm/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/ReceiverHandlers/deleteReceiverHandler.mjs +1 -1
  49. package/dist/esm/grafana/api/notifications/v1beta1/mocks/handlers/ReceiverHandlers/deleteReceiverHandler.mjs.map +1 -0
  50. package/dist/esm/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/ReceiverHandlers/deletecollectionReceiverHandler.mjs +1 -1
  51. package/dist/esm/grafana/api/notifications/v1beta1/mocks/handlers/ReceiverHandlers/deletecollectionReceiverHandler.mjs.map +1 -0
  52. package/dist/esm/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/ReceiverHandlers/getReceiverHandler.mjs +1 -1
  53. package/dist/esm/grafana/api/notifications/v1beta1/mocks/handlers/ReceiverHandlers/getReceiverHandler.mjs.map +1 -0
  54. package/dist/esm/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/ReceiverHandlers/listReceiverHandler.mjs +1 -1
  55. package/dist/esm/grafana/api/notifications/v1beta1/mocks/handlers/ReceiverHandlers/listReceiverHandler.mjs.map +1 -0
  56. package/dist/esm/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/ReceiverHandlers/replaceReceiverHandler.mjs +1 -1
  57. package/dist/esm/grafana/api/notifications/v1beta1/mocks/handlers/ReceiverHandlers/replaceReceiverHandler.mjs.map +1 -0
  58. package/dist/esm/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/ReceiverHandlers/updateReceiverHandler.mjs +1 -1
  59. package/dist/esm/grafana/api/notifications/v1beta1/mocks/handlers/ReceiverHandlers/updateReceiverHandler.mjs.map +1 -0
  60. package/dist/esm/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/RoutingTreeHandlers/listRoutingTreeHandler.mjs +1 -1
  61. package/dist/esm/grafana/api/notifications/v1beta1/mocks/handlers/RoutingTreeHandlers/listRoutingTreeHandler.mjs.map +1 -0
  62. package/dist/esm/grafana/contactPoints/components/ContactPointSelector/ContactPointSelector.mjs +1 -1
  63. package/dist/esm/grafana/contactPoints/components/ContactPointSelector/ContactPointSelector.mjs.map +1 -1
  64. package/dist/esm/grafana/contactPoints/components/ContactPointSelector/ContactPointSelector.scenario.mjs +2 -2
  65. package/dist/esm/grafana/contactPoints/components/ContactPointSelector/ContactPointSelector.scenario.mjs.map +1 -1
  66. package/dist/esm/grafana/contactPoints/hooks/{v0alpha1 → v1beta1}/useContactPoints.mjs +1 -1
  67. package/dist/esm/grafana/contactPoints/hooks/v1beta1/useContactPoints.mjs.map +1 -0
  68. package/dist/esm/grafana/contactPoints/utils.mjs.map +1 -1
  69. package/dist/esm/grafana/notificationPolicies/components/RoutingTreeSelector/RoutingTreeSelector.mjs.map +1 -1
  70. package/dist/esm/grafana/notificationPolicies/components/RoutingTreeSelector/RoutingTreeSelector.scenario.mjs +2 -2
  71. package/dist/esm/grafana/notificationPolicies/components/RoutingTreeSelector/RoutingTreeSelector.scenario.mjs.map +1 -1
  72. package/dist/esm/grafana/notificationPolicies/hooks/useMatchPolicies.mjs +1 -1
  73. package/dist/esm/grafana/notificationPolicies/hooks/useMatchPolicies.mjs.map +1 -1
  74. package/dist/esm/grafana/notificationPolicies/hooks/useRoutingTrees.mjs +1 -1
  75. package/dist/esm/grafana/notificationPolicies/hooks/useRoutingTrees.mjs.map +1 -1
  76. package/dist/esm/grafana/notificationPolicies/routingTrees.mjs +1 -1
  77. package/dist/esm/grafana/notificationPolicies/routingTrees.mjs.map +1 -1
  78. package/dist/esm/grafana/notificationPolicies/utils.mjs.map +1 -1
  79. package/dist/esm/testing.mjs +12 -12
  80. package/dist/esm/unstable.mjs +3 -3
  81. package/dist/types/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/fakes/Receivers.d.ts +108 -108
  82. package/dist/types/grafana/api/notifications/v1beta1/mocks/fakes/Routes.d.ts +41 -0
  83. package/dist/types/grafana/api/notifications/v1beta1/mocks/fakes/common.d.ts +20 -0
  84. package/dist/types/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/ReceiverHandlers/createReceiverHandler.d.ts +1 -1
  85. package/dist/types/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/ReceiverHandlers/deleteReceiverHandler.d.ts +1 -1
  86. package/dist/types/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/ReceiverHandlers/deletecollectionReceiverHandler.d.ts +1 -1
  87. package/dist/types/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/ReceiverHandlers/getReceiverHandler.d.ts +1 -1
  88. package/dist/types/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/ReceiverHandlers/replaceReceiverHandler.d.ts +1 -1
  89. package/dist/types/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/ReceiverHandlers/updateReceiverHandler.d.ts +1 -1
  90. package/dist/types/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/RoutingTreeHandlers/listRoutingTreeHandler.d.ts +1 -1
  91. package/dist/types/grafana/api/notifications/{v0alpha1 → v1beta1}/types.d.ts +1 -1
  92. package/dist/types/grafana/contactPoints/components/ContactPointSelector/ContactPointSelector.d.ts +2 -2
  93. package/dist/types/grafana/contactPoints/components/ContactPointSelector/ContactPointSelector.scenario.d.ts +6 -6
  94. package/dist/types/grafana/contactPoints/hooks/{v0alpha1 → v1beta1}/useContactPoints.d.ts +5 -5
  95. package/dist/types/grafana/contactPoints/utils.d.ts +2 -2
  96. package/dist/types/grafana/matchers/types.d.ts +1 -1
  97. package/dist/types/grafana/mocks/util.d.ts +1 -1
  98. package/dist/types/grafana/notificationPolicies/components/RoutingTreeSelector/RoutingTreeSelector.d.ts +2 -6
  99. package/dist/types/grafana/notificationPolicies/components/RoutingTreeSelector/RoutingTreeSelector.scenario.d.ts +3 -3
  100. package/dist/types/grafana/notificationPolicies/hooks/useMatchPolicies.d.ts +2 -2
  101. package/dist/types/grafana/notificationPolicies/hooks/useRoutingTrees.d.ts +5 -6
  102. package/dist/types/grafana/notificationPolicies/routingTrees.d.ts +2 -2
  103. package/dist/types/grafana/notificationPolicies/types.d.ts +1 -1
  104. package/dist/types/grafana/notificationPolicies/utils.d.ts +2 -2
  105. package/dist/types/grafana/rules/components/labels/AlertLabel.d.ts +1 -1
  106. package/dist/types/grafana/rules/components/labels/AlertLabels.d.ts +1 -1
  107. package/dist/types/grafana/rules/components/state/StateDot.d.ts +1 -1
  108. package/dist/types/grafana/rules/components/state/StateIcon.d.ts +1 -1
  109. package/dist/types/grafana/rules/components/state/StateText.d.ts +1 -1
  110. package/dist/types/testing.d.ts +4 -4
  111. package/dist/types/unstable.d.ts +3 -3
  112. package/package.json +14 -12
  113. package/dist/cjs/grafana/api/notifications/v0alpha1/mocks/fakes/Receivers.cjs.map +0 -1
  114. package/dist/cjs/grafana/api/notifications/v0alpha1/mocks/fakes/Routes.cjs.map +0 -1
  115. package/dist/cjs/grafana/api/notifications/v0alpha1/mocks/fakes/common.cjs.map +0 -1
  116. package/dist/cjs/grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/createReceiverHandler.cjs.map +0 -1
  117. package/dist/cjs/grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/deleteReceiverHandler.cjs.map +0 -1
  118. package/dist/cjs/grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/deletecollectionReceiverHandler.cjs.map +0 -1
  119. package/dist/cjs/grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/getReceiverHandler.cjs.map +0 -1
  120. package/dist/cjs/grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/listReceiverHandler.cjs.map +0 -1
  121. package/dist/cjs/grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/replaceReceiverHandler.cjs.map +0 -1
  122. package/dist/cjs/grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/updateReceiverHandler.cjs.map +0 -1
  123. package/dist/cjs/grafana/api/notifications/v0alpha1/mocks/handlers/RoutingTreeHandlers/listRoutingTreeHandler.cjs.map +0 -1
  124. package/dist/cjs/grafana/contactPoints/hooks/v0alpha1/useContactPoints.cjs.map +0 -1
  125. package/dist/esm/grafana/api/notifications/v0alpha1/mocks/fakes/Receivers.mjs.map +0 -1
  126. package/dist/esm/grafana/api/notifications/v0alpha1/mocks/fakes/Routes.mjs.map +0 -1
  127. package/dist/esm/grafana/api/notifications/v0alpha1/mocks/fakes/common.mjs.map +0 -1
  128. package/dist/esm/grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/createReceiverHandler.mjs.map +0 -1
  129. package/dist/esm/grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/deleteReceiverHandler.mjs.map +0 -1
  130. package/dist/esm/grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/deletecollectionReceiverHandler.mjs.map +0 -1
  131. package/dist/esm/grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/getReceiverHandler.mjs.map +0 -1
  132. package/dist/esm/grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/listReceiverHandler.mjs.map +0 -1
  133. package/dist/esm/grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/replaceReceiverHandler.mjs.map +0 -1
  134. package/dist/esm/grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/updateReceiverHandler.mjs.map +0 -1
  135. package/dist/esm/grafana/api/notifications/v0alpha1/mocks/handlers/RoutingTreeHandlers/listRoutingTreeHandler.mjs.map +0 -1
  136. package/dist/esm/grafana/contactPoints/hooks/v0alpha1/useContactPoints.mjs.map +0 -1
  137. package/dist/types/grafana/api/notifications/v0alpha1/mocks/fakes/Routes.d.ts +0 -41
  138. package/dist/types/grafana/api/notifications/v0alpha1/mocks/fakes/common.d.ts +0 -20
  139. /package/dist/cjs/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/fakes/common.cjs +0 -0
  140. /package/dist/cjs/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/index.cjs +0 -0
  141. /package/dist/cjs/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/index.cjs.map +0 -0
  142. /package/dist/cjs/grafana/api/notifications/{v0alpha1 → v1beta1}/types.cjs +0 -0
  143. /package/dist/cjs/grafana/api/notifications/{v0alpha1 → v1beta1}/types.cjs.map +0 -0
  144. /package/dist/esm/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/fakes/common.mjs +0 -0
  145. /package/dist/esm/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/index.mjs +0 -0
  146. /package/dist/esm/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/index.mjs.map +0 -0
  147. /package/dist/esm/grafana/api/notifications/{v0alpha1 → v1beta1}/types.mjs +0 -0
  148. /package/dist/esm/grafana/api/notifications/{v0alpha1 → v1beta1}/types.mjs.map +0 -0
  149. /package/dist/types/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/ReceiverHandlers/listReceiverHandler.d.ts +0 -0
  150. /package/dist/types/grafana/api/notifications/{v0alpha1 → v1beta1}/mocks/handlers/index.d.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"useRoutingTrees.mjs","sources":["../../../../../src/grafana/notificationPolicies/hooks/useRoutingTrees.ts"],"sourcesContent":["import { type TypedUseQueryHookResult, type fetchBaseQuery } from '@reduxjs/toolkit/query/react';\n\nimport {\n type ListRoutingTreeApiArg,\n type ListRoutingTreeApiResponse,\n generatedAPI as notificationsAPIv0alpha1,\n} from '@grafana/api-clients/rtkq/notifications.alerting/v0alpha1';\n\ntype ListRoutingTreesHookResult = TypedUseQueryHookResult<\n ListRoutingTreeApiResponse,\n ListRoutingTreeApiArg,\n ReturnType<typeof fetchBaseQuery>\n>;\n\ntype ListRoutingTreesQueryArgs = Parameters<\n typeof notificationsAPIv0alpha1.endpoints.listRoutingTree.useQuery<ListRoutingTreesHookResult>\n>[0];\n\ntype ListRoutingTreesQueryOptions = Parameters<\n typeof notificationsAPIv0alpha1.endpoints.listRoutingTree.useQuery<ListRoutingTreesHookResult>\n>[1];\n\n/**\n * useListRoutingTrees is a hook that fetches a list of routing trees (notification policy trees).\n *\n * This function wraps the notificationsAPIv0alpha1.useListRoutingTreeQuery with proper typing.\n *\n * When the `alertingMultiplePolicies` feature toggle is enabled on the backend, this returns all\n * available routing trees. Otherwise, it returns only the default \"user-defined\" tree.\n *\n * @param queryArgs - Optional query arguments for filtering, pagination, etc.\n * @param queryOptions - Optional query options (refetchOnFocus, skip, etc.)\n */\nexport function useListRoutingTrees(\n queryArgs: ListRoutingTreesQueryArgs = {},\n queryOptions: ListRoutingTreesQueryOptions = {}\n): ListRoutingTreesHookResult {\n return notificationsAPIv0alpha1.useListRoutingTreeQuery<ListRoutingTreesHookResult>(queryArgs, queryOptions);\n}\n"],"names":["notificationsAPIv0alpha1"],"mappings":";;;AAiCO,SAAS,oBACd,SAAA,GAAuC,EAAC,EACxC,YAAA,GAA6C,EAAC,EAClB;AAC5B,EAAA,OAAOA,YAAA,CAAyB,uBAAA,CAAoD,SAAA,EAAW,YAAY,CAAA;AAC7G;;;;"}
1
+ {"version":3,"file":"useRoutingTrees.mjs","sources":["../../../../../src/grafana/notificationPolicies/hooks/useRoutingTrees.ts"],"sourcesContent":["import { type TypedUseQueryHookResult, type fetchBaseQuery } from '@reduxjs/toolkit/query/react';\n\nimport {\n type ListRoutingTreeApiArg,\n type ListRoutingTreeApiResponse,\n generatedAPI as notificationsAPIv1beta1,\n} from '@grafana/api-clients/rtkq/notifications.alerting/v1beta1';\n\ntype ListRoutingTreesHookResult = TypedUseQueryHookResult<\n ListRoutingTreeApiResponse,\n ListRoutingTreeApiArg,\n ReturnType<typeof fetchBaseQuery>\n>;\n\ntype ListRoutingTreesQueryArgs = Parameters<\n typeof notificationsAPIv1beta1.endpoints.listRoutingTree.useQuery<ListRoutingTreesHookResult>\n>[0];\n\ntype ListRoutingTreesQueryOptions = Parameters<\n typeof notificationsAPIv1beta1.endpoints.listRoutingTree.useQuery<ListRoutingTreesHookResult>\n>[1];\n\n/**\n * useListRoutingTrees is a hook that fetches a list of routing trees (notification policy trees).\n *\n * This function wraps the notificationsAPIv1beta1.useListRoutingTreeQuery with proper typing.\n *\n * The backend returns all available routing trees.\n *\n * @param queryArgs - Optional query arguments for filtering, pagination, etc.\n * @param queryOptions - Optional query options (refetchOnFocus, skip, etc.)\n */\nexport function useListRoutingTrees(\n queryArgs: ListRoutingTreesQueryArgs = {},\n queryOptions: ListRoutingTreesQueryOptions = {}\n): ListRoutingTreesHookResult {\n return notificationsAPIv1beta1.useListRoutingTreeQuery<ListRoutingTreesHookResult>(queryArgs, queryOptions);\n}\n"],"names":["notificationsAPIv1beta1"],"mappings":";;;AAgCO,SAAS,oBACd,SAAA,GAAuC,EAAC,EACxC,YAAA,GAA6C,EAAC,EAClB;AAC5B,EAAA,OAAOA,YAAA,CAAwB,uBAAA,CAAoD,SAAA,EAAW,YAAY,CAAA;AAC5G;;;;"}
@@ -2,7 +2,7 @@
2
2
  const USER_DEFINED_TREE_NAME = "user-defined";
3
3
  const DEFAULT_ROUTING_TREE_NAME_ALIAS = "default";
4
4
  function isDefaultRoutingTreeName(name) {
5
- return name === void 0 || name === null || name === "" || name === USER_DEFINED_TREE_NAME || name === DEFAULT_ROUTING_TREE_NAME_ALIAS;
5
+ return name === void 0 || name === "" || name === USER_DEFINED_TREE_NAME || name === DEFAULT_ROUTING_TREE_NAME_ALIAS;
6
6
  }
7
7
  function isDefaultRoutingTree(tree) {
8
8
  return isDefaultRoutingTreeName(tree.metadata.name);
@@ -1 +1 @@
1
- {"version":3,"file":"routingTrees.mjs","sources":["../../../../src/grafana/notificationPolicies/routingTrees.ts"],"sourcesContent":["import { type RoutingTree } from '@grafana/api-clients/rtkq/notifications.alerting/v0alpha1';\n\n/** The name the backend emits for the default (root) routing tree and the name the frontend SENDS. */\nexport const USER_DEFINED_TREE_NAME = 'user-defined';\n\n/** Future canonical name the backend may emit for the default (root) routing tree; accepted on the read side. */\nexport const DEFAULT_ROUTING_TREE_NAME_ALIAS = 'default';\n\n/**\n * Reports whether a routing-tree name refers to the default (root) routing tree.\n *\n * Accepts both the emitted name (`user-defined`) and the future canonical alias (`default`), mirroring the\n * backend's IsDefaultRoutingTreeName. Also treats an absent name (empty string / undefined) as the default,\n * because the frontend uses \"no name\" to mean the root route.\n */\nexport function isDefaultRoutingTreeName(name?: string | null): boolean {\n return (\n name === undefined ||\n name === null ||\n name === '' ||\n name === USER_DEFINED_TREE_NAME ||\n name === DEFAULT_ROUTING_TREE_NAME_ALIAS\n );\n}\n\n/**\n * Check if the given routing tree is the default (root) policy tree.\n */\nexport function isDefaultRoutingTree(tree: RoutingTree): boolean {\n return isDefaultRoutingTreeName(tree.metadata.name);\n}\n"],"names":[],"mappings":";AAGO,MAAM,sBAAA,GAAyB;AAG/B,MAAM,+BAAA,GAAkC;AASxC,SAAS,yBAAyB,IAAA,EAA+B;AACtE,EAAA,OACE,IAAA,KAAS,UACT,IAAA,KAAS,IAAA,IACT,SAAS,EAAA,IACT,IAAA,KAAS,0BACT,IAAA,KAAS,+BAAA;AAEb;AAKO,SAAS,qBAAqB,IAAA,EAA4B;AAC/D,EAAA,OAAO,wBAAA,CAAyB,IAAA,CAAK,QAAA,CAAS,IAAI,CAAA;AACpD;;;;"}
1
+ {"version":3,"file":"routingTrees.mjs","sources":["../../../../src/grafana/notificationPolicies/routingTrees.ts"],"sourcesContent":["import { type RoutingTree } from '@grafana/api-clients/rtkq/notifications.alerting/v1beta1';\n\n/** The name the backend emits for the default (root) routing tree and the name the frontend SENDS. */\nexport const USER_DEFINED_TREE_NAME = 'user-defined';\n\n/** Future canonical name the backend may emit for the default (root) routing tree; accepted on the read side. */\nexport const DEFAULT_ROUTING_TREE_NAME_ALIAS = 'default';\n\n/**\n * Reports whether a routing-tree name refers to the default (root) routing tree.\n *\n * Accepts both the emitted name (`user-defined`) and the future canonical alias (`default`), mirroring the\n * backend's IsDefaultRoutingTreeName. Also treats an absent name (empty string / undefined) as the default,\n * because the frontend uses \"no name\" to mean the root route.\n */\nexport function isDefaultRoutingTreeName(name?: string): boolean {\n return (\n name === undefined || name === '' || name === USER_DEFINED_TREE_NAME || name === DEFAULT_ROUTING_TREE_NAME_ALIAS\n );\n}\n\n/**\n * Check if the given routing tree is the default (root) policy tree.\n */\nexport function isDefaultRoutingTree(tree: RoutingTree): boolean {\n return isDefaultRoutingTreeName(tree.metadata.name);\n}\n"],"names":[],"mappings":";AAGO,MAAM,sBAAA,GAAyB;AAG/B,MAAM,+BAAA,GAAkC;AASxC,SAAS,yBAAyB,IAAA,EAAwB;AAC/D,EAAA,OACE,SAAS,KAAA,CAAA,IAAa,IAAA,KAAS,EAAA,IAAM,IAAA,KAAS,0BAA0B,IAAA,KAAS,+BAAA;AAErF;AAKO,SAAS,qBAAqB,IAAA,EAA4B;AAC/D,EAAA,OAAO,wBAAA,CAAyB,IAAA,CAAK,QAAA,CAAS,IAAI,CAAA;AACpD;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.mjs","sources":["../../../../src/grafana/notificationPolicies/utils.ts"],"sourcesContent":["import { groupBy, isArray, pick, reduce, uniqueId } from 'lodash';\n\nimport { type RoutingTree, type RoutingTreeRoute } from '@grafana/api-clients/rtkq/notifications.alerting/v0alpha1';\n\nimport { type Label } from '../matchers/types';\nimport { type LabelMatchDetails, matchLabels } from '../matchers/utils';\n\nimport { type Route, type RouteWithID } from './types';\n\nexport const INHERITABLE_KEYS = ['receiver', 'group_by', 'group_wait', 'group_interval', 'repeat_interval'] as const;\ntype InheritableKeys = typeof INHERITABLE_KEYS;\nexport type InheritableProperties = Pick<Route, InheritableKeys[number]>;\n\n// Represents matching information for a single route in the traversal path\nexport type RouteMatchInfo<T extends Route> = {\n route: T;\n matchDetails: LabelMatchDetails[];\n matched: boolean;\n};\n\nexport interface RouteMatchResult<T extends Route> {\n route: T;\n labels: Label[];\n // Track matching information for each route in the traversal path\n matchingJourney: Array<RouteMatchInfo<T>>;\n}\n\n/**\n * This function performs a depth-first left-to-right search through the route tree and returns the matching routing nodes.\n *\n * If the current node is not a match, return nothing\n * Normalization should have happened earlier in the code\n */\nexport function findMatchingRoutes<T extends Route>(\n route: T,\n labels: Label[],\n matchingJourney: Array<RouteMatchInfo<T>> = []\n): Array<RouteMatchResult<T>> {\n let childMatches: Array<RouteMatchResult<T>> = [];\n\n // Check if the current node matches\n const matchResult = matchLabels(route.matchers ?? [], labels);\n\n // Create matching info for this route\n const currentMatchInfo: RouteMatchInfo<T> = {\n route,\n matchDetails: matchResult.details,\n matched: matchResult.matches,\n };\n\n // Add current route's matching info to the journey\n const currentMatchingJourney = [...matchingJourney, currentMatchInfo];\n\n // If the current node is not a match, return nothing\n if (!matchResult.matches) {\n return [];\n }\n\n // If the current node matches, recurse through child nodes\n if (route.routes) {\n for (const child of route.routes) {\n const matchingChildren = findMatchingRoutes(child, labels, currentMatchingJourney);\n // TODO how do I solve this typescript thingy? It looks correct to me /shrug\n // @ts-ignore\n childMatches = childMatches.concat(matchingChildren);\n // we have matching children and we don't want to continue, so break here\n if (matchingChildren.length && !child.continue) {\n break;\n }\n }\n }\n\n // If no child nodes were matches, the current node itself is a match.\n if (childMatches.length === 0) {\n childMatches.push({\n route,\n labels,\n matchingJourney: currentMatchingJourney,\n });\n }\n\n return childMatches;\n}\n\n/**\n * This function will compute the full tree with inherited properties – this is mostly used for search and filtering\n */\nexport function computeInheritedTree<T extends Route>(parent: T): T {\n return {\n ...parent,\n routes: parent.routes?.map((child) => {\n const inheritedProperties = getInheritedProperties(parent, child);\n\n return computeInheritedTree({\n ...child,\n ...inheritedProperties,\n });\n }),\n };\n}\n\n// inherited properties are config properties that exist on the parent route (or its inherited properties) but not on the child route\nexport function getInheritedProperties<T extends Route>(\n parentRoute: T,\n childRoute: T,\n propertiesParentInherited?: InheritableProperties\n): InheritableProperties {\n const propsFromParent: InheritableProperties = pick(parentRoute, INHERITABLE_KEYS);\n const inheritableProperties: InheritableProperties = {\n ...propsFromParent,\n ...propertiesParentInherited,\n } as const;\n\n // @ts-ignore TS5 & TS6 we're using \"keyof\" for the property so the type checker can help us out but this makes the\n // reduce function signature unhappy\n const inherited = reduce(\n inheritableProperties,\n // @ts-ignore TSGO / TS7 see above comment about the reduce function signature.\n (inheritedProperties: InheritableProperties, parentValue, property: keyof InheritableProperties) => {\n const parentHasValue = parentValue != null;\n\n const inheritableValues = [undefined, '', null];\n const childIsInheriting = inheritableValues.some((value) => childRoute[property] === value);\n const inheritFromValue = childIsInheriting && parentHasValue;\n\n const inheritEmptyGroupByFromParent =\n property === 'group_by' &&\n parentHasValue &&\n isArray(childRoute[property]) &&\n childRoute[property]?.length === 0;\n\n const inheritFromParent = inheritFromValue || inheritEmptyGroupByFromParent;\n\n if (inheritFromParent) {\n // @ts-ignore\n inheritedProperties[property] = parentValue;\n }\n\n return inheritedProperties;\n },\n {}\n );\n\n return inherited;\n}\n\nexport function addUniqueIdentifier(route: Route): RouteWithID {\n return {\n id: uniqueId('route-'),\n ...route,\n routes: route.routes?.map(addUniqueIdentifier) ?? [],\n };\n}\n\n// all policies that were matched of a single tree\nexport type TreeMatch = {\n /* we'll include the entire expanded policy tree for diagnostics */\n expandedTree: RouteWithID;\n /* the routes that matched the labels where the key is a route and the value is an array of instances that match that route */\n matchedPolicies: Map<RouteWithID, Array<RouteMatchResult<RouteWithID>>>;\n};\n\n/**\n * This function will return what notification policies would match a set of labels.\n *\n * ⚠️ This function is rather CPU intensive depending on both the size of the labels list and the size of the notification policy tree.\n * When using this function, consider wrapping it in a web-worker to offload this from the main JavaScript thread.\n *\n * @param instances - A set of labels for which you want to determine the matching policies\n * @param routingTree - A notification policy tree (or subtree)\n */\nexport function matchInstancesToRoute(rootRoute: Route, instances: Label[][]): TreeMatch {\n // initially empty map of matches policies\n const matchedPolicies = new Map();\n\n // compute the entire expanded tree for matching routes and diagnostics\n // this will include inherited properties from parent nodes\n const expandedTree = addUniqueIdentifier(computeInheritedTree(rootRoute));\n\n // let's first find all matching routes for the provided instances\n const matchesArray = instances.flatMap((labels) => findMatchingRoutes(expandedTree, labels));\n\n // now group the matches by route ID\n // this will give us a map of route IDs to their matching instances\n // we use the route ID as the key to ensure uniqueness\n const groupedByRoute = groupBy(matchesArray, (match) => match.route.id);\n Object.entries(groupedByRoute).forEach(([_key, match]) => {\n matchedPolicies.set(match[0].route, match);\n });\n\n return {\n expandedTree,\n matchedPolicies,\n };\n}\n\n/**\n * Converts a RoutingTree to a Route by merging defaults with routes.\n *\n * @param routingTree - The RoutingTree from the API\n * @returns A Route that can be used with the matching functions\n */\nexport function convertRoutingTreeToRoute(routingTree: RoutingTree): Route {\n const convertRoutingTreeRoutes = (routes: RoutingTreeRoute[]): Route[] => {\n return routes.map(\n (route): Route => ({\n ...route,\n routes: route.routes ? convertRoutingTreeRoutes(route.routes) : [],\n })\n );\n };\n\n // Create the root route by merging defaults with the route structure\n const rootRoute: Route = {\n ...routingTree.spec.defaults,\n continue: false,\n active_time_intervals: [],\n mute_time_intervals: [],\n matchers: [], // Root route has no matchers (catch-all)\n routes: convertRoutingTreeRoutes(routingTree.spec.routes),\n };\n\n return rootRoute;\n}\n"],"names":[],"mappings":";;;;AASO,MAAM,mBAAmB,CAAC,UAAA,EAAY,UAAA,EAAY,YAAA,EAAc,kBAAkB,iBAAiB;AAwBnG,SAAS,kBAAA,CACd,KAAA,EACA,MAAA,EACA,eAAA,GAA4C,EAAC,EACjB;AArC9B,EAAA,IAAA,EAAA;AAsCE,EAAA,IAAI,eAA2C,EAAC;AAGhD,EAAA,MAAM,cAAc,WAAA,CAAA,CAAY,EAAA,GAAA,KAAA,CAAM,aAAN,IAAA,GAAA,EAAA,GAAkB,IAAI,MAAM,CAAA;AAG5D,EAAA,MAAM,gBAAA,GAAsC;AAAA,IAC1C,KAAA;AAAA,IACA,cAAc,WAAA,CAAY,OAAA;AAAA,IAC1B,SAAS,WAAA,CAAY;AAAA,GACvB;AAGA,EAAA,MAAM,sBAAA,GAAyB,CAAC,GAAG,eAAA,EAAiB,gBAAgB,CAAA;AAGpE,EAAA,IAAI,CAAC,YAAY,OAAA,EAAS;AACxB,IAAA,OAAO,EAAC;AAAA,EACV;AAGA,EAAA,IAAI,MAAM,MAAA,EAAQ;AAChB,IAAA,KAAA,MAAW,KAAA,IAAS,MAAM,MAAA,EAAQ;AAChC,MAAA,MAAM,gBAAA,GAAmB,kBAAA,CAAmB,KAAA,EAAO,MAAA,EAAQ,sBAAsB,CAAA;AAGjF,MAAA,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,iBAAiB,OAAA,CAAQ,YAAA,EAAc,CAAC,KAAA,KAAU,KAAA,CAAM,MAAM,EAAE,CAAA;AACtE,EAAA,MAAA,CAAO,OAAA,CAAQ,cAAc,CAAA,CAAE,OAAA,CAAQ,CAAC,CAAC,IAAA,EAAM,KAAK,CAAA,KAAM;AACxD,IAAA,eAAA,CAAgB,GAAA,CAAI,KAAA,CAAM,CAAC,CAAA,CAAE,OAAO,KAAK,CAAA;AAAA,EAC3C,CAAC,CAAA;AAED,EAAA,OAAO;AAAA,IACL,YAAA;AAAA,IACA;AAAA,GACF;AACF;AAQO,SAAS,0BAA0B,WAAA,EAAiC;AACzE,EAAA,MAAM,wBAAA,GAA2B,CAAC,MAAA,KAAwC;AACxE,IAAA,OAAO,MAAA,CAAO,GAAA;AAAA,MACZ,CAAC,KAAA,MAAkB;AAAA,QACjB,GAAG,KAAA;AAAA,QACH,QAAQ,KAAA,CAAM,MAAA,GAAS,yBAAyB,KAAA,CAAM,MAAM,IAAI;AAAC,OACnE;AAAA,KACF;AAAA,EACF,CAAA;AAGA,EAAA,MAAM,SAAA,GAAmB;AAAA,IACvB,GAAG,YAAY,IAAA,CAAK,QAAA;AAAA,IACpB,QAAA,EAAU,KAAA;AAAA,IACV,uBAAuB,EAAC;AAAA,IACxB,qBAAqB,EAAC;AAAA,IACtB,UAAU,EAAC;AAAA;AAAA,IACX,MAAA,EAAQ,wBAAA,CAAyB,WAAA,CAAY,IAAA,CAAK,MAAM;AAAA,GAC1D;AAEA,EAAA,OAAO,SAAA;AACT;;;;"}
1
+ {"version":3,"file":"utils.mjs","sources":["../../../../src/grafana/notificationPolicies/utils.ts"],"sourcesContent":["import { groupBy, isArray, pick, reduce, uniqueId } from 'lodash';\n\nimport { type RoutingTree, type RoutingTreeRoute } from '@grafana/api-clients/rtkq/notifications.alerting/v1beta1';\n\nimport { type Label } from '../matchers/types';\nimport { type LabelMatchDetails, matchLabels } from '../matchers/utils';\n\nimport { type Route, type RouteWithID } from './types';\n\nexport const INHERITABLE_KEYS = ['receiver', 'group_by', 'group_wait', 'group_interval', 'repeat_interval'] as const;\ntype InheritableKeys = typeof INHERITABLE_KEYS;\nexport type InheritableProperties = Pick<Route, InheritableKeys[number]>;\n\n// Represents matching information for a single route in the traversal path\nexport type RouteMatchInfo<T extends Route> = {\n route: T;\n matchDetails: LabelMatchDetails[];\n matched: boolean;\n};\n\nexport interface RouteMatchResult<T extends Route> {\n route: T;\n labels: Label[];\n // Track matching information for each route in the traversal path\n matchingJourney: Array<RouteMatchInfo<T>>;\n}\n\n/**\n * This function performs a depth-first left-to-right search through the route tree and returns the matching routing nodes.\n *\n * If the current node is not a match, return nothing\n * Normalization should have happened earlier in the code\n */\nexport function findMatchingRoutes<T extends Route>(\n route: T,\n labels: Label[],\n matchingJourney: Array<RouteMatchInfo<T>> = []\n): Array<RouteMatchResult<T>> {\n let childMatches: Array<RouteMatchResult<T>> = [];\n\n // Check if the current node matches\n const matchResult = matchLabels(route.matchers ?? [], labels);\n\n // Create matching info for this route\n const currentMatchInfo: RouteMatchInfo<T> = {\n route,\n matchDetails: matchResult.details,\n matched: matchResult.matches,\n };\n\n // Add current route's matching info to the journey\n const currentMatchingJourney = [...matchingJourney, currentMatchInfo];\n\n // If the current node is not a match, return nothing\n if (!matchResult.matches) {\n return [];\n }\n\n // If the current node matches, recurse through child nodes\n if (route.routes) {\n for (const child of route.routes) {\n const matchingChildren = findMatchingRoutes(child, labels, currentMatchingJourney);\n // TODO how do I solve this typescript thingy? It looks correct to me /shrug\n // @ts-ignore\n childMatches = childMatches.concat(matchingChildren);\n // we have matching children and we don't want to continue, so break here\n if (matchingChildren.length && !child.continue) {\n break;\n }\n }\n }\n\n // If no child nodes were matches, the current node itself is a match.\n if (childMatches.length === 0) {\n childMatches.push({\n route,\n labels,\n matchingJourney: currentMatchingJourney,\n });\n }\n\n return childMatches;\n}\n\n/**\n * This function will compute the full tree with inherited properties – this is mostly used for search and filtering\n */\nexport function computeInheritedTree<T extends Route>(parent: T): T {\n return {\n ...parent,\n routes: parent.routes?.map((child) => {\n const inheritedProperties = getInheritedProperties(parent, child);\n\n return computeInheritedTree({\n ...child,\n ...inheritedProperties,\n });\n }),\n };\n}\n\n// inherited properties are config properties that exist on the parent route (or its inherited properties) but not on the child route\nexport function getInheritedProperties<T extends Route>(\n parentRoute: T,\n childRoute: T,\n propertiesParentInherited?: InheritableProperties\n): InheritableProperties {\n const propsFromParent: InheritableProperties = pick(parentRoute, INHERITABLE_KEYS);\n const inheritableProperties: InheritableProperties = {\n ...propsFromParent,\n ...propertiesParentInherited,\n } as const;\n\n // @ts-ignore TS5 & TS6 we're using \"keyof\" for the property so the type checker can help us out but this makes the\n // reduce function signature unhappy\n const inherited = reduce(\n inheritableProperties,\n // @ts-ignore TSGO / TS7 see above comment about the reduce function signature.\n (inheritedProperties: InheritableProperties, parentValue, property: keyof InheritableProperties) => {\n const parentHasValue = parentValue != null;\n\n const inheritableValues = [undefined, '', null];\n const childIsInheriting = inheritableValues.some((value) => childRoute[property] === value);\n const inheritFromValue = childIsInheriting && parentHasValue;\n\n const inheritEmptyGroupByFromParent =\n property === 'group_by' &&\n parentHasValue &&\n isArray(childRoute[property]) &&\n childRoute[property]?.length === 0;\n\n const inheritFromParent = inheritFromValue || inheritEmptyGroupByFromParent;\n\n if (inheritFromParent) {\n // @ts-ignore\n inheritedProperties[property] = parentValue;\n }\n\n return inheritedProperties;\n },\n {}\n );\n\n return inherited;\n}\n\nexport function addUniqueIdentifier(route: Route): RouteWithID {\n return {\n id: uniqueId('route-'),\n ...route,\n routes: route.routes?.map(addUniqueIdentifier) ?? [],\n };\n}\n\n// all policies that were matched of a single tree\nexport type TreeMatch = {\n /* we'll include the entire expanded policy tree for diagnostics */\n expandedTree: RouteWithID;\n /* the routes that matched the labels where the key is a route and the value is an array of instances that match that route */\n matchedPolicies: Map<RouteWithID, Array<RouteMatchResult<RouteWithID>>>;\n};\n\n/**\n * This function will return what notification policies would match a set of labels.\n *\n * ⚠️ This function is rather CPU intensive depending on both the size of the labels list and the size of the notification policy tree.\n * When using this function, consider wrapping it in a web-worker to offload this from the main JavaScript thread.\n *\n * @param instances - A set of labels for which you want to determine the matching policies\n * @param routingTree - A notification policy tree (or subtree)\n */\nexport function matchInstancesToRoute(rootRoute: Route, instances: Label[][]): TreeMatch {\n // initially empty map of matches policies\n const matchedPolicies = new Map();\n\n // compute the entire expanded tree for matching routes and diagnostics\n // this will include inherited properties from parent nodes\n const expandedTree = addUniqueIdentifier(computeInheritedTree(rootRoute));\n\n // let's first find all matching routes for the provided instances\n const matchesArray = instances.flatMap((labels) => findMatchingRoutes(expandedTree, labels));\n\n // now group the matches by route ID\n // this will give us a map of route IDs to their matching instances\n // we use the route ID as the key to ensure uniqueness\n const groupedByRoute = groupBy(matchesArray, (match) => match.route.id);\n Object.entries(groupedByRoute).forEach(([_key, match]) => {\n matchedPolicies.set(match[0].route, match);\n });\n\n return {\n expandedTree,\n matchedPolicies,\n };\n}\n\n/**\n * Converts a RoutingTree to a Route by merging defaults with routes.\n *\n * @param routingTree - The RoutingTree from the API\n * @returns A Route that can be used with the matching functions\n */\nexport function convertRoutingTreeToRoute(routingTree: RoutingTree): Route {\n const convertRoutingTreeRoutes = (routes: RoutingTreeRoute[]): Route[] => {\n return routes.map(\n (route): Route => ({\n ...route,\n routes: route.routes ? convertRoutingTreeRoutes(route.routes) : [],\n })\n );\n };\n\n // Create the root route by merging defaults with the route structure\n const rootRoute: Route = {\n ...routingTree.spec.defaults,\n continue: false,\n active_time_intervals: [],\n mute_time_intervals: [],\n matchers: [], // Root route has no matchers (catch-all)\n routes: convertRoutingTreeRoutes(routingTree.spec.routes),\n };\n\n return rootRoute;\n}\n"],"names":[],"mappings":";;;;AASO,MAAM,mBAAmB,CAAC,UAAA,EAAY,UAAA,EAAY,YAAA,EAAc,kBAAkB,iBAAiB;AAwBnG,SAAS,kBAAA,CACd,KAAA,EACA,MAAA,EACA,eAAA,GAA4C,EAAC,EACjB;AArC9B,EAAA,IAA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AM,MAAM,IAAI;AAAC,OACnE;AAAA,KACF;AAAA,EACF,CAAA;AAGA,EAAA,MAAM,SAAA,GAAmB;AAAA,IACvB,GAAG,YAAY,IAAA,CAAK,QAAA;AAAA,IACpB,QAAA,EAAU,KAAA;AAAA,IACV,uBAAuB,EAAC;AAAA,IACxB,qBAAqB,EAAC;AAAA,IACtB,UAAU,EAAC;AAAA;AAAA,IACX,MAAA,EAAQ,wBAAA,CAAyB,WAAA,CAAY,IAAA,CAAK,MAAM;AAAA,GAC1D;AAEA,EAAA,OAAO,SAAA;AACT;;;;"}
@@ -1,17 +1,17 @@
1
- import './grafana/api/notifications/v0alpha1/mocks/handlers/index.mjs';
2
- export { AlertingEntityMetadataAnnotationsFactory } from './grafana/api/notifications/v0alpha1/mocks/fakes/common.mjs';
3
- export { ContactPointFactory, ContactPointMetadataAnnotationsFactory, ContactPointSpecFactory, EmailIntegrationFactory, GenericIntegrationFactory, ListReceiverApiResponseFactory, SlackIntegrationFactory } from './grafana/api/notifications/v0alpha1/mocks/fakes/Receivers.mjs';
4
- export { LabelMatcherFactory, ListRoutingTreeApiResponseFactory, RouteFactory, RoutingTreeFactory } from './grafana/api/notifications/v0alpha1/mocks/fakes/Routes.mjs';
1
+ import './grafana/api/notifications/v1beta1/mocks/handlers/index.mjs';
2
+ export { AlertingEntityMetadataAnnotationsFactory } from './grafana/api/notifications/v1beta1/mocks/fakes/common.mjs';
3
+ export { ContactPointFactory, ContactPointMetadataAnnotationsFactory, ContactPointSpecFactory, EmailIntegrationFactory, GenericIntegrationFactory, ListReceiverApiResponseFactory, SlackIntegrationFactory } from './grafana/api/notifications/v1beta1/mocks/fakes/Receivers.mjs';
4
+ export { LabelMatcherFactory, ListRoutingTreeApiResponseFactory, RouteFactory, RoutingTreeFactory } from './grafana/api/notifications/v1beta1/mocks/fakes/Routes.mjs';
5
5
  export { contactPointsListWithUnusableItems, contactPointsListWithUnusableItemsScenario, simpleContactPointsList, simpleContactPointsListScenario, withErrorScenario } from './grafana/contactPoints/components/ContactPointSelector/ContactPointSelector.scenario.mjs';
6
6
  export { routingTreeWithErrorScenario, simpleRoutingTreesList, simpleRoutingTreesListDefaultAlias, simpleRoutingTreesListDefaultAliasScenario, simpleRoutingTreesListScenario, singleDefaultTreeList, singleDefaultTreeScenario } from './grafana/notificationPolicies/components/RoutingTreeSelector/RoutingTreeSelector.scenario.mjs';
7
- export { createReceiverHandler } from './grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/createReceiverHandler.mjs';
8
- export { deleteReceiverHandler } from './grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/deleteReceiverHandler.mjs';
9
- export { deletecollectionReceiverHandler } from './grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/deletecollectionReceiverHandler.mjs';
10
- export { getReceiverHandler } from './grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/getReceiverHandler.mjs';
11
- export { listReceiverHandler } from './grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/listReceiverHandler.mjs';
12
- export { listRoutingTreeHandler } from './grafana/api/notifications/v0alpha1/mocks/handlers/RoutingTreeHandlers/listRoutingTreeHandler.mjs';
13
- export { replaceReceiverHandler } from './grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/replaceReceiverHandler.mjs';
14
- export { updateReceiverHandler } from './grafana/api/notifications/v0alpha1/mocks/handlers/ReceiverHandlers/updateReceiverHandler.mjs';
7
+ export { createReceiverHandler } from './grafana/api/notifications/v1beta1/mocks/handlers/ReceiverHandlers/createReceiverHandler.mjs';
8
+ export { deleteReceiverHandler } from './grafana/api/notifications/v1beta1/mocks/handlers/ReceiverHandlers/deleteReceiverHandler.mjs';
9
+ export { deletecollectionReceiverHandler } from './grafana/api/notifications/v1beta1/mocks/handlers/ReceiverHandlers/deletecollectionReceiverHandler.mjs';
10
+ export { getReceiverHandler } from './grafana/api/notifications/v1beta1/mocks/handlers/ReceiverHandlers/getReceiverHandler.mjs';
11
+ export { listReceiverHandler } from './grafana/api/notifications/v1beta1/mocks/handlers/ReceiverHandlers/listReceiverHandler.mjs';
12
+ export { listRoutingTreeHandler } from './grafana/api/notifications/v1beta1/mocks/handlers/RoutingTreeHandlers/listRoutingTreeHandler.mjs';
13
+ export { replaceReceiverHandler } from './grafana/api/notifications/v1beta1/mocks/handlers/ReceiverHandlers/replaceReceiverHandler.mjs';
14
+ export { updateReceiverHandler } from './grafana/api/notifications/v1beta1/mocks/handlers/ReceiverHandlers/updateReceiverHandler.mjs';
15
15
 
16
16
  "use strict";
17
17
  //# sourceMappingURL=testing.mjs.map
@@ -1,5 +1,5 @@
1
- import './grafana/api/notifications/v0alpha1/types.mjs';
2
- export { useListContactPoints } from './grafana/contactPoints/hooks/v0alpha1/useContactPoints.mjs';
1
+ import './grafana/api/notifications/v1beta1/types.mjs';
2
+ export { useListContactPoints } from './grafana/contactPoints/hooks/v1beta1/useContactPoints.mjs';
3
3
  export { ContactPointSelector } from './grafana/contactPoints/components/ContactPointSelector/ContactPointSelector.mjs';
4
4
  export { getContactPointDescription, getContactPointInUse, getContactPointInUseRoutes, getContactPointInUseRules } from './grafana/contactPoints/utils.mjs';
5
5
  export { useListRoutingTrees } from './grafana/notificationPolicies/hooks/useRoutingTrees.mjs';
@@ -11,7 +11,7 @@ export { StateIcon } from './grafana/rules/components/state/StateIcon.mjs';
11
11
  export { AlertLabel } from './grafana/rules/components/labels/AlertLabel.mjs';
12
12
  export { AlertLabels } from './grafana/rules/components/labels/AlertLabels.mjs';
13
13
  export { isLabelMatch, matchLabels, matchLabelsSet } from './grafana/matchers/utils.mjs';
14
- export { generatedAPI as notificationsAPIv0alpha1 } from '@grafana/api-clients/rtkq/notifications.alerting/v0alpha1';
14
+ export { generatedAPI as notificationsAPIv1beta1 } from '@grafana/api-clients/rtkq/notifications.alerting/v1beta1';
15
15
  export { generatedAPI as rulesAPIv0alpha1 } from '@grafana/api-clients/rtkq/rules.alerting/v0alpha1';
16
16
  export { generatedAPI as historianAPIv0alpha1 } from '@grafana/api-clients/rtkq/historian.alerting/v0alpha1';
17
17
 
@@ -1,50 +1,50 @@
1
1
  import { Factory } from 'fishery';
2
2
  import { type ContactPoint, type ContactPointMetadataAnnotations, type Integration } from '../../types';
3
3
  export declare const ListReceiverApiResponseFactory: Factory<{
4
- apiVersion?: string | undefined;
5
- kind?: string | undefined;
6
- metadata: import("@grafana/api-clients/rtkq/notifications.alerting/v0alpha1").ListMeta;
4
+ apiVersion?: string;
5
+ kind?: string;
6
+ metadata: import("@grafana/api-clients/rtkq/notifications.alerting/v1beta1").ListMeta;
7
7
  items: ContactPoint[];
8
8
  }, any, {
9
- apiVersion?: string | undefined;
10
- kind?: string | undefined;
11
- metadata: import("@grafana/api-clients/rtkq/notifications.alerting/v0alpha1").ListMeta;
9
+ apiVersion?: string;
10
+ kind?: string;
11
+ metadata: import("@grafana/api-clients/rtkq/notifications.alerting/v1beta1").ListMeta;
12
12
  items: ContactPoint[];
13
13
  }, import("fishery").DeepPartialObject<{
14
- apiVersion?: string | undefined;
15
- kind?: string | undefined;
16
- metadata: import("@grafana/api-clients/rtkq/notifications.alerting/v0alpha1").ListMeta;
14
+ apiVersion?: string;
15
+ kind?: string;
16
+ metadata: import("@grafana/api-clients/rtkq/notifications.alerting/v1beta1").ListMeta;
17
17
  items: ContactPoint[];
18
18
  }>>;
19
19
  export declare const ContactPointFactory: Factory<{
20
20
  apiVersion: string;
21
21
  kind: string;
22
22
  metadata: {
23
- creationTimestamp?: import("@grafana/api-clients/rtkq/notifications.alerting/v0alpha1").Time | undefined;
24
- deletionGracePeriodSeconds?: number | undefined;
25
- deletionTimestamp?: import("@grafana/api-clients/rtkq/notifications.alerting/v0alpha1").Time | undefined;
26
- finalizers?: string[] | undefined;
27
- generateName?: string | undefined;
28
- generation?: number | undefined;
23
+ creationTimestamp?: import("@grafana/api-clients/rtkq/notifications.alerting/v1beta1").Time;
24
+ deletionGracePeriodSeconds?: number;
25
+ deletionTimestamp?: import("@grafana/api-clients/rtkq/notifications.alerting/v1beta1").Time;
26
+ finalizers?: string[];
27
+ generateName?: string;
28
+ generation?: number;
29
29
  labels?: {
30
30
  [x: string]: string;
31
31
  } | undefined;
32
- managedFields?: import("@grafana/api-clients/rtkq/notifications.alerting/v0alpha1").ManagedFieldsEntry[] | undefined;
33
- name?: string | undefined;
34
- namespace?: string | undefined;
35
- ownerReferences?: import("@grafana/api-clients/rtkq/notifications.alerting/v0alpha1").OwnerReference[] | undefined;
36
- resourceVersion?: string | undefined;
37
- selfLink?: string | undefined;
38
- uid?: string | undefined;
32
+ managedFields?: import("@grafana/api-clients/rtkq/notifications.alerting/v1beta1").ManagedFieldsEntry[];
33
+ name?: string;
34
+ namespace?: string;
35
+ ownerReferences?: import("@grafana/api-clients/rtkq/notifications.alerting/v1beta1").OwnerReference[];
36
+ resourceVersion?: string;
37
+ selfLink?: string;
38
+ uid?: string;
39
39
  annotations: {
40
+ 'grafana.com/access/canReadSecrets'?: "false" | "true" | undefined;
41
+ 'grafana.com/inUse/routes'?: `${number}` | undefined;
42
+ 'grafana.com/inUse/rules'?: `${number}` | undefined;
40
43
  'grafana.com/access/canAdmin'?: "false" | "true" | undefined;
41
44
  'grafana.com/access/canDelete'?: "false" | "true" | undefined;
42
45
  'grafana.com/access/canWrite'?: "false" | "true" | undefined;
43
46
  'grafana.com/canUse'?: "false" | "true" | undefined;
44
47
  'grafana.com/provenance'?: string | undefined;
45
- 'grafana.com/access/canReadSecrets'?: "false" | "true" | undefined;
46
- 'grafana.com/inUse/routes'?: `${number}` | undefined;
47
- 'grafana.com/inUse/rules'?: `${number}` | undefined;
48
48
  };
49
49
  };
50
50
  spec: {
@@ -55,31 +55,31 @@ export declare const ContactPointFactory: Factory<{
55
55
  apiVersion: string;
56
56
  kind: string;
57
57
  metadata: {
58
- creationTimestamp?: import("@grafana/api-clients/rtkq/notifications.alerting/v0alpha1").Time | undefined;
59
- deletionGracePeriodSeconds?: number | undefined;
60
- deletionTimestamp?: import("@grafana/api-clients/rtkq/notifications.alerting/v0alpha1").Time | undefined;
61
- finalizers?: string[] | undefined;
62
- generateName?: string | undefined;
63
- generation?: number | undefined;
58
+ creationTimestamp?: import("@grafana/api-clients/rtkq/notifications.alerting/v1beta1").Time;
59
+ deletionGracePeriodSeconds?: number;
60
+ deletionTimestamp?: import("@grafana/api-clients/rtkq/notifications.alerting/v1beta1").Time;
61
+ finalizers?: string[];
62
+ generateName?: string;
63
+ generation?: number;
64
64
  labels?: {
65
65
  [x: string]: string;
66
66
  } | undefined;
67
- managedFields?: import("@grafana/api-clients/rtkq/notifications.alerting/v0alpha1").ManagedFieldsEntry[] | undefined;
68
- name?: string | undefined;
69
- namespace?: string | undefined;
70
- ownerReferences?: import("@grafana/api-clients/rtkq/notifications.alerting/v0alpha1").OwnerReference[] | undefined;
71
- resourceVersion?: string | undefined;
72
- selfLink?: string | undefined;
73
- uid?: string | undefined;
67
+ managedFields?: import("@grafana/api-clients/rtkq/notifications.alerting/v1beta1").ManagedFieldsEntry[];
68
+ name?: string;
69
+ namespace?: string;
70
+ ownerReferences?: import("@grafana/api-clients/rtkq/notifications.alerting/v1beta1").OwnerReference[];
71
+ resourceVersion?: string;
72
+ selfLink?: string;
73
+ uid?: string;
74
74
  annotations: {
75
+ 'grafana.com/access/canReadSecrets'?: "false" | "true" | undefined;
76
+ 'grafana.com/inUse/routes'?: `${number}` | undefined;
77
+ 'grafana.com/inUse/rules'?: `${number}` | undefined;
75
78
  'grafana.com/access/canAdmin'?: "false" | "true" | undefined;
76
79
  'grafana.com/access/canDelete'?: "false" | "true" | undefined;
77
80
  'grafana.com/access/canWrite'?: "false" | "true" | undefined;
78
81
  'grafana.com/canUse'?: "false" | "true" | undefined;
79
82
  'grafana.com/provenance'?: string | undefined;
80
- 'grafana.com/access/canReadSecrets'?: "false" | "true" | undefined;
81
- 'grafana.com/inUse/routes'?: `${number}` | undefined;
82
- 'grafana.com/inUse/rules'?: `${number}` | undefined;
83
83
  };
84
84
  };
85
85
  spec: {
@@ -90,31 +90,31 @@ export declare const ContactPointFactory: Factory<{
90
90
  apiVersion: string;
91
91
  kind: string;
92
92
  metadata: {
93
- creationTimestamp?: import("@grafana/api-clients/rtkq/notifications.alerting/v0alpha1").Time | undefined;
94
- deletionGracePeriodSeconds?: number | undefined;
95
- deletionTimestamp?: import("@grafana/api-clients/rtkq/notifications.alerting/v0alpha1").Time | undefined;
96
- finalizers?: string[] | undefined;
97
- generateName?: string | undefined;
98
- generation?: number | undefined;
93
+ creationTimestamp?: import("@grafana/api-clients/rtkq/notifications.alerting/v1beta1").Time;
94
+ deletionGracePeriodSeconds?: number;
95
+ deletionTimestamp?: import("@grafana/api-clients/rtkq/notifications.alerting/v1beta1").Time;
96
+ finalizers?: string[];
97
+ generateName?: string;
98
+ generation?: number;
99
99
  labels?: {
100
100
  [x: string]: string;
101
101
  } | undefined;
102
- managedFields?: import("@grafana/api-clients/rtkq/notifications.alerting/v0alpha1").ManagedFieldsEntry[] | undefined;
103
- name?: string | undefined;
104
- namespace?: string | undefined;
105
- ownerReferences?: import("@grafana/api-clients/rtkq/notifications.alerting/v0alpha1").OwnerReference[] | undefined;
106
- resourceVersion?: string | undefined;
107
- selfLink?: string | undefined;
108
- uid?: string | undefined;
102
+ managedFields?: import("@grafana/api-clients/rtkq/notifications.alerting/v1beta1").ManagedFieldsEntry[];
103
+ name?: string;
104
+ namespace?: string;
105
+ ownerReferences?: import("@grafana/api-clients/rtkq/notifications.alerting/v1beta1").OwnerReference[];
106
+ resourceVersion?: string;
107
+ selfLink?: string;
108
+ uid?: string;
109
109
  annotations: {
110
+ 'grafana.com/access/canReadSecrets'?: "false" | "true" | undefined;
111
+ 'grafana.com/inUse/routes'?: `${number}` | undefined;
112
+ 'grafana.com/inUse/rules'?: `${number}` | undefined;
110
113
  'grafana.com/access/canAdmin'?: "false" | "true" | undefined;
111
114
  'grafana.com/access/canDelete'?: "false" | "true" | undefined;
112
115
  'grafana.com/access/canWrite'?: "false" | "true" | undefined;
113
116
  'grafana.com/canUse'?: "false" | "true" | undefined;
114
117
  'grafana.com/provenance'?: string | undefined;
115
- 'grafana.com/access/canReadSecrets'?: "false" | "true" | undefined;
116
- 'grafana.com/inUse/routes'?: `${number}` | undefined;
117
- 'grafana.com/inUse/rules'?: `${number}` | undefined;
118
118
  };
119
119
  };
120
120
  spec: {
@@ -133,19 +133,19 @@ export declare const ContactPointSpecFactory: Factory<{
133
133
  integrations: Integration[];
134
134
  }>>;
135
135
  export declare const GenericIntegrationFactory: Factory<Integration, any, Integration, import("fishery").DeepPartialObject<{
136
- disableResolveMessage?: boolean | undefined;
136
+ disableResolveMessage?: boolean;
137
137
  secureFields?: {
138
138
  [key: string]: boolean;
139
- } | undefined;
139
+ };
140
140
  type: string;
141
- uid?: string | undefined;
141
+ uid?: string;
142
142
  version: string;
143
143
  settings: Record<string, unknown>;
144
144
  }> | import("fishery").DeepPartialObject<{
145
- disableResolveMessage?: boolean | undefined;
146
- uid?: string | undefined;
147
- type: "email";
148
- version: "v1";
145
+ disableResolveMessage?: boolean;
146
+ uid?: string;
147
+ type: 'email';
148
+ version: 'v1';
149
149
  settings: {
150
150
  singleEmail?: boolean;
151
151
  addresses: string;
@@ -154,10 +154,10 @@ export declare const GenericIntegrationFactory: Factory<Integration, any, Integr
154
154
  };
155
155
  secureFields: never;
156
156
  }> | import("fishery").DeepPartialObject<{
157
- disableResolveMessage?: boolean | undefined;
158
- uid?: string | undefined;
159
- type: "slack";
160
- version: "v1";
157
+ disableResolveMessage?: boolean;
158
+ uid?: string;
159
+ type: 'slack';
160
+ version: 'v1';
161
161
  settings: {
162
162
  endpointUrl?: string;
163
163
  url?: string;
@@ -178,16 +178,16 @@ export declare const GenericIntegrationFactory: Factory<Integration, any, Integr
178
178
  url: string;
179
179
  }>;
180
180
  }> | import("fishery").DeepPartialObject<{
181
- disableResolveMessage?: boolean | undefined;
181
+ disableResolveMessage?: boolean;
182
182
  secureFields?: {
183
183
  [key: string]: boolean;
184
- } | undefined;
185
- uid?: string | undefined;
186
- type: "OnCall";
187
- version: "v1";
184
+ };
185
+ uid?: string;
186
+ type: 'OnCall';
187
+ version: 'v1';
188
188
  settings: {
189
189
  url: string;
190
- httpMethod?: "POST" | "PUT";
190
+ httpMethod?: 'POST' | 'PUT';
191
191
  maxAlerts?: number;
192
192
  authorization_scheme?: string;
193
193
  authorization_credentials?: string;
@@ -198,19 +198,19 @@ export declare const GenericIntegrationFactory: Factory<Integration, any, Integr
198
198
  };
199
199
  }>>;
200
200
  export declare const EmailIntegrationFactory: Factory<Integration, any, Integration, import("fishery").DeepPartialObject<{
201
- disableResolveMessage?: boolean | undefined;
201
+ disableResolveMessage?: boolean;
202
202
  secureFields?: {
203
203
  [key: string]: boolean;
204
- } | undefined;
204
+ };
205
205
  type: string;
206
- uid?: string | undefined;
206
+ uid?: string;
207
207
  version: string;
208
208
  settings: Record<string, unknown>;
209
209
  }> | import("fishery").DeepPartialObject<{
210
- disableResolveMessage?: boolean | undefined;
211
- uid?: string | undefined;
212
- type: "email";
213
- version: "v1";
210
+ disableResolveMessage?: boolean;
211
+ uid?: string;
212
+ type: 'email';
213
+ version: 'v1';
214
214
  settings: {
215
215
  singleEmail?: boolean;
216
216
  addresses: string;
@@ -219,10 +219,10 @@ export declare const EmailIntegrationFactory: Factory<Integration, any, Integrat
219
219
  };
220
220
  secureFields: never;
221
221
  }> | import("fishery").DeepPartialObject<{
222
- disableResolveMessage?: boolean | undefined;
223
- uid?: string | undefined;
224
- type: "slack";
225
- version: "v1";
222
+ disableResolveMessage?: boolean;
223
+ uid?: string;
224
+ type: 'slack';
225
+ version: 'v1';
226
226
  settings: {
227
227
  endpointUrl?: string;
228
228
  url?: string;
@@ -243,16 +243,16 @@ export declare const EmailIntegrationFactory: Factory<Integration, any, Integrat
243
243
  url: string;
244
244
  }>;
245
245
  }> | import("fishery").DeepPartialObject<{
246
- disableResolveMessage?: boolean | undefined;
246
+ disableResolveMessage?: boolean;
247
247
  secureFields?: {
248
248
  [key: string]: boolean;
249
- } | undefined;
250
- uid?: string | undefined;
251
- type: "OnCall";
252
- version: "v1";
249
+ };
250
+ uid?: string;
251
+ type: 'OnCall';
252
+ version: 'v1';
253
253
  settings: {
254
254
  url: string;
255
- httpMethod?: "POST" | "PUT";
255
+ httpMethod?: 'POST' | 'PUT';
256
256
  maxAlerts?: number;
257
257
  authorization_scheme?: string;
258
258
  authorization_credentials?: string;
@@ -263,19 +263,19 @@ export declare const EmailIntegrationFactory: Factory<Integration, any, Integrat
263
263
  };
264
264
  }>>;
265
265
  export declare const SlackIntegrationFactory: Factory<Integration, any, Integration, import("fishery").DeepPartialObject<{
266
- disableResolveMessage?: boolean | undefined;
266
+ disableResolveMessage?: boolean;
267
267
  secureFields?: {
268
268
  [key: string]: boolean;
269
- } | undefined;
269
+ };
270
270
  type: string;
271
- uid?: string | undefined;
271
+ uid?: string;
272
272
  version: string;
273
273
  settings: Record<string, unknown>;
274
274
  }> | import("fishery").DeepPartialObject<{
275
- disableResolveMessage?: boolean | undefined;
276
- uid?: string | undefined;
277
- type: "email";
278
- version: "v1";
275
+ disableResolveMessage?: boolean;
276
+ uid?: string;
277
+ type: 'email';
278
+ version: 'v1';
279
279
  settings: {
280
280
  singleEmail?: boolean;
281
281
  addresses: string;
@@ -284,10 +284,10 @@ export declare const SlackIntegrationFactory: Factory<Integration, any, Integrat
284
284
  };
285
285
  secureFields: never;
286
286
  }> | import("fishery").DeepPartialObject<{
287
- disableResolveMessage?: boolean | undefined;
288
- uid?: string | undefined;
289
- type: "slack";
290
- version: "v1";
287
+ disableResolveMessage?: boolean;
288
+ uid?: string;
289
+ type: 'slack';
290
+ version: 'v1';
291
291
  settings: {
292
292
  endpointUrl?: string;
293
293
  url?: string;
@@ -308,16 +308,16 @@ export declare const SlackIntegrationFactory: Factory<Integration, any, Integrat
308
308
  url: string;
309
309
  }>;
310
310
  }> | import("fishery").DeepPartialObject<{
311
- disableResolveMessage?: boolean | undefined;
311
+ disableResolveMessage?: boolean;
312
312
  secureFields?: {
313
313
  [key: string]: boolean;
314
- } | undefined;
315
- uid?: string | undefined;
316
- type: "OnCall";
317
- version: "v1";
314
+ };
315
+ uid?: string;
316
+ type: 'OnCall';
317
+ version: 'v1';
318
318
  settings: {
319
319
  url: string;
320
- httpMethod?: "POST" | "PUT";
320
+ httpMethod?: 'POST' | 'PUT';
321
321
  maxAlerts?: number;
322
322
  authorization_scheme?: string;
323
323
  authorization_credentials?: string;
@@ -0,0 +1,41 @@
1
+ import { Factory } from 'fishery';
2
+ import { type RoutingTree } from '@grafana/api-clients/rtkq/notifications.alerting/v1beta1';
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/v1beta1").RoutingTreeMatcher, any, import("@grafana/api-clients/rtkq/notifications.alerting/v1beta1").RoutingTreeMatcher, import("fishery").DeepPartialObject<import("@grafana/api-clients/rtkq/notifications.alerting/v1beta1").RoutingTreeMatcher>>;
6
+ export declare const RouteFactory: Factory<{
7
+ active_time_intervals?: string[];
8
+ continue: boolean;
9
+ group_by?: string[];
10
+ group_interval?: string;
11
+ group_wait?: string;
12
+ mute_time_intervals?: string[];
13
+ receiver?: string;
14
+ repeat_interval?: string;
15
+ matchers?: LabelMatcher[];
16
+ routes: Route[];
17
+ }, any, {
18
+ active_time_intervals?: string[];
19
+ continue: boolean;
20
+ group_by?: string[];
21
+ group_interval?: string;
22
+ group_wait?: string;
23
+ mute_time_intervals?: string[];
24
+ receiver?: string;
25
+ repeat_interval?: string;
26
+ matchers?: LabelMatcher[];
27
+ routes: Route[];
28
+ }, import("fishery").DeepPartialObject<{
29
+ active_time_intervals?: string[];
30
+ continue: boolean;
31
+ group_by?: string[];
32
+ group_interval?: string;
33
+ group_wait?: string;
34
+ mute_time_intervals?: string[];
35
+ receiver?: string;
36
+ repeat_interval?: string;
37
+ matchers?: LabelMatcher[];
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/v1beta1").RoutingTreeList, any, import("@grafana/api-clients/rtkq/notifications.alerting/v1beta1").RoutingTreeList, import("fishery").DeepPartialObject<import("@grafana/api-clients/rtkq/notifications.alerting/v1beta1").RoutingTreeList>>;
@@ -0,0 +1,20 @@
1
+ import { Factory } from 'fishery';
2
+ export declare const AlertingEntityMetadataAnnotationsFactory: Factory<Partial<{
3
+ 'grafana.com/access/canAdmin': 'true' | 'false';
4
+ 'grafana.com/access/canDelete': 'true' | 'false';
5
+ 'grafana.com/access/canWrite': 'true' | 'false';
6
+ 'grafana.com/canUse': 'true' | 'false';
7
+ 'grafana.com/provenance': string;
8
+ }>, any, Partial<{
9
+ 'grafana.com/access/canAdmin': 'true' | 'false';
10
+ 'grafana.com/access/canDelete': 'true' | 'false';
11
+ 'grafana.com/access/canWrite': 'true' | 'false';
12
+ 'grafana.com/canUse': 'true' | 'false';
13
+ 'grafana.com/provenance': string;
14
+ }>, import("fishery").DeepPartialObject<Partial<{
15
+ 'grafana.com/access/canAdmin': 'true' | 'false';
16
+ 'grafana.com/access/canDelete': 'true' | 'false';
17
+ 'grafana.com/access/canWrite': 'true' | 'false';
18
+ 'grafana.com/canUse': 'true' | 'false';
19
+ 'grafana.com/provenance': string;
20
+ }>>>;
@@ -1,3 +1,3 @@
1
1
  import { http } from 'msw';
2
- import { type CreateReceiverApiResponse } from '@grafana/api-clients/rtkq/notifications.alerting/v0alpha1';
2
+ import { type CreateReceiverApiResponse } from '@grafana/api-clients/rtkq/notifications.alerting/v1beta1';
3
3
  export declare function createReceiverHandler(data: CreateReceiverApiResponse | ((info: Parameters<Parameters<typeof http.post>[1]>[0]) => Response)): import("msw").HttpHandler;
@@ -1,3 +1,3 @@
1
1
  import { http } from 'msw';
2
- import { type DeleteReceiverApiResponse } from '@grafana/api-clients/rtkq/notifications.alerting/v0alpha1';
2
+ import { type DeleteReceiverApiResponse } from '@grafana/api-clients/rtkq/notifications.alerting/v1beta1';
3
3
  export declare function deleteReceiverHandler(data: DeleteReceiverApiResponse | ((info: Parameters<Parameters<typeof http.delete>[1]>[0]) => Response)): import("msw").HttpHandler;
@@ -1,3 +1,3 @@
1
1
  import { http } from 'msw';
2
- import { type DeletecollectionReceiverApiResponse } from '@grafana/api-clients/rtkq/notifications.alerting/v0alpha1';
2
+ import { type DeletecollectionReceiverApiResponse } from '@grafana/api-clients/rtkq/notifications.alerting/v1beta1';
3
3
  export declare function deletecollectionReceiverHandler(data: DeletecollectionReceiverApiResponse | ((info: Parameters<Parameters<typeof http.delete>[1]>[0]) => Response)): import("msw").HttpHandler;
@@ -1,3 +1,3 @@
1
1
  import { http } from 'msw';
2
- import { type GetReceiverApiResponse } from '@grafana/api-clients/rtkq/notifications.alerting/v0alpha1';
2
+ import { type GetReceiverApiResponse } from '@grafana/api-clients/rtkq/notifications.alerting/v1beta1';
3
3
  export declare function getReceiverHandler(data: GetReceiverApiResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Response)): import("msw").HttpHandler;
@@ -1,3 +1,3 @@
1
1
  import { http } from 'msw';
2
- import { type ReplaceReceiverApiResponse } from '@grafana/api-clients/rtkq/notifications.alerting/v0alpha1';
2
+ import { type ReplaceReceiverApiResponse } from '@grafana/api-clients/rtkq/notifications.alerting/v1beta1';
3
3
  export declare function replaceReceiverHandler(data: ReplaceReceiverApiResponse | ((info: Parameters<Parameters<typeof http.put>[1]>[0]) => Response)): import("msw").HttpHandler;
@@ -1,3 +1,3 @@
1
1
  import { http } from 'msw';
2
- import { type UpdateReceiverApiResponse } from '@grafana/api-clients/rtkq/notifications.alerting/v0alpha1';
2
+ import { type UpdateReceiverApiResponse } from '@grafana/api-clients/rtkq/notifications.alerting/v1beta1';
3
3
  export declare function updateReceiverHandler(data: UpdateReceiverApiResponse | ((info: Parameters<Parameters<typeof http.patch>[1]>[0]) => Response)): import("msw").HttpHandler;
@@ -1,3 +1,3 @@
1
1
  import { http } from 'msw';
2
- import { type ListRoutingTreeApiResponse } from '@grafana/api-clients/rtkq/notifications.alerting/v0alpha1';
2
+ import { type ListRoutingTreeApiResponse } from '@grafana/api-clients/rtkq/notifications.alerting/v1beta1';
3
3
  export declare function listRoutingTreeHandler(data: ListRoutingTreeApiResponse | ((info: Parameters<Parameters<typeof http.get>[1]>[0]) => Response)): import("msw").HttpHandler;