@signalwire/js 3.25.0 → 3.26.0-dev.202401232045.8ee0040.0
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/core/src/BaseComponent.d.ts +2 -2
- package/dist/core/src/BaseComponent.d.ts.map +1 -1
- package/dist/core/src/BaseJWTSession.d.ts.map +1 -1
- package/dist/core/src/BaseSession.d.ts +4 -0
- package/dist/core/src/BaseSession.d.ts.map +1 -1
- package/dist/core/src/RPCMessages/RPCConnect.d.ts +15 -0
- package/dist/core/src/RPCMessages/RPCConnect.d.ts.map +1 -1
- package/dist/core/src/RPCMessages/RPCEventAck.d.ts +8 -0
- package/dist/core/src/RPCMessages/RPCEventAck.d.ts.map +1 -0
- package/dist/core/src/RPCMessages/index.d.ts +1 -0
- package/dist/core/src/RPCMessages/index.d.ts.map +1 -1
- package/dist/core/src/chat/applyCommonMethods.d.ts +19 -0
- package/dist/core/src/chat/applyCommonMethods.d.ts.map +1 -0
- package/dist/core/src/chat/index.d.ts +1 -0
- package/dist/core/src/chat/index.d.ts.map +1 -1
- package/dist/core/src/index.d.ts +1 -0
- package/dist/core/src/index.d.ts.map +1 -1
- package/dist/core/src/types/callfabric.d.ts +26 -0
- package/dist/core/src/types/callfabric.d.ts.map +1 -0
- package/dist/core/src/types/chat.d.ts +1 -0
- package/dist/core/src/types/chat.d.ts.map +1 -1
- package/dist/core/src/types/index.d.ts +1 -0
- package/dist/core/src/types/index.d.ts.map +1 -1
- package/dist/core/src/types/messaging.d.ts +1 -1
- package/dist/core/src/types/messaging.d.ts.map +1 -1
- package/dist/core/src/types/unified.d.ts +36 -0
- package/dist/core/src/types/unified.d.ts.map +1 -0
- package/dist/core/src/types/utils.d.ts +9 -0
- package/dist/core/src/types/utils.d.ts.map +1 -1
- package/dist/core/src/types/videoLayout.d.ts +5 -0
- package/dist/core/src/types/videoLayout.d.ts.map +1 -1
- package/dist/core/src/types/videoMember.d.ts +21 -0
- package/dist/core/src/types/videoMember.d.ts.map +1 -1
- package/dist/core/src/types/videoPlayback.d.ts +13 -1
- package/dist/core/src/types/videoPlayback.d.ts.map +1 -1
- package/dist/core/src/types/videoRecording.d.ts +12 -0
- package/dist/core/src/types/videoRecording.d.ts.map +1 -1
- package/dist/core/src/types/videoRoomSession.d.ts +19 -0
- package/dist/core/src/types/videoRoomSession.d.ts.map +1 -1
- package/dist/core/src/types/videoStream.d.ts +11 -0
- package/dist/core/src/types/videoStream.d.ts.map +1 -1
- package/dist/core/src/types/voiceCall.d.ts +13 -3
- package/dist/core/src/types/voiceCall.d.ts.map +1 -1
- package/dist/core/src/utils/interfaces.d.ts +3 -1
- package/dist/core/src/utils/interfaces.d.ts.map +1 -1
- package/dist/core/src/utils/mapObject.d.ts +7 -0
- package/dist/core/src/utils/mapObject.d.ts.map +1 -0
- package/dist/core/src/utils/mapObject.test.d.ts +2 -0
- package/dist/core/src/utils/mapObject.test.d.ts.map +1 -0
- package/dist/index.esm.js +198 -29
- package/dist/index.esm.js.map +3 -3
- package/dist/index.js +199 -33
- package/dist/index.js.map +3 -3
- package/dist/index.umd.js +4 -4
- package/dist/index.umd.js.map +1 -1
- package/dist/js/src/BaseRoomSession.d.ts +9 -9
- package/dist/js/src/BaseRoomSession.d.ts.map +1 -1
- package/dist/js/src/Client.d.ts +3 -0
- package/dist/js/src/Client.d.ts.map +1 -1
- package/dist/js/src/JWTSession.d.ts.map +1 -1
- package/dist/js/src/RoomSession.d.ts.map +1 -1
- package/dist/js/src/chat/index.d.ts +4 -6
- package/dist/js/src/chat/index.d.ts.map +1 -1
- package/dist/js/src/fabric/HTTPClient.d.ts +18 -3
- package/dist/js/src/fabric/HTTPClient.d.ts.map +1 -1
- package/dist/js/src/fabric/SignalWire.d.ts +3 -5
- package/dist/js/src/fabric/SignalWire.d.ts.map +1 -1
- package/dist/js/src/fabric/WSClient.d.ts +7 -2
- package/dist/js/src/fabric/WSClient.d.ts.map +1 -1
- package/dist/js/src/fabric/unified/workers/mappers/UnifiedEventsMapper.d.ts +4 -0
- package/dist/js/src/fabric/unified/workers/mappers/UnifiedEventsMapper.d.ts.map +1 -0
- package/dist/js/src/fabric/unified/workers/unifiedEventsWatcher.d.ts +7 -0
- package/dist/js/src/fabric/unified/workers/unifiedEventsWatcher.d.ts.map +1 -0
- package/dist/js/src/utils/interfaces.d.ts +4 -0
- package/dist/js/src/utils/interfaces.d.ts.map +1 -1
- package/dist/js/src/video/videoWorker.d.ts.map +1 -1
- package/dist/js/tsconfig.build.tsbuildinfo +1 -1
- package/dist/webrtc/src/BaseConnection.d.ts.map +1 -1
- package/dist/webrtc/src/RTCPeer.d.ts.map +1 -1
- package/dist/webrtc/src/utils/helpers.d.ts +10 -0
- package/dist/webrtc/src/utils/helpers.d.ts.map +1 -1
- package/dist/webrtc/src/utils/interfaces.d.ts +2 -0
- package/dist/webrtc/src/utils/interfaces.d.ts.map +1 -1
- package/package.json +8 -4
- package/src/BaseRoomSession.ts +14 -10
- package/src/Client.ts +2 -1
- package/src/RoomSession.ts +2 -0
- package/src/chat/index.ts +29 -10
- package/src/fabric/HTTPClient.ts +34 -7
- package/src/fabric/SignalWire.ts +3 -5
- package/src/fabric/WSClient.ts +12 -3
- package/src/fabric/unified/workers/mappers/UnifiedEventsMapper.ts +61 -0
- package/src/fabric/unified/workers/unifiedEventsWatcher.ts +84 -0
- package/src/utils/interfaces.ts +5 -0
- package/src/video/videoWorker.ts +6 -3
package/dist/index.js
CHANGED
|
@@ -1051,11 +1051,14 @@ var videoWorker = function* (options) {
|
|
|
1051
1051
|
default:
|
|
1052
1052
|
break;
|
|
1053
1053
|
}
|
|
1054
|
-
|
|
1054
|
+
const event = (0, import_core12.stripNamespacePrefix)(type, "video");
|
|
1055
|
+
roomSession.emit(event, payload);
|
|
1055
1056
|
}
|
|
1056
|
-
const
|
|
1057
|
+
const isVideoOrCallEvent = (action) => {
|
|
1058
|
+
return action.type.startsWith("video.") || action.type.startsWith("call.");
|
|
1059
|
+
};
|
|
1057
1060
|
while (true) {
|
|
1058
|
-
const action = yield import_core12.sagaEffects.take(swEventChannel,
|
|
1061
|
+
const action = yield import_core12.sagaEffects.take(swEventChannel, isVideoOrCallEvent);
|
|
1059
1062
|
yield import_core12.sagaEffects.fork(worker, action);
|
|
1060
1063
|
}
|
|
1061
1064
|
(0, import_core12.getLogger)().trace("videoWorker ended");
|
|
@@ -1073,6 +1076,9 @@ var RoomSessionConnection = class extends import_webrtc4.BaseConnection {
|
|
|
1073
1076
|
this.runWorker("videoWorker", {
|
|
1074
1077
|
worker: videoWorker
|
|
1075
1078
|
});
|
|
1079
|
+
if (options.eventsWatcher) {
|
|
1080
|
+
this.runWorker("eventsWatcher", { worker: options.eventsWatcher });
|
|
1081
|
+
}
|
|
1076
1082
|
}
|
|
1077
1083
|
get screenShareList() {
|
|
1078
1084
|
return Array.from(this._screenShareList);
|
|
@@ -1633,7 +1639,7 @@ var JWTSession = class extends import_core21.BaseJWTSession {
|
|
|
1633
1639
|
this.options = options;
|
|
1634
1640
|
__publicField(this, "WebSocketConstructor", WebSocket);
|
|
1635
1641
|
__publicField(this, "CloseEventConstructor", SwCloseEvent);
|
|
1636
|
-
__publicField(this, "agent", "@signalwire/js/browser/3.
|
|
1642
|
+
__publicField(this, "agent", "@signalwire/js/browser/3.26.0-dev.202401232045.8ee0040.0");
|
|
1637
1643
|
__publicField(this, "tokenTyp");
|
|
1638
1644
|
this.tokenTyp = (_a = decodedJwt.typ) != null ? _a : "VRT";
|
|
1639
1645
|
}
|
|
@@ -1943,7 +1949,8 @@ var RoomSession = function(roomOptions) {
|
|
|
1943
1949
|
destinationNumber,
|
|
1944
1950
|
localStream,
|
|
1945
1951
|
watchMediaPackets,
|
|
1946
|
-
watchMediaPacketsTimeout
|
|
1952
|
+
watchMediaPacketsTimeout,
|
|
1953
|
+
disableUdpIceServers = false
|
|
1947
1954
|
} = _a, userOptions = __objRest(_a, [
|
|
1948
1955
|
"audio",
|
|
1949
1956
|
"video",
|
|
@@ -1957,7 +1964,8 @@ var RoomSession = function(roomOptions) {
|
|
|
1957
1964
|
"destinationNumber",
|
|
1958
1965
|
"localStream",
|
|
1959
1966
|
"watchMediaPackets",
|
|
1960
|
-
"watchMediaPacketsTimeout"
|
|
1967
|
+
"watchMediaPacketsTimeout",
|
|
1968
|
+
"disableUdpIceServers"
|
|
1961
1969
|
]);
|
|
1962
1970
|
const deprecatedParams = ["audio", "video"];
|
|
1963
1971
|
deprecatedParams.forEach((param) => {
|
|
@@ -2013,7 +2021,8 @@ var RoomSession = function(roomOptions) {
|
|
|
2013
2021
|
localStream,
|
|
2014
2022
|
watchMediaPackets,
|
|
2015
2023
|
watchMediaPacketsTimeout,
|
|
2016
|
-
prevCallId: reattachManager.getPrevCallId()
|
|
2024
|
+
prevCallId: reattachManager.getPrevCallId(),
|
|
2025
|
+
disableUdpIceServers
|
|
2017
2026
|
});
|
|
2018
2027
|
room.once("destroy", () => {
|
|
2019
2028
|
room.emit("room.left", { reason: room.leaveReason });
|
|
@@ -2252,7 +2261,7 @@ var SWClient = class {
|
|
|
2252
2261
|
};
|
|
2253
2262
|
|
|
2254
2263
|
// src/fabric/WSClient.ts
|
|
2255
|
-
var
|
|
2264
|
+
var import_core28 = require("@signalwire/core");
|
|
2256
2265
|
|
|
2257
2266
|
// src/fabric/WSClientWorker.ts
|
|
2258
2267
|
var import_core26 = require("@signalwire/core");
|
|
@@ -2274,19 +2283,160 @@ var WSClientWorker = function* (options) {
|
|
|
2274
2283
|
(0, import_core26.getLogger)().trace("WSClientWorker ended");
|
|
2275
2284
|
};
|
|
2276
2285
|
|
|
2286
|
+
// src/fabric/unified/workers/unifiedEventsWatcher.ts
|
|
2287
|
+
var import_core27 = require("@signalwire/core");
|
|
2288
|
+
|
|
2289
|
+
// ../core/src/utils/mapObject.ts
|
|
2290
|
+
var import_object_path = __toESM(require("object-path"));
|
|
2291
|
+
function isMappableObject(obj) {
|
|
2292
|
+
return !!obj.type;
|
|
2293
|
+
}
|
|
2294
|
+
function mapObject(template, action) {
|
|
2295
|
+
var _a;
|
|
2296
|
+
const matches = new RegExp("^(?<prefix>(\\w|\\.)*)(\\[(?<stateKey>[^\\(\\)]*)(?<replace>\\((?<from>(\\w|\\.)*):(?<to>\\S*)\\))?\\]){0,1}(?<payloadMap>\\{.*\\}){0,1}").exec(template);
|
|
2297
|
+
let result = __spreadProps(__spreadValues({}, action), {
|
|
2298
|
+
type: template
|
|
2299
|
+
});
|
|
2300
|
+
if ((matches == null ? void 0 : matches.groups) && !!action.payload) {
|
|
2301
|
+
const { prefix, stateKey, replace, from, to } = matches.groups;
|
|
2302
|
+
let newType;
|
|
2303
|
+
if (!!replace) {
|
|
2304
|
+
newType = action.payload[stateKey] === from ? `${prefix}${to}` : void 0;
|
|
2305
|
+
} else if (!!stateKey) {
|
|
2306
|
+
newType = !!action.payload[stateKey] ? `${prefix}${action.payload[stateKey]}` : void 0;
|
|
2307
|
+
} else {
|
|
2308
|
+
newType = `${prefix}`;
|
|
2309
|
+
}
|
|
2310
|
+
result = !!newType ? __spreadProps(__spreadValues({}, action), {
|
|
2311
|
+
type: newType
|
|
2312
|
+
}) : void 0;
|
|
2313
|
+
}
|
|
2314
|
+
if ((_a = matches == null ? void 0 : matches.groups) == null ? void 0 : _a.payloadMap) {
|
|
2315
|
+
const { payloadMap: mapString } = matches.groups;
|
|
2316
|
+
const { payload } = action;
|
|
2317
|
+
const payloadMap = JSON.parse(mapString);
|
|
2318
|
+
const newContent = {};
|
|
2319
|
+
Object.entries(payloadMap).forEach(([old_path, new_path]) => {
|
|
2320
|
+
const value = import_object_path.default.get(payload, old_path);
|
|
2321
|
+
import_object_path.default.del(payload, old_path);
|
|
2322
|
+
import_object_path.default.set(newContent, new_path, value);
|
|
2323
|
+
});
|
|
2324
|
+
const newPayload = __spreadValues(__spreadValues({}, payload), newContent);
|
|
2325
|
+
result = __spreadProps(__spreadValues({}, result), {
|
|
2326
|
+
payload: newPayload
|
|
2327
|
+
});
|
|
2328
|
+
}
|
|
2329
|
+
return result;
|
|
2330
|
+
}
|
|
2331
|
+
|
|
2332
|
+
// src/fabric/unified/workers/mappers/UnifiedEventsMapper.ts
|
|
2333
|
+
var EVENT_MAPPINGS = {
|
|
2334
|
+
"call.state": [
|
|
2335
|
+
"call.state.[call_state]",
|
|
2336
|
+
"video.room.[call_state]",
|
|
2337
|
+
"video.room.[call_state(created:started)]"
|
|
2338
|
+
],
|
|
2339
|
+
"call.play": ["call.play.[state]"],
|
|
2340
|
+
"call.collect": ["call.collect.[collect_state]"],
|
|
2341
|
+
"call.connect": [
|
|
2342
|
+
"call.connect.[connect_state]",
|
|
2343
|
+
"video.room.[connect_state(connected:subscribed)]"
|
|
2344
|
+
],
|
|
2345
|
+
"call.join": ['video.room.subscribed{"callID":"room_id"}'],
|
|
2346
|
+
"call.audience_count": ["video.room.audience_count"],
|
|
2347
|
+
"call.denoise": ["call.denoise"],
|
|
2348
|
+
"call.detect": ["call.detect.[detect_state]"],
|
|
2349
|
+
"call.dial": ["call.dial.[dial_state]"],
|
|
2350
|
+
"call.send_digits": ["call.send_digits", "video.room.send_digits"],
|
|
2351
|
+
"call.refer": ["calling.call.refer"],
|
|
2352
|
+
"call.received": ["call.received"],
|
|
2353
|
+
"call.fax": ["call.fax.[fax_state]"],
|
|
2354
|
+
"call.hold": ["call.hold.[fax_state]"],
|
|
2355
|
+
"call.prompt": ["call.prompt.[prompt_state]"],
|
|
2356
|
+
"call.started": ["video.room.started"],
|
|
2357
|
+
"call.subscribed": ["video.room.subscribed"],
|
|
2358
|
+
"call.updated": ["video.room.updated"],
|
|
2359
|
+
"call.ended": ["video.room.ended"],
|
|
2360
|
+
"member.joined": ["video.member.joined"],
|
|
2361
|
+
"member.left": ["video.member.left"],
|
|
2362
|
+
"member.updated": ["video.member.updated"],
|
|
2363
|
+
"member.talking": ["video.member.talking"],
|
|
2364
|
+
"member.promoted": ["video.member.promoted"],
|
|
2365
|
+
"member.demoted": ["video.member.demoted"],
|
|
2366
|
+
"layout.changed": ["video.layout.changed"],
|
|
2367
|
+
"call.recording": ["video.room.recording.[recording_state]"],
|
|
2368
|
+
"call.playback": ["video.room.playback.[playback_state]"],
|
|
2369
|
+
"call.outbound_stream.started": ["video.stream.started"],
|
|
2370
|
+
"call.outbound_stream.ended": ["video.stream.ended"]
|
|
2371
|
+
};
|
|
2372
|
+
function fromUnifiedEvent(action) {
|
|
2373
|
+
const { type } = action;
|
|
2374
|
+
if (!Object.keys(EVENT_MAPPINGS).includes(type)) {
|
|
2375
|
+
return [];
|
|
2376
|
+
}
|
|
2377
|
+
const mapDefinitions = EVENT_MAPPINGS[type];
|
|
2378
|
+
const allNewActions = mapDefinitions.map((eventTemplate) => mapObject(eventTemplate, action));
|
|
2379
|
+
return allNewActions.filter((obj) => !!obj);
|
|
2380
|
+
}
|
|
2381
|
+
|
|
2382
|
+
// src/fabric/unified/workers/unifiedEventsWatcher.ts
|
|
2383
|
+
function* eventMapperWorker({
|
|
2384
|
+
action,
|
|
2385
|
+
swEventChannel
|
|
2386
|
+
}) {
|
|
2387
|
+
if (isMappableObject(action)) {
|
|
2388
|
+
const mappedActions = fromUnifiedEvent(action);
|
|
2389
|
+
for (const mappedAction of mappedActions) {
|
|
2390
|
+
yield import_core27.sagaEffects.put(swEventChannel, mappedAction);
|
|
2391
|
+
}
|
|
2392
|
+
}
|
|
2393
|
+
}
|
|
2394
|
+
function* debugEmitter({
|
|
2395
|
+
action,
|
|
2396
|
+
instance
|
|
2397
|
+
}) {
|
|
2398
|
+
const { type, payload } = action;
|
|
2399
|
+
yield instance.emit(type, payload);
|
|
2400
|
+
}
|
|
2401
|
+
var unifiedEventsWatcher = function* (options) {
|
|
2402
|
+
const {
|
|
2403
|
+
channels: { swEventChannel },
|
|
2404
|
+
instance
|
|
2405
|
+
} = options;
|
|
2406
|
+
(0, import_core27.getLogger)().debug("unifiedEventsWatcher started");
|
|
2407
|
+
function* worker(action) {
|
|
2408
|
+
yield import_core27.sagaEffects.fork(eventMapperWorker, __spreadProps(__spreadValues({}, options), {
|
|
2409
|
+
action,
|
|
2410
|
+
swEventChannel
|
|
2411
|
+
}));
|
|
2412
|
+
yield import_core27.sagaEffects.fork(debugEmitter, __spreadProps(__spreadValues({}, options), {
|
|
2413
|
+
action,
|
|
2414
|
+
instance
|
|
2415
|
+
}));
|
|
2416
|
+
}
|
|
2417
|
+
const isUnifiedEvent = (action) => action.type.startsWith("member") || action.type.startsWith("layout");
|
|
2418
|
+
while (true) {
|
|
2419
|
+
const action = yield import_core27.sagaEffects.take(swEventChannel, isUnifiedEvent);
|
|
2420
|
+
(0, import_core27.getLogger)().debug("UnifiedEventsWatcher action:", action);
|
|
2421
|
+
yield import_core27.sagaEffects.fork(worker, action);
|
|
2422
|
+
}
|
|
2423
|
+
(0, import_core27.getLogger)().trace("unifiedEventsWatcher ended");
|
|
2424
|
+
};
|
|
2425
|
+
|
|
2277
2426
|
// src/fabric/WSClient.ts
|
|
2278
2427
|
var WSClient = class {
|
|
2279
2428
|
constructor(options) {
|
|
2280
2429
|
this.options = options;
|
|
2281
2430
|
__publicField(this, "wsClient");
|
|
2282
|
-
__publicField(this, "logger", (0,
|
|
2431
|
+
__publicField(this, "logger", (0, import_core28.getLogger)());
|
|
2283
2432
|
this.wsClient = createClient({
|
|
2284
2433
|
host: this.options.host,
|
|
2285
2434
|
token: this.options.token,
|
|
2286
2435
|
debug: {
|
|
2287
2436
|
logWsTraffic: true
|
|
2288
2437
|
},
|
|
2289
|
-
logLevel: "debug"
|
|
2438
|
+
logLevel: "debug",
|
|
2439
|
+
unifiedEventing: true
|
|
2290
2440
|
});
|
|
2291
2441
|
}
|
|
2292
2442
|
connect() {
|
|
@@ -2313,7 +2463,9 @@ var WSClient = class {
|
|
|
2313
2463
|
stopMicrophoneWhileMuted: true,
|
|
2314
2464
|
destinationNumber: params.to,
|
|
2315
2465
|
watchMediaPackets: false,
|
|
2316
|
-
nodeId: params.nodeId
|
|
2466
|
+
nodeId: params.nodeId,
|
|
2467
|
+
eventsWatcher: unifiedEventsWatcher,
|
|
2468
|
+
disableUdpIceServers: this.options.disableUdpIceServers || false
|
|
2317
2469
|
});
|
|
2318
2470
|
call.once("destroy", () => {
|
|
2319
2471
|
this.logger.debug("RTC Connection Destroyed");
|
|
@@ -2329,14 +2481,14 @@ var WSClient = class {
|
|
|
2329
2481
|
call.once("room.subscribed", () => resolve2(call));
|
|
2330
2482
|
yield call.join();
|
|
2331
2483
|
} catch (error) {
|
|
2332
|
-
(0,
|
|
2484
|
+
(0, import_core28.getLogger)().error("WSClient call start", error);
|
|
2333
2485
|
reject2(error);
|
|
2334
2486
|
}
|
|
2335
2487
|
}));
|
|
2336
2488
|
};
|
|
2337
2489
|
resolve(call);
|
|
2338
2490
|
} catch (error) {
|
|
2339
|
-
(0,
|
|
2491
|
+
(0, import_core28.getLogger)().error("WSClient dial", error);
|
|
2340
2492
|
reject(error);
|
|
2341
2493
|
}
|
|
2342
2494
|
}));
|
|
@@ -2391,10 +2543,10 @@ var WSClient = class {
|
|
|
2391
2543
|
nodeId
|
|
2392
2544
|
});
|
|
2393
2545
|
call.once("destroy", () => {
|
|
2394
|
-
(0,
|
|
2546
|
+
(0, import_core28.getLogger)().debug("RTC Connection Destroyed");
|
|
2395
2547
|
});
|
|
2396
2548
|
call.attachPreConnectWorkers();
|
|
2397
|
-
(0,
|
|
2549
|
+
(0, import_core28.getLogger)().debug("Resolving Call", call);
|
|
2398
2550
|
resolve({ resultType: "inboundCall", resultObject: call });
|
|
2399
2551
|
} catch (error) {
|
|
2400
2552
|
reject(error);
|
|
@@ -2410,7 +2562,7 @@ var WSClient = class {
|
|
|
2410
2562
|
callID: callId,
|
|
2411
2563
|
node_id: nodeId,
|
|
2412
2564
|
subscribe: [],
|
|
2413
|
-
message: (0,
|
|
2565
|
+
message: (0, import_core28.VertoSubscribe)({
|
|
2414
2566
|
sessid: callId,
|
|
2415
2567
|
eventChannel: []
|
|
2416
2568
|
})
|
|
@@ -2454,13 +2606,23 @@ var HTTPClient = class {
|
|
|
2454
2606
|
}
|
|
2455
2607
|
return `fabric.${host.split(".").splice(1).join(".")}`;
|
|
2456
2608
|
}
|
|
2457
|
-
getAddresses() {
|
|
2609
|
+
getAddresses(options) {
|
|
2458
2610
|
return __async(this, null, function* () {
|
|
2459
|
-
const
|
|
2611
|
+
const { type, displayName } = options || {};
|
|
2612
|
+
let path = "/addresses";
|
|
2613
|
+
if (type || displayName) {
|
|
2614
|
+
const queryParams = new URLSearchParams();
|
|
2615
|
+
if (type) {
|
|
2616
|
+
queryParams.append("type", type);
|
|
2617
|
+
}
|
|
2618
|
+
if (displayName) {
|
|
2619
|
+
queryParams.append("display_name", displayName);
|
|
2620
|
+
}
|
|
2621
|
+
path += `?${queryParams.toString()}`;
|
|
2622
|
+
}
|
|
2460
2623
|
const { body } = yield this.httpClient(path);
|
|
2461
2624
|
const anotherPage = (url) => __async(this, null, function* () {
|
|
2462
|
-
const {
|
|
2463
|
-
const { body: body2 } = yield this.httpClient(`${path}${search}`);
|
|
2625
|
+
const { body: body2 } = yield this.httpClient(url);
|
|
2464
2626
|
return buildResult(body2);
|
|
2465
2627
|
});
|
|
2466
2628
|
const buildResult = (body2) => {
|
|
@@ -2473,7 +2635,13 @@ var HTTPClient = class {
|
|
|
2473
2635
|
prevPage: () => __async(this, null, function* () {
|
|
2474
2636
|
const { prev } = body2.links;
|
|
2475
2637
|
return prev ? anotherPage(prev) : void 0;
|
|
2476
|
-
})
|
|
2638
|
+
}),
|
|
2639
|
+
firstPage: () => __async(this, null, function* () {
|
|
2640
|
+
const { first } = body2.links;
|
|
2641
|
+
return first ? anotherPage(first) : void 0;
|
|
2642
|
+
}),
|
|
2643
|
+
hasNext: Boolean(body2.links.next),
|
|
2644
|
+
hasPrev: Boolean(body2.links.prev)
|
|
2477
2645
|
};
|
|
2478
2646
|
};
|
|
2479
2647
|
return buildResult(body);
|
|
@@ -2533,17 +2701,10 @@ var SignalWire = (options) => {
|
|
|
2533
2701
|
// src/chat/index.ts
|
|
2534
2702
|
var chat_exports = {};
|
|
2535
2703
|
__export(chat_exports, {
|
|
2536
|
-
ChatMember: () => ChatMember,
|
|
2537
|
-
ChatMessage: () => ChatMessage,
|
|
2704
|
+
ChatMember: () => import_core29.ChatMember,
|
|
2705
|
+
ChatMessage: () => import_core29.ChatMessage,
|
|
2538
2706
|
Client: () => Client3
|
|
2539
2707
|
});
|
|
2540
|
-
var import_core29 = require("@signalwire/core");
|
|
2541
|
-
|
|
2542
|
-
// src/utils/interfaces.ts
|
|
2543
|
-
var import_core28 = require("@signalwire/core");
|
|
2544
|
-
var INTERNAL_MEMBER_UPDATED_EVENTS = Object.keys(import_core28.INTERNAL_MEMBER_UPDATABLE_PROPS).map((key) => {
|
|
2545
|
-
return `member.updated.${key}`;
|
|
2546
|
-
});
|
|
2547
2708
|
|
|
2548
2709
|
// src/chat/Client.ts
|
|
2549
2710
|
var INTERCEPTED_METHODS = [
|
|
@@ -2581,8 +2742,7 @@ var Client3 = function(chatOptions) {
|
|
|
2581
2742
|
};
|
|
2582
2743
|
|
|
2583
2744
|
// src/chat/index.ts
|
|
2584
|
-
var
|
|
2585
|
-
var ChatMessage = import_core29.Chat.ChatMessage;
|
|
2745
|
+
var import_core29 = require("@signalwire/core");
|
|
2586
2746
|
|
|
2587
2747
|
// src/pubSub/index.ts
|
|
2588
2748
|
var pubSub_exports = {};
|
|
@@ -2590,7 +2750,13 @@ __export(pubSub_exports, {
|
|
|
2590
2750
|
Client: () => Client4,
|
|
2591
2751
|
PubSubMessage: () => PubSubMessage
|
|
2592
2752
|
});
|
|
2753
|
+
var import_core31 = require("@signalwire/core");
|
|
2754
|
+
|
|
2755
|
+
// src/utils/interfaces.ts
|
|
2593
2756
|
var import_core30 = require("@signalwire/core");
|
|
2757
|
+
var INTERNAL_MEMBER_UPDATED_EVENTS = Object.keys(import_core30.INTERNAL_MEMBER_UPDATABLE_PROPS).map((key) => {
|
|
2758
|
+
return `member.updated.${key}`;
|
|
2759
|
+
});
|
|
2594
2760
|
|
|
2595
2761
|
// src/pubSub/Client.ts
|
|
2596
2762
|
var INTERCEPTED_METHODS2 = [
|
|
@@ -2624,7 +2790,7 @@ var Client4 = function(pubSubOptions) {
|
|
|
2624
2790
|
};
|
|
2625
2791
|
|
|
2626
2792
|
// src/pubSub/index.ts
|
|
2627
|
-
var PubSubMessage =
|
|
2793
|
+
var PubSubMessage = import_core31.PubSub.PubSubMessage;
|
|
2628
2794
|
|
|
2629
2795
|
// src/webrtc.ts
|
|
2630
2796
|
var webrtc_exports = {};
|