@simplybusiness/services 2.5.1 → 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 +14 -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 +2 -2
  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
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 80fc162: remove legacy pcp
8
+
9
+ ## 2.5.2
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies [5e19535]
14
+ - Updated dependencies [425cab4]
15
+ - @simplybusiness/mobius@10.2.0
16
+
3
17
  ## 2.5.1
4
18
 
5
19
  ### Patch Changes
package/dist/cjs/index.js CHANGED
@@ -31,7 +31,6 @@ __export(src_exports, {
31
31
  getSnowplowConfig: () => getSnowplowConfig,
32
32
  interventionPageEvents: () => interventionPageEvents,
33
33
  makeContexts: () => makeContexts,
34
- personalisedCoverPageEvents: () => personalisedCoverPageEvents,
35
34
  qcpPageEvents: () => qcpPageEvents,
36
35
  questionnairePageEvents: () => questionnairePageEvents,
37
36
  referralPageEvents: () => referralPageEvents,
@@ -320,150 +319,6 @@ var interventionEventDefinitions = [
320
319
  }
321
320
  ];
322
321
 
323
- // src/snowplow/constants.ts
324
- var DELIMITER = "|";
325
-
326
- // src/snowplow/event-definitions/questionnaire/redaction.ts
327
- var PII_ANSWER = [
328
- "customer_title",
329
- "customer_first_name",
330
- "customer_last_name",
331
- "customer_email_address",
332
- "preapp_email_address",
333
- "customer_telephone_number",
334
- "customer_alternative_telephone_number",
335
- "uk_address_lookup",
336
- "uk_correspondence_address_lookup",
337
- "customer_address_1_pre_quote",
338
- "customer_address_2_pre_quote",
339
- "customer_town_pre_quote",
340
- "customer_postcode_pre_quote",
341
- "customer_address_1",
342
- "customer_address_2",
343
- "customer_town",
344
- "customer_postcode",
345
- "address_1_pre_quote",
346
- "address_2_pre_quote",
347
- "uk_postcode_pre_quote",
348
- "town_pre_quote",
349
- "owner_first_name",
350
- "owner_last_name",
351
- "beneficiary_first_name",
352
- "beneficiary_last_name",
353
- "gender",
354
- "dynamic_ssn_fein",
355
- "ssn",
356
- "fein",
357
- "sof_county_court_judgement_online_yes",
358
- "sof_county_court_judgement_online_no",
359
- "sof_ccj_count",
360
- "sof_ccj_value",
361
- "sof_ccj_date",
362
- "sof_court_judgement_yes",
363
- "sof_court_judgement_no",
364
- "ccj_date",
365
- "sof_single_ccj_no",
366
- "sof_single_ccj_yes",
367
- "sof_ccj_yes",
368
- "sof_ccj_no",
369
- "ccj_count",
370
- "sof_bankrupt_yes",
371
- "sof_bankrupt_no",
372
- "sof_multiple_bankruptcies_yes",
373
- "sof_multiple_bankruptcies_no",
374
- "bankruptcy_date",
375
- "sof_single_bankruptcy_no",
376
- "sof_single_bankruptcy_yes",
377
- "sof_bankruptcy_yes",
378
- "sof_bankruptcy_no",
379
- "bankruptcy_discharged",
380
- "sof_liquidation_yes",
381
- "sof_liquidation_no",
382
- "sof_multiple_liquidations",
383
- "liquidation_date",
384
- "sof_criminal_offence_yes",
385
- "sof_criminal_offence_no",
386
- "sof_criminal_yes",
387
- "sof_criminal_no",
388
- "hcp_date_of_birth_1",
389
- "hcp_date_of_birth_2",
390
- "hcp_date_of_birth_3",
391
- "hcp_date_of_birth_4",
392
- "hcp_date_of_birth_5",
393
- "hcp_date_of_birth_6",
394
- "hcp_date_of_birth_7",
395
- "hcp_date_of_birth_8",
396
- "hcp_date_of_birth_9",
397
- "hcp_date_of_birth_10",
398
- "sof_previous_claims_yes",
399
- "sof_previous_claims_no",
400
- "sof_claims_yes",
401
- "sof_claims_no",
402
- "sof_property_claims_in_the_last_5_years_yes",
403
- "sof_property_claims_in_the_last_5_years_no",
404
- "sof_property_claims_in_the_last_0_to_4_years_yes",
405
- "sof_property_claims_in_the_last_0_to_4_years_no",
406
- "claim_count",
407
- "sof_number_of_claims",
408
- "number_of_claims_in_last_5_years",
409
- "number_of_claims_in_time_owned",
410
- "date_of_incident_1",
411
- "date_of_incident_2",
412
- "date_of_incident_3",
413
- "date_of_incident_4",
414
- "date_of_incident_5",
415
- "type_of_incident_1",
416
- "type_of_incident_2",
417
- "type_of_incident_3",
418
- "type_of_incident_4",
419
- "type_of_incident_5",
420
- "incident_value_1",
421
- "incident_value_2",
422
- "incident_value_3",
423
- "incident_value_4",
424
- "incident_value_5",
425
- "sof_pollution_disease_claims_yes",
426
- "sof_pollution_disease_claims_no",
427
- "sof_potential_claims_yes",
428
- "sof_potential_claims_no",
429
- "sof_previous_circumstances_yes",
430
- "sof_previous_circumstances_no",
431
- "sof_possible_claims_yes",
432
- "sof_possible_claims_no",
433
- "date_of_possible_incident",
434
- "type_of_possible_incident",
435
- "possible_incident_value",
436
- "sof_property_claims_yes",
437
- "sof_property_claims_no",
438
- "sof_liability_claims_yes",
439
- "sof_liability_claims_no",
440
- "van_registration",
441
- "sof_disqualified_director_yes",
442
- "sof_disqualified_director_no",
443
- "sof_insurance_refused_yes",
444
- "sof_insurance_refused_no",
445
- "sof_insurance_declined_yes",
446
- "sof_insurance_declined_no",
447
- "insurance_refused"
448
- ];
449
- var RADIO_ANSWER_FROM_QUESTIONS = [
450
- "have_secondary_trade_yes",
451
- "have_secondary_trade_no"
452
- ];
453
- var ANSWER_SUFFIX_PATTERN = /_(yes|no)$/;
454
- var redact = (params) => {
455
- let { question, answer } = params;
456
- const piiAnswer = new Set(PII_ANSWER);
457
- const radioAnswerFromQuestions = new Set(RADIO_ANSWER_FROM_QUESTIONS);
458
- if (piiAnswer.has(question)) {
459
- answer = "REDACTED";
460
- question = question?.replace(ANSWER_SUFFIX_PATTERN, "");
461
- } else if (radioAnswerFromQuestions.has(question)) {
462
- question = question?.replace(ANSWER_SUFFIX_PATTERN, "");
463
- }
464
- return { question, answer };
465
- };
466
-
467
322
  // src/snowplow/event-definitions/personalised_cover.ts
468
323
  var personalisedCoverEventDefinitions = [
469
324
  {
@@ -476,16 +331,6 @@ var personalisedCoverEventDefinitions = [
476
331
  property: "personalised_cover"
477
332
  })
478
333
  },
479
- {
480
- name: "selectPackageClicked",
481
- type: "structured",
482
- makePayload: (_) => ({
483
- category: "personalised_cover",
484
- action: "select_package_clicked",
485
- label: "page",
486
- property: "personalised_cover"
487
- })
488
- },
489
334
  {
490
335
  name: "validationShown",
491
336
  type: "structured",
@@ -499,27 +344,6 @@ var personalisedCoverEventDefinitions = [
499
344
  };
500
345
  }
501
346
  },
