@backstage-community/plugin-cost-insights 0.12.25 → 0.12.27

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 (230) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/alerts/ProjectGrowthAlert.esm.js +24 -0
  3. package/dist/alerts/ProjectGrowthAlert.esm.js.map +1 -0
  4. package/dist/alerts/UnlabeledDataflowAlert.esm.js +25 -0
  5. package/dist/alerts/UnlabeledDataflowAlert.esm.js.map +1 -0
  6. package/dist/api/CostInsightsApi.esm.js +8 -0
  7. package/dist/api/CostInsightsApi.esm.js.map +1 -0
  8. package/dist/components/ActionItems/ActionItemCard.esm.js +46 -0
  9. package/dist/components/ActionItems/ActionItemCard.esm.js.map +1 -0
  10. package/dist/components/ActionItems/ActionItems.esm.js +90 -0
  11. package/dist/components/ActionItems/ActionItems.esm.js.map +1 -0
  12. package/dist/components/AlertInsights/AlertDialog.esm.js +123 -0
  13. package/dist/components/AlertInsights/AlertDialog.esm.js.map +1 -0
  14. package/dist/components/AlertInsights/AlertInsights.esm.js +157 -0
  15. package/dist/components/AlertInsights/AlertInsights.esm.js.map +1 -0
  16. package/dist/components/AlertInsights/AlertInsightsHeader.esm.js +17 -0
  17. package/dist/components/AlertInsights/AlertInsightsHeader.esm.js.map +1 -0
  18. package/dist/components/AlertInsights/AlertInsightsSection.esm.js +57 -0
  19. package/dist/components/AlertInsights/AlertInsightsSection.esm.js.map +1 -0
  20. package/dist/components/AlertInsights/AlertInsightsSectionHeader.esm.js +30 -0
  21. package/dist/components/AlertInsights/AlertInsightsSectionHeader.esm.js.map +1 -0
  22. package/dist/components/AlertInsights/AlertStatusSummary.esm.js +93 -0
  23. package/dist/components/AlertInsights/AlertStatusSummary.esm.js.map +1 -0
  24. package/dist/components/AlertInsights/AlertStatusSummaryButton.esm.js +35 -0
  25. package/dist/components/AlertInsights/AlertStatusSummaryButton.esm.js.map +1 -0
  26. package/dist/components/AlertInstructionsLayout/AlertInstructionsLayout.esm.js +47 -0
  27. package/dist/components/AlertInstructionsLayout/AlertInstructionsLayout.esm.js.map +1 -0
  28. package/dist/components/BarChart/BarChart.esm.js +167 -0
  29. package/dist/components/BarChart/BarChart.esm.js.map +1 -0
  30. package/dist/components/BarChart/BarChartLabel.esm.js +31 -0
  31. package/dist/components/BarChart/BarChartLabel.esm.js.map +1 -0
  32. package/dist/components/BarChart/BarChartLegend.esm.js +47 -0
  33. package/dist/components/BarChart/BarChartLegend.esm.js.map +1 -0
  34. package/dist/components/BarChart/BarChartStepper.esm.js +91 -0
  35. package/dist/components/BarChart/BarChartStepper.esm.js.map +1 -0
  36. package/dist/components/BarChart/BarChartStepperButton.esm.js +27 -0
  37. package/dist/components/BarChart/BarChartStepperButton.esm.js.map +1 -0
  38. package/dist/components/BarChart/BarChartSteps.esm.js +25 -0
  39. package/dist/components/BarChart/BarChartSteps.esm.js.map +1 -0
  40. package/dist/components/BarChart/BarChartTick.esm.js +29 -0
  41. package/dist/components/BarChart/BarChartTick.esm.js.map +1 -0
  42. package/dist/components/BarChart/BarChartTooltip.esm.js +30 -0
  43. package/dist/components/BarChart/BarChartTooltip.esm.js.map +1 -0
  44. package/dist/components/BarChart/BarChartTooltipItem.esm.js +24 -0
  45. package/dist/components/BarChart/BarChartTooltipItem.esm.js.map +1 -0
  46. package/dist/components/CopyUrlToClipboard/CopyUrlToClipboard.esm.js +44 -0
  47. package/dist/components/CopyUrlToClipboard/CopyUrlToClipboard.esm.js.map +1 -0
  48. package/dist/components/CostGrowth/CostGrowth.esm.js +55 -0
  49. package/dist/components/CostGrowth/CostGrowth.esm.js.map +1 -0
  50. package/dist/components/CostGrowth/CostGrowthIndicator.esm.js +31 -0
  51. package/dist/components/CostGrowth/CostGrowthIndicator.esm.js.map +1 -0
  52. package/dist/components/CostInsightsHeader/CostInsightsHeader.esm.js +57 -0
  53. package/dist/components/CostInsightsHeader/CostInsightsHeader.esm.js.map +1 -0
  54. package/dist/components/CostInsightsLayout/CostInsightsLayout.esm.js +35 -0
  55. package/dist/components/CostInsightsLayout/CostInsightsLayout.esm.js.map +1 -0
  56. package/dist/components/CostInsightsNavigation/CostInsightsNavigation.esm.js +87 -0
  57. package/dist/components/CostInsightsNavigation/CostInsightsNavigation.esm.js.map +1 -0
  58. package/dist/components/CostInsightsPage/CostInsightsPage.esm.js +229 -0
  59. package/dist/components/CostInsightsPage/CostInsightsPage.esm.js.map +1 -0
  60. package/dist/components/CostInsightsPage/CostInsightsPageRoot.esm.js +15 -0
  61. package/dist/components/CostInsightsPage/CostInsightsPageRoot.esm.js.map +1 -0
  62. package/dist/components/CostInsightsPage/CostInsightsThemeProvider.esm.js +24 -0
  63. package/dist/components/CostInsightsPage/CostInsightsThemeProvider.esm.js.map +1 -0
  64. package/dist/components/CostInsightsPage/index.esm.js +2 -0
  65. package/dist/components/CostInsightsPage/index.esm.js.map +1 -0
  66. package/dist/components/CostInsightsPage/selector.esm.js +15 -0
  67. package/dist/components/CostInsightsPage/selector.esm.js.map +1 -0
  68. package/dist/components/CostInsightsTabs/CostInsightsTabs.esm.js +89 -0
  69. package/dist/components/CostInsightsTabs/CostInsightsTabs.esm.js.map +1 -0
  70. package/dist/components/CostInsightsTabs/selector.esm.js +17 -0
  71. package/dist/components/CostInsightsTabs/selector.esm.js.map +1 -0
  72. package/dist/components/CostOverviewCard/CostOverviewBreakdownChart.esm.js +196 -0
  73. package/dist/components/CostOverviewCard/CostOverviewBreakdownChart.esm.js.map +1 -0
  74. package/dist/components/CostOverviewCard/CostOverviewCard.esm.js +99 -0
  75. package/dist/components/CostOverviewCard/CostOverviewCard.esm.js.map +1 -0
  76. package/dist/components/CostOverviewCard/CostOverviewChart.esm.js +157 -0
  77. package/dist/components/CostOverviewCard/CostOverviewChart.esm.js.map +1 -0
  78. package/dist/components/CostOverviewCard/CostOverviewHeader.esm.js +25 -0
  79. package/dist/components/CostOverviewCard/CostOverviewHeader.esm.js.map +1 -0
  80. package/dist/components/CostOverviewCard/CostOverviewLegend.esm.js +54 -0
  81. package/dist/components/CostOverviewCard/CostOverviewLegend.esm.js.map +1 -0
  82. package/dist/components/CostOverviewCard/selector.esm.js +22 -0
  83. package/dist/components/CostOverviewCard/selector.esm.js.map +1 -0
  84. package/dist/components/CurrencySelect/CurrencySelect.esm.js +52 -0
  85. package/dist/components/CurrencySelect/CurrencySelect.esm.js.map +1 -0
  86. package/dist/{esm/index-BPzWHt3A.esm.js → components/EntityCosts/EntityCosts.esm.js} +14 -80
  87. package/dist/{esm/index-BPzWHt3A.esm.js.map → components/EntityCosts/EntityCosts.esm.js.map} +1 -1
  88. package/dist/components/EntityCosts/index.esm.js +2 -0
  89. package/dist/components/EntityCosts/index.esm.js.map +1 -0
  90. package/dist/{esm/index-BA6m_qFS.esm.js → components/LabelDataflowInstructionsPage/LabelDataflowInstructionsPage.esm.js} +2 -79
  91. package/dist/components/LabelDataflowInstructionsPage/LabelDataflowInstructionsPage.esm.js.map +1 -0
  92. package/dist/components/LabelDataflowInstructionsPage/index.esm.js +2 -0
  93. package/dist/components/LabelDataflowInstructionsPage/index.esm.js.map +1 -0
  94. package/dist/components/LegendItem/LegendItem.esm.js +44 -0
  95. package/dist/components/LegendItem/LegendItem.esm.js.map +1 -0
  96. package/dist/components/MetricSelect/MetricSelect.esm.js +37 -0
  97. package/dist/components/MetricSelect/MetricSelect.esm.js.map +1 -0
  98. package/dist/components/PeriodSelect/PeriodSelect.esm.js +72 -0
  99. package/dist/components/PeriodSelect/PeriodSelect.esm.js.map +1 -0
  100. package/dist/components/ProductInsights/ProductInsights.esm.js +98 -0
  101. package/dist/components/ProductInsights/ProductInsights.esm.js.map +1 -0
  102. package/dist/components/ProductInsightsCard/ProductEntityDialog.esm.js +42 -0
  103. package/dist/components/ProductInsightsCard/ProductEntityDialog.esm.js.map +1 -0
  104. package/dist/components/ProductInsightsCard/ProductEntityTable.esm.js +139 -0
  105. package/dist/components/ProductInsightsCard/ProductEntityTable.esm.js.map +1 -0
  106. package/dist/components/ProductInsightsCard/ProductInsightsCard.esm.js +83 -0
  107. package/dist/components/ProductInsightsCard/ProductInsightsCard.esm.js.map +1 -0
  108. package/dist/components/ProductInsightsCard/ProductInsightsCardList.esm.js +34 -0
  109. package/dist/components/ProductInsightsCard/ProductInsightsCardList.esm.js.map +1 -0
  110. package/dist/components/ProductInsightsCard/ProductInsightsChart.esm.js +148 -0
  111. package/dist/components/ProductInsightsCard/ProductInsightsChart.esm.js.map +1 -0
  112. package/dist/components/ProjectGrowthAlertCard/ProjectGrowthAlertCard.esm.js +20 -0
  113. package/dist/components/ProjectGrowthAlertCard/ProjectGrowthAlertCard.esm.js.map +1 -0
  114. package/dist/components/ProjectGrowthAlertCard/ProjectGrowthAlertChart.esm.js +46 -0
  115. package/dist/components/ProjectGrowthAlertCard/ProjectGrowthAlertChart.esm.js.map +1 -0
  116. package/dist/components/ProjectGrowthInstructionsPage/ProjectGrowthInstructionsPage.esm.js +111 -0
  117. package/dist/components/ProjectGrowthInstructionsPage/ProjectGrowthInstructionsPage.esm.js.map +1 -0
  118. package/dist/components/ProjectGrowthInstructionsPage/index.esm.js +2 -0
  119. package/dist/components/ProjectGrowthInstructionsPage/index.esm.js.map +1 -0
  120. package/dist/components/ProjectSelect/ProjectSelect.esm.js +47 -0
  121. package/dist/components/ProjectSelect/ProjectSelect.esm.js.map +1 -0
  122. package/dist/components/UnlabeledDataflowAlertCard/UnlabeledDataflowAlertCard.esm.js +41 -0
  123. package/dist/components/UnlabeledDataflowAlertCard/UnlabeledDataflowAlertCard.esm.js.map +1 -0
  124. package/dist/components/WhyCostsMatter/WhyCostsMatter.esm.js +21 -0
  125. package/dist/components/WhyCostsMatter/WhyCostsMatter.esm.js.map +1 -0
  126. package/dist/example/alerts/KubernetesMigrationAlert.esm.js +86 -0
  127. package/dist/example/alerts/KubernetesMigrationAlert.esm.js.map +1 -0
  128. package/dist/example/client.esm.js +194 -0
  129. package/dist/example/client.esm.js.map +1 -0
  130. package/dist/example/components/KubernetesMigrationAlertCard/KubernetesMigrationAlertCard.esm.js +33 -0
  131. package/dist/example/components/KubernetesMigrationAlertCard/KubernetesMigrationAlertCard.esm.js.map +1 -0
  132. package/dist/{esm/index-BTIHr4n_.esm.js → example/components/KubernetesMigrationAlertCard/KubernetesMigrationBarChart.esm.js} +69 -48
  133. package/dist/example/components/KubernetesMigrationAlertCard/KubernetesMigrationBarChart.esm.js.map +1 -0
  134. package/dist/example/components/KubernetesMigrationAlertCard/KubernetesMigrationBarChartLegend.esm.js +107 -0
  135. package/dist/example/components/KubernetesMigrationAlertCard/KubernetesMigrationBarChartLegend.esm.js.map +1 -0
  136. package/dist/example/forms/KubernetesMigrationDismissForm.esm.js +57 -0
  137. package/dist/example/forms/KubernetesMigrationDismissForm.esm.js.map +1 -0
  138. package/dist/forms/AlertAcceptForm.esm.js +27 -0
  139. package/dist/forms/AlertAcceptForm.esm.js.map +1 -0
  140. package/dist/forms/AlertDismissForm.esm.js +100 -0
  141. package/dist/forms/AlertDismissForm.esm.js.map +1 -0
  142. package/dist/forms/AlertSnoozeForm.esm.js +52 -0
  143. package/dist/forms/AlertSnoozeForm.esm.js.map +1 -0
  144. package/dist/hooks/useConfig.esm.js +153 -0
  145. package/dist/hooks/useConfig.esm.js.map +1 -0
  146. package/dist/hooks/useCurrency.esm.js +26 -0
  147. package/dist/hooks/useCurrency.esm.js.map +1 -0
  148. package/dist/hooks/useFilters.esm.js +67 -0
  149. package/dist/hooks/useFilters.esm.js.map +1 -0
  150. package/dist/hooks/useGroups.esm.js +55 -0
  151. package/dist/hooks/useGroups.esm.js.map +1 -0
  152. package/dist/hooks/useLastCompleteBillingDate.esm.js +65 -0
  153. package/dist/hooks/useLastCompleteBillingDate.esm.js.map +1 -0
  154. package/dist/hooks/useLoading.esm.js +54 -0
  155. package/dist/hooks/useLoading.esm.js.map +1 -0
  156. package/dist/hooks/useScroll.esm.js +24 -0
  157. package/dist/hooks/useScroll.esm.js.map +1 -0
  158. package/dist/index.esm.js +37 -22
  159. package/dist/index.esm.js.map +1 -1
  160. package/dist/plugin.esm.js +55 -0
  161. package/dist/plugin.esm.js.map +1 -0
  162. package/dist/testUtils/filters.esm.js +8 -0
  163. package/dist/testUtils/filters.esm.js.map +1 -0
  164. package/dist/testUtils/loading.esm.js +14 -0
  165. package/dist/testUtils/loading.esm.js.map +1 -0
  166. package/dist/testUtils/mockData.esm.js +485 -0
  167. package/dist/testUtils/mockData.esm.js.map +1 -0
  168. package/dist/testUtils/products.esm.js +49 -0
  169. package/dist/testUtils/products.esm.js.map +1 -0
  170. package/dist/testUtils/providers.esm.js +41 -0
  171. package/dist/testUtils/providers.esm.js.map +1 -0
  172. package/dist/testUtils/testUtils.esm.js +142 -0
  173. package/dist/testUtils/testUtils.esm.js.map +1 -0
  174. package/dist/types/Alert.esm.js +66 -0
  175. package/dist/types/Alert.esm.js.map +1 -0
  176. package/dist/types/ChangeStatistic.esm.js +15 -0
  177. package/dist/types/ChangeStatistic.esm.js.map +1 -0
  178. package/dist/types/CurrencyType.esm.js +10 -0
  179. package/dist/types/CurrencyType.esm.js.map +1 -0
  180. package/dist/types/DateFormat.esm.js +4 -0
  181. package/dist/types/DateFormat.esm.js.map +1 -0
  182. package/dist/types/Duration.esm.js +10 -0
  183. package/dist/types/Duration.esm.js.map +1 -0
  184. package/dist/types/Icon.esm.js +12 -0
  185. package/dist/types/Icon.esm.js.map +1 -0
  186. package/dist/utils/alerts.esm.js +72 -0
  187. package/dist/utils/alerts.esm.js.map +1 -0
  188. package/dist/utils/assert.esm.js +29 -0
  189. package/dist/utils/assert.esm.js.map +1 -0
  190. package/dist/utils/change.esm.js +58 -0
  191. package/dist/utils/change.esm.js.map +1 -0
  192. package/dist/utils/charts.esm.js +9 -0
  193. package/dist/utils/charts.esm.js.map +1 -0
  194. package/dist/utils/config.esm.js +19 -0
  195. package/dist/utils/config.esm.js.map +1 -0
  196. package/dist/utils/currency.esm.js +56 -0
  197. package/dist/utils/currency.esm.js.map +1 -0
  198. package/dist/utils/duration.esm.js +55 -0
  199. package/dist/utils/duration.esm.js.map +1 -0
  200. package/dist/utils/filters.esm.js +14 -0
  201. package/dist/utils/filters.esm.js.map +1 -0
  202. package/dist/utils/formatters.esm.js +103 -0
  203. package/dist/utils/formatters.esm.js.map +1 -0
  204. package/dist/utils/grammar.esm.js +14 -0
  205. package/dist/utils/grammar.esm.js.map +1 -0
  206. package/dist/utils/graphs.esm.js +48 -0
  207. package/dist/utils/graphs.esm.js.map +1 -0
  208. package/dist/utils/history.esm.js +32 -0
  209. package/dist/utils/history.esm.js.map +1 -0
  210. package/dist/utils/loading.esm.js +51 -0
  211. package/dist/utils/loading.esm.js.map +1 -0
  212. package/dist/utils/navigation.esm.js +56 -0
  213. package/dist/utils/navigation.esm.js.map +1 -0
  214. package/dist/utils/scroll.esm.js +38 -0
  215. package/dist/utils/scroll.esm.js.map +1 -0
  216. package/dist/utils/sort.esm.js +10 -0
  217. package/dist/utils/sort.esm.js.map +1 -0
  218. package/dist/utils/styles.esm.js +562 -0
  219. package/dist/utils/styles.esm.js.map +1 -0
  220. package/dist/utils/sum.esm.js +4 -0
  221. package/dist/utils/sum.esm.js.map +1 -0
  222. package/package.json +17 -12
  223. package/dist/esm/index-BA6m_qFS.esm.js.map +0 -1
  224. package/dist/esm/index-BFM2mP6Z.esm.js +0 -4084
  225. package/dist/esm/index-BFM2mP6Z.esm.js.map +0 -1
  226. package/dist/esm/index-BTIHr4n_.esm.js.map +0 -1
  227. package/dist/esm/index-DaitkcPN.esm.js +0 -1136
  228. package/dist/esm/index-DaitkcPN.esm.js.map +0 -1
  229. package/dist/esm/selector-D7iXJwd9.esm.js +0 -594
  230. package/dist/esm/selector-D7iXJwd9.esm.js.map +0 -1
