@simplybusiness/services 2.5.2 → 2.6.1

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 (40) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/cjs/index.js +144 -214
  3. package/dist/cjs/index.js.map +3 -3
  4. package/dist/cjs/meta.json +71 -87
  5. package/dist/cjs/snowplow/SnowplowContext.js +144 -213
  6. package/dist/cjs/snowplow/SnowplowContext.js.map +3 -3
  7. package/dist/cjs/snowplow/event-definitions/index.js +144 -214
  8. package/dist/cjs/snowplow/event-definitions/index.js.map +3 -3
  9. package/dist/cjs/snowplow/event-definitions/intervention.js +0 -8
  10. package/dist/cjs/snowplow/event-definitions/intervention.js.map +2 -2
  11. package/dist/cjs/snowplow/event-definitions/personalised_cover.js +0 -201
  12. package/dist/cjs/snowplow/event-definitions/personalised_cover.js.map +3 -3
  13. package/dist/cjs/snowplow/index.js +144 -214
  14. package/dist/cjs/snowplow/index.js.map +3 -3
  15. package/dist/cjs/utils/testUtils.js +144 -213
  16. package/dist/cjs/utils/testUtils.js.map +3 -3
  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-RLSHHBYY.js → chunk-I2GKS3FR.js} +1 -9
  20. package/dist/esm/{chunk-RLSHHBYY.js.map → chunk-I2GKS3FR.js.map} +2 -2
  21. package/dist/esm/{chunk-TRQ236KL.js → chunk-MXPROAPE.js} +2 -2
  22. package/dist/esm/{chunk-3JWAIW5L.js → chunk-VH733I2Z.js} +3 -8
  23. package/dist/esm/{chunk-3JWAIW5L.js.map → chunk-VH733I2Z.js.map} +2 -2
  24. package/dist/esm/index.js +4 -6
  25. package/dist/esm/meta.json +58 -88
  26. package/dist/esm/snowplow/SnowplowContext.js +4 -4
  27. package/dist/esm/snowplow/event-definitions/index.js +3 -5
  28. package/dist/esm/snowplow/event-definitions/intervention.js +1 -1
  29. package/dist/esm/snowplow/event-definitions/personalised_cover.js +1 -3
  30. package/dist/esm/snowplow/index.js +4 -6
  31. package/dist/esm/utils/testUtils.js +4 -4
  32. package/dist/tsconfig.build.tsbuildinfo +1 -1
  33. package/dist/types/snowplow/event-definitions/index.d.ts +0 -1
  34. package/package.json +3 -3
  35. package/src/snowplow/event-definitions/index.ts +0 -5
  36. package/src/snowplow/event-definitions/intervention.ts +0 -8
  37. package/src/snowplow/event-definitions/personalised_cover.test.ts +0 -182
  38. package/src/snowplow/event-definitions/personalised_cover.ts +0 -66
  39. package/dist/esm/chunk-3SO3SL37.js.map +0 -7
  40. /package/dist/esm/{chunk-TRQ236KL.js.map → chunk-MXPROAPE.js.map} +0 -0
@@ -232,161 +232,9 @@ var interventionEventDefinitions = [
232
232
  }
233
233
  };
234
234
  }
235
- },
236
- {
237
- name: "iaLiveChatInterventionClosed",
238
- type: "structured",
239
- makePayload: (_) => ({
240
- category: "insurance_assistant",
241
- action: "ia_live_chat_intervention_closed"
242
- })
243
235
  }
244
236
  ];
245
237
 
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
238
  // src/snowplow/event-definitions/personalised_cover.ts
391
239
  var personalisedCoverEventDefinitions = [
392
240
  {
@@ -399,16 +247,6 @@ var personalisedCoverEventDefinitions = [
399
247
  property: "personalised_cover"
400
248
  })
401
249
  },
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
250
  {
413
251
  name: "validationShown",
414
252
  type: "structured",
@@ -422,27 +260,6 @@ var personalisedCoverEventDefinitions = [
422
260
  };
423
261
  }
424
262
  },
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
263
  {
447
264
  name: "limitLinkClicked",
448
265
  type: "structured",
@@ -494,32 +311,6 @@ var personalisedCoverEventDefinitions = [
494
311
  property
495
312
  };
496
313
  }
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
314
  }
524
315
  ];
525
316
 
@@ -873,6 +664,150 @@ var qcpEventDefinitions = [
873
664
  }
874
665
  ];
875
666
 