502
- {
503
- name: "coverQuestionAnswered",
504
- type: "unstructured",
505
- makePayload: (params) => {
506
- const { context } = params;
507
- const { question, answer } = redact(params);
508
- const flatAnswer = Array.isArray(answer) ? answer.join(DELIMITER) : answer;
509
- return {
510
- schema: "iglu:com.simplybusiness/form_question_answered/jsonschema/1-0-4",
511
- data: {
512
- site: context.site,
513
- page_name: "personalised_cover",
514
- section_name: "Personalised Cover Questions",
515
- question,
516
- answer: flatAnswer,
517
- vertical: context.vertical,
518
- journey_id: context.journeyId
519
- }
520
- };
521
- }
522
- },
523
347
  {
524
348
  name: "limitLinkClicked",
525
349
  type: "structured",
@@ -571,32 +395,6 @@ var personalisedCoverEventDefinitions = [
571
395
  property
572
396
  };
573
397
  }
574
- },
575
- {
576
- name: "additionalQuestionsClicked",
577
- type: "structured",
578
- makePayload: (params) => {
579
- const { property } = params;
580
- return {
581
- category: "personalised_cover",
582
- action: "cover_details_clicked",
583
- label: "cover_name",
584
- property
585
- };
586
- }
587
- },
588
- {
589
- name: "chatbotPromptClicked",
590
- type: "structured",
591
- makePayload: (params) => {
592
- const { label, property } = params;
593
- return {
594
- category: "personalised_cover",
595
- action: "chatbot_prompt_clicked",
596
- label: property,
597
- property: label
598
- };
599
- }
600
398
  }
