@internxt/sdk 1.4.79 → 1.6.3
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 +5 -0
- package/dist/auth/index.js +80 -12
- package/dist/auth/types.d.ts +17 -4
- package/dist/drive/backups/index.js +3 -3
- package/dist/drive/index.js +5 -1
- package/dist/drive/payments/index.d.ts +30 -17
- package/dist/drive/payments/index.js +78 -25
- package/dist/drive/payments/types.d.ts +67 -1
- package/dist/drive/payments/types.js +11 -6
- package/dist/drive/referrals/index.js +5 -1
- package/dist/drive/referrals/types.js +2 -2
- package/dist/drive/share/index.d.ts +1 -1
- package/dist/drive/share/index.js +49 -44
- package/dist/drive/share/types.d.ts +31 -29
- package/dist/drive/storage/index.d.ts +130 -10
- package/dist/drive/storage/index.js +253 -53
- package/dist/drive/storage/types.d.ts +107 -21
- package/dist/drive/storage/types.js +2 -2
- package/dist/drive/trash/index.d.ts +22 -2
- package/dist/drive/trash/index.js +44 -9
- package/dist/drive/trash/types.d.ts +9 -0
- package/dist/drive/users/index.d.ts +30 -3
- package/dist/drive/users/index.js +40 -6
- package/dist/drive/users/types.d.ts +16 -6
- package/dist/index.d.ts +3 -2
- package/dist/index.js +12 -7
- package/dist/network/download.js +5 -5
- package/dist/network/errors/codes.d.ts +1 -1
- package/dist/network/errors/context.d.ts +4 -4
- package/dist/network/errors/context.js +2 -2
- package/dist/network/errors/download.js +5 -1
- package/dist/network/errors/index.js +5 -1
- package/dist/network/errors/upload.js +5 -1
- package/dist/network/index.d.ts +2 -3
- package/dist/network/index.js +14 -9
- package/dist/network/types.d.ts +16 -16
- package/dist/network/types.js +2 -2
- package/dist/network/upload.js +8 -9
- package/dist/photos/devices/index.js +8 -8
- package/dist/photos/index.js +5 -1
- package/dist/photos/photos/index.js +26 -26
- package/dist/photos/shares/index.js +3 -3
- package/dist/photos/types.d.ts +14 -14
- package/dist/photos/types.js +3 -3
- package/dist/photos/users/index.js +2 -2
- package/dist/shared/headers/index.d.ts +9 -6
- package/dist/shared/headers/index.js +27 -18
- package/dist/shared/http/client.d.ts +1 -1
- package/dist/shared/http/client.js +4 -13
- package/dist/shared/http/types.d.ts +4 -4
- package/dist/shared/index.js +5 -1
- package/dist/shared/types/apiConnection.d.ts +2 -1
- package/dist/shared/types/appsumo.js +1 -1
- package/dist/shared/types/errors.d.ts +2 -1
- package/dist/shared/types/errors.js +2 -1
- package/dist/shared/types/userSettings.d.ts +17 -1
- package/dist/utils.js +2 -3
- package/dist/workspaces/index.d.ts +176 -0
- package/dist/workspaces/index.js +419 -0
- package/dist/workspaces/index.test.d.ts +1 -0
- package/dist/workspaces/index.test.js +908 -0
- package/dist/workspaces/types.d.ts +294 -0
- package/dist/workspaces/types.js +2 -0
- package/package.json +13 -13
package/dist/photos/types.js
CHANGED
|
@@ -6,14 +6,14 @@ var PhotoStatus;
|
|
|
6
6
|
PhotoStatus["Exists"] = "EXISTS";
|
|
7
7
|
PhotoStatus["Trashed"] = "TRASHED";
|
|
8
8
|
PhotoStatus["Deleted"] = "DELETED";
|
|
9
|
-
})(PhotoStatus
|
|
9
|
+
})(PhotoStatus || (exports.PhotoStatus = PhotoStatus = {}));
|
|
10
10
|
var PhotosSortBy;
|
|
11
11
|
(function (PhotosSortBy) {
|
|
12
12
|
PhotosSortBy["UpdatedAt"] = "updatedAt";
|
|
13
13
|
PhotosSortBy["TakenAt"] = "takenAt";
|
|
14
|
-
})(PhotosSortBy
|
|
14
|
+
})(PhotosSortBy || (exports.PhotosSortBy = PhotosSortBy = {}));
|
|
15
15
|
var PhotosItemType;
|
|
16
16
|
(function (PhotosItemType) {
|
|
17
17
|
PhotosItemType["PHOTO"] = "PHOTO";
|
|
18
18
|
PhotosItemType["VIDEO"] = "VIDEO";
|
|
19
|
-
})(PhotosItemType
|
|
19
|
+
})(PhotosItemType || (exports.PhotosItemType = PhotosItemType = {}));
|
|
@@ -23,12 +23,12 @@ var UsersSubmodule = /** @class */ (function () {
|
|
|
23
23
|
UsersSubmodule.prototype.initialize = function (data) {
|
|
24
24
|
var _this = this;
|
|
25
25
|
return axios_1.default
|
|
26
|
-
.post(this.model.baseUrl
|
|
26
|
+
.post("".concat(this.model.baseUrl, "/users"), {
|
|
27
27
|
mac: data.mac,
|
|
28
28
|
name: data.name,
|
|
29
29
|
}, {
|
|
30
30
|
headers: {
|
|
31
|
-
Authorization: "Bearer "
|
|
31
|
+
Authorization: "Bearer ".concat(this.model.accessToken),
|
|
32
32
|
'internxt-network-pass': data.bridgePassword,
|
|
33
33
|
'internxt-network-user': data.bridgeUser,
|
|
34
34
|
},
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import { BasicAuth, Token } from '../../auth';
|
|
2
|
-
|
|
2
|
+
export interface CustomHeaders {
|
|
3
|
+
[key: string]: string;
|
|
4
|
+
}
|
|
5
|
+
type InternxtHeaders = {
|
|
3
6
|
'content-type': string;
|
|
4
7
|
'internxt-version': string;
|
|
5
8
|
'internxt-client': string;
|
|
6
9
|
'x-share-password'?: string;
|
|
7
|
-
|
|
10
|
+
Authorization?: string;
|
|
8
11
|
'x-token'?: string;
|
|
9
12
|
'internxt-resources-token'?: string;
|
|
10
13
|
};
|
|
11
14
|
export declare function basicHeaders(clientName: string, clientVersion: string): InternxtHeaders;
|
|
12
15
|
export declare function basicHeadersWithPassword(clientName: string, clientVersion: string, password: string): InternxtHeaders;
|
|
13
|
-
export declare function headersWithToken(clientName: string, clientVersion: string, token: Token): InternxtHeaders;
|
|
14
|
-
export declare function headersWithTokenAndPassword(clientName: string, clientVersion: string, token: Token, password: string): InternxtHeaders;
|
|
15
|
-
export declare function headersWithBasicAuth(clientName: string, clientVersion: string, auth: BasicAuth): InternxtHeaders;
|
|
16
|
-
export declare function headersWithAuthToken(clientName: string, clientVersion: string, token: Token): InternxtHeaders;
|
|
16
|
+
export declare function headersWithToken(clientName: string, clientVersion: string, token: Token, workspaceToken?: Token, customHeaders?: CustomHeaders): InternxtHeaders;
|
|
17
|
+
export declare function headersWithTokenAndPassword(clientName: string, clientVersion: string, token: Token, workspaceToken: Token | undefined, password: string): InternxtHeaders;
|
|
18
|
+
export declare function headersWithBasicAuth(clientName: string, clientVersion: string, auth: BasicAuth, workspaceToken?: Token): InternxtHeaders;
|
|
19
|
+
export declare function headersWithAuthToken(clientName: string, clientVersion: string, token: Token, workspaceToken?: Token): InternxtHeaders;
|
|
17
20
|
export declare function addResourcesTokenToHeaders(headers: InternxtHeaders, resourcesToken?: Token): InternxtHeaders;
|
|
18
21
|
export {};
|
|
@@ -11,7 +11,13 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
exports.
|
|
14
|
+
exports.basicHeaders = basicHeaders;
|
|
15
|
+
exports.basicHeadersWithPassword = basicHeadersWithPassword;
|
|
16
|
+
exports.headersWithToken = headersWithToken;
|
|
17
|
+
exports.headersWithTokenAndPassword = headersWithTokenAndPassword;
|
|
18
|
+
exports.headersWithBasicAuth = headersWithBasicAuth;
|
|
19
|
+
exports.headersWithAuthToken = headersWithAuthToken;
|
|
20
|
+
exports.addResourcesTokenToHeaders = addResourcesTokenToHeaders;
|
|
15
21
|
function basicHeaders(clientName, clientVersion) {
|
|
16
22
|
return {
|
|
17
23
|
'content-type': 'application/json; charset=utf-8',
|
|
@@ -19,7 +25,6 @@ function basicHeaders(clientName, clientVersion) {
|
|
|
19
25
|
'internxt-client': clientName,
|
|
20
26
|
};
|
|
21
27
|
}
|
|
22
|
-
exports.basicHeaders = basicHeaders;
|
|
23
28
|
function basicHeadersWithPassword(clientName, clientVersion, password) {
|
|
24
29
|
return {
|
|
25
30
|
'content-type': 'application/json; charset=utf-8',
|
|
@@ -28,42 +33,46 @@ function basicHeadersWithPassword(clientName, clientVersion, password) {
|
|
|
28
33
|
'x-share-password': password,
|
|
29
34
|
};
|
|
30
35
|
}
|
|
31
|
-
|
|
32
|
-
function headersWithToken(clientName, clientVersion, token) {
|
|
36
|
+
function headersWithToken(clientName, clientVersion, token, workspaceToken, customHeaders) {
|
|
33
37
|
var headers = basicHeaders(clientName, clientVersion);
|
|
34
38
|
var extra = {
|
|
35
|
-
|
|
39
|
+
Authorization: 'Bearer ' + token,
|
|
36
40
|
};
|
|
37
|
-
|
|
41
|
+
if (workspaceToken !== undefined) {
|
|
42
|
+
extra['x-internxt-workspace'] = workspaceToken;
|
|
43
|
+
}
|
|
44
|
+
return __assign(__assign(__assign({}, headers), extra), customHeaders);
|
|
38
45
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
var headers = headersWithToken(clientName, clientVersion, token);
|
|
46
|
+
function headersWithTokenAndPassword(clientName, clientVersion, token, workspaceToken, password) {
|
|
47
|
+
var headers = headersWithToken(clientName, clientVersion, token, workspaceToken);
|
|
42
48
|
var extra = {
|
|
43
49
|
'x-share-password': password,
|
|
44
50
|
};
|
|
45
51
|
return __assign(__assign({}, headers), extra);
|
|
46
52
|
}
|
|
47
|
-
|
|
48
|
-
function headersWithBasicAuth(clientName, clientVersion, auth) {
|
|
53
|
+
function headersWithBasicAuth(clientName, clientVersion, auth, workspaceToken) {
|
|
49
54
|
var headers = basicHeaders(clientName, clientVersion);
|
|
50
|
-
var token = auth.username
|
|
55
|
+
var token = "".concat(auth.username, ":").concat(auth.password);
|
|
51
56
|
var encodedToken = Buffer.from(token).toString('base64');
|
|
52
57
|
var extra = {
|
|
53
|
-
|
|
58
|
+
Authorization: 'Basic ' + encodedToken,
|
|
54
59
|
};
|
|
60
|
+
if (workspaceToken !== undefined) {
|
|
61
|
+
extra['x-internxt-workspace'] = workspaceToken;
|
|
62
|
+
}
|
|
55
63
|
return __assign(__assign({}, headers), extra);
|
|
56
64
|
}
|
|
57
|
-
|
|
58
|
-
function headersWithAuthToken(clientName, clientVersion, token) {
|
|
65
|
+
function headersWithAuthToken(clientName, clientVersion, token, workspaceToken) {
|
|
59
66
|
var headers = basicHeaders(clientName, clientVersion);
|
|
60
|
-
|
|
67
|
+
var extra = {};
|
|
68
|
+
if (workspaceToken !== undefined) {
|
|
69
|
+
extra['x-internxt-workspace'] = workspaceToken;
|
|
70
|
+
}
|
|
71
|
+
return __assign(__assign(__assign({}, headers), { 'x-token': token }), extra);
|
|
61
72
|
}
|
|
62
|
-
exports.headersWithAuthToken = headersWithAuthToken;
|
|
63
73
|
function addResourcesTokenToHeaders(headers, resourcesToken) {
|
|
64
74
|
if (resourcesToken && resourcesToken.length > 0) {
|
|
65
75
|
return __assign(__assign({}, headers), { 'internxt-resources-token': resourcesToken });
|
|
66
76
|
}
|
|
67
77
|
return headers;
|
|
68
78
|
}
|
|
69
|
-
exports.addResourcesTokenToHeaders = addResourcesTokenToHeaders;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Headers,
|
|
1
|
+
import { Headers, Parameters, RequestCanceler, URL, UnauthorizedCallback } from './types';
|
|
2
2
|
export { RequestCanceler } from './types';
|
|
3
3
|
export declare class HttpClient {
|
|
4
4
|
private readonly axios;
|
|
@@ -147,24 +147,15 @@ var HttpClient = /** @class */ (function () {
|
|
|
147
147
|
* @private
|
|
148
148
|
*/
|
|
149
149
|
HttpClient.prototype.normalizeError = function (error) {
|
|
150
|
-
var errorMessage, errorStatus;
|
|
150
|
+
var errorMessage, errorStatus, errorCode;
|
|
151
151
|
if (error.response) {
|
|
152
152
|
var response = error.response;
|
|
153
153
|
if (response.status === 401) {
|
|
154
154
|
this.unauthorizedCallback();
|
|
155
155
|
}
|
|
156
|
-
|
|
157
|
-
errorMessage = response.data.message;
|
|
158
|
-
}
|
|
159
|
-
else if (response.data.error !== undefined) {
|
|
160
|
-
errorMessage = response.data.error;
|
|
161
|
-
}
|
|
162
|
-
else {
|
|
163
|
-
// TODO : remove when endpoints of updateMetadata(file/folder) are updated
|
|
164
|
-
// after all clients use th SDK
|
|
165
|
-
errorMessage = JSON.stringify(response.data);
|
|
166
|
-
}
|
|
156
|
+
errorMessage = response.data.message || response.data.error || JSON.stringify(response.data);
|
|
167
157
|
errorStatus = response.status;
|
|
158
|
+
errorCode = response.data.code;
|
|
168
159
|
}
|
|
169
160
|
else if (error.request) {
|
|
170
161
|
errorMessage = 'Server unavailable';
|
|
@@ -174,7 +165,7 @@ var HttpClient = /** @class */ (function () {
|
|
|
174
165
|
errorMessage = error.message;
|
|
175
166
|
errorStatus = 400;
|
|
176
167
|
}
|
|
177
|
-
throw new errors_1.default(errorMessage, errorStatus);
|
|
168
|
+
throw new errors_1.default(errorMessage, errorStatus, errorCode);
|
|
178
169
|
};
|
|
179
170
|
return HttpClient;
|
|
180
171
|
}());
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
3
|
-
export
|
|
1
|
+
export type URL = string;
|
|
2
|
+
export type Headers = Record<string, string>;
|
|
3
|
+
export type Parameters = Record<string, unknown> | FormData;
|
|
4
4
|
export interface RequestCanceler {
|
|
5
5
|
cancel: (message?: string) => void;
|
|
6
6
|
}
|
|
7
|
-
export
|
|
7
|
+
export type UnauthorizedCallback = () => void;
|
package/dist/shared/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Token } from '../../auth';
|
|
2
2
|
import { UnauthorizedCallback } from '../http/types';
|
|
3
|
-
export
|
|
3
|
+
export type ApiUrl = string;
|
|
4
4
|
export interface AppDetails {
|
|
5
5
|
clientName: string;
|
|
6
6
|
clientVersion: string;
|
|
7
7
|
}
|
|
8
8
|
export interface ApiSecurity {
|
|
9
9
|
token: Token;
|
|
10
|
+
workspaceToken?: Token;
|
|
10
11
|
unauthorizedCallback?: UnauthorizedCallback;
|
|
11
12
|
}
|
|
@@ -9,4 +9,4 @@ var AppSumoTier;
|
|
|
9
9
|
AppSumoTier["Tier3"] = "internxt_tier3";
|
|
10
10
|
AppSumoTier["Tier4"] = "internxt_tier4";
|
|
11
11
|
AppSumoTier["Tier5"] = "internxt_tier5";
|
|
12
|
-
})(AppSumoTier
|
|
12
|
+
})(AppSumoTier || (exports.AppSumoTier = AppSumoTier = {}));
|
|
@@ -17,9 +17,10 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
var AppError = /** @class */ (function (_super) {
|
|
19
19
|
__extends(AppError, _super);
|
|
20
|
-
function AppError(message, status) {
|
|
20
|
+
function AppError(message, status, code) {
|
|
21
21
|
var _this = _super.call(this, message) || this;
|
|
22
22
|
_this.status = status;
|
|
23
|
+
_this.code = code;
|
|
23
24
|
return _this;
|
|
24
25
|
}
|
|
25
26
|
return AppError;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AppSumoDetails } from './appsumo';
|
|
2
|
-
export
|
|
2
|
+
export type UUID = string;
|
|
3
3
|
export interface UserSettings {
|
|
4
4
|
userId: string;
|
|
5
5
|
uuid: UUID;
|
|
@@ -11,12 +11,28 @@ export interface UserSettings {
|
|
|
11
11
|
bucket: string;
|
|
12
12
|
backupsBucket: string | null;
|
|
13
13
|
root_folder_id: number;
|
|
14
|
+
rootFolderId: string;
|
|
15
|
+
rootFolderUuid: string | undefined;
|
|
14
16
|
sharedWorkspace: boolean;
|
|
15
17
|
credit: number;
|
|
16
18
|
mnemonic: string;
|
|
19
|
+
/**
|
|
20
|
+
/ @deprecated The individual fields for keys should not be used
|
|
21
|
+
*/
|
|
17
22
|
privateKey: string;
|
|
18
23
|
publicKey: string;
|
|
19
24
|
revocationKey: string;
|
|
25
|
+
keys: {
|
|
26
|
+
ecc: {
|
|
27
|
+
privateKey: string;
|
|
28
|
+
publicKey: string;
|
|
29
|
+
revocationKey: string;
|
|
30
|
+
};
|
|
31
|
+
kyber: {
|
|
32
|
+
privateKyberKey: string;
|
|
33
|
+
publicKyberKey: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
20
36
|
teams?: boolean;
|
|
21
37
|
appSumoDetails: AppSumoDetails | null;
|
|
22
38
|
registerCompleted: boolean;
|
package/dist/utils.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.extractAxiosErrorMessage = extractAxiosErrorMessage;
|
|
4
|
+
exports.isHexString = isHexString;
|
|
4
5
|
function extractAxiosErrorMessage(err) {
|
|
5
6
|
var errMsg;
|
|
6
7
|
var error = err;
|
|
@@ -17,9 +18,7 @@ function extractAxiosErrorMessage(err) {
|
|
|
17
18
|
}
|
|
18
19
|
return errMsg;
|
|
19
20
|
}
|
|
20
|
-
exports.extractAxiosErrorMessage = extractAxiosErrorMessage;
|
|
21
21
|
function isHexString(string) {
|
|
22
22
|
// TODO: replace with proper library
|
|
23
23
|
return /^([0-9a-fA-F]{2})+$/.test(string);
|
|
24
24
|
}
|
|
25
|
-
exports.isHexString = isHexString;
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { Token } from '../auth';
|
|
2
|
+
import { ListAllSharedFoldersResponse, SharingMeta } from '../drive/share/types';
|
|
3
|
+
import { CreateFolderResponse, DriveFileData, FetchPaginatedFolderContentResponse, FetchTrashContentResponse } from '../drive/storage/types';
|
|
4
|
+
import { ApiSecurity, ApiUrl, AppDetails } from '../shared';
|
|
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';
|
|
7
|
+
export declare class Workspaces {
|
|
8
|
+
private readonly client;
|
|
9
|
+
private readonly appDetails;
|
|
10
|
+
private readonly apiSecurity;
|
|
11
|
+
static client(apiUrl: ApiUrl, appDetails: AppDetails, apiSecurity: ApiSecurity): Workspaces;
|
|
12
|
+
private constructor();
|
|
13
|
+
/**
|
|
14
|
+
* Returns the needed headers for the module requests
|
|
15
|
+
* @private
|
|
16
|
+
*/
|
|
17
|
+
private headers;
|
|
18
|
+
private getRequestHeaders;
|
|
19
|
+
getWorkspaces(): Promise<WorkspacesResponse>;
|
|
20
|
+
getPendingWorkspaces(): Promise<WorkspacesResponse>;
|
|
21
|
+
getPendingInvites(): Promise<PendingInvitesResponse>;
|
|
22
|
+
validateWorkspaceInvite(inviteId: string): Promise<string>;
|
|
23
|
+
/**
|
|
24
|
+
* Uploads an avatar for a specific workspace.
|
|
25
|
+
* @param workspaceId The UUID of the workspace to upload the avatar for.
|
|
26
|
+
* @param avatar The avatar to upload.
|
|
27
|
+
* @returns The response from the server.
|
|
28
|
+
*/
|
|
29
|
+
uploadWorkspaceAvatar(workspaceId: string, avatar: Blob): Promise<void>;
|
|
30
|
+
deleteWorkspaceAvatar(workspaceId: string): Promise<void>;
|
|
31
|
+
setupWorkspace({ workspaceId, name, address, description, encryptedMnemonic, hybridModeEnabled, }: WorkspaceSetupInfo): Promise<void>;
|
|
32
|
+
getWorkspaceUsage(workspaceId: string): Promise<WorkspaceUsage>;
|
|
33
|
+
editWorkspace(workspaceId: string, details: {
|
|
34
|
+
name?: string;
|
|
35
|
+
description?: string;
|
|
36
|
+
address?: string;
|
|
37
|
+
}): Promise<void>;
|
|
38
|
+
updateAvatar(workspaceId: string, payload: {
|
|
39
|
+
avatar: Blob;
|
|
40
|
+
}): Promise<{
|
|
41
|
+
avatar: string;
|
|
42
|
+
}>;
|
|
43
|
+
deleteAvatar(workspaceId: string): Promise<void>;
|
|
44
|
+
createTeam({ workspaceId, name, managerId }: CreateTeamData): Promise<void>;
|
|
45
|
+
getWorkspacesMembers(workspaceId: string): Promise<WorkspaceMembers>;
|
|
46
|
+
getWorkspacesTeams(workspaceId: string): Promise<WorkspaceTeamResponse>;
|
|
47
|
+
editTeam({ teamId, name }: {
|
|
48
|
+
teamId: string;
|
|
49
|
+
name: string;
|
|
50
|
+
}): Promise<void>;
|
|
51
|
+
deleteTeam({ workspaceId, teamId }: {
|
|
52
|
+
workspaceId: string;
|
|
53
|
+
teamId: string;
|
|
54
|
+
}): Promise<void>;
|
|
55
|
+
getWorkspacesTeamMembers(teamId: string): Promise<TeamMembers>;
|
|
56
|
+
addTeamUser(teamId: string, userUuid: string): Promise<void>;
|
|
57
|
+
removeTeamUser(teamId: string, userUuid: string): Promise<void>;
|
|
58
|
+
changeTeamManager(workspaceId: string, teamId: string, userUuid: string): Promise<void>;
|
|
59
|
+
getPersonalTrash(workspaceId: string, type: 'file' | 'folder', offset?: number, limit?: number): Promise<FetchTrashContentResponse>;
|
|
60
|
+
emptyPersonalTrash(workspaceId: string): Promise<void>;
|
|
61
|
+
changeUserRole(teamId: string, memberId: string, role: string): Promise<void>;
|
|
62
|
+
inviteMemberToWorkspace({ workspaceId, invitedUserEmail, spaceLimitBytes, encryptedMnemonicInBase64, encryptionAlgorithm, message, }: InviteMemberBody): Promise<void>;
|
|
63
|
+
leaveWorkspace(workspaceId: string): Promise<void>;
|
|
64
|
+
getMemberDetails(workspaceId: string, memberId: string): Promise<GetMemberDetailsResponse>;
|
|
65
|
+
modifyMemberUsage(workspaceId: string, memberId: string, spaceLimitBytes: number): Promise<WorkspaceUser>;
|
|
66
|
+
getMemberUsage(workspaceId: string): Promise<GetMemberUsageResponse>;
|
|
67
|
+
deactivateMember(workspaceId: string, memberId: string): Promise<void>;
|
|
68
|
+
activateMember(workspaceId: string, memberId: string): Promise<void>;
|
|
69
|
+
removeMember(workspaceId: string, memberId: string): Promise<void>;
|
|
70
|
+
acceptInvitation(inviteId: string, token: string): Promise<void>;
|
|
71
|
+
declineInvitation(inviteId: string, token: string): Promise<void>;
|
|
72
|
+
getWorkspaceCredentials(workspaceId: string): Promise<WorkspaceCredentialsDetails>;
|
|
73
|
+
createFileEntry(fileEntry: FileEntry, workspaceId: string, resourcesToken?: Token): Promise<DriveFileData>;
|
|
74
|
+
/**
|
|
75
|
+
* Creates a new folder in the specified workspace.
|
|
76
|
+
*
|
|
77
|
+
* @param {CreateFolderPayload} options - The options for creating the folder.
|
|
78
|
+
* @param {string} options.workspaceId - The ID of the workspace.
|
|
79
|
+
* @param {string} options.plainName - The plain name of the folder.
|
|
80
|
+
* @param {string} options.parentFolderUuid - The UUID of the parent folder.
|
|
81
|
+
* @return {[Promise<CreateFolderResponse>, RequestCanceler]} A tuple containing a promise to get the API response and a function to cancel the request.
|
|
82
|
+
*/
|
|
83
|
+
createFolder({ workspaceId, plainName, parentFolderUuid, }: CreateFolderPayload): [Promise<CreateFolderResponse>, RequestCanceler];
|
|
84
|
+
/**
|
|
85
|
+
* Retrieves a paginated list of folders within a specific folder in a workspace.
|
|
86
|
+
*
|
|
87
|
+
* @param {string} workspaceId - The ID of the workspace.
|
|
88
|
+
* @param {string} folderUUID - The UUID of the folder.
|
|
89
|
+
* @param {number} [offset=0] - The position of the first file to return.
|
|
90
|
+
* @param {number} [limit=50] - The max number of files to be returned.
|
|
91
|
+
* @param {string} [sort=''] - The reference column to sort it.
|
|
92
|
+
* @param {string} [order=''] - The order to be followed.
|
|
93
|
+
* @return {[Promise<FetchPaginatedFolderContentResponse>, RequestCanceler]} An array containing a promise to get the API response and a function to cancel the request.
|
|
94
|
+
*/
|
|
95
|
+
getFolders(workspaceId: string, folderUUID: string, offset?: number, limit?: number, sort?: string, order?: string): [Promise<FetchPaginatedFolderContentResponse>, RequestCanceler];
|
|
96
|
+
/**
|
|
97
|
+
* Retrieves a paginated list of files within a specific folder in a workspace.
|
|
98
|
+
*
|
|
99
|
+
* @param {string} workspaceId - The ID of the workspace.
|
|
100
|
+
* @param {string} folderUUID - The UUID of the folder.
|
|
101
|
+
* @param {number} [offset=0] - The position of the first file to return.
|
|
102
|
+
* @param {number} [limit=50] - The max number of files to be returned.
|
|
103
|
+
* @param {string} [sort=''] - The reference column to sort it.
|
|
104
|
+
* @param {string} [order=''] - The order to be followed.
|
|
105
|
+
* @return {[Promise<FetchPaginatedFolderContentResponse>, RequestCanceler]} An array containing a promise to get the API response and a function to cancel the request.
|
|
106
|
+
*/
|
|
107
|
+
getFiles(workspaceId: string, folderUUID: string, offset?: number, limit?: number, sort?: string, order?: string): [Promise<FetchPaginatedFolderContentResponse>, RequestCanceler];
|
|
108
|
+
getWorkspacePendingInvitations(workspaceId: string, limit: number, offset: number): Promise<WorkspacePendingInvitations[]>;
|
|
109
|
+
/**
|
|
110
|
+
* Creates a new sharing for a workspace item.
|
|
111
|
+
*
|
|
112
|
+
* @param {CreateWorkspaceSharingPayload} options - The options for creating the sharing.
|
|
113
|
+
* @param {string} options.workspaceId - The ID of the workspace.
|
|
114
|
+
* @param {string} options.teamUUID - The UUID of the team.
|
|
115
|
+
* @param {...CreateSharingPayload} options.createSharingPayload - The payload for creating the sharing.
|
|
116
|
+
* @returns {Promise<SharingMeta>} A promise that resolves to the sharing metadata.
|
|
117
|
+
*/
|
|
118
|
+
shareItem({ workspaceId, teamUUID, ...createSharingPayload }: CreateWorkspaceSharingPayload): Promise<SharingMeta>;
|
|
119
|
+
validateWorkspaceInvitation(inviteId: string): Promise<{
|
|
120
|
+
uuid: string;
|
|
121
|
+
}>;
|
|
122
|
+
/**
|
|
123
|
+
* Returns shared files in teams.
|
|
124
|
+
* @param orderBy
|
|
125
|
+
* @deprecated use `getWorkspaceTeamSharedFilesV2` call instead.
|
|
126
|
+
*/
|
|
127
|
+
getWorkspaceTeamSharedFiles(workspaceId: string, teamId: string, orderBy?: OrderByOptions): [Promise<ListAllSharedFoldersResponse>, RequestCanceler];
|
|
128
|
+
/**
|
|
129
|
+
* Returns shared files in teams.
|
|
130
|
+
* @param orderBy
|
|
131
|
+
*/
|
|
132
|
+
getWorkspaceTeamSharedFilesV2(workspaceId: string, orderBy?: OrderByOptions): [Promise<ListAllSharedFoldersResponse>, RequestCanceler];
|
|
133
|
+
/**
|
|
134
|
+
* Returns shared folders in teams.
|
|
135
|
+
* @param orderBy
|
|
136
|
+
* @deprecated use `getWorkspaceTeamSharedFoldersV2` call instead.
|
|
137
|
+
*/
|
|
138
|
+
getWorkspaceTeamSharedFolders(workspaceId: string, teamId: string, orderBy?: OrderByOptions): [Promise<ListAllSharedFoldersResponse>, RequestCanceler];
|
|
139
|
+
/**
|
|
140
|
+
* Returns shared folders in teams.
|
|
141
|
+
* @param orderBy
|
|
142
|
+
*/
|
|
143
|
+
getWorkspaceTeamSharedFoldersV2(workspaceId: string, orderBy?: OrderByOptions): [Promise<ListAllSharedFoldersResponse>, RequestCanceler];
|
|
144
|
+
/**
|
|
145
|
+
* Returns files inside a shared folders with teams.
|
|
146
|
+
* @param orderBy
|
|
147
|
+
* @deprecated use `getWorkspaceTeamSharedFolderFilesV2` call instead.
|
|
148
|
+
*/
|
|
149
|
+
getWorkspaceTeamSharedFolderFiles(workspaceId: string, teamId: string, sharedFolderUUID: string, page?: number, perPage?: number, token?: string, orderBy?: OrderByOptions): [Promise<ListWorkspaceSharedItemsResponse>, RequestCanceler];
|
|
150
|
+
/**
|
|
151
|
+
* Returns files inside a shared folders with teams.
|
|
152
|
+
* @param orderBy
|
|
153
|
+
*/
|
|
154
|
+
getWorkspaceTeamSharedFolderFilesV2(workspaceId: string, sharedFolderUUID: string, page?: number, perPage?: number, token?: string, orderBy?: OrderByOptions): [Promise<ListWorkspaceSharedItemsResponse>, RequestCanceler];
|
|
155
|
+
/**
|
|
156
|
+
* Returns folders inside a shared folders with teams.
|
|
157
|
+
* @param orderBy
|
|
158
|
+
* @deprecated use `getWorkspaceTeamSharedFolderFoldersV2` call instead.
|
|
159
|
+
*/
|
|
160
|
+
getWorkspaceTeamSharedFolderFolders(workspaceId: string, teamId: string, sharedFolderUUID: string, page?: number, perPage?: number, token?: string, orderBy?: OrderByOptions): [Promise<ListWorkspaceSharedItemsResponse>, RequestCanceler];
|
|
161
|
+
/**
|
|
162
|
+
* Returns folders inside a shared folders with teams.
|
|
163
|
+
* @param orderBy
|
|
164
|
+
*/
|
|
165
|
+
getWorkspaceTeamSharedFolderFoldersV2(workspaceId: string, sharedFolderUUID: string, page?: number, perPage?: number, token?: string, orderBy?: OrderByOptions): [Promise<ListWorkspaceSharedItemsResponse>, RequestCanceler];
|
|
166
|
+
/**
|
|
167
|
+
* Returns users and teams an item is shared with.
|
|
168
|
+
*/
|
|
169
|
+
getUsersAndTeamsAnItemIsShareWidth({ workspaceId, itemType, itemId, }: {
|
|
170
|
+
workspaceId: string;
|
|
171
|
+
itemType: 'folder' | 'file';
|
|
172
|
+
itemId: string;
|
|
173
|
+
}): [Promise<UsersAndTeamsAnItemIsShareWidthResponse>, RequestCanceler];
|
|
174
|
+
getWorkspace(workspaceId: string): Promise<Workspace>;
|
|
175
|
+
}
|
|
176
|
+
export * from './types';
|