File tree Expand file tree Collapse file tree 6 files changed +13
-11
lines changed Expand file tree Collapse file tree 6 files changed +13
-11
lines changed Original file line number Diff line number Diff line change 11import drift from "../../drift.app.mjs" ;
22
33export default {
4- key : "drift-delete -contact" ,
4+ key : "drift-get -contact" ,
55 name : "Get Contact" ,
66 description : "Retrieves a contact in Drift by ID or email. [See the docs](https://devdocs.drift.com/docs/retrieving-contact)" ,
77 version : "0.0.1" ,
@@ -29,7 +29,9 @@ export default {
2929
3030 const contact = response . data [ 0 ] || response . data ;
3131
32- console . log ( contact ) ;
32+ if ( ! contact ) {
33+ throw new Error ( "Failed to get contact" ) ;
34+ } ;
3335
3436 $ . export ( "$summary" , `Contact ${ contact . attributes . email } ID "${ contact . id } "`
3537 + " fetched successfully." + warnings . join ( "\n- " ) ) ;
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ export default {
3030 method,
3131 url : `${ this . _baseUrl ( ) } ${ path } ` ,
3232 headers : {
33- "Authorization" : `Bearer ${ this . $auth ?. oauth_access_token || "iHlC8LmFQiTH0DcWds7ETMRMmo3BvUyP" } ` ,
33+ "Authorization" : `Bearer ${ this . $auth ?. oauth_access_token } ` ,
3434 "Content-Type" : contentType || "application/json" ,
3535 } ,
3636 ...opts ,
@@ -42,7 +42,7 @@ export default {
4242 method : "GET" ,
4343 url,
4444 headers : {
45- "Authorization" : `Bearer ${ this . $auth ?. oauth_access_token || "iHlC8LmFQiTH0DcWds7ETMRMmo3BvUyP" } ` ,
45+ "Authorization" : `Bearer ${ this . $auth ?. oauth_access_token } ` ,
4646 } ,
4747 } ) ;
4848 } ,
Original file line number Diff line number Diff line change 11import drift from "../../drift.app.mjs" ;
22
33export default {
4- key : "drift-new-contact-update-test " ,
4+ key : "drift-new-contact-update" ,
55 name : "New Contact Update" ,
66 description : "Emit new event when a contact is updated in Drift. [See the docs](https://devdocs.drift.com/docs/webhook-events-1)." ,
77 version : "0.0.1" ,
@@ -25,7 +25,7 @@ export default {
2525 contactId,
2626 } ) ;
2727
28- const email = result . data . attributes . email ;
28+ const email = result . data ? .attributes ? .email || "unknown" ;
2929
3030 body . data . attributes = result . data . attributes ;
3131
Original file line number Diff line number Diff line change 11import drift from "../../drift.app.mjs" ;
22
33export default {
4- key : "drift-new-conversation-instant-test [See the docs](https://devdocs.drift.com/docs/retrieve-a-conversation) " ,
4+ key : "drift-new-conversation-instant" ,
55 name : "New Conversation" ,
6- description : "Emit new when a new conversation is started in Drift." ,
6+ description : "Emit new when a new conversation is started in Drift. [See the docs](https://devdocs.drift.com/docs/retrieve-a-conversation) " ,
77 version : "0.0.1" ,
88 type : "source" ,
99 dedupe : "unique" ,
Original file line number Diff line number Diff line change 11import drift from "../../drift.app.mjs" ;
22
33export default {
4- key : "drift-new-lead-instance-test " ,
4+ key : "drift-new-lead-instance" ,
55 name : "New Lead" ,
66 description : "Emit new event when a contact adds their email in chat. [See the docs](https://devdocs.drift.com/docs/webhook-events-1)." ,
77 version : "0.0.1" ,
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ export default {
5050 contactId,
5151 } ) ;
5252
53- const email = result . data . attributes . email || "unknown" ;
53+ const email = result . data ? .attributes ? .email || "unknown" ;
5454
5555 if ( this . emailOrId &&
5656 ! ( email === this . emailOrId || Number ( contactId ) === Number ( this . emailOrId ) ) ) {
@@ -61,7 +61,7 @@ export default {
6161 body . data . attributes = result . data . attributes ;
6262
6363 this . $emit ( body , {
64- summary : `Contact "${ email } " ID "${ contactId || "unknown" } " updated` ,
64+ summary : `New message from contact "${ email } " ID "${ contactId || "unknown" } " updated` ,
6565 id : body . data . endUserId ,
6666 ts : body . timeStamp ,
6767 } ) ;
You can’t perform that action at this time.
0 commit comments