@perses-dev/core 0.22.0 → 0.23.1

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.
@@ -0,0 +1,37 @@
1
+ // Copyright 2023 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ function _export(target, all) {
18
+ for(var name in all)Object.defineProperty(target, name, {
19
+ enumerable: true,
20
+ get: all[name]
21
+ });
22
+ }
23
+ _export(exports, {
24
+ dashboardDisplayName: ()=>dashboardDisplayName,
25
+ dashboardExtendedDisplayName: ()=>dashboardExtendedDisplayName
26
+ });
27
+ function dashboardDisplayName(dashboard) {
28
+ var ref;
29
+ return ((ref = dashboard.spec.display) === null || ref === void 0 ? void 0 : ref.name) || dashboard.metadata.name;
30
+ }
31
+ function dashboardExtendedDisplayName(dashboard) {
32
+ var ref;
33
+ if ((ref = dashboard.spec.display) === null || ref === void 0 ? void 0 : ref.name) {
34
+ return `${dashboard.spec.display.name} (ID: ${dashboard.metadata.name})`;
35
+ }
36
+ return dashboard.metadata.name;
37
+ }
@@ -0,0 +1,4 @@
1
+ import { DashboardResource } from '../model';
2
+ export declare function dashboardDisplayName(dashboard: DashboardResource): string;
3
+ export declare function dashboardExtendedDisplayName(dashboard: DashboardResource): string;
4
+ //# sourceMappingURL=text.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../src/utils/text.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAE7C,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,iBAAiB,UAEhE;AAED,wBAAgB,4BAA4B,CAAC,SAAS,EAAE,iBAAiB,UAKxE"}
@@ -0,0 +1,25 @@
1
+ // Copyright 2023 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ export function dashboardDisplayName(dashboard) {
14
+ var ref;
15
+ return ((ref = dashboard.spec.display) === null || ref === void 0 ? void 0 : ref.name) || dashboard.metadata.name;
16
+ }
17
+ export function dashboardExtendedDisplayName(dashboard) {
18
+ var ref;
19
+ if ((ref = dashboard.spec.display) === null || ref === void 0 ? void 0 : ref.name) {
20
+ return `${dashboard.spec.display.name} (ID: ${dashboard.metadata.name})`;
21
+ }
22
+ return dashboard.metadata.name;
23
+ }
24
+
25
+ //# sourceMappingURL=text.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/utils/text.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 { DashboardResource } from '../model';\n\nexport function dashboardDisplayName(dashboard: DashboardResource) {\n return dashboard.spec.display?.name || dashboard.metadata.name;\n}\n\nexport function dashboardExtendedDisplayName(dashboard: DashboardResource) {\n if (dashboard.spec.display?.name) {\n return `${dashboard.spec.display.name} (ID: ${dashboard.metadata.name})`;\n }\n return dashboard.metadata.name;\n}\n"],"names":["dashboardDisplayName","dashboard","spec","display","name","metadata","dashboardExtendedDisplayName"],"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;AAIjC,OAAO,SAASA,oBAAoB,CAACC,SAA4B,EAAE;QAC1DA,GAAsB;IAA7B,OAAOA,CAAAA,CAAAA,GAAsB,GAAtBA,SAAS,CAACC,IAAI,CAACC,OAAO,cAAtBF,GAAsB,WAAM,GAA5BA,KAAAA,CAA4B,GAA5BA,GAAsB,CAAEG,IAAI,CAAA,IAAIH,SAAS,CAACI,QAAQ,CAACD,IAAI,CAAC;AACjE,CAAC;AAED,OAAO,SAASE,4BAA4B,CAACL,SAA4B,EAAE;QACrEA,GAAsB;IAA1B,IAAIA,CAAAA,GAAsB,GAAtBA,SAAS,CAACC,IAAI,CAACC,OAAO,cAAtBF,GAAsB,WAAM,GAA5BA,KAAAA,CAA4B,GAA5BA,GAAsB,CAAEG,IAAI,EAAE;QAChC,OAAO,CAAC,EAAEH,SAAS,CAACC,IAAI,CAACC,OAAO,CAACC,IAAI,CAAC,MAAM,EAAEH,SAAS,CAACI,QAAQ,CAACD,IAAI,CAAC,CAAC,CAAC,CAAC;IAC3E,CAAC;IACD,OAAOH,SAAS,CAACI,QAAQ,CAACD,IAAI,CAAC;AACjC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@perses-dev/core",
3
- "version": "0.22.0",
3
+ "version": "0.23.1",
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",