Skip to content

Commit 6afcc4e

Browse files
committed
Remove deprecated Steps from Apps feature
1 parent b3e995f commit 6afcc4e

File tree

11 files changed

+4
-960
lines changed

11 files changed

+4
-960
lines changed

docs/english/reference.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ Below is the current list of methods that accept listener functions. These metho
2121
| `app.action(actionId, fn);` | Listens for an action event from a Block Kit element, such as a user interaction with a button, select menu, or datepicker. The `actionId` identifier is a `string` that should match the unique `action_id` included when your app sends the element to a view. Note that a view can be a message, modal, or app home. Note that action elements included in an `input` block do not trigger any events.
2222
| `app.shortcut(callbackId, fn);` | Listens for global or message shortcut invocation. The `callbackId` is a `string` or `RegExp` that must match a shortcut `callback_id` specified within your app's configuration.
2323
| `app.view(callbackId, fn);` | Listens for `view_submission` and `view_closed` events. `view_submission` events are sent when a user submits a modal that your app opened. `view_closed` events are sent when a user closes the modal rather than submits it.
24-
| `app.step(workflowStep)` | Listen and responds to steps from apps events using the callbacks passed in an instance of `WorkflowStep`. Callbacks include three callbacks: `edit`, `save`, and `execute`. More information on steps from apps can be found [in the documentation](/tools/bolt-js/legacy/steps-from-apps).
2524
| `app.command(commandName, fn);` | Listens for slash command invocations. The `commandName` is a `string` that must match a slash command specified in your app's configuration. Slash command names should be prefaced with a `/` (ex: `/helpdesk`).
2625
| `app.options(actionId, fn);` | Listens for options requests (from select menus with an external data source). This isn't often used, and shouldn't be mistaken with `app.action`. The `actionId` identifier is a `string` that matches the unique `action_id` included when you app sends a [select with an external data source](/reference/block-kit/block-elements/multi-select-menu-element/#external_multi_select).
2726

@@ -185,7 +184,6 @@ Bolt includes a set of error types to make errors easier to handle, with more sp
185184
| `ReceiverMultipleAckError` | Error thrown within Receiver when your app calls `ack()` when that request has previously been acknowledged. Currently only used in the default `HTTPReceiver`. |
186185
| `ReceiverAuthenticityError` | Error thrown when your app's request signature could not be verified. The error includes information on why it failed, such as an invalid timestamp, missing headers, or invalid signing secret.
187186
| `MultipleListenerError` | Thrown when multiple errors occur when processing multiple listeners for a single event. Includes an `originals` property with an array of the individual errors. |
188-
| `WorkflowStepInitializationError` | Error thrown when configuration options are invalid or missing when instantiating a new `WorkflowStep` instance. This could be scenarios like not including a `callback_id`, or not including a configuration object. More information on steps from apps [can be found in the documentation](/tools/bolt-js/legacy/steps-from-apps). |
189187
| `UnknownError` | An error that was thrown inside the framework but does not have a specified error code. Contains an `original` property with more details. |
190188

191189
:::info

docs/japanese/reference.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ Slack アプリは通常、Slack からのイベント情報を受け取った
1919
| `app.action(actionId, fn);` | Block Kit エレメントから送信される `action` イベントをリッスンします。このイベントにはユーザーのボタン操作、メニュー選択、日付ピッカーの操作などがあります。`actionId` は文字列型で、アプリがビュー内に含めたブロックエレメントに指定した一意の `action_id` の値と一致する必要があります。ここでいう「ビュー」とは、メッセージ、モーダル、アプリのホームタブのことを指します。アクションエレメントを `input` ブロックに配置した場合はイベントがトリガーされないことに注意してください。
2020
| `app.shortcut(callbackId, fn);` | グローバルショートカットまたはメッセージショートカットの呼び出しをリッスンします。`callbackId` は文字列または正規表現で、アプリの設定で指定したショートカットの `callback_id` にマッチする必要があります。
2121
| `app.view(callbackId, fn);` | `view_submission` イベントと `view_closed` イベントをリッスンします。`view_submission` イベントは、アプリが開いたモーダルでユーザーがデータ送信の操作をしたときに発生します。`view_closed` イベントは、ユーザーがデータ送信を実行せずにモーダルを閉じたときに発生します。
22-
| `app.step(workflowStep)` | `WorkflowStep` のインスタンスに渡されたコールバックを使用して、ワークフローステップイベントのリッスンと応答を行います。コールバックには `edit``save``execute` の 3 種類があります。ワークフローステップについて詳しくは、[ドキュメント](/tools/bolt-js/legacy/steps-from-apps)を参照してください。
2322
| `app.command(commandName, fn);` | Slash コマンドの呼び出しをリッスンします。`commandName` は文字列型で、アプリの設定で指定したスラッシュコマンドと一致する必要があります。スラッシュコマンドの名前では `/` を最初に配置します(例 : `/helpdesk`)。
2423
| `app.options(actionId, fn);` | 外部データソースを使用するセレクトメニューなどから送られる選択肢読み込みのリクエストをリッスンします。使う機会は多くありませんが、`app.action` と混同しないようにしましょう。`actionId` は文字列型で、アプリがビュー内に[外部データソースを使用するセレクトメニュー](/reference/block-kit/block-elements/multi-select-menu-element#external_multi_select)を含めるときに指定した`action_id` と一致する必要があります。
2524

@@ -124,7 +123,6 @@ Bolt では、さまざまなエラーが定義されています。これらに
124123
| `ReceiverMultipleAckError` | Receiver 内で、すでに確認が済んでいるリクエストに対してアプリがさらに `ack()` を呼んだ場合にスローされるエラーです。現在、デフォルトの `HTTPReceiver` でのみ使用されます。 |
125124
| `ReceiverAuthenticityError` | アプリのリクエストの署名が検証できないときにスローされるエラーです。このエラーには、失敗した理由を示す情報が含まれます(例 : タイムスタンプが有効でない、ヘッダーに抜けがある、署名シークレットが有効でない)。
126125
| `MultipleListenerError` | 単一のイベントに対して複数のリスナーでの処理中に複数のエラーが発生した場合にスローされるエラーです。個々のエラーを配列に収めた `originals` プロパティを持ちます。 |
127-
| `WorkflowStepInitializationError` | 新しい `WorkflowStep` をインスタンス化する際に、設定オプションが無効な場合、または不足している場合にスローされるエラーです。原因として、`callback_id` が指定されていない、または設定オブジェクトが指定されていないことが考えられます。ワークフローステップについて詳しくは、[ドキュメント](/tools/bolt-js/legacy/steps-from-apps)を参照してください。 |
128126
| `UnknownError` | フレームワーク内でスローされる、特定のエラーコードを持たないエラーです。`original` プロパティで詳細を確認できます。 |
129127

130128
> [errors.ts](https://github.com/slackapi/bolt-js/blob/main/src/errors.ts) のコードで、エラー定義の部分とコンストラクターの部分を読み、参考にしてみてください。

src/App.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {
1313
createFunctionComplete,
1414
createFunctionFail,
1515
} from './CustomFunction';
16-
import type { WorkflowStep } from './WorkflowStep';
1716
import { type ConversationStore, MemoryStore, conversationContext } from './conversation-store';
1817
import {
1918
AppInitializationError,
@@ -84,7 +83,6 @@ import type {
8483
SlashCommand,
8584
ViewConstraints,
8685
ViewOutput,
87-
WorkflowStepEdit,
8886
} from './types';
8987
import { contextBuiltinKeys } from './types';
9088
import { type StringIndexed, isRejected } from './types/utilities';
@@ -522,19 +520,6 @@ export default class App<AppCustomContext extends StringIndexed = StringIndexed>
522520
return this;
523521
}
524522

525-
/**
526-
* Register WorkflowStep middleware
527-
*
528-
* @param workflowStep global workflow step middleware function
529-
* @deprecated Steps from Apps are no longer supported and support for them will be removed in the next major bolt-js
530-
* version.
531-
*/
532-
public step(workflowStep: WorkflowStep): this {
533-
const m = workflowStep.getMiddleware();
534-
this.middleware.push(m);
535-
return this;
536-
}
537-
538523
/**
539524
* Register middleware for a workflow step.
540525
* @param callbackId Unique callback ID of a step.
@@ -1022,11 +1007,9 @@ export default class App<AppCustomContext extends StringIndexed = StringIndexed>
10221007

10231008
// Set body and payload
10241009
// TODO: this value should eventually conform to AnyMiddlewareArgs
1025-
// TODO: remove workflow step stuff in bolt v5
10261010
// TODO: can we instead use type predicates in these switch cases to allow for narrowing of the body simultaneously? we have isEvent, isView, isShortcut, isAction already in types/utilities / helpers
10271011
let payload:
10281012
| DialogSubmitAction
1029-
| WorkflowStepEdit
10301013
| SlackShortcut
10311014
| KnownEventFromType<string>
10321015
| SlashCommand

0 commit comments

Comments
 (0)