@websolutespa/bom-mixer-models 2.0.2 → 3.0.1
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/CHANGELOG.md +5 -10
- package/dist/exports/proxy.d.ts +12 -0
- package/dist/exports/proxy.d.ts.map +1 -0
- package/dist/exports/proxy.js +172 -0
- package/dist/exports/proxy.js.map +1 -0
- package/dist/exports/server.d.ts +184 -0
- package/dist/exports/server.d.ts.map +1 -0
- package/dist/exports/server.js +960 -0
- package/dist/exports/server.js.map +1 -0
- package/dist/index.d.ts +254 -424
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +41 -1450
- package/dist/index.js.map +1 -0
- package/dist/lazy-JamSYYoh.d.ts +84 -0
- package/dist/lazy-JamSYYoh.d.ts.map +1 -0
- package/dist/page-BLbZbnWg.js +12 -0
- package/dist/page-BLbZbnWg.js.map +1 -0
- package/dist/route-k0W3AKyo.js +53 -0
- package/dist/route-k0W3AKyo.js.map +1 -0
- package/package.json +75 -27
- package/src/app/app.service.ts +1 -1
- package/src/captions/captions.handler.ts +1 -1
- package/src/category/category.service.ts +3 -3
- package/src/consent_preference/consent_preference.service.ts +4 -4
- package/src/consent_preference/consent_preference.ts +1 -1
- package/src/country/country.service.ts +4 -4
- package/src/exports/proxy.ts +2 -0
- package/src/exports/server.ts +22 -0
- package/src/index.ts +3 -20
- package/src/label/label.service.ts +3 -3
- package/src/lazy/lazy.service.ts +28 -0
- package/src/lazy/lazy.ts +0 -26
- package/src/locale/locale.service.ts +3 -13
- package/src/locale/locale.ts +9 -0
- package/src/market/market.service.ts +3 -3
- package/src/menu/menu.service.ts +3 -3
- package/src/page/page.service.ts +47 -7
- package/src/page/page.ts +9 -0
- package/src/province/province.service.ts +4 -4
- package/src/redirect/redirect.service.ts +4 -4
- package/src/region/region.service.ts +4 -4
- package/src/route/route-revalidate.handler.ts +54 -43
- package/src/route/route.interceptor.ts +18 -3
- package/src/route/route.service.ts +11 -49
- package/src/route/route.ts +64 -0
- package/src/session/session.service.ts +12 -4
- package/src/sitemap/sitemap.service.ts +5 -5
- package/dist/index.mjs +0 -1363
package/dist/index.mjs
DELETED
|
@@ -1,1363 +0,0 @@
|
|
|
1
|
-
// src/country/country.service.ts
|
|
2
|
-
import { getStore } from "@websolutespa/bom-mixer-store";
|
|
3
|
-
async function getCountries(locale) {
|
|
4
|
-
const store = await getStore();
|
|
5
|
-
const items = await store.i18n_country.findMany({ locale });
|
|
6
|
-
return items;
|
|
7
|
-
}
|
|
8
|
-
async function getCountry(id, params = {}) {
|
|
9
|
-
const store = await getStore();
|
|
10
|
-
const item = await store.i18n_country.findOne(id, params);
|
|
11
|
-
return item;
|
|
12
|
-
}
|
|
13
|
-
async function getCountriesPagination(params = {}) {
|
|
14
|
-
const store = await getStore();
|
|
15
|
-
const pagination = await store.i18n_country.findPaged(params);
|
|
16
|
-
return pagination;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// src/province/province.service.ts
|
|
20
|
-
import { getStore as getStore2 } from "@websolutespa/bom-mixer-store";
|
|
21
|
-
async function getProvinces(locale) {
|
|
22
|
-
const store = await getStore2();
|
|
23
|
-
const items = await store.i18n_province.findMany({ locale });
|
|
24
|
-
return items;
|
|
25
|
-
}
|
|
26
|
-
async function getProvince(id, params = {}) {
|
|
27
|
-
const store = await getStore2();
|
|
28
|
-
const item = await store.i18n_province.findOne(id, params);
|
|
29
|
-
return item;
|
|
30
|
-
}
|
|
31
|
-
async function getProvincesPagination(params = {}) {
|
|
32
|
-
const store = await getStore2();
|
|
33
|
-
const pagination = await store.i18n_province.findPaged(params);
|
|
34
|
-
return pagination;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// src/region/region.service.ts
|
|
38
|
-
import { getStore as getStore3 } from "@websolutespa/bom-mixer-store";
|
|
39
|
-
async function getRegions(locale) {
|
|
40
|
-
const store = await getStore3();
|
|
41
|
-
const items = await store.i18n_region.findMany({ locale });
|
|
42
|
-
return items;
|
|
43
|
-
}
|
|
44
|
-
async function getRegion(id, params = {}) {
|
|
45
|
-
const store = await getStore3();
|
|
46
|
-
const item = await store.i18n_region.findOne(id, params);
|
|
47
|
-
return item;
|
|
48
|
-
}
|
|
49
|
-
async function getRegionsPagination(params = {}) {
|
|
50
|
-
const store = await getStore3();
|
|
51
|
-
const pagination = await store.i18n_region.findPaged(params);
|
|
52
|
-
return pagination;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// src/address/address.service.ts
|
|
56
|
-
async function getAddressOptions(locale) {
|
|
57
|
-
const countries = await getCountries(locale);
|
|
58
|
-
const provinces = await getProvinces(locale);
|
|
59
|
-
const regions = await getRegions(locale);
|
|
60
|
-
return {
|
|
61
|
-
countries,
|
|
62
|
-
regions,
|
|
63
|
-
provinces
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// src/captions/captions.handler.ts
|
|
68
|
-
var getCaptionsVttProps = async (context) => {
|
|
69
|
-
const { req, res, params, query } = context;
|
|
70
|
-
const locale = query?.locale;
|
|
71
|
-
const title = query?.title;
|
|
72
|
-
const captions = (
|
|
73
|
-
/* html */
|
|
74
|
-
`WEBVTT
|
|
75
|
-
|
|
76
|
-
00:00:01.000 --> 00:00:03.000
|
|
77
|
-
- This video has no audio.
|
|
78
|
-
|
|
79
|
-
${title ? `
|
|
80
|
-
00:00:04.000 --> 00:00:06.000
|
|
81
|
-
- The title of the video is "${title}".
|
|
82
|
-
` : ""}`
|
|
83
|
-
);
|
|
84
|
-
res.setHeader("Content-Type", "text/plain; charset=UTF-8");
|
|
85
|
-
res.setHeader("X-Frame-Options", "SAMEORIGIN");
|
|
86
|
-
res.setHeader("X-Robots-Tag", "noindex, follow");
|
|
87
|
-
res.write(captions);
|
|
88
|
-
res.end();
|
|
89
|
-
return {
|
|
90
|
-
props: {}
|
|
91
|
-
};
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
// src/category/category.service.ts
|
|
95
|
-
import { getCategorySegments } from "@websolutespa/bom-core";
|
|
96
|
-
import { getStore as getStore4 } from "@websolutespa/bom-mixer-store";
|
|
97
|
-
async function getCategories(params = {}) {
|
|
98
|
-
const store = await getStore4();
|
|
99
|
-
const categories = await store.category.findMany(params);
|
|
100
|
-
return categories;
|
|
101
|
-
}
|
|
102
|
-
async function getCategory(id, params = {}) {
|
|
103
|
-
const store = await getStore4();
|
|
104
|
-
const item = await store.category.findOne(id, params);
|
|
105
|
-
return item;
|
|
106
|
-
}
|
|
107
|
-
async function getSegments(item, params = {}) {
|
|
108
|
-
const categories = await getCategories(params);
|
|
109
|
-
return getCategorySegments(categories, item);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
// src/consent_preference/consent_preference.service.ts
|
|
113
|
-
import { getStore as getStore5 } from "@websolutespa/bom-mixer-store";
|
|
114
|
-
async function getConsentPreference(id, params = {}) {
|
|
115
|
-
const store = await getStore5();
|
|
116
|
-
const item = await store.consent_preference.findOne(id, params);
|
|
117
|
-
return item;
|
|
118
|
-
}
|
|
119
|
-
async function getConsentPreferences(params = {}) {
|
|
120
|
-
const store = await getStore5();
|
|
121
|
-
const items = await store.consent_preference.findMany(params);
|
|
122
|
-
return items;
|
|
123
|
-
}
|
|
124
|
-
async function getConsentPreferencesPagination(params = {}) {
|
|
125
|
-
const store = await getStore5();
|
|
126
|
-
const pagination = await store.consent_preference.findPaged(params);
|
|
127
|
-
return pagination;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
// src/gtm/gtm.service.ts
|
|
131
|
-
import { isBrowser } from "@websolutespa/bom-core";
|
|
132
|
-
function pushDataLayer(record) {
|
|
133
|
-
if (isBrowser) {
|
|
134
|
-
window.dataLayer?.push(record);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
// src/label/label.service.ts
|
|
139
|
-
import { getStore as getStore6 } from "@websolutespa/bom-mixer-store";
|
|
140
|
-
async function getLabels(params = {}) {
|
|
141
|
-
const store = await getStore6();
|
|
142
|
-
const items = await store.label.findMany(params);
|
|
143
|
-
return items;
|
|
144
|
-
}
|
|
145
|
-
async function getLabel(id, params = {}) {
|
|
146
|
-
const store = await getStore6();
|
|
147
|
-
const item = await store.label.findOne(id, params);
|
|
148
|
-
return item;
|
|
149
|
-
}
|
|
150
|
-
function resolveLabel(labels, id) {
|
|
151
|
-
const label = labels.find((x) => x.id === id);
|
|
152
|
-
return label && label.text ? label.text.toString() : id;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
// src/app/app.service.ts
|
|
156
|
-
import { getStore as getStore7 } from "@websolutespa/bom-mixer-store";
|
|
157
|
-
async function getApp(params = {}) {
|
|
158
|
-
const store = await getStore7();
|
|
159
|
-
const item = await store.app.findGlobal(params);
|
|
160
|
-
return item;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
// src/locale/locale.service.ts
|
|
164
|
-
import { getStore as getStore8 } from "@websolutespa/bom-mixer-store";
|
|
165
|
-
async function getLocales(params = {}) {
|
|
166
|
-
const store = await getStore8();
|
|
167
|
-
const items = await store.locale.findMany(params);
|
|
168
|
-
return items;
|
|
169
|
-
}
|
|
170
|
-
async function getLocale(id, params = {}) {
|
|
171
|
-
const store = await getStore8();
|
|
172
|
-
const item = await store.locale.findOne(id, params);
|
|
173
|
-
return item;
|
|
174
|
-
}
|
|
175
|
-
function getLocaleFromProps(props) {
|
|
176
|
-
return props?.__NEXT_DATA__?.query?.locale;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
// src/market/market.service.ts
|
|
180
|
-
import { getStore as getStore9 } from "@websolutespa/bom-mixer-store";
|
|
181
|
-
async function getMarkets(params = {}) {
|
|
182
|
-
const store = await getStore9();
|
|
183
|
-
const items = await store.market.findMany(params);
|
|
184
|
-
return items;
|
|
185
|
-
}
|
|
186
|
-
async function getMarket(id, params = {}) {
|
|
187
|
-
const store = await getStore9();
|
|
188
|
-
const item = await store.market.findOne(id, params);
|
|
189
|
-
return item;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
// src/menu/menu.service.ts
|
|
193
|
-
import { getStore as getStore10 } from "@websolutespa/bom-mixer-store";
|
|
194
|
-
async function getMenus(params = {}) {
|
|
195
|
-
const store = await getStore10();
|
|
196
|
-
const items = await store.menu.findMany(params);
|
|
197
|
-
return items;
|
|
198
|
-
}
|
|
199
|
-
async function getMenu(id, params = {}) {
|
|
200
|
-
const store = await getStore10();
|
|
201
|
-
const item = await store.menu.findOne(id, params);
|
|
202
|
-
return item;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
// src/route/route.service.ts
|
|
206
|
-
import { asCategoryId, defaultLocale, defaultMarket, findRouteOfCategory, getRootCategory, localize } from "@websolutespa/bom-core";
|
|
207
|
-
import { buildStrategy, BuildStrategy, getStore as getStore11, StoreStrategy, storeStrategy } from "@websolutespa/bom-mixer-store";
|
|
208
|
-
async function getRoutes(params = {}) {
|
|
209
|
-
const store = await getStore11();
|
|
210
|
-
const routes = await store.route.findMany(params);
|
|
211
|
-
return routes;
|
|
212
|
-
}
|
|
213
|
-
async function getRoute(id) {
|
|
214
|
-
const store = await getStore11();
|
|
215
|
-
const route = await store.route.findOne(id);
|
|
216
|
-
return route;
|
|
217
|
-
}
|
|
218
|
-
async function getRoutesForSchemas(schemas, market, locale) {
|
|
219
|
-
const store = await getStore11();
|
|
220
|
-
const routes = await store.route.findMany({
|
|
221
|
-
where: {
|
|
222
|
-
schema: {
|
|
223
|
-
in: schemas
|
|
224
|
-
},
|
|
225
|
-
market: {
|
|
226
|
-
equals: market
|
|
227
|
-
},
|
|
228
|
-
locale: {
|
|
229
|
-
equals: locale
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
});
|
|
233
|
-
const items = {};
|
|
234
|
-
routes.forEach((route) => {
|
|
235
|
-
items[route.schema] = route.id;
|
|
236
|
-
});
|
|
237
|
-
return items;
|
|
238
|
-
}
|
|
239
|
-
async function getRoutesForTemplates(templates, market, locale) {
|
|
240
|
-
const store = await getStore11();
|
|
241
|
-
const routes = await store.route.findMany({
|
|
242
|
-
where: {
|
|
243
|
-
template: {
|
|
244
|
-
in: templates
|
|
245
|
-
},
|
|
246
|
-
market: {
|
|
247
|
-
equals: market
|
|
248
|
-
},
|
|
249
|
-
locale: {
|
|
250
|
-
equals: locale
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
});
|
|
254
|
-
const items = {};
|
|
255
|
-
routes.forEach((route) => {
|
|
256
|
-
if (route.template) {
|
|
257
|
-
items[route.template] = route.id;
|
|
258
|
-
}
|
|
259
|
-
});
|
|
260
|
-
return items;
|
|
261
|
-
}
|
|
262
|
-
async function getStaticPathsForSchema(schema, template) {
|
|
263
|
-
if (buildStrategy === BuildStrategy.Runtime) {
|
|
264
|
-
return [];
|
|
265
|
-
}
|
|
266
|
-
const store = await getStore11();
|
|
267
|
-
const routes = await store.route.findMany({
|
|
268
|
-
where: template ? {
|
|
269
|
-
and: [{
|
|
270
|
-
template: {
|
|
271
|
-
equals: template
|
|
272
|
-
}
|
|
273
|
-
}, {
|
|
274
|
-
schema: {
|
|
275
|
-
equals: schema
|
|
276
|
-
}
|
|
277
|
-
}]
|
|
278
|
-
} : {
|
|
279
|
-
schema: {
|
|
280
|
-
equals: schema
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
});
|
|
284
|
-
return routes.map((x) => ({ params: { id: x.page.toString(), market: x.market, locale: x.locale } }));
|
|
285
|
-
}
|
|
286
|
-
async function getStaticPathsForSchemaAndFallback(schema, fallback = "blocking", template) {
|
|
287
|
-
if (buildStrategy === BuildStrategy.Runtime || fallback === "blocking" && storeStrategy !== StoreStrategy.Mock) {
|
|
288
|
-
return { paths: [], fallback };
|
|
289
|
-
}
|
|
290
|
-
const paths = await getStaticPathsForSchema(schema, template);
|
|
291
|
-
return {
|
|
292
|
-
paths,
|
|
293
|
-
fallback
|
|
294
|
-
// fallback: 'blocking', // runs before initial render
|
|
295
|
-
// fallback: true, // runs in the background
|
|
296
|
-
};
|
|
297
|
-
}
|
|
298
|
-
async function getBreadcrumbFromSegments(segments, route) {
|
|
299
|
-
const market = route.market || defaultMarket;
|
|
300
|
-
const locale = route.locale || defaultLocale;
|
|
301
|
-
const routes = await getRoutes({
|
|
302
|
-
where: {
|
|
303
|
-
market: {
|
|
304
|
-
equals: market
|
|
305
|
-
},
|
|
306
|
-
locale: {
|
|
307
|
-
equals: locale
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
});
|
|
311
|
-
const tree = segments.map((segment) => {
|
|
312
|
-
const route2 = findRouteOfCategory(routes, segment.id);
|
|
313
|
-
return {
|
|
314
|
-
segment,
|
|
315
|
-
route: route2
|
|
316
|
-
};
|
|
317
|
-
}).filter((x) => Boolean(x.route)).map((x) => {
|
|
318
|
-
const category = x.segment;
|
|
319
|
-
const route2 = x.route;
|
|
320
|
-
const routeLink = newRouteLink(category, route2, locale);
|
|
321
|
-
return routeLink;
|
|
322
|
-
});
|
|
323
|
-
if (!route.isDefault) {
|
|
324
|
-
tree.push(routeToRouteLink(route));
|
|
325
|
-
}
|
|
326
|
-
return tree;
|
|
327
|
-
}
|
|
328
|
-
async function getRouteLinkTree(market, locale) {
|
|
329
|
-
const store = await getStore11();
|
|
330
|
-
const routes = await store.route.findMany({
|
|
331
|
-
where: {
|
|
332
|
-
market: {
|
|
333
|
-
equals: market
|
|
334
|
-
},
|
|
335
|
-
locale: {
|
|
336
|
-
equals: locale
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
});
|
|
340
|
-
const categories = await store.category.findMany({ market, locale });
|
|
341
|
-
const rootCategory = getRootCategory(categories);
|
|
342
|
-
if (rootCategory) {
|
|
343
|
-
const root = getRouteLinkCategory(locale, routes, categories, rootCategory, rootCategory);
|
|
344
|
-
return root;
|
|
345
|
-
}
|
|
346
|
-
return void 0;
|
|
347
|
-
}
|
|
348
|
-
function getRouteLinkCategory(locale, routes, categories, rootCategory, category) {
|
|
349
|
-
const route = findRouteOfCategory(routes, category.id);
|
|
350
|
-
const otherCategories = categories.filter((x) => x.id !== category.id);
|
|
351
|
-
const childCategories = otherCategories.filter((x) => asCategoryId(x.category) === category.id);
|
|
352
|
-
const routeLink = newRouteLink(category, route, locale);
|
|
353
|
-
const items = [];
|
|
354
|
-
for (const childCategory of childCategories) {
|
|
355
|
-
const itemOrItems = getRouteLinkCategory(locale, routes, otherCategories, rootCategory, childCategory);
|
|
356
|
-
if (Array.isArray(itemOrItems)) {
|
|
357
|
-
items.push(...itemOrItems);
|
|
358
|
-
} else if (itemOrItems) {
|
|
359
|
-
items.push(itemOrItems);
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
if (!route || category.isHidden && category.id !== rootCategory.id) {
|
|
363
|
-
return items;
|
|
364
|
-
}
|
|
365
|
-
routeLink.items = items;
|
|
366
|
-
return routeLink;
|
|
367
|
-
}
|
|
368
|
-
function newRouteLink(category, route, locale) {
|
|
369
|
-
const href = route && route.id ? route.id.toString() : "/";
|
|
370
|
-
const id = route?.page || category.id;
|
|
371
|
-
const media = category.media || route?.media;
|
|
372
|
-
const schema = route?.template || route?.schema || category?.schema || "unknown";
|
|
373
|
-
const title = localize(category.title || route?.title || "untitled", locale);
|
|
374
|
-
const routeLink = {
|
|
375
|
-
category: category.id,
|
|
376
|
-
href,
|
|
377
|
-
id,
|
|
378
|
-
items: [],
|
|
379
|
-
media,
|
|
380
|
-
schema,
|
|
381
|
-
title
|
|
382
|
-
};
|
|
383
|
-
return routeLink;
|
|
384
|
-
}
|
|
385
|
-
function routeToRouteLink(route) {
|
|
386
|
-
const routeLink = {
|
|
387
|
-
category: asCategoryId(route.category),
|
|
388
|
-
href: route.id,
|
|
389
|
-
id: route.page,
|
|
390
|
-
items: [],
|
|
391
|
-
media: route.media,
|
|
392
|
-
schema: route.schema,
|
|
393
|
-
title: route.title
|
|
394
|
-
};
|
|
395
|
-
return routeLink;
|
|
396
|
-
}
|
|
397
|
-
function resolveRoute(route) {
|
|
398
|
-
const routepath = route.template || route.schema;
|
|
399
|
-
const resolvedPathname = `/${route.market}/${route.locale}/${routepath}/${route.page}${route.splat || ""}`;
|
|
400
|
-
return resolvedPathname;
|
|
401
|
-
}
|
|
402
|
-
|
|
403
|
-
// src/layout/layout.service.ts
|
|
404
|
-
async function getLayout(market, locale) {
|
|
405
|
-
const markets = await getMarkets({ locale });
|
|
406
|
-
const locales = await getLocales({ locale });
|
|
407
|
-
const labels = await getLabels({ locale });
|
|
408
|
-
const app = await getApp({ locale }) || {};
|
|
409
|
-
const tree = await getRouteLinkTree(market, locale);
|
|
410
|
-
const firstLevelRoutes = tree?.items || [];
|
|
411
|
-
const flatTopLevelRoutes = tree ? [tree, ...firstLevelRoutes] : [];
|
|
412
|
-
const topLevelRoutes = flatTopLevelRoutes.reduce((object, routeLink) => {
|
|
413
|
-
if (!object[routeLink.schema] || routeLink.schema === routeLink.category) {
|
|
414
|
-
object[routeLink.schema] = routeLink;
|
|
415
|
-
}
|
|
416
|
-
return object;
|
|
417
|
-
}, {});
|
|
418
|
-
const topLevelHrefs = flatTopLevelRoutes.reduce((object, routeLink) => {
|
|
419
|
-
if (routeLink.href && (!object[routeLink.schema] || routeLink.schema === routeLink.category)) {
|
|
420
|
-
object[routeLink.schema] = routeLink.href;
|
|
421
|
-
}
|
|
422
|
-
return object;
|
|
423
|
-
}, {});
|
|
424
|
-
const menu = {};
|
|
425
|
-
const menus = await getMenus({ market, locale });
|
|
426
|
-
menus.forEach((x) => {
|
|
427
|
-
menu[x.id] = x;
|
|
428
|
-
});
|
|
429
|
-
return {
|
|
430
|
-
labels,
|
|
431
|
-
locale,
|
|
432
|
-
locales,
|
|
433
|
-
market,
|
|
434
|
-
markets,
|
|
435
|
-
app,
|
|
436
|
-
menu,
|
|
437
|
-
topLevelHrefs,
|
|
438
|
-
topLevelRoutes,
|
|
439
|
-
tree
|
|
440
|
-
};
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
// src/lazy/lazy.ts
|
|
444
|
-
var LAZY_PROPS = {};
|
|
445
|
-
function withLazyProps(key, getComponentProps) {
|
|
446
|
-
LAZY_PROPS[key] = getComponentProps;
|
|
447
|
-
}
|
|
448
|
-
async function getDecoratedComponents(props, extraComponents) {
|
|
449
|
-
const page = props.page;
|
|
450
|
-
const components = [
|
|
451
|
-
...page.components || [],
|
|
452
|
-
...extraComponents || []
|
|
453
|
-
];
|
|
454
|
-
const decoratedComponents = [];
|
|
455
|
-
for (const component of components) {
|
|
456
|
-
const key = component.blockType || component.schema || "unkown_type";
|
|
457
|
-
const getComponentProps = LAZY_PROPS[key];
|
|
458
|
-
if (typeof getComponentProps === "function") {
|
|
459
|
-
const decoratedComponent = await getComponentProps({ ...props, component });
|
|
460
|
-
decoratedComponents.push(decoratedComponent);
|
|
461
|
-
} else {
|
|
462
|
-
decoratedComponents.push(component);
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
page.components = decoratedComponents;
|
|
466
|
-
}
|
|
467
|
-
|
|
468
|
-
// src/link/link.service.ts
|
|
469
|
-
function getLink_(category, routeLink) {
|
|
470
|
-
if (routeLink) {
|
|
471
|
-
if (routeLink.category === category) {
|
|
472
|
-
return routeLink.href;
|
|
473
|
-
}
|
|
474
|
-
if (routeLink.items) {
|
|
475
|
-
return routeLink.items.reduce((p, c) => {
|
|
476
|
-
return getLink_(category, c) || p;
|
|
477
|
-
}, void 0);
|
|
478
|
-
}
|
|
479
|
-
}
|
|
480
|
-
return void 0;
|
|
481
|
-
}
|
|
482
|
-
function getLink(category, layout) {
|
|
483
|
-
return getLink_(category, layout.tree);
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
// src/page/page.service.ts
|
|
487
|
-
import { asCategoryId as asCategoryId2, asServerProps, defaultLocale as defaultLocale2, defaultMarket as defaultMarket2 } from "@websolutespa/bom-core";
|
|
488
|
-
import { getStore as getStore12 } from "@websolutespa/bom-mixer-store";
|
|
489
|
-
async function findOnePage(schema, id, params) {
|
|
490
|
-
const store = await getStore12();
|
|
491
|
-
const collection = store[schema];
|
|
492
|
-
if (!collection) {
|
|
493
|
-
throw `PageService.findOnePage: Collection not found [${schema}]`;
|
|
494
|
-
}
|
|
495
|
-
const page = await collection.findOne(id, params);
|
|
496
|
-
if (page) {
|
|
497
|
-
return page;
|
|
498
|
-
} else {
|
|
499
|
-
console.log("PageService.findOnePage.notfound", schema, params);
|
|
500
|
-
return;
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
async function findManyPages(schema, params) {
|
|
504
|
-
const store = await getStore12();
|
|
505
|
-
const collection = store[schema];
|
|
506
|
-
if (!collection) {
|
|
507
|
-
throw `PageService.findManyPages: Collection not found [${schema}]`;
|
|
508
|
-
}
|
|
509
|
-
const pages = await collection.findMany(params);
|
|
510
|
-
return pages;
|
|
511
|
-
}
|
|
512
|
-
async function getPage(schema, id, market, locale, options) {
|
|
513
|
-
const { depth = 3, draftMode = false, previewData } = options || {};
|
|
514
|
-
const draft = draftMode === true;
|
|
515
|
-
const page = await findOnePage(schema, id, { market, locale, depth, draft });
|
|
516
|
-
if (page) {
|
|
517
|
-
const routes = await getPageRoutes(schema, id);
|
|
518
|
-
const currentRoute = routes.find((x) => x.market === market && x.locale === locale);
|
|
519
|
-
const alternates = routes;
|
|
520
|
-
const segments = await getSegments(page, { market, locale });
|
|
521
|
-
const breadcrumb = currentRoute ? await getBreadcrumbFromSegments(segments, currentRoute) : [];
|
|
522
|
-
const parentRoute = breadcrumb.length > 1 ? breadcrumb[breadcrumb.length - 2] : void 0;
|
|
523
|
-
const pageResult = {
|
|
524
|
-
...page,
|
|
525
|
-
href: currentRoute?.id,
|
|
526
|
-
// !!! route?
|
|
527
|
-
alternates,
|
|
528
|
-
breadcrumb,
|
|
529
|
-
parentRoute
|
|
530
|
-
};
|
|
531
|
-
return pageResult;
|
|
532
|
-
} else {
|
|
533
|
-
console.log("PageService.getPage.notfound", schema, id, locale);
|
|
534
|
-
return;
|
|
535
|
-
}
|
|
536
|
-
}
|
|
537
|
-
async function NotFound(market, locale) {
|
|
538
|
-
const routes = await getRoutes({
|
|
539
|
-
where: {
|
|
540
|
-
market: {
|
|
541
|
-
equals: market
|
|
542
|
-
},
|
|
543
|
-
locale: {
|
|
544
|
-
equals: locale
|
|
545
|
-
},
|
|
546
|
-
schema: {
|
|
547
|
-
equals: "notfound"
|
|
548
|
-
}
|
|
549
|
-
}
|
|
550
|
-
});
|
|
551
|
-
if (routes.length > 0) {
|
|
552
|
-
return {
|
|
553
|
-
redirect: {
|
|
554
|
-
destination: routes[0].id,
|
|
555
|
-
permanent: false
|
|
556
|
-
}
|
|
557
|
-
};
|
|
558
|
-
}
|
|
559
|
-
return;
|
|
560
|
-
}
|
|
561
|
-
async function getPageRoutes(schema, id) {
|
|
562
|
-
const store = await getStore12();
|
|
563
|
-
let routes = [];
|
|
564
|
-
try {
|
|
565
|
-
routes = await store.route.findMany({
|
|
566
|
-
where: {
|
|
567
|
-
page: {
|
|
568
|
-
equals: id
|
|
569
|
-
},
|
|
570
|
-
schema: {
|
|
571
|
-
equals: schema
|
|
572
|
-
}
|
|
573
|
-
}
|
|
574
|
-
});
|
|
575
|
-
} catch (error) {
|
|
576
|
-
console.error("No routes found for page " + schema + ":" + id);
|
|
577
|
-
}
|
|
578
|
-
return routes;
|
|
579
|
-
}
|
|
580
|
-
async function getPageCategory(schema, page, market, locale) {
|
|
581
|
-
if (!page) {
|
|
582
|
-
return;
|
|
583
|
-
}
|
|
584
|
-
const store = await getStore12();
|
|
585
|
-
const pages = await findManyPages(schema, {
|
|
586
|
-
where: {
|
|
587
|
-
category: {
|
|
588
|
-
equals: asCategoryId2(page.category)
|
|
589
|
-
}
|
|
590
|
-
},
|
|
591
|
-
market,
|
|
592
|
-
locale
|
|
593
|
-
});
|
|
594
|
-
const category = pages.length ? pages[0] : null;
|
|
595
|
-
if (category) {
|
|
596
|
-
const routes = await store.route.findMany({
|
|
597
|
-
where: {
|
|
598
|
-
schema: {
|
|
599
|
-
equals: schema
|
|
600
|
-
},
|
|
601
|
-
page: {
|
|
602
|
-
equals: category.id
|
|
603
|
-
}
|
|
604
|
-
}
|
|
605
|
-
});
|
|
606
|
-
const currentRoute = routes.find((x) => x.market === market && x.locale === locale);
|
|
607
|
-
if (!currentRoute) {
|
|
608
|
-
throw "No route found for page " + schema + ":" + category.id + " in market " + market + " and locale " + locale;
|
|
609
|
-
}
|
|
610
|
-
return {
|
|
611
|
-
...category,
|
|
612
|
-
href: currentRoute.id
|
|
613
|
-
};
|
|
614
|
-
} else {
|
|
615
|
-
console.log("PageService.getPageCategory.notfound", schema, locale);
|
|
616
|
-
return;
|
|
617
|
-
}
|
|
618
|
-
}
|
|
619
|
-
async function getErrorPageLayout() {
|
|
620
|
-
const layout = await getLayout(defaultMarket2, defaultLocale2);
|
|
621
|
-
const title = resolveLabel(layout.labels, "notfound.title");
|
|
622
|
-
const abstract = resolveLabel(layout.labels, "notfound.abstract");
|
|
623
|
-
const category = layout.tree ? {
|
|
624
|
-
id: layout.tree.category,
|
|
625
|
-
title: layout.tree.title,
|
|
626
|
-
href: layout.tree.href,
|
|
627
|
-
slug: ""
|
|
628
|
-
} : {
|
|
629
|
-
id: "homepage",
|
|
630
|
-
title: "Homepage",
|
|
631
|
-
slug: "",
|
|
632
|
-
href: "/"
|
|
633
|
-
};
|
|
634
|
-
const page = {
|
|
635
|
-
abstract,
|
|
636
|
-
alternates: [],
|
|
637
|
-
breadcrumb: [],
|
|
638
|
-
category,
|
|
639
|
-
slug: "",
|
|
640
|
-
href: "",
|
|
641
|
-
id: "notfound",
|
|
642
|
-
locale: layout.locale,
|
|
643
|
-
market: layout.market,
|
|
644
|
-
markets: [],
|
|
645
|
-
meta: {
|
|
646
|
-
title,
|
|
647
|
-
description: abstract,
|
|
648
|
-
keywords: "",
|
|
649
|
-
robots: "all"
|
|
650
|
-
},
|
|
651
|
-
schema: "notfound",
|
|
652
|
-
title
|
|
653
|
-
};
|
|
654
|
-
return { layout, page };
|
|
655
|
-
}
|
|
656
|
-
async function getPageProps(props, extraComponents) {
|
|
657
|
-
if (props.page) {
|
|
658
|
-
await getDecoratedComponents(props, extraComponents);
|
|
659
|
-
}
|
|
660
|
-
return asServerProps(props);
|
|
661
|
-
}
|
|
662
|
-
function getPublicUrl() {
|
|
663
|
-
const publicUrl = process.env && process.env.NEXT_PUBLIC_URL ? process.env.NEXT_PUBLIC_URL : "";
|
|
664
|
-
return publicUrl;
|
|
665
|
-
}
|
|
666
|
-
function resolveHref(href) {
|
|
667
|
-
href = href || "";
|
|
668
|
-
return href.startsWith("http") ? href : `${getPublicUrl()}${href}`;
|
|
669
|
-
}
|
|
670
|
-
|
|
671
|
-
// src/redirect/redirect.service.ts
|
|
672
|
-
import { getStore as getStore13 } from "@websolutespa/bom-mixer-store";
|
|
673
|
-
async function getRedirects(locale) {
|
|
674
|
-
const store = await getStore13();
|
|
675
|
-
const items = await store.redirect.findMany({ locale });
|
|
676
|
-
return items;
|
|
677
|
-
}
|
|
678
|
-
async function getRedirect(id, params = {}) {
|
|
679
|
-
const store = await getStore13();
|
|
680
|
-
const item = await store.redirect.findOne(id, params);
|
|
681
|
-
return item;
|
|
682
|
-
}
|
|
683
|
-
async function getRedirectsPagination(params = {}) {
|
|
684
|
-
const store = await getStore13();
|
|
685
|
-
const pagination = await store.redirect.findPaged(params);
|
|
686
|
-
return pagination;
|
|
687
|
-
}
|
|
688
|
-
function redirectTo(layout, key = "not_found") {
|
|
689
|
-
return {
|
|
690
|
-
redirect: {
|
|
691
|
-
permanent: false,
|
|
692
|
-
destination: layout.topLevelHrefs[key] || "/"
|
|
693
|
-
}
|
|
694
|
-
};
|
|
695
|
-
}
|
|
696
|
-
|
|
697
|
-
// src/route/route-revalidate.handler.ts
|
|
698
|
-
import { apiHandler } from "@websolutespa/bom-mixer-store";
|
|
699
|
-
function routeRevalidateHandler() {
|
|
700
|
-
return apiHandler({
|
|
701
|
-
post: async (request, response) => {
|
|
702
|
-
const authorization = request.headers.authorization;
|
|
703
|
-
const bearer = authorization && authorization.replace("Bearer ", "");
|
|
704
|
-
if (bearer !== process.env.HOOKS_SECRET) {
|
|
705
|
-
return response.status(401).json({ message: "Invalid token" });
|
|
706
|
-
}
|
|
707
|
-
try {
|
|
708
|
-
const { href } = request.body;
|
|
709
|
-
const routes = await getRoutes({
|
|
710
|
-
where: {
|
|
711
|
-
id: { equals: href }
|
|
712
|
-
}
|
|
713
|
-
});
|
|
714
|
-
if (routes.length === 0) {
|
|
715
|
-
return response.status(404).send(`routeRevalidateHandler.notFound ${href}`);
|
|
716
|
-
}
|
|
717
|
-
for (const route of routes) {
|
|
718
|
-
const resolvedRoute = resolveRoute(route);
|
|
719
|
-
console.log("route.revalidating", resolvedRoute);
|
|
720
|
-
await response.revalidate(resolvedRoute);
|
|
721
|
-
}
|
|
722
|
-
return response.json({ revalidated: true });
|
|
723
|
-
} catch (error) {
|
|
724
|
-
return response.status(500).send("Error revalidating");
|
|
725
|
-
}
|
|
726
|
-
}
|
|
727
|
-
});
|
|
728
|
-
}
|
|
729
|
-
|
|
730
|
-
// src/route/route.interceptor.ts
|
|
731
|
-
import { asEquatable, defaultLocale as defaultLocale3, defaultMarket as defaultMarket3, getHost, isDevelopment } from "@websolutespa/bom-core";
|
|
732
|
-
import { StoreStrategy as StoreStrategy2, localApiGet, localApiPost, storeApiGet, storeApiPost, storeStrategy as storeStrategy2 } from "@websolutespa/bom-mixer-store";
|
|
733
|
-
import { NextResponse } from "next/server";
|
|
734
|
-
async function detectLocale(request, defaultLocale4) {
|
|
735
|
-
const acceptLanguage = request.headers.get("accept-language")?.split(",")[0];
|
|
736
|
-
const detectedLocale = request.cookies.get("NEXT_LOCALE")?.value || acceptLanguage || defaultLocale4 || process.env.DEFAULT_LOCALE;
|
|
737
|
-
return detectedLocale;
|
|
738
|
-
}
|
|
739
|
-
async function detectCountry(request, defaultMarket4) {
|
|
740
|
-
const ip = request.ip || request.headers.get("X-Forwarded-For") || request.headers.get("x-real-ip");
|
|
741
|
-
const isValidIp = ip?.match(/^(\d+?)\.(\d+?)\.(\d+?)\.(\d+?)$/);
|
|
742
|
-
let detectedCountry = "";
|
|
743
|
-
try {
|
|
744
|
-
const token = process.env.IPINFO_TOKEN;
|
|
745
|
-
if (token) {
|
|
746
|
-
const url = isValidIp ? `https://api.ipinfo.io/lite/${ip}/country_code?token=${token}` : `https://api.ipinfo.io/lite/me/country_code?token=${token}`;
|
|
747
|
-
const response = await fetch(url);
|
|
748
|
-
if (response.ok) {
|
|
749
|
-
const data = await response.text();
|
|
750
|
-
detectedCountry = data.toLowerCase();
|
|
751
|
-
}
|
|
752
|
-
} else {
|
|
753
|
-
const url = `https://geoip.websolute.it/Ip2Location/get_info.aspx?ipaddress=${isValidIp ? ip : ""}`;
|
|
754
|
-
const response = await fetch(url);
|
|
755
|
-
if (response.ok) {
|
|
756
|
-
const xml = await response.text();
|
|
757
|
-
detectedCountry = ((xml.split("<CountryCode><![CDATA[")[1] || "").split("]]></CountryCode>")[0] || "").replace("-", "").toLowerCase();
|
|
758
|
-
}
|
|
759
|
-
}
|
|
760
|
-
return detectedCountry || defaultMarket4 || process.env.DEFAULT_MARKET;
|
|
761
|
-
} catch (error) {
|
|
762
|
-
console.log("routeInterceptor.detectCountry.error", error);
|
|
763
|
-
}
|
|
764
|
-
return defaultMarket4 || process.env.DEFAULT_MARKET;
|
|
765
|
-
}
|
|
766
|
-
async function getMarkets2() {
|
|
767
|
-
const apiGet = storeStrategy2 === StoreStrategy2.DecoratedApi ? localApiGet : storeApiGet;
|
|
768
|
-
const markets = await apiGet("/market?pagination=false");
|
|
769
|
-
return markets;
|
|
770
|
-
}
|
|
771
|
-
async function getRootRoutes() {
|
|
772
|
-
const apiGet = storeStrategy2 === StoreStrategy2.DecoratedApi ? localApiGet : storeApiGet;
|
|
773
|
-
const routes = await apiGet("/route?where[isRoot][equals]=true");
|
|
774
|
-
return routes;
|
|
775
|
-
}
|
|
776
|
-
async function routeAutoDetection(request, next) {
|
|
777
|
-
let route;
|
|
778
|
-
const url = request.nextUrl;
|
|
779
|
-
if (url.pathname === "/") {
|
|
780
|
-
const cookie = request.cookies.get("detectedRoute");
|
|
781
|
-
if (cookie?.value) {
|
|
782
|
-
return cookie.value;
|
|
783
|
-
}
|
|
784
|
-
const rootRoutes = await getRootRoutes();
|
|
785
|
-
const defaultRoute = rootRoutes.find((x) => x.id === "/");
|
|
786
|
-
if (defaultRoute) {
|
|
787
|
-
return;
|
|
788
|
-
}
|
|
789
|
-
const markets = await getMarkets2();
|
|
790
|
-
const market = markets.find((x) => x.isDefault) || markets.find((x) => x.id === defaultMarket3) || markets[0];
|
|
791
|
-
const detectedCountry = await detectCountry(request, market.id);
|
|
792
|
-
const detectedMarket = detectedCountry ? markets.filter((x) => Array.isArray(x.countries)).find((x) => {
|
|
793
|
-
const countries = (x.countries || []).map((x2) => typeof x2 === "string" ? x2 : x2.id);
|
|
794
|
-
return countries.includes(detectedCountry);
|
|
795
|
-
}) || markets.find((x) => !Array.isArray(x.countries)) : void 0;
|
|
796
|
-
let detectedMarketRoutes = rootRoutes.filter((x) => x.market === detectedMarket?.id);
|
|
797
|
-
if (detectedMarketRoutes.length === 0) {
|
|
798
|
-
detectedMarketRoutes = rootRoutes.filter((x) => x.market === market.id);
|
|
799
|
-
}
|
|
800
|
-
const defaultMarketLocale = market.defaultLanguage ? typeof market.defaultLanguage === "string" ? market.defaultLanguage : market.defaultLanguage.id : defaultLocale3;
|
|
801
|
-
const detectedLocale = await detectLocale(request, defaultMarketLocale);
|
|
802
|
-
const detectedLocaleRoutes = detectedMarketRoutes.filter((x) => x.locale === detectedLocale);
|
|
803
|
-
const detectedRoute = detectedLocaleRoutes.length > 0 ? detectedLocaleRoutes[0] : detectedMarketRoutes.find((x) => {
|
|
804
|
-
const market2 = markets.find((m) => m.id === x.market);
|
|
805
|
-
const marketLocale = market2.defaultLanguage ? asEquatable(market2.defaultLanguage) : defaultMarketLocale;
|
|
806
|
-
return x.locale === marketLocale;
|
|
807
|
-
});
|
|
808
|
-
if (detectedRoute && detectedRoute.id !== url.pathname) {
|
|
809
|
-
console.log("routeInterceptor.routeAutoDetection", detectedLocale, detectedCountry, detectedRoute.id);
|
|
810
|
-
route = detectedRoute.id;
|
|
811
|
-
}
|
|
812
|
-
}
|
|
813
|
-
return route;
|
|
814
|
-
}
|
|
815
|
-
async function routeInterceptor(request, next) {
|
|
816
|
-
let route;
|
|
817
|
-
let url = request.nextUrl;
|
|
818
|
-
const hrefBeforeRedirect = getHrefBeforeRedirect(request);
|
|
819
|
-
try {
|
|
820
|
-
const redirectUrl = await routeAutoDetection(request, next);
|
|
821
|
-
if (redirectUrl) {
|
|
822
|
-
const response2 = NextResponse.redirect(resolveHref(redirectUrl), isDevelopment ? 307 : 301);
|
|
823
|
-
response2.cookies.set({
|
|
824
|
-
expires: new Date(Date.now() + 1 * 24 * 60 * 60 * 1e3),
|
|
825
|
-
httpOnly: true,
|
|
826
|
-
name: "detectedRoute",
|
|
827
|
-
path: "/",
|
|
828
|
-
sameSite: "lax",
|
|
829
|
-
secure: true,
|
|
830
|
-
value: redirectUrl
|
|
831
|
-
});
|
|
832
|
-
return response2;
|
|
833
|
-
}
|
|
834
|
-
if (storeStrategy2 === StoreStrategy2.DecoratedApi) {
|
|
835
|
-
route = await localApiPost("/route", { pathname: url.pathname, href: url.href, hrefBeforeRedirect });
|
|
836
|
-
} else {
|
|
837
|
-
route = await storeApiPost("/route", { pathname: url.pathname, href: url.href, hrefBeforeRedirect });
|
|
838
|
-
}
|
|
839
|
-
if (!route) {
|
|
840
|
-
console.log("routeInterceptor.route.notfound", url.pathname);
|
|
841
|
-
return;
|
|
842
|
-
}
|
|
843
|
-
} catch (error) {
|
|
844
|
-
if (error.status >= 300 && error.status < 400) {
|
|
845
|
-
console.log("routeInterceptor.3xx", url.pathname, error.status, error.statusText);
|
|
846
|
-
try {
|
|
847
|
-
const { redirectUrl } = await error.json();
|
|
848
|
-
const response2 = NextResponse.redirect(redirectUrl, error.status);
|
|
849
|
-
return response2;
|
|
850
|
-
} catch (error2) {
|
|
851
|
-
const publicUrl = getPublicUrl();
|
|
852
|
-
console.log("routeInterceptor.3xx.error", `cannot parse response, redirecting to ${publicUrl}`);
|
|
853
|
-
const response2 = NextResponse.redirect(publicUrl, 307);
|
|
854
|
-
return response2;
|
|
855
|
-
}
|
|
856
|
-
} else if (error.status === 410) {
|
|
857
|
-
console.log("routeInterceptor.410", url.pathname, error.status, error.statusText);
|
|
858
|
-
url = request.nextUrl.clone();
|
|
859
|
-
url.pathname = `/${error.status}`;
|
|
860
|
-
const response2 = NextResponse.rewrite(url, {
|
|
861
|
-
status: error.status,
|
|
862
|
-
statusText: error.statusText,
|
|
863
|
-
request
|
|
864
|
-
});
|
|
865
|
-
return response2;
|
|
866
|
-
} else if (error.status >= 400 && error.status < 500) {
|
|
867
|
-
console.log("routeInterceptor.4xx", url.pathname, error.status, error.statusText);
|
|
868
|
-
const response2 = NextResponse.next({
|
|
869
|
-
status: error.status,
|
|
870
|
-
statusText: error.statusText,
|
|
871
|
-
request
|
|
872
|
-
});
|
|
873
|
-
return response2;
|
|
874
|
-
}
|
|
875
|
-
console.log("routeInterceptor.error", url.pathname, error.url, error.status, error.statusText || error);
|
|
876
|
-
return;
|
|
877
|
-
}
|
|
878
|
-
url = request.nextUrl.clone();
|
|
879
|
-
const resolvedPathname = resolveRoute(route);
|
|
880
|
-
url.pathname = resolvedPathname;
|
|
881
|
-
const response = NextResponse.rewrite(url);
|
|
882
|
-
return response;
|
|
883
|
-
}
|
|
884
|
-
function getHrefBeforeRedirect(request) {
|
|
885
|
-
let hrefBeforeRedirect = null;
|
|
886
|
-
const urlBeforeRedirect = request.nextUrl.clone();
|
|
887
|
-
const host = getHost(request.headers);
|
|
888
|
-
if (host) {
|
|
889
|
-
urlBeforeRedirect.host = host;
|
|
890
|
-
urlBeforeRedirect.port = host.split(":")[1] || "";
|
|
891
|
-
hrefBeforeRedirect = urlBeforeRedirect.href;
|
|
892
|
-
}
|
|
893
|
-
return hrefBeforeRedirect;
|
|
894
|
-
}
|
|
895
|
-
|
|
896
|
-
// src/seo/seo.service.ts
|
|
897
|
-
var getSeoWeight = (index = 0, seoWeight) => {
|
|
898
|
-
const getter = (subIndex = 0) => {
|
|
899
|
-
const i = seoWeight ? parseInt(seoWeight.replace(/\D/g, "")) : index === 0 ? 1 : 2;
|
|
900
|
-
return `h${Math.min(i + subIndex, 6)}`;
|
|
901
|
-
};
|
|
902
|
-
return getter;
|
|
903
|
-
};
|
|
904
|
-
|
|
905
|
-
// src/session/session.service.ts
|
|
906
|
-
import { isDevelopment as isDevelopment2 } from "@websolutespa/bom-core";
|
|
907
|
-
import { getIronSession } from "iron-session";
|
|
908
|
-
async function getSession(request, response) {
|
|
909
|
-
const COOKIE_NAME = "websolutespa-next-js";
|
|
910
|
-
const COOKIE_PASSWORD = process.env.SECRET_COOKIE_PASSWORD || "SECRET_COOKIE_PASSWORD_32_CHARS_LONG";
|
|
911
|
-
const sessionOptions = {
|
|
912
|
-
cookieName: COOKIE_NAME,
|
|
913
|
-
// secure: true should be used in production (HTTPS) but can't be used in development (HTTP)
|
|
914
|
-
cookieOptions: {
|
|
915
|
-
secure: !isDevelopment2
|
|
916
|
-
},
|
|
917
|
-
password: COOKIE_PASSWORD
|
|
918
|
-
};
|
|
919
|
-
const session = await getIronSession(request, response, sessionOptions);
|
|
920
|
-
return session;
|
|
921
|
-
}
|
|
922
|
-
async function getSessionToken(request, response) {
|
|
923
|
-
const session = await getSession(request, response);
|
|
924
|
-
if (session.token && session.exp && session.exp > Math.floor((/* @__PURE__ */ new Date()).getTime() / 1e3)) {
|
|
925
|
-
return session.token;
|
|
926
|
-
} else {
|
|
927
|
-
session.token = void 0;
|
|
928
|
-
session.exp = void 0;
|
|
929
|
-
await session.save();
|
|
930
|
-
session.destroy();
|
|
931
|
-
return;
|
|
932
|
-
}
|
|
933
|
-
}
|
|
934
|
-
|
|
935
|
-
// src/sitemap/sitemap.handler.ts
|
|
936
|
-
import { getOrigin } from "@websolutespa/bom-core";
|
|
937
|
-
|
|
938
|
-
// src/sitemap/sitemap.service.ts
|
|
939
|
-
import { eachMarketLocale } from "@websolutespa/bom-core";
|
|
940
|
-
async function getSiteMapIndex(origin) {
|
|
941
|
-
let markets = await getMarkets();
|
|
942
|
-
let locales = await getLocales();
|
|
943
|
-
markets = markets.filter((x) => x.isActive !== false);
|
|
944
|
-
locales = locales.filter((x) => x.isActive !== false);
|
|
945
|
-
const routes = await getRoutes();
|
|
946
|
-
const sitemaps = [];
|
|
947
|
-
const getTime = (date) => {
|
|
948
|
-
return typeof date !== "undefined" ? (typeof date === "string" ? new Date(date) : date).getTime() : 0;
|
|
949
|
-
};
|
|
950
|
-
eachMarketLocale(markets, locales, (market, locale, markets2, locales2) => {
|
|
951
|
-
const sitemapRoutes = routes.filter((x) => x.market === market.id && x.locale === locale.id);
|
|
952
|
-
sitemapRoutes.sort((a, b) => getTime(a.updatedAt) - getTime(b.updatedAt));
|
|
953
|
-
sitemaps.push({
|
|
954
|
-
id: `/${market.id}/${locale.id}/sitemap.xml`,
|
|
955
|
-
updatedAt: sitemapRoutes.length > 0 ? sitemapRoutes[sitemapRoutes.length - 1].updatedAt : void 0
|
|
956
|
-
});
|
|
957
|
-
});
|
|
958
|
-
return `<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="${origin}/sitemap.xsl"?>
|
|
959
|
-
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
960
|
-
${sitemaps.map((sitemap) => `
|
|
961
|
-
<sitemap>
|
|
962
|
-
<loc>${escapeHtml(encodeURI(`${origin}${sitemap.id}`))}</loc>${sitemap.updatedAt ? `
|
|
963
|
-
<lastmod>${escapeHtml(String(sitemap.updatedAt))}</lastmod>` : ""}
|
|
964
|
-
</sitemap>
|
|
965
|
-
`).join("")}
|
|
966
|
-
</sitemapindex>`;
|
|
967
|
-
}
|
|
968
|
-
function getSiteMapXMLLastMod(canonical) {
|
|
969
|
-
return canonical.updatedAt ? `
|
|
970
|
-
<lastmod>${escapeHtml(String(canonical.updatedAt))}</lastmod>` : "";
|
|
971
|
-
}
|
|
972
|
-
function getSiteMapXMLImage(canonical) {
|
|
973
|
-
return canonical.media ? `
|
|
974
|
-
<image:image>
|
|
975
|
-
<image:loc>${escapeHtml(encodeURI(`${canonical.media.src || canonical.media.url}`))}</image:loc>
|
|
976
|
-
</image:image>` : "";
|
|
977
|
-
}
|
|
978
|
-
function getSiteMapXMLAlternates(origin, canonical) {
|
|
979
|
-
return canonical.alternates.map((alternate) => `
|
|
980
|
-
<xhtml:link href="${escapeHtml(encodeURI(`${origin}${alternate.id}`))}" hreflang="${alternate.locale}-${alternate.market}" rel="alternate" />`).join("");
|
|
981
|
-
}
|
|
982
|
-
function getSiteMapXMLUrl(origin, canonical) {
|
|
983
|
-
return `
|
|
984
|
-
<url>
|
|
985
|
-
<loc>${escapeHtml(encodeURI(`${origin}${canonical.id}`))}</loc>${getSiteMapXMLLastMod(canonical)}${getSiteMapXMLAlternates(origin, canonical)}${getSiteMapXMLImage(canonical)}
|
|
986
|
-
</url>`;
|
|
987
|
-
}
|
|
988
|
-
function escapeHtml(string) {
|
|
989
|
-
const matchHtmlRegExp = /["'&<>]/;
|
|
990
|
-
const str = "" + string;
|
|
991
|
-
const match = matchHtmlRegExp.exec(str);
|
|
992
|
-
if (!match) {
|
|
993
|
-
return str;
|
|
994
|
-
}
|
|
995
|
-
let escape;
|
|
996
|
-
let html = "";
|
|
997
|
-
let index = 0;
|
|
998
|
-
let lastIndex = 0;
|
|
999
|
-
for (index = match.index; index < str.length; index++) {
|
|
1000
|
-
switch (str.charCodeAt(index)) {
|
|
1001
|
-
case 34:
|
|
1002
|
-
escape = """;
|
|
1003
|
-
break;
|
|
1004
|
-
case 38:
|
|
1005
|
-
escape = "&";
|
|
1006
|
-
break;
|
|
1007
|
-
case 39:
|
|
1008
|
-
escape = "'";
|
|
1009
|
-
break;
|
|
1010
|
-
case 60:
|
|
1011
|
-
escape = "<";
|
|
1012
|
-
break;
|
|
1013
|
-
case 62:
|
|
1014
|
-
escape = ">";
|
|
1015
|
-
break;
|
|
1016
|
-
default:
|
|
1017
|
-
continue;
|
|
1018
|
-
}
|
|
1019
|
-
if (lastIndex !== index) {
|
|
1020
|
-
html += str.substring(lastIndex, index);
|
|
1021
|
-
}
|
|
1022
|
-
lastIndex = index + 1;
|
|
1023
|
-
html += escape;
|
|
1024
|
-
}
|
|
1025
|
-
return lastIndex !== index ? html + str.substring(lastIndex, index) : html;
|
|
1026
|
-
}
|
|
1027
|
-
function getSiteMapXMLUrls(origin, canonicalRoutes) {
|
|
1028
|
-
return canonicalRoutes.map((canonicalRoute) => getSiteMapXMLUrl(origin, canonicalRoute)).join("");
|
|
1029
|
-
}
|
|
1030
|
-
async function getSiteMapXML(origin, marketId, localeId) {
|
|
1031
|
-
let markets = await getMarkets();
|
|
1032
|
-
let locales = await getLocales();
|
|
1033
|
-
markets = markets.filter((x) => x.isActive !== false);
|
|
1034
|
-
locales = locales.filter((x) => x.isActive !== false);
|
|
1035
|
-
const defaultMarket4 = markets.find((x) => marketId ? x.id === marketId : x.isDefault) || markets[0];
|
|
1036
|
-
const defaultLocale4 = locales.find((x) => localeId ? x.id === localeId : x.isDefault) || locales[0];
|
|
1037
|
-
const defaultMarketLocale = defaultMarket4 && defaultMarket4.defaultLanguage ? defaultMarket4.defaultLanguage : defaultLocale4.id;
|
|
1038
|
-
const routes = await getRoutes();
|
|
1039
|
-
const isCanonicalRoute = marketId && localeId ? (route) => {
|
|
1040
|
-
return route.noindex !== true && route.market === defaultMarket4.id && route.locale === defaultLocale4.id;
|
|
1041
|
-
} : (route) => {
|
|
1042
|
-
return route.noindex !== true && route.market === defaultMarket4.id && route.locale === defaultMarketLocale;
|
|
1043
|
-
};
|
|
1044
|
-
const getCanonicalAlternates = marketId && localeId ? (canonical) => {
|
|
1045
|
-
return [];
|
|
1046
|
-
} : (canonical) => {
|
|
1047
|
-
return routes.filter((alternate) => {
|
|
1048
|
-
return alternate !== canonical && alternate.schema === canonical.schema && alternate.page === canonical.page;
|
|
1049
|
-
});
|
|
1050
|
-
};
|
|
1051
|
-
const routeToRouteCanonical = (canonical) => {
|
|
1052
|
-
const alternates = getCanonicalAlternates(canonical);
|
|
1053
|
-
return { ...canonical, alternates };
|
|
1054
|
-
};
|
|
1055
|
-
const canonicalRoutes = routes.filter(isCanonicalRoute).map(routeToRouteCanonical);
|
|
1056
|
-
return `<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="${origin}/sitemap.xsl"?>
|
|
1057
|
-
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
|
|
1058
|
-
xmlns:xhtml="http://www.w3.org/1999/xhtml"
|
|
1059
|
-
xmlns:image="http://www.google.com/schemas/sitemap-image/1.1">
|
|
1060
|
-
${getSiteMapXMLUrls(origin, canonicalRoutes)}
|
|
1061
|
-
</urlset>
|
|
1062
|
-
`;
|
|
1063
|
-
}
|
|
1064
|
-
async function getSiteMapXSL(localeId) {
|
|
1065
|
-
let locales = await getLocales();
|
|
1066
|
-
locales = locales.filter((x) => x.isActive !== false);
|
|
1067
|
-
const defaultLocale4 = locales.find((x) => localeId ? x.id === localeId : x.isDefault) || locales[0];
|
|
1068
|
-
return (
|
|
1069
|
-
/* html */
|
|
1070
|
-
`<?xml version="1.0" encoding="UTF-8"?>
|
|
1071
|
-
<xsl:stylesheet version="2.0"
|
|
1072
|
-
xmlns:html="http://www.w3.org/TR/REC-html40"
|
|
1073
|
-
xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"
|
|
1074
|
-
xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9"
|
|
1075
|
-
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
|
|
1076
|
-
<xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>
|
|
1077
|
-
<xsl:template match="/">
|
|
1078
|
-
<html lang="${defaultLocale4.id}" xmlns="http://www.w3.org/1999/xhtml">
|
|
1079
|
-
<head>
|
|
1080
|
-
<title>XML Sitemap</title>
|
|
1081
|
-
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
1082
|
-
<style type="text/css">
|
|
1083
|
-
html {
|
|
1084
|
-
padding: 0;
|
|
1085
|
-
background: #09090A;
|
|
1086
|
-
color: #fefefe;
|
|
1087
|
-
}
|
|
1088
|
-
body {
|
|
1089
|
-
padding: 15px;
|
|
1090
|
-
font-family: Inter,-apple-system,'Helvetica Neue','Segoe UI',Roboto,Arial,'Noto Sans',sans-serif;
|
|
1091
|
-
font-size: 13px;
|
|
1092
|
-
background: #09090A;
|
|
1093
|
-
color: #fefefe;
|
|
1094
|
-
}
|
|
1095
|
-
.container {
|
|
1096
|
-
margin: 0 auto;
|
|
1097
|
-
max-width: 1280px;
|
|
1098
|
-
}
|
|
1099
|
-
a {
|
|
1100
|
-
color: #fefefe;
|
|
1101
|
-
text-decoration: none;
|
|
1102
|
-
}
|
|
1103
|
-
a:visited {
|
|
1104
|
-
color: #9e9e9e;
|
|
1105
|
-
}
|
|
1106
|
-
a:hover {
|
|
1107
|
-
text-decoration: underline;
|
|
1108
|
-
}
|
|
1109
|
-
table {
|
|
1110
|
-
width: 100%;
|
|
1111
|
-
margin: 10px 0;
|
|
1112
|
-
border: none;
|
|
1113
|
-
border-collapse: collapse;
|
|
1114
|
-
}
|
|
1115
|
-
td,
|
|
1116
|
-
th {
|
|
1117
|
-
text-align: left;
|
|
1118
|
-
font-size: 12px;
|
|
1119
|
-
padding: 3px;
|
|
1120
|
-
}
|
|
1121
|
-
th:not(:last-child),
|
|
1122
|
-
td:not(:last-child) {
|
|
1123
|
-
padding-right: 30px;
|
|
1124
|
-
}
|
|
1125
|
-
thead th {
|
|
1126
|
-
border-bottom: 1px solid #0e0e0f;
|
|
1127
|
-
}
|
|
1128
|
-
#sitemap tr:nth-child(odd) td {
|
|
1129
|
-
background-color: #0e0e0f;
|
|
1130
|
-
}
|
|
1131
|
-
#sitemap tbody tr:hover td {
|
|
1132
|
-
background-color: #1A1A1B;
|
|
1133
|
-
}
|
|
1134
|
-
#sitemap tbody tr:hover td,
|
|
1135
|
-
#sitemap tbody tr:hover td a {
|
|
1136
|
-
color: #fefefe;
|
|
1137
|
-
}
|
|
1138
|
-
.wysiwyg {
|
|
1139
|
-
margin: 0;
|
|
1140
|
-
padding: 0 0 10px 0;
|
|
1141
|
-
line-height: 1.2em;
|
|
1142
|
-
}
|
|
1143
|
-
.wysiwyg a {
|
|
1144
|
-
color: #00ea4e;
|
|
1145
|
-
font-weight: 600;
|
|
1146
|
-
}
|
|
1147
|
-
.wysiwyg a:visited {
|
|
1148
|
-
color: #00ea4e;
|
|
1149
|
-
}
|
|
1150
|
-
</style>
|
|
1151
|
-
</head>
|
|
1152
|
-
<body>
|
|
1153
|
-
<div class="container">
|
|
1154
|
-
<h1>XML Sitemap</h1>
|
|
1155
|
-
<p class="wysiwyg">
|
|
1156
|
-
This is an XML Sitemap meant for consumption by search engines, generated by <a href="https://github.com/websolutespa/bom" target="_blank" rel="noopener">Mixer</a>.
|
|
1157
|
-
</p>
|
|
1158
|
-
<p class="wysiwyg">
|
|
1159
|
-
You can find more information about XML sitemaps on <a href="https://sitemaps.org" target="_blank" rel="noopener">sitemaps.org</a>.
|
|
1160
|
-
</p>
|
|
1161
|
-
<xsl:if test="count(sitemap:sitemapindex/sitemap:sitemap) > 0">
|
|
1162
|
-
<p class="wysiwyg">
|
|
1163
|
-
This sitemap index file contains <xsl:value-of select="count(sitemap:sitemapindex/sitemap:sitemap)"/> sitemaps.
|
|
1164
|
-
</p>
|
|
1165
|
-
<table id="sitemap" cellpadding="3">
|
|
1166
|
-
<thead>
|
|
1167
|
-
<tr>
|
|
1168
|
-
<th width="75%">Sitemap</th>
|
|
1169
|
-
<th width="25%" title="Last Modification Time">Updated At</th>
|
|
1170
|
-
</tr>
|
|
1171
|
-
</thead>
|
|
1172
|
-
<tbody>
|
|
1173
|
-
<xsl:for-each select="sitemap:sitemapindex/sitemap:sitemap">
|
|
1174
|
-
<xsl:variable name="sitemapURL">
|
|
1175
|
-
<xsl:value-of select="sitemap:loc"/>
|
|
1176
|
-
</xsl:variable>
|
|
1177
|
-
<tr>
|
|
1178
|
-
<td>
|
|
1179
|
-
<a href="{$sitemapURL}"><xsl:value-of select="sitemap:loc"/></a>
|
|
1180
|
-
</td>
|
|
1181
|
-
<td>
|
|
1182
|
-
<xsl:value-of select="concat(substring(sitemap:lastmod,0,11),concat(' ', substring(sitemap:lastmod,12,5)),concat(' ', substring(sitemap:lastmod,20,6)))"/>
|
|
1183
|
-
</td>
|
|
1184
|
-
</tr>
|
|
1185
|
-
</xsl:for-each>
|
|
1186
|
-
</tbody>
|
|
1187
|
-
</table>
|
|
1188
|
-
</xsl:if>
|
|
1189
|
-
<xsl:if test="count(sitemap:sitemapindex/sitemap:sitemap) < 1">
|
|
1190
|
-
<p class="wysiwyg">
|
|
1191
|
-
This sitemap contains <xsl:value-of select="count(sitemap:urlset/sitemap:url)"/> URLs.
|
|
1192
|
-
</p>
|
|
1193
|
-
<table id="sitemap" cellpadding="3">
|
|
1194
|
-
<thead>
|
|
1195
|
-
<tr>
|
|
1196
|
-
<th width="75%">URL</th>
|
|
1197
|
-
<th width="15%" title="Last Modification Time">Updated At</th>
|
|
1198
|
-
<th width="10%">Images</th>
|
|
1199
|
-
</tr>
|
|
1200
|
-
</thead>
|
|
1201
|
-
<tbody>
|
|
1202
|
-
<xsl:variable name="lower" select="'abcdefghijklmnopqrstuvwxyz'"/>
|
|
1203
|
-
<xsl:variable name="upper" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
|
|
1204
|
-
<xsl:for-each select="sitemap:urlset/sitemap:url">
|
|
1205
|
-
<tr>
|
|
1206
|
-
<td>
|
|
1207
|
-
<xsl:variable name="itemURL">
|
|
1208
|
-
<xsl:value-of select="sitemap:loc"/>
|
|
1209
|
-
</xsl:variable>
|
|
1210
|
-
<a href="{$itemURL}">
|
|
1211
|
-
<xsl:value-of select="sitemap:loc"/>
|
|
1212
|
-
</a>
|
|
1213
|
-
</td>
|
|
1214
|
-
<td>
|
|
1215
|
-
<xsl:value-of select="concat(substring(sitemap:lastmod,0,11),concat(' ', substring(sitemap:lastmod,12,5)),concat(' ', substring(sitemap:lastmod,20,6)))"/>
|
|
1216
|
-
</td>
|
|
1217
|
-
<td>
|
|
1218
|
-
<xsl:value-of select="count(image:image)"/>
|
|
1219
|
-
</td>
|
|
1220
|
-
</tr>
|
|
1221
|
-
</xsl:for-each>
|
|
1222
|
-
</tbody>
|
|
1223
|
-
</table>
|
|
1224
|
-
</xsl:if>
|
|
1225
|
-
</div>
|
|
1226
|
-
</body>
|
|
1227
|
-
</html>
|
|
1228
|
-
</xsl:template>
|
|
1229
|
-
</xsl:stylesheet>`
|
|
1230
|
-
);
|
|
1231
|
-
}
|
|
1232
|
-
|
|
1233
|
-
// src/sitemap/sitemap.handler.ts
|
|
1234
|
-
var getSiteMapIndexProps = async (context) => {
|
|
1235
|
-
const { req, res } = context;
|
|
1236
|
-
const sitemap = await getSiteMapIndex(getOrigin(req.headers));
|
|
1237
|
-
res.setHeader("Content-Type", "application/xml; charset=UTF-8");
|
|
1238
|
-
res.setHeader("X-Frame-Options", "SAMEORIGIN");
|
|
1239
|
-
res.setHeader("X-Robots-Tag", "noindex, follow");
|
|
1240
|
-
res.write(sitemap);
|
|
1241
|
-
res.end();
|
|
1242
|
-
return {
|
|
1243
|
-
props: {}
|
|
1244
|
-
};
|
|
1245
|
-
};
|
|
1246
|
-
var getSiteMapXMLProps = async (context) => {
|
|
1247
|
-
const { req, res } = context;
|
|
1248
|
-
const params = context.params;
|
|
1249
|
-
const market = params?.market;
|
|
1250
|
-
const locale = params?.locale;
|
|
1251
|
-
const sitemap = await getSiteMapXML(getOrigin(req.headers), market, locale);
|
|
1252
|
-
res.setHeader("Content-Type", "application/xml; charset=UTF-8");
|
|
1253
|
-
res.setHeader("X-Frame-Options", "SAMEORIGIN");
|
|
1254
|
-
res.setHeader("X-Robots-Tag", "noindex, follow");
|
|
1255
|
-
res.write(sitemap);
|
|
1256
|
-
res.end();
|
|
1257
|
-
return {
|
|
1258
|
-
props: {}
|
|
1259
|
-
};
|
|
1260
|
-
};
|
|
1261
|
-
var getSiteMapXSLProps = async (context) => {
|
|
1262
|
-
const { req, res } = context;
|
|
1263
|
-
const params = context.params;
|
|
1264
|
-
const market = params?.market;
|
|
1265
|
-
const locale = params?.locale;
|
|
1266
|
-
const sitemap = await getSiteMapXSL(locale);
|
|
1267
|
-
res.setHeader("Content-Type", "application/xml; charset=UTF-8");
|
|
1268
|
-
res.setHeader("X-Frame-Options", "SAMEORIGIN");
|
|
1269
|
-
res.setHeader("X-Robots-Tag", "noindex, follow");
|
|
1270
|
-
res.write(sitemap);
|
|
1271
|
-
res.end();
|
|
1272
|
-
return {
|
|
1273
|
-
props: {}
|
|
1274
|
-
};
|
|
1275
|
-
};
|
|
1276
|
-
|
|
1277
|
-
// src/utmz/utmz.service.ts
|
|
1278
|
-
function getUtmz(request) {
|
|
1279
|
-
let utmz = "N/A";
|
|
1280
|
-
if (typeof request.cookies.__utmz === "string") {
|
|
1281
|
-
utmz = request.cookies.__utmz;
|
|
1282
|
-
const i = utmz.indexOf("utmcsr");
|
|
1283
|
-
utmz = utmz.substring(i === -1 ? 0 : i);
|
|
1284
|
-
}
|
|
1285
|
-
return utmz;
|
|
1286
|
-
}
|
|
1287
|
-
export {
|
|
1288
|
-
LAZY_PROPS,
|
|
1289
|
-
NotFound,
|
|
1290
|
-
detectCountry,
|
|
1291
|
-
detectLocale,
|
|
1292
|
-
escapeHtml,
|
|
1293
|
-
findManyPages,
|
|
1294
|
-
findOnePage,
|
|
1295
|
-
getAddressOptions,
|
|
1296
|
-
getBreadcrumbFromSegments,
|
|
1297
|
-
getCaptionsVttProps,
|
|
1298
|
-
getCategories,
|
|
1299
|
-
getCategory,
|
|
1300
|
-
getConsentPreference,
|
|
1301
|
-
getConsentPreferences,
|
|
1302
|
-
getConsentPreferencesPagination,
|
|
1303
|
-
getCountries,
|
|
1304
|
-
getCountriesPagination,
|
|
1305
|
-
getCountry,
|
|
1306
|
-
getDecoratedComponents,
|
|
1307
|
-
getErrorPageLayout,
|
|
1308
|
-
getLabel,
|
|
1309
|
-
getLabels,
|
|
1310
|
-
getLayout,
|
|
1311
|
-
getLink,
|
|
1312
|
-
getLocale,
|
|
1313
|
-
getLocaleFromProps,
|
|
1314
|
-
getLocales,
|
|
1315
|
-
getMarket,
|
|
1316
|
-
getMarkets,
|
|
1317
|
-
getMenu,
|
|
1318
|
-
getMenus,
|
|
1319
|
-
getPage,
|
|
1320
|
-
getPageCategory,
|
|
1321
|
-
getPageProps,
|
|
1322
|
-
getPageRoutes,
|
|
1323
|
-
getProvince,
|
|
1324
|
-
getProvinces,
|
|
1325
|
-
getProvincesPagination,
|
|
1326
|
-
getPublicUrl,
|
|
1327
|
-
getRedirect,
|
|
1328
|
-
getRedirects,
|
|
1329
|
-
getRedirectsPagination,
|
|
1330
|
-
getRegion,
|
|
1331
|
-
getRegions,
|
|
1332
|
-
getRegionsPagination,
|
|
1333
|
-
getRoute,
|
|
1334
|
-
getRouteLinkCategory,
|
|
1335
|
-
getRouteLinkTree,
|
|
1336
|
-
getRoutes,
|
|
1337
|
-
getRoutesForSchemas,
|
|
1338
|
-
getRoutesForTemplates,
|
|
1339
|
-
getSegments,
|
|
1340
|
-
getSeoWeight,
|
|
1341
|
-
getSession,
|
|
1342
|
-
getSessionToken,
|
|
1343
|
-
getSiteMapIndex,
|
|
1344
|
-
getSiteMapIndexProps,
|
|
1345
|
-
getSiteMapXML,
|
|
1346
|
-
getSiteMapXMLProps,
|
|
1347
|
-
getSiteMapXSL,
|
|
1348
|
-
getSiteMapXSLProps,
|
|
1349
|
-
getStaticPathsForSchema,
|
|
1350
|
-
getStaticPathsForSchemaAndFallback,
|
|
1351
|
-
getUtmz,
|
|
1352
|
-
newRouteLink,
|
|
1353
|
-
pushDataLayer,
|
|
1354
|
-
redirectTo,
|
|
1355
|
-
resolveHref,
|
|
1356
|
-
resolveLabel,
|
|
1357
|
-
resolveRoute,
|
|
1358
|
-
routeAutoDetection,
|
|
1359
|
-
routeInterceptor,
|
|
1360
|
-
routeRevalidateHandler,
|
|
1361
|
-
routeToRouteLink,
|
|
1362
|
-
withLazyProps
|
|
1363
|
-
};
|