@ztimson/momentum 1.4.2 → 1.4.3
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/dist/actions.d.ts +1 -1
- package/dist/actions.d.ts.map +1 -1
- package/dist/asset-controller.d.ts.map +1 -1
- package/dist/index.js +39 -47
- package/dist/index.mjs +39 -47
- package/dist/sockets.d.ts +4 -4
- package/dist/sockets.d.ts.map +1 -1
- package/dist/webRtc.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/actions.d.ts
CHANGED
|
@@ -103,7 +103,7 @@ export declare class Actions extends AssetController<Action> {
|
|
|
103
103
|
/**
|
|
104
104
|
* Manually trigger an actions execution with real-time updates
|
|
105
105
|
* @param {string} id Action ID
|
|
106
|
-
* @param {(payload:
|
|
106
|
+
* @param {(payload: ActionResult) => any} callback Get updates in real time
|
|
107
107
|
* @param {HttpRequestOptions} opts Additional arguments
|
|
108
108
|
* @return {Promise<string>} Run UID for socket subscription
|
|
109
109
|
*/
|
package/dist/actions.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../src/actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kBAAkB,EAAY,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAC,eAAe,EAAC,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAC,IAAI,EAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAEpC,MAAM,MAAM,QAAQ,GAAG;IAAC,CAAC,GAAG,EAAE,MAAM,GAAG;QACtC,oBAAoB;QACpB,IAAI,EAAE,OAAO,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;QAC3D,2BAA2B;QAC3B,WAAW,EAAE,MAAM,CAAC;QACpB,wBAAwB;QACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;QACnB,oBAAoB;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,CAAC,EAAE,MAAM,CAAC;CAC7B,CAAA;AAED,sDAAsD;AACtD,oBAAY,UAAU;IACrB,0BAA0B;IACzB,QAAQ,IAAI;IACb,wBAAwB;IACvB,MAAM,IAAI;IACX,yBAAyB;IACxB,OAAO,IAAI;IACZ,uBAAuB;IACtB,KAAK,IAAI;IACV,uBAAuB;IACtB,KAAK,IAAI;IACV,qBAAqB;IACpB,OAAO,IAAI;IACZ,eAAe;IACd,MAAM,IAAI;IACX,mBAAmB;IAClB,IAAI,IAAI;CACT;AAED,wCAAwC;AACxC,qBAAa,OAAQ,SAAQ,eAAe,CAAC,MAAM,CAAC;IACvC,SAAS,CAAC,QAAQ,EAAE,QAAQ;gBAAlB,QAAQ,EAAE,QAAQ;IAIxC;;;;;;OAMG;IACG,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,YAAY,CAAC,KAAK,GAAG,EAAE,IAAI,GAAE,kBAAuB,GAAG,OAAO,CAAC,MAAM,CAAC;IAU3H;;;;OAIG;IACH,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAKvC;;;;;OAKG;IACH,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,kBAAuB,GAAG,OAAO,CAAC,CAAC,CAAC;CAG/D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"asset-controller.d.ts","sourceRoot":"","sources":["../src/asset-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"asset-controller.d.ts","sourceRoot":"","sources":["../src/asset-controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAE,YAAY,EAAa,SAAS,EAAE,gBAAgB,EAAC,MAAM,gBAAgB,CAAC;AAC3F,OAAO,EAAC,IAAI,EAAwB,KAAK,QAAQ,EAAE,WAAW,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AO,CAAC,CAAC,CAAC;IASrD;;;;OAIG;IACG,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IAY3C;;;;;OAKG;IACH,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,KAAK,GAAG,CAAC,GAAG,IAAI,EAAE,IAAI,GAAE;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,OAAO,CAAA;KAAM,GAAG,WAAW;CAe1H;AAED,qBAAa,mBAAmB,CAAC,CAAC,SAAS,IAAI,GAAG;IAAC,IAAI,EAAE,MAAM,CAAA;CAAC,CAAE,SAAQ,eAAe,CAAC,CAAC,CAAC;IAC3F;;;;OAIG;IACG,GAAG,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;IAKnD;;;;;OAKG;IACH,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,KAAK,GAAG,EAAE,IAAI,GAAE;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,OAAO,CAAC;QAAC,MAAM,CAAC,EAAE,OAAO,CAAA;KAAM,GAAG,WAAW;CAKhI"}
|
package/dist/index.js
CHANGED
|
@@ -1721,11 +1721,11 @@
|
|
|
1721
1721
|
this.opts.storage = { storage: momentum.database, key: "_" + this.opts.module };
|
|
1722
1722
|
this.cache = new Cache("_id", { persistentStorage: this.opts.storage });
|
|
1723
1723
|
this.momentum.auth.on("login:d", (e) => this.cache.clear());
|
|
1724
|
-
this.on(this.opts.module, (event, payload) => {
|
|
1725
|
-
if (Array.isArray(payload)) {
|
|
1724
|
+
this.on(this.opts.module + ":crud", (event, payload) => {
|
|
1725
|
+
if (!event.path && Array.isArray(payload)) {
|
|
1726
1726
|
this.cache.addAll(payload);
|
|
1727
1727
|
} else if ((event.create || event.update || event.read) && payload != null) {
|
|
1728
|
-
this.cache.add(
|
|
1728
|
+
makeArray(payload).forEach((p) => this.cache.add(p));
|
|
1729
1729
|
} else if (event.delete || payload == null) {
|
|
1730
1730
|
if (!event.path) return this.cache.clear();
|
|
1731
1731
|
const id = this.opts.key == "_id" ? event.name : this.cache.find({ [this.opts.key]: event.path })?._id;
|
|
@@ -1885,18 +1885,17 @@
|
|
|
1885
1885
|
/**
|
|
1886
1886
|
* Manually trigger an actions execution with real-time updates
|
|
1887
1887
|
* @param {string} id Action ID
|
|
1888
|
-
* @param {(payload:
|
|
1888
|
+
* @param {(payload: ActionResult) => any} callback Get updates in real time
|
|
1889
1889
|
* @param {HttpRequestOptions} opts Additional arguments
|
|
1890
1890
|
* @return {Promise<string>} Run UID for socket subscription
|
|
1891
1891
|
*/
|
|
1892
1892
|
async debug(id, callback, opts = {}) {
|
|
1893
1893
|
const uid = await this.momentum.api.request({ url: `api/actions/debug/${id}`, method: "POST", ...opts }).then((resp) => resp.uid);
|
|
1894
1894
|
if (!this.momentum.socket || !callback) return uid;
|
|
1895
|
-
const unsubscribe = this.momentum.socket.
|
|
1895
|
+
const unsubscribe = this.momentum.socket.subscribe(`actions/${id}/${uid}:x`, (event, payload) => {
|
|
1896
1896
|
if (payload.return) unsubscribe();
|
|
1897
1897
|
callback(payload);
|
|
1898
1898
|
});
|
|
1899
|
-
await this.momentum.socket.subscribe(`actions/${uid}`);
|
|
1900
1899
|
return uid;
|
|
1901
1900
|
}
|
|
1902
1901
|
/**
|
|
@@ -3920,6 +3919,11 @@ ${log}`;
|
|
|
3920
3919
|
this.momentum.auth.on("login:cd", (event, user) => {
|
|
3921
3920
|
if (user !== void 0 && this.momentum.api.token != this.token) this.connect();
|
|
3922
3921
|
});
|
|
3922
|
+
if (typeof window !== "undefined") {
|
|
3923
|
+
window.addEventListener("online", () => {
|
|
3924
|
+
if (this.reconnect && !this.connected) this.connect();
|
|
3925
|
+
});
|
|
3926
|
+
}
|
|
3923
3927
|
}
|
|
3924
3928
|
momentum;
|
|
3925
3929
|
static pollingSpeed = 15e3;
|
|
@@ -3928,7 +3932,6 @@ ${log}`;
|
|
|
3928
3932
|
connectingResolver;
|
|
3929
3933
|
events = {};
|
|
3930
3934
|
reconnect = true;
|
|
3931
|
-
pending = [];
|
|
3932
3935
|
token;
|
|
3933
3936
|
reconnectTimeout;
|
|
3934
3937
|
connected = false;
|
|
@@ -3943,19 +3946,17 @@ ${log}`;
|
|
|
3943
3946
|
console.debug("Disconnected from Momentum");
|
|
3944
3947
|
this.connected = false;
|
|
3945
3948
|
this.connection?.close();
|
|
3946
|
-
this.connection = void 0;
|
|
3949
|
+
this.connection = this.connecting = this.connectingResolver = void 0;
|
|
3947
3950
|
this.reconnect = !!reconnect;
|
|
3951
|
+
clearTimeout(this.reconnectTimeout);
|
|
3948
3952
|
if (this.reconnect) {
|
|
3949
3953
|
this.scheduleReconnect();
|
|
3950
3954
|
} else {
|
|
3951
3955
|
this.events = {};
|
|
3952
|
-
clearTimeout(this.reconnectTimeout);
|
|
3953
3956
|
}
|
|
3954
3957
|
}
|
|
3955
3958
|
connect() {
|
|
3956
|
-
if (!this.connecting)
|
|
3957
|
-
this.connecting = new Promise((res) => this.connectingResolver = res);
|
|
3958
|
-
}
|
|
3959
|
+
if (!this.connecting) this.connecting = new Promise((res) => this.connectingResolver = res);
|
|
3959
3960
|
if (typeof navigator != "undefined" && !navigator.onLine || this.connected && this.token == this.momentum.api.token) return this.connecting;
|
|
3960
3961
|
if (this.connected) this.close();
|
|
3961
3962
|
clearTimeout(this.reconnectTimeout);
|
|
@@ -3963,18 +3964,8 @@ ${log}`;
|
|
|
3963
3964
|
const url = this.momentum.url.toString().replace("http", "ws");
|
|
3964
3965
|
this.connection = new WebSocket(url + (this.momentum.api.token ? `?token=${this.momentum.api.token}&url=${location?.href || ""}` : ""));
|
|
3965
3966
|
this.connection.onopen = () => {
|
|
3966
|
-
console.debug("Connected to Momentum");
|
|
3967
|
-
this.connected = true;
|
|
3968
3967
|
this.token = this.momentum.api.token;
|
|
3969
3968
|
clearTimeout(this.reconnectTimeout);
|
|
3970
|
-
Object.keys(this.events).forEach((e) => this.send("subscribe", e));
|
|
3971
|
-
this.pending = this.pending.filter((p) => {
|
|
3972
|
-
this.send(p.event, p.payload);
|
|
3973
|
-
return false;
|
|
3974
|
-
});
|
|
3975
|
-
this.connectingResolver?.();
|
|
3976
|
-
this.connecting = void 0;
|
|
3977
|
-
this.connectingResolver = void 0;
|
|
3978
3969
|
};
|
|
3979
3970
|
this.connection.onclose = () => {
|
|
3980
3971
|
if (!this.reconnect) return;
|
|
@@ -3982,7 +3973,12 @@ ${log}`;
|
|
|
3982
3973
|
};
|
|
3983
3974
|
this.connection.onmessage = (message) => {
|
|
3984
3975
|
const data = JSONAttemptParse(message.data);
|
|
3985
|
-
if (data.connected ===
|
|
3976
|
+
if (data.connected === true) {
|
|
3977
|
+
console.debug("Connected to Momentum");
|
|
3978
|
+
Object.keys(this.events).forEach((e) => this.send("subscribe", e));
|
|
3979
|
+
this.connectingResolver?.();
|
|
3980
|
+
this.connected = true;
|
|
3981
|
+
} else if (data.connected === false) this.close(true);
|
|
3986
3982
|
else this.emit(data.event, data.payload);
|
|
3987
3983
|
};
|
|
3988
3984
|
this.scheduleReconnect();
|
|
@@ -3997,25 +3993,24 @@ ${log}`;
|
|
|
3997
3993
|
this.send("ping");
|
|
3998
3994
|
});
|
|
3999
3995
|
}
|
|
4000
|
-
send(channel, payload = null) {
|
|
3996
|
+
async send(channel, payload = null) {
|
|
3997
|
+
if (!this.connecting) await sleepWhile(() => !this.connecting);
|
|
3998
|
+
if (this.connecting) await this.connecting;
|
|
4001
3999
|
if (!this.connection || this.connection.readyState !== WebSocket.OPEN) {
|
|
4002
|
-
|
|
4003
|
-
} else {
|
|
4004
|
-
this.connection.send(JSON.stringify({ event: channel, payload }));
|
|
4000
|
+
throw new Error("WebSocket is not connected");
|
|
4005
4001
|
}
|
|
4002
|
+
this.connection.send(JSON.stringify({ event: channel, payload }));
|
|
4006
4003
|
}
|
|
4007
|
-
subscribe(event) {
|
|
4004
|
+
subscribe(event, callback) {
|
|
4008
4005
|
const e = new PathEvent(event).toString();
|
|
4006
|
+
const unsubscribe = callback ? this.on(e, callback) : null;
|
|
4009
4007
|
if (!this.events[e]) this.events[e] = 1;
|
|
4010
4008
|
else this.events[e]++;
|
|
4011
|
-
if (this.events[e] == 1)
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
this.send("subscribe", e.toString());
|
|
4017
|
-
});
|
|
4018
|
-
} else return Promise.resolve(true);
|
|
4009
|
+
if (this.events[e] == 1 && this.connected) this.send("subscribe", e.toString());
|
|
4010
|
+
return () => {
|
|
4011
|
+
this.unsubscribe(e);
|
|
4012
|
+
unsubscribe?.();
|
|
4013
|
+
};
|
|
4019
4014
|
}
|
|
4020
4015
|
async subscriptions() {
|
|
4021
4016
|
if (!this.connected) await this.connect();
|
|
@@ -4026,16 +4021,12 @@ ${log}`;
|
|
|
4026
4021
|
}
|
|
4027
4022
|
unsubscribe(event) {
|
|
4028
4023
|
const e = new PathEvent(event).toString();
|
|
4024
|
+
if (!this.events[e]) return;
|
|
4029
4025
|
this.events[e]--;
|
|
4030
4026
|
if (this.events[e] <= 0) {
|
|
4031
4027
|
delete this.events[e];
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
if (payload.event == e) res(payload.success);
|
|
4035
|
-
});
|
|
4036
|
-
this.send("unsubscribe", e.toString());
|
|
4037
|
-
});
|
|
4038
|
-
} else return Promise.resolve(true);
|
|
4028
|
+
if (this.connected) this.send("unsubscribe", e.toString());
|
|
4029
|
+
}
|
|
4039
4030
|
}
|
|
4040
4031
|
}
|
|
4041
4032
|
class Storage extends PathEventEmitter {
|
|
@@ -4207,7 +4198,7 @@ ${log}`;
|
|
|
4207
4198
|
sync(path, callback, opts = {}) {
|
|
4208
4199
|
const e = PE`${this.module}/${path}`;
|
|
4209
4200
|
const unsubscribe = callback ? this.on(e.toString(), (event) => callback(event, this.cache.get(path))) : null;
|
|
4210
|
-
if (
|
|
4201
|
+
if (opts.reload) this.meta(path);
|
|
4211
4202
|
if (!this.subscribers.length) this.momentum.socket?.subscribe(e.toString());
|
|
4212
4203
|
const key = Object.keys(this.subscribers).length.toString();
|
|
4213
4204
|
this.subscribers[key] = () => {
|
|
@@ -4341,7 +4332,7 @@ ${log}`;
|
|
|
4341
4332
|
}
|
|
4342
4333
|
momentum;
|
|
4343
4334
|
}
|
|
4344
|
-
const version = "1.4.
|
|
4335
|
+
const version = "1.4.3";
|
|
4345
4336
|
class WebRtc extends PathEventEmitter {
|
|
4346
4337
|
constructor(momentum) {
|
|
4347
4338
|
super("webrtc");
|
|
@@ -4394,6 +4385,7 @@ ${log}`;
|
|
|
4394
4385
|
session.open = false;
|
|
4395
4386
|
Object.values(session.peers).forEach((p) => p.connection.close());
|
|
4396
4387
|
session.stream.getTracks().forEach((track) => track.stop());
|
|
4388
|
+
unsubscribe();
|
|
4397
4389
|
this.momentum.socket?.send(`webrtc/${id}/${session.uid}:d`, {
|
|
4398
4390
|
uid: session.uid,
|
|
4399
4391
|
username: this.momentum.auth.user?._id || "Anonymous",
|
|
@@ -4401,8 +4393,7 @@ ${log}`;
|
|
|
4401
4393
|
});
|
|
4402
4394
|
}
|
|
4403
4395
|
};
|
|
4404
|
-
this.momentum.socket?.subscribe(`webrtc/${id}
|
|
4405
|
-
this.momentum.socket?.on(`webrtc/${id}`, async (event, payload) => {
|
|
4396
|
+
const unsubscribe = this.momentum.socket?.subscribe(`webrtc/${id}`, async (event, payload) => {
|
|
4406
4397
|
if (event.name != session.uid) {
|
|
4407
4398
|
if (payload.connected) {
|
|
4408
4399
|
session.peers[event.name] = {
|
|
@@ -4448,6 +4439,7 @@ ${log}`;
|
|
|
4448
4439
|
this.emit(id, session);
|
|
4449
4440
|
}
|
|
4450
4441
|
}
|
|
4442
|
+
}) || (() => {
|
|
4451
4443
|
});
|
|
4452
4444
|
this.momentum.socket?.send(`webrtc/${id}/${session.uid}`, {
|
|
4453
4445
|
uid: session.uid,
|
package/dist/index.mjs
CHANGED
|
@@ -1717,11 +1717,11 @@ class AssetController extends PathEventEmitter {
|
|
|
1717
1717
|
this.opts.storage = { storage: momentum.database, key: "_" + this.opts.module };
|
|
1718
1718
|
this.cache = new Cache("_id", { persistentStorage: this.opts.storage });
|
|
1719
1719
|
this.momentum.auth.on("login:d", (e) => this.cache.clear());
|
|
1720
|
-
this.on(this.opts.module, (event, payload) => {
|
|
1721
|
-
if (Array.isArray(payload)) {
|
|
1720
|
+
this.on(this.opts.module + ":crud", (event, payload) => {
|
|
1721
|
+
if (!event.path && Array.isArray(payload)) {
|
|
1722
1722
|
this.cache.addAll(payload);
|
|
1723
1723
|
} else if ((event.create || event.update || event.read) && payload != null) {
|
|
1724
|
-
this.cache.add(
|
|
1724
|
+
makeArray(payload).forEach((p) => this.cache.add(p));
|
|
1725
1725
|
} else if (event.delete || payload == null) {
|
|
1726
1726
|
if (!event.path) return this.cache.clear();
|
|
1727
1727
|
const id = this.opts.key == "_id" ? event.name : this.cache.find({ [this.opts.key]: event.path })?._id;
|
|
@@ -1881,18 +1881,17 @@ class Actions extends AssetController {
|
|
|
1881
1881
|
/**
|
|
1882
1882
|
* Manually trigger an actions execution with real-time updates
|
|
1883
1883
|
* @param {string} id Action ID
|
|
1884
|
-
* @param {(payload:
|
|
1884
|
+
* @param {(payload: ActionResult) => any} callback Get updates in real time
|
|
1885
1885
|
* @param {HttpRequestOptions} opts Additional arguments
|
|
1886
1886
|
* @return {Promise<string>} Run UID for socket subscription
|
|
1887
1887
|
*/
|
|
1888
1888
|
async debug(id, callback, opts = {}) {
|
|
1889
1889
|
const uid = await this.momentum.api.request({ url: `api/actions/debug/${id}`, method: "POST", ...opts }).then((resp) => resp.uid);
|
|
1890
1890
|
if (!this.momentum.socket || !callback) return uid;
|
|
1891
|
-
const unsubscribe = this.momentum.socket.
|
|
1891
|
+
const unsubscribe = this.momentum.socket.subscribe(`actions/${id}/${uid}:x`, (event, payload) => {
|
|
1892
1892
|
if (payload.return) unsubscribe();
|
|
1893
1893
|
callback(payload);
|
|
1894
1894
|
});
|
|
1895
|
-
await this.momentum.socket.subscribe(`actions/${uid}`);
|
|
1896
1895
|
return uid;
|
|
1897
1896
|
}
|
|
1898
1897
|
/**
|
|
@@ -3916,6 +3915,11 @@ class Socket extends PathEventEmitter {
|
|
|
3916
3915
|
this.momentum.auth.on("login:cd", (event, user) => {
|
|
3917
3916
|
if (user !== void 0 && this.momentum.api.token != this.token) this.connect();
|
|
3918
3917
|
});
|
|
3918
|
+
if (typeof window !== "undefined") {
|
|
3919
|
+
window.addEventListener("online", () => {
|
|
3920
|
+
if (this.reconnect && !this.connected) this.connect();
|
|
3921
|
+
});
|
|
3922
|
+
}
|
|
3919
3923
|
}
|
|
3920
3924
|
momentum;
|
|
3921
3925
|
static pollingSpeed = 15e3;
|
|
@@ -3924,7 +3928,6 @@ class Socket extends PathEventEmitter {
|
|
|
3924
3928
|
connectingResolver;
|
|
3925
3929
|
events = {};
|
|
3926
3930
|
reconnect = true;
|
|
3927
|
-
pending = [];
|
|
3928
3931
|
token;
|
|
3929
3932
|
reconnectTimeout;
|
|
3930
3933
|
connected = false;
|
|
@@ -3939,19 +3942,17 @@ class Socket extends PathEventEmitter {
|
|
|
3939
3942
|
console.debug("Disconnected from Momentum");
|
|
3940
3943
|
this.connected = false;
|
|
3941
3944
|
this.connection?.close();
|
|
3942
|
-
this.connection = void 0;
|
|
3945
|
+
this.connection = this.connecting = this.connectingResolver = void 0;
|
|
3943
3946
|
this.reconnect = !!reconnect;
|
|
3947
|
+
clearTimeout(this.reconnectTimeout);
|
|
3944
3948
|
if (this.reconnect) {
|
|
3945
3949
|
this.scheduleReconnect();
|
|
3946
3950
|
} else {
|
|
3947
3951
|
this.events = {};
|
|
3948
|
-
clearTimeout(this.reconnectTimeout);
|
|
3949
3952
|
}
|
|
3950
3953
|
}
|
|
3951
3954
|
connect() {
|
|
3952
|
-
if (!this.connecting)
|
|
3953
|
-
this.connecting = new Promise((res) => this.connectingResolver = res);
|
|
3954
|
-
}
|
|
3955
|
+
if (!this.connecting) this.connecting = new Promise((res) => this.connectingResolver = res);
|
|
3955
3956
|
if (typeof navigator != "undefined" && !navigator.onLine || this.connected && this.token == this.momentum.api.token) return this.connecting;
|
|
3956
3957
|
if (this.connected) this.close();
|
|
3957
3958
|
clearTimeout(this.reconnectTimeout);
|
|
@@ -3959,18 +3960,8 @@ class Socket extends PathEventEmitter {
|
|
|
3959
3960
|
const url = this.momentum.url.toString().replace("http", "ws");
|
|
3960
3961
|
this.connection = new WebSocket(url + (this.momentum.api.token ? `?token=${this.momentum.api.token}&url=${location?.href || ""}` : ""));
|
|
3961
3962
|
this.connection.onopen = () => {
|
|
3962
|
-
console.debug("Connected to Momentum");
|
|
3963
|
-
this.connected = true;
|
|
3964
3963
|
this.token = this.momentum.api.token;
|
|
3965
3964
|
clearTimeout(this.reconnectTimeout);
|
|
3966
|
-
Object.keys(this.events).forEach((e) => this.send("subscribe", e));
|
|
3967
|
-
this.pending = this.pending.filter((p) => {
|
|
3968
|
-
this.send(p.event, p.payload);
|
|
3969
|
-
return false;
|
|
3970
|
-
});
|
|
3971
|
-
this.connectingResolver?.();
|
|
3972
|
-
this.connecting = void 0;
|
|
3973
|
-
this.connectingResolver = void 0;
|
|
3974
3965
|
};
|
|
3975
3966
|
this.connection.onclose = () => {
|
|
3976
3967
|
if (!this.reconnect) return;
|
|
@@ -3978,7 +3969,12 @@ class Socket extends PathEventEmitter {
|
|
|
3978
3969
|
};
|
|
3979
3970
|
this.connection.onmessage = (message) => {
|
|
3980
3971
|
const data = JSONAttemptParse(message.data);
|
|
3981
|
-
if (data.connected ===
|
|
3972
|
+
if (data.connected === true) {
|
|
3973
|
+
console.debug("Connected to Momentum");
|
|
3974
|
+
Object.keys(this.events).forEach((e) => this.send("subscribe", e));
|
|
3975
|
+
this.connectingResolver?.();
|
|
3976
|
+
this.connected = true;
|
|
3977
|
+
} else if (data.connected === false) this.close(true);
|
|
3982
3978
|
else this.emit(data.event, data.payload);
|
|
3983
3979
|
};
|
|
3984
3980
|
this.scheduleReconnect();
|
|
@@ -3993,25 +3989,24 @@ class Socket extends PathEventEmitter {
|
|
|
3993
3989
|
this.send("ping");
|
|
3994
3990
|
});
|
|
3995
3991
|
}
|
|
3996
|
-
send(channel, payload = null) {
|
|
3992
|
+
async send(channel, payload = null) {
|
|
3993
|
+
if (!this.connecting) await sleepWhile(() => !this.connecting);
|
|
3994
|
+
if (this.connecting) await this.connecting;
|
|
3997
3995
|
if (!this.connection || this.connection.readyState !== WebSocket.OPEN) {
|
|
3998
|
-
|
|
3999
|
-
} else {
|
|
4000
|
-
this.connection.send(JSON.stringify({ event: channel, payload }));
|
|
3996
|
+
throw new Error("WebSocket is not connected");
|
|
4001
3997
|
}
|
|
3998
|
+
this.connection.send(JSON.stringify({ event: channel, payload }));
|
|
4002
3999
|
}
|
|
4003
|
-
subscribe(event) {
|
|
4000
|
+
subscribe(event, callback) {
|
|
4004
4001
|
const e = new PathEvent(event).toString();
|
|
4002
|
+
const unsubscribe = callback ? this.on(e, callback) : null;
|
|
4005
4003
|
if (!this.events[e]) this.events[e] = 1;
|
|
4006
4004
|
else this.events[e]++;
|
|
4007
|
-
if (this.events[e] == 1)
|
|
4008
|
-
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
this.send("subscribe", e.toString());
|
|
4013
|
-
});
|
|
4014
|
-
} else return Promise.resolve(true);
|
|
4005
|
+
if (this.events[e] == 1 && this.connected) this.send("subscribe", e.toString());
|
|
4006
|
+
return () => {
|
|
4007
|
+
this.unsubscribe(e);
|
|
4008
|
+
unsubscribe?.();
|
|
4009
|
+
};
|
|
4015
4010
|
}
|
|
4016
4011
|
async subscriptions() {
|
|
4017
4012
|
if (!this.connected) await this.connect();
|
|
@@ -4022,16 +4017,12 @@ class Socket extends PathEventEmitter {
|
|
|
4022
4017
|
}
|
|
4023
4018
|
unsubscribe(event) {
|
|
4024
4019
|
const e = new PathEvent(event).toString();
|
|
4020
|
+
if (!this.events[e]) return;
|
|
4025
4021
|
this.events[e]--;
|
|
4026
4022
|
if (this.events[e] <= 0) {
|
|
4027
4023
|
delete this.events[e];
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
if (payload.event == e) res(payload.success);
|
|
4031
|
-
});
|
|
4032
|
-
this.send("unsubscribe", e.toString());
|
|
4033
|
-
});
|
|
4034
|
-
} else return Promise.resolve(true);
|
|
4024
|
+
if (this.connected) this.send("unsubscribe", e.toString());
|
|
4025
|
+
}
|
|
4035
4026
|
}
|
|
4036
4027
|
}
|
|
4037
4028
|
class Storage extends PathEventEmitter {
|
|
@@ -4203,7 +4194,7 @@ class Storage extends PathEventEmitter {
|
|
|
4203
4194
|
sync(path, callback, opts = {}) {
|
|
4204
4195
|
const e = PE`${this.module}/${path}`;
|
|
4205
4196
|
const unsubscribe = callback ? this.on(e.toString(), (event) => callback(event, this.cache.get(path))) : null;
|
|
4206
|
-
if (
|
|
4197
|
+
if (opts.reload) this.meta(path);
|
|
4207
4198
|
if (!this.subscribers.length) this.momentum.socket?.subscribe(e.toString());
|
|
4208
4199
|
const key = Object.keys(this.subscribers).length.toString();
|
|
4209
4200
|
this.subscribers[key] = () => {
|
|
@@ -4337,7 +4328,7 @@ class Static extends Storage {
|
|
|
4337
4328
|
}
|
|
4338
4329
|
momentum;
|
|
4339
4330
|
}
|
|
4340
|
-
const version = "1.4.
|
|
4331
|
+
const version = "1.4.3";
|
|
4341
4332
|
class WebRtc extends PathEventEmitter {
|
|
4342
4333
|
constructor(momentum) {
|
|
4343
4334
|
super("webrtc");
|
|
@@ -4390,6 +4381,7 @@ class WebRtc extends PathEventEmitter {
|
|
|
4390
4381
|
session.open = false;
|
|
4391
4382
|
Object.values(session.peers).forEach((p) => p.connection.close());
|
|
4392
4383
|
session.stream.getTracks().forEach((track) => track.stop());
|
|
4384
|
+
unsubscribe();
|
|
4393
4385
|
this.momentum.socket?.send(`webrtc/${id}/${session.uid}:d`, {
|
|
4394
4386
|
uid: session.uid,
|
|
4395
4387
|
username: this.momentum.auth.user?._id || "Anonymous",
|
|
@@ -4397,8 +4389,7 @@ class WebRtc extends PathEventEmitter {
|
|
|
4397
4389
|
});
|
|
4398
4390
|
}
|
|
4399
4391
|
};
|
|
4400
|
-
this.momentum.socket?.subscribe(`webrtc/${id}
|
|
4401
|
-
this.momentum.socket?.on(`webrtc/${id}`, async (event, payload) => {
|
|
4392
|
+
const unsubscribe = this.momentum.socket?.subscribe(`webrtc/${id}`, async (event, payload) => {
|
|
4402
4393
|
if (event.name != session.uid) {
|
|
4403
4394
|
if (payload.connected) {
|
|
4404
4395
|
session.peers[event.name] = {
|
|
@@ -4444,6 +4435,7 @@ class WebRtc extends PathEventEmitter {
|
|
|
4444
4435
|
this.emit(id, session);
|
|
4445
4436
|
}
|
|
4446
4437
|
}
|
|
4438
|
+
}) || (() => {
|
|
4447
4439
|
});
|
|
4448
4440
|
this.momentum.socket?.send(`webrtc/${id}/${session.uid}`, {
|
|
4449
4441
|
uid: session.uid,
|
package/dist/sockets.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Unsubscribe } from '@ztimson/utils';
|
|
1
2
|
import { PathEvent, PathEventEmitter } from './core';
|
|
2
3
|
import { Momentum } from './momentum';
|
|
3
4
|
export declare class Socket extends PathEventEmitter {
|
|
@@ -8,7 +9,6 @@ export declare class Socket extends PathEventEmitter {
|
|
|
8
9
|
private connectingResolver?;
|
|
9
10
|
private events;
|
|
10
11
|
private reconnect;
|
|
11
|
-
private pending;
|
|
12
12
|
private token?;
|
|
13
13
|
private reconnectTimeout;
|
|
14
14
|
connected: boolean;
|
|
@@ -17,9 +17,9 @@ export declare class Socket extends PathEventEmitter {
|
|
|
17
17
|
close(reconnect?: boolean): void;
|
|
18
18
|
connect(): Promise<void>;
|
|
19
19
|
ping(): Promise<number>;
|
|
20
|
-
send(channel: string, payload?: any): void
|
|
21
|
-
subscribe(event: string | PathEvent):
|
|
20
|
+
send(channel: string, payload?: any): Promise<void>;
|
|
21
|
+
subscribe(event: string | PathEvent, callback?: (event: PathEvent, payload: any) => any): Unsubscribe;
|
|
22
22
|
subscriptions(): Promise<string[]>;
|
|
23
|
-
unsubscribe(event: string | PathEvent):
|
|
23
|
+
unsubscribe(event: string | PathEvent): void;
|
|
24
24
|
}
|
|
25
25
|
//# sourceMappingURL=sockets.d.ts.map
|
package/dist/sockets.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sockets.d.ts","sourceRoot":"","sources":["../src/sockets.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sockets.d.ts","sourceRoot":"","sources":["../src/sockets.ts"],"names":[],"mappings":"AAAA,OAAO,EAA+B,WAAW,EAAC,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAC,SAAS,EAAE,gBAAgB,EAAC,MAAM,QAAQ,CAAC;AACnD,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAEpC,qBAAa,MAAO,SAAQ,gBAAgB;IAW/B,SAAS,CAAC,QAAQ,EAAE,QAAQ;IAVxC,MAAM,CAAC,QAAQ,CAAC,YAAY,SAAS;IACrC,OAAO,CAAC,UAAU,CAAC,CAAY;IAC/B,OAAO,CAAC,UAAU,CAAC,CAAgB;IACnC,OAAO,CAAC,kBAAkB,CAAC,CAAW;IACtC,OAAO,CAAC,MAAM,CAA+B;IAC7C,OAAO,CAAC,SAAS,CAAQ;IACzB,OAAO,CAAC,KAAK,CAAC,CAAgB;IAC9B,OAAO,CAAC,gBAAgB,CAAM;IAC9B,SAAS,UAAS;gBAEI,QAAQ,EAAE,QAAQ;IAaxC,OAAO,CAAC,iBAAiB;IAQzB,KAAK,CAAC,SAAS,CAAC,EAAE,OAAO;IAczB,OAA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