@perses-dev/core 0.53.0 → 0.54.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/dist/cjs/constants/dashboard-defaults.js +3 -3
  2. package/dist/cjs/model/calculations.js +6 -6
  3. package/dist/cjs/model/definitions.js +1 -3
  4. package/dist/cjs/model/folder.js +16 -0
  5. package/dist/cjs/model/index.js +1 -0
  6. package/dist/cjs/model/legend.js +11 -11
  7. package/dist/cjs/model/otlp/index.js +4 -4
  8. package/dist/cjs/model/otlp/trace/v1/trace.js +4 -4
  9. package/dist/cjs/model/resource.js +3 -3
  10. package/dist/cjs/model/roles.js +4 -4
  11. package/dist/cjs/model/time.js +21 -309
  12. package/dist/cjs/model/units/bits.js +14 -6
  13. package/dist/cjs/model/units/bytes.js +16 -6
  14. package/dist/cjs/model/units/currency.js +14 -6
  15. package/dist/cjs/model/units/date.js +4 -4
  16. package/dist/cjs/model/units/decimal.js +13 -6
  17. package/dist/cjs/model/units/formatterCache.js +120 -0
  18. package/dist/cjs/model/units/percent.js +13 -6
  19. package/dist/cjs/model/units/temperature.js +13 -5
  20. package/dist/cjs/model/units/throughput.js +15 -6
  21. package/dist/cjs/model/units/time.js +15 -7
  22. package/dist/cjs/model/units/units.js +18 -18
  23. package/dist/cjs/model/units/utils.js +4 -4
  24. package/dist/cjs/model/variables.js +3 -3
  25. package/dist/cjs/schema/datasource.js +13 -29
  26. package/dist/cjs/schema/display.js +2 -6
  27. package/dist/cjs/schema/duration.js +2 -4
  28. package/dist/cjs/schema/metadata.js +4 -4
  29. package/dist/cjs/schema/panel.js +20 -72
  30. package/dist/cjs/schema/plugin.js +2 -6
  31. package/dist/cjs/schema/role.js +6 -6
  32. package/dist/cjs/schema/rolebinding.js +6 -6
  33. package/dist/cjs/schema/secret.js +5 -5
  34. package/dist/cjs/schema/user.js +5 -5
  35. package/dist/cjs/schema/variable.js +24 -137
  36. package/dist/cjs/utils/fetch.js +5 -5
  37. package/dist/cjs/utils/panel-refs.js +4 -4
  38. package/dist/cjs/utils/regexp.js +3 -3
  39. package/dist/cjs/utils/text.js +7 -7
  40. package/dist/cjs/utils/time-series-data.js +4 -4
  41. package/dist/cjs/utils/transform-data.js +6 -6
  42. package/dist/model/dashboard.d.ts +2 -21
  43. package/dist/model/dashboard.d.ts.map +1 -1
  44. package/dist/model/dashboard.js.map +1 -1
  45. package/dist/model/datasource.d.ts +3 -22
  46. package/dist/model/datasource.d.ts.map +1 -1
  47. package/dist/model/datasource.js +1 -3
  48. package/dist/model/datasource.js.map +1 -1
  49. package/dist/model/definitions.d.ts +1 -12
  50. package/dist/model/definitions.d.ts.map +1 -1
  51. package/dist/model/definitions.js +1 -6
  52. package/dist/model/definitions.js.map +1 -1
  53. package/dist/model/display.d.ts +1 -4
  54. package/dist/model/display.d.ts.map +1 -1
  55. package/dist/model/display.js.map +1 -1
  56. package/dist/model/folder.d.ts +19 -0
  57. package/dist/model/folder.d.ts.map +1 -0
  58. package/dist/model/folder.js +15 -0
  59. package/dist/model/folder.js.map +1 -0
  60. package/dist/model/index.d.ts +1 -0
  61. package/dist/model/index.d.ts.map +1 -1
  62. package/dist/model/index.js +1 -0
  63. package/dist/model/index.js.map +1 -1
  64. package/dist/model/project.d.ts +1 -1
  65. package/dist/model/project.d.ts.map +1 -1
  66. package/dist/model/project.js.map +1 -1
  67. package/dist/model/query.d.ts +1 -0
  68. package/dist/model/query.d.ts.map +1 -1
  69. package/dist/model/query.js.map +1 -1
  70. package/dist/model/resource.d.ts +1 -1
  71. package/dist/model/resource.d.ts.map +1 -1
  72. package/dist/model/resource.js.map +1 -1
  73. package/dist/model/time.d.ts +3 -54
  74. package/dist/model/time.d.ts.map +1 -1
  75. package/dist/model/time.js +2 -299
  76. package/dist/model/time.js.map +1 -1
  77. package/dist/model/units/bits.d.ts.map +1 -1
  78. package/dist/model/units/bits.js +10 -2
  79. package/dist/model/units/bits.js.map +1 -1
  80. package/dist/model/units/bytes.d.ts.map +1 -1
  81. package/dist/model/units/bytes.js +12 -2
  82. package/dist/model/units/bytes.js.map +1 -1
  83. package/dist/model/units/currency.d.ts.map +1 -1
  84. package/dist/model/units/currency.js +10 -2
  85. package/dist/model/units/currency.js.map +1 -1
  86. package/dist/model/units/decimal.d.ts.map +1 -1
  87. package/dist/model/units/decimal.js +9 -2
  88. package/dist/model/units/decimal.js.map +1 -1
  89. package/dist/model/units/formatterCache.d.ts +11 -0
  90. package/dist/model/units/formatterCache.d.ts.map +1 -0
  91. package/dist/model/units/formatterCache.js +104 -0
  92. package/dist/model/units/formatterCache.js.map +1 -0
  93. package/dist/model/units/percent.d.ts.map +1 -1
  94. package/dist/model/units/percent.js +9 -2
  95. package/dist/model/units/percent.js.map +1 -1
  96. package/dist/model/units/temperature.d.ts.map +1 -1
  97. package/dist/model/units/temperature.js +9 -1
  98. package/dist/model/units/temperature.js.map +1 -1
  99. package/dist/model/units/throughput.d.ts.map +1 -1
  100. package/dist/model/units/throughput.js +11 -2
  101. package/dist/model/units/throughput.js.map +1 -1
  102. package/dist/model/units/time.d.ts.map +1 -1
  103. package/dist/model/units/time.js +10 -2
  104. package/dist/model/units/time.js.map +1 -1
  105. package/dist/schema/datasource.d.ts +10 -9
  106. package/dist/schema/datasource.d.ts.map +1 -1
  107. package/dist/schema/datasource.js +2 -14
  108. package/dist/schema/datasource.js.map +1 -1
  109. package/dist/schema/display.d.ts +1 -11
  110. package/dist/schema/display.d.ts.map +1 -1
  111. package/dist/schema/display.js +1 -5
  112. package/dist/schema/display.js.map +1 -1
  113. package/dist/schema/duration.d.ts +1 -2
  114. package/dist/schema/duration.d.ts.map +1 -1
  115. package/dist/schema/duration.js +1 -3
  116. package/dist/schema/duration.js.map +1 -1
  117. package/dist/schema/panel.d.ts +1 -12
  118. package/dist/schema/panel.d.ts.map +1 -1
  119. package/dist/schema/panel.js +1 -53
  120. package/dist/schema/panel.js.map +1 -1
  121. package/dist/schema/plugin.d.ts +2 -13
  122. package/dist/schema/plugin.d.ts.map +1 -1
  123. package/dist/schema/plugin.js +1 -5
  124. package/dist/schema/plugin.js.map +1 -1
  125. package/dist/schema/role.d.ts +4 -4
  126. package/dist/schema/rolebinding.d.ts +4 -4
  127. package/dist/schema/secret.d.ts +70 -70
  128. package/dist/schema/variable.d.ts +1 -91
  129. package/dist/schema/variable.d.ts.map +1 -1
  130. package/dist/schema/variable.js +1 -105
  131. package/dist/schema/variable.js.map +1 -1
  132. package/dist/utils/fetch.js.map +1 -1
  133. package/dist/utils/text.js +4 -4
  134. package/dist/utils/text.js.map +1 -1
  135. package/package.json +3 -2
