Skip to content

Commit

Permalink
Add deprecation warnings to Steps from Apps components (#1319)
Browse files Browse the repository at this point in the history
  • Loading branch information
seratch committed Jun 6, 2024
1 parent 8e63663 commit 54d924c
Show file tree
Hide file tree
Showing 30 changed files with 86 additions and 4 deletions.
28 changes: 28 additions & 0 deletions bolt/src/main/java/com/slack/api/bolt/App.java
Original file line number Diff line number Diff line change
Expand Up @@ -772,14 +772,26 @@ public App viewClosed(Pattern callbackId, ViewClosedHandler handler) {
// Workflows: Steps from Apps
// https://api.slack.com/workflows/steps

/**
* @deprecated Use new custom steps: https://api.slack.com/automation/functions/custom-bolt
*/
@Deprecated
public App step(WorkflowStep step) {
return this.use(step);
}

/**
* @deprecated Use new custom steps: https://api.slack.com/automation/functions/custom-bolt
*/
@Deprecated
public App workflowStepEdit(String callbackId, WorkflowStepEditHandler handler) {
return workflowStepEdit(Pattern.compile("^" + Pattern.quote(callbackId) + "$"), handler);
}

/**
* @deprecated Use new custom steps: https://api.slack.com/automation/functions/custom-bolt
*/
@Deprecated
public App workflowStepEdit(Pattern callbackId, WorkflowStepEditHandler handler) {
if (workflowStepEditHandlers.get(callbackId) != null) {
log.warn("Replaced the handler for {}", callbackId);
Expand All @@ -788,10 +800,18 @@ public App workflowStepEdit(Pattern callbackId, WorkflowStepEditHandler handler)
return this;
}

/**
* @deprecated Use new custom steps: https://api.slack.com/automation/functions/custom-bolt
*/
@Deprecated
public App workflowStepSave(String callbackId, WorkflowStepSaveHandler handler) {
return workflowStepSave(Pattern.compile("^" + Pattern.quote(callbackId) + "$"), handler);
}

/**
* @deprecated Use new custom steps: https://api.slack.com/automation/functions/custom-bolt
*/
@Deprecated
public App workflowStepSave(Pattern callbackId, WorkflowStepSaveHandler handler) {
if (workflowStepSaveHandlers.get(callbackId) != null) {
log.warn("Replaced the handler for {}", callbackId);
Expand All @@ -800,10 +820,18 @@ public App workflowStepSave(Pattern callbackId, WorkflowStepSaveHandler handler)
return this;
}

/**
* @deprecated Use new custom steps: https://api.slack.com/automation/functions/custom-bolt
*/
@Deprecated
public App workflowStepExecute(String pattern, WorkflowStepExecuteHandler handler) {
return workflowStepExecute(Pattern.compile("^.*" + Pattern.quote(pattern) + ".*$"), handler);
}

/**
* @deprecated Use new custom steps: https://api.slack.com/automation/functions/custom-bolt
*/
@Deprecated
public App workflowStepExecute(Pattern pattern, WorkflowStepExecuteHandler handler) {
if (workflowStepExecuteHandlers.get(pattern) != null) {
log.warn("Replaced the handler for {}", pattern);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
import com.slack.api.methods.MethodsClient;
import com.slack.api.methods.SlackApiException;
import com.slack.api.methods.response.workflows.WorkflowsStepCompletedResponse;
import com.slack.api.model.workflow.WorkflowStepOutput;

import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
* @deprecated Use new custom steps: https://api.slack.com/automation/functions/custom-bolt
*/
@Deprecated
public interface WorkflowCompleteUtility {

String getWorkflowStepExecuteId();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@

import static com.slack.api.model.view.Views.view;

/**
* @deprecated Use new custom steps: https://api.slack.com/automation/functions/custom-bolt
*/
@Deprecated
public interface WorkflowConfigureUtility {

String getTriggerId();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@

import com.slack.api.methods.MethodsClient;
import com.slack.api.methods.SlackApiException;
import com.slack.api.methods.response.workflows.WorkflowsStepCompletedResponse;
import com.slack.api.methods.response.workflows.WorkflowsStepFailedResponse;

import java.io.IOException;
import java.util.Map;

/**
* @deprecated Use new custom steps: https://api.slack.com/automation/functions/custom-bolt
*/
@Deprecated
public interface WorkflowFailUtility {

String getWorkflowStepExecuteId();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
import java.util.List;
import java.util.Map;

/**
* @deprecated Use new custom steps: https://api.slack.com/automation/functions/custom-bolt
*/
@Deprecated
public interface WorkflowUpdateUtility {

String getWorkflowStepEditId();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

/**
* workflow_step_edit type request's context.
* @deprecated Use new custom steps: https://api.slack.com/automation/functions/custom-bolt
*/
@Getter
@Setter
Expand All @@ -14,6 +15,7 @@
@AllArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = false)
@Deprecated
public class WorkflowStepEditContext extends Context implements WorkflowConfigureUtility {

private String triggerId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
import lombok.*;

/**
* workflow_step_edit type request's context.
* workflow_step_execute type request's context.
* @deprecated Use new custom steps: https://api.slack.com/automation/functions/custom-bolt
*/
@Getter
@Setter
Expand All @@ -15,6 +16,7 @@
@AllArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = false)
@Deprecated
public class WorkflowStepExecuteContext extends Context
implements WorkflowCompleteUtility, WorkflowFailUtility {
private String callbackId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,18 @@

import java.util.Map;

/**
* workflow_step_save type request's context.
* @deprecated Use new custom steps: https://api.slack.com/automation/functions/custom-bolt
*/
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = false)
@Deprecated
public class WorkflowStepSaveContext extends Context implements WorkflowUpdateUtility {

private String workflowStepEditId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
import com.slack.api.bolt.response.Response;

@FunctionalInterface
@Deprecated
public interface WorkflowStepEditHandler extends Handler<WorkflowStepEditContext, WorkflowStepEditRequest, Response> {
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
import com.slack.api.bolt.response.Response;

@FunctionalInterface
@Deprecated
public interface WorkflowStepExecuteHandler extends Handler<WorkflowStepExecuteContext, WorkflowStepExecuteRequest, Response> {
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
import com.slack.api.bolt.response.Response;

@FunctionalInterface
@Deprecated
public interface WorkflowStepSaveHandler extends Handler<WorkflowStepSaveContext, WorkflowStepSaveRequest, Response> {
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,16 @@
import java.util.concurrent.ExecutorService;
import java.util.regex.Pattern;

/**
* @deprecated Use new custom steps: https://api.slack.com/automation/functions/custom-bolt
*/
@Slf4j
@Getter
@Setter
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Deprecated
public class WorkflowStep implements Middleware, AutoCloseable {

private String callbackId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import lombok.ToString;

@ToString(callSuper = true)
// Use new custom steps: https://api.slack.com/automation/functions/custom-bolt
@Deprecated
public class WorkflowStepEditRequest extends Request<WorkflowStepEditContext> {

private final String requestBody;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import lombok.ToString;

@ToString(callSuper = true)
// Use new custom steps: https://api.slack.com/automation/functions/custom-bolt
@Deprecated
public class WorkflowStepExecuteRequest extends Request<WorkflowStepExecuteContext> {

private final String requestBody;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import lombok.ToString;

@ToString(callSuper = true)
// Use new custom steps: https://api.slack.com/automation/functions/custom-bolt
@Deprecated
public class WorkflowStepSaveRequest extends Request<WorkflowStepSaveContext> {

private final String requestBody;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
* A workflow step supported by your app was removed from a workflow
* <p>
* https://api.slack.com/events/workflow_step_deleted
* @deprecated Use new custom steps: https://api.slack.com/automation/functions/custom-bolt
*/
@Data
@Deprecated
public class WorkflowStepDeletedEvent implements Event {

public static final String TYPE_NAME = "workflow_step_deleted";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
* A workflow step supported by your app should execute
* <p>
* https://api.slack.com/events/workflow_step_execute
* @deprecated Use new custom steps: https://api.slack.com/automation/functions/custom-bolt
*/
@Data
@Deprecated
public class WorkflowStepExecuteEvent implements Event {

public static final String TYPE_NAME = "workflow_step_execute";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
* A workflow that contains a step supported by your app was unpublished
* <p>
* https://api.slack.com/events/workflow_unpublished
* @deprecated Use new custom steps: https://api.slack.com/automation/functions/custom-bolt
*/
@Data
@Deprecated
public class WorkflowUnpublishedEvent implements Event {

public static final String TYPE_NAME = "workflow_unpublished";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.slack.api.app_backend.events.payload.WorkflowDeletedPayload;
import com.slack.api.model.event.WorkflowDeletedEvent;

@Deprecated
public abstract class WorkflowDeletedHandler extends EventHandler<WorkflowDeletedPayload> {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.slack.api.app_backend.events.payload.WorkflowPublishedPayload;
import com.slack.api.model.event.WorkflowPublishedEvent;

@Deprecated
public abstract class WorkflowPublishedHandler extends EventHandler<WorkflowPublishedPayload> {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.slack.api.app_backend.events.payload.WorkflowStepDeletedPayload;
import com.slack.api.model.event.WorkflowStepDeletedEvent;

@Deprecated
public abstract class WorkflowStepDeletedHandler extends EventHandler<WorkflowStepDeletedPayload> {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.slack.api.app_backend.events.payload.WorkflowStepExecutePayload;
import com.slack.api.model.event.WorkflowStepExecuteEvent;

@Deprecated
public abstract class WorkflowStepExecuteHandler extends EventHandler<WorkflowStepExecutePayload> {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.slack.api.app_backend.events.payload.WorkflowPublishedPayload;
import com.slack.api.model.event.WorkflowUnpublishedEvent;

@Deprecated
public abstract class WorkflowUnpublishedHandler extends EventHandler<WorkflowPublishedPayload> {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.util.List;

@Data
@Deprecated
public class WorkflowDeletedPayload implements EventsApiPayload<WorkflowDeletedEvent> {

private String token;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.util.List;

@Data
@Deprecated
public class WorkflowPublishedPayload implements EventsApiPayload<WorkflowPublishedEvent> {

private String token;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.util.List;

@Data
@Deprecated
public class WorkflowStepDeletedPayload implements EventsApiPayload<WorkflowStepDeletedEvent> {

private String token;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.util.List;

@Data
@Deprecated
public class WorkflowStepExecutePayload implements EventsApiPayload<WorkflowStepExecuteEvent> {

private String token;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.util.List;

@Data
@Deprecated
public class WorkflowUnpublishedPayload implements EventsApiPayload<WorkflowUnpublishedEvent> {

private String token;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@

/**
* https://api.slack.com/reference/workflows/workflow_step_edit
* @deprecated Use new custom steps: https://api.slack.com/automation/functions/custom-bolt
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Deprecated
public class WorkflowStepEditPayload {

public static final String TYPE = "workflow_step_edit";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Deprecated
public class WorkflowStepSavePayload {
public static final String TYPE = "view_submission";
private final String type = TYPE;
Expand Down

0 comments on commit 54d924c

Please sign in to comment.