@perses-dev/core 0.43.0 → 0.44.0-rc1
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/calculations.js +7 -7
- package/dist/cjs/model/legend.js +17 -17
- package/dist/cjs/model/roles.js +3 -3
- package/dist/cjs/model/time.js +15 -15
- package/dist/cjs/model/units/bytes.js +1 -1
- package/dist/cjs/model/units/decimal.js +1 -1
- package/dist/cjs/model/units/percent.js +1 -1
- package/dist/cjs/model/units/throughput.js +1 -1
- package/dist/cjs/model/units/time.js +9 -9
- package/dist/cjs/model/units/units.js +12 -12
- package/dist/cjs/model/units/utils.js +3 -3
- package/dist/cjs/model/variables.js +3 -3
- package/dist/cjs/utils/fetch.js +6 -6
- package/dist/cjs/utils/mathjs.js +1 -1
- package/dist/cjs/utils/memo.js +3 -3
- package/dist/cjs/utils/panel-refs.js +4 -4
- package/dist/cjs/utils/text.js +7 -7
- package/dist/cjs/utils/time-series-data.js +5 -5
- package/dist/model/calculations.d.ts +3 -3
- package/dist/model/calculations.d.ts.map +1 -1
- package/dist/model/calculations.js.map +1 -1
- package/dist/model/dashboard.js.map +1 -1
- package/dist/model/datasource.d.ts +1 -1
- package/dist/model/datasource.d.ts.map +1 -1
- package/dist/model/datasource.js +3 -1
- package/dist/model/datasource.js.map +1 -1
- package/dist/model/definitions.d.ts +1 -1
- package/dist/model/definitions.d.ts.map +1 -1
- package/dist/model/definitions.js +3 -0
- package/dist/model/definitions.js.map +1 -1
- package/dist/model/http-proxy.js.map +1 -1
- package/dist/model/http.d.ts +1 -1
- package/dist/model/http.d.ts.map +1 -1
- package/dist/model/kind.d.ts +1 -1
- package/dist/model/kind.d.ts.map +1 -1
- package/dist/model/layout.d.ts +1 -1
- package/dist/model/layout.d.ts.map +1 -1
- package/dist/model/layout.js.map +1 -1
- package/dist/model/legend.d.ts +3 -3
- package/dist/model/legend.d.ts.map +1 -1
- package/dist/model/legend.js.map +1 -1
- package/dist/model/panels.js +3 -1
- package/dist/model/panels.js.map +1 -1
- package/dist/model/project.js.map +1 -1
- package/dist/model/query.d.ts +1 -1
- package/dist/model/query.d.ts.map +1 -1
- package/dist/model/query.js +4 -1
- package/dist/model/query.js.map +1 -1
- package/dist/model/resource.js.map +1 -1
- package/dist/model/rolebindings.d.ts +1 -1
- package/dist/model/rolebindings.d.ts.map +1 -1
- package/dist/model/rolebindings.js.map +1 -1
- package/dist/model/roles.d.ts +3 -3
- package/dist/model/roles.d.ts.map +1 -1
- package/dist/model/secrets.d.ts +1 -1
- package/dist/model/secrets.d.ts.map +1 -1
- package/dist/model/secrets.js.map +1 -1
- package/dist/model/thresholds.js.map +1 -1
- package/dist/model/time-series-data.js.map +1 -1
- package/dist/model/time-series-queries.d.ts +3 -3
- package/dist/model/time-series-queries.d.ts.map +1 -1
- package/dist/model/time-series-queries.js.map +1 -1
- package/dist/model/time.d.ts +11 -11
- package/dist/model/time.d.ts.map +1 -1
- package/dist/model/time.js +1 -1
- package/dist/model/time.js.map +1 -1
- package/dist/model/trace-data.js +4 -1
- package/dist/model/trace-data.js.map +1 -1
- package/dist/model/units/bytes.d.ts +2 -2
- package/dist/model/units/bytes.d.ts.map +1 -1
- package/dist/model/units/bytes.js +1 -1
- package/dist/model/units/bytes.js.map +1 -1
- package/dist/model/units/decimal.d.ts +2 -2
- package/dist/model/units/decimal.d.ts.map +1 -1
- package/dist/model/units/decimal.js +1 -1
- package/dist/model/units/decimal.js.map +1 -1
- package/dist/model/units/percent.d.ts +2 -2
- package/dist/model/units/percent.d.ts.map +1 -1
- package/dist/model/units/percent.js +1 -1
- package/dist/model/units/percent.js.map +1 -1
- package/dist/model/units/throughput.d.ts +2 -2
- package/dist/model/units/throughput.d.ts.map +1 -1
- package/dist/model/units/throughput.js +1 -1
- package/dist/model/units/throughput.js.map +1 -1
- package/dist/model/units/time.d.ts +2 -2
- package/dist/model/units/time.d.ts.map +1 -1
- package/dist/model/units/time.js +9 -9
- package/dist/model/units/time.js.map +1 -1
- package/dist/model/units/types.d.ts +3 -3
- package/dist/model/units/types.d.ts.map +1 -1
- package/dist/model/units/units.d.ts +3 -3
- package/dist/model/units/units.d.ts.map +1 -1
- package/dist/model/units/units.js.map +1 -1
- package/dist/model/variables.d.ts +4 -4
- package/dist/model/variables.d.ts.map +1 -1
- package/dist/model/variables.js.map +1 -1
- package/dist/utils/event.js.map +1 -1
- package/dist/utils/fetch.js.map +1 -1
- package/dist/utils/is-empty-object.js.map +1 -1
- package/dist/utils/mathjs.js +1 -1
- package/dist/utils/mathjs.js.map +1 -1
- package/dist/utils/memo.js.map +1 -1
- package/dist/utils/panel-refs.js.map +1 -1
- package/dist/utils/text.js.map +1 -1
- package/dist/utils/time-series-data.js.map +1 -1
- package/dist/utils/types.d.ts +1 -1
- package/dist/utils/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -21,20 +21,20 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
|
|
25
|
-
return
|
|
24
|
+
CALCULATIONS_CONFIG: function() {
|
|
25
|
+
return CALCULATIONS_CONFIG;
|
|
26
26
|
},
|
|
27
27
|
CalculationsMap: function() {
|
|
28
28
|
return CalculationsMap;
|
|
29
29
|
},
|
|
30
|
-
|
|
31
|
-
return
|
|
32
|
-
},
|
|
33
|
-
getCalculations: function() {
|
|
34
|
-
return getCalculations;
|
|
30
|
+
DEFAULT_CALCULATION: function() {
|
|
31
|
+
return DEFAULT_CALCULATION;
|
|
35
32
|
},
|
|
36
33
|
getCalculation: function() {
|
|
37
34
|
return getCalculation;
|
|
35
|
+
},
|
|
36
|
+
getCalculations: function() {
|
|
37
|
+
return getCalculations;
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
40
|
const DEFAULT_CALCULATION = 'last-number';
|
package/dist/cjs/model/legend.js
CHANGED
|
@@ -25,35 +25,35 @@ function _export(target, all) {
|
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
27
|
_export(exports, {
|
|
28
|
-
|
|
29
|
-
return
|
|
28
|
+
DEFAULT_LEGEND: function() {
|
|
29
|
+
return DEFAULT_LEGEND;
|
|
30
30
|
},
|
|
31
|
-
|
|
32
|
-
return
|
|
31
|
+
getLegendMode: function() {
|
|
32
|
+
return getLegendMode;
|
|
33
33
|
},
|
|
34
|
-
|
|
35
|
-
return
|
|
34
|
+
getLegendPosition: function() {
|
|
35
|
+
return getLegendPosition;
|
|
36
36
|
},
|
|
37
|
-
|
|
38
|
-
return
|
|
37
|
+
getLegendSize: function() {
|
|
38
|
+
return getLegendSize;
|
|
39
39
|
},
|
|
40
40
|
isValidLegendMode: function() {
|
|
41
41
|
return isValidLegendMode;
|
|
42
42
|
},
|
|
43
|
+
isValidLegendPosition: function() {
|
|
44
|
+
return isValidLegendPosition;
|
|
45
|
+
},
|
|
43
46
|
isValidLegendSize: function() {
|
|
44
47
|
return isValidLegendSize;
|
|
45
48
|
},
|
|
46
|
-
|
|
47
|
-
return
|
|
48
|
-
},
|
|
49
|
-
getLegendPosition: function() {
|
|
50
|
-
return getLegendPosition;
|
|
49
|
+
legendModes: function() {
|
|
50
|
+
return legendModes;
|
|
51
51
|
},
|
|
52
|
-
|
|
53
|
-
return
|
|
52
|
+
legendPositions: function() {
|
|
53
|
+
return legendPositions;
|
|
54
54
|
},
|
|
55
|
-
|
|
56
|
-
return
|
|
55
|
+
legendSizes: function() {
|
|
56
|
+
return legendSizes;
|
|
57
57
|
}
|
|
58
58
|
});
|
|
59
59
|
const legendPositions = [
|
package/dist/cjs/model/roles.js
CHANGED
|
@@ -24,11 +24,11 @@ _export(exports, {
|
|
|
24
24
|
ACTIONS: function() {
|
|
25
25
|
return ACTIONS;
|
|
26
26
|
},
|
|
27
|
-
PROJECT_SCOPES: function() {
|
|
28
|
-
return PROJECT_SCOPES;
|
|
29
|
-
},
|
|
30
27
|
GLOBAL_SCOPES: function() {
|
|
31
28
|
return GLOBAL_SCOPES;
|
|
29
|
+
},
|
|
30
|
+
PROJECT_SCOPES: function() {
|
|
31
|
+
return PROJECT_SCOPES;
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
const ACTIONS = [
|
package/dist/cjs/model/time.js
CHANGED
|
@@ -21,35 +21,35 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
|
|
25
|
-
return
|
|
24
|
+
formatDuration: function() {
|
|
25
|
+
return formatDuration;
|
|
26
26
|
},
|
|
27
|
-
|
|
28
|
-
return
|
|
27
|
+
getSuggestedStepMs: function() {
|
|
28
|
+
return getSuggestedStepMs;
|
|
29
29
|
},
|
|
30
|
-
|
|
31
|
-
return
|
|
30
|
+
intervalToPrometheusDuration: function() {
|
|
31
|
+
return intervalToPrometheusDuration;
|
|
32
32
|
},
|
|
33
|
-
|
|
34
|
-
return
|
|
33
|
+
isAbsoluteTimeRange: function() {
|
|
34
|
+
return isAbsoluteTimeRange;
|
|
35
35
|
},
|
|
36
36
|
isDurationString: function() {
|
|
37
37
|
return isDurationString;
|
|
38
38
|
},
|
|
39
|
-
|
|
40
|
-
return
|
|
39
|
+
isRelativeTimeRange: function() {
|
|
40
|
+
return isRelativeTimeRange;
|
|
41
41
|
},
|
|
42
42
|
msToPrometheusDuration: function() {
|
|
43
43
|
return msToPrometheusDuration;
|
|
44
44
|
},
|
|
45
|
-
|
|
46
|
-
return
|
|
45
|
+
parseDurationString: function() {
|
|
46
|
+
return parseDurationString;
|
|
47
47
|
},
|
|
48
48
|
roundStepInterval: function() {
|
|
49
49
|
return roundStepInterval;
|
|
50
50
|
},
|
|
51
|
-
|
|
52
|
-
return
|
|
51
|
+
toAbsoluteTimeRange: function() {
|
|
52
|
+
return toAbsoluteTimeRange;
|
|
53
53
|
}
|
|
54
54
|
});
|
|
55
55
|
const _datefns = require("date-fns");
|
|
@@ -326,7 +326,7 @@ const ROUNDED_STEP_INTERVALS = [
|
|
|
326
326
|
}
|
|
327
327
|
];
|
|
328
328
|
function roundStepInterval(stepMs) {
|
|
329
|
-
for (const { maxMs
|
|
329
|
+
for (const { maxMs, roundedStepMs } of ROUNDED_STEP_INTERVALS){
|
|
330
330
|
if (stepMs < maxMs) {
|
|
331
331
|
return roundedStepMs;
|
|
332
332
|
}
|
|
@@ -60,7 +60,7 @@ const BYTES_UNIT_CONFIG = {
|
|
|
60
60
|
label: 'Bytes'
|
|
61
61
|
}
|
|
62
62
|
};
|
|
63
|
-
function formatBytes(bytes, { shortValues
|
|
63
|
+
function formatBytes(bytes, { shortValues, decimalPlaces }) {
|
|
64
64
|
// If we're showing the entire value, we can use Intl.NumberFormat.
|
|
65
65
|
if (!(0, _utils.shouldShortenValues)(shortValues) || Math.abs(bytes) < 1000) {
|
|
66
66
|
const formatterOptions = {
|
|
@@ -47,7 +47,7 @@ const DECIMAL_UNIT_CONFIG = {
|
|
|
47
47
|
label: 'Decimal'
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
|
-
function formatDecimal(value, { shortValues
|
|
50
|
+
function formatDecimal(value, { shortValues, decimalPlaces }) {
|
|
51
51
|
const formatterOptions = {
|
|
52
52
|
style: 'decimal',
|
|
53
53
|
useGrouping: true
|
|
@@ -92,7 +92,7 @@ const THROUGHPUT_UNIT_CONFIG = {
|
|
|
92
92
|
label: 'Writes/sec'
|
|
93
93
|
}
|
|
94
94
|
};
|
|
95
|
-
function formatThroughput(value, { unit
|
|
95
|
+
function formatThroughput(value, { unit, shortValues, decimalPlaces }) {
|
|
96
96
|
const formatterOptions = {
|
|
97
97
|
style: 'decimal',
|
|
98
98
|
useGrouping: true
|
|
@@ -87,14 +87,14 @@ const TIME_UNIT_CONFIG = {
|
|
|
87
87
|
};
|
|
88
88
|
var PersesTimeToIntlTime;
|
|
89
89
|
(function(PersesTimeToIntlTime) {
|
|
90
|
-
PersesTimeToIntlTime["milliseconds"] =
|
|
91
|
-
PersesTimeToIntlTime["seconds"] =
|
|
92
|
-
PersesTimeToIntlTime["minutes"] =
|
|
93
|
-
PersesTimeToIntlTime["hours"] =
|
|
94
|
-
PersesTimeToIntlTime["days"] =
|
|
95
|
-
PersesTimeToIntlTime["weeks"] =
|
|
96
|
-
PersesTimeToIntlTime["months"] =
|
|
97
|
-
PersesTimeToIntlTime["years"] =
|
|
90
|
+
PersesTimeToIntlTime["milliseconds"] = "millisecond";
|
|
91
|
+
PersesTimeToIntlTime["seconds"] = "second";
|
|
92
|
+
PersesTimeToIntlTime["minutes"] = "minute";
|
|
93
|
+
PersesTimeToIntlTime["hours"] = "hour";
|
|
94
|
+
PersesTimeToIntlTime["days"] = "day";
|
|
95
|
+
PersesTimeToIntlTime["weeks"] = "week";
|
|
96
|
+
PersesTimeToIntlTime["months"] = "month";
|
|
97
|
+
PersesTimeToIntlTime["years"] = "year";
|
|
98
98
|
})(PersesTimeToIntlTime || (PersesTimeToIntlTime = {}));
|
|
99
99
|
/**
|
|
100
100
|
* Note: This conversion will not be exactly accurate for months and years,
|
|
@@ -147,7 +147,7 @@ const LARGEST_TO_SMALLEST_TIME_UNITS = [
|
|
|
147
147
|
function isMonthOrYear(unit) {
|
|
148
148
|
return unit === 'months' || unit === 'years';
|
|
149
149
|
}
|
|
150
|
-
function formatTime(value, { unit
|
|
150
|
+
function formatTime(value, { unit, decimalPlaces }) {
|
|
151
151
|
if (value === 0) return '0s';
|
|
152
152
|
const results = getValueAndKindForNaturalNumbers(value, unit);
|
|
153
153
|
const formatterOptions = {
|
|
@@ -21,12 +21,12 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
UNIT_GROUP_CONFIG: function() {
|
|
25
|
-
return UNIT_GROUP_CONFIG;
|
|
26
|
-
},
|
|
27
24
|
UNIT_CONFIG: function() {
|
|
28
25
|
return UNIT_CONFIG;
|
|
29
26
|
},
|
|
27
|
+
UNIT_GROUP_CONFIG: function() {
|
|
28
|
+
return UNIT_GROUP_CONFIG;
|
|
29
|
+
},
|
|
30
30
|
formatValue: function() {
|
|
31
31
|
return formatValue;
|
|
32
32
|
},
|
|
@@ -39,26 +39,26 @@ _export(exports, {
|
|
|
39
39
|
getUnitGroupConfig: function() {
|
|
40
40
|
return getUnitGroupConfig;
|
|
41
41
|
},
|
|
42
|
-
|
|
43
|
-
return
|
|
42
|
+
isBytesUnit: function() {
|
|
43
|
+
return isBytesUnit;
|
|
44
|
+
},
|
|
45
|
+
isDecimalUnit: function() {
|
|
46
|
+
return isDecimalUnit;
|
|
44
47
|
},
|
|
45
48
|
isPercentUnit: function() {
|
|
46
49
|
return isPercentUnit;
|
|
47
50
|
},
|
|
48
|
-
|
|
49
|
-
return
|
|
51
|
+
isThroughputUnit: function() {
|
|
52
|
+
return isThroughputUnit;
|
|
50
53
|
},
|
|
51
|
-
|
|
52
|
-
return
|
|
54
|
+
isTimeUnit: function() {
|
|
55
|
+
return isTimeUnit;
|
|
53
56
|
},
|
|
54
57
|
isUnitWithDecimalPlaces: function() {
|
|
55
58
|
return isUnitWithDecimalPlaces;
|
|
56
59
|
},
|
|
57
60
|
isUnitWithShortValues: function() {
|
|
58
61
|
return isUnitWithShortValues;
|
|
59
|
-
},
|
|
60
|
-
isThroughputUnit: function() {
|
|
61
|
-
return isThroughputUnit;
|
|
62
62
|
}
|
|
63
63
|
});
|
|
64
64
|
const _bytes = require("./bytes");
|
|
@@ -21,14 +21,14 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
shouldShortenValues: function() {
|
|
25
|
-
return shouldShortenValues;
|
|
26
|
-
},
|
|
27
24
|
hasDecimalPlaces: function() {
|
|
28
25
|
return hasDecimalPlaces;
|
|
29
26
|
},
|
|
30
27
|
limitDecimalPlaces: function() {
|
|
31
28
|
return limitDecimalPlaces;
|
|
29
|
+
},
|
|
30
|
+
shouldShortenValues: function() {
|
|
31
|
+
return shouldShortenValues;
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
function shouldShortenValues(shortValues) {
|
|
@@ -21,11 +21,11 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
getVariableProject: function() {
|
|
25
|
-
return getVariableProject;
|
|
26
|
-
},
|
|
27
24
|
DEFAULT_ALL_VALUE: function() {
|
|
28
25
|
return DEFAULT_ALL_VALUE;
|
|
26
|
+
},
|
|
27
|
+
getVariableProject: function() {
|
|
28
|
+
return getVariableProject;
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
31
|
function getVariableProject(variable) {
|
package/dist/cjs/utils/fetch.js
CHANGED
|
@@ -23,17 +23,17 @@ function _export(target, all) {
|
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
_export(exports, {
|
|
26
|
-
fetch: function() {
|
|
27
|
-
return fetch;
|
|
28
|
-
},
|
|
29
|
-
fetchJson: function() {
|
|
30
|
-
return fetchJson;
|
|
31
|
-
},
|
|
32
26
|
FetchError: function() {
|
|
33
27
|
return FetchError;
|
|
34
28
|
},
|
|
35
29
|
UserFriendlyError: function() {
|
|
36
30
|
return UserFriendlyError;
|
|
31
|
+
},
|
|
32
|
+
fetch: function() {
|
|
33
|
+
return fetch;
|
|
34
|
+
},
|
|
35
|
+
fetchJson: function() {
|
|
36
|
+
return fetchJson;
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
function _define_property(obj, key, value) {
|
package/dist/cjs/utils/mathjs.js
CHANGED
|
@@ -22,6 +22,6 @@ Object.defineProperty(exports, "gcd", {
|
|
|
22
22
|
});
|
|
23
23
|
const _mathjs = require("mathjs");
|
|
24
24
|
// This ensures we get a minimal mathjs bundle for just what we need (see https://mathjs.org/docs/custom_bundling.html)
|
|
25
|
-
const { gcd
|
|
25
|
+
const { gcd } = (0, _mathjs.create)({
|
|
26
26
|
gcdDependencies: _mathjs.gcdDependencies
|
|
27
27
|
});
|
package/dist/cjs/utils/memo.js
CHANGED
|
@@ -21,11 +21,11 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
useMemoized: function() {
|
|
25
|
-
return useMemoized;
|
|
26
|
-
},
|
|
27
24
|
useDeepMemo: function() {
|
|
28
25
|
return useDeepMemo;
|
|
26
|
+
},
|
|
27
|
+
useMemoized: function() {
|
|
28
|
+
return useMemoized;
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
31
|
const _react = require("react");
|
|
@@ -21,14 +21,14 @@ function _export(target, all) {
|
|
|
21
21
|
});
|
|
22
22
|
}
|
|
23
23
|
_export(exports, {
|
|
24
|
-
|
|
25
|
-
return
|
|
24
|
+
createPanelRef: function() {
|
|
25
|
+
return createPanelRef;
|
|
26
26
|
},
|
|
27
27
|
getPanelKeyFromRef: function() {
|
|
28
28
|
return getPanelKeyFromRef;
|
|
29
29
|
},
|
|
30
|
-
|
|
31
|
-
return
|
|
30
|
+
resolvePanelRef: function() {
|
|
31
|
+
return resolvePanelRef;
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
function resolvePanelRef(spec, panelRef) {
|
package/dist/cjs/utils/text.js
CHANGED
|
@@ -24,20 +24,20 @@ _export(exports, {
|
|
|
24
24
|
getDashboardDisplayName: function() {
|
|
25
25
|
return getDashboardDisplayName;
|
|
26
26
|
},
|
|
27
|
-
|
|
28
|
-
return
|
|
27
|
+
getDashboardExtendedDisplayName: function() {
|
|
28
|
+
return getDashboardExtendedDisplayName;
|
|
29
29
|
},
|
|
30
30
|
getDatasourceDisplayName: function() {
|
|
31
31
|
return getDatasourceDisplayName;
|
|
32
32
|
},
|
|
33
|
-
|
|
34
|
-
return
|
|
33
|
+
getDatasourceExtendedDisplayName: function() {
|
|
34
|
+
return getDatasourceExtendedDisplayName;
|
|
35
|
+
},
|
|
36
|
+
getVariableDisplayName: function() {
|
|
37
|
+
return getVariableDisplayName;
|
|
35
38
|
},
|
|
36
39
|
getVariableExtendedDisplayName: function() {
|
|
37
40
|
return getVariableExtendedDisplayName;
|
|
38
|
-
},
|
|
39
|
-
getDatasourceExtendedDisplayName: function() {
|
|
40
|
-
return getDatasourceExtendedDisplayName;
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
43
|
function getDashboardDisplayName(dashboard) {
|
|
@@ -24,17 +24,17 @@ _export(exports, {
|
|
|
24
24
|
MIN_STEP_INTERVAL_MS: function() {
|
|
25
25
|
return MIN_STEP_INTERVAL_MS;
|
|
26
26
|
},
|
|
27
|
-
|
|
28
|
-
return
|
|
27
|
+
getCommonTimeScale: function() {
|
|
28
|
+
return getCommonTimeScale;
|
|
29
29
|
},
|
|
30
30
|
getTimeSeriesValues: function() {
|
|
31
31
|
return getTimeSeriesValues;
|
|
32
32
|
},
|
|
33
|
+
getXValues: function() {
|
|
34
|
+
return getXValues;
|
|
35
|
+
},
|
|
33
36
|
getYValues: function() {
|
|
34
37
|
return getYValues;
|
|
35
|
-
},
|
|
36
|
-
getCommonTimeScale: function() {
|
|
37
|
-
return getCommonTimeScale;
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
40
|
const _mathjs = require("./mathjs");
|
|
@@ -10,13 +10,13 @@ export declare const CalculationsMap: {
|
|
|
10
10
|
min: typeof min;
|
|
11
11
|
max: typeof max;
|
|
12
12
|
};
|
|
13
|
-
export
|
|
14
|
-
export
|
|
13
|
+
export type CalculationType = keyof typeof CalculationsMap;
|
|
14
|
+
export type CalculationConfig = {
|
|
15
15
|
label: string;
|
|
16
16
|
description: string;
|
|
17
17
|
};
|
|
18
18
|
export declare const CALCULATIONS_CONFIG: Readonly<Record<CalculationType, CalculationConfig>>;
|
|
19
|
-
|
|
19
|
+
type CalculationValue = number | null | undefined;
|
|
20
20
|
/**
|
|
21
21
|
* Calculate a multiple values for a set of time series data.
|
|
22
22
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calculations.d.ts","sourceRoot":"","sources":["../../src/model/calculations.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,oBAAoB,EAA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,CAAC,MAAM,EAAE,oBAAoB,EAAE,GAAG,gBAAgB,CAEpE;AAED,iBAAS,IAAI,CAAC,MAAM,EAAE,oBAAoB,EAAE,GAAG,gBAAgB,CAE9D;AAED,iBAAS,GAAG,CAAC,MAAM,EAAE,oBAAoB,EAAE,GAAG,gBAAgB,CAE7D;AAED,iBAAS,GAAG,CAAC,MAAM,EAAE,oBAAoB,EAAE,GAAG,gBAAgB,CAE7D;AAED,iBAAS,GAAG,CAAC,MAAM,EAAE,oBAAoB,EAAE,GAAG,gBAAgB,CAE7D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/model/calculations.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 { TimeSeriesValueTuple } from '@perses-dev/core';\n\nexport const DEFAULT_CALCULATION: CalculationType = 'last-number';\n\nexport const CalculationsMap = {\n first: first,\n last: last,\n 'first-number': firstNumber,\n 'last-number': lastNumber,\n mean: mean,\n sum: sum,\n min: min,\n max: max,\n};\n\nexport type CalculationType = keyof typeof CalculationsMap;\n\nexport type CalculationConfig = {\n label: string;\n description: string;\n};\n\nexport const CALCULATIONS_CONFIG: Readonly<Record<CalculationType, CalculationConfig>> = {\n first: {\n label: 'First',\n description: 'First value',\n },\n last: {\n label: 'Last',\n description: 'Last value',\n },\n 'first-number': {\n label: 'First *',\n description: 'First numeric value',\n },\n 'last-number': {\n label: 'Last *',\n description: 'Last numeric value',\n },\n mean: {\n label: 'Avg',\n description: 'Average value excluding nulls',\n },\n sum: {\n label: 'Sum',\n description: 'The sum of all values',\n },\n min: {\n label: 'Min',\n description: 'Minimum value',\n },\n max: {\n label: 'Max',\n description: 'Maximum value',\n },\n} as const;\n\ntype CalculationValue = number | null | undefined;\n\n/**\n * Calculate a multiple values for a set of time series data.\n *\n * @param values - Array of time series data.\n * @param includeCalculations - Array of calculations to include.\n */\nexport function getCalculations<IncludeCalcs extends CalculationType[]>(\n values: TimeSeriesValueTuple[],\n includeCalculations: IncludeCalcs\n): Record<\n // This extract combined with the generics above keeps the key of the returned\n // record to *just* the specified calculations.\n Extract<CalculationType, IncludeCalcs[number]>,\n CalculationValue\n> {\n const calculations = includeCalculations.reduce((initResult, calculation) => {\n
|
|
1
|
+
{"version":3,"sources":["../../src/model/calculations.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 { TimeSeriesValueTuple } from '@perses-dev/core';\n\nexport const DEFAULT_CALCULATION: CalculationType = 'last-number';\n\nexport const CalculationsMap = {\n first: first,\n last: last,\n 'first-number': firstNumber,\n 'last-number': lastNumber,\n mean: mean,\n sum: sum,\n min: min,\n max: max,\n};\n\nexport type CalculationType = keyof typeof CalculationsMap;\n\nexport type CalculationConfig = {\n label: string;\n description: string;\n};\n\nexport const CALCULATIONS_CONFIG: Readonly<Record<CalculationType, CalculationConfig>> = {\n first: {\n label: 'First',\n description: 'First value',\n },\n last: {\n label: 'Last',\n description: 'Last value',\n },\n 'first-number': {\n label: 'First *',\n description: 'First numeric value',\n },\n 'last-number': {\n label: 'Last *',\n description: 'Last numeric value',\n },\n mean: {\n label: 'Avg',\n description: 'Average value excluding nulls',\n },\n sum: {\n label: 'Sum',\n description: 'The sum of all values',\n },\n min: {\n label: 'Min',\n description: 'Minimum value',\n },\n max: {\n label: 'Max',\n description: 'Maximum value',\n },\n} as const;\n\ntype CalculationValue = number | null | undefined;\n\n/**\n * Calculate a multiple values for a set of time series data.\n *\n * @param values - Array of time series data.\n * @param includeCalculations - Array of calculations to include.\n */\nexport function getCalculations<IncludeCalcs extends CalculationType[]>(\n values: TimeSeriesValueTuple[],\n includeCalculations: IncludeCalcs\n): Record<\n // This extract combined with the generics above keeps the key of the returned\n // record to *just* the specified calculations.\n Extract<CalculationType, IncludeCalcs[number]>,\n CalculationValue\n> {\n const calculations = includeCalculations.reduce(\n (initResult, calculation) => {\n initResult[calculation] = undefined;\n return initResult;\n },\n {} as Record<string, CalculationValue>\n );\n\n // We save these values as separate values instead of directly setting them\n // in the calculations because they are needed by multiple calculations.\n let nonNullCount = 0;\n let sum = 0;\n\n // We use this large function capable of performing one or more calculations\n // in a single iteration of the data to minimize the performance impact of\n // generating multiple calculations for large timeseries values. This is\n // less optimized for certain single calculations when done in isolation (e.g.\n // `last`), but will be more performant in the more expensive cases where\n // multiple values are being used (e.g. table legend).\n values.forEach((tuple, i) => {\n const value = tuple[1];\n\n if (i === 0 && 'first' in calculations) {\n calculations.first = value;\n }\n if (i === values.length - 1 && 'last' in calculations) {\n calculations.last = value;\n }\n\n // Handling specific to non-null values.\n if (typeof value === 'number') {\n nonNullCount += 1;\n sum += value;\n\n if ('first-number' in calculations && calculations['first-number'] === undefined) {\n // Save the first number we see.\n calculations['first-number'] = value;\n }\n\n if ('last-number' in calculations) {\n // Keep setting the numbers we see, which will eventually be set to the\n // last number when finished iterating.\n calculations['last-number'] = value;\n }\n\n if ('min' in calculations) {\n if (typeof calculations.min !== 'number') {\n // Init the first time we see a number\n calculations.min = value;\n } else {\n // Use lowest value once initialized\n calculations.min = Math.min(calculations.min, value);\n }\n }\n\n if ('max' in calculations) {\n if (typeof calculations.max !== 'number') {\n // Init the first time we see a number\n calculations.max = value;\n } else {\n // Use highest value once initialized\n calculations.max = Math.max(calculations.max, value);\n }\n }\n }\n });\n\n // Set calculations that require iterating over all values.\n if (nonNullCount > 0 && 'sum' in calculations) {\n calculations.sum = sum;\n }\n\n if (nonNullCount > 0 && 'mean' in calculations) {\n calculations.mean = sum / nonNullCount;\n }\n\n return calculations;\n}\n\n/**\n * Calculate a single value for a set of time series data.\n *\n * Use `getCalculations` instead if you need multiple calculations.\n *\n * @param values - Array of time series data.\n * @param calculation - Name of the calculation to calculate.\n */\nexport function getCalculation(values: TimeSeriesValueTuple[], calculation: CalculationType) {\n return getCalculations(values, [calculation])[calculation];\n}\n\nfunction first(values: TimeSeriesValueTuple[]): CalculationValue {\n return getCalculation(values, 'first');\n}\n\nfunction last(values: TimeSeriesValueTuple[]): CalculationValue {\n return getCalculation(values, 'last');\n}\n\nfunction firstNumber(values: TimeSeriesValueTuple[]): CalculationValue {\n return getCalculation(values, 'first-number');\n}\n\nfunction lastNumber(values: TimeSeriesValueTuple[]): CalculationValue {\n return getCalculation(values, 'last-number');\n}\n\nfunction mean(values: TimeSeriesValueTuple[]): CalculationValue {\n return getCalculation(values, 'mean');\n}\n\nfunction sum(values: TimeSeriesValueTuple[]): CalculationValue {\n return getCalculation(values, 'sum');\n}\n\nfunction min(values: TimeSeriesValueTuple[]): CalculationValue {\n return getCalculation(values, 'min');\n}\n\nfunction max(values: TimeSeriesValueTuple[]): CalculationValue {\n return getCalculation(values, 'max');\n}\n"],"names":["DEFAULT_CALCULATION","CalculationsMap","first","last","firstNumber","lastNumber","mean","sum","min","max","CALCULATIONS_CONFIG","label","description","getCalculations","values","includeCalculations","calculations","reduce","initResult","calculation","undefined","nonNullCount","forEach","tuple","i","value","length","Math","getCalculation"],"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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,SAASR,KAAKQ,MAA8B;IAC1C,OAAOc,eAAed,QAAQ;AAChC;AAEA,SAASP,IAAIO,MAA8B;IACzC,OAAOc,eAAed,QAAQ;AAChC;AAEA,SAASN,IAAIM,MAA8B;IACzC,OAAOc,eAAed,QAAQ;AAChC;AAEA,SAASL,IAAIK,MAA8B;IACzC,OAAOc,eAAed,QAAQ;AAChC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/model/dashboard.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 { DatasourceSpec } from './datasource';\nimport { LayoutDefinition } from './layout';\nimport { 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}\n\nexport interface DashboardSelector {\n project: string;\n dashboard: 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;
|
|
1
|
+
{"version":3,"sources":["../../src/model/dashboard.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 { DatasourceSpec } from './datasource';\nimport { LayoutDefinition } from './layout';\nimport { 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}\n\nexport interface DashboardSelector {\n project: string;\n dashboard: 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;AA0BjC,WAGC"}
|
|
@@ -17,7 +17,7 @@ export interface ProjectDatasource {
|
|
|
17
17
|
metadata: ProjectMetadata;
|
|
18
18
|
spec: DatasourceSpec;
|
|
19
19
|
}
|
|
20
|
-
export
|
|
20
|
+
export type Datasource = ProjectDatasource | GlobalDatasource;
|
|
21
21
|
export interface DatasourceSpec<PluginSpec = UnknownSpec> {
|
|
22
22
|
display?: Display;
|
|
23
23
|
default: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datasource.d.ts","sourceRoot":"","sources":["../../src/model/datasource.ts"],"names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AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
|
package/dist/model/datasource.js
CHANGED
|
@@ -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
|
-
|
|
13
|
+
/**
|
|
14
|
+
* A selector for pointing at a specific Datasource.
|
|
15
|
+
*/ export { };
|
|
14
16
|
|
|
15
17
|
//# sourceMappingURL=datasource.js.map
|
|
@@ -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\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;
|
|
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;AAgCjC;;CAEC,GACD,WAWC"}
|
|
@@ -9,5 +9,5 @@ export interface Definition<Spec> {
|
|
|
9
9
|
* Type to represent specs at runtime in framework code where we don't know the spec's real type, probably because it's
|
|
10
10
|
* part of a plugin.
|
|
11
11
|
*/
|
|
12
|
-
export
|
|
12
|
+
export type UnknownSpec = Record<string, unknown>;
|
|
13
13
|
//# sourceMappingURL=definitions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../src/model/definitions.ts"],"names":[],"mappings":"AAaA;;GAEG;AACH,MAAM,WAAW,UAAU,CAAC,IAAI;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,IAAI,CAAC;CACZ;AAED;;;GAGG;AACH,
|
|
1
|
+
{"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../src/model/definitions.ts"],"names":[],"mappings":"AAaA;;GAEG;AACH,MAAM,WAAW,UAAU,CAAC,IAAI;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,IAAI,CAAC;CACZ;AAED;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC"}
|
|
@@ -12,6 +12,9 @@
|
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
/**
|
|
14
14
|
* Base type for definitions in JSON config resources.
|
|
15
|
+
*/ /**
|
|
16
|
+
* Type to represent specs at runtime in framework code where we don't know the spec's real type, probably because it's
|
|
17
|
+
* part of a plugin.
|
|
15
18
|
*/ export { };
|
|
16
19
|
|
|
17
20
|
//# sourceMappingURL=definitions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/model/definitions.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/**\n * Base type for definitions in JSON config resources.\n */\nexport interface Definition<Spec> {\n kind: string;\n spec: Spec;\n}\n\n/**\n * Type to represent specs at runtime in framework code where we don't know the spec's real type, probably because it's\n * part of a plugin.\n */\nexport type UnknownSpec = Record<string, unknown>;\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;;CAEC,GACD,
|
|
1
|
+
{"version":3,"sources":["../../src/model/definitions.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/**\n * Base type for definitions in JSON config resources.\n */\nexport interface Definition<Spec> {\n kind: string;\n spec: Spec;\n}\n\n/**\n * Type to represent specs at runtime in framework code where we don't know the spec's real type, probably because it's\n * part of a plugin.\n */\nexport type UnknownSpec = Record<string, unknown>;\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;;CAEC,GAMD;;;CAGC,GACD,WAAkD"}
|
|
@@ -1 +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;
|
|
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;AAsBjC,WAGC"}
|
package/dist/model/http.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type RequestHeaders = Record<string, string>;
|
|
2
2
|
//# sourceMappingURL=http.d.ts.map
|
package/dist/model/http.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/model/http.ts"],"names":[],"mappings":"AAaA,
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/model/http.ts"],"names":[],"mappings":"AAaA,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC"}
|