@internxt/sdk 1.5.25 → 1.6.4
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 +127 -122
- package/dist/auth/index.js +378 -310
- package/dist/auth/types.d.ts +65 -54
- package/dist/auth/types.js +26 -26
- package/dist/drive/backups/index.d.ts +18 -18
- package/dist/drive/backups/index.js +40 -40
- package/dist/drive/backups/types.d.ts +27 -27
- package/dist/drive/backups/types.js +2 -2
- package/dist/drive/index.d.ts +7 -7
- package/dist/drive/index.js +23 -19
- package/dist/drive/payments/index.d.ts +66 -71
- package/dist/drive/payments/index.js +206 -208
- package/dist/drive/payments/types.d.ts +180 -176
- package/dist/drive/payments/types.js +37 -37
- package/dist/drive/referrals/index.d.ts +19 -19
- package/dist/drive/referrals/index.js +54 -50
- package/dist/drive/referrals/types.d.ts +21 -21
- package/dist/drive/referrals/types.js +18 -18
- package/dist/drive/share/index.d.ts +319 -319
- package/dist/drive/share/index.js +544 -540
- package/dist/drive/share/types.d.ts +360 -360
- package/dist/drive/share/types.js +2 -2
- package/dist/drive/storage/index.d.ts +315 -315
- package/dist/drive/storage/index.js +634 -630
- package/dist/drive/storage/types.d.ts +480 -473
- package/dist/drive/storage/types.js +13 -13
- package/dist/drive/trash/index.d.ts +75 -75
- package/dist/drive/trash/index.js +184 -180
- package/dist/drive/trash/types.d.ts +29 -29
- package/dist/drive/trash/types.js +2 -2
- package/dist/drive/users/index.d.ts +135 -135
- package/dist/drive/users/index.js +208 -204
- package/dist/drive/users/types.d.ts +53 -51
- package/dist/drive/users/types.js +2 -2
- package/dist/index.d.ts +6 -6
- package/dist/index.js +35 -31
- package/dist/network/download.d.ts +8 -8
- package/dist/network/download.js +123 -123
- package/dist/network/errors/codes.d.ts +24 -24
- package/dist/network/errors/codes.js +48 -48
- package/dist/network/errors/context.d.ts +35 -35
- package/dist/network/errors/context.js +39 -39
- package/dist/network/errors/download.d.ts +4 -4
- package/dist/network/errors/download.js +52 -48
- package/dist/network/errors/index.d.ts +3 -3
- package/dist/network/errors/index.js +19 -15
- package/dist/network/errors/upload.d.ts +13 -13
- package/dist/network/errors/upload.js +82 -78
- package/dist/network/index.d.ts +70 -70
- package/dist/network/index.js +315 -311
- package/dist/network/types.d.ts +102 -102
- package/dist/network/types.js +18 -18
- package/dist/network/upload.d.ts +4 -4
- package/dist/network/upload.js +158 -159
- package/dist/photos/devices/index.d.ts +10 -10
- package/dist/photos/devices/index.js +79 -79
- package/dist/photos/index.d.ts +17 -17
- package/dist/photos/index.js +56 -52
- package/dist/photos/photos/index.d.ts +60 -60
- package/dist/photos/photos/index.js +225 -225
- package/dist/photos/shares/index.d.ts +8 -8
- package/dist/photos/shares/index.js +34 -34
- package/dist/photos/types.d.ts +154 -154
- package/dist/photos/types.js +19 -19
- package/dist/photos/users/index.d.ts +7 -7
- package/dist/photos/users/index.js +46 -46
- package/dist/shared/headers/index.d.ts +21 -21
- package/dist/shared/headers/index.js +78 -79
- package/dist/shared/http/client.d.ts +85 -85
- package/dist/shared/http/client.js +172 -172
- package/dist/shared/http/types.d.ts +7 -7
- package/dist/shared/http/types.js +2 -2
- package/dist/shared/index.d.ts +1 -1
- package/dist/shared/index.js +17 -13
- package/dist/shared/types/apiConnection.d.ts +12 -12
- package/dist/shared/types/apiConnection.js +2 -2
- package/dist/shared/types/appsumo.d.ts +16 -16
- package/dist/shared/types/appsumo.js +12 -12
- package/dist/shared/types/errors.d.ts +5 -5
- package/dist/shared/types/errors.js +28 -28
- package/dist/shared/types/teams.d.ts +9 -9
- package/dist/shared/types/teams.js +2 -2
- package/dist/shared/types/userSettings.d.ts +43 -29
- package/dist/shared/types/userSettings.js +2 -2
- package/dist/utils.d.ts +3 -3
- package/dist/utils.js +24 -25
- package/dist/workspaces/index.d.ts +176 -176
- package/dist/workspaces/index.js +419 -415
- package/dist/workspaces/index.test.d.ts +1 -1
- package/dist/workspaces/index.test.js +908 -903
- package/dist/workspaces/types.d.ts +294 -291
- package/dist/workspaces/types.js +2 -2
- package/package.json +13 -13
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EncryptionVersion = exports.FileStatus = void 0;
|
|
4
|
-
var FileStatus;
|
|
5
|
-
(function (FileStatus) {
|
|
6
|
-
FileStatus["EXISTS"] = "EXISTS";
|
|
7
|
-
FileStatus["TRASHED"] = "TRASHED";
|
|
8
|
-
FileStatus["DELETED"] = "DELETED";
|
|
9
|
-
})(FileStatus
|
|
10
|
-
var EncryptionVersion;
|
|
11
|
-
(function (EncryptionVersion) {
|
|
12
|
-
EncryptionVersion["Aes03"] = "03-aes";
|
|
13
|
-
})(EncryptionVersion
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EncryptionVersion = exports.FileStatus = void 0;
|
|
4
|
+
var FileStatus;
|
|
5
|
+
(function (FileStatus) {
|
|
6
|
+
FileStatus["EXISTS"] = "EXISTS";
|
|
7
|
+
FileStatus["TRASHED"] = "TRASHED";
|
|
8
|
+
FileStatus["DELETED"] = "DELETED";
|
|
9
|
+
})(FileStatus || (exports.FileStatus = FileStatus = {}));
|
|
10
|
+
var EncryptionVersion;
|
|
11
|
+
(function (EncryptionVersion) {
|
|
12
|
+
EncryptionVersion["Aes03"] = "03-aes";
|
|
13
|
+
})(EncryptionVersion || (exports.EncryptionVersion = EncryptionVersion = {}));
|
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
import { ApiSecurity, ApiUrl, AppDetails } from '../../shared';
|
|
2
|
-
import { FetchFolderContentResponse, FetchTrashContentResponse } from '../storage/types';
|
|
3
|
-
import { AddItemsToTrashPayload, DeleteFilePayload, DeleteItemsPermanentlyByUUIDPayload, DeleteItemsPermanentlyPayload } from './types';
|
|
4
|
-
export * as TrashTypes from './types';
|
|
5
|
-
export declare class Trash {
|
|
6
|
-
private readonly client;
|
|
7
|
-
private readonly appDetails;
|
|
8
|
-
private readonly apiSecurity;
|
|
9
|
-
static client(apiUrl: ApiUrl, appDetails: AppDetails, apiSecurity: ApiSecurity): Trash;
|
|
10
|
-
private constructor();
|
|
11
|
-
/**
|
|
12
|
-
* Removes a specific folder from the centralized persistence
|
|
13
|
-
* @param folderId
|
|
14
|
-
*/
|
|
15
|
-
deleteFolder(folderId: number): Promise<unknown>;
|
|
16
|
-
/**
|
|
17
|
-
* Deletes a specific file entry
|
|
18
|
-
* @param payload
|
|
19
|
-
*/
|
|
20
|
-
deleteFile(payload: DeleteFilePayload): Promise<unknown>;
|
|
21
|
-
/**
|
|
22
|
-
* Returns a list of items in trash
|
|
23
|
-
*/
|
|
24
|
-
getTrash(): Promise<FetchFolderContentResponse>;
|
|
25
|
-
/**
|
|
26
|
-
* Retrieves a paginated list of trashed files or folders.
|
|
27
|
-
* @param {number} limit - The number of items to retrieve per page.
|
|
28
|
-
* @param {number} [offset=0] - The number of items to skip before beginning to return items.
|
|
29
|
-
* @param {'files' | 'folders'} type - The type of content to retrieve.
|
|
30
|
-
* @param {boolean} root - A boolean indicating whether to retrieve content from the root folder.
|
|
31
|
-
* If is not true it has to get a folderId in order to obtain the items or given folderId
|
|
32
|
-
* @param {number} [folderId] - The ID of the folder to retrieve content from.
|
|
33
|
-
* @returns {Promise<FetchTrashContentResponse>} - A promise that resolves with the paginated list of trashed content.
|
|
34
|
-
*/
|
|
35
|
-
getTrashedFilesPaginated(limit: number, offset: number | undefined, type: 'files' | 'folders', root: boolean, folderId?: number): Promise<FetchTrashContentResponse>;
|
|
36
|
-
/**
|
|
37
|
-
* Retrieves a sorted list of trashed files or folders.
|
|
38
|
-
* @param {number} limit - The number of items to retrieve per page.
|
|
39
|
-
* @param {number} [offset=0] - The number of items to skip before beginning to return items.
|
|
40
|
-
* @param {'files' | 'folders'} type - The type of content to retrieve.
|
|
41
|
-
* @param {boolean} root - A boolean indicating whether to retrieve content from the root folder.
|
|
42
|
-
* If is not true it has to get a folderId in order to obtain the items or given folderId
|
|
43
|
-
* @param {'plainName' | 'date'} [sort] - The ID of the folder to retrieve content from.
|
|
44
|
-
* @param {'ASC' | 'DESC'} [order] - The ID of the folder to retrieve content from.
|
|
45
|
-
* @param {number} [folderId] - The ID of the folder to retrieve content from.
|
|
46
|
-
* @returns {Promise<FetchTrashContentResponse>} - A promise that resolves with the paginated list of trashed content.
|
|
47
|
-
*/
|
|
48
|
-
getTrashedItemsSorted(limit: number, offset: number | undefined, type: 'files' | 'folders', root: boolean, sort: 'plainName' | 'updatedAt', order: 'ASC' | 'DESC', folderId?: number): Promise<FetchTrashContentResponse>;
|
|
49
|
-
/**
|
|
50
|
-
* Add Items to Trash
|
|
51
|
-
* @param payload
|
|
52
|
-
*/
|
|
53
|
-
addItemsToTrash(payload: AddItemsToTrashPayload): Promise<void>;
|
|
54
|
-
/**
|
|
55
|
-
* Removes all items from the trash
|
|
56
|
-
*/
|
|
57
|
-
clearTrash(): Promise<void>;
|
|
58
|
-
/**
|
|
59
|
-
* Deletes trashed items permanently
|
|
60
|
-
* @param payload
|
|
61
|
-
*/
|
|
62
|
-
deleteItemsPermanently(payload: DeleteItemsPermanentlyPayload): Promise<unknown>;
|
|
63
|
-
/**
|
|
64
|
-
* Deletes trashed items permanently by UUID.
|
|
65
|
-
*
|
|
66
|
-
* @param {DeleteItemsPermanentlyByUUIDPayload} payload - The payload containing the items to be deleted.
|
|
67
|
-
* @return {Promise<void>} A promise that resolves when the items are deleted permanently.
|
|
68
|
-
*/
|
|
69
|
-
deleteItemsPermanentlyByUUID(payload: DeleteItemsPermanentlyByUUIDPayload): Promise<unknown>;
|
|
70
|
-
/**
|
|
71
|
-
* Returns the needed headers for the module requests
|
|
72
|
-
* @private
|
|
73
|
-
*/
|
|
74
|
-
private headers;
|
|
75
|
-
}
|
|
1
|
+
import { ApiSecurity, ApiUrl, AppDetails } from '../../shared';
|
|
2
|
+
import { FetchFolderContentResponse, FetchTrashContentResponse } from '../storage/types';
|
|
3
|
+
import { AddItemsToTrashPayload, DeleteFilePayload, DeleteItemsPermanentlyByUUIDPayload, DeleteItemsPermanentlyPayload } from './types';
|
|
4
|
+
export * as TrashTypes from './types';
|
|
5
|
+
export declare class Trash {
|
|
6
|
+
private readonly client;
|
|
7
|
+
private readonly appDetails;
|
|
8
|
+
private readonly apiSecurity;
|
|
9
|
+
static client(apiUrl: ApiUrl, appDetails: AppDetails, apiSecurity: ApiSecurity): Trash;
|
|
10
|
+
private constructor();
|
|
11
|
+
/**
|
|
12
|
+
* Removes a specific folder from the centralized persistence
|
|
13
|
+
* @param folderId
|
|
14
|
+
*/
|
|
15
|
+
deleteFolder(folderId: number): Promise<unknown>;
|
|
16
|
+
/**
|
|
17
|
+
* Deletes a specific file entry
|
|
18
|
+
* @param payload
|
|
19
|
+
*/
|
|
20
|
+
deleteFile(payload: DeleteFilePayload): Promise<unknown>;
|
|
21
|
+
/**
|
|
22
|
+
* Returns a list of items in trash
|
|
23
|
+
*/
|
|
24
|
+
getTrash(): Promise<FetchFolderContentResponse>;
|
|
25
|
+
/**
|
|
26
|
+
* Retrieves a paginated list of trashed files or folders.
|
|
27
|
+
* @param {number} limit - The number of items to retrieve per page.
|
|
28
|
+
* @param {number} [offset=0] - The number of items to skip before beginning to return items.
|
|
29
|
+
* @param {'files' | 'folders'} type - The type of content to retrieve.
|
|
30
|
+
* @param {boolean} root - A boolean indicating whether to retrieve content from the root folder.
|
|
31
|
+
* If is not true it has to get a folderId in order to obtain the items or given folderId
|
|
32
|
+
* @param {number} [folderId] - The ID of the folder to retrieve content from.
|
|
33
|
+
* @returns {Promise<FetchTrashContentResponse>} - A promise that resolves with the paginated list of trashed content.
|
|
34
|
+
*/
|
|
35
|
+
getTrashedFilesPaginated(limit: number, offset: number | undefined, type: 'files' | 'folders', root: boolean, folderId?: number): Promise<FetchTrashContentResponse>;
|
|
36
|
+
/**
|
|
37
|
+
* Retrieves a sorted list of trashed files or folders.
|
|
38
|
+
* @param {number} limit - The number of items to retrieve per page.
|
|
39
|
+
* @param {number} [offset=0] - The number of items to skip before beginning to return items.
|
|
40
|
+
* @param {'files' | 'folders'} type - The type of content to retrieve.
|
|
41
|
+
* @param {boolean} root - A boolean indicating whether to retrieve content from the root folder.
|
|
42
|
+
* If is not true it has to get a folderId in order to obtain the items or given folderId
|
|
43
|
+
* @param {'plainName' | 'date'} [sort] - The ID of the folder to retrieve content from.
|
|
44
|
+
* @param {'ASC' | 'DESC'} [order] - The ID of the folder to retrieve content from.
|
|
45
|
+
* @param {number} [folderId] - The ID of the folder to retrieve content from.
|
|
46
|
+
* @returns {Promise<FetchTrashContentResponse>} - A promise that resolves with the paginated list of trashed content.
|
|
47
|
+
*/
|
|
48
|
+
getTrashedItemsSorted(limit: number, offset: number | undefined, type: 'files' | 'folders', root: boolean, sort: 'plainName' | 'updatedAt', order: 'ASC' | 'DESC', folderId?: number): Promise<FetchTrashContentResponse>;
|
|
49
|
+
/**
|
|
50
|
+
* Add Items to Trash
|
|
51
|
+
* @param payload
|
|
52
|
+
*/
|
|
53
|
+
addItemsToTrash(payload: AddItemsToTrashPayload): Promise<void>;
|
|
54
|
+
/**
|
|
55
|
+
* Removes all items from the trash
|
|
56
|
+
*/
|
|
57
|
+
clearTrash(): Promise<void>;
|
|
58
|
+
/**
|
|
59
|
+
* Deletes trashed items permanently
|
|
60
|
+
* @param payload
|
|
61
|
+
*/
|
|
62
|
+
deleteItemsPermanently(payload: DeleteItemsPermanentlyPayload): Promise<unknown>;
|
|
63
|
+
/**
|
|
64
|
+
* Deletes trashed items permanently by UUID.
|
|
65
|
+
*
|
|
66
|
+
* @param {DeleteItemsPermanentlyByUUIDPayload} payload - The payload containing the items to be deleted.
|
|
67
|
+
* @return {Promise<void>} A promise that resolves when the items are deleted permanently.
|
|
68
|
+
*/
|
|
69
|
+
deleteItemsPermanentlyByUUID(payload: DeleteItemsPermanentlyByUUIDPayload): Promise<unknown>;
|
|
70
|
+
/**
|
|
71
|
+
* Returns the needed headers for the module requests
|
|
72
|
+
* @private
|
|
73
|
+
*/
|
|
74
|
+
private headers;
|
|
75
|
+
}
|
|
@@ -1,180 +1,184 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
if (t[
|
|
50
|
-
_.
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
exports
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
* @param {number} [
|
|
107
|
-
* @
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
* @param {
|
|
124
|
-
* @param {'
|
|
125
|
-
* @param {
|
|
126
|
-
*
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
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);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
35
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
36
|
+
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
37
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
38
|
+
function step(op) {
|
|
39
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
40
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
41
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
42
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
43
|
+
switch (op[0]) {
|
|
44
|
+
case 0: case 1: t = op; break;
|
|
45
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
46
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
47
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
48
|
+
default:
|
|
49
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
50
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
51
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
52
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
53
|
+
if (t[2]) _.ops.pop();
|
|
54
|
+
_.trys.pop(); continue;
|
|
55
|
+
}
|
|
56
|
+
op = body.call(thisArg, _);
|
|
57
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
58
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
62
|
+
exports.Trash = exports.TrashTypes = void 0;
|
|
63
|
+
var headers_1 = require("../../shared/headers");
|
|
64
|
+
var client_1 = require("../../shared/http/client");
|
|
65
|
+
exports.TrashTypes = __importStar(require("./types"));
|
|
66
|
+
var Trash = /** @class */ (function () {
|
|
67
|
+
function Trash(apiUrl, appDetails, apiSecurity) {
|
|
68
|
+
this.client = client_1.HttpClient.create(apiUrl, apiSecurity.unauthorizedCallback);
|
|
69
|
+
this.appDetails = appDetails;
|
|
70
|
+
this.apiSecurity = apiSecurity;
|
|
71
|
+
}
|
|
72
|
+
Trash.client = function (apiUrl, appDetails, apiSecurity) {
|
|
73
|
+
return new Trash(apiUrl, appDetails, apiSecurity);
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* Removes a specific folder from the centralized persistence
|
|
77
|
+
* @param folderId
|
|
78
|
+
*/
|
|
79
|
+
Trash.prototype.deleteFolder = function (folderId) {
|
|
80
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
81
|
+
return __generator(this, function (_a) {
|
|
82
|
+
return [2 /*return*/, this.client.delete("/storage/folder/".concat(folderId), this.headers())];
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Deletes a specific file entry
|
|
88
|
+
* @param payload
|
|
89
|
+
*/
|
|
90
|
+
Trash.prototype.deleteFile = function (payload) {
|
|
91
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
92
|
+
return __generator(this, function (_a) {
|
|
93
|
+
return [2 /*return*/, this.client.delete("/storage/folder/".concat(payload.folderId, "/file/").concat(payload.fileId), this.headers())];
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* Returns a list of items in trash
|
|
99
|
+
*/
|
|
100
|
+
Trash.prototype.getTrash = function () {
|
|
101
|
+
return this.client.get('/storage/trash', this.headers());
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* Retrieves a paginated list of trashed files or folders.
|
|
105
|
+
* @param {number} limit - The number of items to retrieve per page.
|
|
106
|
+
* @param {number} [offset=0] - The number of items to skip before beginning to return items.
|
|
107
|
+
* @param {'files' | 'folders'} type - The type of content to retrieve.
|
|
108
|
+
* @param {boolean} root - A boolean indicating whether to retrieve content from the root folder.
|
|
109
|
+
* If is not true it has to get a folderId in order to obtain the items or given folderId
|
|
110
|
+
* @param {number} [folderId] - The ID of the folder to retrieve content from.
|
|
111
|
+
* @returns {Promise<FetchTrashContentResponse>} - A promise that resolves with the paginated list of trashed content.
|
|
112
|
+
*/
|
|
113
|
+
Trash.prototype.getTrashedFilesPaginated = function (limit, offset, type, root, folderId) {
|
|
114
|
+
if (offset === void 0) { offset = 0; }
|
|
115
|
+
var endpoint = '/storage/trash/paginated';
|
|
116
|
+
var folderIdQuery = folderId !== undefined ? "folderId=".concat(folderId, "&") : '';
|
|
117
|
+
var url = "".concat(endpoint, "?").concat(folderIdQuery, "limit=").concat(limit, "&offset=").concat(offset, "&type=").concat(type, "&root=").concat(root);
|
|
118
|
+
return this.client.get(url, this.headers());
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Retrieves a sorted list of trashed files or folders.
|
|
122
|
+
* @param {number} limit - The number of items to retrieve per page.
|
|
123
|
+
* @param {number} [offset=0] - The number of items to skip before beginning to return items.
|
|
124
|
+
* @param {'files' | 'folders'} type - The type of content to retrieve.
|
|
125
|
+
* @param {boolean} root - A boolean indicating whether to retrieve content from the root folder.
|
|
126
|
+
* If is not true it has to get a folderId in order to obtain the items or given folderId
|
|
127
|
+
* @param {'plainName' | 'date'} [sort] - The ID of the folder to retrieve content from.
|
|
128
|
+
* @param {'ASC' | 'DESC'} [order] - The ID of the folder to retrieve content from.
|
|
129
|
+
* @param {number} [folderId] - The ID of the folder to retrieve content from.
|
|
130
|
+
* @returns {Promise<FetchTrashContentResponse>} - A promise that resolves with the paginated list of trashed content.
|
|
131
|
+
*/
|
|
132
|
+
Trash.prototype.getTrashedItemsSorted = function (limit, offset, type, root, sort, order, folderId) {
|
|
133
|
+
if (offset === void 0) { offset = 0; }
|
|
134
|
+
var endpoint = '/storage/trash/paginated';
|
|
135
|
+
var folderIdQuery = folderId !== undefined ? "folderId=".concat(folderId, "&") : '';
|
|
136
|
+
var params = "limit=".concat(limit, "&offset=").concat(offset, "&type=").concat(type, "&root=").concat(root, "&sort=").concat(sort, "&order=").concat(order);
|
|
137
|
+
var url = "".concat(endpoint, "?").concat(folderIdQuery).concat(params);
|
|
138
|
+
return this.client.get(url, this.headers());
|
|
139
|
+
};
|
|
140
|
+
/**
|
|
141
|
+
* Add Items to Trash
|
|
142
|
+
* @param payload
|
|
143
|
+
*/
|
|
144
|
+
Trash.prototype.addItemsToTrash = function (payload) {
|
|
145
|
+
return this.client.post('/storage/trash/add', {
|
|
146
|
+
items: payload.items,
|
|
147
|
+
}, this.headers());
|
|
148
|
+
};
|
|
149
|
+
/**
|
|
150
|
+
* Removes all items from the trash
|
|
151
|
+
*/
|
|
152
|
+
Trash.prototype.clearTrash = function () {
|
|
153
|
+
return this.client.delete('/storage/trash/all', this.headers());
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* Deletes trashed items permanently
|
|
157
|
+
* @param payload
|
|
158
|
+
*/
|
|
159
|
+
Trash.prototype.deleteItemsPermanently = function (payload) {
|
|
160
|
+
return this.client.delete('/storage/trash', this.headers(), {
|
|
161
|
+
items: payload.items,
|
|
162
|
+
});
|
|
163
|
+
};
|
|
164
|
+
/**
|
|
165
|
+
* Deletes trashed items permanently by UUID.
|
|
166
|
+
*
|
|
167
|
+
* @param {DeleteItemsPermanentlyByUUIDPayload} payload - The payload containing the items to be deleted.
|
|
168
|
+
* @return {Promise<void>} A promise that resolves when the items are deleted permanently.
|
|
169
|
+
*/
|
|
170
|
+
Trash.prototype.deleteItemsPermanentlyByUUID = function (payload) {
|
|
171
|
+
return this.client.delete('/storage/trash', this.headers(), {
|
|
172
|
+
items: payload.items,
|
|
173
|
+
});
|
|
174
|
+
};
|
|
175
|
+
/**
|
|
176
|
+
* Returns the needed headers for the module requests
|
|
177
|
+
* @private
|
|
178
|
+
*/
|
|
179
|
+
Trash.prototype.headers = function () {
|
|
180
|
+
return (0, headers_1.headersWithToken)(this.appDetails.clientName, this.appDetails.clientVersion, this.apiSecurity.token, this.apiSecurity.workspaceToken);
|
|
181
|
+
};
|
|
182
|
+
return Trash;
|
|
183
|
+
}());
|
|
184
|
+
exports.Trash = Trash;
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
export interface AddItemsToTrashPayload {
|
|
2
|
-
items: Array<{
|
|
3
|
-
id?: string;
|
|
4
|
-
uuid?: string;
|
|
5
|
-
type: string;
|
|
6
|
-
}>;
|
|
7
|
-
}
|
|
8
|
-
export interface DeleteFilePayload {
|
|
9
|
-
fileId: number;
|
|
10
|
-
folderId: number;
|
|
11
|
-
}
|
|
12
|
-
export interface DeleteItemsPermanentlyPayload {
|
|
13
|
-
items: Array<{
|
|
14
|
-
id: number;
|
|
15
|
-
type: 'folder';
|
|
16
|
-
} | {
|
|
17
|
-
id: string;
|
|
18
|
-
type: 'file';
|
|
19
|
-
}>;
|
|
20
|
-
}
|
|
21
|
-
export interface DeleteItemsPermanentlyByUUIDPayload {
|
|
22
|
-
items: Array<{
|
|
23
|
-
uuid: string;
|
|
24
|
-
type: 'folder';
|
|
25
|
-
} | {
|
|
26
|
-
uuid: string;
|
|
27
|
-
type: 'file';
|
|
28
|
-
}>;
|
|
29
|
-
}
|
|
1
|
+
export interface AddItemsToTrashPayload {
|
|
2
|
+
items: Array<{
|
|
3
|
+
id?: string;
|
|
4
|
+
uuid?: string;
|
|
5
|
+
type: string;
|
|
6
|
+
}>;
|
|
7
|
+
}
|
|
8
|
+
export interface DeleteFilePayload {
|
|
9
|
+
fileId: number;
|
|
10
|
+
folderId: number;
|
|
11
|
+
}
|
|
12
|
+
export interface DeleteItemsPermanentlyPayload {
|
|
13
|
+
items: Array<{
|
|
14
|
+
id: number;
|
|
15
|
+
type: 'folder';
|
|
16
|
+
} | {
|
|
17
|
+
id: string;
|
|
18
|
+
type: 'file';
|
|
19
|
+
}>;
|
|
20
|
+
}
|
|
21
|
+
export interface DeleteItemsPermanentlyByUUIDPayload {
|
|
22
|
+
items: Array<{
|
|
23
|
+
uuid: string;
|
|
24
|
+
type: 'folder';
|
|
25
|
+
} | {
|
|
26
|
+
uuid: string;
|
|
27
|
+
type: 'file';
|
|
28
|
+
}>;
|
|
29
|
+
}
|