aes70 2.0.1 → 2.0.3

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, error_callback) {
2722
+ constructor(callback, failure_callback) {
2713
2723
  this.callback = callback;
2714
- this.failure_callback = error_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.error_callback) {
2736
+ if (this.failure_callback) {
2727
2737
  try {
2728
- this.error_callback.call(ctx, error);
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, view];
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
 
@@ -6996,7 +7011,7 @@
6996
7011
  ['GetState', 3, 5, [], [OcaTaskManagerState]],
6997
7012
  ['GetTaskStatuses', 3, 6, [], [OcaTaskStatus]],
6998
7013
  ['GetTaskStatus', 3, 7, [OcaUint32], [OcaTaskStatus]],
6999
- ['AddTask', 3, 8, [], []],
7014
+ ['AddTask', 3, 8, [OcaTask], [OcaTask]],
7000
7015
  ['GetTasks', 3, 9, [], [OcaMap(OcaUint32, OcaTask)]],
7001
7016
  ['GetTask', 3, 10, [OcaUint32], [OcaTask]],
7002
7017
  ['SetTask', 3, 11, [OcaUint32, OcaTask], []],
@@ -7081,7 +7096,10 @@
7081
7096
  * successfully created.
7082
7097
  *
7083
7098
  * @method OcaTaskManager#AddTask
7084
- * @returns {Promise<void>}
7099
+ * @param {IOcaTask} Task
7100
+ *
7101
+ * @returns {Promise<OcaTask>}
7102
+ * A promise which resolves to a single value of type :class:`OcaTask`.
7085
7103
  */
7086
7104
  /**
7087
7105
  * Gets map of Tasks in the device. Return value indicates whether map was
@@ -20311,7 +20329,13 @@
20311
20329
  [OcaMediaSourceConnector, OcaMediaConnectorState],
20312
20330
  [],
20313
20331
  ],
20314
- ['AddSinkConnector', 3, 16, [OcaMediaConnectorStatus], []],
20332
+ [
20333
+ 'AddSinkConnector',
20334
+ 3,
20335
+ 16,
20336
+ [OcaMediaConnectorStatus, OcaMediaSinkConnector],
20337
+ [OcaMediaSinkConnector],
20338
+ ],
20315
20339
  ['ControlConnector', 3, 17, [OcaUint16, OcaMediaConnectorCommand], []],
20316
20340
  [
20317
20341
  'SetSourceConnectorPinMap',
@@ -20499,8 +20523,10 @@
20499
20523
  *
20500
20524
  * @method OcaMediaTransportNetwork#AddSinkConnector
20501
20525
  * @param {IOcaMediaConnectorStatus} InitialStatus
20526
+ * @param {IOcaMediaSinkConnector} Connector
20502
20527
  *
20503
- * @returns {Promise<void>}
20528
+ * @returns {Promise<OcaMediaSinkConnector>}
20529
+ * A promise which resolves to a single value of type :class:`OcaMediaSinkConnector`.
20504
20530
  */
20505
20531
  /**
20506
20532
  * Change the state of a given connector. Return status indicates the success of
@@ -23707,16 +23733,6 @@
23707
23733
  return await fetchDeviceContentRec(objects);
23708
23734
  }
23709
23735
 
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
23736
  /*
23721
23737
  * This file has been generated.
23722
23738
  */
@@ -24516,7 +24532,7 @@
24516
24532
  RemoteDevice: RemoteDevice,
24517
24533
  RemoteError: RemoteError,
24518
24534
  Response: Response$1,
24519
- TimeoutError: TimeoutError$1,
24535
+ TimeoutError: TimeoutError,
24520
24536
  Types: types,
24521
24537
  WebSocketConnection: WebSocketConnection,
24522
24538
  currentProtocolVersion: currentProtocolVersion,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aes70",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "description": "A controller library for the AES70 protocol.",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
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:
@@ -1,7 +1,10 @@
1
1
  import { OcaCounter } from '../../types/OcaCounter';
2
2
  import { OcaCounterSet } from '../../types/OcaCounterSet';
3
3
  import { IOcaIODirection } from '../../types/OcaIODirection';
4
- import { OcaMediaStreamEndpoint } from '../../types/OcaMediaStreamEndpoint';
4
+ import {
5
+ IOcaMediaStreamEndpoint,
6
+ OcaMediaStreamEndpoint,
7
+ } from '../../types/OcaMediaStreamEndpoint';
5
8
  import { IOcaMediaStreamEndpointCommand } from '../../types/OcaMediaStreamEndpointCommand';
6
9
  import { IOcaMediaStreamEndpointState } from '../../types/OcaMediaStreamEndpointState';
7
10
  import { OcaMediaStreamEndpointStatus } from '../../types/OcaMediaStreamEndpointStatus';
@@ -375,11 +378,16 @@ export declare class OcaMediaTransportApplication extends OcaNetworkApplication
375
378
  * property **AlignmentLevelLimits**.
376
379
  *
377
380
  * @method OcaMediaTransportApplication#AddEndpoint
381
+ * @param {IOcaMediaStreamEndpoint} Endpoint
378
382
  * @param {IOcaMediaStreamEndpointState} InitialStatus
379
383
  *
380
- * @returns {Promise<void>}
384
+ * @returns {Promise<OcaMediaStreamEndpoint>}
385
+ * A promise which resolves to a single value of type :class:`OcaMediaStreamEndpoint`.
381
386
  */
382
- AddEndpoint(InitialStatus: IOcaMediaStreamEndpointState): Promise<void>;
387
+ AddEndpoint(
388
+ Endpoint: IOcaMediaStreamEndpoint,
389
+ InitialStatus: IOcaMediaStreamEndpointState
390
+ ): Promise<OcaMediaStreamEndpoint>;
383
391
 
384
392
  /**
385
393
  * Deletes a stream endpoint from this media transport application object.
@@ -99,7 +99,13 @@ export const OcaMediaTransportApplication = make_control_class(
99
99
  [OcaMap(OcaUint32, OcaMediaStreamEndpointStatus)],
100
100
  ],
101
101
  ['GetEndpointStatus', 3, 24, [OcaUint32], [OcaMediaStreamEndpointStatus]],
102
- ['AddEndpoint', 3, 25, [OcaMediaStreamEndpointState], []],
102
+ [
103
+ 'AddEndpoint',
104
+ 3,
105
+ 25,
106
+ [OcaMediaStreamEndpoint, OcaMediaStreamEndpointState],
107
+ [OcaMediaStreamEndpoint],
108
+ ],
103
109
  ['DeleteEndpoint', 3, 26, [OcaUint32], []],
104
110
  [
105
111
  'ApplyEndpointCommand',
@@ -427,9 +433,11 @@ export const OcaMediaTransportApplication = make_control_class(
427
433
  * property **AlignmentLevelLimits**.
428
434
  *
429
435
  * @method OcaMediaTransportApplication#AddEndpoint
436
+ * @param {IOcaMediaStreamEndpoint} Endpoint
430
437
  * @param {IOcaMediaStreamEndpointState} InitialStatus
431
438
  *
432
- * @returns {Promise<void>}
439
+ * @returns {Promise<OcaMediaStreamEndpoint>}
440
+ * A promise which resolves to a single value of type :class:`OcaMediaStreamEndpoint`.
433
441
  */
434
442
  /**
435
443
  * Deletes a stream endpoint from this media transport application object.
@@ -6,7 +6,10 @@ import {
6
6
  IOcaMediaConnectorStatus,
7
7
  OcaMediaConnectorStatus,
8
8
  } from '../../types/OcaMediaConnectorStatus';
9
- import { OcaMediaSinkConnector } from '../../types/OcaMediaSinkConnector';
9
+ import {
10
+ IOcaMediaSinkConnector,
11
+ OcaMediaSinkConnector,
12
+ } from '../../types/OcaMediaSinkConnector';
10
13
  import {
11
14
  IOcaMediaSourceConnector,
12
15
  OcaMediaSourceConnector,
@@ -267,10 +270,15 @@ export declare class OcaMediaTransportNetwork extends OcaApplicationNetwork {
267
270
  *
268
271
  * @method OcaMediaTransportNetwork#AddSinkConnector
269
272
  * @param {IOcaMediaConnectorStatus} InitialStatus
273
+ * @param {IOcaMediaSinkConnector} Connector
270
274
  *
271
- * @returns {Promise<void>}
275
+ * @returns {Promise<OcaMediaSinkConnector>}
276
+ * A promise which resolves to a single value of type :class:`OcaMediaSinkConnector`.
272
277
  */
273
- AddSinkConnector(InitialStatus: IOcaMediaConnectorStatus): Promise<void>;
278
+ AddSinkConnector(
279
+ InitialStatus: IOcaMediaConnectorStatus,
280
+ Connector: IOcaMediaSinkConnector
281
+ ): Promise<OcaMediaSinkConnector>;
274
282
 
275
283
  /**
276
284
  * Change the state of a given connector. Return status indicates the success
@@ -51,7 +51,13 @@ export const OcaMediaTransportNetwork = make_control_class(
51
51
  [OcaMediaSourceConnector, OcaMediaConnectorState],
52
52
  [],
53
53
  ],
54
- ['AddSinkConnector', 3, 16, [OcaMediaConnectorStatus], []],
54
+ [
55
+ 'AddSinkConnector',
56
+ 3,
57
+ 16,
58
+ [OcaMediaConnectorStatus, OcaMediaSinkConnector],
59
+ [OcaMediaSinkConnector],
60
+ ],
55
61
  ['ControlConnector', 3, 17, [OcaUint16, OcaMediaConnectorCommand], []],
56
62
  [
57
63
  'SetSourceConnectorPinMap',
@@ -239,8 +245,10 @@ export const OcaMediaTransportNetwork = make_control_class(
239
245
  *
240
246
  * @method OcaMediaTransportNetwork#AddSinkConnector
241
247
  * @param {IOcaMediaConnectorStatus} InitialStatus
248
+ * @param {IOcaMediaSinkConnector} Connector
242
249
  *
243
- * @returns {Promise<void>}
250
+ * @returns {Promise<OcaMediaSinkConnector>}
251
+ * A promise which resolves to a single value of type :class:`OcaMediaSinkConnector`.
244
252
  */
245
253
  /**
246
254
  * Change the state of a given connector. Return status indicates the success of
@@ -1,4 +1,11 @@
1
- import { OcaMediaTransportSession } from '../../types/OcaMediaTransportSession';
1
+ import {
2
+ IOcaMediaTransportSession,
3
+ OcaMediaTransportSession,
4
+ } from '../../types/OcaMediaTransportSession';
5
+ import {
6
+ IOcaMediaTransportSessionConnection,
7
+ OcaMediaTransportSessionConnection,
8
+ } from '../../types/OcaMediaTransportSessionConnection';
2
9
  import { OcaMediaTransportSessionStatus } from '../../types/OcaMediaTransportSessionStatus';
3
10
  import { PropertyEvent } from '../property_event';
4
11
  import { RemoteDevice } from '../remote_device';
@@ -66,9 +73,14 @@ export declare class OcaMediaTransportSessionAgent extends OcaAgent {
66
73
  * with session ID filled in.
67
74
  *
68
75
  * @method OcaMediaTransportSessionAgent#AddSession
69
- * @returns {Promise<void>}
76
+ * @param {IOcaMediaTransportSession} Session
77
+ *
78
+ * @returns {Promise<OcaMediaTransportSession>}
79
+ * A promise which resolves to a single value of type :class:`OcaMediaTransportSession`.
70
80
  */
71
- AddSession(): Promise<void>;
81
+ AddSession(
82
+ Session: IOcaMediaTransportSession
83
+ ): Promise<OcaMediaTransportSession>;
72
84
 
73
85
  /**
74
86
  * Configures a session.
@@ -170,10 +182,15 @@ export declare class OcaMediaTransportSessionAgent extends OcaAgent {
170
182
  *
171
183
  * @method OcaMediaTransportSessionAgent#AddConnection
172
184
  * @param {number} SessionID
185
+ * @param {IOcaMediaTransportSessionConnection} Connection
173
186
  *
174
- * @returns {Promise<void>}
187
+ * @returns {Promise<OcaMediaTransportSessionConnection>}
188
+ * A promise which resolves to a single value of type :class:`OcaMediaTransportSessionConnection`.
175
189
  */
176
- AddConnection(SessionID: number): Promise<void>;
190
+ AddConnection(
191
+ SessionID: number,
192
+ Connection: IOcaMediaTransportSessionConnection
193
+ ): Promise<OcaMediaTransportSessionConnection>;
177
194
 
178
195
  /**
179
196
  * Configures a connection.
@@ -3,6 +3,7 @@ import { OcaBoolean } from '../../OCP1/OcaBoolean.js';
3
3
  import { OcaList } from '../../OCP1/OcaList.js';
4
4
  import { OcaMap } from '../../OCP1/OcaMap.js';
5
5
  import { OcaMediaTransportSession } from '../../OCP1/OcaMediaTransportSession.js';
6
+ import { OcaMediaTransportSessionConnection } from '../../OCP1/OcaMediaTransportSessionConnection.js';
6
7
  import { OcaMediaTransportSessionStatus } from '../../OCP1/OcaMediaTransportSessionStatus.js';
7
8
  import { OcaString } from '../../OCP1/OcaString.js';
8
9
  import { OcaUint32 } from '../../OCP1/OcaUint32.js';
@@ -27,7 +28,13 @@ export const OcaMediaTransportSessionAgent = make_control_class(
27
28
  ['GetSessionType', 3, 1, [], [OcaString]],
28
29
  ['GetSessions', 3, 2, [], [OcaList(OcaMediaTransportSession)]],
29
30
  ['GetSession', 3, 3, [OcaUint32], [OcaMediaTransportSession]],
30
- ['AddSession', 3, 4, [], []],
31
+ [
32
+ 'AddSession',
33
+ 3,
34
+ 4,
35
+ [OcaMediaTransportSession],
36
+ [OcaMediaTransportSession],
37
+ ],
31
38
  ['ConfigureSession', 3, 5, [OcaUint32, OcaBlob, OcaString, OcaBlob], []],
32
39
  ['DeleteSession', 3, 6, [OcaUint32], []],
33
40
  ['ResetSession', 3, 7, [OcaUint32], []],
@@ -42,7 +49,13 @@ export const OcaMediaTransportSessionAgent = make_control_class(
42
49
  [OcaMap(OcaUint32, OcaMediaTransportSessionStatus)],
43
50
  ],
44
51
  ['GetSessionStatus', 3, 12, [OcaUint32], [OcaMediaTransportSessionStatus]],
45
- ['AddConnection', 3, 13, [OcaUint32], []],
52
+ [
53
+ 'AddConnection',
54
+ 3,
55
+ 13,
56
+ [OcaUint32, OcaMediaTransportSessionConnection],
57
+ [OcaMediaTransportSessionConnection],
58
+ ],
46
59
  [
47
60
  'ConfigureConnection',
48
61
  3,
@@ -100,7 +113,10 @@ export const OcaMediaTransportSessionAgent = make_control_class(
100
113
  * session ID filled in.
101
114
  *
102
115
  * @method OcaMediaTransportSessionAgent#AddSession
103
- * @returns {Promise<void>}
116
+ * @param {IOcaMediaTransportSession} Session
117
+ *
118
+ * @returns {Promise<OcaMediaTransportSession>}
119
+ * A promise which resolves to a single value of type :class:`OcaMediaTransportSession`.
104
120
  */
105
121
  /**
106
122
  * Configures a session.
@@ -180,8 +196,10 @@ export const OcaMediaTransportSessionAgent = make_control_class(
180
196
  *
181
197
  * @method OcaMediaTransportSessionAgent#AddConnection
182
198
  * @param {number} SessionID
199
+ * @param {IOcaMediaTransportSessionConnection} Connection
183
200
  *
184
- * @returns {Promise<void>}
201
+ * @returns {Promise<OcaMediaTransportSessionConnection>}
202
+ * A promise which resolves to a single value of type :class:`OcaMediaTransportSessionConnection`.
185
203
  */
186
204
  /**
187
205
  * Configures a connection.
@@ -149,9 +149,12 @@ export declare class OcaTaskManager extends OcaManager {
149
149
  * successfully created.
150
150
  *
151
151
  * @method OcaTaskManager#AddTask
152
- * @returns {Promise<void>}
152
+ * @param {IOcaTask} Task
153
+ *
154
+ * @returns {Promise<OcaTask>}
155
+ * A promise which resolves to a single value of type :class:`OcaTask`.
153
156
  */
154
- AddTask(): Promise<void>;
157
+ AddTask(Task: IOcaTask): Promise<OcaTask>;
155
158
 
156
159
  /**
157
160
  * Gets map of Tasks in the device. Return value indicates whether map was
@@ -53,7 +53,7 @@ export const OcaTaskManager = make_control_class(
53
53
  ['GetState', 3, 5, [], [OcaTaskManagerState]],
54
54
  ['GetTaskStatuses', 3, 6, [], [OcaTaskStatus]],
55
55
  ['GetTaskStatus', 3, 7, [OcaUint32], [OcaTaskStatus]],
56
- ['AddTask', 3, 8, [], []],
56
+ ['AddTask', 3, 8, [OcaTask], [OcaTask]],
57
57
  ['GetTasks', 3, 9, [], [OcaMap(OcaUint32, OcaTask)]],
58
58
  ['GetTask', 3, 10, [OcaUint32], [OcaTask]],
59
59
  ['SetTask', 3, 11, [OcaUint32, OcaTask], []],
@@ -138,7 +138,10 @@ export const OcaTaskManager = make_control_class(
138
138
  * successfully created.
139
139
  *
140
140
  * @method OcaTaskManager#AddTask
141
- * @returns {Promise<void>}
141
+ * @param {IOcaTask} Task
142
+ *
143
+ * @returns {Promise<OcaTask>}
144
+ * A promise which resolves to a single value of type :class:`OcaTask`.
142
145
  */
143
146
  /**
144
147
  * Gets map of Tasks in the device. Return value indicates whether map was
@@ -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, error_callback) {
5
+ constructor(callback, failure_callback) {
6
6
  this.callback = callback;
7
- this.failure_callback = error_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.error_callback) {
19
+ if (this.failure_callback) {
20
20
  try {
21
- this.error_callback.call(ctx, error);
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
 
@@ -25,7 +25,7 @@ function parseNotificationExceptionData(buffer) {
25
25
  [pos, try_again] = OcaBoolean.decodeFrom(view, pos);
26
26
  [pos, data] = OcaBlob.decodeFrom(view, pos);
27
27
 
28
- return [type, try_again, view];
28
+ return [type, try_again, data];
29
29
  }
30
30
 
31
31
  /**