@inzombieland/nuxt-common 1.16.17 → 1.16.19
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/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/AppProvider.vue +3 -2
- package/dist/runtime/api/index.d.ts +2 -2
- package/dist/runtime/api/index.mjs +2 -2
- package/dist/runtime/packages/api/index.d.ts +0 -1
- package/dist/runtime/packages/api/index.mjs +4 -1
- package/dist/runtime/packages/api/package.json +3 -1
- package/package.json +1 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
2
2
|
import { defineNuxtModule, createResolver, addServerHandler, addImportsDir, addPlugin, addComponent } from '@nuxt/kit';
|
|
3
3
|
|
|
4
4
|
const name = "@inzombieland/nuxt-common";
|
|
5
|
-
const version = "1.16.
|
|
5
|
+
const version = "1.16.19";
|
|
6
6
|
|
|
7
7
|
const module = defineNuxtModule({
|
|
8
8
|
meta: {
|
|
@@ -5,10 +5,11 @@ import { useI18n, useLocalePath } from "#i18n"
|
|
|
5
5
|
import { useNuxtApp } from "#imports"
|
|
6
6
|
import { onMounted, ref, watch } from "vue"
|
|
7
7
|
import { useRouter } from "vue-router"
|
|
8
|
-
import { getVisitorId
|
|
8
|
+
import { getVisitorId } from "./api"
|
|
9
9
|
import { useActiveSessions } from "./composables/use-active-sessions"
|
|
10
10
|
import { useUserActions } from "./composables/use-user-actions"
|
|
11
11
|
import { useSubscribe, useUser } from "./packages/api"
|
|
12
|
+
import bus from "./packages/api/bus"
|
|
12
13
|
import type { ConfigProviderTheme } from "vant"
|
|
13
14
|
import "@vant/touch-emulator"
|
|
14
15
|
|
|
@@ -82,7 +83,7 @@ onMounted(() => {
|
|
|
82
83
|
})
|
|
83
84
|
|
|
84
85
|
if (typeof window !== "undefined") {
|
|
85
|
-
|
|
86
|
+
bus.publish("app:beforeMount", true)
|
|
86
87
|
}
|
|
87
88
|
</script>
|
|
88
89
|
|
|
@@ -18,7 +18,7 @@ export declare const config: {
|
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
20
|
};
|
|
21
|
-
declare const fetch: Fetch, getUser: () => Promise<import("src/runtime/packages/api/types").GetUserResponse>,
|
|
21
|
+
declare const fetch: Fetch, getUser: () => Promise<import("src/runtime/packages/api/types").GetUserResponse>, useApiFetch: () => Fetch, userActions: {
|
|
22
22
|
signIn: (body: {
|
|
23
23
|
username: string;
|
|
24
24
|
password: string;
|
|
@@ -28,4 +28,4 @@ declare const fetch: Fetch, getUser: () => Promise<import("src/runtime/packages/
|
|
|
28
28
|
}>;
|
|
29
29
|
logout: () => Promise<void>;
|
|
30
30
|
};
|
|
31
|
-
export { fetch, getUser,
|
|
31
|
+
export { fetch, getUser, useApiFetch, userActions };
|
|
@@ -22,5 +22,5 @@ export const config = {
|
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
|
-
const { fetch, getUser,
|
|
26
|
-
export { fetch, getUser,
|
|
25
|
+
const { fetch, getUser, useApiFetch, userActions } = initApiFetch($fetch, config);
|
|
26
|
+
export { fetch, getUser, useApiFetch, userActions };
|
|
@@ -6,7 +6,6 @@ export { getVisitor, getVisitorId, type Visitor } from "./get-visitor";
|
|
|
6
6
|
export declare function initApiFetch($fetch: Fetch, config: FetchConfig): {
|
|
7
7
|
fetch: Fetch;
|
|
8
8
|
getUser: () => Promise<import("./types").GetUserResponse>;
|
|
9
|
-
getVisitorIdentifier: () => Promise<void>;
|
|
10
9
|
useApiFetch: () => Fetch;
|
|
11
10
|
userActions: {
|
|
12
11
|
signIn: (body: {
|
|
@@ -65,6 +65,9 @@ export function initApiFetch($fetch, config) {
|
|
|
65
65
|
{ immediate: true }
|
|
66
66
|
);
|
|
67
67
|
setNotifyDefaultOptions({ position: "bottom" });
|
|
68
|
+
bus.subscribe("app:beforeMount", () => {
|
|
69
|
+
getVisitorIdentifier();
|
|
70
|
+
});
|
|
68
71
|
}
|
|
69
|
-
return { fetch, getUser,
|
|
72
|
+
return { fetch, getUser, useApiFetch, userActions };
|
|
70
73
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inzombieland/api",
|
|
3
|
-
"version": "1.16.
|
|
3
|
+
"version": "1.16.19",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"main": "./index.mjs",
|
|
@@ -10,11 +10,13 @@
|
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@fingerprintjs/fingerprintjs": "^4.6.2",
|
|
13
|
+
"@vant/touch-emulator": "^1.4.0",
|
|
13
14
|
"@varlet/ui": "^3.10.5",
|
|
14
15
|
"@vueuse/core": "^12.8.2",
|
|
15
16
|
"centrifuge": "^5.3.4",
|
|
16
17
|
"ofetch": "^1.4.1",
|
|
17
18
|
"rxjs": "^7.8.2",
|
|
19
|
+
"vant": "^4.9.19",
|
|
18
20
|
"vue": "^3.5.13",
|
|
19
21
|
"zod": "^3.24.2"
|
|
20
22
|
}
|