Skip to content

Commit 3b72a13

Browse files
authored
Add manifest to slack [MAPS-70] (#10212)
* Update Node.js version in Dockerfile and serverless.yml to 18.x * updating controller to have response * wip: new manifest for slack app * updating backend packages * updating fe deps * adding script * refactoring * Updating test * Fixing old tests * Removing unused dep * Revert "Update Node.js version in Dockerfile and serverless.yml to 18.x" This reverts commit f7ca3bc. * Updating instructions
1 parent 16e8a2e commit 3b72a13

File tree

16 files changed

+15319
-5641
lines changed

16 files changed

+15319
-5641
lines changed

apps/slack/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ This sections explains how to run the Slack app locally.
9999

100100
### Lambda
101101

102+
- Change Dockerfile node version to 18. It should look like: `FROM node:18-alpine AS base`
103+
- Change serverless.yml runtime node version to 18. It should look like `runtime: nodejs18.x`
102104
- Copy `lambda/config/serverless.dev.yml.example` to `lambda/config/serverless.dev.yml`
103105
- Create a new Contentful app, if this has not been done already.
104106
- Set frontend URL to `http://localhost:1234`
Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
11
REACT_APP_SLACK_CLIENT_ID=<your-slack-app-client-id>
2-
REACT_APP_BACKEND_BASE_URL=https://slack-backend-dev.ngrok.io/dev/api
2+
REACT_APP_BACKEND_BASE_URL=https://slack-backend-dev.ngrok.io/dev/api
3+
4+
## This are only needed to run the updateAppAction script
5+
CONTENTFUL_ACCESS_TOKEN=<your-contentful-access-token>
6+
CONTENTFUL_ORG_ID=<your-contentful-organization-id>
7+
CONTENTFUL_APP_DEF_ID=<your-contentful-app-definition-id>
8+
#Optional
9+
APP_ACTION_ID=<your-app-action-id>
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
{
2+
"actions": [
3+
{
4+
"id": "sendMessage",
5+
"name": "Send Slack Message",
6+
"category": "Custom",
7+
"description": "Sends a message to a specified Slack channel or user",
8+
"type": "endpoint",
9+
"url": "/messages",
10+
"allowNetworks": [],
11+
"parametersSchema": {
12+
"type": "object",
13+
"properties": {
14+
"message": {
15+
"type": "string",
16+
"title": "Message Content",
17+
"description": "The content of the message to be sent to Slack",
18+
"minLength": 1,
19+
"maxLength": 4000
20+
},
21+
"channelId": {
22+
"type": "string",
23+
"title": "Slack Channel ID",
24+
"description": "The Slack channel ID to send the message to",
25+
"minLength": 1
26+
},
27+
"workspaceId": {
28+
"type": "string",
29+
"title": "Slack Workspace ID",
30+
"description": "The Slack workspace ID where the message should be sent",
31+
"minLength": 1
32+
}
33+
},
34+
"required": [
35+
"message",
36+
"channelId"
37+
],
38+
"additionalProperties": false
39+
},
40+
"resultSchema": {
41+
"type": "object",
42+
"properties": {
43+
"ok": {
44+
"type": "boolean",
45+
"description": "Indicates whether the message was sent successfully"
46+
},
47+
"channel": {
48+
"type": "string",
49+
"description": "The channel ID where the message was sent"
50+
},
51+
"ts": {
52+
"type": "string",
53+
"description": "The timestamp of the message"
54+
},
55+
"message": {
56+
"type": "object",
57+
"description": "The message object that was sent",
58+
"properties": {
59+
"type": {
60+
"type": "string",
61+
"description": "The type of message"
62+
},
63+
"text": {
64+
"type": "string",
65+
"description": "The text content of the message"
66+
},
67+
"user": {
68+
"type": "string",
69+
"description": "The user ID who sent the message"
70+
},
71+
"ts": {
72+
"type": "string",
73+
"description": "The timestamp of the message"
74+
},
75+
"team": {
76+
"type": "string",
77+
"description": "The team ID"
78+
},
79+
"bot_id": {
80+
"type": "string",
81+
"description": "The bot ID that sent the message"
82+
}
83+
}
84+
},
85+
"error": {
86+
"type": "string",
87+
"description": "Error message when operation fails (present when ok: false)"
88+
},
89+
"errors": {
90+
"type": "array",
91+
"items": {
92+
"type": "string"
93+
},
94+
"description": "Array of error messages (present when ok: false)"
95+
},
96+
"response_metadata": {
97+
"type": "object",
98+
"description": "Additional metadata about the response",
99+
"properties": {
100+
"warnings": {
101+
"type": "array",
102+
"items": {
103+
"type": "string"
104+
}
105+
}
106+
}
107+
}
108+
},
109+
"required": [
110+
"ok"
111+
],
112+
"additionalProperties": false
113+
}
114+
}
115+
]
116+
}

0 commit comments

Comments
 (0)