@inzombieland/nuxt-common 1.17.1 → 1.18.0

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.
Files changed (67) hide show
  1. package/dist/module.json +1 -1
  2. package/dist/module.mjs +2 -2
  3. package/dist/runtime/api/index.d.ts +6 -6
  4. package/dist/runtime/api/index.mjs +2 -2
  5. package/dist/runtime/api/user-actions.d.ts +2 -2
  6. package/dist/runtime/api/user-actions.mjs +2 -2
  7. package/dist/runtime/composables/use-active-sessions.d.ts +1 -1
  8. package/dist/runtime/composables/use-active-sessions.mjs +1 -1
  9. package/dist/runtime/composables/use-app-locale.d.ts +1 -1
  10. package/dist/runtime/composables/use-app-locale.mjs +1 -1
  11. package/dist/runtime/composables/use-device.d.ts +1 -1
  12. package/dist/runtime/composables/use-helpers.d.ts +2 -2
  13. package/dist/runtime/composables/use-helpers.mjs +1 -1
  14. package/dist/runtime/composables/use-subscribe.d.ts +1 -1
  15. package/dist/runtime/composables/use-subscribe.mjs +1 -1
  16. package/dist/runtime/composables/use-theme-mode.d.ts +1 -1
  17. package/dist/runtime/composables/use-theme-mode.mjs +1 -1
  18. package/dist/runtime/composables/use-user.d.ts +1 -1
  19. package/dist/runtime/composables/use-user.mjs +1 -1
  20. package/dist/runtime/packages/{api → core}/AppProvider.vue +5 -5
  21. package/dist/runtime/packages/{api → core}/package.json +2 -2
  22. package/dist/runtime/plugin.mjs +2 -2
  23. package/dist/runtime/plugins/device.d.ts +11 -11
  24. package/dist/runtime/plugins/device.mjs +1 -1
  25. package/package.json +1 -1
  26. /package/dist/runtime/packages/{api → core}/api-client.d.ts +0 -0
  27. /package/dist/runtime/packages/{api → core}/api-client.mjs +0 -0
  28. /package/dist/runtime/packages/{api → core}/bus.d.ts +0 -0
  29. /package/dist/runtime/packages/{api → core}/bus.mjs +0 -0
  30. /package/dist/runtime/packages/{api → core}/comet-client.d.ts +0 -0
  31. /package/dist/runtime/packages/{api → core}/comet-client.mjs +0 -0
  32. /package/dist/runtime/packages/{api → core}/composables/use-active-sessions.d.ts +0 -0
  33. /package/dist/runtime/packages/{api → core}/composables/use-active-sessions.mjs +0 -0
  34. /package/dist/runtime/packages/{api → core}/composables/use-api-actions.d.ts +0 -0
  35. /package/dist/runtime/packages/{api → core}/composables/use-api-actions.mjs +0 -0
  36. /package/dist/runtime/packages/{api → core}/composables/use-app-locale.d.ts +0 -0
  37. /package/dist/runtime/packages/{api → core}/composables/use-app-locale.mjs +0 -0
  38. /package/dist/runtime/packages/{api → core}/composables/use-subscribe.d.ts +0 -0
  39. /package/dist/runtime/packages/{api → core}/composables/use-subscribe.mjs +0 -0
  40. /package/dist/runtime/packages/{api → core}/composables/use-theme-mode.d.ts +0 -0
  41. /package/dist/runtime/packages/{api → core}/composables/use-theme-mode.mjs +0 -0
  42. /package/dist/runtime/packages/{api → core}/composables/use-user.d.ts +0 -0
  43. /package/dist/runtime/packages/{api → core}/composables/use-user.mjs +0 -0
  44. /package/dist/runtime/packages/{api → core}/get-user.d.ts +0 -0
  45. /package/dist/runtime/packages/{api → core}/get-user.mjs +0 -0
  46. /package/dist/runtime/packages/{api → core}/get-visitor.d.ts +0 -0
  47. /package/dist/runtime/packages/{api → core}/get-visitor.mjs +0 -0
  48. /package/dist/runtime/packages/{api → core}/helpers/api-helper.d.ts +0 -0
  49. /package/dist/runtime/packages/{api → core}/helpers/api-helper.mjs +0 -0
  50. /package/dist/runtime/packages/{api → core}/helpers/current-device.d.ts +0 -0
  51. /package/dist/runtime/packages/{api → core}/helpers/current-device.mjs +0 -0
  52. /package/dist/runtime/packages/{api → core}/helpers/date-helper.d.ts +0 -0
  53. /package/dist/runtime/packages/{api → core}/helpers/date-helper.mjs +0 -0
  54. /package/dist/runtime/packages/{api → core}/helpers/device-helper.d.ts +0 -0
  55. /package/dist/runtime/packages/{api → core}/helpers/device-helper.mjs +0 -0
  56. /package/dist/runtime/packages/{api → core}/helpers/index.d.ts +0 -0
  57. /package/dist/runtime/packages/{api → core}/helpers/index.mjs +0 -0
  58. /package/dist/runtime/packages/{api → core}/index.d.ts +0 -0
  59. /package/dist/runtime/packages/{api → core}/index.mjs +0 -0
  60. /package/dist/runtime/packages/{api → core}/init-application.d.ts +0 -0
  61. /package/dist/runtime/packages/{api → core}/init-application.mjs +0 -0
  62. /package/dist/runtime/packages/{api → core}/refresh-token.d.ts +0 -0
  63. /package/dist/runtime/packages/{api → core}/refresh-token.mjs +0 -0
  64. /package/dist/runtime/packages/{api → core}/types.d.ts +0 -0
  65. /package/dist/runtime/packages/{api → core}/types.mjs +0 -0
  66. /package/dist/runtime/packages/{api → core}/user-actions.d.ts +0 -0
  67. /package/dist/runtime/packages/{api → core}/user-actions.mjs +0 -0
