Skip to content
Open
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
28 changes: 27 additions & 1 deletion apps/docs/content/docs/de/tools/slack.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Lesen Sie die neuesten Nachrichten aus Slack-Kanälen. Rufen Sie den Konversatio
| `authMethod` | string | Nein | Authentifizierungsmethode: oauth oder bot_token |
| `botToken` | string | Nein | Bot-Token für benutzerdefinierten Bot |
| `channel` | string | Ja | Slack-Kanal, aus dem Nachrichten gelesen werden sollen (z.B. #general) |
| `limit` | number | Nein | Anzahl der abzurufenden Nachrichten (Standard: 10, max: 100) |
| `limit` | number | Nein | Anzahl der abzurufenden Nachrichten (Standard: 10; Slack begrenzt Nicht-Marketplace-Apps auf 15 pro Anfrage) |
| `oldest` | string | Nein | Beginn des Zeitraums (Zeitstempel) |
| `latest` | string | Nein | Ende des Zeitraums (Zeitstempel) |

Expand All @@ -118,6 +118,32 @@ Lesen Sie die neuesten Nachrichten aus Slack-Kanälen. Rufen Sie den Konversatio
| --------- | ---- | ----------- |
| `messages` | array | Array von Nachrichtenobjekten aus dem Kanal |

### `slack_thread_reader`

Lesen Sie die Stammnachricht und alle Antworten aus einem bestimmten Slack-Thread.

#### Eingabe

| Parameter | Typ | Erforderlich | Beschreibung |
| --------- | ---- | -------- | ----------- |
| `authMethod` | string | Nein | Authentifizierungsmethode: oauth oder bot_token |
| `botToken` | string | Nein | Bot-Token für benutzerdefinierten Bot |
| `channel` | string | Ja | Slack-Kanal, der den Thread enthält |
| `thread_ts` | string | Ja | Zeitstempel der Stammnachricht, die gelesen werden soll |
| `limit` | number | Nein | Anzahl der Thread-Nachrichten (Standard: 15; Slack begrenzt Nicht-Marketplace-Apps auf 15 pro Anfrage) |
| `cursor` | string | Nein | Paginierungs-Cursor zum Abrufen weiterer Antworten |
| `oldest` | string | Nein | Beginn des Zeitraums (Zeitstempel) |
| `latest` | string | Nein | Ende des Zeitraums (Zeitstempel) |

#### Ausgabe

| Parameter | Typ | Beschreibung |
| --------- | ---- | ----------- |
| `thread_ts` | string | Zeitstempel der Stammnachricht des Threads |
| `messages` | array | Array der Thread-Nachrichten (Stamm + Antworten) |
| `has_more` | boolean | Zeigt an, ob weitere Antworten abgerufen werden können |
| `next_cursor` | string | Cursor zum Abrufen der nächsten Seite von Antworten |

### `slack_download`

Eine Datei von Slack herunterladen
Expand Down
28 changes: 27 additions & 1 deletion apps/docs/content/docs/en/tools/slack.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ Read the latest messages from Slack channels. Retrieve conversation history with
| `authMethod` | string | No | Authentication method: oauth or bot_token |
| `botToken` | string | No | Bot token for Custom Bot |
| `channel` | string | Yes | Slack channel to read messages from \(e.g., #general\) |
| `limit` | number | No | Number of messages to retrieve \(default: 10, max: 100\) |
| `limit` | number | No | Number of messages to retrieve \(default: 10, Slack limits non-Marketplace apps to max 15 per request\) |
| `oldest` | string | No | Start of time range \(timestamp\) |
| `latest` | string | No | End of time range \(timestamp\) |

Expand All @@ -120,6 +120,32 @@ Read the latest messages from Slack channels. Retrieve conversation history with
| --------- | ---- | ----------- |
| `messages` | array | Array of message objects from the channel |

### `slack_thread_reader`

Read the root message and replies from a specific Slack thread.

#### Input

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `authMethod` | string | No | Authentication method: oauth or bot_token |
| `botToken` | string | No | Bot token for Custom Bot |
| `channel` | string | Yes | Slack channel that contains the thread |
| `thread_ts` | string | Yes | Timestamp of the root message to read |
| `limit` | number | No | Number of thread messages to retrieve (default: 15, Slack currently limits non-Marketplace apps to max 15 per request) |
| `cursor` | string | No | Pagination cursor for fetching additional replies |
| `oldest` | string | No | Start of time range (timestamp) |
| `latest` | string | No | End of time range (timestamp) |

#### Output

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `thread_ts` | string | Timestamp of the thread root message |
| `messages` | array | Array of thread messages (root + replies) |
| `has_more` | boolean | Indicates whether more replies can be fetched |
| `next_cursor` | string | Cursor for fetching the next page of replies |

### `slack_download`

Download a file from Slack
Expand Down
28 changes: 27 additions & 1 deletion apps/docs/content/docs/es/tools/slack.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Lee los últimos mensajes de los canales de Slack. Recupera el historial de conv
| `authMethod` | string | No | Método de autenticación: oauth o bot_token |
| `botToken` | string | No | Token del bot para Bot personalizado |
| `channel` | string | Sí | Canal de Slack del que leer mensajes (p. ej., #general) |
| `limit` | number | No | Número de mensajes a recuperar (predeterminado: 10, máx: 100) |
| `limit` | number | No | Número de mensajes a recuperar (predeterminado: 10; Slack limita a 15 por solicitud para apps fuera del Marketplace) |
| `oldest` | string | No | Inicio del rango de tiempo (marca de tiempo) |
| `latest` | string | No | Fin del rango de tiempo (marca de tiempo) |

Expand All @@ -118,6 +118,32 @@ Lee los últimos mensajes de los canales de Slack. Recupera el historial de conv
| --------- | ---- | ----------- |
| `messages` | array | Array de objetos de mensaje del canal |

### `slack_thread_reader`

Lee el mensaje raíz y las respuestas de un hilo específico de Slack.

#### Entrada

| Parámetro | Tipo | Obligatorio | Descripción |
| --------- | ---- | -------- | ----------- |
| `authMethod` | string | No | Método de autenticación: oauth o bot_token |
| `botToken` | string | No | Token del bot para Bot personalizado |
| `channel` | string | Sí | Canal de Slack que contiene el hilo |
| `thread_ts` | string | Sí | Marca de tiempo del mensaje raíz que se quiere leer |
| `limit` | number | No | Número de mensajes del hilo a recuperar (predeterminado: 15; Slack limita a 15 por solicitud para apps fuera del Marketplace) |
| `cursor` | string | No | Cursor de paginación para obtener respuestas adicionales |
| `oldest` | string | No | Inicio del rango de tiempo (marca de tiempo) |
| `latest` | string | No | Fin del rango de tiempo (marca de tiempo) |

#### Salida

| Parámetro | Tipo | Descripción |
| --------- | ---- | ----------- |
| `thread_ts` | string | Marca de tiempo del mensaje raíz del hilo |
| `messages` | array | Array de mensajes del hilo (raíz + respuestas) |
| `has_more` | boolean | Indica si se pueden obtener más respuestas |
| `next_cursor` | string | Cursor para obtener la siguiente página de respuestas |

### `slack_download`

Descargar un archivo de Slack
Expand Down
28 changes: 27 additions & 1 deletion apps/docs/content/docs/fr/tools/slack.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Lisez les derniers messages des canaux Slack. Récupérez l'historique des conve
| `authMethod` | chaîne | Non | Méthode d'authentification : oauth ou bot_token |
| `botToken` | chaîne | Non | Jeton du bot pour Bot personnalisé |
| `channel` | chaîne | Oui | Canal Slack pour lire les messages \(ex. : #general\) |
| `limit` | nombre | Non | Nombre de messages à récupérer \(par défaut : 10, max : 100\) |
| `limit` | nombre | Non | Nombre de messages à récupérer \(par défaut : 10; Slack limite les apps hors Marketplace à 15 par requête\) |
| `oldest` | chaîne | Non | Début de la plage temporelle \(horodatage\) |
| `latest` | chaîne | Non | Fin de la plage temporelle \(horodatage\) |

Expand All @@ -118,6 +118,32 @@ Lisez les derniers messages des canaux Slack. Récupérez l'historique des conve
| --------- | ---- | ----------- |
| `messages` | tableau | Tableau d'objets de messages du canal |

### `slack_thread_reader`

Lisez le message racine et les réponses d'un thread Slack spécifique.

#### Entrée

| Paramètre | Type | Obligatoire | Description |
| --------- | ---- | ---------- | ----------- |
| `authMethod` | chaîne | Non | Méthode d'authentification : oauth ou bot_token |
| `botToken` | chaîne | Non | Jeton du bot pour Bot personnalisé |
| `channel` | chaîne | Oui | Canal Slack qui contient le thread |
| `thread_ts` | chaîne | Oui | Horodatage du message racine à lire |
| `limit` | nombre | Non | Nombre de messages du thread à récupérer (par défaut : 15; Slack limite les apps hors Marketplace à 15 par requête) |
| `cursor` | chaîne | Non | Curseur de pagination pour récupérer plus de réponses |
| `oldest` | chaîne | Non | Début de la plage temporelle (horodatage) |
| `latest` | chaîne | Non | Fin de la plage temporelle (horodatage) |

#### Sortie

| Paramètre | Type | Description |
| --------- | ---- | ----------- |
| `thread_ts` | chaîne | Horodatage du message racine du thread |
| `messages` | tableau | Tableau des messages du thread (racine + réponses) |
| `has_more` | booléen | Indique si d'autres réponses peuvent être récupérées |
| `next_cursor` | chaîne | Curseur pour récupérer la page suivante de réponses |

### `slack_download`

Télécharger un fichier depuis Slack
Expand Down
28 changes: 27 additions & 1 deletion apps/docs/content/docs/ja/tools/slack.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Slackチャンネルから最新のメッセージを読み取ります。フィ
| `authMethod` | string | いいえ | 認証方法:oauthまたはbot_token |
| `botToken` | string | いいえ | カスタムボット用のボットトークン |
| `channel` | string | はい | メッセージを読み取るSlackチャンネル(例:#general) |
| `limit` | number | いいえ | 取得するメッセージ数(デフォルト:10、最大:100) |
| `limit` | number | いいえ | 取得するメッセージ数(デフォルト:10。Slackの制限によりMarketplace外アプリは1リクエストあたり15件まで) |
| `oldest` | string | いいえ | 時間範囲の開始(タイムスタンプ) |
| `latest` | string | いいえ | 時間範囲の終了(タイムスタンプ) |

Expand All @@ -117,6 +117,32 @@ Slackチャンネルから最新のメッセージを読み取ります。フィ
| --------- | ---- | ----------- |
| `messages` | array | チャンネルからのメッセージオブジェクトの配列 |

### `slack_thread_reader`

特定のSlackスレッドのルートメッセージと返信を読み取ります。

#### 入力

| パラメータ | 型 | 必須 | 説明 |
| --------- | ---- | -------- | ----------- |
| `authMethod` | string | いいえ | 認証方法:oauthまたはbot_token |
| `botToken` | string | いいえ | カスタムボット用のボットトークン |
| `channel` | string | はい | スレッドを含むSlackチャンネル |
| `thread_ts` | string | はい | 読み取るルートメッセージのタイムスタンプ |
| `limit` | number | いいえ | 取得するスレッドメッセージ数(デフォルト:15。Slackの制限によりMarketplace外アプリは1リクエストあたり15件まで) |
| `cursor` | string | いいえ | 追加の返信を取得するためのカーソル |
| `oldest` | string | いいえ | 時間範囲の開始(タイムスタンプ) |
| `latest` | string | いいえ | 時間範囲の終了(タイムスタンプ) |

#### 出力

| パラメータ | 型 | 説明 |
| --------- | ---- | ----------- |
| `thread_ts` | string | スレッドのルートメッセージのタイムスタンプ |
| `messages` | array | スレッドのメッセージ(ルート + 返信)の配列 |
| `has_more` | boolean | さらに返信を取得できるかどうかを示します |
| `next_cursor` | string | 次の返信ページを取得するためのカーソル |

### `slack_download`

Slackからファイルをダウンロードする
Expand Down
28 changes: 27 additions & 1 deletion apps/docs/content/docs/zh/tools/slack.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ import { BlockInfoCard } from "@/components/ui/block-info-card"
| `authMethod` | string | 否 | 认证方法:oauth 或 bot_token |
| `botToken` | string | 否 | 自定义 Bot 的 Bot token |
| `channel` | string | 是 | 要读取消息的 Slack 频道(例如:#general) |
| `limit` | number | 否 | 要检索的消息数量(默认:10,最大:100) |
| `limit` | number | 否 | 要检索的消息数量(默认:10;Slack 限制非 Marketplace 应用每次请求最多 15 条) |
| `oldest` | string | 否 | 时间范围的开始(时间戳) |
| `latest` | string | 否 | 时间范围的结束(时间戳) |

Expand All @@ -116,6 +116,32 @@ import { BlockInfoCard } from "@/components/ui/block-info-card"
| --------- | ---- | ----------- |
| `messages` | array | 频道中的消息对象数组 |

### `slack_thread_reader`

读取特定 Slack 线程的根消息及所有回复。

#### 输入

| 参数 | 类型 | 必需 | 描述 |
| --------- | ---- | -------- | ----------- |
| `authMethod` | string | 否 | 认证方式:oauth 或 bot_token |
| `botToken` | string | 否 | 自定义 Bot 的 token |
| `channel` | string | 是 | 包含该线程的 Slack 频道 |
| `thread_ts` | string | 是 | 需要读取的根消息时间戳 |
| `limit` | number | 否 | 要检索的线程消息数(默认:15;Slack 限制非 Marketplace 应用每次请求最多 15 条) |
| `cursor` | string | 否 | 获取更多回复的分页游标 |
| `oldest` | string | 否 | 时间范围开始(时间戳) |
| `latest` | string | 否 | 时间范围结束(时间戳) |

#### 输出

| 参数 | 类型 | 描述 |
| --------- | ---- | ----------- |
| `thread_ts` | string | 线程根消息的时间戳 |
| `messages` | array | 线程消息(根消息 + 回复)的数组 |
| `has_more` | boolean | 指示是否还有更多回复可获取 |
| `next_cursor` | string | 获取下一页回复的游标 |

### `slack_download`

从 Slack 下载文件
Expand Down
62 changes: 59 additions & 3 deletions apps/sim/blocks/blocks/slack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const SlackBlock: BlockConfig<SlackResponse> = {
{ label: 'Send Message', id: 'send' },
{ label: 'Create Canvas', id: 'canvas' },
{ label: 'Read Messages', id: 'read' },
{ label: 'Read Thread', id: 'read_thread' },
{ label: 'Download File', id: 'download' },
{ label: 'Update Message', id: 'update' },
{ label: 'Delete Message', id: 'delete' },
Expand Down Expand Up @@ -176,7 +177,7 @@ export const SlackBlock: BlockConfig<SlackResponse> = {
placeholder: '15',
condition: {
field: 'operation',
value: 'read',
value: ['read', 'read_thread'],
},
},
{
Expand All @@ -186,7 +187,39 @@ export const SlackBlock: BlockConfig<SlackResponse> = {
placeholder: 'ISO 8601 timestamp',
condition: {
field: 'operation',
value: 'read',
value: ['read', 'read_thread'],
},
},
{
id: 'latest',
title: 'Latest Timestamp',
type: 'short-input',
placeholder: 'ISO 8601 timestamp',
condition: {
field: 'operation',
value: ['read', 'read_thread'],
},
},
{
id: 'threadReaderTs',
title: 'Thread Timestamp',
type: 'short-input',
canonicalParamId: 'thread_ts',
placeholder: 'Root message timestamp (e.g., 1405894322.002768)',
condition: {
field: 'operation',
value: 'read_thread',
},
required: true,
},
{
id: 'threadCursor',
title: 'Pagination Cursor',
type: 'short-input',
placeholder: 'Slack cursor for fetching more replies',
condition: {
field: 'operation',
value: 'read_thread',
},
},
// Download File specific fields
Expand Down Expand Up @@ -281,6 +314,7 @@ export const SlackBlock: BlockConfig<SlackResponse> = {
'slack_message',
'slack_canvas',
'slack_message_reader',
'slack_thread_reader',
'slack_download',
'slack_update_message',
'slack_delete_message',
Expand All @@ -295,6 +329,8 @@ export const SlackBlock: BlockConfig<SlackResponse> = {
return 'slack_canvas'
case 'read':
return 'slack_message_reader'
case 'read_thread':
return 'slack_thread_reader'
case 'download':
return 'slack_download'
case 'update':
Expand All @@ -320,14 +356,17 @@ export const SlackBlock: BlockConfig<SlackResponse> = {
content,
limit,
oldest,
latest,
attachmentFiles,
files,
threadTs,
threadReaderTs,
updateTimestamp,
updateText,
deleteTimestamp,
reactionTimestamp,
emojiName,
threadCursor,
...rest
} = params

Expand Down Expand Up @@ -384,15 +423,29 @@ export const SlackBlock: BlockConfig<SlackResponse> = {
break

case 'read':
case 'read_thread':
if (limit) {
const parsedLimit = Number.parseInt(limit, 10)
baseParams.limit = !Number.isNaN(parsedLimit) ? parsedLimit : 10
} else {
baseParams.limit = 10
baseParams.limit = operation === 'read_thread' ? 20 : 10
}
if (oldest) {
baseParams.oldest = oldest
}
if (latest) {
baseParams.latest = latest
}
if (operation === 'read_thread') {
const threadTimestamp = threadReaderTs || threadTs
if (!threadTimestamp) {
throw new Error('Thread timestamp is required to read a thread')
}
baseParams.thread_ts = threadTimestamp
if (threadCursor) {
baseParams.cursor = threadCursor
}
}
break

case 'download': {
Expand Down Expand Up @@ -450,6 +503,8 @@ export const SlackBlock: BlockConfig<SlackResponse> = {
content: { type: 'string', description: 'Canvas content' },
limit: { type: 'string', description: 'Message limit' },
oldest: { type: 'string', description: 'Oldest timestamp' },
latest: { type: 'string', description: 'Latest timestamp for message/thread reads' },
threadCursor: { type: 'string', description: 'Slack cursor for paginating thread replies' },
fileId: { type: 'string', description: 'File ID to download' },
downloadFileName: { type: 'string', description: 'File name override for download' },
// Update/Delete/React operation inputs
Expand All @@ -462,6 +517,7 @@ export const SlackBlock: BlockConfig<SlackResponse> = {
name: { type: 'string', description: 'Emoji name' },
threadTs: { type: 'string', description: 'Thread timestamp' },
thread_ts: { type: 'string', description: 'Thread timestamp for reply' },
threadReaderTs: { type: 'string', description: 'Thread timestamp for reading thread' },
},
outputs: {
// slack_message outputs
Expand Down
Loading
Loading