@perses-dev/plugin-system 0.55.0-beta.6 → 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.
Files changed (64) hide show
  1. package/dist/components/DatasourceSelect/DatasourceSelect.d.ts.map +1 -1
  2. package/dist/components/DatasourceTestConnectionButton/DatasourceTestConnectionButton.d.ts.map +1 -1
  3. package/dist/components/HTTPSettingsEditor/HTTPHeaderPolicyEditor.d.ts +10 -0
  4. package/dist/components/HTTPSettingsEditor/HTTPHeaderPolicyEditor.d.ts.map +1 -0
  5. package/dist/components/HTTPSettingsEditor/HTTPHeaderPolicyEditor.js +99 -0
  6. package/dist/components/HTTPSettingsEditor/HTTPHeaderPolicyEditor.js.map +1 -0
  7. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts +1 -0
  8. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.d.ts.map +1 -1
  9. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js +50 -25
  10. package/dist/components/HTTPSettingsEditor/HTTPSettingsEditor.js.map +1 -1
  11. package/dist/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.js +4 -4
  12. package/dist/components/ItemSelectionActionsOptionsEditor/ItemSelectionActionsOptionsEditor.js.map +1 -1
  13. package/dist/components/OptionsEditorRadios/OptionsEditorRadios.d.ts.map +1 -1
  14. package/dist/components/OptionsEditorTabs/OptionsEditorTabs.d.ts.map +1 -1
  15. package/dist/components/PluginKindSelect/PluginKindSelect.js +2 -2
  16. package/dist/components/PluginKindSelect/PluginKindSelect.js.map +1 -1
  17. package/dist/components/PluginRegistry/getPluginSearchHelper.d.ts.map +1 -1
  18. package/dist/components/TimeRangeControls/TimeRangeControls.d.ts +2 -2
  19. package/dist/components/TimeRangeControls/TimeRangeControls.d.ts.map +1 -1
  20. package/dist/components/TimeRangeControls/TimeRangeControls.js +7 -43
  21. package/dist/components/TimeRangeControls/TimeRangeControls.js.map +1 -1
  22. package/dist/components/Variables/VariableEditorForm/VariablePreview.d.ts.map +1 -1
  23. package/dist/components/Variables/VariableEditorForm/VariablePreview.js +1 -0
  24. package/dist/components/Variables/VariableEditorForm/VariablePreview.js.map +1 -1
  25. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js +6 -6
  26. package/dist/components/Variables/VariableEditorForm/variable-editor-form-model.js.map +1 -1
  27. package/dist/components/Variables/variable-model.d.ts +4 -4
  28. package/dist/components/Variables/variable-model.d.ts.map +1 -1
  29. package/dist/constants/repeat.d.ts +1 -1
  30. package/dist/constants/user-interface-text.d.ts.map +1 -1
  31. package/dist/context/ValidationProvider.d.ts +4 -4
  32. package/dist/context/ValidationProvider.d.ts.map +1 -1
  33. package/dist/context/ValidationProvider.js +1 -1
  34. package/dist/context/ValidationProvider.js.map +1 -1
  35. package/dist/model/calculations.d.ts.map +1 -1
  36. package/dist/model/legend.d.ts +1 -1
  37. package/dist/remote/PluginRuntime.d.ts +9 -0
  38. package/dist/remote/PluginRuntime.d.ts.map +1 -1
  39. package/dist/remote/PluginRuntime.js +81 -68
  40. package/dist/remote/PluginRuntime.js.map +1 -1
  41. package/dist/remote/index.d.ts +1 -0
  42. package/dist/remote/index.d.ts.map +1 -1
  43. package/dist/remote/index.js +1 -0
  44. package/dist/remote/index.js.map +1 -1
  45. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.d.ts +4 -0
  46. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.d.ts.map +1 -1
  47. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js +49 -1
  48. package/dist/runtime/TimeRangeProvider/TimeRangeSettingsProvider.js.map +1 -1
  49. package/dist/runtime/TimeRangeProvider/query-params.d.ts.map +1 -1
  50. package/dist/runtime/UsageMetricsProvider.d.ts.map +1 -1
  51. package/dist/runtime/time-series-queries.d.ts.map +1 -1
  52. package/dist/runtime/variables.d.ts.map +1 -1
  53. package/dist/schema/panel.d.ts +2 -2
  54. package/dist/schema/panel.d.ts.map +1 -1
  55. package/dist/schema/panel.js.map +1 -1
  56. package/dist/test/mock-data.d.ts +12 -12
  57. package/dist/test/mock-data.d.ts.map +1 -1
  58. package/dist/test/test-plugins/bert/index.d.ts.map +1 -1
  59. package/dist/test/test-plugins/ernie/index.d.ts.map +1 -1
  60. package/dist/test/utils.d.ts.map +1 -1
  61. package/dist/utils/csv-export.d.ts.map +1 -1
  62. package/dist/utils/csv-export.js +1 -1
  63. package/dist/utils/csv-export.js.map +1 -1
  64. package/package.json +9 -9
