@tellescope/sdk 1.4.90 → 1.4.93

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.
@@ -1,6 +1,7 @@
1
1
  export declare const formUnsubmittedCancelConditionTest: () => Promise<void>;
2
2
  export declare const formsUnsubmittedCancelConditionTest: () => Promise<void>;
3
3
  export declare const formsUnsubmittedTest: () => Promise<void>;
4
+ export declare const automationSameJourneyTests: () => Promise<void>;
4
5
  export declare const meetings_tests: () => Promise<void>;
5
6
  export declare const managed_content_records_tests: () => Promise<void>;
6
7
  export declare const calendar_event_RSVPs_tests: () => Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"tests.d.ts","sourceRoot":"","sources":["../../../src/tests/tests.ts"],"names":[],"mappings":"AAw/DA,eAAO,MAAM,kCAAkC,qBA4I9C,CAAA;AAED,eAAO,MAAM,mCAAmC,qBAsK/C,CAAA;AAGD,eAAO,MAAM,oBAAoB,qBAkHhC,CAAA;AA8ID,eAAO,MAAM,cAAc,qBAqC1B,CAAA;AA0eD,eAAO,MAAM,6BAA6B,qBAgCzC,CAAA;AAED,eAAO,MAAM,0BAA0B,qBAmFtC,CAAA;AAoED,eAAO,MAAM,eAAe,qBA8C3B,CAAA;AAED,eAAO,MAAM,oBAAoB,6BAsBhC,CAAA;AAED,eAAO,MAAM,oCAAoC,qBAmJhD,CAAA;AAED,eAAO,MAAM,mCAAmC,qBAkE/C,CAAA"}
1
+ {"version":3,"file":"tests.d.ts","sourceRoot":"","sources":["../../../src/tests/tests.ts"],"names":[],"mappings":"AAw/DA,eAAO,MAAM,kCAAkC,qBA4I9C,CAAA;AAED,eAAO,MAAM,mCAAmC,qBAsK/C,CAAA;AAGD,eAAO,MAAM,oBAAoB,qBAkHhC,CAAA;AAGD,eAAO,MAAM,0BAA0B,qBAqCtC,CAAA;AA+ID,eAAO,MAAM,cAAc,qBAqC1B,CAAA;AA0eD,eAAO,MAAM,6BAA6B,qBAgCzC,CAAA;AAED,eAAO,MAAM,0BAA0B,qBAmFtC,CAAA;AAoED,eAAO,MAAM,eAAe,qBA8C3B,CAAA;AAED,eAAO,MAAM,oBAAoB,6BAsBhC,CAAA;AAED,eAAO,MAAM,oCAAoC,qBAmJhD,CAAA;AAED,eAAO,MAAM,mCAAmC,qBAkE/C,CAAA"}
@@ -3061,6 +3061,53 @@ export var formsUnsubmittedTest = function () { return __awaiter(void 0, void 0,
3061
3061
  }
3062
3062
  });
3063
3063
  }); };
