@internxt/sdk 1.8.0 → 1.8.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.
- package/dist/auth/index.d.ts +7 -3
- package/dist/auth/index.js +16 -9
- package/dist/workspaces/index.d.ts +4 -3
- package/dist/workspaces/index.js +24 -0
- package/dist/workspaces/types.d.ts +69 -0
- package/dist/workspaces/types.js +23 -0
- package/package.json +1 -1
package/dist/auth/index.d.ts
CHANGED
|
@@ -63,22 +63,26 @@ export declare class Auth {
|
|
|
63
63
|
* @param email
|
|
64
64
|
*/
|
|
65
65
|
securityDetails(email: string): Promise<SecurityDetails>;
|
|
66
|
+
/**
|
|
67
|
+
* Logout
|
|
68
|
+
*/
|
|
69
|
+
logout(token?: Token): Promise<void>;
|
|
66
70
|
/**
|
|
67
71
|
* Generates a new TwoFactorAuth code
|
|
68
72
|
*/
|
|
69
|
-
generateTwoFactorAuthQR(): Promise<TwoFactorAuthQR>;
|
|
73
|
+
generateTwoFactorAuthQR(token?: Token): Promise<TwoFactorAuthQR>;
|
|
70
74
|
/**
|
|
71
75
|
* Disables TwoFactorAuthentication
|
|
72
76
|
* @param pass
|
|
73
77
|
* @param code
|
|
74
78
|
*/
|
|
75
|
-
disableTwoFactorAuth(pass: string, code: string): Promise<void>;
|
|
79
|
+
disableTwoFactorAuth(pass: string, code: string, token?: Token): Promise<void>;
|
|
76
80
|
/**
|
|
77
81
|
* Store TwoFactorAuthentication details
|
|
78
82
|
* @param backupKey
|
|
79
83
|
* @param code
|
|
80
84
|
*/
|
|
81
|
-
storeTwoFactorAuthKey(backupKey: string, code: string): Promise<void>;
|
|
85
|
+
storeTwoFactorAuthKey(backupKey: string, code: string, token?: Token): Promise<void>;
|
|
82
86
|
/**
|
|
83
87
|
* Sends request to send the email to delete the account
|
|
84
88
|
* @param email
|
package/dist/auth/index.js
CHANGED
|
@@ -145,7 +145,7 @@ var Auth = /** @class */ (function () {
|
|
|
145
145
|
case 2:
|
|
146
146
|
keys = _a.sent();
|
|
147
147
|
return [2 /*return*/, this.client
|
|
148
|
-
.post('/access', {
|
|
148
|
+
.post('/auth/login/access', {
|
|
149
149
|
email: details.email,
|
|
150
150
|
password: encryptedPasswordHash,
|
|
151
151
|
tfa: details.tfaCode,
|
|
@@ -181,7 +181,7 @@ var Auth = /** @class */ (function () {
|
|
|
181
181
|
*/
|
|
182
182
|
Auth.prototype.securityDetails = function (email) {
|
|
183
183
|
return this.client
|
|
184
|
-
.post('/login', {
|
|
184
|
+
.post('/auth/login', {
|
|
185
185
|
email: email,
|
|
186
186
|
}, this.basicHeaders())
|
|
187
187
|
.then(function (data) {
|
|
@@ -191,13 +191,20 @@ var Auth = /** @class */ (function () {
|
|
|
191
191
|
};
|
|
192
192
|
});
|
|
193
193
|
};
|
|
194
|
+
/**
|
|
195
|
+
* Logout
|
|
196
|
+
*/
|
|
197
|
+
Auth.prototype.logout = function (token) {
|
|
198
|
+
var _a;
|
|
199
|
+
return this.client.get('/auth/logout', this.headersWithToken(token !== null && token !== void 0 ? token : (_a = this.apiSecurity) === null || _a === void 0 ? void 0 : _a.token));
|
|
200
|
+
};
|
|
194
201
|
/**
|
|
195
202
|
* Generates a new TwoFactorAuth code
|
|
196
203
|
*/
|
|
197
|
-
Auth.prototype.generateTwoFactorAuthQR = function () {
|
|
204
|
+
Auth.prototype.generateTwoFactorAuthQR = function (token) {
|
|
198
205
|
var _a;
|
|
199
206
|
return this.client
|
|
200
|
-
.get('/tfa', this.headersWithToken((_a = this.apiSecurity) === null || _a === void 0 ? void 0 : _a.token))
|
|
207
|
+
.get('/auth/tfa', this.headersWithToken(token !== null && token !== void 0 ? token : (_a = this.apiSecurity) === null || _a === void 0 ? void 0 : _a.token))
|
|
201
208
|
.then(function (data) {
|
|
202
209
|
return {
|
|
203
210
|
qr: data.qr,
|
|
@@ -210,9 +217,9 @@ var Auth = /** @class */ (function () {
|
|
|
210
217
|
* @param pass
|
|
211
218
|
* @param code
|
|
212
219
|
*/
|
|
213
|
-
Auth.prototype.disableTwoFactorAuth = function (pass, code) {
|
|
220
|
+
Auth.prototype.disableTwoFactorAuth = function (pass, code, token) {
|
|
214
221
|
var _a;
|
|
215
|
-
return this.client.delete('/tfa', this.headersWithToken((_a = this.apiSecurity) === null || _a === void 0 ? void 0 : _a.token), {
|
|
222
|
+
return this.client.delete('/auth/tfa', this.headersWithToken(token !== null && token !== void 0 ? token : (_a = this.apiSecurity) === null || _a === void 0 ? void 0 : _a.token), {
|
|
216
223
|
pass: pass,
|
|
217
224
|
code: code,
|
|
218
225
|
});
|
|
@@ -222,12 +229,12 @@ var Auth = /** @class */ (function () {
|
|
|
222
229
|
* @param backupKey
|
|
223
230
|
* @param code
|
|
224
231
|
*/
|
|
225
|
-
Auth.prototype.storeTwoFactorAuthKey = function (backupKey, code) {
|
|
232
|
+
Auth.prototype.storeTwoFactorAuthKey = function (backupKey, code, token) {
|
|
226
233
|
var _a;
|
|
227
|
-
return this.client.put('/tfa', {
|
|
234
|
+
return this.client.put('/auth/tfa', {
|
|
228
235
|
key: backupKey,
|
|
229
236
|
code: code,
|
|
230
|
-
}, this.headersWithToken((_a = this.apiSecurity) === null || _a === void 0 ? void 0 : _a.token));
|
|
237
|
+
}, this.headersWithToken(token !== null && token !== void 0 ? token : (_a = this.apiSecurity) === null || _a === void 0 ? void 0 : _a.token));
|
|
231
238
|
};
|
|
232
239
|
/**
|
|
233
240
|
* Sends request to send the email to delete the account
|
|
@@ -3,7 +3,7 @@ import { ListAllSharedFoldersResponse, SharingMeta } from '../drive/share/types'
|
|
|
3
3
|
import { CreateFolderResponse, DriveFileData, FetchPaginatedFolderContentResponse, FetchTrashContentResponse } from '../drive/storage/types';
|
|
4
4
|
import { ApiSecurity, ApiUrl, AppDetails } from '../shared';
|
|
5
5
|
import { RequestCanceler } from '../shared/http/client';
|
|
6
|
-
import { CreateFolderPayload, CreateTeamData, CreateWorkspaceSharingPayload, FileEntry, GetMemberDetailsResponse, GetMemberUsageResponse, InviteMemberBody, ListWorkspaceSharedItemsResponse, OrderByOptions, PendingInvitesResponse, Workspace, WorkspaceCredentialsDetails, WorkspaceMembers, WorkspacePendingInvitations, WorkspaceSetupInfo, WorkspacesResponse, WorkspaceTeamResponse, TeamMembers, UsersAndTeamsAnItemIsShareWidthResponse, WorkspaceUser, WorkspaceUsage } from './types';
|
|
6
|
+
import { CreateFolderPayload, CreateTeamData, CreateWorkspaceSharingPayload, FileEntry, GetMemberDetailsResponse, GetMemberUsageResponse, InviteMemberBody, ListWorkspaceSharedItemsResponse, OrderByOptions, PendingInvitesResponse, Workspace, WorkspaceCredentialsDetails, WorkspaceMembers, WorkspacePendingInvitations, WorkspaceSetupInfo, WorkspacesResponse, WorkspaceTeamResponse, TeamMembers, UsersAndTeamsAnItemIsShareWidthResponse, WorkspaceUser, WorkspaceUsage, ItemType, WorkspaceLogOrderBy, WorkspaceLogType, WorkspaceLogResponse } from './types';
|
|
7
7
|
export declare class Workspaces {
|
|
8
8
|
private readonly client;
|
|
9
9
|
private readonly appDetails;
|
|
@@ -56,7 +56,7 @@ export declare class Workspaces {
|
|
|
56
56
|
addTeamUser(teamId: string, userUuid: string): Promise<void>;
|
|
57
57
|
removeTeamUser(teamId: string, userUuid: string): Promise<void>;
|
|
58
58
|
changeTeamManager(workspaceId: string, teamId: string, userUuid: string): Promise<void>;
|
|
59
|
-
getPersonalTrash(workspaceId: string, type:
|
|
59
|
+
getPersonalTrash(workspaceId: string, type: ItemType, offset?: number, limit?: number): Promise<FetchTrashContentResponse>;
|
|
60
60
|
emptyPersonalTrash(workspaceId: string): Promise<void>;
|
|
61
61
|
changeUserRole(teamId: string, memberId: string, role: string): Promise<void>;
|
|
62
62
|
inviteMemberToWorkspace({ workspaceId, invitedUserEmail, spaceLimitBytes, encryptedMnemonicInBase64, encryptionAlgorithm, message, }: InviteMemberBody): Promise<void>;
|
|
@@ -168,9 +168,10 @@ export declare class Workspaces {
|
|
|
168
168
|
*/
|
|
169
169
|
getUsersAndTeamsAnItemIsShareWidth({ workspaceId, itemType, itemId, }: {
|
|
170
170
|
workspaceId: string;
|
|
171
|
-
itemType:
|
|
171
|
+
itemType: ItemType;
|
|
172
172
|
itemId: string;
|
|
173
173
|
}): [Promise<UsersAndTeamsAnItemIsShareWidthResponse>, RequestCanceler];
|
|
174
174
|
getWorkspace(workspaceId: string): Promise<Workspace>;
|
|
175
|
+
getWorkspaceLogs(workspaceId: string, limit?: number, offset?: number, member?: string, activity?: WorkspaceLogType[], lastDays?: number, summary?: boolean, orderBy?: WorkspaceLogOrderBy): Promise<WorkspaceLogResponse[]>;
|
|
175
176
|
}
|
|
176
177
|
export * from './types';
|
package/dist/workspaces/index.js
CHANGED
|
@@ -413,6 +413,30 @@ var Workspaces = /** @class */ (function () {
|
|
|
413
413
|
Workspaces.prototype.getWorkspace = function (workspaceId) {
|
|
414
414
|
return this.client.get("workspaces/".concat(workspaceId), this.headers());
|
|
415
415
|
};
|
|
416
|
+
Workspaces.prototype.getWorkspaceLogs = function (workspaceId, limit, offset, member, activity, lastDays, summary, orderBy) {
|
|
417
|
+
if (limit === void 0) { limit = 50; }
|
|
418
|
+
if (offset === void 0) { offset = 0; }
|
|
419
|
+
if (summary === void 0) { summary = true; }
|
|
420
|
+
var params = new URLSearchParams();
|
|
421
|
+
params.append('limit', String(limit));
|
|
422
|
+
params.append('offset', String(offset));
|
|
423
|
+
params.append('summary', String(summary));
|
|
424
|
+
if (member) {
|
|
425
|
+
params.append('member', member);
|
|
426
|
+
}
|
|
427
|
+
if (activity && activity.length > 0) {
|
|
428
|
+
activity.forEach(function (act, index) {
|
|
429
|
+
params.append("activity[".concat(index, "]"), act);
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
if (lastDays) {
|
|
433
|
+
params.append('lastDays', String(lastDays));
|
|
434
|
+
}
|
|
435
|
+
if (orderBy) {
|
|
436
|
+
params.append('orderBy', String(orderBy));
|
|
437
|
+
}
|
|
438
|
+
return this.client.get("workspaces/".concat(workspaceId, "/access/logs?").concat(params.toString()), this.headers());
|
|
439
|
+
};
|
|
416
440
|
return Workspaces;
|
|
417
441
|
}());
|
|
418
442
|
exports.Workspaces = Workspaces;
|
|
@@ -288,4 +288,73 @@ export type GetMemberUsageResponse = {
|
|
|
288
288
|
driveUsage: number;
|
|
289
289
|
spaceLimit: number;
|
|
290
290
|
};
|
|
291
|
+
export declare enum WorkspaceLogType {
|
|
292
|
+
Login = "login",
|
|
293
|
+
ChangedPassword = "changed-password",
|
|
294
|
+
Logout = "logout",
|
|
295
|
+
ShareFile = "share-file",
|
|
296
|
+
ShareFolder = "share-folder",
|
|
297
|
+
DeleteFile = "delete-file",
|
|
298
|
+
DeleteFolder = "delete-folder"
|
|
299
|
+
}
|
|
300
|
+
export declare enum WorkspaceLogActionType {
|
|
301
|
+
Share = "share",
|
|
302
|
+
Delete = "delete",
|
|
303
|
+
DeleteAll = "delete-all"
|
|
304
|
+
}
|
|
305
|
+
export declare enum WorkspaceLogPlatform {
|
|
306
|
+
Web = "web",
|
|
307
|
+
Mobile = "mobile",
|
|
308
|
+
Desktop = "desktop"
|
|
309
|
+
}
|
|
310
|
+
export interface WorkspaceLogUser {
|
|
311
|
+
id: number;
|
|
312
|
+
name: string;
|
|
313
|
+
lastname: string;
|
|
314
|
+
email: string;
|
|
315
|
+
username: string;
|
|
316
|
+
bridgeUser?: string;
|
|
317
|
+
rootFolderId?: number;
|
|
318
|
+
uuid: string;
|
|
319
|
+
sharedWorkspace?: boolean;
|
|
320
|
+
avatar?: string;
|
|
321
|
+
lastPasswordChangedAt?: Date;
|
|
322
|
+
}
|
|
323
|
+
export interface WorkspaceLog {
|
|
324
|
+
id: string;
|
|
325
|
+
workspaceId: string;
|
|
326
|
+
creator: string;
|
|
327
|
+
type: WorkspaceLogType;
|
|
328
|
+
platform: WorkspaceLogPlatform;
|
|
329
|
+
entityId?: string;
|
|
330
|
+
user: WorkspaceLogUser;
|
|
331
|
+
workspace: Workspace;
|
|
332
|
+
createdAt: Date;
|
|
333
|
+
updatedAt: Date;
|
|
334
|
+
}
|
|
335
|
+
export interface WorkspaceLogResponse {
|
|
336
|
+
id: string;
|
|
337
|
+
workspaceId: string;
|
|
338
|
+
creator: string;
|
|
339
|
+
type: WorkspaceLogType;
|
|
340
|
+
platform: WorkspaceLogPlatform;
|
|
341
|
+
entityId?: string;
|
|
342
|
+
createdAt: Date;
|
|
343
|
+
updatedAt: Date;
|
|
344
|
+
user: WorkspaceLogUser;
|
|
345
|
+
workspace: Workspace;
|
|
346
|
+
file?: {
|
|
347
|
+
uuid: string;
|
|
348
|
+
plainName: string;
|
|
349
|
+
folderUuid: string;
|
|
350
|
+
type: string;
|
|
351
|
+
};
|
|
352
|
+
folder?: {
|
|
353
|
+
uuid: string;
|
|
354
|
+
plainName: string;
|
|
355
|
+
parentId: string;
|
|
356
|
+
parentUuid?: string;
|
|
357
|
+
};
|
|
358
|
+
}
|
|
359
|
+
export type WorkspaceLogOrderBy = 'createdAt:ASC' | 'createdAt:DESC' | 'platform:ASC' | 'platform:DESC' | 'type:ASC' | 'type:DESC';
|
|
291
360
|
export {};
|
package/dist/workspaces/types.js
CHANGED
|
@@ -1,2 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WorkspaceLogPlatform = exports.WorkspaceLogActionType = exports.WorkspaceLogType = void 0;
|
|
4
|
+
var WorkspaceLogType;
|
|
5
|
+
(function (WorkspaceLogType) {
|
|
6
|
+
WorkspaceLogType["Login"] = "login";
|
|
7
|
+
WorkspaceLogType["ChangedPassword"] = "changed-password";
|
|
8
|
+
WorkspaceLogType["Logout"] = "logout";
|
|
9
|
+
WorkspaceLogType["ShareFile"] = "share-file";
|
|
10
|
+
WorkspaceLogType["ShareFolder"] = "share-folder";
|
|
11
|
+
WorkspaceLogType["DeleteFile"] = "delete-file";
|
|
12
|
+
WorkspaceLogType["DeleteFolder"] = "delete-folder";
|
|
13
|
+
})(WorkspaceLogType = exports.WorkspaceLogType || (exports.WorkspaceLogType = {}));
|
|
14
|
+
var WorkspaceLogActionType;
|
|
15
|
+
(function (WorkspaceLogActionType) {
|
|
16
|
+
WorkspaceLogActionType["Share"] = "share";
|
|
17
|
+
WorkspaceLogActionType["Delete"] = "delete";
|
|
18
|
+
WorkspaceLogActionType["DeleteAll"] = "delete-all";
|
|
19
|
+
})(WorkspaceLogActionType = exports.WorkspaceLogActionType || (exports.WorkspaceLogActionType = {}));
|
|
20
|
+
var WorkspaceLogPlatform;
|
|
21
|
+
(function (WorkspaceLogPlatform) {
|
|
22
|
+
WorkspaceLogPlatform["Web"] = "web";
|
|
23
|
+
WorkspaceLogPlatform["Mobile"] = "mobile";
|
|
24
|
+
WorkspaceLogPlatform["Desktop"] = "desktop";
|
|
25
|
+
})(WorkspaceLogPlatform = exports.WorkspaceLogPlatform || (exports.WorkspaceLogPlatform = {}));
|