@@ -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\n/* eslint-disable @typescript-eslint/no-require-imports */\n// 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\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 echarts: {\n version: '5.5.0',\n lib: () => require('echarts'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^5.5.0',\n },\n },\n '@perses-dev/spec': {\n version: '0.3.0-beta.5',\n lib: () => require('@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.6',\n lib: () => require('@perses-dev/client'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.55.0-beta.6',\n },\n },\n '@perses-dev/components': {\n version: '0.55.0-beta.6',\n lib: () => require('@perses-dev/components'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.55.0-beta.6',\n },\n },\n '@perses-dev/plugin-system': {\n version: '0.55.0-beta.6',\n lib: () => require('@perses-dev/plugin-system'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.55.0-beta.6',\n },\n },\n '@perses-dev/explore': {\n version: '0.55.0-beta.6',\n lib: () => require('@perses-dev/explore'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.55.0-beta.6',\n },\n },\n '@perses-dev/dashboards': {\n version: '0.55.0-beta.6',\n lib: () => require('@perses-dev/dashboards'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^0.55.0-beta.6',\n },\n },\n // Below are the shared modules that are used by the plugins, this can be part of the SDK\n 'date-fns': {\n version: '4.1.0',\n lib: () => require('date-fns'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^4.1.0',\n },\n },\n 'date-fns-tz': {\n version: '3.2.0',\n lib: () => require('date-fns-tz'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^3.2.0',\n },\n },\n lodash: {\n version: '4.17.21',\n lib: () => require('lodash'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^4.17.21',\n },\n },\n '@emotion/react': {\n version: '11.11.3',\n lib: () => require('@emotion/react'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^11.11.3',\n },\n },\n '@emotion/styled': {\n version: '11.11.0',\n lib: () => require('@emotion/styled'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^11.11.0',\n },\n },\n '@hookform/resolvers/zod': {\n version: '3.3.4',\n lib: () => require('@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 lib: () => require('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 lib: () => require('mdi-material-ui'),\n shareConfig: {\n singleton: true,\n requiredVersion: '^7.4.0',\n },\n },\n immer: {\n version: '10.1.1',\n lib: () => require('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","getPluginRuntime","pluginRuntime","name","remotes","shared","react","version","lib","shareConfig","singleton","requiredVersion","echarts","require","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,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,sEAAsE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OAAOF;gBACPG,OAAOb;YACT;SACD;IACH;AACF;AAEA,OAAO,MAAMc,aAAa,OAAOC;IAO/B,MAAM,EAAEC,UAAU,EAAEC,UAAU,EAAEpB,QAAQ,EAAEV,OAAO,EAAEY,OAAO,EAAE,GAAGgB;IAC/DjB,eAAekB,YAAYnB,UAAUV,SAASY;IAE9C,MAAMjB,gBAAgBD;IACtB,MAAMmB,eAAeJ,8BAA8BoB,YAAYnB,UAAUV;IACzE,OAAOL,cAAcoC,UAAU,CAAqB,GAAGlB,aAAa,CAAC,EAAEiB,YAAY;AACrF,EAAE;AAEF,OAAO,SAASE,iBAAiB,EAAEC,MAAM,EAA4B;IAInE,OAAO;QACLtC,eAAeD;QACfiC,YAAY;YACV,MAAM,EAAEE,UAAU,EAAEjC,MAAMkC,UAAU,EAAEpB,QAAQ,EAAEV,OAAO,EAAEY,OAAO,EAAE,GAAGqB;YACrE,OAAON,WAAW;gBAAEE;gBAAYC;gBAAYpB;gBAAUV;gBAASY;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,YAA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,SAAWA,OAAO5B,IAAI,KAAKwB;IACtF,IAAI,CAACC,gBAAgB;QACnB,MAAMI,sBAAsB;YAAC7B;YAAMY;YAASS;SAAS,CAACS,MAAM,CAACC,SAASC,IAAI,CAAC;QAC3E,MAAMC,SAASV,WAAW;QAC1B,MAAMW,iBAAiB,GAAGD,OAAO,CAAC,EAAEJ,oBAAoB,iBAAiB,CAAC;QAE1ErB,cAAc2B,eAAe,CAAC;YAC5B;gBACEnC,MAAMwB;gBACNY,OAAOF;gBACPG,OAAOb;YACT;SACD;IACH;AACF;AAEA,OAAO,MAAMc,aAAa,OAAOC;IAO/B,MAAM,EAAEC,UAAU,EAAEC,UAAU,EAAEpB,QAAQ,EAAET,OAAO,EAAEW,OAAO,EAAE,GAAGgB;IAC/DjB,eAAekB,YAAYnB,UAAUT,SAASW;IAE9C,MAAMf,gBAAgBD;IACtB,MAAMiB,eAAeJ,8BAA8BoB,YAAYnB,UAAUT;IACzE,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,3 +1,4 @@
1
1
  export * from './PluginLoaderComponent';
2
2
  export * from './remotePluginLoader';
3
+ export * from './PluginRuntime';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/remote/index.ts"],"names":[],"mappings":"AAaA,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/remote/index.ts"],"names":[],"mappings":"AAaA,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,iBAAiB,CAAC"}
@@ -12,5 +12,6 @@
12
12
  // limitations under the License.
13
13
  export * from "./PluginLoaderComponent.js";
14
14
  export * from "./remotePluginLoader.js";
15
+ export * from "./PluginRuntime.js";
15
16
 
16
17
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/remote/index.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\nexport * from './PluginLoaderComponent';\nexport * from './remotePluginLoader';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,6BAA0B;AACxC,cAAc,0BAAuB"}
1
+ {"version":3,"sources":["../../src/remote/index.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\nexport * from './PluginLoaderComponent';\nexport * from './remotePluginLoader';\nexport * from './PluginRuntime';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,6BAA0B;AACxC,cAAc,0BAAuB;AACrC,cAAc,qBAAkB"}
@@ -1,9 +1,11 @@
1
1
  import type { TimeOption } from '@perses-dev/components';
2
2
  import type { ReactElement, ReactNode } from 'react';
3
+ export declare const DEFAULT_REFRESH_INTERVAL_OPTIONS: TimeOption[];
3
4
  export interface TimeRangeSettingsProviderProps {
4
5
  showCustom?: boolean;
5
6
  showZoomButtons?: boolean;
6
7
  disableAutoRefresh?: boolean;
8
+ autoRefreshIntervalOptions?: TimeOption[];
7
9
  options?: TimeOption[];
8
10
  children: ReactNode;
9
11
  }
@@ -11,6 +13,7 @@ export interface TimeRangeSettings {
11
13
  showCustom: boolean;
12
14
  showZoomButtons: boolean;
13
15
  disableAutoRefresh: boolean;
16
+ autoRefreshIntervalOptions: TimeOption[];
14
17
  options: TimeOption[];
15
18
  }
16
19
  export declare const TimeRangeSettingsContext: import("react").Context<TimeRangeSettings>;
@@ -39,6 +42,7 @@ export declare function useTimeRangeOptionsSetting(override?: TimeOption[]): Tim
39
42
  * @param override If set, the value of the provider will be overridden by this value.
40
43
  */
41
44
  export declare function useDisableAutoRefreshSetting(override?: boolean): boolean;
45
+ export declare function useAutoRefreshIntervalsOptions(override?: TimeOption[]): TimeOption[];
42
46
  /**
43
47
  * Provider implementation that supplies the time range state at runtime.
44
48
  */
@@ -1 +1 @@
1
- {"version":3,"file":"TimeRangeSettingsProvider.d.ts","sourceRoot":"","sources":["../../../src/runtime/TimeRangeProvider/TimeRangeSettingsProvider.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGzD,OAAO,KAAK,EAAE,Y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d',
25
25
  '14d'
26
26
  ];
27
+ export const DEFAULT_REFRESH_INTERVAL_OPTIONS = [
28
+ {
29
+ value: {
30
+ pastDuration: '0s'
31
+ },
32
+ display: 'Off'
33
+ },
34
+ {
35
+ value: {
36
+ pastDuration: '5s'
37
+ },
38
+ display: '5s'
39
+ },
40
+ {
41
+ value: {
42
+ pastDuration: '10s'
43
+ },
44
+ display: '10s'
45
+ },
46
+ {
47
+ value: {
48
+ pastDuration: '15s'
49
+ },
50
+ display: '15s'
51
+ },
52
+ {
53
+ value: {
54
+ pastDuration: '30s'
55
+ },
56
+ display: '30s'
57
+ },
58
+ {
59
+ value: {
60
+ pastDuration: '60s'
61
+ },
62
+ display: '1m'
63
+ }
64
+ ];
27
65
  const defaultTimeRangeSettings = {
28
66
  showCustom: true,
29
67
  showZoomButtons: true,
30
68
  disableAutoRefresh: false,
69
+ autoRefreshIntervalOptions: DEFAULT_REFRESH_INTERVAL_OPTIONS,
31
70
  options: DEFAULT_OPTIONS.map((duration)=>buildRelativeTimeOption(duration))
32
71
  };
33
72
  export const TimeRangeSettingsContext = /*#__PURE__*/ createContext(defaultTimeRangeSettings);
@@ -83,6 +122,13 @@ export function useTimeRangeSettingsContext() {
83
122
  }
84
123
  return disableAutoRefresh;
85
124
  }
125
+ export function useAutoRefreshIntervalsOptions(override) {
126
+ const { autoRefreshIntervalOptions } = useTimeRangeSettings();
127
+ if (override?.length) {
128
+ return override;
129
+ }
130
+ return autoRefreshIntervalOptions;
131
+ }
86
132
  /**
87
133
  * Provider implementation that supplies the time range state at runtime.
88
134
  */ export function TimeRangeSettingsProvider(props) {
@@ -91,13 +137,15 @@ export function useTimeRangeSettingsContext() {
91
137
  showCustom: props.showCustom === undefined ? defaultTimeRangeSettings.showCustom : props.showCustom,
92
138
  showZoomButtons: props.showZoomButtons === undefined ? defaultTimeRangeSettings.showZoomButtons : props.showZoomButtons,
93
139
  disableAutoRefresh: props.disableAutoRefresh === undefined ? defaultTimeRangeSettings.disableAutoRefresh : props.disableAutoRefresh,
140
+ autoRefreshIntervalOptions: !props.autoRefreshIntervalOptions?.length ? defaultTimeRangeSettings.autoRefreshIntervalOptions : props.autoRefreshIntervalOptions,
94
141
  options: props.options === undefined ? defaultTimeRangeSettings.options : props.options
95
142
  };
96
143
  }, [
97
144
  props.showCustom,
98
145
  props.showZoomButtons,
99
146
  props.disableAutoRefresh,
100
- props.options
147
+ props.options,
148
+ props.autoRefreshIntervalOptions
101
149
  ]);
