@tellescope/sdk 1.4.61 → 1.4.63

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.
@@ -2535,12 +2535,12 @@ var sequenceTests = function () { return __awaiter(void 0, void 0, void 0, funct
2535
2535
  }
2536
2536
  });
2537
2537
  }); };
2538
- export var cancelConditionsTests = function () { return __awaiter(void 0, void 0, void 0, function () {
2538
+ export var formUnsubmittedCancelConditionTest = function () { return __awaiter(void 0, void 0, void 0, function () {
2539
2539
  var enduser, journey, form, field, triggerStep, unsub, fastFollowup, accessCode;
2540
2540
  return __generator(this, function (_a) {
2541
2541
  switch (_a.label) {
2542
2542
  case 0:
2543
- log_header("Cancel Condition Tests");
2543
+ log_header("formUnsubmitted Cancel Condition Tests");
2544
2544
  return [4 /*yield*/, sdk.api.endusers.createOne({ email: 'deletemeee@tellescope.com' })];
2545
2545
  case 1:
2546
2546
  enduser = _a.sent();
@@ -2577,15 +2577,18 @@ export var cancelConditionsTests = function () { return __awaiter(void 0, void 0
2577
2577
  info: {
2578
2578
  automationStepId: triggerStep.id,
2579
2579
  delayInMS: 0,
2580
- delay: 0, unit: 'Seconds',
2581
- cancelConditions: [{ type: 'formResponse', info: { automationStepId: triggerStep.id } }]
2580
+ delay: 0, unit: 'Seconds', // don't matter
2581
+ // this cancelCondition is now added automatically, does not need to be part of step
2582
+ // cancelConditions: [{ type: 'formResponse', info: { automationStepId: triggerStep.id }}]
2582
2583
  }
2583
2584
  }],
2584
2585
  action: {
2585
2586
  type: 'setEnduserStatus',
2586
2587
  info: { status: 'triggered' },
2587
2588
  },
2588
- })];
2589
+ })
2590
+ // should occur right after unsub
2591
+ ];
2589
2592
  case 6:
2590
2593
  unsub = _a.sent();
2591
2594
  return [4 /*yield*/, sdk.api.automation_steps.createOne({
@@ -2595,17 +2598,21 @@ export var cancelConditionsTests = function () { return __awaiter(void 0, void 0
2595
2598
  info: {
2596
2599
  automationStepId: unsub.id,
2597
2600
  delayInMS: 0,
2598
- delay: 0, unit: 'Seconds',
2599
- cancelConditions: [{ type: 'formResponse', info: { automationStepId: triggerStep.id } }]
2601
+ delay: 0, unit: 'Seconds', // don't matter
2602
+ // this cancelCondition is now added automatically, does not need to be part of step
2603
+ // cancelConditions: [{ type: 'formResponse', info: { automationStepId: triggerStep.id }}]
2600
2604
  }
2601
2605
  }],
2602
2606
  action: {
2603
2607
  type: 'setEnduserStatus',
2604
2608
  info: { status: 'triggered again' },
2605
2609
  },
2606
- })];
2610
+ })
2611
+ // should be cancelled after unsub
2612
+ ];
2607
2613
  case 7:
2608
2614
  fastFollowup = _a.sent();
