@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.
Files changed (34) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/cjs/index.js +144 -206
  3. package/dist/cjs/index.js.map +3 -3
  4. package/dist/cjs/meta.json +62 -78
  5. package/dist/cjs/snowplow/SnowplowContext.js +144 -205
  6. package/dist/cjs/snowplow/SnowplowContext.js.map +3 -3
  7. package/dist/cjs/snowplow/event-definitions/index.js +144 -206
  8. package/dist/cjs/snowplow/event-definitions/index.js.map +3 -3
  9. package/dist/cjs/snowplow/event-definitions/personalised_cover.js +0 -201
  10. package/dist/cjs/snowplow/event-definitions/personalised_cover.js.map +3 -3
  11. package/dist/cjs/snowplow/index.js +144 -206
  12. package/dist/cjs/snowplow/index.js.map +3 -3
  13. package/dist/cjs/utils/testUtils.js +144 -205
  14. package/dist/cjs/utils/testUtils.js.map +3 -3
  15. package/dist/esm/{chunk-3JWAIW5L.js → chunk-FMM4S4JB.js} +2 -7
  16. package/dist/esm/{chunk-3JWAIW5L.js.map → chunk-FMM4S4JB.js.map} +2 -2
  17. package/dist/esm/{chunk-3SO3SL37.js → chunk-HFULBVWF.js} +1 -64
  18. package/dist/esm/chunk-HFULBVWF.js.map +7 -0
  19. package/dist/esm/{chunk-TRQ236KL.js → chunk-YXKJJ7B7.js} +2 -2
  20. package/dist/esm/index.js +3 -5
  21. package/dist/esm/meta.json +45 -75
  22. package/dist/esm/snowplow/SnowplowContext.js +3 -3
  23. package/dist/esm/snowplow/event-definitions/index.js +2 -4
  24. package/dist/esm/snowplow/event-definitions/personalised_cover.js +1 -3
  25. package/dist/esm/snowplow/index.js +3 -5
  26. package/dist/esm/utils/testUtils.js +3 -3
  27. package/dist/tsconfig.build.tsbuildinfo +1 -1
  28. package/dist/types/snowplow/event-definitions/index.d.ts +0 -1
  29. package/package.json +1 -1
  30. package/src/snowplow/event-definitions/index.ts +0 -5
  31. package/src/snowplow/event-definitions/personalised_cover.test.ts +0 -182
  32. package/src/snowplow/event-definitions/personalised_cover.ts +0 -66
  33. package/dist/esm/chunk-3SO3SL37.js.map +0 -7
  34. /package/dist/esm/{chunk-TRQ236KL.js.map → chunk-YXKJJ7B7.js.map} +0 -0
@@ -243,150 +243,6 @@ var interventionEventDefinitions = [
243
243
  }
244
244
  ];
245
245
 
