@ibm-aspera/sdk 0.16.0 → 0.19.0
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/README.md +1 -0
- package/dist/commonjs/app/core.d.ts +153 -20
- package/dist/commonjs/app/core.js +233 -79
- package/dist/commonjs/app/status.d.ts +24 -0
- package/dist/commonjs/app/status.js +96 -0
- package/dist/commonjs/connect/core.d.ts +2 -1
- package/dist/commonjs/connect/core.js +17 -2
- package/dist/commonjs/constants/messages.js +2 -2
- package/dist/commonjs/http-gateway/core.d.ts +10 -1
- package/dist/commonjs/http-gateway/core.js +38 -4
- package/dist/commonjs/http-gateway/index.d.ts +2 -2
- package/dist/commonjs/http-gateway/index.js +2 -1
- package/dist/commonjs/http-gateway/upload.js +1 -1
- package/dist/commonjs/index.d.ts +3 -3
- package/dist/commonjs/index.js +5 -1
- package/dist/commonjs/models/aspera-sdk.model.d.ts +13 -30
- package/dist/commonjs/models/aspera-sdk.model.js +15 -64
- package/dist/commonjs/models/models.d.ts +25 -1
- package/dist/js/aspera-sdk.js +1 -1
- package/dist/js/aspera-sdk.js.LICENSE.txt +1 -1
- package/dist/js/aspera-sdk.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.statusService = void 0;
|
|
4
|
+
var helpers_1 = require("../helpers/helpers");
|
|
5
|
+
var index_1 = require("../index");
|
|
6
|
+
var StatusService = /** @class */ (function () {
|
|
7
|
+
function StatusService() {
|
|
8
|
+
this.currentStatus = undefined;
|
|
9
|
+
this.callbacks = new Map();
|
|
10
|
+
this.pollTimerId = null;
|
|
11
|
+
this.failTimeoutId = null;
|
|
12
|
+
}
|
|
13
|
+
StatusService.prototype.getStatus = function () {
|
|
14
|
+
return this.currentStatus;
|
|
15
|
+
};
|
|
16
|
+
StatusService.prototype.setStatus = function (status) {
|
|
17
|
+
// When Desktop disconnects, remap to DEGRADED if HTTP Gateway is available
|
|
18
|
+
if (status === 'DISCONNECTED' && index_1.asperaSdk.httpGatewayIsReady) {
|
|
19
|
+
status = 'DEGRADED';
|
|
20
|
+
}
|
|
21
|
+
if (this.currentStatus === status) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
// Manage Desktop verification state based on status transitions
|
|
25
|
+
if (status === 'DISCONNECTED' || status === 'DEGRADED') {
|
|
26
|
+
index_1.asperaSdk.globals.asperaAppVerified = false;
|
|
27
|
+
}
|
|
28
|
+
else if (status === 'RUNNING' && (this.currentStatus === 'DISCONNECTED' || this.currentStatus === 'DEGRADED')) {
|
|
29
|
+
index_1.asperaSdk.globals.asperaAppVerified = true;
|
|
30
|
+
}
|
|
31
|
+
this.currentStatus = status;
|
|
32
|
+
this.callbacks.forEach(function (cb) { return cb(status); });
|
|
33
|
+
};
|
|
34
|
+
StatusService.prototype.registerCallback = function (cb) {
|
|
35
|
+
var id = "status-".concat((0, helpers_1.randomUUID)());
|
|
36
|
+
this.callbacks.set(id, cb);
|
|
37
|
+
if (this.currentStatus !== undefined) {
|
|
38
|
+
cb(this.currentStatus);
|
|
39
|
+
}
|
|
40
|
+
return id;
|
|
41
|
+
};
|
|
42
|
+
StatusService.prototype.deregisterCallback = function (id) {
|
|
43
|
+
this.callbacks.delete(id);
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Start Desktop detection polling loop.
|
|
47
|
+
*
|
|
48
|
+
* @param detectFn async function that resolves if Desktop is found, rejects if not
|
|
49
|
+
* @param interval ms between attempts
|
|
50
|
+
* @param failTimeout ms before transitioning to FAILED or DEGRADED
|
|
51
|
+
*/
|
|
52
|
+
StatusService.prototype.startPolling = function (detectFn, interval, failTimeout) {
|
|
53
|
+
var _this = this;
|
|
54
|
+
this.stopPolling();
|
|
55
|
+
this.setStatus('INITIALIZING');
|
|
56
|
+
this.failTimeoutId = setTimeout(function () {
|
|
57
|
+
if (_this.currentStatus !== 'RUNNING') {
|
|
58
|
+
if (index_1.asperaSdk.httpGatewayIsReady) {
|
|
59
|
+
_this.setStatus('DEGRADED');
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
_this.setStatus('FAILED');
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}, failTimeout);
|
|
66
|
+
var attempt = function () {
|
|
67
|
+
detectFn()
|
|
68
|
+
.then(function () {
|
|
69
|
+
_this.stopPolling();
|
|
70
|
+
_this.setStatus('RUNNING');
|
|
71
|
+
})
|
|
72
|
+
.catch(function () {
|
|
73
|
+
// Stay in current status (INITIALIZING or FAILED), poll continues
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
attempt();
|
|
77
|
+
this.pollTimerId = setInterval(attempt, interval);
|
|
78
|
+
};
|
|
79
|
+
StatusService.prototype.stopPolling = function () {
|
|
80
|
+
if (this.pollTimerId) {
|
|
81
|
+
clearInterval(this.pollTimerId);
|
|
82
|
+
this.pollTimerId = null;
|
|
83
|
+
}
|
|
84
|
+
if (this.failTimeoutId) {
|
|
85
|
+
clearTimeout(this.failTimeoutId);
|
|
86
|
+
this.failTimeoutId = null;
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
StatusService.prototype.reset = function () {
|
|
90
|
+
this.stopPolling();
|
|
91
|
+
this.currentStatus = undefined;
|
|
92
|
+
this.callbacks.clear();
|
|
93
|
+
};
|
|
94
|
+
return StatusService;
|
|
95
|
+
}());
|
|
96
|
+
exports.statusService = new StatusService();
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as ConnectTypes from '@ibm-aspera/connect-sdk-js/dist/esm/core/types';
|
|
2
|
+
import { InitOptions } from '../models/models';
|
|
2
3
|
/**
|
|
3
4
|
* Connect Core Logic
|
|
4
5
|
*
|
|
@@ -8,4 +9,4 @@ import * as ConnectTypes from '@ibm-aspera/connect-sdk-js/dist/esm/core/types';
|
|
|
8
9
|
*/
|
|
9
10
|
export declare const handleTransfers: (transfers: ConnectTypes.TransferInfo[]) => void;
|
|
10
11
|
export declare const connectInstallationFlow: () => void;
|
|
11
|
-
export declare const initConnect: (
|
|
12
|
+
export declare const initConnect: (connectSettings: InitOptions["connectSettings"]) => Promise<unknown>;
|
|
@@ -51,7 +51,22 @@ var connectInstallationFlow = function () {
|
|
|
51
51
|
index_1.asperaSdk.globals.connect.addEventListener(index_1.asperaSdk.globals.connectAW4.Connect.EVENT.STATUS, handleInstallerEvent);
|
|
52
52
|
};
|
|
53
53
|
exports.connectInstallationFlow = connectInstallationFlow;
|
|
54
|
-
var initConnect = function (
|
|
54
|
+
var initConnect = function (connectSettings) {
|
|
55
|
+
index_1.asperaSdk.globals.connect = new connect_sdk_js_1.Connect({
|
|
56
|
+
minVersion: connectSettings.minVersion || '3.10.1',
|
|
57
|
+
dragDropEnabled: connectSettings.dragDropEnabled,
|
|
58
|
+
connectMethod: connectSettings.method,
|
|
59
|
+
});
|
|
60
|
+
index_1.asperaSdk.globals.connectInstaller = new connect_sdk_js_1.ConnectInstaller({
|
|
61
|
+
sdkLocation: connectSettings.sdkLocation,
|
|
62
|
+
correlationId: connectSettings.correlationId,
|
|
63
|
+
style: 'carbon',
|
|
64
|
+
version: connectSettings.version,
|
|
65
|
+
});
|
|
66
|
+
index_1.asperaSdk.globals.connectAW4 = {
|
|
67
|
+
Connect: connect_sdk_js_1.Connect,
|
|
68
|
+
ConnectInstaller: connect_sdk_js_1.ConnectInstaller,
|
|
69
|
+
};
|
|
55
70
|
index_1.asperaSdk.globals.connect.addEventListener(connect_sdk_js_1.Connect.EVENT.STATUS, function (eventType, eventStatus) {
|
|
56
71
|
if (eventType === connect_sdk_js_1.Connect.EVENT.STATUS) {
|
|
57
72
|
index_1.asperaSdk.globals.connectStatus = eventStatus;
|
|
@@ -65,7 +80,7 @@ var initConnect = function (useIncludedInstaller) {
|
|
|
65
80
|
}
|
|
66
81
|
});
|
|
67
82
|
index_1.asperaSdk.globals.connect.initSession(index_1.asperaSdk.globals.appId);
|
|
68
|
-
if (
|
|
83
|
+
if (!connectSettings.hideIncludedInstaller) {
|
|
69
84
|
(0, exports.connectInstallationFlow)();
|
|
70
85
|
}
|
|
71
86
|
return Promise.resolve({ connectMode: true });
|
|
@@ -24,7 +24,7 @@ exports.messages = {
|
|
|
24
24
|
showSelectFolderDialogFailed: 'Unable to show select folder dialog',
|
|
25
25
|
showPreferencesFailed: 'Unable to show preferences',
|
|
26
26
|
stopTransferFailed: 'Unable to stop transfer',
|
|
27
|
-
stopTransferFailedExternal: 'Unable to stop transfer. The download must be
|
|
27
|
+
stopTransferFailedExternal: 'Unable to stop transfer. The download must be cancelled from the browser\'s download manager',
|
|
28
28
|
transferFailed: 'The transfer failed to initiate',
|
|
29
29
|
unableToFindElementOnPage: 'Unable to find the element on the current page',
|
|
30
30
|
unableToReadDropped: 'The dropped item could not be parsed. Please try selecting via the select file/folder option',
|
|
@@ -33,7 +33,7 @@ exports.messages = {
|
|
|
33
33
|
websocketNotReady: 'The websocket is not ready. Run init first',
|
|
34
34
|
httpNotAvailable: 'IBM Aspera HTTP Gateway is not available',
|
|
35
35
|
httpInitFail: 'IBM Aspera HTTP Gateway could not be started',
|
|
36
|
-
filePickerCancel: 'User
|
|
36
|
+
filePickerCancel: 'User cancelled the select file or folder dialog.',
|
|
37
37
|
fileNotAllowed: 'The specified path has not been allowed by the user.',
|
|
38
38
|
httpNetworkFail: 'HTTP network encountered unknown error.',
|
|
39
39
|
readAsArrayBufferFailed: 'Unable to read file as array buffer',
|
|
@@ -25,9 +25,18 @@ export declare const sendTransferUpdate: (transfer: AsperaSdkTransfer) => void;
|
|
|
25
25
|
* @returns a promise that resolves when the HTTP Gateway is initialized
|
|
26
26
|
*/
|
|
27
27
|
export declare const initHttpGateway: (response: HttpGatewayInfo) => Promise<void>;
|
|
28
|
+
/**
|
|
29
|
+
* Set up the HTTP Gateway by normalizing the URL, fetching the /info endpoint,
|
|
30
|
+
* and calling initHttpGateway with the response.
|
|
31
|
+
*
|
|
32
|
+
* @param url - The HTTP Gateway URL provided by the consumer
|
|
33
|
+
*
|
|
34
|
+
* @returns a promise that resolves when the HTTP Gateway is initialized
|
|
35
|
+
*/
|
|
36
|
+
export declare const setupHttpGateway: (url: string) => Promise<void>;
|
|
28
37
|
/**
|
|
29
38
|
* Stop an in-progress HTTP Gateway transfer.
|
|
30
|
-
* Aborts the underlying HTTP request and sets the transfer status to '
|
|
39
|
+
* Aborts the underlying HTTP request and sets the transfer status to 'cancelled'.
|
|
31
40
|
*
|
|
32
41
|
* Note: If the download is being directly handled by the browser's download manager, this will return
|
|
33
42
|
* an error. The user must cancel the download themselves in the browser's download manger.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.httpGatewayReadChunkAsArrayBuffer = exports.httpGatewayReadAsArrayBuffer = exports.base64Encoding = exports.getMessageFromError = exports.getSdkTransfer = exports.httpGatewaySelectFileFolderDialog = exports.handleHttpGatewayDrop = exports.createHtmlInputElement = exports.httpGetTransfer = exports.httpGetAllTransfers = exports.httpRemoveTransfer = exports.httpStopTransfer = exports.initHttpGateway = exports.sendTransferUpdate = void 0;
|
|
3
|
+
exports.httpGatewayReadChunkAsArrayBuffer = exports.httpGatewayReadAsArrayBuffer = exports.base64Encoding = exports.getMessageFromError = exports.getSdkTransfer = exports.httpGatewaySelectFileFolderDialog = exports.handleHttpGatewayDrop = exports.createHtmlInputElement = exports.httpGetTransfer = exports.httpGetAllTransfers = exports.httpRemoveTransfer = exports.httpStopTransfer = exports.setupHttpGateway = exports.initHttpGateway = exports.sendTransferUpdate = void 0;
|
|
4
4
|
var messages_1 = require("../constants/messages");
|
|
5
5
|
var helpers_1 = require("../helpers/helpers");
|
|
6
6
|
var index_1 = require("../index");
|
|
@@ -47,7 +47,12 @@ var initHttpGateway = function (response) {
|
|
|
47
47
|
// Watch for old HTTP Gateway transfers in case used.
|
|
48
48
|
(0, http_gateway_sdk_js_1.registerActivityCallback)(function (oldHttpTransfers) {
|
|
49
49
|
oldHttpTransfers.transfers.forEach(function (oldHttpTransfer) {
|
|
50
|
-
|
|
50
|
+
var transfer = oldHttpTransfer;
|
|
51
|
+
// The HTTP Gateway v2 SDK uses "canceled" but we standardize on "cancelled"
|
|
52
|
+
if (transfer.status === 'canceled') {
|
|
53
|
+
transfer.status = 'cancelled';
|
|
54
|
+
}
|
|
55
|
+
(0, exports.sendTransferUpdate)(transfer);
|
|
51
56
|
});
|
|
52
57
|
});
|
|
53
58
|
return (0, http_gateway_sdk_js_1.initHttpGateway)(index_1.asperaSdk.globals.httpGatewayUrl).then(function () { });
|
|
@@ -60,9 +65,38 @@ var initHttpGateway = function (response) {
|
|
|
60
65
|
return Promise.resolve();
|
|
61
66
|
};
|
|
62
67
|
exports.initHttpGateway = initHttpGateway;
|
|
68
|
+
/**
|
|
69
|
+
* Set up the HTTP Gateway by normalizing the URL, fetching the /info endpoint,
|
|
70
|
+
* and calling initHttpGateway with the response.
|
|
71
|
+
*
|
|
72
|
+
* @param url - The HTTP Gateway URL provided by the consumer
|
|
73
|
+
*
|
|
74
|
+
* @returns a promise that resolves when the HTTP Gateway is initialized
|
|
75
|
+
*/
|
|
76
|
+
var setupHttpGateway = function (url) {
|
|
77
|
+
var finalUrl = url.trim();
|
|
78
|
+
if (finalUrl.indexOf('http') !== 0) {
|
|
79
|
+
finalUrl = "https://".concat(finalUrl);
|
|
80
|
+
}
|
|
81
|
+
if (finalUrl.endsWith('/')) {
|
|
82
|
+
finalUrl = finalUrl.slice(0, -1);
|
|
83
|
+
}
|
|
84
|
+
index_1.asperaSdk.globals.httpGatewayUrl = finalUrl;
|
|
85
|
+
return fetch("".concat(finalUrl, "/info"), { method: 'GET' }).then(function (response) {
|
|
86
|
+
return response.json().then(function (responseData) {
|
|
87
|
+
if (response.status >= 400) {
|
|
88
|
+
throw Error(responseData);
|
|
89
|
+
}
|
|
90
|
+
return responseData;
|
|
91
|
+
});
|
|
92
|
+
}).then(function (response) {
|
|
93
|
+
return (0, exports.initHttpGateway)(response);
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
exports.setupHttpGateway = setupHttpGateway;
|
|
63
97
|
/**
|
|
64
98
|
* Stop an in-progress HTTP Gateway transfer.
|
|
65
|
-
* Aborts the underlying HTTP request and sets the transfer status to '
|
|
99
|
+
* Aborts the underlying HTTP request and sets the transfer status to 'cancelled'.
|
|
66
100
|
*
|
|
67
101
|
* Note: If the download is being directly handled by the browser's download manager, this will return
|
|
68
102
|
* an error. The user must cancel the download themselves in the browser's download manger.
|
|
@@ -83,7 +117,7 @@ var httpStopTransfer = function (id) {
|
|
|
83
117
|
else if (transfer.httpDownloadExternalHandle) {
|
|
84
118
|
return Promise.reject((0, helpers_1.generateErrorBody)(messages_1.messages.stopTransferFailedExternal, { reason: 'External handle' }));
|
|
85
119
|
}
|
|
86
|
-
transfer.status = '
|
|
120
|
+
transfer.status = 'cancelled';
|
|
87
121
|
var request = index_1.asperaSdk.httpGatewayRequestStore.get(id);
|
|
88
122
|
if (request) {
|
|
89
123
|
request.abort();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { httpDownload } from './download';
|
|
2
2
|
import { httpUpload } from './upload';
|
|
3
|
-
import { handleHttpGatewayDrop, httpGatewaySelectFileFolderDialog, createHtmlInputElement, initHttpGateway } from './core';
|
|
3
|
+
import { handleHttpGatewayDrop, httpGatewaySelectFileFolderDialog, createHtmlInputElement, initHttpGateway, setupHttpGateway } from './core';
|
|
4
4
|
/**
|
|
5
5
|
* HTTP Gateway Exports
|
|
6
6
|
*
|
|
@@ -8,4 +8,4 @@ import { handleHttpGatewayDrop, httpGatewaySelectFileFolderDialog, createHtmlInp
|
|
|
8
8
|
* Most logic is called directly by Desktop SDK functions
|
|
9
9
|
* You may not need to import anything from this file.
|
|
10
10
|
*/
|
|
11
|
-
export { httpUpload, httpDownload, handleHttpGatewayDrop, httpGatewaySelectFileFolderDialog, createHtmlInputElement, initHttpGateway, };
|
|
11
|
+
export { httpUpload, httpDownload, handleHttpGatewayDrop, httpGatewaySelectFileFolderDialog, createHtmlInputElement, initHttpGateway, setupHttpGateway, };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.initHttpGateway = exports.createHtmlInputElement = exports.httpGatewaySelectFileFolderDialog = exports.handleHttpGatewayDrop = exports.httpDownload = exports.httpUpload = void 0;
|
|
3
|
+
exports.setupHttpGateway = exports.initHttpGateway = exports.createHtmlInputElement = exports.httpGatewaySelectFileFolderDialog = exports.handleHttpGatewayDrop = exports.httpDownload = exports.httpUpload = void 0;
|
|
4
4
|
var download_1 = require("./download");
|
|
5
5
|
Object.defineProperty(exports, "httpDownload", { enumerable: true, get: function () { return download_1.httpDownload; } });
|
|
6
6
|
var upload_1 = require("./upload");
|
|
@@ -10,3 +10,4 @@ Object.defineProperty(exports, "handleHttpGatewayDrop", { enumerable: true, get:
|
|
|
10
10
|
Object.defineProperty(exports, "httpGatewaySelectFileFolderDialog", { enumerable: true, get: function () { return core_1.httpGatewaySelectFileFolderDialog; } });
|
|
11
11
|
Object.defineProperty(exports, "createHtmlInputElement", { enumerable: true, get: function () { return core_1.createHtmlInputElement; } });
|
|
12
12
|
Object.defineProperty(exports, "initHttpGateway", { enumerable: true, get: function () { return core_1.initHttpGateway; } });
|
|
13
|
+
Object.defineProperty(exports, "setupHttpGateway", { enumerable: true, get: function () { return core_1.setupHttpGateway; } });
|
|
@@ -54,7 +54,7 @@ var httpUpload = function (transferSpec, asperaSdkSpec) {
|
|
|
54
54
|
(0, core_1.sendTransferUpdate)(transferObject);
|
|
55
55
|
};
|
|
56
56
|
var triggerFailed = function () {
|
|
57
|
-
if (transferObject.status === '
|
|
57
|
+
if (transferObject.status === 'cancelled') {
|
|
58
58
|
return;
|
|
59
59
|
}
|
|
60
60
|
var errorData = (0, core_1.getMessageFromError)(request.response);
|
package/dist/commonjs/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { AsperaSdk } from './models/aspera-sdk.model';
|
|
2
|
-
import { authenticate, createDropzone, deregisterActivityCallback, deregisterStatusCallback, getAllTransfers, getCapabilities, getChecksum, getFilesList, getInfo, getTransfer, hasCapability, init, initDragDrop, modifyTransfer, showPreferencesPage, readAsArrayBuffer, readChunkAsArrayBuffer, readDirectory, registerActivityCallback, registerStatusCallback, removeDropzone, removeTransfer, resumeTransfer, setBranding, showAbout, showDirectory, showPreferences, showSaveFileDialog, showSelectFileDialog, showSelectFolderDialog, showTransferManager, showTransferMonitor, startTransfer, stopTransfer, testConnection, testSshPorts } from './app/core';
|
|
2
|
+
import { authenticate, createDropzone, deregisterActivityCallback, deregisterStatusCallback, getAllTransfers, getCapabilities, getChecksum, getFilesList, getInfo, getStatus, getTransfer, hasCapability, init, initDragDrop, initSession, modifyTransfer, showPreferencesPage, readAsArrayBuffer, readChunkAsArrayBuffer, readDirectory, registerActivityCallback, registerStatusCallback, removeDropzone, removeTransfer, resumeTransfer, setBranding, showAbout, showDirectory, showPreferences, showSaveFileDialog, showSelectFileDialog, showSelectFolderDialog, showTransferManager, showTransferMonitor, startTransfer, stopTransfer, testConnection, testSshPorts } from './app/core';
|
|
3
3
|
import { getInstallerInfo } from './app/installer';
|
|
4
4
|
import { getInstallerUrls, isSafari } from './helpers/helpers';
|
|
5
5
|
export declare const asperaSdk: AsperaSdk;
|
|
6
6
|
declare const launch: () => void;
|
|
7
|
-
export { isSafari, init, authenticate, testSshPorts, testConnection, startTransfer, launch, registerActivityCallback, deregisterActivityCallback, removeTransfer, showAbout, showDirectory, stopTransfer, resumeTransfer, getAllTransfers, getTransfer, getFilesList, showSelectFileDialog, showSelectFolderDialog, showSaveFileDialog, showPreferences, showTransferManager, showTransferMonitor, showPreferencesPage as openPreferencesPage, modifyTransfer, createDropzone, removeDropzone, initDragDrop, getInstallerInfo, registerStatusCallback, deregisterStatusCallback, setBranding, getInfo, readAsArrayBuffer, readChunkAsArrayBuffer, getInstallerUrls, getCapabilities, hasCapability, getChecksum, readDirectory, };
|
|
8
|
-
export type { AsperaSdkSpec, AsperaSdkTransfer, BrowserStyleFile, ChecksumFileResponse, DirectoryEntry, DirectoryListFilters, CustomBrandingOptions, CustomTheme, CustomThemeItems, DataTransferResponse, DropzoneEventData, DropzoneEventType, EntryType, DropzoneOptions, FileDialogOptions, FileError, FileFilter, FileStat, FileStatus, FolderDialogOptions, SaveFileDialogOptions, GetChecksumOptions, InitOptions, InstallerInfo, InstallerInfoResponse, InstallerOptions, InstallerUrlInfo, ModifyTransferOptions, ShowPreferencesPageOptions as OpenPreferencesPageOptions, OverwritePolicy, PaginatedFilesResponse, Pagination, Path, PreferencesPage, ReadAsArrayBufferResponse, ReadChunkAsArrayBufferResponse, ReadDirectoryOptions, ReadDirectoryResponse, ResumePolicy, ResumeTransferOptions, SafariExtensionEvent, SdkCapabilities, TestSshPortsOptions, TransferSpec, TransferStatus, WebsocketEvent, } from './models/models';
|
|
7
|
+
export { isSafari, init, authenticate, testSshPorts, testConnection, startTransfer, launch, registerActivityCallback, deregisterActivityCallback, removeTransfer, showAbout, showDirectory, stopTransfer, resumeTransfer, getAllTransfers, getTransfer, getFilesList, showSelectFileDialog, showSelectFolderDialog, showSaveFileDialog, showPreferences, showTransferManager, showTransferMonitor, showPreferencesPage as openPreferencesPage, modifyTransfer, createDropzone, removeDropzone, initDragDrop, getInstallerInfo, registerStatusCallback, deregisterStatusCallback, initSession, getStatus, setBranding, getInfo, readAsArrayBuffer, readChunkAsArrayBuffer, getInstallerUrls, getCapabilities, hasCapability, getChecksum, readDirectory, };
|
|
8
|
+
export type { AsperaSdkSpec, AsperaSdkTransfer, BrowserStyleFile, ChecksumFileResponse, DirectoryEntry, DirectoryListFilters, CustomBrandingOptions, CustomTheme, CustomThemeItems, DataTransferResponse, DropzoneEventData, DropzoneEventType, EntryType, DropzoneOptions, FileDialogOptions, FileError, FileFilter, FileStat, FileStatus, FolderDialogOptions, SaveFileDialogOptions, GetChecksumOptions, InitOptions, InstallerInfo, InstallerInfoResponse, InstallerOptions, InstallerUrlInfo, ModifyTransferOptions, ShowPreferencesPageOptions as OpenPreferencesPageOptions, OverwritePolicy, PaginatedFilesResponse, Pagination, Path, PreferencesPage, ReadAsArrayBufferResponse, ReadChunkAsArrayBufferResponse, ReadDirectoryOptions, ReadDirectoryResponse, ResumePolicy, ResumeTransferOptions, SafariExtensionEvent, SdkCapabilities, TestSshPortsOptions, TransferSpec, TransferStatus, SdkStatus, WebsocketEvent, } from './models/models';
|
|
9
9
|
export type { ActivityMessage, ActivityMessageTypes, AsperaSdkClientInfo, AsperaSdkInfo, TransferResponse, } from './models/aspera-sdk.model';
|
|
10
10
|
export { AsperaSdk, AsperaSdkGlobals } from './models/aspera-sdk.model';
|
|
11
11
|
export type { HttpGatewayInfo } from './http-gateway/models';
|
package/dist/commonjs/index.js
CHANGED
|
@@ -33,7 +33,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.AsperaSdkGlobals = exports.AsperaSdk = exports.readDirectory = exports.getChecksum = exports.hasCapability = exports.getCapabilities = exports.getInstallerUrls = exports.readChunkAsArrayBuffer = exports.readAsArrayBuffer = exports.getInfo = exports.setBranding = exports.deregisterStatusCallback = exports.registerStatusCallback = exports.getInstallerInfo = exports.initDragDrop = exports.removeDropzone = exports.createDropzone = exports.modifyTransfer = exports.openPreferencesPage = exports.showTransferMonitor = exports.showTransferManager = exports.showPreferences = exports.showSaveFileDialog = exports.showSelectFolderDialog = exports.showSelectFileDialog = exports.getFilesList = exports.getTransfer = exports.getAllTransfers = exports.resumeTransfer = exports.stopTransfer = exports.showDirectory = exports.showAbout = exports.removeTransfer = exports.deregisterActivityCallback = exports.registerActivityCallback = exports.launch = exports.startTransfer = exports.testConnection = exports.testSshPorts = exports.authenticate = exports.init = exports.isSafari = exports.asperaSdk = void 0;
|
|
36
|
+
exports.AsperaSdkGlobals = exports.AsperaSdk = exports.readDirectory = exports.getChecksum = exports.hasCapability = exports.getCapabilities = exports.getInstallerUrls = exports.readChunkAsArrayBuffer = exports.readAsArrayBuffer = exports.getInfo = exports.setBranding = exports.getStatus = exports.initSession = exports.deregisterStatusCallback = exports.registerStatusCallback = exports.getInstallerInfo = exports.initDragDrop = exports.removeDropzone = exports.createDropzone = exports.modifyTransfer = exports.openPreferencesPage = exports.showTransferMonitor = exports.showTransferManager = exports.showPreferences = exports.showSaveFileDialog = exports.showSelectFolderDialog = exports.showSelectFileDialog = exports.getFilesList = exports.getTransfer = exports.getAllTransfers = exports.resumeTransfer = exports.stopTransfer = exports.showDirectory = exports.showAbout = exports.removeTransfer = exports.deregisterActivityCallback = exports.registerActivityCallback = exports.launch = exports.startTransfer = exports.testConnection = exports.testSshPorts = exports.authenticate = exports.init = exports.isSafari = exports.asperaSdk = void 0;
|
|
37
37
|
var aspera_sdk_model_1 = require("./models/aspera-sdk.model");
|
|
38
38
|
var core_1 = require("./app/core");
|
|
39
39
|
Object.defineProperty(exports, "authenticate", { enumerable: true, get: function () { return core_1.authenticate; } });
|
|
@@ -45,10 +45,12 @@ Object.defineProperty(exports, "getCapabilities", { enumerable: true, get: funct
|
|
|
45
45
|
Object.defineProperty(exports, "getChecksum", { enumerable: true, get: function () { return core_1.getChecksum; } });
|
|
46
46
|
Object.defineProperty(exports, "getFilesList", { enumerable: true, get: function () { return core_1.getFilesList; } });
|
|
47
47
|
Object.defineProperty(exports, "getInfo", { enumerable: true, get: function () { return core_1.getInfo; } });
|
|
48
|
+
Object.defineProperty(exports, "getStatus", { enumerable: true, get: function () { return core_1.getStatus; } });
|
|
48
49
|
Object.defineProperty(exports, "getTransfer", { enumerable: true, get: function () { return core_1.getTransfer; } });
|
|
49
50
|
Object.defineProperty(exports, "hasCapability", { enumerable: true, get: function () { return core_1.hasCapability; } });
|
|
50
51
|
Object.defineProperty(exports, "init", { enumerable: true, get: function () { return core_1.init; } });
|
|
51
52
|
Object.defineProperty(exports, "initDragDrop", { enumerable: true, get: function () { return core_1.initDragDrop; } });
|
|
53
|
+
Object.defineProperty(exports, "initSession", { enumerable: true, get: function () { return core_1.initSession; } });
|
|
52
54
|
Object.defineProperty(exports, "modifyTransfer", { enumerable: true, get: function () { return core_1.modifyTransfer; } });
|
|
53
55
|
Object.defineProperty(exports, "openPreferencesPage", { enumerable: true, get: function () { return core_1.showPreferencesPage; } });
|
|
54
56
|
Object.defineProperty(exports, "readAsArrayBuffer", { enumerable: true, get: function () { return core_1.readAsArrayBuffer; } });
|
|
@@ -107,6 +109,8 @@ exports.asperaSdk.removeDropzone = core_1.removeDropzone;
|
|
|
107
109
|
exports.asperaSdk.getInstallerInfo = installer_1.getInstallerInfo;
|
|
108
110
|
exports.asperaSdk.registerStatusCallback = core_1.registerStatusCallback;
|
|
109
111
|
exports.asperaSdk.deregisterStatusCallback = core_1.deregisterStatusCallback;
|
|
112
|
+
exports.asperaSdk.initSession = core_1.initSession;
|
|
113
|
+
exports.asperaSdk.getStatus = core_1.getStatus;
|
|
110
114
|
exports.asperaSdk.initDragDrop = core_1.initDragDrop;
|
|
111
115
|
exports.asperaSdk.setBranding = core_1.setBranding;
|
|
112
116
|
exports.asperaSdk.getInfo = core_1.getInfo;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CustomBrandingOptions, DataTransferResponse, DropzoneEventData, DropzoneEventType, DropzoneOptions, AsperaSdkSpec, AsperaSdkTransfer, FileDialogOptions, FolderDialogOptions, SaveFileDialogOptions, InitOptions, InstallerInfoResponse, InstallerOptions, ModifyTransferOptions, Pagination, PaginatedFilesResponse, ResumeTransferOptions, SafariExtensionEvent, TransferSpec, WebsocketEvent, InstallerUrlInfo, SdkCapabilities, GetChecksumOptions, ChecksumFileResponse, ReadDirectoryOptions, ReadDirectoryResponse, ShowPreferencesPageOptions, TestSshPortsOptions } from './models';
|
|
1
|
+
import { CustomBrandingOptions, DataTransferResponse, DropzoneEventData, DropzoneEventType, DropzoneOptions, AsperaSdkSpec, AsperaSdkTransfer, FileDialogOptions, FolderDialogOptions, SaveFileDialogOptions, InitOptions, InstallerInfoResponse, InstallerOptions, ModifyTransferOptions, Pagination, PaginatedFilesResponse, ResumeTransferOptions, SafariExtensionEvent, SdkStatus, TransferSpec, WebsocketEvent, InstallerUrlInfo, SdkCapabilities, GetChecksumOptions, ChecksumFileResponse, ReadDirectoryOptions, ReadDirectoryResponse, ShowPreferencesPageOptions, TestSshPortsOptions } from './models';
|
|
2
2
|
import { HttpGatewayInfo } from '../http-gateway/models';
|
|
3
3
|
import * as ConnectTypes from '@ibm-aspera/connect-sdk-js/dist/esm/core/types';
|
|
4
4
|
import { Connect, ConnectInstaller } from '@ibm-aspera/connect-sdk-js';
|
|
@@ -84,12 +84,6 @@ export interface ActivityMessage {
|
|
|
84
84
|
export declare class ActivityTracking {
|
|
85
85
|
/** Map of callbacks that receive transfer update events */
|
|
86
86
|
private activity_callbacks;
|
|
87
|
-
/** Map of callbacks that receive connection events */
|
|
88
|
-
private event_callbacks;
|
|
89
|
-
/** Keep track of the last WebSocket event **/
|
|
90
|
-
private lastWebSocketEvent;
|
|
91
|
-
/** Keep track of the last notified WebSocket event **/
|
|
92
|
-
private lastNotifiedWebSocketEvent;
|
|
93
87
|
/**
|
|
94
88
|
* Notify all consumers when a message is received from the transfer client.
|
|
95
89
|
*
|
|
@@ -97,19 +91,18 @@ export declare class ActivityTracking {
|
|
|
97
91
|
*/
|
|
98
92
|
handleTransferActivity(message: ActivityMessage): void;
|
|
99
93
|
/**
|
|
100
|
-
* Handle and notify
|
|
94
|
+
* Handle and notify when a connection webSocketEvent occurs. For example, when the SDK
|
|
101
95
|
* websocket connection to IBM Aspera App is closed or reconnected.
|
|
102
96
|
*
|
|
97
|
+
* Bridges WebSocket events to StatusService as SdkStatus values.
|
|
98
|
+
*
|
|
103
99
|
* @param webSocketEvent the event type.
|
|
104
100
|
*/
|
|
105
101
|
handleWebSocketEvents(webSocketEvent: WebsocketEvent): void;
|
|
106
102
|
/**
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
* @param webSocketEvent the event type.
|
|
103
|
+
* Trigger manual event for other event types (e.g. Connect status strings).
|
|
104
|
+
* Bridges to StatusService.
|
|
110
105
|
*/
|
|
111
|
-
private notifyWebSocketEvent;
|
|
112
|
-
/** Trigger manual event for other event types. */
|
|
113
106
|
sendManualEventCallback(status: string): void;
|
|
114
107
|
/**
|
|
115
108
|
* Notify all consumers when the client changes status. For example, when
|
|
@@ -145,20 +138,6 @@ export declare class ActivityTracking {
|
|
|
145
138
|
* @param id the string of the callback to remove
|
|
146
139
|
*/
|
|
147
140
|
removeCallback(id: string): void;
|
|
148
|
-
/**
|
|
149
|
-
* Register a callback for getting websocket events back to the consumer
|
|
150
|
-
*
|
|
151
|
-
* @param callback the function to call with the websocket event
|
|
152
|
-
*
|
|
153
|
-
* @returns the ID of the callback index
|
|
154
|
-
*/
|
|
155
|
-
setWebSocketEventCallback(callback: (status: WebsocketEvent) => void): string;
|
|
156
|
-
/**
|
|
157
|
-
* Remove the callback (deregister) from the list of callbacks
|
|
158
|
-
*
|
|
159
|
-
* @param id the string of the callback to remove
|
|
160
|
-
*/
|
|
161
|
-
removeWebSocketEventCallback(id: string): void;
|
|
162
141
|
private registerDesktopAppSession;
|
|
163
142
|
}
|
|
164
143
|
export declare class AsperaSdk {
|
|
@@ -182,9 +161,13 @@ export declare class AsperaSdk {
|
|
|
182
161
|
/** Deregister callback to remove it from the callbacks getting transfer data */
|
|
183
162
|
deregisterActivityCallback: (id: string) => void;
|
|
184
163
|
/** Register callback for connection status events from the app */
|
|
185
|
-
registerStatusCallback: (callback: (status:
|
|
164
|
+
registerStatusCallback: (callback: (status: SdkStatus) => void) => string;
|
|
186
165
|
/** Deregister callback to remove it from the callbacks getting connection events */
|
|
187
166
|
deregisterStatusCallback: (id: string) => void;
|
|
167
|
+
/** Non-blocking initialization. Status events communicate lifecycle via registerStatusCallback. */
|
|
168
|
+
initSession: (options?: InitOptions) => void;
|
|
169
|
+
/** Get current SDK lifecycle status synchronously. */
|
|
170
|
+
getStatus: () => SdkStatus | undefined;
|
|
188
171
|
/** Function to remove a transfer */
|
|
189
172
|
removeTransfer: (transferId: string) => Promise<any>;
|
|
190
173
|
/** Function to show the transfer's download directory in Finder or Windows Explorer */
|
|
@@ -266,9 +249,9 @@ export declare class AsperaSdk {
|
|
|
266
249
|
/** HTTP Gateway in app threshold limit. This can be changed globally for the app. */
|
|
267
250
|
httpGatewayInBrowserDownloadThreshold: number;
|
|
268
251
|
/**
|
|
269
|
-
* Check if IBM Aspera is ready to be used and has been verified.
|
|
252
|
+
* Check if IBM Aspera for desktop is ready to be used and has been verified.
|
|
270
253
|
*
|
|
271
|
-
* @returns a boolean indicating if
|
|
254
|
+
* @returns a boolean indicating if IBM Aspera for desktop can be used for requests
|
|
272
255
|
*/
|
|
273
256
|
get isReady(): boolean;
|
|
274
257
|
/** Indicate that Connect is available. */
|
|
@@ -12,6 +12,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
};
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
exports.AsperaSdk = exports.ActivityTracking = exports.AsperaSdkGlobals = void 0;
|
|
15
|
+
var status_1 = require("../app/status");
|
|
15
16
|
var constants_1 = require("../constants/constants");
|
|
16
17
|
var messages_1 = require("../constants/messages");
|
|
17
18
|
var safari_client_1 = require("../helpers/client/safari-client");
|
|
@@ -88,12 +89,6 @@ var ActivityTracking = /** @class */ (function () {
|
|
|
88
89
|
function ActivityTracking() {
|
|
89
90
|
/** Map of callbacks that receive transfer update events */
|
|
90
91
|
this.activity_callbacks = new Map();
|
|
91
|
-
/** Map of callbacks that receive connection events */
|
|
92
|
-
this.event_callbacks = new Map();
|
|
93
|
-
/** Keep track of the last WebSocket event **/
|
|
94
|
-
this.lastWebSocketEvent = 'CLOSED';
|
|
95
|
-
/** Keep track of the last notified WebSocket event **/
|
|
96
|
-
this.lastNotifiedWebSocketEvent = undefined;
|
|
97
92
|
}
|
|
98
93
|
/**
|
|
99
94
|
* Notify all consumers when a message is received from the transfer client.
|
|
@@ -113,41 +108,27 @@ var ActivityTracking = /** @class */ (function () {
|
|
|
113
108
|
}
|
|
114
109
|
};
|
|
115
110
|
/**
|
|
116
|
-
* Handle and notify
|
|
111
|
+
* Handle and notify when a connection webSocketEvent occurs. For example, when the SDK
|
|
117
112
|
* websocket connection to IBM Aspera App is closed or reconnected.
|
|
118
113
|
*
|
|
114
|
+
* Bridges WebSocket events to StatusService as SdkStatus values.
|
|
115
|
+
*
|
|
119
116
|
* @param webSocketEvent the event type.
|
|
120
117
|
*/
|
|
121
118
|
ActivityTracking.prototype.handleWebSocketEvents = function (webSocketEvent) {
|
|
122
|
-
if (
|
|
123
|
-
|
|
119
|
+
if (webSocketEvent === 'CLOSED') {
|
|
120
|
+
status_1.statusService.setStatus('DISCONNECTED');
|
|
121
|
+
}
|
|
122
|
+
else if (webSocketEvent === 'RECONNECT') {
|
|
123
|
+
status_1.statusService.setStatus('RUNNING');
|
|
124
124
|
}
|
|
125
|
-
this.lastWebSocketEvent = webSocketEvent;
|
|
126
|
-
this.notifyWebSocketEvent(webSocketEvent);
|
|
127
125
|
};
|
|
128
126
|
/**
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
* @param webSocketEvent the event type.
|
|
127
|
+
* Trigger manual event for other event types (e.g. Connect status strings).
|
|
128
|
+
* Bridges to StatusService.
|
|
132
129
|
*/
|
|
133
|
-
ActivityTracking.prototype.notifyWebSocketEvent = function (webSocketEvent) {
|
|
134
|
-
if (this.lastNotifiedWebSocketEvent === webSocketEvent) {
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
this.lastNotifiedWebSocketEvent = webSocketEvent;
|
|
138
|
-
this.event_callbacks.forEach(function (callback) {
|
|
139
|
-
if (typeof callback === 'function') {
|
|
140
|
-
callback(webSocketEvent);
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
};
|
|
144
|
-
/** Trigger manual event for other event types. */
|
|
145
130
|
ActivityTracking.prototype.sendManualEventCallback = function (status) {
|
|
146
|
-
|
|
147
|
-
if (typeof callback === 'function') {
|
|
148
|
-
callback(status);
|
|
149
|
-
}
|
|
150
|
-
});
|
|
131
|
+
status_1.statusService.setStatus(status);
|
|
151
132
|
};
|
|
152
133
|
/**
|
|
153
134
|
* Notify all consumers when the client changes status. For example, when
|
|
@@ -156,14 +137,9 @@ var ActivityTracking = /** @class */ (function () {
|
|
|
156
137
|
* @param running whether the client is running or not.
|
|
157
138
|
*/
|
|
158
139
|
ActivityTracking.prototype.handleClientEvents = function (running) {
|
|
159
|
-
var webSocketEvent;
|
|
160
140
|
if (!running) {
|
|
161
|
-
|
|
162
|
-
}
|
|
163
|
-
else {
|
|
164
|
-
webSocketEvent = this.lastWebSocketEvent;
|
|
141
|
+
status_1.statusService.setStatus('DISCONNECTED');
|
|
165
142
|
}
|
|
166
|
-
this.notifyWebSocketEvent(webSocketEvent);
|
|
167
143
|
};
|
|
168
144
|
/**
|
|
169
145
|
* Notify all consumers when a Safari extension safariExtensionEvent occurs (enabled/disabled).
|
|
@@ -249,31 +225,6 @@ var ActivityTracking = /** @class */ (function () {
|
|
|
249
225
|
ActivityTracking.prototype.removeCallback = function (id) {
|
|
250
226
|
this.activity_callbacks.delete(id);
|
|
251
227
|
};
|
|
252
|
-
/**
|
|
253
|
-
* Register a callback for getting websocket events back to the consumer
|
|
254
|
-
*
|
|
255
|
-
* @param callback the function to call with the websocket event
|
|
256
|
-
*
|
|
257
|
-
* @returns the ID of the callback index
|
|
258
|
-
*/
|
|
259
|
-
ActivityTracking.prototype.setWebSocketEventCallback = function (callback) {
|
|
260
|
-
if (typeof callback !== 'function') {
|
|
261
|
-
(0, helpers_1.errorLog)(messages_1.messages.callbackIsNotFunction);
|
|
262
|
-
return;
|
|
263
|
-
}
|
|
264
|
-
var id = "callback-".concat(this.event_callbacks.size + 1);
|
|
265
|
-
this.event_callbacks.set(id, callback);
|
|
266
|
-
callback(this.lastWebSocketEvent);
|
|
267
|
-
return id;
|
|
268
|
-
};
|
|
269
|
-
/**
|
|
270
|
-
* Remove the callback (deregister) from the list of callbacks
|
|
271
|
-
*
|
|
272
|
-
* @param id the string of the callback to remove
|
|
273
|
-
*/
|
|
274
|
-
ActivityTracking.prototype.removeWebSocketEventCallback = function (id) {
|
|
275
|
-
this.event_callbacks.delete(id);
|
|
276
|
-
};
|
|
277
228
|
ActivityTracking.prototype.registerDesktopAppSession = function () {
|
|
278
229
|
var iframe = document.createElement('iframe');
|
|
279
230
|
iframe.style.display = 'none';
|
|
@@ -306,9 +257,9 @@ var AsperaSdk = /** @class */ (function () {
|
|
|
306
257
|
}
|
|
307
258
|
Object.defineProperty(AsperaSdk.prototype, "isReady", {
|
|
308
259
|
/**
|
|
309
|
-
* Check if IBM Aspera is ready to be used and has been verified.
|
|
260
|
+
* Check if IBM Aspera for desktop is ready to be used and has been verified.
|
|
310
261
|
*
|
|
311
|
-
* @returns a boolean indicating if
|
|
262
|
+
* @returns a boolean indicating if IBM Aspera for desktop can be used for requests
|
|
312
263
|
*/
|
|
313
264
|
get: function () {
|
|
314
265
|
return this.globals.asperaAppVerified && this.globals.appId !== '';
|
|
@@ -388,6 +388,15 @@ export interface TransferSpec {
|
|
|
388
388
|
delete_source?: boolean;
|
|
389
389
|
/** Directon of transfer, whether send (upload) or receive (download) */
|
|
390
390
|
direction?: 'send' | 'receive';
|
|
391
|
+
/**
|
|
392
|
+
* The name of the ZIP file created when downloading more than one file.
|
|
393
|
+
* For example, `download_name: 'project_files'` results in `project_files.zip`.
|
|
394
|
+
*
|
|
395
|
+
* Only applicable when `zip_required` is `true` or downloading multiple files.
|
|
396
|
+
*
|
|
397
|
+
* This field is only used by HTTP Gateway and is ignored by other transfer clients.
|
|
398
|
+
*/
|
|
399
|
+
download_name?: string;
|
|
391
400
|
/**
|
|
392
401
|
* Exclude files (but not directories) that are newer than a specific time from the transfer, based on when the file was last modified.
|
|
393
402
|
* Express in ISO 8601 format (for exanple, 2006-01-02T15:04:05Z) or as number of seconds elapsed since 00:00:00 UTC on 1 January 1970.
|
|
@@ -574,8 +583,18 @@ export interface TransferSpec {
|
|
|
574
583
|
token?: string;
|
|
575
584
|
/** Use ascp4 as the transfer engine. */
|
|
576
585
|
use_ascp4?: boolean;
|
|
586
|
+
/**
|
|
587
|
+
* **Required when downloading a folder via HTTP Gateway.** Set to `true` to have
|
|
588
|
+
* HTTP Gateway stream the folder contents back as a ZIP archive. Without this flag,
|
|
589
|
+
* HTTP Gateway cannot serve folder downloads.
|
|
590
|
+
*
|
|
591
|
+
* Use `download_name` to control the filename of the resulting ZIP (defaults to `download.zip`).
|
|
592
|
+
*
|
|
593
|
+
* This field is only used by HTTP Gateway and is ignored by other transfer clients.
|
|
594
|
+
*/
|
|
595
|
+
zip_required?: boolean;
|
|
577
596
|
}
|
|
578
|
-
export type TransferStatus = 'failed' | 'completed' | 'running' | 'queued' | 'removed' | '
|
|
597
|
+
export type TransferStatus = 'initiating' | 'failed' | 'completed' | 'running' | 'queued' | 'removed' | 'cancelled' | 'orphaned' | 'paused' | 'willretry';
|
|
579
598
|
/** Pagination options for paginated API requests. */
|
|
580
599
|
export interface Pagination {
|
|
581
600
|
/** Maximum number of entries to return. (Default: 1000) */
|
|
@@ -688,6 +707,7 @@ export interface InstallerInfoResponse {
|
|
|
688
707
|
export type WebsocketTopics = 'subscribe_transfer_activity' | 'transfer_activity';
|
|
689
708
|
export type WebsocketEvent = 'CLOSED' | 'RECONNECT';
|
|
690
709
|
export type SafariExtensionEvent = 'ENABLED' | 'DISABLED';
|
|
710
|
+
export type SdkStatus = 'INITIALIZING' | 'RETRYING' | 'RUNNING' | 'DEGRADED' | 'FAILED' | 'OUTDATED' | 'EXTENSION_INSTALL' | 'DISCONNECTED';
|
|
691
711
|
export interface WebsocketMessage {
|
|
692
712
|
jsonrpc: '2.0';
|
|
693
713
|
method: WebsocketTopics;
|
|
@@ -885,6 +905,10 @@ export interface InitOptions {
|
|
|
885
905
|
appId?: string;
|
|
886
906
|
/** Indicate if the computer is running multiple users possibly (avoid port crossing). */
|
|
887
907
|
supportMultipleUsers?: boolean;
|
|
908
|
+
/** Timeout in ms before status transitions to FAILED. Default: 5000. */
|
|
909
|
+
retryTimeout?: number;
|
|
910
|
+
/** Interval in ms between detection attempts. Default: 2000. */
|
|
911
|
+
retryInterval?: number;
|
|
888
912
|
/** HTTP Gateway Settings */
|
|
889
913
|
httpGatewaySettings?: {
|
|
890
914
|
/** Aspera HTTP Gateway URL to use if desktop is not available. Include gateway route but not versions (example: https://example.com/aspera/http-gwy). */
|