@ipcom/asterisk-ari 0.0.124 → 0.0.126
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/esm/index.js
CHANGED
|
@@ -1897,13 +1897,13 @@ var WebSocketClient = class extends EventEmitter3 {
|
|
|
1897
1897
|
*/
|
|
1898
1898
|
addScopedMessageListener(instanceId, app, callback) {
|
|
1899
1899
|
const key = `${app}:${instanceId}`;
|
|
1900
|
-
if (key.includes("removeListener")) {
|
|
1901
|
-
console.warn(`Evento interno ignorado: '${key}'.`);
|
|
1902
|
-
return;
|
|
1903
|
-
}
|
|
1904
1900
|
if (this.scopedListeners.has(key)) {
|
|
1905
|
-
console.warn(
|
|
1906
|
-
|
|
1901
|
+
console.warn(
|
|
1902
|
+
`Listener escopado j\xE1 existe para '${key}'. Removendo antigo.`
|
|
1903
|
+
);
|
|
1904
|
+
const existingListener = this.scopedListeners.get(key);
|
|
1905
|
+
this.off("message", existingListener);
|
|
1906
|
+
this.scopedListeners.delete(key);
|
|
1907
1907
|
}
|
|
1908
1908
|
const scopedListener = (data) => {
|
|
1909
1909
|
if (data.application === app && (data.type.startsWith("Channel") && "channel" in data && data.channel?.id === instanceId || data.type.startsWith("Playback") && "playbackId" in data && data.playbackId === instanceId)) {
|
|
@@ -1931,20 +1931,14 @@ var WebSocketClient = class extends EventEmitter3 {
|
|
|
1931
1931
|
console.warn(`Nenhum listener encontrado para a inst\xE2ncia '${key}'.`);
|
|
1932
1932
|
return;
|
|
1933
1933
|
}
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
this.off("message", scopedListener);
|
|
1937
|
-
console.log(`Listener removido com sucesso para '${key}'.`);
|
|
1938
|
-
} else {
|
|
1939
|
-
console.warn(`Listener j\xE1 foi removido ou n\xE3o encontrado para '${key}'.`);
|
|
1940
|
-
}
|
|
1934
|
+
console.log(`Removendo listener escopado para '${key}'.`);
|
|
1935
|
+
this.off("message", scopedListener);
|
|
1941
1936
|
this.scopedListeners.delete(key);
|
|
1942
1937
|
console.log(
|
|
1943
|
-
`Listeners escopados removidos para
|
|
1938
|
+
`Listeners escopados removidos para '${key}'. Total de listeners restantes: ${this.listenerCount(
|
|
1944
1939
|
"message"
|
|
1945
1940
|
)}`
|
|
1946
1941
|
);
|
|
1947
|
-
console.log("Depois de remover listeners:");
|
|
1948
1942
|
this.listListeners("message");
|
|
1949
1943
|
}
|
|
1950
1944
|
/**
|