@inzombieland/core 1.19.19 → 1.19.26

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 (55) hide show
  1. package/AppProvider.d.vue.ts +14 -0
  2. package/AppProvider.vue +13 -16
  3. package/AppProvider.vue.d.ts +14 -0
  4. package/api-client.d.ts +2 -1
  5. package/{api-client.mjs → api-client.js} +6 -3
  6. package/comet-client.d.ts +1 -1
  7. package/{comet-client.mjs → comet-client.js} +4 -4
  8. package/composables/index.d.ts +10 -10
  9. package/composables/index.js +10 -0
  10. package/composables/use-active-sessions.d.ts +1 -1
  11. package/composables/{use-active-sessions.mjs → use-active-sessions.js} +1 -1
  12. package/composables/use-app-locale.d.ts +1 -1
  13. package/composables/{use-subscribe.mjs → use-subscribe.js} +1 -1
  14. package/composables/use-theme-mode.d.ts +1 -1
  15. package/composables/use-user.d.ts +1 -1
  16. package/composables/use-visitor.d.ts +1 -1
  17. package/{define-vue-plugins.mjs → define-vue-plugins.js} +1 -1
  18. package/get-user.d.ts +1 -1
  19. package/{get-user.mjs → get-user.js} +3 -3
  20. package/get-visitor.d.ts +1 -1
  21. package/{get-visitor.mjs → get-visitor.js} +2 -2
  22. package/helpers/composables.d.ts +4 -4
  23. package/helpers/composables.js +4 -0
  24. package/helpers/{device-helper.mjs → device-helper.js} +1 -1
  25. package/helpers/index.d.ts +5 -5
  26. package/helpers/{index.mjs → index.js} +5 -5
  27. package/index.d.ts +18 -18
  28. package/{index.mjs → index.js} +11 -11
  29. package/{init-application.mjs → init-application.js} +3 -3
  30. package/package.json +1 -1
  31. package/plugins/index.d.ts +2 -2
  32. package/plugins/index.js +2 -0
  33. package/plugins/{sanitize-url.mjs → sanitize-url.js} +1 -1
  34. package/refresh-token.d.ts +1 -1
  35. package/{refresh-token.mjs → refresh-token.js} +2 -2
  36. package/user-actions.d.ts +1 -1
  37. package/{user-actions.mjs → user-actions.js} +5 -4
  38. package/composables/index.mjs +0 -10
  39. package/helpers/composables.mjs +0 -4
  40. package/plugins/index.mjs +0 -2
  41. /package/{bus.mjs → bus.js} +0 -0
  42. /package/composables/{use-api-actions.mjs → use-api-actions.js} +0 -0
  43. /package/composables/{use-app-locale.mjs → use-app-locale.js} +0 -0
  44. /package/composables/{use-cookies.mjs → use-cookies.js} +0 -0
  45. /package/composables/{use-theme-mode.mjs → use-theme-mode.js} +0 -0
  46. /package/composables/{use-user.mjs → use-user.js} +0 -0
  47. /package/composables/{use-validators.mjs → use-validators.js} +0 -0
  48. /package/composables/{use-visitor.mjs → use-visitor.js} +0 -0
  49. /package/helpers/{api-helper.mjs → api-helper.js} +0 -0
  50. /package/helpers/{current-device.mjs → current-device.js} +0 -0
  51. /package/helpers/{phone-helper.mjs → phone-helper.js} +0 -0
  52. /package/helpers/{string-helper.mjs → string-helper.js} +0 -0
  53. /package/plugins/{sanitize-html.mjs → sanitize-html.js} +0 -0
  54. /package/thirdparty/sanitize-url/{index.mjs → index.js} +0 -0
  55. /package/{types.mjs → types.js} +0 -0
