aes70 2.0.1 → 2.0.2
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/AES70.es5.js
CHANGED
|
@@ -993,6 +993,16 @@
|
|
|
993
993
|
}
|
|
994
994
|
}
|
|
995
995
|
|
|
996
|
+
/**
|
|
997
|
+
* Error class raised when a connection is closed due to a timeout.
|
|
998
|
+
*/
|
|
999
|
+
class TimeoutError extends Error {
|
|
1000
|
+
constructor(error) {
|
|
1001
|
+
super(`Connection has timed out.`);
|
|
1002
|
+
this.name = 'aes70.TimeoutError';
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
|
|
996
1006
|
/**
|
|
997
1007
|
* Connection base class. It extends :class:`Events` and defines two events:
|
|
998
1008
|
*
|
|
@@ -2709,9 +2719,9 @@
|
|
|
2709
2719
|
const OcaResetCause = Enum8(OcaResetCause$1);
|
|
2710
2720
|
|
|
2711
2721
|
class EventSubscriber {
|
|
2712
|
-
constructor(callback,
|
|
2722
|
+
constructor(callback, failure_callback) {
|
|
2713
2723
|
this.callback = callback;
|
|
2714
|
-
this.failure_callback =
|
|
2724
|
+
this.failure_callback = failure_callback;
|
|
2715
2725
|
}
|
|
2716
2726
|
|
|
2717
2727
|
emit(ctx, results) {
|
|
@@ -2723,9 +2733,9 @@
|
|
|
2723
2733
|
}
|
|
2724
2734
|
|
|
2725
2735
|
emit_error(ctx, error) {
|
|
2726
|
-
if (this.
|
|
2736
|
+
if (this.failure_callback) {
|
|
2727
2737
|
try {
|
|
2728
|
-
this.
|
|
2738
|
+
this.failure_callback.call(ctx, error);
|
|
2729
2739
|
} catch (e) {
|
|
2730
2740
|
console.error('Exception thrown by error event handler: ', e);
|
|
2731
2741
|
}
|
|
@@ -2838,7 +2848,7 @@
|
|
|
2838
2848
|
[pos, try_again] = OcaBoolean.decodeFrom(view, pos);
|
|
2839
2849
|
[pos, data] = OcaBlob.decodeFrom(view, pos);
|
|
2840
2850
|
|
|
2841
|
-
return [type, try_again,
|
|
2851
|
+
return [type, try_again, data];
|
|
2842
2852
|
}
|
|
2843
2853
|
|
|
2844
2854
|
/**
|
|
@@ -3580,6 +3590,11 @@
|
|
|
3580
3590
|
if (has_setter) descriptor.set = make_setter(prop.setter(blue_print, true));
|
|
3581
3591
|
|
|
3582
3592
|
Object.defineProperty(o, prop.name, descriptor);
|
|
3593
|
+
if (prop.aliases) {
|
|
3594
|
+
prop.aliases.forEach((alias) => {
|
|
3595
|
+
Object.defineProperty(o, alias, descriptor);
|
|
3596
|
+
});
|
|
3597
|
+
}
|
|
3583
3598
|
index++;
|
|
3584
3599
|
});
|
|
3585
3600
|
|
|
@@ -23707,16 +23722,6 @@
|
|
|
23707
23722
|
return await fetchDeviceContentRec(objects);
|
|
23708
23723
|
}
|
|
23709
23724
|
|
|
23710
|
-
/**
|
|
23711
|
-
* Error class raised when a connection is closed due to a timeout.
|
|
23712
|
-
*/
|
|
23713
|
-
let TimeoutError$1 = class TimeoutError extends Error {
|
|
23714
|
-
constructor(error) {
|
|
23715
|
-
super(`Connection has timed out.`);
|
|
23716
|
-
this.name = 'aes70.TimeoutError';
|
|
23717
|
-
}
|
|
23718
|
-
};
|
|
23719
|
-
|
|
23720
23725
|
/*
|
|
23721
23726
|
* This file has been generated.
|
|
23722
23727
|
*/
|
|
@@ -24516,7 +24521,7 @@
|
|
|
24516
24521
|
RemoteDevice: RemoteDevice,
|
|
24517
24522
|
RemoteError: RemoteError,
|
|
24518
24523
|
Response: Response$1,
|
|
24519
|
-
TimeoutError: TimeoutError
|
|
24524
|
+
TimeoutError: TimeoutError,
|
|
24520
24525
|
Types: types,
|
|
24521
24526
|
WebSocketConnection: WebSocketConnection,
|
|
24522
24527
|
currentProtocolVersion: currentProtocolVersion,
|
package/package.json
CHANGED
package/src/connection.js
CHANGED
|
@@ -2,6 +2,7 @@ import { Events } from './events.js';
|
|
|
2
2
|
import { decodeMessage } from './OCP1/decode_message.js';
|
|
3
3
|
import { KeepAlive } from './OCP1/keepalive.js';
|
|
4
4
|
import { MessageGenerator } from './OCP1/message_generator.js';
|
|
5
|
+
import { TimeoutError } from './timeout_error.js';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Connection base class. It extends :class:`Events` and defines two events:
|
|
@@ -2,9 +2,9 @@ import { CloseError } from '../close_error.js';
|
|
|
2
2
|
import { OcaEvent } from '../types/OcaEvent.js';
|
|
3
3
|
|
|
4
4
|
class EventSubscriber {
|
|
5
|
-
constructor(callback,
|
|
5
|
+
constructor(callback, failure_callback) {
|
|
6
6
|
this.callback = callback;
|
|
7
|
-
this.failure_callback =
|
|
7
|
+
this.failure_callback = failure_callback;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
emit(ctx, results) {
|
|
@@ -16,9 +16,9 @@ class EventSubscriber {
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
emit_error(ctx, error) {
|
|
19
|
-
if (this.
|
|
19
|
+
if (this.failure_callback) {
|
|
20
20
|
try {
|
|
21
|
-
this.
|
|
21
|
+
this.failure_callback.call(ctx, error);
|
|
22
22
|
} catch (e) {
|
|
23
23
|
console.error('Exception thrown by error event handler: ', e);
|
|
24
24
|
}
|
|
@@ -42,6 +42,11 @@ function createPropertySync(control_class) {
|
|
|
42
42
|
if (has_setter) descriptor.set = make_setter(prop.setter(blue_print, true));
|
|
43
43
|
|
|
44
44
|
Object.defineProperty(o, prop.name, descriptor);
|
|
45
|
+
if (prop.aliases) {
|
|
46
|
+
prop.aliases.forEach((alias) => {
|
|
47
|
+
Object.defineProperty(o, alias, descriptor);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
45
50
|
index++;
|
|
46
51
|
});
|
|
47
52
|
|