246
- // src/snowplow/constants.ts
247
- var DELIMITER = "|";
248
-
249
- // src/snowplow/event-definitions/questionnaire/redaction.ts
250
- var PII_ANSWER = [
251
- "customer_title",
252
- "customer_first_name",
253
- "customer_last_name",
254
- "customer_email_address",
255
- "preapp_email_address",
256
- "customer_telephone_number",
257
- "customer_alternative_telephone_number",
258
- "uk_address_lookup",
259
- "uk_correspondence_address_lookup",
260
- "customer_address_1_pre_quote",
261
- "customer_address_2_pre_quote",
262
- "customer_town_pre_quote",
263
- "customer_postcode_pre_quote",
264
- "customer_address_1",
265
- "customer_address_2",
266
- "customer_town",
267
- "customer_postcode",
268
- "address_1_pre_quote",
269
- "address_2_pre_quote",
270
- "uk_postcode_pre_quote",
271
- "town_pre_quote",
272
- "owner_first_name",
273
- "owner_last_name",
274
- "beneficiary_first_name",
275
- "beneficiary_last_name",
276
- "gender",
277
- "dynamic_ssn_fein",
278
- "ssn",
279
- "fein",
280
- "sof_county_court_judgement_online_yes",
281
- "sof_county_court_judgement_online_no",
282
- "sof_ccj_count",
283
- "sof_ccj_value",
284
- "sof_ccj_date",
285
- "sof_court_judgement_yes",
286
- "sof_court_judgement_no",
287
- "ccj_date",
288
- "sof_single_ccj_no",
289
- "sof_single_ccj_yes",
290
- "sof_ccj_yes",
291
- "sof_ccj_no",
292
- "ccj_count",
293
- "sof_bankrupt_yes",
294
- "sof_bankrupt_no",
295
- "sof_multiple_bankruptcies_yes",
296
- "sof_multiple_bankruptcies_no",
297
- "bankruptcy_date",
298
- "sof_single_bankruptcy_no",
299
- "sof_single_bankruptcy_yes",
300
- "sof_bankruptcy_yes",
301
- "sof_bankruptcy_no",
302
- "bankruptcy_discharged",
303
- "sof_liquidation_yes",
304
- "sof_liquidation_no",
305
- "sof_multiple_liquidations",
306
- "liquidation_date",
307
- "sof_criminal_offence_yes",
308
- "sof_criminal_offence_no",
309
- "sof_criminal_yes",
310
- "sof_criminal_no",
311
- "hcp_date_of_birth_1",
312
- "hcp_date_of_birth_2",
313
- "hcp_date_of_birth_3",
314
- "hcp_date_of_birth_4",
315
- "hcp_date_of_birth_5",
316
- "hcp_date_of_birth_6",
317
- "hcp_date_of_birth_7",
318
- "hcp_date_of_birth_8",
319
- "hcp_date_of_birth_9",
320
- "hcp_date_of_birth_10",
321
- "sof_previous_claims_yes",
322
- "sof_previous_claims_no",
323
- "sof_claims_yes",
324
- "sof_claims_no",
325
- "sof_property_claims_in_the_last_5_years_yes",
326
- "sof_property_claims_in_the_last_5_years_no",
327
- "sof_property_claims_in_the_last_0_to_4_years_yes",
328
- "sof_property_claims_in_the_last_0_to_4_years_no",
329
- "claim_count",
330
- "sof_number_of_claims",
331
- "number_of_claims_in_last_5_years",
332
- "number_of_claims_in_time_owned",
333
- "date_of_incident_1",
334
- "date_of_incident_2",
335
- "date_of_incident_3",
336
- "date_of_incident_4",
337
- "date_of_incident_5",
338
- "type_of_incident_1",
339
- "type_of_incident_2",
340
- "type_of_incident_3",
341
- "type_of_incident_4",
342
- "type_of_incident_5",
343
- "incident_value_1",
344
- "incident_value_2",
345
- "incident_value_3",
346
- "incident_value_4",
347
- "incident_value_5",
348
- "sof_pollution_disease_claims_yes",
349
- "sof_pollution_disease_claims_no",
350
- "sof_potential_claims_yes",
351
- "sof_potential_claims_no",
352
- "sof_previous_circumstances_yes",
353
- "sof_previous_circumstances_no",
354
- "sof_possible_claims_yes",
355
- "sof_possible_claims_no",
356
- "date_of_possible_incident",
357
- "type_of_possible_incident",
358
- "possible_incident_value",
359
- "sof_property_claims_yes",
360
- "sof_property_claims_no",
361
- "sof_liability_claims_yes",
362
- "sof_liability_claims_no",
363
- "van_registration",
364
- "sof_disqualified_director_yes",
365
- "sof_disqualified_director_no",
366
- "sof_insurance_refused_yes",
367
- "sof_insurance_refused_no",
368
- "sof_insurance_declined_yes",
369
- "sof_insurance_declined_no",
370
- "insurance_refused"
371
- ];
372
- var RADIO_ANSWER_FROM_QUESTIONS = [
373
- "have_secondary_trade_yes",
374
- "have_secondary_trade_no"
375
- ];
376
- var ANSWER_SUFFIX_PATTERN = /_(yes|no)$/;
377
- var redact = (params) => {
378
- let { question, answer } = params;
379
- const piiAnswer = new Set(PII_ANSWER);
380
- const radioAnswerFromQuestions = new Set(RADIO_ANSWER_FROM_QUESTIONS);
381
- if (piiAnswer.has(question)) {
382
- answer = "REDACTED";
383
- question = question?.replace(ANSWER_SUFFIX_PATTERN, "");
384
- } else if (radioAnswerFromQuestions.has(question)) {
385
- question = question?.replace(ANSWER_SUFFIX_PATTERN, "");
386
- }
387
- return { question, answer };
388
- };
389
-
390
246
  // src/snowplow/event-definitions/personalised_cover.ts
391
247
  var personalisedCoverEventDefinitions = [
392
248
  {
@@ -399,16 +255,6 @@ var personalisedCoverEventDefinitions = [
399
255
  property: "personalised_cover"
400
256
  })
401
257
  },
