Skip to content

Commit

Permalink
Add next-gen beta documentation (#1565)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevengill authored Sep 14, 2022
1 parent 6178645 commit c9e30ac
Show file tree
Hide file tree
Showing 26 changed files with 1,759 additions and 21 deletions.
8 changes: 8 additions & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ collections:
permalink: /tutorials/:slug
reference:
output: true
future:
output: true
permalink: /future/:slug

defaults:
-
Expand All @@ -41,6 +44,8 @@ t:
steps: Workflow steps
deployments: Deployments
contribute: Contributing
legacy: LEGACY
beta: BETA
ja-jp:
basic: 基本的な概念
advanced: 応用コンセプト
Expand All @@ -50,6 +55,9 @@ t:
deployments: Deployments
reference: リファレンス
contribute: 貢献
# TODO: translate these titles
legacy: LEGACY
beta: BETA

# Metadata
repo_name: bolt-js
Expand Down
87 changes: 87 additions & 0 deletions docs/_future/app_manifests.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
title: App manifest
order: 3
slug: app-manifests
lang: en
layout: tutorial
permalink: /future/app-manifests
---
# App manifests <span class="label-beta">BETA</span>

<div class="section-content">
An app's manifest is where you can configure its name and scopes, declare the functions your app will use, and more.
</div>

---

### Configuring an app {#configuring-an-app}

Locate the file named `manifest.js` within your application. This will likely be in your project's root directory or a `manifest` folder.

Inside the manifest file, you will find an `module.exports = Manifest({})` block that defines the app's configuration:

```javascript
// manifest/manifest.js
const { Manifest } = require('@slack/bolt');
const { TimeOffWorkflow } = require('./workflows/approval');

module.exports = Manifest({
runOnSlack: false,
// This is the internal name for your app.
// It can contain spaces (e.g., "My App")
name: 'take-your-time',
displayName: 'Take Your Time',
// A description of your app that will help users decide whether to use it.
description: 'Request and take time off.',
longDescription: 'Take your time off by using this application to request and take time off from your manager. Launch the workflow, put in your manager, requested PTO start and end date, and receive updates on your PTO request!',
botScopes: ['chat:write'],
tokenManagementEnabled: true,
socketModeEnabled: true,
// A list of all workflows your app will use.
workflows: [TimeOffWorkflow],
features: {
appHome: {
homeTabEnabled: true,
messagesTabEnabled: true,
messagesTabReadOnlyEnabled: true,
},
},
settings: {
interactivity: {
is_enabled: true,
},
},
tokenRotationEnabled: false,
});
```
---

### Manifest properties {#manifest-properties}

The properties in the Manifest are:

|Property|Type|Has Bolt support?|Description|
|---|---|---|---|
| `runOnSlack` | Boolean | ✅ Yes | This is a property to indicate whether an app can be deployed to Slack infrastructure. **For Bolt apps, this must be set to `false`.** You can learn more [here](/bolt-js/future/getting-started#next-gen). |
| `name` | String | ✅ Yes | This is the internal name for your app. It can contain spaces (e.g., "My App") |
| `description` |String| ✅ Yes | A short sentence describing your application. A description of your app that will help users decide whether to use it |
| `displayName` | String | ✅ Yes | (Optional) Allows a custom name for the app to be displayed that's different from the `name` |
| `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 |
| `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) |
| `types` | Array | ✅ Yes | (Optional) A list of all [custom types](https://api.slack.com/future/types/custom) your app will use |
| `datastores` | Array | ❌ No | (Optional) A list of all [Datastores](https://api.slack.com/future/datastores) your app will use. This is currently only available for non-Bolt next-generation apps. You can learn more [here](/bolt-js/future/getting-started#next-gen). |
| `features` | Object | ✅ Yes | (Optional) A configuration object of your app features |

You will come back to the Manifest every time you create a new workflow, since all workflows for your app need to be added to the Manifest in order to use them.

---

### Next steps {#next-steps}

Now that you're acquainted with the Manifest, you can now dive into the world of [built-in functions](/bolt-js/future/built-in-functions) and [custom functions](/bolt-js/future/custom-functions)!
55 changes: 55 additions & 0 deletions docs/_future/built_in_functions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
title: Built-in functions
order: 4
slug: built-in-functions
lang: en
layout: tutorial
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.

<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}

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 creates a new Slack channel using the `CreateChannel` built-in function:

```javascript
const { DefineWorkflow, Schema } = require('@slack/bolt');

...

const createChannelStep = myWorkflow.addStep(
Schema.slack.functions.CreateChannel,
{
channel_name: myWorkflow.inputs.channel_name,
is_private: false,
},
);
```

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

---

### Built-in functions list {#list}

You can view a full list of built-in functions [here](https://api.slack.com/future/functions#built-in-functions__built-in-functions).

---

### Next steps {#next-steps}

Now that you've taken a dive into built-in functions, you can explore [custom functions](/bolt-js/future/custom-functions) and what they have to offer. ✨

Loading

0 comments on commit c9e30ac

Please sign in to comment.