Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[next-gen docs] Update next-gen capitalization of terms and also trim down on the getting started guide #1709

Merged
merged 3 commits into from
Jan 12, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/_future/app_manifests.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ The properties in the Manifest are:
| `longDescription` | String | ✅ Yes | (Optional) A more detailed description of your application |
| `icon` | String | ❌ No | A relative path to an image asset to use for the app's icon. Your app's profile picture that will appear in the Slack client |
| `backgroundColor` | String | ✅ Yes | (Optional) A six digit combination of numbers and letters (the hexadecimal color code) that make up the color of your app background e.g., "#000000" is the color black |
| `botScopes` | Array<string> | ✅ Yes | A list of [scopes](/scopes), or permissions, the app's Functions require |
| `functions` | Array | ✅ Yes | (Optional) A list of all Functions your app will use |
| `workflows` | Array | ✅ Yes | (Optional) A list of all Workflows your app will use |
| `botScopes` | Array<string> | ✅ Yes | A list of [scopes](/scopes), or permissions, the app's functions require |
| `functions` | Array | ✅ Yes | (Optional) A list of all functions your app will use |
| `workflows` | Array | ✅ Yes | (Optional) A list of all workflows your app will use |
srajiang marked this conversation as resolved.
Show resolved Hide resolved
| `outgoingDomains` | Array<string> | ✅ Yes | (Optional) If your app communicates to any external domains, list them here. Note that the outgoing domains are only restricted if the workspace has Admin approved apps on e.g., myapp.tld |
| `events` | Array | ✅ Yes | (Optional) A list of all Event structures that the app is expecting to be passed via [Message Metadata](/metadata/using) |
hello-ashleyintech marked this conversation as resolved.
Show resolved Hide resolved
| `types` | Array | ✅ Yes | (Optional) A list of all [custom types](https://api.slack.com/future/types/custom) your app will use |
Expand Down
10 changes: 5 additions & 5 deletions docs/_future/built_in_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ permalink: /future/built-in-functions
# Built-in functions <span class="label-beta">BETA</span>

<div class="section-content">
Slack provides built-in functions you can use alongside your [custom functions](/bolt-js/future/custom-functions) in a Workflow. Built-in functions are essentially Slack-native actions, like creating a channel or sending a message, that work hand-in-hand with your functions.
Slack provides built-in functions you can use alongside your [custom functions](/bolt-js/future/custom-functions) in a workflow. Built-in functions are essentially Slack-native actions, like creating a channel or sending a message, that work hand-in-hand with your functions.

<p class="alert alert_info"><ts-icon class="ts_icon_info_circle"></ts-icon> Please note that some built-in functions may be restricted due to Workspace permission settings. Reach out to a Workspace owner if these aren't available to you.</p>

</div>

---

### Using with Workflows {#workflows}
### Using with workflows {#workflows}

Built-in functions need to be imported from the standard library built into the SDK — all built-in functions are children of the `Schema.slack.functions` object. Just like custom Functions, built-ins are then added to steps in a Workflow using the `addStep` method. That's it!
Built-in functions need to be imported from the standard library built into the SDK — all built-in functions are children of the `Schema.slack.functions` object. Just like custom functions, built-ins are then added to steps in a workflow using the `addStep` method. That's it!

Built-in functions define their own inputs and outputs, as detailed for each built-in below.

Here's an example of a Workflow that sends a message using the `SendMessage` built-in function:
Here's an example of a workflow that sends a message using the `SendMessage` built-in function:

```javascript
const { DefineWorkflow, Schema } = require('@slack/bolt');
Expand All @@ -38,7 +38,7 @@ SampleWorkflow.addStep(Schema.slack.functions.SendMessage, {
module.exports = { SampleWorkflow };
```

Read the full documentation for [Workflows](/bolt-js/future/workflows) to learn how to build out Workflows.
Read the full documentation for [workflows](/bolt-js/future/workflows) to learn how to build out workflows.

---

Expand Down
26 changes: 13 additions & 13 deletions docs/_future/custom_functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ permalink: /future/custom-functions
# Custom functions <span class="label-beta">BETA</span>

<div class="section-content">
On the next-generation platform, you can build **custom functions**, reusable building blocks of automation that are deployed to our infrastructure and accept inputs, perform some calculations, and provide outputs. Functions can be used as steps in [Workflows](/bolt-js/future/workflows)&mdash;and Workflows are invoked by [Triggers](/bolt-js/future/triggers).
On the next-generation platform, you can build **custom functions**, reusable building blocks of automation that are deployed to our infrastructure and accept inputs, perform some calculations, and provide outputs. Functions can be used as steps in [workflows](/bolt-js/future/workflows)&mdash;and workflows are invoked by [triggers](/bolt-js/future/triggers).

To create a function, we need to do the following:
- [define the function](#define) in the Manifest;
Expand Down Expand Up @@ -56,11 +56,11 @@ const SampleFunctionDefinition = DefineFunction({
module.exports = { SampleFunctionDefinition };
```

Note that we import `DefineFunction`, which is used for defining our function, and also `Schema`, which has information on supported [Built-in types](https://api.slack.com/future/types).
Note that we import `DefineFunction`, which is used for defining our function, and also `Schema`, which has information on supported [built-in types](https://api.slack.com/future/types).

Just like [Workflows](/bolt-js/future/workflows), Custom functions have a unique `callback_id` and also require a `title`. Additionally, you can set inputs and outputs just like you can with Workflows.
Just like [workflows](/bolt-js/future/workflows), custom functions have a unique `callback_id` and also require a `title`. Additionally, you can set inputs and outputs just like you can with workflows.

Here's all the fields you can use when defining a Custom function:
Here's all the fields you can use when defining a custom function:

| Field | Expected value |
| ---- | ------------------ |
Expand All @@ -71,7 +71,7 @@ Here's all the fields you can use when defining a Custom function:
| `output_parameters` | An object which describes one or more output parameters that will be returned by your function. This object follows the exact same pattern as `input_parameters`: top-level properties of the object define output parameter names, with the property values further describe the type and description of each individual output parameter. |

The value for properties in `input_parameters` and `output_parameters` needs to be an object with further sub-properties:
* `type`: The type of the input parameter. This can be a [Built-in type](https://api.slack.com/future/types) or a [Custom type](https://api.slack.com/future/types/custom) that you define.
* `type`: The type of the input parameter. This can be a [built-in type](https://api.slack.com/future/types) or a [custom type](https://api.slack.com/future/types/custom) that you define.
* `description`: A string description of the parameter.

If you want to set a property as required, list its name in its respective input or output properties as a `required` property.
Expand All @@ -92,7 +92,7 @@ input_parameters: {

Functions can (and generally should) declare inputs and outputs.

Inputs are declared in the `input_parameters` property, and outputs are declared in the `output_parameters` property. Each can contain either [Built-in types](https://api.slack.com/future/types) or [Custom types](https://api.slack.com/future/types/custom) that you define.
Inputs are declared in the `input_parameters` property, and outputs are declared in the `output_parameters` property. Each can contain either [built-in types](https://api.slack.com/future/types) or [custom types](https://api.slack.com/future/types/custom) that you define.

While, strictly speaking, input and output parameters are optional, they are a common and standard way to pass data between functions and nearly any function you write will expect at least one input and pass along an output.

Expand All @@ -102,7 +102,7 @@ Once your function is defined in its own file in `manifest/functions`, the next

---

### Implementing a Function Listener {#implement}
### Implementing a function listener {#implement}

Implement functions in just a few steps:

Expand All @@ -120,7 +120,7 @@ To do this, create a file in `listeners/functions` directory for your function l
// For more information about functions: https://api.slack.com/future/functions
const { SlackFunction } = require('@slack/bolt');

// Get our Function Definition from the manifest!
// Get our function Definition from the manifest!
const { SampleFunctionDefinition } = require('../../manifest/functions/sample-function');

// Here is the work we want to do!
Expand All @@ -138,14 +138,14 @@ const helloWorld = async ({ event, complete }) => {
}
};

// Let's create a new Slack Function with helloWorld as its handler
// Let's create a new Slack function with helloWorld as its handler
const helloWorldFunc = new SlackFunction(SampleFunctionDefinition.id, helloWorld);

module.exports = { helloWorldFunc };
```
The `hello-world.js` file declares a function handler, `helloWorld`, that takes in inputs from the `event`, which is the payload received when your function is being executed. It executes logic within the handler to return a message with a random greeting. This message is the function's output. In addition to the function handler, a new `SlackFunction` instance is declared that actually links the `helloWorld` handler to `SampleFunctionDefinition` through the function's ID:
```js
// Let's create a new Slack Function with helloWorld as its handler
// Let's create a new Slack function with helloWorld as its handler
const helloWorldFunc = new SlackFunction(SampleFunctionDefinition.id, helloWorld);
```

Expand All @@ -162,7 +162,7 @@ module.exports.register = (app) => {
```


Lastly, in order to make sure this handler is triggered, make sure the Function listeners are registered in your `listeners/index.js` file:
Lastly, in order to make sure this handler is triggered, make sure the function listeners are registered in your `listeners/index.js` file:
```js
// listeners/index.js
const functions = require('./functions');
Expand All @@ -172,8 +172,8 @@ module.exports.registerListeners = (app) => {
};
```
#### 3. Add the function as a step in your workflow
To actually call the defined function, `SampleFunctionDefinition`, don't forget to add your function to a workflow! When you're finished defining and implementing your functions, the next step is to add them to [Workflows](/bolt-js/future/workflows). Once added as a step in a Workflow, your Function will run when that Workflow is invoked by a [Trigger](/bolt-js/future/triggers).
To actually call the defined function, `SampleFunctionDefinition`, don't forget to add your function to a workflow! When you're finished defining and implementing your functions, the next step is to add them to [workflows](/bolt-js/future/workflows). Once added as a step in a workflow, your function will run when that workflow is invoked by a [trigger](/bolt-js/future/triggers).

---
### Next steps
You've learned about built-in and custom functions - now it's time to jump into [Workflows](/bolt-js/future/workflows) and learn about how they work with Functions. 🎉
You've learned about built-in and custom functions - now it's time to jump into [workflows](/bolt-js/future/workflows) and learn about how they work with functions. 🎉
8 changes: 4 additions & 4 deletions docs/_future/deploy_your_app.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ In this guide, you will find the steps needed to prepare and deploy your app to

Before you can deploy a Bolt app to Heroku, you'll need a working Bolt app. If you haven't created one yet, [go ahead and make one](/bolt-js/future/getting-started#create-app)! If you already have an app and want features of the next-generation platform, check out the [Bolt for JavaScript setup guide](/bolt-js/future/setup-existing-app).

Additionally, you will need to have at least one Trigger created for your application to confirm that your application has successfully deployed to Heroku. If you haven't created one yet, you can learn about [the different types of Triggers](/bolt-js/future/triggers#types) and [how to create a Trigger](/bolt-js/future/triggers#create) for tapping into your Workflows.
Additionally, you will need to have at least one trigger created for your application to confirm that your application has successfully deployed to Heroku. If you haven't created one yet, you can learn about [the different types of triggers](/bolt-js/future/triggers#types) and [how to create a trigger](/bolt-js/future/triggers#create) for tapping into your workflows.

> 💡 List your application's existing triggers by running `slack triggers list` in your project directory and selecting a workspace where it is installed!

With your app and Trigger created, you can now use the `slack run` command to make sure your app starts successfully and appropriately responds to Triggers from your machine.
With your app and trigger created, you can now use the `slack run` command to make sure your app starts successfully and appropriately responds to triggers from your machine.
srajiang marked this conversation as resolved.
Show resolved Hide resolved

Since we're deploying to Heroku, having a Heroku account will also be useful. If you don't have one, [create one here](https://signup.heroku.com/).

Expand Down Expand Up @@ -208,7 +208,7 @@ For this, we will use the "Web URL" found from `heroku info` to update the **Req

At this step your app should be live, listening for messages, events, or whatever else you have coded up! Go ahead and jump into a workspace with your app to test things out! 🚀

Now would be a terrific time to try tripping your Trigger to test that your Workflows are executing as expected - however, make sure to confirm that you're not running the app locally! A successfully deployed Heroku app is one that is not running locally and will still fully execute your Trigger and all functionality associated with it.
Now would be a terrific time to try tripping your trigger to test that your workflows are executing as expected - however, make sure to confirm that you're not running the app locally! A successfully deployed Heroku app is one that is not running locally and will still fully execute your trigger and all functionality associated with it.

### Inspecting the activity logs {#activity-logs}

Expand Down Expand Up @@ -252,7 +252,7 @@ $ git commit -am "Add mystery to the greeting message"
$ git push -u heroku main
```

After the "Build succeeded!" and "Verifying deploy... done." messages appear, your app will have this newfound functionality! You can now test your Trigger again to verify the new change.
After the "Build succeeded!" and "Verifying deploy... done." messages appear, your app will have this newfound functionality! You can now test your trigger again to verify the new change.

---

Expand Down
Loading