@tellescope/sdk 1.64.0 → 1.64.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.
- package/lib/cjs/tests/tests.d.ts.map +1 -1
- package/lib/cjs/tests/tests.js +28 -21
- package/lib/cjs/tests/tests.js.map +1 -1
- package/lib/esm/tests/tests.d.ts.map +1 -1
- package/lib/esm/tests/tests.js +28 -21
- package/lib/esm/tests/tests.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/tests/tests.ts +22 -11
- package/test_generated.pdf +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tests.d.ts","sourceRoot":"","sources":["../../../src/tests/tests.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tests.d.ts","sourceRoot":"","sources":["../../../src/tests/tests.ts"],"names":[],"mappings":"AAygEA,eAAO,MAAM,kCAAkC,qBA4I9C,CAAA;AAED,eAAO,MAAM,mCAAmC,qBAsK/C,CAAA;AAGD,eAAO,MAAM,oBAAoB,qBAkHhC,CAAA;AAED,eAAO,MAAM,+BAA+B,qBAsF3C,CAAA;AAID,eAAO,MAAM,0BAA0B,qBAqCtC,CAAA;AA+RD,eAAO,MAAM,cAAc,qBAqC1B,CAAA;AA8hBD,eAAO,MAAM,6BAA6B,qBAgCzC,CAAA;AAED,eAAO,MAAM,0BAA0B,qBAmFtC,CAAA;AAqED,eAAO,MAAM,eAAe,qBAgD3B,CAAA;AAED,eAAO,MAAM,oBAAoB,6BAsBhC,CAAA;AAED,eAAO,MAAM,oCAAoC,qBAmKhD,CAAA;AAED,eAAO,MAAM,mCAAmC,qBAkE/C,CAAA"}
|
package/lib/esm/tests/tests.js
CHANGED
|
@@ -1493,21 +1493,27 @@ var chat_room_tests = function () { return __awaiter(void 0, void 0, void 0, fun
|
|
|
1493
1493
|
return [4 /*yield*/, async_test("get-chat-room (join successful)", function () { return sdk2.api.chat_rooms.getOne(emptyRoom.id); }, { onResult: function (r) { return r.id === emptyRoom.id; } })];
|
|
1494
1494
|
case 18:
|
|
1495
1495
|
_j.sent();
|
|
1496
|
-
return [4 /*yield*/, async_test("
|
|
1496
|
+
return [4 /*yield*/, async_test("create-chat (join successful)", function () { return sdk2.api.chats.createOne({ roomId: emptyRoom.id, message: 'test' }); }, passOnAnyResult)];
|
|
1497
1497
|
case 19:
|
|
1498
1498
|
_j.sent();
|
|
1499
|
-
return [4 /*yield*/,
|
|
1499
|
+
return [4 /*yield*/, async_test("get-chat (join successful)", function () { return sdk2.api.chats.getSome({ filter: { roomId: emptyRoom.id } }); }, { onResult: function (r) { return r.length > 0; } })];
|
|
1500
1500
|
case 20:
|
|
1501
1501
|
_j.sent();
|
|
1502
|
-
return [4 /*yield*/,
|
|
1502
|
+
return [4 /*yield*/, async_test("[bulk] get-chat-room (join successful)", function () { return sdk2.bulk_load({ load: [{ model: 'chat_rooms' }] }); }, { onResult: function (r) { var _a, _b, _c; return (_c = (_b = (_a = r.results) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.records) === null || _c === void 0 ? void 0 : _c.find(function (r) { return r.id === emptyRoom.id; }); } })];
|
|
1503
1503
|
case 21:
|
|
1504
|
+
_j.sent();
|
|
1505
|
+
return [4 /*yield*/, enduserSDK.logout()];
|
|
1506
|
+
case 22:
|
|
1507
|
+
_j.sent();
|
|
1508
|
+
return [4 /*yield*/, sdk.api.endusers.getOne(enduser.id)];
|
|
1509
|
+
case 23:
|
|
1504
1510
|
loggedOutEnduser = _j.sent();
|
|
1505
1511
|
assert(new Date(loggedOutEnduser.lastLogout).getTime() > Date.now() - 100, 'lastLogout fail for enduser', 'lastLogout for enduser');
|
|
1506
1512
|
return [4 /*yield*/, sdk.api.endusers.deleteOne(enduser.id)];
|
|
1507
|
-
case
|
|
1513
|
+
case 24:
|
|
1508
1514
|
_j.sent();
|
|
1509
1515
|
return [4 /*yield*/, sdk.api.chat_rooms.deleteOne(emptyRoom.id)];
|
|
1510
|
-
case
|
|
1516
|
+
case 25:
|
|
1511
1517
|
_j.sent();
|
|
1512
1518
|
return [2 /*return*/];
|
|
1513
1519
|
}
|
|
@@ -5136,7 +5142,7 @@ var wait_for_trigger_tests = function () { return __awaiter(void 0, void 0, void
|
|
|
5136
5142
|
return [4 /*yield*/, sdk.api.endusers.add_to_journey({ enduserIds: [eTrigger.id], journeyId: journey.id })];
|
|
5137
5143
|
case 6:
|
|
5138
5144
|
_b.sent();
|
|
5139
|
-
return [4 /*yield*/, wait(undefined,
|
|
5145
|
+
return [4 /*yield*/, wait(undefined, 8000)];
|
|
5140
5146
|
case 7:
|
|
5141
5147
|
_b.sent();
|
|
5142
5148
|
return [4 /*yield*/, async_test("Journey started", function () { return sdk.api.endusers.getOne(eTrigger.id); }, { onResult: function (e) { var _a; return ((_a = e.journeys) === null || _a === void 0 ? void 0 : _a[journey.id]) === 'Started'; } })];
|
|
@@ -5148,7 +5154,7 @@ var wait_for_trigger_tests = function () { return __awaiter(void 0, void 0, void
|
|
|
5148
5154
|
return [4 /*yield*/, sdk.api.endusers.updateOne(eNoTrigger.id, { fields: { Test: 'Trigger' } })];
|
|
5149
5155
|
case 10:
|
|
5150
5156
|
_b.sent();
|
|
5151
|
-
return [4 /*yield*/, wait(undefined,
|
|
5157
|
+
return [4 /*yield*/, wait(undefined, 3000)
|
|
5152
5158
|
// TODO - Test a delayed action which comes after the triggered action
|
|
5153
5159
|
];
|
|
5154
5160
|
case 11:
|
|
@@ -5344,7 +5350,7 @@ var remove_from_journey_on_incoming_comms_tests = function () { return __awaiter
|
|
|
5344
5350
|
return [4 /*yield*/, sdk.api.endusers.updateOne(e2.id, { journeys: (_d = {}, _d[jRemove.id] = '', _d[jDontRemove.id] = '', _d) })];
|
|
5345
5351
|
case 8:
|
|
5346
5352
|
_e.sent();
|
|
5347
|
-
return [4 /*yield*/, wait(undefined,
|
|
5353
|
+
return [4 /*yield*/, wait(undefined, 100)];
|
|
5348
5354
|
case 9:
|
|
5349
5355
|
_e.sent();
|
|
5350
5356
|
return [4 /*yield*/, sdk.api.chat_rooms.createOne({})];
|
|
@@ -5353,30 +5359,31 @@ var remove_from_journey_on_incoming_comms_tests = function () { return __awaiter
|
|
|
5353
5359
|
return [4 /*yield*/, sdk.api.chats.createOne({ roomId: room.id, senderId: e1.id, message: 'cancel' })];
|
|
5354
5360
|
case 11:
|
|
5355
5361
|
_e.sent();
|
|
5356
|
-
return [4 /*yield*/, wait(undefined,
|
|
5362
|
+
return [4 /*yield*/, wait(undefined, 100)];
|
|
5357
5363
|
case 12:
|
|
5358
5364
|
_e.sent();
|
|
5365
|
+
console.log(jRemove.id, removeStep2.id, e1.id);
|
|
5359
5366
|
return [4 /*yield*/, async_test("Appropriate Automated Actions are cancelled on incoming message", function () { return sdk.api.automated_actions.getSome(); }, { onResult: function (actions) { return (!!actions.find(function (a) {
|
|
5360
5367
|
return a.journeyId === jRemove.id
|
|
5361
|
-
&& a.automationStepId ===
|
|
5368
|
+
&& a.automationStepId === removeStep1.id
|
|
5362
5369
|
&& a.enduserId === e1.id
|
|
5363
5370
|
&& a.status === 'cancelled';
|
|
5364
5371
|
})
|
|
5365
5372
|
&& !!actions.find(function (a) {
|
|
5366
5373
|
return a.journeyId === jRemove.id
|
|
5367
|
-
&& a.automationStepId ===
|
|
5374
|
+
&& a.automationStepId === removeStep1.id
|
|
5368
5375
|
&& a.enduserId === e2.id
|
|
5369
5376
|
&& a.status === 'active';
|
|
5370
5377
|
})
|
|
5371
5378
|
&& !!actions.find(function (a) {
|
|
5372
5379
|
return a.journeyId === jDontRemove.id
|
|
5373
|
-
&& a.automationStepId ===
|
|
5380
|
+
&& a.automationStepId === dontRemoveStep1.id
|
|
5374
5381
|
&& a.enduserId === e1.id
|
|
5375
5382
|
&& a.status === 'active';
|
|
5376
5383
|
})
|
|
5377
5384
|
&& !!actions.find(function (a) {
|
|
5378
5385
|
return a.journeyId === jDontRemove.id
|
|
5379
|
-
&& a.automationStepId ===
|
|
5386
|
+
&& a.automationStepId === dontRemoveStep1.id
|
|
5380
5387
|
&& a.enduserId === e2.id
|
|
5381
5388
|
&& a.status === 'active';
|
|
5382
5389
|
})); } })];
|
|
@@ -5390,7 +5397,7 @@ var remove_from_journey_on_incoming_comms_tests = function () { return __awaiter
|
|
|
5390
5397
|
_e.sent();
|
|
5391
5398
|
return [4 /*yield*/, async_test("handle_incoming_communication test for other enduser", function () { return sdk.api.automated_actions.getSome(); }, { onResult: function (actions) { return (!!actions.find(function (a) {
|
|
5392
5399
|
return a.journeyId === jRemove.id
|
|
5393
|
-
&& a.automationStepId ===
|
|
5400
|
+
&& a.automationStepId === removeStep1.id
|
|
5394
5401
|
&& a.enduserId === e2.id
|
|
5395
5402
|
&& a.status === 'cancelled';
|
|
5396
5403
|
})); } })];
|
|
@@ -5582,22 +5589,22 @@ var TRACK_OPEN_IMAGE = Buffer.from("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwC
|
|
|
5582
5589
|
return [4 /*yield*/, setup_tests()];
|
|
5583
5590
|
case 7:
|
|
5584
5591
|
_k.sent();
|
|
5585
|
-
return [4 /*yield*/,
|
|
5592
|
+
return [4 /*yield*/, wait_for_trigger_tests()];
|
|
5586
5593
|
case 8:
|
|
5587
5594
|
_k.sent();
|
|
5588
|
-
return [4 /*yield*/,
|
|
5595
|
+
return [4 /*yield*/, role_based_access_tests()];
|
|
5589
5596
|
case 9:
|
|
5597
|
+
_k.sent();
|
|
5598
|
+
return [4 /*yield*/, multi_tenant_tests()]; // should come right after setup tests
|
|
5599
|
+
case 10:
|
|
5590
5600
|
_k.sent(); // should come right after setup tests
|
|
5591
5601
|
return [4 /*yield*/, pdf_generation()];
|
|
5592
|
-
case 10:
|
|
5593
|
-
_k.sent();
|
|
5594
|
-
return [4 /*yield*/, remove_from_journey_on_incoming_comms_tests()];
|
|
5595
5602
|
case 11:
|
|
5596
5603
|
_k.sent();
|
|
5597
|
-
return [4 /*yield*/,
|
|
5604
|
+
return [4 /*yield*/, remove_from_journey_on_incoming_comms_tests()];
|
|
5598
5605
|
case 12:
|
|
5599
5606
|
_k.sent();
|
|
5600
|
-
return [4 /*yield*/,
|
|
5607
|
+
return [4 /*yield*/, rate_limit_tests()];
|
|
5601
5608
|
case 13:
|
|
5602
5609
|
_k.sent();
|
|
5603
5610
|
return [4 /*yield*/, merge_enduser_tests()];
|