@perses-dev/core 0.0.0-snapshot-panel-extra-content-2-2767e21 → 0.0.0-snapshot-scatter-chart-embed-8efdfab

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 (166) hide show
  1. package/dist/cjs/constants/dashboard-defaults.js +6 -2
  2. package/dist/cjs/constants/dialog.js +3 -1
  3. package/dist/cjs/constants/index.js +11 -9
  4. package/dist/cjs/index.js +12 -10
  5. package/dist/cjs/model/calculations.js +61 -51
  6. package/dist/cjs/model/http-proxy.js +16 -0
  7. package/dist/cjs/model/index.js +34 -26
  8. package/dist/cjs/model/kind.js +38 -0
  9. package/dist/cjs/model/legend.js +39 -19
  10. package/dist/cjs/model/resource.js +9 -0
  11. package/dist/cjs/model/rolebindings.js +16 -0
  12. package/dist/cjs/model/roles.js +59 -0
  13. package/dist/cjs/model/secrets.js +16 -0
  14. package/dist/cjs/model/time-series-queries.js +3 -1
  15. package/dist/cjs/model/time.js +147 -64
  16. package/dist/cjs/model/trace-data.js +16 -0
  17. package/dist/cjs/model/units/bytes.js +37 -25
  18. package/dist/cjs/model/units/constants.js +3 -1
  19. package/dist/cjs/model/units/decimal.js +22 -16
  20. package/dist/cjs/model/units/index.js +13 -11
  21. package/dist/cjs/model/units/percent.js +26 -19
  22. package/dist/cjs/model/units/throughput.js +113 -0
  23. package/dist/cjs/model/units/time.js +99 -38
  24. package/dist/cjs/model/units/types.js +5 -2
  25. package/dist/cjs/model/units/units.js +81 -45
  26. package/dist/cjs/model/units/utils.js +13 -7
  27. package/dist/cjs/model/variables.js +16 -3
  28. package/dist/cjs/utils/event.js +3 -1
  29. package/dist/cjs/utils/fetch.js +32 -7
  30. package/dist/cjs/utils/index.js +17 -14
  31. package/dist/cjs/utils/is-empty-object.js +3 -1
  32. package/dist/cjs/utils/mathjs.js +3 -1
  33. package/dist/cjs/utils/memo.js +10 -6
  34. package/dist/cjs/utils/panel-refs.js +9 -3
  35. package/dist/cjs/utils/text.js +39 -14
  36. package/dist/cjs/utils/time-series-data.js +21 -11
  37. package/dist/cjs/utils/types.js +16 -0
  38. package/dist/constants/dashboard-defaults.js.map +1 -1
  39. package/dist/constants/dialog.js.map +1 -1
  40. package/dist/constants/index.js.map +1 -1
  41. package/dist/index.js.map +1 -1
  42. package/dist/model/calculations.d.ts +9 -9
  43. package/dist/model/calculations.d.ts.map +1 -1
  44. package/dist/model/calculations.js +46 -46
  45. package/dist/model/calculations.js.map +1 -1
  46. package/dist/model/datasource.d.ts +11 -4
  47. package/dist/model/datasource.d.ts.map +1 -1
  48. package/dist/model/datasource.js.map +1 -1
  49. package/dist/model/display.d.ts +1 -1
  50. package/dist/model/display.d.ts.map +1 -1
  51. package/dist/model/display.js.map +1 -1
  52. package/dist/model/http-proxy.d.ts +16 -0
  53. package/dist/model/http-proxy.d.ts.map +1 -0
  54. package/dist/model/http-proxy.js +15 -0
  55. package/dist/model/http-proxy.js.map +1 -0
  56. package/dist/model/index.d.ts +6 -0
  57. package/dist/model/index.d.ts.map +1 -1
  58. package/dist/model/index.js +6 -0
  59. package/dist/model/index.js.map +1 -1
  60. package/dist/model/kind.d.ts +3 -0
  61. package/dist/model/kind.d.ts.map +1 -0
  62. package/dist/model/kind.js +30 -0
  63. package/dist/model/kind.js.map +1 -0
  64. package/dist/model/legend.d.ts +6 -6
  65. package/dist/model/legend.js +9 -9
  66. package/dist/model/legend.js.map +1 -1
  67. package/dist/model/panels.d.ts +5 -2
  68. package/dist/model/panels.d.ts.map +1 -1
  69. package/dist/model/panels.js.map +1 -1
  70. package/dist/model/query.d.ts +15 -2
  71. package/dist/model/query.d.ts.map +1 -1
  72. package/dist/model/query.js.map +1 -1
  73. package/dist/model/resource.d.ts +3 -2
  74. package/dist/model/resource.d.ts.map +1 -1
  75. package/dist/model/resource.js +3 -1
  76. package/dist/model/resource.js.map +1 -1
  77. package/dist/model/rolebindings.d.ts +27 -0
  78. package/dist/model/rolebindings.d.ts.map +1 -0
  79. package/dist/model/rolebindings.js +15 -0
  80. package/dist/model/rolebindings.js.map +1 -0
  81. package/dist/model/roles.d.ts +32 -0
  82. package/dist/model/roles.d.ts.map +1 -0
  83. package/dist/model/roles.js +40 -0
  84. package/dist/model/roles.js.map +1 -0
  85. package/dist/model/secrets.d.ts +44 -0
  86. package/dist/model/secrets.d.ts.map +1 -0
  87. package/dist/model/secrets.js +15 -0
  88. package/dist/model/secrets.js.map +1 -0
  89. package/dist/model/thresholds.d.ts +2 -2
  90. package/dist/model/thresholds.d.ts.map +1 -1
  91. package/dist/model/thresholds.js.map +1 -1
  92. package/dist/model/time-series-queries.js.map +1 -1
  93. package/dist/model/time.d.ts +3 -0
  94. package/dist/model/time.d.ts.map +1 -1
  95. package/dist/model/time.js +115 -55
  96. package/dist/model/time.js.map +1 -1
  97. package/dist/model/trace-data.d.ts +20 -0
  98. package/dist/model/trace-data.d.ts.map +1 -0
  99. package/dist/model/trace-data.js +15 -0
  100. package/dist/model/trace-data.js.map +1 -0
  101. package/dist/model/units/bytes.d.ts +8 -8
  102. package/dist/model/units/bytes.d.ts.map +1 -1
  103. package/dist/model/units/bytes.js +27 -21
  104. package/dist/model/units/bytes.js.map +1 -1
  105. package/dist/model/units/constants.js.map +1 -1
  106. package/dist/model/units/decimal.d.ts +8 -8
  107. package/dist/model/units/decimal.d.ts.map +1 -1
  108. package/dist/model/units/decimal.js +14 -14
  109. package/dist/model/units/decimal.js.map +1 -1
  110. package/dist/model/units/index.js.map +1 -1
  111. package/dist/model/units/percent.d.ts +7 -7
  112. package/dist/model/units/percent.d.ts.map +1 -1
  113. package/dist/model/units/percent.js +17 -16
  114. package/dist/model/units/percent.js.map +1 -1
  115. package/dist/model/units/throughput.d.ts +13 -0
  116. package/dist/model/units/throughput.d.ts.map +1 -0
  117. package/dist/model/units/throughput.js +94 -0
  118. package/dist/model/units/throughput.js.map +1 -0
  119. package/dist/model/units/time.d.ts +15 -15
  120. package/dist/model/units/time.d.ts.map +1 -1
  121. package/dist/model/units/time.js +87 -34
  122. package/dist/model/units/time.js.map +1 -1
  123. package/dist/model/units/types.d.ts +15 -6
  124. package/dist/model/units/types.d.ts.map +1 -1
  125. package/dist/model/units/types.js +2 -1
  126. package/dist/model/units/types.js.map +1 -1
  127. package/dist/model/units/units.d.ts +49 -30
  128. package/dist/model/units/units.d.ts.map +1 -1
  129. package/dist/model/units/units.js +52 -37
  130. package/dist/model/units/units.js.map +1 -1
  131. package/dist/model/units/utils.d.ts +2 -2
  132. package/dist/model/units/utils.d.ts.map +1 -1
  133. package/dist/model/units/utils.js +4 -4
  134. package/dist/model/units/utils.js.map +1 -1
  135. package/dist/model/variables.d.ts +26 -7
  136. package/dist/model/variables.d.ts.map +1 -1
  137. package/dist/model/variables.js +3 -0
  138. package/dist/model/variables.js.map +1 -1
  139. package/dist/test/setup-tests.js.map +1 -1
  140. package/dist/utils/event.js.map +1 -1
  141. package/dist/utils/fetch.d.ts +3 -1
  142. package/dist/utils/fetch.d.ts.map +1 -1
  143. package/dist/utils/fetch.js +21 -4
  144. package/dist/utils/fetch.js.map +1 -1
  145. package/dist/utils/index.d.ts +2 -1
  146. package/dist/utils/index.d.ts.map +1 -1
  147. package/dist/utils/index.js +2 -1
  148. package/dist/utils/index.js.map +1 -1
  149. package/dist/utils/is-empty-object.js.map +1 -1
  150. package/dist/utils/mathjs.js.map +1 -1
  151. package/dist/utils/memo.js +2 -2
  152. package/dist/utils/memo.js.map +1 -1
  153. package/dist/utils/panel-refs.js.map +1 -1
  154. package/dist/utils/text.d.ts +15 -3
  155. package/dist/utils/text.d.ts.map +1 -1
  156. package/dist/utils/text.js +29 -10
  157. package/dist/utils/text.js.map +1 -1
  158. package/dist/utils/time-series-data.d.ts +1 -1
  159. package/dist/utils/time-series-data.d.ts.map +1 -1
  160. package/dist/utils/time-series-data.js +7 -7
  161. package/dist/utils/time-series-data.js.map +1 -1
  162. package/dist/utils/types.d.ts +2 -0
  163. package/dist/utils/types.d.ts.map +1 -0
  164. package/dist/utils/types.js +15 -0
  165. package/dist/utils/types.js.map +1 -0
  166. package/package.json +5 -4
