Skip to content
Open
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
30 changes: 30 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
include .env

# export values in .env to be used in the shell scripts
export $(shell sed 's/=.*//' .env)

default:
$(MAKE) build

deps:
cd code && npm ci
.PHONY: deps

build: deps
cd code && npm run build
.PHONY: build

auth:
devrev profiles authenticate --org $(DEV_ORG) --usr $(USER_EMAIL) --expiry 7 # days

.PHONY: auth

deploy: auth
./code/scripts/deploy.sh
.PHONY: deploy

# Removes the latest snap-in from the org. This is useful when you want to
# re-deploy the same snap-in to the same org.
uninstall:
./code/scripts/cleanup.sh
.PHONY: uninstall
98 changes: 84 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,84 @@
## Partner Workshop Submission

1. Clone this repo: https://github.com/devrev/partner-workshop-submissions
2. Create a branch locally: git commit -b CustomerName_YourName_ProblemStatementNumber
3. Add your code folder here.
4. Commit and Push your code
5. Raise a PR from your branch to main

Also, Dashboard is part of Snap-in, so it doesn’t need any other code repo.
Guidelines:
- You just need to share the code repo with the snap-in. The dashboard should be part of the snap-in only.
- Screenshots of the setup and documentation are not required.
- There are no additional requirements.
- You should put the code in the repo and share it with us.
# Microsoft Teams ADaaS Connector for DevRev

This integration enables the indexing and searching of Microsoft Teams conversations within DevRev's search system. It extracts messages from Teams channels and makes them searchable through DevRev's interface.

## Features

- Extracts messages from Microsoft Teams channels
- Indexes message content, authors, and metadata
- Supports real-time search of Teams conversations in DevRev
- Maintains message context with channel and team information

## Prerequisites

1. Microsoft Azure Account with admin access
2. Microsoft Teams environment
3. DevRev account with appropriate permissions
4. Node.js 14+ and npm installed

## Setup

### 1. Microsoft Teams App Registration

1. Go to [Azure Portal](https://portal.azure.com)
2. Navigate to "App Registrations"
3. Create a new registration
4. Set the following API permissions:
- ChannelMessage.Read.All
- Channel.ReadBasic.All
- Team.ReadBasic.All

### 2. Environment Configuration

Create a `.env` file in the root directory with the following variables:

```env
MS_TEAMS_CLIENT_ID=your_client_id
MS_TEAMS_CLIENT_SECRET=your_client_secret
MS_TEAMS_TENANT_ID=your_tenant_id
MS_TEAMS_TEAM_ID=your_team_id
```

### 3. Installation

```bash
cd code
npm install
npm run build
```

## Usage

1. Configure the connection in DevRev:
- Connection Type: Microsoft Teams Connection
- Provide Client ID, Client Secret, and Tenant ID

2. Run the extraction:
```bash
npm start
```

## Development

- `npm run lint`: Run linter
- `npm run test`: Run tests
- `npm run build`: Build the project
- `npm run start:watch`: Run with hot reload

## Architecture

The connector consists of three main components:

1. **Extraction Function**: Fetches messages from Microsoft Teams channels
2. **Loading Function**: Processes and prepares data for indexing
3. **Teams Client**: Handles authentication and API interactions

## Contributing

1. Fork the repository
2. Create a feature branch
3. Submit a pull request

## License

ISC
4 changes: 4 additions & 0 deletions code/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
dist
.env
extracted_files
1 change: 1 addition & 0 deletions code/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
save-exact=true
1 change: 1 addition & 0 deletions code/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist/**/*
15 changes: 15 additions & 0 deletions code/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"printWidth": 120,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "es5",
"bracketSpacing": true,
"jsxSingleQuote": false,
"arrowParens": "always",
"proseWrap": "never",
"htmlWhitespaceSensitivity": "strict",
"endOfLine": "lf",
"organizeImportsSkipDestructiveCodeActions": true
}
6 changes: 6 additions & 0 deletions code/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
presets: [
['@babel/preset-env', { targets: { node: 'current' } }],
'@babel/preset-typescript',
],
};
4 changes: 4 additions & 0 deletions code/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
};
6 changes: 6 additions & 0 deletions code/nodemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"execMap": {
"ts": "ts-node",
"watch": ["src"]
}
}
Loading