@perses-dev/core 0.41.1 → 0.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/model/http-proxy.js +16 -0
- package/dist/cjs/model/index.js +6 -0
- package/dist/cjs/model/kind.js +38 -0
- package/dist/cjs/model/rolebindings.js +16 -0
- package/dist/cjs/model/roles.js +59 -0
- package/dist/cjs/model/secrets.js +25 -0
- package/dist/cjs/model/trace-data.js +16 -0
- package/dist/cjs/model/units/throughput.js +113 -0
- package/dist/cjs/model/units/types.js +2 -1
- package/dist/cjs/model/units/units.js +14 -2
- package/dist/cjs/utils/fetch.js +20 -3
- package/dist/model/datasource.d.ts +0 -9
- package/dist/model/datasource.d.ts.map +1 -1
- package/dist/model/datasource.js.map +1 -1
- package/dist/model/http-proxy.d.ts +16 -0
- package/dist/model/http-proxy.d.ts.map +1 -0
- package/dist/model/http-proxy.js +15 -0
- package/dist/model/http-proxy.js.map +1 -0
- package/dist/model/index.d.ts +6 -0
- package/dist/model/index.d.ts.map +1 -1
- package/dist/model/index.js +6 -0
- package/dist/model/index.js.map +1 -1
- package/dist/model/kind.d.ts +3 -0
- package/dist/model/kind.d.ts.map +1 -0
- package/dist/model/kind.js +30 -0
- package/dist/model/kind.js.map +1 -0
- package/dist/model/query.d.ts +2 -0
- package/dist/model/query.d.ts.map +1 -1
- package/dist/model/query.js.map +1 -1
- package/dist/model/rolebindings.d.ts +27 -0
- package/dist/model/rolebindings.d.ts.map +1 -0
- package/dist/model/rolebindings.js +15 -0
- package/dist/model/rolebindings.js.map +1 -0
- package/dist/model/roles.d.ts +32 -0
- package/dist/model/roles.d.ts.map +1 -0
- package/dist/model/roles.js +40 -0
- package/dist/model/roles.js.map +1 -0
- package/dist/model/secrets.d.ts +45 -0
- package/dist/model/secrets.d.ts.map +1 -0
- package/dist/model/secrets.js +18 -0
- package/dist/model/secrets.js.map +1 -0
- package/dist/model/trace-data.d.ts +20 -0
- package/dist/model/trace-data.d.ts.map +1 -0
- package/dist/model/trace-data.js +15 -0
- package/dist/model/trace-data.js.map +1 -0
- package/dist/model/units/throughput.d.ts +13 -0
- package/dist/model/units/throughput.d.ts.map +1 -0
- package/dist/model/units/throughput.js +94 -0
- package/dist/model/units/throughput.js.map +1 -0
- package/dist/model/units/types.d.ts +1 -1
- package/dist/model/units/types.d.ts.map +1 -1
- package/dist/model/units/types.js +2 -1
- package/dist/model/units/types.js.map +1 -1
- package/dist/model/units/units.d.ts +13 -1
- package/dist/model/units/units.d.ts.map +1 -1
- package/dist/model/units/units.js +11 -2
- package/dist/model/units/units.js.map +1 -1
- package/dist/model/variables.d.ts +1 -0
- package/dist/model/variables.d.ts.map +1 -1
- package/dist/model/variables.js.map +1 -1
- package/dist/utils/fetch.d.ts +3 -1
- package/dist/utils/fetch.d.ts.map +1 -1
- package/dist/utils/fetch.js +21 -4
- package/dist/utils/fetch.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
package/dist/cjs/model/index.js
CHANGED
|
@@ -20,6 +20,8 @@ _export_star(require("./datasource"), exports);
|
|
|
20
20
|
_export_star(require("./definitions"), exports);
|
|
21
21
|
_export_star(require("./display"), exports);
|
|
22
22
|
_export_star(require("./http"), exports);
|
|
23
|
+
_export_star(require("./http-proxy"), exports);
|
|
24
|
+
_export_star(require("./kind"), exports);
|
|
23
25
|
_export_star(require("./layout"), exports);
|
|
24
26
|
_export_star(require("./legend"), exports);
|
|
25
27
|
_export_star(require("./notice"), exports);
|
|
@@ -27,10 +29,14 @@ _export_star(require("./panels"), exports);
|
|
|
27
29
|
_export_star(require("./project"), exports);
|
|
28
30
|
_export_star(require("./query"), exports);
|
|
29
31
|
_export_star(require("./resource"), exports);
|
|
32
|
+
_export_star(require("./roles"), exports);
|
|
33
|
+
_export_star(require("./rolebindings"), exports);
|
|
34
|
+
_export_star(require("./secrets"), exports);
|
|
30
35
|
_export_star(require("./thresholds"), exports);
|
|
31
36
|
_export_star(require("./time"), exports);
|
|
32
37
|
_export_star(require("./time-series-data"), exports);
|
|
33
38
|
_export_star(require("./time-series-queries"), exports);
|
|
39
|
+
_export_star(require("./trace-data"), exports);
|
|
34
40
|
_export_star(require("./units"), exports);
|
|
35
41
|
_export_star(require("./variables"), exports);
|
|
36
42
|
function _export_star(from, to) {
|
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "KINDS", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return KINDS;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const KINDS = [
|
|
24
|
+
'Dashboard',
|
|
25
|
+
'Datasource',
|
|
26
|
+
'Folder',
|
|
27
|
+
'GlobalDatasource',
|
|
28
|
+
'GlobalRole',
|
|
29
|
+
'GlobalRoleBinding',
|
|
30
|
+
'GlobalSecret',
|
|
31
|
+
'GlobalVariable',
|
|
32
|
+
'Project',
|
|
33
|
+
'Role',
|
|
34
|
+
'RoleBinding',
|
|
35
|
+
'Secret',
|
|
36
|
+
'User',
|
|
37
|
+
'Variable'
|
|
38
|
+
];
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
@@ -0,0 +1,59 @@
|
|
|
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
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
function _export(target, all) {
|
|
18
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: all[name]
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
ACTIONS: function() {
|
|
25
|
+
return ACTIONS;
|
|
26
|
+
},
|
|
27
|
+
PROJECT_SCOPES: function() {
|
|
28
|
+
return PROJECT_SCOPES;
|
|
29
|
+
},
|
|
30
|
+
GLOBAL_SCOPES: function() {
|
|
31
|
+
return GLOBAL_SCOPES;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
const ACTIONS = [
|
|
35
|
+
'*',
|
|
36
|
+
'create',
|
|
37
|
+
'read',
|
|
38
|
+
'update',
|
|
39
|
+
'delete'
|
|
40
|
+
];
|
|
41
|
+
const PROJECT_SCOPES = [
|
|
42
|
+
'*',
|
|
43
|
+
'Dashboard',
|
|
44
|
+
'Datasource',
|
|
45
|
+
'Folder',
|
|
46
|
+
'Project',
|
|
47
|
+
'Role',
|
|
48
|
+
'RoleBinding',
|
|
49
|
+
'Secret',
|
|
50
|
+
'Variable'
|
|
51
|
+
];
|
|
52
|
+
const GLOBAL_SCOPES = [
|
|
53
|
+
'GlobalDatasource',
|
|
54
|
+
'GlobalRole',
|
|
55
|
+
'GlobalRoleBinding',
|
|
56
|
+
'GlobalSecret',
|
|
57
|
+
'GlobalVariable',
|
|
58
|
+
'User'
|
|
59
|
+
];
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(exports, "getSecretProject", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
get: function() {
|
|
20
|
+
return getSecretProject;
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
function getSecretProject(secret) {
|
|
24
|
+
return 'project' in secret.metadata ? secret.metadata.project : undefined;
|
|
25
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
@@ -0,0 +1,113 @@
|
|
|
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
|
+
"use strict";
|
|
14
|
+
Object.defineProperty(exports, "__esModule", {
|
|
15
|
+
value: true
|
|
16
|
+
});
|
|
17
|
+
function _export(target, all) {
|
|
18
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: all[name]
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
_export(exports, {
|
|
24
|
+
THROUGHPUT_GROUP_CONFIG: function() {
|
|
25
|
+
return THROUGHPUT_GROUP_CONFIG;
|
|
26
|
+
},
|
|
27
|
+
THROUGHPUT_UNIT_CONFIG: function() {
|
|
28
|
+
return THROUGHPUT_UNIT_CONFIG;
|
|
29
|
+
},
|
|
30
|
+
formatThroughput: function() {
|
|
31
|
+
return formatThroughput;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
const _constants = require("./constants");
|
|
35
|
+
const _utils = require("./utils");
|
|
36
|
+
const throughputUnits = [
|
|
37
|
+
'counts/sec',
|
|
38
|
+
'events/sec',
|
|
39
|
+
'messages/sec',
|
|
40
|
+
'ops/sec',
|
|
41
|
+
'packets/sec',
|
|
42
|
+
'reads/sec',
|
|
43
|
+
'records/sec',
|
|
44
|
+
'requests/sec',
|
|
45
|
+
'rows/sec',
|
|
46
|
+
'writes/sec'
|
|
47
|
+
];
|
|
48
|
+
const THROUGHPUT_GROUP_CONFIG = {
|
|
49
|
+
label: 'Throughput',
|
|
50
|
+
decimalPlaces: true
|
|
51
|
+
};
|
|
52
|
+
const THROUGHPUT_GROUP = 'Throughput';
|
|
53
|
+
const THROUGHPUT_UNIT_CONFIG = {
|
|
54
|
+
'counts/sec': {
|
|
55
|
+
group: THROUGHPUT_GROUP,
|
|
56
|
+
label: 'Counts/sec'
|
|
57
|
+
},
|
|
58
|
+
'events/sec': {
|
|
59
|
+
group: THROUGHPUT_GROUP,
|
|
60
|
+
label: 'Events/sec'
|
|
61
|
+
},
|
|
62
|
+
'messages/sec': {
|
|
63
|
+
group: THROUGHPUT_GROUP,
|
|
64
|
+
label: 'Messages/sec'
|
|
65
|
+
},
|
|
66
|
+
'ops/sec': {
|
|
67
|
+
group: THROUGHPUT_GROUP,
|
|
68
|
+
label: 'Ops/sec'
|
|
69
|
+
},
|
|
70
|
+
'packets/sec': {
|
|
71
|
+
group: THROUGHPUT_GROUP,
|
|
72
|
+
label: 'Packets/sec'
|
|
73
|
+
},
|
|
74
|
+
'reads/sec': {
|
|
75
|
+
group: THROUGHPUT_GROUP,
|
|
76
|
+
label: 'Reads/sec'
|
|
77
|
+
},
|
|
78
|
+
'requests/sec': {
|
|
79
|
+
group: THROUGHPUT_GROUP,
|
|
80
|
+
label: 'Requests/sec'
|
|
81
|
+
},
|
|
82
|
+
'records/sec': {
|
|
83
|
+
group: THROUGHPUT_GROUP,
|
|
84
|
+
label: 'Records/sec'
|
|
85
|
+
},
|
|
86
|
+
'rows/sec': {
|
|
87
|
+
group: THROUGHPUT_GROUP,
|
|
88
|
+
label: 'Rows/sec'
|
|
89
|
+
},
|
|
90
|
+
'writes/sec': {
|
|
91
|
+
group: THROUGHPUT_GROUP,
|
|
92
|
+
label: 'Writes/sec'
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
function formatThroughput(value, { unit , shortValues , decimalPlaces }) {
|
|
96
|
+
const formatterOptions = {
|
|
97
|
+
style: 'decimal',
|
|
98
|
+
useGrouping: true
|
|
99
|
+
};
|
|
100
|
+
if ((0, _utils.shouldShortenValues)(shortValues)) {
|
|
101
|
+
formatterOptions.notation = 'compact';
|
|
102
|
+
}
|
|
103
|
+
if ((0, _utils.hasDecimalPlaces)(decimalPlaces)) {
|
|
104
|
+
formatterOptions.minimumFractionDigits = (0, _utils.limitDecimalPlaces)(decimalPlaces);
|
|
105
|
+
formatterOptions.maximumFractionDigits = (0, _utils.limitDecimalPlaces)(decimalPlaces);
|
|
106
|
+
} else {
|
|
107
|
+
if ((0, _utils.shouldShortenValues)(shortValues)) {
|
|
108
|
+
formatterOptions.maximumSignificantDigits = _constants.MAX_SIGNIFICANT_DIGITS;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
const formatter = Intl.NumberFormat('en-US', formatterOptions);
|
|
112
|
+
return formatter.format(value) + ' ' + unit;
|
|
113
|
+
}
|
|
@@ -56,23 +56,29 @@ _export(exports, {
|
|
|
56
56
|
},
|
|
57
57
|
isUnitWithShortValues: function() {
|
|
58
58
|
return isUnitWithShortValues;
|
|
59
|
+
},
|
|
60
|
+
isThroughputUnit: function() {
|
|
61
|
+
return isThroughputUnit;
|
|
59
62
|
}
|
|
60
63
|
});
|
|
61
64
|
const _bytes = require("./bytes");
|
|
62
65
|
const _decimal = require("./decimal");
|
|
63
66
|
const _percent = require("./percent");
|
|
64
67
|
const _time = require("./time");
|
|
68
|
+
const _throughput = require("./throughput");
|
|
65
69
|
const UNIT_GROUP_CONFIG = {
|
|
66
70
|
Time: _time.TIME_GROUP_CONFIG,
|
|
67
71
|
Percent: _percent.PERCENT_GROUP_CONFIG,
|
|
68
72
|
Decimal: _decimal.DECIMAL_GROUP_CONFIG,
|
|
69
|
-
Bytes: _bytes.BYTES_GROUP_CONFIG
|
|
73
|
+
Bytes: _bytes.BYTES_GROUP_CONFIG,
|
|
74
|
+
Throughput: _throughput.THROUGHPUT_GROUP_CONFIG
|
|
70
75
|
};
|
|
71
76
|
const UNIT_CONFIG = {
|
|
72
77
|
..._time.TIME_UNIT_CONFIG,
|
|
73
78
|
..._percent.PERCENT_UNIT_CONFIG,
|
|
74
79
|
..._decimal.DECIMAL_UNIT_CONFIG,
|
|
75
|
-
..._bytes.BYTES_UNIT_CONFIG
|
|
80
|
+
..._bytes.BYTES_UNIT_CONFIG,
|
|
81
|
+
..._throughput.THROUGHPUT_UNIT_CONFIG
|
|
76
82
|
};
|
|
77
83
|
function formatValue(value, formatOptions) {
|
|
78
84
|
if (formatOptions === undefined) {
|
|
@@ -90,6 +96,9 @@ function formatValue(value, formatOptions) {
|
|
|
90
96
|
if (isTimeUnit(formatOptions)) {
|
|
91
97
|
return (0, _time.formatTime)(value, formatOptions);
|
|
92
98
|
}
|
|
99
|
+
if (isThroughputUnit(formatOptions)) {
|
|
100
|
+
return (0, _throughput.formatThroughput)(value, formatOptions);
|
|
101
|
+
}
|
|
93
102
|
const exhaustive = formatOptions;
|
|
94
103
|
throw new Error(`Unknown unit options ${exhaustive}`);
|
|
95
104
|
}
|
|
@@ -123,3 +132,6 @@ function isUnitWithShortValues(formatOptions) {
|
|
|
123
132
|
const groupConfig = getUnitGroupConfig(formatOptions);
|
|
124
133
|
return !!groupConfig.shortValues;
|
|
125
134
|
}
|
|
135
|
+
function isThroughputUnit(formatOptions) {
|
|
136
|
+
return getUnitGroup(formatOptions) == 'Throughput';
|
|
137
|
+
}
|
package/dist/cjs/utils/fetch.js
CHANGED
|
@@ -36,15 +36,28 @@ _export(exports, {
|
|
|
36
36
|
return UserFriendlyError;
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
|
+
function _define_property(obj, key, value) {
|
|
40
|
+
if (key in obj) {
|
|
41
|
+
Object.defineProperty(obj, key, {
|
|
42
|
+
value: value,
|
|
43
|
+
enumerable: true,
|
|
44
|
+
configurable: true,
|
|
45
|
+
writable: true
|
|
46
|
+
});
|
|
47
|
+
} else {
|
|
48
|
+
obj[key] = value;
|
|
49
|
+
}
|
|
50
|
+
return obj;
|
|
51
|
+
}
|
|
39
52
|
async function fetch(...args) {
|
|
40
53
|
const response = await global.fetch(...args);
|
|
41
54
|
if (response.ok === false) {
|
|
42
55
|
const json = await response.json();
|
|
43
56
|
if (json.error) {
|
|
44
|
-
throw new UserFriendlyError(json.error);
|
|
57
|
+
throw new UserFriendlyError(json.error, response.status);
|
|
45
58
|
}
|
|
46
59
|
if (json.message) {
|
|
47
|
-
throw new UserFriendlyError(json.message);
|
|
60
|
+
throw new UserFriendlyError(json.message, response.status);
|
|
48
61
|
}
|
|
49
62
|
throw new FetchError(response);
|
|
50
63
|
}
|
|
@@ -58,12 +71,16 @@ async function fetchJson(...args) {
|
|
|
58
71
|
class FetchError extends Error {
|
|
59
72
|
constructor(response){
|
|
60
73
|
super(`${response.status} ${response.statusText}`);
|
|
74
|
+
_define_property(this, "status", void 0);
|
|
75
|
+
this.status = response.status;
|
|
61
76
|
Object.setPrototypeOf(this, FetchError.prototype);
|
|
62
77
|
}
|
|
63
78
|
}
|
|
64
79
|
class UserFriendlyError extends Error {
|
|
65
|
-
constructor(message){
|
|
80
|
+
constructor(message, status){
|
|
66
81
|
super(message);
|
|
82
|
+
_define_property(this, "status", void 0);
|
|
83
|
+
this.status = status;
|
|
67
84
|
Object.setPrototypeOf(this, UserFriendlyError.prototype);
|
|
68
85
|
}
|
|
69
86
|
}
|
|
@@ -31,15 +31,6 @@ export interface DatasourceSelector {
|
|
|
31
31
|
* Kind of the datasource.
|
|
32
32
|
*/
|
|
33
33
|
kind: string;
|
|
34
|
-
/**
|
|
35
|
-
* Group of the datasource.
|
|
36
|
-
* Omit it if you don't store datasource by group.
|
|
37
|
-
* TODO: This group field is fairly ignored by the backend data model.
|
|
38
|
-
* We need to decouple properly the backend and frontend data models.
|
|
39
|
-
* A Zustand store would certainly help here to decouple definition from the backend and state from the UI.
|
|
40
|
-
* => See Variable Store
|
|
41
|
-
*/
|
|
42
|
-
group?: string;
|
|
43
34
|
/**
|
|
44
35
|
* Name of the datasource.
|
|
45
36
|
* If omitted, it's assumed that you target the default datasource for the specified kind (and group, if set)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datasource.d.ts","sourceRoot":"","sources":["../../src/model/datasource.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,kBAAkB,CAAC;IACzB,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,cAAc,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,YAAY,CAAC;IACnB,QAAQ,EAAE,eAAe,CAAC;IAC1B,IAAI,EAAE,cAAc,CAAC;CACtB;AAED,oBAAY,UAAU,GAAG,iBAAiB,GAAG,gBAAgB,CAAC;AAE9D,MAAM,WAAW,cAAc,CAAC,UAAU,GAAG,WAAW;IACtD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"datasource.d.ts","sourceRoot":"","sources":["../../src/model/datasource.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,kBAAkB,CAAC;IACzB,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,cAAc,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,YAAY,CAAC;IACnB,QAAQ,EAAE,eAAe,CAAC;IAC1B,IAAI,EAAE,cAAc,CAAC;CACtB;AAED,oBAAY,UAAU,GAAG,iBAAiB,GAAG,gBAAgB,CAAC;AAE9D,MAAM,WAAW,cAAc,CAAC,UAAU,GAAG,WAAW;IACtD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;CAChC;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/model/datasource.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 { Metadata, ProjectMetadata } from './resource';\nimport { Display } from './display';\n\n/**\n * A Datasource that's available across all projects.\n */\nexport interface GlobalDatasource {\n kind: 'GlobalDatasource';\n metadata: Metadata;\n spec: DatasourceSpec;\n}\n\n/**\n * A Datasource resource, that belongs to a project.\n */\nexport interface ProjectDatasource {\n kind: 'Datasource';\n metadata: ProjectMetadata;\n spec: DatasourceSpec;\n}\n\nexport type Datasource = ProjectDatasource | GlobalDatasource;\n\nexport interface DatasourceSpec<PluginSpec = UnknownSpec> {\n display?: Display;\n default: boolean;\n plugin: Definition<PluginSpec>;\n}\n\n/**\n * A selector for pointing at a specific Datasource.\n */\nexport interface DatasourceSelector {\n /**\n * Kind of the datasource.\n */\n kind: string;\n
|
|
1
|
+
{"version":3,"sources":["../../src/model/datasource.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 { Metadata, ProjectMetadata } from './resource';\nimport { Display } from './display';\n\n/**\n * A Datasource that's available across all projects.\n */\nexport interface GlobalDatasource {\n kind: 'GlobalDatasource';\n metadata: Metadata;\n spec: DatasourceSpec;\n}\n\n/**\n * A Datasource resource, that belongs to a project.\n */\nexport interface ProjectDatasource {\n kind: 'Datasource';\n metadata: ProjectMetadata;\n spec: DatasourceSpec;\n}\n\nexport type Datasource = ProjectDatasource | GlobalDatasource;\n\nexport interface DatasourceSpec<PluginSpec = UnknownSpec> {\n display?: Display;\n default: boolean;\n plugin: Definition<PluginSpec>;\n}\n\n/**\n * A selector for pointing at a specific Datasource.\n */\nexport interface DatasourceSelector {\n /**\n * Kind of the datasource.\n */\n kind: string;\n\n /**\n * Name of the datasource.\n * If omitted, it's assumed that you target the default datasource for the specified kind (and group, if set)\n */\n name?: 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,WA4CC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { RequestHeaders } from './http';
|
|
2
|
+
export interface HTTPProxy {
|
|
3
|
+
kind: 'HTTPProxy';
|
|
4
|
+
spec: HTTPProxySpec;
|
|
5
|
+
}
|
|
6
|
+
export interface HTTPProxySpec {
|
|
7
|
+
url: string;
|
|
8
|
+
allowedEndpoints?: HTTPAllowedEndpoint[];
|
|
9
|
+
headers?: RequestHeaders;
|
|
10
|
+
secret?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface HTTPAllowedEndpoint {
|
|
13
|
+
endpointPattern: string;
|
|
14
|
+
method: string;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=http-proxy.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-proxy.d.ts","sourceRoot":"","sources":["../../src/model/http-proxy.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAExC,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,aAAa,CAAC;CACrB;AACD,MAAM,WAAW,aAAa;IAG5B,GAAG,EAAE,MAAM,CAAC;IAGZ,gBAAgB,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAEzC,OAAO,CAAC,EAAE,cAAc,CAAC;IAGzB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,mBAAmB;IAClC,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -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=http-proxy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/model/http-proxy.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 { RequestHeaders } from './http';\n\nexport interface HTTPProxy {\n kind: 'HTTPProxy';\n spec: HTTPProxySpec;\n}\nexport interface HTTPProxySpec {\n // url is the url of the datasource. It is not the url of the proxy.\n // The Perses server is the proxy, so it needs to know where to redirect the request.\n url: string;\n // allowedEndpoints is a list of tuples of http methods and http endpoints that will be accessible.\n // Leave it empty if you don't want to restrict the access to the datasource.\n allowedEndpoints?: HTTPAllowedEndpoint[];\n // headers can be used to provide additional headers that need to be forwarded when requesting the datasource\n headers?: RequestHeaders;\n // secret is the name of the secret that should be used for the proxy or discovery configuration\n // It will contain any sensitive information such as password, token, certificate.\n secret?: string;\n}\n\nexport interface HTTPAllowedEndpoint {\n endpointPattern: string;\n method: 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"}
|
package/dist/model/index.d.ts
CHANGED
|
@@ -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"}
|
package/dist/model/index.js
CHANGED
|
@@ -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
|
|
package/dist/model/index.js.map
CHANGED
|
@@ -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,iBAAiB;AAC/B,cAAc,cAAc;AAC5B,cAAc,eAAe;AAC7B,cAAc,gBAAgB;AAC9B,cAAc,YAAY;AAC1B,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,eAAe;AAC7B,cAAc,SAAS;AACvB,cAAc,qBAAqB;AACnC,cAAc,wBAAwB;AACtC,cAAc,UAAU;AACxB,cAAc,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"}
|
package/dist/model/query.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Definition, UnknownSpec } from './definitions';
|
|
2
2
|
import { TimeSeriesData } from './time-series-data';
|
|
3
|
+
import { TraceData } from './trace-data';
|
|
3
4
|
interface QuerySpec<PluginSpec> {
|
|
4
5
|
plugin: Definition<PluginSpec>;
|
|
5
6
|
}
|
|
@@ -15,6 +16,7 @@ export interface QueryDefinition<Kind = any, PluginSpec = UnknownSpec> {
|
|
|
15
16
|
*/
|
|
16
17
|
export interface QueryType {
|
|
17
18
|
TimeSeriesQuery: TimeSeriesData;
|
|
19
|
+
TraceQuery: TraceData;
|
|
18
20
|
}
|
|
19
21
|
/**
|
|
20
22
|
* Values of QueryType
|
|
@@ -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;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,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"}
|