-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Port all changes from current docs to new docs + various clean-up
- Loading branch information
Showing
49 changed files
with
545 additions
and
244 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
```graphql Mutation | ||
mutation replyToThread($input: ReplyToThreadInput!) { | ||
replyToThread(input: $input) { | ||
error { | ||
message | ||
type | ||
code | ||
} | ||
} | ||
} | ||
``` | ||
|
||
```json Variables | ||
{ | ||
"input": { | ||
"threadId": "th_01H8H46YPB2S4MAJM382FG9423", | ||
"textContent": "The plain text version of your reply goes here.", | ||
"markdownContent": "The markdown **version** of your _reply_ goes here." | ||
} | ||
} | ||
``` |
21 changes: 2 additions & 19 deletions
21
_snippets/typescript-sdk/create-customer-event-response.mdx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
```json | ||
{ | ||
"__typename": "ThreadEvent", | ||
"id": "tev_01HB924RWAW8H3Q8KZDFWYBJHZ", | ||
"externalId": "ex-id-1", | ||
"customerId": "c_01H14DFQ4PDYBH398J1E99TWSS", | ||
"title": "API key generated", | ||
"createdAt": { | ||
"__typename": "DateTime", | ||
"iso8601": "2023-09-26T15:36:23.690Z", | ||
"unixTimestamp": "1695742583690" | ||
}, | ||
"createdBy": { | ||
"__typename": "MachineUserActor", | ||
"machineUserId": "mu_01HBZM0TZAKAZPJ47NX7X7XMDY" | ||
}, | ||
"updatedAt": { | ||
"__typename": "DateTime", | ||
"iso8601": "2023-10-05T10:10:04.785Z", | ||
"unixTimestamp": "1696500604785" | ||
}, | ||
"updatedBy": { | ||
"__typename": "MachineUserActor", | ||
"machineUserId": "mu_01HBZM0TZAKAZPJ47NX7X7XMDY" | ||
} | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
```tsx | ||
import { PlainClient, uiComponent } from '@team-plain/typescript-sdk'; | ||
|
||
const client = new PlainClient({ | ||
apiKey: 'XXX', | ||
debug: true, | ||
}); | ||
|
||
const res = await client.createThreadEvent({ | ||
title: 'API key generated', | ||
|
||
threadId: 'th_01HB924RWAW8H3Q8KZDFWYBJHZ', | ||
|
||
components: [ | ||
uiComponent.text({ | ||
text: 'New API key was added with the fingerprint **3b7896975ee9fd15eeb7** with 4 associated roles.', | ||
}), | ||
uiComponent.spacer({ | ||
size: 'M', | ||
}), | ||
uiComponent.linkButton({ | ||
label: 'View in admin', | ||
url: 'https://admin.your-app.com', | ||
}), | ||
], | ||
|
||
// Optional - if provided, this will ensure that this event can only | ||
// be created once and fail on the second time. This external id acts | ||
// as an idempotency key while also letting you correlate an event to | ||
// something your systems. | ||
externalId: 'ex-id-1', | ||
}); | ||
|
||
if (res.error) { | ||
console.error(res.error); | ||
} else { | ||
console.log(res.data); | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
```tsx | ||
import { PlainClient } from '@team-plain/typescript-sdk'; | ||
|
||
const client = new PlainClient({ apiKey: 'plainApiKey_xxx' }); | ||
|
||
const res = await client.replyToThread({ | ||
threadId: 'th_01HD44FHMCDSSWE38N14FSYV6K', | ||
textContent: 'The plain text version of your reply goes here.', | ||
markdownContent: 'The markdown **version** of your reply goes here.', | ||
}); | ||
|
||
if (res.error) { | ||
console.error(res.error); | ||
} else { | ||
console.log(res.data); | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
```json | ||
{} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
```json | ||
{ | ||
"timestamp": "2023-11-02T15:32:28.831Z", | ||
"workspaceId": "w_01GST0W989ZNAW53X6XYHAY87P", | ||
"payload": { | ||
"eventType": "thread.chat_sent", | ||
"chat": { | ||
"timelineEntryId": "t_01HE8AM6GZG6C3CM344HFDM3J3", | ||
"id": "ch_01HE8AM6GZPZ3Q3RBEVE5TZ80X", | ||
"customerReadAt": null, | ||
"attachments": [], | ||
"text": "You are welcome!", | ||
"createdAt": "2023-11-02T15:32:28.831Z", | ||
"createdBy": { | ||
"actorType": "user", | ||
"userId": "u_01H1V4NA10RMHWFBXB6A1ZBYRA" | ||
}, | ||
"updatedAt": "2023-11-02T15:32:28.831Z", | ||
"updatedBy": { | ||
"actorType": "user", | ||
"userId": "u_01H1V4NA10RMHWFBXB6A1ZBYRA" | ||
} | ||
}, | ||
"thread": { | ||
"id": "th_01HDRC3CRY6ESPZJ7FZCTRQWYH", | ||
"customer": { | ||
"id": "c_01HDRC3CJHBWBAAF4K63Z11XZ5", | ||
"email": { | ||
"email": "[email protected]", | ||
"isVerified": false, | ||
"verifiedAt": null | ||
}, | ||
"externalId": null, | ||
"fullName": "Peter Santos", | ||
"shortName": "Peter", | ||
"markedAsSpamAt": null, | ||
"markedAsSpamBy": null, | ||
"customerGroupMemberships": [], | ||
"createdAt": "2023-10-27T10:50:24.209Z", | ||
"createdBy": { | ||
"actorType": "system", | ||
"system": "email_inbound_handler" | ||
}, | ||
"updatedAt": "2023-11-02T08:57:32.944Z", | ||
"updatedBy": { | ||
"actorType": "user", | ||
"userId": "u_01H1V4NA10RMHWFBXB6A1ZBYRA" | ||
} | ||
}, | ||
"title": "Unable to tail logs", | ||
"previewText": "Hey, I am currently unable to tail the logs of the service svc-8af1e3", | ||
"priority": 2, | ||
"externalId": null, | ||
"status": "TODO", | ||
"statusChangedAt": "2023-11-02T08:57:32.943Z", | ||
"statusChangedBy": { | ||
"actorType": "user", | ||
"userId": "u_01H1V4NA10RMHWFBXB6A1ZBYRA" | ||
}, | ||
"statusDetail": null, | ||
"assignee": null, | ||
"assignedAt": null, | ||
"labels": [], | ||
"firstInboundMessageInfo": { | ||
"timestamp": "2023-10-27T10:50:24.323Z", | ||
"messageSource": "EMAIL" | ||
}, | ||
"firstOutboundMessageInfo": { | ||
"timestamp": "2023-10-27T10:50:52.944Z", | ||
"messageSource": "EMAIL" | ||
}, | ||
"lastInboundMessageInfo": { | ||
"timestamp": "2023-10-27T15:05:30.223Z", | ||
"messageSource": "EMAIL" | ||
}, | ||
"lastOutboundMessageInfo": { | ||
"timestamp": "2023-10-27T15:04:49.521Z", | ||
"messageSource": "EMAIL" | ||
}, | ||
"supportEmailAddresses": ["[email protected]"], | ||
"createdAt": "2023-10-27T10:50:24.323Z", | ||
"createdBy": { | ||
"actorType": "system", | ||
"system": "email_inbound_handler" | ||
}, | ||
"updatedAt": "2023-11-02T08:57:32.943Z", | ||
"updatedBy": { | ||
"actorType": "user", | ||
"userId": "u_01H1V4NA10RMHWFBXB6A1ZBYRA" | ||
} | ||
} | ||
}, | ||
"id": "pEv_01HE8AM6GZVS1S3609PFGR30FE", | ||
"webhookMetadata": { | ||
"webhookTargetId": "whTarget_01HD4400VTDJQ646V6RY37SR7K", | ||
"webhookDeliveryAttemptId": "whAttempt_01HE8ANGEGVQVTCY3DD30CZ8G4", | ||
"webhookDeliveryAttemptNumber": 1, | ||
"webhookDeliveryAttemptTimestamp": "2023-11-02T15:33:11.760Z" | ||
}, | ||
"type": "thread.chat_sent" | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,10 +16,6 @@ | |
"externalId": null, | ||
"fullName": "Peter Santos", | ||
"shortName": "Peter", | ||
"assignedAt": null, | ||
"assignedToUser": null, | ||
"status": "IDLE", | ||
"statusChangedAt": "2023-10-04T14:17:41.991Z", | ||
"markedAsSpamAt": null, | ||
"markedAsSpamBy": null, | ||
"customerGroupMemberships": [], | ||
|
@@ -55,7 +51,7 @@ | |
"firstOutboundMessageInfo": null, | ||
"lastInboundMessageInfo": null, | ||
"lastOutboundMessageInfo": null, | ||
"supportEmailAddresses": [], | ||
"supportEmailAddresses": ["[email protected]"], | ||
"createdAt": "2023-10-19T14:12:25.266Z", | ||
"createdBy": { | ||
"actorType": "system", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.