@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
@@ -186,161 +186,9 @@ var interventionEventDefinitions = [
186
186
  }
187
187
  };
188
188
  }
189
- },
190
- {
191
- name: "iaLiveChatInterventionClosed",
192
- type: "structured",
193
- makePayload: (_) => ({
194
- category: "insurance_assistant",
195
- action: "ia_live_chat_intervention_closed"
196
- })
197
189
  }
198
190
  ];
199
191
 
200
- // src/snowplow/constants.ts
201
- var DELIMITER = "|";
202
-
203
- // src/snowplow/event-definitions/questionnaire/redaction.ts
204
- var PII_ANSWER = [
205
- "customer_title",
206
- "customer_first_name",
207
- "customer_last_name",
208
- "customer_email_address",
209
- "preapp_email_address",
210
- "customer_telephone_number",
211
- "customer_alternative_telephone_number",
212
- "uk_address_lookup",
213
- "uk_correspondence_address_lookup",
214
- "customer_address_1_pre_quote",
215
- "customer_address_2_pre_quote",
216
- "customer_town_pre_quote",
217
- "customer_postcode_pre_quote",
218
- "customer_address_1",
219
- "customer_address_2",
220
- "customer_town",
221
- "customer_postcode",
222
- "address_1_pre_quote",
223
- "address_2_pre_quote",
224
- "uk_postcode_pre_quote",
225
- "town_pre_quote",
226
- "owner_first_name",
227
- "owner_last_name",
228
- "beneficiary_first_name",
229
- "beneficiary_last_name",
230
- "gender",
231
- "dynamic_ssn_fein",
232
- "ssn",
233
- "fein",
234
- "sof_county_court_judgement_online_yes",
235
- "sof_county_court_judgement_online_no",
236
- "sof_ccj_count",
237
- "sof_ccj_value",
238
- "sof_ccj_date",
239
- "sof_court_judgement_yes",
240
- "sof_court_judgement_no",
241
- "ccj_date",
242
- "sof_single_ccj_no",
243
- "sof_single_ccj_yes",
244
- "sof_ccj_yes",
245
- "sof_ccj_no",
246
- "ccj_count",
247
- "sof_bankrupt_yes",
248
- "sof_bankrupt_no",
249
- "sof_multiple_bankruptcies_yes",
250
- "sof_multiple_bankruptcies_no",
251
- "bankruptcy_date",
252
- "sof_single_bankruptcy_no",
253
- "sof_single_bankruptcy_yes",
254
- "sof_bankruptcy_yes",
255
- "sof_bankruptcy_no",
256
- "bankruptcy_discharged",
257
- "sof_liquidation_yes",
258
- "sof_liquidation_no",
259
- "sof_multiple_liquidations",
260
- "liquidation_date",
261
- "sof_criminal_offence_yes",
262
- "sof_criminal_offence_no",
263
- "sof_criminal_yes",
264
- "sof_criminal_no",
265
- "hcp_date_of_birth_1",
266
- "hcp_date_of_birth_2",
267
- "hcp_date_of_birth_3",
268
- "hcp_date_of_birth_4",
269
- "hcp_date_of_birth_5",
270
- "hcp_date_of_birth_6",
271
- "hcp_date_of_birth_7",
272
- "hcp_date_of_birth_8",
273
- "hcp_date_of_birth_9",
274
- "hcp_date_of_birth_10",
275
- "sof_previous_claims_yes",
276
- "sof_previous_claims_no",
277
- "sof_claims_yes",
278
- "sof_claims_no",
279
- "sof_property_claims_in_the_last_5_years_yes",
280
- "sof_property_claims_in_the_last_5_years_no",
281
- "sof_property_claims_in_the_last_0_to_4_years_yes",
282
- "sof_property_claims_in_the_last_0_to_4_years_no",
283
- "claim_count",
284
- "sof_number_of_claims",
285
- "number_of_claims_in_last_5_years",
286
- "number_of_claims_in_time_owned",
287
- "date_of_incident_1",
288
- "date_of_incident_2",
289
- "date_of_incident_3",
290
- "date_of_incident_4",
291
- "date_of_incident_5",
292
- "type_of_incident_1",
293
- "type_of_incident_2",
294
- "type_of_incident_3",
295
- "type_of_incident_4",
296
- "type_of_incident_5",
297
- "incident_value_1",
298
- "incident_value_2",
299
- "incident_value_3",
300
- "incident_value_4",
301
- "incident_value_5",
302
- "sof_pollution_disease_claims_yes",
303
- "sof_pollution_disease_claims_no",
304
- "sof_potential_claims_yes",
305
- "sof_potential_claims_no",
306
- "sof_previous_circumstances_yes",
307
- "sof_previous_circumstances_no",
308
- "sof_possible_claims_yes",
309
- "sof_possible_claims_no",
310
- "date_of_possible_incident",
311
- "type_of_possible_incident",
312
- "possible_incident_value",
313
- "sof_property_claims_yes",
314
- "sof_property_claims_no",
315
- "sof_liability_claims_yes",
316
- "sof_liability_claims_no",
317
- "van_registration",
318
- "sof_disqualified_director_yes",
319
- "sof_disqualified_director_no",
320
- "sof_insurance_refused_yes",
321
- "sof_insurance_refused_no",
322
- "sof_insurance_declined_yes",
323
- "sof_insurance_declined_no",
324
- "insurance_refused"
325
- ];
326
- var RADIO_ANSWER_FROM_QUESTIONS = [
327
- "have_secondary_trade_yes",
328
- "have_secondary_trade_no"
329
- ];
330
- var ANSWER_SUFFIX_PATTERN = /_(yes|no)$/;
331
- var redact = (params) => {
332
- let { question, answer } = params;
333
- const piiAnswer = new Set(PII_ANSWER);
334
- const radioAnswerFromQuestions = new Set(RADIO_ANSWER_FROM_QUESTIONS);
335
- if (piiAnswer.has(question)) {
336
- answer = "REDACTED";
337
- question = question?.replace(ANSWER_SUFFIX_PATTERN, "");
338
- } else if (radioAnswerFromQuestions.has(question)) {
339
- question = question?.replace(ANSWER_SUFFIX_PATTERN, "");
340
- }
341
- return { question, answer };
342
- };
343
-
344
192
  // src/snowplow/event-definitions/personalised_cover.ts
