@formant/data-sdk 1.81.6 → 1.81.8

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.
@@ -25597,8 +25597,21 @@ class BaseDevice extends EventEmitter {
25597
25597
  }
25598
25598
  }
25599
25599
  class Device extends BaseDevice {
25600
- constructor(t, n, r, o) {
25601
- super(), this.id = t, this.name = n, this.organizationId = r, this.tags = o;
25600
+ constructor(n, r, o, s) {
25601
+ super();
25602
+ /**
25603
+ * Connection monitor state.
25604
+ *
25605
+ * The original implementation would disconnect on the very first 1s tick if:
25606
+ * - the connection wasn't "ready" yet, OR
25607
+ * - RTC stats weren't available yet.
25608
+ *
25609
+ * On Firefox and iOS Safari, those conditions can be transient immediately after ICE reports "connected".
25610
+ * That creates the "connect then disconnect after ~1s" pattern.
25611
+ */
25612
+ _e(this, "connectionMonitorStartedAtMs", 0);
25613
+ _e(this, "connectionMonitorConsecutiveFailures", 0);
25614
+ this.id = n, this.name = r, this.organizationId = o, this.tags = s;
25602
25615
  }
25603
25616
  async getLatestTelemetry() {
25604
25617
  return (await (await fetch(
@@ -25622,22 +25635,22 @@ class Device extends BaseDevice {
25622
25635
  * @returns {Promise<ConfigurationDocument>} A promise that resolves to the configuration document
25623
25636
  * @throws {Error} Throws an error if the device has no configuration or has never been turned on
25624
25637
  */
25625
- async getConfiguration(t = !1) {
25626
- let n = await fetch(`${FORMANT_API_URL}/v1/admin/devices/${this.id}`, {
25638
+ async getConfiguration(n = !1) {
25639
+ let r = await fetch(`${FORMANT_API_URL}/v1/admin/devices/${this.id}`, {
25627
25640
  method: "GET",
25628
25641
  headers: {
25629
25642
  "Content-Type": "application/json",
25630
25643
  Authorization: "Bearer " + Authentication.token
25631
25644
  }
25632
25645
  });
25633
- const r = await n.json();
25634
- if (!r.state.reportedConfiguration)
25646
+ const o = await r.json();
25647
+ if (!o.state.reportedConfiguration)
25635
25648
  throw new Error(
25636
25649
  "Device has no configuration, has it ever been turned on?"
25637
25650
  );
25638
- const o = t ? r.desiredConfigurationVersion : r.state.reportedConfiguration.version;
25639
- return n = await fetch(
25640
- `${FORMANT_API_URL}/v1/admin/devices/${this.id}/configurations/${o}`,
25651
+ const s = n ? o.desiredConfigurationVersion : o.state.reportedConfiguration.version;
25652
+ return r = await fetch(
25653
+ `${FORMANT_API_URL}/v1/admin/devices/${this.id}/configurations/${s}`,
25641
25654
  {
25642
25655
  method: "GET",
25643
25656
  headers: {
@@ -25645,7 +25658,7 @@ class Device extends BaseDevice {
25645
25658
  Authorization: "Bearer " + Authentication.token
25646
25659
  }
25647
25660
  }
25648
- ), (await n.json()).document;
25661
+ ), (await r.json()).document;
25649
25662
  }
25650
25663
  /**
25651
25664
  * Asynchronously retrieves the device's agent version string
@@ -25654,21 +25667,24 @@ class Device extends BaseDevice {
25654
25667
  * @throws {Error} Throws an error if the device info cannot be fetched
25655
25668
  */
25656
25669
  async getAgentVersion() {
25657
- var r;
25658
- const n = await (await fetch(`${FORMANT_API_URL}/v1/admin/devices/${this.id}`, {
25659
- method: "GET",
25660
- headers: {
25661
- "Content-Type": "application/json",
25662
- Authorization: "Bearer " + Authentication.token
25670
+ var o;
25671
+ const r = await (await fetch(
25672
+ `${FORMANT_API_URL}/v1/admin/devices/${this.id}`,
25673
+ {
25674
+ method: "GET",
25675
+ headers: {
25676
+ "Content-Type": "application/json",
25677
+ Authorization: "Bearer " + Authentication.token
25678
+ }
25663
25679
  }
25664
- })).json();
25665
- return (r = n == null ? void 0 : n.state) == null ? void 0 : r.agentVersion;
25680
+ )).json();
25681
+ return (o = r == null ? void 0 : r.state) == null ? void 0 : o.agentVersion;
25666
25682
  }
25667
- async getFileUrl(t) {
25683
+ async getFileUrl(n) {
25668
25684
  return (await (await fetch(`${FORMANT_API_URL}/v1/admin/files/query`, {
25669
25685
  method: "POST",
25670
25686
  body: JSON.stringify({
25671
- fileIds: [t]
25687
+ fileIds: [n]
25672
25688
  }),
25673
25689
  headers: {
25674
25690
  "Content-Type": "application/json",
@@ -25682,7 +25698,7 @@ class Device extends BaseDevice {
25682
25698
  * @throws `Error` If the connection could not be established or if a connection already exists.
25683
25699
  * @returns {void}
25684
25700
  */
25685
- async startRealtimeConnection(t = {}) {
25701
+ async startRealtimeConnection(n = {}) {
25686
25702
  if (console.debug(`${(/* @__PURE__ */ new Date()).toISOString()} :: Connection start requested`), this.rtcClient && this.connectionMonitorInterval !== void 0)
25687
25703
  throw new Error(
25688
25704
  `Already created realtime connection to device ${this.id}`
@@ -25691,102 +25707,149 @@ class Device extends BaseDevice {
25691
25707
  "overwriting existing rtcClient due to missing connectionMonitorInterval"
25692
25708
  );
25693
25709
  const {
25694
- sessionType: n,
25695
- deadlineMs: r = 1e4,
25696
- maxConnectRetries: o = 3
25697
- } = typeof t == "number" ? { sessionType: t } : t, c = getRtcClientPool({
25698
- sessionType: n
25710
+ sessionType: r,
25711
+ deadlineMs: o = 1e4,
25712
+ maxConnectRetries: s = 3
25713
+ } = typeof n == "number" ? { sessionType: n } : n, l = getRtcClientPool({
25714
+ sessionType: r
25699
25715
  }).get(this.handleMessage);
25700
- let l = !1;
25701
- const u = new Promise(
25702
- (h, R) => setTimeout(() => {
25703
- l = !0, R(
25716
+ let u = !1;
25717
+ const d = new Promise(
25718
+ (R, y) => setTimeout(() => {
25719
+ u = !0, y(
25704
25720
  new Error(
25705
25721
  "Connection timed out: the connection could not be finalized in time, possibly due to network issues or misconfigured settings."
25706
25722
  )
25707
25723
  );
25708
- }, r)
25709
- ), d = async () => {
25710
- if ("isReady" in c)
25711
- for (; !c.isReady(); )
25712
- this.assertNotCancelled(l), await delay$1(100);
25713
- const h = await this.getRemoteDevicePeerId(c);
25714
- this.assertNotCancelled(l);
25715
- let R;
25716
- for (let Q = 0; Q < o && (R = await c.connect(h), !R); Q++)
25717
- delay$1(100), this.assertNotCancelled(l);
25718
- if (!R)
25724
+ }, o)
25725
+ ), h = async () => {
25726
+ if ("isReady" in l)
25727
+ for (; !l.isReady(); )
25728
+ this.assertNotCancelled(u), await delay$1(100);
25729
+ const R = await this.getRemoteDevicePeerId(l);
25730
+ this.assertNotCancelled(u);
25731
+ let y;
25732
+ for (let f = 0; f < s && (y = await l.connect(R), !y); f++)
25733
+ delay$1(100), this.assertNotCancelled(u);
25734
+ if (!y)
25719
25735
  throw new Error(
25720
- `Session could not be created: exhausted ${o} retries`
25736
+ `Session could not be created: exhausted ${s} retries`
25721
25737
  );
25722
- let y = 0;
25723
- for (; !l && c.getConnectionStatus(h) !== "connected"; )
25724
- await delay$1(100), y += 1;
25725
- return this.assertNotCancelled(l), console.debug(
25726
- `${(/* @__PURE__ */ new Date()).toISOString()} :: Connection completed after ${y} retries`
25727
- ), h;
25738
+ let Q = 0;
25739
+ for (; !u && l.getConnectionStatus(R) !== "connected"; )
25740
+ await delay$1(100), Q += 1;
25741
+ return this.assertNotCancelled(u), console.debug(
25742
+ `${(/* @__PURE__ */ new Date()).toISOString()} :: Connection completed after ${Q} retries`
25743
+ ), R;
25728
25744
  };
25729
- return Promise.race([d(), u]).then((h) => {
25730
- this.remoteDevicePeerId = h, this.initConnectionMonitoring(), this.rtcClient = c, this.emit("connect");
25731
- }).catch((h) => {
25745
+ return Promise.race([h(), d]).then((R) => {
25746
+ this.remoteDevicePeerId = R, this.rtcClient = l, this.connectionMonitorStartedAtMs = Date.now(), this.connectionMonitorConsecutiveFailures = 0, this.initConnectionMonitoring(), this.emit("connect");
25747
+ }).catch((R) => {
25732
25748
  throw console.debug(
25733
25749
  `${(/* @__PURE__ */ new Date()).toISOString()} :: Connection failed: %o`,
25734
- h
25735
- ), this.remoteDevicePeerId = null, c.shutdown().catch((R) => {
25736
- console.error("rtcClient cannot shutdown: %o", R);
25737
- }), this.emit("connection_failed", h), h;
25750
+ R
25751
+ ), this.remoteDevicePeerId = null, l.shutdown().catch((y) => {
25752
+ console.error("rtcClient cannot shutdown: %o", y);
25753
+ }), this.emit("connection_failed", R), R;
25738
25754
  });
25739
25755
  }
25740
- async getRemoteDevicePeerId(t) {
25741
- const r = (await t.getPeers()).find((o) => o.deviceId === this.id);
25742
- if (!isRtcPeer(r))
25756
+ async getRemoteDevicePeerId(n) {
25757
+ const o = (await n.getPeers()).find((s) => s.deviceId === this.id);
25758
+ if (!isRtcPeer(o))
25743
25759
  throw new Error("Cannot find peer, is the robot offline?");
25744
- return r.id;
25760
+ return o.id;
25745
25761
  }
25746
25762
  initConnectionMonitoring() {
25747
25763
  this.connectionMonitorInterval = setInterval(async () => {
25748
- let t = !1;
25764
+ let o = !1, s = !1, c = !1;
25749
25765
  if (this.rtcClient) {
25750
- const r = this.rtcClient.getConnections().find(
25751
- (o) => o.getRemotePeerId() === this.remoteDevicePeerId && o.isActive()
25766
+ const h = this.rtcClient.getConnections().find(
25767
+ (R) => R.getRemotePeerId() === this.remoteDevicePeerId && R.isActive()
25752
25768
  );
25753
- (r === void 0 || !r.isReady()) && (console.debug(`${(/* @__PURE__ */ new Date()).toISOString()} :: data channel closed`), t = !0);
25769
+ (h === void 0 || !h.isReady()) && (console.debug(`${(/* @__PURE__ */ new Date()).toISOString()} :: data channel closed`), o = !0, s = !0);
25754
25770
  }
25755
- (!this.rtcClient || !this.remoteDevicePeerId || await this.rtcClient.getConnectionStatsInfo(
25756
- this.remoteDevicePeerId
25757
- ) === void 0 || t) && (this.emit("disconnect"), this.stopRealtimeConnection().catch((n) => {
25758
- console.error(n);
25759
- }));
25771
+ if (!this.rtcClient || !this.remoteDevicePeerId) {
25772
+ this.emit("disconnect"), this.stopRealtimeConnection().catch((d) => console.error(d));
25773
+ return;
25774
+ }
25775
+ try {
25776
+ c = await this.rtcClient.getConnectionStatsInfo(
25777
+ this.remoteDevicePeerId
25778
+ ) === void 0;
25779
+ } catch {
25780
+ c = !0;
25781
+ }
25782
+ const l = Date.now() - (this.connectionMonitorStartedAtMs || 0);
25783
+ if (o || s) {
25784
+ if (l < 6e3) {
25785
+ console.debug(
25786
+ `${(/* @__PURE__ */ new Date()).toISOString()} :: connection monitor unhealthy (grace)`,
25787
+ {
25788
+ elapsed: l,
25789
+ connectionNotReady: s,
25790
+ statsUnavailable: c,
25791
+ dataChannelClosed: o,
25792
+ consecutiveFailures: this.connectionMonitorConsecutiveFailures
25793
+ }
25794
+ );
25795
+ return;
25796
+ }
25797
+ if (this.connectionMonitorConsecutiveFailures += 1, this.connectionMonitorConsecutiveFailures < 3) {
25798
+ console.debug(
25799
+ `${(/* @__PURE__ */ new Date()).toISOString()} :: connection monitor unhealthy (retrying)`,
25800
+ {
25801
+ elapsed: l,
25802
+ connectionNotReady: s,
25803
+ statsUnavailable: c,
25804
+ dataChannelClosed: o,
25805
+ consecutiveFailures: this.connectionMonitorConsecutiveFailures
25806
+ }
25807
+ );
25808
+ return;
25809
+ }
25810
+ console.debug(
25811
+ `${(/* @__PURE__ */ new Date()).toISOString()} :: connection monitor disconnecting`,
25812
+ {
25813
+ elapsed: l,
25814
+ connectionNotReady: s,
25815
+ statsUnavailable: c,
25816
+ dataChannelClosed: o,
25817
+ consecutiveFailures: this.connectionMonitorConsecutiveFailures
25818
+ }
25819
+ ), this.emit("disconnect"), this.stopRealtimeConnection().catch((d) => console.error(d));
25820
+ return;
25821
+ }
25822
+ this.connectionMonitorConsecutiveFailures = 0;
25760
25823
  }, 1e3);
25761
25824
  }
25762
25825
  async getRemotePeer() {
25763
- const n = (await defined$1(
25826
+ const r = (await defined$1(
25764
25827
  this.rtcClient,
25765
25828
  "Realtime connection has not been started"
25766
- ).getPeers()).find((r) => r.deviceId === this.id);
25829
+ ).getPeers()).find((o) => o.deviceId === this.id);
25767
25830
  return defined$1(
25768
- n,
25831
+ r,
25769
25832
  "Could not find remote peer for device " + this.id
25770
25833
  );
25771
25834
  }
25772
25835
  async stopRealtimeConnection() {
25773
- let t = !1;
25836
+ let n = !1;
25774
25837
  if (this.rtcClient) {
25775
- this.stopConnectionMonitoring(), this.remoteDevicePeerId ? (await this.rtcClient.disconnect(this.remoteDevicePeerId), this.remoteDevicePeerId = null) : t = !0;
25838
+ this.stopConnectionMonitoring(), this.remoteDevicePeerId ? (await this.rtcClient.disconnect(this.remoteDevicePeerId), this.remoteDevicePeerId = null) : n = !0;
25776
25839
  try {
25777
25840
  await this.rtcClient.shutdown();
25778
25841
  } finally {
25779
25842
  this.rtcClient = void 0;
25780
25843
  }
25781
25844
  }
25782
- if (t)
25845
+ if (n)
25783
25846
  throw new Error(`Realtime connection hasn't been started for ${this.id}`);
25784
25847
  }
25785
25848
  async isInRealtimeSession() {
25786
- const t = await getPeers(), n = await getRealtimeSessions(), r = t.find((o) => o.deviceId === this.id);
25787
- return r ? n[r.id].length > 0 : !1;
25849
+ const n = await getPeers(), r = await getRealtimeSessions(), o = n.find((s) => s.deviceId === this.id);
25850
+ return o ? r[o.id].length > 0 : !1;
25788
25851
  }
25789
- async getAvailableCommands(t = !0) {
25852
+ async getAvailableCommands(n = !0) {
25790
25853
  return (await (await fetch(
25791
25854
  `${FORMANT_API_URL}/v1/admin/command-templates/`,
25792
25855
  {
@@ -25796,32 +25859,32 @@ class Device extends BaseDevice {
25796
25859
  Authorization: "Bearer " + Authentication.token
25797
25860
  }
25798
25861
  }
25799
- )).json()).items.filter((o) => t ? !0 : o.enabled);
25862
+ )).json()).items.filter((s) => n ? !0 : s.enabled);
25800
25863
  }
25801
- async sendCommand(t, n, r, o, s) {
25802
- var R;
25803
- const l = (await this.getAvailableCommands(!1)).find((y) => s ? y.id === s : y.name === t);
25804
- if (!l)
25805
- throw new Error(`Could not find command with name "${t}"`);
25806
- let u = "";
25807
- n === void 0 ? l.parameterEnabled && l.parameterValue && (u = l.parameterValue) : u = n;
25808
- let d = {
25809
- value: u,
25810
- scrubberTime: (r || /* @__PURE__ */ new Date()).toISOString(),
25864
+ async sendCommand(n, r, o, s, c) {
25865
+ var y;
25866
+ const u = (await this.getAvailableCommands(!1)).find((Q) => c ? Q.id === c : Q.name === n);
25867
+ if (!u)
25868
+ throw new Error(`Could not find command with name "${n}"`);
25869
+ let d = "";
25870
+ r === void 0 ? u.parameterEnabled && u.parameterValue && (d = u.parameterValue) : d = r;
25871
+ const h = {
25872
+ value: d,
25873
+ scrubberTime: (o || /* @__PURE__ */ new Date()).toISOString(),
25811
25874
  meta: {
25812
- ...l.parameterMeta,
25813
- ...o
25875
+ ...u.parameterMeta,
25876
+ ...s
25814
25877
  }
25815
25878
  };
25816
25879
  return await fetch(`${FORMANT_API_URL}/v1/admin/commands`, {
25817
25880
  method: "POST",
25818
25881
  body: JSON.stringify({
25819
- commandTemplateId: l.id,
25882
+ commandTemplateId: u.id,
25820
25883
  organizationId: this.organizationId,
25821
25884
  deviceId: this.id,
25822
- command: l.command,
25823
- parameter: d,
25824
- userId: (R = Authentication.currentUser) == null ? void 0 : R.id
25885
+ command: u.command,
25886
+ parameter: h,
25887
+ userId: (y = Authentication.currentUser) == null ? void 0 : y.id
25825
25888
  }),
25826
25889
  headers: {
25827
25890
  "Content-Type": "application/json",
@@ -25829,8 +25892,8 @@ class Device extends BaseDevice {
25829
25892
  }
25830
25893
  });
25831
25894
  }
25832
- async getCommand(t) {
25833
- return await fetch(`${FORMANT_API_URL}/v1/admin/commands/${t}`, {
25895
+ async getCommand(n) {
25896
+ return await fetch(`${FORMANT_API_URL}/v1/admin/commands/${n}`, {
25834
25897
  method: "GET",
25835
25898
  headers: {
25836
25899
  "Content-Type": "application/json",
@@ -25838,12 +25901,12 @@ class Device extends BaseDevice {
25838
25901
  }
25839
25902
  });
25840
25903
  }
25841
- async createCaptureStream(t) {
25842
- const r = await (await fetch(`${FORMANT_API_URL}/v1/admin/capture-sessions`, {
25904
+ async createCaptureStream(n) {
25905
+ const o = await (await fetch(`${FORMANT_API_URL}/v1/admin/capture-sessions`, {
25843
25906
  method: "POST",
25844
25907
  body: JSON.stringify({
25845
25908
  deviceId: this.id,
25846
- streamName: t,
25909
+ streamName: n,
25847
25910
  tags: {}
25848
25911
  }),
25849
25912
  headers: {
@@ -25851,28 +25914,28 @@ class Device extends BaseDevice {
25851
25914
  Authorization: "Bearer " + Authentication.token
25852
25915
  }
25853
25916
  })).json();
25854
- return new CaptureStream(r);
25917
+ return new CaptureStream(o);
25855
25918
  }
25856
- async getTelemetry(t, n, r, o, s, c, l) {
25857
- if (s !== void 0 || c !== void 0)
25919
+ async getTelemetry(n, r, o, s, c, l, u) {
25920
+ if (c !== void 0 || l !== void 0)
25858
25921
  throw new Error("Limit and offset are not supported in this method");
25859
25922
  return await getTelemetry(
25860
25923
  this.id,
25861
- t,
25862
25924
  n,
25863
25925
  r,
25864
25926
  o,
25865
- l
25927
+ s,
25928
+ u
25866
25929
  );
25867
25930
  }
25868
- async queryEvents(t) {
25869
- if (t.deviceIds)
25931
+ async queryEvents(n) {
25932
+ if (n.deviceIds)
25870
25933
  throw new Error("Cannot filter multiple devices via Device class");
25871
- return t.deviceIds = [this.id], queryEvents(t);
25934
+ return n.deviceIds = [this.id], queryEvents(n);
25872
25935
  }
25873
25936
  async getTelemetryStreams() {
25874
- var l, u;
25875
- const t = await this.getConfiguration(), n = await fetch(
25937
+ var u, d;
25938
+ const n = await this.getConfiguration(), r = await fetch(
25876
25939
  `${FORMANT_API_URL}/v1/queries/metadata/stream-names`,
25877
25940
  {
25878
25941
  method: "POST",
@@ -25884,23 +25947,23 @@ class Device extends BaseDevice {
25884
25947
  Authorization: "Bearer " + Authentication.token
25885
25948
  }
25886
25949
  }
25887
- ), r = [], o = [];
25888
- return (u = (l = t.telemetry) == null ? void 0 : l.streams) == null || u.forEach((d) => {
25889
- d.disabled !== !0 && r.push(d.name), d.onDemand === !0 && o.push(d.name);
25890
- }), console.log(o), (await n.json()).items.filter((d) => !r.includes(d)).map((d) => ({ name: d, onDemand: o.includes(d) }));
25950
+ ), o = [], s = [];
25951
+ return (d = (u = n.telemetry) == null ? void 0 : u.streams) == null || d.forEach((h) => {
25952
+ h.disabled !== !0 && o.push(h.name), h.onDemand === !0 && s.push(h.name);
25953
+ }), console.log(s), (await r.json()).items.filter((h) => !o.includes(h)).map((h) => ({ name: h, onDemand: s.includes(h) }));
25891
25954
  }
25892
- async createInterventionRequest(t, n, r, o) {
25955
+ async createInterventionRequest(n, r, o, s) {
25893
25956
  return await (await fetch(
25894
25957
  `${FORMANT_API_URL}/v1/admin/intervention-requests`,
25895
25958
  {
25896
25959
  method: "POST",
25897
25960
  body: JSON.stringify({
25898
- message: t,
25899
- interventionType: n,
25961
+ message: n,
25962
+ interventionType: r,
25900
25963
  time: (/* @__PURE__ */ new Date()).toISOString(),
25901
25964
  deviceId: this.id,
25902
- tags: o,
25903
- data: r
25965
+ tags: s,
25966
+ data: o
25904
25967
  }),
25905
25968
  headers: {
25906
25969
  "Content-Type": "application/json",
@@ -25909,15 +25972,15 @@ class Device extends BaseDevice {
25909
25972
  }
25910
25973
  )).json();
25911
25974
  }
25912
- async addInterventionResponse(t, n, r) {
25975
+ async addInterventionResponse(n, r, o) {
25913
25976
  return await (await fetch(
25914
25977
  `${FORMANT_API_URL}/v1/admin/intervention-responses`,
25915
25978
  {
25916
25979
  method: "POST",
25917
25980
  body: JSON.stringify({
25918
- interventionId: t,
25919
- interventionType: n,
25920
- data: r
25981
+ interventionId: n,
25982
+ interventionType: r,
25983
+ data: o
25921
25984
  }),
25922
25985
  headers: {
25923
25986
  "Content-Type": "application/json",
@@ -25926,24 +25989,24 @@ class Device extends BaseDevice {
25926
25989
  }
25927
25990
  )).json();
25928
25991
  }
25929
- async getAnnotationCount(t, n) {
25930
- return await getAnnotationCount({ ...t, deviceIds: [this.id] }, n);
25992
+ async getAnnotationCount(n, r) {
25993
+ return await getAnnotationCount({ ...n, deviceIds: [this.id] }, r);
25931
25994
  }
25932
- async getAnnotationCountByIntervals(t, n, r) {
25995
+ async getAnnotationCountByIntervals(n, r, o) {
25933
25996
  return await getAnnotationCountByIntervals(
25934
- { ...t, deviceIds: [this.id] },
25935
- n,
25936
- r
25997
+ { ...n, deviceIds: [this.id] },
25998
+ r,
25999
+ o
25937
26000
  );
25938
26001
  }
25939
- async eventsCounter(t, n, r, o, s) {
25940
- return await eventsCounter(t, n, r, o, {
25941
- ...s,
26002
+ async eventsCounter(n, r, o, s, c) {
26003
+ return await eventsCounter(n, r, o, s, {
26004
+ ...c,
25942
26005
  deviceIds: [this.id]
25943
26006
  });
25944
26007
  }
25945
- async createShareLink(t, n) {
25946
- return t.scope.deviceIds = [this.id], await createShareLink(t, n);
26008
+ async createShareLink(n, r) {
26009
+ return n.scope.deviceIds = [this.id], await createShareLink(n, r);
25947
26010
  }
25948
26011
  }
25949
26012
  _e(Device, "createDevice", createDevice), _e(Device, "patchDevice", patchDevice), _e(Device, "getDevicesData", getDevicesData), _e(Device, "queryDevicesData", queryDevicesData), _e(Device, "disableDevice", disableDevice);