flowrix 1.0.1-beta.54 → 1.0.1-beta.55

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.55",
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,6 +53,7 @@ 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';
@@ -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,6 +53,7 @@ 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";
@@ -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
- {
2
- "extends": "../../../.nuxt/tsconfig.server.json",
3
- }
1
+ {
2
+ "extends": "../../../.nuxt/tsconfig.server.json",
3
+ }
@@ -50,8 +50,8 @@ export function useApi() {
50
50
  const locationHeaders = getLocationHeaders();
51
51
  const headers = {
52
52
  "Content-Type": "application/json",
53
- "X-Public-Key": FLOWRIX_API_KEY,
54
- "X-API-Secret": FLOWRIX_API_SECRET,
53
+ "X-Public-Key": process.env.FLOWRIX_API_KEY,
54
+ "X-API-Secret": process.env.FLOWRIX_API_SECRET,
55
55
  // Add location headers from cookies
56
56
  ...locationHeaders,
57
57
  // 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.55",
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",