345
193
  var personalisedCoverEventDefinitions = [
346
194
  {
@@ -353,16 +201,6 @@ var personalisedCoverEventDefinitions = [
353
201
  property: "personalised_cover"
354
202
  })
355
203
  },
356
- {
357
- name: "selectPackageClicked",
358
- type: "structured",
359
- makePayload: (_) => ({
360
- category: "personalised_cover",
361
- action: "select_package_clicked",
362
- label: "page",
363
- property: "personalised_cover"
364
- })
365
- },
366
204
  {
367
205
  name: "validationShown",
368
206
  type: "structured",
@@ -376,27 +214,6 @@ var personalisedCoverEventDefinitions = [
376
214
  };
377
215
  }
378
216
  },
379
- {
380
- name: "coverQuestionAnswered",
381
- type: "unstructured",
382
- makePayload: (params) => {
383
- const { context } = params;
384
- const { question, answer } = redact(params);
385
- const flatAnswer = Array.isArray(answer) ? answer.join(DELIMITER) : answer;
386
- return {
387
- schema: "iglu:com.simplybusiness/form_question_answered/jsonschema/1-0-4",
388
- data: {
389
- site: context.site,
390
- page_name: "personalised_cover",
391
- section_name: "Personalised Cover Questions",
392
- question,
393
- answer: flatAnswer,
394
- vertical: context.vertical,
395
- journey_id: context.journeyId
396
- }
397
- };
398
- }
399
- },
400
217
  {
401
218
  name: "limitLinkClicked",
402
219
  type: "structured",
@@ -448,32 +265,6 @@ var personalisedCoverEventDefinitions = [
448
265
  property
449
266
  };
450
267
  }
