@vizzly/api-client 0.0.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.
Files changed (58) hide show
  1. package/README.md +1 -0
  2. package/dist/errors/DashboardQuotaReached.d.ts +3 -0
  3. package/dist/errors/DashboardQuotaReached.js +10 -0
  4. package/dist/errors/FailedToCreateDashboard.d.ts +3 -0
  5. package/dist/errors/FailedToCreateDashboard.js +10 -0
  6. package/dist/errors/FailedToFetchDashboardAccessTokens.d.ts +3 -0
  7. package/dist/errors/FailedToFetchDashboardAccessTokens.js +10 -0
  8. package/dist/errors/FailedToFetchDashboards.d.ts +3 -0
  9. package/dist/errors/FailedToFetchDashboards.js +10 -0
  10. package/dist/errors/FailedToFetchGlobalLibraries.d.ts +3 -0
  11. package/dist/errors/FailedToFetchGlobalLibraries.js +10 -0
  12. package/dist/errors/FailedToFetchGlobalLibraryAccessTokens.d.ts +3 -0
  13. package/dist/errors/FailedToFetchGlobalLibraryAccessTokens.js +10 -0
  14. package/dist/errors/FailedToResolveDataSets.d.ts +3 -0
  15. package/dist/errors/FailedToResolveDataSets.js +10 -0
  16. package/dist/errors/FailedToSetupProject.d.ts +3 -0
  17. package/dist/errors/FailedToSetupProject.js +10 -0
  18. package/dist/errors/MissingAuthParameter.d.ts +4 -0
  19. package/dist/errors/MissingAuthParameter.js +9 -0
  20. package/dist/errors/MissingRequiredVizzlyQueryEngineApi.d.ts +2 -0
  21. package/dist/errors/MissingRequiredVizzlyQueryEngineApi.js +6 -0
  22. package/dist/errors/SQLPreviewError.d.ts +4 -0
  23. package/dist/errors/SQLPreviewError.js +11 -0
  24. package/dist/errors/ValidationError.d.ts +3 -0
  25. package/dist/errors/ValidationError.js +10 -0
  26. package/dist/errors/index.d.ts +10 -0
  27. package/dist/errors/index.js +26 -0
  28. package/dist/index.d.ts +8 -0
  29. package/dist/index.js +37 -0
  30. package/dist/interfaces/iSerialize.d.ts +10 -0
  31. package/dist/interfaces/iSerialize.js +1 -0
  32. package/dist/models/Api.d.ts +9 -0
  33. package/dist/models/Api.js +47 -0
  34. package/dist/models/Authentication.d.ts +16 -0
  35. package/dist/models/Authentication.js +98 -0
  36. package/dist/models/Dashboard.d.ts +24 -0
  37. package/dist/models/Dashboard.js +156 -0
  38. package/dist/models/DashboardRepository.d.ts +41 -0
  39. package/dist/models/DashboardRepository.js +92 -0
  40. package/dist/models/GlobalLibraryRepository.d.ts +35 -0
  41. package/dist/models/GlobalLibraryRepository.js +106 -0
  42. package/dist/models/ImplementationStrategy.d.ts +9 -0
  43. package/dist/models/ImplementationStrategy.js +18 -0
  44. package/dist/models/Permission.d.ts +26 -0
  45. package/dist/models/Permission.js +22 -0
  46. package/dist/models/Vizzly.d.ts +17 -0
  47. package/dist/models/Vizzly.js +39 -0
  48. package/dist/models/VizzlyApi.d.ts +77 -0
  49. package/dist/models/VizzlyApi.js +423 -0
  50. package/dist/models/VizzlyAppApi.d.ts +54 -0
  51. package/dist/models/VizzlyAppApi.js +348 -0
  52. package/dist/models/VizzlyQueryEngineApi.d.ts +50 -0
  53. package/dist/models/VizzlyQueryEngineApi.js +311 -0
  54. package/dist/types/dashboard.d.ts +23 -0
  55. package/dist/types/dashboard.js +2 -0
  56. package/dist/types.d.ts +405 -0
  57. package/dist/types.js +17 -0
  58. package/package.json +37 -0
