Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/short-baboons-relate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@team-plain/typescript-sdk': minor
---

Regenerate types for slack webhooks (`thread.slack_message_received` and `thread.slack_message_sent`)
127 changes: 127 additions & 0 deletions src/webhooks/webhook-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@
"thread.thread_assignment_transitioned",
"thread.email_received",
"thread.email_sent",
"thread.slack_message_received",
"thread.slack_message_sent",
"thread.chat_sent",
"thread.note_created",
"thread.thread_labels_changed",
Expand Down Expand Up @@ -1604,6 +1606,30 @@
"API",
"SLACK"
]
},
"actorId": {
"type": [
"string",
"null"
],
"default": null
},
"actorType": {
"anyOf": [
{
"type": "string",
"enum": [
"user",
"machineUser",
"customer",
"system"
]
},
{
"type": "null"
}
],
"default": null
}
},
"required": [
Expand Down Expand Up @@ -2532,6 +2558,65 @@
}
]
},
"slackMessage": {
"type": "object",
"properties": {
"timelineEntryId": {
"$ref": "#/definitions/id"
},
"id": {
"$ref": "#/definitions/id"
},
"text": {
"type": "string"
},
"resolvedText": {
"type": "string",
"default": ""
},
"attachments": {
"type": "array",
"items": {
"$ref": "#/definitions/attachment"
}
},
"slackChannelId": {
"type": "string"
},
"slackChannelName": {
"type": "string"
},
"slackMessageLink": {
"type": "string"
},
"createdAt": {
"$ref": "#/definitions/datetime"
},
"createdBy": {
"$ref": "#/definitions/actor"
},
"updatedAt": {
"$ref": "#/definitions/datetime"
},
"updatedBy": {
"$ref": "#/definitions/actor"
}
},
"required": [
"timelineEntryId",
"id",
"text",
"attachments",
"slackChannelId",
"slackChannelName",
"slackMessageLink",
"createdAt",
"createdBy",
"updatedAt",
"updatedBy"
],
"additionalProperties": false
},
"customerChangedPayload": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -3120,6 +3205,48 @@
],
"additionalProperties": false
},
"threadSlackMessageReceivedEventPayload": {
"type": "object",
"properties": {
"eventType": {
"type": "string",
"const": "thread.slack_message_received"
},
"thread": {
"$ref": "#/definitions/thread"
},
"slackMessage": {
"$ref": "#/definitions/slackMessage"
}
},
"required": [
"eventType",
"thread",
"slackMessage"
],
"additionalProperties": false
},
"threadSlackMessageSentEventPayload": {
"type": "object",
"properties": {
"eventType": {
"type": "string",
"const": "thread.slack_message_sent"
},
"thread": {
"$ref": "#/definitions/thread"
},
"slackMessage": {
"$ref": "#/definitions/slackMessage"
}
},
"required": [
"eventType",
"thread",
"slackMessage"
],
"additionalProperties": false
},
"customerCreatedPublicEventPayload": {
"type": "object",
"properties": {
Expand Down
4 changes: 4 additions & 0 deletions src/webhooks/webhook-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ export interface WebhooksSchemaDefinition {
| "thread.thread_assignment_transitioned"
| "thread.email_received"
| "thread.email_sent"
| "thread.slack_message_received"
| "thread.slack_message_sent"
| "thread.chat_sent"
| "thread.note_created"
| "thread.thread_labels_changed"
Expand Down Expand Up @@ -537,6 +539,8 @@ export interface LabelType {
export interface ThreadMessageInfo {
timestamp: Datetime;
messageSource: "CHAT" | "EMAIL" | "API" | "SLACK";
actorId?: string | null;
actorType?: ("user" | "machineUser" | "customer" | "system") | null;
}
export interface ThreadStatusTransitionedPublicEventPayload {
eventType: "thread.thread_status_transitioned";
Expand Down