@trap_stevo/filetide-client 0.0.73 → 0.0.74

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.
@@ -27,6 +27,7 @@ class FileTideClient {
27
27
  this.currentDeviceName = inputDeviceName || deviceName;
28
28
  this.originDeviceName = inputDeviceName || deviceName;
29
29
  this.deviceName = inputDeviceName || deviceName;
30
+ this.requestedDeviceName = this.deviceName;
30
31
  this.tideUrl = inputTideURL || tideUrl;
31
32
  this.currentRoom = inputCurrentRoom || currentRoom;
32
33
  this.fileMessagerInstance = null;
@@ -131,6 +132,7 @@ class FileTideClient {
131
132
  const {
132
133
  onLaunch = null,
133
134
  onReady = null,
135
+ onClientIDAssigned = null,
134
136
  onIncomingFile = null,
135
137
  onIncomingTransfer = null,
136
138
  onTransferBarrier = null,
@@ -148,7 +150,16 @@ class FileTideClient {
148
150
  const fileTideOptions = {
149
151
  ...options,
150
152
  ...lifecycleOptions,
151
- displayTransferOutput
153
+ displayTransferOutput,
154
+ onClientIDAssigned: async assignment => {
155
+ this.deviceName = assignment.clientID;
156
+ this.currentDeviceName = assignment.clientID;
157
+ this.originDeviceName = assignment.clientID;
158
+ this.connectionID = assignment.connectionID;
159
+ if (typeof onClientIDAssigned === "function") {
160
+ await onClientIDAssigned(assignment);
161
+ }
162
+ }
152
163
  };
153
164
  const launchClient = () => {
154
165
  if (this.fileMessagerInstance && this.fileMessagerInstance.clientTide && this.fileMessagerInstance.clientTide.tideExists(this.deviceName)) {
@@ -188,7 +199,7 @@ class FileTideClient {
188
199
  * originClientID
189
200
  * currentTideChannel
190
201
  */
191
- this.fileMessagerInstance.clientTide.emitEvent(this.deviceName, "client-online", this.deviceName, socket.tideID, this.currentDeviceName, socket.id, this.fileTide.transferBarrier, this.originDeviceName, this.currentRoom);
202
+ this.fileMessagerInstance.clientTide.emitEvent(this.deviceName, "client-online", this.deviceName, socket.tideID, this.currentDeviceName, socket.id, this.fileTide.transferBarrier, this.originDeviceName, this.currentRoom, this.fileMessagerInstance.requestedClientID || this.deviceName);
192
203
  if (typeof onConnect === "function") {
193
204
  await onConnect(this.fileMessagerInstance, ...connectionArguments);
194
205
  }
@@ -201,7 +212,7 @@ class FileTideClient {
201
212
  pingTimeout: 3600000,
202
213
  pingInterval: 60000,
203
214
  ...connectionOptions
204
- }, transportOptions, messagerSettings, this.currentRoom, this.deviceName, (fileMessager, roomEntry, resolvedClientID) => {
215
+ }, transportOptions, messagerSettings, this.currentRoom, this.requestedDeviceName, (fileMessager, roomEntry, resolvedClientID) => {
205
216
  this.deviceName = resolvedClientID;
206
217
  this.currentDeviceName = resolvedClientID;
207
218
  this.originDeviceName = resolvedClientID;
@@ -395,6 +406,7 @@ class FileTideClient {
395
406
  const previousClientID = this.deviceName;
396
407
  const result = await this.fileTide.updateClientID(previousClientID, clientID, renameOptions);
397
408
  this.deviceName = clientID;
409
+ this.requestedDeviceName = clientID;
398
410
  this.currentDeviceName = clientID;
399
411
  this.originDeviceName = clientID;
400
412
  this.connectionID = result.connectionID;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trap_stevo/filetide-client",
3
- "version": "0.0.73",
3
+ "version": "0.0.74",
4
4
  "description": "Seamless, real-time file transfers between devices with effortless connectivity. Allowing for powerful, instant, secure, and cross-platform file sharing, enabling efficient and reliable data transfers in any network environment.",
5
5
  "main": "dist/cjs/FileTideClient.js",
6
6
  "exports": {
@@ -38,7 +38,7 @@
38
38
  "license": "SCL-1.1-Universal",
39
39
  "copyright": "© 2026 Hassan Steven Compton. All rights reserved.",
40
40
  "dependencies": {
41
- "@trap_stevo/filetide": "^0.1.5",
41
+ "@trap_stevo/filetide": "^0.1.6",
42
42
  "@trap_stevo/iotide": "^0.0.48",
43
43
  "@trap_stevo/legendarybuilderpronodejs-utilities": "^1.0.51",
44
44
  "chalk": "^4.1.2"