102
150
  return /*#__PURE__*/ _jsx(TimeRangeSettingsContext.Provider, {
103
151
  value: ctx,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/runtime/TimeRangeProvider/TimeRangeSettingsProvider.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 { TimeOption } from '@perses-dev/components';\nimport { buildRelativeTimeOption } from '@perses-dev/components';\nimport type { DurationString } from '@perses-dev/spec';\nimport type { ReactElement, ReactNode } from 'react';\nimport { createContext, useContext, useMemo } from 'react';\n\nconst DEFAULT_OPTIONS: DurationString[] = ['5m', '15m', '30m', '1h', '6h', '12h', '24h', '7d', '14d'];\nconst defaultTimeRangeSettings: TimeRangeSettings = {\n showCustom: true,\n showZoomButtons: true,\n disableAutoRefresh: false,\n options: DEFAULT_OPTIONS.map((duration) => buildRelativeTimeOption(duration)),\n};\n\nexport interface TimeRangeSettingsProviderProps {\n showCustom?: boolean;\n showZoomButtons?: boolean;\n disableAutoRefresh?: boolean;\n options?: TimeOption[];\n children: ReactNode;\n}\n\nexport interface TimeRangeSettings {\n showCustom: boolean;\n showZoomButtons: boolean;\n disableAutoRefresh: boolean;\n options: TimeOption[];\n}\n\nexport const TimeRangeSettingsContext = createContext<TimeRangeSettings>(defaultTimeRangeSettings);\n\nexport function useTimeRangeSettingsContext(): TimeRangeSettings {\n const ctx = useContext(TimeRangeSettingsContext);\n if (ctx === undefined) {\n throw new Error('No TimeRangeContext found. Did you forget a Provider?');\n }\n return ctx;\n}\n\n/**\n * Get and set the current resolved time range at runtime.\n */\nexport function useTimeRangeSettings(): TimeRangeSettings {\n return useTimeRangeSettingsContext();\n}\n\n/**\n * Get the current value of the showCustom setting.\n * @param override If set, the value of the provider will be overridden by this value.\n */\nexport function useShowCustomTimeRangeSetting(override?: boolean): boolean {\n const showCustomTimeRange = useTimeRangeSettings().showCustom;\n if (override !== undefined) {\n return override;\n }\n return showCustomTimeRange;\n}\n\n/**\n * Get the current value of the showZoomButtons setting.\n * @param override If set, the value of the provider will be overridden by this value.\n */\nexport function useShowZoomRangeSetting(override?: boolean): boolean {\n const showZoomTimeRange = useTimeRangeSettings().showZoomButtons;\n if (override !== undefined) {\n return override;\n }\n return showZoomTimeRange;\n}\n\n/**\n * Get the current value of the options setting.\n * @param override If set, the value of the provider will be overridden by this value.\n */\nexport function useTimeRangeOptionsSetting(override?: TimeOption[]): TimeOption[] {\n const showCustomTimeRange = useTimeRangeSettings().options;\n if (override !== undefined) {\n return override;\n }\n return showCustomTimeRange;\n}\n\n/**\n * Get the current value of the disableAutoRefresh setting.\n * @param override If set, the value of the provider will be overridden by this value.\n */\nexport function useDisableAutoRefreshSetting(override?: boolean): boolean {\n const disableAutoRefresh = useTimeRangeSettings().disableAutoRefresh;\n if (override !== undefined) {\n return override;\n }\n return disableAutoRefresh;\n}\n\n/**\n * Provider implementation that supplies the time range state at runtime.\n */\nexport function TimeRangeSettingsProvider(props: TimeRangeSettingsProviderProps): ReactElement {\n const ctx = useMemo(() => {\n return {\n showCustom: props.showCustom === undefined ? defaultTimeRangeSettings.showCustom : props.showCustom,\n showZoomButtons:\n props.showZoomButtons === undefined ? defaultTimeRangeSettings.showZoomButtons : props.showZoomButtons,\n disableAutoRefresh:\n props.disableAutoRefresh === undefined ? defaultTimeRangeSettings.disableAutoRefresh : props.disableAutoRefresh,\n options: props.options === undefined ? defaultTimeRangeSettings.options : props.options,\n };\n }, [props.showCustom, props.showZoomButtons, props.disableAutoRefresh, props.options]);\n\n return <TimeRangeSettingsContext.Provider value={ctx}>{props.children}</TimeRangeSettingsContext.Provider>;\n}\n"],"names":["buildRelativeTimeOption","createContext","useContext","useMemo","DEFAULT_OPTIONS","defaultTimeRangeSettings","showCustom","showZoomButtons","disableAutoRefresh","options","map","duration","TimeRangeSettingsContext","useTimeRangeSettingsContext","ctx","undefined","Error","useTimeRangeSettings","useShowCustomTimeRangeSetting","override","showCustomTimeRange","useShowZoomRangeSetting","showZoomTimeRange","useTimeRangeOptionsSetting","useDisableAutoRefreshSetting","TimeRangeSettingsProvider","props","Provider","value","children"],"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,uBAAuB,QAAQ,yBAAyB;AAGjE,SAASC,aAAa,EAAEC,UAAU,EAAEC,OAAO,QAAQ,QAAQ;AAE3D,MAAMC,kBAAoC;IAAC;IAAM;IAAO;IAAO;IAAM;IAAM;IAAO;IAAO;IAAM;CAAM;AACrG,MAAMC,2BAA8C;IAClDC,YAAY;IACZC,iBAAiB;IACjBC,oBAAoB;IACpBC,SAASL,gBAAgBM,GAAG,CAAC,CAACC,WAAaX,wBAAwBW;AACrE;AAiBA,OAAO,MAAMC,yCAA2BX,cAAiCI,0BAA0B;AAEnG,OAAO,SAASQ;IACd,MAAMC,MAAMZ,WAAWU;IACvB,IAAIE,QAAQC,WAAW;QACrB,MAAM,IAAIC,MAAM;IAClB;IACA,OAAOF;AACT;AAEA;;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AACC,OAAOd;kBAAMY,MAAMG,QAAQ;;AACvE"}
1
+ {"version":3,"sources":["../../../src/runtime/TimeRangeProvider/TimeRangeSettingsProvider.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 { TimeOption } from '@perses-dev/components';\nimport { buildRelativeTimeOption } from '@perses-dev/components';\nimport type { DurationString } from '@perses-dev/spec';\nimport type { ReactElement, ReactNode } from 'react';\nimport { createContext, useContext, useMemo } from 'react';\n\nconst DEFAULT_OPTIONS: DurationString[] = ['5m', '15m', '30m', '1h', '6h', '12h', '24h', '7d', '14d'];\n\nexport const DEFAULT_REFRESH_INTERVAL_OPTIONS: TimeOption[] = [\n { value: { pastDuration: '0s' }, display: 'Off' },\n { value: { pastDuration: '5s' }, display: '5s' },\n { value: { pastDuration: '10s' }, display: '10s' },\n { value: { pastDuration: '15s' }, display: '15s' },\n { value: { pastDuration: '30s' }, display: '30s' },\n { value: { pastDuration: '60s' }, display: '1m' },\n];\n\nconst defaultTimeRangeSettings: TimeRangeSettings = {\n showCustom: true,\n showZoomButtons: true,\n disableAutoRefresh: false,\n autoRefreshIntervalOptions: DEFAULT_REFRESH_INTERVAL_OPTIONS,\n options: DEFAULT_OPTIONS.map((duration) => buildRelativeTimeOption(duration)),\n};\n\nexport interface TimeRangeSettingsProviderProps {\n showCustom?: boolean;\n showZoomButtons?: boolean;\n disableAutoRefresh?: boolean;\n autoRefreshIntervalOptions?: TimeOption[];\n options?: TimeOption[];\n children: ReactNode;\n}\n\nexport interface TimeRangeSettings {\n showCustom: boolean;\n showZoomButtons: boolean;\n disableAutoRefresh: boolean;\n autoRefreshIntervalOptions: TimeOption[];\n options: TimeOption[];\n}\n\nexport const TimeRangeSettingsContext = createContext<TimeRangeSettings>(defaultTimeRangeSettings);\n\nexport function useTimeRangeSettingsContext(): TimeRangeSettings {\n const ctx = useContext(TimeRangeSettingsContext);\n if (ctx === undefined) {\n throw new Error('No TimeRangeContext found. Did you forget a Provider?');\n }\n return ctx;\n}\n\n/**\n * Get and set the current resolved time range at runtime.\n */\nexport function useTimeRangeSettings(): TimeRangeSettings {\n return useTimeRangeSettingsContext();\n}\n\n/**\n * Get the current value of the showCustom setting.\n * @param override If set, the value of the provider will be overridden by this value.\n */\nexport function useShowCustomTimeRangeSetting(override?: boolean): boolean {\n const showCustomTimeRange = useTimeRangeSettings().showCustom;\n if (override !== undefined) {\n return override;\n }\n return showCustomTimeRange;\n}\n\n/**\n * Get the current value of the showZoomButtons setting.\n * @param override If set, the value of the provider will be overridden by this value.\n */\nexport function useShowZoomRangeSetting(override?: boolean): boolean {\n const showZoomTimeRange = useTimeRangeSettings().showZoomButtons;\n if (override !== undefined) {\n return override;\n }\n return showZoomTimeRange;\n}\n\n/**\n * Get the current value of the options setting.\n * @param override If set, the value of the provider will be overridden by this value.\n */\nexport function useTimeRangeOptionsSetting(override?: TimeOption[]): TimeOption[] {\n const showCustomTimeRange = useTimeRangeSettings().options;\n if (override !== undefined) {\n return override;\n }\n return showCustomTimeRange;\n}\n\n/**\n * Get the current value of the disableAutoRefresh setting.\n * @param override If set, the value of the provider will be overridden by this value.\n */\nexport function useDisableAutoRefreshSetting(override?: boolean): boolean {\n const disableAutoRefresh = useTimeRangeSettings().disableAutoRefresh;\n if (override !== undefined) {\n return override;\n }\n return disableAutoRefresh;\n}\n\nexport function useAutoRefreshIntervalsOptions(override?: TimeOption[]): TimeOption[] {\n const { autoRefreshIntervalOptions } = useTimeRangeSettings();\n if (override?.length) {\n return override;\n }\n return autoRefreshIntervalOptions;\n}\n\n/**\n * Provider implementation that supplies the time range state at runtime.\n */\nexport function TimeRangeSettingsProvider(props: TimeRangeSettingsProviderProps): ReactElement {\n const ctx = useMemo((): TimeRangeSettings => {\n return {\n showCustom: props.showCustom === undefined ? defaultTimeRangeSettings.showCustom : props.showCustom,\n showZoomButtons:\n props.showZoomButtons === undefined ? defaultTimeRangeSettings.showZoomButtons : props.showZoomButtons,\n disableAutoRefresh:\n props.disableAutoRefresh === undefined ? defaultTimeRangeSettings.disableAutoRefresh : props.disableAutoRefresh,\n autoRefreshIntervalOptions: !props.autoRefreshIntervalOptions?.length\n ? defaultTimeRangeSettings.autoRefreshIntervalOptions\n : props.autoRefreshIntervalOptions,\n options: props.options === undefined ? defaultTimeRangeSettings.options : props.options,\n };\n }, [\n props.showCustom,\n props.showZoomButtons,\n props.disableAutoRefresh,\n props.options,\n props.autoRefreshIntervalOptions,\n ]);\n\n return <TimeRangeSettingsContext.Provider value={ctx}>{props.children}</TimeRangeSettingsContext.Provider>;\n}\n"],"names":["buildRelativeTimeOption","createContext","useContext","useMemo","DEFAULT_OPTIONS","DEFAULT_REFRESH_INTERVAL_OPTIONS","value","pastDuration","display","defaultTimeRangeSettings","showCustom","showZoomButtons","disableAutoRefresh","autoRefreshIntervalOptions","options","map","duration","TimeRangeSettingsContext","useTimeRangeSettingsContext","ctx","undefined","Error","useTimeRangeSettings","useShowCustomTimeRangeSetting","override","showCustomTimeRange","useShowZoomRangeSetting","showZoomTimeRange","useTimeRangeOptionsSetting","useDisableAutoRefreshSetting","useAutoRefreshIntervalsOptions","length","TimeRangeSettingsProvider","props","Provider","children"],"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,uBAAuB,QAAQ,yBAAyB;AAGjE,SAASC,aAAa,EAAEC,UAAU,EAAEC,OAAO,QAAQ,QAAQ;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AC1D,IAAIU,aAAaJ,WAAW;QAC1B,OAAOI;IACT;IACA,OAAOC;AACT;AAEA;;;CAGC,GACD,OAAO,SAASI,6BAA6BL,QAAkB;IAC7D,MAAMZ,qBAAqBU,uBAAuBV,kBAAkB;IACpE,IAAIY,aAAaJ,WAAW;QAC1B,OAAOI;IACT;IACA,OAAOZ;AACT;AAEA,OAAO,SAASkB,+BAA+BN,QAAuB;IACpE,MAAM,EAAEX,0BAA0B,EAAE,GAAGS;IACvC,IAAIE,UAAUO,QAAQ;QACpB,OAAOP;IACT;IACA,OAAOX;AACT;AAEA;;CAEC,GACD,OAAO,SAASmB,0BAA0BC,KAAqC;IAC7E,MAAMd,MAAMhB,QAAQ;QAClB,OAAO;YACLO,YAAYuB,MAAMvB,UAAU,KAAKU,YAAYX,yBAAyBC,UAAU,GAAGuB,MAAMvB,UAAU;YACnGC,iBACEsB,MAAMtB,eAAe,KAAKS,YAAYX,yBAAyBE,eAAe,GAAGsB,MAAMtB,eAAe;YACxGC,oBACEqB,MAAMrB,kBAAkB,KAAKQ,YAAYX,yBAAyBG,kBAAkB,GAAGqB,MAAMrB,kBAAkB;YACjHC,4BAA4B,CAACoB,MAAMpB,0BAA0B,EAAEkB,SAC3DtB,yBAAyBI,0BAA0B,GACnDoB,MAAMpB,0BAA0B;YACpCC,SAASmB,MAAMnB,OAAO,KAAKM,YAAYX,yBAAyBK,OAAO,GAAGmB,MAAMnB,OAAO;QACzF;IACF,GAAG;QACDmB,MAAMvB,UAAU;QAChBuB,MAAMtB,eAAe;QACrBsB,MAAMrB,kBAAkB;QACxBqB,MAAMnB,OAAO;QACbmB,MAAMpB,0BAA0B;KACjC;IAED,qBAAO,KAACI,yBAAyBiB,QAAQ;QAAC5B,OAAOa;kBAAMc,MAAME,QAAQ;;AACvE"}
@@ -1 +1 @@
1
- {"version":3,"file":"query-params.d.ts","sourceRoot":"","sources":["../../../src/runtime/TimeRangeProvider/query-params.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,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,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,GAC7B,YAAY,yBAAyB,EACrC,UAAU,yBAAyB,EACnC,eAAe,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
+ {"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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,MAAM,EAAE,MAAM,CAAC,GACtC,MAAM,CAMR;AAGD,wBAAgB,2BAA2B,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAKvF"}
@@ -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.ZodSchema<PanelEditorValues>;
5
- export declare function buildPanelEditorSchema(pluginSchema: PluginSchema): z.ZodSchema<PanelEditorValues>;
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,SAAS,CAAC,iBAAiB,CAI3D,CAAC;AAEH,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,YAAY,GAAG,CAAC,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAMjG"}
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"}
@@ -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.ZodSchema<PanelEditorValues> = z.object({\n groupId: z.number(),\n panelDefinition: panelDefinitionSchema,\n layoutDefinition: layoutDefinitionSchema,\n});\n\nexport function buildPanelEditorSchema(pluginSchema: PluginSchema): z.ZodSchema<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,oBAAoDf,EAAEE,MAAM,CAAC;IACxEc,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"}
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"}
@@ -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: "Panel";
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: "PluginModule";
20
+ kind: 'PluginModule';
21
21
  metadata: {
22
22
  name: string;
23
23
  version: string;
24
24
  };
25
25
  spec: {
26
26
  plugins: {
27
- kind: "Panel";
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: "PluginModule";
58
+ kind: 'PluginModule';
59
59
  metadata: {
60
60
  name: string;
61
61
  version: string;
62
62
  };
63
63
  spec: {
64
64
  plugins: {
65
- kind: "Variable";
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: "PluginModule";
82
+ kind: 'PluginModule';
83
83
  metadata: {
84
84
  name: string;
85
85
  version: string;
86
86
  };
87
87
  spec: {
88
88
  plugins: ({
89
- kind: "Panel";
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: "Variable";
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: "PluginModule";
108
+ kind: 'PluginModule';
109
109
  metadata: {
110
110
  name: string;
111
111
  version: string;
112
112
  };
113
113
  spec: {
114
114
  plugins: ({
115
- kind: "Panel";
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: "Variable";
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: "PluginModule";
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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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;;iBA3CqB,MAAM;;iBAAN,MAAM;;;iBAyBN,MAAM;;iBAAN,MAAM;;CAqB9C,CAAC"}
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;;wBArFmC,MAAM;;;yBAkBL,MAAM;;;;CAwE7D,CAAC"}
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"}
@@ -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,IAQ3C,cAAc;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,KAAG,SAAS,CAkB1E"}
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,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM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BAAgB,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"}
@@ -188,7 +188,7 @@ export const exportDataAsCSV = ({ data })=>{
188
188
  }
189
189
  const columnNames = seriesInfo.map((info)=>info.columnName);
190
190
  csvString += `DateTime,${columnNames.join(',')}\n`;
191
- const sortedDateTimes = Object.keys(result).sort((a, b)=>{
191
+ const sortedDateTimes = Object.keys(result).toSorted((a, b)=>{
192
192
  const dateA = new Date(a).getTime();
193
193
  const dateB = new Date(b).getTime();
194
194
  return dateA - dateB;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/csv-export.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\nexport interface SeriesDataPoint {\n timestamp: number | string;\n value: unknown;\n}\n\nexport interface DataSeries {\n name?: string;\n formattedName?: string;\n legendName?: string;\n displayName?: string;\n legend?: string;\n labels?: Record<string, string>;\n values: Array<[number | string, unknown]> | SeriesDataPoint[];\n}\n\nexport interface ExportableData {\n series: DataSeries[];\n timeRange?: {\n start: string | number;\n end: string | number;\n };\n stepMs?: number;\n metadata?: Record<string, unknown>;\n}\n\nexport const isExportableData = (data: unknown): data is ExportableData => {\n return !!(\n data &&\n typeof data === 'object' &&\n 'series' in data &&\n Array.isArray((data as ExportableData).series) &&\n (data as ExportableData).series.length > 0\n );\n};\n\nexport interface QueryDataInput {\n data?: unknown;\n error?: unknown;\n isFetching?: boolean;\n}\n\nexport const extractExportableData = (queryResults: QueryDataInput[]): ExportableData | undefined => {\n if (!queryResults || queryResults.length === 0) return undefined;\n\n const allSeries: DataSeries[] = [];\n let timeRange: ExportableData['timeRange'] = undefined;\n let stepMs: number | undefined = undefined;\n let metadata: ExportableData['metadata'] = undefined;\n\n queryResults.forEach((query) => {\n if (query?.data && typeof query.data === 'object' && 'series' in query.data) {\n const data = query.data as ExportableData;\n if (data.series && Array.isArray(data.series) && data.series.length > 0) {\n allSeries.push(...data.series);\n if (!timeRange && data.timeRange) {\n timeRange = data.timeRange;\n }\n if (!stepMs && data.stepMs) {\n stepMs = data.stepMs;\n }\n if (!metadata && data.metadata) {\n metadata = data.metadata;\n }\n }\n }\n });\n\n if (allSeries.length > 0) {\n return {\n series: allSeries,\n timeRange,\n stepMs,\n metadata,\n };\n }\n\n return undefined;\n};\n\nexport const formatLegendName = (series: DataSeries, seriesIndex: number): string => {\n const seriesAny = series as DataSeries & {\n formattedName?: string;\n legendName?: string;\n displayName?: string;\n legend?: string;\n labels?: Record<string, string>;\n };\n\n let legendName = series.formattedName || series.name;\n\n if (!legendName || legendName === `Series ${seriesIndex + 1}`) {\n legendName = seriesAny.legendName || seriesAny.displayName || seriesAny.legend || series.name || '';\n }\n\n if ((!legendName || legendName === series.name) && series.labels) {\n const labels = series.labels;\n const displayLabels = { ...labels };\n const metricName = displayLabels.__name__;\n delete displayLabels.__name__;\n\n const labelPairs = Object.entries(displayLabels)\n .filter(([value]) => value !== undefined && value !== null && value !== '')\n .map(([key, value]) => `${key}=\"${value}\"`)\n .join(', ');\n\n if (metricName && labelPairs) {\n legendName = `${metricName}{${labelPairs}}`;\n } else if (metricName) {\n legendName = metricName;\n } else if (labelPairs) {\n legendName = `{${labelPairs}}`;\n } else {\n legendName = labels.job || labels.instance || labels.metric || `Series ${seriesIndex + 1}`;\n }\n }\n\n if (!legendName || legendName.trim() === '') {\n legendName = `Series ${seriesIndex + 1}`;\n }\n\n return legendName;\n};\n\nexport const sanitizeColumnName = (name: string): string => {\n return name\n .replace(/[,\"\\n\\r]/g, '_')\n .replace(/\\s+/g, '_')\n .replace(/_+/g, '_')\n .replace(/^_|_$/g, '')\n .substring(0, 255);\n};\n\nexport const sanitizeFilename = (filename: string): string => {\n return filename\n .replace(/[<>:\"/\\\\|?*]/g, ' ')\n .trim()\n .split(/\\s+/)\n .filter((word) => word.length > 0)\n .map((word, index) => {\n if (index === 0) {\n return word.toLowerCase();\n }\n return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();\n })\n .join('');\n};\n\nexport const formatTimestampISO = (timestamp: number | string): string => {\n let timestampMs: number;\n\n if (typeof timestamp === 'string') {\n const date = new Date(timestamp);\n if (isNaN(date.getTime())) {\n return timestamp;\n }\n timestampMs = date.getTime();\n } else {\n timestampMs = timestamp > 1e10 ? timestamp : timestamp * 1000;\n }\n\n const date = new Date(timestampMs);\n if (isNaN(date.getTime())) {\n return new Date(timestampMs).toISOString();\n }\n\n return date.toISOString();\n};\n\nexport const escapeCsvValue = (value: unknown): string => {\n if (value === null || value === undefined) {\n return '';\n }\n\n const stringValue = String(value);\n\n if (\n stringValue.includes(',') ||\n stringValue.includes('\"') ||\n stringValue.includes('\\n') ||\n stringValue.includes('\\r')\n ) {\n return `\"${stringValue.replace(/\"/g, '\"\"')}\"`;\n }\n\n return stringValue;\n};\n\nexport interface ExportDataOptions {\n data: ExportableData;\n}\n\nexport const exportDataAsCSV = ({ data }: ExportDataOptions): Blob => {\n if (!isExportableData(data)) {\n console.warn('No valid data found to export to CSV.');\n return new Blob([''], { type: 'text/csv;charset=utf-8' });\n }\n\n let csvString = '';\n const result: Record<string, Record<string, unknown>> = {};\n const seriesInfo: Array<{ legendName: string; columnName: string; originalName: string }> = [];\n let validSeriesCount = 0;\n\n for (let i = 0; i < data.series.length; i++) {\n const series = data.series[i];\n\n if (!series) {\n continue;\n }\n\n if (!Array.isArray(series.values) || series.values.length === 0) {\n continue;\n }\n\n const legendName = formatLegendName(series, i);\n const columnName = sanitizeColumnName(legendName);\n\n const currentSeriesInfo = {\n legendName,\n columnName: columnName || `Series_${i + 1}`,\n originalName: series.name || '',\n };\n\n seriesInfo.push(currentSeriesInfo);\n validSeriesCount++;\n\n for (let j = 0; j < series.values.length; j++) {\n const entry = series.values[j];\n\n let timestamp: number | string;\n let value: unknown;\n\n if (Array.isArray(entry) && entry.length >= 2) {\n timestamp = entry[0];\n value = entry[1];\n } else if (typeof entry === 'object' && entry !== null && 'timestamp' in entry && 'value' in entry) {\n const dataPoint = entry as SeriesDataPoint;\n timestamp = dataPoint.timestamp;\n value = dataPoint.value;\n } else {\n continue;\n }\n\n if (value === null || value === undefined) {\n continue;\n }\n\n const dateTime = formatTimestampISO(timestamp);\n\n if (!result[dateTime]) {\n result[dateTime] = {};\n }\n /* linter complains, so assert result[dateTime]\n It has already been checked by the if statement\n */\n result[dateTime]![currentSeriesInfo.columnName] = value;\n }\n }\n\n if (validSeriesCount === 0 || seriesInfo.length === 0) {\n console.warn('No valid data found to export to CSV.');\n return new Blob([''], { type: 'text/csv;charset=utf-8' });\n }\n\n const timestampCount = Object.keys(result).length;\n if (timestampCount === 0) {\n console.warn('No valid timestamp data found to export to CSV.');\n return new Blob([''], { type: 'text/csv;charset=utf-8' });\n }\n\n const columnNames = seriesInfo.map((info) => info.columnName);\n csvString += `DateTime,${columnNames.join(',')}\\n`;\n\n const sortedDateTimes = Object.keys(result).sort((a, b) => {\n const dateA = new Date(a).getTime();\n const dateB = new Date(b).getTime();\n return dateA - dateB;\n });\n\n for (const dateTime of sortedDateTimes) {\n const rowData = result[dateTime];\n const values: string[] = [];\n\n if (rowData) {\n for (const columnName of columnNames) {\n const value = rowData[columnName];\n values.push(escapeCsvValue(value));\n }\n\n csvString += `${escapeCsvValue(dateTime)},${values.join(',')}\\n`;\n }\n }\n\n return new Blob([csvString], { type: 'text/csv;charset=utf-8' });\n};\n"],"names":["isExportableData","data","Array","isArray","series","length","extractExportableData","queryResults","undefined","allSeries","timeRange","stepMs","metadata","forEach","query","push","formatLegendName","seriesIndex","seriesAny","legendName","formattedName","name","displayName","legend","labels","displayLabels","metricName","__name__","labelPairs","Object","entries","filter","value","map","key","join","job","instance","metric","trim","sanitizeColumnName","replace","substring","sanitizeFilename","filename","split","word","index","toLowerCase","charAt","toUpperCase","slice","formatTimestampISO","timestamp","timestampMs","date","Date","isNaN","getTime","toISOString","escapeCsvValue","stringValue","String","includes","exportDataAsCSV","console","warn","Blob","type","csvString","result","seriesInfo","validSeriesCount","i","values","columnName","currentSeriesInfo","originalName","j","entry","dataPoint","dateTime","timestampCount","keys","columnNames","info","sortedDateTimes","sort","a","b","dateA","dateB","rowData"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AA2BjC,OAAO,MAAMA,mBAAmB,CAACC;IAC/B,OAAO,CAAC,CACNA,CAAAA,QACA,OAAOA,SAAS,YAChB,YAAYA,QACZC,MAAMC,OAAO,CAAC,AAACF,KAAwBG,MAAM,KAC7C,AAACH,KAAwBG,MAAM,CAACC,MAAM,GAAG,CAAA;AAE7C,EAAE;AAQF,OAAO,MAAMC,wBAAwB,CAACC;IACpC,IAAI,CAACA,gBAAgBA,aAAaF,MAAM,KAAK,GAAG,OAAOG;IAEvD,MAAMC,YAA0B,EAAE;IAClC,IAAIC,YAAyCF;IAC7C,IAAIG,SAA6BH;IACjC,IAAII,WAAuCJ;IAE3CD,aAAaM,OAAO,CAAC,CAACC;QACpB,IAAIA,OAAOb,QAAQ,OAAOa,MAAMb,IAAI,KAAK,YAAY,YAAYa,MAAMb,IAAI,EAAE;YAC3E,MAAM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C,IAAI,CAAC;QACb,OAAO,IAAIC,KAAK;YAAC;SAAG,EAAE;YAAEC,MAAM;QAAyB;IACzD;IAEA,MAAMgB,cAAcb,WAAWtC,GAAG,CAAC,CAACoD,OAASA,KAAKV,UAAU;IAC5DN,aAAa,CAAC,SAAS,EAAEe,YAAYjD,IAAI,CAAC,KAAK,EAAE,CAAC;IAElD,MAAMmD,kBAAkBzD,OAAOsD,IAAI,CAACb,QAAQiB,IAAI,CAAC,CAACC,GAAGC;QACnD,MAAMC,QAAQ,IAAIlC,KAAKgC,GAAG9B,OAAO;QACjC,MAAMiC,QAAQ,IAAInC,KAAKiC,GAAG/B,OAAO;QACjC,OAAOgC,QAAQC;IACjB;IAEA,KAAK,MAAMV,YAAYK,gBAAiB;QACtC,MAAMM,UAAUtB,MAAM,CAACW,SAAS;QAChC,MAAMP,SAAmB,EAAE;QAE3B,IAAIkB,SAAS;YACX,KAAK,MAAMjB,cAAcS,YAAa;gBACpC,MAAMpD,QAAQ4D,OAAO,CAACjB,WAAW;gBACjCD,OAAO3D,IAAI,CAAC6C,eAAe5B;YAC7B;YAEAqC,aAAa,GAAGT,eAAeqB,UAAU,CAAC,EAAEP,OAAOvC,IAAI,CAAC,KAAK,EAAE,CAAC;QAClE;IACF;IAEA,OAAO,IAAIgC,KAAK;QAACE;KAAU,EAAE;QAAED,MAAM;IAAyB;AAChE,EAAE"}
1
+ {"version":3,"sources":["../../src/utils/csv-export.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\nexport interface SeriesDataPoint {\n timestamp: number | string;\n value: unknown;\n}\n\nexport interface DataSeries {\n name?: string;\n formattedName?: string;\n legendName?: string;\n displayName?: string;\n legend?: string;\n labels?: Record<string, string>;\n values: Array<[number | string, unknown]> | SeriesDataPoint[];\n}\n\nexport interface ExportableData {\n series: DataSeries[];\n timeRange?: {\n start: string | number;\n end: string | number;\n };\n stepMs?: number;\n metadata?: Record<string, unknown>;\n}\n\nexport const isExportableData = (data: unknown): data is ExportableData => {\n return !!(\n data &&\n typeof data === 'object' &&\n 'series' in data &&\n Array.isArray((data as ExportableData).series) &&\n (data as ExportableData).series.length > 0\n );\n};\n\nexport interface QueryDataInput {\n data?: unknown;\n error?: unknown;\n isFetching?: boolean;\n}\n\nexport const extractExportableData = (queryResults: QueryDataInput[]): ExportableData | undefined => {\n if (!queryResults || queryResults.length === 0) return undefined;\n\n const allSeries: DataSeries[] = [];\n let timeRange: ExportableData['timeRange'] = undefined;\n let stepMs: number | undefined = undefined;\n let metadata: ExportableData['metadata'] = undefined;\n\n queryResults.forEach((query) => {\n if (query?.data && typeof query.data === 'object' && 'series' in query.data) {\n const data = query.data as ExportableData;\n if (data.series && Array.isArray(data.series) && data.series.length > 0) {\n allSeries.push(...data.series);\n if (!timeRange && data.timeRange) {\n timeRange = data.timeRange;\n }\n if (!stepMs && data.stepMs) {\n stepMs = data.stepMs;\n }\n if (!metadata && data.metadata) {\n metadata = data.metadata;\n }\n }\n }\n });\n\n if (allSeries.length > 0) {\n return {\n series: allSeries,\n timeRange,\n stepMs,\n metadata,\n };\n }\n\n return undefined;\n};\n\nexport const formatLegendName = (series: DataSeries, seriesIndex: number): string => {\n const seriesAny = series as DataSeries & {\n formattedName?: string;\n legendName?: string;\n displayName?: string;\n legend?: string;\n labels?: Record<string, string>;\n };\n\n let legendName = series.formattedName || series.name;\n\n if (!legendName || legendName === `Series ${seriesIndex + 1}`) {\n legendName = seriesAny.legendName || seriesAny.displayName || seriesAny.legend || series.name || '';\n }\n\n if ((!legendName || legendName === series.name) && series.labels) {\n const labels = series.labels;\n const displayLabels = { ...labels };\n const metricName = displayLabels.__name__;\n delete displayLabels.__name__;\n\n const labelPairs = Object.entries(displayLabels)\n .filter(([value]) => value !== undefined && value !== null && value !== '')\n .map(([key, value]) => `${key}=\"${value}\"`)\n .join(', ');\n\n if (metricName && labelPairs) {\n legendName = `${metricName}{${labelPairs}}`;\n } else if (metricName) {\n legendName = metricName;\n } else if (labelPairs) {\n legendName = `{${labelPairs}}`;\n } else {\n legendName = labels.job || labels.instance || labels.metric || `Series ${seriesIndex + 1}`;\n }\n }\n\n if (!legendName || legendName.trim() === '') {\n legendName = `Series ${seriesIndex + 1}`;\n }\n\n return legendName;\n};\n\nexport const sanitizeColumnName = (name: string): string => {\n return name\n .replace(/[,\"\\n\\r]/g, '_')\n .replace(/\\s+/g, '_')\n .replace(/_+/g, '_')\n .replace(/^_|_$/g, '')\n .substring(0, 255);\n};\n\nexport const sanitizeFilename = (filename: string): string => {\n return filename\n .replace(/[<>:\"/\\\\|?*]/g, ' ')\n .trim()\n .split(/\\s+/)\n .filter((word) => word.length > 0)\n .map((word, index) => {\n if (index === 0) {\n return word.toLowerCase();\n }\n return word.charAt(0).toUpperCase() + word.slice(1).toLowerCase();\n })\n .join('');\n};\n\nexport const formatTimestampISO = (timestamp: number | string): string => {\n let timestampMs: number;\n\n if (typeof timestamp === 'string') {\n const date = new Date(timestamp);\n if (isNaN(date.getTime())) {\n return timestamp;\n }\n timestampMs = date.getTime();\n } else {\n timestampMs = timestamp > 1e10 ? timestamp : timestamp * 1000;\n }\n\n const date = new Date(timestampMs);\n if (isNaN(date.getTime())) {\n return new Date(timestampMs).toISOString();\n }\n\n return date.toISOString();\n};\n\nexport const escapeCsvValue = (value: unknown): string => {\n if (value === null || value === undefined) {\n return '';\n }\n\n const stringValue = String(value);\n\n if (\n stringValue.includes(',') ||\n stringValue.includes('\"') ||\n stringValue.includes('\\n') ||\n stringValue.includes('\\r')\n ) {\n return `\"${stringValue.replace(/\"/g, '\"\"')}\"`;\n }\n\n return stringValue;\n};\n\nexport interface ExportDataOptions {\n data: ExportableData;\n}\n\nexport const exportDataAsCSV = ({ data }: ExportDataOptions): Blob => {\n if (!isExportableData(data)) {\n console.warn('No valid data found to export to CSV.');\n return new Blob([''], { type: 'text/csv;charset=utf-8' });\n }\n\n let csvString = '';\n const result: Record<string, Record<string, unknown>> = {};\n const seriesInfo: Array<{ legendName: string; columnName: string; originalName: string }> = [];\n let validSeriesCount = 0;\n\n for (let i = 0; i < data.series.length; i++) {\n const series = data.series[i];\n\n if (!series) {\n continue;\n }\n\n if (!Array.isArray(series.values) || series.values.length === 0) {\n continue;\n }\n\n const legendName = formatLegendName(series, i);\n const columnName = sanitizeColumnName(legendName);\n\n const currentSeriesInfo = {\n legendName,\n columnName: columnName || `Series_${i + 1}`,\n originalName: series.name || '',\n };\n\n seriesInfo.push(currentSeriesInfo);\n validSeriesCount++;\n\n for (let j = 0; j < series.values.length; j++) {\n const entry = series.values[j];\n\n let timestamp: number | string;\n let value: unknown;\n\n if (Array.isArray(entry) && entry.length >= 2) {\n timestamp = entry[0];\n value = entry[1];\n } else if (typeof entry === 'object' && entry !== null && 'timestamp' in entry && 'value' in entry) {\n const dataPoint = entry as SeriesDataPoint;\n timestamp = dataPoint.timestamp;\n value = dataPoint.value;\n } else {\n continue;\n }\n\n if (value === null || value === undefined) {\n continue;\n }\n\n const dateTime = formatTimestampISO(timestamp);\n\n if (!result[dateTime]) {\n result[dateTime] = {};\n }\n /* linter complains, so assert result[dateTime]\n It has already been checked by the if statement\n */\n result[dateTime]![currentSeriesInfo.columnName] = value;\n }\n }\n\n if (validSeriesCount === 0 || seriesInfo.length === 0) {\n console.warn('No valid data found to export to CSV.');\n return new Blob([''], { type: 'text/csv;charset=utf-8' });\n }\n\n const timestampCount = Object.keys(result).length;\n if (timestampCount === 0) {\n console.warn('No valid timestamp data found to export to CSV.');\n return new Blob([''], { type: 'text/csv;charset=utf-8' });\n }\n\n const columnNames = seriesInfo.map((info) => info.columnName);\n csvString += `DateTime,${columnNames.join(',')}\\n`;\n\n const sortedDateTimes = Object.keys(result).toSorted((a, b) => {\n const dateA = new Date(a).getTime();\n const dateB = new Date(b).getTime();\n return dateA - dateB;\n });\n\n for (const dateTime of sortedDateTimes) {\n const rowData = result[dateTime];\n const values: string[] = [];\n\n if (rowData) {\n for (const columnName of columnNames) {\n const value = rowData[columnName];\n values.push(escapeCsvValue(value));\n }\n\n csvString += `${escapeCsvValue(dateTime)},${values.join(',')}\\n`;\n }\n }\n\n return new Blob([csvString], { type: 'text/csv;charset=utf-8' });\n};\n"],"names":["isExportableData","data","Array","isArray","series","length","extractExportableData","queryResults","undefined","allSeries","timeRange","stepMs","metadata","forEach","query","push","formatLegendName","seriesIndex","seriesAny","legendName","formattedName","name","displayName","legend","labels","displayLabels","metricName","__name__","labelPairs","Object","entries","filter","value","map","key","join","job","instance","metric","trim","sanitizeColumnName","replace","substring","sanitizeFilename","filename","split","word","index","toLowerCase","charAt","toUpperCase","slice","formatTimestampISO","timestamp","timestampMs","date","Date","isNaN","getTime","toISOString","escapeCsvValue","stringValue","String","includes","exportDataAsCSV","console","warn","Blob","type","csvString","result","seriesInfo","validSeriesCount","i","values","columnName","currentSeriesInfo","originalName","j","entry","dataPoint","dateTime","timestampCount","keys","columnNames","info","sortedDateTimes","toSorted","a","b","dateA","dateB","rowData"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AA2BjC,OAAO,MAAMA,mBAAmB,CAACC;IAC/B,OAAO,CAAC,CACNA,CAAAA,QACA,OAAOA,SAAS,YAChB,YAAYA,QACZC,MAAMC,OAAO,CAAC,AAACF,KAAwBG,MAAM,KAC7C,AAACH,KAAwBG,MAAM,CAACC,MAAM,GAAG,CAAA;AAE7C,EAAE;AAQF,OAAO,MAAMC,wBAAwB,CAACC;I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