@@ -0,0 +1,348 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.VizzlyAppApi = void 0;
13
+ const Api_1 = require("./Api");
14
+ class VizzlyAppApi extends Api_1.Api {
15
+ constructor(auth, host = 'https://app.vizzly.co') {
16
+ super(auth, host);
17
+ }
18
+ createCliAuthToken() {
19
+ return __awaiter(this, void 0, void 0, function* () {
20
+ return yield this.execute(this.buildCreateCliAuthTokenRequest());
21
+ });
22
+ }
23
+ buildCreateCliAuthTokenRequest() {
24
+ return {
25
+ path: '/api/create-cli-auth-token',
26
+ method: 'post',
27
+ body: {},
28
+ };
29
+ }
30
+ createInstantDashboard(params) {
31
+ return __awaiter(this, void 0, void 0, function* () {
32
+ return yield this.execute(this.buildCreateInstantDashboardRequest(params));
33
+ });
34
+ }
35
+ buildCreateInstantDashboardRequest(params) {
36
+ return {
37
+ path: '/api/v2/instant-dashboard',
38
+ method: 'post',
39
+ body: {
40
+ parent_dashboard_definition: params.definition,
41
+ },
42
+ };
43
+ }
44
+ createProjectAdminOverrideAccessToken(params) {
45
+ return __awaiter(this, void 0, void 0, function* () {
46
+ return yield this.execute(this.buildCreateProjectAdminOverrideAccessTokenRequest(params));
47
+ });
48
+ }
49
+ buildCreateProjectAdminOverrideAccessTokenRequest(params) {
50
+ return {
51
+ path: `/api/v2/project/${params.projectId}/admin-override`,
52
+ method: 'post',
53
+ body: {},
54
+ };
55
+ }
56
+ startEmailChange(params) {
57
+ return __awaiter(this, void 0, void 0, function* () {
58
+ return yield this.execute(this.buildStartEmailChangeRequest(params));
59
+ });
60
+ }
61
+ buildStartEmailChangeRequest(params) {
62
+ return {
63
+ path: '/api/self/start-email-change',
64
+ method: 'post',
65
+ body: {
66
+ email: params.email,
67
+ },
68
+ };
69
+ }
70
+ completeEmailChange(params) {
71
+ return __awaiter(this, void 0, void 0, function* () {
72
+ return yield this.execute(this.buildCompleteEmailChangeRequest(params));
73
+ });
74
+ }
75
+ buildCompleteEmailChangeRequest(params) {
76
+ return {
77
+ path: '/api/self/complete-email-change',
78
+ method: 'post',
79
+ body: {
80
+ token: params.token,
81
+ },
82
+ };
83
+ }
84
+ getManagedQueryEngineAccessTokens(params) {
85
+ return __awaiter(this, void 0, void 0, function* () {
86
+ return yield this.execute(this.buildGetManagedQueryEngineAccessTokensRequest(params));
87
+ });
88
+ }
89
+ buildGetManagedQueryEngineAccessTokensRequest(params) {
90
+ return {
91
+ path: `/api/v2/managed-query-engine/${params.managedQueryEngineId}/identity`,
92
+ method: 'get',
93
+ };
94
+ }
95
+ getParentDashboardMeta(params) {
96
+ return __awaiter(this, void 0, void 0, function* () {
97
+ return yield this.execute(this.buildGetParentDashboardMetaRequest(params));
98
+ });
99
+ }
100
+ buildGetParentDashboardMetaRequest(params) {
101
+ return {
102
+ path: `/api/v2/parent-dashboard/${params.dashboardId}/stats`,
103
+ method: 'get',
104
+ };
105
+ }
106
+ updateParentDashboard(params) {
107
+ return __awaiter(this, void 0, void 0, function* () {
108
+ return yield this.execute(this.buildUpdateParentDashboardRequest(params));
109
+ });
110
+ }
111
+ buildUpdateParentDashboardRequest(params) {
112
+ return {
113
+ path: `/api/v2/parent-dashboard/${params.dashboardId}/stats`,
114
+ method: 'put',
115
+ body: {
116
+ name: params.name,
117
+ definition: params.definition,
118
+ meta: params.meta,
119
+ deleted: params.deleted,
120
+ webhookId: params.webhookId,
121
+ },
122
+ };
123
+ }
124
+ getProjectMeta(params) {
125
+ return __awaiter(this, void 0, void 0, function* () {
126
+ return yield this.execute(this.buildGetProjectMetaRequest(params));
127
+ });
128
+ }
129
+ buildGetProjectMetaRequest(params) {
130
+ return {
131
+ path: `/api/v2/project/${params.projectId}/meta`,
132
+ method: 'get',
133
+ };
134
+ }
135
+ getSelf() {
136
+ return __awaiter(this, void 0, void 0, function* () {
137
+ return yield this.execute(this.buildGetSelfRequest());
138
+ });
139
+ }
140
+ buildGetSelfRequest() {
141
+ return {
142
+ path: `/api/self`,
143
+ method: 'get',
144
+ };
145
+ }
146
+ getTeam() {
147
+ return __awaiter(this, void 0, void 0, function* () {
148
+ return yield this.execute(this.buildGetTeamRequest());
149
+ });
150
+ }
151
+ buildGetTeamRequest() {
152
+ return {
153
+ path: `/api/team`,
154
+ method: 'get',
155
+ };
156
+ }
157
+ getWebhooks() {
158
+ return __awaiter(this, void 0, void 0, function* () {
159
+ return yield this.execute(this.buildGetWebhooksRequest());
160
+ });
161
+ }
162
+ buildGetWebhooksRequest() {
163
+ return {
164
+ path: '/api/organisation/webhooks',
165
+ method: 'get',
166
+ };
167
+ }
168
+ inviteTeamMember(params) {
169
+ return __awaiter(this, void 0, void 0, function* () {
170
+ return yield this.execute(this.buildInviteTeamMemberRequest(params));
171
+ });
172
+ }
173
+ buildInviteTeamMemberRequest(params) {
174
+ return {
175
+ path: '/api/invite',
176
+ method: 'post',
177
+ body: {
178
+ email: params.email,
179
+ first_name: params.firstName,
180
+ last_name: params.lastName,
181
+ department: params.department,
182
+ },
183
+ };
184
+ }
185
+ inAppAcceptTeamMemberInvite(params) {
186
+ return __awaiter(this, void 0, void 0, function* () {
187
+ return yield this.execute(this.buildInAppAcceptTeamMemberInviteRequest(params));
188
+ });
189
+ }
190
+ buildInAppAcceptTeamMemberInviteRequest(params) {
191
+ return {
192
+ path: '/api/invite/in-app-accept',
193
+ method: 'post',
194
+ body: {
195
+ team_member_id: params.teamMemberId,
196
+ },
197
+ };
198
+ }
199
+ acceptTeamMemberInvite(params) {
200
+ return __awaiter(this, void 0, void 0, function* () {
201
+ return yield this.execute(this.buildAcceptTeamMemberInviteRequest(params));
202
+ });
203
+ }
204
+ buildAcceptTeamMemberInviteRequest(params) {
205
+ return {
206
+ path: '/api/invite/accept',
207
+ method: 'post',
208
+ body: {
209
+ token: params.inviteToken,
210
+ },
211
+ };
212
+ }
213
+ resendTeamMemberInvite(params) {
214
+ return __awaiter(this, void 0, void 0, function* () {
215
+ return yield this.execute(this.buildResendTeamMemberInviteRequest(params));
216
+ });
217
+ }
218
+ buildResendTeamMemberInviteRequest(params) {
219
+ return {
220
+ path: '/api/invite/resend',
221
+ method: 'post',
222
+ body: {
223
+ team_member_id: params.teamMemberId,
224
+ },
225
+ };
226
+ }
227
+ removeTeamMember(params) {
228
+ return __awaiter(this, void 0, void 0, function* () {
229
+ return yield this.execute(this.buildRemoveTeamMemberRequest(params));
230
+ });
231
+ }
232
+ buildRemoveTeamMemberRequest(params) {
233
+ return {
234
+ path: '/api/invite/remove',
235
+ method: 'post',
236
+ body: {
237
+ team_member_id: params.teamMemberId,
238
+ },
239
+ };
240
+ }
241
+ startSignIn(params) {
242
+ return __awaiter(this, void 0, void 0, function* () {
243
+ return yield this.execute(this.buildStartSignInRequest(params));
244
+ });
245
+ }
246
+ buildStartSignInRequest(params) {
247
+ return {
248
+ path: '/api/start-sign-in',
249
+ method: 'post',
250
+ body: {
251
+ email: params.email,
252
+ },
253
+ };
254
+ }
255
+ completeSignIn(params) {
256
+ return __awaiter(this, void 0, void 0, function* () {
257
+ return yield this.execute(this.buildCompleteSignInRequest(params));
258
+ });
259
+ }
260
+ buildCompleteSignInRequest(params) {
261
+ return {
262
+ path: '/api/complete-sign-in',
263
+ method: 'post',
264
+ body: {
265
+ token: params.token,
266
+ },
267
+ };
268
+ }
269
+ signUp(params) {
270
+ return __awaiter(this, void 0, void 0, function* () {
271
+ return yield this.execute(this.buildSignUpRequest(params));
272
+ });
273
+ }
274
+ buildSignUpRequest(params) {
275
+ return {
276
+ path: '/api/complete-sign-in',
277
+ method: 'post',
278
+ body: {
279
+ email: params.email,
280
+ organisation_title: params.organisationTitle,
281
+ first_name: params.firstName,
282
+ last_name: params.lastName,
283
+ department: params.department,
284
+ },
285
+ };
286
+ }
287
+ switchOrganisation(params) {
288
+ return __awaiter(this, void 0, void 0, function* () {
289
+ return yield this.execute(this.buildSwitchOrganisationRequest(params));
290
+ });
291
+ }
292
+ buildSwitchOrganisationRequest(params) {
293
+ return {
294
+ path: '/api/team/switch',
295
+ method: 'post',
296
+ body: {
297
+ organisation_id: params.organisationId,
298
+ },
299
+ };
300
+ }
301
+ toggleKeyPairDisabled(params) {
302
+ return __awaiter(this, void 0, void 0, function* () {
303
+ return yield this.execute(this.buildToggleKeyPairDisabledRequest(params));
304
+ });
305
+ }
306
+ buildToggleKeyPairDisabledRequest(params) {
307
+ return {
308
+ path: '/api/organisation/key-pairs/toggle-disabled',
309
+ method: 'post',
310
+ body: {
311
+ key_pair_id: params.keyPairId,
312
+ disabled: params.disabled,
313
+ },
314
+ };
315
+ }
316
+ updateProject(params) {
317
+ return __awaiter(this, void 0, void 0, function* () {
318
+ return yield this.execute(this.buildUpdateProjectRequest(params));
319
+ });
320
+ }
321
+ buildUpdateProjectRequest(params) {
322
+ return {
323
+ path: '/api/v2/project',
324
+ method: 'put',
325
+ body: {
326
+ project_id: params.projectId,
327
+ deleted: params.deleted,
328
+ name: params.name,
329
+ },
330
+ };
331
+ }
332
+ uploadPublicKey(params) {
333
+ return __awaiter(this, void 0, void 0, function* () {
334
+ return yield this.execute(this.buildUploadPublicKeyRequest(params));
335
+ });
336
+ }
337
+ buildUploadPublicKeyRequest(params) {
338
+ return {
339
+ path: '/api/v2/project/key-pair',
340
+ method: 'post',
341
+ body: {
342
+ public_key: params.publicKey,
343
+ project_id: params.projectId,
344
+ },
345
+ };
346
+ }
347
+ }
348
+ exports.VizzlyAppApi = VizzlyAppApi;
@@ -0,0 +1,50 @@
1
+ import { Api } from './Api';
2
+ import { Authentication } from './Authentication';
3
+ import { nVizzlyQueryEngine, Request, extraHeaders, CreateDashboardParams, UpdateDashboardParams } from '../types';
4
+ export declare class VizzlyQueryEngineApi extends Api {
5
+ constructor(auth: Authentication, host: string, extraHeaders?: extraHeaders);
6
+ buildCreateDashboardRequest(params: CreateDashboardParams): Request<CreateDashboardParams & {
7
+ dashboardAccessToken: string;
8
+ }>;
9
+ buildFetchDashboardsRequest(dashboardSessionAccessTokens: string[]): Request<{}>;
10
+ createConfigFromUpload(createConfigFromUploadParams: nVizzlyQueryEngine.CreateConfigFromUploadParams): Promise<import("../types").Response<unknown>>;
11
+ private buildCreateConfigFromUploadRequest;
12
+ createResults(params: nVizzlyQueryEngine.CreateResultsParams): Promise<import("../types").Response<unknown>>;
13
+ private buildCreateResultsRequest;
14
+ createSqlPreview(params: nVizzlyQueryEngine.CreateSqlPreviewParams): Promise<import("../types").Response<{
15
+ message: string;
16
+ }>>;
17
+ buildCreateSqlPreviewRequest(params: nVizzlyQueryEngine.CreateSqlPreviewParams): Request<{}>;
18
+ createQueryEngineUser(params: nVizzlyQueryEngine.CreateQueryEngineUserParams): Promise<import("../types").Response<unknown>>;
19
+ buildCreateQueryEngineUserRequest(params: nVizzlyQueryEngine.CreateQueryEngineUserParams): Request<{}>;
20
+ fetchDataSets(): Promise<import("../types").Response<unknown>>;
21
+ buildFetchDataSetsRequest(): Request<{}>;
22
+ fetchSelfHostedQueryEngineConfig(): Promise<import("../types").Response<unknown>>;
23
+ buildFetchSelfHostedQueryEngineConfigRequest(): Request<{}>;
24
+ fetchProject(): Promise<import("../types").Response<unknown>>;
25
+ buildFetchProjectRequest(): Request<{}>;
26
+ getStarted(params: nVizzlyQueryEngine.GetStartedParams): Promise<import("../types").Response<{
27
+ reason?: string | undefined;
28
+ }>>;
29
+ buildGetStartedRequest(params: nVizzlyQueryEngine.GetStartedParams): Request<{}>;
30
+ getTeamMembers(): Promise<import("../types").Response<unknown>>;
31
+ buildGetTeamMembersRequest(): Request<{}>;
32
+ isVizzly(): Promise<import("../types").Response<unknown>>;
33
+ buildIsVizzlyRequest(): Request<{}>;
34
+ saveConfig(params: nVizzlyQueryEngine.SaveConfigParams): Promise<import("../types").Response<unknown>>;
35
+ buildSaveConfigRequest(params: nVizzlyQueryEngine.SaveConfigParams): Request<{}>;
36
+ saveConnection(params: nVizzlyQueryEngine.SaveConnectionParams): Promise<import("../types").Response<unknown>>;
37
+ buildSaveConnectionRequest(params: nVizzlyQueryEngine.SaveConnectionParams): Request<{}>;
38
+ signInWithQueryEngineAccessToken(): Promise<import("../types").Response<unknown>>;
39
+ buildSignInWithQueryEngineAccessTokenRequest(): Request<{}>;
40
+ signInWithEmailAndPassword(params: nVizzlyQueryEngine.SignInWithEmailAndPasswordParams): Promise<import("../types").Response<unknown>>;
41
+ buildSignInWithEmailAndPasswordRequest(params: nVizzlyQueryEngine.SignInWithEmailAndPasswordParams): Request<{}>;
42
+ status(): Promise<import("../types").Response<unknown>>;
43
+ buildStatusRequest(): Request<{}>;
44
+ updateDashboard(params: UpdateDashboardParams): Promise<import("../types").Response<unknown>>;
45
+ buildUpdateDashboardRequest(params: UpdateDashboardParams): Request<{}>;
46
+ updateQueryEngineUser(params: nVizzlyQueryEngine.UpdateQueryEngineUserParams): Promise<import("../types").Response<unknown>>;
47
+ buildUpdateQueryEngineUserRequest(params: nVizzlyQueryEngine.UpdateQueryEngineUserParams): Request<{}>;
48
+ uploadDataToVizzlyCloud(params: nVizzlyQueryEngine.UploadDataToVizzlyCloudParams): Promise<import("../types").Response<unknown>>;
49
+ buildUploadDataToVizzlyCloudRequest(params: nVizzlyQueryEngine.UploadDataToVizzlyCloudParams): Request<{}>;
50
+ }