@aranova/tracking-react 1.4.0 → 1.5.0
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 +3 -0
- package/dist/{bookings-CqCuuyP6.d.mts → bookings-CGWiBxnC.d.mts} +4 -0
- package/dist/{bookings-DIu1ho6v.d.ts → bookings-aJuXoVwX.d.ts} +4 -0
- package/dist/client.d.mts +2 -2
- package/dist/client.d.ts +2 -2
- package/dist/client.js +15 -3
- package/dist/client.js.map +1 -1
- package/dist/client.mjs +15 -3
- package/dist/client.mjs.map +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +26 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +25 -2
- package/dist/index.mjs.map +1 -1
- package/dist/{ingest-typed-D7UZr0EM.d.mts → ingest-typed-CytXGVw4.d.mts} +16 -2
- package/dist/{ingest-typed-D2S3Kb8m.d.ts → ingest-typed-DpT-uFme.d.ts} +16 -2
- package/dist/{sales-CxJVthx_.d.mts → sales-BdU9BRdG.d.mts} +1 -1
- package/dist/{sales-hlcVTJSS.d.ts → sales-Dvh-tPsk.d.ts} +1 -1
- package/dist/sales.d.mts +2 -2
- package/dist/sales.d.ts +2 -2
- package/dist/sales.js +7 -1
- package/dist/sales.js.map +1 -1
- package/dist/sales.mjs +7 -1
- package/dist/sales.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -722,7 +722,14 @@ function parseBookingOption(value) {
|
|
|
722
722
|
if (!value || typeof value !== "object") return [];
|
|
723
723
|
const o = value;
|
|
724
724
|
if (typeof o.key !== "string" || !o.key || typeof o.label !== "string") return [];
|
|
725
|
-
return [
|
|
725
|
+
return [
|
|
726
|
+
{
|
|
727
|
+
key: o.key,
|
|
728
|
+
label: o.label,
|
|
729
|
+
group: typeof o.group === "string" && o.group ? o.group : null,
|
|
730
|
+
description: typeof o.description === "string" && o.description ? o.description : null
|
|
731
|
+
}
|
|
732
|
+
];
|
|
726
733
|
}
|
|
727
734
|
function parseIntegrations(value) {
|
|
728
735
|
if (!value || typeof value !== "object") return {};
|
|
@@ -1449,7 +1456,12 @@ function getBookingIntegration(integrations) {
|
|
|
1449
1456
|
timezone: booking.timezone,
|
|
1450
1457
|
configVersion: booking.config_version,
|
|
1451
1458
|
rules,
|
|
1452
|
-
options: booking.options.map((option) => ({
|
|
1459
|
+
options: booking.options.map((option) => ({
|
|
1460
|
+
key: option.key,
|
|
1461
|
+
label: option.label,
|
|
1462
|
+
group: option.group,
|
|
1463
|
+
description: option.description
|
|
1464
|
+
})),
|
|
1453
1465
|
mode: booking.mode ?? "live"
|
|
1454
1466
|
};
|
|
1455
1467
|
}
|
|
@@ -1529,6 +1541,15 @@ function nationalDigits(phone) {
|
|
|
1529
1541
|
const parsed = parsePhone(phone);
|
|
1530
1542
|
return (parsed.isValid ? parsed.national : phone).replace(/\D/g, "");
|
|
1531
1543
|
}
|
|
1544
|
+
function groupBookingOptions(options) {
|
|
1545
|
+
const groups = /* @__PURE__ */ new Map();
|
|
1546
|
+
for (const option of options) {
|
|
1547
|
+
const members = groups.get(option.group);
|
|
1548
|
+
if (members) members.push(option);
|
|
1549
|
+
else groups.set(option.group, [option]);
|
|
1550
|
+
}
|
|
1551
|
+
return [...groups].map(([group, members]) => ({ group, options: members }));
|
|
1552
|
+
}
|
|
1532
1553
|
|
|
1533
1554
|
// ../tracking-core/src/events/semantics.ts
|
|
1534
1555
|
var EVENT_SEMANTICS = {
|
|
@@ -2113,6 +2134,7 @@ var zErrorCode = z2.enum([
|
|
|
2113
2134
|
"booking_not_found",
|
|
2114
2135
|
"booking_not_cancellable",
|
|
2115
2136
|
"booking_not_reschedulable",
|
|
2137
|
+
"booking_not_synced",
|
|
2116
2138
|
"manage_token_invalid",
|
|
2117
2139
|
"google_error",
|
|
2118
2140
|
"booking_unavailable",
|
|
@@ -2444,6 +2466,7 @@ export {
|
|
|
2444
2466
|
getConsentState,
|
|
2445
2467
|
getEventSemantics,
|
|
2446
2468
|
getTrackingConfigRuntime,
|
|
2469
|
+
groupBookingOptions,
|
|
2447
2470
|
newBookingAttemptKey,
|
|
2448
2471
|
onConsentChange,
|
|
2449
2472
|
optIn,
|