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

Add next-gen beta documentation #1565

Merged
merged 33 commits into from Sep 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
2e83d2a
Initial pass at adding beta labels and scaffolding for run on slack docs
hello-ashleyintech Aug 25, 2022
5048d07
Add in formatting and label updates
hello-ashleyintech Aug 25, 2022
56d9aae
Small update
hello-ashleyintech Aug 25, 2022
43a1deb
Update run on slack terminology and update section heading
hello-ashleyintech Aug 29, 2022
f077a6d
Update deployment page
hello-ashleyintech Aug 29, 2022
9783e78
Update file name for deploy page
hello-ashleyintech Aug 29, 2022
48344cd
Update sidebar title
hello-ashleyintech Aug 31, 2022
fe2ee9a
Add in more scaffolding for docs
hello-ashleyintech Sep 7, 2022
38a6fd2
Add in new pages and have a (nearly done) create new app page
hello-ashleyintech Sep 9, 2022
710fef1
Add in new updates - full create app guide, custom functions, assets
hello-ashleyintech Sep 12, 2022
df1b707
Add in more updates and JS-ify things
hello-ashleyintech Sep 13, 2022
f8ee225
add in more JS specific clarification
hello-ashleyintech Sep 13, 2022
6429de3
Touch up content
hello-ashleyintech Sep 13, 2022
f3ce60d
Add migration docs
srajiang Sep 13, 2022
03c63d8
More migrate docs changes
srajiang Sep 13, 2022
9112623
Add in updates based on PR feedback
hello-ashleyintech Sep 14, 2022
5e467fa
Update feedback link and add in CTA for feedback
hello-ashleyintech Sep 14, 2022
e57091e
remove extra spacing
hello-ashleyintech Sep 14, 2022
f59fa75
Make feedback into a tooltip
hello-ashleyintech Sep 14, 2022
4e8a91d
Push up final updates and placeholder for deploy guide
hello-ashleyintech Sep 14, 2022
486bb2d
Additional triggers and workflows updates
hello-ashleyintech Sep 14, 2022
f417beb
Push up additional updates to workflow page
hello-ashleyintech Sep 14, 2022
2563d2b
Formatting fixes
hello-ashleyintech Sep 14, 2022
090c97e
Typo fix
hello-ashleyintech Sep 14, 2022
ff30f8a
Typo fixes and update pluralizations
hello-ashleyintech Sep 14, 2022
90a5d6c
Updated custom function doc
stevengill Sep 14, 2022
8ef485a
Update docs/_future/create_new_app.md
stevengill Sep 14, 2022
c47630a
Update docs/_future/custom_functions.md
stevengill Sep 14, 2022
826754b
Apply suggestions from code review
stevengill Sep 14, 2022
48e1303
Add in updates to triggers and workflows
hello-ashleyintech Sep 14, 2022
d4a06cf
Push up initial create new app feedback and update feedback page naming
hello-ashleyintech Sep 14, 2022
0219965
Add missing headers for conclusion
hello-ashleyintech Sep 14, 2022
c3064ea
Add in updates for Triggers
hello-ashleyintech Sep 14, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/_config.yml
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
@@ -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
@@ -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. ✨