601
399
  ];
602
400
 
@@ -950,6 +748,150 @@ var qcpEventDefinitions = [
950
748
  }
951
749
  ];
952
750
 
751
+ // src/snowplow/constants.ts
752
+ var DELIMITER = "|";
753
+
754
+ // src/snowplow/event-definitions/questionnaire/redaction.ts
755
+ var PII_ANSWER = [
756
+ "customer_title",
757
+ "customer_first_name",
758
+ "customer_last_name",
759
+ "customer_email_address",
760
+ "preapp_email_address",
761
+ "customer_telephone_number",
762
+ "customer_alternative_telephone_number",
763
+ "uk_address_lookup",
764
+ "uk_correspondence_address_lookup",
765
+ "customer_address_1_pre_quote",
766
+ "customer_address_2_pre_quote",
767
+ "customer_town_pre_quote",
768
+ "customer_postcode_pre_quote",
769
+ "customer_address_1",
770
+ "customer_address_2",
771
+ "customer_town",
772
+ "customer_postcode",
773
+ "address_1_pre_quote",
774
+ "address_2_pre_quote",
775
+ "uk_postcode_pre_quote",
776
+ "town_pre_quote",
777
+ "owner_first_name",
778
+ "owner_last_name",
779
+ "beneficiary_first_name",
780
+ "beneficiary_last_name",
781
+ "gender",
782
+ "dynamic_ssn_fein",
783
+ "ssn",
784
+ "fein",
785
+ "sof_county_court_judgement_online_yes",
786
+ "sof_county_court_judgement_online_no",
787
+ "sof_ccj_count",
788
+ "sof_ccj_value",
789
+ "sof_ccj_date",
790
+ "sof_court_judgement_yes",
791
+ "sof_court_judgement_no",
792
+ "ccj_date",
793
+ "sof_single_ccj_no",
794
+ "sof_single_ccj_yes",
795
+ "sof_ccj_yes",
796
+ "sof_ccj_no",
797
+ "ccj_count",
798
+ "sof_bankrupt_yes",
799
+ "sof_bankrupt_no",
800
+ "sof_multiple_bankruptcies_yes",
801
+ "sof_multiple_bankruptcies_no",
802
+ "bankruptcy_date",
803
+ "sof_single_bankruptcy_no",
804
+ "sof_single_bankruptcy_yes",
805
+ "sof_bankruptcy_yes",
806
+ "sof_bankruptcy_no",
807
+ "bankruptcy_discharged",
808
+ "sof_liquidation_yes",
809
+ "sof_liquidation_no",
810
+ "sof_multiple_liquidations",
811
+ "liquidation_date",
812
+ "sof_criminal_offence_yes",
813
+ "sof_criminal_offence_no",
814
+ "sof_criminal_yes",
815
+ "sof_criminal_no",
816
+ "hcp_date_of_birth_1",
817
+ "hcp_date_of_birth_2",
818
+ "hcp_date_of_birth_3",
819
+ "hcp_date_of_birth_4",
820
+ "hcp_date_of_birth_5",
821
+ "hcp_date_of_birth_6",
822
+ "hcp_date_of_birth_7",
823
+ "hcp_date_of_birth_8",
824
+ "hcp_date_of_birth_9",
825
+ "hcp_date_of_birth_10",
826
+ "sof_previous_claims_yes",
827
+ "sof_previous_claims_no",
828
+ "sof_claims_yes",
829
+ "sof_claims_no",
830
+ "sof_property_claims_in_the_last_5_years_yes",
831
+ "sof_property_claims_in_the_last_5_years_no",
832
+ "sof_property_claims_in_the_last_0_to_4_years_yes",
833
+ "sof_property_claims_in_the_last_0_to_4_years_no",
834
+ "claim_count",
835
+ "sof_number_of_claims",
836
+ "number_of_claims_in_last_5_years",
837
+ "number_of_claims_in_time_owned",
838
+ "date_of_incident_1",
839
+ "date_of_incident_2",
840
+ "date_of_incident_3",
841
+ "date_of_incident_4",
842
+ "date_of_incident_5",
843
+ "type_of_incident_1",
844
+ "type_of_incident_2",
845
+ "type_of_incident_3",
846
+ "type_of_incident_4",
847
+ "type_of_incident_5",
848
+ "incident_value_1",
849
+ "incident_value_2",
850
+ "incident_value_3",
851
+ "incident_value_4",
852
+ "incident_value_5",
853
+ "sof_pollution_disease_claims_yes",
854
+ "sof_pollution_disease_claims_no",
855
+ "sof_potential_claims_yes",
856
+ "sof_potential_claims_no",
857
+ "sof_previous_circumstances_yes",
858
+ "sof_previous_circumstances_no",
859
+ "sof_possible_claims_yes",
860
+ "sof_possible_claims_no",
861
+ "date_of_possible_incident",
862
+ "type_of_possible_incident",
863
+ "possible_incident_value",
864
+ "sof_property_claims_yes",
865
+ "sof_property_claims_no",
866
+ "sof_liability_claims_yes",
867
+ "sof_liability_claims_no",
868
+ "van_registration",
869
+ "sof_disqualified_director_yes",
870
+ "sof_disqualified_director_no",
871
+ "sof_insurance_refused_yes",
872
+ "sof_insurance_refused_no",
873
+ "sof_insurance_declined_yes",
874
+ "sof_insurance_declined_no",
875
+ "insurance_refused"
876
+ ];
877
+ var RADIO_ANSWER_FROM_QUESTIONS = [
878
+ "have_secondary_trade_yes",
879
+ "have_secondary_trade_no"
880
+ ];
881
+ var ANSWER_SUFFIX_PATTERN = /_(yes|no)$/;
882
+ var redact = (params) => {
883
+ let { question, answer } = params;
884
+ const piiAnswer = new Set(PII_ANSWER);
885
+ const radioAnswerFromQuestions = new Set(RADIO_ANSWER_FROM_QUESTIONS);
886
+ if (piiAnswer.has(question)) {
887
+ answer = "REDACTED";
888
+ question = question?.replace(ANSWER_SUFFIX_PATTERN, "");
889
+ } else if (radioAnswerFromQuestions.has(question)) {
890
+ question = question?.replace(ANSWER_SUFFIX_PATTERN, "");
891
+ }
892
+ return { question, answer };
893
+ };
894
+
953
895
  // src/snowplow/event-definitions/questionnaire/questionnaire.ts
954
896
  var questionnaireEventDefinitions = [
955
897
  {
@@ -1349,10 +1291,6 @@ var referralPageEvents = [
1349
1291
  ...baseEventDefinitions,
1350
1292
  ...referralEventDefinitions
1351
1293
  ];
1352
- var personalisedCoverPageEvents = [
1353
- ...baseEventDefinitions,
1354
- ...personalisedCoverEventDefinitions
1355
- ];
1356
1294
  var interventionPageEvents = [...interventionEventDefinitions];
1357
1295
  var questionnairePageEvents = [...questionnaireEventDefinitions];
1358
1296
  var coverageSelectionPageEvents = [