@jmp-technologies/analytics 0.1.37 → 0.1.39
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/README.md +1 -1
- package/dist/astro/client.cjs +144 -4
- package/dist/astro/client.cjs.map +1 -1
- package/dist/astro/client.d.cts +2 -2
- package/dist/astro/client.d.ts +2 -2
- package/dist/astro/client.js +2 -2
- package/dist/astro/content.cjs +190 -8
- package/dist/astro/content.cjs.map +1 -1
- package/dist/astro/content.d.cts +5 -4
- package/dist/astro/content.d.ts +5 -4
- package/dist/astro/content.js +5 -3
- package/dist/astro/integration.cjs +149 -6
- package/dist/astro/integration.cjs.map +1 -1
- package/dist/astro/integration.js +3 -3
- package/dist/astro/middleware.cjs +5 -2
- package/dist/astro/middleware.cjs.map +1 -1
- package/dist/astro/middleware.d.cts +2 -2
- package/dist/astro/middleware.d.ts +2 -2
- package/dist/astro/middleware.js +2 -2
- package/dist/astro/register.cjs +149 -6
- package/dist/astro/register.cjs.map +1 -1
- package/dist/astro/register.js +3 -3
- package/dist/{chunk-EMZXL6VF.js → chunk-6WQMWPEY.js} +6 -3
- package/dist/chunk-6WQMWPEY.js.map +1 -0
- package/dist/{chunk-D43AEUXU.js → chunk-BXPMVR7M.js} +3 -3
- package/dist/{chunk-TN6PGIB5.js → chunk-JJ3JP3RV.js} +2 -2
- package/dist/{chunk-UHXWHKHJ.js → chunk-M66PHSBO.js} +16 -3
- package/dist/chunk-M66PHSBO.js.map +1 -0
- package/dist/{chunk-VQF6QYLR.js → chunk-OCIOQIE4.js} +3 -3
- package/dist/{chunk-PTXPNIMF.js → chunk-ONIPLMOY.js} +2 -2
- package/dist/{chunk-RT2YYDCK.js → chunk-XAEWXWSP.js} +189 -8
- package/dist/chunk-XAEWXWSP.js.map +1 -0
- package/dist/constants-DTZMYgi4.d.cts +12 -0
- package/dist/constants-DTZMYgi4.d.ts +12 -0
- package/dist/{create-jmp-analytics-Bz0-K0Af.d.cts → create-jmp-analytics-C1IH32ZF.d.cts} +1 -1
- package/dist/{create-jmp-analytics-DRjrlWUn.d.ts → create-jmp-analytics-CjVYSmPJ.d.ts} +1 -1
- package/dist/index.cjs +196 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -13
- package/dist/index.d.ts +11 -13
- package/dist/index.js +10 -2
- package/dist/next/content.cjs +195 -8
- package/dist/next/content.cjs.map +1 -1
- package/dist/next/content.d.cts +6 -4
- package/dist/next/content.d.ts +6 -4
- package/dist/next/content.js +11 -3
- package/dist/next/content.js.map +1 -1
- package/dist/next/instrumentation.cjs +149 -6
- package/dist/next/instrumentation.cjs.map +1 -1
- package/dist/next/instrumentation.js +2 -2
- package/dist/next/landing-pages.cjs +156 -7
- package/dist/next/landing-pages.cjs.map +1 -1
- package/dist/next/landing-pages.d.cts +2 -2
- package/dist/next/landing-pages.d.ts +2 -2
- package/dist/next/landing-pages.js +3 -3
- package/dist/next/locations.cjs +156 -7
- package/dist/next/locations.cjs.map +1 -1
- package/dist/next/locations.d.cts +2 -2
- package/dist/next/locations.d.ts +2 -2
- package/dist/next/locations.js +3 -3
- package/dist/next/middleware.cjs +5 -2
- package/dist/next/middleware.cjs.map +1 -1
- package/dist/next/middleware.d.cts +2 -2
- package/dist/next/middleware.d.ts +2 -2
- package/dist/next/middleware.js +2 -2
- package/dist/next/site-root-server.cjs +156 -7
- package/dist/next/site-root-server.cjs.map +1 -1
- package/dist/next/site-root-server.js +4 -4
- package/dist/next.cjs +144 -4
- package/dist/next.cjs.map +1 -1
- package/dist/next.d.cts +3 -3
- package/dist/next.d.ts +3 -3
- package/dist/next.js +4 -4
- package/dist/react.cjs +144 -4
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.js +3 -3
- package/dist/{site-config-BxEmJxBB.d.ts → site-config-BEaYpZ3X.d.ts} +9 -3
- package/dist/{site-config-Cgq67uQ1.d.cts → site-config-BN6Z2zIf.d.cts} +9 -3
- package/dist/{track-page-view-74Su6lQY.d.ts → track-page-view-B3OwUOYl.d.ts} +1 -1
- package/dist/{track-page-view-BCX1Dsfk.d.cts → track-page-view-BeVjC-pV.d.cts} +1 -1
- package/dist/{types-yNgoakwk.d.ts → types-uwXEaMD6.d.cts} +45 -2
- package/dist/{types-yNgoakwk.d.cts → types-uwXEaMD6.d.ts} +45 -2
- package/dist/{utils-BLoWWfSw.d.ts → utils-6a6lNKsg.d.ts} +1 -1
- package/dist/{utils-UPTIdK1D.d.cts → utils-Cbb3CO3i.d.cts} +1 -1
- package/docs/legal-and-privacy.md +2 -2
- package/package.json +1 -1
- package/dist/chunk-EMZXL6VF.js.map +0 -1
- package/dist/chunk-RT2YYDCK.js.map +0 -1
- package/dist/chunk-UHXWHKHJ.js.map +0 -1
- /package/dist/{chunk-D43AEUXU.js.map → chunk-BXPMVR7M.js.map} +0 -0
- /package/dist/{chunk-TN6PGIB5.js.map → chunk-JJ3JP3RV.js.map} +0 -0
- /package/dist/{chunk-VQF6QYLR.js.map → chunk-OCIOQIE4.js.map} +0 -0
- /package/dist/{chunk-PTXPNIMF.js.map → chunk-ONIPLMOY.js.map} +0 -0
package/dist/index.cjs
CHANGED
|
@@ -23,6 +23,8 @@ __export(index_exports, {
|
|
|
23
23
|
BOOKING_LINK_HOSTS: () => BOOKING_LINK_HOSTS,
|
|
24
24
|
DEFAULT_JMP_BROWSER_PAGE_VIEW_DEDUPE_MS: () => DEFAULT_JMP_BROWSER_PAGE_VIEW_DEDUPE_MS,
|
|
25
25
|
JMP_ANALYTICS_SDK_VERSION: () => JMP_ANALYTICS_SDK_VERSION,
|
|
26
|
+
JMP_CONTENT_CACHE_TAG: () => JMP_CONTENT_CACHE_TAG,
|
|
27
|
+
JMP_CONTENT_REVALIDATE_SECONDS: () => JMP_CONTENT_REVALIDATE_SECONDS,
|
|
26
28
|
JMP_TRACKING_CONSENT_STORAGE_KEY: () => JMP_TRACKING_CONSENT_STORAGE_KEY,
|
|
27
29
|
buildLandingCaptureInlineScript: () => buildLandingCaptureInlineScript,
|
|
28
30
|
classifyContactHref: () => classifyContactHref,
|
|
@@ -41,6 +43,8 @@ __export(index_exports, {
|
|
|
41
43
|
getJmpLandingPageDetail: () => getJmpLandingPageDetail,
|
|
42
44
|
getJmpLandingPageSitemap: () => getJmpLandingPageSitemap,
|
|
43
45
|
getJmpLandingPages: () => getJmpLandingPages,
|
|
46
|
+
getJmpLegalDocument: () => getJmpLegalDocument,
|
|
47
|
+
getJmpLegalDocuments: () => getJmpLegalDocuments,
|
|
44
48
|
getJmpLocationDetail: () => getJmpLocationDetail,
|
|
45
49
|
getJmpLocations: () => getJmpLocations,
|
|
46
50
|
getJmpPopularPages: () => getJmpPopularPages,
|
|
@@ -348,12 +352,14 @@ function extractMailtoTarget(href) {
|
|
|
348
352
|
}
|
|
349
353
|
|
|
350
354
|
// package.json
|
|
351
|
-
var version = "0.1.
|
|
355
|
+
var version = "0.1.39";
|
|
352
356
|
|
|
353
357
|
// src/constants.ts
|
|
354
358
|
var JMP_ANALYTICS_SDK_VERSION = version;
|
|
355
359
|
var JMP_TRACKING_CONSENT_STORAGE_KEY = "jmp_analytics_consent_v1";
|
|
356
360
|
var DEFAULT_JMP_BROWSER_PAGE_VIEW_DEDUPE_MS = 2500;
|
|
361
|
+
var JMP_CONTENT_CACHE_TAG = "jmp-content";
|
|
362
|
+
var JMP_CONTENT_REVALIDATE_SECONDS = 3600;
|
|
357
363
|
|
|
358
364
|
// src/consent.ts
|
|
359
365
|
var moduleTrackingConsentGranted = true;
|
|
@@ -917,11 +923,14 @@ function getJmpContentConfig() {
|
|
|
917
923
|
return null;
|
|
918
924
|
}
|
|
919
925
|
const site = getJmpSiteDefinition();
|
|
926
|
+
const contentWrappers = site?.contentWrappers ?? void 0;
|
|
927
|
+
const inferredMode = contentWrappers && contentWrappers.length > 0 ? "manual" : void 0;
|
|
920
928
|
return {
|
|
921
929
|
baseUrl: analyticsUrl,
|
|
922
930
|
trackingKey,
|
|
923
|
-
contentWrappers
|
|
924
|
-
contentManifest: site?.contentManifest ?? void 0
|
|
931
|
+
contentWrappers,
|
|
932
|
+
contentManifest: site?.contentManifest ?? void 0,
|
|
933
|
+
contentWrapperMode: site?.contentWrapperMode ?? inferredMode
|
|
925
934
|
};
|
|
926
935
|
}
|
|
927
936
|
|
|
@@ -1087,7 +1096,8 @@ function normalizeJmpContentManifest(input) {
|
|
|
1087
1096
|
const externalSources = normalizeExternalSources(input.externalSources);
|
|
1088
1097
|
const trust = normalizeTrust(input.trust);
|
|
1089
1098
|
const contact = normalizeContact(input.contact);
|
|
1090
|
-
|
|
1099
|
+
const defaults = normalizeManifestDefaults(input.defaults);
|
|
1100
|
+
if (routes.length === 0 && !externalSources && !trust && !contact && !defaults) {
|
|
1091
1101
|
return null;
|
|
1092
1102
|
}
|
|
1093
1103
|
return {
|
|
@@ -1095,7 +1105,8 @@ function normalizeJmpContentManifest(input) {
|
|
|
1095
1105
|
...routes.length > 0 ? { routes } : {},
|
|
1096
1106
|
...externalSources ? { externalSources } : {},
|
|
1097
1107
|
...trust ? { trust } : {},
|
|
1098
|
-
...contact ? { contact } : {}
|
|
1108
|
+
...contact ? { contact } : {},
|
|
1109
|
+
...defaults ? { defaults } : {}
|
|
1099
1110
|
};
|
|
1100
1111
|
}
|
|
1101
1112
|
function normalizeRoutes(routes) {
|
|
@@ -1159,6 +1170,85 @@ function normalizeTrustLabels(labels) {
|
|
|
1159
1170
|
}
|
|
1160
1171
|
return Object.keys(out).length > 0 ? out : null;
|
|
1161
1172
|
}
|
|
1173
|
+
function readDefaultText(value, max = 500) {
|
|
1174
|
+
if (typeof value !== "string") return void 0;
|
|
1175
|
+
const trimmed = value.trim();
|
|
1176
|
+
if (!trimmed) return void 0;
|
|
1177
|
+
return trimmed.slice(0, max);
|
|
1178
|
+
}
|
|
1179
|
+
function normalizeManifestDefaults(defaults) {
|
|
1180
|
+
if (!defaults || typeof defaults !== "object") return null;
|
|
1181
|
+
const contactRaw = defaults.contact;
|
|
1182
|
+
const contact = {};
|
|
1183
|
+
if (contactRaw && typeof contactRaw === "object") {
|
|
1184
|
+
const displayName = readDefaultText(contactRaw.displayName, 120);
|
|
1185
|
+
const email = readDefaultText(contactRaw.email, 200);
|
|
1186
|
+
const phone = readDefaultText(contactRaw.phone, 40);
|
|
1187
|
+
const address = readDefaultText(contactRaw.address, 400);
|
|
1188
|
+
const hours = readDefaultText(contactRaw.hours, 400);
|
|
1189
|
+
const serviceArea = readDefaultText(contactRaw.serviceArea, 200);
|
|
1190
|
+
const googleMapsUrl = readDefaultText(contactRaw.googleMapsUrl, 2048);
|
|
1191
|
+
const linkedinUrl = readDefaultText(contactRaw.linkedinUrl, 2048);
|
|
1192
|
+
const instagramUrl = readDefaultText(contactRaw.instagramUrl, 2048);
|
|
1193
|
+
const facebookUrl = readDefaultText(contactRaw.facebookUrl, 2048);
|
|
1194
|
+
const xUrl = readDefaultText(contactRaw.xUrl, 2048);
|
|
1195
|
+
const youtubeUrl = readDefaultText(contactRaw.youtubeUrl, 2048);
|
|
1196
|
+
if (displayName) contact.displayName = displayName;
|
|
1197
|
+
if (email) contact.email = email;
|
|
1198
|
+
if (phone) contact.phone = phone;
|
|
1199
|
+
if (address) contact.address = address;
|
|
1200
|
+
if (hours) contact.hours = hours;
|
|
1201
|
+
if (serviceArea) contact.serviceArea = serviceArea;
|
|
1202
|
+
if (googleMapsUrl) contact.googleMapsUrl = googleMapsUrl;
|
|
1203
|
+
if (linkedinUrl) contact.linkedinUrl = linkedinUrl;
|
|
1204
|
+
if (instagramUrl) contact.instagramUrl = instagramUrl;
|
|
1205
|
+
if (facebookUrl) contact.facebookUrl = facebookUrl;
|
|
1206
|
+
if (xUrl) contact.xUrl = xUrl;
|
|
1207
|
+
if (youtubeUrl) contact.youtubeUrl = youtubeUrl;
|
|
1208
|
+
if (contactRaw.extras && typeof contactRaw.extras === "object") {
|
|
1209
|
+
const extras = {};
|
|
1210
|
+
for (const [rawKey, rawValue] of Object.entries(contactRaw.extras)) {
|
|
1211
|
+
if (Object.keys(extras).length >= 10) break;
|
|
1212
|
+
const key = normalizeKey(rawKey);
|
|
1213
|
+
const value = readDefaultText(rawValue, 200);
|
|
1214
|
+
if (key && isValidExtraKey(key) && value) extras[key] = value;
|
|
1215
|
+
}
|
|
1216
|
+
if (Object.keys(extras).length > 0) contact.extras = extras;
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
1219
|
+
const faq = [];
|
|
1220
|
+
if (Array.isArray(defaults.faq)) {
|
|
1221
|
+
for (const raw of defaults.faq) {
|
|
1222
|
+
if (!raw || typeof raw !== "object" || faq.length >= 40) continue;
|
|
1223
|
+
const question = readDefaultText(raw.question, 300);
|
|
1224
|
+
const answer = readDefaultText(raw.answer, 8e3);
|
|
1225
|
+
if (!question || !answer) continue;
|
|
1226
|
+
const category = readDefaultText(raw.category, 80);
|
|
1227
|
+
faq.push({ question, answer, ...category ? { category } : {} });
|
|
1228
|
+
}
|
|
1229
|
+
}
|
|
1230
|
+
const trustRaw = defaults.trust;
|
|
1231
|
+
const trust = {};
|
|
1232
|
+
if (trustRaw && typeof trustRaw === "object") {
|
|
1233
|
+
const assign = (key, max) => {
|
|
1234
|
+
const value = readDefaultText(trustRaw[key], max);
|
|
1235
|
+
if (value) trust[key] = value;
|
|
1236
|
+
};
|
|
1237
|
+
assign("googleReviewsUrl", 2048);
|
|
1238
|
+
assign("googlePlaceId", 128);
|
|
1239
|
+
assign("yelpUrl", 2048);
|
|
1240
|
+
assign("trustpilotUrl", 2048);
|
|
1241
|
+
assign("disclaimer", 1e3);
|
|
1242
|
+
}
|
|
1243
|
+
const hasContact = Object.keys(contact).length > 0;
|
|
1244
|
+
const hasTrust = Object.keys(trust).length > 0;
|
|
1245
|
+
if (!hasContact && faq.length === 0 && !hasTrust) return null;
|
|
1246
|
+
return {
|
|
1247
|
+
...hasContact ? { contact } : {},
|
|
1248
|
+
...faq.length > 0 ? { faq } : {},
|
|
1249
|
+
...hasTrust ? { trust } : {}
|
|
1250
|
+
};
|
|
1251
|
+
}
|
|
1162
1252
|
function normalizeContact(contact) {
|
|
1163
1253
|
if (!contact || typeof contact !== "object") return null;
|
|
1164
1254
|
const extras = normalizeContactExtras(contact.extras);
|
|
@@ -1226,7 +1316,11 @@ async function getContentText(config, path) {
|
|
|
1226
1316
|
}
|
|
1227
1317
|
const res = await resolvedFetch(url, {
|
|
1228
1318
|
method: "GET",
|
|
1229
|
-
headers: jmpContentRequestHeaders(config)
|
|
1319
|
+
headers: jmpContentRequestHeaders(config),
|
|
1320
|
+
next: {
|
|
1321
|
+
revalidate: JMP_CONTENT_REVALIDATE_SECONDS,
|
|
1322
|
+
tags: [JMP_CONTENT_CACHE_TAG]
|
|
1323
|
+
}
|
|
1230
1324
|
});
|
|
1231
1325
|
const text = await res.text();
|
|
1232
1326
|
if (!res.ok) {
|
|
@@ -1253,6 +1347,7 @@ var WRAPPER_SLOT_ORDER = [
|
|
|
1253
1347
|
"blog",
|
|
1254
1348
|
"faq",
|
|
1255
1349
|
"contact",
|
|
1350
|
+
"legal",
|
|
1256
1351
|
"trust",
|
|
1257
1352
|
"trust.summary",
|
|
1258
1353
|
"trust.testimonials",
|
|
@@ -1279,7 +1374,7 @@ function markTrustBundleWrappers(bundle) {
|
|
|
1279
1374
|
}
|
|
1280
1375
|
}
|
|
1281
1376
|
function inferTrustWrapperSlots(bundle) {
|
|
1282
|
-
const slots = /* @__PURE__ */ new Set(
|
|
1377
|
+
const slots = /* @__PURE__ */ new Set();
|
|
1283
1378
|
const { summary, testimonials, stats, logos, credentials } = bundle;
|
|
1284
1379
|
const hasSummary = summary.google_rating != null || summary.google_review_count != null || Boolean(summary.google_reviews_url?.trim()) || Boolean(summary.yelp_url?.trim()) || Boolean(summary.trustpilot_url?.trim()) || Boolean(summary.disclaimer?.trim());
|
|
1285
1380
|
if (hasSummary) {
|
|
@@ -1316,7 +1411,65 @@ function getDiscoveredContentWrappers() {
|
|
|
1316
1411
|
return sortWrapperSlots([...discovered]);
|
|
1317
1412
|
}
|
|
1318
1413
|
function resolveContentManifestForReport(config) {
|
|
1319
|
-
|
|
1414
|
+
const site = getJmpSiteDefinition();
|
|
1415
|
+
const fallback = site?.contactFallback;
|
|
1416
|
+
const existing = config.contentManifest;
|
|
1417
|
+
const fromFallback = fallbackToManifestDefaults(fallback);
|
|
1418
|
+
if (!existing && !fromFallback) {
|
|
1419
|
+
return null;
|
|
1420
|
+
}
|
|
1421
|
+
const merged = {
|
|
1422
|
+
...existing ?? {},
|
|
1423
|
+
defaults: {
|
|
1424
|
+
...fromFallback ?? {},
|
|
1425
|
+
...existing?.defaults ?? {},
|
|
1426
|
+
contact: {
|
|
1427
|
+
...fromFallback?.contact ?? {},
|
|
1428
|
+
...existing?.defaults?.contact ?? {},
|
|
1429
|
+
extras: {
|
|
1430
|
+
...fromFallback?.contact?.extras ?? {},
|
|
1431
|
+
...existing?.defaults?.contact?.extras ?? {}
|
|
1432
|
+
}
|
|
1433
|
+
},
|
|
1434
|
+
trust: {
|
|
1435
|
+
...fromFallback?.trust ?? {},
|
|
1436
|
+
...existing?.defaults?.trust ?? {}
|
|
1437
|
+
},
|
|
1438
|
+
faq: existing?.defaults?.faq?.length ? existing.defaults.faq : fromFallback?.faq
|
|
1439
|
+
}
|
|
1440
|
+
};
|
|
1441
|
+
return normalizeJmpContentManifest(merged);
|
|
1442
|
+
}
|
|
1443
|
+
function fallbackToManifestDefaults(fallback) {
|
|
1444
|
+
if (!fallback) return null;
|
|
1445
|
+
const contact = {};
|
|
1446
|
+
if (fallback.displayName?.trim()) contact.displayName = fallback.displayName.trim();
|
|
1447
|
+
if (fallback.email?.trim()) contact.email = fallback.email.trim();
|
|
1448
|
+
if (typeof fallback.phone === "string" && fallback.phone.trim()) {
|
|
1449
|
+
contact.phone = fallback.phone.trim();
|
|
1450
|
+
}
|
|
1451
|
+
if (fallback.address?.trim()) contact.address = fallback.address.trim();
|
|
1452
|
+
if (fallback.hours?.trim()) contact.hours = fallback.hours.trim();
|
|
1453
|
+
if (fallback.serviceArea?.trim()) contact.serviceArea = fallback.serviceArea.trim();
|
|
1454
|
+
if (fallback.googleMapsUrl?.trim()) {
|
|
1455
|
+
contact.googleMapsUrl = fallback.googleMapsUrl.trim();
|
|
1456
|
+
}
|
|
1457
|
+
if (fallback.linkedin?.trim()) contact.linkedinUrl = fallback.linkedin.trim();
|
|
1458
|
+
if (fallback.instagram?.trim()) contact.instagramUrl = fallback.instagram.trim();
|
|
1459
|
+
if (fallback.facebook?.trim()) contact.facebookUrl = fallback.facebook.trim();
|
|
1460
|
+
if (fallback.x?.trim()) contact.xUrl = fallback.x.trim();
|
|
1461
|
+
if (fallback.youtube?.trim()) contact.youtubeUrl = fallback.youtube.trim();
|
|
1462
|
+
const trust = {};
|
|
1463
|
+
if (fallback.googleMapsUrl?.trim()) {
|
|
1464
|
+
trust.googleReviewsUrl = fallback.googleMapsUrl.trim();
|
|
1465
|
+
}
|
|
1466
|
+
const hasContact = Object.keys(contact).length > 0;
|
|
1467
|
+
const hasTrust = Object.keys(trust).length > 0;
|
|
1468
|
+
if (!hasContact && !hasTrust) return null;
|
|
1469
|
+
return {
|
|
1470
|
+
...hasContact ? { contact } : {},
|
|
1471
|
+
...hasTrust ? { trust } : {}
|
|
1472
|
+
};
|
|
1320
1473
|
}
|
|
1321
1474
|
function resolveContentWrappersForReport(config) {
|
|
1322
1475
|
const explicit = config.contentWrappers ?? [];
|
|
@@ -1457,6 +1610,35 @@ async function getJmpFaqs(config, filters) {
|
|
|
1457
1610
|
afterContentWrapperUse(config);
|
|
1458
1611
|
return data.faqs;
|
|
1459
1612
|
}
|
|
1613
|
+
async function getJmpLegalDocument(config, slug) {
|
|
1614
|
+
const key = slug.trim().toLowerCase();
|
|
1615
|
+
if (!key) {
|
|
1616
|
+
return null;
|
|
1617
|
+
}
|
|
1618
|
+
try {
|
|
1619
|
+
const data = await getContent(
|
|
1620
|
+
config,
|
|
1621
|
+
`/api/content/legal?slug=${encodeURIComponent(key)}`
|
|
1622
|
+
);
|
|
1623
|
+
markContentWrapper("legal");
|
|
1624
|
+
afterContentWrapperUse(config);
|
|
1625
|
+
return data.document;
|
|
1626
|
+
} catch (error) {
|
|
1627
|
+
if (error instanceof Error && error.message.includes("HTTP 404")) {
|
|
1628
|
+
return null;
|
|
1629
|
+
}
|
|
1630
|
+
throw error;
|
|
1631
|
+
}
|
|
1632
|
+
}
|
|
1633
|
+
async function getJmpLegalDocuments(config) {
|
|
1634
|
+
const data = await getContent(
|
|
1635
|
+
config,
|
|
1636
|
+
"/api/content/legal"
|
|
1637
|
+
);
|
|
1638
|
+
markContentWrapper("legal");
|
|
1639
|
+
afterContentWrapperUse(config);
|
|
1640
|
+
return data.documents;
|
|
1641
|
+
}
|
|
1460
1642
|
async function getJmpFaqDetail(config, slug, locale) {
|
|
1461
1643
|
try {
|
|
1462
1644
|
const params = new URLSearchParams();
|
|
@@ -1652,6 +1834,8 @@ function createJmpContentClient(config) {
|
|
|
1652
1834
|
getBlogPosts: (filters) => getJmpBlogPosts(config, filters),
|
|
1653
1835
|
getBlogPost: (slug, locale) => getJmpBlogPost(config, slug, locale),
|
|
1654
1836
|
getFaqs: (filters) => getJmpFaqs(config, filters),
|
|
1837
|
+
getLegalDocument: (slug) => getJmpLegalDocument(config, slug),
|
|
1838
|
+
getLegalDocuments: () => getJmpLegalDocuments(config),
|
|
1655
1839
|
getLandingPages: (filters) => getJmpLandingPages(config, filters),
|
|
1656
1840
|
getLandingPageDetail: (kind, slug, locale) => getJmpLandingPageDetail(config, kind, slug, locale),
|
|
1657
1841
|
getLandingPageSitemap: () => getJmpLandingPageSitemap(config),
|
|
@@ -1712,6 +1896,8 @@ function createJmpContentClientFromServerEnv(overrides) {
|
|
|
1712
1896
|
BOOKING_LINK_HOSTS,
|
|
1713
1897
|
DEFAULT_JMP_BROWSER_PAGE_VIEW_DEDUPE_MS,
|
|
1714
1898
|
JMP_ANALYTICS_SDK_VERSION,
|
|
1899
|
+
JMP_CONTENT_CACHE_TAG,
|
|
1900
|
+
JMP_CONTENT_REVALIDATE_SECONDS,
|
|
1715
1901
|
JMP_TRACKING_CONSENT_STORAGE_KEY,
|
|
1716
1902
|
buildLandingCaptureInlineScript,
|
|
1717
1903
|
classifyContactHref,
|
|
@@ -1730,6 +1916,8 @@ function createJmpContentClientFromServerEnv(overrides) {
|
|
|
1730
1916
|
getJmpLandingPageDetail,
|
|
1731
1917
|
getJmpLandingPageSitemap,
|
|
1732
1918
|
getJmpLandingPages,
|
|
1919
|
+
getJmpLegalDocument,
|
|
1920
|
+
getJmpLegalDocuments,
|
|
1733
1921
|
getJmpLocationDetail,
|
|
1734
1922
|
getJmpLocations,
|
|
1735
1923
|
getJmpPopularPages,
|