flowrix 1.0.1-beta.75 → 1.0.1-beta.77
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/runtime/server/api/banners.js +1 -1
- package/dist/runtime/server/api/brand/[...slug].js +1 -1
- package/dist/runtime/server/api/cache/[...slug].delete.js +1 -1
- package/dist/runtime/server/api/cache/clean.get.js +1 -1
- package/dist/runtime/server/api/category/[...slug].js +5 -1
- package/dist/runtime/server/api/countries.js +1 -1
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -2,7 +2,7 @@ import { defineEventHandler, createError } from "h3";
|
|
|
2
2
|
import { $fetch } from "ofetch";
|
|
3
3
|
import { writeFile, mkdir, readFile } from "fs/promises";
|
|
4
4
|
import { join } from "path";
|
|
5
|
-
const CACHE_DIR = join(
|
|
5
|
+
const CACHE_DIR = join("/tmp", ".cache", "nitro", "extra");
|
|
6
6
|
export const catelogCache = /* @__PURE__ */ new Map();
|
|
7
7
|
async function ensureCacheDir() {
|
|
8
8
|
try {
|
|
@@ -3,7 +3,7 @@ import { $fetch } from "ofetch";
|
|
|
3
3
|
import { writeFile, mkdir, readFile } from "fs/promises";
|
|
4
4
|
import { join } from "path";
|
|
5
5
|
import { useRuntimeConfig } from "#imports";
|
|
6
|
-
const CACHE_DIR = join(
|
|
6
|
+
const CACHE_DIR = join("/tmp", ".cache", "nitro", "brands");
|
|
7
7
|
export const brandCache = /* @__PURE__ */ new Map();
|
|
8
8
|
async function ensureCacheDir() {
|
|
9
9
|
try {
|
|
@@ -2,7 +2,7 @@ import { defineEventHandler, getQuery, createError } from "h3";
|
|
|
2
2
|
import { join } from "path";
|
|
3
3
|
import fs from "fs";
|
|
4
4
|
import path from "path";
|
|
5
|
-
const CACHE_DIR = join(
|
|
5
|
+
const CACHE_DIR = join("/tmp", ".cache");
|
|
6
6
|
export default defineEventHandler(async (event) => {
|
|
7
7
|
const slug = event.context.params._;
|
|
8
8
|
try {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineEventHandler, createError } from "h3";
|
|
2
2
|
import { join } from "path";
|
|
3
3
|
import { rm } from "fs/promises";
|
|
4
|
-
const CACHE_DIR = join(
|
|
4
|
+
const CACHE_DIR = join("/tmp", ".cache");
|
|
5
5
|
export default defineEventHandler(async (event) => {
|
|
6
6
|
try {
|
|
7
7
|
await rm(CACHE_DIR, { recursive: true, force: true });
|
|
@@ -15,7 +15,7 @@ async function ensureCacheDir() {
|
|
|
15
15
|
export default defineEventHandler(async (event) => {
|
|
16
16
|
const slug = event.context.params._;
|
|
17
17
|
const customerType = getCookie(event, "customertype") || "";
|
|
18
|
-
|
|
18
|
+
let query = getQuery(event);
|
|
19
19
|
if (!slug) {
|
|
20
20
|
throw createError({ statusCode: 400, statusMessage: "Missing slug parameter" });
|
|
21
21
|
}
|
|
@@ -37,6 +37,10 @@ export default defineEventHandler(async (event) => {
|
|
|
37
37
|
...config,
|
|
38
38
|
cookies: rawCookies
|
|
39
39
|
};
|
|
40
|
+
query = {
|
|
41
|
+
...query,
|
|
42
|
+
"scope[withchildren]": "true"
|
|
43
|
+
};
|
|
40
44
|
const category = await flowrixApi.get(`categories/${slug}`, apiConfig, { query });
|
|
41
45
|
await ensureCacheDir();
|
|
42
46
|
await writeFile(filePath, JSON.stringify(category, null, 2), "utf-8");
|
|
@@ -3,7 +3,7 @@ import { writeFile, mkdir, readFile } from "fs/promises";
|
|
|
3
3
|
import { join } from "path";
|
|
4
4
|
import { flowrixApi } from "../../middleware/flowrix.js";
|
|
5
5
|
import { useRuntimeConfig } from "#imports";
|
|
6
|
-
const CACHE_DIR = join(
|
|
6
|
+
const CACHE_DIR = join("/tmp", ".cache", "nitro", "company");
|
|
7
7
|
async function ensureCacheDir() {
|
|
8
8
|
try {
|
|
9
9
|
await mkdir(CACHE_DIR, { recursive: true });
|