667
+ // src/snowplow/constants.ts
668
+ var DELIMITER = "|";
669
+
670
+ // src/snowplow/event-definitions/questionnaire/redaction.ts
671
+ var PII_ANSWER = [
672
+ "customer_title",
673
+ "customer_first_name",
674
+ "customer_last_name",
675
+ "customer_email_address",
676
+ "preapp_email_address",
677
+ "customer_telephone_number",
678
+ "customer_alternative_telephone_number",
679
+ "uk_address_lookup",
680
+ "uk_correspondence_address_lookup",
681
+ "customer_address_1_pre_quote",
682
+ "customer_address_2_pre_quote",
683
+ "customer_town_pre_quote",
684
+ "customer_postcode_pre_quote",
685
+ "customer_address_1",
686
+ "customer_address_2",
687
+ "customer_town",
688
+ "customer_postcode",
689
+ "address_1_pre_quote",
690
+ "address_2_pre_quote",
691
+ "uk_postcode_pre_quote",
692
+ "town_pre_quote",
693
+ "owner_first_name",
694
+ "owner_last_name",
695
+ "beneficiary_first_name",
696
+ "beneficiary_last_name",
697
+ "gender",
698
+ "dynamic_ssn_fein",
699
+ "ssn",
700
+ "fein",
701
+ "sof_county_court_judgement_online_yes",
702
+ "sof_county_court_judgement_online_no",
703
+ "sof_ccj_count",
704
+ "sof_ccj_value",
705
+ "sof_ccj_date",
706
+ "sof_court_judgement_yes",
707
+ "sof_court_judgement_no",
708
+ "ccj_date",
709
+ "sof_single_ccj_no",
710
+ "sof_single_ccj_yes",
711
+ "sof_ccj_yes",
712
+ "sof_ccj_no",
713
+ "ccj_count",
714
+ "sof_bankrupt_yes",
715
+ "sof_bankrupt_no",
716
+ "sof_multiple_bankruptcies_yes",
717
+ "sof_multiple_bankruptcies_no",
718
+ "bankruptcy_date",
719
+ "sof_single_bankruptcy_no",
720
+ "sof_single_bankruptcy_yes",
721
+ "sof_bankruptcy_yes",
722
+ "sof_bankruptcy_no",
723
+ "bankruptcy_discharged",
724
+ "sof_liquidation_yes",
725
+ "sof_liquidation_no",
726
+ "sof_multiple_liquidations",
727
+ "liquidation_date",
728
+ "sof_criminal_offence_yes",
729
+ "sof_criminal_offence_no",
730
+ "sof_criminal_yes",
731
+ "sof_criminal_no",
732
+ "hcp_date_of_birth_1",
733
+ "hcp_date_of_birth_2",
734
+ "hcp_date_of_birth_3",
735
+ "hcp_date_of_birth_4",
736
+ "hcp_date_of_birth_5",
737
+ "hcp_date_of_birth_6",
738
+ "hcp_date_of_birth_7",
739
+ "hcp_date_of_birth_8",
740
+ "hcp_date_of_birth_9",
741
+ "hcp_date_of_birth_10",
742
+ "sof_previous_claims_yes",
743
+ "sof_previous_claims_no",
744
+ "sof_claims_yes",
745
+ "sof_claims_no",
746
+ "sof_property_claims_in_the_last_5_years_yes",
747
+ "sof_property_claims_in_the_last_5_years_no",
748
+ "sof_property_claims_in_the_last_0_to_4_years_yes",
749
+ "sof_property_claims_in_the_last_0_to_4_years_no",
750
+ "claim_count",
751
+ "sof_number_of_claims",
752
+ "number_of_claims_in_last_5_years",
753
+ "number_of_claims_in_time_owned",
754
+ "date_of_incident_1",
755
+ "date_of_incident_2",
756
+ "date_of_incident_3",
757
+ "date_of_incident_4",
758
+ "date_of_incident_5",
759
+ "type_of_incident_1",
760
+ "type_of_incident_2",
761
+ "type_of_incident_3",
762
+ "type_of_incident_4",
763
+ "type_of_incident_5",
764
+ "incident_value_1",
765
+ "incident_value_2",
766
+ "incident_value_3",
767
+ "incident_value_4",
768
+ "incident_value_5",
769
+ "sof_pollution_disease_claims_yes",
770
+ "sof_pollution_disease_claims_no",
771
+ "sof_potential_claims_yes",
772
+ "sof_potential_claims_no",
773
+ "sof_previous_circumstances_yes",
774
+ "sof_previous_circumstances_no",
775
+ "sof_possible_claims_yes",
776
+ "sof_possible_claims_no",
777
+ "date_of_possible_incident",
778
+ "type_of_possible_incident",
779
+ "possible_incident_value",
780
+ "sof_property_claims_yes",
781
+ "sof_property_claims_no",
782
+ "sof_liability_claims_yes",
783
+ "sof_liability_claims_no",
784
+ "van_registration",
785
+ "sof_disqualified_director_yes",
786
+ "sof_disqualified_director_no",
787
+ "sof_insurance_refused_yes",
788
+ "sof_insurance_refused_no",
789
+ "sof_insurance_declined_yes",
790
+ "sof_insurance_declined_no",
791
+ "insurance_refused"
792
+ ];
793
+ var RADIO_ANSWER_FROM_QUESTIONS = [
794
+ "have_secondary_trade_yes",
795
+ "have_secondary_trade_no"
796
+ ];
797
+ var ANSWER_SUFFIX_PATTERN = /_(yes|no)$/;
798
+ var redact = (params) => {
799
+ let { question, answer } = params;
800
+ const piiAnswer = new Set(PII_ANSWER);
801
+ const radioAnswerFromQuestions = new Set(RADIO_ANSWER_FROM_QUESTIONS);
802
+ if (piiAnswer.has(question)) {
803
+ answer = "REDACTED";
804
+ question = question?.replace(ANSWER_SUFFIX_PATTERN, "");
805
+ } else if (radioAnswerFromQuestions.has(question)) {
806
+ question = question?.replace(ANSWER_SUFFIX_PATTERN, "");
807
+ }
808
+ return { question, answer };
809
+ };
810
+
876
811
  // src/snowplow/event-definitions/questionnaire/questionnaire.ts
877
812
  var questionnaireEventDefinitions = [
878
813
  {
@@ -1272,10 +1207,6 @@ var referralPageEvents = [
1272
1207
  ...baseEventDefinitions,
1273
1208
  ...referralEventDefinitions
1274
1209
  ];
1275
- var personalisedCoverPageEvents = [
1276
- ...baseEventDefinitions,
1277
- ...personalisedCoverEventDefinitions
1278
- ];
1279
1210
  var interventionPageEvents = [...interventionEventDefinitions];
1280
1211
  var questionnairePageEvents = [...questionnaireEventDefinitions];
1281
1212
  var coverageSelectionPageEvents = [