flowrix 1.0.1-beta.87 → 1.0.1-beta.89
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 +13 -1
- package/dist/runtime/composables/Checkout/useCheckout.js +47 -8
- package/dist/runtime/pages/flowrix-default.d.vue.ts +3 -0
- package/dist/runtime/pages/flowrix-default.vue +34 -0
- package/dist/runtime/pages/flowrix-default.vue.d.ts +3 -0
- package/dist/runtime/server/api/banners.js +1 -1
- package/dist/runtime/server/api/brand/[...slug].js +1 -1
- package/dist/runtime/server/api/catalog/categories.js +3 -1
- package/dist/runtime/server/api/catalog/categoriesall.js +1 -1
- package/dist/runtime/server/api/catalog/featured.js +1 -1
- package/dist/runtime/server/api/catalog/samples.js +1 -1
- package/dist/runtime/server/api/catalog/search.js +1 -1
- package/dist/runtime/server/api/category/[...slug].js +1 -1
- package/dist/runtime/server/api/cmspost/[...slug].js +3 -1
- package/dist/runtime/server/api/countries.js +1 -1
- package/dist/runtime/server/api/page/[...slug].js +3 -1
- package/dist/runtime/server/api/reviews.d.ts +2 -0
- package/dist/runtime/server/api/reviews.js +18 -0
- package/dist/runtime/server/api/service/[slug].js +1 -1
- package/dist/runtime/server/api/service/getall.js +1 -1
- package/dist/runtime/server/api/v2/{[...slug].d.ts → [...slug].get.d.ts} +0 -1
- package/dist/runtime/server/api/v2/{[...slug].js → [...slug].get.js} +4 -3
- package/dist/runtime/utils/htmlCache.js +1 -1
- package/package.json +16 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -46,6 +46,10 @@ const module$1 = defineNuxtModule({
|
|
|
46
46
|
route: "/api/albums",
|
|
47
47
|
handler: resolver.resolve("./runtime/server/api/albums")
|
|
48
48
|
});
|
|
49
|
+
addServerHandler({
|
|
50
|
+
route: "/api/reviews",
|
|
51
|
+
handler: resolver.resolve("./runtime/server/api/reviews")
|
|
52
|
+
});
|
|
49
53
|
addServerHandler({
|
|
50
54
|
route: "/api/banners",
|
|
51
55
|
handler: resolver.resolve("./runtime/server/api/banners")
|
|
@@ -304,7 +308,7 @@ const module$1 = defineNuxtModule({
|
|
|
304
308
|
});
|
|
305
309
|
addServerHandler({
|
|
306
310
|
route: "/api/v2/**",
|
|
307
|
-
handler: resolver.resolve("./runtime/server/api/v2/[...slug]")
|
|
311
|
+
handler: resolver.resolve("./runtime/server/api/v2/[...slug].get")
|
|
308
312
|
});
|
|
309
313
|
addServerHandler({
|
|
310
314
|
route: "/api/shop",
|
|
@@ -330,6 +334,14 @@ const module$1 = defineNuxtModule({
|
|
|
330
334
|
route: "/api/cache/**",
|
|
331
335
|
handler: resolver.resolve("./runtime/server/api/cache/[...slug].delete")
|
|
332
336
|
});
|
|
337
|
+
addServerHandler({
|
|
338
|
+
route: "/sitemap.xml",
|
|
339
|
+
handler: resolver.resolve("./runtime/server/api/generate/sitemap.get")
|
|
340
|
+
});
|
|
341
|
+
addServerHandler({
|
|
342
|
+
route: "/robots.txt",
|
|
343
|
+
handler: resolver.resolve("./runtime/server/api/generate/robots.get")
|
|
344
|
+
});
|
|
333
345
|
}
|
|
334
346
|
});
|
|
335
347
|
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { ref, computed, watch, onMounted, defineAsyncComponent } from "vue";
|
|
2
2
|
import { useCompanyProfile } from "../../stores/useCompanyProfile.js";
|
|
3
3
|
import { useCartStore } from "../../stores/Cart.js";
|
|
4
|
+
import { GTM_begin_checkout, GTM_add_shipping_info, GTM_add_payment_info } from "../../composables/useDataLayer.js";
|
|
5
|
+
import { META_begin_checkout, META_add_shipping_info, META_add_payment_info } from "../../composables/useMetaLayer.js";
|
|
6
|
+
import { TikTok_begin_checkout, TikTok_add_payment_info } from "../../composables/useTikTokDatalayer.js";
|
|
4
7
|
import { useCheckoutStore } from "../../stores/Checkout.js";
|
|
5
8
|
import { useCountry } from "../Extras/useCountry.js";
|
|
6
9
|
import { useRouter, useRoute } from "vue-router";
|
|
@@ -147,10 +150,51 @@ export default function() {
|
|
|
147
150
|
onMounted(() => {
|
|
148
151
|
checkoutStore.getConfig();
|
|
149
152
|
updateUserFieldsIfuserLogin(inputData.value.shippingasbilling);
|
|
150
|
-
const
|
|
151
|
-
|
|
153
|
+
const cartInfo = [];
|
|
154
|
+
cartInfo.items = checkoutStore.config.cartInfo;
|
|
155
|
+
cartInfo.totals = checkoutStore?.config?.calculations ? checkoutStore?.config?.calculations : "";
|
|
156
|
+
let shippingmethods = checkoutStore.config.shippingmethods;
|
|
157
|
+
let shipping_method = shippingmethods.filter((method) => method.selected == true)[0];
|
|
152
158
|
let deliverymethods = checkoutStore.config.preferences;
|
|
153
159
|
let deliverymethod = false;
|
|
160
|
+
let delivery_method = deliverymethods.filter((method) => method.selected == true)[0];
|
|
161
|
+
if (delivery_method) {
|
|
162
|
+
if (delivery_method.id == 1) {
|
|
163
|
+
if (shipping_method) {
|
|
164
|
+
GTM_add_shipping_info(cartStore?.cart, shipping_method);
|
|
165
|
+
META_add_shipping_info(cartStore?.cart, shipping_method);
|
|
166
|
+
}
|
|
167
|
+
} else if (delivery_method.id == 2) {
|
|
168
|
+
shipping_method = {
|
|
169
|
+
"id": 0,
|
|
170
|
+
"title": "Click and Collect",
|
|
171
|
+
"details": "",
|
|
172
|
+
"available": 1,
|
|
173
|
+
"price": 0,
|
|
174
|
+
"selected": true
|
|
175
|
+
};
|
|
176
|
+
GTM_add_shipping_info(cartStore?.cart, shipping_method);
|
|
177
|
+
META_add_shipping_info(cartStore?.cart, shipping_method);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
if (cartStore?.cart) {
|
|
181
|
+
GTM_begin_checkout(cartStore?.cart);
|
|
182
|
+
META_begin_checkout(cartStore?.cart);
|
|
183
|
+
TikTok_begin_checkout(cartStore?.cart);
|
|
184
|
+
GTM_add_payment_info(cartStore?.cart, inputData.value.paymentmethod);
|
|
185
|
+
META_add_payment_info(cartStore?.cart, inputData.value.paymentmethod);
|
|
186
|
+
TikTok_add_payment_info(cartStore?.cart, inputData.value.paymentmethod);
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
watch(() => cartStore?.cart, (newCartData) => {
|
|
190
|
+
if (newCartData) {
|
|
191
|
+
GTM_begin_checkout(newCartData);
|
|
192
|
+
META_begin_checkout(newCartData);
|
|
193
|
+
TikTok_begin_checkout(newCartData);
|
|
194
|
+
GTM_add_payment_info(cartStore?.cart, inputData.value.paymentmethod);
|
|
195
|
+
META_add_payment_info(cartStore?.cart, inputData.value.paymentmethod);
|
|
196
|
+
TikTok_add_payment_info(cartStore?.cart, inputData.value.paymentmethod);
|
|
197
|
+
}
|
|
154
198
|
});
|
|
155
199
|
const totalPrice = computed(() => {
|
|
156
200
|
return checkoutStore.config ? checkoutStore.config?.calculations?.total : 0;
|
|
@@ -168,7 +212,7 @@ export default function() {
|
|
|
168
212
|
}
|
|
169
213
|
return states.value;
|
|
170
214
|
});
|
|
171
|
-
watch(inputData.value, async (newData, oldValue) => {
|
|
215
|
+
watch(() => inputData.value, async (newData, oldValue) => {
|
|
172
216
|
});
|
|
173
217
|
const shippingMethods = computed(() => {
|
|
174
218
|
if (checkoutStore.config) {
|
|
@@ -226,7 +270,6 @@ export default function() {
|
|
|
226
270
|
};
|
|
227
271
|
payment.tokenize(
|
|
228
272
|
data,
|
|
229
|
-
//additional data, MUST include card_holder (or first_name & last_name), month and year
|
|
230
273
|
function(token2, cardData) {
|
|
231
274
|
inputData2.clientsceret = token2;
|
|
232
275
|
checkoutStore.publishableKey.clientsceret = token2;
|
|
@@ -279,19 +322,15 @@ export default function() {
|
|
|
279
322
|
inputData.value.clientsceret
|
|
280
323
|
);
|
|
281
324
|
if (sessiondata.value.calculations.total > 0) {
|
|
282
|
-
console.log("chckoutResponse", sessiondata.value);
|
|
283
|
-
console.log("chckoutResponse", checkoutStore.responseData.booking ? `${window.location.origin}${url_booking}?calendar=${checkoutStore.responseData.calendar}&order_no=${checkoutStore.responseData.order_no}` : `${window.location.origin}${url_success}`);
|
|
284
325
|
const { error: error2 } = await stripe.confirmPayment({
|
|
285
326
|
elements,
|
|
286
327
|
confirmParams: {
|
|
287
|
-
// Make sure to change this to your payment completion page
|
|
288
328
|
return_url: checkoutStore.responseData.booking ? `${window.location.origin}${url_booking}?calendar=${checkoutStore.responseData.calendar}&order_no=${checkoutStore.responseData.order_no}` : `${window.location.origin}${url_success}`,
|
|
289
329
|
receipt_email: inputData.value.email
|
|
290
330
|
}
|
|
291
331
|
});
|
|
292
332
|
if (error2.type === "card_error" || error2.type === "validation_error") {
|
|
293
333
|
showMessage(error2.message);
|
|
294
|
-
} else {
|
|
295
334
|
}
|
|
296
335
|
} else {
|
|
297
336
|
showMessage(error.message);
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
const route = useRoute();
|
|
3
|
+
const { data, error } = await useAsyncData(
|
|
4
|
+
"flowrix-page",
|
|
5
|
+
() => $fetch(`/api/v2${route.fullPath}`, {
|
|
6
|
+
method: "GET"
|
|
7
|
+
})
|
|
8
|
+
);
|
|
9
|
+
if (error.value) {
|
|
10
|
+
throw createError({
|
|
11
|
+
statusCode: 404,
|
|
12
|
+
statusMessage: "Page Not Found"
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
const rediectpage = (async (data2) => {
|
|
16
|
+
return navigateTo(data2.target, { redirectCode: 302 });
|
|
17
|
+
});
|
|
18
|
+
if (data.value?.data?.type === "Redirect") {
|
|
19
|
+
}
|
|
20
|
+
const html = data.value?.data?.html || null;
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<template>
|
|
24
|
+
{{ data }}
|
|
25
|
+
<div>
|
|
26
|
+
<!-- Render HTML page from API -->
|
|
27
|
+
<div v-if="html" v-html="html"></div>
|
|
28
|
+
|
|
29
|
+
<!-- Fallback for debugging -->
|
|
30
|
+
<div v-else>
|
|
31
|
+
<pre>{{ data }}</pre>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
</template>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
@@ -28,7 +28,7 @@ export default defineEventHandler(async (event) => {
|
|
|
28
28
|
"Origin": process.env.FLOWRIX_API_ORIGIN
|
|
29
29
|
}
|
|
30
30
|
});
|
|
31
|
-
if (
|
|
31
|
+
if (process.env.FLOWRIX_CACHE == true) {
|
|
32
32
|
await ensureCacheDir();
|
|
33
33
|
await writeFile(filePath, JSON.stringify(banners, null, 2), "utf-8");
|
|
34
34
|
}
|
|
@@ -45,7 +45,7 @@ export default defineEventHandler(async (event) => {
|
|
|
45
45
|
"Origin": process.env.FLOWRIX_API_ORIGIN
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
|
-
if (
|
|
48
|
+
if (process.env.FLOWRIX_CACHE == true) {
|
|
49
49
|
await ensureCacheDir();
|
|
50
50
|
await writeFile(filePath, JSON.stringify(brand, null, 2), "utf-8");
|
|
51
51
|
}
|
|
@@ -2,6 +2,7 @@ import { defineEventHandler, getQuery, createError, getCookie } from "h3";
|
|
|
2
2
|
import { $fetch } from "ofetch";
|
|
3
3
|
import { writeFile, mkdir, readFile } from "fs/promises";
|
|
4
4
|
import { join } from "path";
|
|
5
|
+
import { useRuntimeConfig } from "#imports";
|
|
5
6
|
const CACHE_DIR = join("/tmp", ".cache", "nitro", "catalog");
|
|
6
7
|
export const catelogCache = /* @__PURE__ */ new Map();
|
|
7
8
|
async function ensureCacheDir() {
|
|
@@ -23,6 +24,7 @@ export default defineEventHandler(async (event) => {
|
|
|
23
24
|
} catch (error) {
|
|
24
25
|
}
|
|
25
26
|
try {
|
|
27
|
+
const config = useRuntimeConfig();
|
|
26
28
|
const categories = await $fetch(`${process.env.FLOWRIX_API_BASE}categories`, {
|
|
27
29
|
query,
|
|
28
30
|
headers: {
|
|
@@ -31,7 +33,7 @@ export default defineEventHandler(async (event) => {
|
|
|
31
33
|
"Origin": process.env.FLOWRIX_API_ORIGIN
|
|
32
34
|
}
|
|
33
35
|
});
|
|
34
|
-
if (
|
|
36
|
+
if (process.env.FLOWRIX_CACHE == true) {
|
|
35
37
|
await ensureCacheDir();
|
|
36
38
|
await writeFile(filePath, JSON.stringify(categories, null, 2), "utf-8");
|
|
37
39
|
}
|
|
@@ -31,7 +31,7 @@ export default defineEventHandler(async (event) => {
|
|
|
31
31
|
"Origin": process.env.FLOWRIX_API_ORIGIN
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
|
-
if (
|
|
34
|
+
if (process.env.FLOWRIX_CACHE == true) {
|
|
35
35
|
await ensureCacheDir();
|
|
36
36
|
await writeFile(filePath, JSON.stringify(categories, null, 2), "utf-8");
|
|
37
37
|
}
|
|
@@ -29,7 +29,7 @@ export default defineEventHandler(async (event) => {
|
|
|
29
29
|
"Origin": process.env.FLOWRIX_API_ORIGIN
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
|
-
if (
|
|
32
|
+
if (process.env.FLOWRIX_CACHE == true) {
|
|
33
33
|
await ensureCacheDir();
|
|
34
34
|
await writeFile(filePath, JSON.stringify(featured, null, 2), "utf-8");
|
|
35
35
|
}
|
|
@@ -32,7 +32,7 @@ export default defineEventHandler(async (event) => {
|
|
|
32
32
|
"Origin": process.env.FLOWRIX_API_ORIGIN
|
|
33
33
|
}
|
|
34
34
|
});
|
|
35
|
-
if (
|
|
35
|
+
if (process.env.FLOWRIX_CACHE == true) {
|
|
36
36
|
await ensureCacheDir();
|
|
37
37
|
await writeFile(filePath, JSON.stringify(samples, null, 2), "utf-8");
|
|
38
38
|
}
|
|
@@ -32,7 +32,7 @@ export default defineEventHandler(async (event) => {
|
|
|
32
32
|
"Origin": process.env.FLOWRIX_API_ORIGIN
|
|
33
33
|
}
|
|
34
34
|
});
|
|
35
|
-
if (
|
|
35
|
+
if (process.env.FLOWRIX_CACHE == true) {
|
|
36
36
|
await ensureCacheDir();
|
|
37
37
|
await writeFile(filePath, JSON.stringify(search, null, 2), "utf-8");
|
|
38
38
|
}
|
|
@@ -42,7 +42,7 @@ export default defineEventHandler(async (event) => {
|
|
|
42
42
|
"scope[withchildren]": "true"
|
|
43
43
|
};
|
|
44
44
|
const category = await flowrixApi.get(`categories/${slug}`, apiConfig, { query });
|
|
45
|
-
if (
|
|
45
|
+
if (process.env.FLOWRIX_CACHE == true) {
|
|
46
46
|
await ensureCacheDir();
|
|
47
47
|
await writeFile(filePath, JSON.stringify(category, null, 2), "utf-8");
|
|
48
48
|
}
|
|
@@ -2,6 +2,7 @@ import { defineEventHandler, getQuery, createError, readBody, getCookie } from "
|
|
|
2
2
|
import { $fetch } from "ofetch";
|
|
3
3
|
import { writeFile, mkdir, readFile } from "fs/promises";
|
|
4
4
|
import { join } from "path";
|
|
5
|
+
import { useRuntimeConfig } from "#imports";
|
|
5
6
|
const CACHE_DIR = join("/tmp", ".cache", "nitro", "blogs");
|
|
6
7
|
export const blogCache = /* @__PURE__ */ new Map();
|
|
7
8
|
async function ensureCacheDir() {
|
|
@@ -29,6 +30,7 @@ export default defineEventHandler(async (event) => {
|
|
|
29
30
|
} catch (error) {
|
|
30
31
|
}
|
|
31
32
|
try {
|
|
33
|
+
const config = useRuntimeConfig();
|
|
32
34
|
const blog = await $fetch(`${process.env.FLOWRIX_API_BASE}post/${slug}`, {
|
|
33
35
|
headers: {
|
|
34
36
|
"x-public-key": process.env.FLOWRIX_API_KEY,
|
|
@@ -36,7 +38,7 @@ export default defineEventHandler(async (event) => {
|
|
|
36
38
|
"Origin": process.env.FLOWRIX_API_ORIGIN
|
|
37
39
|
}
|
|
38
40
|
});
|
|
39
|
-
if (
|
|
41
|
+
if (process.env.FLOWRIX_CACHE == true) {
|
|
40
42
|
await ensureCacheDir();
|
|
41
43
|
await writeFile(filePath, JSON.stringify(blog, null, 2), "utf-8");
|
|
42
44
|
}
|
|
@@ -22,7 +22,7 @@ export default defineEventHandler(async (event) => {
|
|
|
22
22
|
try {
|
|
23
23
|
const config = useRuntimeConfig();
|
|
24
24
|
const countries = await flowrixApi.get(`countries`, config);
|
|
25
|
-
if (
|
|
25
|
+
if (process.env.FLOWRIX_CACHE == true) {
|
|
26
26
|
await ensureCacheDir();
|
|
27
27
|
await writeFile(filePath, JSON.stringify(countries, null, 2), "utf-8");
|
|
28
28
|
}
|
|
@@ -2,6 +2,7 @@ import { defineEventHandler, getQuery, createError, readBody, getCookie } from "
|
|
|
2
2
|
import { $fetch } from "ofetch";
|
|
3
3
|
import { writeFile, mkdir, readFile } from "fs/promises";
|
|
4
4
|
import { join } from "path";
|
|
5
|
+
import { useRuntimeConfig } from "#imports";
|
|
5
6
|
const CACHE_DIR = join("/tmp", ".cache", "nitro", "pages");
|
|
6
7
|
export const pageCache = /* @__PURE__ */ new Map();
|
|
7
8
|
async function ensureCacheDir() {
|
|
@@ -29,6 +30,7 @@ export default defineEventHandler(async (event) => {
|
|
|
29
30
|
} catch (error) {
|
|
30
31
|
}
|
|
31
32
|
try {
|
|
33
|
+
const config = useRuntimeConfig();
|
|
32
34
|
const page = await $fetch(`${process.env.FLOWRIX_API_BASE}page/${slug}`, {
|
|
33
35
|
headers: {
|
|
34
36
|
"x-public-key": process.env.FLOWRIX_API_KEY,
|
|
@@ -36,7 +38,7 @@ export default defineEventHandler(async (event) => {
|
|
|
36
38
|
"Origin": process.env.FLOWRIX_API_ORIGIN
|
|
37
39
|
}
|
|
38
40
|
});
|
|
39
|
-
if (
|
|
41
|
+
if (process.env.FLOWRIX_CACHE == true) {
|
|
40
42
|
await ensureCacheDir();
|
|
41
43
|
await writeFile(filePath, JSON.stringify(page, null, 2), "utf-8");
|
|
42
44
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { defineEventHandler, setResponseStatus } from "h3";
|
|
2
|
+
import { $fetch } from "ofetch";
|
|
3
|
+
export default defineEventHandler(async (event) => {
|
|
4
|
+
try {
|
|
5
|
+
const reviews = await $fetch(`${process.env.FLOWRIX_API_BASE}reviews`, {
|
|
6
|
+
method: "GET",
|
|
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 reviews;
|
|
14
|
+
} catch (error) {
|
|
15
|
+
setResponseStatus(event, 500);
|
|
16
|
+
return { success: false, error: error.message };
|
|
17
|
+
}
|
|
18
|
+
});
|
|
@@ -39,7 +39,7 @@ export default defineEventHandler(async (event) => {
|
|
|
39
39
|
"Origin": process.env.FLOWRIX_API_ORIGIN
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
|
-
if (
|
|
42
|
+
if (process.env.FLOWRIX_CACHE == true) {
|
|
43
43
|
await ensureCacheDir();
|
|
44
44
|
await writeFile(filePath, JSON.stringify(service, null, 2), "utf-8");
|
|
45
45
|
}
|
|
@@ -39,7 +39,7 @@ export default defineEventHandler(async (event) => {
|
|
|
39
39
|
"Origin": process.env.FLOWRIX_API_ORIGIN
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
|
-
if (
|
|
42
|
+
if (process.env.FLOWRIX_CACHE == true) {
|
|
43
43
|
await ensureCacheDir();
|
|
44
44
|
await writeFile(filePath, JSON.stringify(service, null, 2), "utf-8");
|
|
45
45
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { defineEventHandler } from "h3";
|
|
2
2
|
import { flowrixApi } from "../../../middleware/flowrix.js";
|
|
3
3
|
import { useRuntimeConfig } from "#imports";
|
|
4
|
-
export const Page = /* @__PURE__ */ new Map();
|
|
5
4
|
export default defineEventHandler(async (event) => {
|
|
6
5
|
const slug = event.context.params._;
|
|
7
|
-
|
|
6
|
+
const config = useRuntimeConfig();
|
|
7
|
+
console.log("ddddd", slug);
|
|
8
8
|
const page = await flowrixApi.get(`permalink/${slug}`, config);
|
|
9
|
-
|
|
9
|
+
if (page.status === "Success" && page.data.type === "Redirect") {
|
|
10
|
+
}
|
|
10
11
|
return page;
|
|
11
12
|
});
|
|
@@ -54,7 +54,7 @@ export default defineEventHandler(async (event) => {
|
|
|
54
54
|
if (chunk) chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
|
|
55
55
|
const html = Buffer.concat(chunks).toString("utf-8");
|
|
56
56
|
if (event.node.res.statusCode === 200 && html.includes("<!DOCTYPE html>")) {
|
|
57
|
-
if (
|
|
57
|
+
if (process.env.FLOWRIX_CACHE == true) {
|
|
58
58
|
writeCache(url, html, customerType);
|
|
59
59
|
}
|
|
60
60
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flowrix",
|
|
3
|
-
"version": "1.0.1-beta.
|
|
3
|
+
"version": "1.0.1-beta.89",
|
|
4
4
|
"description": "Plug-and-play Nuxt eCommerce cart powered by FLOWRiX. Subscription required.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -51,5 +51,20 @@
|
|
|
51
51
|
"nuxt-toast": "1.4.0",
|
|
52
52
|
"pinia": "2.3.1",
|
|
53
53
|
"pinia-plugin-persistedstate": "3.2.3"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@nuxt/devtools": "2.6.5",
|
|
57
|
+
"@nuxt/eslint-config": "1.9.0",
|
|
58
|
+
"@nuxt/module-builder": "^1.0.2",
|
|
59
|
+
"@nuxt/schema": "4.2.0",
|
|
60
|
+
"@nuxt/test-utils": "3.19.2",
|
|
61
|
+
"@types/node": "24.9.1",
|
|
62
|
+
"changelogen": "0.6.2",
|
|
63
|
+
"eslint": "9.38.0",
|
|
64
|
+
"nuxt": "4.2.0",
|
|
65
|
+
"sass": "^1.94.2",
|
|
66
|
+
"typescript": "5.9.3",
|
|
67
|
+
"vitest": "3.2.4",
|
|
68
|
+
"vue-tsc": "3.1.1"
|
|
54
69
|
}
|
|
55
70
|
}
|