@@ -0,0 +1,14 @@
1
+ export declare const useBus: () => {
2
+ publish<T>(eventName: string, data: T): void;
3
+ subscribe<T>(eventName: string, func: (data: T) => void): import("rxjs").Subscription;
4
+ unsubscribeAll(): void;
5
+ };
6
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, {
7
+ default?: (props: {}) => any;
8
+ }>;
9
+ export default _default;
10
+ type __VLS_WithSlots<T, S> = T & {
11
+ new (): {
12
+ $slots: S;
13
+ };
14
+ };
package/AppProvider.vue CHANGED
@@ -1,24 +1,21 @@
1
- <script setup lang="ts">
2
- import { onBeforeMount, onMounted, ref } from "vue"
3
- import bus from "./bus"
4
- import { useUser } from "./index"
5
-
6
- const user = useUser()
7
- const appLoading = ref(Boolean(user.value))
8
-
1
+ <script setup>
2
+ import { onBeforeMount, onMounted, ref } from "vue";
3
+ import bus from "./bus";
4
+ import { useUser } from "./index";
5
+ const user = useUser();
6
+ const appLoading = ref(Boolean(user.value));
9
7
  onBeforeMount(() => {
10
- bus.publish("app:beforeMount", true)
11
- })
12
-
8
+ bus.publish("app:beforeMount", true);
9
+ });
13
10
  onMounted(() => {
14
- appLoading.value = false
15
- })
11
+ appLoading.value = false;
12
+ });
16
13
  </script>
17
14
 
18
- <script lang="ts">
15
+ <script>
19
16
  export const useBus = () => {
20
- return bus
21
- }
17
+ return bus;
18
+ };
22
19
  </script>
23
20
 
24
21
  <template>
@@ -0,0 +1,14 @@
1
+ export declare const useBus: () => {
2
+ publish<T>(eventName: string, data: T): void;
3
+ subscribe<T>(eventName: string, func: (data: T) => void): import("rxjs").Subscription;
4
+ unsubscribeAll(): void;
5
+ };
6
+ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, {
7
+ default?: (props: {}) => any;
8
+ }>;
9
+ export default _default;
10
+ type __VLS_WithSlots<T, S> = T & {
11
+ new (): {
12
+ $slots: S;
13
+ };
14
+ };
package/api-client.d.ts CHANGED
@@ -1,9 +1,10 @@
1
- import type { Fetch, FetchConfig, FetchExtraOptions as FetchOptions, User } from "./types";
1
+ import type { Fetch, FetchConfig, FetchExtraOptions as FetchOptions, User } from "./types.js";
2
2
  export declare const setUser: (newUser?: User | null) => void;
3
3
  export declare const updateUser: (newUser: Partial<User>) => void;
4
4
  export declare const getToken: () => string | null | undefined;
5
5
  export declare const setToken: (newToken?: string | null) => void;
6
6
  export declare const getSecretKey: () => string | undefined;
7
7
  export declare const setSecretKey: (newSecretKey?: string) => void;
8
+ export declare const setVisitorId: (visitorId?: string) => void;
8
9
  export declare const flush: () => void;
9
10
  export declare const createApiFetch: (fetch: Fetch, config: FetchConfig) => (url: string, options?: FetchOptions) => Promise<any>;
@@ -1,6 +1,6 @@
1
- import { useApiActions, useUser, useVisitor } from "./composables/index.mjs";
2
- import { apiHelper, once } from "./helpers/index.mjs";
3
- import { useBus } from "./index.mjs";
1
+ import { useApiActions, useUser, useVisitor } from "./composables/index.js";
2
+ import { apiHelper, once } from "./helpers/index.js";
3
+ import { useBus } from "./index.js";
4
4
  let token = null;
5
5
  let secretKey;