package/dist/module.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inzombieland/nuxt-common",
3
- "version": "1.17.1",
3
+ "version": "1.18.0",
4
4
  "configKey": "nuxt-common",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "0.6.0",
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.17.1";
5
+ const version = "1.18.0";
6
6
 
7
7
  const module = defineNuxtModule({
8
8
  meta: {
@@ -54,7 +54,7 @@ const module = defineNuxtModule({
54
54
  addPlugin(resolve(runtimeDir, "plugins/sanitize-url"));
55
55
  addComponent({
56
56
  name: "NuxtAppProvider",
57
- filePath: resolve(runtimeDir, "packages/api/AppProvider.vue")
57
+ filePath: resolve(runtimeDir, "packages/core/AppProvider.vue")
58
58
  });
59
59
  addComponent({
60
60
  name: "NuxtLayerManager",
@@ -1,6 +1,6 @@
1
- import { type Fetch } from "../packages/api";
2
- export { type ActiveSession, type Fetch, type User, type Visitor } from "../packages/api";
3
- export { getVisitor, getVisitorId, useUser } from "../packages/api";
1
+ import { type Fetch } from "../packages/core";
2
+ export { type ActiveSession, type Fetch, type User, type Visitor } from "../packages/core";
3
+ export { getVisitor, getVisitorId, useUser } from "../packages/core";
4
4
  export declare const config: {
5
5
  apiBaseURL: any;
6
6
  cometServerURL: any;
@@ -18,17 +18,17 @@ export declare const config: {
18
18
  };
19
19
  };
20
20
  };
21
- declare const fetch: Fetch, getUser: () => Promise<import("src/runtime/packages/api/types").GetUserResponse>, useApiFetch: () => Fetch, userActions: {
21
+ declare const fetch: Fetch, getUser: () => Promise<import("src/runtime/packages/core/types").GetUserResponse>, useApiFetch: () => Fetch, userActions: {
22
22
  signIn: (body: {
23
23
  username: string;
24
24
  password: string;
25
25
  rememberMe: boolean;
26
- }) => Promise<import("src/runtime/packages/api/types").GetUserResponse | {
26
+ }) => Promise<import("src/runtime/packages/core/types").GetUserResponse | {
27
27
  key: string;
28
28
  }>;
29
29
  logout: () => Promise<void>;
30
30
  fetchActiveSessions: () => Promise<{
31
- sessions: import("src/runtime/packages/api/types").ActiveSession[];
31
+ sessions: import("src/runtime/packages/core/types").ActiveSession[];
32
32
  }>;
33
33
  };
34
34
  export { fetch, getUser, useApiFetch, userActions };
@@ -1,7 +1,7 @@
1
1
  import { useRequestHeaders, useRequestURL } from "#imports";
2
2
  import { useDevice } from "../composables/use-device.mjs";
3
- import { initApiFetch } from "../packages/api/index.mjs";
4
- export { getVisitor, getVisitorId, useUser } from "../packages/api/index.mjs";
3
+ import { initApiFetch } from "../packages/core/index.mjs";
4
+ export { getVisitor, getVisitorId, useUser } from "../packages/core/index.mjs";
5
5
  export const config = {
6
6
  apiBaseURL: import.meta.env.VITE_API_BASE_URL,
7
7
  cometServerURL: import.meta.env.VITE_COMET_SERVER_URL,
@@ -3,7 +3,7 @@ export declare const signIn: (body: {
3
3
  username: string;
4
4
  password: string;
5
5
  rememberMe: boolean;
6
- }) => Promise<import("src/runtime/packages/api/types").GetUserResponse | {
6
+ }) => Promise<import("src/runtime/packages/core/types").GetUserResponse | {
7
7
  key: string;
8
8
  }>;
9
9
  export declare const logout: () => Promise<void>;
@@ -16,7 +16,7 @@ export declare const signInByCodeVerifyCode: (body: {
16
16
  key: string;
17
17
  code: string;
18
18
  rememberMe?: boolean;
19
- }) => Promise<import("src/runtime/packages/api/types").GetUserResponse>;
19
+ }) => Promise<import("src/runtime/packages/core/types").GetUserResponse>;
20
20
  export declare const signUp: (body: {
21
21
  email: string;
22
22
  password: string;
@@ -1,6 +1,6 @@
1
1
  import { useCookie, useRequestHeaders } from "#imports";
2
- import { useAppLocale, useThemeMode } from "../packages/api/index.mjs";
3
- import { flush, setToken, updateUser } from "../packages/api/api-client.mjs";
2
+ import { useAppLocale, useThemeMode } from "../packages/core/index.mjs";
3
+ import { flush, setToken, updateUser } from "../packages/core/api-client.mjs";
4
4
  import { fetch, getUser, userActions, useUser } from "./index.mjs";
5
5
  export const signIn = userActions.signIn;
6
6
  export const logout = userActions.logout;
@@ -1,3 +1,3 @@
1
- import { useActiveSessions } from "../packages/api";
1
+ import { useActiveSessions } from "../packages/core";
2
2
  export { useActiveSessions };
3
3
  export default useActiveSessions;
@@ -1,3 +1,3 @@
1
- import { useActiveSessions } from "../packages/api/index.mjs";
1
+ import { useActiveSessions } from "../packages/core/index.mjs";
2
2
  export { useActiveSessions };
3
3
  export default useActiveSessions;
@@ -1,3 +1,3 @@
1
- import { useAppLocale } from "../packages/api";
1
+ import { useAppLocale } from "../packages/core";
2
2
  export { useAppLocale };
3
3
  export default useAppLocale;
@@ -1,3 +1,3 @@
1
- import { useAppLocale } from "../packages/api/index.mjs";
1
+ import { useAppLocale } from "../packages/core/index.mjs";
2
2
  export { useAppLocale };
3
3
  export default useAppLocale;
@@ -1,3 +1,3 @@
1
- export declare const useDevice: () => import("src/runtime/packages/api/helpers").Device & {
1
+ export declare const useDevice: () => import("src/runtime/packages/core/helpers").Device & {
2
2
  getInfo: () => Promise<string> | string;
3
3
  };
@@ -2,8 +2,8 @@ import { once } from "../packages/helpers";
2
2
  export declare const useHelpers: () => {
3
3
  once: typeof once;
4
4
  dateHelper: {
5
- stringToDate: typeof import("src/runtime/packages/api/helpers/date-helper").stringToDate;
6
- dateFormat: typeof import("src/runtime/packages/api/helpers/date-helper").dateFormat;
5
+ stringToDate: typeof import("src/runtime/packages/core/helpers/date-helper").stringToDate;
6
+ dateFormat: typeof import("src/runtime/packages/core/helpers/date-helper").dateFormat;
7
7
  };
8
8
  phoneHelper: {
9
9
  getPlainPhoneNumber: typeof import("src/runtime/packages/helpers/phone-helper").getPlainPhoneNumber;
@@ -1,4 +1,4 @@
1
- import { dateHelper } from "../packages/api/helpers/index.mjs";
1
+ import { dateHelper } from "../packages/core/helpers/index.mjs";
2
2
  import { once, phoneHelper, stringHelper } from "../packages/helpers/index.mjs";
3
3
  export const useHelpers = () => {
4
4
  return {
@@ -1,3 +1,3 @@
1
- import { useSubscribe } from "../packages/api";
1
+ import { useSubscribe } from "../packages/core";
2
2
  export { useSubscribe };
3
3
  export default useSubscribe;
@@ -1,3 +1,3 @@
1
- import { useSubscribe } from "../packages/api/index.mjs";
1
+ import { useSubscribe } from "../packages/core/index.mjs";
2
2
  export { useSubscribe };
3
3
  export default useSubscribe;
@@ -1,3 +1,3 @@
1
- import { useThemeMode } from "../packages/api";
1
+ import { useThemeMode } from "../packages/core";
2
2
  export { useThemeMode };
3
3
  export default useThemeMode;
@@ -1,3 +1,3 @@
1
- import { useThemeMode } from "../packages/api/index.mjs";
1
+ import { useThemeMode } from "../packages/core/index.mjs";
2
2
  export { useThemeMode };
3
3
  export default useThemeMode;
@@ -1,3 +1,3 @@
1
- import { useUser } from "../packages/api";
1
+ import { useUser } from "../packages/core";
2
2
  export { useUser };
3
3
  export default useUser;
@@ -1,3 +1,3 @@
1
- import { useUser } from "../packages/api/index.mjs";
1
+ import { useUser } from "../packages/core/index.mjs";
2
2
  export { useUser };
3
3
  export default useUser;
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import { onMounted, ref } from "vue"
2
+ import { onBeforeMount, onMounted, ref } from "vue"
3
3
  import bus from "./bus"
4
4
  import { useThemeMode, useUser } from "./index"
5
5
  import type { ConfigProviderTheme } from "vant"
@@ -9,13 +9,13 @@ const theme = useThemeMode()
9
9
  const user = useUser()
10
10
  const appLoading = ref(Boolean(user.value))
11
11
 
12
+ onBeforeMount(() => {
13
+ bus.publish("app:beforeMount", true)
14
+ })
15
+
12
16
  onMounted(() => {
13
17
  appLoading.value = false
14
18
  })
15
-
16
- if (typeof window !== "undefined") {
17
- bus.publish("app:beforeMount", true)
18
- }
19
19
  </script>
20
20
 
21
21
  <template>
@@ -1,6 +1,6 @@
1
1
  {
2
- "name": "@inzombieland/api",
3
- "version": "1.17.1",
2
+ "name": "@inzombieland/core",
3
+ "version": "1.18.0",
4
4
  "type": "module",
5
5
  "license": "ISC",
6
6
  "main": "./index.mjs",
@@ -3,8 +3,8 @@ import { useNuxtApp, useRequestHeaders, useRuntimeConfig, useState } from "#impo
3
3
  import { watch } from "vue";
4
4
  import { fetch, getUser } from "./api/index.mjs";
5
5
  import { authMiddleware, guestMiddleware, localeMiddleware } from "./middleware/index.mjs";
6
- import { useThemeMode } from "./packages/api/index.mjs";
7
- import { flush, setToken, setUser } from "./packages/api/api-client.mjs";
6
+ import { useThemeMode } from "./packages/core/index.mjs";
7
+ import { flush, setToken, setUser } from "./packages/core/api-client.mjs";
8
8
  const useAuth = () => {
9
9
  return useState("auth", () => null);
10
10
  };
@@ -1,4 +1,4 @@
1
- import { deviceHelper } from "../packages/api/helpers";
1
+ import { deviceHelper } from "../packages/core/helpers";
2
2
  declare const _default: import("#app").Plugin<{
3
3
  device: {
4
4
  getInfo: () => Promise<string>;
@@ -33,11 +33,11 @@ declare const _default: import("#app").Plugin<{
33
33
  androidTabletApp: () => boolean;
34
34
  landscape: () => boolean;
35
35
  portrait: () => boolean;
36
- onChangeOrientation: (cb: (newOrientation: import("src/runtime/packages/api/helpers/device-helper").DeviceOrientation) => void) => void;
37
- noConflict: (currentDevice: import("src/runtime/packages/api/helpers/device-helper").Device) => void;
38
- type: import("src/runtime/packages/api/helpers/device-helper").DeviceType;
39
- orientation: import("src/runtime/packages/api/helpers/device-helper").DeviceOrientation;
40
- os: import("src/runtime/packages/api/helpers/device-helper").DeviceOs;
36
+ onChangeOrientation: (cb: (newOrientation: import("src/runtime/packages/core/helpers/device-helper").DeviceOrientation) => void) => void;
37
+ noConflict: (currentDevice: import("src/runtime/packages/core/helpers/device-helper").Device) => void;
38
+ type: import("src/runtime/packages/core/helpers/device-helper").DeviceType;
39
+ orientation: import("src/runtime/packages/core/helpers/device-helper").DeviceOrientation;
40
+ os: import("src/runtime/packages/core/helpers/device-helper").DeviceOs;
41
41
  osName: () => string;
42
42
  };
43
43
  }> & import("#app").ObjectPlugin<{
@@ -74,11 +74,11 @@ declare const _default: import("#app").Plugin<{
74
74
  androidTabletApp: () => boolean;
75
75
  landscape: () => boolean;
76
76
  portrait: () => boolean;
77
- onChangeOrientation: (cb: (newOrientation: import("src/runtime/packages/api/helpers/device-helper").DeviceOrientation) => void) => void;
78
- noConflict: (currentDevice: import("src/runtime/packages/api/helpers/device-helper").Device) => void;
79
- type: import("src/runtime/packages/api/helpers/device-helper").DeviceType;
80
- orientation: import("src/runtime/packages/api/helpers/device-helper").DeviceOrientation;
81
- os: import("src/runtime/packages/api/helpers/device-helper").DeviceOs;
77
+ onChangeOrientation: (cb: (newOrientation: import("src/runtime/packages/core/helpers/device-helper").DeviceOrientation) => void) => void;
78
+ noConflict: (currentDevice: import("src/runtime/packages/core/helpers/device-helper").Device) => void;
79
+ type: import("src/runtime/packages/core/helpers/device-helper").DeviceType;
80
+ orientation: import("src/runtime/packages/core/helpers/device-helper").DeviceOrientation;
81
+ os: import("src/runtime/packages/core/helpers/device-helper").DeviceOs;
82
82
  osName: () => string;
83
83
  };
84
84
  }>;
@@ -1,6 +1,6 @@
1
1
  import { defineNuxtPlugin } from "#app";
2
2
  import { useNuxtApp } from "#imports";
3
- import { deviceHelper } from "../packages/api/helpers/index.mjs";
3
+ import { deviceHelper } from "../packages/core/helpers/index.mjs";
4
4
  export default defineNuxtPlugin(() => {
5
5
  const device = deviceHelper();
6
6
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inzombieland/nuxt-common",
3
- "version": "1.17.1",
3
+ "version": "1.18.0",
4
4
  "license": "ISC",
5
5
  "type": "module",
6
6
  "exports": {
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes