@placeos/ts-client 4.7.6 → 4.7.9

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.
@@ -1,3 +1,4 @@
1
+ import { AlertSeverity } from '../alerts/alert';
1
2
  import { PlaceDriver } from '../drivers/driver';
2
3
  import { PlaceDriverRole } from '../drivers/enums';
3
4
  import { PlaceResource } from '../resources/resource';
@@ -62,6 +63,8 @@ export declare class PlaceModule extends PlaceResource {
62
63
  readonly has_runtime_error: boolean;
63
64
  /** Timestamp of the last runtime error in ms since UTC epoch */
64
65
  readonly error_timestamp: number;
66
+ /** */
67
+ readonly alert_level: AlertSeverity;
65
68
  /** ID of the system associated with the module */
66
69
  get system_id(): string;
67
70
  constructor(raw_data?: PlaceModuleComplete);
@@ -37,8 +37,8 @@ export declare class PlaceSystem extends PlaceResource {
37
37
  readonly support_url: string;
38
38
  /** URL for the timetable UI linked to the system */
39
39
  readonly timetable_url: string;
40
- /** URL for requesting snapshots of the assosiated camera */
41
- readonly camera_snapshot_url: string;
40
+ /** URLs for requesting snapshots of the assosiated camera */
41
+ readonly camera_snapshot_urls: string[];
42
42
  /** URL for managing the attached camera */
43
43
  readonly camera_url: string;
44
44
  /** External booking URL for the system */
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "4.7.6",
2
+ "version": "4.7.9",
3
3
  "license": "MIT",
4
4
  "name": "@placeos/ts-client",
5
5
  "author": "Alex Sorafumo <alex@place.tech>",
@@ -159,10 +159,12 @@ export function token(return_expired: boolean = true): string {
159
159
  _failed_count += 1;
160
160
  timeout(
161
161
  're-authorise',
162
- () =>
163
- authorise().catch((e) =>
162
+ async () => {
163
+ delete _promises.authorise;
164
+ await authorise().catch((e) =>
164
165
  log('Auth', `Failed to get token: ${e}`),
165
- ),
166
+ );
167
+ },
166
168
  200 * Math.min(20, _failed_count),
167
169
  );
168
170
  }
@@ -1,3 +1,4 @@
1
+ import { AlertSeverity } from '../alerts/alert';
1
2
  import { PlaceResource } from '../resources/resource';
2
3
  import { EncryptionLevel } from '../settings/interfaces';
3
4
  import { PlaceSettings } from '../settings/settings';
@@ -32,6 +33,8 @@ export class PlaceDriver extends PlaceResource {
32
33
  author: string;
33
34
  date: string;
34
35
  };
36
+ /** */
37
+ public readonly alert_level: AlertSeverity;
35
38
  /** Tuple of user settings of differring encryption levels for the driver */
36
39
  public readonly settings: [
37
40
  PlaceSettings | null,
@@ -54,6 +57,7 @@ export class PlaceDriver extends PlaceResource {
54
57
  this.commit = raw_data.commit || '';
55
58
  this.update_available = raw_data.update_available || false;
56
59
  this.update_info = raw_data.update_info;
60
+ this.alert_level = raw_data.alert_level || 'medium';
57
61
  this.settings = raw_data.settings || [null, null, null, null];
58
62
  if (typeof this.settings !== 'object') {
59
63
  (this as any).settings = [null, null, null, null];
@@ -1,3 +1,4 @@
1
+ import { AlertSeverity } from '../alerts/alert';
1
2
  import { PlaceDriver } from '../drivers/driver';
2
3
  import { PlaceDriverRole } from '../drivers/enums';
3
4
  import { PlaceResource } from '../resources/resource';
@@ -66,6 +67,8 @@ export class PlaceModule extends PlaceResource {
66
67
  public readonly has_runtime_error: boolean;
67
68
  /** Timestamp of the last runtime error in ms since UTC epoch */
68
69
  public readonly error_timestamp: number;
70
+ /** */
71
+ public readonly alert_level: AlertSeverity;
69
72
  /** ID of the system associated with the module */
70
73
  public get system_id(): string {
71
74
  return this.control_system_id;
@@ -96,6 +99,7 @@ export class PlaceModule extends PlaceResource {
96
99
  this.error_timestamp = raw_data.error_timestamp || 0;
97
100
  this.driver = new PlaceDriver(raw_data.dependency || raw_data.driver);
98
101
  this.settings = raw_data.settings || [null, null, null, null];
102
+ this.alert_level = raw_data.alert_level || 'medium';
99
103
  if (typeof this.settings !== 'object') {
100
104
  (this as any).settings = [null, null, null, null];
101
105
  }
@@ -40,8 +40,8 @@ export class PlaceSystem extends PlaceResource {
40
40
  public readonly support_url: string;
41
41
  /** URL for the timetable UI linked to the system */
42
42
  public readonly timetable_url: string;
43
- /** URL for requesting snapshots of the assosiated camera */
44
- public readonly camera_snapshot_url: string;
43
+ /** URLs for requesting snapshots of the assosiated camera */
44
+ public readonly camera_snapshot_urls: string[];
45
45
  /** URL for managing the attached camera */
46
46
  public readonly camera_url: string;
47
47
  /** External booking URL for the system */
@@ -85,7 +85,7 @@ export class PlaceSystem extends PlaceResource {
85
85
  this.public = raw_data.public ?? false;
86
86
  this.installed_ui_devices = raw_data.installed_ui_devices || 0;
87
87
  this.support_url = raw_data.support_url || '';
88
- this.camera_snapshot_url = raw_data.camera_snapshot_url || '';
88
+ this.camera_snapshot_urls = raw_data.camera_snapshot_urls || [];
89
89
  this.camera_url = raw_data.camera_url || '';
90
90
  this.timetable_url = raw_data.timetable_url || '';
91
91
  this.room_booking_url = raw_data.room_booking_url || '';