flowrix 1.0.1-beta.105 → 1.0.1-beta.106
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 +2 -1
- package/dist/runtime/server/api/albums.js +6 -1
- package/dist/runtime/server/api/banners.js +6 -1
- package/dist/runtime/server/api/brand/[...slug].js +4 -1
- package/dist/runtime/server/api/catalog/brands.js +7 -1
- package/dist/runtime/server/api/catalog/categories.js +7 -1
- package/dist/runtime/server/api/catalog/categoriesall.js +7 -1
- package/dist/runtime/server/api/catalog/featured.js +7 -1
- package/dist/runtime/server/api/catalog/posts.js +7 -1
- package/dist/runtime/server/api/catalog/samples.js +7 -1
- package/dist/runtime/server/api/catalog/search.js +7 -1
- package/dist/runtime/server/api/category/[...slug].js +7 -1
- package/dist/runtime/server/api/cmspost/[...slug].js +6 -1
- package/dist/runtime/server/api/cmspost/all.js +7 -1
- package/dist/runtime/server/api/company/profile.js +6 -1
- package/dist/runtime/server/api/contact-center/webforms/[id]/details.js +6 -1
- package/dist/runtime/server/api/contact-center/webforms/create.js +6 -2
- package/dist/runtime/server/api/countries.js +6 -1
- package/dist/runtime/server/api/featured.js +7 -1
- package/dist/runtime/server/api/location.js +6 -2
- package/dist/runtime/server/api/nav/[id]/links.js +6 -1
- package/dist/runtime/server/api/page/[...slug].js +6 -1
- package/dist/runtime/server/api/product/[...slug].js +8 -4
- package/dist/runtime/server/api/quickview/[slug].js +6 -2
- package/dist/runtime/server/api/reviews.js +6 -1
- package/dist/runtime/server/api/samples.js +7 -1
- package/dist/runtime/server/api/search.js +7 -1
- package/dist/runtime/server/api/service/[slug].js +6 -1
- package/dist/runtime/server/api/service/availability.js +6 -2
- package/dist/runtime/server/api/service/getall.js +6 -1
- package/dist/runtime/server/api/shop.js +7 -1
- package/dist/runtime/server/api/subscribe.js +6 -2
- package/dist/runtime/server/api/v2/[...slug].get.js +6 -1
- package/dist/runtime/server/api/webform.js +6 -1
- package/package.json +1 -1
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -8,15 +8,16 @@ const module$1 = defineNuxtModule({
|
|
|
8
8
|
defaults: {},
|
|
9
9
|
async setup(_options, nuxt) {
|
|
10
10
|
const env = process.env;
|
|
11
|
+
console.log("envenvenvenvenvenvenv", env);
|
|
11
12
|
const runtimeConfig = nuxt.options.runtimeConfig;
|
|
12
13
|
runtimeConfig.FLOWRIX_API_KEY = env.KEY || runtimeConfig.FLOWRIX_API_KEY || "";
|
|
14
|
+
runtimeConfig.FLOWRIX_API_SECRET = env.SECRET || runtimeConfig.FLOWRIX_API_SECRET || "";
|
|
13
15
|
runtimeConfig.FLOWRIX_API_ORIGIN = env.ORIGIN || runtimeConfig.FLOWRIX_API_ORIGIN || "";
|
|
14
16
|
runtimeConfig.FLOWRIX_API_BASE = env.BASE || runtimeConfig.FLOWRIX_API_BASE || "";
|
|
15
17
|
runtimeConfig.FLOWRIX_CACHE = env.CACHE || runtimeConfig.FLOWRIX_CACHE || "false";
|
|
16
18
|
runtimeConfig.FLOWRIX_CDN = env.CDN || runtimeConfig.FLOWRIX_CDN || "";
|
|
17
19
|
Object.assign(runtimeConfig.public, {
|
|
18
20
|
...runtimeConfig.public,
|
|
19
|
-
...process.env,
|
|
20
21
|
FLOWRIX_API_KEY: runtimeConfig.public.FLOWRIX_API_KEY || env.KEY || runtimeConfig.FLOWRIX_API_KEY || "",
|
|
21
22
|
FLOWRIX_API_ORIGIN: runtimeConfig.public.FLOWRIX_API_ORIGIN || env.ORIGIN || runtimeConfig.FLOWRIX_API_ORIGIN || "",
|
|
22
23
|
FLOWRIX_API_BASE: runtimeConfig.public.FLOWRIX_API_BASE || env.BASE || runtimeConfig.FLOWRIX_API_BASE || "",
|
|
@@ -28,7 +28,12 @@ export default defineEventHandler(async (event) => {
|
|
|
28
28
|
...config,
|
|
29
29
|
cookies: rawCookies
|
|
30
30
|
};
|
|
31
|
-
const
|
|
31
|
+
const options = {
|
|
32
|
+
headers: {
|
|
33
|
+
"x-api-secret": apiConfig?.FLOWRIX_API_SECRET || ""
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
const albums = await flowrixApi.get(`albums`, apiConfig, options);
|
|
32
37
|
if (config.FLOWRIX_CACHE == "true" || config.public.FLOWRIX_CACHE == "true") {
|
|
33
38
|
await ensureCacheDir();
|
|
34
39
|
await writeFile(filePath, JSON.stringify(albums, null, 2), "utf-8");
|
|
@@ -28,7 +28,12 @@ export default defineEventHandler(async (event) => {
|
|
|
28
28
|
...config,
|
|
29
29
|
cookies: rawCookies
|
|
30
30
|
};
|
|
31
|
-
const
|
|
31
|
+
const options = {
|
|
32
|
+
headers: {
|
|
33
|
+
"x-api-secret": apiConfig?.FLOWRIX_API_SECRET || ""
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
const banners = await flowrixApi.get(`banners`, apiConfig, options);
|
|
32
37
|
if (config.FLOWRIX_CACHE == "true" || config.public.FLOWRIX_CACHE == "true") {
|
|
33
38
|
await ensureCacheDir();
|
|
34
39
|
await writeFile(filePath, JSON.stringify(banners, null, 2), "utf-8");
|
|
@@ -39,7 +39,10 @@ export default defineEventHandler(async (event) => {
|
|
|
39
39
|
query = {
|
|
40
40
|
...query
|
|
41
41
|
};
|
|
42
|
-
const
|
|
42
|
+
const headers = {
|
|
43
|
+
"x-api-secret": apiConfig?.FLOWRIX_API_KEY || ""
|
|
44
|
+
};
|
|
45
|
+
const brand = await flowrixApi.get(`brands/${slug}`, apiConfig, { query, headers });
|
|
43
46
|
if (config.FLOWRIX_CACHE == "true" || config.public.FLOWRIX_CACHE == "true") {
|
|
44
47
|
await ensureCacheDir();
|
|
45
48
|
await writeFile(filePath, JSON.stringify(brand, null, 2), "utf-8");
|
|
@@ -33,7 +33,13 @@ export default defineEventHandler(async (event) => {
|
|
|
33
33
|
query = {
|
|
34
34
|
...query
|
|
35
35
|
};
|
|
36
|
-
const
|
|
36
|
+
const options = {
|
|
37
|
+
headers: {
|
|
38
|
+
"x-api-secret": apiConfig?.FLOWRIX_API_SECRET || ""
|
|
39
|
+
},
|
|
40
|
+
query
|
|
41
|
+
};
|
|
42
|
+
const brands = await flowrixApi.get(`brands`, apiConfig, options);
|
|
37
43
|
if (config.FLOWRIX_CACHE == "true" || config.public.FLOWRIX_CACHE == "true") {
|
|
38
44
|
await ensureCacheDir();
|
|
39
45
|
await writeFile(filePath, JSON.stringify(brands, null, 2), "utf-8");
|
|
@@ -33,7 +33,13 @@ export default defineEventHandler(async (event) => {
|
|
|
33
33
|
query = {
|
|
34
34
|
...query
|
|
35
35
|
};
|
|
36
|
-
const
|
|
36
|
+
const options = {
|
|
37
|
+
headers: {
|
|
38
|
+
"x-api-secret": apiConfig?.FLOWRIX_API_SECRET || ""
|
|
39
|
+
},
|
|
40
|
+
query
|
|
41
|
+
};
|
|
42
|
+
const categories = await flowrixApi.get(`categories`, apiConfig, options);
|
|
37
43
|
if (config.FLOWRIX_CACHE == "true" || config.public.FLOWRIX_CACHE == "true") {
|
|
38
44
|
await ensureCacheDir();
|
|
39
45
|
await writeFile(filePath, JSON.stringify(categories, null, 2), "utf-8");
|
|
@@ -33,7 +33,13 @@ export default defineEventHandler(async (event) => {
|
|
|
33
33
|
query = {
|
|
34
34
|
...query
|
|
35
35
|
};
|
|
36
|
-
const
|
|
36
|
+
const options = {
|
|
37
|
+
headers: {
|
|
38
|
+
"x-api-secret": apiConfig?.FLOWRIX_API_SECRET || ""
|
|
39
|
+
},
|
|
40
|
+
query
|
|
41
|
+
};
|
|
42
|
+
const categories = await flowrixApi.get(`categories/all`, apiConfig, options);
|
|
37
43
|
if (config.FLOWRIX_CACHE == "true" || config.public.FLOWRIX_CACHE == "true") {
|
|
38
44
|
await ensureCacheDir();
|
|
39
45
|
await writeFile(filePath, JSON.stringify(categories, null, 2), "utf-8");
|
|
@@ -33,7 +33,13 @@ export default defineEventHandler(async (event) => {
|
|
|
33
33
|
query = {
|
|
34
34
|
...query
|
|
35
35
|
};
|
|
36
|
-
const
|
|
36
|
+
const options = {
|
|
37
|
+
headers: {
|
|
38
|
+
"x-api-secret": apiConfig?.FLOWRIX_API_SECRET || ""
|
|
39
|
+
},
|
|
40
|
+
query
|
|
41
|
+
};
|
|
42
|
+
const featured = await flowrixApi.get(`products/featured`, apiConfig, options);
|
|
37
43
|
if (config.FLOWRIX_CACHE == "true" || config.public.FLOWRIX_CACHE == "true") {
|
|
38
44
|
await ensureCacheDir();
|
|
39
45
|
await writeFile(filePath, JSON.stringify(featured, null, 2), "utf-8");
|
|
@@ -33,7 +33,13 @@ export default defineEventHandler(async (event) => {
|
|
|
33
33
|
query = {
|
|
34
34
|
...query
|
|
35
35
|
};
|
|
36
|
-
const
|
|
36
|
+
const options = {
|
|
37
|
+
headers: {
|
|
38
|
+
"x-api-secret": apiConfig?.FLOWRIX_API_SECRET || ""
|
|
39
|
+
},
|
|
40
|
+
query
|
|
41
|
+
};
|
|
42
|
+
const posts = await flowrixApi.post(`posts`, apiConfig, options);
|
|
37
43
|
if (config.FLOWRIX_CACHE == "true" || config.public.FLOWRIX_CACHE == "true") {
|
|
38
44
|
await ensureCacheDir();
|
|
39
45
|
await writeFile(filePath, JSON.stringify(posts, null, 2), "utf-8");
|
|
@@ -34,7 +34,13 @@ export default defineEventHandler(async (event) => {
|
|
|
34
34
|
query = {
|
|
35
35
|
...query
|
|
36
36
|
};
|
|
37
|
-
const
|
|
37
|
+
const options = {
|
|
38
|
+
headers: {
|
|
39
|
+
"x-api-secret": apiConfig?.FLOWRIX_API_SECRET || ""
|
|
40
|
+
},
|
|
41
|
+
query
|
|
42
|
+
};
|
|
43
|
+
const samples = await flowrixApi.get(`samples`, apiConfig, options);
|
|
38
44
|
if (config.FLOWRIX_CACHE == "true" || config.public.FLOWRIX_CACHE == "true") {
|
|
39
45
|
await ensureCacheDir();
|
|
40
46
|
await writeFile(filePath, JSON.stringify(samples, null, 2), "utf-8");
|
|
@@ -34,7 +34,13 @@ export default defineEventHandler(async (event) => {
|
|
|
34
34
|
query = {
|
|
35
35
|
...query
|
|
36
36
|
};
|
|
37
|
-
const
|
|
37
|
+
const options = {
|
|
38
|
+
headers: {
|
|
39
|
+
"x-api-secret": apiConfig?.FLOWRIX_API_SECRET || ""
|
|
40
|
+
},
|
|
41
|
+
query
|
|
42
|
+
};
|
|
43
|
+
const search = await flowrixApi.get(`search`, apiConfig, options);
|
|
38
44
|
if (config.FLOWRIX_CACHE == "true" || config.public.FLOWRIX_CACHE == "true") {
|
|
39
45
|
await ensureCacheDir();
|
|
40
46
|
await writeFile(filePath, JSON.stringify(search, null, 2), "utf-8");
|
|
@@ -41,7 +41,13 @@ export default defineEventHandler(async (event) => {
|
|
|
41
41
|
...query,
|
|
42
42
|
"scope[withchildren]": "true"
|
|
43
43
|
};
|
|
44
|
-
const
|
|
44
|
+
const options = {
|
|
45
|
+
headers: {
|
|
46
|
+
"x-api-secret": apiConfig?.FLOWRIX_API_SECRET || ""
|
|
47
|
+
},
|
|
48
|
+
query
|
|
49
|
+
};
|
|
50
|
+
const category = await flowrixApi.get(`categories/${slug}`, apiConfig, options);
|
|
45
51
|
if (config.FLOWRIX_CACHE == "true" || config.public.FLOWRIX_CACHE == "true") {
|
|
46
52
|
await ensureCacheDir();
|
|
47
53
|
await writeFile(filePath, JSON.stringify(category, null, 2), "utf-8");
|
|
@@ -36,7 +36,12 @@ export default defineEventHandler(async (event) => {
|
|
|
36
36
|
...config,
|
|
37
37
|
cookies: rawCookies
|
|
38
38
|
};
|
|
39
|
-
const
|
|
39
|
+
const options = {
|
|
40
|
+
headers: {
|
|
41
|
+
"x-api-secret": apiConfig?.FLOWRIX_API_SECRET || ""
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
const blog = await flowrixApi.get(`post/${slug}`, apiConfig, options);
|
|
40
45
|
if (config.FLOWRIX_CACHE == "true" || config.public.FLOWRIX_CACHE == "true") {
|
|
41
46
|
await ensureCacheDir();
|
|
42
47
|
await writeFile(filePath, JSON.stringify(blog, null, 2), "utf-8");
|
|
@@ -33,7 +33,13 @@ export default defineEventHandler(async (event) => {
|
|
|
33
33
|
query = {
|
|
34
34
|
...query
|
|
35
35
|
};
|
|
36
|
-
const
|
|
36
|
+
const options = {
|
|
37
|
+
headers: {
|
|
38
|
+
"x-api-secret": apiConfig?.FLOWRIX_API_SECRET || ""
|
|
39
|
+
},
|
|
40
|
+
query
|
|
41
|
+
};
|
|
42
|
+
const posts = await flowrixApi.post(`posts`, apiConfig, options);
|
|
37
43
|
if (config.FLOWRIX_CACHE == "true" || config.public.FLOWRIX_CACHE == "true") {
|
|
38
44
|
await ensureCacheDir();
|
|
39
45
|
await writeFile(filePath, JSON.stringify(posts, null, 2), "utf-8");
|
|
@@ -9,7 +9,12 @@ export default defineEventHandler(async (event) => {
|
|
|
9
9
|
...config,
|
|
10
10
|
cookies: rawCookies
|
|
11
11
|
};
|
|
12
|
-
const
|
|
12
|
+
const options = {
|
|
13
|
+
headers: {
|
|
14
|
+
"x-api-secret": apiConfig?.FLOWRIX_API_SECRET || ""
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
const companyProfile = await flowrixApi.get(`company/profile`, apiConfig, options);
|
|
13
18
|
return companyProfile;
|
|
14
19
|
} catch (error) {
|
|
15
20
|
setResponseStatus(event, 500);
|
|
@@ -36,7 +36,12 @@ export default defineEventHandler(async (event) => {
|
|
|
36
36
|
...config,
|
|
37
37
|
cookies: rawCookies
|
|
38
38
|
};
|
|
39
|
-
const
|
|
39
|
+
const options = {
|
|
40
|
+
headers: {
|
|
41
|
+
"x-api-secret": apiConfig?.FLOWRIX_API_SECRET || ""
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
const webfrom = await flowrixApi.get(`contact-center/webforms/${slug}/details`, apiConfig, options);
|
|
40
45
|
if (config.FLOWRIX_CACHE == "true" || config.public.FLOWRIX_CACHE == "true") {
|
|
41
46
|
await ensureCacheDir();
|
|
42
47
|
await writeFile(filePath, JSON.stringify(webfrom, null, 2), "utf-8");
|
|
@@ -9,8 +9,12 @@ export default defineEventHandler(async (event) => {
|
|
|
9
9
|
...config,
|
|
10
10
|
cookies: rawCookies
|
|
11
11
|
};
|
|
12
|
-
const
|
|
12
|
+
const options = {
|
|
13
|
+
headers: {
|
|
14
|
+
"x-api-secret": apiConfig?.FLOWRIX_API_SECRET || ""
|
|
15
|
+
},
|
|
13
16
|
body
|
|
14
|
-
}
|
|
17
|
+
};
|
|
18
|
+
const webform = await flowrixApi.post(`posts`, apiConfig, options);
|
|
15
19
|
return webform;
|
|
16
20
|
});
|
|
@@ -26,7 +26,12 @@ export default defineEventHandler(async (event) => {
|
|
|
26
26
|
...config,
|
|
27
27
|
cookies: rawCookies
|
|
28
28
|
};
|
|
29
|
-
const
|
|
29
|
+
const options = {
|
|
30
|
+
headers: {
|
|
31
|
+
"x-api-secret": apiConfig?.FLOWRIX_API_SECRET || ""
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const countries = await flowrixApi.get(`countries`, apiConfig, options);
|
|
30
35
|
if (config.FLOWRIX_CACHE == "true" || config.public.FLOWRIX_CACHE == "true") {
|
|
31
36
|
await ensureCacheDir();
|
|
32
37
|
await writeFile(filePath, JSON.stringify(countries, null, 2), "utf-8");
|
|
@@ -33,7 +33,13 @@ export default defineEventHandler(async (event) => {
|
|
|
33
33
|
query = {
|
|
34
34
|
...query
|
|
35
35
|
};
|
|
36
|
-
const
|
|
36
|
+
const options = {
|
|
37
|
+
headers: {
|
|
38
|
+
"x-api-secret": apiConfig?.FLOWRIX_API_SECRET || ""
|
|
39
|
+
},
|
|
40
|
+
query
|
|
41
|
+
};
|
|
42
|
+
const featured = await flowrixApi.get(`products/featured`, apiConfig, options);
|
|
37
43
|
if (config.FLOWRIX_CACHE == "true" || config.public.FLOWRIX_CACHE == "true") {
|
|
38
44
|
await ensureCacheDir();
|
|
39
45
|
await writeFile(filePath, JSON.stringify(featured, null, 2), "utf-8");
|
|
@@ -10,9 +10,13 @@ export default defineEventHandler(async (event) => {
|
|
|
10
10
|
...config,
|
|
11
11
|
cookies: rawCookies
|
|
12
12
|
};
|
|
13
|
-
const
|
|
13
|
+
const options = {
|
|
14
|
+
headers: {
|
|
15
|
+
"x-api-secret": apiConfig?.FLOWRIX_API_SECRET || ""
|
|
16
|
+
},
|
|
14
17
|
body: JSON.stringify(body)
|
|
15
|
-
}
|
|
18
|
+
};
|
|
19
|
+
const location = await flowrixApi.post(`ip/location`, apiConfig, options);
|
|
16
20
|
return location;
|
|
17
21
|
} catch (error) {
|
|
18
22
|
setResponseStatus(event, 500);
|
|
@@ -37,7 +37,12 @@ export default defineEventHandler(async (event) => {
|
|
|
37
37
|
...config,
|
|
38
38
|
cookies: rawCookies
|
|
39
39
|
};
|
|
40
|
-
const
|
|
40
|
+
const options = {
|
|
41
|
+
headers: {
|
|
42
|
+
"x-api-secret": apiConfig?.FLOWRIX_API_SECRET || ""
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
const menu = await flowrixApi.get(`nav/${slug}/links`, apiConfig, options);
|
|
41
46
|
if (config.FLOWRIX_CACHE == "true" || config.public.FLOWRIX_CACHE == "true") {
|
|
42
47
|
await ensureCacheDir();
|
|
43
48
|
await writeFile(filePath, JSON.stringify(menu, null, 2), "utf-8");
|
|
@@ -36,7 +36,12 @@ export default defineEventHandler(async (event) => {
|
|
|
36
36
|
...config,
|
|
37
37
|
cookies: rawCookies
|
|
38
38
|
};
|
|
39
|
-
const
|
|
39
|
+
const options = {
|
|
40
|
+
headers: {
|
|
41
|
+
"x-api-secret": apiConfig?.FLOWRIX_API_SECRET || ""
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
const page = await flowrixApi.get(`page/${slug}`, apiConfig, options);
|
|
40
45
|
if (config.FLOWRIX_CACHE == "true" || config.public.FLOWRIX_CACHE == "true") {
|
|
41
46
|
await ensureCacheDir();
|
|
42
47
|
await writeFile(filePath, JSON.stringify(page, null, 2), "utf-8");
|
|
@@ -39,10 +39,14 @@ export default defineEventHandler(async (event) => {
|
|
|
39
39
|
query = {
|
|
40
40
|
...query
|
|
41
41
|
};
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
const options = {
|
|
43
|
+
headers: {
|
|
44
|
+
"x-api-secret": apiConfig?.FLOWRIX_API_SECRET || ""
|
|
45
|
+
},
|
|
46
|
+
query,
|
|
47
|
+
body: JSON.stringify(body)
|
|
48
|
+
};
|
|
49
|
+
const product = await flowrixApi.post(`product/${slug}`, apiConfig, options);
|
|
46
50
|
if (config.FLOWRIX_CACHE == "true" || config.public.FLOWRIX_CACHE == "true") {
|
|
47
51
|
await ensureCacheDir();
|
|
48
52
|
await writeFile(filePath, JSON.stringify(product, null, 2), "utf-8");
|
|
@@ -10,8 +10,12 @@ export default defineEventHandler(async (event) => {
|
|
|
10
10
|
...config,
|
|
11
11
|
cookies: rawCookies
|
|
12
12
|
};
|
|
13
|
-
const
|
|
13
|
+
const options = {
|
|
14
|
+
headers: {
|
|
15
|
+
"x-api-secret": apiConfig?.FLOWRIX_API_SECRET || ""
|
|
16
|
+
},
|
|
14
17
|
body: JSON.stringify(body)
|
|
15
|
-
}
|
|
18
|
+
};
|
|
19
|
+
const quickview = await flowrixApi.post(`quickview/${slug}`, apiConfig, options);
|
|
16
20
|
return quickview;
|
|
17
21
|
});
|
|
@@ -9,7 +9,12 @@ export default defineEventHandler(async (event) => {
|
|
|
9
9
|
...config,
|
|
10
10
|
cookies: rawCookies
|
|
11
11
|
};
|
|
12
|
-
const
|
|
12
|
+
const options = {
|
|
13
|
+
headers: {
|
|
14
|
+
"x-api-secret": apiConfig?.FLOWRIX_API_SECRET || ""
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
const reviews = await flowrixApi.get(`reviews`, apiConfig, options);
|
|
13
18
|
return reviews;
|
|
14
19
|
} catch (error) {
|
|
15
20
|
setResponseStatus(event, 500);
|
|
@@ -34,7 +34,13 @@ export default defineEventHandler(async (event) => {
|
|
|
34
34
|
query = {
|
|
35
35
|
...query
|
|
36
36
|
};
|
|
37
|
-
const
|
|
37
|
+
const options = {
|
|
38
|
+
headers: {
|
|
39
|
+
"x-api-secret": apiConfig?.FLOWRIX_API_SECRET || ""
|
|
40
|
+
},
|
|
41
|
+
query
|
|
42
|
+
};
|
|
43
|
+
const samples = await flowrixApi.get(`samples`, apiConfig, options);
|
|
38
44
|
if (config.FLOWRIX_CACHE == "true" || config.public.FLOWRIX_CACHE == "true") {
|
|
39
45
|
await ensureCacheDir();
|
|
40
46
|
await writeFile(filePath, JSON.stringify(samples, null, 2), "utf-8");
|
|
@@ -34,7 +34,13 @@ export default defineEventHandler(async (event) => {
|
|
|
34
34
|
query = {
|
|
35
35
|
...query
|
|
36
36
|
};
|
|
37
|
-
const
|
|
37
|
+
const options = {
|
|
38
|
+
headers: {
|
|
39
|
+
"x-api-secret": apiConfig?.FLOWRIX_API_SECRET || ""
|
|
40
|
+
},
|
|
41
|
+
query
|
|
42
|
+
};
|
|
43
|
+
const search = await flowrixApi.get(`search`, apiConfig, options);
|
|
38
44
|
if (config.FLOWRIX_CACHE == "true" || config.public.FLOWRIX_CACHE == "true") {
|
|
39
45
|
await ensureCacheDir();
|
|
40
46
|
await writeFile(filePath, JSON.stringify(search, null, 2), "utf-8");
|
|
@@ -39,7 +39,12 @@ export default defineEventHandler(async (event) => {
|
|
|
39
39
|
...config,
|
|
40
40
|
cookies: rawCookies
|
|
41
41
|
};
|
|
42
|
-
const
|
|
42
|
+
const options = {
|
|
43
|
+
headers: {
|
|
44
|
+
"x-api-secret": apiConfig?.FLOWRIX_API_SECRET || ""
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
const service = await flowrixApi.get(`services/${slug}`, apiConfig, options);
|
|
43
48
|
if (config.FLOWRIX_CACHE == "true" || config.public.FLOWRIX_CACHE == "true") {
|
|
44
49
|
await ensureCacheDir();
|
|
45
50
|
await writeFile(filePath, JSON.stringify(service, null, 2), "utf-8");
|
|
@@ -10,9 +10,13 @@ export default defineEventHandler(async (event) => {
|
|
|
10
10
|
...config,
|
|
11
11
|
cookies: rawCookies
|
|
12
12
|
};
|
|
13
|
-
const
|
|
13
|
+
const options = {
|
|
14
|
+
headers: {
|
|
15
|
+
"x-api-secret": apiConfig?.FLOWRIX_API_SECRET || ""
|
|
16
|
+
},
|
|
14
17
|
body: JSON.stringify(body)
|
|
15
|
-
}
|
|
18
|
+
};
|
|
19
|
+
const response = await flowrixApi.post(`services/availability`, apiConfig, options);
|
|
16
20
|
return response;
|
|
17
21
|
} catch (error) {
|
|
18
22
|
return {
|
|
@@ -39,7 +39,12 @@ export default defineEventHandler(async (event) => {
|
|
|
39
39
|
...config,
|
|
40
40
|
cookies: rawCookies
|
|
41
41
|
};
|
|
42
|
-
const
|
|
42
|
+
const options = {
|
|
43
|
+
headers: {
|
|
44
|
+
"x-api-secret": apiConfig?.FLOWRIX_API_SECRET || ""
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
const service = await flowrixApi.get(`services`, apiConfig, options);
|
|
43
48
|
if (config.FLOWRIX_CACHE == "true" || config.public.FLOWRIX_CACHE == "true") {
|
|
44
49
|
await ensureCacheDir();
|
|
45
50
|
await writeFile(filePath, JSON.stringify(service, null, 2), "utf-8");
|
|
@@ -34,7 +34,13 @@ export default defineEventHandler(async (event) => {
|
|
|
34
34
|
query = {
|
|
35
35
|
...query
|
|
36
36
|
};
|
|
37
|
-
const
|
|
37
|
+
const options = {
|
|
38
|
+
headers: {
|
|
39
|
+
"x-api-secret": apiConfig?.FLOWRIX_API_SECRET || ""
|
|
40
|
+
},
|
|
41
|
+
query
|
|
42
|
+
};
|
|
43
|
+
const search = await flowrixApi.get(`search`, apiConfig, options);
|
|
38
44
|
if (config.FLOWRIX_CACHE == "true" || config.public.FLOWRIX_CACHE == "true") {
|
|
39
45
|
await ensureCacheDir();
|
|
40
46
|
await writeFile(filePath, JSON.stringify(search, null, 2), "utf-8");
|
|
@@ -10,9 +10,13 @@ export default defineEventHandler(async (event) => {
|
|
|
10
10
|
...config,
|
|
11
11
|
cookies: rawCookies
|
|
12
12
|
};
|
|
13
|
-
const
|
|
13
|
+
const options = {
|
|
14
|
+
headers: {
|
|
15
|
+
"x-api-secret": apiConfig?.FLOWRIX_API_SECRET || ""
|
|
16
|
+
},
|
|
14
17
|
body: JSON.stringify(body)
|
|
15
|
-
}
|
|
18
|
+
};
|
|
19
|
+
const subscribe = await flowrixApi.post(`subscribe`, apiConfig, options);
|
|
16
20
|
return subscribe;
|
|
17
21
|
} catch (error) {
|
|
18
22
|
setResponseStatus(event, 500);
|
|
@@ -12,7 +12,12 @@ export default defineEventHandler(async (event) => {
|
|
|
12
12
|
...config,
|
|
13
13
|
cookies: rawCookies
|
|
14
14
|
};
|
|
15
|
-
const
|
|
15
|
+
const options = {
|
|
16
|
+
headers: {
|
|
17
|
+
"x-api-secret": apiConfig?.FLOWRIX_API_SECRET || ""
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
const page = await flowrixApi.get(`permalink/${slug}`, apiConfig, options);
|
|
16
21
|
console.log("config.FLOWRIX_CACHE", config);
|
|
17
22
|
if (config.FLOWRIX_CACHE != "true" || config.public?.FLOWRIX_CACHE != "true") {
|
|
18
23
|
const CACHE_DIR = join("/tmp", ".cache");
|
|
@@ -36,7 +36,12 @@ export default defineEventHandler(async (event) => {
|
|
|
36
36
|
...config,
|
|
37
37
|
cookies: rawCookies
|
|
38
38
|
};
|
|
39
|
-
const
|
|
39
|
+
const options = {
|
|
40
|
+
headers: {
|
|
41
|
+
"x-api-secret": apiConfig?.FLOWRIX_API_SECRET || ""
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
const webfrom = await flowrixApi.get(`contact-center/webforms/${slug}/details`, apiConfig, options);
|
|
40
45
|
if (config.FLOWRIX_CACHE == "true" || config.public.FLOWRIX_CACHE == "true") {
|
|
41
46
|
await ensureCacheDir();
|
|
42
47
|
await writeFile(filePath, JSON.stringify(webfrom, null, 2), "utf-8");
|