402
- {
403
- name: "selectPackageClicked",
404
- type: "structured",
405
- makePayload: (_) => ({
406
- category: "personalised_cover",
407
- action: "select_package_clicked",
408
- label: "page",
409
- property: "personalised_cover"
410
- })
411
- },
412
258
  {
413
259
  name: "validationShown",
414
260
  type: "structured",
@@ -422,27 +268,6 @@ var personalisedCoverEventDefinitions = [
422
268
  };
423
269
  }
424
270
  },
425
- {
426
- name: "coverQuestionAnswered",
427
- type: "unstructured",
428
- makePayload: (params) => {
429
- const { context } = params;
430
- const { question, answer } = redact(params);
431
- const flatAnswer = Array.isArray(answer) ? answer.join(DELIMITER) : answer;
432
- return {
433
- schema: "iglu:com.simplybusiness/form_question_answered/jsonschema/1-0-4",
434
- data: {
435
- site: context.site,
436
- page_name: "personalised_cover",
437
- section_name: "Personalised Cover Questions",
438
- question,
439
- answer: flatAnswer,
440
- vertical: context.vertical,
441
- journey_id: context.journeyId
442
- }
443
- };
444
- }
445
- },
446
271
  {
447
272
  name: "limitLinkClicked",
448
273
  type: "structured",
@@ -494,32 +319,6 @@ var personalisedCoverEventDefinitions = [
494
319
  property
495
320
  };
496
321
  }
497
- },
498
- {
499
- name: "additionalQuestionsClicked",
500
- type: "structured",
501
- makePayload: (params) => {
502
- const { property } = params;
503
- return {
504
- category: "personalised_cover",
505
- action: "cover_details_clicked",
506
- label: "cover_name",
507
- property
508
- };
509
- }
510
- },
511
- {
512
- name: "chatbotPromptClicked",
513
- type: "structured",
514
- makePayload: (params) => {
515
- const { label, property } = params;
516
- return {
517
- category: "personalised_cover",
518
- action: "chatbot_prompt_clicked",
519
- label: property,
520
- property: label
521
- };
522
- }
523
322
  }
524
323
  ];
525
324
 
@@ -873,6 +672,150 @@ var qcpEventDefinitions = [
873
672
  }
874
673
  ];
875
674
 
