@@ -24,13 +24,19 @@ import { WorkflowStepInitializationError } from './errors';
2424
2525/** Interfaces */
2626
27+ /** @deprecated Steps from Apps are no longer supported and support for them will be removed in the next major bolt-js
28+ * version.
29+ */
2730export interface StepConfigureArguments {
2831 blocks : ( KnownBlock | Block ) [ ] ;
2932 private_metadata ?: string ;
3033 submit_disabled ?: boolean ;
3134 external_id ?: string ;
3235}
3336
37+ /** @deprecated Steps from Apps are no longer supported and support for them will be removed in the next major bolt-js
38+ * version.
39+ */
3440export interface StepUpdateArguments {
3541 inputs ?: {
3642 [ key : string ] : {
@@ -50,50 +56,80 @@ export interface StepUpdateArguments {
5056 step_image_url ?: string ;
5157}
5258
59+ /** @deprecated Steps from Apps are no longer supported and support for them will be removed in the next major bolt-js
60+ * version.
61+ */
5362export interface StepCompleteArguments {
5463 outputs ?: {
5564 [ key : string ] : any ;
5665 } ;
5766}
5867
68+ /** @deprecated Steps from Apps are no longer supported and support for them will be removed in the next major bolt-js
69+ * version.
70+ */
5971export interface StepFailArguments {
6072 error : {
6173 message : string ;
6274 } ;
6375}
6476
77+ /** @deprecated Steps from Apps are no longer supported and support for them will be removed in the next major bolt-js
78+ * version.
79+ */
6580export interface StepConfigureFn {
6681 ( params : StepConfigureArguments ) : Promise < ViewsOpenResponse > ;
6782}
6883
84+ /** @deprecated Steps from Apps are no longer supported and support for them will be removed in the next major bolt-js
85+ * version.
86+ */
6987export interface StepUpdateFn {
7088 ( params ?: StepUpdateArguments ) : Promise < WorkflowsUpdateStepResponse > ;
7189}
7290
91+ /** @deprecated Steps from Apps are no longer supported and support for them will be removed in the next major bolt-js
92+ * version.
93+ */
7394export interface StepCompleteFn {
7495 ( params ?: StepCompleteArguments ) : Promise < WorkflowsStepCompletedResponse > ;
7596}
7697
98+ /** @deprecated Steps from Apps are no longer supported and support for them will be removed in the next major bolt-js
99+ * version.
100+ */
77101export interface StepFailFn {
78102 ( params : StepFailArguments ) : Promise < WorkflowsStepFailedResponse > ;
79103}
80104
105+ /** @deprecated Steps from Apps are no longer supported and support for them will be removed in the next major bolt-js
106+ * version.
107+ */
81108export interface WorkflowStepConfig {
82109 edit : WorkflowStepEditMiddleware | WorkflowStepEditMiddleware [ ] ;
83110 save : WorkflowStepSaveMiddleware | WorkflowStepSaveMiddleware [ ] ;
84111 execute : WorkflowStepExecuteMiddleware | WorkflowStepExecuteMiddleware [ ] ;
85112}
86113
114+ /** @deprecated Steps from Apps are no longer supported and support for them will be removed in the next major bolt-js
115+ * version.
116+ */
87117export interface WorkflowStepEditMiddlewareArgs extends SlackActionMiddlewareArgs < WorkflowStepEdit > {
88118 step : WorkflowStepEdit [ 'workflow_step' ] ;
89119 configure : StepConfigureFn ;
90120}
91121
122+ /** @deprecated Steps from Apps are no longer supported and support for them will be removed in the next major bolt-js
123+ * version.
124+ */
92125export interface WorkflowStepSaveMiddlewareArgs extends SlackViewMiddlewareArgs < ViewWorkflowStepSubmitAction > {
93126 step : ViewWorkflowStepSubmitAction [ 'workflow_step' ] ;
94127 update : StepUpdateFn ;
95128}
96129
130+ /** @deprecated Steps from Apps are no longer supported and support for them will be removed in the next major bolt-js
131+ * version.
132+ */
97133export interface WorkflowStepExecuteMiddlewareArgs extends SlackEventMiddlewareArgs < 'workflow_step_execute' > {
98134 step : WorkflowStepExecuteEvent [ 'workflow_step' ] ;
99135 complete : StepCompleteFn ;
@@ -102,29 +138,48 @@ export interface WorkflowStepExecuteMiddlewareArgs extends SlackEventMiddlewareA
102138
103139/** Types */
104140
141+ /** @deprecated Steps from Apps are no longer supported and support for them will be removed in the next major bolt-js
142+ * version.
143+ */
105144export type SlackWorkflowStepMiddlewareArgs =
106145 | WorkflowStepEditMiddlewareArgs
107146 | WorkflowStepSaveMiddlewareArgs
108147 | WorkflowStepExecuteMiddlewareArgs ;
109148
149+ /** @deprecated Steps from Apps are no longer supported and support for them will be removed in the next major bolt-js
150+ * version.
151+ */
110152export type WorkflowStepEditMiddleware = Middleware < WorkflowStepEditMiddlewareArgs > ;
153+ /** @deprecated Steps from Apps are no longer supported and support for them will be removed in the next major bolt-js
154+ * version.
155+ */
111156export type WorkflowStepSaveMiddleware = Middleware < WorkflowStepSaveMiddlewareArgs > ;
157+ /** @deprecated Steps from Apps are no longer supported and support for them will be removed in the next major bolt-js
158+ * version.
159+ */
112160export type WorkflowStepExecuteMiddleware = Middleware < WorkflowStepExecuteMiddlewareArgs > ;
113161
162+ /** @deprecated Steps from Apps are no longer supported and support for them will be removed in the next major bolt-js
163+ * version.
164+ */
114165export type WorkflowStepMiddleware =
115166 | WorkflowStepEditMiddleware [ ]
116167 | WorkflowStepSaveMiddleware [ ]
117168 | WorkflowStepExecuteMiddleware [ ] ;
118169
170+ /** @deprecated Steps from Apps are no longer supported and support for them will be removed in the next major bolt-js
171+ * version.
172+ */
119173export type AllWorkflowStepMiddlewareArgs < T extends SlackWorkflowStepMiddlewareArgs = SlackWorkflowStepMiddlewareArgs > =
120174 T & AllMiddlewareArgs ;
121175
122176/** Constants */
123177
124178const VALID_PAYLOAD_TYPES = new Set ( [ 'workflow_step_edit' , 'workflow_step' , 'workflow_step_execute' ] ) ;
125179
126- /** Class */
127-
180+ /** @deprecated Steps from Apps are no longer supported and support for them will be removed in the next major bolt-js
181+ * version.
182+ */
128183export class WorkflowStep {
129184 /** Step callback_id */
130185 private callbackId : string ;
@@ -185,6 +240,9 @@ export class WorkflowStep {
185240
186241/** Helper Functions */
187242
243+ /** @deprecated Steps from Apps are no longer supported and support for them will be removed in the next major bolt-js
244+ * version.
245+ */
188246export function validate ( callbackId : string , config : WorkflowStepConfig ) : void {
189247 // Ensure callbackId is valid
190248 if ( typeof callbackId !== 'string' ) {
@@ -224,6 +282,8 @@ export function validate(callbackId: string, config: WorkflowStepConfig): void {
224282
225283/**
226284 * `processStepMiddleware()` invokes each callback for lifecycle event
285+ * @deprecated Steps from Apps are no longer supported and support for them will be removed in the next major bolt-js
286+ * version.
227287 * @param args workflow_step_edit action
228288 */
229289export async function processStepMiddleware (
@@ -243,6 +303,9 @@ export async function processStepMiddleware(
243303 }
244304}
245305
306+ /** @deprecated Steps from Apps are no longer supported and support for them will be removed in the next major bolt-js
307+ * version.
308+ */
246309export function isStepEvent ( args : AnyMiddlewareArgs ) : args is AllWorkflowStepMiddlewareArgs {
247310 return VALID_PAYLOAD_TYPES . has ( args . payload . type ) ;
248311}
@@ -345,8 +408,9 @@ function createStepFail(args: AllWorkflowStepMiddlewareArgs<WorkflowStepExecuteM
345408 * 1. removes the next() passed in from App-level middleware processing
346409 * - events will *not* continue down global middleware chain to subsequent listeners
347410 * 2. augments args with step lifecycle-specific properties/utilities
348- * */
349- // TODO :: refactor to incorporate a generic parameter
411+ * @deprecated Steps from Apps are no longer supported and support for them will be removed in the next major bolt-js
412+ * version.
413+ */
350414export function prepareStepArgs ( args : any ) : AllWorkflowStepMiddlewareArgs {
351415 const { next : _next , ...stepArgs } = args ;
352416 const preparedArgs : any = { ...stepArgs } ;
0 commit comments