@internxt/sdk 1.9.0 → 1.9.2
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/drive/payments/index.d.ts +1 -1
- package/dist/drive/payments/index.js +5 -2
- package/dist/drive/payments/types.d.ts +2 -1
- package/dist/drive/users/index.js +2 -1
- package/dist/drive/users/types.d.ts +9 -0
- 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
|
@@ -171,7 +171,7 @@ var Auth = /** @class */ (function () {
|
|
|
171
171
|
case 2:
|
|
172
172
|
keys = _a.sent();
|
|
173
173
|
return [2 /*return*/, this.client
|
|
174
|
-
.post('/access', {
|
|
174
|
+
.post('/auth/login/access', {
|
|
175
175
|
email: details.email,
|
|
176
176
|
password: encryptedPasswordHash,
|
|
177
177
|
tfa: details.tfaCode,
|
|
@@ -231,7 +231,7 @@ var Auth = /** @class */ (function () {
|
|
|
231
231
|
*/
|
|
232
232
|
Auth.prototype.securityDetails = function (email) {
|
|
233
233
|
return this.client
|
|
234
|
-
.post('/login', {
|
|
234
|
+
.post('/auth/login', {
|
|
235
235
|
email: email,
|
|
236
236
|
}, this.basicHeaders())
|
|
237
237
|
.then(function (data) {
|
|
@@ -241,13 +241,20 @@ var Auth = /** @class */ (function () {
|
|
|
241
241
|
};
|
|
242
242
|
});
|
|
243
243
|
};
|
|
244
|
+
/**
|
|
245
|
+
* Logout
|
|
246
|
+
*/
|
|
247
|
+
Auth.prototype.logout = function (token) {
|
|
248
|
+
var _a;
|
|
249
|
+
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));
|
|
250
|
+
};
|
|
244
251
|
/**
|
|
245
252
|
* Generates a new TwoFactorAuth code
|
|
246
253
|
*/
|
|
247
|
-
Auth.prototype.generateTwoFactorAuthQR = function () {
|
|
254
|
+
Auth.prototype.generateTwoFactorAuthQR = function (token) {
|
|
248
255
|
var _a;
|
|
249
256
|
return this.client
|
|
250
|
-
.get('/tfa', this.headersWithToken((_a = this.apiSecurity) === null || _a === void 0 ? void 0 : _a.token))
|
|
257
|
+
.get('/auth/tfa', this.headersWithToken(token !== null && token !== void 0 ? token : (_a = this.apiSecurity) === null || _a === void 0 ? void 0 : _a.token))
|
|
251
258
|
.then(function (data) {
|
|
252
259
|
return {
|
|
253
260
|
qr: data.qr,
|
|
@@ -260,9 +267,9 @@ var Auth = /** @class */ (function () {
|
|
|
260
267
|
* @param pass
|
|
261
268
|
* @param code
|
|
262
269
|
*/
|
|
263
|
-
Auth.prototype.disableTwoFactorAuth = function (pass, code) {
|
|
270
|
+
Auth.prototype.disableTwoFactorAuth = function (pass, code, token) {
|
|
264
271
|
var _a;
|
|
265
|
-
return this.client.delete('/tfa', this.headersWithToken((_a = this.apiSecurity) === null || _a === void 0 ? void 0 : _a.token), {
|
|
272
|
+
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), {
|
|
266
273
|
pass: pass,
|
|
267
274
|
code: code,
|
|
268
275
|
});
|
|
@@ -272,12 +279,12 @@ var Auth = /** @class */ (function () {
|
|
|
272
279
|
* @param backupKey
|
|
273
280
|
* @param code
|
|
274
281
|
*/
|
|
275
|
-
Auth.prototype.storeTwoFactorAuthKey = function (backupKey, code) {
|
|
282
|
+
Auth.prototype.storeTwoFactorAuthKey = function (backupKey, code, token) {
|
|
276
283
|
var _a;
|
|
277
|
-
return this.client.put('/tfa', {
|
|
284
|
+
return this.client.put('/auth/tfa', {
|
|
278
285
|
key: backupKey,
|
|
279
286
|
code: code,
|
|
280
|
-
}, this.headersWithToken((_a = this.apiSecurity) === null || _a === void 0 ? void 0 : _a.token));
|
|
287
|
+
}, this.headersWithToken(token !== null && token !== void 0 ? token : (_a = this.apiSecurity) === null || _a === void 0 ? void 0 : _a.token));
|
|
281
288
|
};
|
|
282
289
|
/**
|
|
283
290
|
* Sends request to send the email to delete the account
|
|
@@ -31,7 +31,7 @@ export declare class Payments {
|
|
|
31
31
|
clientSecret: string;
|
|
32
32
|
}>;
|
|
33
33
|
getDefaultPaymentMethod(userType?: UserType): Promise<PaymentMethod>;
|
|
34
|
-
getInvoices({ subscriptionId, startingAfter, limit }: InvoicePayload): Promise<Invoice[]>;
|
|
34
|
+
getInvoices({ subscriptionId, userType, startingAfter, limit, }: InvoicePayload): Promise<Invoice[]>;
|
|
35
35
|
isCouponUsedByUser({ couponCode }: {
|
|
36
36
|
couponCode: string;
|
|
37
37
|
}): Promise<{
|
|
@@ -50,6 +50,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
50
50
|
exports.Payments = void 0;
|
|
51
51
|
var headers_1 = require("../../shared/headers");
|
|
52
52
|
var client_1 = require("../../shared/http/client");
|
|
53
|
+
var types_1 = require("./types");
|
|
53
54
|
var Payments = /** @class */ (function () {
|
|
54
55
|
function Payments(apiUrl, appDetails, apiSecurity) {
|
|
55
56
|
this.client = client_1.HttpClient.create(apiUrl, apiSecurity.unauthorizedCallback);
|
|
@@ -117,12 +118,14 @@ var Payments = /** @class */ (function () {
|
|
|
117
118
|
return this.client.get("/default-payment-method?".concat(query.toString()), this.headers());
|
|
118
119
|
};
|
|
119
120
|
Payments.prototype.getInvoices = function (_a) {
|
|
120
|
-
var subscriptionId = _a.subscriptionId, startingAfter = _a.startingAfter, limit = _a.limit;
|
|
121
|
+
var subscriptionId = _a.subscriptionId, _b = _a.userType, userType = _b === void 0 ? types_1.UserType.Individual : _b, startingAfter = _a.startingAfter, limit = _a.limit;
|
|
121
122
|
var query = new URLSearchParams();
|
|
122
|
-
if (subscriptionId)
|
|
123
|
+
if (subscriptionId !== undefined)
|
|
123
124
|
query.set('subscription', subscriptionId);
|
|
124
125
|
if (startingAfter !== undefined)
|
|
125
126
|
query.set('starting_after', startingAfter);
|
|
127
|
+
if (userType !== undefined)
|
|
128
|
+
query.set('userType', userType);
|
|
126
129
|
if (limit !== undefined)
|
|
127
130
|
query.set('limit', limit.toString());
|
|
128
131
|
return this.client.get("/invoices?".concat(query.toString()), this.headers());
|
|
@@ -121,8 +121,9 @@ export interface Invoice {
|
|
|
121
121
|
currency: string;
|
|
122
122
|
}
|
|
123
123
|
export interface InvoicePayload {
|
|
124
|
-
subscriptionId
|
|
124
|
+
subscriptionId?: string;
|
|
125
125
|
startingAfter?: string;
|
|
126
|
+
userType?: UserType;
|
|
126
127
|
limit?: number;
|
|
127
128
|
}
|
|
128
129
|
export type UserSubscription = {
|
|
@@ -107,7 +107,8 @@ var Users = /** @class */ (function () {
|
|
|
107
107
|
newPassword: payload.newEncryptedPassword,
|
|
108
108
|
newSalt: payload.newEncryptedSalt,
|
|
109
109
|
mnemonic: payload.encryptedMnemonic,
|
|
110
|
-
privateKey: payload.encryptedPrivateKey,
|
|
110
|
+
privateKey: payload.keys.encryptedPrivateKey,
|
|
111
|
+
privateKyberKey: payload.keys.encryptedPrivateKyberKey,
|
|
111
112
|
encryptVersion: payload.encryptVersion,
|
|
112
113
|
}, this.headers());
|
|
113
114
|
};
|
|
@@ -17,12 +17,20 @@ export interface ChangePasswordPayloadNew {
|
|
|
17
17
|
newEncryptedPassword: string;
|
|
18
18
|
newEncryptedSalt: string;
|
|
19
19
|
encryptedMnemonic: string;
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated encryptedPrivateKey field is depercated, use keys.encryptedPrivateKey instead
|
|
22
|
+
*/
|
|
20
23
|
encryptedPrivateKey: string;
|
|
24
|
+
keys: {
|
|
25
|
+
encryptedPrivateKey: string;
|
|
26
|
+
encryptedPrivateKyberKey: string;
|
|
27
|
+
};
|
|
21
28
|
encryptVersion: string;
|
|
22
29
|
}
|
|
23
30
|
export type UpdateProfilePayload = Partial<Pick<UserSettings, 'name' | 'lastname'>>;
|
|
24
31
|
export type PreCreateUserResponse = {
|
|
25
32
|
publicKey: string;
|
|
33
|
+
publicKyberKey?: string;
|
|
26
34
|
user: {
|
|
27
35
|
uuid: UUID;
|
|
28
36
|
email: string;
|
|
@@ -36,6 +44,7 @@ export type FriendInvite = {
|
|
|
36
44
|
};
|
|
37
45
|
export type UserPublicKeyResponse = {
|
|
38
46
|
publicKey: string;
|
|
47
|
+
publicKyberKey?: string;
|
|
39
48
|
};
|
|
40
49
|
export type VerifyEmailChangeResponse = {
|
|
41
50
|
oldEmail: string;
|
|
@@ -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 = {}));
|