flowrix 1.0.1-beta.54 → 1.0.1-beta.56

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "flowrix",
3
3
  "configKey": "flowrix",
4
- "version": "1.0.1-beta.54",
4
+ "version": "1.0.1-beta.56",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
package/dist/module.mjs CHANGED
@@ -262,6 +262,10 @@ const module$1 = defineNuxtModule({
262
262
  route: "/api/product/**",
263
263
  handler: resolver.resolve("./runtime/server/api/product/[...slug]")
264
264
  });
265
+ addServerHandler({
266
+ route: "/api/quickview/:slug",
267
+ handler: resolver.resolve("./runtime/server/api/quickview/[slug]")
268
+ });
265
269
  addServerHandler({
266
270
  route: "/api/service/:slug",
267
271
  handler: resolver.resolve("./runtime/server/api/service/[slug]")
@@ -0,0 +1,7 @@
1
+ export declare const useQuickView: (slug: string) => {
2
+ data: any;
3
+ error: any;
4
+ refresh: any;
5
+ execute: any;
6
+ pending: any;
7
+ };
@@ -0,0 +1,20 @@
1
+ import { useFetch } from "#imports";
2
+ import { readonly } from "vue";
3
+ export const useQuickView = (slug) => {
4
+ const { data, error, refresh, execute, pending } = useFetch(
5
+ `/api/quickview/${slug}`,
6
+ {
7
+ key: `quickview-${slug}`,
8
+ lazy: true,
9
+ server: false,
10
+ default: () => null
11
+ }
12
+ );
13
+ return {
14
+ data: readonly(data),
15
+ error: readonly(error),
16
+ refresh,
17
+ execute,
18
+ pending: readonly(pending)
19
+ };
20
+ };
@@ -10,8 +10,6 @@ export * from './Cart/useCartDetail.js';
10
10
  export * from './Category/useCategoryContent.js';
11
11
  export * from './Category/useCategoryGrid.js';
12
12
  export * from './Category/useCategoryIndex.js';
13
- export * from './Category/useCategoryTemplate2.js';
14
- export * from './Category/useCategoryTemplate3.js';
15
13
  export * from './Category/useCategoryTop.js';
16
14
  export * from './Checkout/useBillingAddress.js';
17
15
  export * from './Checkout/useCheckout.js';
@@ -55,20 +53,18 @@ export * from './SideBar/useSideBar.js';
55
53
  export * from './SideBar/Filters/useFilters.js';
56
54
  export * from './SideBar/Filters/useSorting.js';
57
55
  export { useAddresses } from './useAddresses.js';
56
+ export { useQuickView } from './Product/useQuickView.js';
58
57
  export { useAddToCart } from './useAddToCart.js';
59
58
  export { useAuth } from './useAuth.js';
60
59
  export { useCards } from './useCards.js';
61
60
  export { useClientApi } from './useClientApi.js';
62
61
  export { useCountries } from './useCountries.js';
63
- export { useDataLayer } from './useDataLayer.js';
64
62
  export { useDynamicHtmlRenderer } from './useDynamicHtmlRenderer.js';
65
63
  export { useLocation } from './useLocation.js';
66
64
  export { useLocations } from './useLocations.js';
67
- export { useMetaLayer } from './useMetaLayer.js';
68
65
  export { useOrders } from './useOrders.js';
69
66
  export { useQuotations } from './useQuotations.js';
70
67
  export { useSearch } from './useSearch.js';
71
68
  export { useSubscriptions } from './useSubscriptions.js';
72
- export { useTikTokDatalayer } from './useTikTokDatalayer.js';
73
69
  export { useWebforms } from './useWebforms.js';
74
70
  export { useWishlists } from './useWishlists.js';
@@ -10,8 +10,6 @@ export * from "./Cart/useCartDetail.js";
10
10
  export * from "./Category/useCategoryContent.js";
11
11
  export * from "./Category/useCategoryGrid.js";
12
12
  export * from "./Category/useCategoryIndex.js";
13
- export * from "./Category/useCategoryTemplate2";
14
- export * from "./Category/useCategoryTemplate3";
15
13
  export * from "./Category/useCategoryTop.js";
16
14
  export * from "./Checkout/useBillingAddress.js";
17
15
  export * from "./Checkout/useCheckout.js";
@@ -55,20 +53,18 @@ export * from "./SideBar/useSideBar.js";
55
53
  export * from "./SideBar/Filters/useFilters.js";
56
54
  export * from "./SideBar/Filters/useSorting.js";
57
55
  export { useAddresses } from "./useAddresses.js";
56
+ export { useQuickView } from "./Product/useQuickView.js";
58
57
  export { useAddToCart } from "./useAddToCart.js";
59
58
  export { useAuth } from "./useAuth.js";
60
59
  export { useCards } from "./useCards.js";
61
60
  export { useClientApi } from "./useClientApi.js";
62
61
  export { useCountries } from "./useCountries.js";
63
- export { useDataLayer } from "./useDataLayer.js";
64
62
  export { useDynamicHtmlRenderer } from "./useDynamicHtmlRenderer.js";
65
63
  export { useLocation } from "./useLocation.js";
66
64
  export { useLocations } from "./useLocations.js";
67
- export { useMetaLayer } from "./useMetaLayer.js";
68
65
  export { useOrders } from "./useOrders.js";
69
66
  export { useQuotations } from "./useQuotations.js";
70
67
  export { useSearch } from "./useSearch.js";
71
68
  export { useSubscriptions } from "./useSubscriptions.js";
72
- export { useTikTokDatalayer } from "./useTikTokDatalayer.js";
73
69
  export { useWebforms } from "./useWebforms.js";
74
70
  export { useWishlists } from "./useWishlists.js";
@@ -1,6 +1,6 @@
1
1
  export declare const flowrixApi: {
2
- get: (endpoint: any, config?: {}, options?: {}) => Promise<any>;
3
- post: (endpoint: any, config?: {}, options?: {}) => Promise<any>;
4
- put: (endpoint: any, config?: {}, options?: {}) => Promise<any>;
5
- delete: (endpoint: any, config?: {}, options?: {}) => Promise<any>;
2
+ get: (endpoint: any, config?: {}, options?: {}) => Promise<unknown>;
3
+ post: (endpoint: any, config?: {}, options?: {}) => Promise<unknown>;
4
+ put: (endpoint: any, config?: {}, options?: {}) => Promise<unknown>;
5
+ delete: (endpoint: any, config?: {}, options?: {}) => Promise<unknown>;
6
6
  };
@@ -9,11 +9,10 @@ export default defineEventHandler(async (event) => {
9
9
  statusMessage: "Email and password are required"
10
10
  });
11
11
  }
12
- const config = useRuntimeConfig();
13
- const apiBase = config.apiBase;
14
- const apiKey = config.apiKey;
15
- const apiSecret = config.apiSecret;
16
- const apiOrigin = config.apiOrigin;
12
+ console.log("Environment check:");
13
+ console.log("API_BASE:", process.env.FLOWRIX_API_KEY);
14
+ console.log("API_KEY present:", process.env.FLOWRIX_API_SECRET);
15
+ console.log("API_SECRET present:", process.env.FLOWRIX_API_ORIGIN);
17
16
  const response = await fetch(`${process.env.FLOWRIX_API_BASE}login/`, {
18
17
  method: "POST",
19
18
  headers: {
@@ -1,2 +1,2 @@
1
- declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
1
+ declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<unknown>>;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
1
+ declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<unknown>>;
2
2
  export default _default;
@@ -1,7 +1,7 @@
1
1
  declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<{
2
2
  status: string;
3
3
  statusCode: number;
4
- data: any;
4
+ data: unknown;
5
5
  message: string;
6
6
  error?: undefined;
7
7
  } | {
@@ -7,7 +7,7 @@ declare const _default: import("h3").EventHandler<import("h3").EventHandlerReque
7
7
  } | {
8
8
  status: string;
9
9
  statusCode: number;
10
- data: any;
10
+ data: unknown;
11
11
  message: string;
12
12
  error?: undefined;
13
13
  } | {
@@ -7,7 +7,7 @@ declare const _default: import("h3").EventHandler<import("h3").EventHandlerReque
7
7
  } | {
8
8
  status: string;
9
9
  statusCode: number;
10
- data: any;
10
+ data: unknown;
11
11
  message: string;
12
12
  error?: undefined;
13
13
  } | {
@@ -7,7 +7,7 @@ declare const _default: import("h3").EventHandler<import("h3").EventHandlerReque
7
7
  } | {
8
8
  status: string;
9
9
  statusCode: number;
10
- data: any;
10
+ data: unknown;
11
11
  message: string;
12
12
  error?: undefined;
13
13
  } | {
@@ -1,2 +1,2 @@
1
- declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
1
+ declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<unknown>>;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
1
+ declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<unknown>>;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
1
+ declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<unknown>>;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
1
+ declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<unknown>>;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
1
+ declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<unknown>>;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
1
+ declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<unknown>>;
2
2
  export default _default;
@@ -0,0 +1,2 @@
1
+ declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
2
+ export default _default;
@@ -0,0 +1,14 @@
1
+ import { defineEventHandler, getRouterParam } from "h3";
2
+ import { $fetch } from "ofetch";
3
+ export default defineEventHandler(async (event) => {
4
+ const slug = getRouterParam(event, "slug");
5
+ const page = await $fetch(`${process.env.FLOWRIX_API_BASE}quickview/${slug}`, {
6
+ method: "POST",
7
+ headers: {
8
+ "x-public-key": process.env.FLOWRIX_API_KEY,
9
+ "x-api-secret": process.env.FLOWRIX_API_SECRET,
10
+ "Origin": process.env.FLOWRIX_API_ORIGIN
11
+ }
12
+ });
13
+ return page;
14
+ });
@@ -1,3 +1,3 @@
1
1
  export declare const Page: Map<any, any>;
2
- declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<any>>;
2
+ declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<unknown>>;
3
3
  export default _default;
@@ -1,3 +1,3 @@
1
- {
2
- "extends": "../../../.nuxt/tsconfig.server.json",
3
- }
1
+ {
2
+ "extends": "../../../.nuxt/tsconfig.server.json",
3
+ }
@@ -1,3 +1,5 @@
1
+ import { useRuntimeConfig } from "nuxt/app";
2
+ import { useCookie } from "nuxt/app";
1
3
  import { useAuthStore } from "../stores/auth.js";
2
4
  function getLocationHeaders() {
3
5
  const headers = {};
@@ -32,26 +34,20 @@ function getLocationHeaders() {
32
34
  }
33
35
  return headers;
34
36
  }
35
- function getEnv(key) {
36
- if (typeof useRuntimeConfig === "function") {
37
- const config = useRuntimeConfig();
38
- return config.public?.[key] || config[key];
39
- }
40
- return process.env[key];
41
- }
42
37
  export function useApi() {
43
38
  const authStore = useAuthStore();
44
- const FLOWRIX_API_KEY = getEnv("FLOWRIX_API_KEY");
45
- const FLOWRIX_API_SECRET = getEnv("FLOWRIX_API_SECRET");
46
- const FLOWRIX_API_ORIGIN = getEnv("FLOWRIX_API_ORIGIN");
47
- const FLOWRIX_API_BASE = getEnv("FLOWRIX_API_BASE");
39
+ const config = useRuntimeConfig();
40
+ const FLOWRIX_API_KEY = config.public.FLOWRIX_API_KEY;
41
+ const FLOWRIX_API_SECRET = config.public.FLOWRIX_API_SECRET;
42
+ const FLOWRIX_API_ORIGIN = config.public.FLOWRIX_API_ORIGIN;
43
+ const FLOWRIX_API_BASE = config.public.FLOWRIX_API_BASE;
48
44
  const baseURL = FLOWRIX_API_BASE || "";
49
45
  async function request(method, url, data = null, options = {}, extraHeaders = {}) {
50
46
  const locationHeaders = getLocationHeaders();
51
47
  const headers = {
52
48
  "Content-Type": "application/json",
53
- "X-Public-Key": FLOWRIX_API_KEY,
54
- "X-API-Secret": FLOWRIX_API_SECRET,
49
+ "x-public-key": FLOWRIX_API_KEY,
50
+ "x-api-secret": FLOWRIX_API_SECRET,
55
51
  // Add location headers from cookies
56
52
  ...locationHeaders,
57
53
  // Add extra headers
package/package.json CHANGED
@@ -1,13 +1,17 @@
1
1
  {
2
2
  "name": "flowrix",
3
- "version": "1.0.1-beta.54",
4
- "description": "lug-and-play Nuxt eCommerce cart powered by FLOWRiX. Subscription required.",
3
+ "version": "1.0.1-beta.56",
4
+ "description": "Plug-and-play Nuxt eCommerce cart powered by FLOWRiX. Subscription required.",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "exports": {
8
8
  ".": {
9
9
  "types": "./dist/types.d.mts",
10
10
  "import": "./dist/module.mjs"
11
+ },
12
+ "./composables": {
13
+ "types": "./dist/runtime/composables/index.d.ts",
14
+ "import": "./dist/runtime/composables/index.js"
11
15
  }
12
16
  },
13
17
  "main": "./dist/module.mjs",
@@ -15,12 +19,14 @@
15
19
  "*": {
16
20
  ".": [
17
21
  "./dist/types.d.mts"
22
+ ],
23
+ "composables": [
24
+ "./dist/runtime/composables/index.d.ts"
18
25
  ]
19
26
  }
20
27
  },
21
28
  "files": [
22
- "dist",
23
- "runtime/stores"
29
+ "dist"
24
30
  ],
25
31
  "scripts": {
26
32
  "prepack": "nuxt-module-build build",