@@ -17,88 +17,36 @@ Object.defineProperty(exports, "__esModule", {
17
17
  function _export(target, all) {
18
18
  for(var name in all)Object.defineProperty(target, name, {
19
19
  enumerable: true,
20
- get: all[name]
20
+ get: Object.getOwnPropertyDescriptor(all, name).get
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- buildPanelDefinitionSchema: function() {
25
- return buildPanelDefinitionSchema;
24
+ get buildPanelDefinitionSchema () {
25
+ return _spec.buildPanelDefinitionSchema;
26
26
  },
27
- buildPanelEditorSchema: function() {
28
- return buildPanelEditorSchema;
27
+ get buildPanelEditorSchema () {
28
+ return _spec.buildPanelEditorSchema;
29
29
  },
30
- buildPanelSpecSchema: function() {
31
- return buildPanelSpecSchema;
30
+ get buildPanelSpecSchema () {
31
+ return _spec.buildPanelSpecSchema;
32
32
  },
33
- linkSchema: function() {
34
- return linkSchema;
33
+ get linkSchema () {
34
+ return _spec.linkSchema;
35
35
  },
36
- panelDefinitionSchema: function() {
37
- return panelDefinitionSchema;
36
+ get panelDefinitionSchema () {
37
+ return _spec.panelDefinitionSchema;
38
38
  },
39
- panelDisplaySpec: function() {
40
- return panelDisplaySpec;
39
+ get panelDisplaySpec () {
40
+ return _spec.panelDisplaySpec;
41
41
  },
42
- panelEditorSchema: function() {
43
- return panelEditorSchema;
42
+ get panelEditorSchema () {
43
+ return _spec.panelEditorSchema;
44
44
  },
45
- panelSpecSchema: function() {
46
- return panelSpecSchema;
45
+ get panelSpecSchema () {
46
+ return _spec.panelSpecSchema;
47
47
  },
48
- querySpecSchema: function() {
49
- return querySpecSchema;
48
+ get querySpecSchema () {
49
+ return _spec.querySpecSchema;
50
50
  }
51
51
  });
52
- const _zod = require("zod");
53
- const _plugin = require("./plugin");
54
- const panelDisplaySpec = _zod.z.object({
55
- name: _zod.z.string().optional(),
56
- description: _zod.z.string().optional()
57
- });
58
- const querySpecSchema = _zod.z.object({
59
- kind: _zod.z.string().min(1),
60
- spec: _zod.z.object({
61
- plugin: _plugin.pluginSchema
62
- })
63
- });
64
- const linkSchema = _zod.z.object({
65
- name: _zod.z.string().optional(),
66
- url: _zod.z.string().min(1),
67
- tooltip: _zod.z.string().optional(),
68
- renderVariables: _zod.z.boolean().optional(),
69
- targetBlank: _zod.z.boolean().optional()
70
- });
71
- const panelSpecSchema = _zod.z.object({
72
- display: panelDisplaySpec.optional(),
73
- plugin: _plugin.pluginSchema,
74
- queries: _zod.z.array(querySpecSchema).optional(),
75
- links: _zod.z.array(linkSchema).optional()
76
- });
77
- function buildPanelSpecSchema(pluginSchema) {
78
- return _zod.z.object({
79
- display: panelDisplaySpec.optional(),
80
- plugin: pluginSchema,
81
- queries: _zod.z.array(querySpecSchema).optional(),
82
- links: _zod.z.array(linkSchema).optional()
83
- });
84
- }
85
- const panelDefinitionSchema = _zod.z.object({
86
- kind: _zod.z.literal('Panel'),
87
- spec: panelSpecSchema
88
- });
89
- function buildPanelDefinitionSchema(pluginSchema) {
90
- return _zod.z.object({
91
- kind: _zod.z.literal('Panel'),
92
- spec: buildPanelSpecSchema(pluginSchema)
93
- });
94
- }
95
- const panelEditorSchema = _zod.z.object({
96
- groupId: _zod.z.number(),
97
- panelDefinition: panelDefinitionSchema
98
- });
99
- function buildPanelEditorSchema(pluginSchema) {
100
- return _zod.z.object({
101
- groupId: _zod.z.number(),
102
- panelDefinition: buildPanelDefinitionSchema(pluginSchema)
103
- });
104
- }
52
+ const _spec = require("@perses-dev/spec");
@@ -17,11 +17,7 @@ Object.defineProperty(exports, "__esModule", {
17
17
  Object.defineProperty(exports, "pluginSchema", {
18
18
  enumerable: true,
19
19
  get: function() {
20
- return pluginSchema;
20
+ return _spec.pluginSchema;
21
21
  }
22
22
  });
23
- const _zod = require("zod");
24
- const pluginSchema = _zod.z.object({
25
- kind: _zod.z.string().min(1, 'Required'),
26
- spec: _zod.z.record(_zod.z.string(), _zod.z.any())
27
- });
23
+ const _spec = require("@perses-dev/spec");
@@ -17,23 +17,23 @@ Object.defineProperty(exports, "__esModule", {
17
17
  function _export(target, all) {
18
18
  for(var name in all)Object.defineProperty(target, name, {
19
19
  enumerable: true,
20
- get: all[name]
20
+ get: Object.getOwnPropertyDescriptor(all, name).get
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- globalRoleSchema: function() {
24
+ get globalRoleSchema () {
25
25
  return globalRoleSchema;
26
26
  },
27
- permissionSchema: function() {
27
+ get permissionSchema () {
28
28
  return permissionSchema;
29
29
  },
30
- roleSchema: function() {
30
+ get roleSchema () {
31
31
  return roleSchema;
32
32
  },
33
- roleSpecSchema: function() {
33
+ get roleSpecSchema () {
34
34
  return roleSpecSchema;
35
35
  },
36
- rolesEditorSchema: function() {
36
+ get rolesEditorSchema () {
37
37
  return rolesEditorSchema;
38
38
  }
39
39
  });
@@ -17,23 +17,23 @@ Object.defineProperty(exports, "__esModule", {
17
17
  function _export(target, all) {
18
18
  for(var name in all)Object.defineProperty(target, name, {
19
19
  enumerable: true,
20
- get: all[name]
20
+ get: Object.getOwnPropertyDescriptor(all, name).get
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- globalRoleBindingSchema: function() {
24
+ get globalRoleBindingSchema () {
25
25
  return globalRoleBindingSchema;
26
26
  },
27
- roleBindingSchema: function() {
27
+ get roleBindingSchema () {
28
28
  return roleBindingSchema;
29
29
  },
30
- roleBindingSpecSchema: function() {
30
+ get roleBindingSpecSchema () {
31
31
  return roleBindingSpecSchema;
32
32
  },
33
- roleBindingsEditorSchema: function() {
33
+ get roleBindingsEditorSchema () {
34
34
  return roleBindingsEditorSchema;
35
35
  },
36
- subjectSchema: function() {
36
+ get subjectSchema () {
37
37
  return subjectSchema;
38
38
  }
39
39
  });
@@ -17,20 +17,20 @@ Object.defineProperty(exports, "__esModule", {
17
17
  function _export(target, all) {
18
18
  for(var name in all)Object.defineProperty(target, name, {
19
19
  enumerable: true,
20
- get: all[name]
20
+ get: Object.getOwnPropertyDescriptor(all, name).get
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- globalSecretSchema: function() {
24
+ get globalSecretSchema () {
25
25
  return globalSecretSchema;
26
26
  },
27
- secretSchema: function() {
27
+ get secretSchema () {
28
28
  return secretSchema;
29
29
  },
30
- secretSpecSchema: function() {
30
+ get secretSpecSchema () {
31
31
  return secretSpecSchema;
32
32
  },
33
- secretsEditorSchema: function() {
33
+ get secretsEditorSchema () {
34
34
  return secretsEditorSchema;
35
35
  }
36
36
  });
@@ -17,20 +17,20 @@ Object.defineProperty(exports, "__esModule", {
17
17
  function _export(target, all) {
18
18
  for(var name in all)Object.defineProperty(target, name, {
19
19
  enumerable: true,
20
- get: all[name]
20
+ get: Object.getOwnPropertyDescriptor(all, name).get
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- nativeProviderSchema: function() {
24
+ get nativeProviderSchema () {
25
25
  return nativeProviderSchema;
26
26
  },
27
- oauthProvidersSchema: function() {
27
+ get oauthProvidersSchema () {
28
28
  return oauthProvidersSchema;
29
29
  },
30
- userSchema: function() {
30
+ get userSchema () {
31
31
  return userSchema;
32
32
  },
33
- userSpecSchema: function() {
33
+ get userSpecSchema () {
34
34
  return userSpecSchema;
35
35
  }
36
36
  });
@@ -17,155 +17,42 @@ Object.defineProperty(exports, "__esModule", {
17
17
  function _export(target, all) {
18
18
  for(var name in all)Object.defineProperty(target, name, {
19
19
  enumerable: true,
20
- get: all[name]
20
+ get: Object.getOwnPropertyDescriptor(all, name).get
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- buildVariableDefinitionSchema: function() {
25
- return buildVariableDefinitionSchema;
24
+ get buildVariableDefinitionSchema () {
25
+ return _spec.buildVariableDefinitionSchema;
26
26
  },
27
- buildVariableListSchema: function() {
28
- return buildVariableListSchema;
27
+ get buildVariableListSchema () {
28
+ return _spec.buildVariableListSchema;
29
29
  },
30
- buildVariableListSpecSchema: function() {
31
- return buildVariableListSpecSchema;
30
+ get buildVariableListSpecSchema () {
31
+ return _spec.buildVariableListSpecSchema;
32
32
  },
33
- buildVariableSpecSchema: function() {
34
- return buildVariableSpecSchema;
33
+ get buildVariableSpecSchema () {
34
+ return _spec.buildVariableSpecSchema;
35
35
  },
36
- globalVariableSchema: function() {
37
- return globalVariableSchema;
36
+ get variableDefinitionSchema () {
37
+ return _spec.variableDefinitionSchema;
38
38
  },
39
- variableDefinitionSchema: function() {
40
- return variableDefinitionSchema;
39
+ get variableDisplaySchema () {
40
+ return _spec.variableDisplaySchema;
41
41
  },
42
- variableDisplaySchema: function() {
43
- return variableDisplaySchema;
42
+ get variableListSchema () {
43
+ return _spec.variableListSchema;
44
44
  },
45
- variableListSchema: function() {
46
- return variableListSchema;
45
+ get variableListSpecSchema () {
46
+ return _spec.variableListSpecSchema;
47
47
  },
48
- variableListSpecSchema: function() {
49
- return variableListSpecSchema;
48
+ get variableSpecSchema () {
49
+ return _spec.variableSpecSchema;
50
50
  },
51
- variableSchema: function() {
52
- return variableSchema;
51
+ get variableTextSchema () {
52
+ return _spec.variableTextSchema;
53
53
  },
54
- variableSpecSchema: function() {
55
- return variableSpecSchema;
56
- },
57
- variableTextSchema: function() {
58
- return variableTextSchema;
59
- },
60
- variableTextSpecSchema: function() {
61
- return variableTextSpecSchema;
62
- },
63
- variablesSchema: function() {
64
- return variablesSchema;
54
+ get variableTextSpecSchema () {
55
+ return _spec.variableTextSpecSchema;
65
56
  }
66
57
  });
67
- const _zod = require("zod");
68
- const _metadata = require("./metadata");
69
- const _plugin = require("./plugin");
70
- const variableDisplaySchema = _zod.z.object({
71
- name: _zod.z.string().optional(),
72
- description: _zod.z.string().optional(),
73
- hidden: _zod.z.boolean().optional()
74
- });
75
- const variableListSpecSchema = _zod.z.object({
76
- name: _zod.z.string().min(1),
77
- display: variableDisplaySchema.optional(),
78
- defaultValue: _zod.z.string().or(_zod.z.array(_zod.z.string())).optional(),
79
- allowAllValue: _zod.z.boolean(),
80
- allowMultiple: _zod.z.boolean(),
81
- customAllValue: _zod.z.string().optional(),
82
- capturingRegexp: _zod.z.string().optional(),
83
- sort: _zod.z.enum([
84
- 'none',
85
- 'alphabetical-asc',
86
- 'alphabetical-desc',
87
- 'numerical-asc',
88
- 'numerical-desc',
89
- 'alphabetical-ci-asc',
90
- 'alphabetical-ci-desc'
91
- ]).optional(),
92
- plugin: _plugin.pluginSchema
93
- });
94
- function buildVariableListSpecSchema(pluginSchema) {
95
- return _zod.z.object({
96
- name: _zod.z.string().min(1),
97
- display: variableDisplaySchema.optional(),
98
- defaultValue: _zod.z.string().or(_zod.z.array(_zod.z.string())).optional(),
99
- allowAllValue: _zod.z.boolean(),
100
- allowMultiple: _zod.z.boolean(),
101
- customAllValue: _zod.z.string().optional(),
102
- capturingRegexp: _zod.z.string().optional(),
103
- sort: _zod.z.enum([
104
- 'none',
105
- 'alphabetical-asc',
106
- 'alphabetical-desc',
107
- 'numerical-asc',
108
- 'numerical-desc',
109
- 'alphabetical-ci-asc',
110
- 'alphabetical-ci-desc'
111
- ]).optional(),
112
- plugin: pluginSchema
113
- });
114
- }
115
- const variableListSchema = _zod.z.object({
116
- kind: _zod.z.literal('ListVariable'),
117
- spec: variableListSpecSchema
118
- });
119
- function buildVariableListSchema(pluginSchema) {
120
- return _zod.z.object({
121
- kind: _zod.z.literal('ListVariable'),
122
- spec: buildVariableListSpecSchema(pluginSchema)
123
- });
124
- }
125
- const variableTextSpecSchema = _zod.z.object({
126
- name: _zod.z.string().min(1),
127
- display: variableDisplaySchema.optional(),
128
- value: _zod.z.string(),
129
- constant: _zod.z.boolean().optional()
130
- });
131
- const variableTextSchema = _zod.z.object({
132
- kind: _zod.z.literal('TextVariable'),
133
- spec: variableTextSpecSchema
134
- });
135
- const variableSpecSchema = _zod.z.discriminatedUnion('kind', [
136
- variableTextSchema,
137
- variableListSchema
138
- ]);
139
- function buildVariableSpecSchema(pluginSchema) {
140
- return _zod.z.union([
141
- variableTextSchema,
142
- buildVariableListSchema(pluginSchema)
143
- ]);
144
- }
145
- const variableSchema = _zod.z.object({
146
- kind: _zod.z.literal('Variable'),
147
- metadata: _metadata.projectMetadataSchema,
148
- spec: variableSpecSchema
149
- });
150
- const globalVariableSchema = _zod.z.object({
151
- kind: _zod.z.literal('GlobalVariable'),
152
- metadata: _metadata.projectMetadataSchema,
153
- spec: variableSpecSchema
154
- });
155
- const variablesSchema = _zod.z.discriminatedUnion('kind', [
156
- variableSchema,
157
- globalVariableSchema
158
- ]);
159
- const variableDefinitionSchema = variableSpecSchema;
160
- function buildVariableDefinitionSchema(pluginSchema) {
161
- return _zod.z.discriminatedUnion('kind', [
162
- _zod.z.object({
163
- kind: _zod.z.literal('ListVariable'),
164
- spec: buildVariableListSpecSchema(pluginSchema)
165
- }),
166
- _zod.z.object({
167
- kind: _zod.z.literal('TextVariable'),
168
- spec: variableTextSpecSchema
169
- })
170
- ]);
171
- }
58
+ const _spec = require("@perses-dev/spec");
@@ -19,20 +19,20 @@ Object.defineProperty(exports, "__esModule", {
19
19
  function _export(target, all) {
20
20
  for(var name in all)Object.defineProperty(target, name, {
21
21
  enumerable: true,
22
- get: all[name]
22
+ get: Object.getOwnPropertyDescriptor(all, name).get
23
23
  });
24
24
  }
25
25
  _export(exports, {
26
- FetchError: function() {
26
+ get FetchError () {
27
27
  return FetchError;
28
28
  },
29
- UserFriendlyError: function() {
29
+ get UserFriendlyError () {
30
30
  return UserFriendlyError;
31
31
  },
32
- fetch: function() {
32
+ get fetch () {
33
33
  return fetch;
34
34
  },
35
- fetchJson: function() {
35
+ get fetchJson () {
36
36
  return fetchJson;
37
37
  }
38
38
  });
@@ -17,17 +17,17 @@ Object.defineProperty(exports, "__esModule", {
17
17
  function _export(target, all) {
18
18
  for(var name in all)Object.defineProperty(target, name, {
19
19
  enumerable: true,
20
- get: all[name]
20
+ get: Object.getOwnPropertyDescriptor(all, name).get
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- createPanelRef: function() {
24
+ get createPanelRef () {
25
25
  return createPanelRef;
26
26
  },
27
- getPanelKeyFromRef: function() {
27
+ get getPanelKeyFromRef () {
28
28
  return getPanelKeyFromRef;
29
29
  },
30
- resolvePanelRef: function() {
30
+ get resolvePanelRef () {
31
31
  return resolvePanelRef;
32
32
  }
33
33
  });
@@ -19,14 +19,14 @@ Object.defineProperty(exports, "__esModule", {
19
19
  function _export(target, all) {
20
20
  for(var name in all)Object.defineProperty(target, name, {
21
21
  enumerable: true,
22
- get: all[name]
22
+ get: Object.getOwnPropertyDescriptor(all, name).get
23
23
  });
24
24
  }
25
25
  _export(exports, {
26
- createRegexFromString: function() {
26
+ get createRegexFromString () {
27
27
  return createRegexFromString;
28
28
  },
29
- isRegexPattern: function() {
29
+ get isRegexPattern () {
30
30
  return isRegexPattern;
31
31
  }
32
32
  });
@@ -17,35 +17,35 @@ Object.defineProperty(exports, "__esModule", {
17
17
  function _export(target, all) {
18
18
  for(var name in all)Object.defineProperty(target, name, {
19
19
  enumerable: true,
20
- get: all[name]
20
+ get: Object.getOwnPropertyDescriptor(all, name).get
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- getResourceDisplayName: function() {
24
+ get getResourceDisplayName () {
25
25
  return getResourceDisplayName;
26
26
  },
27
- getResourceExtendedDisplayName: function() {
27
+ get getResourceExtendedDisplayName () {
28
28
  return getResourceExtendedDisplayName;
29
29
  }
30
30
  });
31
31
  function getResourceDisplayName(resource) {
32
32
  // Variables
33
- if (resource.spec.spec?.display?.name) {
33
+ if (resource.spec?.spec?.display?.name) {
34
34
  return resource.spec.spec.display.name;
35
35
  }
36
36
  // Other resources with display
37
- if (resource.spec.display?.name) {
37
+ if (resource.spec?.display?.name) {
38
38
  return resource.spec.display.name;
39
39
  }
40
40
  return resource.metadata.name;
41
41
  }
42
42
  function getResourceExtendedDisplayName(resource) {
43
43
  // Variables
44
- if (resource.spec.spec?.display?.name) {
44
+ if (resource.spec?.spec?.display?.name) {
45
45
  return `${resource.spec.spec.display.name} (ID: ${resource.metadata.name})`;
46
46
  }
47
47
  // Other resources with display
48
- if (resource.spec.display?.name) {
48
+ if (resource.spec?.display?.name) {
49
49
  return `${resource.spec.display.name} (ID: ${resource.metadata.name})`;
50
50
  }
51
51
  return resource.metadata.name;
@@ -17,17 +17,17 @@ Object.defineProperty(exports, "__esModule", {
17
17
  function _export(target, all) {
18
18
  for(var name in all)Object.defineProperty(target, name, {
19
19
  enumerable: true,
20
- get: all[name]
20
+ get: Object.getOwnPropertyDescriptor(all, name).get
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- MIN_STEP_INTERVAL_MS: function() {
24
+ get MIN_STEP_INTERVAL_MS () {
25
25
  return MIN_STEP_INTERVAL_MS;
26
26
  },
27
- getCommonTimeScale: function() {
27
+ get getCommonTimeScale () {
28
28
  return getCommonTimeScale;
29
29
  },
30
- getTimeSeriesValues: function() {
30
+ get getTimeSeriesValues () {
31
31
  return getTimeSeriesValues;
32
32
  }
33
33
  });
@@ -17,23 +17,23 @@ Object.defineProperty(exports, "__esModule", {
17
17
  function _export(target, all) {
18
18
  for(var name in all)Object.defineProperty(target, name, {
19
19
  enumerable: true,
20
- get: all[name]
20
+ get: Object.getOwnPropertyDescriptor(all, name).get
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- applyJoinTransform: function() {
24
+ get applyJoinTransform () {
25
25
  return applyJoinTransform;
26
26
  },
27
- applyMergeColumnsTransform: function() {
27
+ get applyMergeColumnsTransform () {
28
28
  return applyMergeColumnsTransform;
29
29
  },
30
- applyMergeIndexedColumnsTransform: function() {
30
+ get applyMergeIndexedColumnsTransform () {
31
31
  return applyMergeIndexedColumnsTransform;
32
32
  },
33
- applyMergeSeriesTransform: function() {
33
+ get applyMergeSeriesTransform () {
34
34
  return applyMergeSeriesTransform;
35
35
  },
36
- transformData: function() {
36
+ get transformData () {
37
37
  return transformData;
38
38
  }
39
39
  });
@@ -1,28 +1,9 @@
1
- import { DatasourceSpec } from './datasource';
2
- import { LayoutDefinition } from './layout';
3
- import { Link, PanelDefinition } from './panels';
1
+ import { DashboardSpec, DashboardSelector } from '@perses-dev/spec';
4
2
  import { ProjectMetadata } from './resource';
5
- import { DurationString } from './time';
6
- import { VariableDefinition } from './variables';
7
- import { Display } from './display';
3
+ export type { DashboardSelector, DashboardSpec };
8
4
  export interface DashboardResource {
9
5
  kind: 'Dashboard';
10
6
  metadata: ProjectMetadata;
11
7
  spec: DashboardSpec;
12
8
  }
13
- export interface DashboardSpec {
14
- display?: Display;
15
- datasources?: Record<string, DatasourceSpec>;
16
- duration: DurationString;
17
- refreshInterval?: DurationString;
18
- variables: VariableDefinition[];
19
- layouts: LayoutDefinition[];
20
- panels: Record<string, PanelDefinition>;
21
- links?: Link[];
22
- }
23
- export interface DashboardSelector {
24
- project: string;
25
- dashboard: string;
26
- tags?: string[];
27
- }
28
9
  //# sourceMappingURL=dashboard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../src/model/dashboard.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,WAAW,CAAC;IAClB,QAAQ,EAAE,eAAe,CAAC;IAC1B,IAAI,EAAE,aAAa,CAAC;CACrB;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAC7C,QAAQ,EAAE,cAAc,CAAC;IACzB,eAAe,CAAC,EAAE,cAAc,CAAC;IACjC,SAAS,EAAE,kBAAkB,EAAE,CAAC;IAChC,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IACxC,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;CAChB;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB"}
1
+ {"version":3,"file":"dashboard.d.ts","sourceRoot":"","sources":["../../src/model/dashboard.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,YAAY,EAAE,iBAAiB,EAAE,aAAa,EAAE,CAAC;AAEjD,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,WAAW,CAAC;IAClB,QAAQ,EAAE,eAAe,CAAC;IAC1B,IAAI,EAAE,aAAa,CAAC;CACrB"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/model/dashboard.ts"],"sourcesContent":["// Copyright 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 { DatasourceSpec } from './datasource';\nimport { LayoutDefinition } from './layout';\nimport { Link, PanelDefinition } from './panels';\nimport { ProjectMetadata } from './resource';\nimport { DurationString } from './time';\nimport { VariableDefinition } from './variables';\nimport { Display } from './display';\n\nexport interface DashboardResource {\n kind: 'Dashboard';\n metadata: ProjectMetadata;\n spec: DashboardSpec;\n}\n\nexport interface DashboardSpec {\n display?: Display;\n datasources?: Record<string, DatasourceSpec>;\n duration: DurationString;\n refreshInterval?: DurationString;\n variables: VariableDefinition[];\n layouts: LayoutDefinition[];\n panels: Record<string, PanelDefinition>;\n links?: Link[];\n}\n\nexport interface DashboardSelector {\n project: string;\n dashboard: string;\n tags?: string[];\n}\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AA2BjC,WAIC"}
1
+ {"version":3,"sources":["../../src/model/dashboard.ts"],"sourcesContent":["// Copyright 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 { DashboardSpec, DashboardSelector } from '@perses-dev/spec';\nimport { ProjectMetadata } from './resource';\n\nexport type { DashboardSelector, DashboardSpec };\n\nexport interface DashboardResource {\n kind: 'Dashboard';\n metadata: ProjectMetadata;\n spec: DashboardSpec;\n}\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAOjC,WAIC"}