@ibm-aspera/sdk 0.2.29 → 0.2.30

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.
Files changed (112) hide show
  1. package/dist/commonjs/app/core.d.ts +191 -0
  2. package/dist/commonjs/app/core.js +682 -0
  3. package/dist/commonjs/app/installer.d.ts +9 -0
  4. package/dist/commonjs/app/installer.js +50 -0
  5. package/dist/commonjs/connect/core.d.ts +11 -0
  6. package/dist/commonjs/connect/core.js +73 -0
  7. package/dist/commonjs/constants/constants.d.ts +8 -0
  8. package/dist/commonjs/constants/constants.js +11 -0
  9. package/dist/commonjs/constants/messages.d.ts +35 -0
  10. package/dist/commonjs/constants/messages.js +38 -0
  11. package/dist/commonjs/helpers/client/client.d.ts +5 -0
  12. package/dist/commonjs/helpers/client/client.js +7 -0
  13. package/dist/commonjs/helpers/client/http-client.d.ts +42 -0
  14. package/dist/commonjs/helpers/client/http-client.js +84 -0
  15. package/dist/commonjs/helpers/client/safari-client.d.ts +101 -0
  16. package/dist/commonjs/helpers/client/safari-client.js +264 -0
  17. package/dist/commonjs/helpers/helpers.d.ts +109 -0
  18. package/dist/commonjs/helpers/helpers.js +249 -0
  19. package/dist/commonjs/helpers/http.d.ts +16 -0
  20. package/dist/commonjs/helpers/http.js +42 -0
  21. package/dist/commonjs/helpers/ws.d.ts +62 -0
  22. package/dist/commonjs/helpers/ws.js +161 -0
  23. package/dist/commonjs/http-gateway/core.d.ts +76 -0
  24. package/dist/commonjs/http-gateway/core.js +254 -0
  25. package/dist/commonjs/http-gateway/download.d.ts +14 -0
  26. package/dist/commonjs/http-gateway/download.js +187 -0
  27. package/dist/commonjs/http-gateway/index.d.ts +11 -0
  28. package/dist/commonjs/http-gateway/index.js +11 -0
  29. package/dist/commonjs/http-gateway/models.d.ts +16 -0
  30. package/dist/commonjs/http-gateway/models.js +2 -0
  31. package/dist/commonjs/http-gateway/upload.d.ts +14 -0
  32. package/dist/commonjs/http-gateway/upload.js +124 -0
  33. package/dist/commonjs/index.d.ts +8 -0
  34. package/dist/commonjs/index.js +100 -0
  35. package/dist/commonjs/models/aspera-sdk.model.d.ts +245 -0
  36. package/dist/commonjs/models/aspera-sdk.model.js +345 -0
  37. package/dist/commonjs/models/models.d.ts +712 -0
  38. package/dist/commonjs/models/models.js +2 -0
  39. package/dist/js/aspera-sdk.js +3 -0
  40. package/dist/js/aspera-sdk.js.LICENSE.txt +15 -0
  41. package/dist/js/aspera-sdk.js.map +1 -0
  42. package/package.json +5 -1
  43. package/.editorconfig +0 -13
  44. package/.github/CODEOWNERS +0 -1
  45. package/.github/CODE_OF_CONDUCT.md +0 -128
  46. package/.github/CONTRIBUTING.md +0 -147
  47. package/.github/dependabot.yml +0 -10
  48. package/.github/workflows/ci.yml +0 -39
  49. package/.github/workflows/documentation.yml +0 -44
  50. package/.github/workflows/publish.yml +0 -23
  51. package/.github/workflows/version.yml +0 -32
  52. package/.whitesource +0 -3
  53. package/CHANGELOG.md +0 -204
  54. package/docs/DEVELOPMENT.md +0 -38
  55. package/eslint.config.js +0 -104
  56. package/example/README.md +0 -7
  57. package/example/index.html +0 -14
  58. package/example/package-lock.json +0 -2989
  59. package/example/package.json +0 -30
  60. package/example/public/404.html +0 -5
  61. package/example/public/sdk-code.js +0 -326
  62. package/example/src/App/App.scss +0 -40
  63. package/example/src/App/index.tsx +0 -196
  64. package/example/src/Views/AllTogether.tsx +0 -26
  65. package/example/src/Views/DragDrop.tsx +0 -23
  66. package/example/src/Views/Home.tsx +0 -10
  67. package/example/src/Views/Initialize.tsx +0 -31
  68. package/example/src/Views/Installer.tsx +0 -154
  69. package/example/src/Views/MonitorTransfers.tsx +0 -88
  70. package/example/src/Views/Other.tsx +0 -24
  71. package/example/src/Views/SelectItems.tsx +0 -46
  72. package/example/src/Views/StartTransfer.tsx +0 -37
  73. package/example/src/Views/Test.tsx +0 -20
  74. package/example/src/Views/Views.scss +0 -111
  75. package/example/src/helpers/index.ts +0 -19
  76. package/example/src/index.scss +0 -47
  77. package/example/src/main.tsx +0 -17
  78. package/example/src/vite-env.d.ts +0 -2
  79. package/example/tsconfig.json +0 -30
  80. package/example/vite.config.ts +0 -23
  81. package/jest.config.js +0 -19
  82. package/jest.setup.js +0 -0
  83. package/renovate.json +0 -12
  84. package/src/app/core.ts +0 -765
  85. package/src/app/installer.ts +0 -53
  86. package/src/connect/core.ts +0 -83
  87. package/src/constants/constants.ts +0 -19
  88. package/src/constants/messages.ts +0 -35
  89. package/src/helpers/client/client.ts +0 -11
  90. package/src/helpers/client/http-client.ts +0 -92
  91. package/src/helpers/client/safari-client.ts +0 -334
  92. package/src/helpers/helpers.ts +0 -253
  93. package/src/helpers/http.ts +0 -39
  94. package/src/helpers/ws.ts +0 -191
  95. package/src/http-gateway/core.ts +0 -273
  96. package/src/http-gateway/download.ts +0 -217
  97. package/src/http-gateway/index.ts +0 -19
  98. package/src/http-gateway/models.ts +0 -20
  99. package/src/http-gateway/upload.ts +0 -148
  100. package/src/index.ts +0 -72
  101. package/src/models/aspera-sdk.model.ts +0 -446
  102. package/src/models/models.ts +0 -740
  103. package/tests/client.spec.ts +0 -52
  104. package/tests/core.spec.ts +0 -13
  105. package/tests/helpers.spec.ts +0 -127
  106. package/tests/http.spec.ts +0 -14
  107. package/tests/installer.spec.ts +0 -135
  108. package/tests/mocks.ts +0 -11
  109. package/tsconfig.json +0 -14
  110. package/tsconfig.module.json +0 -16
  111. package/typedoc.js +0 -7
  112. package/webpack.config.js +0 -35
