@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
@@ -197,150 +197,6 @@ var interventionEventDefinitions = [
197
197
  }
198
198
  ];
199
199
 
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
200
  // src/snowplow/event-definitions/personalised_cover.ts
345
201
  var personalisedCoverEventDefinitions = [
346
202
  {
@@ -353,16 +209,6 @@ var personalisedCoverEventDefinitions = [
353
209
  property: "personalised_cover"
354
210
  })
355
211
  },
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
212
  {
367
213
  name: "validationShown",
368
214
  type: "structured",
@@ -376,27 +222,6 @@ var personalisedCoverEventDefinitions = [
376
222
  };
377
223
  }
378
224
  },
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
225
  {
401
226
  name: "limitLinkClicked",
402
227
  type: "structured",
@@ -448,32 +273,6 @@ var personalisedCoverEventDefinitions = [
448
273
  property
449
274
  };
450
275
  }
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
276
  }
478
277
  ];
479
278
 
@@ -827,6 +626,150 @@ var qcpEventDefinitions = [
827
626
  }
828
627
  ];
829
628
 
629
+ // src/snowplow/constants.ts
630
+ var DELIMITER = "|";
631
+
632
+ // src/snowplow/event-definitions/questionnaire/redaction.ts
633
+ var PII_ANSWER = [
634
+ "customer_title",
635
+ "customer_first_name",
636
+ "customer_last_name",
637
+ "customer_email_address",
638
+ "preapp_email_address",
639
+ "customer_telephone_number",
640
+ "customer_alternative_telephone_number",
641
+ "uk_address_lookup",
642
+ "uk_correspondence_address_lookup",
643
+ "customer_address_1_pre_quote",
644
+ "customer_address_2_pre_quote",
645
+ "customer_town_pre_quote",
646
+ "customer_postcode_pre_quote",
647
+ "customer_address_1",
648
+ "customer_address_2",
649
+ "customer_town",
650
+ "customer_postcode",
651
+ "address_1_pre_quote",
652
+ "address_2_pre_quote",
653
+ "uk_postcode_pre_quote",
654
+ "town_pre_quote",
655
+ "owner_first_name",
656
+ "owner_last_name",
657
+ "beneficiary_first_name",
658
+ "beneficiary_last_name",
659
+ "gender",
660
+ "dynamic_ssn_fein",
661
+ "ssn",
662
+ "fein",
663
+ "sof_county_court_judgement_online_yes",
664
+ "sof_county_court_judgement_online_no",
665
+ "sof_ccj_count",
666
+ "sof_ccj_value",
667
+ "sof_ccj_date",
668
+ "sof_court_judgement_yes",
669
+ "sof_court_judgement_no",
670
+ "ccj_date",
671
+ "sof_single_ccj_no",
672
+ "sof_single_ccj_yes",
673
+ "sof_ccj_yes",
674
+ "sof_ccj_no",
675
+ "ccj_count",
676
+ "sof_bankrupt_yes",
677
+ "sof_bankrupt_no",
678
+ "sof_multiple_bankruptcies_yes",
679
+ "sof_multiple_bankruptcies_no",
680
+ "bankruptcy_date",
681
+ "sof_single_bankruptcy_no",
682
+ "sof_single_bankruptcy_yes",
683
+ "sof_bankruptcy_yes",
684
+ "sof_bankruptcy_no",
685
+ "bankruptcy_discharged",
686
+ "sof_liquidation_yes",
687
+ "sof_liquidation_no",
688
+ "sof_multiple_liquidations",
689
+ "liquidation_date",
690
+ "sof_criminal_offence_yes",
691
+ "sof_criminal_offence_no",
692
+ "sof_criminal_yes",
693
+ "sof_criminal_no",
694
+ "hcp_date_of_birth_1",
695
+ "hcp_date_of_birth_2",
696
+ "hcp_date_of_birth_3",
697
+ "hcp_date_of_birth_4",
698
+ "hcp_date_of_birth_5",
699
+ "hcp_date_of_birth_6",
700
+ "hcp_date_of_birth_7",
701
+ "hcp_date_of_birth_8",
702
+ "hcp_date_of_birth_9",
703
+ "hcp_date_of_birth_10",
704
+ "sof_previous_claims_yes",
705
+ "sof_previous_claims_no",
706
+ "sof_claims_yes",
707
+ "sof_claims_no",
708
+ "sof_property_claims_in_the_last_5_years_yes",
709
+ "sof_property_claims_in_the_last_5_years_no",
710
+ "sof_property_claims_in_the_last_0_to_4_years_yes",
711
+ "sof_property_claims_in_the_last_0_to_4_years_no",
712
+ "claim_count",
713
+ "sof_number_of_claims",
714
+ "number_of_claims_in_last_5_years",
715
+ "number_of_claims_in_time_owned",
716
+ "date_of_incident_1",
717
+ "date_of_incident_2",
718
+ "date_of_incident_3",
719
+ "date_of_incident_4",
720
+ "date_of_incident_5",
721
+ "type_of_incident_1",
722
+ "type_of_incident_2",
723
+ "type_of_incident_3",
724
+ "type_of_incident_4",
725
+ "type_of_incident_5",
726
+ "incident_value_1",
727
+ "incident_value_2",
728
+ "incident_value_3",
729
+ "incident_value_4",
730
+ "incident_value_5",
731
+ "sof_pollution_disease_claims_yes",
732
+ "sof_pollution_disease_claims_no",
733
+ "sof_potential_claims_yes",
734
+ "sof_potential_claims_no",
735
+ "sof_previous_circumstances_yes",
736
+ "sof_previous_circumstances_no",
737
+ "sof_possible_claims_yes",
738
+ "sof_possible_claims_no",
739
+ "date_of_possible_incident",
740
+ "type_of_possible_incident",
741
+ "possible_incident_value",
742
+ "sof_property_claims_yes",
743
+ "sof_property_claims_no",
744
+ "sof_liability_claims_yes",
745
+ "sof_liability_claims_no",
746
+ "van_registration",
747
+ "sof_disqualified_director_yes",
748
+ "sof_disqualified_director_no",
749
+ "sof_insurance_refused_yes",
750
+ "sof_insurance_refused_no",
751
+ "sof_insurance_declined_yes",
752
+ "sof_insurance_declined_no",
753
+ "insurance_refused"
754
+ ];
755
+ var RADIO_ANSWER_FROM_QUESTIONS = [
756
+ "have_secondary_trade_yes",
757
+ "have_secondary_trade_no"
758
+ ];
759
+ var ANSWER_SUFFIX_PATTERN = /_(yes|no)$/;
760
+ var redact = (params) => {
761
+ let { question, answer } = params;
762
+ const piiAnswer = new Set(PII_ANSWER);
763
+ const radioAnswerFromQuestions = new Set(RADIO_ANSWER_FROM_QUESTIONS);
764
+ if (piiAnswer.has(question)) {
765
+ answer = "REDACTED";
766
+ question = question?.replace(ANSWER_SUFFIX_PATTERN, "");
767
+ } else if (radioAnswerFromQuestions.has(question)) {
768
+ question = question?.replace(ANSWER_SUFFIX_PATTERN, "");
769
+ }
770
+ return { question, answer };
771
+ };
772
+
830
773
  // src/snowplow/event-definitions/questionnaire/questionnaire.ts
831
774
  var questionnaireEventDefinitions = [
832
775
  {
@@ -1226,10 +1169,6 @@ var referralPageEvents = [
1226
1169
  ...baseEventDefinitions,
1227
1170
  ...referralEventDefinitions
1228
1171
  ];
1229
- var personalisedCoverPageEvents = [
1230
- ...baseEventDefinitions,
1231
- ...personalisedCoverEventDefinitions
1232
- ];
1233
1172
  var interventionPageEvents = [...interventionEventDefinitions];
1234
1173
  var questionnairePageEvents = [...questionnaireEventDefinitions];
1235
1174
  var coverageSelectionPageEvents = [