@ipcom/asterisk-ari 0.0.155 → 0.0.156
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
|
@@ -954,7 +954,6 @@ var BridgeInstance = class {
|
|
|
954
954
|
this.client = client;
|
|
955
955
|
this.baseClient = baseClient;
|
|
956
956
|
this.id = bridgeId || `bridge-${Date.now()}`;
|
|
957
|
-
console.log(`BridgeInstance inicializada com ID: ${this.id}`);
|
|
958
957
|
}
|
|
959
958
|
eventEmitter = new EventEmitter();
|
|
960
959
|
bridgeData = null;
|
|
@@ -977,7 +976,7 @@ var BridgeInstance = class {
|
|
|
977
976
|
*
|
|
978
977
|
* @example
|
|
979
978
|
* bridge.on('BridgeCreated', (event) => {
|
|
980
|
-
*
|
|
979
|
+
*
|
|
981
980
|
* });
|
|
982
981
|
* @param event
|
|
983
982
|
* @param listener
|
|
@@ -992,7 +991,6 @@ var BridgeInstance = class {
|
|
|
992
991
|
}
|
|
993
992
|
};
|
|
994
993
|
this.eventEmitter.on(event, wrappedListener);
|
|
995
|
-
console.log(`Event listener registered for ${event} on bridge ${this.id}`);
|
|
996
994
|
}
|
|
997
995
|
/**
|
|
998
996
|
* Registers a one-time listener for specific bridge events.
|
|
@@ -1010,9 +1008,6 @@ var BridgeInstance = class {
|
|
|
1010
1008
|
}
|
|
1011
1009
|
};
|
|
1012
1010
|
this.eventEmitter.once(event, wrappedListener);
|
|
1013
|
-
console.log(
|
|
1014
|
-
`One-time listener registered for ${event} on bridge ${this.id}`
|
|
1015
|
-
);
|
|
1016
1011
|
}
|
|
1017
1012
|
/**
|
|
1018
1013
|
* Removes event listener(s) from the bridge.
|
|
@@ -1026,12 +1021,8 @@ var BridgeInstance = class {
|
|
|
1026
1021
|
}
|
|
1027
1022
|
if (listener) {
|
|
1028
1023
|
this.eventEmitter.off(event, listener);
|
|
1029
|
-
console.log(
|
|
1030
|
-
`Specific listener removed for ${event} on bridge ${this.id}`
|
|
1031
|
-
);
|
|
1032
1024
|
} else {
|
|
1033
1025
|
this.eventEmitter.removeAllListeners(event);
|
|
1034
|
-
console.log(`All listeners removed for ${event} on bridge ${this.id}`);
|
|
1035
1026
|
}
|
|
1036
1027
|
}
|
|
1037
1028
|
/**
|
|
@@ -1046,7 +1037,6 @@ var BridgeInstance = class {
|
|
|
1046
1037
|
}
|
|
1047
1038
|
if ("bridge" in event && event.bridge?.id === this.id) {
|
|
1048
1039
|
this.eventEmitter.emit(event.type, event);
|
|
1049
|
-
console.log(`Event ${event.type} emitted for bridge ${this.id}`);
|
|
1050
1040
|
}
|
|
1051
1041
|
}
|
|
1052
1042
|
/**
|
|
@@ -1054,7 +1044,6 @@ var BridgeInstance = class {
|
|
|
1054
1044
|
*/
|
|
1055
1045
|
removeAllListeners() {
|
|
1056
1046
|
this.eventEmitter.removeAllListeners();
|
|
1057
|
-
console.log(`All listeners removed from bridge ${this.id}`);
|
|
1058
1047
|
}
|
|
1059
1048
|
/**
|
|
1060
1049
|
* Retrieves the current details of the bridge.
|
|
@@ -1070,7 +1059,6 @@ var BridgeInstance = class {
|
|
|
1070
1059
|
this.bridgeData = await this.baseClient.get(
|
|
1071
1060
|
`/bridges/${this.id}`
|
|
1072
1061
|
);
|
|
1073
|
-
console.log(`Details retrieved for bridge ${this.id}`);
|
|
1074
1062
|
return this.bridgeData;
|
|
1075
1063
|
} catch (error) {
|
|
1076
1064
|
const message = getErrorMessage(error);
|
|
@@ -1093,7 +1081,6 @@ var BridgeInstance = class {
|
|
|
1093
1081
|
await this.baseClient.post(
|
|
1094
1082
|
`/bridges/${this.id}/addChannel?${queryParams}`
|
|
1095
1083
|
);
|
|
1096
|
-
console.log(`Channels added to bridge ${this.id}`);
|
|
1097
1084
|
} catch (error) {
|
|
1098
1085
|
const message = getErrorMessage(error);
|
|
1099
1086
|
console.error(`Error adding channels to bridge ${this.id}:`, message);
|
|
@@ -1114,7 +1101,6 @@ var BridgeInstance = class {
|
|
|
1114
1101
|
await this.baseClient.post(
|
|
1115
1102
|
`/bridges/${this.id}/removeChannel?${queryParams}`
|
|
1116
1103
|
);
|
|
1117
|
-
console.log(`Channels removed from bridge ${this.id}`);
|
|
1118
1104
|
} catch (error) {
|
|
1119
1105
|
const message = getErrorMessage(error);
|
|
1120
1106
|
console.error(`Error removing channels from bridge ${this.id}:`, message);
|
|
@@ -1140,7 +1126,6 @@ var BridgeInstance = class {
|
|
|
1140
1126
|
`/bridges/${this.id}/play?${queryParams}`,
|
|
1141
1127
|
{ media: request.media }
|
|
1142
1128
|
);
|
|
1143
|
-
console.log(`Media playback started on bridge ${this.id}`);
|
|
1144
1129
|
return result;
|
|
1145
1130
|
} catch (error) {
|
|
1146
1131
|
const message = getErrorMessage(error);
|
|
@@ -1159,7 +1144,6 @@ var BridgeInstance = class {
|
|
|
1159
1144
|
await this.baseClient.delete(
|
|
1160
1145
|
`/bridges/${this.id}/play/${playbackId}`
|
|
1161
1146
|
);
|
|
1162
|
-
console.log(`Playback ${playbackId} stopped on bridge ${this.id}`);
|
|
1163
1147
|
} catch (error) {
|
|
1164
1148
|
const message = getErrorMessage(error);
|
|
1165
1149
|
console.error(`Error stopping playback on bridge ${this.id}:`, message);
|
|
@@ -1177,7 +1161,6 @@ var BridgeInstance = class {
|
|
|
1177
1161
|
await this.baseClient.post(
|
|
1178
1162
|
`/bridges/${this.id}/videoSource/${channelId}`
|
|
1179
1163
|
);
|
|
1180
|
-
console.log(`Video source set for bridge ${this.id}`);
|
|
1181
1164
|
} catch (error) {
|
|
1182
1165
|
const message = getErrorMessage(error);
|
|
1183
1166
|
console.error(
|
|
@@ -1195,7 +1178,6 @@ var BridgeInstance = class {
|
|
|
1195
1178
|
async clearVideoSource() {
|
|
1196
1179
|
try {
|
|
1197
1180
|
await this.baseClient.delete(`/bridges/${this.id}/videoSource`);
|
|
1198
|
-
console.log(`Video source removed from bridge ${this.id}`);
|
|
1199
1181
|
} catch (error) {
|
|
1200
1182
|
const message = getErrorMessage(error);
|
|
1201
1183
|
console.error(
|
|
@@ -1249,20 +1231,16 @@ var Bridges = class {
|
|
|
1249
1231
|
if (!id) {
|
|
1250
1232
|
const instance = new BridgeInstance(this.client, this.baseClient);
|
|
1251
1233
|
this.bridgeInstances.set(instance.id, instance);
|
|
1252
|
-
console.log(`New bridge instance created with ID: ${instance.id}`);
|
|
1253
1234
|
return instance;
|
|
1254
1235
|
}
|
|
1255
1236
|
if (!this.bridgeInstances.has(id)) {
|
|
1256
1237
|
const instance = new BridgeInstance(this.client, this.baseClient, id);
|
|
1257
1238
|
this.bridgeInstances.set(id, instance);
|
|
1258
|
-
console.log(`New bridge instance created with provided ID: ${id}`);
|
|
1259
1239
|
return instance;
|
|
1260
1240
|
}
|
|
1261
|
-
console.log(`Returning existing bridge instance: ${id}`);
|
|
1262
1241
|
return this.bridgeInstances.get(id);
|
|
1263
1242
|
} catch (error) {
|
|
1264
1243
|
const message = getErrorMessage(error);
|
|
1265
|
-
console.error(`Error creating/retrieving bridge instance:`, message);
|
|
1266
1244
|
throw new Error(`Failed to manage bridge instance: ${message}`);
|
|
1267
1245
|
}
|
|
1268
1246
|
}
|
|
@@ -1284,7 +1262,6 @@ var Bridges = class {
|
|
|
1284
1262
|
const instance = this.bridgeInstances.get(bridgeId);
|
|
1285
1263
|
instance?.removeAllListeners();
|
|
1286
1264
|
this.bridgeInstances.delete(bridgeId);
|
|
1287
|
-
console.log(`Inst\xE2ncia de bridge removida: ${bridgeId}`);
|
|
1288
1265
|
} else {
|
|
1289
1266
|
console.warn(`Tentativa de remover inst\xE2ncia inexistente: ${bridgeId}`);
|
|
1290
1267
|
}
|
|
@@ -1316,9 +1293,6 @@ var Bridges = class {
|
|
|
1316
1293
|
const instance = this.bridgeInstances.get(event.bridge.id);
|
|
1317
1294
|
if (instance) {
|
|
1318
1295
|
instance.emitEvent(event);
|
|
1319
|
-
console.log(
|
|
1320
|
-
`Evento propagado para bridge ${event.bridge.id}: ${event.type}`
|
|
1321
|
-
);
|
|
1322
1296
|
} else {
|
|
1323
1297
|
console.warn(
|
|
1324
1298
|
`Nenhuma inst\xE2ncia encontrada para bridge ${event.bridge.id}`
|
|
@@ -1340,7 +1314,7 @@ var Bridges = class {
|
|
|
1340
1314
|
* @example
|
|
1341
1315
|
* try {
|
|
1342
1316
|
* const bridges = await bridgesInstance.list();
|
|
1343
|
-
*
|
|
1317
|
+
*
|
|
1344
1318
|
* } catch (error) {
|
|
1345
1319
|
* console.error('Failed to fetch bridges:', error);
|
|
1346
1320
|
* }
|