@tellescope/sdk 0.0.22 → 0.0.23

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tellescope/sdk",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "description": "Code for interacting with the Tellescope API",
5
5
  "main": "./lib/cjs/sdk.js",
6
6
  "module": "./lib/esm/sdk.js",
@@ -32,14 +32,14 @@
32
32
  },
33
33
  "homepage": "https://github.com/tellescope-os/tellescope#readme",
34
34
  "dependencies": {
35
- "@tellescope/constants": "^0.0.22",
36
- "@tellescope/schema": "^0.0.22",
37
- "@tellescope/testing": "^0.0.22",
38
- "@tellescope/types-client": "^0.0.22",
39
- "@tellescope/types-models": "^0.0.22",
40
- "@tellescope/types-utilities": "^0.0.22",
41
- "@tellescope/utilities": "^0.0.22",
42
- "@tellescope/validation": "^0.0.22",
35
+ "@tellescope/constants": "^0.0.23",
36
+ "@tellescope/schema": "^0.0.23",
37
+ "@tellescope/testing": "^0.0.23",
38
+ "@tellescope/types-client": "^0.0.23",
39
+ "@tellescope/types-models": "^0.0.23",
40
+ "@tellescope/types-utilities": "^0.0.23",
41
+ "@tellescope/utilities": "^0.0.23",
42
+ "@tellescope/validation": "^0.0.23",
43
43
  "axios": "^0.21.1",
44
44
  "express": "^4.17.1",
45
45
  "form-data": "^4.0.0",
@@ -56,5 +56,5 @@
56
56
  "publishConfig": {
57
57
  "access": "public"
58
58
  },
59
- "gitHead": "670a97b8dd2154cb75a6a3adc0001bdc02207855"
59
+ "gitHead": "da81cccdf2fcf06080a5a7d33e0a1cdac9f05a40"
60
60
  }
package/src/enduser.ts CHANGED
@@ -8,13 +8,14 @@ import { S3PresignedPost, UserIdentity } from "@tellescope/types-utilities"
8
8
  import {
9
9
  Attendee,
10
10
  AttendeeInfo,
11
- Meeting,
12
11
  } from "@tellescope/types-models"
13
12
  import {
14
13
  ClientModelForName,
15
14
  ClientModelForName_required,
16
15
  Enduser,
17
16
  File,
17
+ Meeting,
18
+ UserDisplayInfo,
18
19
  } from "@tellescope/types-client"
19
20
 
20
21
  export interface EnduserSessionOptions extends SessionOptions {}
@@ -44,7 +45,7 @@ type EnduserQueries = { [K in EnduserAccessibleModels]: APIQuery<K> } & {
44
45
  logout: () => Promise<void>;
45
46
  },
46
47
  users: {
47
- display_info: () => Promise<{ fname?: string, lname?: string, id: string, lastActive?: Date, lastLogout?: Date }[]>
48
+ display_info: () => Promise<UserDisplayInfo[]>
48
49
  },
49
50
  files: {
50
51
  prepare_file_upload: (args: { name: string, size: number, type: string }) => Promise<{ presignedUpload: S3PresignedPost, file: File }>,
@@ -79,7 +80,7 @@ export class EnduserSession extends Session {
79
80
  logout: () => this._POST('/v1/logout-enduser'),
80
81
  }
81
82
  this.api.users = {
82
- display_info: () => this._GET<{}, { fname: string, lname: string, id: string }[] >(`/v1/user-display-info`),
83
+ display_info: () => this._GET<{}, UserDisplayInfo[] >(`/v1/user-display-info`),
83
84
  }
84
85
  this.api.meetings = {
85
86
  attendee_info: a => this._GET('/v1/attendee-info', a),
package/src/sdk.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import {
2
2
  AttendeeInfo,
3
3
  JourneyState,
4
- Meeting,
5
4
  UserSession,
6
5
  MeetingInfo,
7
6
  ReadFilter,
@@ -17,6 +16,7 @@ import {
17
16
  ChatRoom,
18
17
  Enduser,
19
18
  File,
19
+ Meeting,
20
20
  } from "@tellescope/types-client"
21
21
  import { CustomUpdateOptions, SortOption, S3PresignedPost, UserIdentity } from "@tellescope/types-utilities"
22
22
  import { url_safe_path } from "@tellescope/utilities"
@@ -1061,6 +1061,20 @@ const files_tests = async () => {
1061
1061
  assert(downloaded === buff.toString(), 'downloaded file does not match uploaded file', 'upload, download comparison')
1062
1062
  }
1063
1063
 
1064
+ const enduser_session_tests = async () => {
1065
+ const email = 'enduser@tellescope.com'
1066
+ const password = 'testpassword'
1067
+
1068
+ const enduser = await sdk.api.endusers.createOne({ email })
1069
+ await sdk.api.endusers.set_password({ id: enduser.id, password }).catch(console.error)
1070
+ await enduserSDK.authenticate(email, password).catch(console.error)
1071
+
1072
+ const users = await enduserSDK.api.users.display_info()
1073
+ assert(users && users.length > 0, 'No users returned', 'Get user display info for enduser')
1074
+
1075
+ await sdk.api.endusers.deleteOne(enduser.id)
1076
+ }
1077
+
1064
1078
  const tests: { [K in keyof ClientModelForName]: () => void } = {
1065
1079
  chats: chat_tests,
1066
1080
  endusers: enduser_tests,
@@ -1093,6 +1107,7 @@ const tests: { [K in keyof ClientModelForName]: () => void } = {
1093
1107
  await threadKeyTests()
1094
1108
  await enduserAccessTests()
1095
1109
  await generateEnduserAuthTests()
1110
+ await enduser_session_tests()
1096
1111
  } catch(err) {
1097
1112
  console.error("Failed during custom test")
1098
1113
  console.error(err)
@@ -1109,7 +1124,7 @@ const tests: { [K in keyof ClientModelForName]: () => void } = {
1109
1124
  model: schema[n] as any,
1110
1125
  name: n,
1111
1126
  returns: {
1112
- create: returnValidation as ModelFields<ClientModel>,
1127
+ create: returnValidation as any// ModelFields<ClientModel>,
1113
1128
  }
1114
1129
  })
1115
1130
  }