@sigmaott/base-next 1.4.49 → 1.4.51

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.
package/.npmrc ADDED
@@ -0,0 +1,3 @@
1
+ shamefully-hoist=true
2
+ strict-peer-dependencies=false
3
+ shell-emulator=true
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sigmaott/base-next",
3
3
  "type": "module",
4
- "version": "1.4.49",
4
+ "version": "1.4.51",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -64,6 +64,7 @@ const optionsEncoder = computed(() => {
64
64
  if (encoderTypeValue.value === 'NETINT') {
65
65
  return [
66
66
  { label: 'NETINT', value: 'netint' },
67
+ { label: 'Passthrough', value: 'passthrough' },
67
68
  ]
68
69
  }
69
70
 
@@ -1,8 +1,9 @@
1
- import SwaggerClient from 'swagger-client'
2
- import { useFilterSchema } from './useFilterSchema'
3
- import service from '@/api/axios'
1
+ import SwaggerClient from "swagger-client";
2
+ import { useFilterSchema } from "./useFilterSchema";
3
+ import service from "@/api/axios";
4
+ import { createSharedComposable, useAsyncState } from "@vueuse/core";
4
5
 
5
- const useSharedSchemaAsync = createSharedComposable(useAsyncState)
6
+ const useSharedSchemaAsync = createSharedComposable(useAsyncState);
6
7
 
7
8
  export function useAsyncSchema(url: string, schemaInput: string) {
8
9
  async function fetcher() {
@@ -10,20 +11,25 @@ export function useAsyncSchema(url: string, schemaInput: string) {
10
11
  headers: {
11
12
  noNotify: true,
12
13
  },
13
- })
14
- const result = await SwaggerClient.resolveSubtree(res.data.components.schemas, [])
15
- return result.spec
14
+ });
15
+ const result = await SwaggerClient.resolveSubtree(
16
+ res.data.components.schemas,
17
+ []
18
+ );
19
+ return result.spec;
16
20
  }
17
21
 
18
- const { state, ...rest } = useSharedSchemaAsync(fetcher, {})
22
+ const { state, ...rest } = useSharedSchemaAsync(fetcher, {});
19
23
 
20
- const schema = computed(() => useFilterSchema(state.value?.[schemaInput]?.properties || {}, {}))
21
- const schemaItem = computed(() => state.value?.[schemaInput] || {})
24
+ const schema = computed(() =>
25
+ useFilterSchema(state.value?.[schemaInput]?.properties || {}, {})
26
+ );
27
+ const schemaItem = computed(() => state.value?.[schemaInput] || {});
22
28
 
23
- const schemaObj = computed(() => schemaItem.value?.properties || {})
29
+ const schemaObj = computed(() => schemaItem.value?.properties || {});
24
30
  const schemaDesc = computed(() => {
25
- return objectMap(schemaObj.value || {}, (k, v) => [k, v.description || ''])
26
- })
31
+ return objectMap(schemaObj.value || {}, (k, v) => [k, v.description || ""]);
32
+ });
27
33
 
28
34
  return {
29
35
  ...rest,
@@ -31,28 +37,28 @@ export function useAsyncSchema(url: string, schemaInput: string) {
31
37
  schemaItem,
32
38
  schemaDesc,
33
39
  schemaObj,
34
- }
40
+ };
35
41
  }
36
42
 
37
43
  export function useHelpPanel() {
38
- const isShowHelpPanel = ref(false)
39
- const schemaObj = ref({})
44
+ const isShowHelpPanel = ref(false);
45
+ const schemaObj = ref({});
40
46
 
41
47
  function openHelpPanel(schema: any) {
42
- schemaObj.value = schema
43
- isShowHelpPanel.value = true
44
- console.log('🚀 ~ openHelpPanel ~ schema:', schema, isShowHelpPanel)
48
+ schemaObj.value = schema;
49
+ isShowHelpPanel.value = true;
50
+ console.log("🚀 ~ openHelpPanel ~ schema:", schema, isShowHelpPanel);
45
51
  }
46
52
 
47
53
  function closeHelpPanel() {
48
- isShowHelpPanel.value = false
54
+ isShowHelpPanel.value = false;
49
55
  }
50
56
  return {
51
57
  isShowHelpPanel,
52
58
  openHelpPanel,
53
59
  closeHelpPanel,
54
60
  schemaObj,
55
- }
61
+ };
56
62
  }
57
63
 
58
- export const useSharedHelpPanel = createSharedComposable(useHelpPanel)
64
+ export const useSharedHelpPanel = createSharedComposable(useHelpPanel);
@@ -1,10 +1,12 @@
1
+ import { useDocumentVisibility } from "@vueuse/core";
2
+
1
3
  export default defineNuxtPlugin(() => {
2
- const visibility = useDocumentVisibility()
4
+ const visibility = useDocumentVisibility();
3
5
 
4
6
  watch(TOKEN_STORAGE, () => {
5
7
  nextTick(() => {
6
- if (!TOKEN_STORAGE.value && visibility.value === 'hidden')
7
- window.location.reload()
8
- })
9
- })
10
- })
8
+ if (!TOKEN_STORAGE.value && visibility.value === "hidden")
9
+ window.location.reload();
10
+ });
11
+ });
12
+ });