iosignal 4.0.0 → 4.6.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/.vscode/settings.json +1 -1
- package/README.md +0 -2
- package/dist/io.d.ts +18 -11
- package/dist/io.js +5 -5
- package/dist/io.js.map +1 -1
- package/dist/io.min.js +5 -5
- package/dist/io.min.js.map +1 -1
- package/dist/iosignal.js +291 -251
- package/dist/types/client/IOCore.d.ts +15 -12
- package/dist/types/client/browser/IOWebSocket.d.ts +4 -0
- package/dist/types/common/constants.d.ts +29 -37
- package/index.js +4 -3
- package/package.json +1 -1
- package/src/auth/BohoAuth.js +48 -11
- package/src/auth/{Auth_File.js → key_providers/FileKeyProvider.js} +8 -20
- package/src/auth/{Auth_Redis.js → key_providers/RedisKeyProvider.js} +4 -7
- package/src/auth/key_providers/StringKeyProvider.js +54 -0
- package/src/client/IOCongSocket.js +4 -4
- package/src/client/IOCore.js +71 -70
- package/src/client/IOWS.js +6 -5
- package/src/client/browser/IOWebSocket.js +4 -4
- package/src/common/constants.js +32 -43
- package/src/common/util.js +3 -0
- package/src/server/Manager.js +4 -4
- package/src/server/Remote.js +4 -1
- package/src/server/RemoteCore.js +28 -19
- package/src/server/Server.js +7 -7
- package/README.en.md +0 -56
- package/auth_file_sample.js +0 -23
- package/auth_file_sample.json +0 -13
- package/src/auth/Auth_Env.js +0 -76
package/.vscode/settings.json
CHANGED
package/README.md
CHANGED
package/dist/io.d.ts
CHANGED
|
@@ -162,7 +162,7 @@ declare class IOCore extends EventEmitter<string | symbol, any> {
|
|
|
162
162
|
/**
|
|
163
163
|
* Disables auto-reconnect and closes the current connection.
|
|
164
164
|
* The instance can be re-opened manually later. For complete cleanup, use destroy().
|
|
165
|
-
|
|
165
|
+
*/
|
|
166
166
|
stop(): void;
|
|
167
167
|
/**
|
|
168
168
|
* Permanently destroys the instance, cleaning up all resources.
|
|
@@ -170,8 +170,9 @@ declare class IOCore extends EventEmitter<string | symbol, any> {
|
|
|
170
170
|
*/
|
|
171
171
|
destroy(): void;
|
|
172
172
|
/**
|
|
173
|
-
* The core keep-alive logic.
|
|
174
|
-
* The
|
|
173
|
+
* The core keep-alive logic.
|
|
174
|
+
* The specific logic for checking the socket's state and reconnecting
|
|
175
|
+
* is implemented keepConnection() in the child classes (IOWS, IOCongSocket, etc.).
|
|
175
176
|
*/
|
|
176
177
|
keepAlive(): void;
|
|
177
178
|
/**
|
|
@@ -194,18 +195,18 @@ declare class IOCore extends EventEmitter<string | symbol, any> {
|
|
|
194
195
|
onClose(): void;
|
|
195
196
|
/**
|
|
196
197
|
* Manually logs in with provided ID and key.
|
|
197
|
-
* @param {string} id - The user ID.
|
|
198
|
+
* @param {string} id - The user ID. or 'id.key'
|
|
198
199
|
* @param {string} key - The user key.
|
|
199
|
-
* @returns {
|
|
200
|
+
* @returns {this}
|
|
200
201
|
*/
|
|
201
|
-
login(id: string, key: string):
|
|
202
|
+
login(id: string, key: string): this;
|
|
202
203
|
/**
|
|
203
204
|
* Sets up authentication for auto-login.
|
|
204
|
-
* @param {string} id - The user ID.
|
|
205
|
+
* @param {string} id - The user ID. or 'id.Key'
|
|
205
206
|
* @param {string} key - The user key.
|
|
206
|
-
* @returns {
|
|
207
|
+
* @returns {this}
|
|
207
208
|
*/
|
|
208
|
-
auth(id: string, key: string):
|
|
209
|
+
auth(id: string, key: string): this;
|
|
209
210
|
/**
|
|
210
211
|
* Handles incoming data from the WebSocket.
|
|
211
212
|
* @param {Buffer} buffer - The incoming data buffer.
|
|
@@ -264,10 +265,12 @@ declare class IOCore extends EventEmitter<string | symbol, any> {
|
|
|
264
265
|
*/
|
|
265
266
|
testPromise(buffer: Buffer$1): void;
|
|
266
267
|
/**
|
|
267
|
-
*
|
|
268
|
+
* alias of signal()
|
|
269
|
+
* Sends a signal with a tag and arguments.
|
|
270
|
+
* @param {string} tag - The signal tag.
|
|
268
271
|
* @param {...any} args - Arguments for the signal.
|
|
269
272
|
*/
|
|
270
|
-
publish(...args: any[]): void;
|
|
273
|
+
publish(tag: string, ...args: any[]): void;
|
|
271
274
|
/**
|
|
272
275
|
* Sends a signal with a tag and arguments.
|
|
273
276
|
* @param {string} tag - The signal tag.
|
|
@@ -459,6 +462,10 @@ declare class IO extends IOCore {
|
|
|
459
462
|
* Pings the server when the browser tab becomes visible.
|
|
460
463
|
*/
|
|
461
464
|
browserVisiblePing(): void;
|
|
465
|
+
/**
|
|
466
|
+
* Keeps the connection alive by re-connecting if closed.
|
|
467
|
+
*/
|
|
468
|
+
keepConnection(): void;
|
|
462
469
|
/**
|
|
463
470
|
* Creates a new WebSocket connection.
|
|
464
471
|
* @param {string} url - The WebSocket URL to connect to.
|