tsviewer 1.0.13 → 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,18 +12804,22 @@ function useHandleXhrError(e) {
12803
12804
  EventBus.$emit("ajaxError", e);
12804
12805
  }
12805
12806
  }
12806
- const useToken = () => {
12807
- const e = inject("getToken");
12808
- if (!e)
12809
- throw new Error(
12810
- "getToken is not provided. Please use a Nuxt plugin or Vue app to provide it."
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
+ }
12811
12814
  );
12812
- return e;
12813
- }, getLayerIndex = (e, t, n) => {
12815
+ } catch (e) {
12816
+ console.error(e);
12817
+ }
12818
+ }
12819
+ const getLayerIndex = (e, t, n) => {
12814
12820
  const r = propOr("", e, t);
12815
12821
  return findIndex(propEq("id", r), n);
12816
12822
  }, initialState = () => ({
12817
- userToken: "",
12818
12823
  selectedPackage: {},
12819
12824
  activeViewer: {},
12820
12825
  viewerSidePanelOpen: !1,
@@ -12949,9 +12954,6 @@ const useToken = () => {
12949
12954
  setViewerMontageScheme(e) {
12950
12955
  this.viewerMontageScheme = e;
12951
12956
  },
12952
- updateUserToken(e) {
12953
- this.userToken = e;
12954
- },
12955
12957
  selectPackage(e) {
12956
12958
  this.selectedPackage = e;
12957
12959
  }