@internxt/sdk 1.9.13 → 1.9.15
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.
|
@@ -3,7 +3,7 @@ import { ApiSecurity, ApiUrl, AppDetails } from '../../shared';
|
|
|
3
3
|
import { RequestCanceler } from '../../shared/http/client';
|
|
4
4
|
import { UUID } from '../../shared/types/userSettings';
|
|
5
5
|
import { ItemType } from './../../workspaces/types';
|
|
6
|
-
import { AddItemsToTrashPayload, CheckDuplicatedFilesPayload, CheckDuplicatedFilesResponse, CheckDuplicatedFolderPayload, CheckDuplicatedFoldersResponse, CreateFolderByUuidPayload, CreateFolderPayload, CreateFolderResponse, DeleteFilePayload, DriveFileData, FetchFolderContentResponse, FetchLimitResponse, FetchPaginatedFilesContent, FetchPaginatedFolderContentResponse, FetchPaginatedFoldersContent, FileEntry, FileEntryByUuid, FileMeta, FolderAncestor, FolderAncestorWorkspace, FolderMeta, FolderTreeResponse, MoveFilePayload, MoveFileResponse, MoveFileUuidPayload, MoveFolderPayload, MoveFolderResponse, MoveFolderUuidPayload, ReplaceFile, SearchResultData, Thumbnail, ThumbnailEntry, UpdateFilePayload, UpdateFolderMetadataPayload, UsageResponse } from './types';
|
|
6
|
+
import { AddItemsToTrashPayload, CheckDuplicatedFilesPayload, CheckDuplicatedFilesResponse, CheckDuplicatedFolderPayload, CheckDuplicatedFoldersResponse, CreateFolderByUuidPayload, CreateFolderPayload, CreateFolderResponse, CreateThumbnailEntryPayload, DeleteFilePayload, DriveFileData, FetchFolderContentResponse, FetchLimitResponse, FetchPaginatedFilesContent, FetchPaginatedFolderContentResponse, FetchPaginatedFoldersContent, FileEntry, FileEntryByUuid, FileMeta, FolderAncestor, FolderAncestorWorkspace, FolderMeta, FolderTreeResponse, MoveFilePayload, MoveFileResponse, MoveFileUuidPayload, MoveFolderPayload, MoveFolderResponse, MoveFolderUuidPayload, ReplaceFile, SearchResultData, Thumbnail, ThumbnailEntry, UpdateFilePayload, UpdateFolderMetadataPayload, UsageResponse } from './types';
|
|
7
7
|
export * as StorageTypes from './types';
|
|
8
8
|
export declare class Storage {
|
|
9
9
|
private readonly client;
|
|
@@ -148,6 +148,11 @@ export declare class Storage {
|
|
|
148
148
|
* @param thumbnailEntry
|
|
149
149
|
*/
|
|
150
150
|
createThumbnailEntry(thumbnailEntry: ThumbnailEntry, resourcesToken?: Token): Promise<Thumbnail>;
|
|
151
|
+
/**
|
|
152
|
+
* Creates a new thumbnail entry using drive-server-wip
|
|
153
|
+
* @param CreateThumbnailEntryPayload
|
|
154
|
+
*/
|
|
155
|
+
createThumbnailEntryWithUUID(thumbnailEntry: CreateThumbnailEntryPayload, resourcesToken?: string): Promise<Thumbnail>;
|
|
151
156
|
/**
|
|
152
157
|
* Updates the details of a file entry
|
|
153
158
|
* @param payload
|
|
@@ -371,6 +371,13 @@ var Storage = /** @class */ (function () {
|
|
|
371
371
|
thumbnail: thumbnailEntry,
|
|
372
372
|
}, (0, headers_1.addResourcesTokenToHeaders)(this.headers(), resourcesToken));
|
|
373
373
|
};
|
|
374
|
+
/**
|
|
375
|
+
* Creates a new thumbnail entry using drive-server-wip
|
|
376
|
+
* @param CreateThumbnailEntryPayload
|
|
377
|
+
*/
|
|
378
|
+
Storage.prototype.createThumbnailEntryWithUUID = function (thumbnailEntry, resourcesToken) {
|
|
379
|
+
return this.client.post('/files/thumbnail', __assign({}, thumbnailEntry), (0, headers_1.addResourcesTokenToHeaders)(this.headers(), resourcesToken));
|
|
380
|
+
};
|
|
374
381
|
/**
|
|
375
382
|
* Updates the details of a file entry
|
|
376
383
|
* @param payload
|
|
@@ -275,6 +275,17 @@ export interface ThumbnailEntry {
|
|
|
275
275
|
bucket_file: string;
|
|
276
276
|
encrypt_version: EncryptionVersion;
|
|
277
277
|
}
|
|
278
|
+
export interface CreateThumbnailEntryPayload {
|
|
279
|
+
fileId: number;
|
|
280
|
+
fileUuid: string;
|
|
281
|
+
type: string;
|
|
282
|
+
size: number;
|
|
283
|
+
maxWidth: number;
|
|
284
|
+
maxHeight: number;
|
|
285
|
+
bucketId: string;
|
|
286
|
+
bucketFile: string;
|
|
287
|
+
encryptVersion: EncryptionVersion;
|
|
288
|
+
}
|
|
278
289
|
export interface CreateFolderPayload {
|
|
279
290
|
parentFolderId: number;
|
|
280
291
|
folderName: string;
|
package/dist/meet/index.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export declare class Meet {
|
|
|
8
8
|
static client(apiUrl: ApiUrl, appDetails: AppDetails, apiSecurity?: ApiSecurity): Meet;
|
|
9
9
|
createCall(): Promise<CreateCallResponse>;
|
|
10
10
|
joinCall(callId: string, payload: JoinCallPayload): Promise<JoinCallResponse>;
|
|
11
|
+
leaveCall(callId: string): Promise<void>;
|
|
11
12
|
getCurrentUsersInCall(callId: string): Promise<UsersInCallResponse[]>;
|
|
12
13
|
private headersWithToken;
|
|
13
14
|
private basicHeaders;
|
package/dist/meet/index.js
CHANGED
|
@@ -76,6 +76,16 @@ var Meet = /** @class */ (function () {
|
|
|
76
76
|
});
|
|
77
77
|
});
|
|
78
78
|
};
|
|
79
|
+
Meet.prototype.leaveCall = function (callId) {
|
|
80
|
+
var _a;
|
|
81
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
82
|
+
var headers;
|
|
83
|
+
return __generator(this, function (_b) {
|
|
84
|
+
headers = ((_a = this.apiSecurity) === null || _a === void 0 ? void 0 : _a.token) ? this.headersWithToken() : this.basicHeaders();
|
|
85
|
+
return [2 /*return*/, this.client.post("call/".concat(callId, "/users/leave"), {}, headers)];
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
};
|
|
79
89
|
Meet.prototype.getCurrentUsersInCall = function (callId) {
|
|
80
90
|
var _a;
|
|
81
91
|
return __awaiter(this, void 0, void 0, function () {
|
package/dist/meet/index.test.js
CHANGED
|
@@ -193,6 +193,47 @@ describe('Meet service tests', function () {
|
|
|
193
193
|
});
|
|
194
194
|
}); });
|
|
195
195
|
});
|
|
196
|
+
describe('leaveCall method', function () {
|
|
197
|
+
var callId = 'call-123';
|
|
198
|
+
it('should leave a call successfully with token', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
199
|
+
var _a, client, headers, postCall;
|
|
200
|
+
return __generator(this, function (_b) {
|
|
201
|
+
switch (_b.label) {
|
|
202
|
+
case 0:
|
|
203
|
+
_a = clientAndHeadersWithToken(), client = _a.client, headers = _a.headers;
|
|
204
|
+
postCall = sinon_1.default.stub(httpClient, 'post').resolves();
|
|
205
|
+
// Act
|
|
206
|
+
return [4 /*yield*/, client.leaveCall(callId)];
|
|
207
|
+
case 1:
|
|
208
|
+
// Act
|
|
209
|
+
_b.sent();
|
|
210
|
+
// Assert
|
|
211
|
+
expect(postCall.firstCall.args).toEqual(["call/".concat(callId, "/users/leave"), {}, headers]);
|
|
212
|
+
return [2 /*return*/];
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
}); });
|
|
216
|
+
it('should leave a call successfully without token', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
217
|
+
var _a, client, headers, postCall;
|
|
218
|
+
return __generator(this, function (_b) {
|
|
219
|
+
switch (_b.label) {
|
|
220
|
+
case 0:
|
|
221
|
+
_a = clientAndHeadersWithoutToken(), client = _a.client, headers = _a.headers;
|
|
222
|
+
postCall = sinon_1.default.stub(httpClient, 'post').resolves();
|
|
223
|
+
// Act
|
|
224
|
+
return [4 /*yield*/, client.leaveCall(callId)];
|
|
225
|
+
case 1:
|
|
226
|
+
// Act
|
|
227
|
+
_b.sent();
|
|
228
|
+
// Assert
|
|
229
|
+
expect(postCall.firstCall.args[0]).toEqual("call/".concat(callId, "/users/leave"));
|
|
230
|
+
expect(postCall.firstCall.args[1]).toEqual({});
|
|
231
|
+
expect(postCall.firstCall.args[2]).toEqual(headers);
|
|
232
|
+
return [2 /*return*/];
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
}); });
|
|
236
|
+
});
|
|
196
237
|
});
|
|
197
238
|
function clientAndHeadersWithToken(apiUrl, clientName, clientVersion, token) {
|
|
198
239
|
if (apiUrl === void 0) { apiUrl = ''; }
|