@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.
Files changed (45) hide show
  1. package/lib/cjs/enduser.d.ts +149 -7
  2. package/lib/cjs/enduser.d.ts.map +1 -1
  3. package/lib/cjs/enduser.js +13 -5
  4. package/lib/cjs/enduser.js.map +1 -1
  5. package/lib/cjs/sdk.d.ts +84 -9
  6. package/lib/cjs/sdk.d.ts.map +1 -1
  7. package/lib/cjs/sdk.js +27 -9
  8. package/lib/cjs/sdk.js.map +1 -1
  9. package/lib/cjs/session.d.ts +4 -3
  10. package/lib/cjs/session.d.ts.map +1 -1
  11. package/lib/cjs/session.js +34 -0
  12. package/lib/cjs/session.js.map +1 -1
  13. package/lib/cjs/tests/public_endpoint_tests.js +3 -3
  14. package/lib/cjs/tests/public_endpoint_tests.js.map +1 -1
  15. package/lib/cjs/tests/socket_tests.js +1 -1
  16. package/lib/cjs/tests/socket_tests.js.map +1 -1
  17. package/lib/cjs/tests/tests.js +12 -13
  18. package/lib/cjs/tests/tests.js.map +1 -1
  19. package/lib/esm/enduser.d.ts +149 -7
  20. package/lib/esm/enduser.d.ts.map +1 -1
  21. package/lib/esm/enduser.js +13 -5
  22. package/lib/esm/enduser.js.map +1 -1
  23. package/lib/esm/sdk.d.ts +84 -9
  24. package/lib/esm/sdk.d.ts.map +1 -1
  25. package/lib/esm/sdk.js +27 -9
  26. package/lib/esm/sdk.js.map +1 -1
  27. package/lib/esm/session.d.ts +4 -3
  28. package/lib/esm/session.d.ts.map +1 -1
  29. package/lib/esm/session.js +34 -0
  30. package/lib/esm/session.js.map +1 -1
  31. package/lib/esm/tests/public_endpoint_tests.js +3 -3
  32. package/lib/esm/tests/public_endpoint_tests.js.map +1 -1
  33. package/lib/esm/tests/socket_tests.js +1 -1
  34. package/lib/esm/tests/socket_tests.js.map +1 -1
  35. package/lib/esm/tests/tests.js +6 -12
  36. package/lib/esm/tests/tests.js.map +1 -1
  37. package/lib/tsconfig.tsbuildinfo +1 -1
  38. package/package.json +11 -10
  39. package/src/enduser.ts +17 -6
  40. package/src/sdk.ts +19 -10
  41. package/src/session.ts +37 -2
  42. package/src/tests/public_endpoint_tests.ts +3 -3
  43. package/src/tests/socket_tests.ts +7 -1
  44. package/src/tests/tests.ts +16 -8
  45. package/tsconfig.json +0 -1
@@ -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
- // import v from 'validator'
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
- // InputValidation,
23
+ InputValidation,
18
24
  } from "@tellescope/validation"
19
25
 
20
26
  import { Session, APIQuery, EnduserSession } from "../sdk"
21
- import { url_safe_path } from "@tellescope/utilities"
27
+ import { } from "@tellescope/utilities"
22
28
  import { DEFAULT_OPERATIONS } from "@tellescope/constants"
23
29
  import {
24
30
  schema,
25
- // Model,
26
- // ModelFields
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 () => {
package/tsconfig.json CHANGED
@@ -10,7 +10,6 @@
10
10
  { "path": "../constants" },
11
11
  { "path": "../schema" },
12
12
  { "path": "../testing" },
13
- { "path": "../types" },
14
13
  { "path": "../types-client" },
15
14
  { "path": "../utilities" },
16
15
  { "path": "../validation" }