675
+ // src/snowplow/constants.ts
676
+ var DELIMITER = "|";
677
+
678
+ // src/snowplow/event-definitions/questionnaire/redaction.ts
679
+ var PII_ANSWER = [
680
+ "customer_title",
681
+ "customer_first_name",
682
+ "customer_last_name",
683
+ "customer_email_address",
684
+ "preapp_email_address",
685
+ "customer_telephone_number",
686
+ "customer_alternative_telephone_number",
687
+ "uk_address_lookup",
688
+ "uk_correspondence_address_lookup",
689
+ "customer_address_1_pre_quote",
690
+ "customer_address_2_pre_quote",
691
+ "customer_town_pre_quote",
692
+ "customer_postcode_pre_quote",
693
+ "customer_address_1",
694
+ "customer_address_2",
695
+ "customer_town",
696
+ "customer_postcode",
697
+ "address_1_pre_quote",
698
+ "address_2_pre_quote",
699
+ "uk_postcode_pre_quote",
700
+ "town_pre_quote",
701
+ "owner_first_name",
702
+ "owner_last_name",
703
+ "beneficiary_first_name",
704
+ "beneficiary_last_name",
705
+ "gender",
706
+ "dynamic_ssn_fein",
707
+ "ssn",
708
+ "fein",
709
+ "sof_county_court_judgement_online_yes",
710
+ "sof_county_court_judgement_online_no",
711
+ "sof_ccj_count",
712
+ "sof_ccj_value",
713
+ "sof_ccj_date",
714
+ "sof_court_judgement_yes",
715
+ "sof_court_judgement_no",
716
+ "ccj_date",
717
+ "sof_single_ccj_no",
718
+ "sof_single_ccj_yes",
719
+ "sof_ccj_yes",
720
+ "sof_ccj_no",
721
+ "ccj_count",
722
+ "sof_bankrupt_yes",
723
+ "sof_bankrupt_no",
724
+ "sof_multiple_bankruptcies_yes",
725
+ "sof_multiple_bankruptcies_no",
726
+ "bankruptcy_date",
727
+ "sof_single_bankruptcy_no",
728
+ "sof_single_bankruptcy_yes",
729
+ "sof_bankruptcy_yes",
730
+ "sof_bankruptcy_no",
731
+ "bankruptcy_discharged",
732
+ "sof_liquidation_yes",
733
+ "sof_liquidation_no",
734
+ "sof_multiple_liquidations",
735
+ "liquidation_date",
736
+ "sof_criminal_offence_yes",
737
+ "sof_criminal_offence_no",
738
+ "sof_criminal_yes",
739
+ "sof_criminal_no",
740
+ "hcp_date_of_birth_1",
741
+ "hcp_date_of_birth_2",
742
+ "hcp_date_of_birth_3",
743
+ "hcp_date_of_birth_4",
744
+ "hcp_date_of_birth_5",
745
+ "hcp_date_of_birth_6",
746
+ "hcp_date_of_birth_7",
747
+ "hcp_date_of_birth_8",
748
+ "hcp_date_of_birth_9",
749
+ "hcp_date_of_birth_10",
750
+ "sof_previous_claims_yes",
751
+ "sof_previous_claims_no",
752
+ "sof_claims_yes",
753
+ "sof_claims_no",
754
+ "sof_property_claims_in_the_last_5_years_yes",
755
+ "sof_property_claims_in_the_last_5_years_no",
756
+ "sof_property_claims_in_the_last_0_to_4_years_yes",
757
+ "sof_property_claims_in_the_last_0_to_4_years_no",
758
+ "claim_count",
759
+ "sof_number_of_claims",
760
+ "number_of_claims_in_last_5_years",
761
+ "number_of_claims_in_time_owned",
762
+ "date_of_incident_1",
763
+ "date_of_incident_2",
764
+ "date_of_incident_3",
765
+ "date_of_incident_4",
766
+ "date_of_incident_5",
767
+ "type_of_incident_1",
768
+ "type_of_incident_2",
769
+ "type_of_incident_3",
770
+ "type_of_incident_4",
771
+ "type_of_incident_5",
772
+ "incident_value_1",
773
+ "incident_value_2",
774
+ "incident_value_3",
775
+ "incident_value_4",
776
+ "incident_value_5",
777
+ "sof_pollution_disease_claims_yes",
778
+ "sof_pollution_disease_claims_no",
779
+ "sof_potential_claims_yes",
780
+ "sof_potential_claims_no",
781
+ "sof_previous_circumstances_yes",
782
+ "sof_previous_circumstances_no",
783
+ "sof_possible_claims_yes",
784
+ "sof_possible_claims_no",
785
+ "date_of_possible_incident",
786
+ "type_of_possible_incident",
787
+ "possible_incident_value",
788
+ "sof_property_claims_yes",
789
+ "sof_property_claims_no",
790
+ "sof_liability_claims_yes",
791
+ "sof_liability_claims_no",
792
+ "van_registration",
793
+ "sof_disqualified_director_yes",
794
+ "sof_disqualified_director_no",
795
+ "sof_insurance_refused_yes",
796
+ "sof_insurance_refused_no",
797
+ "sof_insurance_declined_yes",
798
+ "sof_insurance_declined_no",
799
+ "insurance_refused"
800
+ ];
801
+ var RADIO_ANSWER_FROM_QUESTIONS = [
802
+ "have_secondary_trade_yes",
803
+ "have_secondary_trade_no"
804
+ ];
805
+ var ANSWER_SUFFIX_PATTERN = /_(yes|no)$/;
806
+ var redact = (params) => {
807
+ let { question, answer } = params;
808
+ const piiAnswer = new Set(PII_ANSWER);
809
+ const radioAnswerFromQuestions = new Set(RADIO_ANSWER_FROM_QUESTIONS);
810
+ if (piiAnswer.has(question)) {
811
+ answer = "REDACTED";
812
+ question = question?.replace(ANSWER_SUFFIX_PATTERN, "");
813
+ } else if (radioAnswerFromQuestions.has(question)) {
814
+ question = question?.replace(ANSWER_SUFFIX_PATTERN, "");
815
+ }
816
+ return { question, answer };
817
+ };
818
+
876
819
  // src/snowplow/event-definitions/questionnaire/questionnaire.ts
877
820
  var questionnaireEventDefinitions = [
878
821
  {
@@ -1272,10 +1215,6 @@ var referralPageEvents = [
1272
1215
  ...baseEventDefinitions,
1273
1216
  ...referralEventDefinitions
1274
1217
  ];
1275
- var personalisedCoverPageEvents = [
1276
- ...baseEventDefinitions,
1277
- ...personalisedCoverEventDefinitions
1278
- ];
1279
1218
  var interventionPageEvents = [...interventionEventDefinitions];
1280
1219
  var questionnairePageEvents = [...questionnaireEventDefinitions];
1281
1220
  var coverageSelectionPageEvents = [