@@ -4,6 +4,8 @@ export * from './datasource';
4
4
  export * from './definitions';
5
5
  export * from './display';
6
6
  export * from './http';
7
+ export * from './http-proxy';
8
+ export * from './kind';
7
9
  export * from './layout';
8
10
  export * from './legend';
9
11
  export * from './notice';
@@ -11,10 +13,14 @@ export * from './panels';
11
13
  export * from './project';
12
14
  export * from './query';
13
15
  export * from './resource';
16
+ export * from './roles';
17
+ export * from './rolebindings';
18
+ export * from './secrets';
14
19
  export * from './thresholds';
15
20
  export * from './time';
16
21
  export * from './time-series-data';
17
22
  export * from './time-series-queries';
23
+ export * from './trace-data';
18
24
  export * from './units';
19
25
  export * from './variables';
20
26
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/model/index.ts"],"names":[],"mappings":"AAaA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/model/index.ts"],"names":[],"mappings":"AAaA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC"}
@@ -16,6 +16,8 @@ export * from './datasource';
16
16
  export * from './definitions';
17
17
  export * from './display';
18
18
  export * from './http';
19
+ export * from './http-proxy';
20
+ export * from './kind';
19
21
  export * from './layout';
20
22
  export * from './legend';
21
23
  export * from './notice';
@@ -23,10 +25,14 @@ export * from './panels';
23
25
  export * from './project';
24
26
  export * from './query';
25
27
  export * from './resource';
28
+ export * from './roles';
29
+ export * from './rolebindings';
30
+ export * from './secrets';
26
31
  export * from './thresholds';
27
32
  export * from './time';
28
33
  export * from './time-series-data';
29
34
  export * from './time-series-queries';
35
+ export * from './trace-data';
30
36
  export * from './units';
31
37
  export * from './variables';
32
38
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/model/index.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\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\nexport * from './calculations';\nexport * from './dashboard';\nexport * from './datasource';\nexport * from './definitions';\nexport * from './display';\nexport * from './http';\nexport * from './layout';\nexport * from './legend';\nexport * from './notice';\nexport * from './panels';\nexport * from './project';\nexport * from './query';\nexport * from './resource';\nexport * from './thresholds';\nexport * from './time';\nexport * from './time-series-data';\nexport * from './time-series-queries';\nexport * from './units';\nexport * from './variables';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC"}
1
+ {"version":3,"sources":["../../src/model/index.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\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\nexport * from './calculations';\nexport * from './dashboard';\nexport * from './datasource';\nexport * from './definitions';\nexport * from './display';\nexport * from './http';\nexport * from './http-proxy';\nexport * from './kind';\nexport * from './layout';\nexport * from './legend';\nexport * from './notice';\nexport * from './panels';\nexport * from './project';\nexport * from './query';\nexport * from './resource';\nexport * from './roles';\nexport * from './rolebindings';\nexport * from './secrets';\nexport * from './thresholds';\nexport * from './time';\nexport * from './time-series-data';\nexport * from './time-series-queries';\nexport * from './trace-data';\nexport * from './units';\nexport * from './variables';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,iBAAiB;AAC/B,cAAc,cAAc;AAC5B,cAAc,eAAe;AAC7B,cAAc,gBAAgB;AAC9B,cAAc,YAAY;AAC1B,cAAc,SAAS;AACvB,cAAc,eAAe;AAC7B,cAAc,SAAS;AACvB,cAAc,WAAW;AACzB,cAAc,WAAW;AACzB,cAAc,WAAW;AACzB,cAAc,WAAW;AACzB,cAAc,YAAY;AAC1B,cAAc,UAAU;AACxB,cAAc,aAAa;AAC3B,cAAc,UAAU;AACxB,cAAc,iBAAiB;AAC/B,cAAc,YAAY;AAC1B,cAAc,eAAe;AAC7B,cAAc,SAAS;AACvB,cAAc,qBAAqB;AACnC,cAAc,wBAAwB;AACtC,cAAc,eAAe;AAC7B,cAAc,UAAU;AACxB,cAAc,cAAc"}
@@ -0,0 +1,3 @@
1
+ export declare type Kind = 'Dashboard' | 'Datasource' | 'Folder' | 'GlobalDatasource' | 'GlobalRole' | 'GlobalRoleBinding' | 'GlobalSecret' | 'GlobalVariable' | 'Project' | 'Role' | 'RoleBinding' | 'Secret' | 'User' | 'Variable';
2
+ export declare const KINDS: Kind[];
3
+ //# sourceMappingURL=kind.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kind.d.ts","sourceRoot":"","sources":["../../src/model/kind.ts"],"names":[],"mappings":"AAaA,oBAAY,IAAI,GACZ,WAAW,GACX,YAAY,GACZ,QAAQ,GACR,kBAAkB,GAClB,YAAY,GACZ,mBAAmB,GACnB,cAAc,GACd,gBAAgB,GAChB,SAAS,GACT,MAAM,GACN,aAAa,GACb,QAAQ,GACR,MAAM,GACN,UAAU,CAAC;AAEf,eAAO,MAAM,KAAK,EAAE,IAAI,EAevB,CAAC"}
@@ -0,0 +1,30 @@
1
+ // Copyright 2023 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ export const KINDS = [
14
+ 'Dashboard',
15
+ 'Datasource',
16
+ 'Folder',
17
+ 'GlobalDatasource',
18
+ 'GlobalRole',
19
+ 'GlobalRoleBinding',
20
+ 'GlobalSecret',
21
+ 'GlobalVariable',
22
+ 'Project',
23
+ 'Role',
24
+ 'RoleBinding',
25
+ 'Secret',
26
+ 'User',
27
+ 'Variable'
28
+ ];
29
+
30
+ //# sourceMappingURL=kind.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/model/kind.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\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\nexport type Kind =\n | 'Dashboard'\n | 'Datasource'\n | 'Folder'\n | 'GlobalDatasource'\n | 'GlobalRole'\n | 'GlobalRoleBinding'\n | 'GlobalSecret'\n | 'GlobalVariable'\n | 'Project'\n | 'Role'\n | 'RoleBinding'\n | 'Secret'\n | 'User'\n | 'Variable';\n\nexport const KINDS: Kind[] = [\n 'Dashboard',\n 'Datasource',\n 'Folder',\n 'GlobalDatasource',\n 'GlobalRole',\n 'GlobalRoleBinding',\n 'GlobalSecret',\n 'GlobalVariable',\n 'Project',\n 'Role',\n 'RoleBinding',\n 'Secret',\n 'User',\n 'Variable',\n];\n"],"names":["KINDS"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAkBjC,OAAO,MAAMA,QAAgB;IAC3B;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD,CAAC"}
@@ -1,8 +1,8 @@
1
- export declare const legendPositions: readonly ["Bottom", "Right"];
1
+ export declare const legendPositions: readonly ["bottom", "right"];
2
2
  export declare type LegendPositions = (typeof legendPositions)[number];
