@tellescope/sdk 1.74.1 → 1.74.2
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/sdk.d.ts +1 -0
- package/lib/cjs/sdk.d.ts.map +1 -1
- package/lib/cjs/sdk.js +1 -0
- package/lib/cjs/sdk.js.map +1 -1
- package/lib/cjs/tests/tests.js +38 -1
- 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/sdk.d.ts +1 -0
- package/lib/esm/sdk.d.ts.map +1 -1
- package/lib/esm/sdk.js +1 -0
- package/lib/esm/sdk.js.map +1 -1
- package/lib/esm/tests/tests.js +38 -1
- 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/sdk.ts +4 -0
- package/src/tests/tests.ts +23 -0
- 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.2",
|
|
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.2",
|
|
36
|
+
"@tellescope/schema": "^1.74.2",
|
|
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.2",
|
|
39
|
+
"@tellescope/types-models": "^1.74.2",
|
|
40
40
|
"@tellescope/types-utilities": "^1.69.3",
|
|
41
|
-
"@tellescope/utilities": "^1.74.
|
|
42
|
-
"@tellescope/validation": "^1.74.
|
|
41
|
+
"@tellescope/utilities": "^1.74.2",
|
|
42
|
+
"@tellescope/validation": "^1.74.2",
|
|
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": "f4bc81378a92dcd29e715c151cbab1c13e2b9cb5"
|
|
62
62
|
}
|
package/src/sdk.ts
CHANGED
|
@@ -532,6 +532,9 @@ type Queries = { [K in keyof ClientModelForName]: APIQuery<K> } & {
|
|
|
532
532
|
deliver_via_iterable: (args: extractFields<CustomActions['emails']['deliver_via_iterable']['parameters']>) => (
|
|
533
533
|
Promise<extractFields<CustomActions['emails']['deliver_via_iterable']['returns']>>
|
|
534
534
|
),
|
|
535
|
+
send_with_template: (args: extractFields<CustomActions['emails']['send_with_template']['parameters']>) => (
|
|
536
|
+
Promise<extractFields<CustomActions['emails']['send_with_template']['returns']>>
|
|
537
|
+
),
|
|
535
538
|
},
|
|
536
539
|
calendar_events: {
|
|
537
540
|
get_events_for_user: (args: extractFields<CustomActions['calendar_events']['get_events_for_user']['parameters']>) => (
|
|
@@ -764,6 +767,7 @@ export class Session extends SessionManager {
|
|
|
764
767
|
queries.emails.sync_integrations = a => this._POST(`/v1/${schema.emails.customActions.sync_integrations.path}`, a)
|
|
765
768
|
queries.emails.deliver_via_outlook = a => this._POST(`/v1/${schema.emails.customActions.deliver_via_outlook.path}`, a)
|
|
766
769
|
queries.emails.deliver_via_iterable = a => this._POST(`/v1/${schema.emails.customActions.deliver_via_iterable.path}`, a)
|
|
770
|
+
queries.emails.send_with_template = a => this._POST(`/v1/${schema.emails.customActions.send_with_template.path}`, a)
|
|
767
771
|
|
|
768
772
|
queries.calendar_events.get_events_for_user = a => this._GET(`/v1/${schema.calendar_events.customActions.get_events_for_user.path}`, a)
|
|
769
773
|
queries.calendar_events.load_events = a => this._GET(`/v1/${schema.calendar_events.customActions.load_events.path}`, a)
|
package/src/tests/tests.ts
CHANGED
|
@@ -6573,6 +6573,28 @@ const bulk_read_tests = async () => {
|
|
|
6573
6573
|
}
|
|
6574
6574
|
}
|
|
6575
6575
|
|
|
6576
|
+
const test_send_with_template = async () => {
|
|
6577
|
+
log_header("test_send_with_template")
|
|
6578
|
+
|
|
6579
|
+
const [enduser, template] = await Promise.all([
|
|
6580
|
+
sdk.api.endusers.createOne({ email: 'sebass192@gmail.com' }),
|
|
6581
|
+
sdk.api.templates.createOne({ message: 'Text Message', subject: "test_send_with_template", title: 'test_send_with_template', html: "HTML Message" }),
|
|
6582
|
+
])
|
|
6583
|
+
|
|
6584
|
+
await async_test(
|
|
6585
|
+
"send with template",
|
|
6586
|
+
() => sdk.api.emails.send_with_template({
|
|
6587
|
+
enduserId: enduser.id, templateId: template.id, senderId: sdk.userInfo.id,
|
|
6588
|
+
}),
|
|
6589
|
+
{ onResult: ({ email }) => !!email.id && email.enduserId === enduser.id && email.templateId === template.id }
|
|
6590
|
+
)
|
|
6591
|
+
|
|
6592
|
+
await wait(undefined, 3000)
|
|
6593
|
+
await Promise.all([
|
|
6594
|
+
sdk.api.endusers.deleteOne(enduser.id),
|
|
6595
|
+
sdk.api.templates.deleteOne(template.id),
|
|
6596
|
+
])
|
|
6597
|
+
}
|
|
6576
6598
|
|
|
6577
6599
|
(async () => {
|
|
6578
6600
|
log_header("API")
|
|
@@ -6616,6 +6638,7 @@ const bulk_read_tests = async () => {
|
|
|
6616
6638
|
await mfa_tests()
|
|
6617
6639
|
await setup_tests()
|
|
6618
6640
|
await multi_tenant_tests() // should come right after setup tests
|
|
6641
|
+
// await test_send_with_template()
|
|
6619
6642
|
await bulk_read_tests()
|
|
6620
6643
|
await ticket_reminder_tests()
|
|
6621
6644
|
await enduser_access_tags_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
|