tsviewer 1.0.12 → 1.0.14

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,5 +1,6 @@
1
1
  import { getCurrentInstance, inject, ref, computed, unref, getCurrentScope, onScopeDispose, shallowRef, watchEffect, readonly, onMounted, nextTick, watch, isRef, warn, defineComponent, createElementBlock, openBlock, mergeProps, renderSlot, createElementVNode, toRef, onUnmounted, useAttrs as useAttrs$1, useSlots, normalizeStyle, normalizeClass, createCommentVNode, Fragment, createBlock, withCtx, resolveDynamicComponent, withModifiers, createVNode, toDisplayString, onBeforeUnmount, Transition, withDirectives, vShow, provide, reactive, onActivated, onUpdated, cloneVNode, Text, Comment, Teleport as Teleport$1, onBeforeMount, onDeactivated, isVNode, renderList, createTextVNode, withKeys, h, createSlots, toRaw, toRefs, resolveComponent, resolveDirective, toHandlerKey, vModelText } from "vue";
2
2
  import { defineStore } from "pinia";
3
+ import { fetchAuthSession } from "aws-amplify/auth";
3
4
  const configProviderContextKey = Symbol(), defaultNamespace = "el", statePrefix = "is-", _bem = (e, t, n, r, i) => {
4
5
  let a = `${e}-${t}`;
5
6
  return n && (a += `-${n}`), r && (a += `__${r}`), i && (a += `--${i}`), a;
@@ -12803,17 +12804,22 @@ function useHandleXhrError(e) {
12803
12804
  EventBus.$emit("ajaxError", e);
12804
12805
  }
12805
12806
  }
12806
- function useToken() {
12807
- const e = inject("useGetToken");
12808
- if (!e)
12809
- throw new Error("useGetToken is not provided. Make sure to provide it in your app.");
12810
- return e;
12807
+ async function useToken() {
12808
+ try {
12809
+ return fetchAuthSession().then(
12810
+ (e) => {
12811
+ var t, n;
12812
+ return console.log("session object", e), console.log("access token is", (t = e == null ? void 0 : e.tokens) == null ? void 0 : t.accessToken.toString()), (n = e == null ? void 0 : e.tokens) == null ? void 0 : n.accessToken.toString();
12813
+ }
12814
+ );
12815
+ } catch (e) {
12816
+ console.error(e);
12817
+ }
12811
12818
  }
12812
12819
  const getLayerIndex = (e, t, n) => {
12813
12820
  const r = propOr("", e, t);
12814
12821
  return findIndex(propEq("id", r), n);
12815
12822
  }, initialState = () => ({
12816
- userToken: "",
12817
12823
  selectedPackage: {},
12818
12824
  activeViewer: {},
12819
12825
  viewerSidePanelOpen: !1,
@@ -12948,9 +12954,6 @@ const getLayerIndex = (e, t, n) => {
12948
12954
  setViewerMontageScheme(e) {
12949
12955
  this.viewerMontageScheme = e;
12950
12956
  },
12951
- updateUserToken(e) {
12952
- this.userToken = e;
12953
- },
12954
12957
  selectPackage(e) {
12955
12958
  this.selectedPackage = e;
12956
12959
  }