Skip to content

Commit

Permalink
chore: update terminology (#42)
Browse files Browse the repository at this point in the history
Co-authored-by: Alissa Renz <alissa.renz@gmail.com>
Co-authored-by: Eden Zimbelman <zim@o526.net>
  • Loading branch information
3 people authored Aug 22, 2024
1 parent 3ca4f2a commit d8d7798
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 24 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Bolt for JavaScript Custom Function Template
# Bolt for JavaScript Custom Step Template

This is a Bolt for JavaScript template app used to build custom functions for
This is a Bolt for JavaScript template app used to build custom steps for
use in [Workflow Builder](https://api.slack.com/start#workflow-builder).

## Setup
Expand Down Expand Up @@ -47,10 +47,10 @@ Before you can run the app, you'll need to store some environment variables.

```zsh
# Clone this project onto your machine
git clone https://github.com/slack-samples/bolt-js-custom-function-template.git
git clone https://github.com/slack-samples/bolt-js-custom-step-template.git

# Change into this project directory
cd bolt-js-custom-function-template
cd bolt-js-custom-step-template

# Install dependencies
npm install
Expand All @@ -69,7 +69,7 @@ npm run lint

## Using Steps in Workflow Builder

With your server running, your function is now ready for use in
With your server running, your step is now ready for use in
[Workflow Builder](https://api.slack.com/start#workflow-builder)! Add it as a
custom step in a new or existing workflow, then run the workflow while your app
is running.
Expand Down
16 changes: 8 additions & 8 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,25 @@ const app = new App({
});

/** Sample Function Listener */
app.function('sample_function', async ({ client, inputs, fail }) => {
app.function('sample_step', async ({ client, inputs, fail }) => {
try {
const { user_id } = inputs;

await client.chat.postMessage({
channel: user_id,
text: 'Click the button to signal the function has completed',
text: 'Click the button to signal the step has completed',
blocks: [
{
type: 'section',
text: {
type: 'mrkdwn',
text: 'Click the button to signal the function has completed',
text: 'Click the button to signal the step has completed',
},
accessory: {
type: 'button',
text: {
type: 'plain_text',
text: 'Complete function',
text: 'Complete step',
},
action_id: 'sample_button',
},
Expand All @@ -39,7 +39,7 @@ app.function('sample_function', async ({ client, inputs, fail }) => {
});
} catch (error) {
console.error(error);

Check warning on line 41 in app.js

View workflow job for this annotation

GitHub Actions / build (18.x)

Unexpected console statement

Check warning on line 41 in app.js

View workflow job for this annotation

GitHub Actions / build (20.x)

Unexpected console statement
fail({ error: `Failed to handle a function request: ${error}` });
fail({ error: `Failed to complete the step: ${error}` });
}
});

Expand All @@ -48,19 +48,19 @@ app.action('sample_button', async ({ body, client, complete, fail }) => {
const { channel, message, user } = body;

try {
// Functions should be marked as successfully completed using `complete` or
// Steps should be marked as successfully completed using `complete` or
// as having failed using `fail`, else they'll remain in an 'In progress' state.
// Learn more at https://api.slack.com/automation/interactive-messages
await complete({ outputs: { user_id: user.id } });

await client.chat.update({
channel: channel.id,
ts: message.ts,
text: 'Function completed successfully!',
text: 'Step completed successfully!',
});
} catch (error) {
console.error(error);

Check warning on line 62 in app.js

View workflow job for this annotation

GitHub Actions / build (18.x)

Unexpected console statement

Check warning on line 62 in app.js

View workflow job for this annotation

GitHub Actions / build (20.x)

Unexpected console statement
fail({ error: `Failed to handle a function request: ${error}` });
fail({ error: `Failed to handle a step request: ${error}` });
}
});

Expand Down
12 changes: 6 additions & 6 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"display_information": {
"name": "Bolt Custom Function"
"name": "Bolt Custom Step"
},
"features": {
"app_home": {
Expand All @@ -9,7 +9,7 @@
"messages_tab_read_only_enabled": true
},
"bot_user": {
"display_name": "Bolt Custom Function",
"display_name": "Bolt Custom Step",
"always_online": false
}
},
Expand All @@ -35,9 +35,9 @@
"function_runtime": "remote"
},
"functions": {
"sample_function": {
"title": "Sample function",
"description": "Runs sample function",
"sample_step": {
"title": "Sample step",
"description": "Runs sample step",
"input_parameters": {
"user_id": {
"type": "slack#/types/user_id",
Expand All @@ -52,7 +52,7 @@
"user_id": {
"type": "slack#/types/user_id",
"title": "User",
"description": "User that completed the function",
"description": "User that completed the step",
"is_required": true,
"name": "user_id"
}
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "bolt-js-custom-function-template",
"name": "bolt-js-custom-step-template",
"version": "1.0.0",
"description": "A custom function template for Slack apps",
"description": "A custom step template for Slack apps",
"main": "app.js",
"scripts": {
"start": "node app.js",
Expand All @@ -16,10 +16,10 @@
],
"repository": {
"type": "git",
"url": "https://github.com/slack-samples/bolt-js-custom-function-template.git"
"url": "https://github.com/slack-samples/bolt-js-custom-step-template.git"
},
"bugs": {
"url": "https://github.com/slack-samples/bolt-js-custom-function-template/issues"
"url": "https://github.com/slack-samples/bolt-js-custom-step-template/issues"
},
"dependencies": {
"@slack/bolt": "3.21.0",
Expand Down

0 comments on commit d8d7798

Please sign in to comment.