@ibm-aspera/sdk 0.2.29 → 0.4.12
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 +17 -13
- package/dist/commonjs/app/core.d.ts +234 -0
- package/dist/commonjs/app/core.js +812 -0
- package/dist/commonjs/app/installer.d.ts +9 -0
- package/dist/commonjs/app/installer.js +50 -0
- package/dist/commonjs/connect/core.d.ts +11 -0
- package/dist/commonjs/connect/core.js +73 -0
- package/dist/commonjs/constants/constants.d.ts +8 -0
- package/dist/commonjs/constants/constants.js +11 -0
- package/dist/commonjs/constants/messages.d.ts +38 -0
- package/dist/commonjs/constants/messages.js +41 -0
- package/dist/commonjs/helpers/client/client.d.ts +5 -0
- package/dist/commonjs/helpers/client/client.js +7 -0
- package/dist/commonjs/helpers/client/http-client.d.ts +42 -0
- package/dist/commonjs/helpers/client/http-client.js +84 -0
- package/dist/commonjs/helpers/client/safari-client.d.ts +101 -0
- package/dist/commonjs/helpers/client/safari-client.js +264 -0
- package/dist/commonjs/helpers/helpers.d.ts +109 -0
- package/dist/commonjs/helpers/helpers.js +249 -0
- package/dist/commonjs/helpers/http.d.ts +16 -0
- package/dist/commonjs/helpers/http.js +42 -0
- package/dist/commonjs/helpers/ws.d.ts +62 -0
- package/dist/commonjs/helpers/ws.js +161 -0
- package/dist/commonjs/http-gateway/core.d.ts +98 -0
- package/dist/commonjs/http-gateway/core.js +388 -0
- package/dist/commonjs/http-gateway/download.d.ts +14 -0
- package/dist/commonjs/http-gateway/download.js +187 -0
- package/dist/commonjs/http-gateway/index.d.ts +11 -0
- package/dist/commonjs/http-gateway/index.js +11 -0
- package/dist/commonjs/http-gateway/models.d.ts +16 -0
- package/dist/commonjs/http-gateway/models.js +2 -0
- package/dist/commonjs/http-gateway/upload.d.ts +14 -0
- package/dist/commonjs/http-gateway/upload.js +124 -0
- package/dist/commonjs/index.d.ts +12 -0
- package/dist/commonjs/index.js +109 -0
- package/dist/commonjs/models/aspera-sdk.model.d.ts +259 -0
- package/dist/commonjs/models/aspera-sdk.model.js +349 -0
- package/dist/commonjs/models/models.d.ts +760 -0
- package/dist/commonjs/models/models.js +2 -0
- package/dist/js/aspera-sdk.js +3 -0
- package/dist/js/aspera-sdk.js.LICENSE.txt +15 -0
- package/dist/js/aspera-sdk.js.map +1 -0
- package/package.json +8 -5
- package/.editorconfig +0 -13
- package/.github/CODEOWNERS +0 -1
- package/.github/CODE_OF_CONDUCT.md +0 -128
- package/.github/CONTRIBUTING.md +0 -147
- package/.github/dependabot.yml +0 -10
- package/.github/workflows/ci.yml +0 -39
- package/.github/workflows/documentation.yml +0 -44
- package/.github/workflows/publish.yml +0 -23
- package/.github/workflows/version.yml +0 -32
- package/.whitesource +0 -3
- package/CHANGELOG.md +0 -204
- package/docs/DEVELOPMENT.md +0 -38
- package/eslint.config.js +0 -104
- package/example/README.md +0 -7
- package/example/index.html +0 -14
- package/example/package-lock.json +0 -2989
- package/example/package.json +0 -30
- package/example/public/404.html +0 -5
- package/example/public/sdk-code.js +0 -326
- package/example/src/App/App.scss +0 -40
- package/example/src/App/index.tsx +0 -196
- package/example/src/Views/AllTogether.tsx +0 -26
- package/example/src/Views/DragDrop.tsx +0 -23
- package/example/src/Views/Home.tsx +0 -10
- package/example/src/Views/Initialize.tsx +0 -31
- package/example/src/Views/Installer.tsx +0 -154
- package/example/src/Views/MonitorTransfers.tsx +0 -88
- package/example/src/Views/Other.tsx +0 -24
- package/example/src/Views/SelectItems.tsx +0 -46
- package/example/src/Views/StartTransfer.tsx +0 -37
- package/example/src/Views/Test.tsx +0 -20
- package/example/src/Views/Views.scss +0 -111
- package/example/src/helpers/index.ts +0 -19
- package/example/src/index.scss +0 -47
- package/example/src/main.tsx +0 -17
- package/example/src/vite-env.d.ts +0 -2
- package/example/tsconfig.json +0 -30
- package/example/vite.config.ts +0 -23
- package/jest.config.js +0 -19
- package/jest.setup.js +0 -0
- package/renovate.json +0 -12
- package/src/app/core.ts +0 -765
- package/src/app/installer.ts +0 -53
- package/src/connect/core.ts +0 -83
- package/src/constants/constants.ts +0 -19
- package/src/constants/messages.ts +0 -35
- package/src/helpers/client/client.ts +0 -11
- package/src/helpers/client/http-client.ts +0 -92
- package/src/helpers/client/safari-client.ts +0 -334
- package/src/helpers/helpers.ts +0 -253
- package/src/helpers/http.ts +0 -39
- package/src/helpers/ws.ts +0 -191
- package/src/http-gateway/core.ts +0 -273
- package/src/http-gateway/download.ts +0 -217
- package/src/http-gateway/index.ts +0 -19
- package/src/http-gateway/models.ts +0 -20
- package/src/http-gateway/upload.ts +0 -148
- package/src/index.ts +0 -72
- package/src/models/aspera-sdk.model.ts +0 -446
- package/src/models/models.ts +0 -740
- package/tests/client.spec.ts +0 -52
- package/tests/core.spec.ts +0 -13
- package/tests/helpers.spec.ts +0 -127
- package/tests/http.spec.ts +0 -14
- package/tests/installer.spec.ts +0 -135
- package/tests/mocks.ts +0 -11
- package/tsconfig.json +0 -14
- package/tsconfig.module.json +0 -16
- package/typedoc.js +0 -7
- package/webpack.config.js +0 -35
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.AsperaSdk = exports.ActivityTracking = exports.AsperaSdkGlobals = void 0;
|
|
15
|
+
var constants_1 = require("../constants/constants");
|
|
16
|
+
var messages_1 = require("../constants/messages");
|
|
17
|
+
var safari_client_1 = require("../helpers/client/safari-client");
|
|
18
|
+
var client_1 = require("../helpers/client/client");
|
|
19
|
+
var helpers_1 = require("../helpers/helpers");
|
|
20
|
+
var ws_1 = require("../helpers/ws");
|
|
21
|
+
var index_1 = require("../index");
|
|
22
|
+
var AsperaSdkGlobals = /** @class */ (function () {
|
|
23
|
+
function AsperaSdkGlobals() {
|
|
24
|
+
/** The URL of the IBM Aspera HTTP server to use with the SDK */
|
|
25
|
+
this.asperaAppUrl = 'http://127.0.0.1';
|
|
26
|
+
/** The URL of the IBM Aspera Desktop HTTP server to use with the SDK */
|
|
27
|
+
this.rpcPort = 33024;
|
|
28
|
+
/** The list of RPC methods supported by the running IBM Aspera for desktop application */
|
|
29
|
+
this.rpcMethods = [];
|
|
30
|
+
/** The default URL to check for latest Aspera installers */
|
|
31
|
+
this.installerUrl = constants_1.installerUrl;
|
|
32
|
+
/** Indicate that the server has been verified as working */
|
|
33
|
+
this.asperaAppVerified = false;
|
|
34
|
+
/** Indicate if multiple session is supported */
|
|
35
|
+
this.supportMultipleUsers = false;
|
|
36
|
+
/** Map of drop zones created by querySelector */
|
|
37
|
+
this.dropZonesCreated = new Map();
|
|
38
|
+
/** Indicate that the HTTP Gateway has been verified as working */
|
|
39
|
+
this.httpGatewayVerified = false;
|
|
40
|
+
/** Connect status */
|
|
41
|
+
this.connectStatus = 'WAITING';
|
|
42
|
+
}
|
|
43
|
+
AsperaSdkGlobals.prototype.backupLaunchMethod = function (url) {
|
|
44
|
+
window.alert(messages_1.messages.loadingProtocol);
|
|
45
|
+
window.location.href = url;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Launch the IBM Aspera App via protocol url. By default, a hidden IFRAME attempts to
|
|
49
|
+
* open the app but if that fails a fallback of opening a new window happens.
|
|
50
|
+
*/
|
|
51
|
+
AsperaSdkGlobals.prototype.launch = function () {
|
|
52
|
+
var _this = this;
|
|
53
|
+
try {
|
|
54
|
+
var element = document.createElement('iframe');
|
|
55
|
+
element.src = constants_1.protocol;
|
|
56
|
+
element.onerror = function (error) {
|
|
57
|
+
(0, helpers_1.errorLog)(messages_1.messages.failedToGenerateIframe, error);
|
|
58
|
+
_this.backupLaunchMethod(constants_1.protocol);
|
|
59
|
+
};
|
|
60
|
+
element.setAttribute('style', constants_1.hiddenStyleList);
|
|
61
|
+
document.body.appendChild(element);
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
(0, helpers_1.errorLog)(messages_1.messages.failedToGenerateIframe, error);
|
|
65
|
+
this.backupLaunchMethod(constants_1.protocol);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
Object.defineProperty(AsperaSdkGlobals.prototype, "sdkResponseData", {
|
|
69
|
+
get: function () {
|
|
70
|
+
return __assign(__assign({ verified: this.asperaAppVerified }, this.asperaSdkInfo), { httpGateway: {
|
|
71
|
+
verified: this.httpGatewayVerified,
|
|
72
|
+
url: this.httpGatewayUrl,
|
|
73
|
+
info: this.httpGatewayInfo,
|
|
74
|
+
}, connect: {
|
|
75
|
+
active: this.connectStatus === 'RUNNING',
|
|
76
|
+
status: this.connectStatus,
|
|
77
|
+
} });
|
|
78
|
+
},
|
|
79
|
+
enumerable: false,
|
|
80
|
+
configurable: true
|
|
81
|
+
});
|
|
82
|
+
return AsperaSdkGlobals;
|
|
83
|
+
}());
|
|
84
|
+
exports.AsperaSdkGlobals = AsperaSdkGlobals;
|
|
85
|
+
var ActivityTracking = /** @class */ (function () {
|
|
86
|
+
function ActivityTracking() {
|
|
87
|
+
/** Map of callbacks that receive transfer update events */
|
|
88
|
+
this.activity_callbacks = new Map();
|
|
89
|
+
/** Map of callbacks that receive connection events */
|
|
90
|
+
this.event_callbacks = new Map();
|
|
91
|
+
/** Keep track of the last WebSocket event **/
|
|
92
|
+
this.lastWebSocketEvent = 'CLOSED';
|
|
93
|
+
/** Keep track of the last notified WebSocket event **/
|
|
94
|
+
this.lastNotifiedWebSocketEvent = undefined;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Notify all consumers when a message is received from the websocket
|
|
98
|
+
*
|
|
99
|
+
* @param message the message received from the websocket
|
|
100
|
+
*/
|
|
101
|
+
ActivityTracking.prototype.handleTransferActivity = function (message) {
|
|
102
|
+
if (message.type === 'transferUpdated' || message.type === 'transferRemoved') {
|
|
103
|
+
this.activity_callbacks.forEach(function (callback) {
|
|
104
|
+
if (typeof callback === 'function') {
|
|
105
|
+
callback(message.data);
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* Handle and notify if needed when a connection webSocketEvent occurs. For example, when the SDK
|
|
112
|
+
* websocket connection to IBM Aspera App is closed or reconnected.
|
|
113
|
+
*
|
|
114
|
+
* @param webSocketEvent the event type.
|
|
115
|
+
*/
|
|
116
|
+
ActivityTracking.prototype.handleWebSocketEvents = function (webSocketEvent) {
|
|
117
|
+
if (this.lastWebSocketEvent === webSocketEvent) {
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
this.lastWebSocketEvent = webSocketEvent;
|
|
121
|
+
this.notifyWebSocketEvent(webSocketEvent);
|
|
122
|
+
};
|
|
123
|
+
/**
|
|
124
|
+
* Notify all consumers when a connection webSocketEvent occurs.
|
|
125
|
+
*
|
|
126
|
+
* @param webSocketEvent the event type.
|
|
127
|
+
*/
|
|
128
|
+
ActivityTracking.prototype.notifyWebSocketEvent = function (webSocketEvent) {
|
|
129
|
+
if (this.lastNotifiedWebSocketEvent === webSocketEvent) {
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
this.lastNotifiedWebSocketEvent = webSocketEvent;
|
|
133
|
+
this.event_callbacks.forEach(function (callback) {
|
|
134
|
+
if (typeof callback === 'function') {
|
|
135
|
+
callback(webSocketEvent);
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
};
|
|
139
|
+
/** Trigger manual event for other event types. */
|
|
140
|
+
ActivityTracking.prototype.sendManualEventCallback = function (status) {
|
|
141
|
+
this.event_callbacks.forEach(function (callback) {
|
|
142
|
+
if (typeof callback === 'function') {
|
|
143
|
+
callback(status);
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
148
|
+
* Notify all consumers when the client changes status. For example, when
|
|
149
|
+
* IBM Aspera App is launched or closed.
|
|
150
|
+
*
|
|
151
|
+
* @param running whether the client is running or not.
|
|
152
|
+
*/
|
|
153
|
+
ActivityTracking.prototype.handleClientEvents = function (running) {
|
|
154
|
+
var webSocketEvent;
|
|
155
|
+
if (!running) {
|
|
156
|
+
webSocketEvent = 'CLOSED';
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
webSocketEvent = this.lastWebSocketEvent;
|
|
160
|
+
}
|
|
161
|
+
this.notifyWebSocketEvent(webSocketEvent);
|
|
162
|
+
};
|
|
163
|
+
/**
|
|
164
|
+
* Notify all consumers when a Safari extension safariExtensionEvent occurs (enabled/disabled).
|
|
165
|
+
*
|
|
166
|
+
* @param safariExtensionEvent the event type.
|
|
167
|
+
*/
|
|
168
|
+
ActivityTracking.prototype.handleSafariExtensionEvents = function (safariExtensionEvent) {
|
|
169
|
+
index_1.asperaSdk.SAFARI_EXTENSION_STATUS = safariExtensionEvent;
|
|
170
|
+
};
|
|
171
|
+
/**
|
|
172
|
+
* Set up the activity tracking with IBM Aspera.
|
|
173
|
+
*
|
|
174
|
+
* @returns a promise that resolves when the websocket connection is established.
|
|
175
|
+
* Currently, this promise does not reject.
|
|
176
|
+
*/
|
|
177
|
+
ActivityTracking.prototype.setup = function () {
|
|
178
|
+
var _this = this;
|
|
179
|
+
if (index_1.asperaSdk.globals.sessionId) {
|
|
180
|
+
this.registerDesktopAppSession();
|
|
181
|
+
}
|
|
182
|
+
var finalCall = function () {
|
|
183
|
+
if ((0, helpers_1.isSafari)()) {
|
|
184
|
+
return safari_client_1.safariClient.monitorTransferActivity();
|
|
185
|
+
}
|
|
186
|
+
return ws_1.websocketService.init()
|
|
187
|
+
.then(function () {
|
|
188
|
+
ws_1.websocketService.registerMessage('transfer_activity', function (data) { return _this.handleTransferActivity(data); });
|
|
189
|
+
ws_1.websocketService.registerEvent(function (status) { return _this.handleWebSocketEvents(status); });
|
|
190
|
+
});
|
|
191
|
+
};
|
|
192
|
+
if (index_1.asperaSdk.globals.supportMultipleUsers) {
|
|
193
|
+
var retryCount_1 = 0;
|
|
194
|
+
var makeVerifyCall_1 = function (incrementIt) {
|
|
195
|
+
if (incrementIt) {
|
|
196
|
+
index_1.asperaSdk.globals.rpcPort = index_1.asperaSdk.globals.rpcPort + 1;
|
|
197
|
+
}
|
|
198
|
+
if (index_1.asperaSdk.globals.rpcPort > 33029) {
|
|
199
|
+
retryCount_1++;
|
|
200
|
+
index_1.asperaSdk.globals.rpcPort = 33024;
|
|
201
|
+
return new Promise(function (resolve) { return setTimeout(resolve, retryCount_1 * 1050); }).then(function () { return makeVerifyCall_1(false); });
|
|
202
|
+
}
|
|
203
|
+
return client_1.client.request('verify_session', { app_id: index_1.asperaSdk.globals.appId, session_id: index_1.asperaSdk.globals.sessionId })
|
|
204
|
+
.then(function (data) {
|
|
205
|
+
if (data.result) {
|
|
206
|
+
return finalCall();
|
|
207
|
+
}
|
|
208
|
+
return makeVerifyCall_1(true);
|
|
209
|
+
}).catch(function () {
|
|
210
|
+
if (retryCount_1 > 5) {
|
|
211
|
+
index_1.asperaSdk.globals.rpcPort = 33024;
|
|
212
|
+
return Promise.reject('Unable to find port running for session');
|
|
213
|
+
}
|
|
214
|
+
return makeVerifyCall_1(true);
|
|
215
|
+
});
|
|
216
|
+
};
|
|
217
|
+
return makeVerifyCall_1(false);
|
|
218
|
+
}
|
|
219
|
+
else {
|
|
220
|
+
return finalCall();
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
/**
|
|
224
|
+
* Register a callback for getting transfers back to the consumer
|
|
225
|
+
*
|
|
226
|
+
* @param callback the function to call with the array of transfers
|
|
227
|
+
*
|
|
228
|
+
* @returns the ID of the callback index
|
|
229
|
+
*/
|
|
230
|
+
ActivityTracking.prototype.setCallback = function (callback) {
|
|
231
|
+
if (typeof callback !== 'function') {
|
|
232
|
+
(0, helpers_1.errorLog)(messages_1.messages.callbackIsNotFunction);
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
var id = "callback-".concat(this.activity_callbacks.size + 1);
|
|
236
|
+
this.activity_callbacks.set(id, callback);
|
|
237
|
+
return id;
|
|
238
|
+
};
|
|
239
|
+
/**
|
|
240
|
+
* Remove the callback (deregister) from the list of callbacks
|
|
241
|
+
*
|
|
242
|
+
* @param id the string of the callback to remove
|
|
243
|
+
*/
|
|
244
|
+
ActivityTracking.prototype.removeCallback = function (id) {
|
|
245
|
+
this.activity_callbacks.delete(id);
|
|
246
|
+
};
|
|
247
|
+
/**
|
|
248
|
+
* Register a callback for getting websocket events back to the consumer
|
|
249
|
+
*
|
|
250
|
+
* @param callback the function to call with the websocket event
|
|
251
|
+
*
|
|
252
|
+
* @returns the ID of the callback index
|
|
253
|
+
*/
|
|
254
|
+
ActivityTracking.prototype.setWebSocketEventCallback = function (callback) {
|
|
255
|
+
if (typeof callback !== 'function') {
|
|
256
|
+
(0, helpers_1.errorLog)(messages_1.messages.callbackIsNotFunction);
|
|
257
|
+
return;
|
|
258
|
+
}
|
|
259
|
+
var id = "callback-".concat(this.event_callbacks.size + 1);
|
|
260
|
+
this.event_callbacks.set(id, callback);
|
|
261
|
+
callback(this.lastWebSocketEvent);
|
|
262
|
+
return id;
|
|
263
|
+
};
|
|
264
|
+
/**
|
|
265
|
+
* Remove the callback (deregister) from the list of callbacks
|
|
266
|
+
*
|
|
267
|
+
* @param id the string of the callback to remove
|
|
268
|
+
*/
|
|
269
|
+
ActivityTracking.prototype.removeWebSocketEventCallback = function (id) {
|
|
270
|
+
this.event_callbacks.delete(id);
|
|
271
|
+
};
|
|
272
|
+
ActivityTracking.prototype.registerDesktopAppSession = function () {
|
|
273
|
+
var iframe = document.createElement('iframe');
|
|
274
|
+
iframe.style.display = 'none';
|
|
275
|
+
iframe.src = "aspera://initialize?app_id=".concat(index_1.asperaSdk.globals.appId, "&session_id=").concat(index_1.asperaSdk.globals.sessionId);
|
|
276
|
+
document.body.appendChild(iframe);
|
|
277
|
+
setTimeout(function () {
|
|
278
|
+
document.body.removeChild(iframe);
|
|
279
|
+
}, 1000);
|
|
280
|
+
};
|
|
281
|
+
return ActivityTracking;
|
|
282
|
+
}());
|
|
283
|
+
exports.ActivityTracking = ActivityTracking;
|
|
284
|
+
var AsperaSdk = /** @class */ (function () {
|
|
285
|
+
function AsperaSdk() {
|
|
286
|
+
/** Global information about IBM Aspera */
|
|
287
|
+
this.globals = new AsperaSdkGlobals();
|
|
288
|
+
/** Activity tracking for watching transfers */
|
|
289
|
+
/** @ignore */
|
|
290
|
+
this.activityTracking = new ActivityTracking();
|
|
291
|
+
/** HTTP Gateway file store. Key is the file name. */
|
|
292
|
+
this.httpGatewaySelectedFiles = new Map();
|
|
293
|
+
/** Indicate if Safari Extension is enabled. If the extension is disabled during the lifecycle this will not update to disabled. */
|
|
294
|
+
this.SAFARI_EXTENSION_STATUS = 'DISABLED';
|
|
295
|
+
/** Store of HTTP Gateway transfers */
|
|
296
|
+
this.httpGatewayTransferStore = new Map();
|
|
297
|
+
/** HTTP Gateway in app threshold limit. This can be changed globally for the app. */
|
|
298
|
+
this.httpGatewayInBrowserDownloadThreshold = 1000000000;
|
|
299
|
+
}
|
|
300
|
+
Object.defineProperty(AsperaSdk.prototype, "isReady", {
|
|
301
|
+
/**
|
|
302
|
+
* Check if IBM Aspera is ready to be used and has been verified.
|
|
303
|
+
*
|
|
304
|
+
* @returns a boolean indicating if SDK can be used for requests
|
|
305
|
+
*/
|
|
306
|
+
get: function () {
|
|
307
|
+
return this.globals.asperaAppVerified && this.globals.appId !== '';
|
|
308
|
+
},
|
|
309
|
+
enumerable: false,
|
|
310
|
+
configurable: true
|
|
311
|
+
});
|
|
312
|
+
Object.defineProperty(AsperaSdk.prototype, "useConnect", {
|
|
313
|
+
/** Indicate that Connect is available. */
|
|
314
|
+
get: function () {
|
|
315
|
+
return this.globals.connectStatus === 'RUNNING';
|
|
316
|
+
},
|
|
317
|
+
enumerable: false,
|
|
318
|
+
configurable: true
|
|
319
|
+
});
|
|
320
|
+
Object.defineProperty(AsperaSdk.prototype, "httpGatewayIsReady", {
|
|
321
|
+
/** Indicate that HTTP Gateway is available. */
|
|
322
|
+
get: function () {
|
|
323
|
+
return !!this.globals.httpGatewayVerified;
|
|
324
|
+
},
|
|
325
|
+
enumerable: false,
|
|
326
|
+
configurable: true
|
|
327
|
+
});
|
|
328
|
+
Object.defineProperty(AsperaSdk.prototype, "useHttpGateway", {
|
|
329
|
+
/** Indicates if internal calls should use Gateway */
|
|
330
|
+
get: function () {
|
|
331
|
+
return this.httpGatewayIsReady && !this.isReady && !this.useConnect;
|
|
332
|
+
},
|
|
333
|
+
enumerable: false,
|
|
334
|
+
configurable: true
|
|
335
|
+
});
|
|
336
|
+
Object.defineProperty(AsperaSdk.prototype, "useOldHttpGateway", {
|
|
337
|
+
/** Indicates if old HTTP Gateway SDK should be used (v2 and lower) */
|
|
338
|
+
get: function () {
|
|
339
|
+
if (!this.useHttpGateway) {
|
|
340
|
+
return false;
|
|
341
|
+
}
|
|
342
|
+
return Number(this.globals.httpGatewayInfo.version.split('.')[0] || 3) <= 2;
|
|
343
|
+
},
|
|
344
|
+
enumerable: false,
|
|
345
|
+
configurable: true
|
|
346
|
+
});
|
|
347
|
+
return AsperaSdk;
|
|
348
|
+
}());
|
|
349
|
+
exports.AsperaSdk = AsperaSdk;
|