3064
+ // ensure child steps come from the same journey
3065
+ export var automationSameJourneyTests = function () { return __awaiter(void 0, void 0, void 0, function () {
3066
+ var journey, journey2, badRoot;
3067
+ return __generator(this, function (_a) {
3068
+ switch (_a.label) {
3069
+ case 0:
3070
+ log_header("automationSameJourney");
3071
+ return [4 /*yield*/, sdk.api.journeys.createOne({ title: 'test journey' })];
3072
+ case 1:
3073
+ journey = _a.sent();
3074
+ return [4 /*yield*/, sdk.api.journeys.createOne({ title: 'test other journey' })
3075
+ // this action won't be fired, because patient isn't added to journey as part of tests
3076
+ ];
3077
+ case 2:
3078
+ journey2 = _a.sent();
3079
+ return [4 /*yield*/, sdk.api.automation_steps.createOne({
3080
+ journeyId: journey.id,
3081
+ events: [{ type: 'onJourneyStart', info: {} }],
3082
+ // in practice, this would send a form, so that the next step(s) could handle the response
3083
+ // but we don't want to send emails in testing, and can still attach this Id to a form response to test a trigger
3084
+ action: {
3085
+ type: 'setEnduserStatus',
3086
+ info: { status: 'start' },
3087
+ },
3088
+ })];
3089
+ case 3:
3090
+ badRoot = _a.sent();
3091
+ return [4 /*yield*/, async_test("can't create child of other journey", function () { return (sdk.api.automation_steps.createOne({
3092
+ journeyId: journey2.id,
3093
+ events: [{
3094
+ type: 'afterAction',
3095
+ info: { automationStepId: badRoot.id, delay: 0, delayInMS: 0, unit: 'Days' }
3096
+ }],
3097
+ action: { type: 'setEnduserStatus', info: { status: 'irrelevant' } },
3098
+ })); }, handleAnyError)];
3099
+ case 4:
3100
+ _a.sent();
3101
+ return [4 /*yield*/, Promise.all([
3102
+ sdk.api.journeys.deleteOne(journey.id),
3103
+ sdk.api.journeys.deleteOne(journey2.id)
3104
+ ])];
3105
+ case 5:
3106
+ _a.sent();
3107
+ return [2 /*return*/];
3108
+ }
3109
+ });
3110
+ }); };
3064
3111
  var addToJourneyTests = function () { return __awaiter(void 0, void 0, void 0, function () {
3065
3112
  var journey, enduser, root, follow;
3066
3113
  return __generator(this, function (_a) {
@@ -3130,29 +3177,32 @@ var automation_events_tests = function () { return __awaiter(void 0, void 0, voi
3130
3177
  switch (_a.label) {
3131
3178
  case 0:
3132
3179
  log_header("Automation Events");
3133
- return [4 /*yield*/, formsUnsubmittedTest()];
3180
+ return [4 /*yield*/, automationSameJourneyTests()];
3134
3181
  case 1:
3135
3182
  _a.sent();
3136
- return [4 /*yield*/, formsUnsubmittedCancelConditionTest()];
3183
+ return [4 /*yield*/, formsUnsubmittedTest()];
3137
3184
  case 2:
3138
3185
  _a.sent();
3139
- return [4 /*yield*/, formUnsubmittedCancelConditionTest()];
3186
+ return [4 /*yield*/, formsUnsubmittedCancelConditionTest()];
3140
3187
  case 3:
3141
3188
  _a.sent();
3142
- return [4 /*yield*/, addToJourneyTests()];
3189
+ return [4 /*yield*/, formUnsubmittedCancelConditionTest()];
3143
3190
  case 4:
3144
3191
  _a.sent();
3145
- return [4 /*yield*/, sequenceTests()];
3192
+ return [4 /*yield*/, addToJourneyTests()];
3146
3193
  case 5:
3147
3194
  _a.sent();
3148
- return [4 /*yield*/, formEventTests()];
3195
+ return [4 /*yield*/, sequenceTests()];
3149
3196
  case 6:
3150
3197
  _a.sent();
3151
- return [4 /*yield*/, ticketEventTests()];
3198
+ return [4 /*yield*/, formEventTests()];
3152
3199
  case 7:
3153
3200
  _a.sent();
3154
- return [4 /*yield*/, removeFromJourneyTests()];
3201
+ return [4 /*yield*/, ticketEventTests()];
3155
3202
  case 8:
3203
+ _a.sent();
3204
+ return [4 /*yield*/, removeFromJourneyTests()];
3205
+ case 9:
3156
3206
  _a.sent();
3157
3207
  return [2 /*return*/];
3158
3208
  }
@@ -4171,10 +4221,10 @@ export var self_serve_appointment_booking_tests = function () { return __awaiter
4171
4221
  switch (_a.label) {
4172
4222
  case 0:
4173
4223
  log_header("Self Serve Appointment Booking");
4174
- return [4 /*yield*/, sdk.api.endusers.createOne({ email: 'ny@tellescope.com', state: 'NY' })];
4224
+ return [4 /*yield*/, sdk.api.endusers.createOne({ email: 'sebass+ny@tellescope.com', state: 'NY' })];
4175
4225
  case 1:
4176
4226
  e1 = _a.sent();
4177
- return [4 /*yield*/, sdk.api.endusers.createOne({ email: 'ca@tellescope.com', state: 'CA' })];
4227
+ return [4 /*yield*/, sdk.api.endusers.createOne({ email: 'sebass+ca@tellescope.com', state: 'CA' })];
4178
4228
  case 2:
4179
4229
  e2 = _a.sent();
4180
4230
  return [4 /*yield*/, sdk.api.endusers.set_password({ id: e1.id, password: password })];
@@ -4231,7 +4281,7 @@ export var self_serve_appointment_booking_tests = function () { return __awaiter
4231
4281
  case 8:
4232
4282
  _a.sent();
4233
4283
  // NY Enduser Tests
4234
- return [4 /*yield*/, enduserSDK.authenticate('ny@tellescope.com', password).catch(console.error)];
4284
+ return [4 /*yield*/, enduserSDK.authenticate('sebass+ny@tellescope.com', password).catch(console.error)];
4235
4285
  case 9:
4236
4286
  // NY Enduser Tests
4237
4287
  _a.sent();