tsviewer 1.0.10 → 1.0.11

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.
@@ -14212,19 +14212,19 @@ const __unplugin_components_2 = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["rend
14212
14212
  console.log(e), EventBus.$emit("ajaxError", e);
14213
14213
  }
14214
14214
  }
14215
- }, authToken = {
14216
- methods: {
14217
- async useGetToken() {
14218
- return useViewerStore().userToken;
14219
- }
14220
- }
14221
- }, _sfc_main$4 = {
14215
+ };
14216
+ function useToken() {
14217
+ const e = inject("useGetToken");
14218
+ if (!e)
14219
+ throw new Error("useGetToken is not provided. Make sure to provide it in your app.");
14220
+ return e;
14221
+ }
14222
+ const _sfc_main$4 = {
14222
14223
  name: "TimeseriesAnnotationCanvas",
14223
14224
  mixins: [
14224
14225
  Request,
14225
14226
  ViewerActiveTool,
14226
- viewerStoreMixin,
14227
- authToken
14227
+ viewerStoreMixin
14228
14228
  ],
14229
14229
  props: {
14230
14230
  cWidth: {
@@ -14305,7 +14305,7 @@ const __unplugin_components_2 = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["rend
14305
14305
  }
14306
14306
  },
14307
14307
  mounted: function() {
14308
- this.useGetToken().then((e) => {
14308
+ useToken().then((e) => {
14309
14309
  const t = `https://api.pennsieve.net/timeseries/${this.activeViewer.content.id}/layers?api_key=${e}`;
14310
14310
  return useSendXhr(t).then((n) => {
14311
14311
  this._getLayerResponse(n).then(() => {
@@ -14456,7 +14456,7 @@ const __unplugin_components_2 = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["rend
14456
14456
  layerId: c.id,
14457
14457
  limit: this.constants.LIMITANNFETCH
14458
14458
  };
14459
- this.useGetToken().then((f) => {
14459
+ useToken().then((f) => {
14460
14460
  const v = `https://api.pennsieve.net/timeseries/${this.activeViewer.content.id}/layers/${c.id}/annotations?api_key=${f}`, g = Object.keys(d).map((y) => `&${y}=${d[y]}`).join(""), b = `${v}${g}`;
14461
14461
  return fetch(b, {
14462
14462
  method: "GET",
@@ -14612,7 +14612,7 @@ const __unplugin_components_2 = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["rend
14612
14612
  return defaultTo({}, find(propEq("id", t), this.viewerAnnotations));
14613
14613
  },
14614
14614
  createAnnotationLayer: function(e) {
14615
- this.useGetToken().then((t) => {
14615
+ useToken().then((t) => {
14616
14616
  const n = `https://api.pennsieve.net/timeseries/${this.activeViewer.content.id}/layers?api_key=${t}`;
14617
14617
  return useSendXhr(n, {
14618
14618
  method: "POST",
@@ -14698,7 +14698,7 @@ const __unplugin_components_2 = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["rend
14698
14698
  const p = pathOr({}, ["objects", "view", 1, "content"], f), v = propOr("", "fileType", p), g = new Image();
14699
14699
  if (v === "PNG") {
14700
14700
  const { id: b, packageId: y } = p, _ = "https://api.pennsieve.net";
14701
- this.useGetToken().then((w) => {
14701
+ useToken().then((w) => {
14702
14702
  g.src = `${_}/packages/${y}/files/${b}/presign/?api_key=${w}`, g.complete || g.addEventListener("load", () => this.render(), { once: !0 }), e.drawImage(g, u, d - i, 27, r);
14703
14703
  }).catch(console.log);
14704
14704
  } else
@@ -14799,7 +14799,7 @@ function _sfc_render$4(e, t, n, r, i, a) {
14799
14799
  style: normalizeStyle(a.canvasStyle)
14800
14800
  }, null, 12, _hoisted_1$4);
14801
14801
  }
14802
- const __unplugin_components_1$1 = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4], ["__scopeId", "data-v-9d26fb2e"]]);
14802
+ const __unplugin_components_1$1 = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4], ["__scopeId", "data-v-b1363b2d"]]);
14803
14803
  var src = { exports: {} }, indexLight = { exports: {} }, indexMinimal = {}, minimal = {}, aspromise, hasRequiredAspromise;
14804
14804
  function requireAspromise() {
14805
14805
  if (hasRequiredAspromise) return aspromise;
@@ -18317,7 +18317,7 @@ const protobuf = /* @__PURE__ */ getDefaultExportFromCjs(protobufjsExports), _sf
18317
18317
  return this.cHeight - 20;
18318
18318
  }
18319
18319
  },
18320
- mixins: [viewerStoreMixin, authToken],
18320
+ mixins: [viewerStoreMixin],
18321
18321
  data: function() {
18322
18322
  return {
18323
18323
  proto: {
@@ -19042,7 +19042,7 @@ const protobuf = /* @__PURE__ */ getDefaultExportFromCjs(protobufjsExports), _sf
19042
19042
  // _________________
19043
19043
  // WEBSOCKET METHODS
19044
19044
  openWebsocket: function() {
19045
- this._websocket && (this._websocket.readyState === 0 || this._websocket.readyState === 1) || this.useGetToken().then((e) => {
19045
+ this._websocket && (this._websocket.readyState === 0 || this._websocket.readyState === 1) || useToken().then((e) => {
19046
19046
  const t = "wss://api.pennsieve.net/streaming/ts/query?session=" + e + "&package=" + this.activeViewer.content.id;
19047
19047
  this._websocket = new WebSocket(t), this._websocket.onopen = this._onWebsocketOpen.bind(this), this._websocket.onclose = this._onWebsocketClose.bind(this), this._websocket.onmessage = this._onWebsocketMessage.bind(this);
19048
19048
  }).catch(console.log);
@@ -19287,7 +19287,7 @@ function _sfc_render$3(e, t, n, r, i, a) {
19287
19287
  }, null, 12, _hoisted_3$3)
19288
19288
  ]);
19289
19289
  }
19290
- const __unplugin_components_0$1 = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3], ["__scopeId", "data-v-6c706684"]]), _sfc_main$2 = {
19290
+ const __unplugin_components_0$1 = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3], ["__scopeId", "data-v-c196e0b5"]]), _sfc_main$2 = {
19291
19291
  name: "TSViewerCanvas",
19292
19292
  mixins: [
19293
19293
  Request,
@@ -19791,8 +19791,7 @@ const __unplugin_components_1 = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["rend
19791
19791
  mixins: [
19792
19792
  Request,
19793
19793
  ViewerActiveTool,
19794
- viewerStoreMixin,
19795
- authToken
19794
+ viewerStoreMixin
19796
19795
  ],
19797
19796
  props: {
19798
19797
  ts_start: Number,
@@ -19943,7 +19942,7 @@ const __unplugin_components_1 = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["rend
19943
19942
  },
19944
19943
  _requestSegmentSpan: function(e, t, n, r, i) {
19945
19944
  const a = this.constants.MAXRECURSION;
19946
- this.useGetToken().then((o) => {
19945
+ useToken().then((o) => {
19947
19946
  const l = `https://api.pennsieve.net/streaming/ts/retrieve/segments?session=${o}&channel=${e}&start=${n}&end=${r}`;
19948
19947
  return this.sendXhr(l).then((u) => {
19949
19948
  let c = new Array(u.length * 2), m = 0;
@@ -19973,7 +19972,7 @@ const __unplugin_components_1 = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["rend
19973
19972
  });
19974
19973
  },
19975
19974
  getAnnotations: function() {
19976
- this.useGetToken().then((e) => {
19975
+ useToken().then((e) => {
19977
19976
  const t = map((i) => i.id, this.viewerAnnotations);
19978
19977
  this.ts_end;
19979
19978
  let r = `https://api.pennsieve.net/timeseries/${this.activeViewer.content.id}/annotations/window` + `?api_key=${e}&aggregation=count&start=${this.ts_start}&end=${this.ts_end}&period=${this.period}&mergePeriods=true`;
@@ -20117,11 +20116,10 @@ function _sfc_render$1(e, t, n, r, i, a) {
20117
20116
  ])
20118
20117
  ]);
20119
20118
  }
20120
- const __unplugin_components_0 = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-9c68e52f"]]), TsAnnotation = {
20119
+ const __unplugin_components_0 = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1], ["__scopeId", "data-v-6b151a27"]]), TsAnnotation = {
20121
20120
  mixins: [
20122
20121
  Request,
20123
- viewerStoreMixin,
20124
- authToken
20122
+ viewerStoreMixin
20125
20123
  ],
20126
20124
  data: function() {
20127
20125
  return {};
@@ -20167,7 +20165,7 @@ const __unplugin_components_0 = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["rend
20167
20165
  start: e,
20168
20166
  end: e + t
20169
20167
  }, c = `https://api.pennsieve.net/timeseries/${this.activeViewer.content.nodeId}/layers/${a}/annotations`;
20170
- this.useGetToken().then((m) => {
20168
+ useToken().then((m) => {
20171
20169
  this.sendXhr(c, {
20172
20170
  method: "POST",
20173
20171
  header: {
@@ -20218,7 +20216,7 @@ const __unplugin_components_0 = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["rend
20218
20216
  start: e,
20219
20217
  end: e + t
20220
20218
  }, o = this;
20221
- this.useGetToken().then((l) => {
20219
+ useToken().then((l) => {
20222
20220
  elf.sendXhr(i, {
20223
20221
  method: "PUT",
20224
20222
  header: {
@@ -20234,7 +20232,7 @@ const __unplugin_components_0 = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["rend
20234
20232
  let t = "";
20235
20233
  e.layer ? t = e.layer.id : t = e.layer_id;
20236
20234
  const r = `https://api.pennsieve.net/timeseries/${this.activeViewer.content.nodeId}/layers/${t}/annotations/${e.id}`, i = this;
20237
- this.useGetToken().then((a) => {
20235
+ useToken().then((a) => {
20238
20236
  i.sendXhr(r, {
20239
20237
  method: "DELETE",
20240
20238
  header: {