@ibm-aspera/sdk 0.20.1 → 0.21.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.
@@ -1440,11 +1440,11 @@ var supportsMethod = function (method) {
1440
1440
  // We currently do not support calculating file checksums when using HTTP Gateway. In theory it should be possible
1441
1441
  // to calculate this directly in the browser similar to how `readAsArrayBuffer()` is implemented.
1442
1442
  // HTTP Gateway also does not support showing native transfer client UI (about, preferences, etc.).
1443
- if (index_1.asperaSdk.useHttpGateway && (method === 'get_checksum' || method === 'show_about' || method === 'open_preferences' || method === 'show_transfer_manager' || method === 'show_transfer_monitor' || method === 'authenticate' || method === 'test_ssh_ports' || method === 'show_save_file_dialog' || method === 'read_directory')) {
1443
+ if (index_1.asperaSdk.useHttpGateway && (method === 'get_checksum' || method === 'show_about' || method === 'open_preferences' || method === 'show_transfer_manager' || method === 'show_transfer_monitor' || method === 'authenticate' || method === 'test_ssh_ports' || method === 'show_save_file_dialog' || method === 'read_directory' || method === 'get_files_list' || method === 'update_branding' || method === 'show_directory' || method === 'modify_transfer' || method === 'resume_transfer')) {
1444
1444
  return false;
1445
1445
  }
1446
1446
  // Reading directory contents is only supported by the Desktop App (not Connect).
1447
- if (index_1.asperaSdk.useConnect && method === 'read_directory') {
1447
+ if (index_1.asperaSdk.useConnect && (method === 'read_directory' || method === 'get_files_list' || method === 'update_branding')) {
1448
1448
  return false;
1449
1449
  }
1450
1450
  // HTTP Gateway and Connect do not have any RPC methods so fallback to true
@@ -1486,6 +1486,12 @@ var getCapabilities = function () {
1486
1486
  testSshPorts: supportsMethod('test_ssh_ports'),
1487
1487
  showSaveFileDialog: supportsMethod('show_save_file_dialog'),
1488
1488
  readDirectory: supportsMethod('read_directory'),
1489
+ getFilesList: supportsMethod('get_files_list'),
1490
+ setBranding: supportsMethod('update_branding'),
1491
+ showDirectory: supportsMethod('show_directory'),
1492
+ folderUpload: !index_1.asperaSdk.useOldHttpGateway,
1493
+ modifyTransfer: supportsMethod('modify_transfer'),
1494
+ resumeTransfer: supportsMethod('resume_transfer'),
1489
1495
  };
1490
1496
  };
1491
1497
  exports.getCapabilities = getCapabilities;
@@ -124,10 +124,24 @@ var ActivityTracking = /** @class */ (function () {
124
124
  * @param webSocketEvent the event type.
125
125
  */
126
126
  ActivityTracking.prototype.handleWebSocketEvents = function (webSocketEvent) {
127
+ var current_status = status_1.statusService.getStatus();
127
128
  if (webSocketEvent === 'CLOSED') {
128
129
  status_1.statusService.setStatus('DISCONNECTED');
130
+ return;
131
+ }
132
+ if (webSocketEvent !== 'RECONNECT') {
133
+ return;
129
134
  }
130
- else if (webSocketEvent === 'RECONNECT') {
135
+ // Only treat RECONNECT as a transition to RUNNING when we have prior verification of
136
+ // IBM Aspera for desktop. For example, if IBM Aspera for desktop was RUNNING and verified,
137
+ // and then the user quits and restarts the application.
138
+ //
139
+ // TODO: This potentially leads to a data race if the application was quit/restarted because it was being
140
+ // upgraded. The new application may have newer RPC methods, but transitioning to RUNNING here could
141
+ // potentially lead to an application seeing stale RPC methods if they call `hasCapability()`, for example,
142
+ // in the status event listener.
143
+ var wasPreviouslyVerified = index_1.asperaSdk.globals.rpcMethods.length > 0;
144
+ if (current_status === 'DISCONNECTED' || (current_status === 'DEGRADED' && wasPreviouslyVerified)) {
131
145
  status_1.statusService.setStatus('RUNNING');
132
146
  }
133
147
  };
@@ -966,70 +966,99 @@ export interface RpcMethod {
966
966
  */
967
967
  export interface SdkCapabilities {
968
968
  /**
969
- * Whether the SDK can read file contents for generating image previews.
969
+ * Whether the transfer client can read file contents for generating image previews.
970
970
  *
971
- * Image preview is supported if the SDK is using HTTP Gateway, Connect, or IBM Aspera for desktop
972
- * with the required RPC methods.
971
+ * This is supported when using HTTP Gateway, Connect, or IBM Aspera for desktop.
973
972
  */
974
973
  imagePreview: boolean;
975
974
  /**
976
- * Whether the SDK can calculate checksums of a file chunk.
975
+ * Whether the transfer client can calculate checksums of a file chunk.
977
976
  */
978
977
  fileChecksum: boolean;
979
978
  /**
980
979
  * Whether the transfer client supports showing the about page.
981
980
  *
982
- * This is supported when using Connect or IBM Aspera for desktop with the required RPC methods,
983
- * but not HTTP Gateway.
981
+ * This is supported when using Connect or IBM Aspera for desktop.
984
982
  */
985
983
  showAbout: boolean;
986
984
  /**
987
985
  * Whether the transfer client supports showing the preferences page.
988
986
  *
989
- * This is supported when using Connect or IBM Aspera for desktop with the required RPC methods,
990
- * but not HTTP Gateway.
987
+ * This is supported when using Connect or IBM Aspera for desktop.
991
988
  */
992
989
  showPreferences: boolean;
993
990
  /**
994
991
  * Whether the transfer client supports showing the transfer manager.
995
992
  *
996
- * This is supported when using Connect or IBM Aspera for desktop with the required RPC methods,
997
- * but not HTTP Gateway.
993
+ * This is supported when using Connect or IBM Aspera for desktop.
998
994
  */
999
995
  showTransferManager: boolean;
1000
996
  /**
1001
997
  * Whether the transfer client supports showing the transfer rate monitor.
1002
998
  *
1003
- * This is supported when using Connect or IBM Aspera for desktop with the required RPC methods,
1004
- * but not HTTP Gateway.
999
+ * This is supported when using Connect or IBM Aspera for desktop.
1005
1000
  */
1006
1001
  showTransferMonitor: boolean;
1007
1002
  /**
1008
1003
  * Whether the transfer client supports authenticating a transfer specification.
1009
1004
  *
1010
- * This is supported when using Connect or IBM Aspera for desktop with the required RPC methods,
1011
- * but not HTTP Gateway.
1005
+ * This is supported when using Connect or IBM Aspera for desktop.
1012
1006
  */
1013
1007
  authenticate: boolean;
1014
1008
  /**
1015
1009
  * Whether the transfer client supports testing SSH port connectivity.
1016
1010
  *
1017
- * This is supported when using Connect or IBM Aspera for desktop with the required RPC methods,
1018
- * but not HTTP Gateway.
1011
+ * This is supported when using Connect or IBM Aspera for desktop.
1019
1012
  */
1020
1013
  testSshPorts: boolean;
1021
1014
  /**
1022
1015
  * Whether the transfer client supports showing the save file dialog.
1023
1016
  *
1024
- * This is supported when using Connect or IBM Aspera for desktop with the required RPC methods,
1025
- * but not HTTP Gateway.
1017
+ * This is supported when using Connect or IBM Aspera for desktop.
1026
1018
  */
1027
1019
  showSaveFileDialog: boolean;
1028
1020
  /**
1029
- * Whether the SDK can read directory contents.
1021
+ * Whether the transfer client can read directory contents.
1030
1022
  *
1031
- * This is supported when using IBM Aspera for desktop with the required RPC methods,
1032
- * but not Connect or HTTP Gateway.
1023
+ * This is only supported when using IBM Aspera for desktop.
1033
1024
  */
1034
1025
  readDirectory: boolean;
1026
+ /**
1027
+ * Whether the transfer client supports getting file-level progress for a given transfer.
1028
+ *
1029
+ * This is supported when using IBM Aspera for desktop.
1030
+ */
1031
+ getFilesList: boolean;
1032
+ /**
1033
+ * Whether the transfer client supports customized branding settings.
1034
+ *
1035
+ * This is supported when using IBM Aspera for desktop.
1036
+ */
1037
+ setBranding: boolean;
1038
+ /**
1039
+ * Whether the transfer client supports highlighting the destination directory of the transfer
1040
+ * using the system's file browser (ex: Finder or Windows Explorer).
1041
+ *
1042
+ * This is supported when using Connect or IBM Aspera for desktop.
1043
+ */
1044
+ showDirectory: boolean;
1045
+ /**
1046
+ * Whether the transfer client supports uploading folders.
1047
+ *
1048
+ * This is supported when using Connect, IBM Aspera for desktop, and HTTP Gateway v3 or newer. HTTP Gateway v2 and older
1049
+ * do not support uploading folders.
1050
+ */
1051
+ folderUpload: boolean;
1052
+ /**
1053
+ * Whether the transfer client can modify a running transfer.
1054
+ *
1055
+ * This is supported when using Connect or IBM Aspera for desktop.
1056
+ */
1057
+ modifyTransfer: boolean;
1058
+ /**
1059
+ * Whether the transfer client resume a stopped transfer.
1060
+ *
1061
+ * This is supported when using Connect or IBM Aspera for desktop.
1062
+ */
1063
+ resumeTransfer: boolean;
1035
1064
  }