@simplybusiness/services 2.5.2 → 2.6.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/CHANGELOG.md +6 -0
- package/dist/cjs/index.js +144 -206
- package/dist/cjs/index.js.map +3 -3
- package/dist/cjs/meta.json +62 -78
- package/dist/cjs/snowplow/SnowplowContext.js +144 -205
- package/dist/cjs/snowplow/SnowplowContext.js.map +3 -3
- package/dist/cjs/snowplow/event-definitions/index.js +144 -206
- package/dist/cjs/snowplow/event-definitions/index.js.map +3 -3
- package/dist/cjs/snowplow/event-definitions/personalised_cover.js +0 -201
- package/dist/cjs/snowplow/event-definitions/personalised_cover.js.map +3 -3
- package/dist/cjs/snowplow/index.js +144 -206
- package/dist/cjs/snowplow/index.js.map +3 -3
- package/dist/cjs/utils/testUtils.js +144 -205
- package/dist/cjs/utils/testUtils.js.map +3 -3
- package/dist/esm/{chunk-3JWAIW5L.js → chunk-FMM4S4JB.js} +2 -7
- package/dist/esm/{chunk-3JWAIW5L.js.map → chunk-FMM4S4JB.js.map} +2 -2
- package/dist/esm/{chunk-3SO3SL37.js → chunk-HFULBVWF.js} +1 -64
- package/dist/esm/chunk-HFULBVWF.js.map +7 -0
- package/dist/esm/{chunk-TRQ236KL.js → chunk-YXKJJ7B7.js} +2 -2
- package/dist/esm/index.js +3 -5
- package/dist/esm/meta.json +45 -75
- package/dist/esm/snowplow/SnowplowContext.js +3 -3
- package/dist/esm/snowplow/event-definitions/index.js +2 -4
- package/dist/esm/snowplow/event-definitions/personalised_cover.js +1 -3
- package/dist/esm/snowplow/index.js +3 -5
- package/dist/esm/utils/testUtils.js +3 -3
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/types/snowplow/event-definitions/index.d.ts +0 -1
- package/package.json +1 -1
- package/src/snowplow/event-definitions/index.ts +0 -5
- package/src/snowplow/event-definitions/personalised_cover.test.ts +0 -182
- package/src/snowplow/event-definitions/personalised_cover.ts +0 -66
- package/dist/esm/chunk-3SO3SL37.js.map +0 -7
- /package/dist/esm/{chunk-TRQ236KL.js.map → chunk-YXKJJ7B7.js.map} +0 -0
|
@@ -23,7 +23,6 @@ __export(event_definitions_exports, {
|
|
|
23
23
|
coverageSelectionPageEvents: () => coverageSelectionPageEvents,
|
|
24
24
|
eventDefinitions: () => eventDefinitions,
|
|
25
25
|
interventionPageEvents: () => interventionPageEvents,
|
|
26
|
-
personalisedCoverPageEvents: () => personalisedCoverPageEvents,
|
|
27
26
|
qcpPageEvents: () => qcpPageEvents,
|
|
28
27
|
questionnairePageEvents: () => questionnairePageEvents,
|
|
29
28
|
referralPageEvents: () => referralPageEvents
|
|
@@ -136,150 +135,6 @@ var interventionEventDefinitions = [
|
|
|
136
135
|
// src/utils/text.ts
|
|
137
136
|
var snakeCase = (text = "") => text.toLowerCase().replace(/ /g, "_");
|
|
138
137
|
|
|
139
|
-
// src/snowplow/constants.ts
|
|
140
|
-
var DELIMITER = "|";
|
|
141
|
-
|
|
142
|
-
// src/snowplow/event-definitions/questionnaire/redaction.ts
|
|
143
|
-
var PII_ANSWER = [
|
|
144
|
-
"customer_title",
|
|
145
|
-
"customer_first_name",
|
|
146
|
-
"customer_last_name",
|
|
147
|
-
"customer_email_address",
|
|
148
|
-
"preapp_email_address",
|
|
149
|
-
"customer_telephone_number",
|
|
150
|
-
"customer_alternative_telephone_number",
|
|
151
|
-
"uk_address_lookup",
|
|
152
|
-
"uk_correspondence_address_lookup",
|
|
153
|
-
"customer_address_1_pre_quote",
|
|
154
|
-
"customer_address_2_pre_quote",
|
|
155
|
-
"customer_town_pre_quote",
|
|
156
|
-
"customer_postcode_pre_quote",
|
|
157
|
-
"customer_address_1",
|
|
158
|
-
"customer_address_2",
|
|
159
|
-
"customer_town",
|
|
160
|
-
"customer_postcode",
|
|
161
|
-
"address_1_pre_quote",
|
|
162
|
-
"address_2_pre_quote",
|
|
163
|
-
"uk_postcode_pre_quote",
|
|
164
|
-
"town_pre_quote",
|
|
165
|
-
"owner_first_name",
|
|
166
|
-
"owner_last_name",
|
|
167
|
-
"beneficiary_first_name",
|
|
168
|
-
"beneficiary_last_name",
|
|
169
|
-
"gender",
|
|
170
|
-
"dynamic_ssn_fein",
|
|
171
|
-
"ssn",
|
|
172
|
-
"fein",
|
|
173
|
-
"sof_county_court_judgement_online_yes",
|
|
174
|
-
"sof_county_court_judgement_online_no",
|
|
175
|
-
"sof_ccj_count",
|
|
176
|
-
"sof_ccj_value",
|
|
177
|
-
"sof_ccj_date",
|
|
178
|
-
"sof_court_judgement_yes",
|
|
179
|
-
"sof_court_judgement_no",
|
|
180
|
-
"ccj_date",
|
|
181
|
-
"sof_single_ccj_no",
|
|
182
|
-
"sof_single_ccj_yes",
|
|
183
|
-
"sof_ccj_yes",
|
|
184
|
-
"sof_ccj_no",
|
|
185
|
-
"ccj_count",
|
|
186
|
-
"sof_bankrupt_yes",
|
|
187
|
-
"sof_bankrupt_no",
|
|
188
|
-
"sof_multiple_bankruptcies_yes",
|
|
189
|
-
"sof_multiple_bankruptcies_no",
|
|
190
|
-
"bankruptcy_date",
|
|
191
|
-
"sof_single_bankruptcy_no",
|
|
192
|
-
"sof_single_bankruptcy_yes",
|
|
193
|
-
"sof_bankruptcy_yes",
|
|
194
|
-
"sof_bankruptcy_no",
|
|
195
|
-
"bankruptcy_discharged",
|
|
196
|
-
"sof_liquidation_yes",
|
|
197
|
-
"sof_liquidation_no",
|
|
198
|
-
"sof_multiple_liquidations",
|
|
199
|
-
"liquidation_date",
|
|
200
|
-
"sof_criminal_offence_yes",
|
|
201
|
-
"sof_criminal_offence_no",
|
|
202
|
-
"sof_criminal_yes",
|
|
203
|
-
"sof_criminal_no",
|
|
204
|
-
"hcp_date_of_birth_1",
|
|
205
|
-
"hcp_date_of_birth_2",
|
|
206
|
-
"hcp_date_of_birth_3",
|
|
207
|
-
"hcp_date_of_birth_4",
|
|
208
|
-
"hcp_date_of_birth_5",
|
|
209
|
-
"hcp_date_of_birth_6",
|
|
210
|
-
"hcp_date_of_birth_7",
|
|
211
|
-
"hcp_date_of_birth_8",
|
|
212
|
-
"hcp_date_of_birth_9",
|
|
213
|
-
"hcp_date_of_birth_10",
|
|
214
|
-
"sof_previous_claims_yes",
|
|
215
|
-
"sof_previous_claims_no",
|
|
216
|
-
"sof_claims_yes",
|
|
217
|
-
"sof_claims_no",
|
|
218
|
-
"sof_property_claims_in_the_last_5_years_yes",
|
|
219
|
-
"sof_property_claims_in_the_last_5_years_no",
|
|
220
|
-
"sof_property_claims_in_the_last_0_to_4_years_yes",
|
|
221
|
-
"sof_property_claims_in_the_last_0_to_4_years_no",
|
|
222
|
-
"claim_count",
|
|
223
|
-
"sof_number_of_claims",
|
|
224
|
-
"number_of_claims_in_last_5_years",
|
|
225
|
-
"number_of_claims_in_time_owned",
|
|
226
|
-
"date_of_incident_1",
|
|
227
|
-
"date_of_incident_2",
|
|
228
|
-
"date_of_incident_3",
|
|
229
|
-
"date_of_incident_4",
|
|
230
|
-
"date_of_incident_5",
|
|
231
|
-
"type_of_incident_1",
|
|
232
|
-
"type_of_incident_2",
|
|
233
|
-
"type_of_incident_3",
|
|
234
|
-
"type_of_incident_4",
|
|
235
|
-
"type_of_incident_5",
|
|
236
|
-
"incident_value_1",
|
|
237
|
-
"incident_value_2",
|
|
238
|
-
"incident_value_3",
|
|
239
|
-
"incident_value_4",
|
|
240
|
-
"incident_value_5",
|
|
241
|
-
"sof_pollution_disease_claims_yes",
|
|
242
|
-
"sof_pollution_disease_claims_no",
|
|
243
|
-
"sof_potential_claims_yes",
|
|
244
|
-
"sof_potential_claims_no",
|
|
245
|
-
"sof_previous_circumstances_yes",
|
|
246
|
-
"sof_previous_circumstances_no",
|
|
247
|
-
"sof_possible_claims_yes",
|
|
248
|
-
"sof_possible_claims_no",
|
|
249
|
-
"date_of_possible_incident",
|
|
250
|
-
"type_of_possible_incident",
|
|
251
|
-
"possible_incident_value",
|
|
252
|
-
"sof_property_claims_yes",
|
|
253
|
-
"sof_property_claims_no",
|
|
254
|
-
"sof_liability_claims_yes",
|
|
255
|
-
"sof_liability_claims_no",
|
|
256
|
-
"van_registration",
|
|
257
|
-
"sof_disqualified_director_yes",
|
|
258
|
-
"sof_disqualified_director_no",
|
|
259
|
-
"sof_insurance_refused_yes",
|
|
260
|
-
"sof_insurance_refused_no",
|
|
261
|
-
"sof_insurance_declined_yes",
|
|
262
|
-
"sof_insurance_declined_no",
|
|
263
|
-
"insurance_refused"
|
|
264
|
-
];
|
|
265
|
-
var RADIO_ANSWER_FROM_QUESTIONS = [
|
|
266
|
-
"have_secondary_trade_yes",
|
|
267
|
-
"have_secondary_trade_no"
|
|
268
|
-
];
|
|
269
|
-
var ANSWER_SUFFIX_PATTERN = /_(yes|no)$/;
|
|
270
|
-
var redact = (params) => {
|
|
271
|
-
let { question, answer } = params;
|
|
272
|
-
const piiAnswer = new Set(PII_ANSWER);
|
|
273
|
-
const radioAnswerFromQuestions = new Set(RADIO_ANSWER_FROM_QUESTIONS);
|
|
274
|
-
if (piiAnswer.has(question)) {
|
|
275
|
-
answer = "REDACTED";
|
|
276
|
-
question = question?.replace(ANSWER_SUFFIX_PATTERN, "");
|
|
277
|
-
} else if (radioAnswerFromQuestions.has(question)) {
|
|
278
|
-
question = question?.replace(ANSWER_SUFFIX_PATTERN, "");
|
|
279
|
-
}
|
|
280
|
-
return { question, answer };
|
|
281
|
-
};
|
|
282
|
-
|
|
283
138
|
// src/snowplow/event-definitions/personalised_cover.ts
|
|
284
139
|
var personalisedCoverEventDefinitions = [
|
|
285
140
|
{
|
|
@@ -292,16 +147,6 @@ var personalisedCoverEventDefinitions = [
|
|
|
292
147
|
property: "personalised_cover"
|
|
293
148
|
})
|
|
294
149
|
},
|
|
295
|
-
{
|
|
296
|
-
name: "selectPackageClicked",
|
|
297
|
-
type: "structured",
|
|
298
|
-
makePayload: (_) => ({
|
|
299
|
-
category: "personalised_cover",
|
|
300
|
-
action: "select_package_clicked",
|
|
301
|
-
label: "page",
|
|
302
|
-
property: "personalised_cover"
|
|
303
|
-
})
|
|
304
|
-
},
|
|
305
150
|
{
|
|
306
151
|
name: "validationShown",
|
|
307
152
|
type: "structured",
|
|
@@ -315,27 +160,6 @@ var personalisedCoverEventDefinitions = [
|
|
|
315
160
|
};
|
|
316
161
|
}
|
|
317
162
|
},
|
|
318
|
-
{
|
|
319
|
-
name: "coverQuestionAnswered",
|
|
320
|
-
type: "unstructured",
|
|
321
|
-
makePayload: (params) => {
|
|
322
|
-
const { context } = params;
|
|
323
|
-
const { question, answer } = redact(params);
|
|
324
|
-
const flatAnswer = Array.isArray(answer) ? answer.join(DELIMITER) : answer;
|
|
325
|
-
return {
|
|
326
|
-
schema: "iglu:com.simplybusiness/form_question_answered/jsonschema/1-0-4",
|
|
327
|
-
data: {
|
|
328
|
-
site: context.site,
|
|
329
|
-
page_name: "personalised_cover",
|
|
330
|
-
section_name: "Personalised Cover Questions",
|
|
331
|
-
question,
|
|
332
|
-
answer: flatAnswer,
|
|
333
|
-
vertical: context.vertical,
|
|
334
|
-
journey_id: context.journeyId
|
|
335
|
-
}
|
|
336
|
-
};
|
|
337
|
-
}
|
|
338
|
-
},
|
|
339
163
|
{
|
|
340
164
|
name: "limitLinkClicked",
|
|
341
165
|
type: "structured",
|
|
@@ -387,32 +211,6 @@ var personalisedCoverEventDefinitions = [
|
|
|
387
211
|
property
|
|
388
212
|
};
|
|
389
213
|
}
|
|
390
|
-
},
|
|
391
|
-
{
|
|
392
|
-
name: "additionalQuestionsClicked",
|
|
393
|
-
type: "structured",
|
|
394
|
-
makePayload: (params) => {
|
|
395
|
-
const { property } = params;
|
|
396
|
-
return {
|
|
397
|
-
category: "personalised_cover",
|
|
398
|
-
action: "cover_details_clicked",
|
|
399
|
-
label: "cover_name",
|
|
400
|
-
property
|
|
401
|
-
};
|
|
402
|
-
}
|
|
403
|
-
},
|
|
404
|
-
{
|
|
405
|
-
name: "chatbotPromptClicked",
|
|
406
|
-
type: "structured",
|
|
407
|
-
makePayload: (params) => {
|
|
408
|
-
const { label, property } = params;
|
|
409
|
-
return {
|
|
410
|
-
category: "personalised_cover",
|
|
411
|
-
action: "chatbot_prompt_clicked",
|
|
412
|
-
label: property,
|
|
413
|
-
property: label
|
|
414
|
-
};
|
|
415
|
-
}
|
|
416
214
|
}
|
|
417
215
|
];
|
|
418
216
|
|
|
@@ -766,6 +564,150 @@ var qcpEventDefinitions = [
|
|
|
766
564
|
}
|
|
767
565
|
];
|
|
768
566
|
|
|
567
|
+
// src/snowplow/constants.ts
|
|
568
|
+
var DELIMITER = "|";
|
|
569
|
+
|
|
570
|
+
// src/snowplow/event-definitions/questionnaire/redaction.ts
|
|
571
|
+
var PII_ANSWER = [
|
|
572
|
+
"customer_title",
|
|
573
|
+
"customer_first_name",
|
|
574
|
+
"customer_last_name",
|
|
575
|
+
"customer_email_address",
|
|
576
|
+
"preapp_email_address",
|
|
577
|
+
"customer_telephone_number",
|
|
578
|
+
"customer_alternative_telephone_number",
|
|
579
|
+
"uk_address_lookup",
|
|
580
|
+
"uk_correspondence_address_lookup",
|
|
581
|
+
"customer_address_1_pre_quote",
|
|
582
|
+
"customer_address_2_pre_quote",
|
|
583
|
+
"customer_town_pre_quote",
|
|
584
|
+
"customer_postcode_pre_quote",
|
|
585
|
+
"customer_address_1",
|
|
586
|
+
"customer_address_2",
|
|
587
|
+
"customer_town",
|
|
588
|
+
"customer_postcode",
|
|
589
|
+
"address_1_pre_quote",
|
|
590
|
+
"address_2_pre_quote",
|
|
591
|
+
"uk_postcode_pre_quote",
|
|
592
|
+
"town_pre_quote",
|
|
593
|
+
"owner_first_name",
|
|
594
|
+
"owner_last_name",
|
|
595
|
+
"beneficiary_first_name",
|
|
596
|
+
"beneficiary_last_name",
|
|
597
|
+
"gender",
|
|
598
|
+
"dynamic_ssn_fein",
|
|
599
|
+
"ssn",
|
|
600
|
+
"fein",
|
|
601
|
+
"sof_county_court_judgement_online_yes",
|
|
602
|
+
"sof_county_court_judgement_online_no",
|
|
603
|
+
"sof_ccj_count",
|
|
604
|
+
"sof_ccj_value",
|
|
605
|
+
"sof_ccj_date",
|
|
606
|
+
"sof_court_judgement_yes",
|
|
607
|
+
"sof_court_judgement_no",
|
|
608
|
+
"ccj_date",
|
|
609
|
+
"sof_single_ccj_no",
|
|
610
|
+
"sof_single_ccj_yes",
|
|
611
|
+
"sof_ccj_yes",
|
|
612
|
+
"sof_ccj_no",
|
|
613
|
+
"ccj_count",
|
|
614
|
+
"sof_bankrupt_yes",
|
|
615
|
+
"sof_bankrupt_no",
|
|
616
|
+
"sof_multiple_bankruptcies_yes",
|
|
617
|
+
"sof_multiple_bankruptcies_no",
|
|
618
|
+
"bankruptcy_date",
|
|
619
|
+
"sof_single_bankruptcy_no",
|
|
620
|
+
"sof_single_bankruptcy_yes",
|
|
621
|
+
"sof_bankruptcy_yes",
|
|
622
|
+
"sof_bankruptcy_no",
|
|
623
|
+
"bankruptcy_discharged",
|
|
624
|
+
"sof_liquidation_yes",
|
|
625
|
+
"sof_liquidation_no",
|
|
626
|
+
"sof_multiple_liquidations",
|
|
627
|
+
"liquidation_date",
|
|
628
|
+
"sof_criminal_offence_yes",
|
|
629
|
+
"sof_criminal_offence_no",
|
|
630
|
+
"sof_criminal_yes",
|
|
631
|
+
"sof_criminal_no",
|
|
632
|
+
"hcp_date_of_birth_1",
|
|
633
|
+
"hcp_date_of_birth_2",
|
|
634
|
+
"hcp_date_of_birth_3",
|
|
635
|
+
"hcp_date_of_birth_4",
|
|
636
|
+
"hcp_date_of_birth_5",
|
|
637
|
+
"hcp_date_of_birth_6",
|
|
638
|
+
"hcp_date_of_birth_7",
|
|
639
|
+
"hcp_date_of_birth_8",
|
|
640
|
+
"hcp_date_of_birth_9",
|
|
641
|
+
"hcp_date_of_birth_10",
|
|
642
|
+
"sof_previous_claims_yes",
|
|
643
|
+
"sof_previous_claims_no",
|
|
644
|
+
"sof_claims_yes",
|
|
645
|
+
"sof_claims_no",
|
|
646
|
+
"sof_property_claims_in_the_last_5_years_yes",
|
|
647
|
+
"sof_property_claims_in_the_last_5_years_no",
|
|
648
|
+
"sof_property_claims_in_the_last_0_to_4_years_yes",
|
|
649
|
+
"sof_property_claims_in_the_last_0_to_4_years_no",
|
|
650
|
+
"claim_count",
|
|
651
|
+
"sof_number_of_claims",
|
|
652
|
+
"number_of_claims_in_last_5_years",
|
|
653
|
+
"number_of_claims_in_time_owned",
|
|
654
|
+
"date_of_incident_1",
|
|
655
|
+
"date_of_incident_2",
|
|
656
|
+
"date_of_incident_3",
|
|
657
|
+
"date_of_incident_4",
|
|
658
|
+
"date_of_incident_5",
|
|
659
|
+
"type_of_incident_1",
|
|
660
|
+
"type_of_incident_2",
|
|
661
|
+
"type_of_incident_3",
|
|
662
|
+
"type_of_incident_4",
|
|
663
|
+
"type_of_incident_5",
|
|
664
|
+
"incident_value_1",
|
|
665
|
+
"incident_value_2",
|
|
666
|
+
"incident_value_3",
|
|
667
|
+
"incident_value_4",
|
|
668
|
+
"incident_value_5",
|
|
669
|
+
"sof_pollution_disease_claims_yes",
|
|
670
|
+
"sof_pollution_disease_claims_no",
|
|
671
|
+
"sof_potential_claims_yes",
|
|
672
|
+
"sof_potential_claims_no",
|
|
673
|
+
"sof_previous_circumstances_yes",
|
|
674
|
+
"sof_previous_circumstances_no",
|
|
675
|
+
"sof_possible_claims_yes",
|
|
676
|
+
"sof_possible_claims_no",
|
|
677
|
+
"date_of_possible_incident",
|
|
678
|
+
"type_of_possible_incident",
|
|
679
|
+
"possible_incident_value",
|
|
680
|
+
"sof_property_claims_yes",
|
|
681
|
+
"sof_property_claims_no",
|
|
682
|
+
"sof_liability_claims_yes",
|
|
683
|
+
"sof_liability_claims_no",
|
|
684
|
+
"van_registration",
|
|
685
|
+
"sof_disqualified_director_yes",
|
|
686
|
+
"sof_disqualified_director_no",
|
|
687
|
+
"sof_insurance_refused_yes",
|
|
688
|
+
"sof_insurance_refused_no",
|
|
689
|
+
"sof_insurance_declined_yes",
|
|
690
|
+
"sof_insurance_declined_no",
|
|
691
|
+
"insurance_refused"
|
|
692
|
+
];
|
|
693
|
+
var RADIO_ANSWER_FROM_QUESTIONS = [
|
|
694
|
+
"have_secondary_trade_yes",
|
|
695
|
+
"have_secondary_trade_no"
|
|
696
|
+
];
|
|
697
|
+
var ANSWER_SUFFIX_PATTERN = /_(yes|no)$/;
|
|
698
|
+
var redact = (params) => {
|
|
699
|
+
let { question, answer } = params;
|
|
700
|
+
const piiAnswer = new Set(PII_ANSWER);
|
|
701
|
+
const radioAnswerFromQuestions = new Set(RADIO_ANSWER_FROM_QUESTIONS);
|
|
702
|
+
if (piiAnswer.has(question)) {
|
|
703
|
+
answer = "REDACTED";
|
|
704
|
+
question = question?.replace(ANSWER_SUFFIX_PATTERN, "");
|
|
705
|
+
} else if (radioAnswerFromQuestions.has(question)) {
|
|
706
|
+
question = question?.replace(ANSWER_SUFFIX_PATTERN, "");
|
|
707
|
+
}
|
|
708
|
+
return { question, answer };
|
|
709
|
+
};
|
|
710
|
+
|
|
769
711
|
// src/snowplow/event-definitions/questionnaire/questionnaire.ts
|
|
770
712
|
var questionnaireEventDefinitions = [
|
|
771
713
|
{
|
|
@@ -1165,10 +1107,6 @@ var referralPageEvents = [
|
|
|
1165
1107
|
...baseEventDefinitions,
|
|
1166
1108
|
...referralEventDefinitions
|
|
1167
1109
|
];
|
|
1168
|
-
var personalisedCoverPageEvents = [
|
|
1169
|
-
...baseEventDefinitions,
|
|
1170
|
-
...personalisedCoverEventDefinitions
|
|
1171
|
-
];
|
|
1172
1110
|
var interventionPageEvents = [...interventionEventDefinitions];
|
|
1173
1111
|
var questionnairePageEvents = [...questionnaireEventDefinitions];
|
|
1174
1112
|
var coverageSelectionPageEvents = [
|