Skip to content

Commit

Permalink
Merge pull request #58 from evry-ace/feature/typescript
Browse files Browse the repository at this point in the history
Typescript support
  • Loading branch information
bjornkpu authored Mar 6, 2023
2 parents a417b0a + d0566ac commit 70b6f9c
Show file tree
Hide file tree
Showing 16 changed files with 7,064 additions and 2 deletions.
7 changes: 5 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
node_modules/
.idea/*
.env
node_modules
*.tsbuildinfo
node-ts/src/**/*.js
node-ts/src/**/*.js.map
*.tsbuildinfo
11 changes: 11 additions & 0 deletions node-ts/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"parser": "@typescript-eslint/parser",
"plugins": [
"@typescript-eslint"
],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
]
}
57 changes: 57 additions & 0 deletions node-ts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@

# Iskaribot.node

Message-relaying bot for cross-posting messages between platforms.


## Run Locally

Clone the project

```bash
# Clone the project
git clone https://github.com/evry-ace/iskaribot.git

# Go to the project directory
cd iskaribot/node

# Install dependencies
npm install

# Define environment variables in .env

# Build the program
npm run build

# Start the server
npm run start


```
- Start ngrok
- Set uri for the ngrok tunnel in workplace integrations
- `Admin Panel > Integrations > Iskaribot > Webhooks > Groups`
- callback URL: `https://<ngrok-tunel-domain>/workplace`
- Verify token: same as in .env
-
Ngrok and the server needs to run to validate server when saving webhook config



## Environment Variables

To run this project, you will need to add the following environment variables to your .env file

`PORT` Port the server runs on.

`WORKPLACE_APP_ID` Found under 'details' in workplace.

`WORKPLACE_APP_SECRET` Found under 'details' in workplace.

`WORKPLACE_ACCESS_TOKEN` Generated in workplace under details. can only be viewed once.

`WORKPLACE_VERIFY_TOKEN` Self-defined, must be the same in workplace config and .env file.

`SLACK_URL` Url for the webhook used for posting messages.


6 changes: 6 additions & 0 deletions node-ts/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
// eslint-disable-next-line no-undef
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
};
Loading

0 comments on commit 70b6f9c

Please sign in to comment.