@tellescope/sdk 1.256.6 → 1.256.7
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/enduser.d.ts +1 -1
- package/lib/cjs/enduser.d.ts.map +1 -1
- package/lib/cjs/enduser.js +1 -0
- package/lib/cjs/enduser.js.map +1 -1
- package/lib/cjs/tests/api_tests/calendar_event_create_and_bulk_triggers.test.d.ts +6 -0
- package/lib/cjs/tests/api_tests/calendar_event_create_and_bulk_triggers.test.d.ts.map +1 -0
- package/lib/cjs/tests/api_tests/calendar_event_create_and_bulk_triggers.test.js +505 -0
- package/lib/cjs/tests/api_tests/calendar_event_create_and_bulk_triggers.test.js.map +1 -0
- package/lib/cjs/tests/api_tests/configurations_public_read.test.d.ts +6 -0
- package/lib/cjs/tests/api_tests/configurations_public_read.test.d.ts.map +1 -0
- package/lib/cjs/tests/api_tests/configurations_public_read.test.js +173 -0
- package/lib/cjs/tests/api_tests/configurations_public_read.test.js.map +1 -0
- package/lib/cjs/tests/api_tests/form_started_trigger.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/form_started_trigger.test.js +87 -24
- package/lib/cjs/tests/api_tests/form_started_trigger.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/form_translations.test.d.ts +6 -0
- package/lib/cjs/tests/api_tests/form_translations.test.d.ts.map +1 -0
- package/lib/cjs/tests/api_tests/form_translations.test.js +259 -0
- package/lib/cjs/tests/api_tests/form_translations.test.js.map +1 -0
- package/lib/cjs/tests/api_tests/group_event_attendee_status_triggers.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/group_event_attendee_status_triggers.test.js +340 -124
- package/lib/cjs/tests/api_tests/group_event_attendee_status_triggers.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/mdi_trigger_refill.test.d.ts +6 -0
- package/lib/cjs/tests/api_tests/mdi_trigger_refill.test.d.ts.map +1 -0
- package/lib/cjs/tests/api_tests/mdi_trigger_refill.test.js +277 -0
- package/lib/cjs/tests/api_tests/mdi_trigger_refill.test.js.map +1 -0
- package/lib/cjs/tests/api_tests/purchase_made_trigger.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/purchase_made_trigger.test.js +262 -78
- package/lib/cjs/tests/api_tests/purchase_made_trigger.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/security/F-0006-develop-health-benefit-verification-rbac.test.d.ts +31 -0
- package/lib/cjs/tests/api_tests/security/F-0006-develop-health-benefit-verification-rbac.test.d.ts.map +1 -0
- package/lib/cjs/tests/api_tests/security/F-0006-develop-health-benefit-verification-rbac.test.js +230 -0
- package/lib/cjs/tests/api_tests/security/F-0006-develop-health-benefit-verification-rbac.test.js.map +1 -0
- package/lib/cjs/tests/api_tests/security/public_endpoint_auth_field_lock.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/security/public_endpoint_auth_field_lock.test.js +206 -198
- package/lib/cjs/tests/api_tests/security/public_endpoint_auth_field_lock.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/stripe_webhook_triggers.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/stripe_webhook_triggers.test.js +343 -80
- package/lib/cjs/tests/api_tests/stripe_webhook_triggers.test.js.map +1 -1
- package/lib/cjs/tests/api_tests/welle_partner_token.test.d.ts.map +1 -1
- package/lib/cjs/tests/api_tests/welle_partner_token.test.js +74 -35
- package/lib/cjs/tests/api_tests/welle_partner_token.test.js.map +1 -1
- package/lib/cjs/tests/stripe_webhook_helpers.d.ts +134 -0
- package/lib/cjs/tests/stripe_webhook_helpers.d.ts.map +1 -1
- package/lib/cjs/tests/stripe_webhook_helpers.js +126 -1
- package/lib/cjs/tests/stripe_webhook_helpers.js.map +1 -1
- package/lib/cjs/tests/tests.d.ts.map +1 -1
- package/lib/cjs/tests/tests.js +238 -212
- package/lib/cjs/tests/tests.js.map +1 -1
- package/lib/esm/enduser.d.ts +1 -1
- package/lib/esm/enduser.d.ts.map +1 -1
- package/lib/esm/enduser.js +1 -0
- package/lib/esm/enduser.js.map +1 -1
- package/lib/esm/tests/api_tests/calendar_event_create_and_bulk_triggers.test.d.ts +6 -0
- package/lib/esm/tests/api_tests/calendar_event_create_and_bulk_triggers.test.d.ts.map +1 -0
- package/lib/esm/tests/api_tests/calendar_event_create_and_bulk_triggers.test.js +501 -0
- package/lib/esm/tests/api_tests/calendar_event_create_and_bulk_triggers.test.js.map +1 -0
- package/lib/esm/tests/api_tests/configurations_public_read.test.d.ts +6 -0
- package/lib/esm/tests/api_tests/configurations_public_read.test.d.ts.map +1 -0
- package/lib/esm/tests/api_tests/configurations_public_read.test.js +169 -0
- package/lib/esm/tests/api_tests/configurations_public_read.test.js.map +1 -0
- package/lib/esm/tests/api_tests/form_started_trigger.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/form_started_trigger.test.js +87 -24
- package/lib/esm/tests/api_tests/form_started_trigger.test.js.map +1 -1
- package/lib/esm/tests/api_tests/form_translations.test.d.ts +6 -0
- package/lib/esm/tests/api_tests/form_translations.test.d.ts.map +1 -0
- package/lib/esm/tests/api_tests/form_translations.test.js +255 -0
- package/lib/esm/tests/api_tests/form_translations.test.js.map +1 -0
- package/lib/esm/tests/api_tests/group_event_attendee_status_triggers.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/group_event_attendee_status_triggers.test.js +340 -124
- package/lib/esm/tests/api_tests/group_event_attendee_status_triggers.test.js.map +1 -1
- package/lib/esm/tests/api_tests/mdi_trigger_refill.test.d.ts +6 -0
- package/lib/esm/tests/api_tests/mdi_trigger_refill.test.d.ts.map +1 -0
- package/lib/esm/tests/api_tests/mdi_trigger_refill.test.js +273 -0
- package/lib/esm/tests/api_tests/mdi_trigger_refill.test.js.map +1 -0
- package/lib/esm/tests/api_tests/purchase_made_trigger.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/purchase_made_trigger.test.js +262 -78
- package/lib/esm/tests/api_tests/purchase_made_trigger.test.js.map +1 -1
- package/lib/esm/tests/api_tests/security/F-0006-develop-health-benefit-verification-rbac.test.d.ts +31 -0
- package/lib/esm/tests/api_tests/security/F-0006-develop-health-benefit-verification-rbac.test.d.ts.map +1 -0
- package/lib/esm/tests/api_tests/security/F-0006-develop-health-benefit-verification-rbac.test.js +226 -0
- package/lib/esm/tests/api_tests/security/F-0006-develop-health-benefit-verification-rbac.test.js.map +1 -0
- package/lib/esm/tests/api_tests/security/public_endpoint_auth_field_lock.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/security/public_endpoint_auth_field_lock.test.js +206 -198
- package/lib/esm/tests/api_tests/security/public_endpoint_auth_field_lock.test.js.map +1 -1
- package/lib/esm/tests/api_tests/stripe_webhook_triggers.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/stripe_webhook_triggers.test.js +344 -81
- package/lib/esm/tests/api_tests/stripe_webhook_triggers.test.js.map +1 -1
- package/lib/esm/tests/api_tests/welle_partner_token.test.d.ts.map +1 -1
- package/lib/esm/tests/api_tests/welle_partner_token.test.js +74 -35
- package/lib/esm/tests/api_tests/welle_partner_token.test.js.map +1 -1
- package/lib/esm/tests/stripe_webhook_helpers.d.ts +134 -0
- package/lib/esm/tests/stripe_webhook_helpers.d.ts.map +1 -1
- package/lib/esm/tests/stripe_webhook_helpers.js +119 -0
- package/lib/esm/tests/stripe_webhook_helpers.js.map +1 -1
- package/lib/esm/tests/tests.d.ts.map +1 -1
- package/lib/esm/tests/tests.js +238 -212
- package/lib/esm/tests/tests.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +10 -10
- package/src/enduser.ts +4 -2
- package/src/tests/api_tests/calendar_event_create_and_bulk_triggers.test.ts +293 -0
- package/src/tests/api_tests/configurations_public_read.test.ts +116 -0
- package/src/tests/api_tests/form_started_trigger.test.ts +49 -1
- package/src/tests/api_tests/form_translations.test.ts +205 -0
- package/src/tests/api_tests/group_event_attendee_status_triggers.test.ts +135 -0
- package/src/tests/api_tests/mdi_trigger_refill.test.ts +184 -0
- package/src/tests/api_tests/purchase_made_trigger.test.ts +137 -0
- package/src/tests/api_tests/security/F-0006-develop-health-benefit-verification-rbac.test.ts +144 -0
- package/src/tests/api_tests/security/public_endpoint_auth_field_lock.test.ts +16 -6
- package/src/tests/api_tests/stripe_webhook_triggers.test.ts +221 -0
- package/src/tests/api_tests/welle_partner_token.test.ts +49 -6
- package/src/tests/stripe_webhook_helpers.ts +116 -0
- package/src/tests/tests.ts +27 -12
- package/test_generated.pdf +0 -0
|
@@ -193,10 +193,10 @@ var sleep = function (ms) { return new Promise(function (resolve) { return setTi
|
|
|
193
193
|
export var public_endpoint_auth_field_lock_tests = function (_a) {
|
|
194
194
|
var sdk = _a.sdk, sdkNonAdmin = _a.sdkNonAdmin;
|
|
195
195
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
196
|
-
var businessId, RUN, results, record, skip, runScenario, phoneOffset, phoneSeed, nextPhone, emailFor, createdEnduserIds, createdFormIds, createdFormFieldIds, createdUserIds, createdEventIds, createdTemplateIds, organization, MATCH_EMAIL_AND_NAMES, form, plainField, autoMergeForm, autoMergeField, makeIntakeForm, intake, partialIntake, pivotIntake, MERGE_CUSTOM_KEY, autoMergeIntake, template, hostUser, publicSDK, startForm, startBooking, startFormOn, asEnduser, postAuthed, tokenFromURL, patchAuthed, intakeAnswers, pollEnduser, describe, makeVictim, VICTIM_SHAPES, _loop_1, _i, VICTIM_SHAPES_1, shape, _loop_2,
|
|
197
|
-
var
|
|
198
|
-
return __generator(this, function (
|
|
199
|
-
switch (
|
|
196
|
+
var businessId, RUN, results, record, skip, runScenario, phoneOffset, phoneSeed, nextPhone, emailFor, createdEnduserIds, createdFormIds, createdFormFieldIds, createdUserIds, createdEventIds, createdTemplateIds, organization, MATCH_EMAIL_AND_NAMES, form, plainField, autoMergeForm, autoMergeField, makeIntakeForm, intake, partialIntake, pivotIntake, MERGE_CUSTOM_KEY, autoMergeIntake, template, hostEmail, hostUser, _b, publicSDK, startForm, startBooking, startFormOn, asEnduser, postAuthed, tokenFromURL, patchAuthed, intakeAnswers, pollEnduser, describe, makeVictim, VICTIM_SHAPES, _loop_1, _i, VICTIM_SHAPES_1, shape, _loop_2, _c, VICTIM_SHAPES_2, shape, formSessions, bookingTokens, _loop_3, _d, VICTIM_SHAPES_3, shape, G12_NAME, G13_NAME, G14_NAME, G15_NAME, namelessDob, makeNamelessVictim, G19_NAME, G20_NAME, coldStartCase, G23_NAME, chainForVictim, G24_NAME, G25_NAME, G26_NAME, G27_NAME, G28_NAME, failures, skipped, _e, results_1, r, status_1, _f, createdEventIds_1, id, _g, createdFormIds_1, formId, responses, _h, responses_1, response, _j, createdFormFieldIds_1, id, _k, createdFormIds_2, id, uniqueEnduserIds, _l, uniqueEnduserIds_1, id, _m, createdTemplateIds_1, id, _o, createdUserIds_1, id, _p, results_2, r;
|
|
197
|
+
var _q, _r;
|
|
198
|
+
return __generator(this, function (_s) {
|
|
199
|
+
switch (_s.label) {
|
|
200
200
|
case 0:
|
|
201
201
|
log_header("Public Endpoint Auth Field Lock (email / phone)");
|
|
202
202
|
businessId = sdk.userInfo.businessId;
|
|
@@ -243,11 +243,11 @@ export var public_endpoint_auth_field_lock_tests = function (_a) {
|
|
|
243
243
|
createdTemplateIds = [];
|
|
244
244
|
return [4 /*yield*/, sdk.api.organizations.getOne(businessId).catch(function () { return null; })];
|
|
245
245
|
case 1:
|
|
246
|
-
organization =
|
|
247
|
-
MATCH_EMAIL_AND_NAMES = !!((
|
|
246
|
+
organization = _s.sent();
|
|
247
|
+
MATCH_EMAIL_AND_NAMES = !!((_r = (_q = organization === null || organization === void 0 ? void 0 : organization.settings) === null || _q === void 0 ? void 0 : _q.endusers) === null || _r === void 0 ? void 0 : _r.matchEmailAndNames);
|
|
248
248
|
return [4 /*yield*/, sdk.api.forms.createOne({ title: "auth field lock ".concat(RUN), allowPublicURL: true })];
|
|
249
249
|
case 2:
|
|
250
|
-
form =
|
|
250
|
+
form = _s.sent();
|
|
251
251
|
createdFormIds.push(form.id);
|
|
252
252
|
return [4 /*yield*/, sdk.api.form_fields.createOne({
|
|
253
253
|
formId: form.id,
|
|
@@ -256,7 +256,7 @@ export var public_endpoint_auth_field_lock_tests = function (_a) {
|
|
|
256
256
|
previousFields: [{ type: 'root', info: {} }],
|
|
257
257
|
})];
|
|
258
258
|
case 3:
|
|
259
|
-
plainField =
|
|
259
|
+
plainField = _s.sent();
|
|
260
260
|
createdFormFieldIds.push(plainField.id);
|
|
261
261
|
return [4 /*yield*/, sdk.api.forms.createOne({
|
|
262
262
|
title: "auth field lock automerge ".concat(RUN),
|
|
@@ -264,7 +264,7 @@ export var public_endpoint_auth_field_lock_tests = function (_a) {
|
|
|
264
264
|
autoMergeOnSubmission: true,
|
|
265
265
|
})];
|
|
266
266
|
case 4:
|
|
267
|
-
autoMergeForm =
|
|
267
|
+
autoMergeForm = _s.sent();
|
|
268
268
|
createdFormIds.push(autoMergeForm.id);
|
|
269
269
|
return [4 /*yield*/, sdk.api.form_fields.createOne({
|
|
270
270
|
formId: autoMergeForm.id,
|
|
@@ -273,7 +273,7 @@ export var public_endpoint_auth_field_lock_tests = function (_a) {
|
|
|
273
273
|
previousFields: [{ type: 'root', info: {} }],
|
|
274
274
|
})];
|
|
275
275
|
case 5:
|
|
276
|
-
autoMergeField =
|
|
276
|
+
autoMergeField = _s.sent();
|
|
277
277
|
createdFormFieldIds.push(autoMergeField.id);
|
|
278
278
|
makeIntakeForm = function (label, opts) {
|
|
279
279
|
if (opts === void 0) { opts = {}; }
|
|
@@ -301,20 +301,20 @@ export var public_endpoint_auth_field_lock_tests = function (_a) {
|
|
|
301
301
|
};
|
|
302
302
|
return [4 /*yield*/, makeIntakeForm('intake')];
|
|
303
303
|
case 6:
|
|
304
|
-
intake =
|
|
304
|
+
intake = _s.sent();
|
|
305
305
|
return [4 /*yield*/, makeIntakeForm('partial', { saveIntakeOnPartial: true })
|
|
306
306
|
// Deliberately NOT allowPublicURL. prepare_form_response does not require it, so a public session
|
|
307
307
|
// can pivot from any public form to any form in the org carrying an email/phone intake mapping.
|
|
308
308
|
];
|
|
309
309
|
case 7:
|
|
310
|
-
partialIntake =
|
|
310
|
+
partialIntake = _s.sent();
|
|
311
311
|
return [4 /*yield*/, makeIntakeForm('pivot', { public: false })
|
|
312
312
|
// Auto-merge fixture for G26. Needs real intakeField mappings, because resolveAutoMergeBeforeSubmission
|
|
313
313
|
// derives its match values from the submitted answers via those mappings — and the custom field is the
|
|
314
314
|
// anti-vacuity control (it proves the intake write ran at all).
|
|
315
315
|
];
|
|
316
316
|
case 8:
|
|
317
|
-
pivotIntake =
|
|
317
|
+
pivotIntake = _s.sent();
|
|
318
318
|
MERGE_CUSTOM_KEY = "aflMerge".concat(RUN);
|
|
319
319
|
return [4 /*yield*/, (function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
320
320
|
var form, spec, made, _i, spec_1, s, field, fname, lname, dateOfBirth, email, custom;
|
|
@@ -366,7 +366,7 @@ export var public_endpoint_auth_field_lock_tests = function (_a) {
|
|
|
366
366
|
});
|
|
367
367
|
}); })()];
|
|
368
368
|
case 9:
|
|
369
|
-
autoMergeIntake =
|
|
369
|
+
autoMergeIntake = _s.sent();
|
|
370
370
|
return [4 /*yield*/, sdk.api.calendar_event_templates.createOne({
|
|
371
371
|
title: "auth field lock ".concat(RUN),
|
|
372
372
|
durationInMinutes: 60,
|
|
@@ -375,16 +375,24 @@ export var public_endpoint_auth_field_lock_tests = function (_a) {
|
|
|
375
375
|
reminders: [],
|
|
376
376
|
})];
|
|
377
377
|
case 10:
|
|
378
|
-
template =
|
|
378
|
+
template = _s.sent();
|
|
379
379
|
createdTemplateIds.push(template.id);
|
|
380
|
+
hostEmail = 'lock-host@tellescope.com';
|
|
381
|
+
return [4 /*yield*/, sdk.api.users.getOne({ email: hostEmail }).catch(function () { return null; })];
|
|
382
|
+
case 11:
|
|
383
|
+
_b = (_s.sent());
|
|
384
|
+
if (_b) return [3 /*break*/, 13];
|
|
380
385
|
return [4 /*yield*/, sdk.api.users.createOne({
|
|
381
|
-
email:
|
|
386
|
+
email: hostEmail,
|
|
382
387
|
verifiedEmail: true,
|
|
383
388
|
fname: 'Lock',
|
|
384
|
-
lname:
|
|
389
|
+
lname: 'Host',
|
|
385
390
|
})];
|
|
386
|
-
case
|
|
387
|
-
|
|
391
|
+
case 12:
|
|
392
|
+
_b = (_s.sent());
|
|
393
|
+
_s.label = 13;
|
|
394
|
+
case 13:
|
|
395
|
+
hostUser = _b;
|
|
388
396
|
createdUserIds.push(hostUser.id);
|
|
389
397
|
return [4 /*yield*/, sdk.api.users.updateOne(hostUser.id, {
|
|
390
398
|
weeklyAvailabilities: [0, 1, 2, 3, 4, 5, 6].map(function (dayOfWeekStartingSundayIndexedByZero) { return ({
|
|
@@ -395,15 +403,15 @@ export var public_endpoint_auth_field_lock_tests = function (_a) {
|
|
|
395
403
|
}); }),
|
|
396
404
|
calendarEventLimits: [],
|
|
397
405
|
}, { replaceObjectFields: true })];
|
|
398
|
-
case
|
|
399
|
-
|
|
406
|
+
case 14:
|
|
407
|
+
_s.sent();
|
|
400
408
|
return [4 /*yield*/, sleep(250)
|
|
401
409
|
// ---------------------------------------------------------------------------------------------
|
|
402
410
|
// Helpers
|
|
403
411
|
// ---------------------------------------------------------------------------------------------
|
|
404
412
|
]; // let form.numFields settle before the public endpoints validate it
|
|
405
|
-
case
|
|
406
|
-
|
|
413
|
+
case 15:
|
|
414
|
+
_s.sent(); // let form.numFields settle before the public endpoints validate it
|
|
407
415
|
publicSDK = function () { return new EnduserSession({ host: host, businessId: businessId }); };
|
|
408
416
|
startForm = function (args) { return publicSDK().api.form_responses.session_for_public_form(__assign({ formId: form.id, businessId: businessId }, args)); };
|
|
409
417
|
startBooking = function (args) { return publicSDK().api.calendar_events.session_for_public_appointment_booking(__assign({ calendarEventTemplateId: template.id, businessId: businessId }, args)); };
|
|
@@ -505,8 +513,8 @@ export var public_endpoint_auth_field_lock_tests = function (_a) {
|
|
|
505
513
|
];
|
|
506
514
|
_loop_1 = function (shape) {
|
|
507
515
|
var name_1;
|
|
508
|
-
return __generator(this, function (
|
|
509
|
-
switch (
|
|
516
|
+
return __generator(this, function (_t) {
|
|
517
|
+
switch (_t.label) {
|
|
510
518
|
case 0:
|
|
511
519
|
name_1 = "A blocks email/phone overwrite \u2014 ".concat(shape.label);
|
|
512
520
|
return [4 /*yield*/, runScenario('G1', name_1, function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -549,28 +557,28 @@ export var public_endpoint_auth_field_lock_tests = function (_a) {
|
|
|
549
557
|
});
|
|
550
558
|
}); })];
|
|
551
559
|
case 1:
|
|
552
|
-
|
|
560
|
+
_t.sent();
|
|
553
561
|
return [2 /*return*/];
|
|
554
562
|
}
|
|
555
563
|
});
|
|
556
564
|
};
|
|
557
565
|
_i = 0, VICTIM_SHAPES_1 = VICTIM_SHAPES;
|
|
558
|
-
|
|
559
|
-
case
|
|
560
|
-
if (!(_i < VICTIM_SHAPES_1.length)) return [3 /*break*/,
|
|
566
|
+
_s.label = 16;
|
|
567
|
+
case 16:
|
|
568
|
+
if (!(_i < VICTIM_SHAPES_1.length)) return [3 /*break*/, 19];
|
|
561
569
|
shape = VICTIM_SHAPES_1[_i];
|
|
562
570
|
return [5 /*yield**/, _loop_1(shape)];
|
|
563
|
-
case 15:
|
|
564
|
-
_r.sent();
|
|
565
|
-
_r.label = 16;
|
|
566
|
-
case 16:
|
|
567
|
-
_i++;
|
|
568
|
-
return [3 /*break*/, 14];
|
|
569
571
|
case 17:
|
|
572
|
+
_s.sent();
|
|
573
|
+
_s.label = 18;
|
|
574
|
+
case 18:
|
|
575
|
+
_i++;
|
|
576
|
+
return [3 /*break*/, 16];
|
|
577
|
+
case 19:
|
|
570
578
|
_loop_2 = function (shape) {
|
|
571
579
|
var name_2;
|
|
572
|
-
return __generator(this, function (
|
|
573
|
-
switch (
|
|
580
|
+
return __generator(this, function (_u) {
|
|
581
|
+
switch (_u.label) {
|
|
574
582
|
case 0:
|
|
575
583
|
name_2 = "B blocks email/phone overwrite \u2014 ".concat(shape.label);
|
|
576
584
|
return [4 /*yield*/, runScenario('G2', name_2, function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -614,24 +622,24 @@ export var public_endpoint_auth_field_lock_tests = function (_a) {
|
|
|
614
622
|
});
|
|
615
623
|
}); })];
|
|
616
624
|
case 1:
|
|
617
|
-
|
|
625
|
+
_u.sent();
|
|
618
626
|
return [2 /*return*/];
|
|
619
627
|
}
|
|
620
628
|
});
|
|
621
629
|
};
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
case 18:
|
|
625
|
-
if (!(_b < VICTIM_SHAPES_2.length)) return [3 /*break*/, 21];
|
|
626
|
-
shape = VICTIM_SHAPES_2[_b];
|
|
627
|
-
return [5 /*yield**/, _loop_2(shape)];
|
|
628
|
-
case 19:
|
|
629
|
-
_r.sent();
|
|
630
|
-
_r.label = 20;
|
|
630
|
+
_c = 0, VICTIM_SHAPES_2 = VICTIM_SHAPES;
|
|
631
|
+
_s.label = 20;
|
|
631
632
|
case 20:
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
633
|
+
if (!(_c < VICTIM_SHAPES_2.length)) return [3 /*break*/, 23];
|
|
634
|
+
shape = VICTIM_SHAPES_2[_c];
|
|
635
|
+
return [5 /*yield**/, _loop_2(shape)];
|
|
636
|
+
case 21:
|
|
637
|
+
_s.sent();
|
|
638
|
+
_s.label = 22;
|
|
639
|
+
case 22:
|
|
640
|
+
_c++;
|
|
641
|
+
return [3 /*break*/, 20];
|
|
642
|
+
case 23:
|
|
635
643
|
// ---------------------------------------------------------------------------------------------
|
|
636
644
|
// G3 — Endpoint A with the raw enduserId parameter (findById, no ownership check). Not reachable
|
|
637
645
|
// as an attack through the first-party frontend, but trivially reachable by POSTing directly.
|
|
@@ -684,13 +692,13 @@ export var public_endpoint_auth_field_lock_tests = function (_a) {
|
|
|
684
692
|
// this file runs as part of tests.ts).
|
|
685
693
|
// ---------------------------------------------------------------------------------------------
|
|
686
694
|
];
|
|
687
|
-
case
|
|
695
|
+
case 24:
|
|
688
696
|
// ---------------------------------------------------------------------------------------------
|
|
689
697
|
// G3 — Endpoint A with the raw enduserId parameter (findById, no ownership check). Not reachable
|
|
690
698
|
// as an attack through the first-party frontend, but trivially reachable by POSTing directly.
|
|
691
699
|
// The field lock must hold on this path too.
|
|
692
700
|
// ---------------------------------------------------------------------------------------------
|
|
693
|
-
|
|
701
|
+
_s.sent();
|
|
694
702
|
// ---------------------------------------------------------------------------------------------
|
|
695
703
|
// G4 — The takeover chain itself.
|
|
696
704
|
//
|
|
@@ -778,7 +786,7 @@ export var public_endpoint_auth_field_lock_tests = function (_a) {
|
|
|
778
786
|
// G5 — Intended intake behavior preserved: blank match keys still get filled, blank phone does not.
|
|
779
787
|
// ---------------------------------------------------------------------------------------------
|
|
780
788
|
];
|
|
781
|
-
case
|
|
789
|
+
case 25:
|
|
782
790
|
// ---------------------------------------------------------------------------------------------
|
|
783
791
|
// G4 — The takeover chain itself.
|
|
784
792
|
//
|
|
@@ -796,7 +804,7 @@ export var public_endpoint_auth_field_lock_tests = function (_a) {
|
|
|
796
804
|
// failure (reset_db is deliberately NOT called here — it would wipe other suites' fixtures when
|
|
797
805
|
// this file runs as part of tests.ts).
|
|
798
806
|
// ---------------------------------------------------------------------------------------------
|
|
799
|
-
|
|
807
|
+
_s.sent();
|
|
800
808
|
// ---------------------------------------------------------------------------------------------
|
|
801
809
|
// G5 — Intended intake behavior preserved: blank match keys still get filled, blank phone does not.
|
|
802
810
|
// ---------------------------------------------------------------------------------------------
|
|
@@ -852,11 +860,11 @@ export var public_endpoint_auth_field_lock_tests = function (_a) {
|
|
|
852
860
|
// provider licensed in their new state.
|
|
853
861
|
// ---------------------------------------------------------------------------------------------
|
|
854
862
|
];
|
|
855
|
-
case
|
|
863
|
+
case 26:
|
|
856
864
|
// ---------------------------------------------------------------------------------------------
|
|
857
865
|
// G5 — Intended intake behavior preserved: blank match keys still get filled, blank phone does not.
|
|
858
866
|
// ---------------------------------------------------------------------------------------------
|
|
859
|
-
|
|
867
|
+
_s.sent();
|
|
860
868
|
// ---------------------------------------------------------------------------------------------
|
|
861
869
|
// G6 — Status-quo pin: state still overwrites on match. This is deliberate, not incidental —
|
|
862
870
|
// state is not an auth channel, and locking it would break a relocated patient booking with a
|
|
@@ -898,13 +906,13 @@ export var public_endpoint_auth_field_lock_tests = function (_a) {
|
|
|
898
906
|
// Accumulator arrays rather than `let ... | null`: values are assigned inside runScenario's
|
|
899
907
|
// callback, and TS's control-flow narrowing does not account for closure assignments.
|
|
900
908
|
];
|
|
901
|
-
case
|
|
909
|
+
case 27:
|
|
902
910
|
// ---------------------------------------------------------------------------------------------
|
|
903
911
|
// G6 — Status-quo pin: state still overwrites on match. This is deliberate, not incidental —
|
|
904
912
|
// state is not an auth channel, and locking it would break a relocated patient booking with a
|
|
905
913
|
// provider licensed in their new state.
|
|
906
914
|
// ---------------------------------------------------------------------------------------------
|
|
907
|
-
|
|
915
|
+
_s.sent();
|
|
908
916
|
formSessions = [];
|
|
909
917
|
return [4 /*yield*/, runScenario('G7', 'A creates a new visitor with submitted email + phone', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
910
918
|
var email, phone, session, created, ok;
|
|
@@ -934,8 +942,8 @@ export var public_endpoint_auth_field_lock_tests = function (_a) {
|
|
|
934
942
|
}
|
|
935
943
|
});
|
|
936
944
|
}); })];
|
|
937
|
-
case
|
|
938
|
-
|
|
945
|
+
case 28:
|
|
946
|
+
_s.sent();
|
|
939
947
|
bookingTokens = [];
|
|
940
948
|
return [4 /*yield*/, runScenario('G7', 'B creates a new visitor with submitted email + phone', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
941
949
|
var email, phone, lname, session, matching, _i, matching_2, m, created, ok;
|
|
@@ -974,8 +982,8 @@ export var public_endpoint_auth_field_lock_tests = function (_a) {
|
|
|
974
982
|
// G8 — The returned public-form session still works end-to-end.
|
|
975
983
|
// ---------------------------------------------------------------------------------------------
|
|
976
984
|
];
|
|
977
|
-
case
|
|
978
|
-
|
|
985
|
+
case 29:
|
|
986
|
+
_s.sent();
|
|
979
987
|
// ---------------------------------------------------------------------------------------------
|
|
980
988
|
// G8 — The returned public-form session still works end-to-end.
|
|
981
989
|
// ---------------------------------------------------------------------------------------------
|
|
@@ -1011,11 +1019,11 @@ export var public_endpoint_auth_field_lock_tests = function (_a) {
|
|
|
1011
1019
|
// regression.
|
|
1012
1020
|
// ---------------------------------------------------------------------------------------------
|
|
1013
1021
|
];
|
|
1014
|
-
case
|
|
1022
|
+
case 30:
|
|
1015
1023
|
// ---------------------------------------------------------------------------------------------
|
|
1016
1024
|
// G8 — The returned public-form session still works end-to-end.
|
|
1017
1025
|
// ---------------------------------------------------------------------------------------------
|
|
1018
|
-
|
|
1026
|
+
_s.sent();
|
|
1019
1027
|
// ---------------------------------------------------------------------------------------------
|
|
1020
1028
|
// G9 — The returned booking session still works. Tiered: availability is always asserted; an
|
|
1021
1029
|
// actual booking is attempted only when a slot exists, so an empty window never reads as a
|
|
@@ -1069,13 +1077,13 @@ export var public_endpoint_auth_field_lock_tests = function (_a) {
|
|
|
1069
1077
|
// G10 — skipMatch behavior unchanged.
|
|
1070
1078
|
// ---------------------------------------------------------------------------------------------
|
|
1071
1079
|
];
|
|
1072
|
-
case
|
|
1080
|
+
case 31:
|
|
1073
1081
|
// ---------------------------------------------------------------------------------------------
|
|
1074
1082
|
// G9 — The returned booking session still works. Tiered: availability is always asserted; an
|
|
1075
1083
|
// actual booking is attempted only when a slot exists, so an empty window never reads as a
|
|
1076
1084
|
// regression.
|
|
1077
1085
|
// ---------------------------------------------------------------------------------------------
|
|
1078
|
-
|
|
1086
|
+
_s.sent();
|
|
1079
1087
|
// ---------------------------------------------------------------------------------------------
|
|
1080
1088
|
// G10 — skipMatch behavior unchanged.
|
|
1081
1089
|
// ---------------------------------------------------------------------------------------------
|
|
@@ -1103,11 +1111,11 @@ export var public_endpoint_auth_field_lock_tests = function (_a) {
|
|
|
1103
1111
|
}
|
|
1104
1112
|
});
|
|
1105
1113
|
}); })];
|
|
1106
|
-
case
|
|
1114
|
+
case 32:
|
|
1107
1115
|
// ---------------------------------------------------------------------------------------------
|
|
1108
1116
|
// G10 — skipMatch behavior unchanged.
|
|
1109
1117
|
// ---------------------------------------------------------------------------------------------
|
|
1110
|
-
|
|
1118
|
+
_s.sent();
|
|
1111
1119
|
return [4 /*yield*/, runScenario('G10', 'skipMatch + autoMergeOnSubmission sets eligibleForAutoMerge', function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1112
1120
|
var session, created;
|
|
1113
1121
|
return __generator(this, function (_a) {
|
|
@@ -1138,12 +1146,12 @@ export var public_endpoint_auth_field_lock_tests = function (_a) {
|
|
|
1138
1146
|
// G11 — Intake answers must not overwrite email/phone on a matched patient (submit path).
|
|
1139
1147
|
// ---------------------------------------------------------------------------------------------
|
|
1140
1148
|
];
|
|
1141
|
-
case
|
|
1142
|
-
|
|
1149
|
+
case 33:
|
|
1150
|
+
_s.sent();
|
|
1143
1151
|
_loop_3 = function (shape) {
|
|
1144
1152
|
var name_3;
|
|
1145
|
-
return __generator(this, function (
|
|
1146
|
-
switch (
|
|
1153
|
+
return __generator(this, function (_v) {
|
|
1154
|
+
switch (_v.label) {
|
|
1147
1155
|
case 0:
|
|
1148
1156
|
name_3 = "intake answers do not overwrite a matched patient \u2014 ".concat(shape.label);
|
|
1149
1157
|
return [4 /*yield*/, runScenario('G11', name_3, function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -1191,24 +1199,24 @@ export var public_endpoint_auth_field_lock_tests = function (_a) {
|
|
|
1191
1199
|
});
|
|
1192
1200
|
}); })];
|
|
1193
1201
|
case 1:
|
|
1194
|
-
|
|
1202
|
+
_v.sent();
|
|
1195
1203
|
return [2 /*return*/];
|
|
1196
1204
|
}
|
|
1197
1205
|
});
|
|
1198
1206
|
};
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
case 32:
|
|
1202
|
-
if (!(_c < VICTIM_SHAPES_3.length)) return [3 /*break*/, 35];
|
|
1203
|
-
shape = VICTIM_SHAPES_3[_c];
|
|
1204
|
-
return [5 /*yield**/, _loop_3(shape)];
|
|
1205
|
-
case 33:
|
|
1206
|
-
_r.sent();
|
|
1207
|
-
_r.label = 34;
|
|
1207
|
+
_d = 0, VICTIM_SHAPES_3 = VICTIM_SHAPES;
|
|
1208
|
+
_s.label = 34;
|
|
1208
1209
|
case 34:
|
|
1209
|
-
|
|
1210
|
-
|
|
1210
|
+
if (!(_d < VICTIM_SHAPES_3.length)) return [3 /*break*/, 37];
|
|
1211
|
+
shape = VICTIM_SHAPES_3[_d];
|
|
1212
|
+
return [5 /*yield**/, _loop_3(shape)];
|
|
1211
1213
|
case 35:
|
|
1214
|
+
_s.sent();
|
|
1215
|
+
_s.label = 36;
|
|
1216
|
+
case 36:
|
|
1217
|
+
_d++;
|
|
1218
|
+
return [3 /*break*/, 34];
|
|
1219
|
+
case 37:
|
|
1212
1220
|
G12_NAME = 'saveIntakeOnPartial answers do not overwrite a matched patient';
|
|
1213
1221
|
return [4 /*yield*/, runScenario('G12', G12_NAME, function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1214
1222
|
var victim, attackerEmail, session, enduser;
|
|
@@ -1258,8 +1266,8 @@ export var public_endpoint_auth_field_lock_tests = function (_a) {
|
|
|
1258
1266
|
// G13 — The full takeover chain, driven through an intake answer instead of the endpoint.
|
|
1259
1267
|
// ---------------------------------------------------------------------------------------------
|
|
1260
1268
|
];
|
|
1261
|
-
case
|
|
1262
|
-
|
|
1269
|
+
case 38:
|
|
1270
|
+
_s.sent();
|
|
1263
1271
|
G13_NAME = 'takeover chain via intake answer: victim not made resolvable';
|
|
1264
1272
|
return [4 /*yield*/, runScenario('G13', G13_NAME, function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1265
1273
|
var victim, attackerEmail, session, enduser, resetRes, resolvable, after, afterResult;
|
|
@@ -1322,8 +1330,8 @@ export var public_endpoint_auth_field_lock_tests = function (_a) {
|
|
|
1322
1330
|
// G14 — Pivot: a public session can prepare a response for a NON-public form and submit that.
|
|
1323
1331
|
// ---------------------------------------------------------------------------------------------
|
|
1324
1332
|
];
|
|
1325
|
-
case
|
|
1326
|
-
|
|
1333
|
+
case 39:
|
|
1334
|
+
_s.sent();
|
|
1327
1335
|
G14_NAME = 'pivot via prepare_form_response to a non-public form is also blocked';
|
|
1328
1336
|
return [4 /*yield*/, runScenario('G14', G14_NAME, function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1329
1337
|
var victimPhone, victim, attackerEmail, attackerPhone, session, authed, prepared, enduser;
|
|
@@ -1377,8 +1385,8 @@ export var public_endpoint_auth_field_lock_tests = function (_a) {
|
|
|
1377
1385
|
// G15 — save_field_response ownership: a guessable formResponseId must not reach another patient.
|
|
1378
1386
|
// ---------------------------------------------------------------------------------------------
|
|
1379
1387
|
];
|
|
1380
|
-
case
|
|
1381
|
-
|
|
1388
|
+
case 40:
|
|
1389
|
+
_s.sent();
|
|
1382
1390
|
G15_NAME = "save_field_response rejects another patient's formResponseId";
|
|
1383
1391
|
return [4 /*yield*/, runScenario('G15', G15_NAME, function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1384
1392
|
var patientA, patientB, sessionA, bPrepared, bResponseId, answer, byId, byCode, byIdWrongCode, aResponse, ownBoth;
|
|
@@ -1452,8 +1460,8 @@ export var public_endpoint_auth_field_lock_tests = function (_a) {
|
|
|
1452
1460
|
// scoped to "matched a pre-existing patient" rather than "any public session".
|
|
1453
1461
|
// ---------------------------------------------------------------------------------------------
|
|
1454
1462
|
];
|
|
1455
|
-
case
|
|
1456
|
-
|
|
1463
|
+
case 41:
|
|
1464
|
+
_s.sent();
|
|
1457
1465
|
// ---------------------------------------------------------------------------------------------
|
|
1458
1466
|
// G16 — No-regression: the intake path is the ONLY source of contact info for a new visitor.
|
|
1459
1467
|
// This is the intakeEmailHidden / intakePhone:'hidden' configuration, and the reason the lock is
|
|
@@ -1496,13 +1504,13 @@ export var public_endpoint_auth_field_lock_tests = function (_a) {
|
|
|
1496
1504
|
// G17 — No-regression: a fully authenticated (non-public) portal session may still self-update.
|
|
1497
1505
|
// ---------------------------------------------------------------------------------------------
|
|
1498
1506
|
];
|
|
1499
|
-
case
|
|
1507
|
+
case 42:
|
|
1500
1508
|
// ---------------------------------------------------------------------------------------------
|
|
1501
1509
|
// G16 — No-regression: the intake path is the ONLY source of contact info for a new visitor.
|
|
1502
1510
|
// This is the intakeEmailHidden / intakePhone:'hidden' configuration, and the reason the lock is
|
|
1503
1511
|
// scoped to "matched a pre-existing patient" rather than "any public session".
|
|
1504
1512
|
// ---------------------------------------------------------------------------------------------
|
|
1505
|
-
|
|
1513
|
+
_s.sent();
|
|
1506
1514
|
// ---------------------------------------------------------------------------------------------
|
|
1507
1515
|
// G17 — No-regression: a fully authenticated (non-public) portal session may still self-update.
|
|
1508
1516
|
// ---------------------------------------------------------------------------------------------
|
|
@@ -1543,11 +1551,11 @@ export var public_endpoint_auth_field_lock_tests = function (_a) {
|
|
|
1543
1551
|
// G18 — No-regression: staff submitting on a patient's behalf may still set email/phone.
|
|
1544
1552
|
// ---------------------------------------------------------------------------------------------
|
|
1545
1553
|
];
|
|
1546
|
-
case
|
|
1554
|
+
case 43:
|
|
1547
1555
|
// ---------------------------------------------------------------------------------------------
|
|
1548
1556
|
// G17 — No-regression: a fully authenticated (non-public) portal session may still self-update.
|
|
1549
1557
|
// ---------------------------------------------------------------------------------------------
|
|
1550
|
-
|
|
1558
|
+
_s.sent();
|
|
1551
1559
|
// ---------------------------------------------------------------------------------------------
|
|
1552
1560
|
// G18 — No-regression: staff submitting on a patient's behalf may still set email/phone.
|
|
1553
1561
|
// ---------------------------------------------------------------------------------------------
|
|
@@ -1597,11 +1605,11 @@ export var public_endpoint_auth_field_lock_tests = function (_a) {
|
|
|
1597
1605
|
// accepted. Deliberately opaque rather than date-shaped, so match-vs-insert is unambiguous even when
|
|
1598
1606
|
// this file runs inside the full suite (no reset_db between files).
|
|
1599
1607
|
];
|
|
1600
|
-
case
|
|
1608
|
+
case 44:
|
|
1601
1609
|
// ---------------------------------------------------------------------------------------------
|
|
1602
1610
|
// G18 — No-regression: staff submitting on a patient's behalf may still set email/phone.
|
|
1603
1611
|
// ---------------------------------------------------------------------------------------------
|
|
1604
|
-
|
|
1612
|
+
_s.sent();
|
|
1605
1613
|
namelessDob = "01-02-1990-".concat(RUN);
|
|
1606
1614
|
makeNamelessVictim = function (tag) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1607
1615
|
var victim, stored;
|
|
@@ -1642,8 +1650,8 @@ export var public_endpoint_auth_field_lock_tests = function (_a) {
|
|
|
1642
1650
|
}
|
|
1643
1651
|
});
|
|
1644
1652
|
}); })];
|
|
1645
|
-
case
|
|
1646
|
-
|
|
1653
|
+
case 45:
|
|
1654
|
+
_s.sent();
|
|
1647
1655
|
G20_NAME = 'DOB-only request does not hijack a nameless patient (booking endpoint)';
|
|
1648
1656
|
return [4 /*yield*/, runScenario('G20', G20_NAME, function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1649
1657
|
var _a, victim, stored, dob, withDob;
|
|
@@ -1680,8 +1688,8 @@ export var public_endpoint_auth_field_lock_tests = function (_a) {
|
|
|
1680
1688
|
// enduserInfo (which is spread into both the enduser insert and the form_responses record).
|
|
1681
1689
|
// ---------------------------------------------------------------------------------------------
|
|
1682
1690
|
];
|
|
1683
|
-
case
|
|
1684
|
-
|
|
1691
|
+
case 46:
|
|
1692
|
+
_s.sent();
|
|
1685
1693
|
// ---------------------------------------------------------------------------------------------
|
|
1686
1694
|
// G21 — The match sentinel must never be stored as a patient's name.
|
|
1687
1695
|
// Guard rail on the fix: the fallback belongs in the filter literal only, never written into
|
|
@@ -1716,13 +1724,13 @@ export var public_endpoint_auth_field_lock_tests = function (_a) {
|
|
|
1716
1724
|
// "any public session", precisely so this keeps working.
|
|
1717
1725
|
// ---------------------------------------------------------------------------------------------
|
|
1718
1726
|
];
|
|
1719
|
-
case
|
|
1727
|
+
case 47:
|
|
1720
1728
|
// ---------------------------------------------------------------------------------------------
|
|
1721
1729
|
// G21 — The match sentinel must never be stored as a patient's name.
|
|
1722
1730
|
// Guard rail on the fix: the fallback belongs in the filter literal only, never written into
|
|
1723
1731
|
// enduserInfo (which is spread into both the enduser insert and the form_responses record).
|
|
1724
1732
|
// ---------------------------------------------------------------------------------------------
|
|
1725
|
-
|
|
1733
|
+
_s.sent();
|
|
1726
1734
|
coldStartCase = function (label, args) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1727
1735
|
var group, submittedEmail, submittedPhone, session, created, enduser;
|
|
1728
1736
|
return __generator(this, function (_a) {
|
|
@@ -1760,9 +1768,9 @@ export var public_endpoint_auth_field_lock_tests = function (_a) {
|
|
|
1760
1768
|
// And the same with no skipMatch, which still cannot match: the email branch needs email === "never"
|
|
1761
1769
|
// (unstorable) and the name branch needs dateOfBirth === "never" literally.
|
|
1762
1770
|
];
|
|
1763
|
-
case
|
|
1771
|
+
case 48:
|
|
1764
1772
|
// The shape the real webapp sends (public_form.tsx handleNoIntakeRedirect): nothing but ids.
|
|
1765
|
-
|
|
1773
|
+
_s.sent();
|
|
1766
1774
|
// And the same with no skipMatch, which still cannot match: the email branch needs email === "never"
|
|
1767
1775
|
// (unstorable) and the name branch needs dateOfBirth === "never" literally.
|
|
1768
1776
|
return [4 /*yield*/, runScenario('G22', 'cold start without skipMatch', function () { return coldStartCase('no-skipMatch', {}); })
|
|
@@ -1784,10 +1792,10 @@ export var public_endpoint_auth_field_lock_tests = function (_a) {
|
|
|
1784
1792
|
// sentinels constrain which record shapes the filter can match, not which tenants it searches.
|
|
1785
1793
|
// ---------------------------------------------------------------------------------------------
|
|
1786
1794
|
];
|
|
1787
|
-
case
|
|
1795
|
+
case 49:
|
|
1788
1796
|
// And the same with no skipMatch, which still cannot match: the email branch needs email === "never"
|
|
1789
1797
|
// (unstorable) and the name branch needs dateOfBirth === "never" literally.
|
|
1790
|
-
|
|
1798
|
+
_s.sent();
|
|
1791
1799
|
G23_NAME = 'session_for_public_form requires businessId';
|
|
1792
1800
|
return [4 /*yield*/, runScenario('G23', G23_NAME, function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1793
1801
|
var victim, omitted, blocked, wrongBiz, badBiz;
|
|
@@ -1847,8 +1855,8 @@ export var public_endpoint_auth_field_lock_tests = function (_a) {
|
|
|
1847
1855
|
// redact_field(enduser, 'hashedPassword') — the whole record — instead of just assignedTo.
|
|
1848
1856
|
// ---------------------------------------------------------------------------------------------
|
|
1849
1857
|
];
|
|
1850
|
-
case
|
|
1851
|
-
|
|
1858
|
+
case 50:
|
|
1859
|
+
_s.sent();
|
|
1852
1860
|
chainForVictim = function (tag, victim) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1853
1861
|
var t1, hop1;
|
|
1854
1862
|
return __generator(this, function (_a) {
|
|
@@ -1922,8 +1930,8 @@ export var public_endpoint_auth_field_lock_tests = function (_a) {
|
|
|
1922
1930
|
}
|
|
1923
1931
|
});
|
|
1924
1932
|
}); })];
|
|
1925
|
-
case
|
|
1926
|
-
|
|
1933
|
+
case 51:
|
|
1934
|
+
_s.sent();
|
|
1927
1935
|
G25_NAME = 'chained session does not expose the enduser record on refresh';
|
|
1928
1936
|
return [4 /*yield*/, runScenario('G25', G25_NAME, function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1929
1937
|
var victim, _a, matched, t1, t2, PHI_KEYS, leakedIn, base, chained, leaked;
|
|
@@ -1975,8 +1983,8 @@ export var public_endpoint_auth_field_lock_tests = function (_a) {
|
|
|
1975
1983
|
// unchanged" cannot pass just because nothing happened.
|
|
1976
1984
|
// ---------------------------------------------------------------------------------------------
|
|
1977
1985
|
];
|
|
1978
|
-
case
|
|
1979
|
-
|
|
1986
|
+
case 52:
|
|
1987
|
+
_s.sent();
|
|
1980
1988
|
G26_NAME = 'auto-merge does not let an intake answer repoint the merged patient';
|
|
1981
1989
|
return [4 /*yield*/, runScenario('G26', G26_NAME, function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
1982
1990
|
var victimEmail, victimPhone, victimDob, victim, attackerEmail, session, sourceId, f, after, merged, customLanded;
|
|
@@ -2045,8 +2053,8 @@ export var public_endpoint_auth_field_lock_tests = function (_a) {
|
|
|
2045
2053
|
// stored flag is the load-bearing assertion here, not a follow-up submit.
|
|
2046
2054
|
// ---------------------------------------------------------------------------------------------
|
|
2047
2055
|
];
|
|
2048
|
-
case
|
|
2049
|
-
|
|
2056
|
+
case 53:
|
|
2057
|
+
_s.sent();
|
|
2050
2058
|
G27_NAME = 'staff merge applies the lock when it repoints a response';
|
|
2051
2059
|
return [4 /*yield*/, runScenario('G27', G27_NAME, function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
2052
2060
|
var victimEmail, victim, session, beforeMerge, afterMerge, repointed, stillVictim;
|
|
@@ -2109,8 +2117,8 @@ export var public_endpoint_auth_field_lock_tests = function (_a) {
|
|
|
2109
2117
|
// caller including this one, with no other test noticing.
|
|
2110
2118
|
// ---------------------------------------------------------------------------------------------
|
|
2111
2119
|
];
|
|
2112
|
-
case
|
|
2113
|
-
|
|
2120
|
+
case 54:
|
|
2121
|
+
_s.sent();
|
|
2114
2122
|
G28_NAME = 'a fresh Stripe-created patient gets no grace on the public form path';
|
|
2115
2123
|
return [4 /*yield*/, runScenario('G28', G28_NAME, function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
2116
2124
|
var victimEmail, victim, attackerEmail, attackerPhone, session, enduser;
|
|
@@ -2164,127 +2172,127 @@ export var public_endpoint_auth_field_lock_tests = function (_a) {
|
|
|
2164
2172
|
// Report
|
|
2165
2173
|
// ---------------------------------------------------------------------------------------------
|
|
2166
2174
|
];
|
|
2167
|
-
case
|
|
2168
|
-
|
|
2175
|
+
case 55:
|
|
2176
|
+
_s.sent();
|
|
2169
2177
|
failures = results.filter(function (r) { return !r.ok; });
|
|
2170
2178
|
skipped = results.filter(function (r) { return !!r.skipped; });
|
|
2171
2179
|
console.log('');
|
|
2172
2180
|
console.log(' ┌─ Public endpoint auth-field lock — summary ────────────────────────────');
|
|
2173
|
-
for (
|
|
2174
|
-
r = results_1[
|
|
2181
|
+
for (_e = 0, results_1 = results; _e < results_1.length; _e++) {
|
|
2182
|
+
r = results_1[_e];
|
|
2175
2183
|
status_1 = r.skipped ? 'SKIP' : r.ok ? 'PASS' : 'FAIL';
|
|
2176
2184
|
console.log(" \u2502 ".concat(status_1, " ").concat(r.group.padEnd(3), " ").concat(r.name).concat(r.detail ? " \u2014 ".concat(r.detail) : ''));
|
|
2177
2185
|
}
|
|
2178
2186
|
console.log(" \u2514\u2500 ".concat(results.length - failures.length, "/").concat(results.length, " passed, ").concat(skipped.length, " skipped, ").concat(failures.length, " failed"));
|
|
2179
2187
|
console.log('');
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
case 54:
|
|
2183
|
-
if (!(_e < createdEventIds_1.length)) return [3 /*break*/, 57];
|
|
2184
|
-
id = createdEventIds_1[_e];
|
|
2185
|
-
return [4 /*yield*/, sdk.api.calendar_events.deleteOne(id).catch(function () { return null; })];
|
|
2186
|
-
case 55:
|
|
2187
|
-
_r.sent();
|
|
2188
|
-
_r.label = 56;
|
|
2188
|
+
_f = 0, createdEventIds_1 = createdEventIds;
|
|
2189
|
+
_s.label = 56;
|
|
2189
2190
|
case 56:
|
|
2190
|
-
|
|
2191
|
-
|
|
2191
|
+
if (!(_f < createdEventIds_1.length)) return [3 /*break*/, 59];
|
|
2192
|
+
id = createdEventIds_1[_f];
|
|
2193
|
+
return [4 /*yield*/, sdk.api.calendar_events.deleteOne(id).catch(function () { return null; })];
|
|
2192
2194
|
case 57:
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
+
_s.sent();
|
|
2196
|
+
_s.label = 58;
|
|
2195
2197
|
case 58:
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
return [4 /*yield*/, sdk.api.form_responses.getSome({ filter: { formId: formId } }).catch(function () { return []; })];
|
|
2198
|
+
_f++;
|
|
2199
|
+
return [3 /*break*/, 56];
|
|
2199
2200
|
case 59:
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
_r.label = 60;
|
|
2201
|
+
_g = 0, createdFormIds_1 = createdFormIds;
|
|
2202
|
+
_s.label = 60;
|
|
2203
2203
|
case 60:
|
|
2204
|
-
if (!(_g <
|
|
2205
|
-
|
|
2206
|
-
return [4 /*yield*/, sdk.api.form_responses.
|
|
2204
|
+
if (!(_g < createdFormIds_1.length)) return [3 /*break*/, 66];
|
|
2205
|
+
formId = createdFormIds_1[_g];
|
|
2206
|
+
return [4 /*yield*/, sdk.api.form_responses.getSome({ filter: { formId: formId } }).catch(function () { return []; })];
|
|
2207
2207
|
case 61:
|
|
2208
|
-
|
|
2209
|
-
|
|
2208
|
+
responses = _s.sent();
|
|
2209
|
+
_h = 0, responses_1 = responses;
|
|
2210
|
+
_s.label = 62;
|
|
2210
2211
|
case 62:
|
|
2211
|
-
|
|
2212
|
-
|
|
2212
|
+
if (!(_h < responses_1.length)) return [3 /*break*/, 65];
|
|
2213
|
+
response = responses_1[_h];
|
|
2214
|
+
return [4 /*yield*/, sdk.api.form_responses.deleteOne(response.id).catch(function () { return null; })];
|
|
2213
2215
|
case 63:
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
+
_s.sent();
|
|
2217
|
+
_s.label = 64;
|
|
2216
2218
|
case 64:
|
|
2217
|
-
_h
|
|
2218
|
-
|
|
2219
|
+
_h++;
|
|
2220
|
+
return [3 /*break*/, 62];
|
|
2219
2221
|
case 65:
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
return [4 /*yield*/, sdk.api.form_fields.deleteOne(id).catch(function () { return null; })];
|
|
2222
|
+
_g++;
|
|
2223
|
+
return [3 /*break*/, 60];
|
|
2223
2224
|
case 66:
|
|
2224
|
-
|
|
2225
|
-
|
|
2225
|
+
_j = 0, createdFormFieldIds_1 = createdFormFieldIds;
|
|
2226
|
+
_s.label = 67;
|
|
2226
2227
|
case 67:
|
|
2227
|
-
|
|
2228
|
-
|
|
2228
|
+
if (!(_j < createdFormFieldIds_1.length)) return [3 /*break*/, 70];
|
|
2229
|
+
id = createdFormFieldIds_1[_j];
|
|
2230
|
+
return [4 /*yield*/, sdk.api.form_fields.deleteOne(id).catch(function () { return null; })];
|
|
2229
2231
|
case 68:
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
+
_s.sent();
|
|
2233
|
+
_s.label = 69;
|
|
2232
2234
|
case 69:
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
return [4 /*yield*/, sdk.api.forms.deleteOne(id).catch(function () { return null; })];
|
|
2235
|
+
_j++;
|
|
2236
|
+
return [3 /*break*/, 67];
|
|
2236
2237
|
case 70:
|
|
2237
|
-
|
|
2238
|
-
|
|
2238
|
+
_k = 0, createdFormIds_2 = createdFormIds;
|
|
2239
|
+
_s.label = 71;
|
|
2239
2240
|
case 71:
|
|
2240
|
-
|
|
2241
|
-
|
|
2241
|
+
if (!(_k < createdFormIds_2.length)) return [3 /*break*/, 74];
|
|
2242
|
+
id = createdFormIds_2[_k];
|
|
2243
|
+
return [4 /*yield*/, sdk.api.forms.deleteOne(id).catch(function () { return null; })];
|
|
2242
2244
|
case 72:
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
_r.label = 73;
|
|
2245
|
+
_s.sent();
|
|
2246
|
+
_s.label = 73;
|
|
2246
2247
|
case 73:
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
return [4 /*yield*/, sdk.api.endusers.deleteOne(id).catch(function () { return null; })];
|
|
2248
|
+
_k++;
|
|
2249
|
+
return [3 /*break*/, 71];
|
|
2250
2250
|
case 74:
|
|
2251
|
-
|
|
2252
|
-
|
|
2251
|
+
uniqueEnduserIds = createdEnduserIds.filter(function (id, i) { return !!id && createdEnduserIds.indexOf(id) === i; });
|
|
2252
|
+
_l = 0, uniqueEnduserIds_1 = uniqueEnduserIds;
|
|
2253
|
+
_s.label = 75;
|
|
2253
2254
|
case 75:
|
|
2254
|
-
|
|
2255
|
-
|
|
2255
|
+
if (!(_l < uniqueEnduserIds_1.length)) return [3 /*break*/, 78];
|
|
2256
|
+
id = uniqueEnduserIds_1[_l];
|
|
2257
|
+
return [4 /*yield*/, sdk.api.endusers.deleteOne(id).catch(function () { return null; })];
|
|
2256
2258
|
case 76:
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
+
_s.sent();
|
|
2260
|
+
_s.label = 77;
|
|
2259
2261
|
case 77:
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
return [4 /*yield*/, sdk.api.calendar_event_templates.deleteOne(id).catch(function () { return null; })];
|
|
2262
|
+
_l++;
|
|
2263
|
+
return [3 /*break*/, 75];
|
|
2263
2264
|
case 78:
|
|
2264
|
-
|
|
2265
|
-
|
|
2265
|
+
_m = 0, createdTemplateIds_1 = createdTemplateIds;
|
|
2266
|
+
_s.label = 79;
|
|
2266
2267
|
case 79:
|
|
2267
|
-
|
|
2268
|
-
|
|
2268
|
+
if (!(_m < createdTemplateIds_1.length)) return [3 /*break*/, 82];
|
|
2269
|
+
id = createdTemplateIds_1[_m];
|
|
2270
|
+
return [4 /*yield*/, sdk.api.calendar_event_templates.deleteOne(id).catch(function () { return null; })];
|
|
2269
2271
|
case 80:
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
+
_s.sent();
|
|
2273
|
+
_s.label = 81;
|
|
2272
2274
|
case 81:
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
return [4 /*yield*/, sdk.api.users.deleteOne(id).catch(function () { return null; })];
|
|
2275
|
+
_m++;
|
|
2276
|
+
return [3 /*break*/, 79];
|
|
2276
2277
|
case 82:
|
|
2277
|
-
|
|
2278
|
-
|
|
2278
|
+
_o = 0, createdUserIds_1 = createdUserIds;
|
|
2279
|
+
_s.label = 83;
|
|
2279
2280
|
case 83:
|
|
2280
|
-
|
|
2281
|
-
|
|
2281
|
+
if (!(_o < createdUserIds_1.length)) return [3 /*break*/, 86];
|
|
2282
|
+
id = createdUserIds_1[_o];
|
|
2283
|
+
return [4 /*yield*/, sdk.api.users.deleteOne(id).catch(function () { return null; })];
|
|
2282
2284
|
case 84:
|
|
2285
|
+
_s.sent();
|
|
2286
|
+
_s.label = 85;
|
|
2287
|
+
case 85:
|
|
2288
|
+
_o++;
|
|
2289
|
+
return [3 /*break*/, 83];
|
|
2290
|
+
case 86:
|
|
2283
2291
|
// ---------------------------------------------------------------------------------------------
|
|
2284
2292
|
// Assert — single pass, last, so the full table above is always printed first.
|
|
2285
2293
|
// ---------------------------------------------------------------------------------------------
|
|
2286
|
-
for (
|
|
2287
|
-
r = results_2[
|
|
2294
|
+
for (_p = 0, results_2 = results; _p < results_2.length; _p++) {
|
|
2295
|
+
r = results_2[_p];
|
|
2288
2296
|
assert(r.ok, "\u274C [".concat(r.group, "] ").concat(r.name, " \u2014 ").concat(r.detail), "[".concat(r.group, "] ").concat(r.name).concat(r.skipped ? ' (SKIPPED)' : ''));
|
|
2289
2297
|
}
|
|
2290
2298
|
return [2 /*return*/];
|