2615
+ // should be cancelled after unsub
2609
2616
  return [4 /*yield*/, sdk.api.automation_steps.createOne({
2610
2617
  journeyId: journey.id,
2611
2618
  events: [{
@@ -2613,8 +2620,9 @@ export var cancelConditionsTests = function () { return __awaiter(void 0, void 0
2613
2620
  info: {
2614
2621
  automationStepId: unsub.id,
2615
2622
  delayInMS: 1000000,
2616
- delay: 0, unit: 'Seconds',
2617
- cancelConditions: [{ type: 'formResponse', info: { automationStepId: triggerStep.id } }]
2623
+ delay: 0, unit: 'Seconds', // don't matter
2624
+ // this cancelCondition is now added automatically, passed down from unsub
2625
+ // cancelConditions: [{ type: 'formResponse', info: { automationStepId: triggerStep.id }}]
2618
2626
  }
2619
2627
  }],
2620
2628
  action: {
@@ -2622,10 +2630,13 @@ export var cancelConditionsTests = function () { return __awaiter(void 0, void 0
2622
2630
  info: { status: 'violation 1' },
2623
2631
  },
2624
2632
  })
2633
+ // should be cancelled after unsub
2625
2634
  // a second followup to the unsub event (to create example of two actions with same cancel condition)
2626
2635
  ];
2627
2636
  case 8:
2637
+ // should be cancelled after unsub
2628
2638
  _a.sent();
2639
+ // should be cancelled after unsub
2629
2640
  // a second followup to the unsub event (to create example of two actions with same cancel condition)
2630
2641
  return [4 /*yield*/, sdk.api.automation_steps.createOne({
2631
2642
  journeyId: journey.id,
@@ -2634,8 +2645,9 @@ export var cancelConditionsTests = function () { return __awaiter(void 0, void 0
2634
2645
  info: {
2635
2646
  automationStepId: unsub.id,
2636
2647
  delayInMS: 1000000,
2637
- delay: 0, unit: 'Seconds',
2638
- cancelConditions: [{ type: 'formResponse', info: { automationStepId: triggerStep.id } }]
2648
+ delay: 0, unit: 'Seconds', // don't matter
2649
+ // this cancelCondition is now added automatically, does not need to be part of step
2650
+ // cancelConditions: [{ type: 'formResponse', info: { automationStepId: triggerStep.id }}]
2639
2651
  }
2640
2652
  }],
2641
2653
  action: {
@@ -2644,6 +2656,7 @@ export var cancelConditionsTests = function () { return __awaiter(void 0, void 0
2644
2656
  },
2645
2657
  })];
2646
2658
  case 9:
2659
+ // should be cancelled after unsub
2647
2660
  // a second followup to the unsub event (to create example of two actions with same cancel condition)
2648
2661
  _a.sent();
2649
2662
  return [4 /*yield*/, sdk.api.form_responses.prepare_form_response({
@@ -2651,34 +2664,13 @@ export var cancelConditionsTests = function () { return __awaiter(void 0, void 0
2651
2664
  automationStepId: triggerStep.id,
2652
2665
  enduserId: enduser.id
2653
2666
  })
2654
- // allow formUnsubmitted to trigger
2655
- // await wait(undefined, 1500) // allow background creation with generous pause
2656
- // await async_test(
2657
- // `formUnsubmitted event with short delay is triggered`,
2658
- // () => sdk.api.endusers.getOne(enduser.id),
2659
- // { onResult: e => e?.journeys?.[journey.id] === 'triggered' }
2660
- // )
2661
2667
  // allow fast followup to trigger
2662
2668
  ];
2663
2669
  case 10:
2664
2670
  accessCode = (_a.sent()).accessCode;
2665
- // allow formUnsubmitted to trigger
2666
- // await wait(undefined, 1500) // allow background creation with generous pause
2667
- // await async_test(
2668
- // `formUnsubmitted event with short delay is triggered`,
2669
- // () => sdk.api.endusers.getOne(enduser.id),
2670
- // { onResult: e => e?.journeys?.[journey.id] === 'triggered' }
2671
- // )
2672
2671
  // allow fast followup to trigger
2673
2672
  return [4 /*yield*/, wait(undefined, 4000)]; // allow background creation with generous pause
2674
2673
  case 11:
2675
- // allow formUnsubmitted to trigger
2676
- // await wait(undefined, 1500) // allow background creation with generous pause
2677
- // await async_test(
2678
- // `formUnsubmitted event with short delay is triggered`,
2679
- // () => sdk.api.endusers.getOne(enduser.id),
2680
- // { onResult: e => e?.journeys?.[journey.id] === 'triggered' }
2681
- // )
2682
2674
  // allow fast followup to trigger
2683
2675
  _a.sent(); // allow background creation with generous pause
2684
2676
  return [4 /*yield*/, async_test("formUnsubmitted event with short delay is triggered", function () { return sdk.api.endusers.getOne(enduser.id); }, { onResult: function (e) { var _a; return ((_a = e === null || e === void 0 ? void 0 : e.journeys) === null || _a === void 0 ? void 0 : _a[journey.id]) === 'triggered again'; } })
@@ -2722,6 +2714,193 @@ export var cancelConditionsTests = function () { return __awaiter(void 0, void 0
2722
2714
  }
2723
2715
  });
2724
2716
  }); };
2717
+ export var formsUnsubmittedCancelConditionTest = function () { return __awaiter(void 0, void 0, void 0, function () {
2718
+ var enduser, journey, form, field, triggerStep, unsub, form_responses;
2719
+ return __generator(this, function (_a) {
2720
+ switch (_a.label) {
2721
+ case 0:
2722
+ log_header("formsUnsubmitted Cancel Condition Tests");
2723
+ return [4 /*yield*/, sdk.api.endusers.createOne({ email: 'deletemeee@tellescope.com' })];
2724
+ case 1:
2725
+ enduser = _a.sent();
2726
+ return [4 /*yield*/, sdk.api.journeys.createOne({ title: 'test journey ' })];
2727
+ case 2:
2728
+ journey = _a.sent();
2729
+ return [4 /*yield*/, sdk.api.forms.createOne({ title: 'test form' })];
2730
+ case 3:
2731
+ form = _a.sent();
2732
+ return [4 /*yield*/, sdk.api.form_fields.createOne({
2733
+ formId: form.id, title: 'question', type: 'string',
2734
+ previousFields: [{ type: 'root', info: {} }]
2735
+ })
2736
+ // this action won't be fired, because patient isn't added to journey as part of tests
2737
+ ];
2738
+ case 4:
2739
+ field = _a.sent();
2740
+ return [4 /*yield*/, sdk.api.automation_steps.createOne({
2741
+ journeyId: journey.id,
2742
+ events: [{ type: 'onJourneyStart', info: {} }],
2743
+ // in practice, this would send a form, so that the next step(s) could handle the response
2744
+ // but we don't want to send emails in testing, and can still attach this Id to a form response to test a trigger
2745
+ action: {
2746
+ type: 'setEnduserStatus',
2747
+ info: { status: 'start' },
2748
+ },
2749
+ })];
2750
+ case 5:
2751
+ triggerStep = _a.sent();
2752
+ return [4 /*yield*/, sdk.api.automation_steps.createOne({
2753
+ journeyId: journey.id,
2754
+ events: [{
2755
+ type: 'formsUnsubmitted',
2756
+ info: {
2757
+ automationStepId: triggerStep.id,
2758
+ delayInMS: 10000,
2759
+ delay: 0, unit: 'Seconds',
2760
+ cancelConditions: [
2761
+ // { type: 'formResponse', info: { automationStepId: triggerStep.id }}
2762
+ ]
2763
+ }
2764
+ }],
2765
+ action: {
2766
+ type: 'setEnduserStatus',
2767
+ info: { status: 'triggered' },
2768
+ },
2769
+ })
2770
+ // test for all forms submitted triggering update
2771
+ ];
2772
+ case 6:
2773
+ unsub = _a.sent();
2774
+ // test for all forms submitted triggering update
2775
+ return [4 /*yield*/, sdk.api.automation_steps.createOne({
2776
+ journeyId: journey.id,
2777
+ events: [{
2778
+ type: 'formResponses',
2779
+ info: { automationStepId: triggerStep.id }
2780
+ }],
2781
+ action: {
2782
+ type: 'setEnduserStatus',
2783
+ info: { status: 'formsSubmitted' },
2784
+ },
2785
+ })
2786
+ // triggers formsUnsubmitted automated actions to be created when forms generated in templated message
2787
+ ];
2788
+ case 7:
2789
+ // test for all forms submitted triggering update
2790
+ _a.sent();
2791
+ // triggers formsUnsubmitted automated actions to be created when forms generated in templated message
2792
+ return [4 /*yield*/, sdk.api.templates.get_templated_message({
2793
+ channel: 'Email',
2794
+ enduserId: enduser.id,
2795
+ message: "{{forms.".concat(form.id, ".link:title}} {{forms.").concat(form.id, ".link:title}}"),
2796
+ userId: sdk.userInfo.id,
2797
+ automationStepId: triggerStep.id,
2798
+ })];
2799
+ case 8:
2800
+ // triggers formsUnsubmitted automated actions to be created when forms generated in templated message
2801
+ _a.sent();
2802
+ return [4 /*yield*/, sdk.api.form_responses.getSome()
2803
+ // allow fast followup to trigger
2804
+ ];
2805
+ case 9:
2806
+ form_responses = _a.sent();
2807
+ // allow fast followup to trigger
2808
+ return [4 /*yield*/, wait(undefined, 2500)]; // allow background creation with generous pause
2809
+ case 10:
2810
+ // allow fast followup to trigger
2811
+ _a.sent(); // allow background creation with generous pause
2812
+ return [4 /*yield*/, async_test("FormsUnsubmitted action created with cancel conditions", function () { return sdk.api.automated_actions.getSome(); }, { onResult: function (as) {
2813
+ var _a;
2814
+ var match = as.find(function (a) { return a.automationStepId === unsub.id; });
2815
+ return !!(as.length === 1
2816
+ && (match === null || match === void 0 ? void 0 : match.status) === 'active'
2817
+ && (match === null || match === void 0 ? void 0 : match.event.type) === 'formsUnsubmitted'
2818
+ && ((_a = match.event.info.cancelConditions) === null || _a === void 0 ? void 0 : _a.find(function (c) {
2819
+ return c.type === 'formResponses'
2820
+ && c.info.automationStepId === triggerStep.id
2821
+ && c.info.unsubmittedFormCount === 2;
2822
+ })));
2823
+ } })];
2824
+ case 11:
2825
+ _a.sent();
2826
+ return [4 /*yield*/, async_test("formResponses not triggered with all forms unsubmitted", function () { return sdk.api.endusers.getOne(enduser.id); }, { onResult: function (e) { var _a; return ((_a = e === null || e === void 0 ? void 0 : e.journeys) === null || _a === void 0 ? void 0 : _a[journey.id]) !== 'formsSubmitted'; } })
2827
+ // trigger cancel conditions
2828
+ ];
2829
+ case 12:
2830
+ _a.sent();
2831
+ // trigger cancel conditions
2832
+ return [4 /*yield*/, sdk.api.form_responses.submit_form_response({ accessCode: form_responses[0].accessCode, automationStepId: triggerStep.id, responses: [{
2833
+ answer: {
2834
+ type: 'string',
2835
+ value: 'answer'
2836
+ },
2837
+ fieldId: field.id,
2838
+ fieldTitle: field.title,
2839
+ }] })];
2840
+ case 13:
2841
+ // trigger cancel conditions
2842
+ _a.sent();
2843
+ return [4 /*yield*/, wait(undefined, 2500)]; // allow background creation with generous pause
2844
+ case 14:
2845
+ _a.sent(); // allow background creation with generous pause
2846
+ return [4 /*yield*/, async_test("FormsUnsubmitted cancel conditions working", function () { return sdk.api.automated_actions.getSome(); }, { onResult: function (as) {
2847
+ var _a;
2848
+ var match = as.find(function (a) { return a.automationStepId === unsub.id; });
2849
+ return !!(as.length === 1
2850
+ && (match === null || match === void 0 ? void 0 : match.status) === 'active'
2851
+ && (match === null || match === void 0 ? void 0 : match.event.type) === 'formsUnsubmitted'
2852
+ && ((_a = match.event.info.cancelConditions) === null || _a === void 0 ? void 0 : _a.find(function (c) {
2853
+ return c.type === 'formResponses'
2854
+ && c.info.automationStepId === triggerStep.id
2855
+ && c.info.unsubmittedFormCount === 1;
2856
+ })));
2857
+ } })];
2858
+ case 15:
2859
+ _a.sent();
2860
+ return [4 /*yield*/, async_test("formResponses not triggered yet after 1 form remaining", function () { return sdk.api.endusers.getOne(enduser.id); }, { onResult: function (e) { var _a; return ((_a = e === null || e === void 0 ? void 0 : e.journeys) === null || _a === void 0 ? void 0 : _a[journey.id]) !== 'formsSubmitted'; } })];
2861
+ case 16:
2862
+ _a.sent();
2863
+ return [4 /*yield*/, sdk.api.form_responses.submit_form_response({ accessCode: form_responses[1].accessCode, automationStepId: triggerStep.id, responses: [{
2864
+ answer: {
2865
+ type: 'string',
2866
+ value: 'answer'
2867
+ },
2868
+ fieldId: field.id,
2869
+ fieldTitle: field.title,
2870
+ }] })];
2871
+ case 17:
2872
+ _a.sent();
2873
+ return [4 /*yield*/, wait(undefined, 2500)]; // allow background creation with generous pause
2874
+ case 18:
2875
+ _a.sent(); // allow background creation with generous pause
2876
+ return [4 /*yield*/, async_test("FormsUnsubmitted cancel conditions work", function () { return sdk.api.automated_actions.getSome(); }, { onResult: function (as) {
2877
+ var _a;
2878
+ var match = as.find(function (a) { return a.automationStepId === unsub.id; });
2879
+ return !!(as.length === 2 // this now includes formResponses event as well, which we test has worked in the next test
2880
+ && (match === null || match === void 0 ? void 0 : match.status) === 'cancelled'
2881
+ && (match === null || match === void 0 ? void 0 : match.event.type) === 'formsUnsubmitted'
2882
+ && ((_a = match.event.info.cancelConditions) === null || _a === void 0 ? void 0 : _a.find(function (c) {
2883
+ return c.type === 'formResponses'
2884
+ && c.info.automationStepId === triggerStep.id
2885
+ && c.info.unsubmittedFormCount === 0;
2886
+ })));
2887
+ } })];
2888
+ case 19:
2889
+ _a.sent();
2890
+ return [4 /*yield*/, async_test("formResponses triggered after both forms submitted", function () { return sdk.api.endusers.getOne(enduser.id); }, { onResult: function (e) { var _a; return ((_a = e === null || e === void 0 ? void 0 : e.journeys) === null || _a === void 0 ? void 0 : _a[journey.id]) === 'formsSubmitted'; } })];
2891
+ case 20:
2892
+ _a.sent();
2893
+ return [4 /*yield*/, Promise.all([
2894
+ sdk.api.forms.deleteOne(form.id),
2895
+ sdk.api.journeys.deleteOne(journey.id),
2896
+ sdk.api.endusers.deleteOne(enduser.id)
2897
+ ])];
2898
+ case 21:
2899
+ _a.sent();
2900
+ return [2 /*return*/];
2901
+ }
2902
+ });
2903
+ }); };
2725
2904
  var addToJourneyTests = function () { return __awaiter(void 0, void 0, void 0, function () {
2726
2905
  var journey, enduser, root, follow;
2727
2906
  return __generator(this, function (_a) {
@@ -2791,23 +2970,26 @@ var automation_events_tests = function () { return __awaiter(void 0, void 0, voi
2791
2970
  switch (_a.label) {
2792
2971
  case 0:
2793
2972
  log_header("Automation Events");
2794
- return [4 /*yield*/, addToJourneyTests()];
2973
+ return [4 /*yield*/, formsUnsubmittedCancelConditionTest()];
2795
2974
  case 1:
2796
2975
  _a.sent();
2797
- return [4 /*yield*/, cancelConditionsTests()];
2976
+ return [4 /*yield*/, formUnsubmittedCancelConditionTest()];
2798
2977
  case 2:
2799
2978
  _a.sent();
2800
- return [4 /*yield*/, sequenceTests()];
2979
+ return [4 /*yield*/, addToJourneyTests()];
2801
2980
  case 3:
2802
2981
  _a.sent();
2803
- return [4 /*yield*/, formEventTests()];
2982
+ return [4 /*yield*/, sequenceTests()];
2804
2983
  case 4:
2805
2984
  _a.sent();
2806
- return [4 /*yield*/, ticketEventTests()];
2985
+ return [4 /*yield*/, formEventTests()];
2807
2986
  case 5:
2808
2987
  _a.sent();
2809
- return [4 /*yield*/, removeFromJourneyTests()];
2988
+ return [4 /*yield*/, ticketEventTests()];
2810
2989
  case 6:
2990
+ _a.sent();
2991
+ return [4 /*yield*/, removeFromJourneyTests()];
2992
+ case 7:
2811
2993
  _a.sent();
2812
2994
  return [2 /*return*/];
2813
2995
  }
@@ -4056,6 +4238,7 @@ export var role_based_access_permissions_tests = function () { return __awaiter(
4056
4238
  }); };
4057
4239
  var NO_TEST = function () { };
4058
4240
  var tests = {
4241
+ automation_steps: automation_events_tests,
4059
4242
  products: NO_TEST,
4060
4243
  purchase_credits: NO_TEST,
4061
4244
  purchases: NO_TEST,
@@ -4063,7 +4246,6 @@ var tests = {
4063
4246
  appointment_booking_pages: NO_TEST,
4064
4247
  role_based_access_permissions: role_based_access_permissions_tests,
4065
4248
  chat_rooms: chat_room_tests,
4066
- automation_steps: automation_events_tests,
4067
4249
  files: files_tests,
4068
4250
  enduser_tasks: NO_TEST,
4069
4251
  care_plans: NO_TEST,
@@ -4114,7 +4296,7 @@ var tests = {
4114
4296
  log_header("API");
4115
4297
  _k.label = 1;
4116
4298
  case 1:
4117
- _k.trys.push([1, 21, , 22]);
4299
+ _k.trys.push([1, 22, , 23]);
4118
4300
  return [4 /*yield*/, Promise.all([
4119
4301
  sdk.authenticate(email, password),
4120
4302
  sdkSub.authenticate(subUserEmail, password),
@@ -4130,56 +4312,60 @@ var tests = {
4130
4312
  return [4 /*yield*/, multi_tenant_tests()]; // should come right after setup tests
4131
4313
  case 4:
4132
4314
  _k.sent(); // should come right after setup tests
4133
- return [4 /*yield*/, sub_organization_enduser_tests()];
4315
+ console.log('delete me');
4316
+ return [4 /*yield*/, automation_events_tests()];
4134
4317
  case 5:
4135
4318
  _k.sent();
4136
- return [4 /*yield*/, sub_organization_tests()];
4319
+ return [4 /*yield*/, sub_organization_enduser_tests()];
4137
4320
  case 6:
4138
4321
  _k.sent();
4139
- return [4 /*yield*/, self_serve_appointment_booking_tests()];
4322
+ return [4 /*yield*/, sub_organization_tests()];
4140
4323
  case 7:
4141
4324
  _k.sent();
4142
- return [4 /*yield*/, filter_by_date_tests()];
4325
+ return [4 /*yield*/, self_serve_appointment_booking_tests()];
4143
4326
  case 8:
4144
4327
  _k.sent();
4145
- return [4 /*yield*/, generate_user_auth_tests()];
4328
+ return [4 /*yield*/, filter_by_date_tests()];
4146
4329
  case 9:
4147
4330
  _k.sent();
4148
- return [4 /*yield*/, role_based_access_tests()];
4331
+ return [4 /*yield*/, generate_user_auth_tests()];
4149
4332
  case 10:
4150
4333
  _k.sent();
4151
- return [4 /*yield*/, generateEnduserAuthTests()];
4334
+ return [4 /*yield*/, role_based_access_tests()];
4152
4335
  case 11:
4153
4336
  _k.sent();
4154
- return [4 /*yield*/, public_form_tests()];
4337
+ return [4 /*yield*/, generateEnduserAuthTests()];
4155
4338
  case 12:
4156
4339
  _k.sent();
4157
- return [4 /*yield*/, search_tests()];
4340
+ return [4 /*yield*/, public_form_tests()];
4158
4341
  case 13:
4159
4342
  _k.sent();
4160
- return [4 /*yield*/, badInputTests()];
4343
+ return [4 /*yield*/, search_tests()];
4161
4344
  case 14:
4162
4345
  _k.sent();
4163
- return [4 /*yield*/, filterTests()];
4346
+ return [4 /*yield*/, badInputTests()];
4164
4347
  case 15:
4165
4348
  _k.sent();
4166
- return [4 /*yield*/, updatesTests()];
4349
+ return [4 /*yield*/, filterTests()];
4167
4350
  case 16:
4168
4351
  _k.sent();
4169
- return [4 /*yield*/, threadKeyTests()];
4352
+ return [4 /*yield*/, updatesTests()];
4170
4353
  case 17:
4171
4354
  _k.sent();
4172
- return [4 /*yield*/, enduserAccessTests()];
4355
+ return [4 /*yield*/, threadKeyTests()];
4173
4356
  case 18:
4174
4357
  _k.sent();
4175
- return [4 /*yield*/, enduser_session_tests()];
4358
+ return [4 /*yield*/, enduserAccessTests()];
4176
4359
  case 19:
4177
4360
  _k.sent();
4178
- return [4 /*yield*/, enduser_redaction_tests()];
4361
+ return [4 /*yield*/, enduser_session_tests()];
4179
4362
  case 20:
4180
4363
  _k.sent();
4181
- return [3 /*break*/, 22];
4364
+ return [4 /*yield*/, enduser_redaction_tests()];
4182
4365
  case 21:
4366
+ _k.sent();
4367
+ return [3 /*break*/, 23];
4368
+ case 22:
4183
4369
  err_1 = _k.sent();
4184
4370
  console.error("Failed during custom test");
4185
4371
  if (err_1.message && err_1.info) {
@@ -4189,18 +4375,18 @@ var tests = {
4189
4375
  console.error(err_1);
4190
4376
  }
4191
4377
  process.exit(1);
4192
- return [3 /*break*/, 22];
4193
- case 22:
4378
+ return [3 /*break*/, 23];
4379
+ case 23:
4194
4380
  _a = schema;
4195
4381
  _b = [];
4196
4382
  for (_c in _a)
4197
4383
  _b.push(_c);
4198
4384
  _i = 0;
4199
- _k.label = 23;
4200
- case 23:
4201
- if (!(_i < _b.length)) return [3 /*break*/, 26];
4385
+ _k.label = 24;
4386
+ case 24:
4387
+ if (!(_i < _b.length)) return [3 /*break*/, 27];
4202
4388
  _c = _b[_i];
4203
- if (!(_c in _a)) return [3 /*break*/, 25];
4389
+ if (!(_c in _a)) return [3 /*break*/, 26];
4204
4390
  n = _c;
4205
4391
  returnValidation = (_j = (_h = schema[n].customActions) === null || _h === void 0 ? void 0 : _h.create) === null || _j === void 0 ? void 0 : _j.returns;
4206
4392
  return [4 /*yield*/, run_generated_tests({
@@ -4211,41 +4397,41 @@ var tests = {
4211
4397
  create: returnValidation // ModelFields<ClientModel>,
4212
4398
  }
4213
4399
  })];
4214
- case 24:
4215
- _k.sent();
4216
- _k.label = 25;
4217
4400
  case 25:
4218
- _i++;
4219
- return [3 /*break*/, 23];
4401
+ _k.sent();
4402
+ _k.label = 26;
4220
4403
  case 26:
4404
+ _i++;
4405
+ return [3 /*break*/, 24];
4406
+ case 27:
4221
4407
  _d = tests;
4222
4408
  _e = [];
4223
4409
  for (_f in _d)
4224
4410
  _e.push(_f);
4225
4411
  _g = 0;
4226
- _k.label = 27;
4227
- case 27:
4228
- if (!(_g < _e.length)) return [3 /*break*/, 32];
4229
- _f = _e[_g];
4230
- if (!(_f in _d)) return [3 /*break*/, 31];
4231
- t = _f;
4232
4412
  _k.label = 28;
4233
4413
  case 28:
4234
- _k.trys.push([28, 30, , 31]);
4235
- return [4 /*yield*/, tests[t]()];
4414
+ if (!(_g < _e.length)) return [3 /*break*/, 33];
4415
+ _f = _e[_g];
4416
+ if (!(_f in _d)) return [3 /*break*/, 32];
4417
+ t = _f;
4418
+ _k.label = 29;
4236
4419
  case 29:
4237
- _k.sent();
4238
- return [3 /*break*/, 31];
4420
+ _k.trys.push([29, 31, , 32]);
4421
+ return [4 /*yield*/, tests[t]()];
4239
4422
  case 30:
4423
+ _k.sent();
4424
+ return [3 /*break*/, 32];
4425
+ case 31:
4240
4426
  err_2 = _k.sent();
4241
4427
  console.error("Error running test:");
4242
4428
  console.error(err_2);
4243
4429
  process.exit(1);
4244
- return [3 /*break*/, 31];
4245
- case 31:
4246
- _g++;
4247
- return [3 /*break*/, 27];
4430
+ return [3 /*break*/, 32];
4248
4431
  case 32:
4432
+ _g++;
4433
+ return [3 /*break*/, 28];
4434
+ case 33:
4249
4435
  process.exit();
4250
4436
  return [2 /*return*/];
4251
4437
  }