@tellescope/sdk 1.68.7 → 1.68.8
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 +231 -74
- package/lib/cjs/tests/tests.js.map +1 -1
- package/lib/esm/session.d.ts +0 -1
- package/lib/esm/session.d.ts.map +1 -1
- package/lib/esm/tests/tests.d.ts.map +1 -1
- package/lib/esm/tests/tests.js +221 -64
- package/lib/esm/tests/tests.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -8
- package/src/tests/tests.ts +170 -1
- 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":"AAqmEA,eAAO,MAAM,kCAAkC,qBAgJ9C,CAAA;AAED,eAAO,MAAM,mCAAmC,qBA2K/C,CAAA;AAGD,eAAO,MAAM,oBAAoB,qBAoHhC,CAAA;AAED,eAAO,MAAM,+BAA+B,qBAsF3C,CAAA;AAID,eAAO,MAAM,0BAA0B,qBAqCtC,CAAA;AAsfD,eAAO,MAAM,cAAc,qBAqC1B,CAAA;AAqiBD,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;AAqtCD,eAAO,MAAM,yBAAyB,qBA0DrC,CAAA;AAED,eAAO,MAAM,kBAAkB,qBAgG9B,CAAA;AAED,eAAO,MAAM,sBAAsB,qBA0BlC,CAAA"}
|
package/lib/cjs/tests/tests.js
CHANGED
|
@@ -89,10 +89,11 @@ var crypto_1 = __importDefault(require("crypto"));
|
|
|
89
89
|
var buffer = __importStar(require("buffer")); // only node >=15.7.0
|
|
90
90
|
var validation_1 = require("@tellescope/validation");
|
|
91
91
|
var sdk_1 = require("../sdk");
|
|
92
|
+
var utilities_1 = require("@tellescope/utilities");
|
|
92
93
|
var constants_1 = require("@tellescope/constants");
|
|
93
94
|
var schema_1 = require("@tellescope/schema");
|
|
94
95
|
var testing_1 = require("@tellescope/testing");
|
|
95
|
-
var
|
|
96
|
+
var utilities_2 = require("@tellescope/utilities");
|
|
96
97
|
var fs_1 = __importDefault(require("fs"));
|
|
97
98
|
var UniquenessViolationMessage = 'Uniqueness Violation';
|
|
98
99
|
var host = process.env.TEST_URL || 'http://localhost:8080';
|
|
@@ -887,7 +888,7 @@ var run_generated_tests = function (_a) {
|
|
|
887
888
|
if (updates.enduserId)
|
|
888
889
|
updates.enduserId = defaultEnduser.id;
|
|
889
890
|
_id = '';
|
|
890
|
-
safeName = (0,
|
|
891
|
+
safeName = (0, utilities_2.url_safe_path)(name);
|
|
891
892
|
singularName = safeName.substring(0, safeName.length - 1);
|
|
892
893
|
return [4 /*yield*/, verify_missing_defaults({ queries: queries, model: model, name: name, returns: returns })
|
|
893
894
|
// only validate id for general objects, for now
|
|
@@ -930,7 +931,7 @@ var run_generated_tests = function (_a) {
|
|
|
930
931
|
return false;
|
|
931
932
|
for (var k in instance) {
|
|
932
933
|
// @ts-ignore
|
|
933
|
-
if (!(0,
|
|
934
|
+
if (!(0, utilities_2.objects_equivalent)(instance[k], d[k]))
|
|
934
935
|
return false;
|
|
935
936
|
}
|
|
936
937
|
return true;
|
|
@@ -945,7 +946,7 @@ var run_generated_tests = function (_a) {
|
|
|
945
946
|
return false;
|
|
946
947
|
for (var k in instance) {
|
|
947
948
|
// @ts-ignore
|
|
948
|
-
if (!(0,
|
|
949
|
+
if (!(0, utilities_2.objects_equivalent)(instance[k], d[k]))
|
|
949
950
|
return false;
|
|
950
951
|
}
|
|
951
952
|
return true;
|
|
@@ -1053,7 +1054,7 @@ var enduser_tests = function (queries) {
|
|
|
1053
1054
|
return [4 /*yield*/, (0, testing_1.async_test)("update-enduser test replaceObjectFields true unset", function () { var _a; return queries.updateOne((_a = e1.id) !== null && _a !== void 0 ? _a : '', { fields: {} }, { replaceObjectFields: true }); }, passOnVoid)];
|
|
1054
1055
|
case 15:
|
|
1055
1056
|
_a.sent();
|
|
1056
|
-
return [4 /*yield*/, (0, testing_1.async_test)("get-enduser test replaceObjectFields verify true unset", function () { var _a; return queries.getOne((_a = e1.id) !== null && _a !== void 0 ? _a : ''); }, { onResult: function (e) { return (0,
|
|
1057
|
+
return [4 /*yield*/, (0, testing_1.async_test)("get-enduser test replaceObjectFields verify true unset", function () { var _a; return queries.getOne((_a = e1.id) !== null && _a !== void 0 ? _a : ''); }, { onResult: function (e) { return (0, utilities_2.objects_equivalent)(e.fields, {}); } })];
|
|
1057
1058
|
case 16:
|
|
1058
1059
|
_a.sent();
|
|
1059
1060
|
eToDup1 = { email: 'dup1@tellescope.com' };
|
|
@@ -1208,7 +1209,7 @@ var journey_tests = function (queries) {
|
|
|
1208
1209
|
return [4 /*yield*/, queries.updateOne(journey.id, { states: [{ name: 'First', priority: "N/A" }, { name: 'Added', priority: "N/A" }] }, { replaceObjectFields: true })];
|
|
1209
1210
|
case 26:
|
|
1210
1211
|
_g.sent();
|
|
1211
|
-
return [4 /*yield*/, (0, testing_1.async_test)("journey-update - insert new state at front", function () { return queries.getOne(journey.id); }, { onResult: function (j) { return (0,
|
|
1212
|
+
return [4 /*yield*/, (0, testing_1.async_test)("journey-update - insert new state at front", function () { return queries.getOne(journey.id); }, { onResult: function (j) { return (0, utilities_2.objects_equivalent)(j.states, [{ name: 'First', priority: "N/A" }, { name: 'Added', priority: "N/A" }]); } })
|
|
1212
1213
|
// removed
|
|
1213
1214
|
// await async_test(
|
|
1214
1215
|
// `journey-updateState`,
|
|
@@ -1269,12 +1270,12 @@ var journey_tests = function (queries) {
|
|
|
1269
1270
|
return [4 /*yield*/, (0, testing_1.wait)(undefined, 25)]; // wait for side effects to update endusers
|
|
1270
1271
|
case 29:
|
|
1271
1272
|
_g.sent(); // wait for side effects to update endusers
|
|
1272
|
-
return [4 /*yield*/, (0, testing_1.async_test)("journey-delete - corresponding enduser journeys are unset 1", function () { return sdk.api.endusers.getOne(e1.id); }, { onResult: function (e) { return (0,
|
|
1273
|
+
return [4 /*yield*/, (0, testing_1.async_test)("journey-delete - corresponding enduser journeys are unset 1", function () { return sdk.api.endusers.getOne(e1.id); }, { onResult: function (e) { return (0, utilities_2.objects_equivalent)(e.journeys, {}); } })];
|
|
1273
1274
|
case 30:
|
|
1274
1275
|
_g.sent();
|
|
1275
1276
|
return [4 /*yield*/, (0, testing_1.async_test)("journey-delete - corresponding enduser journeys are unset, others left", function () { return sdk.api.endusers.getOne(e2.id); }, { onResult: function (e) {
|
|
1276
1277
|
var _a;
|
|
1277
|
-
return (0,
|
|
1278
|
+
return (0, utilities_2.objects_equivalent)(e.journeys, (_a = {}, _a[journey2.id] = 'New', _a));
|
|
1278
1279
|
} })];
|
|
1279
1280
|
case 31:
|
|
1280
1281
|
_g.sent();
|
|
@@ -1822,7 +1823,7 @@ var enduserAccessTests = function () { return __awaiter(void 0, void 0, void 0,
|
|
|
1822
1823
|
return __generator(this, function (_l) {
|
|
1823
1824
|
switch (_l.label) {
|
|
1824
1825
|
case 0:
|
|
1825
|
-
endpoint = (0,
|
|
1826
|
+
endpoint = (0, utilities_2.url_safe_path)(n);
|
|
1826
1827
|
model = schema_1.schema[n];
|
|
1827
1828
|
if (n === 'webhooks')
|
|
1828
1829
|
return [2 /*return*/, "continue"]; // no default endpoints implemented
|
|
@@ -2347,7 +2348,7 @@ var formEventTests = function () { return __awaiter(void 0, void 0, void 0, func
|
|
|
2347
2348
|
return [4 /*yield*/, sdk.api.form_responses.submit_form_response({ accessCode: acNoStep, responses: [testResponse] })];
|
|
2348
2349
|
case 9:
|
|
2349
2350
|
formResponse = (_a.sent()).formResponse;
|
|
2350
|
-
(0, testing_1.assert)((0,
|
|
2351
|
+
(0, testing_1.assert)((0, utilities_2.objects_equivalent)(formResponse.responses, [testResponse]), 'bad form resonse returned', 'form response returned correctly');
|
|
2351
2352
|
return [4 /*yield*/, sdk.api.form_responses.submit_form_response({ accessCode: acStep, automationStepId: triggerStep.id, responses: [testResponse] })];
|
|
2352
2353
|
case 10:
|
|
2353
2354
|
_a.sent();
|
|
@@ -6806,6 +6807,7 @@ var tests = {
|
|
|
6806
6807
|
var TRACK_OPEN_IMAGE = Buffer.from("iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=", 'base64');
|
|
6807
6808
|
var validate_schema = function () {
|
|
6808
6809
|
var _a;
|
|
6810
|
+
(0, testing_1.log_header)("Validate Schema");
|
|
6809
6811
|
var endpoints = new Set([]);
|
|
6810
6812
|
var modelName = undefined;
|
|
6811
6813
|
for (modelName in schema_1.schema) {
|
|
@@ -6827,6 +6829,158 @@ var validate_schema = function () {
|
|
|
6827
6829
|
}
|
|
6828
6830
|
}
|
|
6829
6831
|
};
|
|
6832
|
+
var test_weighted_round_robin = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
6833
|
+
var testUsers, userIds, testAssignments, run_assignment_simulation;
|
|
6834
|
+
return __generator(this, function (_a) {
|
|
6835
|
+
switch (_a.label) {
|
|
6836
|
+
case 0:
|
|
6837
|
+
(0, testing_1.log_header)("Test validate_weighted_round_robin");
|
|
6838
|
+
testUsers = [
|
|
6839
|
+
{ id: '0', ticketAssignmentPriority: undefined },
|
|
6840
|
+
{ id: '1', ticketAssignmentPriority: 1 },
|
|
6841
|
+
{ id: '2', ticketAssignmentPriority: 2 },
|
|
6842
|
+
{ id: '3', ticketAssignmentPriority: 3 },
|
|
6843
|
+
];
|
|
6844
|
+
userIds = testUsers.map(function (u) { return u.id; });
|
|
6845
|
+
testAssignments = testUsers.map(function (u, i) { return ({
|
|
6846
|
+
id: i.toString(),
|
|
6847
|
+
key: 'test',
|
|
6848
|
+
timestamp: Date.now() - 1000,
|
|
6849
|
+
userId: u.id,
|
|
6850
|
+
}); });
|
|
6851
|
+
return [4 /*yield*/, (0, testing_1.async_test)("Both empty", function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
6852
|
+
return [2 /*return*/, (0, utilities_1.weighted_round_robin)({ assignments: [], users: [] })];
|
|
6853
|
+
}); }); }, { onResult: function (r) { return r.selected === undefined; } })];
|
|
6854
|
+
case 1:
|
|
6855
|
+
_a.sent();
|
|
6856
|
+
return [4 /*yield*/, (0, testing_1.async_test)("Single user, empty assignment", function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
6857
|
+
return [2 /*return*/, (0, utilities_1.weighted_round_robin)({ assignments: [], users: [testUsers[0]] })];
|
|
6858
|
+
}); }); }, { onResult: function (r) { return r.selected === testUsers[0].id; } })];
|
|
6859
|
+
case 2:
|
|
6860
|
+
_a.sent();
|
|
6861
|
+
return [4 /*yield*/, (0, testing_1.async_test)("Both singletons", function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
6862
|
+
return [2 /*return*/, (0, utilities_1.weighted_round_robin)({ assignments: [testAssignments[0]], users: [testUsers[0]] })];
|
|
6863
|
+
}); }); }, { onResult: function (r) { return r.selected === testUsers[0].id; } })];
|
|
6864
|
+
case 3:
|
|
6865
|
+
_a.sent();
|
|
6866
|
+
run_assignment_simulation = function (_a) {
|
|
6867
|
+
var iterations = _a.iterations, expectedSelections = _a.expectedSelections, _b = _a.users, users = _b === void 0 ? testUsers : _b, _c = _a.title, title = _c === void 0 ? "Simulation ".concat(iterations) : _c;
|
|
6868
|
+
var assignments = [];
|
|
6869
|
+
var selections = [];
|
|
6870
|
+
for (var i = 0; i < iterations; i++) {
|
|
6871
|
+
if (assignments.length !== i) {
|
|
6872
|
+
throw new Error("Invariant Violation: assignment not saved in history");
|
|
6873
|
+
}
|
|
6874
|
+
var selected = (0, utilities_1.weighted_round_robin)({ assignments: assignments, users: users }).selected;
|
|
6875
|
+
selections.push(selected);
|
|
6876
|
+
var assignment = {
|
|
6877
|
+
id: i.toString(),
|
|
6878
|
+
userId: selected || '',
|
|
6879
|
+
key: 'test',
|
|
6880
|
+
timestamp: i, // simply ensures increasing timestamps per assignment
|
|
6881
|
+
};
|
|
6882
|
+
// ensure that assignment order doesn't matter (e.g. weighted_round_robin sorts internally)
|
|
6883
|
+
if (i % 2 === 0) {
|
|
6884
|
+
assignments.push(assignment); // add to back
|
|
6885
|
+
}
|
|
6886
|
+
else {
|
|
6887
|
+
assignments.unshift(assignment); // add to front
|
|
6888
|
+
}
|
|
6889
|
+
}
|
|
6890
|
+
(0, testing_1.assert)((0, utilities_2.objects_equivalent)(selections, expectedSelections), title + '\n' + JSON.stringify({ expected: expectedSelections, got: selections }, null, 2), title);
|
|
6891
|
+
};
|
|
6892
|
+
run_assignment_simulation({ expectedSelections: [], iterations: 0 });
|
|
6893
|
+
run_assignment_simulation({ expectedSelections: [userIds[0]], iterations: 1 });
|
|
6894
|
+
run_assignment_simulation({ expectedSelections: [userIds[0], userIds[1]], iterations: 2 });
|
|
6895
|
+
run_assignment_simulation({ expectedSelections: [userIds[0], userIds[1], userIds[2]], iterations: 3 });
|
|
6896
|
+
run_assignment_simulation({ expectedSelections: [userIds[0], userIds[1], userIds[2], userIds[3]], iterations: 4 });
|
|
6897
|
+
run_assignment_simulation({ iterations: 5,
|
|
6898
|
+
expectedSelections: [
|
|
6899
|
+
userIds[0], userIds[1], userIds[2], userIds[3],
|
|
6900
|
+
userIds[0],
|
|
6901
|
+
],
|
|
6902
|
+
});
|
|
6903
|
+
run_assignment_simulation({ iterations: 6, expectedSelections: [
|
|
6904
|
+
userIds[0], userIds[1], userIds[2], userIds[3],
|
|
6905
|
+
userIds[0], userIds[2],
|
|
6906
|
+
] });
|
|
6907
|
+
run_assignment_simulation({ iterations: 7, expectedSelections: [
|
|
6908
|
+
userIds[0], userIds[1], userIds[2], userIds[3],
|
|
6909
|
+
userIds[0], userIds[2], userIds[3],
|
|
6910
|
+
] });
|
|
6911
|
+
run_assignment_simulation({ iterations: 8, expectedSelections: [
|
|
6912
|
+
userIds[0], userIds[1], userIds[2], userIds[3],
|
|
6913
|
+
userIds[0], userIds[2], userIds[3],
|
|
6914
|
+
userIds[0],
|
|
6915
|
+
] });
|
|
6916
|
+
run_assignment_simulation({ iterations: 9,
|
|
6917
|
+
expectedSelections: [
|
|
6918
|
+
userIds[0], userIds[1], userIds[2], userIds[3],
|
|
6919
|
+
userIds[0], userIds[2], userIds[3],
|
|
6920
|
+
userIds[0], userIds[3],
|
|
6921
|
+
],
|
|
6922
|
+
});
|
|
6923
|
+
run_assignment_simulation({ iterations: 10,
|
|
6924
|
+
expectedSelections: [
|
|
6925
|
+
userIds[0], userIds[1], userIds[2], userIds[3],
|
|
6926
|
+
userIds[0], userIds[2], userIds[3],
|
|
6927
|
+
userIds[0], userIds[3],
|
|
6928
|
+
userIds[0],
|
|
6929
|
+
],
|
|
6930
|
+
});
|
|
6931
|
+
run_assignment_simulation({ iterations: 11,
|
|
6932
|
+
expectedSelections: [
|
|
6933
|
+
userIds[0], userIds[1], userIds[2], userIds[3],
|
|
6934
|
+
userIds[0], userIds[2], userIds[3],
|
|
6935
|
+
userIds[0], userIds[3],
|
|
6936
|
+
userIds[0],
|
|
6937
|
+
userIds[0],
|
|
6938
|
+
],
|
|
6939
|
+
});
|
|
6940
|
+
run_assignment_simulation({ iterations: 12,
|
|
6941
|
+
expectedSelections: [
|
|
6942
|
+
userIds[0], userIds[1], userIds[2], userIds[3],
|
|
6943
|
+
userIds[0], userIds[2], userIds[3],
|
|
6944
|
+
userIds[0], userIds[3],
|
|
6945
|
+
userIds[0],
|
|
6946
|
+
userIds[0],
|
|
6947
|
+
userIds[0],
|
|
6948
|
+
],
|
|
6949
|
+
});
|
|
6950
|
+
run_assignment_simulation({ iterations: 13,
|
|
6951
|
+
expectedSelections: [
|
|
6952
|
+
userIds[0], userIds[1], userIds[2], userIds[3],
|
|
6953
|
+
userIds[0], userIds[2], userIds[3],
|
|
6954
|
+
userIds[0], userIds[3],
|
|
6955
|
+
userIds[0],
|
|
6956
|
+
userIds[0],
|
|
6957
|
+
userIds[0], userIds[1],
|
|
6958
|
+
],
|
|
6959
|
+
});
|
|
6960
|
+
run_assignment_simulation({ iterations: 14,
|
|
6961
|
+
expectedSelections: [
|
|
6962
|
+
userIds[0], userIds[1], userIds[2], userIds[3],
|
|
6963
|
+
userIds[0], userIds[2], userIds[3],
|
|
6964
|
+
userIds[0], userIds[3],
|
|
6965
|
+
userIds[0],
|
|
6966
|
+
userIds[0],
|
|
6967
|
+
userIds[0], userIds[1], userIds[2],
|
|
6968
|
+
],
|
|
6969
|
+
});
|
|
6970
|
+
run_assignment_simulation({ iterations: 15,
|
|
6971
|
+
expectedSelections: [
|
|
6972
|
+
userIds[0], userIds[1], userIds[2], userIds[3],
|
|
6973
|
+
userIds[0], userIds[2], userIds[3],
|
|
6974
|
+
userIds[0], userIds[3],
|
|
6975
|
+
userIds[0],
|
|
6976
|
+
userIds[0],
|
|
6977
|
+
userIds[0], userIds[1], userIds[2], userIds[3],
|
|
6978
|
+
],
|
|
6979
|
+
});
|
|
6980
|
+
return [2 /*return*/];
|
|
6981
|
+
}
|
|
6982
|
+
});
|
|
6983
|
+
}); };
|
|
6830
6984
|
(function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
6831
6985
|
var err_1, n, _a, _b, _c, _i, returnValidation, t, _d, _e, _f, _g, err_2;
|
|
6832
6986
|
var _h, _j;
|
|
@@ -6839,9 +6993,12 @@ var validate_schema = function () {
|
|
|
6839
6993
|
_k.sent();
|
|
6840
6994
|
_k.label = 2;
|
|
6841
6995
|
case 2:
|
|
6842
|
-
_k.trys.push([2,
|
|
6843
|
-
return [4 /*yield*/,
|
|
6996
|
+
_k.trys.push([2, 40, , 41]);
|
|
6997
|
+
return [4 /*yield*/, test_weighted_round_robin()];
|
|
6844
6998
|
case 3:
|
|
6999
|
+
_k.sent();
|
|
7000
|
+
return [4 /*yield*/, validate_schema()];
|
|
7001
|
+
case 4:
|
|
6845
7002
|
_k.sent();
|
|
6846
7003
|
return [4 /*yield*/, Promise.all([
|
|
6847
7004
|
sdk.authenticate(email, password),
|
|
@@ -6852,116 +7009,116 @@ var validate_schema = function () {
|
|
|
6852
7009
|
])
|
|
6853
7010
|
// console.log(JSON.stringify(await sdk.bulk_load({ load: [{ model: 'users' }]}), null, 2))
|
|
6854
7011
|
];
|
|
6855
|
-
case
|
|
7012
|
+
case 5:
|
|
6856
7013
|
_k.sent();
|
|
6857
7014
|
// console.log(JSON.stringify(await sdk.bulk_load({ load: [{ model: 'users' }]}), null, 2))
|
|
6858
7015
|
return [4 /*yield*/, (0, testing_1.async_test)("count exists",
|
|
6859
7016
|
// @ts-ignore
|
|
6860
7017
|
function () { return sdk.api.endusers.getSome({ returnCount: true }); }, { onResult: function (result) { return typeof result.count === 'number'; } })];
|
|
6861
|
-
case
|
|
7018
|
+
case 6:
|
|
6862
7019
|
// console.log(JSON.stringify(await sdk.bulk_load({ load: [{ model: 'users' }]}), null, 2))
|
|
6863
7020
|
_k.sent();
|
|
6864
7021
|
return [4 /*yield*/, (0, testing_1.async_test)("push_to_EHR allows missing addedResponses", function () { return sdk.api.form_responses.push_to_EHR({ id: constants_1.PLACEHOLDER_ID }); }, { shouldError: true, onError: function (e) { return (e === null || e === void 0 ? void 0 : e.message) === 'Could not find a record for the given id'; } })];
|
|
6865
|
-
case
|
|
7022
|
+
case 7:
|
|
6866
7023
|
_k.sent();
|
|
6867
7024
|
return [4 /*yield*/, mfa_tests()];
|
|
6868
|
-
case
|
|
7025
|
+
case 8:
|
|
6869
7026
|
_k.sent();
|
|
6870
7027
|
return [4 /*yield*/, setup_tests()];
|
|
6871
|
-
case
|
|
7028
|
+
case 9:
|
|
6872
7029
|
_k.sent();
|
|
6873
7030
|
return [4 /*yield*/, multi_tenant_tests()]; // should come right after setup tests
|
|
6874
|
-
case
|
|
7031
|
+
case 10:
|
|
6875
7032
|
_k.sent(); // should come right after setup tests
|
|
6876
7033
|
return [4 /*yield*/, (0, exports.alternate_phones_tests)()];
|
|
6877
|
-
case 10:
|
|
6878
|
-
_k.sent();
|
|
6879
|
-
return [4 /*yield*/, (0, exports.ticket_queue_tests)()];
|
|
6880
7034
|
case 11:
|
|
6881
7035
|
_k.sent();
|
|
6882
|
-
return [4 /*yield*/, (0, exports.
|
|
7036
|
+
return [4 /*yield*/, (0, exports.ticket_queue_tests)()];
|
|
6883
7037
|
case 12:
|
|
6884
7038
|
_k.sent();
|
|
6885
|
-
return [4 /*yield*/,
|
|
7039
|
+
return [4 /*yield*/, (0, exports.no_chained_triggers_tests)()];
|
|
6886
7040
|
case 13:
|
|
6887
7041
|
_k.sent();
|
|
6888
|
-
return [4 /*yield*/,
|
|
7042
|
+
return [4 /*yield*/, field_equals_trigger_tests()];
|
|
6889
7043
|
case 14:
|
|
6890
7044
|
_k.sent();
|
|
6891
|
-
return [4 /*yield*/,
|
|
7045
|
+
return [4 /*yield*/, test_ticket_automation_assignment_and_optimization()];
|
|
6892
7046
|
case 15:
|
|
6893
7047
|
_k.sent();
|
|
6894
|
-
return [4 /*yield*/,
|
|
7048
|
+
return [4 /*yield*/, role_based_access_tests()];
|
|
6895
7049
|
case 16:
|
|
6896
7050
|
_k.sent();
|
|
6897
|
-
return [4 /*yield*/,
|
|
7051
|
+
return [4 /*yield*/, automation_trigger_tests()];
|
|
6898
7052
|
case 17:
|
|
6899
7053
|
_k.sent();
|
|
6900
|
-
return [4 /*yield*/,
|
|
7054
|
+
return [4 /*yield*/, enduser_session_tests()];
|
|
6901
7055
|
case 18:
|
|
6902
7056
|
_k.sent();
|
|
6903
|
-
return [4 /*yield*/,
|
|
7057
|
+
return [4 /*yield*/, nextReminderInMS_tests()];
|
|
6904
7058
|
case 19:
|
|
6905
7059
|
_k.sent();
|
|
6906
|
-
return [4 /*yield*/,
|
|
7060
|
+
return [4 /*yield*/, search_tests()];
|
|
6907
7061
|
case 20:
|
|
6908
7062
|
_k.sent();
|
|
6909
|
-
return [4 /*yield*/,
|
|
7063
|
+
return [4 /*yield*/, wait_for_trigger_tests()];
|
|
6910
7064
|
case 21:
|
|
6911
7065
|
_k.sent();
|
|
6912
|
-
return [4 /*yield*/,
|
|
7066
|
+
return [4 /*yield*/, pdf_generation()];
|
|
6913
7067
|
case 22:
|
|
6914
7068
|
_k.sent();
|
|
6915
|
-
return [4 /*yield*/,
|
|
7069
|
+
return [4 /*yield*/, remove_from_journey_on_incoming_comms_tests()];
|
|
6916
7070
|
case 23:
|
|
6917
7071
|
_k.sent();
|
|
6918
|
-
return [4 /*yield*/,
|
|
7072
|
+
return [4 /*yield*/, rate_limit_tests()];
|
|
6919
7073
|
case 24:
|
|
6920
7074
|
_k.sent();
|
|
6921
|
-
return [4 /*yield*/, (
|
|
7075
|
+
return [4 /*yield*/, merge_enduser_tests()];
|
|
6922
7076
|
case 25:
|
|
6923
7077
|
_k.sent();
|
|
6924
|
-
return [4 /*yield*/,
|
|
7078
|
+
return [4 /*yield*/, (0, exports.self_serve_appointment_booking_tests)()];
|
|
6925
7079
|
case 26:
|
|
6926
7080
|
_k.sent();
|
|
6927
|
-
return [4 /*yield*/,
|
|
7081
|
+
return [4 /*yield*/, auto_reply_tests()];
|
|
6928
7082
|
case 27:
|
|
6929
7083
|
_k.sent();
|
|
6930
|
-
return [4 /*yield*/,
|
|
7084
|
+
return [4 /*yield*/, sub_organization_enduser_tests()];
|
|
6931
7085
|
case 28:
|
|
6932
7086
|
_k.sent();
|
|
6933
|
-
return [4 /*yield*/, (
|
|
7087
|
+
return [4 /*yield*/, sub_organization_tests()];
|
|
6934
7088
|
case 29:
|
|
6935
7089
|
_k.sent();
|
|
6936
|
-
return [4 /*yield*/,
|
|
7090
|
+
return [4 /*yield*/, (0, exports.filter_by_date_tests)()];
|
|
6937
7091
|
case 30:
|
|
6938
7092
|
_k.sent();
|
|
6939
|
-
return [4 /*yield*/,
|
|
7093
|
+
return [4 /*yield*/, generate_user_auth_tests()];
|
|
6940
7094
|
case 31:
|
|
6941
7095
|
_k.sent();
|
|
6942
|
-
return [4 /*yield*/,
|
|
7096
|
+
return [4 /*yield*/, generateEnduserAuthTests()];
|
|
6943
7097
|
case 32:
|
|
6944
7098
|
_k.sent();
|
|
6945
|
-
return [4 /*yield*/,
|
|
7099
|
+
return [4 /*yield*/, public_form_tests()];
|
|
6946
7100
|
case 33:
|
|
6947
7101
|
_k.sent();
|
|
6948
|
-
return [4 /*yield*/,
|
|
7102
|
+
return [4 /*yield*/, badInputTests()];
|
|
6949
7103
|
case 34:
|
|
6950
7104
|
_k.sent();
|
|
6951
|
-
return [4 /*yield*/,
|
|
7105
|
+
return [4 /*yield*/, filterTests()];
|
|
6952
7106
|
case 35:
|
|
6953
7107
|
_k.sent();
|
|
6954
|
-
return [4 /*yield*/,
|
|
7108
|
+
return [4 /*yield*/, updatesTests()];
|
|
6955
7109
|
case 36:
|
|
6956
7110
|
_k.sent();
|
|
6957
|
-
return [4 /*yield*/,
|
|
7111
|
+
return [4 /*yield*/, threadKeyTests()];
|
|
6958
7112
|
case 37:
|
|
6959
7113
|
_k.sent();
|
|
6960
|
-
return [4 /*yield*/,
|
|
7114
|
+
return [4 /*yield*/, enduserAccessTests()];
|
|
6961
7115
|
case 38:
|
|
6962
7116
|
_k.sent();
|
|
6963
|
-
return [
|
|
7117
|
+
return [4 /*yield*/, enduser_redaction_tests()];
|
|
6964
7118
|
case 39:
|
|
7119
|
+
_k.sent();
|
|
7120
|
+
return [3 /*break*/, 41];
|
|
7121
|
+
case 40:
|
|
6965
7122
|
err_1 = _k.sent();
|
|
6966
7123
|
console.error("Failed during custom test");
|
|
6967
7124
|
if (err_1.message && err_1.info) {
|
|
@@ -6971,18 +7128,18 @@ var validate_schema = function () {
|
|
|
6971
7128
|
console.error(err_1);
|
|
6972
7129
|
}
|
|
6973
7130
|
process.exit(1);
|
|
6974
|
-
return [3 /*break*/,
|
|
6975
|
-
case
|
|
7131
|
+
return [3 /*break*/, 41];
|
|
7132
|
+
case 41:
|
|
6976
7133
|
_a = schema_1.schema;
|
|
6977
7134
|
_b = [];
|
|
6978
7135
|
for (_c in _a)
|
|
6979
7136
|
_b.push(_c);
|
|
6980
7137
|
_i = 0;
|
|
6981
|
-
_k.label =
|
|
6982
|
-
case
|
|
6983
|
-
if (!(_i < _b.length)) return [3 /*break*/,
|
|
7138
|
+
_k.label = 42;
|
|
7139
|
+
case 42:
|
|
7140
|
+
if (!(_i < _b.length)) return [3 /*break*/, 45];
|
|
6984
7141
|
_c = _b[_i];
|
|
6985
|
-
if (!(_c in _a)) return [3 /*break*/,
|
|
7142
|
+
if (!(_c in _a)) return [3 /*break*/, 44];
|
|
6986
7143
|
n = _c;
|
|
6987
7144
|
returnValidation = (_j = (_h = schema_1.schema[n].customActions) === null || _h === void 0 ? void 0 : _h.create) === null || _j === void 0 ? void 0 : _j.returns;
|
|
6988
7145
|
return [4 /*yield*/, run_generated_tests({
|
|
@@ -6993,41 +7150,41 @@ var validate_schema = function () {
|
|
|
6993
7150
|
create: returnValidation // ModelFields<ClientModel>,
|
|
6994
7151
|
}
|
|
6995
7152
|
})];
|
|
6996
|
-
case 42:
|
|
6997
|
-
_k.sent();
|
|
6998
|
-
_k.label = 43;
|
|
6999
7153
|
case 43:
|
|
7000
|
-
|
|
7001
|
-
|
|
7154
|
+
_k.sent();
|
|
7155
|
+
_k.label = 44;
|
|
7002
7156
|
case 44:
|
|
7157
|
+
_i++;
|
|
7158
|
+
return [3 /*break*/, 42];
|
|
7159
|
+
case 45:
|
|
7003
7160
|
_d = tests;
|
|
7004
7161
|
_e = [];
|
|
7005
7162
|
for (_f in _d)
|
|
7006
7163
|
_e.push(_f);
|
|
7007
7164
|
_g = 0;
|
|
7008
|
-
_k.label = 45;
|
|
7009
|
-
case 45:
|
|
7010
|
-
if (!(_g < _e.length)) return [3 /*break*/, 50];
|
|
7011
|
-
_f = _e[_g];
|
|
7012
|
-
if (!(_f in _d)) return [3 /*break*/, 49];
|
|
7013
|
-
t = _f;
|
|
7014
7165
|
_k.label = 46;
|
|
7015
7166
|
case 46:
|
|
7016
|
-
|
|
7017
|
-
|
|
7167
|
+
if (!(_g < _e.length)) return [3 /*break*/, 51];
|
|
7168
|
+
_f = _e[_g];
|
|
7169
|
+
if (!(_f in _d)) return [3 /*break*/, 50];
|
|
7170
|
+
t = _f;
|
|
7171
|
+
_k.label = 47;
|
|
7018
7172
|
case 47:
|
|
7019
|
-
_k.
|
|
7020
|
-
return [
|
|
7173
|
+
_k.trys.push([47, 49, , 50]);
|
|
7174
|
+
return [4 /*yield*/, tests[t]()];
|
|
7021
7175
|
case 48:
|
|
7176
|
+
_k.sent();
|
|
7177
|
+
return [3 /*break*/, 50];
|
|
7178
|
+
case 49:
|
|
7022
7179
|
err_2 = _k.sent();
|
|
7023
7180
|
console.error("Error running test:");
|
|
7024
7181
|
console.error(err_2);
|
|
7025
7182
|
process.exit(1);
|
|
7026
|
-
return [3 /*break*/,
|
|
7027
|
-
case 49:
|
|
7028
|
-
_g++;
|
|
7029
|
-
return [3 /*break*/, 45];
|
|
7183
|
+
return [3 /*break*/, 50];
|
|
7030
7184
|
case 50:
|
|
7185
|
+
_g++;
|
|
7186
|
+
return [3 /*break*/, 46];
|
|
7187
|
+
case 51:
|
|
7031
7188
|
process.exit();
|
|
7032
7189
|
return [2 /*return*/];
|
|
7033
7190
|
}
|