6
6
  export const setUser = (newUser) => {
@@ -27,6 +27,9 @@ export const getSecretKey = () => {
27
27
  export const setSecretKey = (newSecretKey) => {
28
28
  secretKey = newSecretKey;
29
29
  };
30
+ export const setVisitorId = (visitorId) => {
31
+ localStorage.setItem("vid", visitorId);
32
+ };
30
33
  export const flush = () => {
31
34
  setToken(null);
32
35
  setUser(null);
package/comet-client.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { User } from "./types";
1
+ import type { User } from "./types.js";
2
2
  declare global {
3
3
  interface Window {
4
4
  wsPublish: (eventName: string, data: unknown) => void;
@@ -1,8 +1,8 @@
1
1
  import { Centrifuge } from "centrifuge";
2
- import { getToken } from "./api-client.mjs";
3
- import { useApiActions } from "./composables/index.mjs";
4
- import { apiHelper } from "./helpers/index.mjs";
5
- import { useBus } from "./index.mjs";
2
+ import { getToken } from "./api-client.js";
3
+ import { useApiActions } from "./composables/index.js";
4
+ import { apiHelper } from "./helpers/index.js";
5
+ import { useBus } from "./index.js";
6
6
  if (typeof window !== "undefined" && import.meta.env.VITE_MODE !== "production") {
7
7
  window.wsPublish = (eventName, data) => {
8
8
  const bus = useBus();
@@ -1,10 +1,10 @@
1
- export * from "../helpers/composables";
2
- export * from "./use-active-sessions";
3
- export { useApiActions } from "./use-api-actions";
4
- export { useAppLocale } from "./use-app-locale";
5
- export { useCookies } from "./use-cookies";
6
- export { useSubscribe } from "./use-subscribe";
7
- export { useThemeMode } from "./use-theme-mode";
8
- export { useUser } from "./use-user";
9
- export { useValidators } from "./use-validators";
10
- export { useVisitor } from "./use-visitor";
1
+ export * from "../helpers/composables.js";
2
+ export * from "./use-active-sessions.js";
3
+ export { useApiActions } from "./use-api-actions.js";
4
+ export { useAppLocale } from "./use-app-locale.js";
5
+ export { useCookies } from "./use-cookies.js";
6
+ export { useSubscribe } from "./use-subscribe.js";
7
+ export { useThemeMode } from "./use-theme-mode.js";
8
+ export { useUser } from "./use-user.js";
9
+ export { useValidators } from "./use-validators.js";
10
+ export { useVisitor } from "./use-visitor.js";
@@ -0,0 +1,10 @@
1
+ export * from "../helpers/composables.js";
2
+ export * from "./use-active-sessions.js";
3
+ export { useApiActions } from "./use-api-actions.js";
4
+ export { useAppLocale } from "./use-app-locale.js";
5
+ export { useCookies } from "./use-cookies.js";
6
+ export { useSubscribe } from "./use-subscribe.js";
7
+ export { useThemeMode } from "./use-theme-mode.js";
8
+ export { useUser } from "./use-user.js";
9
+ export { useValidators } from "./use-validators.js";
10
+ export { useVisitor } from "./use-visitor.js";
@@ -1,4 +1,4 @@
1
- import type { ActiveSession } from "../types";
1
+ import type { ActiveSession } from "../types.js";
2
2
  export declare function useActiveSessions(): import("vue").Ref<{
3
3
  id: string;
4
4
  visitorId: string;
@@ -1,5 +1,5 @@
1
1
  import { ref } from "vue";
2
- import { useBus, useUserActions } from "../index.mjs";
2
+ import { useBus, useUserActions } from "../index.js";
3
3
  const activeSessions = ref([]);
4
4
  export function useActiveSessions() {
5
5
  const userActions = useUserActions();
@@ -1 +1 @@
1
- export declare const useAppLocale: () => import("@vueuse/shared").RemovableRef<any>;
1
+ export declare const useAppLocale: () => any;
@@ -1,5 +1,5 @@
1
1
  import { onMounted, onUnmounted } from "vue";
2
- import { useBus } from "../index.mjs";
2
+ import { useBus } from "../index.js";
3
3
  export const useSubscribe = (eventName, func, options = { once: false, unsubscribeOnUnmount: true }) => {
4
4
  const bus = useBus();
5
5
  let subscription;
@@ -1 +1 @@
1
- export declare const useThemeMode: () => import("@vueuse/shared").RemovableRef<any>;
1
+ export declare const useThemeMode: () => any;
@@ -1,4 +1,4 @@
1
- import type { User } from "../types";
1
+ import type { User } from "../types.js";
2
2
  export declare function useUser(): import("vue").Ref<{
3
3
  id: string;
4
4
  firstName: string;
@@ -1,4 +1,4 @@
1
- import type { Visitor } from "../types";
1
+ import type { Visitor } from "../types.js";
2
2
  export declare function useVisitor(): import("vue").Ref<{
3
3
  id?: string | undefined;
4
4
  ip?: string | undefined;
@@ -1,4 +1,4 @@
1
- import { defineSanitizeHtmlPlugin, defineSanitizeUrlPlugin } from "./plugins/index.mjs";
1
+ import { defineSanitizeHtmlPlugin, defineSanitizeUrlPlugin } from "./plugins/index.js";
2
2
  export function defineVuePlugins(app) {
3
3
  defineSanitizeHtmlPlugin(app);
4
4
  defineSanitizeUrlPlugin(app);
package/get-user.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import type { Fetch, FetchConfig, GetUserResponse } from "./types";
1
+ import type { Fetch, FetchConfig, GetUserResponse } from "./types.js";
2
2
  export declare const createApiGetUser: (fetch: Fetch, config: FetchConfig) => () => Promise<GetUserResponse>;
@@ -1,7 +1,7 @@
1
1
  import { useLocalStorage } from "@vueuse/core";
2
- import { flush, getSecretKey, getToken, setUser } from "./api-client.mjs";
3
- import { useApiActions, useUser } from "./composables/index.mjs";
4
- import { createSingletonAsync, once } from "./helpers/index.mjs";
2
+ import { flush, getSecretKey, getToken, setUser } from "./api-client.js";
3
+ import { useApiActions, useUser } from "./composables/index.js";
4
+ import { createSingletonAsync, once } from "./helpers/index.js";
5
5
  async function getUserRequest(fetch, config) {
6
6
  const token = getToken();
7
7
  const user = useUser();
package/get-visitor.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import type { FetchConfig } from "./types";
1
+ import type { FetchConfig } from "./types.js";
2
2
  export declare const createApiGetVisitorIdentifier: (config: FetchConfig) => () => Promise<void>;
@@ -1,6 +1,6 @@
1
1
  import { hashComponents, load } from "@fingerprintjs/fingerprintjs";
2
- import { useVisitor } from "./composables/index.mjs";
3
- import { createSingletonAsync, once } from "./helpers/index.mjs";
2
+ import { useVisitor } from "./composables/index.js";
3
+ import { createSingletonAsync, once } from "./helpers/index.js";
4
4
  const setVisitor = (newVisitor) => {
5
5
  const visitor = useVisitor();
6
6
  visitor.value = !visitor.value ? newVisitor : { ...visitor.value, ...newVisitor };
@@ -1,4 +1,4 @@
1
- export { useApiHelper } from "./api-helper";
2
- export { useDevice } from "./device-helper";
3
- export { usePhoneHelper } from "./phone-helper";
4
- export { useStringHelper } from "./string-helper";
1
+ export { useApiHelper } from "./api-helper.js";
2
+ export { useDevice } from "./device-helper.js";
3
+ export { usePhoneHelper } from "./phone-helper.js";
4
+ export { useStringHelper } from "./string-helper.js";
@@ -0,0 +1,4 @@
1
+ export { useApiHelper } from "./api-helper.js";
2
+ export { useDevice } from "./device-helper.js";
3
+ export { usePhoneHelper } from "./phone-helper.js";
4
+ export { useStringHelper } from "./string-helper.js";
@@ -1,4 +1,4 @@
1
- import { device as currentDevice } from "./current-device.mjs";
1
+ import { device as currentDevice } from "./current-device.js";
2
2
  export const deviceHelper = () => {
3
3
  const device = currentDevice;
4
4
  const isMobileApp = import.meta.env.VITE_IS_MOBILE_APP === "true" || import.meta.env.VITE_IS_MOBILE_APP === true;
@@ -1,7 +1,7 @@
1
- export { apiHelper } from "./api-helper";
2
- export { deviceHelper, type Device } from "./device-helper";
3
- export { phoneHelper } from "./phone-helper";
4
- export { stringHelper } from "./string-helper";
5
- export * from "./composables";
1
+ export { apiHelper } from "./api-helper.js";
2
+ export { deviceHelper, type Device } from "./device-helper.js";
3
+ export { phoneHelper } from "./phone-helper.js";
4
+ export { stringHelper } from "./string-helper.js";
5
+ export * from "./composables.js";
6
6
  export declare function once<T extends (...args: any[]) => any>(fn: T): T;
7
7
  export declare function createSingletonAsync<T, Args extends unknown[]>(fn: (...args: Args) => Promise<T>): (...args: Args) => Promise<T>;
@@ -1,8 +1,8 @@
1
- export { apiHelper } from "./api-helper.mjs";
2
- export { deviceHelper } from "./device-helper.mjs";
3
- export { phoneHelper } from "./phone-helper.mjs";
4
- export { stringHelper } from "./string-helper.mjs";
5
- export * from "./composables.mjs";
1
+ export { apiHelper } from "./api-helper.js";
2
+ export { deviceHelper } from "./device-helper.js";
3
+ export { phoneHelper } from "./phone-helper.js";
4
+ export { stringHelper } from "./string-helper.js";
5
+ export * from "./composables.js";
6
6
  export function once(fn) {
7
7
  let executed = false;
8
8
  let result;
package/index.d.ts CHANGED
@@ -1,22 +1,22 @@
1
1
  import { type Ref } from "vue";
2
- import type { Fetch, FetchConfig } from "./types";
3
- export { defineVuePlugins } from "./define-vue-plugins";
4
- export { default as AppProvider, useBus } from "./AppProvider.vue";
5
- export * from "./composables";
6
- export * from "./types";
2
+ import type { Fetch, FetchConfig } from "./types.js";
3
+ export { defineVuePlugins } from "./define-vue-plugins.js";
4
+ export { default as AppProvider, useBus } from "./AppProvider.vue.js";
5
+ export * from "./composables/index.js";
6
+ export * from "./types.js";
7
7
  export declare function initApiFetch($fetch: Fetch, config: FetchConfig): {
8
8
  fetch: Fetch;
9
- getUser: () => Promise<import("./types").GetUserResponse>;
9
+ getUser: () => Promise<import("./types.js").GetUserResponse>;
10
10
  useApiFetch: () => Fetch;
11
11
  userActions: {
12
- signIn: (body: Record<string, any>) => Promise<import("./types").GetUserResponse | {
12
+ signIn: (body: Record<string, any>) => Promise<import("./types.js").GetUserResponse | {
13
13
  key: string;
14
14
  }>;
15
15
  signInByCodeSendCode: (body: Record<string, any>) => Promise<{
16
16
  key: string;
17
17
  }>;
18
- signInByCodeVerifyCode: (body: Record<string, any>) => Promise<import("./types").GetUserResponse>;
19
- getToken: (body: Record<string, any>) => Promise<import("./types").GetUserResponse>;
18
+ signInByCodeVerifyCode: (body: Record<string, any>) => Promise<import("./types.js").GetUserResponse>;
19
+ getToken: (body: Record<string, any>) => Promise<import("./types.js").GetUserResponse>;
20
20
  signUp: (body: Record<string, any>) => Promise<{
21
21
  key: string;
22
22
  }>;
@@ -91,7 +91,7 @@ export declare function initApiFetch($fetch: Fetch, config: FetchConfig): {
91
91
  changeAvatar: (body: FormData) => Promise<void>;
92
92
  deleteAvatar: () => Promise<void>;
93
93
  fetchActiveSessions: () => Promise<{
94
- sessions: import("./types").ActiveSession[];
94
+ sessions: import("./types.js").ActiveSession[];
95
95
  }>;
96
96
  logoutActiveSession: (body: {
97
97
  sessionId: string;
@@ -108,14 +108,14 @@ export declare function initApiFetch($fetch: Fetch, config: FetchConfig): {
108
108
  };
109
109
  };
110
110
  export declare const useUserActions: () => Ref<{
111
- signIn: (body: Record<string, any>) => Promise<import("./types").GetUserResponse | {
111
+ signIn: (body: Record<string, any>) => Promise<import("./types.js").GetUserResponse | {
112
112
  key: string;
113
113
  }>;
114
114
  signInByCodeSendCode: (body: Record<string, any>) => Promise<{
115
115
  key: string;
116
116
  }>;
117
- signInByCodeVerifyCode: (body: Record<string, any>) => Promise<import("./types").GetUserResponse>;
118
- getToken: (body: Record<string, any>) => Promise<import("./types").GetUserResponse>;
117
+ signInByCodeVerifyCode: (body: Record<string, any>) => Promise<import("./types.js").GetUserResponse>;
118
+ getToken: (body: Record<string, any>) => Promise<import("./types.js").GetUserResponse>;
119
119
  signUp: (body: Record<string, any>) => Promise<{
120
120
  key: string;
121
121
  }>;
@@ -190,7 +190,7 @@ export declare const useUserActions: () => Ref<{
190
190
  changeAvatar: (body: FormData) => Promise<void>;
191
191
  deleteAvatar: () => Promise<void>;
192
192
  fetchActiveSessions: () => Promise<{
193
- sessions: import("./types").ActiveSession[];
193
+ sessions: import("./types.js").ActiveSession[];
194
194
  }>;
195
195
  logoutActiveSession: (body: {
196
196
  sessionId: string;
@@ -205,14 +205,14 @@ export declare const useUserActions: () => Ref<{
205
205
  code: string;
206
206
  }) => Promise<void>;
207
207
  }, {
208
- signIn: (body: Record<string, any>) => Promise<import("./types").GetUserResponse | {
208
+ signIn: (body: Record<string, any>) => Promise<import("./types.js").GetUserResponse | {
209
209
  key: string;
210
210
  }>;
211
211
  signInByCodeSendCode: (body: Record<string, any>) => Promise<{
212
212
  key: string;
213
213
  }>;
214
- signInByCodeVerifyCode: (body: Record<string, any>) => Promise<import("./types").GetUserResponse>;
215
- getToken: (body: Record<string, any>) => Promise<import("./types").GetUserResponse>;
214
+ signInByCodeVerifyCode: (body: Record<string, any>) => Promise<import("./types.js").GetUserResponse>;
215
+ getToken: (body: Record<string, any>) => Promise<import("./types.js").GetUserResponse>;
216
216
  signUp: (body: Record<string, any>) => Promise<{
217
217
  key: string;
218
218
  }>;
@@ -287,7 +287,7 @@ export declare const useUserActions: () => Ref<{
287
287
  changeAvatar: (body: FormData) => Promise<void>;
288
288
  deleteAvatar: () => Promise<void>;
289
289
  fetchActiveSessions: () => Promise<{
290
- sessions: import("./types").ActiveSession[];
290
+ sessions: import("./types.js").ActiveSession[];
291
291
  }>;
292
292
  logoutActiveSession: (body: {
293
293
  sessionId: string;
@@ -1,18 +1,18 @@
1
1
  import { useLocalStorage } from "@vueuse/core";
2
2
  import { ref } from "vue";
3
- import { createApiFetch } from "./api-client.mjs";
3
+ import { createApiFetch } from "./api-client.js";
4
4
  import { useBus } from "./AppProvider.vue";
5
- import { newCometClient } from "./comet-client.mjs";
6
- import { useApiActions } from "./composables/index.mjs";
7
- import { createApiGetUser } from "./get-user.mjs";
8
- import { createApiGetVisitorIdentifier } from "./get-visitor.mjs";
9
- import { createInitApplication } from "./init-application.mjs";
10
- import { createApiRefreshToken } from "./refresh-token.mjs";
11
- import { createApiUserActions } from "./user-actions.mjs";
12
- export { defineVuePlugins } from "./define-vue-plugins.mjs";
5
+ import { newCometClient } from "./comet-client.js";
6
+ import { useApiActions } from "./composables/index.js";
7
+ import { createApiGetUser } from "./get-user.js";
8
+ import { createApiGetVisitorIdentifier } from "./get-visitor.js";
9
+ import { createInitApplication } from "./init-application.js";
10
+ import { createApiRefreshToken } from "./refresh-token.js";
11
+ import { createApiUserActions } from "./user-actions.js";
12
+ export { defineVuePlugins } from "./define-vue-plugins.js";
13
13
  export { default as AppProvider, useBus } from "./AppProvider.vue";
14
- export * from "./composables/index.mjs";
15
- export * from "./types.mjs";
14
+ export * from "./composables/index.js";
15
+ export * from "./types.js";
16
16
  const apiActions = useApiActions();
17
17
  let userActions;
18
18
  export function initApiFetch($fetch, config) {
@@ -1,9 +1,9 @@
1
1
  import { watch } from "vue";
2
2
  import { useI18n } from "vue-i18n";
3
3
  import { useRouter } from "vue-router";
4
- import { useActiveSessions, useCookies, useSubscribe, useUser } from "./composables/index.mjs";
5
- import { once } from "./helpers/index.mjs";
6
- import { useAppLocale, useThemeMode, useUserActions, useVisitor } from "./index.mjs";
4
+ import { useActiveSessions, useCookies, useSubscribe, useUser } from "./composables/index.js";
5
+ import { once } from "./helpers/index.js";
6
+ import { useAppLocale, useThemeMode, useUserActions, useVisitor } from "./index.js";
7
7
  function initApplication() {
8
8
  const router = useRouter();
9
9
  const user = useUser();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inzombieland/core",
3
- "version": "1.19.19",
3
+ "version": "1.19.26",
4
4
  "type": "module",
5
5
  "license": "ISC",
6
6
  "main": "./index.mjs",
@@ -1,2 +1,2 @@
1
- export * from "./sanitize-html";
2
- export * from "./sanitize-url";
1
+ export * from "./sanitize-html.js";
2
+ export * from "./sanitize-url.js";
@@ -0,0 +1,2 @@
1
+ export * from "./sanitize-html.js";
2
+ export * from "./sanitize-url.js";
@@ -1,4 +1,4 @@
1
- import { sanitizeUrl } from "../thirdparty/sanitize-url/index.mjs";
1
+ import { sanitizeUrl } from "../thirdparty/sanitize-url/index.js";
2
2
  export function defineSanitizeUrlPlugin(app) {
3
3
  app.directive("sanitize-url", (el, binding) => {
4
4
  if (binding.value !== binding.oldValue) {
@@ -1,2 +1,2 @@
1
- import type { Fetch, FetchConfig } from "./types";
1
+ import type { Fetch, FetchConfig } from "./types.js";
2
2
  export declare const createApiRefreshToken: (fetch: Fetch, config: FetchConfig) => () => Promise<string>;
@@ -1,5 +1,5 @@
1
- import { flush, setToken } from "./api-client.mjs";
2
- import { createSingletonAsync, once } from "./helpers/index.mjs";
1
+ import { flush, setToken } from "./api-client.js";
2
+ import { createSingletonAsync, once } from "./helpers/index.js";
3
3
  async function refreshTokenRequest(fetch, config) {
4
4
  setToken(null);
5
5
  try {
package/user-actions.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ActiveSession, Fetch, FetchConfig, GetUserResponse } from "./types";
1
+ import type { ActiveSession, Fetch, FetchConfig, GetUserResponse } from "./types.js";
2
2
  export type UserActions = ReturnType<typeof createApiUserActions>;
3
3
  export declare const createApiUserActions: (fetch: Fetch, config: FetchConfig, getUser: () => Promise<GetUserResponse>) => {
4
4
  signIn: (body: Record<string, any>) => Promise<GetUserResponse | {
@@ -1,6 +1,6 @@
1
- import { flush, setSecretKey, setToken, updateUser } from "./api-client.mjs";
2
- import { useUser } from "./composables/index.mjs";
3
- import { once } from "./helpers/index.mjs";
1
+ import { flush, setSecretKey, setVisitorId, setToken, updateUser } from "./api-client.js";
2
+ import { useUser } from "./composables/index.js";
3
+ import { once } from "./helpers/index.js";
4
4
  export const createApiUserActions = once(
5
5
  (fetch, config, getUser) => {
6
6
  return {
@@ -36,12 +36,13 @@ export const createApiUserActions = once(
36
36
  ...config.useRequestHeaders?.(["cookie"]) ?? {}
37
37
  }
38
38
  );
39
- const { accessToken, secretKey, ...rest } = response;
39
+ const { accessToken, secretKey, visitorId, ...rest } = response;
40
40
  if (!accessToken) {
41
41
  throw rest;
42
42
  }
43
43
  setToken(accessToken);
44
44
  setSecretKey(secretKey);
45
+ setVisitorId(visitorId);
45
46
  return await getUser();
46
47
  },
47
48
  getToken: async (body) => {
@@ -1,10 +0,0 @@
1
- export * from "../helpers/composables.mjs";
2
- export * from "./use-active-sessions.mjs";
3
- export { useApiActions } from "./use-api-actions.mjs";
4
- export { useAppLocale } from "./use-app-locale.mjs";
5
- export { useCookies } from "./use-cookies.mjs";
6
- export { useSubscribe } from "./use-subscribe.mjs";
7
- export { useThemeMode } from "./use-theme-mode.mjs";
8
- export { useUser } from "./use-user.mjs";
9
- export { useValidators } from "./use-validators.mjs";
10
- export { useVisitor } from "./use-visitor.mjs";
@@ -1,4 +0,0 @@
1
- export { useApiHelper } from "./api-helper.mjs";
2
- export { useDevice } from "./device-helper.mjs";
3
- export { usePhoneHelper } from "./phone-helper.mjs";
4
- export { useStringHelper } from "./string-helper.mjs";
package/plugins/index.mjs DELETED
@@ -1,2 +0,0 @@
1
- export * from "./sanitize-html.mjs";
2
- export * from "./sanitize-url.mjs";
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes