From 76c538f6303659c527681e7e31273b9e947f8016 Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Tue, 13 Aug 2024 16:52:27 -0400 Subject: [PATCH 1/5] chore: purge the "workflow step" terminology --- docs/content/reference.md | 4 +- docs/content/steps/adding-editing-steps.md | 10 ++-- docs/content/steps/creating-steps.md | 14 +++--- docs/content/steps/executing-steps.md | 16 +++---- docs/content/steps/saving-steps.md | 10 ++-- docs/content/steps/steps.md | 14 +++--- docs/sidebars.js | 10 ++-- src/App.ts | 54 +++++++++++----------- src/WorkflowStep.ts | 2 +- src/types/actions/workflow-step-edit.ts | 4 +- src/types/view/index.ts | 4 +- 11 files changed, 71 insertions(+), 71 deletions(-) diff --git a/docs/content/reference.md b/docs/content/reference.md index 6acd3db76..c4c7a06be 100644 --- a/docs/content/reference.md +++ b/docs/content/reference.md @@ -22,7 +22,7 @@ Below is the current list of methods that accept listener functions. These metho | `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. | `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. | `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. -| `app.step(workflowStep)` | Listen and responds to workflow step events using the callbacks passed in an instance of `WorkflowStep`. Callbacks include three callbacks: `edit`, `save`, and `execute`. More information on workflow steps can be found [in the documentation](/concepts/adding-editing-steps). +| `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](/concepts/adding-editing-steps). | `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`). | `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](https://api.slack.com/reference/block-kit/block-elements#external_select). @@ -162,7 +162,7 @@ Bolt includes a set of error types to make errors easier to handle, with more sp | `ReceiverMultipleAckError` | Error thrown within Receiver when your app calls `ack()` when that request has previously been acknowledged. Currently only used in the default `HTTPReceiver`. | | `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. | `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. | -| `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 Workflow Steps [can be found in the documentation](/concepts/steps). | +| `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](/concepts/steps). | | `UnknownError` | An error that was thrown inside the framework but does not have a specified error code. Contains an `original` property with more details. | :::info diff --git a/docs/content/steps/adding-editing-steps.md b/docs/content/steps/adding-editing-steps.md index da8330d07..d7204dea7 100644 --- a/docs/content/steps/adding-editing-steps.md +++ b/docs/content/steps/adding-editing-steps.md @@ -1,14 +1,14 @@ --- -title: Adding or editing workflow steps +title: Adding or editing steps from apps lang: en slug: /concepts/adding-editing-steps --- :::danger -Workflow Steps from Apps are a deprecated feature. +Steps from Apps are a deprecated feature. -Workflow Steps from Apps are different than, and not interchangable with, Slack automation workflows. We encourage those who are currently publishing Workflow Steps from Apps to consider the new [Slack automation features](https://api.slack.com/automation), such as [custom functions for Bolt](/concepts/creating-custom-functions). +Steps from Apps are different than, and not interchangable with, Slack automation workflows. We encourage those who are currently publishing steps from apps to consider the new [Slack automation features](https://api.slack.com/automation), such as [custom steps for Bolt](/concepts/creating-custom-functions). Please [read the Slack API changelog entry](https://api.slack.com/changelog/2023-08-workflow-steps-from-apps-step-back) for more information. @@ -16,7 +16,7 @@ Please [read the Slack API changelog entry](https://api.slack.com/changelog/2023 When a builder adds (or later edits) your step in their workflow, your app will receive a [`workflow_step_edit` event](https://api.slack.com/reference/workflows/workflow_step_edit). The `edit` callback in your `WorkflowStep` configuration will be run when this event is received. -Whether a builder is adding or editing a step, you need to send them a [workflow step configuration modal](https://api.slack.com/reference/workflows/configuration-view). This modal is where step-specific settings are chosen, and it has more restrictions than typical modals—most notably, it cannot include `title​`, `submit​`, or `close`​ properties. By default, the configuration modal's `callback_id` will be the same as the workflow step. +Whether a builder is adding or editing a step, you need to send them a [step form app configuration modal](https://api.slack.com/reference/workflows/configuration-view). This modal is where step-specific settings are chosen, and it has more restrictions than typical modals—most notably, it cannot include `title​`, `submit​`, or `close`​ properties. By default, the configuration modal's `callback_id` will be the same as the step from app. Within the `edit` callback, the `configure()` utility can be used to easily open your step's configuration modal by passing in an object with your view's `blocks`. To disable saving the configuration before certain conditions are met, pass in `submit_disabled` with a value of `true`. @@ -67,4 +67,4 @@ const ws = new WorkflowStep('add_task', { save: async ({ ack, step, update }) => {}, execute: async ({ step, complete, fail }) => {}, }); -``` \ No newline at end of file +``` diff --git a/docs/content/steps/creating-steps.md b/docs/content/steps/creating-steps.md index f8a6e0620..9f63f7b49 100644 --- a/docs/content/steps/creating-steps.md +++ b/docs/content/steps/creating-steps.md @@ -1,26 +1,26 @@ --- -title: Creating workflow steps +title: Creating steps from apps lang: en slug: /concepts/creating-steps --- :::danger -Workflow Steps from Apps are a deprecated feature. +Steps from apps are a deprecated feature. -Workflow Steps from Apps are different than, and not interchangable with, Slack automation workflows. We encourage those who are currently publishing Workflow Steps from Apps to consider the new [Slack automation features](https://api.slack.com/automation), such as [custom functions for Bolt](/concepts/creating-custom-functions). +Steps from apps are different than, and not interchangable with, Slack automation workflows. We encourage those who are currently publishing steps from apps to consider the new [Slack automation features](https://api.slack.com/automation), such as [custom steps for Bolt](/concepts/creating-custom-functions). Please [read the Slack API changelog entry](https://api.slack.com/changelog/2023-08-workflow-steps-from-apps-step-back) for more information. ::: -To create a workflow step, Bolt provides the `WorkflowStep` class. +To create a step from app, Bolt provides the `WorkflowStep` class. When instantiating a new `WorkflowStep`, pass in the step's `callback_id` and a configuration object. -The configuration object contains three properties: `edit`, `save`, and `execute`. Each of these properties must be a single callback or an array of callbacks. All callbacks have access to a `step` object that contains information about the workflow step event. +The configuration object contains three properties: `edit`, `save`, and `execute`. Each of these properties must be a single callback or an array of callbacks. All callbacks have access to a `step` object that contains information about the step from app event. -After instantiating a `WorkflowStep`, you can pass it into `app.step()`. Behind the scenes, your app will listen and respond to the workflow step’s events using the callbacks provided in the configuration object. +After instantiating a `WorkflowStep`, you can pass it into `app.step()`. Behind the scenes, your app will listen and respond to the step’s events using the callbacks provided in the configuration object. ```javascript const { App, WorkflowStep } = require('@slack/bolt'); @@ -39,4 +39,4 @@ const ws = new WorkflowStep('add_task', { }); app.step(ws); -``` \ No newline at end of file +``` diff --git a/docs/content/steps/executing-steps.md b/docs/content/steps/executing-steps.md index c97f19693..525386826 100644 --- a/docs/content/steps/executing-steps.md +++ b/docs/content/steps/executing-steps.md @@ -1,22 +1,22 @@ --- -title: Executing workflow steps +title: Executing steps from apps lang: en slug: /concepts/executing-steps --- :::danger -Workflow Steps from Apps are a deprecated feature. +Steps from Apps are a deprecated feature. -Workflow Steps from Apps are different than, and not interchangable with, Slack automation workflows. We encourage those who are currently publishing Workflow Steps from Apps to consider the new [Slack automation features](https://api.slack.com/automation), such as [custom functions for Bolt](/concepts/creating-custom-functions). +Steps from Apps are different than, and not interchangable with, Slack automation workflows. We encourage those who are currently publishing steps from apps to consider the new [Slack automation features](https://api.slack.com/automation), such as [custom steps for Bolt](/concepts/creating-custom-functions). Please [read the Slack API changelog entry](https://api.slack.com/changelog/2023-08-workflow-steps-from-apps-step-back) for more information. ::: -When your workflow step is executed by an end user, your app will receive a [`workflow_step_execute` event](https://api.slack.com/events/workflow_step_execute). The `execute` callback in your `WorkflowStep` configuration will be run when this event is received. +When your step from app is executed by an end user, your app will receive a [`workflow_step_execute` event](https://api.slack.com/events/workflow_step_execute). The `execute` callback in your `WorkflowStep` configuration will be run when this event is received. -Using the `inputs` from the `save` callback, this is where you can make third-party API calls, save information to a database, update the user's Home tab, or decide the outputs that will be available to subsequent workflow steps by mapping values to the `outputs` object. +Using the `inputs` from the `save` callback, this is where you can make third-party API calls, save information to a database, update the user's Home tab, or decide the outputs that will be available to subsequent steps by mapping values to the `outputs` object. Within the `execute` callback, your app must either call `complete()` to indicate that the step's execution was successful, or `fail()` to indicate that the step's execution failed. @@ -38,12 +38,12 @@ const ws = new WorkflowStep('add_task', { // `await complete()` is not recommended because of the slow response of the API endpoint // which could result in not responding to the Slack Events API within the required 3 seconds // instead, use: - // complete({ outputs }).then(() => { console.log('workflow step execution complete registered'); }); + // complete({ outputs }).then(() => { console.log('step from app execution complete registered'); }); // let Slack know if something went wrong // await fail({ error: { message: "Just testing step failure!" } }); // NOTE: If you run your app with processBeforeResponse: true, use this instead: - // fail({ error: { message: "Just testing step failure!" } }).then(() => { console.log('workflow step execution failure registered'); }); + // fail({ error: { message: "Just testing step failure!" } }).then(() => { console.log('step from app execution failure registered'); }); }, }); -``` \ No newline at end of file +``` diff --git a/docs/content/steps/saving-steps.md b/docs/content/steps/saving-steps.md index 8b7f0447b..cc52b1e78 100644 --- a/docs/content/steps/saving-steps.md +++ b/docs/content/steps/saving-steps.md @@ -6,9 +6,9 @@ slug: /concepts/saving-steps :::danger -Workflow Steps from Apps are a deprecated feature. +Steps from apps are a deprecated feature. -Workflow Steps from Apps are different than, and not interchangable with, Slack automation workflows. We encourage those who are currently publishing Workflow Steps from Apps to consider the new [Slack automation features](https://api.slack.com/automation), such as [custom functions for Bolt](/concepts/creating-custom-functions). +Steps from apps are different than, and not interchangable with, Slack automation workflows. We encourage those who are currently publishing steps from apps to consider the new [Slack automation features](https://api.slack.com/automation), such as [custom steps for Bolt](/concepts/creating-custom-functions). Please [read the Slack API changelog entry](https://api.slack.com/changelog/2023-08-workflow-steps-from-apps-step-back) for more information. @@ -18,8 +18,8 @@ After the configuration modal is opened, your app will listen for the `view_subm Within the `save` callback, the `update()` method can be used to save the builder's step configuration by passing in the following arguments: -- `inputs` is an object representing the data your app expects to receive from the user upon workflow step execution. -- `outputs` is an array of objects containing data that your app will provide upon the workflow step's completion. Outputs can then be used in subsequent steps of the workflow. +- `inputs` is an object representing the data your app expects to receive from the user upon step from app execution. +- `outputs` is an array of objects containing data that your app will provide upon the step's completion. Outputs can then be used in subsequent steps of the workflow. - `step_name` overrides the default Step name - `step_image_url` overrides the default Step image @@ -57,4 +57,4 @@ const ws = new WorkflowStep('add_task', { }, execute: async ({ step, complete, fail }) => {}, }); -``` \ No newline at end of file +``` diff --git a/docs/content/steps/steps.md b/docs/content/steps/steps.md index 54aeb1962..0eac040db 100644 --- a/docs/content/steps/steps.md +++ b/docs/content/steps/steps.md @@ -1,14 +1,14 @@ --- -title: Overview of Workflow Steps from Apps +title: Overview of steps from apps lang: en slug: /concepts/steps --- :::danger -Workflow Steps from Apps are a deprecated feature. +Steps from apps are a deprecated feature. -Workflow Steps from Apps are different than, and not interchangable with, Slack automation workflows. We encourage those who are currently publishing Workflow Steps from Apps to consider the new [Slack automation features](https://api.slack.com/automation), such as [custom functions for Bolt](/concepts/creating-custom-functions). +Steps from apps are different than, and not interchangable with, Slack automation workflows. We encourage those who are currently publishing steps from apps to consider the new [Slack automation features](https://api.slack.com/automation), such as [custom steps for Bolt](/concepts/creating-custom-functions). Please [read the Slack API changelog entry](https://api.slack.com/changelog/2023-08-workflow-steps-from-apps-step-back) for more information. @@ -16,14 +16,14 @@ Please [read the Slack API changelog entry](https://api.slack.com/changelog/2023 --- -Workflow Steps from Apps allow your app to create and process custom workflow steps that users can add using [Workflow Builder](https://api.slack.com/workflows). +Steps from apps allow your app to create and process step that users can add using [Workflow Builder](https://api.slack.com/workflows). -A workflow step is made up of three distinct user events: +A step from app is made up of three distinct user events: - Adding or editing the step in a Workflow - Saving or updating the step's configuration - The end user's execution of the step -All three events must be handled for a workflow step to function. +All three events must be handled for a step from app to function. -Read more about Workflow Steps from Apps in the [API documentation](https://api.slack.com/legacy/workflows/steps). \ No newline at end of file +Read more about steps from apps in the [API documentation](https://api.slack.com/legacy/workflows/steps). diff --git a/docs/sidebars.js b/docs/sidebars.js index b82dbcdf2..1a0e35c55 100644 --- a/docs/sidebars.js +++ b/docs/sidebars.js @@ -39,7 +39,7 @@ const sidebars = { 'basic/options', 'basic/authenticating-oauth', 'basic/socket-mode' - ], + ], }, { type: 'category', @@ -78,7 +78,7 @@ const sidebars = { }, { type: 'category', - label: 'Workflow steps (Deprecated)', + label: 'Steps from apps (Deprecated)', items: [ 'steps/steps', 'steps/creating-steps', @@ -87,7 +87,7 @@ const sidebars = { 'steps/executing-steps', ], }, - {type: 'html', value: '
'}, + { type: 'html', value: '
' }, { type: 'category', label: 'Tutorials', @@ -98,9 +98,9 @@ const sidebars = { 'tutorial/migration-v3' ], }, - {type: 'html', value: '
'}, + { type: 'html', value: '
' }, 'reference', - {type: 'html', value: '
'}, + { type: 'html', value: '
' }, { type: 'link', label: 'Release notes', diff --git a/src/App.ts b/src/App.ts index 5fea2290c..d0a482845 100644 --- a/src/App.ts +++ b/src/App.ts @@ -194,7 +194,7 @@ export interface AnyErrorHandler extends ErrorHandler, ExtendedErrorHandler { // Used only in this file type MessageEventMiddleware< - CustomContext extends StringIndexed = StringIndexed, + CustomContext extends StringIndexed = StringIndexed, > = Middleware, CustomContext>; class WebClientPool { @@ -380,8 +380,8 @@ export default class App this.developerMode && this.installerOptions && (typeof this.installerOptions.callbackOptions === 'undefined' || - (typeof this.installerOptions.callbackOptions !== 'undefined' && - typeof this.installerOptions.callbackOptions.failure === 'undefined')) + (typeof this.installerOptions.callbackOptions !== 'undefined' && + typeof this.installerOptions.callbackOptions.failure === 'undefined')) ) { // add a custom failure callback for Developer Mode in case they are using OAuth this.logger.debug('adding Developer Mode custom OAuth failure handler'); @@ -509,7 +509,7 @@ export default class App /** * Register WorkflowStep middleware * - * @param workflowStep global workflow step middleware function + * @param workflowStep global step from app middleware function */ public step(workflowStep: WorkflowStep): this { const m = workflowStep.getMiddleware(); @@ -542,22 +542,22 @@ export default class App } public event< - EventType extends string = string, - MiddlewareCustomContext extends StringIndexed = StringIndexed, + EventType extends string = string, + MiddlewareCustomContext extends StringIndexed = StringIndexed, >( eventName: EventType, ...listeners: Middleware, AppCustomContext & MiddlewareCustomContext>[] ): void; public event< - EventType extends RegExp = RegExp, - MiddlewareCustomContext extends StringIndexed = StringIndexed, + EventType extends RegExp = RegExp, + MiddlewareCustomContext extends StringIndexed = StringIndexed, >( eventName: EventType, ...listeners: Middleware, AppCustomContext & MiddlewareCustomContext>[] ): void; public event< - EventType extends EventTypePattern = EventTypePattern, - MiddlewareCustomContext extends StringIndexed = StringIndexed, + EventType extends EventTypePattern = EventTypePattern, + MiddlewareCustomContext extends StringIndexed = StringIndexed, >( eventNameOrPattern: EventType, ...listeners: Middleware, AppCustomContext & MiddlewareCustomContext>[] @@ -573,8 +573,8 @@ export default class App if (invalidEventName) { throw new AppInitializationError( `Although the document mentions "${eventNameOrPattern}",` + - 'it is not a valid event type. Use "message" instead. ' + - 'If you want to filter message events, you can use event.channel_type for it.', + 'it is not a valid event type. Use "message" instead. ' + + 'If you want to filter message events, you can use event.channel_type for it.', ); } // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -591,7 +591,7 @@ export default class App * @param listeners Middlewares that process and react to a message event */ public message< - MiddlewareCustomContext extends StringIndexed = StringIndexed, + MiddlewareCustomContext extends StringIndexed = StringIndexed, >(...listeners: MessageEventMiddleware[]): void; /** * @@ -600,7 +600,7 @@ export default class App * @param listeners Middlewares that process and react to the message events that matched the provided patterns. */ public message< - MiddlewareCustomContext extends StringIndexed = StringIndexed, + MiddlewareCustomContext extends StringIndexed = StringIndexed, >( pattern: string | RegExp, ...listeners: MessageEventMiddleware[] @@ -614,7 +614,7 @@ export default class App * @param listeners Middlewares that process and react to the message events that matched the provided pattern. */ public message< - MiddlewareCustomContext extends StringIndexed = StringIndexed, + MiddlewareCustomContext extends StringIndexed = StringIndexed, >( filter: MessageEventMiddleware, pattern: string | RegExp, @@ -653,7 +653,7 @@ export default class App return matchMessage(patternOrMiddleware); } return patternOrMiddleware; - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any }) as any; // FIXME: workaround for TypeScript 4.7 breaking changes this.listeners.push([ @@ -757,8 +757,8 @@ export default class App public command( commandName: string | RegExp, ...listeners: Middleware< - SlackCommandMiddlewareArgs, - AppCustomContext & MiddlewareCustomContext + SlackCommandMiddlewareArgs, + AppCustomContext & MiddlewareCustomContext >[] ): void { // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -961,7 +961,7 @@ export default class App // Set body and payload // TODO: this value should eventually conform to AnyMiddlewareArgs let payload: DialogSubmitAction | WorkflowStepEdit | SlackShortcut | KnownEventFromType | SlashCommand - | KnownOptionsPayloadFromType | BlockElementAction | ViewOutput | InteractiveAction; + | KnownOptionsPayloadFromType | BlockElementAction | ViewOutput | InteractiveAction; switch (type) { case IncomingEventType.Event: payload = (bodyArg as SlackEventMiddlewareArgs['body']).event; @@ -980,12 +980,12 @@ export default class App [payload] = actions; break; } - // If above conditional does not hit, fall through to fallback payload in default block below + // If above conditional does not hit, fall through to fallback payload in default block below default: payload = (bodyArg as ( | Exclude< - AnyMiddlewareArgs, - SlackEventMiddlewareArgs | SlackActionMiddlewareArgs | SlackViewMiddlewareArgs + AnyMiddlewareArgs, + SlackEventMiddlewareArgs | SlackActionMiddlewareArgs | SlackViewMiddlewareArgs > | SlackActionMiddlewareArgs> )['body']); @@ -1205,7 +1205,7 @@ export default class App // Using default receiver HTTPReceiver, signature verification enabled, missing signingSecret throw new AppInitializationError( 'signingSecret is required to initialize the default receiver. Set signingSecret or use a ' + - 'custom receiver. You can find your Signing Secret in your Slack App Settings.', + 'custom receiver. You can find your Signing Secret in your Slack App Settings.', ); } this.logger.debug('Initializing HTTPReceiver'); @@ -1384,10 +1384,10 @@ function buildSource( const parseTeamId = ( bodyAs: - | SlackAction - | SlackViewAction - | SlackShortcut - | KnownOptionsPayloadFromType, + | SlackAction + | SlackViewAction + | SlackShortcut + | KnownOptionsPayloadFromType, ): string | undefined => { // When the app is installed using org-wide deployment, team property will be null if (typeof bodyAs.team !== 'undefined' && bodyAs.team !== null) { diff --git a/src/WorkflowStep.ts b/src/WorkflowStep.ts index ed9c36ab7..0a7c53bb8 100644 --- a/src/WorkflowStep.ts +++ b/src/WorkflowStep.ts @@ -341,7 +341,7 @@ function createStepFail(args: AllWorkflowStepMiddlewareArgs Date: Tue, 13 Aug 2024 16:56:26 -0400 Subject: [PATCH 2/5] Fix typos --- docs/content/steps/adding-editing-steps.md | 2 +- src/App.ts | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/content/steps/adding-editing-steps.md b/docs/content/steps/adding-editing-steps.md index d7204dea7..3d2aee1fc 100644 --- a/docs/content/steps/adding-editing-steps.md +++ b/docs/content/steps/adding-editing-steps.md @@ -16,7 +16,7 @@ Please [read the Slack API changelog entry](https://api.slack.com/changelog/2023 When a builder adds (or later edits) your step in their workflow, your app will receive a [`workflow_step_edit` event](https://api.slack.com/reference/workflows/workflow_step_edit). The `edit` callback in your `WorkflowStep` configuration will be run when this event is received. -Whether a builder is adding or editing a step, you need to send them a [step form app configuration modal](https://api.slack.com/reference/workflows/configuration-view). This modal is where step-specific settings are chosen, and it has more restrictions than typical modals—most notably, it cannot include `title​`, `submit​`, or `close`​ properties. By default, the configuration modal's `callback_id` will be the same as the step from app. +Whether a builder is adding or editing a step, you need to send them a [step from app configuration modal](https://api.slack.com/reference/workflows/configuration-view). This modal is where step-specific settings are chosen, and it has more restrictions than typical modals—most notably, it cannot include `title​`, `submit​`, or `close`​ properties. By default, the configuration modal's `callback_id` will be the same as the step from app. Within the `edit` callback, the `configure()` utility can be used to easily open your step's configuration modal by passing in an object with your view's `blocks`. To disable saving the configuration before certain conditions are met, pass in `submit_disabled` with a value of `true`. diff --git a/src/App.ts b/src/App.ts index d0a482845..7fc8fddcf 100644 --- a/src/App.ts +++ b/src/App.ts @@ -757,8 +757,8 @@ export default class App public command( commandName: string | RegExp, ...listeners: Middleware< - SlackCommandMiddlewareArgs, - AppCustomContext & MiddlewareCustomContext + SlackCommandMiddlewareArgs, + AppCustomContext & MiddlewareCustomContext >[] ): void { // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -961,7 +961,7 @@ export default class App // Set body and payload // TODO: this value should eventually conform to AnyMiddlewareArgs let payload: DialogSubmitAction | WorkflowStepEdit | SlackShortcut | KnownEventFromType | SlashCommand - | KnownOptionsPayloadFromType | BlockElementAction | ViewOutput | InteractiveAction; + | KnownOptionsPayloadFromType | BlockElementAction | ViewOutput | InteractiveAction; switch (type) { case IncomingEventType.Event: payload = (bodyArg as SlackEventMiddlewareArgs['body']).event; @@ -984,8 +984,8 @@ export default class App default: payload = (bodyArg as ( | Exclude< - AnyMiddlewareArgs, - SlackEventMiddlewareArgs | SlackActionMiddlewareArgs | SlackViewMiddlewareArgs + AnyMiddlewareArgs, + SlackEventMiddlewareArgs | SlackActionMiddlewareArgs | SlackViewMiddlewareArgs > | SlackActionMiddlewareArgs> )['body']); @@ -1384,10 +1384,10 @@ function buildSource( const parseTeamId = ( bodyAs: - | SlackAction - | SlackViewAction - | SlackShortcut - | KnownOptionsPayloadFromType, + | SlackAction + | SlackViewAction + | SlackShortcut + | KnownOptionsPayloadFromType, ): string | undefined => { // When the app is installed using org-wide deployment, team property will be null if (typeof bodyAs.team !== 'undefined' && bodyAs.team !== null) { From 9e0d9b582b2b6bb8ea6f95c1ca53bf99f47f9a3c Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Tue, 13 Aug 2024 17:01:19 -0400 Subject: [PATCH 3/5] Update App.ts --- src/App.ts | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/App.ts b/src/App.ts index 7fc8fddcf..5fea2290c 100644 --- a/src/App.ts +++ b/src/App.ts @@ -194,7 +194,7 @@ export interface AnyErrorHandler extends ErrorHandler, ExtendedErrorHandler { // Used only in this file type MessageEventMiddleware< - CustomContext extends StringIndexed = StringIndexed, + CustomContext extends StringIndexed = StringIndexed, > = Middleware, CustomContext>; class WebClientPool { @@ -380,8 +380,8 @@ export default class App this.developerMode && this.installerOptions && (typeof this.installerOptions.callbackOptions === 'undefined' || - (typeof this.installerOptions.callbackOptions !== 'undefined' && - typeof this.installerOptions.callbackOptions.failure === 'undefined')) + (typeof this.installerOptions.callbackOptions !== 'undefined' && + typeof this.installerOptions.callbackOptions.failure === 'undefined')) ) { // add a custom failure callback for Developer Mode in case they are using OAuth this.logger.debug('adding Developer Mode custom OAuth failure handler'); @@ -509,7 +509,7 @@ export default class App /** * Register WorkflowStep middleware * - * @param workflowStep global step from app middleware function + * @param workflowStep global workflow step middleware function */ public step(workflowStep: WorkflowStep): this { const m = workflowStep.getMiddleware(); @@ -542,22 +542,22 @@ export default class App } public event< - EventType extends string = string, - MiddlewareCustomContext extends StringIndexed = StringIndexed, + EventType extends string = string, + MiddlewareCustomContext extends StringIndexed = StringIndexed, >( eventName: EventType, ...listeners: Middleware, AppCustomContext & MiddlewareCustomContext>[] ): void; public event< - EventType extends RegExp = RegExp, - MiddlewareCustomContext extends StringIndexed = StringIndexed, + EventType extends RegExp = RegExp, + MiddlewareCustomContext extends StringIndexed = StringIndexed, >( eventName: EventType, ...listeners: Middleware, AppCustomContext & MiddlewareCustomContext>[] ): void; public event< - EventType extends EventTypePattern = EventTypePattern, - MiddlewareCustomContext extends StringIndexed = StringIndexed, + EventType extends EventTypePattern = EventTypePattern, + MiddlewareCustomContext extends StringIndexed = StringIndexed, >( eventNameOrPattern: EventType, ...listeners: Middleware, AppCustomContext & MiddlewareCustomContext>[] @@ -573,8 +573,8 @@ export default class App if (invalidEventName) { throw new AppInitializationError( `Although the document mentions "${eventNameOrPattern}",` + - 'it is not a valid event type. Use "message" instead. ' + - 'If you want to filter message events, you can use event.channel_type for it.', + 'it is not a valid event type. Use "message" instead. ' + + 'If you want to filter message events, you can use event.channel_type for it.', ); } // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -591,7 +591,7 @@ export default class App * @param listeners Middlewares that process and react to a message event */ public message< - MiddlewareCustomContext extends StringIndexed = StringIndexed, + MiddlewareCustomContext extends StringIndexed = StringIndexed, >(...listeners: MessageEventMiddleware[]): void; /** * @@ -600,7 +600,7 @@ export default class App * @param listeners Middlewares that process and react to the message events that matched the provided patterns. */ public message< - MiddlewareCustomContext extends StringIndexed = StringIndexed, + MiddlewareCustomContext extends StringIndexed = StringIndexed, >( pattern: string | RegExp, ...listeners: MessageEventMiddleware[] @@ -614,7 +614,7 @@ export default class App * @param listeners Middlewares that process and react to the message events that matched the provided pattern. */ public message< - MiddlewareCustomContext extends StringIndexed = StringIndexed, + MiddlewareCustomContext extends StringIndexed = StringIndexed, >( filter: MessageEventMiddleware, pattern: string | RegExp, @@ -653,7 +653,7 @@ export default class App return matchMessage(patternOrMiddleware); } return patternOrMiddleware; - // eslint-disable-next-line @typescript-eslint/no-explicit-any + // eslint-disable-next-line @typescript-eslint/no-explicit-any }) as any; // FIXME: workaround for TypeScript 4.7 breaking changes this.listeners.push([ @@ -980,7 +980,7 @@ export default class App [payload] = actions; break; } - // If above conditional does not hit, fall through to fallback payload in default block below + // If above conditional does not hit, fall through to fallback payload in default block below default: payload = (bodyArg as ( | Exclude< @@ -1205,7 +1205,7 @@ export default class App // Using default receiver HTTPReceiver, signature verification enabled, missing signingSecret throw new AppInitializationError( 'signingSecret is required to initialize the default receiver. Set signingSecret or use a ' + - 'custom receiver. You can find your Signing Secret in your Slack App Settings.', + 'custom receiver. You can find your Signing Secret in your Slack App Settings.', ); } this.logger.debug('Initializing HTTPReceiver'); From ee4f66fbb59780f808e13ae991503d4b28b26d4e Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Wed, 14 Aug 2024 11:09:56 -0400 Subject: [PATCH 4/5] Update docs/content/steps/steps.md Co-authored-by: Eden Zimbelman --- docs/content/steps/steps.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/steps/steps.md b/docs/content/steps/steps.md index 0eac040db..ce6e65c86 100644 --- a/docs/content/steps/steps.md +++ b/docs/content/steps/steps.md @@ -16,7 +16,7 @@ Please [read the Slack API changelog entry](https://api.slack.com/changelog/2023 --- -Steps from apps allow your app to create and process step that users can add using [Workflow Builder](https://api.slack.com/workflows). +Steps from apps allow your app to create and process steps that users can add using [Workflow Builder](https://api.slack.com/workflows). A step from app is made up of three distinct user events: From 5750c43a0420d17991a73dc89294b87fa789e7dc Mon Sep 17 00:00:00 2001 From: William Bergamin Date: Wed, 14 Aug 2024 11:14:57 -0400 Subject: [PATCH 5/5] Improve based on feedback --- docs/content/steps/adding-editing-steps.md | 2 +- docs/content/steps/creating-steps.md | 4 ++-- docs/content/steps/executing-steps.md | 2 +- docs/content/steps/saving-steps.md | 4 ++-- docs/content/steps/steps.md | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/content/steps/adding-editing-steps.md b/docs/content/steps/adding-editing-steps.md index 3d2aee1fc..0622d17a4 100644 --- a/docs/content/steps/adding-editing-steps.md +++ b/docs/content/steps/adding-editing-steps.md @@ -8,7 +8,7 @@ slug: /concepts/adding-editing-steps Steps from Apps are a deprecated feature. -Steps from Apps are different than, and not interchangable with, Slack automation workflows. We encourage those who are currently publishing steps from apps to consider the new [Slack automation features](https://api.slack.com/automation), such as [custom steps for Bolt](/concepts/creating-custom-functions). +Steps from Apps are different than, and not interchangeable with, Slack automation workflows. We encourage those who are currently publishing steps from apps to consider the new [Slack automation features](https://api.slack.com/automation), such as [custom steps for Bolt](https://api.slack.com/automation/functions/custom-bolt). Please [read the Slack API changelog entry](https://api.slack.com/changelog/2023-08-workflow-steps-from-apps-step-back) for more information. diff --git a/docs/content/steps/creating-steps.md b/docs/content/steps/creating-steps.md index 9f63f7b49..f39714ede 100644 --- a/docs/content/steps/creating-steps.md +++ b/docs/content/steps/creating-steps.md @@ -6,9 +6,9 @@ slug: /concepts/creating-steps :::danger -Steps from apps are a deprecated feature. +Steps from Apps are a deprecated feature. -Steps from apps are different than, and not interchangable with, Slack automation workflows. We encourage those who are currently publishing steps from apps to consider the new [Slack automation features](https://api.slack.com/automation), such as [custom steps for Bolt](/concepts/creating-custom-functions). +Steps from Apps are different than, and not interchangeable with, Slack automation workflows. We encourage those who are currently publishing steps from apps to consider the new [Slack automation features](https://api.slack.com/automation), such as [custom steps for Bolt](https://api.slack.com/automation/functions/custom-bolt). Please [read the Slack API changelog entry](https://api.slack.com/changelog/2023-08-workflow-steps-from-apps-step-back) for more information. diff --git a/docs/content/steps/executing-steps.md b/docs/content/steps/executing-steps.md index 525386826..55194cecb 100644 --- a/docs/content/steps/executing-steps.md +++ b/docs/content/steps/executing-steps.md @@ -8,7 +8,7 @@ slug: /concepts/executing-steps Steps from Apps are a deprecated feature. -Steps from Apps are different than, and not interchangable with, Slack automation workflows. We encourage those who are currently publishing steps from apps to consider the new [Slack automation features](https://api.slack.com/automation), such as [custom steps for Bolt](/concepts/creating-custom-functions). +Steps from Apps are different than, and not interchangeable with, Slack automation workflows. We encourage those who are currently publishing steps from apps to consider the new [Slack automation features](https://api.slack.com/automation), such as [custom steps for Bolt](https://api.slack.com/automation/functions/custom-bolt). Please [read the Slack API changelog entry](https://api.slack.com/changelog/2023-08-workflow-steps-from-apps-step-back) for more information. diff --git a/docs/content/steps/saving-steps.md b/docs/content/steps/saving-steps.md index cc52b1e78..5f3e4a4ba 100644 --- a/docs/content/steps/saving-steps.md +++ b/docs/content/steps/saving-steps.md @@ -6,9 +6,9 @@ slug: /concepts/saving-steps :::danger -Steps from apps are a deprecated feature. +Steps from Apps are a deprecated feature. -Steps from apps are different than, and not interchangable with, Slack automation workflows. We encourage those who are currently publishing steps from apps to consider the new [Slack automation features](https://api.slack.com/automation), such as [custom steps for Bolt](/concepts/creating-custom-functions). +Steps from Apps are different than, and not interchangeable with, Slack automation workflows. We encourage those who are currently publishing steps from apps to consider the new [Slack automation features](https://api.slack.com/automation), such as [custom steps for Bolt](https://api.slack.com/automation/functions/custom-bolt). Please [read the Slack API changelog entry](https://api.slack.com/changelog/2023-08-workflow-steps-from-apps-step-back) for more information. diff --git a/docs/content/steps/steps.md b/docs/content/steps/steps.md index 0eac040db..c681f9062 100644 --- a/docs/content/steps/steps.md +++ b/docs/content/steps/steps.md @@ -6,9 +6,9 @@ slug: /concepts/steps :::danger -Steps from apps are a deprecated feature. +Steps from Apps are a deprecated feature. -Steps from apps are different than, and not interchangable with, Slack automation workflows. We encourage those who are currently publishing steps from apps to consider the new [Slack automation features](https://api.slack.com/automation), such as [custom steps for Bolt](/concepts/creating-custom-functions). +Steps from Apps are different than, and not interchangeable with, Slack automation workflows. We encourage those who are currently publishing steps from apps to consider the new [Slack automation features](https://api.slack.com/automation), such as [custom steps for Bolt](https://api.slack.com/automation/functions/custom-bolt). Please [read the Slack API changelog entry](https://api.slack.com/changelog/2023-08-workflow-steps-from-apps-step-back) for more information.