@perses-dev/plugin-system 0.55.0-beta.7 → 0.55.0-beta.8
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/components/DatasourceSelect/DatasourceSelect.d.ts.map +1 -1
- package/dist/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.d.ts.map +1 -1
- package/dist/components/HTTPSettingsEditor/HTTPHeaderPolicyEditor.d.ts +10 -0
- package/dist/components/HTTPSettingsEditor/HTTPHeaderPolicyEditor.d.ts.map +1 -0
- package/dist/components/HTTPSettingsEditor/HTTPHeaderPolicyEditor.js +99 -0
- package/dist/components/HTTPSettingsEditor/HTTPHeaderPolicyEditor.js.map +1 -0
- package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts +1 -0
- package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts.map +1 -1
- package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js +50 -25
- package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js.map +1 -1
- package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts.map +1 -1
- package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts.map +1 -1
- package/dist/components/PluginRegistry/getPluginSearchHelper.d.ts.map +1 -1
- package/dist/components/Variables/variable-model.d.ts +4 -4
- package/dist/components/Variables/variable-model.d.ts.map +1 -1
- package/dist/constants/repeat.d.ts +1 -1
- package/dist/constants/user-interface-text.d.ts.map +1 -1
- package/dist/context/ValidationProvider.d.ts +4 -4
- package/dist/context/ValidationProvider.d.ts.map +1 -1
- package/dist/context/ValidationProvider.js +1 -1
- package/dist/context/ValidationProvider.js.map +1 -1
- package/dist/model/calculations.d.ts.map +1 -1
- package/dist/model/legend.d.ts +1 -1
- package/dist/remote/PluginRuntime.d.ts.map +1 -1
- package/dist/remote/PluginRuntime.js +40 -38
- package/dist/remote/PluginRuntime.js.map +1 -1
- package/dist/runtime/TimeRangeProvider/query-params.d.ts.map +1 -1
- package/dist/runtime/UsageMetricsProvider.d.ts.map +1 -1
- package/dist/runtime/time-series-queries.d.ts.map +1 -1
- package/dist/runtime/variables.d.ts.map +1 -1
- package/dist/schema/panel.d.ts +2 -2
- package/dist/schema/panel.d.ts.map +1 -1
- package/dist/schema/panel.js.map +1 -1
- package/dist/test/mock-data.d.ts +12 -12
- package/dist/test/mock-data.d.ts.map +1 -1
- package/dist/test/test-plugins/bert/index.d.ts.map +1 -1
- package/dist/test/test-plugins/ernie/index.d.ts.map +1 -1
- package/dist/test/utils.d.ts.map +1 -1
- package/dist/utils/csv-export.d.ts.map +1 -1
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatasourceSelect.d.ts","sourceRoot":"","sources":["../../../src/components/DatasourceSelect/DatasourceSelect.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAE1E,OAAO,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAEzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C,OAAO,KAAK,EAEV,yBAAyB,EACzB,4BAA4B,EAC5B,gBAAgB,EACjB,MAAM,eAAe,CAAC;AAQvB,KAAK,eAAe,GAAG,UAAU,GAAG,OAAO,GAAG,UAAU,CAAC;AAWzD,MAAM,MAAM,qBAAqB,CAAC,CAAC,GAAG,kBAAkB,IAAI,CAAC,GAAG,YAAY,CAAC;AAE7E,MAAM,WAAW,qBAAsB,SAAQ,IAAI,CAAC,mBAAmB,GAAG,eAAe,CAAC,MAAM,CAAC,EAAE,eAAe,CAAC;IACjH,KAAK,EAAE,qBAAqB,CAAC;IAC7B,QAAQ,EAAE,CAAC,IAAI,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAChD,oBAAoB,EAAE,MAAM,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB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,CAAC,IAAI,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAChD,oBAAoB,EAAE,MAAM,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,YAAY,CAkH3E;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAAC,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,YAAY,CAahH;AAKD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,4BAA4B,GAAG,YAAY,GAAG,MAAM,CAKnG;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,WAAW,EAAE,MAAM,GAAG,qBAAqB,CAehF;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,qBAAqB,GAAG,SAAS,GAAG,KAAK,IAAI,YAAY,CAEpG;AAED,eAAO,MAAM,+BAA+B,UACnC,qBAAqB,GAAG,SAAS,aAC7B,gBAAgB,8BACC,yBAAyB,EAAE,GAAG,SAAS,KAClE,kBAAkB,GAAG,SA4BvB,CAAC;AAEF,eAAO,MAAM,kCAAkC,UACtC,qBAAqB,wBACN,MAAM,KAC3B,kBAQF,CAAC"}
|
package/dist/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatasourceTestConnectionButton.d.ts","sourceRoot":"","sources":["../../../src/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C,KAAK,mCAAmC,GAAG;IACzC,cAAc,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACrC,GAAG,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;AAEjC,eAAO,MAAM,8BAA8B,
|
|
1
|
+
{"version":3,"file":"DatasourceTestConnectionButton.d.ts","sourceRoot":"","sources":["../../../src/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAGjD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1C,KAAK,mCAAmC,GAAG;IACzC,cAAc,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACrC,GAAG,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;AAEjC,eAAO,MAAM,8BAA8B,iDAIxC,mCAAmC,KAAG,YAqBxC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HTTPProxySpec } from '@perses-dev/spec';
|
|
2
|
+
import type { ReactElement } from 'react';
|
|
3
|
+
interface HTTPHeaderPolicyEditorProps {
|
|
4
|
+
value: HTTPProxySpec;
|
|
5
|
+
onChange: (next: HTTPProxySpec) => void;
|
|
6
|
+
isReadonly?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function HTTPHeaderPolicyEditor({ value, onChange, isReadonly }: HTTPHeaderPolicyEditorProps): ReactElement;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=HTTPHeaderPolicyEditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HTTPHeaderPolicyEditor.d.ts","sourceRoot":"","sources":["../../../src/components/HTTPSettingsEditor/HTTPHeaderPolicyEditor.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAoB1C,UAAU,2BAA2B;IACnC,KAAK,EAAE,aAAa,CAAC;IACrB,QAAQ,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,CAAC;IACxC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAgB,sBAAsB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,2BAA2B,GAAG,YAAY,CAmBjH"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// Copyright 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
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
+
import { Autocomplete, Stack, TextField, Typography } from "@mui/material";
|
|
15
|
+
import { useCallback } from "react";
|
|
16
|
+
const emptyHeaders = [];
|
|
17
|
+
const headerPolicies = [
|
|
18
|
+
{
|
|
19
|
+
name: 'allowHeaders',
|
|
20
|
+
label: 'Allowed headers',
|
|
21
|
+
otherName: 'dropHeaders',
|
|
22
|
+
description: 'Only these request headers may be forwarded to the datasource. All other request headers are dropped.'
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: 'dropHeaders',
|
|
26
|
+
label: 'Dropped headers',
|
|
27
|
+
otherName: 'allowHeaders',
|
|
28
|
+
description: 'These request headers must not be forwarded to the datasource.'
|
|
29
|
+
}
|
|
30
|
+
];
|
|
31
|
+
export function HTTPHeaderPolicyEditor({ value, onChange, isReadonly }) {
|
|
32
|
+
return /*#__PURE__*/ _jsxs(Stack, {
|
|
33
|
+
spacing: 1,
|
|
34
|
+
mb: 2,
|
|
35
|
+
children: [
|
|
36
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
37
|
+
variant: "h5",
|
|
38
|
+
children: "Request header forwarding"
|
|
39
|
+
}),
|
|
40
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
41
|
+
variant: "body2",
|
|
42
|
+
children: "Configure either allowed headers or dropped headers. Clear the current list before using the other. Type a header name and press Enter to add it."
|
|
43
|
+
}),
|
|
44
|
+
headerPolicies.map((policy)=>/*#__PURE__*/ _jsx(HeaderPolicyField, {
|
|
45
|
+
policy: policy,
|
|
46
|
+
value: value,
|
|
47
|
+
onChange: onChange,
|
|
48
|
+
isReadonly: isReadonly
|
|
49
|
+
}, policy.name))
|
|
50
|
+
]
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function HeaderPolicyField({ policy, value, onChange, isReadonly }) {
|
|
54
|
+
const { name, label, otherName, description } = policy;
|
|
55
|
+
const hasConflict = Boolean(value.allowHeaders?.length && value.dropHeaders?.length);
|
|
56
|
+
const handleChange = useCallback((_, headers)=>{
|
|
57
|
+
const nextHeaders = headers.map((header)=>header.trim()).filter(Boolean);
|
|
58
|
+
onChange({
|
|
59
|
+
...value,
|
|
60
|
+
[name]: nextHeaders.length > 0 ? nextHeaders : undefined
|
|
61
|
+
});
|
|
62
|
+
}, [
|
|
63
|
+
name,
|
|
64
|
+
value,
|
|
65
|
+
onChange
|
|
66
|
+
]);
|
|
67
|
+
const renderInput = useCallback((params)=>/*#__PURE__*/ _jsx(TextField, {
|
|
68
|
+
...params,
|
|
69
|
+
label: label,
|
|
70
|
+
error: hasConflict,
|
|
71
|
+
helperText: hasConflict ? 'Allowed headers and dropped headers cannot both be configured.' : description,
|
|
72
|
+
InputProps: {
|
|
73
|
+
...params.InputProps,
|
|
74
|
+
readOnly: isReadonly
|
|
75
|
+
},
|
|
76
|
+
InputLabelProps: {
|
|
77
|
+
...params.InputLabelProps,
|
|
78
|
+
shrink: isReadonly ? true : undefined
|
|
79
|
+
}
|
|
80
|
+
}), [
|
|
81
|
+
isReadonly,
|
|
82
|
+
label,
|
|
83
|
+
hasConflict,
|
|
84
|
+
description
|
|
85
|
+
]);
|
|
86
|
+
return /*#__PURE__*/ _jsx(Autocomplete, {
|
|
87
|
+
multiple: true,
|
|
88
|
+
freeSolo: true,
|
|
89
|
+
autoSelect: true,
|
|
90
|
+
options: emptyHeaders,
|
|
91
|
+
value: value[name] ?? emptyHeaders,
|
|
92
|
+
readOnly: isReadonly,
|
|
93
|
+
disabled: Boolean(value[otherName]?.length) && !value[name]?.length,
|
|
94
|
+
onChange: handleChange,
|
|
95
|
+
renderInput: renderInput
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
//# sourceMappingURL=HTTPHeaderPolicyEditor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/components/HTTPSettingsEditor/HTTPHeaderPolicyEditor.tsx"],"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 type { AutocompleteRenderInputParams } from '@mui/material';\nimport { Autocomplete, Stack, TextField, Typography } from '@mui/material';\nimport type { HTTPProxySpec } from '@perses-dev/spec';\nimport type { ReactElement } from 'react';\nimport { useCallback } from 'react';\n\nconst emptyHeaders: string[] = [];\nconst headerPolicies = [\n {\n name: 'allowHeaders',\n label: 'Allowed headers',\n otherName: 'dropHeaders',\n description:\n 'Only these request headers may be forwarded to the datasource. All other request headers are dropped.',\n },\n {\n name: 'dropHeaders',\n label: 'Dropped headers',\n otherName: 'allowHeaders',\n description: 'These request headers must not be forwarded to the datasource.',\n },\n] as const;\n\ninterface HTTPHeaderPolicyEditorProps {\n value: HTTPProxySpec;\n onChange: (next: HTTPProxySpec) => void;\n isReadonly?: boolean;\n}\n\nexport function HTTPHeaderPolicyEditor({ value, onChange, isReadonly }: HTTPHeaderPolicyEditorProps): ReactElement {\n return (\n <Stack spacing={1} mb={2}>\n <Typography variant=\"h5\">Request header forwarding</Typography>\n <Typography variant=\"body2\">\n Configure either allowed headers or dropped headers. Clear the current list before using the other. Type a\n header name and press Enter to add it.\n </Typography>\n {headerPolicies.map((policy) => (\n <HeaderPolicyField\n key={policy.name}\n policy={policy}\n value={value}\n onChange={onChange}\n isReadonly={isReadonly}\n />\n ))}\n </Stack>\n );\n}\n\ninterface HeaderPolicyFieldProps extends HTTPHeaderPolicyEditorProps {\n policy: (typeof headerPolicies)[number];\n}\n\nfunction HeaderPolicyField({ policy, value, onChange, isReadonly }: HeaderPolicyFieldProps): ReactElement {\n const { name, label, otherName, description } = policy;\n const hasConflict = Boolean(value.allowHeaders?.length && value.dropHeaders?.length);\n const handleChange = useCallback(\n (_: unknown, headers: string[]): void => {\n const nextHeaders = headers.map((header) => header.trim()).filter(Boolean);\n onChange({ ...value, [name]: nextHeaders.length > 0 ? nextHeaders : undefined });\n },\n [name, value, onChange],\n );\n const renderInput = useCallback(\n (params: AutocompleteRenderInputParams): ReactElement => (\n <TextField\n {...params}\n label={label}\n error={hasConflict}\n helperText={hasConflict ? 'Allowed headers and dropped headers cannot both be configured.' : description}\n InputProps={{\n ...params.InputProps,\n readOnly: isReadonly,\n }}\n InputLabelProps={{ ...params.InputLabelProps, shrink: isReadonly ? true : undefined }}\n />\n ),\n [isReadonly, label, hasConflict, description],\n );\n\n return (\n <Autocomplete\n multiple\n freeSolo\n autoSelect\n options={emptyHeaders}\n value={value[name] ?? emptyHeaders}\n readOnly={isReadonly}\n disabled={Boolean(value[otherName]?.length) && !value[name]?.length}\n onChange={handleChange}\n renderInput={renderInput}\n />\n );\n}\n"],"names":["Autocomplete","Stack","TextField","Typography","useCallback","emptyHeaders","headerPolicies","name","label","otherName","description","HTTPHeaderPolicyEditor","value","onChange","isReadonly","spacing","mb","variant","map","policy","HeaderPolicyField","hasConflict","Boolean","allowHeaders","length","dropHeaders","handleChange","_","headers","nextHeaders","header","trim","filter","undefined","renderInput","params","error","helperText","InputProps","readOnly","InputLabelProps","shrink","multiple","freeSolo","autoSelect","options","disabled"],"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;;AAGjC,SAASA,YAAY,EAAEC,KAAK,EAAEC,SAAS,EAAEC,UAAU,QAAQ,gBAAgB;AAG3E,SAASC,WAAW,QAAQ,QAAQ;AAEpC,MAAMC,eAAyB,EAAE;AACjC,MAAMC,iBAAiB;IACrB;QACEC,MAAM;QACNC,OAAO;QACPC,WAAW;QACXC,aACE;IACJ;IACA;QACEH,MAAM;QACNC,OAAO;QACPC,WAAW;QACXC,aAAa;IACf;CACD;AAQD,OAAO,SAASC,uBAAuB,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,UAAU,EAA+B;IACjG,qBACE,MAACb;QAAMc,SAAS;QAAGC,IAAI;;0BACrB,KAACb;gBAAWc,SAAQ;0BAAK;;0BACzB,KAACd;gBAAWc,SAAQ;0BAAQ;;YAI3BX,eAAeY,GAAG,CAAC,CAACC,uBACnB,KAACC;oBAECD,QAAQA;oBACRP,OAAOA;oBACPC,UAAUA;oBACVC,YAAYA;mBAJPK,OAAOZ,IAAI;;;AAS1B;AAMA,SAASa,kBAAkB,EAAED,MAAM,EAAEP,KAAK,EAAEC,QAAQ,EAAEC,UAAU,EAA0B;IACxF,MAAM,EAAEP,IAAI,EAAEC,KAAK,EAAEC,SAAS,EAAEC,WAAW,EAAE,GAAGS;IAChD,MAAME,cAAcC,QAAQV,MAAMW,YAAY,EAAEC,UAAUZ,MAAMa,WAAW,EAAED;IAC7E,MAAME,eAAetB,YACnB,CAACuB,GAAYC;QACX,MAAMC,cAAcD,QAAQV,GAAG,CAAC,CAACY,SAAWA,OAAOC,IAAI,IAAIC,MAAM,CAACV;QAClET,SAAS;YAAE,GAAGD,KAAK;YAAE,CAACL,KAAK,EAAEsB,YAAYL,MAAM,GAAG,IAAIK,cAAcI;QAAU;IAChF,GACA;QAAC1B;QAAMK;QAAOC;KAAS;IAEzB,MAAMqB,cAAc9B,YAClB,CAAC+B,uBACC,KAACjC;YACE,GAAGiC,MAAM;YACV3B,OAAOA;YACP4B,OAAOf;YACPgB,YAAYhB,cAAc,mEAAmEX;YAC7F4B,YAAY;gBACV,GAAGH,OAAOG,UAAU;gBACpBC,UAAUzB;YACZ;YACA0B,iBAAiB;gBAAE,GAAGL,OAAOK,eAAe;gBAAEC,QAAQ3B,aAAa,OAAOmB;YAAU;YAGxF;QAACnB;QAAYN;QAAOa;QAAaX;KAAY;IAG/C,qBACE,KAACV;QACC0C,QAAQ;QACRC,QAAQ;QACRC,UAAU;QACVC,SAASxC;QACTO,OAAOA,KAAK,CAACL,KAAK,IAAIF;QACtBkC,UAAUzB;QACVgC,UAAUxB,QAAQV,KAAK,CAACH,UAAU,EAAEe,WAAW,CAACZ,KAAK,CAACL,KAAK,EAAEiB;QAC7DX,UAAUa;QACVQ,aAAaA;;AAGnB"}
|
|
@@ -8,5 +8,6 @@ export interface HTTPSettingsEditor {
|
|
|
8
8
|
initialSpecProxy: HTTPDatasourceSpec;
|
|
9
9
|
testConnection?: () => Promise<void>;
|
|
10
10
|
}
|
|
11
|
+
/** Edits direct URLs and proxy settings, including mutually exclusive allow/drop request header lists. */
|
|
11
12
|
export declare function HTTPSettingsEditor(props: HTTPSettingsEditor): ReactElement;
|
|
12
13
|
//# sourceMappingURL=HTTPSettingsEditor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HTTPSettingsEditor.d.ts","sourceRoot":"","sources":["../../../src/components/HTTPSettingsEditor/HTTPSettingsEditor.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"HTTPSettingsEditor.d.ts","sourceRoot":"","sources":["../../../src/components/HTTPSettingsEditor/HTTPSettingsEditor.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,kBAAkB,EAAiB,MAAM,kBAAkB,CAAC;AAI1E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAoB1C,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,kBAAkB,CAAC;IAC1B,QAAQ,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC7C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,iBAAiB,EAAE,kBAAkB,CAAC;IACtC,gBAAgB,EAAE,kBAAkB,CAAC;IACrC,cAAc,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACtC;AAED,0GAA0G;AAC1G,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,kBAAkB,GAAG,YAAY,CAwe1E"}
|
|
@@ -11,17 +11,18 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
11
11
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
12
|
// See the License for the specific language governing permissions and
|
|
13
13
|
// limitations under the License.
|
|
14
|
-
import { Box, Grid, IconButton, MenuItem, TextField, Typography } from "@mui/material";
|
|
14
|
+
import { Box, Grid, IconButton, MenuItem, Stack, TextField, Typography } from "@mui/material";
|
|
15
15
|
import { produce } from "immer";
|
|
16
16
|
import MinusIcon from "mdi-material-ui/Minus";
|
|
17
17
|
import PlusIcon from "mdi-material-ui/Plus";
|
|
18
|
-
import React, { Fragment, useState } from "react";
|
|
18
|
+
import React, { Fragment, useCallback, useState } from "react";
|
|
19
19
|
import { Controller, useFieldArray, useForm } from "react-hook-form";
|
|
20
20
|
import { z } from "zod";
|
|
21
21
|
import { DatasourceTestConnectionButton } from "../DatasourceTestConnectionButton/index.js";
|
|
22
22
|
import { OptionsEditorRadios } from "../OptionsEditorRadios/index.js";
|
|
23
|
+
import { HTTPHeaderPolicyEditor } from "./HTTPHeaderPolicyEditor.js";
|
|
23
24
|
const urlSchema = z.string().url();
|
|
24
|
-
export function HTTPSettingsEditor(props) {
|
|
25
|
+
/** Edits direct URLs and proxy settings, including mutually exclusive allow/drop request header lists. */ export function HTTPSettingsEditor(props) {
|
|
25
26
|
const { value, onChange, isReadonly, initialSpecDirect, initialSpecProxy, testConnection } = props;
|
|
26
27
|
const strDirect = 'Direct access';
|
|
27
28
|
const strProxy = 'Proxy';
|
|
@@ -74,6 +75,16 @@ export function HTTPSettingsEditor(props) {
|
|
|
74
75
|
}
|
|
75
76
|
}));
|
|
76
77
|
};
|
|
78
|
+
const handleHeaderPolicyChange = useCallback((next)=>{
|
|
79
|
+
onChange(produce(value, (draft)=>{
|
|
80
|
+
if (draft.proxy !== undefined) {
|
|
81
|
+
draft.proxy.spec = next;
|
|
82
|
+
}
|
|
83
|
+
}));
|
|
84
|
+
}, [
|
|
85
|
+
value,
|
|
86
|
+
onChange
|
|
87
|
+
]);
|
|
77
88
|
const tabs = [
|
|
78
89
|
{
|
|
79
90
|
label: strProxy,
|
|
@@ -419,30 +430,44 @@ export function HTTPSettingsEditor(props) {
|
|
|
419
430
|
})
|
|
420
431
|
]
|
|
421
432
|
}),
|
|
422
|
-
/*#__PURE__*/ _jsx(
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
},
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
433
|
+
value.proxy && /*#__PURE__*/ _jsx(HTTPHeaderPolicyEditor, {
|
|
434
|
+
value: value.proxy.spec,
|
|
435
|
+
isReadonly: isReadonly,
|
|
436
|
+
onChange: handleHeaderPolicyChange
|
|
437
|
+
}),
|
|
438
|
+
/*#__PURE__*/ _jsxs(Stack, {
|
|
439
|
+
spacing: 1,
|
|
440
|
+
children: [
|
|
441
|
+
/*#__PURE__*/ _jsx(Typography, {
|
|
442
|
+
variant: "h5",
|
|
443
|
+
children: "Secret"
|
|
444
|
+
}),
|
|
445
|
+
/*#__PURE__*/ _jsx(Controller, {
|
|
446
|
+
name: "Secret",
|
|
447
|
+
render: ({ field, fieldState })=>/*#__PURE__*/ _jsx(TextField, {
|
|
448
|
+
...field,
|
|
449
|
+
fullWidth: true,
|
|
450
|
+
label: "Secret",
|
|
451
|
+
value: value.proxy?.spec.secret || '',
|
|
452
|
+
error: !!fieldState.error,
|
|
453
|
+
helperText: fieldState.error?.message,
|
|
454
|
+
InputProps: {
|
|
455
|
+
readOnly: isReadonly
|
|
456
|
+
},
|
|
457
|
+
InputLabelProps: {
|
|
458
|
+
shrink: isReadonly ? true : undefined
|
|
459
|
+
},
|
|
460
|
+
onChange: (e)=>{
|
|
461
|
+
field.onChange(e);
|
|
462
|
+
onChange(produce(value, (draft)=>{
|
|
463
|
+
if (draft.proxy !== undefined) {
|
|
464
|
+
draft.proxy.spec.secret = e.target.value;
|
|
465
|
+
}
|
|
466
|
+
}));
|
|
442
467
|
}
|
|
443
|
-
})
|
|
444
|
-
}
|
|
468
|
+
})
|
|
445
469
|
})
|
|
470
|
+
]
|
|
446
471
|
})
|
|
447
472
|
]
|
|
448
473
|
})
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/components/HTTPSettingsEditor/HTTPSettingsEditor.tsx"],"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 { Box, Grid, IconButton, MenuItem, TextField, Typography } from '@mui/material';\nimport type { RequestHeaders } from '@perses-dev/client';\nimport type { HTTPDatasourceSpec } from '@perses-dev/spec';\nimport { produce } from 'immer';\nimport MinusIcon from 'mdi-material-ui/Minus';\nimport PlusIcon from 'mdi-material-ui/Plus';\nimport type { ReactElement } from 'react';\nimport React, { Fragment, useState } from 'react';\nimport { Controller, useFieldArray, useForm } from 'react-hook-form';\nimport { z } from 'zod';\n\nimport { DatasourceTestConnectionButton } from '../DatasourceTestConnectionButton';\nimport { OptionsEditorRadios } from '../OptionsEditorRadios';\n\nconst urlSchema = z.string().url();\n\ntype HeaderEntry = {\n name: string;\n value: string;\n};\n\ntype HeaderFormValues = {\n headers: HeaderEntry[];\n};\n\nexport interface HTTPSettingsEditor {\n value: HTTPDatasourceSpec;\n onChange: (next: HTTPDatasourceSpec) => void;\n isReadonly?: boolean;\n initialSpecDirect: HTTPDatasourceSpec;\n initialSpecProxy: HTTPDatasourceSpec;\n testConnection?: () => Promise<void>;\n}\n\nexport function HTTPSettingsEditor(props: HTTPSettingsEditor): ReactElement {\n const { value, onChange, isReadonly, initialSpecDirect, initialSpecProxy, testConnection } = props;\n const strDirect = 'Direct access';\n const strProxy = 'Proxy';\n\n // Initialize Proxy mode by default, if neither direct nor proxy mode is selected.\n if (value.directUrl === undefined && value.proxy === undefined) {\n Object.assign(value, initialSpecProxy);\n }\n\n // Use local state to maintain an array of header entries during editing, instead of\n // manipulating a map directly which causes weird UX.\n const headersForm = useForm<HeaderFormValues>({\n defaultValues: {\n headers: Object.entries(value.proxy?.spec.headers ?? {}).map(([name, headerValue]) => ({\n name,\n value: headerValue as string,\n })),\n },\n });\n\n const { fields, append, remove } = useFieldArray({\n control: headersForm.control,\n name: 'headers',\n });\n\n // Watch the headers array for changes to detect duplicates\n const watchedHeaders = headersForm.watch('headers');\n\n // Check for duplicate header names\n // TODO: duplication detection logic to be replaced by proper zod schema validation in the future\n // ref https://github.com/perses/perses/issues/3014\n const nameMap = new Map<string, number>();\n const duplicateNames = new Set<string>();\n watchedHeaders.forEach(({ name }) => {\n if (name !== '') {\n const count = (nameMap.get(name) || 0) + 1;\n nameMap.set(name, count);\n if (count > 1) {\n duplicateNames.add(name);\n }\n }\n });\n const hasDuplicates = duplicateNames.size > 0;\n\n // Sync headers to parent\n const syncHeadersToParent = (headers: HeaderEntry[]): void => {\n const headersObject: RequestHeaders = {};\n headers.forEach(({ name, value: headerValue }) => {\n if (name !== '') {\n headersObject[name] = headerValue;\n }\n });\n\n onChange(\n produce(value, (draft) => {\n if (draft.proxy !== undefined) {\n draft.proxy.spec.headers = Object.keys(headersObject).length > 0 ? headersObject : undefined;\n }\n }),\n );\n };\n\n const tabs = [\n {\n label: strProxy,\n content: (\n <>\n <Controller\n name=\"URL\"\n render={({ field, fieldState }) => (\n <TextField\n {...field}\n fullWidth\n label=\"URL\"\n value={value.proxy?.spec.url || ''}\n error={!!fieldState.error}\n helperText={fieldState.error?.message}\n InputProps={{\n readOnly: isReadonly,\n }}\n InputLabelProps={{ shrink: isReadonly ? true : undefined }}\n onChange={(e) => {\n field.onChange(e);\n onChange(\n produce(value, (draft) => {\n if (draft.proxy !== undefined) {\n draft.proxy.spec.url = e.target.value;\n }\n }),\n );\n }}\n sx={{ mb: 2 }}\n />\n )}\n />\n {testConnection && (\n <Box mb={2} display=\"flex\" justifyContent=\"flex-end\">\n <DatasourceTestConnectionButton\n testConnection={testConnection}\n disabled={!urlSchema.safeParse(value.proxy?.spec.url).success}\n />\n </Box>\n )}\n <Typography variant=\"h5\" mb={2}>\n Allowed endpoints\n </Typography>\n <Grid container spacing={2} mb={2}>\n {value.proxy?.spec.allowedEndpoints && value.proxy?.spec.allowedEndpoints.length !== 0 ? (\n value.proxy.spec.allowedEndpoints.map(({ endpointPattern, method }, i) => {\n return (\n <Fragment key={i}>\n <Grid item xs={8}>\n <Controller\n name={`Endpoint pattern ${i}`}\n render={({ field, fieldState }) => (\n <TextField\n {...field}\n fullWidth\n label=\"Endpoint pattern\"\n value={endpointPattern}\n error={!!fieldState.error}\n helperText={fieldState.error?.message}\n InputProps={{\n readOnly: isReadonly,\n }}\n InputLabelProps={{ shrink: isReadonly ? true : undefined }}\n onChange={(e) => {\n field.onChange(e);\n onChange(\n produce(value, (draft) => {\n if (draft.proxy !== undefined) {\n draft.proxy.spec.allowedEndpoints = draft.proxy.spec.allowedEndpoints?.map(\n (item, itemIndex) => {\n if (i === itemIndex) {\n return {\n endpointPattern: e.target.value,\n method: item.method,\n };\n } else {\n return item;\n }\n },\n );\n }\n }),\n );\n }}\n />\n )}\n />\n </Grid>\n <Grid item xs={3}>\n <Controller\n name={`Method ${i}`}\n render={({ field, fieldState }) => (\n <TextField\n {...field}\n select\n fullWidth\n label=\"Method\"\n value={method}\n error={!!fieldState.error}\n helperText={fieldState.error?.message}\n InputProps={{\n readOnly: isReadonly,\n }}\n InputLabelProps={{ shrink: isReadonly ? true : undefined }}\n onChange={(e) => {\n field.onChange(e);\n onChange(\n produce(value, (draft) => {\n if (draft.proxy !== undefined) {\n draft.proxy.spec.allowedEndpoints = draft.proxy.spec.allowedEndpoints?.map(\n (item, itemIndex) => {\n if (i === itemIndex) {\n return {\n endpointPattern: item.endpointPattern,\n method: e.target.value,\n };\n } else {\n return item;\n }\n },\n );\n }\n }),\n );\n }}\n >\n <MenuItem value=\"GET\">GET</MenuItem>\n <MenuItem value=\"POST\">POST</MenuItem>\n <MenuItem value=\"PUT\">PUT</MenuItem>\n <MenuItem value=\"PATCH\">PATCH</MenuItem>\n <MenuItem value=\"DELETE\">DELETE</MenuItem>\n </TextField>\n )}\n />\n </Grid>\n <Grid item xs={1}>\n <Controller\n name={`Remove Endpoint ${i}`}\n render={({ field }) => (\n <IconButton\n {...field}\n disabled={isReadonly}\n // Remove the given allowed endpoint from the list\n onClick={(e) => {\n field.onChange(e);\n onChange(\n produce(value, (draft) => {\n if (draft.proxy !== undefined) {\n draft.proxy.spec.allowedEndpoints = [\n ...(draft.proxy.spec.allowedEndpoints?.filter((item, itemIndex) => {\n return itemIndex !== i;\n }) || []),\n ];\n }\n }),\n );\n }}\n >\n <MinusIcon />\n </IconButton>\n )}\n />\n </Grid>\n </Fragment>\n );\n })\n ) : (\n <Grid item xs={4}>\n <Typography sx={{ fontStyle: 'italic' }}>None</Typography>\n </Grid>\n )}\n <Grid item xs={12} sx={{ paddingTop: '0px !important', paddingLeft: '5px !important' }}>\n <IconButton\n disabled={isReadonly}\n // Add a new (empty) allowed endpoint to the list\n onClick={() =>\n onChange(\n produce(value, (draft) => {\n if (draft.proxy !== undefined) {\n draft.proxy.spec.allowedEndpoints = [\n ...(draft.proxy.spec.allowedEndpoints ?? []),\n { endpointPattern: '', method: '' },\n ];\n }\n }),\n )\n }\n >\n <PlusIcon />\n </IconButton>\n </Grid>\n </Grid>\n <Typography variant=\"h5\" mb={2}>\n Request Headers\n </Typography>\n <Grid container spacing={2} mb={2}>\n {fields.length > 0 ? (\n fields.map((field, index) => (\n <Fragment key={field.id}>\n <Grid item xs={4}>\n <Controller\n control={headersForm.control}\n name={`headers.${index}.name`}\n render={({ field: controllerField, fieldState }) => (\n <TextField\n {...controllerField}\n fullWidth\n label=\"Header name\"\n error={!!fieldState.error || duplicateNames.has(controllerField.value)}\n helperText={fieldState.error?.message}\n InputProps={{\n readOnly: isReadonly,\n }}\n InputLabelProps={{ shrink: isReadonly ? true : undefined }}\n onChange={(e) => {\n controllerField.onChange(e);\n const updatedHeaders = [...watchedHeaders];\n updatedHeaders[index] = { name: e.target.value, value: updatedHeaders[index]?.value ?? '' };\n syncHeadersToParent(updatedHeaders);\n }}\n />\n )}\n />\n </Grid>\n <Grid item xs={7}>\n <Controller\n control={headersForm.control}\n name={`headers.${index}.value`}\n render={({ field: controllerField, fieldState }) => (\n <TextField\n {...controllerField}\n fullWidth\n label=\"Header value\"\n error={!!fieldState.error}\n helperText={fieldState.error?.message}\n InputProps={{\n readOnly: isReadonly,\n }}\n InputLabelProps={{ shrink: isReadonly ? true : undefined }}\n onChange={(e) => {\n controllerField.onChange(e);\n const updatedHeaders = [...watchedHeaders];\n updatedHeaders[index] = { name: updatedHeaders[index]?.name ?? '', value: e.target.value };\n syncHeadersToParent(updatedHeaders);\n }}\n />\n )}\n />\n </Grid>\n <Grid item xs={1}>\n <IconButton\n disabled={isReadonly}\n aria-label={`Remove header ${watchedHeaders[index]?.name || index}`}\n onClick={() => {\n remove(index);\n const updatedHeaders = watchedHeaders.filter((_, i) => i !== index);\n syncHeadersToParent(updatedHeaders);\n }}\n >\n <MinusIcon />\n </IconButton>\n </Grid>\n </Fragment>\n ))\n ) : (\n <Grid item xs={4}>\n <Typography sx={{ fontStyle: 'italic' }}>None</Typography>\n </Grid>\n )}\n {hasDuplicates && (\n <Grid item xs={12}>\n <Typography variant=\"body2\" color=\"error\">\n Duplicate header names detected. Each header name must be unique.\n </Typography>\n </Grid>\n )}\n <Grid item xs={12} sx={{ paddingTop: '0px !important', paddingLeft: '5px !important' }}>\n <IconButton disabled={isReadonly} onClick={() => append({ name: '', value: '' })}>\n <PlusIcon />\n </IconButton>\n </Grid>\n </Grid>\n\n <Controller\n name=\"Secret\"\n render={({ field, fieldState }) => (\n <TextField\n {...field}\n fullWidth\n label=\"Secret\"\n value={value.proxy?.spec.secret || ''}\n error={!!fieldState.error}\n helperText={fieldState.error?.message}\n InputProps={{\n readOnly: isReadonly,\n }}\n InputLabelProps={{ shrink: isReadonly ? true : undefined }}\n onChange={(e) => {\n field.onChange(e);\n onChange(\n produce(value, (draft) => {\n if (draft.proxy !== undefined) {\n draft.proxy.spec.secret = e.target.value;\n }\n }),\n );\n }}\n />\n )}\n />\n </>\n ),\n },\n {\n label: strDirect,\n content: (\n <>\n <Controller\n name=\"URL\"\n render={({ field, fieldState }) => (\n <TextField\n {...field}\n fullWidth\n label=\"URL\"\n value={value.directUrl || ''}\n error={!!fieldState.error}\n helperText={fieldState.error?.message}\n InputProps={{\n readOnly: isReadonly,\n }}\n InputLabelProps={{ shrink: isReadonly ? true : undefined }}\n onChange={(e) => {\n field.onChange(e);\n onChange(\n produce(value, (draft) => {\n draft.directUrl = e.target.value;\n }),\n );\n }}\n />\n )}\n />\n {testConnection && (\n <Box my={2} display=\"flex\" justifyContent=\"flex-end\">\n <DatasourceTestConnectionButton\n testConnection={testConnection}\n disabled={!urlSchema.safeParse(value.directUrl).success}\n />\n </Box>\n )}\n </>\n ),\n },\n ];\n\n // Use of findIndex instead of providing hardcoded values to avoid desynchronisatio or\n // bug in case the tabs get eventually swapped in the future.\n const directModeId = tabs.findIndex((tab) => tab.label === strDirect);\n const proxyModeId = tabs.findIndex((tab) => tab.label === strProxy);\n\n // Set defaultTab to the mode that this datasource is currently relying on.\n const defaultTab = value.proxy ? proxyModeId : directModeId;\n\n // For better user experience, save previous states in mind for both mode.\n // This avoids losing everything when the user changes their mind back.\n const [previousSpecDirect, setPreviousSpecDirect] = useState(initialSpecDirect);\n const [previousSpecProxy, setPreviousSpecProxy] = useState(initialSpecProxy);\n\n // When changing mode, remove previous mode's config + append default values for the new mode.\n const handleModeChange = (v: number): void => {\n if (tabs[v]?.label === strDirect) {\n setPreviousSpecProxy(value);\n\n // Copy all settings (for example, scrapeInterval), except 'proxy'\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { proxy, ...newValue } = value;\n onChange({ ...newValue, directUrl: previousSpecDirect.directUrl });\n } else if (tabs[v]?.label === strProxy) {\n setPreviousSpecDirect(value);\n\n // Copy all settings (for example, scrapeInterval), except 'directUrl'\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { directUrl, ...newValue } = value;\n onChange({ ...newValue, proxy: previousSpecProxy.proxy });\n }\n };\n\n return (\n <>\n <Typography variant=\"h4\" mt={2}>\n HTTP Settings\n </Typography>\n <OptionsEditorRadios\n isReadonly={isReadonly}\n tabs={tabs}\n defaultTab={defaultTab}\n onModeChange={handleModeChange}\n />\n </>\n );\n}\n"],"names":["Box","Grid","IconButton","MenuItem","TextField","Typography","produce","MinusIcon","PlusIcon","React","Fragment","useState","Controller","useFieldArray","useForm","z","DatasourceTestConnectionButton","OptionsEditorRadios","urlSchema","string","url","HTTPSettingsEditor","props","value","onChange","isReadonly","initialSpecDirect","initialSpecProxy","testConnection","strDirect","strProxy","directUrl","undefined","proxy","Object","assign","headersForm","defaultValues","headers","entries","spec","map","name","headerValue","fields","append","remove","control","watchedHeaders","watch","nameMap","Map","duplicateNames","Set","forEach","count","get","set","add","hasDuplicates","size","syncHeadersToParent","headersObject","draft","keys","length","tabs","label","content","render","field","fieldState","fullWidth","error","helperText","message","InputProps","readOnly","InputLabelProps","shrink","e","target","sx","mb","display","justifyContent","disabled","safeParse","success","variant","container","spacing","allowedEndpoints","endpointPattern","method","i","item","xs","itemIndex","select","onClick","filter","fontStyle","paddingTop","paddingLeft","index","controllerField","has","updatedHeaders","aria-label","_","id","color","secret","my","directModeId","findIndex","tab","proxyModeId","defaultTab","previousSpecDirect","setPreviousSpecDirect","previousSpecProxy","setPreviousSpecProxy","handleModeChange","v","newValue","mt","onModeChange"],"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;AAEjC,SAASA,GAAG,EAAEC,IAAI,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,SAAS,EAAEC,UAAU,QAAQ,gBAAgB;AAGvF,SAASC,OAAO,QAAQ,QAAQ;AAChC,OAAOC,eAAe,wBAAwB;AAC9C,OAAOC,cAAc,uBAAuB;AAE5C,OAAOC,SAASC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"version":3,"sources":["../../../src/components/HTTPSettingsEditor/HTTPSettingsEditor.tsx"],"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 { Box, Grid, IconButton, MenuItem, Stack, TextField, Typography } from '@mui/material';\nimport type { RequestHeaders } from '@perses-dev/client';\nimport type { HTTPDatasourceSpec, HTTPProxySpec } from '@perses-dev/spec';\nimport { produce } from 'immer';\nimport MinusIcon from 'mdi-material-ui/Minus';\nimport PlusIcon from 'mdi-material-ui/Plus';\nimport type { ReactElement } from 'react';\nimport React, { Fragment, useCallback, useState } from 'react';\nimport { Controller, useFieldArray, useForm } from 'react-hook-form';\nimport { z } from 'zod';\n\nimport { DatasourceTestConnectionButton } from '../DatasourceTestConnectionButton';\nimport { OptionsEditorRadios } from '../OptionsEditorRadios';\nimport { HTTPHeaderPolicyEditor } from './HTTPHeaderPolicyEditor';\n\nconst urlSchema = z.string().url();\n\ntype HeaderEntry = {\n name: string;\n value: string;\n};\n\ntype HeaderFormValues = {\n headers: HeaderEntry[];\n};\n\nexport interface HTTPSettingsEditor {\n value: HTTPDatasourceSpec;\n onChange: (next: HTTPDatasourceSpec) => void;\n isReadonly?: boolean;\n initialSpecDirect: HTTPDatasourceSpec;\n initialSpecProxy: HTTPDatasourceSpec;\n testConnection?: () => Promise<void>;\n}\n\n/** Edits direct URLs and proxy settings, including mutually exclusive allow/drop request header lists. */\nexport function HTTPSettingsEditor(props: HTTPSettingsEditor): ReactElement {\n const { value, onChange, isReadonly, initialSpecDirect, initialSpecProxy, testConnection } = props;\n const strDirect = 'Direct access';\n const strProxy = 'Proxy';\n\n // Initialize Proxy mode by default, if neither direct nor proxy mode is selected.\n if (value.directUrl === undefined && value.proxy === undefined) {\n Object.assign(value, initialSpecProxy);\n }\n\n // Use local state to maintain an array of header entries during editing, instead of\n // manipulating a map directly which causes weird UX.\n const headersForm = useForm<HeaderFormValues>({\n defaultValues: {\n headers: Object.entries(value.proxy?.spec.headers ?? {}).map(([name, headerValue]) => ({\n name,\n value: headerValue as string,\n })),\n },\n });\n\n const { fields, append, remove } = useFieldArray({\n control: headersForm.control,\n name: 'headers',\n });\n\n // Watch the headers array for changes to detect duplicates\n const watchedHeaders = headersForm.watch('headers');\n\n // Check for duplicate header names\n // TODO: duplication detection logic to be replaced by proper zod schema validation in the future\n // ref https://github.com/perses/perses/issues/3014\n const nameMap = new Map<string, number>();\n const duplicateNames = new Set<string>();\n watchedHeaders.forEach(({ name }) => {\n if (name !== '') {\n const count = (nameMap.get(name) || 0) + 1;\n nameMap.set(name, count);\n if (count > 1) {\n duplicateNames.add(name);\n }\n }\n });\n const hasDuplicates = duplicateNames.size > 0;\n\n // Sync headers to parent\n const syncHeadersToParent = (headers: HeaderEntry[]): void => {\n const headersObject: RequestHeaders = {};\n headers.forEach(({ name, value: headerValue }) => {\n if (name !== '') {\n headersObject[name] = headerValue;\n }\n });\n\n onChange(\n produce(value, (draft) => {\n if (draft.proxy !== undefined) {\n draft.proxy.spec.headers = Object.keys(headersObject).length > 0 ? headersObject : undefined;\n }\n }),\n );\n };\n\n const handleHeaderPolicyChange = useCallback(\n (next: HTTPProxySpec): void => {\n onChange(\n produce(value, (draft) => {\n if (draft.proxy !== undefined) {\n draft.proxy.spec = next;\n }\n }),\n );\n },\n [value, onChange],\n );\n\n const tabs = [\n {\n label: strProxy,\n content: (\n <>\n <Controller\n name=\"URL\"\n render={({ field, fieldState }) => (\n <TextField\n {...field}\n fullWidth\n label=\"URL\"\n value={value.proxy?.spec.url || ''}\n error={!!fieldState.error}\n helperText={fieldState.error?.message}\n InputProps={{\n readOnly: isReadonly,\n }}\n InputLabelProps={{ shrink: isReadonly ? true : undefined }}\n onChange={(e) => {\n field.onChange(e);\n onChange(\n produce(value, (draft) => {\n if (draft.proxy !== undefined) {\n draft.proxy.spec.url = e.target.value;\n }\n }),\n );\n }}\n sx={{ mb: 2 }}\n />\n )}\n />\n {testConnection && (\n <Box mb={2} display=\"flex\" justifyContent=\"flex-end\">\n <DatasourceTestConnectionButton\n testConnection={testConnection}\n disabled={!urlSchema.safeParse(value.proxy?.spec.url).success}\n />\n </Box>\n )}\n <Typography variant=\"h5\" mb={2}>\n Allowed endpoints\n </Typography>\n <Grid container spacing={2} mb={2}>\n {value.proxy?.spec.allowedEndpoints && value.proxy?.spec.allowedEndpoints.length !== 0 ? (\n value.proxy.spec.allowedEndpoints.map(({ endpointPattern, method }, i) => {\n return (\n <Fragment key={i}>\n <Grid item xs={8}>\n <Controller\n name={`Endpoint pattern ${i}`}\n render={({ field, fieldState }) => (\n <TextField\n {...field}\n fullWidth\n label=\"Endpoint pattern\"\n value={endpointPattern}\n error={!!fieldState.error}\n helperText={fieldState.error?.message}\n InputProps={{\n readOnly: isReadonly,\n }}\n InputLabelProps={{ shrink: isReadonly ? true : undefined }}\n onChange={(e) => {\n field.onChange(e);\n onChange(\n produce(value, (draft) => {\n if (draft.proxy !== undefined) {\n draft.proxy.spec.allowedEndpoints = draft.proxy.spec.allowedEndpoints?.map(\n (item, itemIndex) => {\n if (i === itemIndex) {\n return {\n endpointPattern: e.target.value,\n method: item.method,\n };\n } else {\n return item;\n }\n },\n );\n }\n }),\n );\n }}\n />\n )}\n />\n </Grid>\n <Grid item xs={3}>\n <Controller\n name={`Method ${i}`}\n render={({ field, fieldState }) => (\n <TextField\n {...field}\n select\n fullWidth\n label=\"Method\"\n value={method}\n error={!!fieldState.error}\n helperText={fieldState.error?.message}\n InputProps={{\n readOnly: isReadonly,\n }}\n InputLabelProps={{ shrink: isReadonly ? true : undefined }}\n onChange={(e) => {\n field.onChange(e);\n onChange(\n produce(value, (draft) => {\n if (draft.proxy !== undefined) {\n draft.proxy.spec.allowedEndpoints = draft.proxy.spec.allowedEndpoints?.map(\n (item, itemIndex) => {\n if (i === itemIndex) {\n return {\n endpointPattern: item.endpointPattern,\n method: e.target.value,\n };\n } else {\n return item;\n }\n },\n );\n }\n }),\n );\n }}\n >\n <MenuItem value=\"GET\">GET</MenuItem>\n <MenuItem value=\"POST\">POST</MenuItem>\n <MenuItem value=\"PUT\">PUT</MenuItem>\n <MenuItem value=\"PATCH\">PATCH</MenuItem>\n <MenuItem value=\"DELETE\">DELETE</MenuItem>\n </TextField>\n )}\n />\n </Grid>\n <Grid item xs={1}>\n <Controller\n name={`Remove Endpoint ${i}`}\n render={({ field }) => (\n <IconButton\n {...field}\n disabled={isReadonly}\n // Remove the given allowed endpoint from the list\n onClick={(e) => {\n field.onChange(e);\n onChange(\n produce(value, (draft) => {\n if (draft.proxy !== undefined) {\n draft.proxy.spec.allowedEndpoints = [\n ...(draft.proxy.spec.allowedEndpoints?.filter((item, itemIndex) => {\n return itemIndex !== i;\n }) || []),\n ];\n }\n }),\n );\n }}\n >\n <MinusIcon />\n </IconButton>\n )}\n />\n </Grid>\n </Fragment>\n );\n })\n ) : (\n <Grid item xs={4}>\n <Typography sx={{ fontStyle: 'italic' }}>None</Typography>\n </Grid>\n )}\n <Grid item xs={12} sx={{ paddingTop: '0px !important', paddingLeft: '5px !important' }}>\n <IconButton\n disabled={isReadonly}\n // Add a new (empty) allowed endpoint to the list\n onClick={() =>\n onChange(\n produce(value, (draft) => {\n if (draft.proxy !== undefined) {\n draft.proxy.spec.allowedEndpoints = [\n ...(draft.proxy.spec.allowedEndpoints ?? []),\n { endpointPattern: '', method: '' },\n ];\n }\n }),\n )\n }\n >\n <PlusIcon />\n </IconButton>\n </Grid>\n </Grid>\n <Typography variant=\"h5\" mb={2}>\n Request Headers\n </Typography>\n <Grid container spacing={2} mb={2}>\n {fields.length > 0 ? (\n fields.map((field, index) => (\n <Fragment key={field.id}>\n <Grid item xs={4}>\n <Controller\n control={headersForm.control}\n name={`headers.${index}.name`}\n render={({ field: controllerField, fieldState }) => (\n <TextField\n {...controllerField}\n fullWidth\n label=\"Header name\"\n error={!!fieldState.error || duplicateNames.has(controllerField.value)}\n helperText={fieldState.error?.message}\n InputProps={{\n readOnly: isReadonly,\n }}\n InputLabelProps={{ shrink: isReadonly ? true : undefined }}\n onChange={(e) => {\n controllerField.onChange(e);\n const updatedHeaders = [...watchedHeaders];\n updatedHeaders[index] = { name: e.target.value, value: updatedHeaders[index]?.value ?? '' };\n syncHeadersToParent(updatedHeaders);\n }}\n />\n )}\n />\n </Grid>\n <Grid item xs={7}>\n <Controller\n control={headersForm.control}\n name={`headers.${index}.value`}\n render={({ field: controllerField, fieldState }) => (\n <TextField\n {...controllerField}\n fullWidth\n label=\"Header value\"\n error={!!fieldState.error}\n helperText={fieldState.error?.message}\n InputProps={{\n readOnly: isReadonly,\n }}\n InputLabelProps={{ shrink: isReadonly ? true : undefined }}\n onChange={(e) => {\n controllerField.onChange(e);\n const updatedHeaders = [...watchedHeaders];\n updatedHeaders[index] = { name: updatedHeaders[index]?.name ?? '', value: e.target.value };\n syncHeadersToParent(updatedHeaders);\n }}\n />\n )}\n />\n </Grid>\n <Grid item xs={1}>\n <IconButton\n disabled={isReadonly}\n aria-label={`Remove header ${watchedHeaders[index]?.name || index}`}\n onClick={() => {\n remove(index);\n const updatedHeaders = watchedHeaders.filter((_, i) => i !== index);\n syncHeadersToParent(updatedHeaders);\n }}\n >\n <MinusIcon />\n </IconButton>\n </Grid>\n </Fragment>\n ))\n ) : (\n <Grid item xs={4}>\n <Typography sx={{ fontStyle: 'italic' }}>None</Typography>\n </Grid>\n )}\n {hasDuplicates && (\n <Grid item xs={12}>\n <Typography variant=\"body2\" color=\"error\">\n Duplicate header names detected. Each header name must be unique.\n </Typography>\n </Grid>\n )}\n <Grid item xs={12} sx={{ paddingTop: '0px !important', paddingLeft: '5px !important' }}>\n <IconButton disabled={isReadonly} onClick={() => append({ name: '', value: '' })}>\n <PlusIcon />\n </IconButton>\n </Grid>\n </Grid>\n\n {value.proxy && (\n <HTTPHeaderPolicyEditor\n value={value.proxy.spec}\n isReadonly={isReadonly}\n onChange={handleHeaderPolicyChange}\n />\n )}\n\n <Stack spacing={1}>\n <Typography variant=\"h5\">Secret</Typography>\n <Controller\n name=\"Secret\"\n render={({ field, fieldState }) => (\n <TextField\n {...field}\n fullWidth\n label=\"Secret\"\n value={value.proxy?.spec.secret || ''}\n error={!!fieldState.error}\n helperText={fieldState.error?.message}\n InputProps={{\n readOnly: isReadonly,\n }}\n InputLabelProps={{ shrink: isReadonly ? true : undefined }}\n onChange={(e) => {\n field.onChange(e);\n onChange(\n produce(value, (draft) => {\n if (draft.proxy !== undefined) {\n draft.proxy.spec.secret = e.target.value;\n }\n }),\n );\n }}\n />\n )}\n />\n </Stack>\n </>\n ),\n },\n {\n label: strDirect,\n content: (\n <>\n <Controller\n name=\"URL\"\n render={({ field, fieldState }) => (\n <TextField\n {...field}\n fullWidth\n label=\"URL\"\n value={value.directUrl || ''}\n error={!!fieldState.error}\n helperText={fieldState.error?.message}\n InputProps={{\n readOnly: isReadonly,\n }}\n InputLabelProps={{ shrink: isReadonly ? true : undefined }}\n onChange={(e) => {\n field.onChange(e);\n onChange(\n produce(value, (draft) => {\n draft.directUrl = e.target.value;\n }),\n );\n }}\n />\n )}\n />\n {testConnection && (\n <Box my={2} display=\"flex\" justifyContent=\"flex-end\">\n <DatasourceTestConnectionButton\n testConnection={testConnection}\n disabled={!urlSchema.safeParse(value.directUrl).success}\n />\n </Box>\n )}\n </>\n ),\n },\n ];\n\n // Use of findIndex instead of providing hardcoded values to avoid desynchronisatio or\n // bug in case the tabs get eventually swapped in the future.\n const directModeId = tabs.findIndex((tab) => tab.label === strDirect);\n const proxyModeId = tabs.findIndex((tab) => tab.label === strProxy);\n\n // Set defaultTab to the mode that this datasource is currently relying on.\n const defaultTab = value.proxy ? proxyModeId : directModeId;\n\n // For better user experience, save previous states in mind for both mode.\n // This avoids losing everything when the user changes their mind back.\n const [previousSpecDirect, setPreviousSpecDirect] = useState(initialSpecDirect);\n const [previousSpecProxy, setPreviousSpecProxy] = useState(initialSpecProxy);\n\n // When changing mode, remove previous mode's config + append default values for the new mode.\n const handleModeChange = (v: number): void => {\n if (tabs[v]?.label === strDirect) {\n setPreviousSpecProxy(value);\n\n // Copy all settings (for example, scrapeInterval), except 'proxy'\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { proxy, ...newValue } = value;\n onChange({ ...newValue, directUrl: previousSpecDirect.directUrl });\n } else if (tabs[v]?.label === strProxy) {\n setPreviousSpecDirect(value);\n\n // Copy all settings (for example, scrapeInterval), except 'directUrl'\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { directUrl, ...newValue } = value;\n onChange({ ...newValue, proxy: previousSpecProxy.proxy });\n }\n };\n\n return (\n <>\n <Typography variant=\"h4\" mt={2}>\n HTTP Settings\n </Typography>\n <OptionsEditorRadios\n isReadonly={isReadonly}\n tabs={tabs}\n defaultTab={defaultTab}\n onModeChange={handleModeChange}\n />\n </>\n );\n}\n"],"names":["Box","Grid","IconButton","MenuItem","Stack","TextField","Typography","produce","MinusIcon","PlusIcon","React","Fragment","useCallback","useState","Controller","useFieldArray","useForm","z","DatasourceTestConnectionButton","OptionsEditorRadios","HTTPHeaderPolicyEditor","urlSchema","string","url","HTTPSettingsEditor","props","value","onChange","isReadonly","initialSpecDirect","initialSpecProxy","testConnection","strDirect","strProxy","directUrl","undefined","proxy","Object","assign","headersForm","defaultValues","headers","entries","spec","map","name","headerValue","fields","append","remove","control","watchedHeaders","watch","nameMap","Map","duplicateNames","Set","forEach","count","get","set","add","hasDuplicates","size","syncHeadersToParent","headersObject","draft","keys","length","handleHeaderPolicyChange","next","tabs","label","content","render","field","fieldState","fullWidth","error","helperText","message","InputProps","readOnly","InputLabelProps","shrink","e","target","sx","mb","display","justifyContent","disabled","safeParse","success","variant","container","spacing","allowedEndpoints","endpointPattern","method","i","item","xs","itemIndex","select","onClick","filter","fontStyle","paddingTop","paddingLeft","index","controllerField","has","updatedHeaders","aria-label","_","id","color","secret","my","directModeId","findIndex","tab","proxyModeId","defaultTab","previousSpecDirect","setPreviousSpecDirect","previousSpecProxy","setPreviousSpecProxy","handleModeChange","v","newValue","mt","onModeChange"],"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;AAEjC,SAASA,GAAG,EAAEC,IAAI,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,KAAK,EAAEC,SAAS,EAAEC,UAAU,QAAQ,gBAAgB;AAG9F,SAASC,OAAO,QAAQ,QAAQ;AAChC,OAAOC,eAAe,wBAAwB;AAC9C,OAAOC,cAAc,uBAAuB;AAE5C,OAAOC,SAASC,QAAQ,EAAEC,WAAW,EAAEC,QAAQ,QAAQ,QAAQ;AAC/D,SAASC,UAAU,EAAEC,aAAa,EAAEC,OAAO,QAAQ,kBAAkB;AACrE,SAASC,CAAC,QAAQ,MAAM;AAExB,SAASC,8BAA8B,QAAQ,6CAAoC;AACnF,SAASC,mBAAmB,QAAQ,kCAAyB;AAC7D,SAASC,sBAAsB,QAAQ,8BAA2B;AAElE,MAAMC,YAAYJ,EAAEK,MAAM,GAAGC,GAAG;AAoBhC,wGAAwG,GACxG,OAAO,SAASC,mBAAmBC,KAAyB;IAC1D,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,UAAU,EAAEC,iBAAiB,EAAEC,gBAAgB,EAAEC,cAAc,EAAE,GAAGN;IAC7F,MAAMO,YAAY;IAClB,MAAMC,WAAW;IAEjB,kFAAkF;IAClF,IAAIP,MAAMQ,SAAS,KAAKC,aAAaT,MAAMU,KAAK,KAAKD,WAAW;QAC9DE,OAAOC,MAAM,CAACZ,OAAOI;IACvB;IAEA,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C7D,MAAM2B,eAAejD,KAAKkD,SAAS,CAAC,CAACC,MAAQA,IAAIlD,KAAK,KAAKxC;IAC3D,MAAM2F,cAAcpD,KAAKkD,SAAS,CAAC,CAACC,MAAQA,IAAIlD,KAAK,KAAKvC;IAE1D,2EAA2E;IAC3E,MAAM2F,aAAalG,MAAMU,KAAK,GAAGuF,cAAcH;IAE/C,0EAA0E;IAC1E,uEAAuE;IACvE,MAAM,CAACK,oBAAoBC,sBAAsB,GAAGjH,SAASgB;IAC7D,MAAM,CAACkG,mBAAmBC,qBAAqB,GAAGnH,SAASiB;IAE3D,8FAA8F;IAC9F,MAAMmG,mBAAmB,CAACC;QACxB,IAAI3D,IAAI,CAAC2D,EAAE,EAAE1D,UAAUxC,WAAW;YAChCgG,qBAAqBtG;YAErB,kEAAkE;YAClE,6DAA6D;YAC7D,MAAM,EAAEU,KAAK,EAAE,GAAG+F,UAAU,GAAGzG;YAC/BC,SAAS;gBAAE,GAAGwG,QAAQ;gBAAEjG,WAAW2F,mBAAmB3F,SAAS;YAAC;QAClE,OAAO,IAAIqC,IAAI,CAAC2D,EAAE,EAAE1D,UAAUvC,UAAU;YACtC6F,sBAAsBpG;YAEtB,sEAAsE;YACtE,6DAA6D;YAC7D,MAAM,EAAEQ,SAAS,EAAE,GAAGiG,UAAU,GAAGzG;YACnCC,SAAS;gBAAE,GAAGwG,QAAQ;gBAAE/F,OAAO2F,kBAAkB3F,KAAK;YAAC;QACzD;IACF;IAEA,qBACE;;0BACE,KAAC9B;gBAAWwF,SAAQ;gBAAKsC,IAAI;0BAAG;;0BAGhC,KAACjH;gBACCS,YAAYA;gBACZ2C,MAAMA;gBACNqD,YAAYA;gBACZS,cAAcJ;;;;AAItB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OptionsEditorRadios.d.ts","sourceRoot":"","sources":["../../../src/components/OptionsEditorRadios/OptionsEditorRadios.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKrD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,OAAO,EAAE,SAAS,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,IAAI,EAAE,kBAAkB,EAAE,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"OptionsEditorRadios.d.ts","sourceRoot":"","sources":["../../../src/components/OptionsEditorRadios/OptionsEditorRadios.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKrD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,OAAO,EAAE,SAAS,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,IAAI,EAAE,kBAAkB,EAAE,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,mBAAmB,UAAW,wBAAwB,KAAG,YAoCrE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OptionsEditorTabs.d.ts","sourceRoot":"","sources":["../../../src/components/OptionsEditorTabs/OptionsEditorTabs.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKrD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,OAAO,EAAE,SAAS,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,EAAE,gBAAgB,EAAE,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"OptionsEditorTabs.d.ts","sourceRoot":"","sources":["../../../src/components/OptionsEditorTabs/OptionsEditorTabs.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKrD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,OAAO,EAAE,SAAS,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,EAAE,gBAAgB,EAAE,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,iBAAiB,aAAc,sBAAsB,KAAG,YAgCpE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPluginSearchHelper.d.ts","sourceRoot":"","sources":["../../../src/components/PluginRegistry/getPluginSearchHelper.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAI1D,MAAM,WAAW,2BAA2B;IAC1C,mBAAmB,EAAE,OAAO,CAAC;CAC9B;AAID;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,UAAU,
|
|
1
|
+
{"version":3,"file":"getPluginSearchHelper.d.ts","sourceRoot":"","sources":["../../../src/components/PluginRegistry/getPluginSearchHelper.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAI1D,MAAM,WAAW,2BAA2B;IAC1C,mBAAmB,EAAE,OAAO,CAAC;CAC9B;AAID;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,CAAC,SAAS,UAAU,WAC3C,QAAQ,CAAC,MAAM,CAAC,SAClB,iBAAiB,CAAC,CAAC,CAAC,oBACV,2BAA2B,KAC3C,MAAM,EAkER,CAAC"}
|
|
@@ -17,10 +17,10 @@ export declare function useResolveListVariableValues(variableDefinitions: Variab
|
|
|
17
17
|
*/
|
|
18
18
|
export declare function getVariableValuesKey(v: VariableStateMap): string;
|
|
19
19
|
export declare const VARIABLE_TYPES: readonly [{
|
|
20
|
-
readonly label:
|
|
21
|
-
readonly kind:
|
|
20
|
+
readonly label: 'List';
|
|
21
|
+
readonly kind: 'ListVariable';
|
|
22
22
|
}, {
|
|
23
|
-
readonly label:
|
|
24
|
-
readonly kind:
|
|
23
|
+
readonly label: 'Text';
|
|
24
|
+
readonly kind: 'TextVariable';
|
|
25
25
|
}];
|
|
26
26
|
//# sourceMappingURL=variable-model.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variable-model.d.ts","sourceRoot":"","sources":["../../../src/components/Variables/variable-model.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAClG,OAAO,KAAK,EAAmB,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAI7E,OAAO,KAAK,EAA6B,cAAc,EAAkB,MAAM,aAAa,CAAC;AAC7F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAGtD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,cAAc,EAAE,EAAE,cAAc,EAAE,MAAM,GAAG,cAAc,EAAE,CAqBnG;AAgDD,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,sBAAsB,GAAG,cAAc,CAAC,cAAc,EAAE,CAAC,CAahH;AAcD;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,mBAAmB,EAAE,kBAAkB,EAAE,GAAG;IACvF,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACrD,SAAS,EAAE,OAAO,CAAC;CACpB,CAqEA;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,gBAAgB,GAAG,MAAM,CAIhE;AAED,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"variable-model.d.ts","sourceRoot":"","sources":["../../../src/components/Variables/variable-model.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAClG,OAAO,KAAK,EAAmB,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAI7E,OAAO,KAAK,EAA6B,cAAc,EAAkB,MAAM,aAAa,CAAC;AAC7F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAGtD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,cAAc,EAAE,EAAE,cAAc,EAAE,MAAM,GAAG,cAAc,EAAE,CAqBnG;AAgDD,wBAAgB,2BAA2B,CAAC,UAAU,EAAE,sBAAsB,GAAG,cAAc,CAAC,cAAc,EAAE,CAAC,CAahH;AAcD;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,mBAAmB,EAAE,kBAAkB,EAAE,GAAG;IACvF,qBAAqB,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACrD,SAAS,EAAE,OAAO,CAAC;CACpB,CAqEA;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,gBAAgB,GAAG,MAAM,CAIhE;AAED,eAAO,MAAM,cAAc;aACvB,KAAK,EAAE,MAAM;aAAE,IAAI,EAAE,cAAc;;aACnC,KAAK,EAAE,MAAM;aAAE,IAAI,EAAE,cAAc;EAC7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user-interface-text.d.ts","sourceRoot":"","sources":["../../src/constants/user-interface-text.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"user-interface-text.d.ts","sourceRoot":"","sources":["../../src/constants/user-interface-text.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,YAAY;IAEvB,qBAAqB;IACrB,kBAAkB;IAElB,OAAO;IACP,eAAe;IACf,MAAM;IACN,OAAO;CACR,CAAC"}
|
|
@@ -4,10 +4,10 @@ import type { ReactElement, ReactNode } from 'react';
|
|
|
4
4
|
import type { z } from 'zod';
|
|
5
5
|
import type { PanelEditorValues } from '../model';
|
|
6
6
|
export interface ValidationSchemas {
|
|
7
|
-
datasourceEditorSchema: z.
|
|
8
|
-
panelEditorSchema: z.
|
|
9
|
-
variableEditorSchema: z.
|
|
10
|
-
annotationEditorSchema: z.
|
|
7
|
+
datasourceEditorSchema: z.ZodType<DatasourceDefinition, DatasourceDefinition>;
|
|
8
|
+
panelEditorSchema: z.ZodType<PanelEditorValues, PanelEditorValues>;
|
|
9
|
+
variableEditorSchema: z.ZodType<VariableDefinition, VariableDefinition>;
|
|
10
|
+
annotationEditorSchema: z.ZodType<AnnotationSpec, AnnotationSpec>;
|
|
11
11
|
setDatasourceEditorSchemaPlugin: (pluginSchema: PluginSchema) => void;
|
|
12
12
|
setPanelEditorSchemaPlugin: (pluginSchema: PluginSchema) => void;
|
|
13
13
|
setVariableEditorSchemaPlugin: (pluginSchema: PluginSchema) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ValidationProvider.d.ts","sourceRoot":"","sources":["../../src/context/ValidationProvider.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAOzF,OAAO,KAAK,EAAE,YAAY,EAAE,SA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AM,wBAAwB,wDAA0D,CAAC;AAEhG,wBAAgB,oBAAoB,IAAI,iBAAiB,CAMxD;AAED,UAAU,uBAAuB;IAC/B,QAAQ,EAAE,SAAS,CAAC;CACrB;AAKD,wBAAgB,kBAAkB,CAAC,EAAE,QAAQ,EAAE,EAAE,uBAAuB,GAAG,YAAY,CA0CtF"}
|
|
@@ -27,7 +27,7 @@ export function useValidationSchemas() {
|
|
|
27
27
|
* Provide validation schemas for forms handling plugins (datasources, variables, panels).
|
|
28
28
|
*/ export function ValidationProvider({ children }) {
|
|
29
29
|
const [datasourceEditorSchema, setDatasourceEditorSchema] = useState(datasourceDefinitionSchema);
|
|
30
|
-
const [panelEditorSchema, setPanelEditorSchema] = useState(defaultPanelEditorSchema);
|
|
30
|
+
const [panelEditorSchema, setPanelEditorSchema] = useState(defaultPanelEditorSchema);
|
|
31
31
|
const [variableEditorSchema, setVariableEditorSchema] = useState(variableDefinitionSchema);
|
|
32
32
|
const [annotationEditorSchema, setAnnotationEditorSchema] = useState(annotationSpecSchema);
|
|
33
33
|
function setDatasourceEditorSchemaPlugin(pluginSchema) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/context/ValidationProvider.tsx"],"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 type { DatasourceDefinition } from '@perses-dev/client';\nimport { buildDatasourceDefinitionSchema, datasourceDefinitionSchema } from '@perses-dev/client';\nimport type { AnnotationSpec, PluginSchema, VariableDefinition } from '@perses-dev/spec';\nimport {\n annotationSpecSchema,\n buildAnnotationSpecSchema,\n buildVariableDefinitionSchema,\n variableDefinitionSchema,\n} from '@perses-dev/spec';\nimport type { ReactElement, ReactNode } from 'react';\nimport { createContext, useContext, useState } from 'react';\nimport type { z } from 'zod';\n\nimport type { PanelEditorValues } from '../model';\nimport { buildPanelEditorSchema, panelEditorSchema as defaultPanelEditorSchema } from '../schema';\n\nexport interface ValidationSchemas {\n datasourceEditorSchema: z.
|
|
1
|
+
{"version":3,"sources":["../../src/context/ValidationProvider.tsx"],"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 type { DatasourceDefinition } from '@perses-dev/client';\nimport { buildDatasourceDefinitionSchema, datasourceDefinitionSchema } from '@perses-dev/client';\nimport type { AnnotationSpec, PluginSchema, VariableDefinition } from '@perses-dev/spec';\nimport {\n annotationSpecSchema,\n buildAnnotationSpecSchema,\n buildVariableDefinitionSchema,\n variableDefinitionSchema,\n} from '@perses-dev/spec';\nimport type { ReactElement, ReactNode } from 'react';\nimport { createContext, useContext, useState } from 'react';\nimport type { z } from 'zod';\n\nimport type { PanelEditorValues } from '../model';\nimport { buildPanelEditorSchema, panelEditorSchema as defaultPanelEditorSchema } from '../schema';\n\nexport interface ValidationSchemas {\n datasourceEditorSchema: z.ZodType<DatasourceDefinition, DatasourceDefinition>;\n panelEditorSchema: z.ZodType<PanelEditorValues, PanelEditorValues>;\n variableEditorSchema: z.ZodType<VariableDefinition, VariableDefinition>;\n annotationEditorSchema: z.ZodType<AnnotationSpec, AnnotationSpec>;\n setDatasourceEditorSchemaPlugin: (pluginSchema: PluginSchema) => void;\n setPanelEditorSchemaPlugin: (pluginSchema: PluginSchema) => void;\n setVariableEditorSchemaPlugin: (pluginSchema: PluginSchema) => void;\n setAnnotationEditorSchemaPlugin?: (pluginSchema: PluginSchema) => void;\n}\n\nexport const ValidationSchemasContext = createContext<ValidationSchemas | undefined>(undefined);\n\nexport function useValidationSchemas(): ValidationSchemas {\n const ctx = useContext(ValidationSchemasContext);\n if (ctx === undefined) {\n throw new Error('No ValidationSchemasContext found. Did you forget a Provider?');\n }\n return ctx;\n}\n\ninterface ValidationProviderProps {\n children: ReactNode;\n}\n\n/*\n * Provide validation schemas for forms handling plugins (datasources, variables, panels).\n */\nexport function ValidationProvider({ children }: ValidationProviderProps): ReactElement {\n const [datasourceEditorSchema, setDatasourceEditorSchema] =\n useState<z.ZodType<DatasourceDefinition, DatasourceDefinition>>(datasourceDefinitionSchema);\n const [panelEditorSchema, setPanelEditorSchema] =\n useState<z.ZodType<PanelEditorValues, PanelEditorValues>>(defaultPanelEditorSchema);\n const [variableEditorSchema, setVariableEditorSchema] =\n useState<z.ZodType<VariableDefinition, VariableDefinition>>(variableDefinitionSchema);\n const [annotationEditorSchema, setAnnotationEditorSchema] =\n useState<z.ZodType<AnnotationSpec, AnnotationSpec>>(annotationSpecSchema);\n\n function setDatasourceEditorSchemaPlugin(pluginSchema: PluginSchema): void {\n setDatasourceEditorSchema(buildDatasourceDefinitionSchema(pluginSchema));\n }\n\n function setPanelEditorSchemaPlugin(pluginSchema: PluginSchema): void {\n setPanelEditorSchema(buildPanelEditorSchema(pluginSchema));\n }\n\n function setVariableEditorSchemaPlugin(pluginSchema: PluginSchema): void {\n setVariableEditorSchema(buildVariableDefinitionSchema(pluginSchema));\n }\n\n function setAnnotationEditorSchemaPlugin(pluginSchema: PluginSchema): void {\n setAnnotationEditorSchema(buildAnnotationSpecSchema(pluginSchema));\n }\n\n return (\n <ValidationSchemasContext.Provider\n value={{\n datasourceEditorSchema,\n panelEditorSchema,\n variableEditorSchema,\n annotationEditorSchema,\n setDatasourceEditorSchemaPlugin,\n setPanelEditorSchemaPlugin,\n setVariableEditorSchemaPlugin,\n setAnnotationEditorSchemaPlugin,\n }}\n >\n {children}\n </ValidationSchemasContext.Provider>\n );\n}\n"],"names":["buildDatasourceDefinitionSchema","datasourceDefinitionSchema","annotationSpecSchema","buildAnnotationSpecSchema","buildVariableDefinitionSchema","variableDefinitionSchema","createContext","useContext","useState","buildPanelEditorSchema","panelEditorSchema","defaultPanelEditorSchema","ValidationSchemasContext","undefined","useValidationSchemas","ctx","Error","ValidationProvider","children","datasourceEditorSchema","setDatasourceEditorSchema","setPanelEditorSchema","variableEditorSchema","setVariableEditorSchema","annotationEditorSchema","setAnnotationEditorSchema","setDatasourceEditorSchemaPlugin","pluginSchema","setPanelEditorSchemaPlugin","setVariableEditorSchemaPlugin","setAnnotationEditorSchemaPlugin","Provider","value"],"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;;AAGjC,SAASA,+BAA+B,EAAEC,0BAA0B,QAAQ,qBAAqB;AAEjG,SACEC,oBAAoB,EACpBC,yBAAyB,EACzBC,6BAA6B,EAC7BC,wBAAwB,QACnB,mBAAmB;AAE1B,SAASC,aAAa,EAAEC,UAAU,EAAEC,QAAQ,QAAQ,QAAQ;AAI5D,SAASC,sBAAsB,EAAEC,qBAAqBC,wBAAwB,QAAQ,qBAAY;AAalG,OAAO,MAAMC,yCAA2BN,cAA6CO,WAAW;AAEhG,OAAO,SAASC;IACd,MAAMC,MAAMR,WAAWK;IACvB,IAAIG,QAAQF,WAAW;QACrB,MAAM,IAAIG,MAAM;IAClB;IACA,OAAOD;AACT;AAMA;;CAEC,GACD,OAAO,SAASE,mBAAmB,EAAEC,QAAQ,EAA2B;IACtE,MAAM,CAACC,wBAAwBC,0BAA0B,GACvDZ,SAAgEP;IAClE,MAAM,CAACS,mBAAmBW,qBAAqB,GAC7Cb,SAA0DG;IAC5D,MAAM,CAACW,sBAAsBC,wBAAwB,GACnDf,SAA4DH;IAC9D,MAAM,CAACmB,wBAAwBC,0BAA0B,GACvDjB,SAAoDN;IAEtD,SAASwB,gCAAgCC,YAA0B;QACjEP,0BAA0BpB,gCAAgC2B;IAC5D;IAEA,SAASC,2BAA2BD,YAA0B;QAC5DN,qBAAqBZ,uBAAuBkB;IAC9C;IAEA,SAASE,8BAA8BF,YAA0B;QAC/DJ,wBAAwBnB,8BAA8BuB;IACxD;IAEA,SAASG,gCAAgCH,YAA0B;QACjEF,0BAA0BtB,0BAA0BwB;IACtD;IAEA,qBACE,KAACf,yBAAyBmB,QAAQ;QAChCC,OAAO;YACLb;YACAT;YACAY;YACAE;YACAE;YACAE;YACAC;YACAC;QACF;kBAECZ;;AAGP"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calculations.d.ts","sourceRoot":"","sources":["../../src/model/calculations.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAElE,eAAO,MAAM,mBAAmB,EAAE,eAAwB,CAAC;AAE3D,eAAO,MAAM,eAAe
|
|
1
|
+
{"version":3,"file":"calculations.d.ts","sourceRoot":"","sources":["../../src/model/calculations.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAElE,eAAO,MAAM,mBAAmB,EAAE,eAAwB,CAAC;AAE3D,eAAO,MAAM,eAAe;IAC1B,KAAK;IACL,IAAI;IACJ,cAAc;IACd,aAAa;IACb,IAAI;IACJ,GAAG;IACH,GAAG;IACH,GAAG;CACJ,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,MAAM,OAAO,eAAe,CAAC;AAE3D,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,MAAM,CAAC,eAAe,EAAE,iBAAiB,CAAC,CAiC3E,CAAC;AAEX,KAAK,gBAAgB,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;AAElD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,YAAY,SAAS,eAAe,EAAE,EACpE,MAAM,EAAE,oBAAoB,EAAE,EAC9B,mBAAmB,EAAE,YAAY,GAChC,MAAM,CAGP,OAAO,CAAC,eAAe,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC,EAC9C,gBAAgB,CACjB,CA8EA;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,oBAAoB,EAAE,EAAE,WAAW,EAAE,eAAe,GAAG,gBAAgB,CAE7G;AAED,iBAAS,KAAK,CAAC,MAAM,EAAE,oBAAoB,EAAE,GAAG,gBAAgB,CAE/D;AAED,iBAAS,IAAI,CAAC,MAAM,EAAE,oBAAoB,EAAE,GAAG,gBAAgB,CAE9D;AAED,iBAAS,WAAW,CAAC,MAAM,EAAE,oBAAoB,EAAE,GAAG,gBAAgB,CAErE;AAED,iBAAS,UAAU,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"}
|
package/dist/model/legend.d.ts
CHANGED
|
@@ -14,6 +14,6 @@ export type LegendSingleSelectConfig = {
|
|
|
14
14
|
export declare const LEGEND_POSITIONS_CONFIG: Readonly<Record<LegendPositions, LegendSingleSelectConfig>>;
|
|
15
15
|
export declare const LEGEND_MODE_CONFIG: Readonly<Record<LegendMode, LegendSingleSelectConfig>>;
|
|
16
16
|
export declare const LEGEND_SIZE_CONFIG: Readonly<Record<LegendSize, LegendSingleSelectConfig>>;
|
|
17
|
-
export declare const LEGEND_VALUE_CONFIG: Partial<Record<"
|
|
17
|
+
export declare const LEGEND_VALUE_CONFIG: Partial<Record<"first" | "first-number" | "last" | "last-number" | "max" | "mean" | "min" | "sum", LegendSingleSelectConfig>>;
|
|
18
18
|
export declare function validateLegendSpec(legend?: LegendOptionsBase): boolean;
|
|
19
19
|
//# sourceMappingURL=legend.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PluginRuntime.d.ts","sourceRoot":"","sources":["../../src/remote/PluginRuntime.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PluginRuntime.d.ts","sourceRoot":"","sources":["../../src/remote/PluginRuntime.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAQ5E,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAW7E,MAAM,WAAW,iBAAiB;IAChC,kBAAkB,EAAE,OAAO,CAAC;IAC5B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,wBAAwB,EAAE,OAAO,CAAC;IAClC,2BAA2B,EAAE,OAAO,CAAC;IACrC,qBAAqB,EAAE,OAAO,CAAC;IAC/B,wBAAwB,EAAE,OAAO,CAAC;CACnC;AAUD,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,iBAAiB,GAAG,IAAI,CAI1E;AA+ND,eAAO,MAAM,UAAU,WAAkB;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,KAAG,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAOpC,CAAC;AAEF,wBAAgB,gBAAgB,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE,GAAG;IACtE,aAAa,EAAE,gBAAgB,CAAC;IAChC,UAAU,EAAE,MAAM,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CAAC;CACtD,CAQA"}
|
|
@@ -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
|
+
import * as EmotionReact from "@emotion/react";
|
|
14
|
+
import * as EmotionStyled from "@emotion/styled";
|
|
13
15
|
import { createInstance } from "@module-federation/enhanced/runtime";
|
|
14
16
|
import * as ReactQuery from "@tanstack/react-query";
|
|
15
17
|
import React from "react";
|
|
@@ -62,7 +64,7 @@ const getPluginRuntime = ()=>{
|
|
|
62
64
|
}
|
|
63
65
|
},
|
|
64
66
|
'react-router-dom': {
|
|
65
|
-
version: '6.
|
|
67
|
+
version: '6.30.4',
|
|
66
68
|
lib: ()=>ReactRouterDOM,
|
|
67
69
|
shareConfig: {
|
|
68
70
|
singleton: true,
|
|
@@ -70,7 +72,7 @@ const getPluginRuntime = ()=>{
|
|
|
70
72
|
}
|
|
71
73
|
},
|
|
72
74
|
'@tanstack/react-query': {
|
|
73
|
-
version: '4.
|
|
75
|
+
version: '4.44.0',
|
|
74
76
|
lib: ()=>ReactQuery,
|
|
75
77
|
shareConfig: {
|
|
76
78
|
singleton: true,
|
|
@@ -78,59 +80,75 @@ const getPluginRuntime = ()=>{
|
|
|
78
80
|
}
|
|
79
81
|
},
|
|
80
82
|
'react-hook-form': {
|
|
81
|
-
version: '7.
|
|
83
|
+
version: '7.87.0',
|
|
82
84
|
lib: ()=>ReactHookForm,
|
|
83
85
|
shareConfig: {
|
|
84
86
|
singleton: true,
|
|
85
|
-
requiredVersion: '^7.
|
|
87
|
+
requiredVersion: '^7.87.0'
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
'@emotion/react': {
|
|
91
|
+
version: '11.14.0',
|
|
92
|
+
lib: ()=>EmotionReact,
|
|
93
|
+
shareConfig: {
|
|
94
|
+
singleton: true,
|
|
95
|
+
requiredVersion: '^11.11.3'
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
'@emotion/styled': {
|
|
99
|
+
version: '11.14.1',
|
|
100
|
+
lib: ()=>EmotionStyled,
|
|
101
|
+
shareConfig: {
|
|
102
|
+
singleton: true,
|
|
103
|
+
requiredVersion: '^11.11.0'
|
|
86
104
|
}
|
|
87
105
|
},
|
|
88
106
|
'@perses-dev/spec': {
|
|
89
|
-
version: '0.3.0-beta.
|
|
107
|
+
version: '0.3.0-beta.7',
|
|
90
108
|
lib: ()=>getHostSharedModule('@perses-dev/spec'),
|
|
91
109
|
shareConfig: {
|
|
92
110
|
singleton: true,
|
|
93
|
-
requiredVersion: '^0.3.0-beta.
|
|
111
|
+
requiredVersion: '^0.3.0-beta.7'
|
|
94
112
|
}
|
|
95
113
|
},
|
|
96
114
|
'@perses-dev/client': {
|
|
97
|
-
version: '0.55.0-beta.
|
|
115
|
+
version: '0.55.0-beta.8',
|
|
98
116
|
lib: ()=>getHostSharedModule('@perses-dev/client'),
|
|
99
117
|
shareConfig: {
|
|
100
118
|
singleton: true,
|
|
101
|
-
requiredVersion: '^0.55.0-beta.
|
|
119
|
+
requiredVersion: '^0.55.0-beta.8'
|
|
102
120
|
}
|
|
103
121
|
},
|
|
104
122
|
'@perses-dev/components': {
|
|
105
|
-
version: '0.55.0-beta.
|
|
123
|
+
version: '0.55.0-beta.8',
|
|
106
124
|
lib: ()=>getHostSharedModule('@perses-dev/components'),
|
|
107
125
|
shareConfig: {
|
|
108
126
|
singleton: true,
|
|
109
|
-
requiredVersion: '^0.55.0-beta.
|
|
127
|
+
requiredVersion: '^0.55.0-beta.8'
|
|
110
128
|
}
|
|
111
129
|
},
|
|
112
130
|
'@perses-dev/plugin-system': {
|
|
113
|
-
version: '0.55.0-beta.
|
|
131
|
+
version: '0.55.0-beta.8',
|
|
114
132
|
lib: ()=>getHostSharedModule('@perses-dev/plugin-system'),
|
|
115
133
|
shareConfig: {
|
|
116
134
|
singleton: true,
|
|
117
|
-
requiredVersion: '^0.55.0-beta.
|
|
135
|
+
requiredVersion: '^0.55.0-beta.8'
|
|
118
136
|
}
|
|
119
137
|
},
|
|
120
138
|
'@perses-dev/explore': {
|
|
121
|
-
version: '0.55.0-beta.
|
|
139
|
+
version: '0.55.0-beta.8',
|
|
122
140
|
lib: ()=>getHostSharedModule('@perses-dev/explore'),
|
|
123
141
|
shareConfig: {
|
|
124
142
|
singleton: true,
|
|
125
|
-
requiredVersion: '^0.55.0-beta.
|
|
143
|
+
requiredVersion: '^0.55.0-beta.8'
|
|
126
144
|
}
|
|
127
145
|
},
|
|
128
146
|
'@perses-dev/dashboards': {
|
|
129
|
-
version: '0.55.0-beta.
|
|
147
|
+
version: '0.55.0-beta.8',
|
|
130
148
|
lib: ()=>getHostSharedModule('@perses-dev/dashboards'),
|
|
131
149
|
shareConfig: {
|
|
132
150
|
singleton: true,
|
|
133
|
-
requiredVersion: '^0.55.0-beta.
|
|
151
|
+
requiredVersion: '^0.55.0-beta.8'
|
|
134
152
|
}
|
|
135
153
|
},
|
|
136
154
|
// Below are the shared modules that are used by the plugins and are loaded asynchronously on demand using get rather than lib.
|
|
@@ -144,7 +162,7 @@ const getPluginRuntime = ()=>{
|
|
|
144
162
|
}
|
|
145
163
|
},
|
|
146
164
|
'date-fns': {
|
|
147
|
-
version: '4.1
|
|
165
|
+
version: '4.2.1',
|
|
148
166
|
get: createSharedModuleLoader(()=>import("date-fns")),
|
|
149
167
|
shareConfig: {
|
|
150
168
|
singleton: true,
|
|
@@ -160,35 +178,19 @@ const getPluginRuntime = ()=>{
|
|
|
160
178
|
}
|
|
161
179
|
},
|
|
162
180
|
lodash: {
|
|
163
|
-
version: '4.
|
|
181
|
+
version: '4.18.1',
|
|
164
182
|
get: createSharedModuleLoader(()=>import("lodash")),
|
|
165
183
|
shareConfig: {
|
|
166
184
|
singleton: true,
|
|
167
185
|
requiredVersion: '^4.17.21'
|
|
168
186
|
}
|
|
169
187
|
},
|
|
170
|
-
'@emotion/react': {
|
|
171
|
-
version: '11.11.3',
|
|
172
|
-
get: createSharedModuleLoader(()=>import("@emotion/react")),
|
|
173
|
-
shareConfig: {
|
|
174
|
-
singleton: true,
|
|
175
|
-
requiredVersion: '^11.11.3'
|
|
176
|
-
}
|
|
177
|
-
},
|
|
178
|
-
'@emotion/styled': {
|
|
179
|
-
version: '11.11.0',
|
|
180
|
-
get: createSharedModuleLoader(()=>import("@emotion/styled")),
|
|
181
|
-
shareConfig: {
|
|
182
|
-
singleton: true,
|
|
183
|
-
requiredVersion: '^11.11.0'
|
|
184
|
-
}
|
|
185
|
-
},
|
|
186
188
|
'@hookform/resolvers/zod': {
|
|
187
|
-
version: '
|
|
189
|
+
version: '5.9.1',
|
|
188
190
|
get: createSharedModuleLoader(()=>import("@hookform/resolvers/zod")),
|
|
189
191
|
shareConfig: {
|
|
190
192
|
singleton: true,
|
|
191
|
-
requiredVersion: '^
|
|
193
|
+
requiredVersion: '^5.9.1'
|
|
192
194
|
}
|
|
193
195
|
},
|
|
194
196
|
'use-resize-observer': {
|
|
@@ -200,7 +202,7 @@ const getPluginRuntime = ()=>{
|
|
|
200
202
|
}
|
|
201
203
|
},
|
|
202
204
|
'mdi-material-ui': {
|
|
203
|
-
version: '7.4
|
|
205
|
+
version: '7.9.4',
|
|
204
206
|
get: createSharedModuleLoader(()=>import("mdi-material-ui")),
|
|
205
207
|
shareConfig: {
|
|
206
208
|
singleton: true,
|
|
@@ -208,7 +210,7 @@ const getPluginRuntime = ()=>{
|
|
|
208
210
|
}
|
|
209
211
|
},
|
|
210
212
|
immer: {
|
|
211
|
-
version: '10.
|
|
213
|
+
version: '10.2.0',
|
|
212
214
|
get: createSharedModuleLoader(()=>import("immer")),
|
|
213
215
|
shareConfig: {
|
|
214
216
|
singleton: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/remote/PluginRuntime.tsx"],"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 type { ModuleFederation } from '@module-federation/enhanced/runtime';\nimport { createInstance } from '@module-federation/enhanced/runtime';\nimport * as ReactQuery from '@tanstack/react-query';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport * as ReactHookForm from 'react-hook-form';\nimport * as ReactRouterDOM from 'react-router-dom';\n\nimport type { PersesPlugin, RemotePluginModule } from './PersesPlugin.types';\n\nlet instance: ModuleFederation | null = null;\n\nfunction createSharedModuleLoader<TModule>(loadModule: () => Promise<TModule>): () => Promise<() => TModule> {\n return async () => {\n const module = await loadModule();\n return () => module;\n };\n}\n\nexport interface HostSharedModules {\n '@perses-dev/spec': unknown;\n '@perses-dev/client': unknown;\n '@perses-dev/components': unknown;\n '@perses-dev/plugin-system': unknown;\n '@perses-dev/explore': unknown;\n '@perses-dev/dashboards': unknown;\n}\n\ntype HostSharedModuleName = keyof HostSharedModules;\n\nconst hostSharedModules = new Map<HostSharedModuleName, unknown>();\n\n/*\n * Shared singletons must be provided to Module Federation *synchronously* (via `lib`) so the host's\n * copy wins singleton negotiation to avoid loader deadlocks or multiple instances.\n */\nexport function registerHostSharedModules(modules: HostSharedModules): void {\n for (const [name, module] of Object.entries(modules) as Array<[HostSharedModuleName, unknown]>) {\n hostSharedModules.set(name, module);\n }\n}\n\nfunction getHostSharedModule(name: HostSharedModuleName): unknown {\n const module = hostSharedModules.get(name);\n if (!module) {\n throw new Error(\n `Shared module \"${name}\" was not registered before a plugin tried to consume it. ` +\n `Call registerHostSharedModules() during app bootstrap.`,\n );\n }\n return module;\n}\n\nconst getPluginRuntime = (): ModuleFederation => {\n if (instance === null) {\n const pluginRuntime = createInstance({\n name: '@perses/perses-ui-host',\n remotes: [], // all remotes are loaded dynamically\n shared: {\n react: {\n version: React.version,\n lib: () => React,\n shareConfig: {\n singleton: true,\n requiredVersion: `^${React.version}`,\n },\n },\n 'react-dom': {\n version: '18.3.1',\n lib: () => ReactDOM,\n shareConfig: {\n singleton: true,\n requiredVersion: `^18.3.1`,\n },\n },\n 'react-router-dom': {\n version: '6.26.0',\n lib: () => ReactRouterDOM,\n shareConfig: {\n singleton: true,\n requiredVersion: '^6.26.0',\n },\n },\n '@tanstack/react-query': {\n version: '4.39.1',\n lib: () => ReactQuery,\n shareConfig: {\n singleton: true,\n requiredVersion: '^4.39.1',\n },\n },\n 'react-hook-form': {\n version: '7.52.2',\n lib: () => ReactHookForm,\n shareConfig: {\n singleton: true,\n requiredVersion: '^7.52.2',\n },\n },\n '@perses-dev/spec': {\n version: '0.3.0-beta.5',\n lib: () => getHostSharedModule('@perses-dev/spec'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.3.0-beta.5',\n },\n },\n '@perses-dev/client': {\n version: '0.55.0-beta.7',\n lib: () => getHostSharedModule('@perses-dev/client'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.55.0-beta.7',\n },\n },\n '@perses-dev/components': {\n version: '0.55.0-beta.7',\n lib: () => getHostSharedModule('@perses-dev/components'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.55.0-beta.7',\n },\n },\n '@perses-dev/plugin-system': {\n version: '0.55.0-beta.7',\n lib: () => getHostSharedModule('@perses-dev/plugin-system'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.55.0-beta.7',\n },\n },\n '@perses-dev/explore': {\n version: '0.55.0-beta.7',\n lib: () => getHostSharedModule('@perses-dev/explore'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.55.0-beta.7',\n },\n },\n '@perses-dev/dashboards': {\n version: '0.55.0-beta.7',\n lib: () => getHostSharedModule('@perses-dev/dashboards'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.55.0-beta.7',\n },\n },\n // Below are the shared modules that are used by the plugins and are loaded asynchronously on demand using get rather than lib.\n // This is to avoid loading the modules if they are not used by the plugin.\n echarts: {\n version: '5.5.0',\n get: createSharedModuleLoader(() => import('echarts')),\n shareConfig: {\n singleton: true,\n requiredVersion: '^5.5.0',\n },\n },\n 'date-fns': {\n version: '4.1.0',\n get: createSharedModuleLoader(() => import('date-fns')),\n shareConfig: {\n singleton: true,\n requiredVersion: '^4.1.0',\n },\n },\n 'date-fns-tz': {\n version: '3.2.0',\n get: createSharedModuleLoader(() => import('date-fns-tz')),\n shareConfig: {\n singleton: true,\n requiredVersion: '^3.2.0',\n },\n },\n lodash: {\n version: '4.17.21',\n get: createSharedModuleLoader(() => import('lodash')),\n shareConfig: {\n singleton: true,\n requiredVersion: '^4.17.21',\n },\n },\n '@emotion/react': {\n version: '11.11.3',\n get: createSharedModuleLoader(() => import('@emotion/react')),\n shareConfig: {\n singleton: true,\n requiredVersion: '^11.11.3',\n },\n },\n '@emotion/styled': {\n version: '11.11.0',\n get: createSharedModuleLoader(() => import('@emotion/styled')),\n shareConfig: {\n singleton: true,\n requiredVersion: '^11.11.0',\n },\n },\n '@hookform/resolvers/zod': {\n version: '3.3.4',\n get: createSharedModuleLoader(() => import('@hookform/resolvers/zod')),\n shareConfig: {\n singleton: true,\n requiredVersion: '^3.3.4',\n },\n },\n 'use-resize-observer': {\n version: '9.1.0',\n get: createSharedModuleLoader(() => import('use-resize-observer')),\n shareConfig: {\n singleton: true,\n requiredVersion: '^9.1.0',\n },\n },\n 'mdi-material-ui': {\n version: '7.4.0',\n get: createSharedModuleLoader(() => import('mdi-material-ui')),\n shareConfig: {\n singleton: true,\n requiredVersion: '^7.4.0',\n },\n },\n immer: {\n version: '10.1.1',\n get: createSharedModuleLoader(() => import('immer')),\n shareConfig: {\n singleton: true,\n requiredVersion: '^10.1.1',\n },\n },\n },\n });\n\n instance = pluginRuntime;\n\n return instance;\n }\n return instance;\n};\n\nfunction getModuleFederationRemoteName(name: string, registry?: string, version?: string): string {\n return `${name}:${registry ?? ''}:${version ?? ''}`;\n}\n\nconst registerRemote = (name: string, registry?: string, version?: string, baseURL?: string): void => {\n const pluginRuntime = getPluginRuntime();\n const registryName = getModuleFederationRemoteName(name, registry, version);\n\n const existingRemote = pluginRuntime.options.remotes.find((remote) => remote.name === registryName);\n if (!existingRemote) {\n const nameVersionRegistry = [name, version, registry].filter(Boolean).join('~');\n const prefix = baseURL || '/plugins';\n const remoteEntryURL = `${prefix}/${nameVersionRegistry}/mf-manifest.json`;\n\n pluginRuntime.registerRemotes([\n {\n name: registryName,\n entry: remoteEntryURL,\n alias: registryName,\n },\n ]);\n }\n};\n\nexport const loadPlugin = async (target: {\n moduleName: string;\n pluginName: string;\n registry?: string;\n version?: string;\n baseURL?: string;\n}): Promise<RemotePluginModule | null> => {\n const { moduleName, pluginName, registry, version, baseURL } = target;\n registerRemote(moduleName, registry, version, baseURL);\n\n const pluginRuntime = getPluginRuntime();\n const registryName = getModuleFederationRemoteName(moduleName, registry, version);\n return pluginRuntime.loadRemote<RemotePluginModule>(`${registryName}/${pluginName}`);\n};\n\nexport function usePluginRuntime({ plugin }: { plugin: PersesPlugin }): {\n pluginRuntime: ModuleFederation;\n loadPlugin: () => Promise<RemotePluginModule | null>;\n} {\n return {\n pluginRuntime: getPluginRuntime(),\n loadPlugin: (): Promise<RemotePluginModule | null> => {\n const { moduleName, name: pluginName, registry, version, baseURL } = plugin;\n return loadPlugin({ moduleName, pluginName, registry, version, baseURL });\n },\n };\n}\n"],"names":["createInstance","ReactQuery","React","ReactDOM","ReactHookForm","ReactRouterDOM","instance","createSharedModuleLoader","loadModule","module","hostSharedModules","Map","registerHostSharedModules","modules","name","Object","entries","set","getHostSharedModule","get","Error","getPluginRuntime","pluginRuntime","remotes","shared","react","version","lib","shareConfig","singleton","requiredVersion","echarts","lodash","immer","getModuleFederationRemoteName","registry","registerRemote","baseURL","registryName","existingRemote","options","find","remote","nameVersionRegistry","filter","Boolean","join","prefix","remoteEntryURL","registerRemotes","entry","alias","loadPlugin","target","moduleName","pluginName","loadRemote","usePluginRuntime","plugin"],"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;AAGjC,SAASA,cAAc,QAAQ,sCAAsC;AACrE,YAAYC,gBAAgB,wBAAwB;AACpD,OAAOC,WAAW,QAAQ;AAC1B,OAAOC,cAAc,YAAY;AACjC,YAAYC,mBAAmB,kBAAkB;AACjD,YAAYC,oBAAoB,mBAAmB;AAInD,IAAIC,WAAoC;AAExC,SAASC,yBAAkCC,UAAkC;IAC3E,OAAO;QACL,MAAMC,SAAS,MAAMD;QACrB,OAAO,IAAMC;IACf;AACF;AAaA,MAAMC,oBAAoB,IAAIC;AAE9B;;;CAGC,GACD,OAAO,SAASC,0BAA0BC,OAA0B;IAClE,KAAK,MAAM,CAACC,MAAML,OAAO,IAAIM,OAAOC,OAAO,CAACH,SAAoD;QAC9FH,kBAAkBO,GAAG,CAACH,MAAML;IAC9B;AACF;AAEA,SAASS,oBAAoBJ,IAA0B;IACrD,MAAML,SAASC,kBAAkBS,GAAG,CAACL;IACrC,IAAI,CAACL,QAAQ;QACX,MAAM,IAAIW,MACR,CAAC,eAAe,EAAEN,KAAK,0DAA0D,CAAC,GAChF,CAAC,sDAAsD,CAAC;IAE9D;IACA,OAAOL;AACT;AAEA,MAAMY,mBAAmB;IACvB,IAAIf,aAAa,MAAM;QACrB,MAAMgB,g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E,OAAOJ,cAAckC,UAAU,CAAqB,GAAGlB,aAAa,CAAC,EAAEiB,YAAY;AACrF,EAAE;AAEF,OAAO,SAASE,iBAAiB,EAAEC,MAAM,EAA4B;IAInE,OAAO;QACLpC,eAAeD;QACf+B,YAAY;YACV,MAAM,EAAEE,UAAU,EAAExC,MAAMyC,UAAU,EAAEpB,QAAQ,EAAET,OAAO,EAAEW,OAAO,EAAE,GAAGqB;YACrE,OAAON,WAAW;gBAAEE;gBAAYC;gBAAYpB;gBAAUT;gBAASW;YAAQ;QACzE;IACF;AACF"}
|
|
1
|
+
{"version":3,"sources":["../../src/remote/PluginRuntime.tsx"],"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 * as EmotionReact from '@emotion/react';\nimport * as EmotionStyled from '@emotion/styled';\nimport type { ModuleFederation } from '@module-federation/enhanced/runtime';\nimport { createInstance } from '@module-federation/enhanced/runtime';\nimport * as ReactQuery from '@tanstack/react-query';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport * as ReactHookForm from 'react-hook-form';\nimport * as ReactRouterDOM from 'react-router-dom';\n\nimport type { PersesPlugin, RemotePluginModule } from './PersesPlugin.types';\n\nlet instance: ModuleFederation | null = null;\n\nfunction createSharedModuleLoader<TModule>(loadModule: () => Promise<TModule>): () => Promise<() => TModule> {\n return async () => {\n const module = await loadModule();\n return () => module;\n };\n}\n\nexport interface HostSharedModules {\n '@perses-dev/spec': unknown;\n '@perses-dev/client': unknown;\n '@perses-dev/components': unknown;\n '@perses-dev/plugin-system': unknown;\n '@perses-dev/explore': unknown;\n '@perses-dev/dashboards': unknown;\n}\n\ntype HostSharedModuleName = keyof HostSharedModules;\n\nconst hostSharedModules = new Map<HostSharedModuleName, unknown>();\n\n/*\n * Shared singletons must be provided to Module Federation *synchronously* (via `lib`) so the host's\n * copy wins singleton negotiation to avoid loader deadlocks or multiple instances.\n */\nexport function registerHostSharedModules(modules: HostSharedModules): void {\n for (const [name, module] of Object.entries(modules) as Array<[HostSharedModuleName, unknown]>) {\n hostSharedModules.set(name, module);\n }\n}\n\nfunction getHostSharedModule(name: HostSharedModuleName): unknown {\n const module = hostSharedModules.get(name);\n if (!module) {\n throw new Error(\n `Shared module \"${name}\" was not registered before a plugin tried to consume it. ` +\n `Call registerHostSharedModules() during app bootstrap.`,\n );\n }\n return module;\n}\n\nconst getPluginRuntime = (): ModuleFederation => {\n if (instance === null) {\n const pluginRuntime = createInstance({\n name: '@perses/perses-ui-host',\n remotes: [], // all remotes are loaded dynamically\n shared: {\n react: {\n version: React.version,\n lib: () => React,\n shareConfig: {\n singleton: true,\n requiredVersion: `^${React.version}`,\n },\n },\n 'react-dom': {\n version: '18.3.1',\n lib: () => ReactDOM,\n shareConfig: {\n singleton: true,\n requiredVersion: `^18.3.1`,\n },\n },\n 'react-router-dom': {\n version: '6.30.4',\n lib: () => ReactRouterDOM,\n shareConfig: {\n singleton: true,\n requiredVersion: '^6.26.0',\n },\n },\n '@tanstack/react-query': {\n version: '4.44.0',\n lib: () => ReactQuery,\n shareConfig: {\n singleton: true,\n requiredVersion: '^4.39.1',\n },\n },\n 'react-hook-form': {\n version: '7.87.0',\n lib: () => ReactHookForm,\n shareConfig: {\n singleton: true,\n requiredVersion: '^7.87.0',\n },\n },\n '@emotion/react': {\n version: '11.14.0',\n lib: () => EmotionReact,\n shareConfig: {\n singleton: true,\n requiredVersion: '^11.11.3',\n },\n },\n '@emotion/styled': {\n version: '11.14.1',\n lib: () => EmotionStyled,\n shareConfig: {\n singleton: true,\n requiredVersion: '^11.11.0',\n },\n },\n '@perses-dev/spec': {\n version: '0.3.0-beta.7',\n lib: () => getHostSharedModule('@perses-dev/spec'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.3.0-beta.7',\n },\n },\n '@perses-dev/client': {\n version: '0.55.0-beta.8',\n lib: () => getHostSharedModule('@perses-dev/client'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.55.0-beta.8',\n },\n },\n '@perses-dev/components': {\n version: '0.55.0-beta.8',\n lib: () => getHostSharedModule('@perses-dev/components'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.55.0-beta.8',\n },\n },\n '@perses-dev/plugin-system': {\n version: '0.55.0-beta.8',\n lib: () => getHostSharedModule('@perses-dev/plugin-system'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.55.0-beta.8',\n },\n },\n '@perses-dev/explore': {\n version: '0.55.0-beta.8',\n lib: () => getHostSharedModule('@perses-dev/explore'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.55.0-beta.8',\n },\n },\n '@perses-dev/dashboards': {\n version: '0.55.0-beta.8',\n lib: () => getHostSharedModule('@perses-dev/dashboards'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.55.0-beta.8',\n },\n },\n // Below are the shared modules that are used by the plugins and are loaded asynchronously on demand using get rather than lib.\n // This is to avoid loading the modules if they are not used by the plugin.\n echarts: {\n version: '5.5.0',\n get: createSharedModuleLoader(() => import('echarts')),\n shareConfig: {\n singleton: true,\n requiredVersion: '^5.5.0',\n },\n },\n 'date-fns': {\n version: '4.2.1',\n get: createSharedModuleLoader(() => import('date-fns')),\n shareConfig: {\n singleton: true,\n requiredVersion: '^4.1.0',\n },\n },\n 'date-fns-tz': {\n version: '3.2.0',\n get: createSharedModuleLoader(() => import('date-fns-tz')),\n shareConfig: {\n singleton: true,\n requiredVersion: '^3.2.0',\n },\n },\n lodash: {\n version: '4.18.1',\n get: createSharedModuleLoader(() => import('lodash')),\n shareConfig: {\n singleton: true,\n requiredVersion: '^4.17.21',\n },\n },\n '@hookform/resolvers/zod': {\n version: '5.9.1',\n get: createSharedModuleLoader(() => import('@hookform/resolvers/zod')),\n shareConfig: {\n singleton: true,\n requiredVersion: '^5.9.1',\n },\n },\n 'use-resize-observer': {\n version: '9.1.0',\n get: createSharedModuleLoader(() => import('use-resize-observer')),\n shareConfig: {\n singleton: true,\n requiredVersion: '^9.1.0',\n },\n },\n 'mdi-material-ui': {\n version: '7.9.4',\n get: createSharedModuleLoader(() => import('mdi-material-ui')),\n shareConfig: {\n singleton: true,\n requiredVersion: '^7.4.0',\n },\n },\n immer: {\n version: '10.2.0',\n get: createSharedModuleLoader(() => import('immer')),\n shareConfig: {\n singleton: true,\n requiredVersion: '^10.1.1',\n },\n },\n },\n });\n\n instance = pluginRuntime;\n\n return instance;\n }\n return instance;\n};\n\nfunction getModuleFederationRemoteName(name: string, registry?: string, version?: string): string {\n return `${name}:${registry ?? ''}:${version ?? ''}`;\n}\n\nconst registerRemote = (name: string, registry?: string, version?: string, baseURL?: string): void => {\n const pluginRuntime = getPluginRuntime();\n const registryName = getModuleFederationRemoteName(name, registry, version);\n\n const existingRemote = pluginRuntime.options.remotes.find((remote) => remote.name === registryName);\n if (!existingRemote) {\n const nameVersionRegistry = [name, version, registry].filter(Boolean).join('~');\n const prefix = baseURL || '/plugins';\n const remoteEntryURL = `${prefix}/${nameVersionRegistry}/mf-manifest.json`;\n\n pluginRuntime.registerRemotes([\n {\n name: registryName,\n entry: remoteEntryURL,\n alias: registryName,\n },\n ]);\n }\n};\n\nexport const loadPlugin = async (target: {\n moduleName: string;\n pluginName: string;\n registry?: string;\n version?: string;\n baseURL?: string;\n}): Promise<RemotePluginModule | null> => {\n const { moduleName, pluginName, registry, version, baseURL } = target;\n registerRemote(moduleName, registry, version, baseURL);\n\n const pluginRuntime = getPluginRuntime();\n const registryName = getModuleFederationRemoteName(moduleName, registry, version);\n return pluginRuntime.loadRemote<RemotePluginModule>(`${registryName}/${pluginName}`);\n};\n\nexport function usePluginRuntime({ plugin }: { plugin: PersesPlugin }): {\n pluginRuntime: ModuleFederation;\n loadPlugin: () => Promise<RemotePluginModule | null>;\n} {\n return {\n pluginRuntime: getPluginRuntime(),\n loadPlugin: (): Promise<RemotePluginModule | null> => {\n const { moduleName, name: pluginName, registry, version, baseURL } = plugin;\n return loadPlugin({ moduleName, pluginName, registry, version, baseURL });\n },\n };\n}\n"],"names":["EmotionReact","EmotionStyled","createInstance","ReactQuery","React","ReactDOM","ReactHookForm","ReactRouterDOM","instance","createSharedModuleLoader","loadModule","module","hostSharedModules","Map","registerHostSharedModules","modules","name","Object","entries","set","getHostSharedModule","get","Error","getPluginRuntime","pluginRuntime","remotes","shared","react","version","lib","shareConfig","singleton","requiredVersion","echarts","lodash","immer","getModuleFederationRemoteName","registry","registerRemote","baseURL","registryName","existingRemote","options","find","remote","nameVersionRegistry","filter","Boolean","join","prefix","remoteEntryURL","registerRemotes","entry","alias","loadPlugin","target","moduleName","pluginName","loadRemote","usePluginRuntime","plugin"],"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;AAEjC,YAAYA,kBAAkB,iBAAiB;AAC/C,YAAYC,mBAAmB,kBAAkB;AAEjD,SAASC,cAAc,QAAQ,sCAAsC;AACrE,YAAYC,gBAAgB,wBAAwB;AACpD,OAAOC,WAAW,QAAQ;AAC1B,OAAOC,cAAc,YAAY;AACjC,YAAYC,mBAAmB,kBAAkB;AACjD,YAAYC,oBAAoB,mBAAmB;AAInD,IAAIC,WAAoC;AAExC,SAASC,yBAAkCC,UAAkC;IAC3E,OAAO;QACL,MAAMC,SAAS,MAAMD;QACrB,OAAO,IAAMC;IACf;AACF;AAaA,MAAMC,oBAAoB,IAAIC;AAE9B;;;CAGC,GACD,OAAO,SAASC,0BAA0BC,OAA0B;IAClE,KAAK,MAAM,CAACC,MAAML,OAAO,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mB,mDAAqD,CAAC;AAEtF,eAAO,MAAM,sBAAsB,QAAO,YAAY,GAAG,SAExD,CAAC;AAEF,eAAO,MAAM,eAAe,QAAO,sBA6BlC,CAAC;AAiBF,eAAO,MAAM,oBAAoB,gDAAiD,iBAAiB,KAAG,YAerG,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"time-series-queries.d.ts","sourceRoot":"","sources":["../../src/runtime/time-series-queries.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,cAAc,EAAE,yBAAyB,EAAe,MAAM,kBAAkB,CAAC;AAC/F,OAAO,KAAK,EAAS,UAAU,EAAY,oBAAoB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAG/G,OAAO,KAAK,EAAE,mBAAmB,EAA0B,mBAAmB,EAAyB,MAAM,UAAU,CAAC;AAOxH,MAAM,WAAW,yBAAyB;IACxC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,IAAI,CAAC,EAAE,mBAAmB,CAAC;CAC5B;AAED,eAAO,MAAM,qBAAqB,oBAAoB,CAAC;AA+CvD;;GAEG;AACH,eAAO,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"time-series-queries.d.ts","sourceRoot":"","sources":["../../src/runtime/time-series-queries.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,cAAc,EAAE,yBAAyB,EAAe,MAAM,kBAAkB,CAAC;AAC/F,OAAO,KAAK,EAAS,UAAU,EAAY,oBAAoB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAG/G,OAAO,KAAK,EAAE,mBAAmB,EAA0B,mBAAmB,EAAyB,MAAM,UAAU,CAAC;AAOxH,MAAM,WAAW,yBAAyB;IACxC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,IAAI,CAAC,EAAE,mBAAmB,CAAC;CAC5B;AAED,eAAO,MAAM,qBAAqB,oBAAoB,CAAC;AA+CvD;;GAEG;AACH,eAAO,MAAM,kBAAkB,eACjB,yBAAyB,YAC3B,yBAAyB,iBACpB,oBAAoB,CAAC,cAAc,CAAC,KAClD,cAAc,CAAC,cAAc,CAiB/B,CAAC;AAEF;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,yBAAyB,EAAE,EACxC,OAAO,CAAC,EAAE,yBAAyB,EACnC,YAAY,CAAC,EAAE,IAAI,CAAC,oBAAoB,EAAE,UAAU,CAAC,GACpD,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC,CAgCvC;AAiBD;;GAEG;AACH,wBAAgB,0BAA0B,IAAI,mBAAmB,EAAE,CAIlE;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,UAAU,GAAG,mBAAmB,EAAE,CAWnF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"variables.d.ts","sourceRoot":"","sources":["../../src/runtime/variables.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE9F,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMlC,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,gBAAgB,EAAE,CAAC;AAEhE;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;GAEG;AACH,qBAAa,qBAAqB;IAChC;;;OAGG;IACH,CAAC,SAAS,CAAC,UAAQ;IAEnB,OAAO,CAAC,QAAQ,CAAC,yBAAyB,CAAM;IAChD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAqD;IAE5E;;;OAGG;IACH,GAAG,CAAC,GAAG,EAAE,gBAAgB,GAAG,aAAa,GAAG,SAAS;
|
|
1
|
+
{"version":3,"file":"variables.d.ts","sourceRoot":"","sources":["../../src/runtime/variables.ts"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AAM,EACZ,cAAc,EAAE,gBAAgB,EAChC,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACtC,MAAM,CAMR;AAGD,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAKvF"}
|
package/dist/schema/panel.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { PluginSchema } from '@perses-dev/spec';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import type { PanelEditorValues } from '../model';
|
|
4
|
-
export declare const panelEditorSchema: z.
|
|
5
|
-
export declare function buildPanelEditorSchema(pluginSchema: PluginSchema): z.
|
|
4
|
+
export declare const panelEditorSchema: z.ZodType<PanelEditorValues, PanelEditorValues>;
|
|
5
|
+
export declare function buildPanelEditorSchema(pluginSchema: PluginSchema): z.ZodType<PanelEditorValues, PanelEditorValues>;
|
|
6
6
|
//# sourceMappingURL=panel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panel.d.ts","sourceRoot":"","sources":["../../src/schema/panel.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAgBlD,eAAO,MAAM,iBAAiB,EAAE,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"panel.d.ts","sourceRoot":"","sources":["../../src/schema/panel.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAgBlD,eAAO,MAAM,iBAAiB,EAAE,CAAC,CAAC,OAAO,CAAC,iBAAiB,EAAE,iBAAiB,CAI5E,CAAC;AAEH,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,YAAY,GAAG,CAAC,CAAC,OAAO,CAAC,iBAAiB,EAAE,iBAAiB,CAAC,CAMlH"}
|
package/dist/schema/panel.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/schema/panel.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 type { PluginSchema } from '@perses-dev/spec';\nimport { panelDefinitionSchema, buildPanelDefinitionSchema } from '@perses-dev/spec';\nimport { z } from 'zod';\n\nimport type { PanelEditorValues } from '../model';\n\nconst layoutDefinitionSchema = z\n .object({\n width: z.number(),\n height: z.number(),\n repeatVariable: z\n .object({\n value: z.string(),\n maxPer: z.number().min(1).max(12).optional(),\n alignment: z.enum(['horizontal', 'vertical']).optional(),\n })\n .optional(),\n })\n .optional();\n\nexport const panelEditorSchema: z.
|
|
1
|
+
{"version":3,"sources":["../../src/schema/panel.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 type { PluginSchema } from '@perses-dev/spec';\nimport { panelDefinitionSchema, buildPanelDefinitionSchema } from '@perses-dev/spec';\nimport { z } from 'zod';\n\nimport type { PanelEditorValues } from '../model';\n\nconst layoutDefinitionSchema = z\n .object({\n width: z.number(),\n height: z.number(),\n repeatVariable: z\n .object({\n value: z.string(),\n maxPer: z.number().min(1).max(12).optional(),\n alignment: z.enum(['horizontal', 'vertical']).optional(),\n })\n .optional(),\n })\n .optional();\n\nexport const panelEditorSchema: z.ZodType<PanelEditorValues, PanelEditorValues> = z.object({\n groupId: z.number(),\n panelDefinition: panelDefinitionSchema,\n layoutDefinition: layoutDefinitionSchema,\n});\n\nexport function buildPanelEditorSchema(pluginSchema: PluginSchema): z.ZodType<PanelEditorValues, PanelEditorValues> {\n return z.object({\n groupId: z.number(),\n panelDefinition: buildPanelDefinitionSchema(pluginSchema),\n layoutDefinition: layoutDefinitionSchema,\n });\n}\n"],"names":["panelDefinitionSchema","buildPanelDefinitionSchema","z","layoutDefinitionSchema","object","width","number","height","repeatVariable","value","string","maxPer","min","max","optional","alignment","enum","panelEditorSchema","groupId","panelDefinition","layoutDefinition","buildPanelEditorSchema","pluginSchema"],"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;AAGjC,SAASA,qBAAqB,EAAEC,0BAA0B,QAAQ,mBAAmB;AACrF,SAASC,CAAC,QAAQ,MAAM;AAIxB,MAAMC,yBAAyBD,EAC5BE,MAAM,CAAC;IACNC,OAAOH,EAAEI,MAAM;IACfC,QAAQL,EAAEI,MAAM;IAChBE,gBAAgBN,EACbE,MAAM,CAAC;QACNK,OAAOP,EAAEQ,MAAM;QACfC,QAAQT,EAAEI,MAAM,GAAGM,GAAG,CAAC,GAAGC,GAAG,CAAC,IAAIC,QAAQ;QAC1CC,WAAWb,EAAEc,IAAI,CAAC;YAAC;YAAc;SAAW,EAAEF,QAAQ;IACxD,GACCA,QAAQ;AACb,GACCA,QAAQ;AAEX,OAAO,MAAMG,oBAAqEf,EAAEE,MAAM,CAAC;IACzFc,SAAShB,EAAEI,MAAM;IACjBa,iBAAiBnB;IACjBoB,kBAAkBjB;AACpB,GAAG;AAEH,OAAO,SAASkB,uBAAuBC,YAA0B;IAC/D,OAAOpB,EAAEE,MAAM,CAAC;QACdc,SAAShB,EAAEI,MAAM;QACjBa,iBAAiBlB,2BAA2BqB;QAC5CF,kBAAkBjB;IACpB;AACF"}
|
package/dist/test/mock-data.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export declare const MOCK_ALERTS_DATA: AlertsData;
|
|
|
7
7
|
export declare const MOCK_SILENCES_DATA: SilencesData;
|
|
8
8
|
export declare const MOCK_JSON_DATA: JsonData;
|
|
9
9
|
export declare const MOCK_VALID_PLUGIN_METADATA: {
|
|
10
|
-
kind:
|
|
10
|
+
kind: 'Panel';
|
|
11
11
|
spec: {
|
|
12
12
|
name: string;
|
|
13
13
|
display: {
|
|
@@ -17,14 +17,14 @@ export declare const MOCK_VALID_PLUGIN_METADATA: {
|
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
19
|
export declare const MOCK_VALID_PLUGIN_MODULE_RESOURCE: {
|
|
20
|
-
kind:
|
|
20
|
+
kind: 'PluginModule';
|
|
21
21
|
metadata: {
|
|
22
22
|
name: string;
|
|
23
23
|
version: string;
|
|
24
24
|
};
|
|
25
25
|
spec: {
|
|
26
26
|
plugins: {
|
|
27
|
-
kind:
|
|
27
|
+
kind: 'Panel';
|
|
28
28
|
spec: {
|
|
29
29
|
name: string;
|
|
30
30
|
display: {
|
|
@@ -55,14 +55,14 @@ export declare const MOCK_MIXED_VALIDITY_PLUGIN_MODULES: ({
|
|
|
55
55
|
}[];
|
|
56
56
|
};
|
|
57
57
|
} | {
|
|
58
|
-
kind:
|
|
58
|
+
kind: 'PluginModule';
|
|
59
59
|
metadata: {
|
|
60
60
|
name: string;
|
|
61
61
|
version: string;
|
|
62
62
|
};
|
|
63
63
|
spec: {
|
|
64
64
|
plugins: {
|
|
65
|
-
kind:
|
|
65
|
+
kind: 'Variable';
|
|
66
66
|
spec: {
|
|
67
67
|
name: string;
|
|
68
68
|
display: {
|
|
@@ -79,14 +79,14 @@ export declare const MOCK_REMOTE_PLUGIN_MODULE: {
|
|
|
79
79
|
};
|
|
80
80
|
};
|
|
81
81
|
export declare const MOCK_MULTI_PLUGIN_MODULE: {
|
|
82
|
-
kind:
|
|
82
|
+
kind: 'PluginModule';
|
|
83
83
|
metadata: {
|
|
84
84
|
name: string;
|
|
85
85
|
version: string;
|
|
86
86
|
};
|
|
87
87
|
spec: {
|
|
88
88
|
plugins: ({
|
|
89
|
-
kind:
|
|
89
|
+
kind: 'Panel';
|
|
90
90
|
spec: {
|
|
91
91
|
name: string;
|
|
92
92
|
display: {
|
|
@@ -94,7 +94,7 @@ export declare const MOCK_MULTI_PLUGIN_MODULE: {
|
|
|
94
94
|
};
|
|
95
95
|
};
|
|
96
96
|
} | {
|
|
97
|
-
kind:
|
|
97
|
+
kind: 'Variable';
|
|
98
98
|
spec: {
|
|
99
99
|
name: string;
|
|
100
100
|
display: {
|
|
@@ -105,14 +105,14 @@ export declare const MOCK_MULTI_PLUGIN_MODULE: {
|
|
|
105
105
|
};
|
|
106
106
|
};
|
|
107
107
|
export declare const MOCK_PARTIAL_FAILURE_MODULE: {
|
|
108
|
-
kind:
|
|
108
|
+
kind: 'PluginModule';
|
|
109
109
|
metadata: {
|
|
110
110
|
name: string;
|
|
111
111
|
version: string;
|
|
112
112
|
};
|
|
113
113
|
spec: {
|
|
114
114
|
plugins: ({
|
|
115
|
-
kind:
|
|
115
|
+
kind: 'Panel';
|
|
116
116
|
spec: {
|
|
117
117
|
name: string;
|
|
118
118
|
display: {
|
|
@@ -120,7 +120,7 @@ export declare const MOCK_PARTIAL_FAILURE_MODULE: {
|
|
|
120
120
|
};
|
|
121
121
|
};
|
|
122
122
|
} | {
|
|
123
|
-
kind:
|
|
123
|
+
kind: 'Variable';
|
|
124
124
|
spec: {
|
|
125
125
|
name: string;
|
|
126
126
|
display: {
|
|
@@ -131,7 +131,7 @@ export declare const MOCK_PARTIAL_FAILURE_MODULE: {
|
|
|
131
131
|
};
|
|
132
132
|
};
|
|
133
133
|
export declare const MOCK_EMPTY_PLUGIN_MODULE: {
|
|
134
|
-
kind:
|
|
134
|
+
kind: 'PluginModule';
|
|
135
135
|
metadata: {
|
|
136
136
|
name: string;
|
|
137
137
|
version: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mock-data.d.ts","sourceRoot":"","sources":["../../src/test/mock-data.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACV,UAAU,EACV,QAAQ,EACR,OAAO,EACP,WAAW,EACX,YAAY,EACZ,cAAc,EACd,SAAS,EACV,MAAM,kBAAkB,CAAC;AAE1B,eAAO,MAAM,qBAAqB,EAAE,cAsBnC,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,SAmC7B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,OAoB3B,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,WAmB/B,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,UAqB9B,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,YAoBhC,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,QAK5B,CAAC;AAGF,eAAO,MAAM,0BAA0B
|
|
1
|
+
{"version":3,"file":"mock-data.d.ts","sourceRoot":"","sources":["../../src/test/mock-data.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACV,UAAU,EACV,QAAQ,EACR,OAAO,EACP,WAAW,EACX,YAAY,EACZ,cAAc,EACd,SAAS,EACV,MAAM,kBAAkB,CAAC;AAE1B,eAAO,MAAM,qBAAqB,EAAE,cAsBnC,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,SAmC7B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,OAoB3B,CAAC;AAEF,eAAO,MAAM,iBAAiB,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,eAAO,MAAM,wBAAwB;IACnC,IAAI,EAAE,cAAc;IACpB,QAAQ;QACN,IAAI;QACJ,OAAO;;IAET,IAAI;QACF,OAAO;;CAEV,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/test/test-plugins/bert/index.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAsB,WAAW,EAAE,MAAM,gBAAgB,CAAC;AA4DtE,eAAO,MAAM,OAAO
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/test/test-plugins/bert/index.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAsB,WAAW,EAAE,MAAM,gBAAgB,CAAC;AA4DtE,eAAO,MAAM,OAAO;IAClB,yBAAyB;iBA5Cc,MAAM;;;;IA6C7C,yBAAyB;iBApBc,MAAM;;;;CAqB9C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/test/test-plugins/ernie/index.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,qBAAqB,EAAE,gBAAgB,EAAkB,cAAc,EAAE,MAAM,gBAAgB,CAAC;AA4C9G,KAAK,mBAAmB,GAAG;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAiD5C,eAAO,MAAM,OAAO
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/test/test-plugins/ernie/index.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,qBAAqB,EAAE,gBAAgB,EAAkB,cAAc,EAAE,MAAM,gBAAgB,CAAC;AA4C9G,KAAK,mBAAmB,GAAG;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAiD5C,eAAO,MAAM,OAAO;IAClB,gCAAgC;wBAtFqB,MAAM;;IAuF3D,gCAAgC;yBArEsB,MAAM;;IAsE5D,mCAAmC;IACnC,gDAAgD;CACjD,CAAC"}
|
package/dist/test/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/test/utils.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAInD,MAAM,MAAM,cAAc,GAAG;IAC3B,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;CACzC,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,cAAc,CAAC,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/test/utils.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAInD,MAAM,MAAM,cAAc,GAAG;IAC3B,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;CACzC,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,cAAc,CAAC,EAAE,cAAc,kBAQ7B;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,KAAG,SAAS,CAkB1E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"csv-export.d.ts","sourceRoot":"","sources":["../../src/utils/csv-export.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB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ACF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,eAAO,MAAM,gBAAgB,SAAU,OAAO,KAAG,IAAI,IAAI,cAQxD,CAAC;AAEF,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,eAAO,MAAM,qBAAqB,iBAAkB,cAAc,EAAE,KAAG,cAAc,GAAG,SAoCvF,CAAC;AAEF,eAAO,MAAM,gBAAgB,WAAY,UAAU,eAAe,MAAM,KAAG,MA0C1E,CAAC;AAEF,eAAO,MAAM,kBAAkB,SAAU,MAAM,KAAG,MAOjD,CAAC;AAEF,eAAO,MAAM,gBAAgB,aAAc,MAAM,KAAG,MAanD,CAAC;AAEF,eAAO,MAAM,kBAAkB,cAAe,MAAM,GAAG,MAAM,KAAG,MAmB/D,CAAC;AAEF,eAAO,MAAM,cAAc,UAAW,OAAO,KAAG,MAiB/C,CAAC;AAEF,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,cAAc,CAAC;CACtB;AAED,eAAO,MAAM,eAAe,aAAc,iBAAiB,KAAG,IAsG7D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@perses-dev/plugin-system",
|
|
3
|
-
"version": "0.55.0-beta.
|
|
3
|
+
"version": "0.55.0-beta.8",
|
|
4
4
|
"description": "The plugin feature in Pereses",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/perses/perses/blob/main/README.md",
|
|
@@ -30,21 +30,21 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@module-federation/enhanced": "^2.8.0",
|
|
33
|
-
"@perses-dev/client": "0.55.0-beta.
|
|
34
|
-
"@perses-dev/components": "0.55.0-beta.
|
|
35
|
-
"@perses-dev/spec": "0.3.0-beta.
|
|
33
|
+
"@perses-dev/client": "0.55.0-beta.8",
|
|
34
|
+
"@perses-dev/components": "0.55.0-beta.8",
|
|
35
|
+
"@perses-dev/spec": "0.3.0-beta.7",
|
|
36
36
|
"date-fns": "^4.1.0",
|
|
37
37
|
"date-fns-tz": "^3.2.0",
|
|
38
38
|
"immer": "^10.1.1",
|
|
39
|
-
"react-hook-form": "^7.
|
|
39
|
+
"react-hook-form": "^7.87.0",
|
|
40
40
|
"semver": "^7.8.0",
|
|
41
41
|
"use-query-params": "^2.2.1",
|
|
42
|
-
"zod": "^
|
|
42
|
+
"zod": "^4.5.4"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"@emotion/react": "^11.14.0",
|
|
46
46
|
"@emotion/styled": "^11.14.1",
|
|
47
|
-
"@hookform/resolvers": "^
|
|
47
|
+
"@hookform/resolvers": "^5.9.1",
|
|
48
48
|
"@mui/material": "^6.1.10",
|
|
49
49
|
"@tanstack/react-query": "^4.39.1",
|
|
50
50
|
"react": "^18.3.0",
|