@bridgething/client 0.5.2 → 0.7.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.
|
@@ -177,6 +177,20 @@ export class AudioSurface {
|
|
|
177
177
|
handler(inner.data);
|
|
178
178
|
});
|
|
179
179
|
}
|
|
180
|
+
/** Subscribe to `Audio::ErrorEvent` from the daemon. */
|
|
181
|
+
onErrorEvent(handler) {
|
|
182
|
+
return this._client.on(event => {
|
|
183
|
+
if (event.type !== 'message')
|
|
184
|
+
return;
|
|
185
|
+
const data = event.message.data;
|
|
186
|
+
if (data.type !== 'audio')
|
|
187
|
+
return;
|
|
188
|
+
const inner = data.data;
|
|
189
|
+
if (inner.event !== 'errorEvent')
|
|
190
|
+
return;
|
|
191
|
+
handler(inner.data);
|
|
192
|
+
});
|
|
193
|
+
}
|
|
180
194
|
/** Exhaustive subscribe over all inbound `Audio` variants. */
|
|
181
195
|
subscribe(handlers) {
|
|
182
196
|
return this._subscribe(handlers, false);
|
|
@@ -206,6 +220,10 @@ export class AudioSurface {
|
|
|
206
220
|
handlers.volumeChanged?.(inner.data);
|
|
207
221
|
return;
|
|
208
222
|
}
|
|
223
|
+
case 'errorEvent': {
|
|
224
|
+
handlers.errorEvent?.(inner.data);
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
209
227
|
default: {
|
|
210
228
|
if (!partial)
|
|
211
229
|
this._client.logger.warn('Audio: no handler for inner', inner);
|
|
@@ -886,6 +904,20 @@ export class GeoSurface {
|
|
|
886
904
|
handler(inner.data);
|
|
887
905
|
});
|
|
888
906
|
}
|
|
907
|
+
/** Subscribe to `Geo::ErrorEvent` from the daemon. */
|
|
908
|
+
onErrorEvent(handler) {
|
|
909
|
+
return this._client.on(event => {
|
|
910
|
+
if (event.type !== 'message')
|
|
911
|
+
return;
|
|
912
|
+
const data = event.message.data;
|
|
913
|
+
if (data.type !== 'geo')
|
|
914
|
+
return;
|
|
915
|
+
const inner = data.data;
|
|
916
|
+
if (inner.event !== 'errorEvent')
|
|
917
|
+
return;
|
|
918
|
+
handler(inner.data);
|
|
919
|
+
});
|
|
920
|
+
}
|
|
889
921
|
/** Subscribe to `Geo::WatchReply` from the daemon. */
|
|
890
922
|
onWatchReply(handler) {
|
|
891
923
|
return this._client.on(event => {
|
|
@@ -949,6 +981,10 @@ export class GeoSurface {
|
|
|
949
981
|
handlers.position?.(inner.data);
|
|
950
982
|
return;
|
|
951
983
|
}
|
|
984
|
+
case 'errorEvent': {
|
|
985
|
+
handlers.errorEvent?.(inner.data);
|
|
986
|
+
return;
|
|
987
|
+
}
|
|
952
988
|
case 'watchReply': {
|
|
953
989
|
handlers.watchReply?.(inner.data);
|
|
954
990
|
return;
|
|
@@ -1217,8 +1253,8 @@ export class LibrarySurface {
|
|
|
1217
1253
|
handler(inner.data);
|
|
1218
1254
|
});
|
|
1219
1255
|
}
|
|
1220
|
-
/** Subscribe to `Library::
|
|
1221
|
-
|
|
1256
|
+
/** Subscribe to `Library::ErrorReply` from the daemon. */
|
|
1257
|
+
onErrorReply(handler) {
|
|
1222
1258
|
return this._client.on(event => {
|
|
1223
1259
|
if (event.type !== 'message')
|
|
1224
1260
|
return;
|
|
@@ -1226,7 +1262,7 @@ export class LibrarySurface {
|
|
|
1226
1262
|
if (data.type !== 'library')
|
|
1227
1263
|
return;
|
|
1228
1264
|
const inner = data.data;
|
|
1229
|
-
if (inner.event !== '
|
|
1265
|
+
if (inner.event !== 'errorReply')
|
|
1230
1266
|
return;
|
|
1231
1267
|
handler(inner.data);
|
|
1232
1268
|
});
|
|
@@ -1245,6 +1281,20 @@ export class LibrarySurface {
|
|
|
1245
1281
|
handler(inner.data);
|
|
1246
1282
|
});
|
|
1247
1283
|
}
|
|
1284
|
+
/** Subscribe to `Library::ErrorEvent` from the daemon. */
|
|
1285
|
+
onErrorEvent(handler) {
|
|
1286
|
+
return this._client.on(event => {
|
|
1287
|
+
if (event.type !== 'message')
|
|
1288
|
+
return;
|
|
1289
|
+
const data = event.message.data;
|
|
1290
|
+
if (data.type !== 'library')
|
|
1291
|
+
return;
|
|
1292
|
+
const inner = data.data;
|
|
1293
|
+
if (inner.event !== 'errorEvent')
|
|
1294
|
+
return;
|
|
1295
|
+
handler(inner.data);
|
|
1296
|
+
});
|
|
1297
|
+
}
|
|
1248
1298
|
/** Exhaustive subscribe over all inbound `Library` variants. */
|
|
1249
1299
|
subscribe(handlers) {
|
|
1250
1300
|
return this._subscribe(handlers, false);
|
|
@@ -1286,14 +1336,18 @@ export class LibrarySurface {
|
|
|
1286
1336
|
handlers.favoritesContainsReply?.(inner.data);
|
|
1287
1337
|
return;
|
|
1288
1338
|
}
|
|
1289
|
-
case '
|
|
1290
|
-
handlers.
|
|
1339
|
+
case 'errorReply': {
|
|
1340
|
+
handlers.errorReply?.(inner.data);
|
|
1291
1341
|
return;
|
|
1292
1342
|
}
|
|
1293
1343
|
case 'favoriteChanged': {
|
|
1294
1344
|
handlers.favoriteChanged?.(inner.data);
|
|
1295
1345
|
return;
|
|
1296
1346
|
}
|
|
1347
|
+
case 'errorEvent': {
|
|
1348
|
+
handlers.errorEvent?.(inner.data);
|
|
1349
|
+
return;
|
|
1350
|
+
}
|
|
1297
1351
|
default: {
|
|
1298
1352
|
if (!partial)
|
|
1299
1353
|
this._client.logger.warn('Library: no handler for inner', inner);
|
|
@@ -1338,7 +1392,7 @@ export class LibrarySurface {
|
|
|
1338
1392
|
const inner = d.data;
|
|
1339
1393
|
if (inner.event === 'browseReply')
|
|
1340
1394
|
return { ok: true, response: inner.data };
|
|
1341
|
-
if (inner.event === '
|
|
1395
|
+
if (inner.event === 'errorReply')
|
|
1342
1396
|
return { ok: false, kind: 'domain', error: inner.data };
|
|
1343
1397
|
}
|
|
1344
1398
|
if (d.type === 'error')
|
|
@@ -1354,7 +1408,7 @@ export class LibrarySurface {
|
|
|
1354
1408
|
const inner = d.data;
|
|
1355
1409
|
if (inner.event === 'searchReply')
|
|
1356
1410
|
return { ok: true, response: inner.data };
|
|
1357
|
-
if (inner.event === '
|
|
1411
|
+
if (inner.event === 'errorReply')
|
|
1358
1412
|
return { ok: false, kind: 'domain', error: inner.data };
|
|
1359
1413
|
}
|
|
1360
1414
|
if (d.type === 'error')
|
|
@@ -1370,7 +1424,7 @@ export class LibrarySurface {
|
|
|
1370
1424
|
const inner = d.data;
|
|
1371
1425
|
if (inner.event === 'recommendationsReply')
|
|
1372
1426
|
return { ok: true, response: inner.data };
|
|
1373
|
-
if (inner.event === '
|
|
1427
|
+
if (inner.event === 'errorReply')
|
|
1374
1428
|
return { ok: false, kind: 'domain', error: inner.data };
|
|
1375
1429
|
}
|
|
1376
1430
|
if (d.type === 'error')
|
|
@@ -1386,7 +1440,7 @@ export class LibrarySurface {
|
|
|
1386
1440
|
const inner = d.data;
|
|
1387
1441
|
if (inner.event === 'resolveContextReply')
|
|
1388
1442
|
return { ok: true, response: inner.data };
|
|
1389
|
-
if (inner.event === '
|
|
1443
|
+
if (inner.event === 'errorReply')
|
|
1390
1444
|
return { ok: false, kind: 'domain', error: inner.data };
|
|
1391
1445
|
}
|
|
1392
1446
|
if (d.type === 'error')
|
|
@@ -1402,7 +1456,7 @@ export class LibrarySurface {
|
|
|
1402
1456
|
const inner = d.data;
|
|
1403
1457
|
if (inner.event === 'favoritesListReply')
|
|
1404
1458
|
return { ok: true, response: inner.data };
|
|
1405
|
-
if (inner.event === '
|
|
1459
|
+
if (inner.event === 'errorReply')
|
|
1406
1460
|
return { ok: false, kind: 'domain', error: inner.data };
|
|
1407
1461
|
}
|
|
1408
1462
|
if (d.type === 'error')
|
|
@@ -1418,7 +1472,7 @@ export class LibrarySurface {
|
|
|
1418
1472
|
const inner = d.data;
|
|
1419
1473
|
if (inner.event === 'favoritesContainsReply')
|
|
1420
1474
|
return { ok: true, response: inner.data };
|
|
1421
|
-
if (inner.event === '
|
|
1475
|
+
if (inner.event === 'errorReply')
|
|
1422
1476
|
return { ok: false, kind: 'domain', error: inner.data };
|
|
1423
1477
|
}
|
|
1424
1478
|
if (d.type === 'error')
|
|
@@ -1770,6 +1824,20 @@ export class NotificationsSurface {
|
|
|
1770
1824
|
handler(inner.data);
|
|
1771
1825
|
});
|
|
1772
1826
|
}
|
|
1827
|
+
/** Subscribe to `Notifications::ErrorEvent` from the daemon. */
|
|
1828
|
+
onErrorEvent(handler) {
|
|
1829
|
+
return this._client.on(event => {
|
|
1830
|
+
if (event.type !== 'message')
|
|
1831
|
+
return;
|
|
1832
|
+
const data = event.message.data;
|
|
1833
|
+
if (data.type !== 'notifications')
|
|
1834
|
+
return;
|
|
1835
|
+
const inner = data.data;
|
|
1836
|
+
if (inner.event !== 'errorEvent')
|
|
1837
|
+
return;
|
|
1838
|
+
handler(inner.data);
|
|
1839
|
+
});
|
|
1840
|
+
}
|
|
1773
1841
|
/** Exhaustive subscribe over all inbound `Notifications` variants. */
|
|
1774
1842
|
subscribe(handlers) {
|
|
1775
1843
|
return this._subscribe(handlers, false);
|
|
@@ -1799,6 +1867,10 @@ export class NotificationsSurface {
|
|
|
1799
1867
|
handlers.removed?.(inner.data);
|
|
1800
1868
|
return;
|
|
1801
1869
|
}
|
|
1870
|
+
case 'errorEvent': {
|
|
1871
|
+
handlers.errorEvent?.(inner.data);
|
|
1872
|
+
return;
|
|
1873
|
+
}
|
|
1802
1874
|
default: {
|
|
1803
1875
|
if (!partial)
|
|
1804
1876
|
this._client.logger.warn('Notifications: no handler for inner', inner);
|
|
@@ -1907,6 +1979,20 @@ export class PhoneSurface {
|
|
|
1907
1979
|
handler(inner.data);
|
|
1908
1980
|
});
|
|
1909
1981
|
}
|
|
1982
|
+
/** Subscribe to `Phone::ErrorEvent` from the daemon. */
|
|
1983
|
+
onErrorEvent(handler) {
|
|
1984
|
+
return this._client.on(event => {
|
|
1985
|
+
if (event.type !== 'message')
|
|
1986
|
+
return;
|
|
1987
|
+
const data = event.message.data;
|
|
1988
|
+
if (data.type !== 'phone')
|
|
1989
|
+
return;
|
|
1990
|
+
const inner = data.data;
|
|
1991
|
+
if (inner.event !== 'errorEvent')
|
|
1992
|
+
return;
|
|
1993
|
+
handler(inner.data);
|
|
1994
|
+
});
|
|
1995
|
+
}
|
|
1910
1996
|
/** Subscribe to `Phone::StateReply` from the daemon. */
|
|
1911
1997
|
onStateReply(handler) {
|
|
1912
1998
|
return this._client.on(event => {
|
|
@@ -1968,6 +2054,10 @@ export class PhoneSurface {
|
|
|
1968
2054
|
handlers.communicationsChanged?.(inner.data);
|
|
1969
2055
|
return;
|
|
1970
2056
|
}
|
|
2057
|
+
case 'errorEvent': {
|
|
2058
|
+
handlers.errorEvent?.(inner.data);
|
|
2059
|
+
return;
|
|
2060
|
+
}
|
|
1971
2061
|
case 'stateReply': {
|
|
1972
2062
|
handlers.stateReply?.(inner.data);
|
|
1973
2063
|
return;
|
|
@@ -2196,6 +2286,20 @@ export class PlayerSurface {
|
|
|
2196
2286
|
handler(inner.data);
|
|
2197
2287
|
});
|
|
2198
2288
|
}
|
|
2289
|
+
/** Subscribe to `Player::ErrorEvent` from the daemon. */
|
|
2290
|
+
onErrorEvent(handler) {
|
|
2291
|
+
return this._client.on(event => {
|
|
2292
|
+
if (event.type !== 'message')
|
|
2293
|
+
return;
|
|
2294
|
+
const data = event.message.data;
|
|
2295
|
+
if (data.type !== 'player')
|
|
2296
|
+
return;
|
|
2297
|
+
const inner = data.data;
|
|
2298
|
+
if (inner.event !== 'errorEvent')
|
|
2299
|
+
return;
|
|
2300
|
+
handler(inner.data);
|
|
2301
|
+
});
|
|
2302
|
+
}
|
|
2199
2303
|
/** Subscribe to `Player::TargetsReply` from the daemon. */
|
|
2200
2304
|
onTargetsReply(handler) {
|
|
2201
2305
|
return this._client.on(event => {
|
|
@@ -2265,6 +2369,10 @@ export class PlayerSurface {
|
|
|
2265
2369
|
handlers.queueReply?.(inner.data);
|
|
2266
2370
|
return;
|
|
2267
2371
|
}
|
|
2372
|
+
case 'errorEvent': {
|
|
2373
|
+
handlers.errorEvent?.(inner.data);
|
|
2374
|
+
return;
|
|
2375
|
+
}
|
|
2268
2376
|
case 'targetsReply': {
|
|
2269
2377
|
handlers.targetsReply?.(inner.data);
|
|
2270
2378
|
return;
|
|
@@ -2544,6 +2652,20 @@ export class SystemSurface {
|
|
|
2544
2652
|
handler(inner.data);
|
|
2545
2653
|
});
|
|
2546
2654
|
}
|
|
2655
|
+
/** Subscribe to `System::OtaFinished` from the daemon. */
|
|
2656
|
+
onOtaFinished(handler) {
|
|
2657
|
+
return this._client.on(event => {
|
|
2658
|
+
if (event.type !== 'message')
|
|
2659
|
+
return;
|
|
2660
|
+
const data = event.message.data;
|
|
2661
|
+
if (data.type !== 'system')
|
|
2662
|
+
return;
|
|
2663
|
+
const inner = data.data;
|
|
2664
|
+
if (inner.event !== 'otaFinished')
|
|
2665
|
+
return;
|
|
2666
|
+
handler(inner.data);
|
|
2667
|
+
});
|
|
2668
|
+
}
|
|
2547
2669
|
/** Subscribe to `System::DeviceNickname` from the daemon. */
|
|
2548
2670
|
onDeviceNickname(handler) {
|
|
2549
2671
|
return this._client.on(event => {
|
|
@@ -2617,6 +2739,10 @@ export class SystemSurface {
|
|
|
2617
2739
|
handlers.otaError?.(inner.data);
|
|
2618
2740
|
return;
|
|
2619
2741
|
}
|
|
2742
|
+
case 'otaFinished': {
|
|
2743
|
+
handlers.otaFinished?.(inner.data);
|
|
2744
|
+
return;
|
|
2745
|
+
}
|
|
2620
2746
|
case 'deviceNickname': {
|
|
2621
2747
|
handlers.deviceNickname?.(inner.data);
|
|
2622
2748
|
return;
|
|
@@ -3621,6 +3747,10 @@ function outerSubscribe(c, handlers, partial) {
|
|
|
3621
3747
|
innerHandlers.volumeChanged?.(inner.data);
|
|
3622
3748
|
return;
|
|
3623
3749
|
}
|
|
3750
|
+
case 'errorEvent': {
|
|
3751
|
+
innerHandlers.errorEvent?.(inner.data);
|
|
3752
|
+
return;
|
|
3753
|
+
}
|
|
3624
3754
|
default: {
|
|
3625
3755
|
if (!partial)
|
|
3626
3756
|
c.logger.warn('Audio: no handler for inner', inner);
|
|
@@ -3769,6 +3899,10 @@ function outerSubscribe(c, handlers, partial) {
|
|
|
3769
3899
|
innerHandlers.position?.(inner.data);
|
|
3770
3900
|
return;
|
|
3771
3901
|
}
|
|
3902
|
+
case 'errorEvent': {
|
|
3903
|
+
innerHandlers.errorEvent?.(inner.data);
|
|
3904
|
+
return;
|
|
3905
|
+
}
|
|
3772
3906
|
case 'watchReply': {
|
|
3773
3907
|
innerHandlers.watchReply?.(inner.data);
|
|
3774
3908
|
return;
|
|
@@ -3849,14 +3983,18 @@ function outerSubscribe(c, handlers, partial) {
|
|
|
3849
3983
|
innerHandlers.favoritesContainsReply?.(inner.data);
|
|
3850
3984
|
return;
|
|
3851
3985
|
}
|
|
3852
|
-
case '
|
|
3853
|
-
innerHandlers.
|
|
3986
|
+
case 'errorReply': {
|
|
3987
|
+
innerHandlers.errorReply?.(inner.data);
|
|
3854
3988
|
return;
|
|
3855
3989
|
}
|
|
3856
3990
|
case 'favoriteChanged': {
|
|
3857
3991
|
innerHandlers.favoriteChanged?.(inner.data);
|
|
3858
3992
|
return;
|
|
3859
3993
|
}
|
|
3994
|
+
case 'errorEvent': {
|
|
3995
|
+
innerHandlers.errorEvent?.(inner.data);
|
|
3996
|
+
return;
|
|
3997
|
+
}
|
|
3860
3998
|
default: {
|
|
3861
3999
|
if (!partial)
|
|
3862
4000
|
c.logger.warn('Library: no handler for inner', inner);
|
|
@@ -3945,6 +4083,10 @@ function outerSubscribe(c, handlers, partial) {
|
|
|
3945
4083
|
innerHandlers.removed?.(inner.data);
|
|
3946
4084
|
return;
|
|
3947
4085
|
}
|
|
4086
|
+
case 'errorEvent': {
|
|
4087
|
+
innerHandlers.errorEvent?.(inner.data);
|
|
4088
|
+
return;
|
|
4089
|
+
}
|
|
3948
4090
|
default: {
|
|
3949
4091
|
if (!partial)
|
|
3950
4092
|
c.logger.warn('Notifications: no handler for inner', inner);
|
|
@@ -3987,6 +4129,10 @@ function outerSubscribe(c, handlers, partial) {
|
|
|
3987
4129
|
innerHandlers.communicationsChanged?.(inner.data);
|
|
3988
4130
|
return;
|
|
3989
4131
|
}
|
|
4132
|
+
case 'errorEvent': {
|
|
4133
|
+
innerHandlers.errorEvent?.(inner.data);
|
|
4134
|
+
return;
|
|
4135
|
+
}
|
|
3990
4136
|
case 'stateReply': {
|
|
3991
4137
|
innerHandlers.stateReply?.(inner.data);
|
|
3992
4138
|
return;
|
|
@@ -4035,6 +4181,10 @@ function outerSubscribe(c, handlers, partial) {
|
|
|
4035
4181
|
innerHandlers.queueReply?.(inner.data);
|
|
4036
4182
|
return;
|
|
4037
4183
|
}
|
|
4184
|
+
case 'errorEvent': {
|
|
4185
|
+
innerHandlers.errorEvent?.(inner.data);
|
|
4186
|
+
return;
|
|
4187
|
+
}
|
|
4038
4188
|
case 'targetsReply': {
|
|
4039
4189
|
innerHandlers.targetsReply?.(inner.data);
|
|
4040
4190
|
return;
|
|
@@ -4087,6 +4237,10 @@ function outerSubscribe(c, handlers, partial) {
|
|
|
4087
4237
|
innerHandlers.otaError?.(inner.data);
|
|
4088
4238
|
return;
|
|
4089
4239
|
}
|
|
4240
|
+
case 'otaFinished': {
|
|
4241
|
+
innerHandlers.otaFinished?.(inner.data);
|
|
4242
|
+
return;
|
|
4243
|
+
}
|
|
4090
4244
|
case 'deviceNickname': {
|
|
4091
4245
|
innerHandlers.deviceNickname?.(inner.data);
|
|
4092
4246
|
return;
|