@inzombieland/nuxt-common 1.19.14 → 1.19.15
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/packages/core/api-client.mjs +1 -1
- package/dist/runtime/packages/core/comet-client.mjs +3 -3
- package/dist/runtime/packages/core/composables/use-cookies.mjs +1 -1
- package/dist/runtime/packages/core/index.mjs +1 -1
- package/dist/runtime/packages/core/package.json +1 -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.19.
|
|
5
|
+
const version = "1.19.15";
|
|
6
6
|
|
|
7
7
|
const module = defineNuxtModule({
|
|
8
8
|
meta: {
|
|
@@ -62,7 +62,7 @@ const successHandler = async (response, options = {}) => {
|
|
|
62
62
|
}
|
|
63
63
|
function resolveData(resData) {
|
|
64
64
|
const data = apiHelper.convertToClient(resData);
|
|
65
|
-
if (import.meta.env.
|
|
65
|
+
if (import.meta.env.VITE_MODE !== "production" && checkResponse && !checkResponse(data)?.success) {
|
|
66
66
|
console.error(checkResponse(data).error);
|
|
67
67
|
}
|
|
68
68
|
return data;
|
|
@@ -3,7 +3,7 @@ import { getToken } from "./api-client.mjs";
|
|
|
3
3
|
import { useApiActions } from "./composables/index.mjs";
|
|
4
4
|
import { apiHelper } from "./helpers/index.mjs";
|
|
5
5
|
import { useBus } from "./index.mjs";
|
|
6
|
-
if (typeof window !== "undefined" && import.meta.env.
|
|
6
|
+
if (typeof window !== "undefined" && import.meta.env.VITE_MODE !== "production") {
|
|
7
7
|
window.wsPublish = (eventName, data) => {
|
|
8
8
|
const bus = useBus();
|
|
9
9
|
setTimeout(() => bus.publish(`WS.${eventName}`, data), 0);
|
|
@@ -26,7 +26,7 @@ export function newCometClient(user, cometServerURL) {
|
|
|
26
26
|
];
|
|
27
27
|
const centrifuge = new Centrifuge(transports, {
|
|
28
28
|
token: getToken() ?? "",
|
|
29
|
-
debug: import.meta.env.
|
|
29
|
+
debug: import.meta.env.VITE_MODE !== "production",
|
|
30
30
|
getToken: async () => {
|
|
31
31
|
const apiActions = useApiActions();
|
|
32
32
|
return await apiActions.value?.refreshToken?.() ?? "";
|
|
@@ -49,7 +49,7 @@ export function newCometClient(user, cometServerURL) {
|
|
|
49
49
|
message.data.forEach((event) => {
|
|
50
50
|
const eventName = event.NotificationName;
|
|
51
51
|
const data = event.Data;
|
|
52
|
-
if (import.meta.env.
|
|
52
|
+
if (import.meta.env.VITE_MODE !== "production") {
|
|
53
53
|
console.log("IO event handled:", eventName, data);
|
|
54
54
|
if (!eventName) {
|
|
55
55
|
console.log(`[${/* @__PURE__ */ new Date()}] Comet: no name event`);
|
|
@@ -24,7 +24,7 @@ export function useCookies(name, _opts) {
|
|
|
24
24
|
const shouldSetInitialClientCookie = hasExpired || cookies[name] === void 0 || cookies[name] === null;
|
|
25
25
|
const cookieValue = klona(hasExpired ? void 0 : cookies[name] ?? opts.default?.());
|
|
26
26
|
const cookie = delay && !hasExpired ? cookieRef(cookieValue, delay, opts.watch && opts.watch !== "shallow") : ref(cookieValue);
|
|
27
|
-
if (import.meta.env.
|
|
27
|
+
if (import.meta.env.VITE_MODE !== "production" && hasExpired) {
|
|
28
28
|
console.warn(`not setting cookie \`${name}\` as it has already expired.`);
|
|
29
29
|
}
|
|
30
30
|
let channel = null;
|
|
@@ -43,7 +43,7 @@ export function initApiFetch($fetch, config) {
|
|
|
43
43
|
});
|
|
44
44
|
const subscription = bus.subscribe("app:beforeMount", () => {
|
|
45
45
|
subscription.unsubscribe();
|
|
46
|
-
console.log("Service started in mode", import.meta.env.
|
|
46
|
+
console.log("Service started in mode", import.meta.env.VITE_MODE);
|
|
47
47
|
getVisitorIdentifier();
|
|
48
48
|
initApplication();
|
|
49
49
|
});
|