@tellescope/sdk 1.74.1 → 1.74.3
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.map +1 -1
- package/lib/cjs/enduser.js +1 -0
- package/lib/cjs/enduser.js.map +1 -1
- package/lib/cjs/sdk.d.ts +2 -0
- package/lib/cjs/sdk.d.ts.map +1 -1
- package/lib/cjs/sdk.js +2 -0
- package/lib/cjs/sdk.js.map +1 -1
- package/lib/cjs/tests/tests.d.ts.map +1 -1
- package/lib/cjs/tests/tests.js +78 -23
- package/lib/cjs/tests/tests.js.map +1 -1
- package/lib/cjs/tests/webhooks_tests.js +5 -4
- package/lib/cjs/tests/webhooks_tests.js.map +1 -1
- package/lib/esm/enduser.d.ts.map +1 -1
- package/lib/esm/enduser.js +1 -0
- package/lib/esm/enduser.js.map +1 -1
- package/lib/esm/sdk.d.ts +2 -0
- package/lib/esm/sdk.d.ts.map +1 -1
- package/lib/esm/sdk.js +2 -0
- package/lib/esm/sdk.js.map +1 -1
- package/lib/esm/tests/tests.d.ts.map +1 -1
- package/lib/esm/tests/tests.js +78 -23
- package/lib/esm/tests/tests.js.map +1 -1
- package/lib/esm/tests/webhooks_tests.js +5 -4
- package/lib/esm/tests/webhooks_tests.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +8 -8
- package/src/enduser.ts +4 -0
- package/src/sdk.ts +8 -0
- package/src/tests/tests.ts +46 -1
- package/src/tests/webhooks_tests.ts +2 -2
- package/test_generated.pdf +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tellescope/sdk",
|
|
3
|
-
"version": "1.74.
|
|
3
|
+
"version": "1.74.3",
|
|
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": "^1.74.
|
|
36
|
-
"@tellescope/schema": "^1.74.
|
|
35
|
+
"@tellescope/constants": "^1.74.3",
|
|
36
|
+
"@tellescope/schema": "^1.74.3",
|
|
37
37
|
"@tellescope/testing": "^1.69.3",
|
|
38
|
-
"@tellescope/types-client": "^1.74.
|
|
39
|
-
"@tellescope/types-models": "^1.74.
|
|
38
|
+
"@tellescope/types-client": "^1.74.3",
|
|
39
|
+
"@tellescope/types-models": "^1.74.3",
|
|
40
40
|
"@tellescope/types-utilities": "^1.69.3",
|
|
41
|
-
"@tellescope/utilities": "^1.74.
|
|
42
|
-
"@tellescope/validation": "^1.74.
|
|
41
|
+
"@tellescope/utilities": "^1.74.3",
|
|
42
|
+
"@tellescope/validation": "^1.74.3",
|
|
43
43
|
"axios": "^0.21.1",
|
|
44
44
|
"dotenv": "^14.2.0",
|
|
45
45
|
"express": "^4.17.1",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"publishConfig": {
|
|
59
59
|
"access": "public"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "4af13e93344da5f55a070b0d85d69b00d49d8b46"
|
|
62
62
|
}
|
package/src/enduser.ts
CHANGED
|
@@ -101,6 +101,9 @@ type EnduserQueries = { [K in EnduserAccessibleModels]: APIQuery<K> } & {
|
|
|
101
101
|
load_choices_from_database: (args: extractFields<CustomActions['form_fields']['load_choices_from_database']['parameters']>) => (
|
|
102
102
|
Promise<extractFields<CustomActions['form_fields']['load_choices_from_database']['returns']>>
|
|
103
103
|
),
|
|
104
|
+
// load_payers: (args: extractFields<CustomActions['form_fields']['load_payers']['parameters']>) => (
|
|
105
|
+
// Promise<extractFields<CustomActions['form_fields']['load_payers']['returns']>>
|
|
106
|
+
// ),
|
|
104
107
|
},
|
|
105
108
|
form_responses: {
|
|
106
109
|
save_field_response: (args: extractFields<CustomActions['form_responses']['save_field_response']['parameters']>) => (
|
|
@@ -278,6 +281,7 @@ export class EnduserSession extends Session {
|
|
|
278
281
|
}
|
|
279
282
|
|
|
280
283
|
this.api.form_fields.load_choices_from_database = args => this._GET(`/v1${schema.form_fields.customActions.load_choices_from_database.path}`, args)
|
|
284
|
+
// this.api.form_fields.load_payers = args => this._GET(`/v1${schema.form_fields.customActions.load_payers.path}`, args)
|
|
281
285
|
|
|
282
286
|
this.api.form_responses.prepare_form_response = args => this._POST(`/v1${schema.form_responses.customActions.prepare_form_response.path}`, args)
|
|
283
287
|
this.api.form_responses.session_for_public_form = args => this._POST(`/v1${schema.form_responses.publicActions.session_for_public_form.path}`, args)
|
package/src/sdk.ts
CHANGED
|
@@ -429,6 +429,9 @@ type Queries = { [K in keyof ClientModelForName]: APIQuery<K> } & {
|
|
|
429
429
|
),
|
|
430
430
|
},
|
|
431
431
|
integrations: {
|
|
432
|
+
load_payers: (args: extractFields<CustomActions['integrations']['load_payers']['parameters']>) => (
|
|
433
|
+
Promise<extractFields<CustomActions['integrations']['load_payers']['returns']>>
|
|
434
|
+
),
|
|
432
435
|
generate_google_auth_url: (args: extractFields<CustomActions['integrations']['generate_google_auth_url']['parameters']>) => (
|
|
433
436
|
Promise<extractFields<CustomActions['integrations']['generate_google_auth_url']['returns']>>
|
|
434
437
|
),
|
|
@@ -532,6 +535,9 @@ type Queries = { [K in keyof ClientModelForName]: APIQuery<K> } & {
|
|
|
532
535
|
deliver_via_iterable: (args: extractFields<CustomActions['emails']['deliver_via_iterable']['parameters']>) => (
|
|
533
536
|
Promise<extractFields<CustomActions['emails']['deliver_via_iterable']['returns']>>
|
|
534
537
|
),
|
|
538
|
+
send_with_template: (args: extractFields<CustomActions['emails']['send_with_template']['parameters']>) => (
|
|
539
|
+
Promise<extractFields<CustomActions['emails']['send_with_template']['returns']>>
|
|
540
|
+
),
|
|
535
541
|
},
|
|
536
542
|
calendar_events: {
|
|
537
543
|
get_events_for_user: (args: extractFields<CustomActions['calendar_events']['get_events_for_user']['parameters']>) => (
|
|
@@ -744,6 +750,7 @@ export class Session extends SessionManager {
|
|
|
744
750
|
queries.organizations.create_suborganization = a => this._POST(`/v1/${schema.organizations.customActions.create_suborganization.path}`, a)
|
|
745
751
|
queries.organizations.create_and_join = a => this._POST(`/v1${schema.organizations.customActions.create_and_join.path}`, a)
|
|
746
752
|
|
|
753
|
+
queries.integrations.load_payers = args => this._GET(`/v1${schema.integrations.customActions.load_payers.path}`, args)
|
|
747
754
|
queries.integrations.generate_google_auth_url = a => this._POST(`/v1/${schema.integrations.customActions.generate_google_auth_url.path}`, a)
|
|
748
755
|
queries.integrations.disconnect_google_integration = a => this._POST(`/v1/${schema.integrations.customActions.disconnect_google_integration.path}`, a)
|
|
749
756
|
queries.integrations.refresh_oauth2_session = a => this._POST(`/v1/${schema.integrations.customActions.refresh_oauth2_session.path}`, a)
|
|
@@ -764,6 +771,7 @@ export class Session extends SessionManager {
|
|
|
764
771
|
queries.emails.sync_integrations = a => this._POST(`/v1/${schema.emails.customActions.sync_integrations.path}`, a)
|
|
765
772
|
queries.emails.deliver_via_outlook = a => this._POST(`/v1/${schema.emails.customActions.deliver_via_outlook.path}`, a)
|
|
766
773
|
queries.emails.deliver_via_iterable = a => this._POST(`/v1/${schema.emails.customActions.deliver_via_iterable.path}`, a)
|
|
774
|
+
queries.emails.send_with_template = a => this._POST(`/v1/${schema.emails.customActions.send_with_template.path}`, a)
|
|
767
775
|
|
|
768
776
|
queries.calendar_events.get_events_for_user = a => this._GET(`/v1/${schema.calendar_events.customActions.get_events_for_user.path}`, a)
|
|
769
777
|
queries.calendar_events.load_events = a => this._GET(`/v1/${schema.calendar_events.customActions.load_events.path}`, a)
|
package/src/tests/tests.ts
CHANGED
|
@@ -4147,6 +4147,28 @@ export const self_serve_appointment_booking_tests = async () => {
|
|
|
4147
4147
|
}),
|
|
4148
4148
|
{ onResult: r => r.availabilityBlocks.length === 2 }, // 1 providers with 1 hour availability for 30 minute meetings
|
|
4149
4149
|
)
|
|
4150
|
+
await async_test(
|
|
4151
|
+
'30 minute slots for state restriction with 15 min interval',
|
|
4152
|
+
() => enduserSDK.api.calendar_events.get_appointment_availability({
|
|
4153
|
+
calendarEventTemplateId: event30min.id,
|
|
4154
|
+
from: new Date(Date.now() - 10000),
|
|
4155
|
+
to: new Date(Date.now() + 3 * 24 * 60 * 60 * 1000),
|
|
4156
|
+
restrictedByState: true,
|
|
4157
|
+
intervalInMinutes: 15,
|
|
4158
|
+
}),
|
|
4159
|
+
{ onResult: r => r.availabilityBlocks.length === 3 }, // 1 providers with 1 hour availability for 30 minute meetings
|
|
4160
|
+
)
|
|
4161
|
+
await async_test(
|
|
4162
|
+
'30 minute slots for state restriction with 10 min interval',
|
|
4163
|
+
() => enduserSDK.api.calendar_events.get_appointment_availability({
|
|
4164
|
+
calendarEventTemplateId: event30min.id,
|
|
4165
|
+
from: new Date(Date.now() - 10000),
|
|
4166
|
+
to: new Date(Date.now() + 3 * 24 * 60 * 60 * 1000),
|
|
4167
|
+
restrictedByState: true,
|
|
4168
|
+
intervalInMinutes: 10,
|
|
4169
|
+
}),
|
|
4170
|
+
{ onResult: r => r.availabilityBlocks.length === 4 }, // 1 providers with 1 hour availability for 30 minute meetings
|
|
4171
|
+
)
|
|
4150
4172
|
await async_test(
|
|
4151
4173
|
'30 minute slots for no state restrictions',
|
|
4152
4174
|
() => enduserSDK.api.calendar_events.get_appointment_availability({
|
|
@@ -6573,6 +6595,28 @@ const bulk_read_tests = async () => {
|
|
|
6573
6595
|
}
|
|
6574
6596
|
}
|
|
6575
6597
|
|
|
6598
|
+
const test_send_with_template = async () => {
|
|
6599
|
+
log_header("test_send_with_template")
|
|
6600
|
+
|
|
6601
|
+
const [enduser, template] = await Promise.all([
|
|
6602
|
+
sdk.api.endusers.createOne({ email: 'sebass192@gmail.com' }),
|
|
6603
|
+
sdk.api.templates.createOne({ message: 'Text Message', subject: "test_send_with_template", title: 'test_send_with_template', html: "HTML Message" }),
|
|
6604
|
+
])
|
|
6605
|
+
|
|
6606
|
+
await async_test(
|
|
6607
|
+
"send with template",
|
|
6608
|
+
() => sdk.api.emails.send_with_template({
|
|
6609
|
+
enduserId: enduser.id, templateId: template.id, senderId: sdk.userInfo.id,
|
|
6610
|
+
}),
|
|
6611
|
+
{ onResult: ({ email }) => !!email.id && email.enduserId === enduser.id && email.templateId === template.id }
|
|
6612
|
+
)
|
|
6613
|
+
|
|
6614
|
+
await wait(undefined, 3000)
|
|
6615
|
+
await Promise.all([
|
|
6616
|
+
sdk.api.endusers.deleteOne(enduser.id),
|
|
6617
|
+
sdk.api.templates.deleteOne(template.id),
|
|
6618
|
+
])
|
|
6619
|
+
}
|
|
6576
6620
|
|
|
6577
6621
|
(async () => {
|
|
6578
6622
|
log_header("API")
|
|
@@ -6616,12 +6660,13 @@ const bulk_read_tests = async () => {
|
|
|
6616
6660
|
await mfa_tests()
|
|
6617
6661
|
await setup_tests()
|
|
6618
6662
|
await multi_tenant_tests() // should come right after setup tests
|
|
6663
|
+
// await test_send_with_template()
|
|
6664
|
+
await self_serve_appointment_booking_tests()
|
|
6619
6665
|
await bulk_read_tests()
|
|
6620
6666
|
await ticket_reminder_tests()
|
|
6621
6667
|
await enduser_access_tags_tests()
|
|
6622
6668
|
await marketing_email_unsubscribe_tests()
|
|
6623
6669
|
await unique_strings_tests()
|
|
6624
|
-
await self_serve_appointment_booking_tests()
|
|
6625
6670
|
await alternate_phones_tests()
|
|
6626
6671
|
await ticket_queue_tests()
|
|
6627
6672
|
await no_chained_triggers_tests()
|
|
@@ -160,8 +160,8 @@ const meetings_tests = async (isSubscribed: boolean) => {
|
|
|
160
160
|
const meeting = await sdk.api.meetings.start_meeting()
|
|
161
161
|
|
|
162
162
|
await check_next_webhook(a => (
|
|
163
|
-
objects_equivalent(a.records[0]?.meetingInfo, meeting.meeting)
|
|
164
|
-
|
|
163
|
+
// objects_equivalent(a.records[0]?.meetingInfo, meeting.meeting)
|
|
164
|
+
(a.records[0] as Meeting).attendees?.length === 1
|
|
165
165
|
&& (a.records[0] as Meeting).attendees?.[0].id === sdk.userInfo.id
|
|
166
166
|
),
|
|
167
167
|
'Create meeting error', 'Create meeting webhook', isSubscribed
|
package/test_generated.pdf
CHANGED
|
Binary file
|