@tellescope/sdk 1.77.0 → 1.79.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.
@@ -3325,6 +3325,23 @@ const search_tests = async () => {
3325
3325
 
3326
3326
  const e1 = await sdk.api.endusers.createOne({ email: 'e1_search@tellescope.com', fname: 'JoHn', lname: "strauss" })
3327
3327
  const e2 = await sdk.api.endusers.createOne({ email: 'e2_search@tellescope.com', fname: 'sebastian', lname: "coates" })
3328
+
3329
+ await async_test(
3330
+ `Search error message`,
3331
+ () => sdk.api.endusers.getSome({ search: "alert(1)" as any }),
3332
+ {
3333
+ shouldError: true,
3334
+ onError: e => !e.message.includes('script') && e.message.startsWith("Error parsing field search: Expecting an object but got alert(1)")
3335
+ },
3336
+ )
3337
+ await async_test(
3338
+ `Search error does not return script tags `,
3339
+ () => sdk.api.endusers.getSome({ search: "<script>alert(1)</script>" as any }),
3340
+ {
3341
+ shouldError: true,
3342
+ onError: e => !e.message.includes('script') && e.message.startsWith("Error parsing field search: Expecting an object but got")
3343
+ },
3344
+ )
3328
3345
 
3329
3346
  await async_test(
3330
3347
  `Search full fname case insensitive`,
@@ -6968,6 +6985,11 @@ const sync_tests = async () => {
6968
6985
  () => sdkSub.sync({ from }),
6969
6986
  { onResult: ({ results }) => results.length === 0 },
6970
6987
  )
6988
+ await async_test(
6989
+ "Other organization",
6990
+ () => sdkOther.sync({ from }),
6991
+ { onResult: ({ results }) => results.length === 0 },
6992
+ )
6971
6993
 
6972
6994
  await sdk.api.endusers.updateOne(e.id, { fname: "UPDATE_TEST"})
6973
6995
  await wait(undefined, 100)
@@ -6991,6 +7013,11 @@ const sync_tests = async () => {
6991
7013
  () => sdkSub.sync({ from }),
6992
7014
  { onResult: ({ results }) => results.length === 0 },
6993
7015
  )
7016
+ await async_test(
7017
+ "Other organization",
7018
+ () => sdkOther.sync({ from }),
7019
+ { onResult: ({ results }) => results.length === 0 },
7020
+ )
6994
7021
 
6995
7022
  const t = await sdk.api.tickets.createOne({ title: 'access test' })
6996
7023
  await wait(undefined, 100)
@@ -7064,6 +7091,11 @@ const sync_tests = async () => {
7064
7091
  () => sdkSub.sync({ from }),
7065
7092
  { onResult: ({ results }) => results.length === 0 },
7066
7093
  )
7094
+ await async_test(
7095
+ "Other organization",
7096
+ () => sdkOther.sync({ from }),
7097
+ { onResult: ({ results }) => results.length === 0 },
7098
+ )
7067
7099
 
7068
7100
  // bulk create test coverage
7069
7101
  const [e2] = (await sdk.api.endusers.createSome([{ }])).created
@@ -7089,6 +7121,11 @@ const sync_tests = async () => {
7089
7121
  () => sdkSub.sync({ from }),
7090
7122
  { onResult: ({ results }) => results.length === 0 },
7091
7123
  )
7124
+ await async_test(
7125
+ "Other organization",
7126
+ () => sdkOther.sync({ from }),
7127
+ { onResult: ({ results }) => results.length === 0 },
7128
+ )
7092
7129
 
7093
7130
  await sdk.api.endusers.deleteOne(e2.id)
7094
7131
  await wait(undefined, 100)
@@ -7112,6 +7149,11 @@ const sync_tests = async () => {
7112
7149
  () => sdkSub.sync({ from }),
7113
7150
  { onResult: ({ results }) => results.length === 0 },
7114
7151
  )
7152
+ await async_test(
7153
+ "Other organization",
7154
+ () => sdkOther.sync({ from }),
7155
+ { onResult: ({ results }) => results.length === 0 },
7156
+ )
7115
7157
  }
7116
7158
 
7117
7159
  // to cover potential vulernabilities with enduser public register endpoint
@@ -7168,6 +7210,13 @@ const register_as_enduser_tests = async () => {
7168
7210
 
7169
7211
  // console.log(JSON.stringify(await sdk.bulk_load({ load: [{ model: 'users' }]}), null, 2))
7170
7212
 
7213
+ await async_test(
7214
+ "email validation error message",
7215
+ // @ts-ignore
7216
+ () => sdk.api.endusers.createOne({ email: 'not-an-email' }),
7217
+ { shouldError: true, onError: e => e.message === 'Error parsing field email: Invalid email: not-an-email' }
7218
+ )
7219
+
7171
7220
  await async_test(
7172
7221
  "count exists",
7173
7222
  // @ts-ignore
Binary file