@@ -0,0 +1,485 @@
1
+ const MockBigQueryInsights = {
2
+ id: "bigQuery",
3
+ aggregation: [1e4, 3e4],
4
+ change: {
5
+ ratio: 3,
6
+ amount: 2e4
7
+ },
8
+ entities: {
9
+ dataset: [
10
+ {
11
+ id: "dataset-a",
12
+ aggregation: [5e3, 1e4],
13
+ change: {
14
+ ratio: 1,
15
+ amount: 5e3
16
+ },
17
+ entities: {}
18
+ },
19
+ {
20
+ id: "dataset-b",
21
+ aggregation: [5e3, 1e4],
22
+ change: {
23
+ ratio: 1,
24
+ amount: 5e3
25
+ },
26
+ entities: {}
27
+ },
28
+ {
29
+ id: "dataset-c",
30
+ aggregation: [0, 1e4],
31
+ change: {
32
+ amount: 1e4
33
+ },
34
+ entities: {}
35
+ }
36
+ ]
37
+ }
38
+ };
39
+ const MockCloudDataflowInsights = {
40
+ id: "cloudDataflow",
41
+ aggregation: [1e5, 158e3],
42
+ change: {
43
+ ratio: 0.58,
44
+ amount: 58e3
45
+ },
46
+ entities: {
47
+ pipeline: [
48
+ {
49
+ id: null,
50
+ aggregation: [1e4, 12e3],
51
+ change: {
52
+ ratio: 0.2,
53
+ amount: 2e3
54
+ },
55
+ entities: {
56
+ SKU: [
57
+ {
58
+ id: "Mock SKU A",
59
+ aggregation: [3e3, 4e3],
60
+ change: {
61
+ ratio: 0.333333,
62
+ amount: 1e3
63
+ },
64
+ entities: {}
65
+ },
66
+ {
67
+ id: "Mock SKU B",
68
+ aggregation: [7e3, 8e3],
69
+ change: {
70
+ ratio: 0.14285714,
71
+ amount: 1e3
72
+ },
73
+ entities: {}
74
+ }
75
+ ]
76
+ }
77
+ },
78
+ {
79
+ id: "pipeline-a",
80
+ aggregation: [6e4, 7e4],
81
+ change: {
82
+ ratio: 0.16666666666666666,
83
+ amount: 1e4
84
+ },
85
+ entities: {
86
+ SKU: [
87
+ {
88
+ id: "Mock SKU A",
89
+ aggregation: [2e4, 15e3],
90
+ change: {
91
+ ratio: -0.25,
92
+ amount: -5e3
93
+ },
94
+ entities: {}
95
+ },
96
+ {
97
+ id: "Mock SKU B",
98
+ aggregation: [3e4, 35e3],
99
+ change: {
100
+ ratio: -0.16666666666666666,
101
+ amount: -5e3
102
+ },
103
+ entities: {}
104
+ },
105
+ {
106
+ id: "Mock SKU C",
107
+ aggregation: [1e4, 2e4],
108
+ change: {
109
+ ratio: 1,
110
+ amount: 1e4
111
+ },
112
+ entities: {}
113
+ }
114
+ ]
115
+ }
116
+ },
117
+ {
118
+ id: "pipeline-b",
119
+ aggregation: [12e3, 8e3],
120
+ change: {
121
+ ratio: -0.33333,
122
+ amount: -4e3
123
+ },
124
+ entities: {
125
+ SKU: [
126
+ {
127
+ id: "Mock SKU A",
128
+ aggregation: [4e3, 4e3],
129
+ change: {
130
+ ratio: 0,
131
+ amount: 0
132
+ },
133
+ entities: {}
134
+ },
135
+ {
136
+ id: "Mock SKU B",
137
+ aggregation: [8e3, 4e3],
138
+ change: {
139
+ ratio: -0.5,
140
+ amount: -4e3
141
+ },
142
+ entities: {}
143
+ }
144
+ ]
145
+ }
146
+ },
147
+ {
148
+ id: "pipeline-c",
149
+ aggregation: [0, 1e4],
150
+ change: {
151
+ amount: 1e4
152
+ },
153
+ entities: {}
154
+ }
155
+ ]
156
+ }
157
+ };
158
+ const MockCloudStorageInsights = {
159
+ id: "cloudStorage",
160
+ aggregation: [45e3, 45e3],
161
+ change: {
162
+ ratio: 0,
163
+ amount: 0
164
+ },
165
+ entities: {
166
+ bucket: [
167
+ {
168
+ id: "bucket-a",
169
+ aggregation: [15e3, 2e4],
170
+ change: {
171
+ ratio: 0.333,
172
+ amount: 5e3
173
+ },
174
+ entities: {
175
+ SKU: [
176
+ {
177
+ id: "Mock SKU A",
178
+ aggregation: [1e4, 11e3],
179
+ change: {
180
+ ratio: 0.1,
181
+ amount: 1e3
182
+ },
183
+ entities: {}
184
+ },
185
+ {
186
+ id: "Mock SKU B",
187
+ aggregation: [2e3, 5e3],
188
+ change: {
189
+ ratio: 1.5,
190
+ amount: 3e3
191
+ },
192
+ entities: {}
193
+ },
194
+ {
195
+ id: "Mock SKU C",
196
+ aggregation: [3e3, 4e3],
197
+ change: {
198
+ ratio: 0.3333,
199
+ amount: 1e3
200
+ },
201
+ entities: {}
202
+ }
203
+ ]
204
+ }
205
+ },
206
+ {
207
+ id: "bucket-b",
208
+ aggregation: [3e4, 25e3],
209
+ change: {
210
+ ratio: -0.16666,
211
+ amount: -5e3
212
+ },
213
+ entities: {
214
+ SKU: [
215
+ {
216
+ id: "Mock SKU A",
217
+ aggregation: [12e3, 13e3],
218
+ change: {
219
+ ratio: 0.08333333333333333,
220
+ amount: 1e3
221
+ },
222
+ entities: {}
223
+ },
224
+ {
225
+ id: "Mock SKU B",
226
+ aggregation: [16e3, 12e3],
227
+ change: {
228
+ ratio: -0.25,
229
+ amount: -4e3
230
+ },
231
+ entities: {}
232
+ },
233
+ {
234
+ id: "Mock SKU C",
235
+ aggregation: [2e3, 0],
236
+ change: {
237
+ amount: -2e3
238
+ },
239
+ entities: {}
240
+ }
241
+ ]
242
+ }
243
+ },
244
+ {
245
+ id: "bucket-c",
246
+ aggregation: [0, 0],
247
+ change: {
248
+ amount: 0
249
+ },
250
+ entities: {}
251
+ }
252
+ ]
253
+ }
254
+ };
255
+ const MockComputeEngineInsights = {
256
+ id: "computeEngine",
257
+ aggregation: [8e4, 9e4],
258
+ change: {
259
+ ratio: 0.125,
260
+ amount: 1e4
261
+ },
262
+ entities: {
263
+ service: [
264
+ {
265
+ id: "service-a",
266
+ aggregation: [2e4, 1e4],
267
+ change: {
268
+ ratio: -0.5,
269
+ amount: -1e4
270
+ },
271
+ entities: {
272
+ SKU: [
273
+ {
274
+ id: "Mock SKU A",
275
+ aggregation: [4e3, 2e3],
276
+ change: {
277
+ ratio: -0.5,
278
+ amount: -2e3
279
+ },
280
+ entities: {}
281
+ },
282
+ {
283
+ id: "Mock SKU B",
284
+ aggregation: [7e3, 6e3],
285
+ change: {
286
+ ratio: -0.14285714285714285,
287
+ amount: -1e3
288
+ },
289
+ entities: {}
290
+ },
291
+ {
292
+ id: "Mock SKU C",
293
+ aggregation: [9e3, 2e3],
294
+ change: {
295
+ ratio: -0.7777777777777778,
296
+ amount: -7e3
297
+ },
298
+ entities: {}
299
+ }
300
+ ],
301
+ deployment: [
302
+ {
303
+ id: "Compute Engine",
304
+ aggregation: [7e3, 6e3],
305
+ change: {
306
+ ratio: -0.5,
307
+ amount: -2e3
308
+ },
309
+ entities: {}
310
+ },
311
+ {
312
+ id: "Kubernetes",
313
+ aggregation: [4e3, 2e3],
314
+ change: {
315
+ ratio: -0.14285714285714285,
316
+ amount: -1e3
317
+ },
318
+ entities: {}
319
+ }
320
+ ]
321
+ }
322
+ },
323
+ {
324
+ id: "service-b",
325
+ aggregation: [1e4, 2e4],
326
+ change: {
327
+ ratio: 1,
328
+ amount: 1e4
329
+ },
330
+ entities: {
331
+ SKU: [
332
+ {
333
+ id: "Mock SKU A",
334
+ aggregation: [1e3, 2e3],
335
+ change: {
336
+ ratio: 1,
337
+ amount: 1e3
338
+ },
339
+ entities: {}
340
+ },
341
+ {
342
+ id: "Mock SKU B",
343
+ aggregation: [4e3, 8e3],
344
+ change: {
345
+ ratio: 1,
346
+ amount: 4e3
347
+ },
348
+ entities: {}
349
+ },
350
+ {
351
+ id: "Mock SKU C",
352
+ aggregation: [5e3, 1e4],
353
+ change: {
354
+ ratio: 1,
355
+ amount: 5e3
356
+ },
357
+ entities: {}
358
+ }
359
+ ],
360
+ deployment: [
361
+ {
362
+ id: "Compute Engine",
363
+ aggregation: [7e3, 6e3],
364
+ change: {
365
+ ratio: -0.5,
366
+ amount: -2e3
367
+ },
368
+ entities: {}
369
+ },
370
+ {
371
+ id: "Kubernetes",
372
+ aggregation: [4e3, 2e3],
373
+ change: {
374
+ ratio: -0.14285714285714285,
375
+ amount: -1e3
376
+ },
377
+ entities: {}
378
+ }
379
+ ]
380
+ }
381
+ },
382
+ {
383
+ id: "service-c",
384
+ aggregation: [0, 1e4],
385
+ change: {
386
+ amount: 1e4
387
+ },
388
+ entities: {}
389
+ }
390
+ ]
391
+ }
392
+ };
393
+ const MockEventsInsights = {
394
+ id: "events",
395
+ aggregation: [2e4, 1e4],
396
+ change: {
397
+ ratio: -0.5,
398
+ amount: -1e4
399
+ },
400
+ entities: {
401
+ event: [
402
+ {
403
+ id: "event-a",
404
+ aggregation: [15e3, 7e3],
405
+ change: {
406
+ ratio: -0.53333333333,
407
+ amount: -8e3
408
+ },
409
+ entities: {
410
+ product: [
411
+ {
412
+ id: "Mock Product A",
413
+ aggregation: [5e3, 2e3],
414
+ change: {
415
+ ratio: -0.6,
416
+ amount: -3e3
417
+ },
418
+ entities: {}
419
+ },
420
+ {
421
+ id: "Mock Product B",
422
+ aggregation: [7e3, 2500],
423
+ change: {
424
+ ratio: -0.64285714285,
425
+ amount: -4500
426
+ },
427
+ entities: {}
428
+ },
429
+ {
430
+ id: "Mock Product C",
431
+ aggregation: [3e3, 2500],
432
+ change: {
433
+ ratio: -0.16666666666,
434
+ amount: -500
435
+ },
436
+ entities: {}
437
+ }
438
+ ]
439
+ }
440
+ },
441
+ {
442
+ id: "event-b",
443
+ aggregation: [5e3, 3e3],
444
+ change: {
445
+ ratio: -0.4,
446
+ amount: -2e3
447
+ },
448
+ entities: {
449
+ product: [
450
+ {
451
+ id: "Mock Product A",
452
+ aggregation: [2e3, 1e3],
453
+ change: {
454
+ ratio: -0.5,
455
+ amount: -1e3
456
+ },
457
+ entities: {}
458
+ },
459
+ {
460
+ id: "Mock Product B",
461
+ aggregation: [1e3, 1500],
462
+ change: {
463
+ ratio: 0.5,
464
+ amount: 500
465
+ },
466
+ entities: {}
467
+ },
468
+ {
469
+ id: "Mock Product C",
470
+ aggregation: [2e3, 500],
471
+ change: {
472
+ ratio: -0.75,
473
+ amount: -1500
474
+ },
475
+ entities: {}
476
+ }
477
+ ]
478
+ }
479
+ }
480
+ ]
481
+ }
482
+ };
483
+
484
+ export { MockBigQueryInsights, MockCloudDataflowInsights, MockCloudStorageInsights, MockComputeEngineInsights, MockEventsInsights };
485
+ //# sourceMappingURL=mockData.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mockData.esm.js","sources":["../../src/testUtils/mockData.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n DateAggregation,\n Entity,\n} from '@backstage-community/plugin-cost-insights-common';\n\nexport const MockAggregatedDailyCosts: DateAggregation[] = [\n {\n date: '2020-08-07',\n amount: 3500,\n },\n {\n date: '2020-08-06',\n amount: 2500,\n },\n {\n date: '2020-08-05',\n amount: 1400,\n },\n {\n date: '2020-08-04',\n amount: 3800,\n },\n {\n date: '2020-08-09',\n amount: 1900,\n },\n {\n date: '2020-08-08',\n amount: 2400,\n },\n {\n date: '2020-08-03',\n amount: 4000,\n },\n {\n date: '2020-08-02',\n amount: 3700,\n },\n {\n date: '2020-08-01',\n amount: 2500,\n },\n {\n date: '2020-08-18',\n amount: 4300,\n },\n {\n date: '2020-08-17',\n amount: 1500,\n },\n {\n date: '2020-08-16',\n amount: 3600,\n },\n {\n date: '2020-08-15',\n amount: 2200,\n },\n {\n date: '2020-08-19',\n amount: 3900,\n },\n {\n date: '2020-08-10',\n amount: 4100,\n },\n {\n date: '2020-08-14',\n amount: 3600,\n },\n {\n date: '2020-08-13',\n amount: 2900,\n },\n {\n date: '2020-08-12',\n amount: 2700,\n },\n {\n date: '2020-08-11',\n amount: 5100,\n },\n {\n date: '2020-09-19',\n amount: 1200,\n },\n {\n date: '2020-09-18',\n amount: 6500,\n },\n {\n date: '2020-09-17',\n amount: 2500,\n },\n {\n date: '2020-09-16',\n amount: 1400,\n },\n {\n date: '2020-09-11',\n amount: 2300,\n },\n {\n date: '2020-09-10',\n amount: 1900,\n },\n {\n date: '2020-09-15',\n amount: 3100,\n },\n {\n date: '2020-09-14',\n amount: 4500,\n },\n {\n date: '2020-09-13',\n amount: 3300,\n },\n {\n date: '2020-09-12',\n amount: 2800,\n },\n {\n date: '2020-09-29',\n amount: 2600,\n },\n {\n date: '2020-09-28',\n amount: 4100,\n },\n {\n date: '2020-09-27',\n amount: 3800,\n },\n {\n date: '2020-09-22',\n amount: 3700,\n },\n {\n date: '2020-09-21',\n amount: 2700,\n },\n {\n date: '2020-09-20',\n amount: 2200,\n },\n {\n date: '2020-09-26',\n amount: 3300,\n },\n {\n date: '2020-09-25',\n amount: 4000,\n },\n {\n date: '2020-09-24',\n amount: 3800,\n },\n {\n date: '2020-09-23',\n amount: 4100,\n },\n {\n date: '2020-08-29',\n amount: 4400,\n },\n {\n date: '2020-08-28',\n amount: 5000,\n },\n {\n date: '2020-08-27',\n amount: 4900,\n },\n {\n date: '2020-08-26',\n amount: 4100,\n },\n {\n date: '2020-08-21',\n amount: 3700,\n },\n {\n date: '2020-08-20',\n amount: 2200,\n },\n {\n date: '2020-08-25',\n amount: 1700,\n },\n {\n date: '2020-08-24',\n amount: 2100,\n },\n {\n date: '2020-08-23',\n amount: 3100,\n },\n {\n date: '2020-08-22',\n amount: 1500,\n },\n {\n date: '2020-09-08',\n amount: 2900,\n },\n {\n date: '2020-09-07',\n amount: 4100,\n },\n {\n date: '2020-09-06',\n amount: 3600,\n },\n {\n date: '2020-09-05',\n amount: 3300,\n },\n {\n date: '2020-09-09',\n amount: 2800,\n },\n {\n date: '2020-08-31',\n amount: 3400,\n },\n {\n date: '2020-08-30',\n amount: 4300,\n },\n {\n date: '2020-09-04',\n amount: 6100,\n },\n {\n date: '2020-09-03',\n amount: 2500,\n },\n {\n date: '2020-09-02',\n amount: 4900,\n },\n {\n date: '2020-09-01',\n amount: 6100,\n },\n {\n date: '2020-09-30',\n amount: 5500,\n },\n];\n\nexport const MockBigQueryInsights: Entity = {\n id: 'bigQuery',\n aggregation: [10_000, 30_000],\n change: {\n ratio: 3,\n amount: 20_000,\n },\n entities: {\n dataset: [\n {\n id: 'dataset-a',\n aggregation: [5_000, 10_000],\n change: {\n ratio: 1,\n amount: 5_000,\n },\n entities: {},\n },\n {\n id: 'dataset-b',\n aggregation: [5_000, 10_000],\n change: {\n ratio: 1,\n amount: 5_000,\n },\n entities: {},\n },\n {\n id: 'dataset-c',\n aggregation: [0, 10_000],\n change: {\n amount: 10_000,\n },\n entities: {},\n },\n ],\n },\n};\n\nexport const MockCloudDataflowInsights: Entity = {\n id: 'cloudDataflow',\n aggregation: [100_000, 158_000],\n change: {\n ratio: 0.58,\n amount: 58_000,\n },\n entities: {\n pipeline: [\n {\n id: null,\n aggregation: [10_000, 12_000],\n change: {\n ratio: 0.2,\n amount: 2_000,\n },\n entities: {\n SKU: [\n {\n id: 'Mock SKU A',\n aggregation: [3_000, 4_000],\n change: {\n ratio: 0.333333,\n amount: 1_000,\n },\n entities: {},\n },\n {\n id: 'Mock SKU B',\n aggregation: [7_000, 8_000],\n change: {\n ratio: 0.14285714,\n amount: 1_000,\n },\n entities: {},\n },\n ],\n },\n },\n {\n id: 'pipeline-a',\n aggregation: [60_000, 70_000],\n change: {\n ratio: 0.16666666666666666,\n amount: 10_000,\n },\n entities: {\n SKU: [\n {\n id: 'Mock SKU A',\n aggregation: [20_000, 15_000],\n change: {\n ratio: -0.25,\n amount: -5_000,\n },\n entities: {},\n },\n {\n id: 'Mock SKU B',\n aggregation: [30_000, 35_000],\n change: {\n ratio: -0.16666666666666666,\n amount: -5_000,\n },\n entities: {},\n },\n {\n id: 'Mock SKU C',\n aggregation: [10_000, 20_000],\n change: {\n ratio: 1,\n amount: 10_000,\n },\n entities: {},\n },\n ],\n },\n },\n {\n id: 'pipeline-b',\n aggregation: [12_000, 8_000],\n change: {\n ratio: -0.33333,\n amount: -4_000,\n },\n entities: {\n SKU: [\n {\n id: 'Mock SKU A',\n aggregation: [4_000, 4_000],\n change: {\n ratio: 0,\n amount: 0,\n },\n entities: {},\n },\n {\n id: 'Mock SKU B',\n aggregation: [8_000, 4_000],\n change: {\n ratio: -0.5,\n amount: -4_000,\n },\n entities: {},\n },\n ],\n },\n },\n {\n id: 'pipeline-c',\n aggregation: [0, 10_000],\n change: {\n amount: 10_000,\n },\n entities: {},\n },\n ],\n },\n};\n\nexport const MockCloudStorageInsights: Entity = {\n id: 'cloudStorage',\n aggregation: [45_000, 45_000],\n change: {\n ratio: 0,\n amount: 0,\n },\n entities: {\n bucket: [\n {\n id: 'bucket-a',\n aggregation: [15_000, 20_000],\n change: {\n ratio: 0.333,\n amount: 5_000,\n },\n entities: {\n SKU: [\n {\n id: 'Mock SKU A',\n aggregation: [10_000, 11_000],\n change: {\n ratio: 0.1,\n amount: 1_000,\n },\n entities: {},\n },\n {\n id: 'Mock SKU B',\n aggregation: [2_000, 5_000],\n change: {\n ratio: 1.5,\n amount: 3_000,\n },\n entities: {},\n },\n {\n id: 'Mock SKU C',\n aggregation: [3_000, 4_000],\n change: {\n ratio: 0.3333,\n amount: 1_000,\n },\n entities: {},\n },\n ],\n },\n },\n {\n id: 'bucket-b',\n aggregation: [30_000, 25_000],\n change: {\n ratio: -0.16666,\n amount: -5_000,\n },\n entities: {\n SKU: [\n {\n id: 'Mock SKU A',\n aggregation: [12_000, 13_000],\n change: {\n ratio: 0.08333333333333333,\n amount: 1_000,\n },\n entities: {},\n },\n {\n id: 'Mock SKU B',\n aggregation: [16_000, 12_000],\n change: {\n ratio: -0.25,\n amount: -4_000,\n },\n entities: {},\n },\n {\n id: 'Mock SKU C',\n aggregation: [2_000, 0],\n change: {\n amount: -2000,\n },\n entities: {},\n },\n ],\n },\n },\n {\n id: 'bucket-c',\n aggregation: [0, 0],\n change: {\n amount: 0,\n },\n entities: {},\n },\n ],\n },\n};\n\nexport const MockComputeEngineInsights: Entity = {\n id: 'computeEngine',\n aggregation: [80_000, 90_000],\n change: {\n ratio: 0.125,\n amount: 10_000,\n },\n entities: {\n service: [\n {\n id: 'service-a',\n aggregation: [20_000, 10_000],\n change: {\n ratio: -0.5,\n amount: -10_000,\n },\n entities: {\n SKU: [\n {\n id: 'Mock SKU A',\n aggregation: [4_000, 2_000],\n change: {\n ratio: -0.5,\n amount: -2_000,\n },\n entities: {},\n },\n {\n id: 'Mock SKU B',\n aggregation: [7_000, 6_000],\n change: {\n ratio: -0.14285714285714285,\n amount: -1_000,\n },\n entities: {},\n },\n {\n id: 'Mock SKU C',\n aggregation: [9_000, 2_000],\n change: {\n ratio: -0.7777777777777778,\n amount: -7000,\n },\n entities: {},\n },\n ],\n deployment: [\n {\n id: 'Compute Engine',\n aggregation: [7_000, 6_000],\n change: {\n ratio: -0.5,\n amount: -2_000,\n },\n entities: {},\n },\n {\n id: 'Kubernetes',\n aggregation: [4_000, 2_000],\n change: {\n ratio: -0.14285714285714285,\n amount: -1_000,\n },\n entities: {},\n },\n ],\n },\n },\n {\n id: 'service-b',\n aggregation: [10_000, 20_000],\n change: {\n ratio: 1,\n amount: 10_000,\n },\n entities: {\n SKU: [\n {\n id: 'Mock SKU A',\n aggregation: [1_000, 2_000],\n change: {\n ratio: 1,\n amount: 1_000,\n },\n entities: {},\n },\n {\n id: 'Mock SKU B',\n aggregation: [4_000, 8_000],\n change: {\n ratio: 1,\n amount: 4_000,\n },\n entities: {},\n },\n {\n id: 'Mock SKU C',\n aggregation: [5_000, 10_000],\n change: {\n ratio: 1,\n amount: 5_000,\n },\n entities: {},\n },\n ],\n deployment: [\n {\n id: 'Compute Engine',\n aggregation: [7_000, 6_000],\n change: {\n ratio: -0.5,\n amount: -2_000,\n },\n entities: {},\n },\n {\n id: 'Kubernetes',\n aggregation: [4_000, 2_000],\n change: {\n ratio: -0.14285714285714285,\n amount: -1_000,\n },\n entities: {},\n },\n ],\n },\n },\n {\n id: 'service-c',\n aggregation: [0, 10_000],\n change: {\n amount: 10_000,\n },\n entities: {},\n },\n ],\n },\n};\n\nexport const MockEventsInsights: Entity = {\n id: 'events',\n aggregation: [20_000, 10_000],\n change: {\n ratio: -0.5,\n amount: -10_000,\n },\n entities: {\n event: [\n {\n id: 'event-a',\n aggregation: [15_000, 7_000],\n change: {\n ratio: -0.53333333333,\n amount: -8_000,\n },\n entities: {\n product: [\n {\n id: 'Mock Product A',\n aggregation: [5_000, 2_000],\n change: {\n ratio: -0.6,\n amount: -3_000,\n },\n entities: {},\n },\n {\n id: 'Mock Product B',\n aggregation: [7_000, 2_500],\n change: {\n ratio: -0.64285714285,\n amount: -4_500,\n },\n entities: {},\n },\n {\n id: 'Mock Product C',\n aggregation: [3_000, 2_500],\n change: {\n ratio: -0.16666666666,\n amount: -500,\n },\n entities: {},\n },\n ],\n },\n },\n {\n id: 'event-b',\n aggregation: [5_000, 3_000],\n change: {\n ratio: -0.4,\n amount: -2_000,\n },\n entities: {\n product: [\n {\n id: 'Mock Product A',\n aggregation: [2_000, 1_000],\n change: {\n ratio: -0.5,\n amount: -1_000,\n },\n entities: {},\n },\n {\n id: 'Mock Product B',\n aggregation: [1_000, 1_500],\n change: {\n ratio: 0.5,\n amount: 500,\n },\n entities: {},\n },\n {\n id: 'Mock Product C',\n aggregation: [2_000, 500],\n change: {\n ratio: -0.75,\n amount: -1_500,\n },\n entities: {},\n },\n ],\n },\n },\n ],\n },\n};\n"],"names":[],"mappings":"AA4QO,MAAM,oBAA+B,GAAA;AAAA,EAC1C,EAAI,EAAA,UAAA;AAAA,EACJ,WAAA,EAAa,CAAC,GAAA,EAAQ,GAAM,CAAA;AAAA,EAC5B,MAAQ,EAAA;AAAA,IACN,KAAO,EAAA,CAAA;AAAA,IACP,MAAQ,EAAA,GAAA;AAAA,GACV;AAAA,EACA,QAAU,EAAA;AAAA,IACR,OAAS,EAAA;AAAA,MACP;AAAA,QACE,EAAI,EAAA,WAAA;AAAA,QACJ,WAAA,EAAa,CAAC,GAAA,EAAO,GAAM,CAAA;AAAA,QAC3B,MAAQ,EAAA;AAAA,UACN,KAAO,EAAA,CAAA;AAAA,UACP,MAAQ,EAAA,GAAA;AAAA,SACV;AAAA,QACA,UAAU,EAAC;AAAA,OACb;AAAA,MACA;AAAA,QACE,EAAI,EAAA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,gBACP,MAAQ,EAAA,GAAA;AAAA,eACV;AAAA,cACA,UAAU,EAAC;AAAA,aACb;AAAA,YACA;AAAA,cACE,EAAI,EAAA,gBAAA;AAAA,cACJ,WAAA,EAAa,CAAC,GAAA,EAAO,GAAG,CAAA;AAAA,cACxB,MAAQ,EAAA;AAAA,gBACN,KAAO,EAAA,CAAA,IAAA;AAAA,gBACP,MAAQ,EAAA,CAAA,IAAA;AAAA,eACV;AAAA,cACA,UAAU,EAAC;AAAA,aACb;AAAA,WACF;AAAA,SACF;AAAA,OACF;AAAA,KACF;AAAA,GACF;AACF;;;;"}
@@ -0,0 +1,49 @@
1
+ import { findAlways } from '../utils/assert.esm.js';
2
+
3
+ const createMockProduct = (callback) => {
4
+ const defaultProduct = {
5
+ kind: "compute-engine",
6
+ name: "Compute Engine"
7
+ };
8
+ if (typeof callback === "function") {
9
+ return callback({ ...defaultProduct });
10
+ }
11
+ return { ...defaultProduct };
12
+ };
13
+ const MockProductTypes = {
14
+ "compute-engine": "Compute Engine",
15
+ "cloud-dataflow": "Cloud Dataflow",
16
+ "cloud-storage": "Cloud Storage",
17
+ "big-query": "Big Query",
18
+ "big-table": "BigTable",
19
+ "cloud-pub-sub": "Cloud Pub/Sub"
20
+ };
21
+ const MockProducts = Object.keys(MockProductTypes).map(
22
+ (productType) => createMockProduct(() => ({
23
+ kind: productType,
24
+ name: MockProductTypes[productType]
25
+ }))
26
+ );
27
+ findAlways(
28
+ MockProducts,
29
+ (p) => p.kind === "compute-engine"
30
+ );
31
+ findAlways(
32
+ MockProducts,
33
+ (p) => p.kind === "cloud-dataflow"
34
+ );
35
+ findAlways(
36
+ MockProducts,
37
+ (p) => p.kind === "cloud-storage"
38
+ );
39
+ findAlways(
40
+ MockProducts,
41
+ (p) => p.kind === "big-query"
42
+ );
43
+ findAlways(
44
+ MockProducts,
45
+ (p) => p.kind === "big-table"
46
+ );
47
+
48
+ export { MockProductTypes, MockProducts, createMockProduct };
49
+ //# sourceMappingURL=products.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"products.esm.js","sources":["../../src/testUtils/products.ts"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n Entity,\n Product,\n} from '@backstage-community/plugin-cost-insights-common';\nimport { findAlways } from '../utils/assert';\n\ntype mockEntityRenderer<T> = (entity: T) => T;\n\nexport const createMockEntity = (\n callback?: mockEntityRenderer<Entity>,\n): Entity => {\n const defaultEntity: Entity = {\n id: 'test-entity',\n aggregation: [100, 200],\n entities: {},\n change: {\n ratio: 0,\n amount: 0,\n },\n };\n\n if (typeof callback === 'function') {\n return callback({ ...defaultEntity });\n }\n return { ...defaultEntity };\n};\n\nexport const createMockProduct = (\n callback?: mockEntityRenderer<Product>,\n): Product => {\n const defaultProduct: Product = {\n kind: 'compute-engine',\n name: 'Compute Engine',\n };\n if (typeof callback === 'function') {\n return callback({ ...defaultProduct });\n }\n return { ...defaultProduct };\n};\n\nexport const MockProductTypes: Record<string, string> = {\n 'compute-engine': 'Compute Engine',\n 'cloud-dataflow': 'Cloud Dataflow',\n 'cloud-storage': 'Cloud Storage',\n 'big-query': 'Big Query',\n 'big-table': 'BigTable',\n 'cloud-pub-sub': 'Cloud Pub/Sub',\n};\n\nexport const MockProducts: Product[] = Object.keys(MockProductTypes).map(\n productType =>\n createMockProduct(() => ({\n kind: productType,\n name: MockProductTypes[productType],\n })),\n);\n\nexport const MockComputeEngine = findAlways(\n MockProducts,\n p => p.kind === 'compute-engine',\n);\nexport const MockCloudDataflow = findAlways(\n MockProducts,\n p => p.kind === 'cloud-dataflow',\n);\nexport const MockCloudStorage = findAlways(\n MockProducts,\n p => p.kind === 'cloud-storage',\n);\nexport const MockBigQuery = findAlways(\n MockProducts,\n p => p.kind === 'big-query',\n);\nexport const MockBigtable = findAlways(\n MockProducts,\n p => p.kind === 'big-table',\n);\n"],"names":[],"mappings":";;AA2Ca,MAAA,iBAAA,GAAoB,CAC/B,QACY,KAAA;AACZ,EAAA,MAAM,cAA0B,GAAA;AAAA,IAC9B,IAAM,EAAA,gBAAA;AAAA,IACN,IAAM,EAAA,gBAAA;AAAA,GACR,CAAA;AACA,EAAI,IAAA,OAAO,aAAa,UAAY,EAAA;AAClC,IAAA,OAAO,QAAS,CAAA,EAAE,GAAG,cAAA,EAAgB,CAAA,CAAA;AAAA,GACvC;AACA,EAAO,OAAA,EAAE,GAAG,cAAe,EAAA,CAAA;AAC7B,EAAA;AAEO,MAAM,gBAA2C,GAAA;AAAA,EACtD,gBAAkB,EAAA,gBAAA;AAAA,EAClB,gBAAkB,EAAA,gBAAA;AAAA,EAClB,eAAiB,EAAA,eAAA;AAAA,EACjB,WAAa,EAAA,WAAA;AAAA,EACb,WAAa,EAAA,UAAA;AAAA,EACb,eAAiB,EAAA,eAAA;AACnB,EAAA;AAEO,MAAM,YAA0B,GAAA,MAAA,CAAO,IAAK,CAAA,gBAAgB,CAAE,CAAA,GAAA;AAAA,EACnE,CAAA,WAAA,KACE,kBAAkB,OAAO;AAAA,IACvB,IAAM,EAAA,WAAA;AAAA,IACN,IAAA,EAAM,iBAAiB,WAAW,CAAA;AAAA,GAClC,CAAA,CAAA;AACN,EAAA;AAEiC,UAAA;AAAA,EAC/B,YAAA;AAAA,EACA,CAAA,CAAA,KAAK,EAAE,IAAS,KAAA,gBAAA;AAClB,EAAA;AACiC,UAAA;AAAA,EAC/B,YAAA;AAAA,EACA,CAAA,CAAA,KAAK,EAAE,IAAS,KAAA,gBAAA;AAClB,EAAA;AACgC,UAAA;AAAA,EAC9B,YAAA;AAAA,EACA,CAAA,CAAA,KAAK,EAAE,IAAS,KAAA,eAAA;AAClB,EAAA;AAC4B,UAAA;AAAA,EAC1B,YAAA;AAAA,EACA,CAAA,CAAA,KAAK,EAAE,IAAS,KAAA,WAAA;AAClB,EAAA;AAC4B,UAAA;AAAA,EAC1B,YAAA;AAAA,EACA,CAAA,CAAA,KAAK,EAAE,IAAS,KAAA,WAAA;AAClB;;;;"}
@@ -0,0 +1,41 @@
1
+ import React from 'react';
2
+ import { ConfigContext } from '../hooks/useConfig.esm.js';
3
+ import { CurrencyContext } from '../hooks/useCurrency.esm.js';
4
+ import '../hooks/useFilters.esm.js';
5
+ import '../hooks/useGroups.esm.js';
6
+ import '../hooks/useLoading.esm.js';
7
+ import '../hooks/useScroll.esm.js';
8
+ import '../hooks/useLastCompleteBillingDate.esm.js';
9
+ import '../types/Alert.esm.js';
10
+ import { EngineerThreshold } from '../types/ChangeStatistic.esm.js';
11
+ import { createCurrencyFormat } from '../utils/currency.esm.js';
12
+
13
+ const MockConfigProvider = (props) => {
14
+ const { children, ...context } = props;
15
+ const defaultContext = {
16
+ baseCurrency: createCurrencyFormat(),
17
+ metrics: [],
18
+ products: [],
19
+ icons: [],
20
+ engineerCost: 0,
21
+ engineerThreshold: EngineerThreshold,
22
+ hideTrendLine: false,
23
+ currencies: []
24
+ };
25
+ return /* @__PURE__ */ React.createElement(ConfigContext.Provider, { value: { ...defaultContext, ...context } }, children);
26
+ };
27
+ const MockCurrencyProvider = (props) => {
28
+ const { children, ...context } = props;
29
+ const defaultContext = {
30
+ currency: {
31
+ kind: null,
32
+ label: "Engineers \u{1F6E0}",
33
+ unit: "engineer"
34
+ },
35
+ setCurrency: jest.fn()
36
+ };
37
+ return /* @__PURE__ */ React.createElement(CurrencyContext.Provider, { value: { ...defaultContext, ...context } }, children);
38
+ };
39
+
40
+ export { MockConfigProvider, MockCurrencyProvider };
41
+ //# sourceMappingURL=providers.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"providers.esm.js","sources":["../../src/testUtils/providers.tsx"],"sourcesContent":["/*\n * Copyright 2020 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport React, { PropsWithChildren } from 'react';\nimport {\n LoadingContext,\n LoadingContextProps,\n GroupsContext,\n GroupsContextProps,\n FilterContext,\n FilterContextProps,\n ConfigContext,\n ConfigContextProps,\n CurrencyContext,\n CurrencyContextProps,\n BillingDateContext,\n BillingDateContextProps,\n ScrollContext,\n ScrollContextProps,\n} from '../hooks';\nimport { Duration, EngineerThreshold } from '../types';\nimport { createCurrencyFormat } from '../utils/currency';\n\nexport type MockFilterProviderProps = PropsWithChildren<\n Partial<FilterContextProps>\n>;\n\nexport const MockFilterProvider = ({\n children,\n ...context\n}: MockFilterProviderProps) => {\n const defaultContext: FilterContextProps = {\n pageFilters: {\n group: 'tech',\n project: null,\n duration: Duration.P90D,\n metric: null,\n },\n productFilters: [],\n setPageFilters: jest.fn(),\n setProductFilters: jest.fn(),\n };\n return (\n <FilterContext.Provider value={{ ...defaultContext, ...context }}>\n {children}\n </FilterContext.Provider>\n );\n};\n\nexport type MockLoadingProviderProps = PropsWithChildren<\n Partial<LoadingContextProps>\n>;\n\nexport const MockLoadingProvider = ({\n children,\n ...context\n}: MockLoadingProviderProps) => {\n const defaultContext: LoadingContextProps = {\n state: {},\n actions: [],\n dispatch: jest.fn(),\n };\n return (\n <LoadingContext.Provider value={{ ...defaultContext, ...context }}>\n {children}\n </LoadingContext.Provider>\n );\n};\n\n/** @public */\nexport type MockConfigProviderProps = PropsWithChildren<\n Partial<ConfigContextProps>\n>;\n\n/** @public */\nexport const MockConfigProvider = (props: MockConfigProviderProps) => {\n const { children, ...context } = props;\n\n const defaultContext: ConfigContextProps = {\n baseCurrency: createCurrencyFormat(),\n metrics: [],\n products: [],\n icons: [],\n engineerCost: 0,\n engineerThreshold: EngineerThreshold,\n hideTrendLine: false,\n currencies: [],\n };\n\n return (\n <ConfigContext.Provider value={{ ...defaultContext, ...context }}>\n {children}\n </ConfigContext.Provider>\n );\n};\n\n/** @public */\nexport type MockCurrencyProviderProps = PropsWithChildren<\n Partial<CurrencyContextProps>\n>;\n\n/** @public */\nexport const MockCurrencyProvider = (props: MockCurrencyProviderProps) => {\n const { children, ...context } = props;\n\n const defaultContext: CurrencyContextProps = {\n currency: {\n kind: null,\n label: 'Engineers 🛠',\n unit: 'engineer',\n },\n setCurrency: jest.fn(),\n };\n\n return (\n <CurrencyContext.Provider value={{ ...defaultContext, ...context }}>\n {children}\n </CurrencyContext.Provider>\n );\n};\n\nexport type MockBillingDateProviderProps = PropsWithChildren<\n Partial<BillingDateContextProps>\n>;\n\nexport const MockBillingDateProvider = ({\n children,\n ...context\n}: MockBillingDateProviderProps) => {\n const defaultContext: BillingDateContextProps = {\n lastCompleteBillingDate: '2020-10-01',\n };\n return (\n <BillingDateContext.Provider value={{ ...defaultContext, ...context }}>\n {children}\n </BillingDateContext.Provider>\n );\n};\n\nexport type MockScrollProviderProps = PropsWithChildren<{}>;\n\nexport const MockScrollProvider = ({ children }: MockScrollProviderProps) => {\n const defaultContext: ScrollContextProps = {\n scroll: null,\n setScroll: jest.fn(),\n };\n return (\n <ScrollContext.Provider value={defaultContext}>\n {children}\n </ScrollContext.Provider>\n );\n};\n\nexport type MockGroupsProviderProps = PropsWithChildren<\n Partial<GroupsContextProps>\n>;\n\nexport const MockGroupsProvider = ({\n children,\n ...context\n}: MockGroupsProviderProps) => {\n const defaultContext: GroupsContextProps = {\n groups: [],\n };\n return (\n <GroupsContext.Provider value={{ ...defaultContext, ...context }}>\n {children}\n </GroupsContext.Provider>\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;AAwFa,MAAA,kBAAA,GAAqB,CAAC,KAAmC,KAAA;AACpE,EAAA,MAAM,EAAE,QAAA,EAAU,GAAG,OAAA,EAAY,GAAA,KAAA,CAAA;AAEjC,EAAA,MAAM,cAAqC,GAAA;AAAA,IACzC,cAAc,oBAAqB,EAAA;AAAA,IACnC,SAAS,EAAC;AAAA,IACV,UAAU,EAAC;AAAA,IACX,OAAO,EAAC;AAAA,IACR,YAAc,EAAA,CAAA;AAAA,IACd,iBAAmB,EAAA,iBAAA;AAAA,IACnB,aAAe,EAAA,KAAA;AAAA,IACf,YAAY,EAAC;AAAA,GACf,CAAA;AAEA,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,aAAc,CAAA,QAAA,EAAd,EAAuB,KAAA,EAAO,EAAE,GAAG,cAAgB,EAAA,GAAG,OAAQ,EAAA,EAAA,EAC5D,QACH,CAAA,CAAA;AAEJ,EAAA;AAQa,MAAA,oBAAA,GAAuB,CAAC,KAAqC,KAAA;AACxE,EAAA,MAAM,EAAE,QAAA,EAAU,GAAG,OAAA,EAAY,GAAA,KAAA,CAAA;AAEjC,EAAA,MAAM,cAAuC,GAAA;AAAA,IAC3C,QAAU,EAAA;AAAA,MACR,IAAM,EAAA,IAAA;AAAA,MACN,KAAO,EAAA,qBAAA;AAAA,MACP,IAAM,EAAA,UAAA;AAAA,KACR;AAAA,IACA,WAAA,EAAa,KAAK,EAAG,EAAA;AAAA,GACvB,CAAA;AAEA,EACE,uBAAA,KAAA,CAAA,aAAA,CAAC,eAAgB,CAAA,QAAA,EAAhB,EAAyB,KAAA,EAAO,EAAE,GAAG,cAAgB,EAAA,GAAG,OAAQ,EAAA,EAAA,EAC9D,QACH,CAAA,CAAA;AAEJ;;;;"}