@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
|
@@ -28,7 +28,6 @@ __export(snowplow_exports, {
|
|
|
28
28
|
getSnowplowConfig: () => getSnowplowConfig,
|
|
29
29
|
interventionPageEvents: () => interventionPageEvents,
|
|
30
30
|
makeContexts: () => makeContexts,
|
|
31
|
-
personalisedCoverPageEvents: () => personalisedCoverPageEvents,
|
|
32
31
|
qcpPageEvents: () => qcpPageEvents,
|
|
33
32
|
questionnairePageEvents: () => questionnairePageEvents,
|
|
34
33
|
referralPageEvents: () => referralPageEvents,
|
|
@@ -208,150 +207,6 @@ var interventionEventDefinitions = [
|
|
|
208
207
|
}
|
|
209
208
|
];
|
|
210
209
|
|
|
211
|
-
// src/snowplow/constants.ts
|
|
212
|
-
var DELIMITER = "|";
|
|
213
|
-
|
|
214
|
-
// src/snowplow/event-definitions/questionnaire/redaction.ts
|
|
215
|
-
var PII_ANSWER = [
|
|
216
|
-
"customer_title",
|
|
217
|
-
"customer_first_name",
|
|
218
|
-
"customer_last_name",
|
|
219
|
-
"customer_email_address",
|
|
220
|
-
"preapp_email_address",
|
|
221
|
-
"customer_telephone_number",
|
|
222
|
-
"customer_alternative_telephone_number",
|
|
223
|
-
"uk_address_lookup",
|
|
224
|
-
"uk_correspondence_address_lookup",
|
|
225
|
-
"customer_address_1_pre_quote",
|
|
226
|
-
"customer_address_2_pre_quote",
|
|
227
|
-
"customer_town_pre_quote",
|
|
228
|
-
"customer_postcode_pre_quote",
|
|
229
|
-
"customer_address_1",
|
|
230
|
-
"customer_address_2",
|
|
231
|
-
"customer_town",
|
|
232
|
-
"customer_postcode",
|
|
233
|
-
"address_1_pre_quote",
|
|
234
|
-
"address_2_pre_quote",
|
|
235
|
-
"uk_postcode_pre_quote",
|
|
236
|
-
"town_pre_quote",
|
|
237
|
-
"owner_first_name",
|
|
238
|
-
"owner_last_name",
|
|
239
|
-
"beneficiary_first_name",
|
|
240
|
-
"beneficiary_last_name",
|
|
241
|
-
"gender",
|
|
242
|
-
"dynamic_ssn_fein",
|
|
243
|
-
"ssn",
|
|
244
|
-
"fein",
|
|
245
|
-
"sof_county_court_judgement_online_yes",
|
|
246
|
-
"sof_county_court_judgement_online_no",
|
|
247
|
-
"sof_ccj_count",
|
|
248
|
-
"sof_ccj_value",
|
|
249
|
-
"sof_ccj_date",
|
|
250
|
-
"sof_court_judgement_yes",
|
|
251
|
-
"sof_court_judgement_no",
|
|
252
|
-
"ccj_date",
|
|
253
|
-
"sof_single_ccj_no",
|
|
254
|
-
"sof_single_ccj_yes",
|
|
255
|
-
"sof_ccj_yes",
|
|
256
|
-
"sof_ccj_no",
|
|
257
|
-
"ccj_count",
|
|
258
|
-
"sof_bankrupt_yes",
|
|
259
|
-
"sof_bankrupt_no",
|
|
260
|
-
"sof_multiple_bankruptcies_yes",
|
|
261
|
-
"sof_multiple_bankruptcies_no",
|
|
262
|
-
"bankruptcy_date",
|
|
263
|
-
"sof_single_bankruptcy_no",
|
|
264
|
-
"sof_single_bankruptcy_yes",
|
|
265
|
-
"sof_bankruptcy_yes",
|
|
266
|
-
"sof_bankruptcy_no",
|
|
267
|
-
"bankruptcy_discharged",
|
|
268
|
-
"sof_liquidation_yes",
|
|
269
|
-
"sof_liquidation_no",
|
|
270
|
-
"sof_multiple_liquidations",
|
|
271
|
-
"liquidation_date",
|
|
272
|
-
"sof_criminal_offence_yes",
|
|
273
|
-
"sof_criminal_offence_no",
|
|
274
|
-
"sof_criminal_yes",
|
|
275
|
-
"sof_criminal_no",
|
|
276
|
-
"hcp_date_of_birth_1",
|
|
277
|
-
"hcp_date_of_birth_2",
|
|
278
|
-
"hcp_date_of_birth_3",
|
|
279
|
-
"hcp_date_of_birth_4",
|
|
280
|
-
"hcp_date_of_birth_5",
|
|
281
|
-
"hcp_date_of_birth_6",
|
|
282
|
-
"hcp_date_of_birth_7",
|
|
283
|
-
"hcp_date_of_birth_8",
|
|
284
|
-
"hcp_date_of_birth_9",
|
|
285
|
-
"hcp_date_of_birth_10",
|
|
286
|
-
"sof_previous_claims_yes",
|
|
287
|
-
"sof_previous_claims_no",
|
|
288
|
-
"sof_claims_yes",
|
|
289
|
-
"sof_claims_no",
|
|
290
|
-
"sof_property_claims_in_the_last_5_years_yes",
|
|
291
|
-
"sof_property_claims_in_the_last_5_years_no",
|
|
292
|
-
"sof_property_claims_in_the_last_0_to_4_years_yes",
|
|
293
|
-
"sof_property_claims_in_the_last_0_to_4_years_no",
|
|
294
|
-
"claim_count",
|
|
295
|
-
"sof_number_of_claims",
|
|
296
|
-
"number_of_claims_in_last_5_years",
|
|
297
|
-
"number_of_claims_in_time_owned",
|
|
298
|
-
"date_of_incident_1",
|
|
299
|
-
"date_of_incident_2",
|
|
300
|
-
"date_of_incident_3",
|
|
301
|
-
"date_of_incident_4",
|
|
302
|
-
"date_of_incident_5",
|
|
303
|
-
"type_of_incident_1",
|
|
304
|
-
"type_of_incident_2",
|
|
305
|
-
"type_of_incident_3",
|
|
306
|
-
"type_of_incident_4",
|
|
307
|
-
"type_of_incident_5",
|
|
308
|
-
"incident_value_1",
|
|
309
|
-
"incident_value_2",
|
|
310
|
-
"incident_value_3",
|
|
311
|
-
"incident_value_4",
|
|
312
|
-
"incident_value_5",
|
|
313
|
-
"sof_pollution_disease_claims_yes",
|
|
314
|
-
"sof_pollution_disease_claims_no",
|
|
315
|
-
"sof_potential_claims_yes",
|
|
316
|
-
"sof_potential_claims_no",
|
|
317
|
-
"sof_previous_circumstances_yes",
|
|
318
|
-
"sof_previous_circumstances_no",
|
|
319
|
-
"sof_possible_claims_yes",
|
|
320
|
-
"sof_possible_claims_no",
|
|
321
|
-
"date_of_possible_incident",
|
|
322
|
-
"type_of_possible_incident",
|
|
323
|
-
"possible_incident_value",
|
|
324
|
-
"sof_property_claims_yes",
|
|
325
|
-
"sof_property_claims_no",
|
|
326
|
-
"sof_liability_claims_yes",
|
|
327
|
-
"sof_liability_claims_no",
|
|
328
|
-
"van_registration",
|
|
329
|
-
"sof_disqualified_director_yes",
|
|
330
|
-
"sof_disqualified_director_no",
|
|
331
|
-
"sof_insurance_refused_yes",
|
|
332
|
-
"sof_insurance_refused_no",
|
|
333
|
-
"sof_insurance_declined_yes",
|
|
334
|
-
"sof_insurance_declined_no",
|
|
335
|
-
"insurance_refused"
|
|
336
|
-
];
|
|
337
|
-
var RADIO_ANSWER_FROM_QUESTIONS = [
|
|
338
|
-
"have_secondary_trade_yes",
|
|
339
|
-
"have_secondary_trade_no"
|
|
340
|
-
];
|
|
341
|
-
var ANSWER_SUFFIX_PATTERN = /_(yes|no)$/;
|
|
342
|
-
var redact = (params) => {
|
|
343
|
-
let { question, answer } = params;
|
|
344
|
-
const piiAnswer = new Set(PII_ANSWER);
|
|
345
|
-
const radioAnswerFromQuestions = new Set(RADIO_ANSWER_FROM_QUESTIONS);
|
|
346
|
-
if (piiAnswer.has(question)) {
|
|
347
|
-
answer = "REDACTED";
|
|
348
|
-
question = question?.replace(ANSWER_SUFFIX_PATTERN, "");
|
|
349
|
-
} else if (radioAnswerFromQuestions.has(question)) {
|
|
350
|
-
question = question?.replace(ANSWER_SUFFIX_PATTERN, "");
|
|
351
|
-
}
|
|
352
|
-
return { question, answer };
|
|
353
|
-
};
|
|
354
|
-
|
|
355
210
|
// src/snowplow/event-definitions/personalised_cover.ts
|
|
356
211
|
var personalisedCoverEventDefinitions = [
|
|
357
212
|
{
|
|
@@ -364,16 +219,6 @@ var personalisedCoverEventDefinitions = [
|
|
|
364
219
|
property: "personalised_cover"
|
|
365
220
|
})
|
|
366
221
|
},
|
|
367
|
-
{
|
|
368
|
-
name: "selectPackageClicked",
|
|
369
|
-
type: "structured",
|
|
370
|
-
makePayload: (_) => ({
|
|
371
|
-
category: "personalised_cover",
|
|
372
|
-
action: "select_package_clicked",
|
|
373
|
-
label: "page",
|
|
374
|
-
property: "personalised_cover"
|
|
375
|
-
})
|
|
376
|
-
},
|
|
377
222
|
{
|
|
378
223
|
name: "validationShown",
|
|
379
224
|
type: "structured",
|
|
@@ -387,27 +232,6 @@ var personalisedCoverEventDefinitions = [
|
|
|
387
232
|
};
|
|
388
233
|
}
|
|
389
234
|
},
|
|
390
|
-
{
|
|
391
|
-
name: "coverQuestionAnswered",
|
|
392
|
-
type: "unstructured",
|
|
393
|
-
makePayload: (params) => {
|
|
394
|
-
const { context } = params;
|
|
395
|
-
const { question, answer } = redact(params);
|
|
396
|
-
const flatAnswer = Array.isArray(answer) ? answer.join(DELIMITER) : answer;
|
|
397
|
-
return {
|
|
398
|
-
schema: "iglu:com.simplybusiness/form_question_answered/jsonschema/1-0-4",
|
|
399
|
-
data: {
|
|
400
|
-
site: context.site,
|
|
401
|
-
page_name: "personalised_cover",
|
|
402
|
-
section_name: "Personalised Cover Questions",
|
|
403
|
-
question,
|
|
404
|
-
answer: flatAnswer,
|
|
405
|
-
vertical: context.vertical,
|
|
406
|
-
journey_id: context.journeyId
|
|
407
|
-
}
|
|
408
|
-
};
|
|
409
|
-
}
|
|
410
|
-
},
|
|
411
235
|
{
|
|
412
236
|
name: "limitLinkClicked",
|
|
413
237
|
type: "structured",
|
|
@@ -459,32 +283,6 @@ var personalisedCoverEventDefinitions = [
|
|
|
459
283
|
property
|
|
460
284
|
};
|
|
461
285
|
}
|
|
462
|
-
},
|
|
463
|
-
{
|
|
464
|
-
name: "additionalQuestionsClicked",
|
|
465
|
-
type: "structured",
|
|
466
|
-
makePayload: (params) => {
|
|
467
|
-
const { property } = params;
|
|
468
|
-
return {
|
|
469
|
-
category: "personalised_cover",
|
|
470
|
-
action: "cover_details_clicked",
|
|
471
|
-
label: "cover_name",
|
|
472
|
-
property
|
|
473
|
-
};
|
|
474
|
-
}
|
|
475
|
-
},
|
|
476
|
-
{
|
|
477
|
-
name: "chatbotPromptClicked",
|
|
478
|
-
type: "structured",
|
|
479
|
-
makePayload: (params) => {
|
|
480
|
-
const { label, property } = params;
|
|
481
|
-
return {
|
|
482
|
-
category: "personalised_cover",
|
|
483
|
-
action: "chatbot_prompt_clicked",
|
|
484
|
-
label: property,
|
|
485
|
-
property: label
|
|
486
|
-
};
|
|
487
|
-
}
|
|
488
286
|
}
|
|
489
287
|
];
|
|
490
288
|
|
|
@@ -838,6 +636,150 @@ var qcpEventDefinitions = [
|
|
|
838
636
|
}
|
|
839
637
|
];
|
|
840
638
|
|
|
639
|
+
// src/snowplow/constants.ts
|
|
640
|
+
var DELIMITER = "|";
|
|
641
|
+
|
|
642
|
+
// src/snowplow/event-definitions/questionnaire/redaction.ts
|
|
643
|
+
var PII_ANSWER = [
|
|
644
|
+
"customer_title",
|
|
645
|
+
"customer_first_name",
|
|
646
|
+
"customer_last_name",
|
|
647
|
+
"customer_email_address",
|
|
648
|
+
"preapp_email_address",
|
|
649
|
+
"customer_telephone_number",
|
|
650
|
+
"customer_alternative_telephone_number",
|
|
651
|
+
"uk_address_lookup",
|
|
652
|
+
"uk_correspondence_address_lookup",
|
|
653
|
+
"customer_address_1_pre_quote",
|
|
654
|
+
"customer_address_2_pre_quote",
|
|
655
|
+
"customer_town_pre_quote",
|
|
656
|
+
"customer_postcode_pre_quote",
|
|
657
|
+
"customer_address_1",
|
|
658
|
+
"customer_address_2",
|
|
659
|
+
"customer_town",
|
|
660
|
+
"customer_postcode",
|
|
661
|
+
"address_1_pre_quote",
|
|
662
|
+
"address_2_pre_quote",
|
|
663
|
+
"uk_postcode_pre_quote",
|
|
664
|
+
"town_pre_quote",
|
|
665
|
+
"owner_first_name",
|
|
666
|
+
"owner_last_name",
|
|
667
|
+
"beneficiary_first_name",
|
|
668
|
+
"beneficiary_last_name",
|
|
669
|
+
"gender",
|
|
670
|
+
"dynamic_ssn_fein",
|
|
671
|
+
"ssn",
|
|
672
|
+
"fein",
|
|
673
|
+
"sof_county_court_judgement_online_yes",
|
|
674
|
+
"sof_county_court_judgement_online_no",
|
|
675
|
+
"sof_ccj_count",
|
|
676
|
+
"sof_ccj_value",
|
|
677
|
+
"sof_ccj_date",
|
|
678
|
+
"sof_court_judgement_yes",
|
|
679
|
+
"sof_court_judgement_no",
|
|
680
|
+
"ccj_date",
|
|
681
|
+
"sof_single_ccj_no",
|
|
682
|
+
"sof_single_ccj_yes",
|
|
683
|
+
"sof_ccj_yes",
|
|
684
|
+
"sof_ccj_no",
|
|
685
|
+
"ccj_count",
|
|
686
|
+
"sof_bankrupt_yes",
|
|
687
|
+
"sof_bankrupt_no",
|
|
688
|
+
"sof_multiple_bankruptcies_yes",
|
|
689
|
+
"sof_multiple_bankruptcies_no",
|
|
690
|
+
"bankruptcy_date",
|
|
691
|
+
"sof_single_bankruptcy_no",
|
|
692
|
+
"sof_single_bankruptcy_yes",
|
|
693
|
+
"sof_bankruptcy_yes",
|
|
694
|
+
"sof_bankruptcy_no",
|
|
695
|
+
"bankruptcy_discharged",
|
|
696
|
+
"sof_liquidation_yes",
|
|
697
|
+
"sof_liquidation_no",
|
|
698
|
+
"sof_multiple_liquidations",
|
|
699
|
+
"liquidation_date",
|
|
700
|
+
"sof_criminal_offence_yes",
|
|
701
|
+
"sof_criminal_offence_no",
|
|
702
|
+
"sof_criminal_yes",
|
|
703
|
+
"sof_criminal_no",
|
|
704
|
+
"hcp_date_of_birth_1",
|
|
705
|
+
"hcp_date_of_birth_2",
|
|
706
|
+
"hcp_date_of_birth_3",
|
|
707
|
+
"hcp_date_of_birth_4",
|
|
708
|
+
"hcp_date_of_birth_5",
|
|
709
|
+
"hcp_date_of_birth_6",
|
|
710
|
+
"hcp_date_of_birth_7",
|
|
711
|
+
"hcp_date_of_birth_8",
|
|
712
|
+
"hcp_date_of_birth_9",
|
|
713
|
+
"hcp_date_of_birth_10",
|
|
714
|
+
"sof_previous_claims_yes",
|
|
715
|
+
"sof_previous_claims_no",
|
|
716
|
+
"sof_claims_yes",
|
|
717
|
+
"sof_claims_no",
|
|
718
|
+
"sof_property_claims_in_the_last_5_years_yes",
|
|
719
|
+
"sof_property_claims_in_the_last_5_years_no",
|
|
720
|
+
"sof_property_claims_in_the_last_0_to_4_years_yes",
|
|
721
|
+
"sof_property_claims_in_the_last_0_to_4_years_no",
|
|
722
|
+
"claim_count",
|
|
723
|
+
"sof_number_of_claims",
|
|
724
|
+
"number_of_claims_in_last_5_years",
|
|
725
|
+
"number_of_claims_in_time_owned",
|
|
726
|
+
"date_of_incident_1",
|
|
727
|
+
"date_of_incident_2",
|
|
728
|
+
"date_of_incident_3",
|
|
729
|
+
"date_of_incident_4",
|
|
730
|
+
"date_of_incident_5",
|
|
731
|
+
"type_of_incident_1",
|
|
732
|
+
"type_of_incident_2",
|
|
733
|
+
"type_of_incident_3",
|
|
734
|
+
"type_of_incident_4",
|
|
735
|
+
"type_of_incident_5",
|
|
736
|
+
"incident_value_1",
|
|
737
|
+
"incident_value_2",
|
|
738
|
+
"incident_value_3",
|
|
739
|
+
"incident_value_4",
|
|
740
|
+
"incident_value_5",
|
|
741
|
+
"sof_pollution_disease_claims_yes",
|
|
742
|
+
"sof_pollution_disease_claims_no",
|
|
743
|
+
"sof_potential_claims_yes",
|
|
744
|
+
"sof_potential_claims_no",
|
|
745
|
+
"sof_previous_circumstances_yes",
|
|
746
|
+
"sof_previous_circumstances_no",
|
|
747
|
+
"sof_possible_claims_yes",
|
|
748
|
+
"sof_possible_claims_no",
|
|
749
|
+
"date_of_possible_incident",
|
|
750
|
+
"type_of_possible_incident",
|
|
751
|
+
"possible_incident_value",
|
|
752
|
+
"sof_property_claims_yes",
|
|
753
|
+
"sof_property_claims_no",
|
|
754
|
+
"sof_liability_claims_yes",
|
|
755
|
+
"sof_liability_claims_no",
|
|
756
|
+
"van_registration",
|
|
757
|
+
"sof_disqualified_director_yes",
|
|
758
|
+
"sof_disqualified_director_no",
|
|
759
|
+
"sof_insurance_refused_yes",
|
|
760
|
+
"sof_insurance_refused_no",
|
|
761
|
+
"sof_insurance_declined_yes",
|
|
762
|
+
"sof_insurance_declined_no",
|
|
763
|
+
"insurance_refused"
|
|
764
|
+
];
|
|
765
|
+
var RADIO_ANSWER_FROM_QUESTIONS = [
|
|
766
|
+
"have_secondary_trade_yes",
|
|
767
|
+
"have_secondary_trade_no"
|
|
768
|
+
];
|
|
769
|
+
var ANSWER_SUFFIX_PATTERN = /_(yes|no)$/;
|
|
770
|
+
var redact = (params) => {
|
|
771
|
+
let { question, answer } = params;
|
|
772
|
+
const piiAnswer = new Set(PII_ANSWER);
|
|
773
|
+
const radioAnswerFromQuestions = new Set(RADIO_ANSWER_FROM_QUESTIONS);
|
|
774
|
+
if (piiAnswer.has(question)) {
|
|
775
|
+
answer = "REDACTED";
|
|
776
|
+
question = question?.replace(ANSWER_SUFFIX_PATTERN, "");
|
|
777
|
+
} else if (radioAnswerFromQuestions.has(question)) {
|
|
778
|
+
question = question?.replace(ANSWER_SUFFIX_PATTERN, "");
|
|
779
|
+
}
|
|
780
|
+
return { question, answer };
|
|
781
|
+
};
|
|
782
|
+
|
|
841
783
|
// src/snowplow/event-definitions/questionnaire/questionnaire.ts
|
|
842
784
|
var questionnaireEventDefinitions = [
|
|
843
785
|
{
|
|
@@ -1237,10 +1179,6 @@ var referralPageEvents = [
|
|
|
1237
1179
|
...baseEventDefinitions,
|
|
1238
1180
|
...referralEventDefinitions
|
|
1239
1181
|
];
|
|
1240
|
-
var personalisedCoverPageEvents = [
|
|
1241
|
-
...baseEventDefinitions,
|
|
1242
|
-
...personalisedCoverEventDefinitions
|
|
1243
|
-
];
|
|
1244
1182
|
var interventionPageEvents = [...interventionEventDefinitions];
|
|
1245
1183
|
var questionnairePageEvents = [...questionnaireEventDefinitions];
|
|
1246
1184
|
var coverageSelectionPageEvents = [
|