@aranova/tracking-react 1.11.0 → 1.12.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/dist/{bookings-BnXZGgwr.d.mts → bookings-Lmi0o_PA.d.mts} +34 -0
- package/dist/{bookings-vM_aCNOS.d.ts → bookings-v_ucn93l.d.ts} +34 -0
- package/dist/client.d.mts +2 -2
- package/dist/client.d.ts +2 -2
- package/dist/client.js +53 -4
- package/dist/client.js.map +1 -1
- package/dist/client.mjs +53 -4
- 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 +52 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +52 -3
- package/dist/index.mjs.map +1 -1
- package/dist/{ingest-typed-BS9agXM5.d.ts → ingest-typed-B9I1c7jr.d.ts} +1 -1
- package/dist/{ingest-typed-TI6KqVzL.d.mts → ingest-typed-PKFEuJ8E.d.mts} +1 -1
- package/dist/{sales-CSV0H3iG.d.mts → sales-6vMEcopj.d.mts} +1 -1
- package/dist/{sales-BegN5t_z.d.ts → sales-DXLGjJQ6.d.ts} +1 -1
- package/dist/sales.d.mts +2 -2
- package/dist/sales.d.ts +2 -2
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -820,9 +820,58 @@ function parseConversionConfig(raw) {
|
|
|
820
820
|
};
|
|
821
821
|
}
|
|
822
822
|
function parseLeadForms(value) {
|
|
823
|
-
if (!value || typeof value !== "
|
|
824
|
-
|
|
825
|
-
|
|
823
|
+
if (!isRecord(value) || typeof value.registry_version !== "number") return null;
|
|
824
|
+
return {
|
|
825
|
+
registry_version: value.registry_version,
|
|
826
|
+
contracts: records(value.contracts).flatMap(
|
|
827
|
+
(c) => typeof c.form_kind === "string" && typeof c.contract_hash === "string" ? [
|
|
828
|
+
{
|
|
829
|
+
form_kind: c.form_kind,
|
|
830
|
+
requires: records(c.requires).flatMap(
|
|
831
|
+
(r) => typeof r.role === "string" ? [
|
|
832
|
+
{
|
|
833
|
+
role: r.role,
|
|
834
|
+
required_when: parseCondition(r.required_when),
|
|
835
|
+
waived: r.waived === true
|
|
836
|
+
}
|
|
837
|
+
] : []
|
|
838
|
+
),
|
|
839
|
+
requires_any: records(c.requires_any).map((g) => ({
|
|
840
|
+
roles: strings(g.roles),
|
|
841
|
+
waived: g.waived === true
|
|
842
|
+
})),
|
|
843
|
+
options: records(c.options).flatMap(
|
|
844
|
+
(o) => typeof o.role === "string" ? [{ role: o.role, options: records(o.options).flatMap(parseContractOption) }] : []
|
|
845
|
+
),
|
|
846
|
+
contract_hash: c.contract_hash
|
|
847
|
+
}
|
|
848
|
+
] : []
|
|
849
|
+
)
|
|
850
|
+
};
|
|
851
|
+
}
|
|
852
|
+
function parseCondition(value) {
|
|
853
|
+
if (!isRecord(value) || typeof value.role !== "string") return null;
|
|
854
|
+
return { role: value.role, any_of: strings(value.any_of) };
|
|
855
|
+
}
|
|
856
|
+
function parseContractOption(value) {
|
|
857
|
+
if (typeof value.key !== "string" || typeof value.label !== "string") return [];
|
|
858
|
+
return [
|
|
859
|
+
{
|
|
860
|
+
key: value.key,
|
|
861
|
+
label: value.label,
|
|
862
|
+
is_non_answer: value.is_non_answer === true,
|
|
863
|
+
deprecated: value.deprecated === true
|
|
864
|
+
}
|
|
865
|
+
];
|
|
866
|
+
}
|
|
867
|
+
function isRecord(value) {
|
|
868
|
+
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
869
|
+
}
|
|
870
|
+
function records(value) {
|
|
871
|
+
return Array.isArray(value) ? value.filter(isRecord) : [];
|
|
872
|
+
}
|
|
873
|
+
function strings(value) {
|
|
874
|
+
return Array.isArray(value) ? value.filter((v) => typeof v === "string") : [];
|
|
826
875
|
}
|
|
827
876
|
var CACHE_PREFIX = "_aranova_cfg_";
|
|
828
877
|
function cacheKey(url) {
|