@isardsat/editorial-server 6.6.3 → 6.6.4
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/routes/data.js +11 -3
- package/package.json +3 -3
package/dist/routes/data.js
CHANGED
|
@@ -17,7 +17,9 @@ function createCache() {
|
|
|
17
17
|
return schema;
|
|
18
18
|
},
|
|
19
19
|
async getContent(storage, options = {}) {
|
|
20
|
-
const
|
|
20
|
+
const mode = options.production ? "production" : "preview";
|
|
21
|
+
const langSuffix = options.lang ? `-${options.lang}` : "";
|
|
22
|
+
const cacheKey = `${mode}${langSuffix}`;
|
|
21
23
|
const cachedEntry = contentCache.get(cacheKey);
|
|
22
24
|
if (cachedEntry && !isExpired(cachedEntry)) {
|
|
23
25
|
return cachedEntry.data;
|
|
@@ -123,7 +125,10 @@ export function createDataRoutes(config, storage) {
|
|
|
123
125
|
const { itemType } = c.req.valid("param");
|
|
124
126
|
const { lang, preview } = c.req.valid("query");
|
|
125
127
|
const origin = preview ? new URL(c.req.url).origin : publicFilesUrl;
|
|
126
|
-
const content = await cache.getContent(storage, {
|
|
128
|
+
const content = await cache.getContent(storage, {
|
|
129
|
+
production: !preview,
|
|
130
|
+
lang,
|
|
131
|
+
});
|
|
127
132
|
const schema = await cache.getSchema(storage);
|
|
128
133
|
const collection = content[itemType];
|
|
129
134
|
if (!collection) {
|
|
@@ -222,7 +227,10 @@ export function createDataRoutes(config, storage) {
|
|
|
222
227
|
const { itemType, id } = c.req.valid("param");
|
|
223
228
|
const { lang, preview } = c.req.valid("query");
|
|
224
229
|
const origin = preview ? new URL(c.req.url).origin : publicFilesUrl;
|
|
225
|
-
const content = await cache.getContent(storage, {
|
|
230
|
+
const content = await cache.getContent(storage, {
|
|
231
|
+
production: !preview,
|
|
232
|
+
lang,
|
|
233
|
+
});
|
|
226
234
|
const schema = await cache.getSchema(storage);
|
|
227
235
|
const collection = content[itemType];
|
|
228
236
|
if (!collection) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@isardsat/editorial-server",
|
|
3
|
-
"version": "6.6.
|
|
3
|
+
"version": "6.6.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"hono": "^4.6.20",
|
|
15
15
|
"yaml": "^2.7.0",
|
|
16
16
|
"zod": "^3.24.1",
|
|
17
|
-
"@isardsat/editorial-
|
|
18
|
-
"@isardsat/editorial-
|
|
17
|
+
"@isardsat/editorial-admin": "^6.6.4",
|
|
18
|
+
"@isardsat/editorial-common": "^6.6.4"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@tsconfig/node22": "^22.0.0",
|