@vizzly/api-client 0.0.39 → 0.0.41
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Api } from './Api';
|
|
2
2
|
import { Authentication } from './Authentication';
|
|
3
|
-
import { CreateDashboardParams, CreateGlobalLibraryParams, GlobalLibrary, GlobalLibraryPermissionFromAPI, QueryEngineUserFromAPI, Request, RequestParams, TeamMemberFromAPI, UpdateDashboardParams, UpdateDashboardResponseBody, UpdateGlobalLibraryParams } from '../types';
|
|
3
|
+
import { CreateDashboardParams, CreateGlobalLibraryParams, GlobalLibrary, GlobalLibraryPermissionFromAPI, PersistedReport, QueryEngineUserFromAPI, Request, RequestParams, TeamMemberFromAPI, UpdateDashboardParams, UpdateDashboardResponseBody, UpdateGlobalLibraryParams } from '../types';
|
|
4
4
|
import { nVizzlyApi } from '../types';
|
|
5
5
|
import { ProjectFromAPI } from '../types/project';
|
|
6
6
|
export declare class VizzlyApi extends Api {
|
|
@@ -93,7 +93,13 @@ export declare class VizzlyApi extends Api {
|
|
|
93
93
|
buildSaveConnectionRequest(params: RequestParams<nVizzlyApi.SaveConnectionParams>): Request<{}>;
|
|
94
94
|
saveEncryptedProjectEncryptionSecret(params: RequestParams<nVizzlyApi.SaveEncryptedProjectEncryptionSecretParams>): Promise<boolean>;
|
|
95
95
|
buildSaveEncryptedProjectEncryptionSecretRequest(params: RequestParams<nVizzlyApi.SaveEncryptedProjectEncryptionSecretParams>): Request<{}>;
|
|
96
|
-
|
|
96
|
+
getScheduledReports(params: RequestParams<nVizzlyApi.GetScheduledReportParams>): Promise<import("../types").Response<{
|
|
97
|
+
reports: Array<PersistedReport>;
|
|
98
|
+
}>>;
|
|
99
|
+
buildGetScheduledReports(params: RequestParams<nVizzlyApi.GetScheduledReportParams>): Request<{}>;
|
|
100
|
+
saveScheduledReport(params: RequestParams<nVizzlyApi.SaveScheduledReportParams>): Promise<import("../types").Response<{
|
|
101
|
+
report: PersistedReport;
|
|
102
|
+
}>>;
|
|
97
103
|
buildSaveScheduledReportRequest(params: RequestParams<nVizzlyApi.SaveScheduledReportParams>): Request<{}>;
|
|
98
104
|
updateDashboard(params: RequestParams<UpdateDashboardParams>): Promise<import("../types").Response<UpdateDashboardResponseBody>>;
|
|
99
105
|
buildUpdateDashboardRequest(params: RequestParams<UpdateDashboardParams>): Request<{}>;
|
package/dist/models/VizzlyApi.js
CHANGED
|
@@ -422,6 +422,21 @@ class VizzlyApi extends Api_1.Api {
|
|
|
422
422
|
acceptedAuthParams: ['projectApiKey', 'projectAccessToken'],
|
|
423
423
|
};
|
|
424
424
|
}
|
|
425
|
+
getScheduledReports(params) {
|
|
426
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
427
|
+
return yield this.execute(this.buildGetScheduledReports(params));
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
buildGetScheduledReports(params) {
|
|
431
|
+
return {
|
|
432
|
+
path: '/api/scheduled-report/collect',
|
|
433
|
+
method: 'post',
|
|
434
|
+
body: {
|
|
435
|
+
dashboardAccessToken: params.dashboardAccessToken,
|
|
436
|
+
},
|
|
437
|
+
abortSignal: params.abortSignal,
|
|
438
|
+
};
|
|
439
|
+
}
|
|
425
440
|
saveScheduledReport(params) {
|
|
426
441
|
return __awaiter(this, void 0, void 0, function* () {
|
|
427
442
|
return yield this.execute(this.buildSaveScheduledReportRequest(params));
|
|
@@ -433,7 +448,7 @@ class VizzlyApi extends Api_1.Api {
|
|
|
433
448
|
method: 'post',
|
|
434
449
|
body: {
|
|
435
450
|
cronSchedule: params.cronSchedule,
|
|
436
|
-
dashboardAccessToken:
|
|
451
|
+
dashboardAccessToken: params.dashboardAccessToken,
|
|
437
452
|
scheduledReportId: params.scheduledReportId,
|
|
438
453
|
},
|
|
439
454
|
abortSignal: params.abortSignal,
|
|
@@ -41,6 +41,19 @@ export declare class VizzlyAppApi extends Api {
|
|
|
41
41
|
buildStartSignInRequest(params: nVizzlyAppApi.StartSignInParams): Request<{}>;
|
|
42
42
|
completeSignIn(params: nVizzlyAppApi.CompleteSignInParams): Promise<import("../types").Response<unknown>>;
|
|
43
43
|
buildCompleteSignInRequest(params: nVizzlyAppApi.CompleteSignInParams): Request<{}>;
|
|
44
|
+
searchUserDashboards(params: nVizzlyAppApi.SearchUserDashboardsParams): Promise<import("../types").Response<{
|
|
45
|
+
search_results: Array<{
|
|
46
|
+
id: string;
|
|
47
|
+
parent_dashboard_id: string | null;
|
|
48
|
+
parent_dashboard_name: string | null;
|
|
49
|
+
scope: 'read' | 'read_write';
|
|
50
|
+
user_reference: string;
|
|
51
|
+
permission_created_at: string;
|
|
52
|
+
dashboard_created_at: string;
|
|
53
|
+
dashboard_updated_at: string;
|
|
54
|
+
}>;
|
|
55
|
+
}>>;
|
|
56
|
+
buildSearchUserDashboardsRequest(params: nVizzlyAppApi.SearchUserDashboardsParams): Request<{}>;
|
|
44
57
|
signUp(params: nVizzlyAppApi.SignUpParams): Promise<import("../types").Response<unknown>>;
|
|
45
58
|
buildSignUpRequest(params: nVizzlyAppApi.SignUpParams): Request<{}>;
|
|
46
59
|
switchOrganisation(params: nVizzlyAppApi.SwitchOrganisationParams): Promise<import("../types").Response<unknown>>;
|
|
@@ -266,6 +266,17 @@ class VizzlyAppApi extends Api_1.Api {
|
|
|
266
266
|
},
|
|
267
267
|
};
|
|
268
268
|
}
|
|
269
|
+
searchUserDashboards(params) {
|
|
270
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
271
|
+
return yield this.execute(this.buildSearchUserDashboardsRequest(params));
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
buildSearchUserDashboardsRequest(params) {
|
|
275
|
+
return {
|
|
276
|
+
path: `/api/v2/project/${params.projectId}/search-user-dashboards?user_reference=${params.userReference}`,
|
|
277
|
+
method: 'get',
|
|
278
|
+
};
|
|
279
|
+
}
|
|
269
280
|
signUp(params) {
|
|
270
281
|
return __awaiter(this, void 0, void 0, function* () {
|
|
271
282
|
return yield this.execute(this.buildSignUpRequest(params));
|
package/dist/types.d.ts
CHANGED
|
@@ -11,6 +11,14 @@ export type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
|
11
11
|
export type UpdateDashboardResponseBody = {
|
|
12
12
|
dashboard: DashboardFromAPI;
|
|
13
13
|
};
|
|
14
|
+
export type PersistedReport = {
|
|
15
|
+
id: string;
|
|
16
|
+
dashboard_id: string;
|
|
17
|
+
organisation_id: string;
|
|
18
|
+
schedule: string;
|
|
19
|
+
type: 'scheduled';
|
|
20
|
+
user_reference: string;
|
|
21
|
+
};
|
|
14
22
|
export type Response<T> = {
|
|
15
23
|
status: number;
|
|
16
24
|
headers: Headers;
|
|
@@ -126,6 +134,9 @@ export declare namespace nVizzlyQueryEngine {
|
|
|
126
134
|
};
|
|
127
135
|
}
|
|
128
136
|
export declare namespace nVizzlyApi {
|
|
137
|
+
type GetScheduledReportParams = {
|
|
138
|
+
dashboardAccessToken: string;
|
|
139
|
+
};
|
|
129
140
|
type CreateParentDashboardParams = {
|
|
130
141
|
definition: any;
|
|
131
142
|
projectId: string;
|
|
@@ -155,7 +166,8 @@ export declare namespace nVizzlyApi {
|
|
|
155
166
|
name?: string;
|
|
156
167
|
};
|
|
157
168
|
type SaveScheduledReportParams = {
|
|
158
|
-
|
|
169
|
+
dashboardAccessToken: string;
|
|
170
|
+
cronSchedule: string | null;
|
|
159
171
|
scheduledReportId: string;
|
|
160
172
|
};
|
|
161
173
|
type SaveEncryptedProjectEncryptionSecretParams = {
|
|
@@ -204,6 +216,10 @@ export declare namespace nVizzlyApi {
|
|
|
204
216
|
};
|
|
205
217
|
}
|
|
206
218
|
export declare namespace nVizzlyAppApi {
|
|
219
|
+
type SearchUserDashboardsParams = {
|
|
220
|
+
projectId: string;
|
|
221
|
+
userReference: string;
|
|
222
|
+
};
|
|
207
223
|
type CreateInstantDashboardParams = {
|
|
208
224
|
definition: Object;
|
|
209
225
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vizzly/api-client",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.41",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "NONE",
|
|
6
6
|
"source": "src/index.ts",
|
|
@@ -25,7 +25,8 @@
|
|
|
25
25
|
"uuid": "^9.0.1"
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
|
-
"test": "jest",
|
|
28
|
+
"test": ". ./secrets.env && jest",
|
|
29
|
+
"test:ci": "jest",
|
|
29
30
|
"build": "rm -rf ./dist && tsc",
|
|
30
31
|
"dev": "tsc -w",
|
|
31
32
|
"format": "prettier --write ./src/** ./__tests__/**",
|