@tellescope/sdk 1.256.11 → 1.256.12
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/api_tests/active_patient_count.test.d.ts +15 -0
- package/lib/cjs/tests/api_tests/active_patient_count.test.d.ts.map +1 -0
- package/lib/cjs/tests/api_tests/active_patient_count.test.js +594 -0
- package/lib/cjs/tests/api_tests/active_patient_count.test.js.map +1 -0
- package/lib/cjs/tests/api_tests/out_of_office_endpoint.test.d.ts +6 -0
- package/lib/cjs/tests/api_tests/out_of_office_endpoint.test.d.ts.map +1 -0
- package/lib/cjs/tests/api_tests/out_of_office_endpoint.test.js +192 -0
- package/lib/cjs/tests/api_tests/out_of_office_endpoint.test.js.map +1 -0
- package/lib/cjs/tests/api_tests/security/enduser-ai-summary-trust-gate.test.d.ts +5 -0
- package/lib/cjs/tests/api_tests/security/enduser-ai-summary-trust-gate.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/security/enduser-ai-summary-trust-gate.test.js +95 -31
- package/lib/cjs/tests/api_tests/security/enduser-ai-summary-trust-gate.test.js.map +1 -1
- package/lib/cjs/tests/tests.d.ts.map +1 -1
- package/lib/cjs/tests/tests.js +152 -148
- package/lib/cjs/tests/tests.js.map +1 -1
- package/lib/esm/tests/api_tests/active_patient_count.test.d.ts +15 -0
- package/lib/esm/tests/api_tests/active_patient_count.test.d.ts.map +1 -0
- package/lib/esm/tests/api_tests/active_patient_count.test.js +590 -0
- package/lib/esm/tests/api_tests/active_patient_count.test.js.map +1 -0
- package/lib/esm/tests/api_tests/out_of_office_endpoint.test.d.ts +6 -0
- package/lib/esm/tests/api_tests/out_of_office_endpoint.test.d.ts.map +1 -0
- package/lib/esm/tests/api_tests/out_of_office_endpoint.test.js +188 -0
- package/lib/esm/tests/api_tests/out_of_office_endpoint.test.js.map +1 -0
- package/lib/esm/tests/api_tests/security/enduser-ai-summary-trust-gate.test.d.ts +5 -0
- package/lib/esm/tests/api_tests/security/enduser-ai-summary-trust-gate.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/security/enduser-ai-summary-trust-gate.test.js +95 -31
- package/lib/esm/tests/api_tests/security/enduser-ai-summary-trust-gate.test.js.map +1 -1
- package/lib/esm/tests/tests.d.ts.map +1 -1
- package/lib/esm/tests/tests.js +152 -148
- package/lib/esm/tests/tests.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +10 -10
- package/src/tests/api_tests/active_patient_count.test.ts +435 -0
- package/src/tests/api_tests/security/enduser-ai-summary-trust-gate.test.ts +56 -0
- package/src/tests/tests.ts +2 -0
- package/test_generated.pdf +0 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Session } from "../../sdk";
|
|
2
|
+
/**
|
|
3
|
+
* Locks in the behavior of getEngagedEndusers (endusers/engagement), which backs both the billing
|
|
4
|
+
* /usage endpoint and the super-admin active patient count. Every case creates exactly one
|
|
5
|
+
* qualifying (or deliberately non-qualifying) engagement record and asserts its effect on the
|
|
6
|
+
* distinct enduser count.
|
|
7
|
+
*
|
|
8
|
+
* All assertions are made inside a time window opened at the top of the test, so unrelated records
|
|
9
|
+
* left behind by other suites can't move the numbers.
|
|
10
|
+
*/
|
|
11
|
+
export declare const active_patient_count_tests: ({ sdk, sdkNonAdmin }: {
|
|
12
|
+
sdk: Session;
|
|
13
|
+
sdkNonAdmin: Session;
|
|
14
|
+
}) => Promise<void>;
|
|
15
|
+
//# sourceMappingURL=active_patient_count.test.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"active_patient_count.test.d.ts","sourceRoot":"","sources":["../../../../src/tests/api_tests/active_patient_count.test.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAkB,MAAM,WAAW,CAAA;AAmBnD;;;;;;;;GAQG;AACH,eAAO,MAAM,0BAA0B;SAAwC,OAAO;iBAAe,OAAO;mBA+X3G,CAAA"}
|
|
@@ -0,0 +1,594 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
+
function step(op) {
|
|
27
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
29
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
30
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
+
switch (op[0]) {
|
|
32
|
+
case 0: case 1: t = op; break;
|
|
33
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
+
default:
|
|
37
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
+
if (t[2]) _.ops.pop();
|
|
42
|
+
_.trys.pop(); continue;
|
|
43
|
+
}
|
|
44
|
+
op = body.call(thisArg, _);
|
|
45
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
50
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
51
|
+
if (ar || !(i in from)) {
|
|
52
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
53
|
+
ar[i] = from[i];
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
57
|
+
};
|
|
58
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
59
|
+
exports.active_patient_count_tests = void 0;
|
|
60
|
+
require('source-map-support').install();
|
|
61
|
+
var sdk_1 = require("../../sdk");
|
|
62
|
+
var testing_1 = require("@tellescope/testing");
|
|
63
|
+
var setup_1 = require("../setup");
|
|
64
|
+
var host = process.env.API_URL || 'http://localhost:8080';
|
|
65
|
+
var businessId = '60398b1131a295e64f084ff6';
|
|
66
|
+
// Second-tenant session, used to prove the active patient count never crosses tenants.
|
|
67
|
+
// Same key used by the org-isolation tests in tests.ts.
|
|
68
|
+
var OTHER_TENANT_API_KEY = "ba745e25162bb95a795c5fa1af70df188d93c4d3aac9c48b34a5c8c9dd7b80f7";
|
|
69
|
+
// Arbitrary valid ObjectId — endusers carrying a customTypeId are excluded from the default count
|
|
70
|
+
var TEST_CUSTOM_TYPE_ID = '60398b0231a295e64f084fd9';
|
|
71
|
+
/**
|
|
72
|
+
* Locks in the behavior of getEngagedEndusers (endusers/engagement), which backs both the billing
|
|
73
|
+
* /usage endpoint and the super-admin active patient count. Every case creates exactly one
|
|
74
|
+
* qualifying (or deliberately non-qualifying) engagement record and asserts its effect on the
|
|
75
|
+
* distinct enduser count.
|
|
76
|
+
*
|
|
77
|
+
* All assertions are made inside a time window opened at the top of the test, so unrelated records
|
|
78
|
+
* left behind by other suites can't move the numbers.
|
|
79
|
+
*/
|
|
80
|
+
var active_patient_count_tests = function (_a) {
|
|
81
|
+
var sdk = _a.sdk, sdkNonAdmin = _a.sdkNonAdmin;
|
|
82
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
83
|
+
var userId, windowStart, activeCount, onlyCase, onlyThisTest, _b, eEmail, eEmailOutbound, eSMS, eSMSOutbound, eCallInbound, eCallLongOutbound, eCallShortOutbound, eChat, eChatNoEnduser, eForm, eFormUnsubmitted, eFormOtherForm, eCalendar, eCalendarUserOnly, eCalendarPastStart, eGroupMMS, eGroupMMSUserSender, eDedupe, eCustomType, eInactive, createdEnduserIds, chatRoomIds, conversationIds, calendarEventIds, formIds, chatRoom, chatRoomNoEnduser, formA_1, fieldA, formB, fieldB, submitForm, calendarEvent, calendarEventUserOnly, calendarEventPastStart, conversation, dedupeRoom, EXPECTED_ACTIVE_1, expectActive, afterAll_1, enduserSDK_1, sdkOther_1, otherWindowStart_1, otherEnduser;
|
|
84
|
+
return __generator(this, function (_c) {
|
|
85
|
+
switch (_c.label) {
|
|
86
|
+
case 0:
|
|
87
|
+
(0, testing_1.log_header)("Active Patient Count Tests");
|
|
88
|
+
userId = sdk.userInfo.id;
|
|
89
|
+
windowStart = new Date(Date.now() - 2000);
|
|
90
|
+
activeCount = function (args) {
|
|
91
|
+
if (args === void 0) { args = {}; }
|
|
92
|
+
return (sdk.api.endusers.get_engagement_statistics(__assign({ range: { from: windowStart } }, args))
|
|
93
|
+
.then(function (r) { return r.count; }));
|
|
94
|
+
};
|
|
95
|
+
onlyCase = function (apcCase) { return activeCount({ enduserFields: [{ field: 'fields.apcCase', value: apcCase }] }); };
|
|
96
|
+
onlyThisTest = function (args) {
|
|
97
|
+
if (args === void 0) { args = {}; }
|
|
98
|
+
return activeCount(__assign(__assign({}, args), { enduserFields: [{ field: 'fields.apcCase', value: '$exists' }] }));
|
|
99
|
+
};
|
|
100
|
+
return [4 /*yield*/, sdk.api.endusers.createSome([
|
|
101
|
+
{ fname: 'apc-email', fields: { apcCase: 'email', apcTag: 'yes', apcGroup: 'A' } },
|
|
102
|
+
{ fname: 'apc-email-outbound', fields: { apcCase: 'email-outbound' } },
|
|
103
|
+
{ fname: 'apc-sms', fields: { apcCase: 'sms', apcTag: 'yes', apcGroup: 'A' } },
|
|
104
|
+
{ fname: 'apc-sms-outbound', fields: { apcCase: 'sms-outbound' } },
|
|
105
|
+
{ fname: 'apc-call-inbound', fields: { apcCase: 'call-inbound', apcGroup: 'B' } },
|
|
106
|
+
{ fname: 'apc-call-long-outbound', fields: { apcCase: 'call-long-outbound', apcGroup: 'B' } },
|
|
107
|
+
{ fname: 'apc-call-short-outbound', fields: { apcCase: 'call-short-outbound' } },
|
|
108
|
+
{ fname: 'apc-chat', fields: { apcCase: 'chat', apcGroup: 'B' } },
|
|
109
|
+
{ fname: 'apc-chat-no-enduserid', fields: { apcCase: 'chat-no-enduserid' } },
|
|
110
|
+
{ fname: 'apc-form', fields: { apcCase: 'form', apcGroup: 'C' } },
|
|
111
|
+
{ fname: 'apc-form-unsubmitted', fields: { apcCase: 'form-unsubmitted' } },
|
|
112
|
+
{ fname: 'apc-form-other-form', fields: { apcCase: 'form-other-form', apcGroup: 'C' } },
|
|
113
|
+
// deliberately has no apcGroup, so the $exists case below is narrower than the total
|
|
114
|
+
{ fname: 'apc-calendar', fields: { apcCase: 'calendar' } },
|
|
115
|
+
{ fname: 'apc-calendar-user-only', fields: { apcCase: 'calendar-user-only' } },
|
|
116
|
+
{ fname: 'apc-calendar-past-start', fields: { apcCase: 'calendar-past-start' } },
|
|
117
|
+
{ fname: 'apc-group-mms', fields: { apcCase: 'group-mms', apcGroup: 'D' } },
|
|
118
|
+
{ fname: 'apc-group-mms-user-sender', fields: { apcCase: 'group-mms-user-sender' } },
|
|
119
|
+
{ fname: 'apc-dedupe', fields: { apcCase: 'dedupe', apcTag: 'yes', apcGroup: 'D' } },
|
|
120
|
+
{ fname: 'apc-custom-type', customTypeId: TEST_CUSTOM_TYPE_ID, fields: { apcCase: 'custom-type' } },
|
|
121
|
+
{ fname: 'apc-inactive', fields: { apcCase: 'inactive' } },
|
|
122
|
+
])];
|
|
123
|
+
case 1:
|
|
124
|
+
_b = (_c.sent()).created, eEmail = _b[0], eEmailOutbound = _b[1], eSMS = _b[2], eSMSOutbound = _b[3], eCallInbound = _b[4], eCallLongOutbound = _b[5], eCallShortOutbound = _b[6], eChat = _b[7], eChatNoEnduser = _b[8], eForm = _b[9], eFormUnsubmitted = _b[10], eFormOtherForm = _b[11], eCalendar = _b[12], eCalendarUserOnly = _b[13], eCalendarPastStart = _b[14], eGroupMMS = _b[15], eGroupMMSUserSender = _b[16], eDedupe = _b[17], eCustomType = _b[18], eInactive = _b[19];
|
|
125
|
+
createdEnduserIds = [
|
|
126
|
+
eEmail, eEmailOutbound, eSMS, eSMSOutbound, eCallInbound, eCallLongOutbound, eCallShortOutbound,
|
|
127
|
+
eChat, eChatNoEnduser, eForm, eFormUnsubmitted, eFormOtherForm, eCalendar, eCalendarUserOnly,
|
|
128
|
+
eCalendarPastStart, eGroupMMS, eGroupMMSUserSender, eDedupe, eCustomType, eInactive,
|
|
129
|
+
].map(function (e) { return e.id; });
|
|
130
|
+
chatRoomIds = [];
|
|
131
|
+
conversationIds = [];
|
|
132
|
+
calendarEventIds = [];
|
|
133
|
+
formIds = [];
|
|
134
|
+
_c.label = 2;
|
|
135
|
+
case 2:
|
|
136
|
+
_c.trys.push([2, , 75, 77]);
|
|
137
|
+
// --- emails ---------------------------------------------------------------------------------
|
|
138
|
+
return [4 /*yield*/, sdk.api.emails.createOne({
|
|
139
|
+
logOnly: true, inbound: true,
|
|
140
|
+
userId: userId,
|
|
141
|
+
enduserId: eEmail.id, subject: 'apc inbound', textContent: 'inbound email',
|
|
142
|
+
})
|
|
143
|
+
// outbound with no link opens does not qualify
|
|
144
|
+
];
|
|
145
|
+
case 3:
|
|
146
|
+
// --- emails ---------------------------------------------------------------------------------
|
|
147
|
+
_c.sent();
|
|
148
|
+
// outbound with no link opens does not qualify
|
|
149
|
+
return [4 /*yield*/, sdk.api.emails.createOne({
|
|
150
|
+
logOnly: true, inbound: false,
|
|
151
|
+
userId: userId,
|
|
152
|
+
enduserId: eEmailOutbound.id, subject: 'apc outbound', textContent: 'outbound email',
|
|
153
|
+
})
|
|
154
|
+
// --- sms_messages ---------------------------------------------------------------------------
|
|
155
|
+
];
|
|
156
|
+
case 4:
|
|
157
|
+
// outbound with no link opens does not qualify
|
|
158
|
+
_c.sent();
|
|
159
|
+
// --- sms_messages ---------------------------------------------------------------------------
|
|
160
|
+
return [4 /*yield*/, sdk.api.sms_messages.createOne({
|
|
161
|
+
logOnly: true, inbound: true,
|
|
162
|
+
userId: userId,
|
|
163
|
+
enduserId: eSMS.id, message: 'apc inbound sms',
|
|
164
|
+
})];
|
|
165
|
+
case 5:
|
|
166
|
+
// --- sms_messages ---------------------------------------------------------------------------
|
|
167
|
+
_c.sent();
|
|
168
|
+
return [4 /*yield*/, sdk.api.sms_messages.createOne({
|
|
169
|
+
logOnly: true, inbound: false,
|
|
170
|
+
userId: userId,
|
|
171
|
+
enduserId: eSMSOutbound.id, message: 'apc outbound sms',
|
|
172
|
+
})
|
|
173
|
+
// --- phone_calls ----------------------------------------------------------------------------
|
|
174
|
+
// inbound qualifies regardless of duration
|
|
175
|
+
];
|
|
176
|
+
case 6:
|
|
177
|
+
_c.sent();
|
|
178
|
+
// --- phone_calls ----------------------------------------------------------------------------
|
|
179
|
+
// inbound qualifies regardless of duration
|
|
180
|
+
return [4 /*yield*/, sdk.api.phone_calls.createOne({ enduserId: eCallInbound.id, inbound: true, userId: userId })
|
|
181
|
+
// outbound qualifies only at >= 60 seconds
|
|
182
|
+
];
|
|
183
|
+
case 7:
|
|
184
|
+
// --- phone_calls ----------------------------------------------------------------------------
|
|
185
|
+
// inbound qualifies regardless of duration
|
|
186
|
+
_c.sent();
|
|
187
|
+
// outbound qualifies only at >= 60 seconds
|
|
188
|
+
return [4 /*yield*/, sdk.api.phone_calls.createOne({
|
|
189
|
+
enduserId: eCallLongOutbound.id, inbound: false,
|
|
190
|
+
userId: userId,
|
|
191
|
+
callDurationInSeconds: 60,
|
|
192
|
+
})];
|
|
193
|
+
case 8:
|
|
194
|
+
// outbound qualifies only at >= 60 seconds
|
|
195
|
+
_c.sent();
|
|
196
|
+
return [4 /*yield*/, sdk.api.phone_calls.createOne({
|
|
197
|
+
enduserId: eCallShortOutbound.id, inbound: false,
|
|
198
|
+
userId: userId,
|
|
199
|
+
callDurationInSeconds: 59,
|
|
200
|
+
})
|
|
201
|
+
// --- chats ----------------------------------------------------------------------------------
|
|
202
|
+
];
|
|
203
|
+
case 9:
|
|
204
|
+
_c.sent();
|
|
205
|
+
return [4 /*yield*/, sdk.api.chat_rooms.createOne({ enduserIds: [eChat.id], userIds: [userId] })];
|
|
206
|
+
case 10:
|
|
207
|
+
chatRoom = _c.sent();
|
|
208
|
+
chatRoomIds.push(chatRoom.id);
|
|
209
|
+
return [4 /*yield*/, sdk.api.chats.createOne({
|
|
210
|
+
roomId: chatRoom.id, message: 'apc chat', senderId: eChat.id, enduserId: eChat.id,
|
|
211
|
+
})
|
|
212
|
+
// a chat with no enduserId can't be attributed to a patient
|
|
213
|
+
];
|
|
214
|
+
case 11:
|
|
215
|
+
_c.sent();
|
|
216
|
+
return [4 /*yield*/, sdk.api.chat_rooms.createOne({
|
|
217
|
+
enduserIds: [eChatNoEnduser.id], userIds: [userId],
|
|
218
|
+
})];
|
|
219
|
+
case 12:
|
|
220
|
+
chatRoomNoEnduser = _c.sent();
|
|
221
|
+
chatRoomIds.push(chatRoomNoEnduser.id);
|
|
222
|
+
return [4 /*yield*/, sdk.api.chats.createOne({
|
|
223
|
+
roomId: chatRoomNoEnduser.id, message: 'apc chat without enduserId', senderId: userId,
|
|
224
|
+
})
|
|
225
|
+
// --- form_responses -------------------------------------------------------------------------
|
|
226
|
+
];
|
|
227
|
+
case 13:
|
|
228
|
+
_c.sent();
|
|
229
|
+
return [4 /*yield*/, sdk.api.forms.createOne({ title: 'Active Patient Count Form A' })];
|
|
230
|
+
case 14:
|
|
231
|
+
formA_1 = _c.sent();
|
|
232
|
+
formIds.push(formA_1.id);
|
|
233
|
+
return [4 /*yield*/, sdk.api.form_fields.createOne({
|
|
234
|
+
formId: formA_1.id, type: 'string', title: 'FieldA', previousFields: [{ type: 'root', info: {} }],
|
|
235
|
+
})];
|
|
236
|
+
case 15:
|
|
237
|
+
fieldA = _c.sent();
|
|
238
|
+
return [4 /*yield*/, sdk.api.forms.createOne({ title: 'Active Patient Count Form B' })];
|
|
239
|
+
case 16:
|
|
240
|
+
formB = _c.sent();
|
|
241
|
+
formIds.push(formB.id);
|
|
242
|
+
return [4 /*yield*/, sdk.api.form_fields.createOne({
|
|
243
|
+
formId: formB.id, type: 'string', title: 'FieldB', previousFields: [{ type: 'root', info: {} }],
|
|
244
|
+
})];
|
|
245
|
+
case 17:
|
|
246
|
+
fieldB = _c.sent();
|
|
247
|
+
submitForm = function (formId, fieldId, fieldTitle, enduserId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
248
|
+
var accessCode;
|
|
249
|
+
return __generator(this, function (_a) {
|
|
250
|
+
switch (_a.label) {
|
|
251
|
+
case 0: return [4 /*yield*/, sdk.api.form_responses.prepare_form_response({ enduserId: enduserId, formId: formId })];
|
|
252
|
+
case 1:
|
|
253
|
+
accessCode = (_a.sent()).accessCode;
|
|
254
|
+
return [4 /*yield*/, sdk.api.form_responses.submit_form_response({
|
|
255
|
+
accessCode: accessCode,
|
|
256
|
+
responses: [{ fieldId: fieldId, fieldTitle: fieldTitle, answer: { type: 'string', value: 'apc' } }],
|
|
257
|
+
})];
|
|
258
|
+
case 2:
|
|
259
|
+
_a.sent();
|
|
260
|
+
return [2 /*return*/];
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
}); };
|
|
264
|
+
return [4 /*yield*/, submitForm(formA_1.id, fieldA.id, 'FieldA', eForm.id)];
|
|
265
|
+
case 18:
|
|
266
|
+
_c.sent();
|
|
267
|
+
return [4 /*yield*/, submitForm(formB.id, fieldB.id, 'FieldB', eFormOtherForm.id)
|
|
268
|
+
// prepared but never submitted — no submittedAt, so it must not qualify
|
|
269
|
+
];
|
|
270
|
+
case 19:
|
|
271
|
+
_c.sent();
|
|
272
|
+
// prepared but never submitted — no submittedAt, so it must not qualify
|
|
273
|
+
return [4 /*yield*/, sdk.api.form_responses.prepare_form_response({
|
|
274
|
+
enduserId: eFormUnsubmitted.id, formId: formA_1.id,
|
|
275
|
+
})
|
|
276
|
+
// --- calendar_events ------------------------------------------------------------------------
|
|
277
|
+
// starts now, not in the future — the bounded-range case below closes the window a couple of
|
|
278
|
+
// seconds out, and calendar_events are filtered on startTimeInMS
|
|
279
|
+
];
|
|
280
|
+
case 20:
|
|
281
|
+
// prepared but never submitted — no submittedAt, so it must not qualify
|
|
282
|
+
_c.sent();
|
|
283
|
+
return [4 /*yield*/, sdk.api.calendar_events.createOne({
|
|
284
|
+
title: 'apc event', durationInMinutes: 30, startTimeInMS: Date.now(),
|
|
285
|
+
attendees: [{ id: eCalendar.id, type: 'enduser' }],
|
|
286
|
+
})];
|
|
287
|
+
case 21:
|
|
288
|
+
calendarEvent = _c.sent();
|
|
289
|
+
calendarEventIds.push(calendarEvent.id);
|
|
290
|
+
return [4 /*yield*/, sdk.api.calendar_events.createOne({
|
|
291
|
+
title: 'apc event user only', durationInMinutes: 30, startTimeInMS: Date.now(),
|
|
292
|
+
attendees: [{ id: userId, type: 'user' }],
|
|
293
|
+
})];
|
|
294
|
+
case 22:
|
|
295
|
+
calendarEventUserOnly = _c.sent();
|
|
296
|
+
calendarEventIds.push(calendarEventUserOnly.id);
|
|
297
|
+
return [4 /*yield*/, sdk.api.calendar_events.createOne({
|
|
298
|
+
title: 'apc event past start', durationInMinutes: 30,
|
|
299
|
+
startTimeInMS: Date.now() - 30 * 24 * 60 * 60 * 1000,
|
|
300
|
+
attendees: [{ id: eCalendarPastStart.id, type: 'enduser' }],
|
|
301
|
+
})];
|
|
302
|
+
case 23:
|
|
303
|
+
calendarEventPastStart = _c.sent();
|
|
304
|
+
calendarEventIds.push(calendarEventPastStart.id);
|
|
305
|
+
return [4 /*yield*/, sdk.api.group_mms_conversations.createOne({
|
|
306
|
+
enduserIds: [eGroupMMS.id, eGroupMMSUserSender.id], userIds: [userId], userStates: [], messages: [],
|
|
307
|
+
})];
|
|
308
|
+
case 24:
|
|
309
|
+
conversation = _c.sent();
|
|
310
|
+
conversationIds.push(conversation.id);
|
|
311
|
+
return [4 /*yield*/, sdk.api.group_mms_conversations.send_message({
|
|
312
|
+
conversationId: conversation.id, sender: eGroupMMS.id, message: 'apc group mms', logOnly: true,
|
|
313
|
+
})];
|
|
314
|
+
case 25:
|
|
315
|
+
_c.sent();
|
|
316
|
+
return [4 /*yield*/, (0, testing_1.wait)(undefined, 250)
|
|
317
|
+
// sent by a user, so it counts for nobody — the other enduser in the conversation included
|
|
318
|
+
];
|
|
319
|
+
case 26:
|
|
320
|
+
_c.sent();
|
|
321
|
+
// sent by a user, so it counts for nobody — the other enduser in the conversation included
|
|
322
|
+
return [4 /*yield*/, sdk.api.group_mms_conversations.send_message({
|
|
323
|
+
conversationId: conversation.id, sender: userId, message: 'apc group mms from user', logOnly: true,
|
|
324
|
+
})];
|
|
325
|
+
case 27:
|
|
326
|
+
// sent by a user, so it counts for nobody — the other enduser in the conversation included
|
|
327
|
+
_c.sent();
|
|
328
|
+
return [4 /*yield*/, (0, testing_1.wait)(undefined, 250)
|
|
329
|
+
// --- dedupe: one enduser active across three channels ----------------------------------------
|
|
330
|
+
];
|
|
331
|
+
case 28:
|
|
332
|
+
_c.sent();
|
|
333
|
+
// --- dedupe: one enduser active across three channels ----------------------------------------
|
|
334
|
+
return [4 /*yield*/, sdk.api.emails.createOne({
|
|
335
|
+
logOnly: true, inbound: true,
|
|
336
|
+
userId: userId,
|
|
337
|
+
enduserId: eDedupe.id, subject: 'apc dedupe', textContent: 'inbound email',
|
|
338
|
+
})];
|
|
339
|
+
case 29:
|
|
340
|
+
// --- dedupe: one enduser active across three channels ----------------------------------------
|
|
341
|
+
_c.sent();
|
|
342
|
+
return [4 /*yield*/, sdk.api.sms_messages.createOne({
|
|
343
|
+
logOnly: true, inbound: true,
|
|
344
|
+
userId: userId,
|
|
345
|
+
enduserId: eDedupe.id, message: 'apc dedupe sms',
|
|
346
|
+
})];
|
|
347
|
+
case 30:
|
|
348
|
+
_c.sent();
|
|
349
|
+
return [4 /*yield*/, sdk.api.chat_rooms.createOne({ enduserIds: [eDedupe.id], userIds: [userId] })];
|
|
350
|
+
case 31:
|
|
351
|
+
dedupeRoom = _c.sent();
|
|
352
|
+
chatRoomIds.push(dedupeRoom.id);
|
|
353
|
+
return [4 /*yield*/, sdk.api.chats.createOne({
|
|
354
|
+
roomId: dedupeRoom.id, message: 'apc dedupe chat', senderId: eDedupe.id, enduserId: eDedupe.id,
|
|
355
|
+
})
|
|
356
|
+
// --- customTypeId: excluded from the default count --------------------------------------------
|
|
357
|
+
];
|
|
358
|
+
case 32:
|
|
359
|
+
_c.sent();
|
|
360
|
+
// --- customTypeId: excluded from the default count --------------------------------------------
|
|
361
|
+
return [4 /*yield*/, sdk.api.emails.createOne({
|
|
362
|
+
logOnly: true, inbound: true,
|
|
363
|
+
userId: userId,
|
|
364
|
+
enduserId: eCustomType.id, subject: 'apc custom type', textContent: 'inbound email',
|
|
365
|
+
})];
|
|
366
|
+
case 33:
|
|
367
|
+
// --- customTypeId: excluded from the default count --------------------------------------------
|
|
368
|
+
_c.sent();
|
|
369
|
+
return [4 /*yield*/, (0, testing_1.wait)(undefined, 1000)
|
|
370
|
+
// Qualifying endusers: email, sms, inbound call, long outbound call, chat, form A, form B,
|
|
371
|
+
// calendar, group mms, dedupe = 10. eCustomType is excluded by customTypeId.
|
|
372
|
+
]; // let side effects settle
|
|
373
|
+
case 34:
|
|
374
|
+
_c.sent(); // let side effects settle
|
|
375
|
+
EXPECTED_ACTIVE_1 = 10;
|
|
376
|
+
return [4 /*yield*/, (0, testing_1.async_test)("Active count includes exactly the qualifying endusers", function () { return onlyThisTest(); }, { onResult: function (r) { return r === EXPECTED_ACTIVE_1; } })
|
|
377
|
+
// --- dedupe ----------------------------------------------------------------------------------
|
|
378
|
+
];
|
|
379
|
+
case 35:
|
|
380
|
+
_c.sent();
|
|
381
|
+
// --- dedupe ----------------------------------------------------------------------------------
|
|
382
|
+
return [4 /*yield*/, (0, testing_1.async_test)("Enduser active on email + sms + chat counts once", function () { return onlyCase('dedupe'); }, { onResult: function (r) { return r === 1; } })
|
|
383
|
+
// --- per-channel attribution -----------------------------------------------------------------
|
|
384
|
+
];
|
|
385
|
+
case 36:
|
|
386
|
+
// --- dedupe ----------------------------------------------------------------------------------
|
|
387
|
+
_c.sent();
|
|
388
|
+
expectActive = function (label, apcCase, expected) { return (0, testing_1.async_test)(label, function () { return onlyCase(apcCase); }, { onResult: function (r) { return r === expected; } }); };
|
|
389
|
+
return [4 /*yield*/, expectActive("Inbound email counts", 'email', 1)];
|
|
390
|
+
case 37:
|
|
391
|
+
_c.sent();
|
|
392
|
+
return [4 /*yield*/, expectActive("Outbound email without link opens does not count", 'email-outbound', 0)];
|
|
393
|
+
case 38:
|
|
394
|
+
_c.sent();
|
|
395
|
+
return [4 /*yield*/, expectActive("Inbound SMS counts", 'sms', 1)];
|
|
396
|
+
case 39:
|
|
397
|
+
_c.sent();
|
|
398
|
+
return [4 /*yield*/, expectActive("Outbound SMS does not count", 'sms-outbound', 0)];
|
|
399
|
+
case 40:
|
|
400
|
+
_c.sent();
|
|
401
|
+
return [4 /*yield*/, expectActive("Inbound phone call counts", 'call-inbound', 1)];
|
|
402
|
+
case 41:
|
|
403
|
+
_c.sent();
|
|
404
|
+
return [4 /*yield*/, expectActive("Outbound phone call >= 60s counts", 'call-long-outbound', 1)];
|
|
405
|
+
case 42:
|
|
406
|
+
_c.sent();
|
|
407
|
+
return [4 /*yield*/, expectActive("Outbound phone call < 60s does not count", 'call-short-outbound', 0)];
|
|
408
|
+
case 43:
|
|
409
|
+
_c.sent();
|
|
410
|
+
return [4 /*yield*/, expectActive("Chat with enduserId counts", 'chat', 1)];
|
|
411
|
+
case 44:
|
|
412
|
+
_c.sent();
|
|
413
|
+
return [4 /*yield*/, expectActive("Chat without enduserId does not count", 'chat-no-enduserid', 0)];
|
|
414
|
+
case 45:
|
|
415
|
+
_c.sent();
|
|
416
|
+
return [4 /*yield*/, expectActive("Submitted form response counts", 'form', 1)];
|
|
417
|
+
case 46:
|
|
418
|
+
_c.sent();
|
|
419
|
+
return [4 /*yield*/, expectActive("Unsubmitted form response does not count", 'form-unsubmitted', 0)];
|
|
420
|
+
case 47:
|
|
421
|
+
_c.sent();
|
|
422
|
+
return [4 /*yield*/, expectActive("Calendar event with enduser attendee counts", 'calendar', 1)];
|
|
423
|
+
case 48:
|
|
424
|
+
_c.sent();
|
|
425
|
+
return [4 /*yield*/, expectActive("Calendar event with only user attendees does not count", 'calendar-user-only', 0)];
|
|
426
|
+
case 49:
|
|
427
|
+
_c.sent();
|
|
428
|
+
return [4 /*yield*/, expectActive("Inbound group MMS counts", 'group-mms', 1)];
|
|
429
|
+
case 50:
|
|
430
|
+
_c.sent();
|
|
431
|
+
return [4 /*yield*/, expectActive("Group MMS sent by a user does not count", 'group-mms-user-sender', 0)];
|
|
432
|
+
case 51:
|
|
433
|
+
_c.sent();
|
|
434
|
+
return [4 /*yield*/, expectActive("Enduser with no engagement does not count", 'inactive', 0)
|
|
435
|
+
// --- date field per collection ----------------------------------------------------------------
|
|
436
|
+
];
|
|
437
|
+
case 52:
|
|
438
|
+
_c.sent();
|
|
439
|
+
// --- date field per collection ----------------------------------------------------------------
|
|
440
|
+
return [4 /*yield*/, (0, testing_1.async_test)("Calendar event is filtered by startTimeInMS, not creation time", function () { return onlyCase('calendar-past-start'); }, { onResult: function (r) { return r === 0; } })
|
|
441
|
+
// --- range boundaries -------------------------------------------------------------------------
|
|
442
|
+
];
|
|
443
|
+
case 53:
|
|
444
|
+
// --- date field per collection ----------------------------------------------------------------
|
|
445
|
+
_c.sent();
|
|
446
|
+
afterAll_1 = new Date(Date.now() + 2000);
|
|
447
|
+
return [4 /*yield*/, (0, testing_1.async_test)("Active count is unchanged with an explicit upper bound after all activity", function () { return sdk.api.endusers.get_engagement_statistics({
|
|
448
|
+
range: { from: windowStart, to: afterAll_1 },
|
|
449
|
+
enduserFields: [{ field: 'fields.apcCase', value: '$exists' }],
|
|
450
|
+
}).then(function (r) { return r.count; }); }, { onResult: function (r) { return r === EXPECTED_ACTIVE_1; } })];
|
|
451
|
+
case 54:
|
|
452
|
+
_c.sent();
|
|
453
|
+
return [4 /*yield*/, (0, testing_1.async_test)("Active count is 0 for a range that starts after all activity", function () { return sdk.api.endusers.get_engagement_statistics({ range: { from: afterAll_1 } }).then(function (r) { return r.count; }); }, { onResult: function (r) { return r === 0; } })];
|
|
454
|
+
case 55:
|
|
455
|
+
_c.sent();
|
|
456
|
+
return [4 /*yield*/, (0, testing_1.async_test)("Active count is 0 for a range that ends before all activity", function () { return sdk.api.endusers.get_engagement_statistics({
|
|
457
|
+
range: { from: new Date(windowStart.getTime() - 4000), to: windowStart },
|
|
458
|
+
enduserFields: [{ field: 'fields.apcCase', value: '$exists' }],
|
|
459
|
+
}).then(function (r) { return r.count; }); }, { onResult: function (r) { return r === 0; } })
|
|
460
|
+
// --- customTypeId ------------------------------------------------------------------------------
|
|
461
|
+
];
|
|
462
|
+
case 56:
|
|
463
|
+
_c.sent();
|
|
464
|
+
// --- customTypeId ------------------------------------------------------------------------------
|
|
465
|
+
return [4 /*yield*/, (0, testing_1.async_test)("Endusers with a customTypeId are excluded by default", function () { return onlyCase('custom-type'); }, { onResult: function (r) { return r === 0; } })];
|
|
466
|
+
case 57:
|
|
467
|
+
// --- customTypeId ------------------------------------------------------------------------------
|
|
468
|
+
_c.sent();
|
|
469
|
+
return [4 /*yield*/, (0, testing_1.async_test)("Endusers with a customTypeId are included when that customTypeId is requested", function () { return activeCount({ customTypeId: TEST_CUSTOM_TYPE_ID }); }, { onResult: function (r) { return r === 1; } })
|
|
470
|
+
// --- formIds ------------------------------------------------------------------------------------
|
|
471
|
+
];
|
|
472
|
+
case 58:
|
|
473
|
+
_c.sent();
|
|
474
|
+
// --- formIds ------------------------------------------------------------------------------------
|
|
475
|
+
return [4 /*yield*/, (0, testing_1.async_test)("formIds narrows which form responses qualify", function () { return onlyThisTest({ formIds: [formA_1.id] }); }, { onResult: function (r) { return r === EXPECTED_ACTIVE_1 - 1; } } // drops the enduser who only submitted form B
|
|
476
|
+
)
|
|
477
|
+
// --- endusersFilter (a separate code path from enduserFields) -------------------------------------
|
|
478
|
+
];
|
|
479
|
+
case 59:
|
|
480
|
+
// --- formIds ------------------------------------------------------------------------------------
|
|
481
|
+
_c.sent();
|
|
482
|
+
// --- endusersFilter (a separate code path from enduserFields) -------------------------------------
|
|
483
|
+
return [4 /*yield*/, (0, testing_1.async_test)("endusersFilter narrows the counted endusers", function () { return activeCount({ endusersFilter: { 'fields.apcCase': 'email' } }); }, { onResult: function (r) { return r === 1; } })
|
|
484
|
+
// --- enduserFields -------------------------------------------------------------------------------
|
|
485
|
+
];
|
|
486
|
+
case 60:
|
|
487
|
+
// --- endusersFilter (a separate code path from enduserFields) -------------------------------------
|
|
488
|
+
_c.sent();
|
|
489
|
+
// --- enduserFields -------------------------------------------------------------------------------
|
|
490
|
+
return [4 /*yield*/, (0, testing_1.async_test)("enduserFields matches on a stored field value", function () { return activeCount({ enduserFields: [{ field: 'fields.apcTag', value: 'yes' }] }); }, { onResult: function (r) { return r === 3; } } // email, sms, dedupe
|
|
491
|
+
)];
|
|
492
|
+
case 61:
|
|
493
|
+
// --- enduserFields -------------------------------------------------------------------------------
|
|
494
|
+
_c.sent();
|
|
495
|
+
return [4 /*yield*/, (0, testing_1.async_test)("enduserFields supports the $exists qualifier", function () { return activeCount({ enduserFields: [{ field: 'fields.apcGroup', value: '$exists' }] }); }, { onResult: function (r) { return r === EXPECTED_ACTIVE_1 - 1; } } // all active endusers except apc-calendar
|
|
496
|
+
)
|
|
497
|
+
// --- groupBy ---------------------------------------------------------------------------------------
|
|
498
|
+
];
|
|
499
|
+
case 62:
|
|
500
|
+
_c.sent();
|
|
501
|
+
// --- groupBy ---------------------------------------------------------------------------------------
|
|
502
|
+
return [4 /*yield*/, (0, testing_1.async_test)("groupBy returns per-group counts summing to the total", function () { return sdk.api.endusers.get_engagement_statistics({
|
|
503
|
+
range: { from: windowStart }, groupBy: 'fields.apcGroup',
|
|
504
|
+
enduserFields: [{ field: 'fields.apcCase', value: '$exists' }],
|
|
505
|
+
}); }, {
|
|
506
|
+
onResult: function (r) { return (Array.isArray(r.grouped)
|
|
507
|
+
&& r.grouped.reduce(function (sum, g) { return sum + g.count; }, 0) === EXPECTED_ACTIVE_1); }
|
|
508
|
+
})
|
|
509
|
+
// --- endusers cannot read org-wide staff analytics ------------------------------------------------
|
|
510
|
+
];
|
|
511
|
+
case 63:
|
|
512
|
+
// --- groupBy ---------------------------------------------------------------------------------------
|
|
513
|
+
_c.sent();
|
|
514
|
+
enduserSDK_1 = new sdk_1.EnduserSession({ host: host, businessId: businessId });
|
|
515
|
+
return [4 /*yield*/, (0, setup_1.authenticate_enduser_via_token)(sdk, enduserSDK_1, { id: eEmail.id })];
|
|
516
|
+
case 64:
|
|
517
|
+
_c.sent();
|
|
518
|
+
return [4 /*yield*/, (0, testing_1.async_test)("Endusers cannot call get_engagement_statistics", function () { return enduserSDK_1._GET('/v1/endusers/engagement', { range: { from: windowStart } }); }, testing_1.handleAnyError)
|
|
519
|
+
// --- tenant isolation --------------------------------------------------------------------------------
|
|
520
|
+
// The refactor drops restrictAccess in favor of a direct businessId match, so this is the one
|
|
521
|
+
// boundary the function now enforces entirely on its own.
|
|
522
|
+
];
|
|
523
|
+
case 65:
|
|
524
|
+
_c.sent();
|
|
525
|
+
sdkOther_1 = new sdk_1.Session({ host: host, apiKey: OTHER_TENANT_API_KEY });
|
|
526
|
+
otherWindowStart_1 = new Date(Date.now() - 2000);
|
|
527
|
+
return [4 /*yield*/, sdkOther_1.api.endusers.createOne({ fname: 'apc-other-tenant' })];
|
|
528
|
+
case 66:
|
|
529
|
+
otherEnduser = _c.sent();
|
|
530
|
+
_c.label = 67;
|
|
531
|
+
case 67:
|
|
532
|
+
_c.trys.push([67, , 72, 74]);
|
|
533
|
+
// userId is left to its session initializer — this is an API-key session with no logged-in user
|
|
534
|
+
return [4 /*yield*/, sdkOther_1.api.emails.createOne({
|
|
535
|
+
logOnly: true, inbound: true,
|
|
536
|
+
enduserId: otherEnduser.id, subject: 'apc other tenant', textContent: 'inbound email',
|
|
537
|
+
})];
|
|
538
|
+
case 68:
|
|
539
|
+
// userId is left to its session initializer — this is an API-key session with no logged-in user
|
|
540
|
+
_c.sent();
|
|
541
|
+
return [4 /*yield*/, (0, testing_1.wait)(undefined, 500)];
|
|
542
|
+
case 69:
|
|
543
|
+
_c.sent();
|
|
544
|
+
return [4 /*yield*/, (0, testing_1.async_test)("Other tenant's engagement does not appear in this tenant's count", function () { return onlyThisTest(); }, { onResult: function (r) { return r === EXPECTED_ACTIVE_1; } })];
|
|
545
|
+
case 70:
|
|
546
|
+
_c.sent();
|
|
547
|
+
return [4 /*yield*/, (0, testing_1.async_test)("This tenant's engagement does not appear in the other tenant's count", function () { return sdkOther_1.api.endusers.get_engagement_statistics({ range: { from: otherWindowStart_1 } })
|
|
548
|
+
.then(function (r) { return r.count; }); }, { onResult: function (r) { return r === 1; } })];
|
|
549
|
+
case 71:
|
|
550
|
+
_c.sent();
|
|
551
|
+
return [3 /*break*/, 74];
|
|
552
|
+
case 72: return [4 /*yield*/, sdkOther_1.api.endusers.deleteOne(otherEnduser.id).catch(console.error)];
|
|
553
|
+
case 73:
|
|
554
|
+
_c.sent();
|
|
555
|
+
return [7 /*endfinally*/];
|
|
556
|
+
case 74: return [3 /*break*/, 77];
|
|
557
|
+
case 75: return [4 /*yield*/, Promise.all(__spreadArray(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], createdEnduserIds.map(function (id) { return sdk.api.endusers.deleteOne(id).catch(console.error); }), true), chatRoomIds.map(function (id) { return sdk.api.chat_rooms.deleteOne(id).catch(console.error); }), true), conversationIds.map(function (id) { return sdk.api.group_mms_conversations.deleteOne(id).catch(console.error); }), true), calendarEventIds.map(function (id) { return sdk.api.calendar_events.deleteOne(id).catch(console.error); }), true), formIds.map(function (id) { return sdk.api.forms.deleteOne(id).catch(console.error); }), true))];
|
|
558
|
+
case 76:
|
|
559
|
+
_c.sent();
|
|
560
|
+
return [7 /*endfinally*/];
|
|
561
|
+
case 77: return [2 /*return*/];
|
|
562
|
+
}
|
|
563
|
+
});
|
|
564
|
+
});
|
|
565
|
+
};
|
|
566
|
+
exports.active_patient_count_tests = active_patient_count_tests;
|
|
567
|
+
// Allow running this test file independently
|
|
568
|
+
if (require.main === module) {
|
|
569
|
+
var sdk_2 = new sdk_1.Session({ host: host });
|
|
570
|
+
var sdkNonAdmin_1 = new sdk_1.Session({ host: host });
|
|
571
|
+
var runTests = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
572
|
+
return __generator(this, function (_a) {
|
|
573
|
+
switch (_a.label) {
|
|
574
|
+
case 0: return [4 /*yield*/, (0, setup_1.setup_tests)(sdk_2, sdkNonAdmin_1)];
|
|
575
|
+
case 1:
|
|
576
|
+
_a.sent();
|
|
577
|
+
return [4 /*yield*/, (0, exports.active_patient_count_tests)({ sdk: sdk_2, sdkNonAdmin: sdkNonAdmin_1 })];
|
|
578
|
+
case 2:
|
|
579
|
+
_a.sent();
|
|
580
|
+
return [2 /*return*/];
|
|
581
|
+
}
|
|
582
|
+
});
|
|
583
|
+
}); };
|
|
584
|
+
runTests()
|
|
585
|
+
.then(function () {
|
|
586
|
+
console.log("✅ Active patient count test suite completed successfully");
|
|
587
|
+
process.exit(0);
|
|
588
|
+
})
|
|
589
|
+
.catch(function (error) {
|
|
590
|
+
console.error("❌ Active patient count test suite failed:", error);
|
|
591
|
+
process.exit(1);
|
|
592
|
+
});
|
|
593
|
+
}
|
|
594
|
+
//# sourceMappingURL=active_patient_count.test.js.map
|