diff --git a/.changeset/short-baboons-relate.md b/.changeset/short-baboons-relate.md new file mode 100644 index 0000000..6c51199 --- /dev/null +++ b/.changeset/short-baboons-relate.md @@ -0,0 +1,5 @@ +--- +'@team-plain/typescript-sdk': minor +--- + +Regenerate types for slack webhooks (`thread.slack_message_received` and `thread.slack_message_sent`) diff --git a/src/webhooks/webhook-schema.json b/src/webhooks/webhook-schema.json index f1dcac5..c21ab8c 100644 --- a/src/webhooks/webhook-schema.json +++ b/src/webhooks/webhook-schema.json @@ -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", @@ -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": [ @@ -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": { @@ -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": { diff --git a/src/webhooks/webhook-schema.ts b/src/webhooks/webhook-schema.ts index ee0098d..3d8199b 100644 --- a/src/webhooks/webhook-schema.ts +++ b/src/webhooks/webhook-schema.ts @@ -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" @@ -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";