@perses-dev/core 0.23.1 → 0.25.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.
@@ -0,0 +1,16 @@
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
+ });
@@ -18,9 +18,12 @@ _exportStar(require("./dashboard"), exports);
18
18
  _exportStar(require("./datasource"), exports);
19
19
  _exportStar(require("./definitions"), exports);
20
20
  _exportStar(require("./display"), exports);
21
+ _exportStar(require("./http"), exports);
21
22
  _exportStar(require("./layout"), exports);
23
+ _exportStar(require("./notice"), exports);
22
24
  _exportStar(require("./panels"), exports);
23
25
  _exportStar(require("./resource"), exports);
26
+ _exportStar(require("./thresholds"), exports);
24
27
  _exportStar(require("./time"), exports);
25
28
  _exportStar(require("./time-series-queries"), exports);
26
29
  _exportStar(require("./variables"), exports);
@@ -0,0 +1,16 @@
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
+ });
@@ -0,0 +1,16 @@
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
+ });
@@ -42,7 +42,6 @@ async function fetchJson(...args) {
42
42
  class FetchError extends Error {
43
43
  constructor(response){
44
44
  super(`${response.status} ${response.statusText}`);
45
- this.response = response;
46
45
  Object.setPrototypeOf(this, FetchError.prototype);
47
46
  }
48
47
  }
@@ -0,0 +1,2 @@
1
+ export declare type RequestHeaders = Record<string, string>;
2
+ //# sourceMappingURL=http.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/model/http.ts"],"names":[],"mappings":"AAaA,oBAAY,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC"}
@@ -0,0 +1,15 @@
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 { };
14
+
15
+ //# sourceMappingURL=http.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/model/http.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\nexport type RequestHeaders = Record<string, string>;\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,WAAoD"}
@@ -2,11 +2,13 @@ export * from './dashboard';
2
2
  export * from './datasource';
3
3
  export * from './definitions';
4
4
  export * from './display';
5
+ export * from './http';
5
6
  export * from './layout';
7
+ export * from './notice';
6
8
  export * from './panels';
7
9
  export * from './resource';
10
+ export * from './thresholds';
8
11
  export * from './time';
9
12
  export * from './time-series-queries';
10
13
  export * from './variables';
11
- export * from './display';
12
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/model/index.ts"],"names":[],"mappings":"AAaA,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/model/index.ts"],"names":[],"mappings":"AAaA,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC"}
@@ -14,12 +14,14 @@ export * from './dashboard';
14
14
  export * from './datasource';
15
15
  export * from './definitions';
16
16
  export * from './display';
17
+ export * from './http';
17
18
  export * from './layout';
19
+ export * from './notice';
18
20
  export * from './panels';
19
21
  export * from './resource';
22
+ export * from './thresholds';
20
23
  export * from './time';
21
24
  export * from './time-series-queries';
22
25
  export * from './variables';
23
- export * from './display';
24
26
 
25
27
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/model/index.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\nexport * from './dashboard';\nexport * from './datasource';\nexport * from './definitions';\nexport * from './display';\nexport * from './layout';\nexport * from './panels';\nexport * from './resource';\nexport * from './time';\nexport * from './time-series-queries';\nexport * from './variables';\nexport * from './display';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC"}
1
+ {"version":3,"sources":["../../src/model/index.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\nexport * from './dashboard';\nexport * from './datasource';\nexport * from './definitions';\nexport * from './display';\nexport * from './http';\nexport * from './layout';\nexport * from './notice';\nexport * from './panels';\nexport * from './resource';\nexport * from './thresholds';\nexport * from './time';\nexport * from './time-series-queries';\nexport * from './variables';\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC"}
@@ -0,0 +1,6 @@
1
+ export interface Notice {
2
+ type: 'error' | 'info' | 'warning';
3
+ message: string;
4
+ display?: 'tag';
5
+ }
6
+ //# sourceMappingURL=notice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notice.d.ts","sourceRoot":"","sources":["../../src/model/notice.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,KAAK,CAAC;CACjB"}
@@ -0,0 +1,15 @@
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 { };
14
+
15
+ //# sourceMappingURL=notice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/model/notice.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\nexport interface Notice {\n type: 'error' | 'info' | 'warning';\n message: string;\n display?: 'tag'; // TODO: define other action types and alternate display options\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;AAEjC,WAIC"}
@@ -0,0 +1,12 @@
1
+ export interface StepOptions {
2
+ value: number;
3
+ color?: string;
4
+ name?: string;
5
+ }
6
+ export interface ThresholdOptions {
7
+ mode?: 'Percent' | 'Absolute';
8
+ default_color?: string;
9
+ max?: number;
10
+ steps?: StepOptions[];
11
+ }
12
+ //# sourceMappingURL=thresholds.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"thresholds.d.ts","sourceRoot":"","sources":["../../src/model/thresholds.ts"],"names":[],"mappings":"AAaA,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;IAC9B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,WAAW,EAAE,CAAC;CACvB"}
@@ -0,0 +1,15 @@
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 { };
14
+
15
+ //# sourceMappingURL=thresholds.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/model/thresholds.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\nexport interface StepOptions {\n value: number;\n color?: string;\n name?: string;\n}\n\nexport interface ThresholdOptions {\n mode?: 'Percent' | 'Absolute';\n default_color?: string;\n max?: number; // is this same as the max in GaugeChartOptions? can we remove?\n steps?: StepOptions[];\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;AAEjC,WAWC"}
@@ -1,8 +1,11 @@
1
1
  import { Definition, UnknownSpec } from './definitions';
2
+ import { UnixTimeMs } from './time';
2
3
  export interface TimeSeriesQueryDefinition<PluginSpec = UnknownSpec> extends Definition<TimeSeriesQuerySpec<PluginSpec>> {
3
4
  kind: 'TimeSeriesQuery';
4
5
  }
5
6
  export interface TimeSeriesQuerySpec<PluginSpec> {
6
7
  plugin: Definition<PluginSpec>;
7
8
  }
9
+ export declare type TimeSeriesValueTuple = [timestamp: UnixTimeMs, value: number | null];
10
+ export declare type Labels = Record<string, string>;
8
11
  //# sourceMappingURL=time-series-queries.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"time-series-queries.d.ts","sourceRoot":"","sources":["../../src/model/time-series-queries.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAExD,MAAM,WAAW,yBAAyB,CAAC,UAAU,GAAG,WAAW,CACjE,SAAQ,UAAU,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC;IACnD,IAAI,EAAE,iBAAiB,CAAC;CACzB;AAED,MAAM,WAAW,mBAAmB,CAAC,UAAU;IAC7C,MAAM,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;CAChC"}
1
+ {"version":3,"file":"time-series-queries.d.ts","sourceRoot":"","sources":["../../src/model/time-series-queries.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC,MAAM,WAAW,yBAAyB,CAAC,UAAU,GAAG,WAAW,CACjE,SAAQ,UAAU,CAAC,mBAAmB,CAAC,UAAU,CAAC,CAAC;IACnD,IAAI,EAAE,iBAAiB,CAAC;CACzB;AAED,MAAM,WAAW,mBAAmB,CAAC,UAAU;IAC7C,MAAM,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC;CAChC;AAED,oBAAY,oBAAoB,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC;AAEjF,oBAAY,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/model/time-series-queries.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';\n\nexport interface TimeSeriesQueryDefinition<PluginSpec = UnknownSpec>\n extends Definition<TimeSeriesQuerySpec<PluginSpec>> {\n kind: 'TimeSeriesQuery';\n}\n\nexport interface TimeSeriesQuerySpec<PluginSpec> {\n plugin: Definition<PluginSpec>;\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;AAEjC,WASC"}
1
+ {"version":3,"sources":["../../src/model/time-series-queries.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 { UnixTimeMs } from './time';\n\nexport interface TimeSeriesQueryDefinition<PluginSpec = UnknownSpec>\n extends Definition<TimeSeriesQuerySpec<PluginSpec>> {\n kind: 'TimeSeriesQuery';\n}\n\nexport interface TimeSeriesQuerySpec<PluginSpec> {\n plugin: Definition<PluginSpec>;\n}\n\nexport type TimeSeriesValueTuple = [timestamp: UnixTimeMs, value: number | null];\n\nexport type Labels = Record<string, string>;\n"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,WAc4C"}
@@ -12,7 +12,6 @@ export declare function fetchJson<T>(...args: Parameters<typeof global.fetch>):
12
12
  * Error thrown when fetch returns a non-200 response.
13
13
  */
14
14
  export declare class FetchError extends Error {
15
- readonly response: Response;
16
- constructor(response: Response);
15
+ constructor(response: Readonly<Response>);
17
16
  }
18
17
  //# sourceMappingURL=fetch.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../src/utils/fetch.ts"],"names":[],"mappings":"AAaA;;GAEG;AACH,wBAAsB,KAAK,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,OAAO,MAAM,CAAC,KAAK,CAAC,qBAMnE;AAED;;;;GAIG;AACH,wBAAsB,SAAS,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,UAAU,CAAC,OAAO,MAAM,CAAC,KAAK,CAAC,cAI1E;AAED;;GAEG;AACH,qBAAa,UAAW,SAAQ,KAAK;IACvB,QAAQ,CAAC,QAAQ,EAAE,QAAQ;gBAAlB,QAAQ,EAAE,QAAQ;CAIxC"}
1
+ {"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../src/utils/fetch.ts"],"names":[],"mappings":"AAaA;;GAEG;AACH,wBAAsB,KAAK,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,OAAO,MAAM,CAAC,KAAK,CAAC,qBAMnE;AAED;;;;GAIG;AACH,wBAAsB,SAAS,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,UAAU,CAAC,OAAO,MAAM,CAAC,KAAK,CAAC,cAI1E;AAED;;GAEG;AACH,qBAAa,UAAW,SAAQ,KAAK;gBACvB,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC;CAIzC"}
@@ -33,7 +33,6 @@
33
33
  */ export class FetchError extends Error {
34
34
  constructor(response){
35
35
  super(`${response.status} ${response.statusText}`);
36
- this.response = response;
37
36
  Object.setPrototypeOf(this, FetchError.prototype);
38
37
  }
39
38
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/fetch.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n/**\n * Calls `global.fetch`, but throws a `FetchError` for non-200 responses.\n */\nexport async function fetch(...args: Parameters<typeof global.fetch>) {\n const response = await global.fetch(...args);\n if (response.ok === false) {\n throw new FetchError(response);\n }\n return response;\n}\n\n/**\n * Calls `global.fetch` and throws a `FetchError` on non-200 responses, but also\n * decodes the response body as JSON, casting it to type `T`. Returns the\n * decoded body.\n */\nexport async function fetchJson<T>(...args: Parameters<typeof global.fetch>) {\n const response = await fetch(...args);\n const json: T = await response.json();\n return json;\n}\n\n/**\n * Error thrown when fetch returns a non-200 response.\n */\nexport class FetchError extends Error {\n constructor(readonly response: Response) {\n super(`${response.status} ${response.statusText}`);\n Object.setPrototypeOf(this, FetchError.prototype);\n }\n}\n"],"names":["fetch","args","response","global","ok","FetchError","fetchJson","json","Error","constructor","status","statusText","Object","setPrototypeOf","prototype"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC;;CAEC,GACD,OAAO,eAAeA,KAAK,CAAC,GAAGC,IAAI,AAAiC,EAAE;IACpE,MAAMC,QAAQ,GAAG,MAAMC,MAAM,CAACH,KAAK,IAAIC,IAAI,CAAC,AAAC;IAC7C,IAAIC,QAAQ,CAACE,EAAE,KAAK,KAAK,EAAE;QACzB,MAAM,IAAIC,UAAU,CAACH,QAAQ,CAAC,CAAC;IACjC,CAAC;IACD,OAAOA,QAAQ,CAAC;AAClB,CAAC;AAED;;;;CAIC,GACD,OAAO,eAAeI,SAAS,CAAI,GAAGL,IAAI,AAAiC,EAAE;IAC3E,MAAMC,QAAQ,GAAG,MAAMF,KAAK,IAAIC,IAAI,CAAC,AAAC;IACtC,MAAMM,IAAI,GAAM,MAAML,QAAQ,CAACK,IAAI,EAAE,AAAC;IACtC,OAAOA,IAAI,CAAC;AACd,CAAC;AAED;;CAEC,GACD,OAAO,MAAMF,UAAU,SAASG,KAAK;IACnCC,YAAqBP,QAAkB,CAAE;QACvC,KAAK,CAAC,CAAC,EAAEA,QAAQ,CAACQ,MAAM,CAAC,CAAC,EAAER,QAAQ,CAACS,UAAU,CAAC,CAAC,CAAC,CAAC;QADhCT,gBAAAA,QAAkB,CAAA;QAErCU,MAAM,CAACC,cAAc,CAAC,IAAI,EAAER,UAAU,CAACS,SAAS,CAAC,CAAC;IACpD;CACD"}
1
+ {"version":3,"sources":["../../src/utils/fetch.ts"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n/**\n * Calls `global.fetch`, but throws a `FetchError` for non-200 responses.\n */\nexport async function fetch(...args: Parameters<typeof global.fetch>) {\n const response = await global.fetch(...args);\n if (response.ok === false) {\n throw new FetchError(response);\n }\n return response;\n}\n\n/**\n * Calls `global.fetch` and throws a `FetchError` on non-200 responses, but also\n * decodes the response body as JSON, casting it to type `T`. Returns the\n * decoded body.\n */\nexport async function fetchJson<T>(...args: Parameters<typeof global.fetch>) {\n const response = await fetch(...args);\n const json: T = await response.json();\n return json;\n}\n\n/**\n * Error thrown when fetch returns a non-200 response.\n */\nexport class FetchError extends Error {\n constructor(response: Readonly<Response>) {\n super(`${response.status} ${response.statusText}`);\n Object.setPrototypeOf(this, FetchError.prototype);\n }\n}\n"],"names":["fetch","args","response","global","ok","FetchError","fetchJson","json","Error","constructor","status","statusText","Object","setPrototypeOf","prototype"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC;;CAEC,GACD,OAAO,eAAeA,KAAK,CAAC,GAAGC,IAAI,AAAiC,EAAE;IACpE,MAAMC,QAAQ,GAAG,MAAMC,MAAM,CAACH,KAAK,IAAIC,IAAI,CAAC,AAAC;IAC7C,IAAIC,QAAQ,CAACE,EAAE,KAAK,KAAK,EAAE;QACzB,MAAM,IAAIC,UAAU,CAACH,QAAQ,CAAC,CAAC;IACjC,CAAC;IACD,OAAOA,QAAQ,CAAC;AAClB,CAAC;AAED;;;;CAIC,GACD,OAAO,eAAeI,SAAS,CAAI,GAAGL,IAAI,AAAiC,EAAE;IAC3E,MAAMC,QAAQ,GAAG,MAAMF,KAAK,IAAIC,IAAI,CAAC,AAAC;IACtC,MAAMM,IAAI,GAAM,MAAML,QAAQ,CAACK,IAAI,EAAE,AAAC;IACtC,OAAOA,IAAI,CAAC;AACd,CAAC;AAED;;CAEC,GACD,OAAO,MAAMF,UAAU,SAASG,KAAK;IACnCC,YAAYP,QAA4B,CAAE;QACxC,KAAK,CAAC,CAAC,EAAEA,QAAQ,CAACQ,MAAM,CAAC,CAAC,EAAER,QAAQ,CAACS,UAAU,CAAC,CAAC,CAAC,CAAC;QACnDC,MAAM,CAACC,cAAc,CAAC,IAAI,EAAER,UAAU,CAACS,SAAS,CAAC,CAAC;IACpD;CACD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@perses-dev/core",
3
- "version": "0.23.1",
3
+ "version": "0.25.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",
@@ -20,7 +20,8 @@
20
20
  "build": "concurrently \"npm:build:*\"",
21
21
  "build:cjs": "swc ./src -d dist/cjs --config-file ../.cjs.swcrc",
22
22
  "build:esm": "swc ./src -d dist --config-file ../.swcrc",
23
- "build:types": "tsc --emitDeclarationOnly --declaration --preserveWatchOutput",
23
+ "build:types": "tsc --project tsconfig.build.json",
24
+ "type-check": "tsc --noEmit",
24
25
  "start": "concurrently -P \"npm:build:* -- {*}\" -- --watch",
25
26
  "test": "echo 'no test to run' && exit 0",
26
27
  "lint": "eslint src --ext .ts,.tsx",