@@ -0,0 +1,191 @@
1
+ import { AsperaSdkInfo, TransferResponse } from '../models/aspera-sdk.model';
2
+ import { CustomBrandingOptions, DataTransferResponse, AsperaSdkSpec, AsperaSdkTransfer, FileDialogOptions, FolderDialogOptions, InitOptions, ModifyTransferOptions, ResumeTransferOptions, TransferSpec, WebsocketEvent } from '../models/models';
3
+ import * as ConnectTypes from '@ibm-aspera/connect-sdk-js/dist/esm/core/types';
4
+ /**
5
+ * Check if IBM Aspera for Desktop connection works. This function is called by init
6
+ * when initializing the SDK. This function can be used at any point for checking.
7
+ *
8
+ * @returns a promise that resolves if server can connect or rejects if not
9
+ */
10
+ export declare const testConnection: () => Promise<any>;
11
+ /**
12
+ * Initialize drag and drop. HTTP Gateway and Connect does not need to init.
13
+ * Ignore if only HTTP Gateway
14
+ * @param initCall - Indicate if called via init flow and should not reject
15
+ *
16
+ * @returns a promise that resolves if the initialization was successful or not
17
+ */
18
+ export declare const initDragDrop: (initCall?: boolean) => Promise<boolean>;
19
+ /**
20
+ * Initialize IBM Aspera client. If client cannot (reject/catch), then
21
+ * client should attempt fixing server URL or trying again. If still fails disable UI elements.
22
+ *
23
+ * @param options initialization options:
24
+ *
25
+ * - `appId` the unique ID for the website. Transfers initiated during this session
26
+ * will be associated with this ID. It is recommended to use a unique ID to keep transfer
27
+ * information private from other websites.
28
+ *
29
+ * - `supportMultipleUsers` when enabled (defaults to false), the SDK will iterate over a port
30
+ * range and generate a session id to determine the running instance of the desktop app for the
31
+ * current user. This is needed when multiple users may be logged into the same machine
32
+ * simultaneously, for example on a Windows Server.
33
+ *
34
+ * @returns a promise that resolves if IBM Aspera Desktop is running properly or
35
+ * rejects if unable to connect
36
+ */
37
+ export declare const init: (options?: InitOptions) => Promise<any>;
38
+ /**
39
+ * Start a transfer
40
+ *
41
+ * @param transferSpec standard transferSpec for transfer
42
+ * @param asperaSdkSpec IBM Aspera settings when starting a transfer.
43
+ *
44
+ * @returns a promise that resolves if transfer initiation is successful and rejects if transfer cannot be started
45
+ */
46
+ export declare const startTransfer: (transferSpec: TransferSpec, asperaSdkSpec: AsperaSdkSpec) => Promise<AsperaSdkTransfer>;
47
+ /**
48
+ * Register a callback event for getting transfer updates
49
+ *
50
+ * @param callback callback function to receive transfers
51
+ *
52
+ * @returns ID representing the callback for deregistration purposes
53
+ */
54
+ export declare const registerActivityCallback: (callback: (transfers: TransferResponse) => void) => string;
55
+ /**
56
+ * Remove a callback from the transfer callback
57
+ *
58
+ * @param id the ID returned by `registerActivityCallback`
59
+ */
60
+ export declare const deregisterActivityCallback: (id: string) => void;
61
+ /**
62
+ * Register a callback for getting updates about the connection status of IBM Aspera SDK.
63
+ *
64
+ * For example, to be notified of when the SDK loses connection with the application or connection
65
+ * is re-established. This can be useful if you want to handle the case where the user quits IBM Aspera
66
+ * after `init` has already been called, and want to prompt the user to relaunch the application.
67
+ *
68
+ * @param callback callback function to receive events
69
+ *
70
+ * @returns ID representing the callback for deregistration purposes
71
+ */
72
+ export declare const registerStatusCallback: (callback: (status: WebsocketEvent) => void) => string;
73
+ /**
74
+ * Remove a callback from getting connection status events.
75
+ *
76
+ * @param id the ID returned by `registerStatusCallback`
77
+ */
78
+ export declare const deregisterStatusCallback: (id: string) => void;
79
+ /**
80
+ * Remove a transfer. This will stop the transfer if it is in progress.
81
+ *
82
+ * @param id transfer uuid
83
+ *
84
+ * @returns a promise that resolves if transfer is removed and rejects if transfer cannot be removed
85
+ */
86
+ export declare const removeTransfer: (id: string) => Promise<any>;
87
+ /**
88
+ * Stop a transfer.
89
+ *
90
+ * @param id transfer uuid
91
+ *
92
+ * @returns a promise that resolves if transfer is stopped and rejects if transfer cannot be stopped
93
+ */
94
+ export declare const stopTransfer: (id: string) => Promise<any>;
95
+ /**
96
+ * Resume a paused or failed transfer.
97
+ *
98
+ * @param id transfer uuid
99
+ * @param options resume transfer options
100
+ *
101
+ * @returns a promise that resolves with the new transfer object if transfer is resumed
102
+ */
103
+ export declare const resumeTransfer: (id: string, options?: ResumeTransferOptions) => Promise<AsperaSdkTransfer>;
104
+ /**
105
+ * Displays a file browser dialog for the user to select files.
106
+ *
107
+ * @param options file dialog options
108
+ *
109
+ * @returns a promise that resolves with the selected file(s) and rejects if user cancels dialog
110
+ */
111
+ export declare const showSelectFileDialog: (options?: FileDialogOptions) => Promise<DataTransferResponse>;
112
+ /**
113
+ * Displays a folder browser dialog for the user to select folders.
114
+ *
115
+ * @param options folder dialog options
116
+ *
117
+ * @returns a promise that resolves with the selected folder(s) and rejects if user cancels dialog
118
+ */
119
+ export declare const showSelectFolderDialog: (options?: FolderDialogOptions) => Promise<DataTransferResponse>;
120
+ /**
121
+ * Opens the IBM Aspera preferences page.
122
+ *
123
+ * @returns a promise that resolves when the preferences page is opened.
124
+ */
125
+ export declare const showPreferences: () => Promise<any>;
126
+ /**
127
+ * Get all transfers associated with the current application.
128
+ *
129
+ * @returns a promise that resolves with an array of transfers.
130
+ */
131
+ export declare const getAllTransfers: () => Promise<AsperaSdkTransfer[]>;
132
+ /**
133
+ * Get a specific transfer by ID.
134
+ *
135
+ * @param id transfer uuid
136
+ *
137
+ * @returns a promise that resolves with the transfer.
138
+ */
139
+ export declare const getTransfer: (id: string) => Promise<AsperaSdkTransfer>;
140
+ /**
141
+ * Opens and highlights the downloaded file in Finder or Windows Explorer. If multiple files,
142
+ * then only the first file will be selected.
143
+ *
144
+ * @param id transfer uuid
145
+ *
146
+ * @returns a promise that resolves if the file can be shown and rejects if not
147
+ */
148
+ export declare const showDirectory: (id: string) => Promise<any>;
149
+ /**
150
+ * Modify the speed of a running transfer.
151
+ *
152
+ * @param id transfer uuid
153
+ * @param options transfer rate options
154
+ *
155
+ * @returns a promise that resolves if the transfer rate can be modified and rejects if not
156
+ */
157
+ export declare const modifyTransfer: (id: string, options: ModifyTransferOptions) => Promise<AsperaSdkTransfer>;
158
+ /**
159
+ * Set the custom branding template to be used by IBM Aspera. If the app is already
160
+ * configured to use a different branding, then the branding template you specify will be
161
+ * stored by the app, allowing the end user to switch at any point.
162
+ *
163
+ * @param id custom branding template id. This should be consistent across page loads.
164
+ * @param options custom branding options
165
+ *
166
+ * @returns a promise that resolves if the branding was properly set.
167
+ */
168
+ export declare const setBranding: (id: string, options: CustomBrandingOptions) => Promise<any>;
169
+ /**
170
+ * Create a dropzone for the given element selector.
171
+ *
172
+ * @param callback the function to call once the files are dropped
173
+ * @param elementSelector the selector of the element on the page that should watch for drop events
174
+ * @param connectOptions options for connect
175
+ */
176
+ export declare const createDropzone: (callback: (data: {
177
+ event: DragEvent;
178
+ files: DataTransferResponse;
179
+ }) => void, elementSelector: string, connectOptions?: ConnectTypes.DragDropOptions) => void;
180
+ /**
181
+ * Remove dropzone.
182
+ *
183
+ * @param elementSelector the selector of the element on the page that should remove
184
+ */
185
+ export declare const removeDropzone: (elementSelector: string) => void;
186
+ /**
187
+ * Get metadata about the IBM Aspera installation.
188
+ *
189
+ * @returns a promise that returns information about the user's IBM Aspera installation.
190
+ */
191
+ export declare const getInfo: () => Promise<AsperaSdkInfo>;