@signalwire/js 4.0.0-dev-20260428183200 → 4.0.0-dev-20260429174756
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 +79 -79
- package/dist/browser.mjs.map +1 -1
- package/dist/browser.umd.js +79 -79
- package/dist/browser.umd.js.map +1 -1
- package/dist/index.cjs +65 -65
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +48 -48
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +48 -48
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +65 -65
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/browser.mjs
CHANGED
|
@@ -457,9 +457,9 @@ var require_Subscriber = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
457
457
|
var NotificationFactories_1 = require_NotificationFactories();
|
|
458
458
|
var timeoutProvider_1 = require_timeoutProvider();
|
|
459
459
|
var errorContext_1$2 = require_errorContext();
|
|
460
|
-
var Subscriber
|
|
461
|
-
__extends$16(Subscriber$
|
|
462
|
-
function Subscriber$
|
|
460
|
+
var Subscriber = function(_super) {
|
|
461
|
+
__extends$16(Subscriber$1, _super);
|
|
462
|
+
function Subscriber$1(destination) {
|
|
463
463
|
var _this = _super.call(this) || this;
|
|
464
464
|
_this.isStopped = false;
|
|
465
465
|
if (destination) {
|
|
@@ -468,54 +468,54 @@ var require_Subscriber = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
468
468
|
} else _this.destination = exports.EMPTY_OBSERVER;
|
|
469
469
|
return _this;
|
|
470
470
|
}
|
|
471
|
-
Subscriber$
|
|
471
|
+
Subscriber$1.create = function(next, error, complete) {
|
|
472
472
|
return new SafeSubscriber(next, error, complete);
|
|
473
473
|
};
|
|
474
|
-
Subscriber$
|
|
474
|
+
Subscriber$1.prototype.next = function(value) {
|
|
475
475
|
if (this.isStopped) handleStoppedNotification(NotificationFactories_1.nextNotification(value), this);
|
|
476
476
|
else this._next(value);
|
|
477
477
|
};
|
|
478
|
-
Subscriber$
|
|
478
|
+
Subscriber$1.prototype.error = function(err) {
|
|
479
479
|
if (this.isStopped) handleStoppedNotification(NotificationFactories_1.errorNotification(err), this);
|
|
480
480
|
else {
|
|
481
481
|
this.isStopped = true;
|
|
482
482
|
this._error(err);
|
|
483
483
|
}
|
|
484
484
|
};
|
|
485
|
-
Subscriber$
|
|
485
|
+
Subscriber$1.prototype.complete = function() {
|
|
486
486
|
if (this.isStopped) handleStoppedNotification(NotificationFactories_1.COMPLETE_NOTIFICATION, this);
|
|
487
487
|
else {
|
|
488
488
|
this.isStopped = true;
|
|
489
489
|
this._complete();
|
|
490
490
|
}
|
|
491
491
|
};
|
|
492
|
-
Subscriber$
|
|
492
|
+
Subscriber$1.prototype.unsubscribe = function() {
|
|
493
493
|
if (!this.closed) {
|
|
494
494
|
this.isStopped = true;
|
|
495
495
|
_super.prototype.unsubscribe.call(this);
|
|
496
496
|
this.destination = null;
|
|
497
497
|
}
|
|
498
498
|
};
|
|
499
|
-
Subscriber$
|
|
499
|
+
Subscriber$1.prototype._next = function(value) {
|
|
500
500
|
this.destination.next(value);
|
|
501
501
|
};
|
|
502
|
-
Subscriber$
|
|
502
|
+
Subscriber$1.prototype._error = function(err) {
|
|
503
503
|
try {
|
|
504
504
|
this.destination.error(err);
|
|
505
505
|
} finally {
|
|
506
506
|
this.unsubscribe();
|
|
507
507
|
}
|
|
508
508
|
};
|
|
509
|
-
Subscriber$
|
|
509
|
+
Subscriber$1.prototype._complete = function() {
|
|
510
510
|
try {
|
|
511
511
|
this.destination.complete();
|
|
512
512
|
} finally {
|
|
513
513
|
this.unsubscribe();
|
|
514
514
|
}
|
|
515
515
|
};
|
|
516
|
-
return Subscriber$
|
|
516
|
+
return Subscriber$1;
|
|
517
517
|
}(Subscription_1$10.Subscription);
|
|
518
|
-
exports.Subscriber = Subscriber
|
|
518
|
+
exports.Subscriber = Subscriber;
|
|
519
519
|
var _bind = Function.prototype.bind;
|
|
520
520
|
function bind(fn, thisArg) {
|
|
521
521
|
return _bind.call(fn, thisArg);
|
|
@@ -579,7 +579,7 @@ var require_Subscriber = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
579
579
|
return _this;
|
|
580
580
|
}
|
|
581
581
|
return SafeSubscriber$1;
|
|
582
|
-
}(Subscriber
|
|
582
|
+
}(Subscriber);
|
|
583
583
|
exports.SafeSubscriber = SafeSubscriber;
|
|
584
584
|
function handleUnhandledError(error) {
|
|
585
585
|
if (config_1$2.config.useDeprecatedSynchronousErrorHandling) errorContext_1$2.captureError(error);
|
|
@@ -11215,15 +11215,15 @@ var DependencyContainer = class {
|
|
|
11215
11215
|
this._baseURL = this.apiHost;
|
|
11216
11216
|
this._credential = {};
|
|
11217
11217
|
}
|
|
11218
|
-
get
|
|
11219
|
-
return this.
|
|
11218
|
+
get userId() {
|
|
11219
|
+
return this.user.id;
|
|
11220
11220
|
}
|
|
11221
|
-
get
|
|
11222
|
-
if (!this.
|
|
11223
|
-
return this.
|
|
11221
|
+
get user() {
|
|
11222
|
+
if (!this._user) throw new DependencyError("User");
|
|
11223
|
+
return this._user;
|
|
11224
11224
|
}
|
|
11225
|
-
set
|
|
11226
|
-
this.
|
|
11225
|
+
set user(user) {
|
|
11226
|
+
this._user = user;
|
|
11227
11227
|
}
|
|
11228
11228
|
get storage() {
|
|
11229
11229
|
if (!this._storageManager) {
|
|
@@ -11269,16 +11269,16 @@ var DependencyContainer = class {
|
|
|
11269
11269
|
this._deviceController = void 0;
|
|
11270
11270
|
}
|
|
11271
11271
|
get authorizationStateKey() {
|
|
11272
|
-
return `sw:${this.
|
|
11272
|
+
return `sw:${this.userId}:as`;
|
|
11273
11273
|
}
|
|
11274
11274
|
get protocolKey() {
|
|
11275
|
-
return `sw:${this.
|
|
11275
|
+
return `sw:${this.userId}:pt`;
|
|
11276
11276
|
}
|
|
11277
11277
|
get attachedCallsKey() {
|
|
11278
|
-
return `sw:${this.
|
|
11278
|
+
return `sw:${this.userId}:att`;
|
|
11279
11279
|
}
|
|
11280
|
-
|
|
11281
|
-
return this.
|
|
11280
|
+
getUserFromAddressId() {
|
|
11281
|
+
return this.user.addresses[0]?.id ?? "";
|
|
11282
11282
|
}
|
|
11283
11283
|
set baseURL(baseURL) {
|
|
11284
11284
|
this._baseURL = baseURL;
|
|
@@ -12108,14 +12108,14 @@ var Fetchable = class extends Destroyable {
|
|
|
12108
12108
|
};
|
|
12109
12109
|
|
|
12110
12110
|
//#endregion
|
|
12111
|
-
//#region src/core/entities/
|
|
12111
|
+
//#region src/core/entities/User.ts
|
|
12112
12112
|
/**
|
|
12113
|
-
* Authenticated
|
|
12113
|
+
* Authenticated user profile.
|
|
12114
12114
|
*
|
|
12115
12115
|
* Fetched automatically when a {@link SignalWire} connects.
|
|
12116
12116
|
* Contains identity, contact, and organization details.
|
|
12117
12117
|
*/
|
|
12118
|
-
var
|
|
12118
|
+
var User = class extends Fetchable {
|
|
12119
12119
|
constructor(http) {
|
|
12120
12120
|
super("/api/fabric/subscriber/info", http);
|
|
12121
12121
|
}
|
|
@@ -13709,9 +13709,9 @@ var Participant = class extends Destroyable {
|
|
|
13709
13709
|
get meta$() {
|
|
13710
13710
|
return this.cachedObservable("meta$", () => this._state$.pipe((0, import_operators$1.map)((state) => state.meta), (0, import_operators$1.distinctUntilChanged)()));
|
|
13711
13711
|
}
|
|
13712
|
-
/** Observable of the participant's
|
|
13713
|
-
get
|
|
13714
|
-
return this.cachedObservable("
|
|
13712
|
+
/** Observable of the participant's user ID. */
|
|
13713
|
+
get userId$() {
|
|
13714
|
+
return this.cachedObservable("userId$", () => this._state$.pipe((0, import_operators$1.map)((state) => state.subscriber_id), (0, import_operators$1.distinctUntilChanged)()));
|
|
13715
13715
|
}
|
|
13716
13716
|
/** Observable of the participant's address ID. */
|
|
13717
13717
|
get addressId$() {
|
|
@@ -13815,8 +13815,8 @@ var Participant = class extends Destroyable {
|
|
|
13815
13815
|
get meta() {
|
|
13816
13816
|
return this._state$.value.meta;
|
|
13817
13817
|
}
|
|
13818
|
-
/**
|
|
13819
|
-
get
|
|
13818
|
+
/** User ID of this participant, or `undefined` if not available. */
|
|
13819
|
+
get userId() {
|
|
13820
13820
|
return this._state$.value.subscriber_id;
|
|
13821
13821
|
}
|
|
13822
13822
|
/** Address ID of this participant, or `undefined` if not available. */
|
|
@@ -19618,7 +19618,7 @@ var ClientSessionManager = class extends Destroyable {
|
|
|
19618
19618
|
this._errors$ = this.createReplaySubject(1);
|
|
19619
19619
|
this._authState$ = this.createBehaviorSubject({ kind: "unauthenticated" });
|
|
19620
19620
|
this._wasClientBound = false;
|
|
19621
|
-
this.
|
|
19621
|
+
this._userInfo$ = this.createBehaviorSubject(null);
|
|
19622
19622
|
this._calls$ = this.createBehaviorSubject({});
|
|
19623
19623
|
this._iceServers$ = this.createBehaviorSubject([]);
|
|
19624
19624
|
attachManager.setSession(this);
|
|
@@ -19631,11 +19631,11 @@ var ClientSessionManager = class extends Destroyable {
|
|
|
19631
19631
|
get incomingCalls() {
|
|
19632
19632
|
return Object.values(this._calls$.value).filter((call) => call.direction === "inbound");
|
|
19633
19633
|
}
|
|
19634
|
-
get
|
|
19635
|
-
return this.
|
|
19634
|
+
get userInfo$() {
|
|
19635
|
+
return this._userInfo$.asObservable();
|
|
19636
19636
|
}
|
|
19637
|
-
get
|
|
19638
|
-
return this.
|
|
19637
|
+
get userInfo() {
|
|
19638
|
+
return this._userInfo$.value;
|
|
19639
19639
|
}
|
|
19640
19640
|
get calls$() {
|
|
19641
19641
|
return this.cachedObservable("calls$", () => this._calls$.pipe((0, import_cjs$7.map)((calls) => Object.values(calls))));
|
|
@@ -20081,22 +20081,22 @@ var ConversationMessageCollection = class extends EntityCollection {
|
|
|
20081
20081
|
}
|
|
20082
20082
|
};
|
|
20083
20083
|
var ConversationsManager = class {
|
|
20084
|
-
constructor(clientSession, http,
|
|
20084
|
+
constructor(clientSession, http, getUserAddressId, onError) {
|
|
20085
20085
|
this.clientSession = clientSession;
|
|
20086
20086
|
this.http = http;
|
|
20087
|
-
this.
|
|
20087
|
+
this.getUserAddressId = getUserAddressId;
|
|
20088
20088
|
this.onError = onError;
|
|
20089
20089
|
this.groupIds = /* @__PURE__ */ new Map();
|
|
20090
20090
|
}
|
|
20091
20091
|
async join(addressId) {
|
|
20092
|
-
const
|
|
20092
|
+
const userFromAddressId = this.getUserAddressId();
|
|
20093
20093
|
try {
|
|
20094
20094
|
const response = await this.http.request({
|
|
20095
20095
|
...POST_PARAMS,
|
|
20096
20096
|
url: `/api/fabric/conversations/join`,
|
|
20097
20097
|
body: JSON.stringify({
|
|
20098
|
-
from_fabric_address_id:
|
|
20099
|
-
fabric_address_ids: [addressId,
|
|
20098
|
+
from_fabric_address_id: userFromAddressId,
|
|
20099
|
+
fabric_address_ids: [addressId, userFromAddressId]
|
|
20100
20100
|
})
|
|
20101
20101
|
});
|
|
20102
20102
|
if (response.ok && !!response.body) {
|
|
@@ -20118,14 +20118,14 @@ var ConversationsManager = class {
|
|
|
20118
20118
|
}
|
|
20119
20119
|
async sendText(text, destinationAddressId) {
|
|
20120
20120
|
const groupId = this.groupIds.get(destinationAddressId) ?? await this.join(destinationAddressId);
|
|
20121
|
-
const
|
|
20121
|
+
const userFromAddressId = this.getUserAddressId();
|
|
20122
20122
|
try {
|
|
20123
20123
|
if ((await this.http.request({
|
|
20124
20124
|
...POST_PARAMS,
|
|
20125
20125
|
url: "/api/fabric/messages",
|
|
20126
20126
|
body: JSON.stringify({
|
|
20127
20127
|
group_id: groupId,
|
|
20128
|
-
from_fabric_address_id:
|
|
20128
|
+
from_fabric_address_id: userFromAddressId,
|
|
20129
20129
|
text
|
|
20130
20130
|
})
|
|
20131
20131
|
})).ok) return;
|
|
@@ -20198,17 +20198,17 @@ var DeviceTokenManager = class extends Destroyable {
|
|
|
20198
20198
|
return this._effectiveExpireIn;
|
|
20199
20199
|
}
|
|
20200
20200
|
/**
|
|
20201
|
-
* Activates the Client Bound SAT flow when the
|
|
20201
|
+
* Activates the Client Bound SAT flow when the user's token has
|
|
20202
20202
|
* `sat:refresh` scope.
|
|
20203
20203
|
*
|
|
20204
20204
|
* Steps:
|
|
20205
|
-
* 1. Check
|
|
20205
|
+
* 1. Check user's `sat_claims` for `sat:refresh` scope
|
|
20206
20206
|
* 2. Call `/api/fabric/subscriber/devices/token` with a DPoP proof
|
|
20207
20207
|
* 3. Reauthenticate the session with the Client Bound SAT + DPoP proof
|
|
20208
20208
|
* 4. Emit token to trigger the reactive refresh pipeline
|
|
20209
20209
|
*/
|
|
20210
|
-
async activate(
|
|
20211
|
-
const { satClaims } =
|
|
20210
|
+
async activate(user, session, updateCredential) {
|
|
20211
|
+
const { satClaims } = user;
|
|
20212
20212
|
if (!satClaims?.scope?.includes(SAT_REFRESH_SCOPE)) {
|
|
20213
20213
|
logger$6.debug("[DeviceToken] No sat:refresh scope, skipping Client Bound SAT activation");
|
|
20214
20214
|
return;
|
|
@@ -21055,7 +21055,7 @@ var SignalWire = class extends Destroyable {
|
|
|
21055
21055
|
constructor(credentialProvider, options = {}) {
|
|
21056
21056
|
super();
|
|
21057
21057
|
this.preferences = new ClientPreferences();
|
|
21058
|
-
this.
|
|
21058
|
+
this._user$ = this.createBehaviorSubject(void 0);
|
|
21059
21059
|
this._directory$ = this.createBehaviorSubject(void 0);
|
|
21060
21060
|
this._isConnected$ = this.createBehaviorSubject(false);
|
|
21061
21061
|
this._isRegistered$ = this.createBehaviorSubject(false);
|
|
@@ -21195,7 +21195,7 @@ var SignalWire = class extends Destroyable {
|
|
|
21195
21195
|
if (this._deps.persistSession) this._deps.storage.setItem("sw:cached_credential", credential, "local");
|
|
21196
21196
|
}
|
|
21197
21197
|
async init() {
|
|
21198
|
-
this.
|
|
21198
|
+
this._user$.next(new User(this._deps.http));
|
|
21199
21199
|
if (!this._options.skipConnection) await this.connect();
|
|
21200
21200
|
if (!this._options.reconnectAttachedCalls && this._attachManager) await this._attachManager.flush();
|
|
21201
21201
|
if (!this._options.skipRegister) try {
|
|
@@ -21259,13 +21259,13 @@ var SignalWire = class extends Destroyable {
|
|
|
21259
21259
|
async connect() {
|
|
21260
21260
|
await this.teardownTransportAndSession();
|
|
21261
21261
|
try {
|
|
21262
|
-
const
|
|
21263
|
-
if (!
|
|
21264
|
-
if (!await (0, import_cjs$1.firstValueFrom)(
|
|
21265
|
-
this._deps.
|
|
21262
|
+
const user = this._user$.value;
|
|
21263
|
+
if (!user) throw new UnexpectedError("User not initialized before connect");
|
|
21264
|
+
if (!await (0, import_cjs$1.firstValueFrom)(user.fetched$)) throw new UnexpectedError("Failed to fetch user information - fetched$ emitted false");
|
|
21265
|
+
this._deps.user = user;
|
|
21266
21266
|
} catch (error) {
|
|
21267
|
-
logger$1.error(`[SignalWire] Failed to fetch
|
|
21268
|
-
throw new UnexpectedError("Error fetching
|
|
21267
|
+
logger$1.error(`[SignalWire] Failed to fetch user information: ${error instanceof Error ? error.message : "Unknown error"}. This usually means the user token is invalid or expired.`);
|
|
21268
|
+
throw new UnexpectedError("Error fetching user information", { cause: error });
|
|
21269
21269
|
}
|
|
21270
21270
|
const errorHandler = (error) => {
|
|
21271
21271
|
this._errors$.next(error);
|
|
@@ -21299,7 +21299,7 @@ var SignalWire = class extends Destroyable {
|
|
|
21299
21299
|
logger$1.debug("[SignalWire] Developer refresh disabled — Client Bound SAT activation starting");
|
|
21300
21300
|
}
|
|
21301
21301
|
this._deviceTokenManager = new DeviceTokenManager(this._dpopManager, this._deps.http, (error) => this._errors$.next(error), () => this._deps.credential);
|
|
21302
|
-
await this._deviceTokenManager.activate(this._deps.
|
|
21302
|
+
await this._deviceTokenManager.activate(this._deps.user, this._clientSession, (cred) => {
|
|
21303
21303
|
this._deps.credential = {
|
|
21304
21304
|
...this._deps.credential,
|
|
21305
21305
|
...cred
|
|
@@ -21309,7 +21309,7 @@ var SignalWire = class extends Destroyable {
|
|
|
21309
21309
|
this.subscribeTo(this._clientSession.authenticated$.pipe((0, import_cjs$1.skip)(1), (0, import_cjs$1.filter)(Boolean)), async () => {
|
|
21310
21310
|
try {
|
|
21311
21311
|
if (this._deviceTokenManager) {
|
|
21312
|
-
await this._deviceTokenManager.activate(this._deps.
|
|
21312
|
+
await this._deviceTokenManager.activate(this._deps.user, this._clientSession, (cred) => {
|
|
21313
21313
|
this._deps.credential = {
|
|
21314
21314
|
...this._deps.credential,
|
|
21315
21315
|
...cred
|
|
@@ -21322,15 +21322,15 @@ var SignalWire = class extends Destroyable {
|
|
|
21322
21322
|
this._errors$.next(error instanceof Error ? error : new Error(String(error), { cause: error }));
|
|
21323
21323
|
}
|
|
21324
21324
|
try {
|
|
21325
|
-
logger$1.debug("[SignalWire] Re-registering
|
|
21325
|
+
logger$1.debug("[SignalWire] Re-registering user after reconnect");
|
|
21326
21326
|
await this.register();
|
|
21327
|
-
logger$1.debug("[SignalWire]
|
|
21327
|
+
logger$1.debug("[SignalWire] User re-registered successfully after reconnect");
|
|
21328
21328
|
} catch (error) {
|
|
21329
21329
|
logger$1.error("[SignalWire] Re-registration failed after reconnect:", error);
|
|
21330
21330
|
this._errors$.next(error instanceof Error ? error : new Error(String(error), { cause: error }));
|
|
21331
21331
|
}
|
|
21332
21332
|
});
|
|
21333
|
-
const conversationManager = new ConversationsManager(this._clientSession, this._deps.http, () => this._deps.
|
|
21333
|
+
const conversationManager = new ConversationsManager(this._clientSession, this._deps.http, () => this._deps.getUserFromAddressId(), errorHandler);
|
|
21334
21334
|
const directory = new DirectoryManager(this._deps.http, this._clientSession, conversationManager, errorHandler);
|
|
21335
21335
|
this._directory$.next(directory);
|
|
21336
21336
|
this._clientSession.setDirectory(directory);
|
|
@@ -21341,22 +21341,22 @@ var SignalWire = class extends Destroyable {
|
|
|
21341
21341
|
});
|
|
21342
21342
|
}
|
|
21343
21343
|
/**
|
|
21344
|
-
* Observable that emits the {@link
|
|
21344
|
+
* Observable that emits the {@link User} profile once fetched,
|
|
21345
21345
|
* or `undefined` before authentication completes.
|
|
21346
21346
|
*
|
|
21347
21347
|
* @example
|
|
21348
21348
|
* ```ts
|
|
21349
|
-
* client.
|
|
21350
|
-
* if (
|
|
21349
|
+
* client.user$.subscribe(u => {
|
|
21350
|
+
* if (u) console.log('Logged in as', u.email);
|
|
21351
21351
|
* });
|
|
21352
21352
|
* ```
|
|
21353
21353
|
*/
|
|
21354
|
-
get
|
|
21355
|
-
return this.deferEmission(this.
|
|
21354
|
+
get user$() {
|
|
21355
|
+
return this.deferEmission(this._user$.asObservable());
|
|
21356
21356
|
}
|
|
21357
|
-
/** Current
|
|
21358
|
-
get
|
|
21359
|
-
return this.
|
|
21357
|
+
/** Current user snapshot, or `undefined` if not yet authenticated. */
|
|
21358
|
+
get user() {
|
|
21359
|
+
return this._user$.value;
|
|
21360
21360
|
}
|
|
21361
21361
|
/**
|
|
21362
21362
|
* Observable that emits the {@link Directory} instance once the client is connected,
|
|
@@ -21380,11 +21380,11 @@ var SignalWire = class extends Destroyable {
|
|
|
21380
21380
|
get directory() {
|
|
21381
21381
|
return this._directory$.value;
|
|
21382
21382
|
}
|
|
21383
|
-
/** Observable that emits when the
|
|
21383
|
+
/** Observable that emits when the user registration state changes. */
|
|
21384
21384
|
get isRegistered$() {
|
|
21385
21385
|
return this.deferEmission(this._isRegistered$.asObservable());
|
|
21386
21386
|
}
|
|
21387
|
-
/** Whether the
|
|
21387
|
+
/** Whether the user is currently registered. */
|
|
21388
21388
|
get isRegistered() {
|
|
21389
21389
|
return this._isRegistered$.value;
|
|
21390
21390
|
}
|
|
@@ -21517,7 +21517,7 @@ var SignalWire = class extends Destroyable {
|
|
|
21517
21517
|
await (0, import_cjs$1.firstValueFrom)(this.ready$.pipe((0, import_cjs$1.filter)((ready$1) => ready$1 === true)));
|
|
21518
21518
|
}
|
|
21519
21519
|
/**
|
|
21520
|
-
* Registers the
|
|
21520
|
+
* Registers the user as online to receive inbound calls and events.
|
|
21521
21521
|
*
|
|
21522
21522
|
* Waits for authentication to complete before sending the registration.
|
|
21523
21523
|
* If the initial attempt fails, reauthentication is attempted automatically.
|
|
@@ -21538,7 +21538,7 @@ var SignalWire = class extends Destroyable {
|
|
|
21538
21538
|
this._errors$.next(error instanceof Error ? error : new Error(String(error), { cause: error }));
|
|
21539
21539
|
throw error;
|
|
21540
21540
|
}
|
|
21541
|
-
logger$1.debug("[SignalWire] Failed to register
|
|
21541
|
+
logger$1.debug("[SignalWire] Failed to register user, trying reauthentication...");
|
|
21542
21542
|
try {
|
|
21543
21543
|
await this._clientSession.reauthenticate(this._deps.credential.token);
|
|
21544
21544
|
logger$1.debug("[SignalWire] Reauthentication successful, retrying register()");
|
|
@@ -21549,14 +21549,14 @@ var SignalWire = class extends Destroyable {
|
|
|
21549
21549
|
this._isRegistered$.next(true);
|
|
21550
21550
|
} catch (reauthError) {
|
|
21551
21551
|
logger$1.error("[SignalWire] Reauthentication failed during register():", reauthError);
|
|
21552
|
-
const registerError = new InvalidCredentialsError("Failed to register
|
|
21552
|
+
const registerError = new InvalidCredentialsError("Failed to register user, and reauthentication attempt also failed. Please check your credentials.", { cause: reauthError instanceof Error ? reauthError : new Error(String(reauthError), { cause: reauthError }) });
|
|
21553
21553
|
this._errors$.next(registerError);
|
|
21554
21554
|
throw registerError;
|
|
21555
21555
|
}
|
|
21556
21556
|
}
|
|
21557
21557
|
}
|
|
21558
21558
|
/**
|
|
21559
|
-
* Unregisters the
|
|
21559
|
+
* Unregisters the user, going offline for inbound calls.
|
|
21560
21560
|
*
|
|
21561
21561
|
* The WebSocket connection remains open; use {@link disconnect} to fully close it.
|
|
21562
21562
|
*/
|
|
@@ -21568,7 +21568,7 @@ var SignalWire = class extends Destroyable {
|
|
|
21568
21568
|
}));
|
|
21569
21569
|
this._isRegistered$.next(false);
|
|
21570
21570
|
} catch (error) {
|
|
21571
|
-
logger$1.error("[SignalWire] Failed to unregister
|
|
21571
|
+
logger$1.error("[SignalWire] Failed to unregister user:", error);
|
|
21572
21572
|
this._errors$.next(error instanceof Error ? error : new Error(String(error), { cause: error }));
|
|
21573
21573
|
throw error;
|
|
21574
21574
|
}
|
|
@@ -22043,5 +22043,5 @@ emitReadyEvent();
|
|
|
22043
22043
|
if (typeof process === "undefined") globalThis.process = { env: { NODE_ENV: "production" } };
|
|
22044
22044
|
|
|
22045
22045
|
//#endregion
|
|
22046
|
-
export { Address, CallCreateError, ClientPreferences, CollectionFetchError, DPoPInitError, DeviceTokenError, EmbedTokenCredentialProvider, InvalidCredentialsError, MediaTrackError, MessageParseError, OverconstrainedFallbackError, Participant, PreflightError, RecoveryError, SelfCapabilities, SelfParticipant, SignalWire, StaticCredentialProvider,
|
|
22046
|
+
export { Address, CallCreateError, ClientPreferences, CollectionFetchError, DPoPInitError, DeviceTokenError, EmbedTokenCredentialProvider, InvalidCredentialsError, MediaTrackError, MessageParseError, OverconstrainedFallbackError, Participant, PreflightError, RecoveryError, SelfCapabilities, SelfParticipant, SignalWire, StaticCredentialProvider, TokenRefreshError, UnexpectedError, User, VertoPongError, WebRTCCall, embeddableCall, getLogger, isSelfParticipant, ready, setDebugOptions, setLogLevel, setLogger, version };
|
|
22047
22047
|
//# sourceMappingURL=browser.mjs.map
|