@perses-dev/core 0.53.0-beta.3 → 0.53.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/schema/panel.js
CHANGED
|
@@ -52,9 +52,7 @@ _export(exports, {
|
|
|
52
52
|
const _zod = require("zod");
|
|
53
53
|
const _plugin = require("./plugin");
|
|
54
54
|
const panelDisplaySpec = _zod.z.object({
|
|
55
|
-
name: _zod.z.string().
|
|
56
|
-
message: 'Required'
|
|
57
|
-
}),
|
|
55
|
+
name: _zod.z.string().optional(),
|
|
58
56
|
description: _zod.z.string().optional()
|
|
59
57
|
});
|
|
60
58
|
const querySpecSchema = _zod.z.object({
|
|
@@ -71,14 +69,14 @@ const linkSchema = _zod.z.object({
|
|
|
71
69
|
targetBlank: _zod.z.boolean().optional()
|
|
72
70
|
});
|
|
73
71
|
const panelSpecSchema = _zod.z.object({
|
|
74
|
-
display: panelDisplaySpec,
|
|
72
|
+
display: panelDisplaySpec.optional(),
|
|
75
73
|
plugin: _plugin.pluginSchema,
|
|
76
74
|
queries: _zod.z.array(querySpecSchema).optional(),
|
|
77
75
|
links: _zod.z.array(linkSchema).optional()
|
|
78
76
|
});
|
|
79
77
|
function buildPanelSpecSchema(pluginSchema) {
|
|
80
78
|
return _zod.z.object({
|
|
81
|
-
display: panelDisplaySpec,
|
|
79
|
+
display: panelDisplaySpec.optional(),
|
|
82
80
|
plugin: pluginSchema,
|
|
83
81
|
queries: _zod.z.array(querySpecSchema).optional(),
|
|
84
82
|
links: _zod.z.array(linkSchema).optional()
|
package/dist/model/panels.d.ts
CHANGED
|
@@ -8,14 +8,14 @@ export interface Link {
|
|
|
8
8
|
targetBlank?: boolean;
|
|
9
9
|
}
|
|
10
10
|
export interface PanelDisplay {
|
|
11
|
-
name
|
|
11
|
+
name?: string;
|
|
12
12
|
description?: string;
|
|
13
13
|
}
|
|
14
14
|
export interface PanelDefinition<PluginSpec = UnknownSpec> extends Definition<PanelSpec<PluginSpec>> {
|
|
15
15
|
kind: 'Panel';
|
|
16
16
|
}
|
|
17
17
|
export interface PanelSpec<PluginSpec = UnknownSpec> {
|
|
18
|
-
display
|
|
18
|
+
display?: PanelDisplay;
|
|
19
19
|
plugin: Definition<PluginSpec>;
|
|
20
20
|
queries?: QueryDefinition[];
|
|
21
21
|
links?: Link[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"panels.d.ts","sourceRoot":"","sources":["../../src/model/panels.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,MAAM,WAAW,IAAI;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"panels.d.ts","sourceRoot":"","sources":["../../src/model/panels.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,MAAM,WAAW,IAAI;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,eAAe,CAAC,UAAU,GAAG,WAAW,CAAE,SAAQ,UAAU,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IAClG,IAAI,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,SAAS,CAAC,UAAU,GAAG,WAAW;IACjD,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,MAAM,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;IAC/B,OAAO,CAAC,EAAE,eAAe,EAAE,CAAC;IAC5B,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,iBAAiB,MAAM,EAAE,CAAC;CACjC;AAED,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;AAElC;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,YAAY,CAAC;IACtB,eAAe,EAAE,eAAe,CAAC;CAClC"}
|
package/dist/model/panels.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/model/panels.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Definition, UnknownSpec } from './definitions';\nimport { QueryDefinition } from './query';\n\nexport interface Link {\n name?: string;\n url: string;\n tooltip?: string;\n renderVariables?: boolean;\n targetBlank?: boolean;\n}\n\nexport interface PanelDisplay {\n name
|
|
1
|
+
{"version":3,"sources":["../../src/model/panels.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Definition, UnknownSpec } from './definitions';\nimport { QueryDefinition } from './query';\n\nexport interface Link {\n name?: string;\n url: string;\n tooltip?: string;\n renderVariables?: boolean;\n targetBlank?: boolean;\n}\n\nexport interface PanelDisplay {\n name?: string;\n description?: string;\n}\n\nexport interface PanelDefinition<PluginSpec = UnknownSpec> extends Definition<PanelSpec<PluginSpec>> {\n kind: 'Panel';\n}\n\nexport interface PanelSpec<PluginSpec = UnknownSpec> {\n display?: PanelDisplay;\n plugin: Definition<PluginSpec>;\n queries?: QueryDefinition[];\n links?: Link[];\n}\n\n/**\n * A reference to a panel defined in the DashboardSpec.\n */\nexport interface PanelRef {\n $ref: `#/spec/panels/${string}`;\n}\n\nexport type PanelGroupId = number;\n\n/**\n * Panel values that can be edited in the panel editor.\n */\nexport interface PanelEditorValues {\n groupId: PanelGroupId;\n panelDefinition: PanelDefinition;\n}\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAsCjC;;CAEC,GACD,WAGC"}
|
package/dist/schema/panel.js
CHANGED
|
@@ -13,9 +13,7 @@
|
|
|
13
13
|
import { z } from 'zod';
|
|
14
14
|
import { pluginSchema } from './plugin';
|
|
15
15
|
export const panelDisplaySpec = z.object({
|
|
16
|
-
name: z.string().
|
|
17
|
-
message: 'Required'
|
|
18
|
-
}),
|
|
16
|
+
name: z.string().optional(),
|
|
19
17
|
description: z.string().optional()
|
|
20
18
|
});
|
|
21
19
|
export const querySpecSchema = z.object({
|
|
@@ -32,14 +30,14 @@ export const linkSchema = z.object({
|
|
|
32
30
|
targetBlank: z.boolean().optional()
|
|
33
31
|
});
|
|
34
32
|
export const panelSpecSchema = z.object({
|
|
35
|
-
display: panelDisplaySpec,
|
|
33
|
+
display: panelDisplaySpec.optional(),
|
|
36
34
|
plugin: pluginSchema,
|
|
37
35
|
queries: z.array(querySpecSchema).optional(),
|
|
38
36
|
links: z.array(linkSchema).optional()
|
|
39
37
|
});
|
|
40
38
|
export function buildPanelSpecSchema(pluginSchema) {
|
|
41
39
|
return z.object({
|
|
42
|
-
display: panelDisplaySpec,
|
|
40
|
+
display: panelDisplaySpec.optional(),
|
|
43
41
|
plugin: pluginSchema,
|
|
44
42
|
queries: z.array(querySpecSchema).optional(),
|
|
45
43
|
links: z.array(linkSchema).optional()
|
package/dist/schema/panel.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/schema/panel.ts"],"sourcesContent":["// Copyright 2024 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 { z } from 'zod';\nimport { Link, PanelDefinition, PanelDisplay, PanelEditorValues, PanelSpec, QueryDefinition } from '../model';\nimport { PluginSchema, pluginSchema } from './plugin';\n\nexport const panelDisplaySpec: z.ZodSchema<PanelDisplay> = z.object({\n name: z.string().
|
|
1
|
+
{"version":3,"sources":["../../src/schema/panel.ts"],"sourcesContent":["// Copyright 2024 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 { z } from 'zod';\nimport { Link, PanelDefinition, PanelDisplay, PanelEditorValues, PanelSpec, QueryDefinition } from '../model';\nimport { PluginSchema, pluginSchema } from './plugin';\n\nexport const panelDisplaySpec: z.ZodSchema<PanelDisplay> = z.object({\n name: z.string().optional(),\n description: z.string().optional(),\n});\n\nexport const querySpecSchema: z.ZodSchema<QueryDefinition> = z.object({\n kind: z.string().min(1),\n spec: z.object({\n plugin: pluginSchema,\n }),\n});\n\nexport const linkSchema: z.ZodSchema<Link> = z.object({\n name: z.string().optional(),\n url: z.string().min(1),\n tooltip: z.string().optional(),\n renderVariables: z.boolean().optional(),\n targetBlank: z.boolean().optional(),\n});\n\nexport const panelSpecSchema: z.ZodSchema<PanelSpec> = z.object({\n display: panelDisplaySpec.optional(),\n plugin: pluginSchema,\n queries: z.array(querySpecSchema).optional(),\n links: z.array(linkSchema).optional(),\n});\n\nexport function buildPanelSpecSchema(pluginSchema: PluginSchema): z.ZodSchema<PanelSpec> {\n return z.object({\n display: panelDisplaySpec.optional(),\n plugin: pluginSchema,\n queries: z.array(querySpecSchema).optional(),\n links: z.array(linkSchema).optional(),\n });\n}\n\nexport const panelDefinitionSchema: z.ZodSchema<PanelDefinition> = z.object({\n kind: z.literal('Panel'),\n spec: panelSpecSchema,\n});\n\nexport function buildPanelDefinitionSchema(pluginSchema: PluginSchema): z.ZodSchema<PanelDefinition> {\n return z.object({\n kind: z.literal('Panel'),\n spec: buildPanelSpecSchema(pluginSchema),\n });\n}\n\nexport const panelEditorSchema: z.ZodSchema<PanelEditorValues> = z.object({\n groupId: z.number(),\n panelDefinition: panelDefinitionSchema,\n});\n\nexport function buildPanelEditorSchema(pluginSchema: PluginSchema): z.ZodSchema<PanelEditorValues> {\n return z.object({\n groupId: z.number(),\n panelDefinition: buildPanelDefinitionSchema(pluginSchema),\n });\n}\n"],"names":["z","pluginSchema","panelDisplaySpec","object","name","string","optional","description","querySpecSchema","kind","min","spec","plugin","linkSchema","url","tooltip","renderVariables","boolean","targetBlank","panelSpecSchema","display","queries","array","links","buildPanelSpecSchema","panelDefinitionSchema","literal","buildPanelDefinitionSchema","panelEditorSchema","groupId","number","panelDefinition","buildPanelEditorSchema"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,CAAC,QAAQ,MAAM;AAExB,SAAuBC,YAAY,QAAQ,WAAW;AAEtD,OAAO,MAAMC,mBAA8CF,EAAEG,MAAM,CAAC;IAClEC,MAAMJ,EAAEK,MAAM,GAAGC,QAAQ;IACzBC,aAAaP,EAAEK,MAAM,GAAGC,QAAQ;AAClC,GAAG;AAEH,OAAO,MAAME,kBAAgDR,EAAEG,MAAM,CAAC;IACpEM,MAAMT,EAAEK,MAAM,GAAGK,GAAG,CAAC;IACrBC,MAAMX,EAAEG,MAAM,CAAC;QACbS,QAAQX;IACV;AACF,GAAG;AAEH,OAAO,MAAMY,aAAgCb,EAAEG,MAAM,CAAC;IACpDC,MAAMJ,EAAEK,MAAM,GAAGC,QAAQ;IACzBQ,KAAKd,EAAEK,MAAM,GAAGK,GAAG,CAAC;IACpBK,SAASf,EAAEK,MAAM,GAAGC,QAAQ;IAC5BU,iBAAiBhB,EAAEiB,OAAO,GAAGX,QAAQ;IACrCY,aAAalB,EAAEiB,OAAO,GAAGX,QAAQ;AACnC,GAAG;AAEH,OAAO,MAAMa,kBAA0CnB,EAAEG,MAAM,CAAC;IAC9DiB,SAASlB,iBAAiBI,QAAQ;IAClCM,QAAQX;IACRoB,SAASrB,EAAEsB,KAAK,CAACd,iBAAiBF,QAAQ;IAC1CiB,OAAOvB,EAAEsB,KAAK,CAACT,YAAYP,QAAQ;AACrC,GAAG;AAEH,OAAO,SAASkB,qBAAqBvB,YAA0B;IAC7D,OAAOD,EAAEG,MAAM,CAAC;QACdiB,SAASlB,iBAAiBI,QAAQ;QAClCM,QAAQX;QACRoB,SAASrB,EAAEsB,KAAK,CAACd,iBAAiBF,QAAQ;QAC1CiB,OAAOvB,EAAEsB,KAAK,CAACT,YAAYP,QAAQ;IACrC;AACF;AAEA,OAAO,MAAMmB,wBAAsDzB,EAAEG,MAAM,CAAC;IAC1EM,MAAMT,EAAE0B,OAAO,CAAC;IAChBf,MAAMQ;AACR,GAAG;AAEH,OAAO,SAASQ,2BAA2B1B,YAA0B;IACnE,OAAOD,EAAEG,MAAM,CAAC;QACdM,MAAMT,EAAE0B,OAAO,CAAC;QAChBf,MAAMa,qBAAqBvB;IAC7B;AACF;AAEA,OAAO,MAAM2B,oBAAoD5B,EAAEG,MAAM,CAAC;IACxE0B,SAAS7B,EAAE8B,MAAM;IACjBC,iBAAiBN;AACnB,GAAG;AAEH,OAAO,SAASO,uBAAuB/B,YAA0B;IAC/D,OAAOD,EAAEG,MAAM,CAAC;QACd0B,SAAS7B,EAAE8B,MAAM;QACjBC,iBAAiBJ,2BAA2B1B;IAC9C;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@perses-dev/core",
|
|
3
|
-
"version": "0.53.0-
|
|
3
|
+
"version": "0.53.0-rc.0",
|
|
4
4
|
"description": "Core functionality consumed by both the Perses UI and plugins",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/perses/perses/blob/main/README.md",
|