@tellescope/sdk 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/enduser.d.ts +149 -7
- package/lib/cjs/enduser.d.ts.map +1 -1
- package/lib/cjs/enduser.js +13 -5
- package/lib/cjs/enduser.js.map +1 -1
- package/lib/cjs/sdk.d.ts +84 -9
- package/lib/cjs/sdk.d.ts.map +1 -1
- package/lib/cjs/sdk.js +27 -9
- package/lib/cjs/sdk.js.map +1 -1
- package/lib/cjs/session.d.ts +4 -3
- package/lib/cjs/session.d.ts.map +1 -1
- package/lib/cjs/session.js +34 -0
- package/lib/cjs/session.js.map +1 -1
- package/lib/cjs/tests/public_endpoint_tests.js +3 -3
- package/lib/cjs/tests/public_endpoint_tests.js.map +1 -1
- package/lib/cjs/tests/socket_tests.js +1 -1
- package/lib/cjs/tests/socket_tests.js.map +1 -1
- package/lib/cjs/tests/tests.js +12 -13
- package/lib/cjs/tests/tests.js.map +1 -1
- package/lib/esm/enduser.d.ts +149 -7
- package/lib/esm/enduser.d.ts.map +1 -1
- package/lib/esm/enduser.js +13 -5
- package/lib/esm/enduser.js.map +1 -1
- package/lib/esm/sdk.d.ts +84 -9
- package/lib/esm/sdk.d.ts.map +1 -1
- package/lib/esm/sdk.js +27 -9
- package/lib/esm/sdk.js.map +1 -1
- package/lib/esm/session.d.ts +4 -3
- package/lib/esm/session.d.ts.map +1 -1
- package/lib/esm/session.js +34 -0
- package/lib/esm/session.js.map +1 -1
- package/lib/esm/tests/public_endpoint_tests.js +3 -3
- package/lib/esm/tests/public_endpoint_tests.js.map +1 -1
- package/lib/esm/tests/socket_tests.js +1 -1
- package/lib/esm/tests/socket_tests.js.map +1 -1
- package/lib/esm/tests/tests.js +6 -12
- package/lib/esm/tests/tests.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +11 -10
- package/src/enduser.ts +17 -6
- package/src/sdk.ts +19 -10
- package/src/session.ts +37 -2
- package/src/tests/public_endpoint_tests.ts +3 -3
- package/src/tests/socket_tests.ts +7 -1
- package/src/tests/tests.ts +16 -8
- package/tsconfig.json +0 -1
package/src/tests/tests.ts
CHANGED
|
@@ -6,24 +6,30 @@ import {
|
|
|
6
6
|
ClientModelForName,
|
|
7
7
|
ClientModelForName_required,
|
|
8
8
|
} from "@tellescope/types-client"
|
|
9
|
+
import {
|
|
10
|
+
Model as ClientModel,
|
|
11
|
+
ModelName,
|
|
12
|
+
} from "@tellescope/types-models"
|
|
9
13
|
|
|
10
|
-
|
|
11
|
-
|
|
14
|
+
import {
|
|
15
|
+
Indexable,
|
|
16
|
+
Operation,
|
|
17
|
+
} from "@tellescope/types-utilities"
|
|
12
18
|
|
|
13
19
|
import {
|
|
14
20
|
fieldsToValidation,
|
|
15
21
|
mongoIdValidator,
|
|
16
22
|
|
|
17
|
-
|
|
23
|
+
InputValidation,
|
|
18
24
|
} from "@tellescope/validation"
|
|
19
25
|
|
|
20
26
|
import { Session, APIQuery, EnduserSession } from "../sdk"
|
|
21
|
-
import {
|
|
27
|
+
import { } from "@tellescope/utilities"
|
|
22
28
|
import { DEFAULT_OPERATIONS } from "@tellescope/constants"
|
|
23
29
|
import {
|
|
24
30
|
schema,
|
|
25
|
-
|
|
26
|
-
|
|
31
|
+
Model,
|
|
32
|
+
ModelFields,
|
|
27
33
|
} from "@tellescope/schema"
|
|
28
34
|
|
|
29
35
|
import {
|
|
@@ -35,6 +41,7 @@ import {
|
|
|
35
41
|
|
|
36
42
|
import {
|
|
37
43
|
objects_equivalent,
|
|
44
|
+
url_safe_path,
|
|
38
45
|
} from "@tellescope/utilities"
|
|
39
46
|
|
|
40
47
|
|
|
@@ -550,7 +557,7 @@ const journey_tests = async (queries=sdk.api.journeys) => {
|
|
|
550
557
|
|
|
551
558
|
await async_test(
|
|
552
559
|
`journey-updateState`,
|
|
553
|
-
() => queries.updateState(journey.id, 'Added', { name: 'Updated', priority: 'N/A' }),
|
|
560
|
+
() => queries.updateState({ id: journey.id, name: 'Added', updates: { name: 'Updated', priority: 'N/A' }}),
|
|
554
561
|
passOnVoid,
|
|
555
562
|
)
|
|
556
563
|
await wait(undefined, 25) // wait for side effects to update endusers
|
|
@@ -813,7 +820,7 @@ const enduserAccessTests = async () => {
|
|
|
813
820
|
const password = 'testpassword'
|
|
814
821
|
|
|
815
822
|
const enduser = await sdk.api.endusers.createOne({ email })
|
|
816
|
-
await sdk.api.endusers.setPassword(enduser.id, password).catch(console.error)
|
|
823
|
+
await sdk.api.endusers.setPassword({ id: enduser.id, password }).catch(console.error)
|
|
817
824
|
await enduserSDK.authenticate(email, password).catch(console.error)
|
|
818
825
|
|
|
819
826
|
for (const n in schema) {
|
|
@@ -879,6 +886,7 @@ const tests: { [K in keyof ClientModelForName]: () => void } = {
|
|
|
879
886
|
chat_rooms: chat_room_tests,
|
|
880
887
|
users: () => {},
|
|
881
888
|
templates: () => {},
|
|
889
|
+
files: () => {},
|
|
882
890
|
};
|
|
883
891
|
|
|
884
892
|
(async () => {
|