Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Commit 70b6f9c

Browse files
authored
Merge pull request #58 from evry-ace/feature/typescript
Typescript support
2 parents a417b0a + d0566ac commit 70b6f9c

16 files changed

+7064
-2
lines changed

.gitignore

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
node_modules/
2+
.idea/*
13
.env
2-
node_modules
3-
*.tsbuildinfo
4+
node-ts/src/**/*.js
5+
node-ts/src/**/*.js.map
6+
*.tsbuildinfo

node-ts/.eslintrc

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"parser": "@typescript-eslint/parser",
3+
"plugins": [
4+
"@typescript-eslint"
5+
],
6+
"extends": [
7+
"eslint:recommended",
8+
"plugin:@typescript-eslint/eslint-recommended",
9+
"plugin:@typescript-eslint/recommended"
10+
]
11+
}

node-ts/README.md

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
2+
# Iskaribot.node
3+
4+
Message-relaying bot for cross-posting messages between platforms.
5+
6+
7+
## Run Locally
8+
9+
Clone the project
10+
11+
```bash
12+
# Clone the project
13+
git clone https://github.com/evry-ace/iskaribot.git
14+
15+
# Go to the project directory
16+
cd iskaribot/node
17+
18+
# Install dependencies
19+
npm install
20+
21+
# Define environment variables in .env
22+
23+
# Build the program
24+
npm run build
25+
26+
# Start the server
27+
npm run start
28+
29+
30+
```
31+
- Start ngrok
32+
- Set uri for the ngrok tunnel in workplace integrations
33+
- `Admin Panel > Integrations > Iskaribot > Webhooks > Groups`
34+
- callback URL: `https://<ngrok-tunel-domain>/workplace`
35+
- Verify token: same as in .env
36+
-
37+
Ngrok and the server needs to run to validate server when saving webhook config
38+
39+
40+
41+
## Environment Variables
42+
43+
To run this project, you will need to add the following environment variables to your .env file
44+
45+
`PORT` Port the server runs on.
46+
47+
`WORKPLACE_APP_ID` Found under 'details' in workplace.
48+
49+
`WORKPLACE_APP_SECRET` Found under 'details' in workplace.
50+
51+
`WORKPLACE_ACCESS_TOKEN` Generated in workplace under details. can only be viewed once.
52+
53+
`WORKPLACE_VERIFY_TOKEN` Self-defined, must be the same in workplace config and .env file.
54+
55+
`SLACK_URL` Url for the webhook used for posting messages.
56+
57+

node-ts/jest.config.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/** @type {import('ts-jest').JestConfigWithTsJest} */
2+
// eslint-disable-next-line no-undef
3+
module.exports = {
4+
preset: 'ts-jest',
5+
testEnvironment: 'node',
6+
};

0 commit comments

Comments
 (0)