@tellescope/sdk 1.168.0 → 1.169.0

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.
@@ -7500,8 +7500,8 @@ var formsort_tests = function () { return __awaiter(void 0, void 0, void 0, func
7500
7500
  case 31:
7501
7501
  submissionEnduser = _a.sent();
7502
7502
  validateResponse = function (fr, key, value) {
7503
- var _a, _b;
7504
- var answer = (_b = (_a = fr.responses.find(function (r) { return r.externalId === key; })) === null || _a === void 0 ? void 0 : _a.answer) === null || _b === void 0 ? void 0 : _b.value;
7503
+ var _a, _b, _c;
7504
+ var answer = (_c = (_b = (_a = fr.responses) === null || _a === void 0 ? void 0 : _a.find(function (r) { return r.externalId === key; })) === null || _b === void 0 ? void 0 : _b.answer) === null || _c === void 0 ? void 0 : _c.value;
7505
7505
  if (typeof value === 'object') {
7506
7506
  return (0, utilities_2.objects_equivalent)(answer, value);
7507
7507
  }
@@ -7510,7 +7510,7 @@ var formsort_tests = function () { return __awaiter(void 0, void 0, void 0, func
7510
7510
  // EXISTING ENDUSER FIELDS ARE CURRENTLY ONLY UPDATED ON SUBMISSION
7511
7511
  return [4 /*yield*/, (0, testing_1.async_test)("Answers and fields (unfinalized)", function () { return sdk.api.form_responses.getOne({ externalId: '6' }); }, {
7512
7512
  onResult: function (r) {
7513
- var _a;
7513
+ var _a, _b;
7514
7514
  if (!r) {
7515
7515
  return false;
7516
7516
  }
@@ -7520,7 +7520,7 @@ var formsort_tests = function () { return __awaiter(void 0, void 0, void 0, func
7520
7520
  if (!((_a = r.formsort) === null || _a === void 0 ? void 0 : _a.length)) {
7521
7521
  return false;
7522
7522
  }
7523
- if (!r.responses.length) {
7523
+ if (!((_b = r.responses) === null || _b === void 0 ? void 0 : _b.length)) {
7524
7524
  return false;
7525
7525
  }
7526
7526
  if (r.responses.length !== answers.length) {
@@ -7611,7 +7611,7 @@ var formsort_tests = function () { return __awaiter(void 0, void 0, void 0, func
7611
7611
  // EXISTING ENDUSER FIELDS ARE CURRENTLY ONLY UPDATED ON SUBMISSION
7612
7612
  return [4 /*yield*/, (0, testing_1.async_test)("Answers and fields (finalized)", function () { return sdk.api.form_responses.getOne({ externalId: '6' }); }, {
7613
7613
  onResult: function (r) {
7614
- var _a, _b, _c, _d, _f, _g, _h, _j;
7614
+ var _a, _b, _c, _d, _f, _g, _h, _j, _k;
7615
7615
  if (!r) {
7616
7616
  return false;
7617
7617
  }
@@ -7621,7 +7621,7 @@ var formsort_tests = function () { return __awaiter(void 0, void 0, void 0, func
7621
7621
  if (!((_a = r.formsort) === null || _a === void 0 ? void 0 : _a.length)) {
7622
7622
  return false;
7623
7623
  }
7624
- if (!r.responses.length) {
7624
+ if (!((_b = r.responses) === null || _b === void 0 ? void 0 : _b.length)) {
7625
7625
  return false;
7626
7626
  }
7627
7627
  if (r.responses.length !== answers.length) {
@@ -7717,7 +7717,7 @@ var formsort_tests = function () { return __awaiter(void 0, void 0, void 0, func
7717
7717
  if (submissionEnduser.useDefaultFromPhoneInAutomations !== true) {
7718
7718
  return false;
7719
7719
  }
7720
- if (((_b = submissionEnduser.language) === null || _b === void 0 ? void 0 : _b.displayName) !== "Spanish") {
7720
+ if (((_c = submissionEnduser.language) === null || _c === void 0 ? void 0 : _c.displayName) !== "Spanish") {
7721
7721
  return false;
7722
7722
  }
7723
7723
  if (submissionEnduser.timezone !== "US/Eastern") {
@@ -7726,10 +7726,10 @@ var formsort_tests = function () { return __awaiter(void 0, void 0, void 0, func
7726
7726
  if (submissionEnduser.healthie_dietitian_id !== "test_id") {
7727
7727
  return false;
7728
7728
  }
7729
- if (((_c = submissionEnduser.height) === null || _c === void 0 ? void 0 : _c.value) !== 10) {
7729
+ if (((_d = submissionEnduser.height) === null || _d === void 0 ? void 0 : _d.value) !== 10) {
7730
7730
  return false;
7731
7731
  }
7732
- if (((_d = submissionEnduser.weight) === null || _d === void 0 ? void 0 : _d.value) !== 20) {
7732
+ if (((_f = submissionEnduser.weight) === null || _f === void 0 ? void 0 : _f.value) !== 20) {
7733
7733
  return false;
7734
7734
  }
7735
7735
  if (submissionEnduser.addressLineOne !== 'Address 1') {
@@ -7750,16 +7750,16 @@ var formsort_tests = function () { return __awaiter(void 0, void 0, void 0, func
7750
7750
  if (submissionEnduser.dateOfBirth !== '12-20-2000') {
7751
7751
  return false;
7752
7752
  }
7753
- if (((_f = submissionEnduser.insurance) === null || _f === void 0 ? void 0 : _f.payerId) !== 'insurance 1') {
7753
+ if (((_g = submissionEnduser.insurance) === null || _g === void 0 ? void 0 : _g.payerId) !== 'insurance 1') {
7754
7754
  return false;
7755
7755
  }
7756
- if (((_g = submissionEnduser.insuranceSecondary) === null || _g === void 0 ? void 0 : _g.payerId) !== 'insurance 2') {
7756
+ if (((_h = submissionEnduser.insuranceSecondary) === null || _h === void 0 ? void 0 : _h.payerId) !== 'insurance 2') {
7757
7757
  return false;
7758
7758
  }
7759
- if (((_h = submissionEnduser.fields) === null || _h === void 0 ? void 0 : _h.custom) !== 'Custom') {
7759
+ if (((_j = submissionEnduser.fields) === null || _j === void 0 ? void 0 : _j.custom) !== 'Custom') {
7760
7760
  return false;
7761
7761
  }
7762
- if (((_j = submissionEnduser.fields) === null || _j === void 0 ? void 0 : _j.custom2) !== 'Custom 2') {
7762
+ if (((_k = submissionEnduser.fields) === null || _k === void 0 ? void 0 : _k.custom2) !== 'Custom 2') {
7763
7763
  return false;
7764
7764
  }
7765
7765
  return true;
@@ -10338,7 +10338,7 @@ var input_modifier_tests = function () { return __awaiter(void 0, void 0, void 0
10338
10338
  fieldId: '',
10339
10339
  answer: { type: 'string', value: 'hello' }
10340
10340
  }]
10341
- }); }, { onResult: function (r) { return r.responses[0].answer.value === 'hello'; } })];
10341
+ }); }, { onResult: function (r) { var _a; return ((_a = r.responses) === null || _a === void 0 ? void 0 : _a[0].answer.value) === 'hello'; } })];
10342
10342
  case 2:
10343
10343
  _a.sent();
10344
10344
  return [4 /*yield*/, (0, testing_1.async_test)("Number coerce to string", function () { return sdk.api.form_responses.createOne({
@@ -10350,7 +10350,7 @@ var input_modifier_tests = function () { return __awaiter(void 0, void 0, void 0
10350
10350
  fieldId: '',
10351
10351
  answer: { type: 'string', value: 55 }
10352
10352
  }]
10353
- }); }, { onResult: function (r) { return r.responses[0].answer.value === '55'; } })];
10353
+ }); }, { onResult: function (r) { var _a; return ((_a = r.responses) === null || _a === void 0 ? void 0 : _a[0].answer.value) === '55'; } })];
10354
10354
  case 3:
10355
10355
  _a.sent();
10356
10356
  return [4 /*yield*/, Promise.all([