@ipcom/asterisk-ari 0.0.141 → 0.0.143
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/cjs/index.cjs
CHANGED
|
@@ -1509,6 +1509,27 @@ var Channels = class {
|
|
|
1509
1509
|
throw new Error(`Failed to manage channel instance: ${message}`);
|
|
1510
1510
|
}
|
|
1511
1511
|
}
|
|
1512
|
+
/**
|
|
1513
|
+
* Retrieves the details of a specific channel.
|
|
1514
|
+
*
|
|
1515
|
+
* @param {string} id - The unique identifier of the channel to retrieve.
|
|
1516
|
+
* @returns {Promise<Channel>} A promise that resolves to the Channel object containing the channel details.
|
|
1517
|
+
* @throws {Error} If no channel ID is associated with this instance or if there's an error retrieving the channel details.
|
|
1518
|
+
*/
|
|
1519
|
+
async get(id) {
|
|
1520
|
+
try {
|
|
1521
|
+
if (!id) {
|
|
1522
|
+
throw new Error("No channel ID associated with this instance");
|
|
1523
|
+
}
|
|
1524
|
+
const details = await this.baseClient.get(`/channels/${id}`);
|
|
1525
|
+
console.log(`Retrieved channel details for ${id}`);
|
|
1526
|
+
return details;
|
|
1527
|
+
} catch (error) {
|
|
1528
|
+
const message = getErrorMessage(error);
|
|
1529
|
+
console.error(`Error retrieving channel details for ${id}:`, message);
|
|
1530
|
+
throw new Error(`Failed to get channel details: ${message}`);
|
|
1531
|
+
}
|
|
1532
|
+
}
|
|
1512
1533
|
/**
|
|
1513
1534
|
* Removes a channel instance from the collection.
|
|
1514
1535
|
*/
|