3
- export declare const legendModes: readonly ["List", "Table"];
3
+ export declare const legendModes: readonly ["list", "table"];
4
4
  export declare type LegendMode = (typeof legendModes)[number];
5
- export declare const legendSizes: readonly ["Small", "Medium"];
5
+ export declare const legendSizes: readonly ["small", "medium"];
6
6
  export declare type LegendSize = (typeof legendSizes)[number];
7
7
  export interface LegendOptionsBase {
8
8
  position: LegendPositions;
@@ -13,7 +13,7 @@ export declare function isValidLegendPosition(position: LegendPositions): boolea
13
13
  export declare function isValidLegendMode(mode: LegendMode): boolean;
14
14
  export declare function isValidLegendSize(size: LegendSize): boolean;
15
15
  export declare const DEFAULT_LEGEND: Required<LegendOptionsBase>;
16
- export declare function getLegendPosition(position?: LegendPositions): "Bottom" | "Right";
17
- export declare function getLegendMode(mode?: LegendMode): "List" | "Table";
18
- export declare function getLegendSize(size?: LegendSize): "Small" | "Medium";
16
+ export declare function getLegendPosition(position?: LegendPositions): "bottom" | "right";
17
+ export declare function getLegendMode(mode?: LegendMode): "list" | "table";
18
+ export declare function getLegendSize(size?: LegendSize): "small" | "medium";
19
19
  //# sourceMappingURL=legend.d.ts.map
@@ -15,16 +15,16 @@
15
15
  // component and the `plugin-system` package for legend model code specific to
16
16
  // panel plugin specs.
17
17
  export const legendPositions = [
18
- 'Bottom',
19
- 'Right'
18
+ 'bottom',
19
+ 'right'
20
20
  ];
21
21
  export const legendModes = [
22
- 'List',
23
- 'Table'
22
+ 'list',
23
+ 'table'
24
24
  ];
25
25
  export const legendSizes = [
26
- 'Small',
27
- 'Medium'
26
+ 'small',
27
+ 'medium'
28
28
  ];
29
29
  export function isValidLegendPosition(position) {
30
30
  return legendPositions.includes(position);
@@ -36,9 +36,9 @@ export function isValidLegendSize(size) {
36
36
  return legendSizes.includes(size);
37
37
  }
38
38
  export const DEFAULT_LEGEND = {
39
- position: 'Bottom',
40
- mode: 'List',
41
- size: 'Medium'
39
+ position: 'bottom',
40
+ mode: 'list',
41
+ size: 'medium'
42
42
  };
43
43
  export function getLegendPosition(position) {
44
44
  if (position === undefined) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/model/legend.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\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// This file contains common/shared legend model code.\n// See the `components` package for legend model code specific to the Legend\n// component and the `plugin-system` package for legend model code specific to\n// panel plugin specs.\n\nexport const legendPositions = ['Bottom', 'Right'] as const;\nexport type LegendPositions = (typeof legendPositions)[number];\n\nexport const legendModes = ['List', 'Table'] as const;\nexport type LegendMode = (typeof legendModes)[number];\n\nexport const legendSizes = ['Small', 'Medium'] as const;\nexport type LegendSize = (typeof legendSizes)[number];\n\n// Common legend options used across some UI components and panel specifications\nexport interface LegendOptionsBase {\n position: LegendPositions;\n mode?: LegendMode;\n size?: LegendSize;\n}\n\nexport function isValidLegendPosition(position: LegendPositions) {\n return (legendPositions as readonly string[]).includes(position);\n}\n\nexport function isValidLegendMode(mode: LegendMode) {\n return (legendModes as readonly string[]).includes(mode);\n}\n\nexport function isValidLegendSize(size: LegendSize) {\n return (legendSizes as readonly string[]).includes(size);\n}\n\nexport const DEFAULT_LEGEND: Required<LegendOptionsBase> = {\n position: 'Bottom',\n mode: 'List',\n size: 'Medium',\n};\n\nexport function getLegendPosition(position?: LegendPositions) {\n if (position === undefined) {\n return DEFAULT_LEGEND.position;\n }\n if (isValidLegendPosition(position)) {\n return position;\n }\n return DEFAULT_LEGEND.position;\n}\n\nexport function getLegendMode(mode?: LegendMode) {\n if (!mode || !isValidLegendMode(mode)) {\n return DEFAULT_LEGEND.mode;\n }\n\n return mode;\n}\n\nexport function getLegendSize(size?: LegendSize) {\n if (!size || !isValidLegendSize(size)) {\n return DEFAULT_LEGEND.size;\n }\n\n return size;\n}\n"],"names":["legendPositions","legendModes","legendSizes","isValidLegendPosition","position","includes","isValidLegendMode","mode","isValidLegendSize","size","DEFAULT_LEGEND","getLegendPosition","undefined","getLegendMode","getLegendSize"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,sDAAsD;AACtD,4EAA4E;AAC5E,+EAA+E;AAC/E,sBAAsB;AAEtB,OAAO,MAAMA,eAAe,GAAG;IAAC,QAAQ;IAAE,OAAO;CAAC,AAAS,CAAC;AAG5D,OAAO,MAAMC,WAAW,GAAG;IAAC,MAAM;IAAE,OAAO;CAAC,AAAS,CAAC;AAGtD,OAAO,MAAMC,WAAW,GAAG;IAAC,OAAO;IAAE,QAAQ;CAAC,AAAS,CAAC;AAUxD,OAAO,SAASC,qBAAqB,CAACC,QAAyB,EAAE;IAC/D,OAAO,AAACJ,eAAe,CAAuBK,QAAQ,CAACD,QAAQ,CAAC,CAAC;AACnE,CAAC;AAED,OAAO,SAASE,iBAAiB,CAACC,IAAgB,EAAE;IAClD,OAAO,AAACN,WAAW,CAAuBI,QAAQ,CAACE,IAAI,CAAC,CAAC;AAC3D,CAAC;AAED,OAAO,SAASC,iBAAiB,CAACC,IAAgB,EAAE;IAClD,OAAO,AAACP,WAAW,CAAuBG,QAAQ,CAACI,IAAI,CAAC,CAAC;AAC3D,CAAC;AAED,OAAO,MAAMC,cAAc,GAAgC;IACzDN,QAAQ,EAAE,QAAQ;IAClBG,IAAI,EAAE,MAAM;IACZE,IAAI,EAAE,QAAQ;CACf,CAAC;AAEF,OAAO,SAASE,iBAAiB,CAACP,QAA0B,EAAE;IAC5D,IAAIA,QAAQ,KAAKQ,SAAS,EAAE;QAC1B,OAAOF,cAAc,CAACN,QAAQ,CAAC;IACjC,CAAC;IACD,IAAID,qBAAqB,CAACC,QAAQ,CAAC,EAAE;QACnC,OAAOA,QAAQ,CAAC;IAClB,CAAC;IACD,OAAOM,cAAc,CAACN,QAAQ,CAAC;AACjC,CAAC;AAED,OAAO,SAASS,aAAa,CAACN,IAAiB,EAAE;IAC/C,IAAI,CAACA,IAAI,IAAI,CAACD,iBAAiB,CAACC,IAAI,CAAC,EAAE;QACrC,OAAOG,cAAc,CAACH,IAAI,CAAC;IAC7B,CAAC;IAED,OAAOA,IAAI,CAAC;AACd,CAAC;AAED,OAAO,SAASO,aAAa,CAACL,IAAiB,EAAE;IAC/C,IAAI,CAACA,IAAI,IAAI,CAACD,iBAAiB,CAACC,IAAI,CAAC,EAAE;QACrC,OAAOC,cAAc,CAACD,IAAI,CAAC;IAC7B,CAAC;IAED,OAAOA,IAAI,CAAC;AACd,CAAC"}
1
+ {"version":3,"sources":["../../src/model/legend.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\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// This file contains common/shared legend model code.\n// See the `components` package for legend model code specific to the Legend\n// component and the `plugin-system` package for legend model code specific to\n// panel plugin specs.\n\nexport const legendPositions = ['bottom', 'right'] as const;\nexport type LegendPositions = (typeof legendPositions)[number];\n\nexport const legendModes = ['list', 'table'] as const;\nexport type LegendMode = (typeof legendModes)[number];\n\nexport const legendSizes = ['small', 'medium'] as const;\nexport type LegendSize = (typeof legendSizes)[number];\n\n// Common legend options used across some UI components and panel specifications\nexport interface LegendOptionsBase {\n position: LegendPositions;\n mode?: LegendMode;\n size?: LegendSize;\n}\n\nexport function isValidLegendPosition(position: LegendPositions) {\n return (legendPositions as readonly string[]).includes(position);\n}\n\nexport function isValidLegendMode(mode: LegendMode) {\n return (legendModes as readonly string[]).includes(mode);\n}\n\nexport function isValidLegendSize(size: LegendSize) {\n return (legendSizes as readonly string[]).includes(size);\n}\n\nexport const DEFAULT_LEGEND: Required<LegendOptionsBase> = {\n position: 'bottom',\n mode: 'list',\n size: 'medium',\n};\n\nexport function getLegendPosition(position?: LegendPositions) {\n if (position === undefined) {\n return DEFAULT_LEGEND.position;\n }\n if (isValidLegendPosition(position)) {\n return position;\n }\n return DEFAULT_LEGEND.position;\n}\n\nexport function getLegendMode(mode?: LegendMode) {\n if (!mode || !isValidLegendMode(mode)) {\n return DEFAULT_LEGEND.mode;\n }\n\n return mode;\n}\n\nexport function getLegendSize(size?: LegendSize) {\n if (!size || !isValidLegendSize(size)) {\n return DEFAULT_LEGEND.size;\n }\n\n return size;\n}\n"],"names":["legendPositions","legendModes","legendSizes","isValidLegendPosition","position","includes","isValidLegendMode","mode","isValidLegendSize","size","DEFAULT_LEGEND","getLegendPosition","undefined","getLegendMode","getLegendSize"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,sDAAsD;AACtD,4EAA4E;AAC5E,+EAA+E;AAC/E,sBAAsB;AAEtB,OAAO,MAAMA,kBAAkB;IAAC;IAAU;CAAQ,CAAU;AAG5D,OAAO,MAAMC,cAAc;IAAC;IAAQ;CAAQ,CAAU;AAGtD,OAAO,MAAMC,cAAc;IAAC;IAAS;CAAS,CAAU;AAUxD,OAAO,SAASC,sBAAsBC,QAAyB;IAC7D,OAAO,AAACJ,gBAAsCK,SAASD;AACzD;AAEA,OAAO,SAASE,kBAAkBC,IAAgB;IAChD,OAAO,AAACN,YAAkCI,SAASE;AACrD;AAEA,OAAO,SAASC,kBAAkBC,IAAgB;IAChD,OAAO,AAACP,YAAkCG,SAASI;AACrD;AAEA,OAAO,MAAMC,iBAA8C;IACzDN,UAAU;IACVG,MAAM;IACNE,MAAM;AACR,EAAE;AAEF,OAAO,SAASE,kBAAkBP,QAA0B;IAC1D,IAAIA,aAAaQ,WAAW;QAC1B,OAAOF,eAAeN;IACxB;IACA,IAAID,sBAAsBC,WAAW;QACnC,OAAOA;IACT;IACA,OAAOM,eAAeN;AACxB;AAEA,OAAO,SAASS,cAAcN,IAAiB;IAC7C,IAAI,CAACA,QAAQ,CAACD,kBAAkBC,OAAO;QACrC,OAAOG,eAAeH;IACxB;IAEA,OAAOA;AACT;AAEA,OAAO,SAASO,cAAcL,IAAiB;IAC7C,IAAI,CAACA,QAAQ,CAACD,kBAAkBC,OAAO;QACrC,OAAOC,eAAeD;IACxB;IAEA,OAAOA;AACT"}
@@ -1,11 +1,14 @@
1
1
  import { Definition, UnknownSpec } from './definitions';
2
- import { Display } from './display';
3
2
  import { QueryDefinition } from './query';
3
+ export interface PanelDisplay {
4
+ name: string;
5
+ description?: string;
6
+ }
4
7
  export interface PanelDefinition<PluginSpec = UnknownSpec> extends Definition<PanelSpec<PluginSpec>> {
5
8
  kind: 'Panel';
6
9
  }
7
10
  export interface PanelSpec<PluginSpec> {
8
- display: Display;
11
+ display: PanelDisplay;
9
12
  plugin: Definition<PluginSpec>;
10
13
  queries?: QueryDefinition[];
11
14
  }
@@ -1 +1 @@
1
- {"version":3,"file":"panels.d.ts","sourceRoot":"","sources":["../../src/model/panels.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC1C,MAAM,WAAW,eAAe,CAAC,UAAU,GAAG,WAAW,CAAE,SAAQ,UAAU,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IAClG,IAAI,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,SAAS,CAAC,UAAU;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;IAC/B,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,iBAAiB,MAAM,EAAE,CAAC;CACjC"}
1
+ {"version":3,"file":"panels.d.ts","sourceRoot":"","sources":["../../src/model/panels.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,eAAe,CAAC,UAAU,GAAG,WAAW,CAAE,SAAQ,UAAU,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IAClG,IAAI,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,SAAS,CAAC,UAAU;IACnC,OAAO,EAAE,YAAY,CAAC;IACtB,MAAM,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;IAC/B,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,iBAAiB,MAAM,EAAE,CAAC;CACjC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/model/panels.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\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\nimport { Definition, UnknownSpec } from './definitions';\nimport { Display } from './display';\nimport { QueryDefinition } from './query';\nexport interface PanelDefinition<PluginSpec = UnknownSpec> extends Definition<PanelSpec<PluginSpec>> {\n kind: 'Panel';\n}\n\nexport interface PanelSpec<PluginSpec> {\n display: Display;\n plugin: Definition<PluginSpec>;\n queries?: QueryDefinition[];\n}\n\n/**\n * A reference to a panel defined in the DashboardSpec.\n */\nexport interface PanelRef {\n $ref: `#/spec/panels/${string}`;\n}\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,WAkBC"}
1
+ {"version":3,"sources":["../../src/model/panels.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\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\nimport { Definition, UnknownSpec } from './definitions';\nimport { QueryDefinition } from './query';\n\nexport interface PanelDisplay {\n name: string;\n description?: string;\n}\n\nexport interface PanelDefinition<PluginSpec = UnknownSpec> extends Definition<PanelSpec<PluginSpec>> {\n kind: 'Panel';\n}\n\nexport interface PanelSpec<PluginSpec> {\n display: PanelDisplay;\n plugin: Definition<PluginSpec>;\n queries?: QueryDefinition[];\n}\n\n/**\n * A reference to a panel defined in the DashboardSpec.\n */\nexport interface PanelRef {\n $ref: `#/spec/panels/${string}`;\n}\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,WAuBC"}
@@ -1,14 +1,27 @@
1
1
  import { Definition, UnknownSpec } from './definitions';
2
+ import { TimeSeriesData } from './time-series-data';
3
+ import { TraceData } from './trace-data';
2
4
  interface QuerySpec<PluginSpec> {
3
5
  plugin: Definition<PluginSpec>;
4
6
  }
5
7
  /**
6
8
  * A generic query definition interface that can be extended to support more than just TimeSeriesQuery
7
9
  */
8
- export interface QueryDefinition<Kind = QueryType, PluginSpec = UnknownSpec> {
10
+ export interface QueryDefinition<Kind = any, PluginSpec = UnknownSpec> {
9
11
  kind: Kind;
10
12
  spec: QuerySpec<PluginSpec>;
11
13
  }
12
- export declare type QueryType = 'TimeSeriesQuery';
14
+ /**
15
+ * Mapping the query plugin to the data type it returns
16
+ */
17
+ export interface QueryType {
18
+ TimeSeriesQuery: TimeSeriesData;
19
+ TraceQuery: TraceData;
20
+ }
21
+ /**
22
+ * Values of QueryType
23
+ * ex: 'TimeSeriesData'
24
+ */
25
+ export declare type QueryDataType = QueryType[keyof QueryType];
13
26
  export {};
14
27
  //# sourceMappingURL=query.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../src/model/query.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAExD,UAAU,SAAS,CAAC,UAAU;IAC5B,MAAM,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;CAChC;AACD;;GAEG;AACH,MAAM,WAAW,eAAe,CAAC,IAAI,GAAG,SAAS,EAAE,UAAU,GAAG,WAAW;IACzE,IAAI,EAAE,IAAI,CAAC;IACX,IAAI,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;CAC7B;AAED,oBAAY,SAAS,GAAG,iBAAiB,CAAC"}
1
+ {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../src/model/query.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,UAAU,SAAS,CAAC,UAAU;IAC5B,MAAM,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;CAChC;AACD;;GAEG;AAGH,MAAM,WAAW,eAAe,CAAC,IAAI,GAAG,GAAG,EAAE,UAAU,GAAG,WAAW;IACnE,IAAI,EAAE,IAAI,CAAC;IACX,IAAI,EAAE,SAAS,CAAC,UAAU,CAAC,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,eAAe,EAAE,cAAc,CAAC;IAChC,UAAU,EAAE,SAAS,CAAC;CAGvB;AAED;;;GAGG;AACH,oBAAY,aAAa,GAAG,SAAS,CAAC,MAAM,SAAS,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/model/query.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\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\nimport { Definition, UnknownSpec } from './definitions';\n\ninterface QuerySpec<PluginSpec> {\n plugin: Definition<PluginSpec>;\n}\n/**\n * A generic query definition interface that can be extended to support more than just TimeSeriesQuery\n */\nexport interface QueryDefinition<Kind = QueryType, PluginSpec = UnknownSpec> {\n kind: Kind;\n spec: QuerySpec<PluginSpec>;\n}\n\nexport type QueryType = 'TimeSeriesQuery';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,WAa0C"}
1
+ {"version":3,"sources":["../../src/model/query.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\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\nimport { Definition, UnknownSpec } from './definitions';\nimport { TimeSeriesData } from './time-series-data';\nimport { TraceData } from './trace-data';\n\ninterface QuerySpec<PluginSpec> {\n plugin: Definition<PluginSpec>;\n}\n/**\n * A generic query definition interface that can be extended to support more than just TimeSeriesQuery\n */\n// Kind needs to be `any` because otherwise typescript will complain 'unknown' is not assignable to type '\"TimeSeriesQuery\"' in a few places\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface QueryDefinition<Kind = any, PluginSpec = UnknownSpec> {\n kind: Kind;\n spec: QuerySpec<PluginSpec>;\n}\n\n/**\n * Mapping the query plugin to the data type it returns\n */\nexport interface QueryType {\n TimeSeriesQuery: TimeSeriesData;\n TraceQuery: TraceData;\n // in the future we can add other query plugin and data types\n // for example: we can add something like `LogsQuery: LogsData;`\n}\n\n/**\n * Values of QueryType\n * ex: 'TimeSeriesData'\n */\nexport type QueryDataType = QueryType[keyof QueryType];\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,WA+BuD"}
@@ -1,10 +1,11 @@
1
1
  export interface Metadata {
2
2
  name: string;
3
- created_at?: string;
4
- updated_at?: string;
3
+ createdAt?: string;
4
+ updatedAt?: string;
5
5
  version?: number;
6
6
  }
7
7
  export interface ProjectMetadata extends Metadata {
8
8
  project: string;
9
9
  }
10
+ export declare function getMetadataProject(metadata: ProjectMetadata | Metadata): string | undefined;
10
11
  //# sourceMappingURL=resource.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../../src/model/resource.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,eAAgB,SAAQ,QAAQ;IAC/C,OAAO,EAAE,MAAM,CAAC;CACjB"}
1
+ {"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../../src/model/resource.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,eAAgB,SAAQ,QAAQ;IAC/C,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,eAAe,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAE3F"}
@@ -10,6 +10,8 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- export { };
13
+ export function getMetadataProject(metadata) {
14
+ return 'project' in metadata ? metadata.project : undefined;
15
+ }
14
16
 
15
17
  //# sourceMappingURL=resource.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/model/resource.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\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\nexport interface Metadata {\n name: string;\n created_at?: string;\n updated_at?: string;\n version?: number;\n}\n\nexport interface ProjectMetadata extends Metadata {\n project: string;\n}\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,WASC"}
1
+ {"version":3,"sources":["../../src/model/resource.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\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\nexport interface Metadata {\n name: string;\n createdAt?: string;\n updatedAt?: string;\n version?: number;\n}\n\nexport interface ProjectMetadata extends Metadata {\n project: string;\n}\n\nexport function getMetadataProject(metadata: ProjectMetadata | Metadata): string | undefined {\n return 'project' in metadata ? metadata.project : undefined;\n}\n"],"names":["getMetadataProject","metadata","project","undefined"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAajC,OAAO,SAASA,mBAAmBC,QAAoC;IACrE,OAAO,aAAaA,WAAWA,SAASC,UAAUC;AACpD"}
@@ -0,0 +1,27 @@
1
+ import { Metadata, ProjectMetadata } from './resource';
2
+ export interface Subject {
3
+ kind: 'User';
4
+ name: string;
5
+ }
6
+ export interface RoleBindingSpec {
7
+ role: string;
8
+ subjects: Subject[];
9
+ }
10
+ /**
11
+ * A role binding that belongs to a project.
12
+ */
13
+ export interface RoleBindingResource {
14
+ kind: 'RoleBinding';
15
+ metadata: ProjectMetadata;
16
+ spec: RoleBindingSpec;
17
+ }
18
+ /**
19
+ * A global role binding that doesn´t belong to a project.
20
+ */
21
+ export interface GlobalRoleBindingResource {
22
+ kind: 'GlobalRoleBinding';
23
+ metadata: Metadata;
24
+ spec: RoleBindingSpec;
25
+ }
26
+ export declare type RoleBinding = RoleBindingResource | GlobalRoleBindingResource;
27
+ //# sourceMappingURL=rolebindings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rolebindings.d.ts","sourceRoot":"","sources":["../../src/model/rolebindings.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEvD,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,eAAe;IAE9B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,EAAE,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,aAAa,CAAC;IACpB,QAAQ,EAAE,eAAe,CAAC;IAC1B,IAAI,EAAE,eAAe,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,mBAAmB,CAAC;IAC1B,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,eAAe,CAAC;CACvB;AAED,oBAAY,WAAW,GAAG,mBAAmB,GAAG,yBAAyB,CAAC"}
@@ -0,0 +1,15 @@
1
+ // Copyright 2023 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ export { };
14
+
15
+ //# sourceMappingURL=rolebindings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/model/rolebindings.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\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\nimport { Metadata, ProjectMetadata } from './resource';\n\nexport interface Subject {\n kind: 'User';\n name: string;\n}\n\nexport interface RoleBindingSpec {\n // name of the role or global role (metadata.name)\n role: string;\n subjects: Subject[];\n}\n\n/**\n * A role binding that belongs to a project.\n */\nexport interface RoleBindingResource {\n kind: 'RoleBinding';\n metadata: ProjectMetadata;\n spec: RoleBindingSpec;\n}\n\n/**\n * A global role binding that doesn´t belong to a project.\n */\nexport interface GlobalRoleBindingResource {\n kind: 'GlobalRoleBinding';\n metadata: Metadata;\n spec: RoleBindingSpec;\n}\n\nexport type RoleBinding = RoleBindingResource | GlobalRoleBindingResource;\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,WA+B0E"}
@@ -0,0 +1,32 @@
1
+ import { Metadata, ProjectMetadata } from './resource';
2
+ import { Kind } from './kind';
3
+ export declare type Action = 'create' | 'read' | 'update' | 'delete' | '*';
4
+ export declare const ACTIONS: string[];
5
+ export declare type Scope = Kind | '*';
6
+ export declare const PROJECT_SCOPES: string[];
7
+ export declare const GLOBAL_SCOPES: string[];
8
+ export interface Permission {
9
+ actions: Action[];
10
+ scopes: Scope[];
11
+ }
12
+ export interface RoleSpec {
13
+ permissions: Permission[];
14
+ }
15
+ /**
16
+ * A role that belongs to a project.
17
+ */
18
+ export interface RoleResource {
19
+ kind: 'Role';
20
+ metadata: ProjectMetadata;
21
+ spec: RoleSpec;
22
+ }
23
+ /**
24
+ * A global role that doesn´t belong to a project.
25
+ */
26
+ export interface GlobalRoleResource {
27
+ kind: 'GlobalRole';
28
+ metadata: Metadata;
29
+ spec: RoleSpec;
30
+ }
31
+ export declare type Role = RoleResource | GlobalRoleResource;
32
+ //# sourceMappingURL=roles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"roles.d.ts","sourceRoot":"","sources":["../../src/model/roles.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,oBAAY,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,GAAG,CAAC;AACnE,eAAO,MAAM,OAAO,UAA8C,CAAC;AACnE,oBAAY,KAAK,GAAG,IAAI,GAAG,GAAG,CAAC;AAC/B,eAAO,MAAM,cAAc,UAU1B,CAAC;AAEF,eAAO,MAAM,aAAa,UAOzB,CAAC;AAEF,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,KAAK,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,QAAQ;IACvB,WAAW,EAAE,UAAU,EAAE,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,eAAe,CAAC;IAC1B,IAAI,EAAE,QAAQ,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,YAAY,CAAC;IACnB,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,QAAQ,CAAC;CAChB;AAED,oBAAY,IAAI,GAAG,YAAY,GAAG,kBAAkB,CAAC"}
@@ -0,0 +1,40 @@
1
+ // Copyright 2023 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ export const ACTIONS = [
14
+ '*',
15
+ 'create',
16
+ 'read',
17
+ 'update',
18
+ 'delete'
19
+ ];
20
+ export const PROJECT_SCOPES = [
21
+ '*',
22
+ 'Dashboard',
23
+ 'Datasource',
24
+ 'Folder',
25
+ 'Project',
26
+ 'Role',
27
+ 'RoleBinding',
28
+ 'Secret',
29
+ 'Variable'
30
+ ];
31
+ export const GLOBAL_SCOPES = [
32
+ 'GlobalDatasource',
33
+ 'GlobalRole',
34
+ 'GlobalRoleBinding',
35
+ 'GlobalSecret',
36
+ 'GlobalVariable',
37
+ 'User'
38
+ ];
39
+
40
+ //# sourceMappingURL=roles.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/model/roles.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\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\nimport { Metadata, ProjectMetadata } from './resource';\nimport { Kind } from './kind';\n\nexport type Action = 'create' | 'read' | 'update' | 'delete' | '*';\nexport const ACTIONS = ['*', 'create', 'read', 'update', 'delete'];\nexport type Scope = Kind | '*';\nexport const PROJECT_SCOPES = [\n '*',\n 'Dashboard',\n 'Datasource',\n 'Folder',\n 'Project',\n 'Role',\n 'RoleBinding',\n 'Secret',\n 'Variable',\n];\n\nexport const GLOBAL_SCOPES = [\n 'GlobalDatasource',\n 'GlobalRole',\n 'GlobalRoleBinding',\n 'GlobalSecret',\n 'GlobalVariable',\n 'User',\n];\n\nexport interface Permission {\n actions: Action[];\n scopes: Scope[];\n}\n\nexport interface RoleSpec {\n permissions: Permission[];\n}\n\n/**\n * A role that belongs to a project.\n */\nexport interface RoleResource {\n kind: 'Role';\n metadata: ProjectMetadata;\n spec: RoleSpec;\n}\n\n/**\n * A global role that doesn´t belong to a project.\n */\nexport interface GlobalRoleResource {\n kind: 'GlobalRole';\n metadata: Metadata;\n spec: RoleSpec;\n}\n\nexport type Role = RoleResource | GlobalRoleResource;\n"],"names":["ACTIONS","PROJECT_SCOPES","GLOBAL_SCOPES"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAMjC,OAAO,MAAMA,UAAU;IAAC;IAAK;IAAU;IAAQ;IAAU;CAAS,CAAC;AAEnE,OAAO,MAAMC,iBAAiB;IAC5B;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;CACD,CAAC;AAEF,OAAO,MAAMC,gBAAgB;IAC3B;IACA;IACA;IACA;IACA;IACA;CACD,CAAC"}
@@ -0,0 +1,44 @@
1
+ import { Metadata, ProjectMetadata } from './resource';
2
+ export interface BasicAuth {
3
+ username: string;
4
+ password?: string;
5
+ passwordFile?: string;
6
+ }
7
+ export interface Authorization {
8
+ type?: string;
9
+ credentials?: string;
10
+ credentialsFile?: string;
11
+ }
12
+ export interface TLSConfig {
13
+ ca?: string;
14
+ cert?: string;
15
+ key?: string;
16
+ caFile?: string;
17
+ certFile?: string;
18
+ keyFile?: string;
19
+ serverName?: string;
20
+ insecureSkipVerify: boolean;
21
+ }
22
+ export interface SecretSpec {
23
+ basicAuth?: BasicAuth;
24
+ authorization?: Authorization;
25
+ tlsConfig?: TLSConfig;
26
+ }
27
+ /**
28
+ * A secret that belongs to a project.
29
+ */
30
+ export interface SecretResource {
31
+ kind: 'Secret';
32
+ metadata: ProjectMetadata;
33
+ spec: SecretSpec;
34
+ }
35
+ /**
36
+ * A global secret that doesn´t belong to a project.
37
+ */
38
+ export interface GlobalSecretResource {
39
+ kind: 'GlobalSecret';
40
+ metadata: Metadata;
41
+ spec: SecretSpec;
42
+ }
43
+ export declare type Secret = SecretResource | GlobalSecretResource;
44
+ //# sourceMappingURL=secrets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"secrets.d.ts","sourceRoot":"","sources":["../../src/model/secrets.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEvD,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,SAAS;IACxB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB,EAAE,OAAO,CAAC;CAC7B;AAED,MAAM,WAAW,UAAU;IACzB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,QAAQ,CAAC;IACf,QAAQ,EAAE,eAAe,CAAC;IAC1B,IAAI,EAAE,UAAU,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,cAAc,CAAC;IACrB,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,UAAU,CAAC;CAClB;AAED,oBAAY,MAAM,GAAG,cAAc,GAAG,oBAAoB,CAAC"}
@@ -0,0 +1,15 @@
1
+ // Copyright 2023 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ export { };
14
+
15
+ //# sourceMappingURL=secrets.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/model/secrets.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\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\nimport { Metadata, ProjectMetadata } from './resource';\n\nexport interface BasicAuth {\n username: string;\n password?: string;\n passwordFile?: string;\n}\n\nexport interface Authorization {\n type?: string;\n credentials?: string;\n credentialsFile?: string;\n}\n\nexport interface TLSConfig {\n ca?: string;\n cert?: string;\n key?: string;\n caFile?: string;\n certFile?: string;\n keyFile?: string;\n serverName?: string;\n insecureSkipVerify: boolean;\n}\n\nexport interface SecretSpec {\n basicAuth?: BasicAuth;\n authorization?: Authorization;\n tlsConfig?: TLSConfig;\n}\n\n/**\n * A secret that belongs to a project.\n */\nexport interface SecretResource {\n kind: 'Secret';\n metadata: ProjectMetadata;\n spec: SecretSpec;\n}\n\n/**\n * A global secret that doesn´t belong to a project.\n */\nexport interface GlobalSecretResource {\n kind: 'GlobalSecret';\n metadata: Metadata;\n spec: SecretSpec;\n}\n\nexport type Secret = SecretResource | GlobalSecretResource;\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,WAiD2D"}
@@ -4,8 +4,8 @@ export interface StepOptions {
4
4
  name?: string;
5
5
  }
6
6
  export interface ThresholdOptions {
7
- mode?: 'Percent' | 'Absolute';
8
- default_color?: string;
7
+ mode?: 'percent' | 'absolute';
8
+ defaultColor?: string;
9
9
  max?: number;
10
10
  steps?: StepOptions[];
11
11
  }
@@ -1 +1 @@
1
- {"version":3,"file":"thresholds.d.ts","sourceRoot":"","sources":["../../src/model/thresholds.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;IAC9B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,WAAW,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,qBAAqB;IACpC,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB"}
1
+ {"version":3,"file":"thresholds.d.ts","sourceRoot":"","sources":["../../src/model/thresholds.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,WAAW,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,qBAAqB;IACpC,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/model/thresholds.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\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\nexport interface StepOptions {\n value: number;\n color?: string;\n name?: string;\n}\n\nexport interface ThresholdOptions {\n mode?: 'Percent' | 'Absolute';\n default_color?: string;\n max?: number; // is this same as the max in GaugeChartOptions? can we remove?\n steps?: StepOptions[];\n}\n\nexport interface ThresholdColorPalette {\n defaultColor: string;\n palette: string[];\n}\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,WAgBC"}
1
+ {"version":3,"sources":["../../src/model/thresholds.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\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\nexport interface StepOptions {\n value: number;\n color?: string;\n name?: string;\n}\n\nexport interface ThresholdOptions {\n mode?: 'percent' | 'absolute';\n defaultColor?: string;\n max?: number; // is this same as the max in GaugeChartOptions? can we remove?\n steps?: StepOptions[];\n}\n\nexport interface ThresholdColorPalette {\n defaultColor: string;\n palette: string[];\n}\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,WAgBC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/model/time-series-queries.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\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\nimport { UnknownSpec } from './definitions';\nimport { QueryDefinition } from './query';\nimport { UnixTimeMs } from './time';\n\nexport type TimeSeriesQueryDefinition<PluginSpec = UnknownSpec> = QueryDefinition<'TimeSeriesQuery', PluginSpec>;\n\nexport type TimeSeriesValueTuple = [timestamp: UnixTimeMs, value: number | null];\n\nexport function isTimeSeriesValueTuple(data: TimeSeriesValueTuple): data is TimeSeriesValueTuple {\n if (data.length !== 2) return false;\n return true;\n}\n\nexport type Labels = Record<string, string>;\n"],"names":["isTimeSeriesValueTuple","data","length"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAUjC,OAAO,SAASA,sBAAsB,CAACC,IAA0B,EAAgC;IAC/F,IAAIA,IAAI,CAACC,MAAM,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;IACpC,OAAO,IAAI,CAAC;AACd,CAAC"}
1
+ {"version":3,"sources":["../../src/model/time-series-queries.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\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\nimport { UnknownSpec } from './definitions';\nimport { QueryDefinition } from './query';\nimport { UnixTimeMs } from './time';\n\nexport type TimeSeriesQueryDefinition<PluginSpec = UnknownSpec> = QueryDefinition<'TimeSeriesQuery', PluginSpec>;\n\nexport type TimeSeriesValueTuple = [timestamp: UnixTimeMs, value: number | null];\n\nexport function isTimeSeriesValueTuple(data: TimeSeriesValueTuple): data is TimeSeriesValueTuple {\n if (data.length !== 2) return false;\n return true;\n}\n\nexport type Labels = Record<string, string>;\n"],"names":["isTimeSeriesValueTuple","data","length"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAUjC,OAAO,SAASA,uBAAuBC,IAA0B;IAC/D,IAAIA,KAAKC,WAAW,GAAG,OAAO;IAC9B,OAAO;AACT"}
@@ -39,6 +39,9 @@ export declare function parseDurationString(durationString: string): Duration;
39
39
  * Returns true if the given string is a valid DurationString.
40
40
  */
41
41
  export declare function isDurationString(maybeDuration: string): maybeDuration is DurationString;
42
+ export declare function intervalToPrometheusDuration(timeRange: AbsoluteTimeRange): Duration;
43
+ export declare function msToPrometheusDuration(durationInMs: number): Duration;
44
+ export declare function formatDuration(duration: Duration): DurationString;
42
45
  /**
43
46
  * Round interval to clearer increments
44
47
  */
@@ -1 +1 @@
1
- {"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../src/model/time.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,QAAQ,EAAO,MAAM,UAAU,CAAC;AAEzC,oBAAY,UAAU,GAAG,MAAM,CAAC;AAEhC,oBAAY,cAAc,GAAG,MAAM,GAAG,MAAM,CAAC;AAE7C,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,IAAI,CAAC;IACZ,GAAG,EAAE,IAAI,CAAC;CACX;AAED,MAAM,WAAW,iBAAiB;IAEhC,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,YAAY,EAAE,cAAc,CAAC;CAC9B;AAED,oBAAY,cAAc,GAAG,iBAAiB,GAAG,iBAAiB,CAAC;AAEnE;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,cAAc,GAAG,SAAS,IAAI,iBAAiB,CAE7F;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,cAAc,GAAG,SAAS,IAAI,iBAAiB,CAE7F;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,iBAAiB,GAAG,iBAAiB,CAOnF;AAED,aAAK,0BAA0B,GAAG,GAAG,MAAM,IAAI,CAAC;AAChD,aAAK,qBAAqB,GAAG,GAAG,MAAM,GAAG,CAAC;AAC1C,aAAK,qBAAqB,GAAG,GAAG,MAAM,GAAG,CAAC;AAC1C,aAAK,mBAAmB,GAAG,GAAG,MAAM,GAAG,CAAC;AACxC,aAAK,kBAAkB,GAAG,GAAG,MAAM,GAAG,CAAC;AACvC,aAAK,mBAAmB,GAAG,GAAG,MAAM,GAAG,CAAC;AACxC,aAAK,mBAAmB,GAAG,GAAG,MAAM,GAAG,CAAC;AAExC,oBAAY,cAAc,GAAG,OAAO,CAClC,GAAG,mBAAmB,GAAG,EAAE,GAAG,mBAAmB,GAAG,EAAE,GAAG,kBAAkB,GAAG,EAAE,GAAG,mBAAmB,GAAG,EAAE,GACvG,qBAAqB,GACrB,EAAE,GAAG,qBAAqB,GAAG,EAAE,GAAG,0BAA0B,GAAG,EAAE,EAAE,EACvE,EAAE,CACH,CAAC;AAIF;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,cAAc,EAAE,MAAM,GAAG,QAAQ,CAepE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,aAAa,EAAE,MAAM,GAAG,aAAa,IAAI,cAAc,CAGvF;AAiED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,UAO/C;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,UAI7E"}
1
+ {"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../src/model/time.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,QAAQ,EAAO,MAAM,UAAU,CAAC;AASzC,oBAAY,UAAU,GAAG,MAAM,CAAC;AAEhC,oBAAY,cAAc,GAAG,MAAM,GAAG,MAAM,CAAC;AAE7C,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,IAAI,CAAC;IACZ,GAAG,EAAE,IAAI,CAAC;CACX;AAED,MAAM,WAAW,iBAAiB;IAEhC,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,YAAY,EAAE,cAAc,CAAC;CAC9B;AAED,oBAAY,cAAc,GAAG,iBAAiB,GAAG,iBAAiB,CAAC;AAEnE;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,cAAc,GAAG,SAAS,IAAI,iBAAiB,CAE7F;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,cAAc,GAAG,SAAS,IAAI,iBAAiB,CAE7F;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,iBAAiB,GAAG,iBAAiB,CAOnF;AAED,aAAK,0BAA0B,GAAG,GAAG,MAAM,IAAI,CAAC;AAChD,aAAK,qBAAqB,GAAG,GAAG,MAAM,GAAG,CAAC;AAC1C,aAAK,qBAAqB,GAAG,GAAG,MAAM,GAAG,CAAC;AAC1C,aAAK,mBAAmB,GAAG,GAAG,MAAM,GAAG,CAAC;AACxC,aAAK,kBAAkB,GAAG,GAAG,MAAM,GAAG,CAAC;AACvC,aAAK,mBAAmB,GAAG,GAAG,MAAM,GAAG,CAAC;AACxC,aAAK,mBAAmB,GAAG,GAAG,MAAM,GAAG,CAAC;AAExC,oBAAY,cAAc,GAAG,OAAO,CAClC,GAAG,mBAAmB,GAAG,EAAE,GAAG,mBAAmB,GAAG,EAAE,GAAG,kBAAkB,GAAG,EAAE,GAAG,mBAAmB,GAAG,EAAE,GACvG,qBAAqB,GACrB,EAAE,GAAG,qBAAqB,GAAG,EAAE,GAAG,0BAA0B,GAAG,EAAE,EAAE,EACvE,EAAE,CACH,CAAC;AAIF;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,cAAc,EAAE,MAAM,GAAG,QAAQ,CAepE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,aAAa,EAAE,MAAM,GAAG,aAAa,IAAI,cAAc,CAGvF;AAED,wBAAgB,4BAA4B,CAAC,SAAS,EAAE,iBAAiB,GAAG,QAAQ,CAGnF;AAED,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,MAAM,GAAG,QAAQ,CAqBrE;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,QAAQ,GAAG,cAAc,CA4BjE;AAiED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,UAO/C;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,UAI7E"}