@vizzly/api-client 0.0.5 → 0.0.6

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,3 @@
1
+ export declare class FailedToDecryptDashboardBeforeClient extends Error {
2
+ constructor();
3
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FailedToDecryptDashboardBeforeClient = void 0;
4
+ class FailedToDecryptDashboardBeforeClient extends Error {
5
+ constructor() {
6
+ super(`Vizzly offers dashboard encryption to keep your dashboard configurations secure.
7
+ Please ensure your Vizzly Query Engine is still setup to manage encrypted dashboards.`);
8
+ this.name = 'FailedToDecryptDashboardBeforeClient';
9
+ }
10
+ }
11
+ exports.FailedToDecryptDashboardBeforeClient = FailedToDecryptDashboardBeforeClient;
@@ -9,3 +9,4 @@ export * from './SQLPreviewError';
9
9
  export * from './FailedToSetupProject';
10
10
  export * from './FailedToResolveDataSets';
11
11
  export * from './FailedToCreateGlobalLibrary';
12
+ export * from './FailedToDecryptDashboardBeforeClient';
@@ -25,3 +25,4 @@ __exportStar(require("./SQLPreviewError"), exports);
25
25
  __exportStar(require("./FailedToSetupProject"), exports);
26
26
  __exportStar(require("./FailedToResolveDataSets"), exports);
27
27
  __exportStar(require("./FailedToCreateGlobalLibrary"), exports);
28
+ __exportStar(require("./FailedToDecryptDashboardBeforeClient"), exports);
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.DashboardRepository = void 0;
13
13
  const DashboardQuotaReached_1 = require("../errors/DashboardQuotaReached");
14
14
  const FailedToCreateDashboard_1 = require("../errors/FailedToCreateDashboard");
15
+ const FailedToDecryptDashboardBeforeClient_1 = require("../errors/FailedToDecryptDashboardBeforeClient");
15
16
  const FailedToFetchDashboardAccessTokens_1 = require("../errors/FailedToFetchDashboardAccessTokens");
16
17
  const FailedToFetchDashboards_1 = require("../errors/FailedToFetchDashboards");
17
18
  const Permission_1 = require("./Permission");
@@ -71,8 +72,14 @@ class DashboardRepository {
71
72
  const vizzlyApi = this.vizzly.getVizzlyAPI();
72
73
  dashboardResponse = yield vizzlyApi.execute(vizzlyApi.buildFetchDashboardsRequest(permissions.map((p) => p.token)));
73
74
  }
74
- if (dashboardResponse.status === 200)
75
+ if (dashboardResponse.status === 200) {
76
+ dashboardResponse.body.found.forEach((dashboard) => {
77
+ if (typeof dashboard.definition === 'string') {
78
+ throw new FailedToDecryptDashboardBeforeClient_1.FailedToDecryptDashboardBeforeClient();
79
+ }
80
+ });
75
81
  return dashboardResponse.body;
82
+ }
76
83
  throw new FailedToFetchDashboards_1.FailedToFetchDashboards(`Failed to fetch dashboards. Got status code ${dashboardResponse.status}.`);
77
84
  });
78
85
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vizzly/api-client",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "private": false,
5
5
  "license": "NONE",
6
6
  "source": "src/index.ts",