451
- },
452
- {
453
- name: "additionalQuestionsClicked",
454
- type: "structured",
455
- makePayload: (params) => {
456
- const { property } = params;
457
- return {
458
- category: "personalised_cover",
459
- action: "cover_details_clicked",
460
- label: "cover_name",
461
- property
462
- };
463
- }
464
- },
465
- {
466
- name: "chatbotPromptClicked",
467
- type: "structured",
468
- makePayload: (params) => {
469
- const { label, property } = params;
470
- return {
471
- category: "personalised_cover",
472
- action: "chatbot_prompt_clicked",
473
- label: property,
474
- property: label
475
- };
476
- }
477
268
  }
478
269
  ];
479
270
 
@@ -827,6 +618,150 @@ var qcpEventDefinitions = [
827
618
  }
828
619
  ];
829
620
 
621
+ // src/snowplow/constants.ts
622
+ var DELIMITER = "|";
623
+
624
+ // src/snowplow/event-definitions/questionnaire/redaction.ts
625
+ var PII_ANSWER = [
626
+ "customer_title",
627
+ "customer_first_name",
628
+ "customer_last_name",
629
+ "customer_email_address",
630
+ "preapp_email_address",
631
+ "customer_telephone_number",
632
+ "customer_alternative_telephone_number",
633
+ "uk_address_lookup",
634
+ "uk_correspondence_address_lookup",
635
+ "customer_address_1_pre_quote",
636
+ "customer_address_2_pre_quote",
637
+ "customer_town_pre_quote",
638
+ "customer_postcode_pre_quote",
639
+ "customer_address_1",
640
+ "customer_address_2",
641
+ "customer_town",
642
+ "customer_postcode",
643
+ "address_1_pre_quote",
644
+ "address_2_pre_quote",
645
+ "uk_postcode_pre_quote",
646
+ "town_pre_quote",
647
+ "owner_first_name",
648
+ "owner_last_name",
649
+ "beneficiary_first_name",
650
+ "beneficiary_last_name",
651
+ "gender",
652
+ "dynamic_ssn_fein",
653
+ "ssn",
654
+ "fein",
655
+ "sof_county_court_judgement_online_yes",
656
+ "sof_county_court_judgement_online_no",
657
+ "sof_ccj_count",
658
+ "sof_ccj_value",
659
+ "sof_ccj_date",
660
+ "sof_court_judgement_yes",
661
+ "sof_court_judgement_no",
662
+ "ccj_date",
663
+ "sof_single_ccj_no",
664
+ "sof_single_ccj_yes",
665
+ "sof_ccj_yes",
666
+ "sof_ccj_no",
667
+ "ccj_count",
668
+ "sof_bankrupt_yes",
669
+ "sof_bankrupt_no",
670
+ "sof_multiple_bankruptcies_yes",
671
+ "sof_multiple_bankruptcies_no",
672
+ "bankruptcy_date",
673
+ "sof_single_bankruptcy_no",
674
+ "sof_single_bankruptcy_yes",
675
+ "sof_bankruptcy_yes",
676
+ "sof_bankruptcy_no",
677
+ "bankruptcy_discharged",
678
+ "sof_liquidation_yes",
679
+ "sof_liquidation_no",
680
+ "sof_multiple_liquidations",
681
+ "liquidation_date",
682
+ "sof_criminal_offence_yes",
683
+ "sof_criminal_offence_no",
684
+ "sof_criminal_yes",
685
+ "sof_criminal_no",
686
+ "hcp_date_of_birth_1",
687
+ "hcp_date_of_birth_2",
688
+ "hcp_date_of_birth_3",
689
+ "hcp_date_of_birth_4",
690
+ "hcp_date_of_birth_5",
691
+ "hcp_date_of_birth_6",
692
+ "hcp_date_of_birth_7",
693
+ "hcp_date_of_birth_8",
694
+ "hcp_date_of_birth_9",
695
+ "hcp_date_of_birth_10",
696
+ "sof_previous_claims_yes",
697
+ "sof_previous_claims_no",
698
+ "sof_claims_yes",
699
+ "sof_claims_no",
700
+ "sof_property_claims_in_the_last_5_years_yes",
701
+ "sof_property_claims_in_the_last_5_years_no",
702
+ "sof_property_claims_in_the_last_0_to_4_years_yes",
703
+ "sof_property_claims_in_the_last_0_to_4_years_no",
704
+ "claim_count",
705
+ "sof_number_of_claims",
706
+ "number_of_claims_in_last_5_years",
707
+ "number_of_claims_in_time_owned",
708
+ "date_of_incident_1",
709
+ "date_of_incident_2",
710
+ "date_of_incident_3",
711
+ "date_of_incident_4",
712
+ "date_of_incident_5",
713
+ "type_of_incident_1",
714
+ "type_of_incident_2",
715
+ "type_of_incident_3",
716
+ "type_of_incident_4",
717
+ "type_of_incident_5",
718
+ "incident_value_1",
719
+ "incident_value_2",
720
+ "incident_value_3",
721
+ "incident_value_4",
722
+ "incident_value_5",
723
+ "sof_pollution_disease_claims_yes",
724
+ "sof_pollution_disease_claims_no",
725
+ "sof_potential_claims_yes",
726
+ "sof_potential_claims_no",
727
+ "sof_previous_circumstances_yes",
728
+ "sof_previous_circumstances_no",
729
+ "sof_possible_claims_yes",
730
+ "sof_possible_claims_no",
731
+ "date_of_possible_incident",
732
+ "type_of_possible_incident",
733
+ "possible_incident_value",
734
+ "sof_property_claims_yes",
735
+ "sof_property_claims_no",
736
+ "sof_liability_claims_yes",
737
+ "sof_liability_claims_no",
738
+ "van_registration",
739
+ "sof_disqualified_director_yes",
740
+ "sof_disqualified_director_no",
741
+ "sof_insurance_refused_yes",
742
+ "sof_insurance_refused_no",
743
+ "sof_insurance_declined_yes",
744
+ "sof_insurance_declined_no",
745
+ "insurance_refused"
746
+ ];
747
+ var RADIO_ANSWER_FROM_QUESTIONS = [
748
+ "have_secondary_trade_yes",
749
+ "have_secondary_trade_no"
750
+ ];
751
+ var ANSWER_SUFFIX_PATTERN = /_(yes|no)$/;
752
+ var redact = (params) => {
753
+ let { question, answer } = params;
754
+ const piiAnswer = new Set(PII_ANSWER);
755
+ const radioAnswerFromQuestions = new Set(RADIO_ANSWER_FROM_QUESTIONS);
756
+ if (piiAnswer.has(question)) {
757
+ answer = "REDACTED";
758
+ question = question?.replace(ANSWER_SUFFIX_PATTERN, "");
759
+ } else if (radioAnswerFromQuestions.has(question)) {
760
+ question = question?.replace(ANSWER_SUFFIX_PATTERN, "");
761
+ }
762
+ return { question, answer };
763
+ };
764
+
830
765
  // src/snowplow/event-definitions/questionnaire/questionnaire.ts
831
766
  var questionnaireEventDefinitions = [
832
767
  {
@@ -1226,10 +1161,6 @@ var referralPageEvents = [
1226
1161
  ...baseEventDefinitions,
1227
1162
  ...referralEventDefinitions
1228
1163
  ];
1229
- var personalisedCoverPageEvents = [
1230
- ...baseEventDefinitions,
1231
- ...personalisedCoverEventDefinitions
1232
- ];
1233
1164
  var interventionPageEvents = [...interventionEventDefinitions];
1234
1165
  var questionnairePageEvents = [...questionnaireEventDefinitions];
1235
1166
  var coverageSelectionPageEvents = [