Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions apps/slack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ This sections explains how to run the Slack app locally.

### Lambda

- Change Dockerfile node version to 18. It should look like: `FROM node:18-alpine AS base`
- Change serverless.yml runtime node version to 18. It should look like `runtime: nodejs18.x`
- Copy `lambda/config/serverless.dev.yml.example` to `lambda/config/serverless.dev.yml`
- Create a new Contentful app, if this has not been done already.
- Set frontend URL to `http://localhost:1234`
Expand Down
9 changes: 8 additions & 1 deletion apps/slack/frontend/.env.development.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
REACT_APP_SLACK_CLIENT_ID=<your-slack-app-client-id>
REACT_APP_BACKEND_BASE_URL=https://slack-backend-dev.ngrok.io/dev/api
REACT_APP_BACKEND_BASE_URL=https://slack-backend-dev.ngrok.io/dev/api

## This are only needed to run the updateAppAction script
CONTENTFUL_ACCESS_TOKEN=<your-contentful-access-token>
CONTENTFUL_ORG_ID=<your-contentful-organization-id>
CONTENTFUL_APP_DEF_ID=<your-contentful-app-definition-id>
#Optional
APP_ACTION_ID=<your-app-action-id>
116 changes: 116 additions & 0 deletions apps/slack/frontend/contentful-app-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
{
"actions": [
{
"id": "sendMessage",
"name": "Send Slack Message",
"category": "Custom",
"description": "Sends a message to a specified Slack channel or user",
"type": "endpoint",
"url": "/messages",
"allowNetworks": [],
"parametersSchema": {
"type": "object",
"properties": {
"message": {
"type": "string",
"title": "Message Content",
"description": "The content of the message to be sent to Slack",
"minLength": 1,
"maxLength": 4000
},
"channelId": {
"type": "string",
"title": "Slack Channel ID",
"description": "The Slack channel ID to send the message to",
"minLength": 1
},
"workspaceId": {
"type": "string",
"title": "Slack Workspace ID",
"description": "The Slack workspace ID where the message should be sent",
"minLength": 1
}
},
"required": [
"message",
"channelId"
],
"additionalProperties": false
},
"resultSchema": {
"type": "object",
"properties": {
"ok": {
"type": "boolean",
"description": "Indicates whether the message was sent successfully"
},
"channel": {
"type": "string",
"description": "The channel ID where the message was sent"
},
"ts": {
"type": "string",
"description": "The timestamp of the message"
},
"message": {
"type": "object",
"description": "The message object that was sent",
"properties": {
"type": {
"type": "string",
"description": "The type of message"
},
"text": {
"type": "string",
"description": "The text content of the message"
},
"user": {
"type": "string",
"description": "The user ID who sent the message"
},
"ts": {
"type": "string",
"description": "The timestamp of the message"
},
"team": {
"type": "string",
"description": "The team ID"
},
"bot_id": {
"type": "string",
"description": "The bot ID that sent the message"
}
}
},
"error": {
"type": "string",
"description": "Error message when operation fails (present when ok: false)"
},
"errors": {
"type": "array",
"items": {
"type": "string"
},
"description": "Array of error messages (present when ok: false)"
},
"response_metadata": {
"type": "object",
"description": "Additional metadata about the response",
"properties": {
"warnings": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
},
"required": [
"ok"
],
"additionalProperties": false
}
}
]
}
Loading