@signalwire/js 4.0.0-beta.0 → 4.0.0-beta.1
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/browser.mjs +8 -5
- package/dist/browser.mjs.map +1 -1
- package/dist/browser.umd.js +8 -5
- package/dist/browser.umd.js.map +1 -1
- package/dist/index.cjs +8 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +8 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/browser.mjs
CHANGED
|
@@ -15508,12 +15508,15 @@ var ClientSessionManager = class extends Destroyable {
|
|
|
15508
15508
|
}
|
|
15509
15509
|
async createCall(options = {}) {
|
|
15510
15510
|
try {
|
|
15511
|
-
if (!this._directory) throw new DependencyError("Directory not initialized");
|
|
15512
15511
|
const addressURI = getAddressSearchURI(options);
|
|
15513
|
-
|
|
15514
|
-
if (!
|
|
15515
|
-
|
|
15516
|
-
|
|
15512
|
+
let address;
|
|
15513
|
+
if (!addressURI.startsWith("+")) {
|
|
15514
|
+
if (!this._directory) throw new DependencyError("Directory not initialized");
|
|
15515
|
+
const addressId = await this._directory.findAddressIdByURI(addressURI);
|
|
15516
|
+
if (!addressId) throw new DependencyError(`Address name: ${addressURI} not found`);
|
|
15517
|
+
address = this._directory.get(addressId);
|
|
15518
|
+
if (!address) throw new DependencyError(`Address ID: ${addressId} not found`);
|
|
15519
|
+
}
|
|
15517
15520
|
const callSession = this.callFactory.createCall(address, { ...options });
|
|
15518
15521
|
callSession.status$.pipe((0, import_cjs$5.filter)((status) => status === "destroyed"), (0, import_cjs$5.take)(1)).subscribe(() => {
|
|
15519
15522
|
const { [`${callSession.id}`]: _, ...remainingCalls } = this._calls$.value;
|