@simplybusiness/services 0.21.4 → 0.21.7
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 +21 -0
- package/dist/cjs/index.js +1198 -17
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/index.js +1193 -4
- package/package.json +7 -6
- package/src/snowplow/event-definitions/qcp.ts +2 -1
- package/dist/cjs/address-lookup/index.js +0 -98
- package/dist/cjs/address-lookup/index.js.map +0 -1
- package/dist/cjs/address-lookup/types.js +0 -7
- package/dist/cjs/address-lookup/types.js.map +0 -1
- package/dist/cjs/airbrake/index.js +0 -45
- package/dist/cjs/airbrake/index.js.map +0 -1
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/mocks/eventDefinitions.js +0 -90
- package/dist/cjs/mocks/eventDefinitions.js.map +0 -1
- package/dist/cjs/mocks/scripts-mock.js +0 -59
- package/dist/cjs/mocks/scripts-mock.js.map +0 -1
- package/dist/cjs/mocks/snowplowBrowserTrackerMock.js +0 -7
- package/dist/cjs/mocks/snowplowBrowserTrackerMock.js.map +0 -1
- package/dist/cjs/snowplow/Snowplow.js +0 -174
- package/dist/cjs/snowplow/Snowplow.js.map +0 -1
- package/dist/cjs/snowplow/SnowplowContext.js +0 -61
- package/dist/cjs/snowplow/SnowplowContext.js.map +0 -1
- package/dist/cjs/snowplow/constants.js +0 -13
- package/dist/cjs/snowplow/constants.js.map +0 -1
- package/dist/cjs/snowplow/contexts.js +0 -68
- package/dist/cjs/snowplow/contexts.js.map +0 -1
- package/dist/cjs/snowplow/event-definitions/base.js +0 -56
- package/dist/cjs/snowplow/event-definitions/base.js.map +0 -1
- package/dist/cjs/snowplow/event-definitions/index.js +0 -65
- package/dist/cjs/snowplow/event-definitions/index.js.map +0 -1
- package/dist/cjs/snowplow/event-definitions/intervention.js +0 -33
- package/dist/cjs/snowplow/event-definitions/intervention.js.map +0 -1
- package/dist/cjs/snowplow/event-definitions/personalised_cover.js +0 -122
- package/dist/cjs/snowplow/event-definitions/personalised_cover.js.map +0 -1
- package/dist/cjs/snowplow/event-definitions/qcp.js +0 -348
- package/dist/cjs/snowplow/event-definitions/qcp.js.map +0 -1
- package/dist/cjs/snowplow/event-definitions/questionnaire.js +0 -115
- package/dist/cjs/snowplow/event-definitions/questionnaire.js.map +0 -1
- package/dist/cjs/snowplow/event-definitions/redaction.js +0 -154
- package/dist/cjs/snowplow/event-definitions/redaction.js.map +0 -1
- package/dist/cjs/snowplow/event-definitions/referral.js +0 -37
- package/dist/cjs/snowplow/event-definitions/referral.js.map +0 -1
- package/dist/cjs/snowplow/getSnowplowConfig.js +0 -16
- package/dist/cjs/snowplow/getSnowplowConfig.js.map +0 -1
- package/dist/cjs/snowplow/index.js +0 -25
- package/dist/cjs/snowplow/index.js.map +0 -1
- package/dist/cjs/snowplow/types.js +0 -6
- package/dist/cjs/snowplow/types.js.map +0 -1
- package/dist/cjs/utils/index.js +0 -21
- package/dist/cjs/utils/index.js.map +0 -1
- package/dist/cjs/utils/isObject.js +0 -15
- package/dist/cjs/utils/isObject.js.map +0 -1
- package/dist/cjs/utils/testUtils.js +0 -43
- package/dist/cjs/utils/testUtils.js.map +0 -1
- package/dist/cjs/utils/text.js +0 -45
- package/dist/cjs/utils/text.js.map +0 -1
- package/dist/esm/address-lookup/index.js +0 -88
- package/dist/esm/address-lookup/index.js.map +0 -1
- package/dist/esm/address-lookup/types.js +0 -5
- package/dist/esm/address-lookup/types.js.map +0 -1
- package/dist/esm/airbrake/index.js +0 -35
- package/dist/esm/airbrake/index.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/mocks/eventDefinitions.js +0 -80
- package/dist/esm/mocks/eventDefinitions.js.map +0 -1
- package/dist/esm/mocks/scripts-mock.js +0 -49
- package/dist/esm/mocks/scripts-mock.js.map +0 -1
- package/dist/esm/mocks/snowplowBrowserTrackerMock.js +0 -6
- package/dist/esm/mocks/snowplowBrowserTrackerMock.js.map +0 -1
- package/dist/esm/snowplow/Snowplow.js +0 -169
- package/dist/esm/snowplow/Snowplow.js.map +0 -1
- package/dist/esm/snowplow/SnowplowContext.js +0 -43
- package/dist/esm/snowplow/SnowplowContext.js.map +0 -1
- package/dist/esm/snowplow/constants.js +0 -3
- package/dist/esm/snowplow/constants.js.map +0 -1
- package/dist/esm/snowplow/contexts.js +0 -47
- package/dist/esm/snowplow/contexts.js.map +0 -1
- package/dist/esm/snowplow/event-definitions/base.js +0 -66
- package/dist/esm/snowplow/event-definitions/base.js.map +0 -1
- package/dist/esm/snowplow/event-definitions/index.js +0 -36
- package/dist/esm/snowplow/event-definitions/index.js.map +0 -1
- package/dist/esm/snowplow/event-definitions/intervention.js +0 -23
- package/dist/esm/snowplow/event-definitions/intervention.js.map +0 -1
- package/dist/esm/snowplow/event-definitions/personalised_cover.js +0 -131
- package/dist/esm/snowplow/event-definitions/personalised_cover.js.map +0 -1
- package/dist/esm/snowplow/event-definitions/qcp.js +0 -339
- package/dist/esm/snowplow/event-definitions/qcp.js.map +0 -1
- package/dist/esm/snowplow/event-definitions/questionnaire.js +0 -106
- package/dist/esm/snowplow/event-definitions/questionnaire.js.map +0 -1
- package/dist/esm/snowplow/event-definitions/redaction.js +0 -144
- package/dist/esm/snowplow/event-definitions/redaction.js.map +0 -1
- package/dist/esm/snowplow/event-definitions/referral.js +0 -28
- package/dist/esm/snowplow/event-definitions/referral.js.map +0 -1
- package/dist/esm/snowplow/getSnowplowConfig.js +0 -7
- package/dist/esm/snowplow/getSnowplowConfig.js.map +0 -1
- package/dist/esm/snowplow/index.js +0 -8
- package/dist/esm/snowplow/index.js.map +0 -1
- package/dist/esm/snowplow/types.js +0 -3
- package/dist/esm/snowplow/types.js.map +0 -1
- package/dist/esm/utils/index.js +0 -4
- package/dist/esm/utils/index.js.map +0 -1
- package/dist/esm/utils/isObject.js +0 -5
- package/dist/esm/utils/isObject.js.map +0 -1
- package/dist/esm/utils/testUtils.js +0 -26
- package/dist/esm/utils/testUtils.js.map +0 -1
- package/dist/esm/utils/text.js +0 -25
- package/dist/esm/utils/text.js.map +0 -1
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */ "use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
function _export(target, all) {
|
|
6
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
SnowplowProvider: function() {
|
|
13
|
-
return SnowplowProvider;
|
|
14
|
-
},
|
|
15
|
-
useSnowplowContext: function() {
|
|
16
|
-
return useSnowplowContext;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
20
|
-
const _react = require("react");
|
|
21
|
-
const _contexts = require("./contexts");
|
|
22
|
-
const _eventdefinitions = require("./event-definitions");
|
|
23
|
-
const _Snowplow = require("./Snowplow");
|
|
24
|
-
const SnowplowContext = /*#__PURE__*/ (0, _react.createContext)(null);
|
|
25
|
-
const SnowplowProvider = ({ scripts, children })=>{
|
|
26
|
-
const [config, _setConfig] = (0, _react.useState)(scripts);
|
|
27
|
-
const snowplow = (0, _react.useRef)(_Snowplow.Snowplow.getInstance(config));
|
|
28
|
-
// Attach event handlers and set contexts
|
|
29
|
-
(0, _react.useEffect)(()=>{
|
|
30
|
-
if (snowplow.current && scripts) {
|
|
31
|
-
const contexts = (0, _contexts.getContexts)(config);
|
|
32
|
-
snowplow.current.setContexts(contexts).addEventHandlers(_eventdefinitions.eventDefinitions);
|
|
33
|
-
// Send page view event
|
|
34
|
-
if (config.trackPageView) snowplow.current.trackView();
|
|
35
|
-
}
|
|
36
|
-
}, [
|
|
37
|
-
config,
|
|
38
|
-
snowplow,
|
|
39
|
-
scripts
|
|
40
|
-
]);
|
|
41
|
-
const value = (0, _react.useMemo)(()=>({
|
|
42
|
-
config,
|
|
43
|
-
snowplow: snowplow.current
|
|
44
|
-
}), [
|
|
45
|
-
config,
|
|
46
|
-
snowplow
|
|
47
|
-
]);
|
|
48
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(SnowplowContext.Provider, {
|
|
49
|
-
value: value,
|
|
50
|
-
children: children
|
|
51
|
-
});
|
|
52
|
-
};
|
|
53
|
-
function useSnowplowContext() {
|
|
54
|
-
const context = (0, _react.useContext)(SnowplowContext);
|
|
55
|
-
if (!context) {
|
|
56
|
-
throw new Error("useSnowplowContext must be used inside a `SnowplowProvider`");
|
|
57
|
-
}
|
|
58
|
-
return context;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
//# sourceMappingURL=SnowplowContext.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/snowplow/SnowplowContext.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\nimport {\n createContext,\n useContext,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ReactNode,\n} from \"react\";\nimport { getContexts } from \"./contexts\";\nimport { eventDefinitions } from \"./event-definitions\";\nimport { Snowplow } from \"./Snowplow\";\nimport { EventDefinition, TrackingProps } from \"./types\";\n\nexport interface SnowplowContextInterface {\n config: TrackingProps;\n snowplow?: Snowplow;\n}\n\nconst SnowplowContext = createContext<SnowplowContextInterface | null>(null);\n\ntype ProviderProps = {\n scripts: TrackingProps;\n children: ReactNode;\n};\n\nexport const SnowplowProvider = ({ scripts, children }: ProviderProps) => {\n const [config, _setConfig] = useState<TrackingProps>(scripts);\n const snowplow = useRef<Snowplow>(Snowplow.getInstance(config));\n\n // Attach event handlers and set contexts\n useEffect(() => {\n if (snowplow.current && scripts) {\n const contexts = getContexts(config);\n\n snowplow.current\n .setContexts(contexts)\n .addEventHandlers(eventDefinitions as EventDefinition[]);\n // Send page view event\n if (config.trackPageView) snowplow.current.trackView();\n }\n }, [config, snowplow, scripts]);\n\n const value: SnowplowContextInterface = useMemo(\n () => ({\n config,\n snowplow: snowplow.current,\n }),\n [config, snowplow],\n );\n\n return (\n <SnowplowContext.Provider value={value}>\n {children}\n </SnowplowContext.Provider>\n );\n};\n\nexport function useSnowplowContext() {\n const context = useContext(SnowplowContext);\n\n if (!context) {\n throw new Error(\n \"useSnowplowContext must be used inside a `SnowplowProvider`\",\n );\n }\n return context;\n}\n"],"names":["SnowplowProvider","useSnowplowContext","SnowplowContext","createContext","scripts","children","config","_setConfig","useState","snowplow","useRef","Snowplow","getInstance","useEffect","current","contexts","getContexts","setContexts","addEventHandlers","eventDefinitions","trackPageView","trackView","value","useMemo","Provider","context","useContext","Error"],"mappings":"AAAA,oDAAoD;;;;;;;;;;;IA2BvCA,gBAAgB;eAAhBA;;IAgCGC,kBAAkB;eAAlBA;;;;uBAlDT;0BACqB;kCACK;0BACR;AAQzB,MAAMC,gCAAkBC,IAAAA,oBAAa,EAAkC;AAOhE,MAAMH,mBAAmB,CAAC,EAAEI,OAAO,EAAEC,QAAQ,EAAiB;IACnE,MAAM,CAACC,QAAQC,WAAW,GAAGC,IAAAA,eAAQ,EAAgBJ;IACrD,MAAMK,WAAWC,IAAAA,aAAM,EAAWC,kBAAQ,CAACC,WAAW,CAACN;IAEvD,yCAAyC;IACzCO,IAAAA,gBAAS,EAAC;QACR,IAAIJ,SAASK,OAAO,IAAIV,SAAS;YAC/B,MAAMW,WAAWC,IAAAA,qBAAW,EAACV;YAE7BG,SAASK,OAAO,CACbG,WAAW,CAACF,UACZG,gBAAgB,CAACC,kCAAgB;YACpC,uBAAuB;YACvB,IAAIb,OAAOc,aAAa,EAAEX,SAASK,OAAO,CAACO,SAAS;QACtD;IACF,GAAG;QAACf;QAAQG;QAAUL;KAAQ;IAE9B,MAAMkB,QAAkCC,IAAAA,cAAO,EAC7C,IAAO,CAAA;YACLjB;YACAG,UAAUA,SAASK,OAAO;QAC5B,CAAA,GACA;QAACR;QAAQG;KAAS;IAGpB,qBACE,qBAACP,gBAAgBsB,QAAQ;QAACF,OAAOA;kBAC9BjB;;AAGP;AAEO,SAASJ;IACd,MAAMwB,UAAUC,IAAAA,iBAAU,EAACxB;IAE3B,IAAI,CAACuB,SAAS;QACZ,MAAM,IAAIE,MACR;IAEJ;IACA,OAAOF;AACT"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "DELIMITER", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return DELIMITER;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const DELIMITER = "|"; // Used to flatten arrays
|
|
12
|
-
|
|
13
|
-
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/snowplow/constants.ts"],"sourcesContent":["export const DELIMITER = \"|\"; // Used to flatten arrays\n"],"names":["DELIMITER"],"mappings":";;;;+BAAaA;;;eAAAA;;;AAAN,MAAMA,YAAY,KAAK,yBAAyB"}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
function _export(target, all) {
|
|
6
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
getContexts: function() {
|
|
13
|
-
return getContexts;
|
|
14
|
-
},
|
|
15
|
-
makeContexts: function() {
|
|
16
|
-
return makeContexts;
|
|
17
|
-
},
|
|
18
|
-
updateIdentityContext: function() {
|
|
19
|
-
return updateIdentityContext;
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
const _utils = require("../utils");
|
|
23
|
-
const getContexts = (config)=>{
|
|
24
|
-
// Create an object that only contains Context keys
|
|
25
|
-
// and snake_case the keys
|
|
26
|
-
const contextEntries = Object.entries(config || {}).filter(([key])=>key.includes("Context") && key !== "includeGAContext").reduce((acc, [key, value])=>{
|
|
27
|
-
if (typeof value === "object") {
|
|
28
|
-
return {
|
|
29
|
-
...acc,
|
|
30
|
-
[key]: (0, _utils.snakeCaseKeys)({
|
|
31
|
-
...value
|
|
32
|
-
})
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
return {
|
|
36
|
-
...acc,
|
|
37
|
-
[key]: (0, _utils.snakeCaseKeys)({
|
|
38
|
-
data: {
|
|
39
|
-
service_channel_identifier: value
|
|
40
|
-
}
|
|
41
|
-
})
|
|
42
|
-
};
|
|
43
|
-
}, {});
|
|
44
|
-
return contextEntries;
|
|
45
|
-
};
|
|
46
|
-
const updateIdentityContext = (contexts, uid)=>{
|
|
47
|
-
const index = Object.keys(contexts).findIndex((ctx)=>{
|
|
48
|
-
var _contexts_ctx_schema;
|
|
49
|
-
return (_contexts_ctx_schema = contexts[ctx].schema) === null || _contexts_ctx_schema === void 0 ? void 0 : _contexts_ctx_schema.includes("identity_context");
|
|
50
|
-
});
|
|
51
|
-
if (index > -1) {
|
|
52
|
-
const key = Object.keys(contexts)[index];
|
|
53
|
-
return {
|
|
54
|
-
...contexts,
|
|
55
|
-
[key]: {
|
|
56
|
-
...contexts[key],
|
|
57
|
-
data: {
|
|
58
|
-
...contexts[key].data,
|
|
59
|
-
domain_userid: uid
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
return contexts;
|
|
65
|
-
};
|
|
66
|
-
const makeContexts = (keys, config)=>(keys || []).map((key)=>config[key]);
|
|
67
|
-
|
|
68
|
-
//# sourceMappingURL=contexts.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/snowplow/contexts.ts"],"sourcesContent":["import { snakeCaseKeys } from \"../utils\";\nimport { SerialisedEvent, TrackingProps } from \"./types\";\n\nexport const getContexts = (\n config: TrackingProps,\n): Record<string, SerialisedEvent> => {\n // Create an object that only contains Context keys\n // and snake_case the keys\n const contextEntries = Object.entries(config || {})\n .filter(([key]) => key.includes(\"Context\") && key !== \"includeGAContext\")\n .reduce((acc, [key, value]) => {\n if (typeof value === \"object\") {\n return { ...acc, [key]: snakeCaseKeys({ ...value }) };\n }\n return {\n ...acc,\n [key]: snakeCaseKeys({ data: { service_channel_identifier: value } }),\n };\n }, {});\n\n return contextEntries as Record<string, SerialisedEvent>;\n};\n\nexport const updateIdentityContext = (\n contexts: Record<string, SerialisedEvent>,\n uid: unknown,\n): Record<string, SerialisedEvent> => {\n const index = Object.keys(contexts).findIndex(ctx =>\n contexts[ctx].schema?.includes(\"identity_context\"),\n );\n if (index > -1) {\n const key = Object.keys(contexts)[index];\n return {\n ...contexts,\n [key]: {\n ...contexts[key],\n data: {\n ...contexts[key].data,\n domain_userid: uid,\n },\n },\n };\n }\n return contexts;\n};\n\nexport const makeContexts = (\n keys: string[],\n config: Record<string, SerialisedEvent>,\n): SerialisedEvent[] => (keys || []).map(key => config[key]);\n"],"names":["getContexts","makeContexts","updateIdentityContext","config","contextEntries","Object","entries","filter","key","includes","reduce","acc","value","snakeCaseKeys","data","service_channel_identifier","contexts","uid","index","keys","findIndex","ctx","schema","domain_userid","map"],"mappings":";;;;;;;;;;;IAGaA,WAAW;eAAXA;;IA2CAC,YAAY;eAAZA;;IAvBAC,qBAAqB;eAArBA;;;uBAvBiB;AAGvB,MAAMF,cAAc,CACzBG;IAEA,mDAAmD;IACnD,0BAA0B;IAC1B,MAAMC,iBAAiBC,OAAOC,OAAO,CAACH,UAAU,CAAC,GAC9CI,MAAM,CAAC,CAAC,CAACC,IAAI,GAAKA,IAAIC,QAAQ,CAAC,cAAcD,QAAQ,oBACrDE,MAAM,CAAC,CAACC,KAAK,CAACH,KAAKI,MAAM;QACxB,IAAI,OAAOA,UAAU,UAAU;YAC7B,OAAO;gBAAE,GAAGD,GAAG;gBAAE,CAACH,IAAI,EAAEK,IAAAA,oBAAa,EAAC;oBAAE,GAAGD,KAAK;gBAAC;YAAG;QACtD;QACA,OAAO;YACL,GAAGD,GAAG;YACN,CAACH,IAAI,EAAEK,IAAAA,oBAAa,EAAC;gBAAEC,MAAM;oBAAEC,4BAA4BH;gBAAM;YAAE;QACrE;IACF,GAAG,CAAC;IAEN,OAAOR;AACT;AAEO,MAAMF,wBAAwB,CACnCc,UACAC;IAEA,MAAMC,QAAQb,OAAOc,IAAI,CAACH,UAAUI,SAAS,CAACC,CAAAA;YAC5CL;gBAAAA,uBAAAA,QAAQ,CAACK,IAAI,CAACC,MAAM,cAApBN,2CAAAA,qBAAsBP,QAAQ,CAAC;;IAEjC,IAAIS,QAAQ,CAAC,GAAG;QACd,MAAMV,MAAMH,OAAOc,IAAI,CAACH,SAAS,CAACE,MAAM;QACxC,OAAO;YACL,GAAGF,QAAQ;YACX,CAACR,IAAI,EAAE;gBACL,GAAGQ,QAAQ,CAACR,IAAI;gBAChBM,MAAM;oBACJ,GAAGE,QAAQ,CAACR,IAAI,CAACM,IAAI;oBACrBS,eAAeN;gBACjB;YACF;QACF;IACF;IACA,OAAOD;AACT;AAEO,MAAMf,eAAe,CAC1BkB,MACAhB,SACsB,AAACgB,CAAAA,QAAQ,EAAE,AAAD,EAAGK,GAAG,CAAChB,CAAAA,MAAOL,MAAM,CAACK,IAAI"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "baseEventDefinitions", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return baseEventDefinitions;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const baseEventDefinitions = [
|
|
12
|
-
// Mobile link in header
|
|
13
|
-
{
|
|
14
|
-
name: "mobileLinkClick",
|
|
15
|
-
type: "structured",
|
|
16
|
-
makePayload: ()=>({
|
|
17
|
-
category: "marketing",
|
|
18
|
-
action: "link-click",
|
|
19
|
-
label: "mobile_call_button",
|
|
20
|
-
property: window.location.href
|
|
21
|
-
})
|
|
22
|
-
},
|
|
23
|
-
// Operating hours link in footer
|
|
24
|
-
{
|
|
25
|
-
name: "operatingHoursClick",
|
|
26
|
-
type: "unstructured",
|
|
27
|
-
makePayload: ()=>({
|
|
28
|
-
schema: "iglu:com.snowplowanalytics.snowplow/unstruct_event/jsonschema/1-0-0",
|
|
29
|
-
data: {
|
|
30
|
-
schema: "iglu:com.simplybusiness/operating_hours_clicked/jsonschema/1-0-2",
|
|
31
|
-
data: {}
|
|
32
|
-
}
|
|
33
|
-
})
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
name: "progressbarClicked",
|
|
37
|
-
type: "unstructured",
|
|
38
|
-
makePayload: (params)=>{
|
|
39
|
-
const { section, context, fromStepIndex, fromStepName, stepIndex, stepName } = params;
|
|
40
|
-
return {
|
|
41
|
-
schema: "iglu:com.simplybusiness/progressbar_clicked/jsonschema/1-1-0",
|
|
42
|
-
data: {
|
|
43
|
-
source_page_index: fromStepIndex,
|
|
44
|
-
source_page_name: fromStepName,
|
|
45
|
-
page_index: stepIndex,
|
|
46
|
-
page_name: stepName,
|
|
47
|
-
site: context.site,
|
|
48
|
-
section_name: section,
|
|
49
|
-
vertical: context.vertical
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
];
|
|
55
|
-
|
|
56
|
-
//# sourceMappingURL=base.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/snowplow/event-definitions/base.ts"],"sourcesContent":["import { EventDefinition, ParamsType } from \"../types\";\n/**\n * Event definitions for Snowplow\n * @type {EventDefinition[]}\n * @property {string} name - The name of the event, to use when triggering\n * @property {string} type - The type of the event (structured | unstructured)\n * @property {makePayload} makePayload\n * - Function that creates the payload for the event;\n * - Allows optional params object to be passed in\n *\n * @example\n * Parent\n * import { getSnowplowConfig, SnowplowProvider } from \"@simplybusiness/services\";\n * const snowplowProps = getSnowplowConfig(pageData);\n * <SnowplowProvider scripts={snowplowProps!}>{children}</SnowplowProvider>\n *\n * Child\n * import { useSnowplowContext } from \"@simplybusiness/services\";\n * const { snowplow } = useSnowplowContext();\n * const handlerFunction = () => snowplow?.trigger(\"eventNameHere\");\n */\n\n// Base page events\nexport const baseEventDefinitions: EventDefinition[] = [\n // Mobile link in header\n {\n name: \"mobileLinkClick\",\n type: \"structured\",\n makePayload: () => ({\n category: \"marketing\",\n action: \"link-click\",\n label: \"mobile_call_button\",\n property: window.location.href,\n }),\n },\n // Operating hours link in footer\n {\n name: \"operatingHoursClick\",\n type: \"unstructured\",\n makePayload: () => ({\n schema:\n \"iglu:com.snowplowanalytics.snowplow/unstruct_event/jsonschema/1-0-0\",\n data: {\n schema:\n \"iglu:com.simplybusiness/operating_hours_clicked/jsonschema/1-0-2\",\n data: {},\n },\n }),\n },\n {\n name: \"progressbarClicked\",\n type: \"unstructured\",\n makePayload: params => {\n const {\n section,\n context,\n fromStepIndex,\n fromStepName,\n stepIndex,\n stepName,\n } = params as ParamsType;\n\n return {\n schema: \"iglu:com.simplybusiness/progressbar_clicked/jsonschema/1-1-0\",\n data: {\n source_page_index: fromStepIndex,\n source_page_name: fromStepName,\n page_index: stepIndex,\n page_name: stepName,\n site: context.site,\n section_name: section,\n vertical: context.vertical,\n },\n };\n },\n },\n];\n"],"names":["baseEventDefinitions","name","type","makePayload","category","action","label","property","window","location","href","schema","data","params","section","context","fromStepIndex","fromStepName","stepIndex","stepName","source_page_index","source_page_name","page_index","page_name","site","section_name","vertical"],"mappings":";;;;+BAuBaA;;;eAAAA;;;AAAN,MAAMA,uBAA0C;IACrD,wBAAwB;IACxB;QACEC,MAAM;QACNC,MAAM;QACNC,aAAa,IAAO,CAAA;gBAClBC,UAAU;gBACVC,QAAQ;gBACRC,OAAO;gBACPC,UAAUC,OAAOC,QAAQ,CAACC,IAAI;YAChC,CAAA;IACF;IACA,iCAAiC;IACjC;QACET,MAAM;QACNC,MAAM;QACNC,aAAa,IAAO,CAAA;gBAClBQ,QACE;gBACFC,MAAM;oBACJD,QACE;oBACFC,MAAM,CAAC;gBACT;YACF,CAAA;IACF;IACA;QACEX,MAAM;QACNC,MAAM;QACNC,aAAaU,CAAAA;YACX,MAAM,EACJC,OAAO,EACPC,OAAO,EACPC,aAAa,EACbC,YAAY,EACZC,SAAS,EACTC,QAAQ,EACT,GAAGN;YAEJ,OAAO;gBACLF,QAAQ;gBACRC,MAAM;oBACJQ,mBAAmBJ;oBACnBK,kBAAkBJ;oBAClBK,YAAYJ;oBACZK,WAAWJ;oBACXK,MAAMT,QAAQS,IAAI;oBAClBC,cAAcX;oBACdY,UAAUX,QAAQW,QAAQ;gBAC5B;YACF;QACF;IACF;CACD"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
function _export(target, all) {
|
|
6
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
eventDefinitions: function() {
|
|
13
|
-
return eventDefinitions;
|
|
14
|
-
},
|
|
15
|
-
interventionPageEvents: function() {
|
|
16
|
-
return interventionPageEvents;
|
|
17
|
-
},
|
|
18
|
-
personalisedCoverPageEvents: function() {
|
|
19
|
-
return personalisedCoverPageEvents;
|
|
20
|
-
},
|
|
21
|
-
qcpPageEvents: function() {
|
|
22
|
-
return qcpPageEvents;
|
|
23
|
-
},
|
|
24
|
-
questionnairePageEvents: function() {
|
|
25
|
-
return questionnairePageEvents;
|
|
26
|
-
},
|
|
27
|
-
referralPageEvents: function() {
|
|
28
|
-
return referralPageEvents;
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
const _base = require("./base");
|
|
32
|
-
const _qcp = require("./qcp");
|
|
33
|
-
const _referral = require("./referral");
|
|
34
|
-
const _intervention = require("./intervention");
|
|
35
|
-
const _questionnaire = require("./questionnaire");
|
|
36
|
-
const _personalised_cover = require("./personalised_cover");
|
|
37
|
-
const eventDefinitions = [
|
|
38
|
-
..._base.baseEventDefinitions,
|
|
39
|
-
..._qcp.qcpEventDefinitions,
|
|
40
|
-
..._referral.referralEventDefinitions,
|
|
41
|
-
..._intervention.interventionEventDefinitions,
|
|
42
|
-
..._questionnaire.questionnaireEventDefinitions,
|
|
43
|
-
..._personalised_cover.personalisedCoverEventDefinitions
|
|
44
|
-
];
|
|
45
|
-
const qcpPageEvents = [
|
|
46
|
-
..._base.baseEventDefinitions,
|
|
47
|
-
..._qcp.qcpEventDefinitions
|
|
48
|
-
];
|
|
49
|
-
const referralPageEvents = [
|
|
50
|
-
..._base.baseEventDefinitions,
|
|
51
|
-
..._referral.referralEventDefinitions
|
|
52
|
-
];
|
|
53
|
-
const personalisedCoverPageEvents = [
|
|
54
|
-
..._base.baseEventDefinitions,
|
|
55
|
-
..._personalised_cover.personalisedCoverEventDefinitions
|
|
56
|
-
];
|
|
57
|
-
const interventionPageEvents = [
|
|
58
|
-
..._intervention.interventionEventDefinitions
|
|
59
|
-
];
|
|
60
|
-
const questionnairePageEvents = [
|
|
61
|
-
..._questionnaire.questionnaireEventDefinitions
|
|
62
|
-
]; // Create a new export for each kind of page below
|
|
63
|
-
// containing just the subset needed for that page
|
|
64
|
-
|
|
65
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/snowplow/event-definitions/index.ts"],"sourcesContent":["import { baseEventDefinitions } from \"./base\";\nimport { qcpEventDefinitions } from \"./qcp\";\nimport { referralEventDefinitions } from \"./referral\";\nimport { interventionEventDefinitions } from \"./intervention\";\nimport { questionnaireEventDefinitions } from \"./questionnaire\";\nimport { personalisedCoverEventDefinitions } from \"./personalised_cover\";\n\n// All events (keep up to date with new files)\nexport const eventDefinitions = [\n ...baseEventDefinitions,\n ...qcpEventDefinitions,\n ...referralEventDefinitions,\n ...interventionEventDefinitions,\n ...questionnaireEventDefinitions,\n ...personalisedCoverEventDefinitions,\n];\n\nexport const qcpPageEvents = [...baseEventDefinitions, ...qcpEventDefinitions];\n\nexport const referralPageEvents = [\n ...baseEventDefinitions,\n ...referralEventDefinitions,\n];\n\nexport const personalisedCoverPageEvents = [\n ...baseEventDefinitions,\n ...personalisedCoverEventDefinitions,\n];\n\nexport const interventionPageEvents = [...interventionEventDefinitions];\n\nexport type { InterventionPayload } from \"./intervention\";\n\nexport const questionnairePageEvents = [...questionnaireEventDefinitions];\n\n// Create a new export for each kind of page below\n// containing just the subset needed for that page\n"],"names":["eventDefinitions","interventionPageEvents","personalisedCoverPageEvents","qcpPageEvents","questionnairePageEvents","referralPageEvents","baseEventDefinitions","qcpEventDefinitions","referralEventDefinitions","interventionEventDefinitions","questionnaireEventDefinitions","personalisedCoverEventDefinitions"],"mappings":";;;;;;;;;;;IAQaA,gBAAgB;eAAhBA;;IAqBAC,sBAAsB;eAAtBA;;IALAC,2BAA2B;eAA3BA;;IAPAC,aAAa;eAAbA;;IAgBAC,uBAAuB;eAAvBA;;IAdAC,kBAAkB;eAAlBA;;;sBAnBwB;qBACD;0BACK;8BACI;+BACC;oCACI;AAG3C,MAAML,mBAAmB;OAC3BM,0BAAoB;OACpBC,wBAAmB;OACnBC,kCAAwB;OACxBC,0CAA4B;OAC5BC,4CAA6B;OAC7BC,qDAAiC;CACrC;AAEM,MAAMR,gBAAgB;OAAIG,0BAAoB;OAAKC,wBAAmB;CAAC;AAEvE,MAAMF,qBAAqB;OAC7BC,0BAAoB;OACpBE,kCAAwB;CAC5B;AAEM,MAAMN,8BAA8B;OACtCI,0BAAoB;OACpBK,qDAAiC;CACrC;AAEM,MAAMV,yBAAyB;OAAIQ,0CAA4B;CAAC;AAIhE,MAAML,0BAA0B;OAAIM,4CAA6B;CAAC,EAEzE,kDAAkD;CAClD,kDAAkD"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "interventionEventDefinitions", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return interventionEventDefinitions;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const interventionEventDefinitions = [
|
|
12
|
-
{
|
|
13
|
-
name: "interventionInteraction",
|
|
14
|
-
type: "unstructured",
|
|
15
|
-
makePayload: (params)=>{
|
|
16
|
-
const { interventionId, interventionName, category, userUniqueIdentifier, userUniqueIdentifierType, action, site } = params;
|
|
17
|
-
return {
|
|
18
|
-
schema: "iglu:com.simplybusiness/intervention_interaction/jsonschema/2-1-0",
|
|
19
|
-
data: {
|
|
20
|
-
intervention_id: interventionId,
|
|
21
|
-
intervention_name: interventionName,
|
|
22
|
-
category,
|
|
23
|
-
user_unique_identifier: userUniqueIdentifier,
|
|
24
|
-
user_unique_identifier_type: userUniqueIdentifierType,
|
|
25
|
-
action,
|
|
26
|
-
site
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
];
|
|
32
|
-
|
|
33
|
-
//# sourceMappingURL=intervention.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/snowplow/event-definitions/intervention.ts"],"sourcesContent":["import { EventDefinition } from \"../types\";\n\ntype InterventionIdTypes = \"duid\"; // Add more values as needed\n\nexport type InterventionPayload = {\n interventionId: string;\n interventionName: string;\n category: string;\n userUniqueIdentifier: string;\n userUniqueIdentifierType: InterventionIdTypes;\n action: string;\n site?: string;\n};\n\nexport const interventionEventDefinitions: EventDefinition[] = [\n {\n name: \"interventionInteraction\",\n type: \"unstructured\",\n makePayload: params => {\n const {\n interventionId,\n interventionName,\n category,\n userUniqueIdentifier,\n userUniqueIdentifierType,\n action,\n site,\n } = params as InterventionPayload;\n\n return {\n schema:\n \"iglu:com.simplybusiness/intervention_interaction/jsonschema/2-1-0\",\n data: {\n intervention_id: interventionId,\n intervention_name: interventionName,\n category,\n user_unique_identifier: userUniqueIdentifier,\n user_unique_identifier_type: userUniqueIdentifierType,\n action,\n site,\n },\n };\n },\n },\n];\n"],"names":["interventionEventDefinitions","name","type","makePayload","params","interventionId","interventionName","category","userUniqueIdentifier","userUniqueIdentifierType","action","site","schema","data","intervention_id","intervention_name","user_unique_identifier","user_unique_identifier_type"],"mappings":";;;;+BAcaA;;;eAAAA;;;AAAN,MAAMA,+BAAkD;IAC7D;QACEC,MAAM;QACNC,MAAM;QACNC,aAAaC,CAAAA;YACX,MAAM,EACJC,cAAc,EACdC,gBAAgB,EAChBC,QAAQ,EACRC,oBAAoB,EACpBC,wBAAwB,EACxBC,MAAM,EACNC,IAAI,EACL,GAAGP;YAEJ,OAAO;gBACLQ,QACE;gBACFC,MAAM;oBACJC,iBAAiBT;oBACjBU,mBAAmBT;oBACnBC;oBACAS,wBAAwBR;oBACxBS,6BAA6BR;oBAC7BC;oBACAC;gBACF;YACF;QACF;IACF;CACD"}
|
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "personalisedCoverEventDefinitions", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return personalisedCoverEventDefinitions;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _redaction = require("./redaction");
|
|
12
|
-
const _constants = require("../constants");
|
|
13
|
-
const _utils = require("../../utils");
|
|
14
|
-
const personalisedCoverEventDefinitions = [
|
|
15
|
-
{
|
|
16
|
-
name: "seeMoreClicked",
|
|
17
|
-
type: "structured",
|
|
18
|
-
makePayload: (_)=>({
|
|
19
|
-
category: "personalised_cover",
|
|
20
|
-
action: "see_more_clicked",
|
|
21
|
-
label: "page",
|
|
22
|
-
property: "personalised_cover"
|
|
23
|
-
})
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
name: "selectPackageClicked",
|
|
27
|
-
type: "structured",
|
|
28
|
-
makePayload: (_)=>({
|
|
29
|
-
category: "personalised_cover",
|
|
30
|
-
action: "select_package_clicked",
|
|
31
|
-
label: "page",
|
|
32
|
-
property: "personalised_cover"
|
|
33
|
-
})
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
name: "validationShown",
|
|
37
|
-
type: "structured",
|
|
38
|
-
makePayload: (params)=>{
|
|
39
|
-
const { cover, question } = params;
|
|
40
|
-
return {
|
|
41
|
-
category: "personalised_cover",
|
|
42
|
-
action: "validation_shown",
|
|
43
|
-
label: "cover_question",
|
|
44
|
-
property: `${(0, _utils.snakeCase)(cover)}_${(0, _utils.snakeCase)(question)}`
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
name: "coverQuestionAnswered",
|
|
50
|
-
type: "unstructured",
|
|
51
|
-
makePayload: (params)=>{
|
|
52
|
-
const { context } = params;
|
|
53
|
-
const { question, answer } = (0, _redaction.redact)(params);
|
|
54
|
-
// Flatten the answer to a delimited string
|
|
55
|
-
const flatAnswer = Array.isArray(answer) ? answer.join(_constants.DELIMITER) : answer;
|
|
56
|
-
return {
|
|
57
|
-
schema: "iglu:com.simplybusiness/form_question_answered/jsonschema/1-0-1",
|
|
58
|
-
data: {
|
|
59
|
-
site: context.site,
|
|
60
|
-
page_name: "personalised_cover",
|
|
61
|
-
section_name: "Personalised Cover Questions",
|
|
62
|
-
question,
|
|
63
|
-
answer: flatAnswer
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
name: "limitLinkClicked",
|
|
70
|
-
type: "structured",
|
|
71
|
-
makePayload: (params)=>{
|
|
72
|
-
const { label } = params;
|
|
73
|
-
return {
|
|
74
|
-
category: "personalised_cover",
|
|
75
|
-
action: "limit_link_clicked",
|
|
76
|
-
label,
|
|
77
|
-
property: "link_clicked"
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
name: "limitChanged",
|
|
83
|
-
type: "structured",
|
|
84
|
-
makePayload: (params)=>{
|
|
85
|
-
const { label, limit } = params;
|
|
86
|
-
return {
|
|
87
|
-
category: "personalised_cover",
|
|
88
|
-
action: "limit_changed",
|
|
89
|
-
label,
|
|
90
|
-
property: limit
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
name: "coverPresented",
|
|
96
|
-
type: "structured",
|
|
97
|
-
makePayload: (params)=>{
|
|
98
|
-
const { property } = params;
|
|
99
|
-
return {
|
|
100
|
-
category: "personalised_cover",
|
|
101
|
-
action: "cover_presented",
|
|
102
|
-
label: "cover_name",
|
|
103
|
-
property
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
name: "moreInfoClicked",
|
|
109
|
-
type: "structured",
|
|
110
|
-
makePayload: (params)=>{
|
|
111
|
-
const { property } = params;
|
|
112
|
-
return {
|
|
113
|
-
category: "personalised_cover",
|
|
114
|
-
action: "more_info_clicked",
|
|
115
|
-
label: "cover_name",
|
|
116
|
-
property
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
];
|
|
121
|
-
|
|
122
|
-
//# sourceMappingURL=personalised_cover.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/snowplow/event-definitions/personalised_cover.ts"],"sourcesContent":["import { EventDefinition, ParamsType } from \"../types\";\nimport { redact } from \"./redaction\";\nimport { DELIMITER } from \"../constants\";\nimport { snakeCase } from \"../../utils\";\n\n/**\n * Event definitions for Snowplow\n * @type {EventDefinition[]}\n * @property {string} name - The name of the event, to use when triggering\n * @property {string} type - The type of the event (structured | unstructured)\n * @property {makePayload} makePayload\n * - Function that creates the payload for the event;\n * - Allows optional params object to be passed in\n *\n * @example\n * Parent\n * import { getSnowplowConfig, SnowplowProvider } from \"@simplybusiness/services\";\n * const snowplowProps = getSnowplowConfig(pageData);\n * <SnowplowProvider scripts={snowplowProps!}>{children}</SnowplowProvider>\n *\n * Child\n * import { useSnowplowContext } from \"@simplybusiness/services\";\n * const { snowplow } = useSnowplowContext();\n * const handlerFunction = () => snowplow?.trigger(\"eventNameHere\");\n */\n\nexport const personalisedCoverEventDefinitions: EventDefinition[] = [\n {\n name: \"seeMoreClicked\",\n type: \"structured\",\n makePayload: _ => ({\n category: \"personalised_cover\",\n action: \"see_more_clicked\",\n label: \"page\",\n property: \"personalised_cover\",\n }),\n },\n {\n name: \"selectPackageClicked\",\n type: \"structured\",\n makePayload: _ => ({\n category: \"personalised_cover\",\n action: \"select_package_clicked\",\n label: \"page\",\n property: \"personalised_cover\",\n }),\n },\n {\n name: \"validationShown\",\n type: \"structured\",\n makePayload: params => {\n const { cover, question } = params as ParamsType;\n\n return {\n category: \"personalised_cover\",\n action: \"validation_shown\",\n label: \"cover_question\",\n property: `${snakeCase(cover)}_${snakeCase(question)}`,\n };\n },\n },\n {\n name: \"coverQuestionAnswered\",\n type: \"unstructured\",\n makePayload: params => {\n const { context } = params as ParamsType;\n const { question, answer } = redact(params as ParamsType);\n // Flatten the answer to a delimited string\n const flatAnswer = Array.isArray(answer)\n ? answer.join(DELIMITER)\n : answer;\n\n return {\n schema:\n \"iglu:com.simplybusiness/form_question_answered/jsonschema/1-0-1\",\n data: {\n site: context.site,\n page_name: \"personalised_cover\",\n section_name: \"Personalised Cover Questions\",\n question,\n answer: flatAnswer,\n },\n };\n },\n },\n {\n name: \"limitLinkClicked\",\n type: \"structured\",\n makePayload: params => {\n const { label } = params as ParamsType;\n\n return {\n category: \"personalised_cover\",\n action: \"limit_link_clicked\",\n label,\n property: \"link_clicked\",\n };\n },\n },\n {\n name: \"limitChanged\",\n type: \"structured\",\n makePayload: params => {\n const { label, limit } = params as ParamsType;\n\n return {\n category: \"personalised_cover\",\n action: \"limit_changed\",\n label,\n property: limit,\n };\n },\n },\n {\n name: \"coverPresented\",\n type: \"structured\",\n makePayload: params => {\n const { property } = params as ParamsType;\n\n return {\n category: \"personalised_cover\",\n action: \"cover_presented\",\n label: \"cover_name\",\n property,\n };\n },\n },\n {\n name: \"moreInfoClicked\",\n type: \"structured\",\n makePayload: params => {\n const { property } = params as ParamsType;\n\n return {\n category: \"personalised_cover\",\n action: \"more_info_clicked\",\n label: \"cover_name\",\n property,\n };\n },\n },\n];\n"],"names":["personalisedCoverEventDefinitions","name","type","makePayload","_","category","action","label","property","params","cover","question","snakeCase","context","answer","redact","flatAnswer","Array","isArray","join","DELIMITER","schema","data","site","page_name","section_name","limit"],"mappings":";;;;+BA0BaA;;;eAAAA;;;2BAzBU;2BACG;uBACA;AAuBnB,MAAMA,oCAAuD;IAClE;QACEC,MAAM;QACNC,MAAM;QACNC,aAAaC,CAAAA,IAAM,CAAA;gBACjBC,UAAU;gBACVC,QAAQ;gBACRC,OAAO;gBACPC,UAAU;YACZ,CAAA;IACF;IACA;QACEP,MAAM;QACNC,MAAM;QACNC,aAAaC,CAAAA,IAAM,CAAA;gBACjBC,UAAU;gBACVC,QAAQ;gBACRC,OAAO;gBACPC,UAAU;YACZ,CAAA;IACF;IACA;QACEP,MAAM;QACNC,MAAM;QACNC,aAAaM,CAAAA;YACX,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAE,GAAGF;YAE5B,OAAO;gBACLJ,UAAU;gBACVC,QAAQ;gBACRC,OAAO;gBACPC,UAAU,GAAGI,IAAAA,gBAAS,EAACF,OAAO,CAAC,EAAEE,IAAAA,gBAAS,EAACD,WAAW;YACxD;QACF;IACF;IACA;QACEV,MAAM;QACNC,MAAM;QACNC,aAAaM,CAAAA;YACX,MAAM,EAAEI,OAAO,EAAE,GAAGJ;YACpB,MAAM,EAAEE,QAAQ,EAAEG,MAAM,EAAE,GAAGC,IAAAA,iBAAM,EAACN;YACpC,2CAA2C;YAC3C,MAAMO,aAAaC,MAAMC,OAAO,CAACJ,UAC7BA,OAAOK,IAAI,CAACC,oBAAS,IACrBN;YAEJ,OAAO;gBACLO,QACE;gBACFC,MAAM;oBACJC,MAAMV,QAAQU,IAAI;oBAClBC,WAAW;oBACXC,cAAc;oBACdd;oBACAG,QAAQE;gBACV;YACF;QACF;IACF;IACA;QACEf,MAAM;QACNC,MAAM;QACNC,aAAaM,CAAAA;YACX,MAAM,EAAEF,KAAK,EAAE,GAAGE;YAElB,OAAO;gBACLJ,UAAU;gBACVC,QAAQ;gBACRC;gBACAC,UAAU;YACZ;QACF;IACF;IACA;QACEP,MAAM;QACNC,MAAM;QACNC,aAAaM,CAAAA;YACX,MAAM,EAAEF,KAAK,EAAEmB,KAAK,EAAE,GAAGjB;YAEzB,OAAO;gBACLJ,UAAU;gBACVC,QAAQ;gBACRC;gBACAC,UAAUkB;YACZ;QACF;IACF;IACA;QACEzB,MAAM;QACNC,MAAM;QACNC,aAAaM,CAAAA;YACX,MAAM,EAAED,QAAQ,EAAE,GAAGC;YAErB,OAAO;gBACLJ,UAAU;gBACVC,QAAQ;gBACRC,OAAO;gBACPC;YACF;QACF;IACF;IACA;QACEP,MAAM;QACNC,MAAM;QACNC,aAAaM,CAAAA;YACX,MAAM,EAAED,QAAQ,EAAE,GAAGC;YAErB,OAAO;gBACLJ,UAAU;gBACVC,QAAQ;gBACRC,OAAO;gBACPC;YACF;QACF;IACF;CACD"}
|