@tellescope/sdk 1.4.24 → 1.4.27
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 -0
- package/lib/cjs/enduser.d.ts.map +1 -1
- package/lib/cjs/sdk.d.ts +6 -2
- package/lib/cjs/sdk.d.ts.map +1 -1
- package/lib/cjs/sdk.js +1 -0
- package/lib/cjs/sdk.js.map +1 -1
- package/lib/cjs/session.d.ts +2 -0
- package/lib/cjs/session.d.ts.map +1 -1
- package/lib/cjs/session.js +8 -3
- package/lib/cjs/session.js.map +1 -1
- package/lib/cjs/tests/tests.d.ts.map +1 -1
- package/lib/cjs/tests/tests.js +37 -77
- package/lib/cjs/tests/tests.js.map +1 -1
- package/lib/cjs/tests/webhooks_tests.js +13 -7
- package/lib/cjs/tests/webhooks_tests.js.map +1 -1
- package/lib/esm/enduser.d.ts +0 -1
- package/lib/esm/enduser.d.ts.map +1 -1
- package/lib/esm/sdk.d.ts +7 -3
- package/lib/esm/sdk.d.ts.map +1 -1
- package/lib/esm/sdk.js +1 -0
- package/lib/esm/sdk.js.map +1 -1
- package/lib/esm/session.d.ts +1 -1
- package/lib/esm/session.d.ts.map +1 -1
- package/lib/esm/session.js +8 -3
- package/lib/esm/session.js.map +1 -1
- package/lib/esm/tests/tests.d.ts.map +1 -1
- package/lib/esm/tests/tests.js +37 -77
- package/lib/esm/tests/tests.js.map +1 -1
- package/lib/esm/tests/webhooks_tests.js +13 -7
- package/lib/esm/tests/webhooks_tests.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +10 -10
- package/src/sdk.ts +7 -0
- package/src/session.ts +11 -3
- package/src/tests/tests.ts +6 -55
- package/src/tests/webhooks_tests.ts +6 -0
package/lib/esm/tests/tests.js
CHANGED
|
@@ -692,73 +692,89 @@ var enduser_tests = function (queries) {
|
|
|
692
692
|
return [4 /*yield*/, async_test("enduser registered can log in", function () { return enduserSDK.authenticate('test3@gmail.com', 'testenduserpassword'); }, { onResult: function (e) { return !!e.authToken && e.enduser.email === 'test3@gmail.com'; } })];
|
|
693
693
|
case 5:
|
|
694
694
|
_a.sent();
|
|
695
|
-
return [4 /*yield*/, async_test("update-enduser email conflict", function () { var _a; return queries.updateOne((_a = e1.id) !== null && _a !== void 0 ? _a : '', { email: e2.email }); }, { shouldError: true, onError: function () { return true; } })
|
|
695
|
+
return [4 /*yield*/, async_test("update-enduser email conflict", function () { var _a; return queries.updateOne((_a = e1.id) !== null && _a !== void 0 ? _a : '', { email: e2.email }); }, { shouldError: true, onError: function () { return true; } })
|
|
696
|
+
// no longer restricted
|
|
697
|
+
// await async_test(
|
|
698
|
+
// `update-enduser phone conflict`,
|
|
699
|
+
// () => queries.updateOne(e1.id ?? '', { phone: e2.phone }),
|
|
700
|
+
// { shouldError: true, onError: () => true }
|
|
701
|
+
// )
|
|
702
|
+
];
|
|
696
703
|
case 6:
|
|
697
704
|
_a.sent();
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
705
|
+
// no longer restricted
|
|
706
|
+
// await async_test(
|
|
707
|
+
// `update-enduser phone conflict`,
|
|
708
|
+
// () => queries.updateOne(e1.id ?? '', { phone: e2.phone }),
|
|
709
|
+
// { shouldError: true, onError: () => true }
|
|
710
|
+
// )
|
|
701
711
|
return [4 /*yield*/, async_test("update-enduser email and phone conflict", function () { var _a; return queries.updateOne((_a = e1.id) !== null && _a !== void 0 ? _a : '', { email: e2.email, phone: e2.phone }); }, { shouldError: true, onError: function () { return true; } })];
|
|
702
|
-
case
|
|
712
|
+
case 7:
|
|
713
|
+
// no longer restricted
|
|
714
|
+
// await async_test(
|
|
715
|
+
// `update-enduser phone conflict`,
|
|
716
|
+
// () => queries.updateOne(e1.id ?? '', { phone: e2.phone }),
|
|
717
|
+
// { shouldError: true, onError: () => true }
|
|
718
|
+
// )
|
|
703
719
|
_a.sent();
|
|
704
720
|
return [4 /*yield*/, async_test("update-enduser working", function () { var _a; return queries.updateOne((_a = e1.id) !== null && _a !== void 0 ? _a : '', { email: 'edited' + e1.email }); }, passOnVoid)];
|
|
705
|
-
case
|
|
721
|
+
case 8:
|
|
706
722
|
_a.sent();
|
|
707
723
|
return [4 /*yield*/, async_test("update-enduser test replaceObjectFields 1", function () { var _a; return queries.updateOne((_a = e1.id) !== null && _a !== void 0 ? _a : '', { fields: { field1: '1' } }); }, passOnVoid)];
|
|
708
|
-
case
|
|
724
|
+
case 9:
|
|
709
725
|
_a.sent();
|
|
710
726
|
return [4 /*yield*/, async_test("get-enduser test replaceObjectFields verify 1", function () { var _a; return queries.getOne((_a = e1.id) !== null && _a !== void 0 ? _a : ''); }, { onResult: function (e) { var _a; return ((_a = e.fields) === null || _a === void 0 ? void 0 : _a.field1) === '1'; } })];
|
|
711
|
-
case
|
|
727
|
+
case 10:
|
|
712
728
|
_a.sent();
|
|
713
729
|
return [4 /*yield*/, async_test("update-enduser test replaceObjectFields 2", function () { var _a; return queries.updateOne((_a = e1.id) !== null && _a !== void 0 ? _a : '', { fields: { field2: '2' } }); }, passOnVoid)];
|
|
714
|
-
case
|
|
730
|
+
case 11:
|
|
715
731
|
_a.sent();
|
|
716
732
|
return [4 /*yield*/, async_test("get-enduser test replaceObjectFields verify 2", function () { var _a; return queries.getOne((_a = e1.id) !== null && _a !== void 0 ? _a : ''); }, { onResult: function (e) { var _a, _b; return ((_a = e.fields) === null || _a === void 0 ? void 0 : _a.field1) === '1' && ((_b = e.fields) === null || _b === void 0 ? void 0 : _b.field2) === '2'; } })];
|
|
717
|
-
case
|
|
733
|
+
case 12:
|
|
718
734
|
_a.sent();
|
|
719
735
|
return [4 /*yield*/, async_test("update-enduser test replaceObjectFields true 1", function () { var _a; return queries.updateOne((_a = e1.id) !== null && _a !== void 0 ? _a : '', { fields: { field2: '_2' } }, { replaceObjectFields: true }); }, passOnVoid)];
|
|
720
|
-
case
|
|
736
|
+
case 13:
|
|
721
737
|
_a.sent();
|
|
722
738
|
return [4 /*yield*/, async_test("get-enduser test replaceObjectFields verify true 1", function () { var _a; return queries.getOne((_a = e1.id) !== null && _a !== void 0 ? _a : ''); }, { onResult: function (e) { var _a, _b; return ((_a = e.fields) === null || _a === void 0 ? void 0 : _a.field1) === undefined && ((_b = e.fields) === null || _b === void 0 ? void 0 : _b.field2) === '_2'; } })];
|
|
723
|
-
case
|
|
739
|
+
case 14:
|
|
724
740
|
_a.sent();
|
|
725
741
|
return [4 /*yield*/, async_test("update-enduser test replaceObjectFields true unset", function () { var _a; return queries.updateOne((_a = e1.id) !== null && _a !== void 0 ? _a : '', { fields: {} }, { replaceObjectFields: true }); }, passOnVoid)];
|
|
726
|
-
case
|
|
742
|
+
case 15:
|
|
727
743
|
_a.sent();
|
|
728
744
|
return [4 /*yield*/, async_test("get-enduser test replaceObjectFields verify true unset", function () { var _a; return queries.getOne((_a = e1.id) !== null && _a !== void 0 ? _a : ''); }, { onResult: function (e) { return objects_equivalent(e.fields, {}); } })];
|
|
729
|
-
case
|
|
745
|
+
case 16:
|
|
730
746
|
_a.sent();
|
|
731
747
|
eToDup1 = { email: 'dup1@tellescope.com' };
|
|
732
748
|
eToDup2 = { email: 'dup2@tellescope.com' };
|
|
733
749
|
return [4 /*yield*/, queries.createOne(eToDup1)];
|
|
734
|
-
case
|
|
750
|
+
case 17:
|
|
735
751
|
_a.sent();
|
|
736
752
|
return [4 /*yield*/, queries.createOne(eToDup2)];
|
|
737
|
-
case
|
|
753
|
+
case 18:
|
|
738
754
|
_a.sent();
|
|
739
755
|
return [4 /*yield*/, async_test("create-many-endusers - all conflict (1)", function () { return queries.createSome([eToDup1]); }, { shouldError: true, onError: function (e) { return e.message === 'Uniqueness Violation'; } })];
|
|
740
|
-
case
|
|
756
|
+
case 19:
|
|
741
757
|
_a.sent();
|
|
742
758
|
return [4 /*yield*/, async_test("create-many-endusers - all conflict (2)", function () { return queries.createSome([eToDup1, eToDup2]); }, { shouldError: true, onError: function (e) { return e.message === 'Uniqueness Violation'; } })];
|
|
743
|
-
case
|
|
759
|
+
case 20:
|
|
744
760
|
_a.sent();
|
|
745
761
|
return [4 /*yield*/, async_test("create-many-endusers - multiple email conflict", function () { return queries.createSome([eToDup1, eToDup2, { email: "unique@tellescope.com" }]); }, { onResult: function (_a) {
|
|
746
762
|
var created = _a.created, errors = _a.errors;
|
|
747
763
|
return created.length === 1 && errors.length === 2;
|
|
748
764
|
} })];
|
|
749
|
-
case
|
|
765
|
+
case 21:
|
|
750
766
|
_a.sent();
|
|
751
767
|
return [4 /*yield*/, async_test("create-many-endusers - create conflict, one unique", function () { return queries.createSome([{ email: 'd1@tellescope.com' }, { email: 'd1@tellescope.com' }, { email: 'd1@tellescope.com' }]); }, { onResult: function (_a) {
|
|
752
768
|
var created = _a.created, errors = _a.errors;
|
|
753
769
|
return created.length === 1 && errors.length === 2;
|
|
754
770
|
} })];
|
|
755
|
-
case
|
|
771
|
+
case 22:
|
|
756
772
|
_a.sent();
|
|
757
773
|
return [4 /*yield*/, async_test("create-many-endusers - create conflict, two unique", function () { return queries.createSome([{ email: 'd2@tellescope.com' }, { email: 'd2@tellescope.com' }, { email: 'createme@tellescope.com' }]); }, { onResult: function (_a) {
|
|
758
774
|
var created = _a.created, errors = _a.errors;
|
|
759
775
|
return created.length === 2 && errors.length === 1;
|
|
760
776
|
} })];
|
|
761
|
-
case
|
|
777
|
+
case 23:
|
|
762
778
|
_a.sent();
|
|
763
779
|
return [2 /*return*/];
|
|
764
780
|
}
|
|
@@ -3776,62 +3792,6 @@ export var role_based_access_permissions_tests = function () { return __awaiter(
|
|
|
3776
3792
|
}
|
|
3777
3793
|
});
|
|
3778
3794
|
}); };
|
|
3779
|
-
var example_hep_record = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
3780
|
-
return __generator(this, function (_a) {
|
|
3781
|
-
switch (_a.label) {
|
|
3782
|
-
case 0: return [4 /*yield*/, sdk.api.managed_content_records.createOne({
|
|
3783
|
-
"title": "Squats For Days (output.title)",
|
|
3784
|
-
"assignmentType": "Individual",
|
|
3785
|
-
"enduserId": "tellescope_enduser_id_here",
|
|
3786
|
-
"htmlContent": "",
|
|
3787
|
-
"textContent": "",
|
|
3788
|
-
"blocks": [
|
|
3789
|
-
{
|
|
3790
|
-
"type": "h1",
|
|
3791
|
-
"info": {
|
|
3792
|
-
"text": "Standing stability in partial squat with support from table/chair"
|
|
3793
|
-
}
|
|
3794
|
-
},
|
|
3795
|
-
{
|
|
3796
|
-
"type": "h2",
|
|
3797
|
-
"info": {
|
|
3798
|
-
"text": "Stand in front of a counter and hold onto the countertop.\nWhile maintaining your back straight and your hips above the level of your knees, slowly lower your body into a semi-squat position without leaning forward and keeping your heels in contact with the ground at all times."
|
|
3799
|
-
}
|
|
3800
|
-
},
|
|
3801
|
-
{
|
|
3802
|
-
"type": "html",
|
|
3803
|
-
"info": {
|
|
3804
|
-
"html": "<div>custom content synthesizing weight, repetition, frequency, duration, sets, etc.</div>"
|
|
3805
|
-
},
|
|
3806
|
-
},
|
|
3807
|
-
{
|
|
3808
|
-
"type": "image",
|
|
3809
|
-
"info": {
|
|
3810
|
-
"link": "https://hep.physiotec.ca/image.php?param=ZzZySkRIVXBqN2JTejF5U0cvZWtaSkk5MUdyNDYvRmQ3YkFjMm1CU2NEbm9iOENKNEs1ZXlXTXhWcXZyRWZQOERBNVBYVkpNTXlIOVlBWm5PTkVJaFE9PQ=="
|
|
3811
|
-
}
|
|
3812
|
-
},
|
|
3813
|
-
{
|
|
3814
|
-
"type": "image",
|
|
3815
|
-
"info": {
|
|
3816
|
-
"link": "https://hep.physiotec.ca/image.php?param=ZzZySkRIVXBqN2JTejF5U0cvZWtaSkk5MUdyNDYvRmQ3YkFjMm1CU2NEazBlY1g2TFpaYVZsa0wrT3F3aGdsMGd6dTkyVXFvNVdBOUlVUFZpcmltM0E9PQ=="
|
|
3817
|
-
}
|
|
3818
|
-
},
|
|
3819
|
-
{
|
|
3820
|
-
"type": "iframe",
|
|
3821
|
-
"info": {
|
|
3822
|
-
"link": "videos.sproutvideo.com/embed/a09bdeb3191ae5c428/50796be0534425e7?type=sd",
|
|
3823
|
-
"width": 630,
|
|
3824
|
-
"height": 354
|
|
3825
|
-
}
|
|
3826
|
-
}
|
|
3827
|
-
]
|
|
3828
|
-
})];
|
|
3829
|
-
case 1:
|
|
3830
|
-
_a.sent();
|
|
3831
|
-
return [2 /*return*/];
|
|
3832
|
-
}
|
|
3833
|
-
});
|
|
3834
|
-
}); };
|
|
3835
3795
|
var NO_TEST = function () { };
|
|
3836
3796
|
var tests = {
|
|
3837
3797
|
role_based_access_permissions: role_based_access_permissions_tests,
|