Skip to content

Commit

Permalink
initialize
Browse files Browse the repository at this point in the history
  • Loading branch information
formulahendry committed Dec 14, 2022
0 parents commit cfa40eb
Show file tree
Hide file tree
Showing 35 changed files with 1,194 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .fx/configs/azure.parameters.dev.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"provisionParameters": {
"value": {
"botAadAppClientId": "{{state.teams-bot.botId}}",
"botAadAppClientSecret": "{{state.teams-bot.botPassword}}",
"resourceBaseName": "openaiteam2ab769"
}
}
}
}
18 changes: 18 additions & 0 deletions .fx/configs/config.dev.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"$schema": "https://aka.ms/teamsfx-env-config-schema",
"description": "You can customize the TeamsFx config for different environments. Visit https://aka.ms/teamsfx-env-config to learn more about this.",
"manifest": {
"appName": {
"short": "openai-teams-bot",
"full": "Full name for openai-teams-bot"
},
"description": {
"short": "Short description of openai-teams-bot",
"full": "Full description of openai-teams-bot"
},
"icons": {
"color": "resources/color.png",
"outline": "resources/outline.png"
}
}
}
60 changes: 60 additions & 0 deletions .fx/configs/projectSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"appName": "openai-teams-bot",
"projectId": "7b645719-832e-4408-a185-7d1d52f4011e",
"version": "2.1.0",
"components": [
{
"name": "teams-bot",
"hosting": "azure-web-app",
"provision": false,
"deploy": true,
"capabilities": [
"bot"
],
"build": true,
"folder": "bot"
},
{
"name": "bot-service",
"provision": true
},
{
"name": "azure-web-app",
"scenario": "Bot",
"connections": [
"identity",
"teams-bot"
]
},
{
"name": "identity",
"provision": true
}
],
"programmingLanguage": "typescript",
"solutionSettings": {
"name": "fx-solution-azure",
"version": "1.0.0",
"hostType": "Azure",
"azureResources": [],
"capabilities": [
"Bot"
],
"activeResourcePlugins": [
"fx-resource-local-debug",
"fx-resource-appstudio",
"fx-resource-cicd",
"fx-resource-api-connector",
"fx-resource-bot",
"fx-resource-identity"
]
},
"pluginSettings": {
"fx-resource-bot": {
"host-type": "app-service",
"capabilities": [
"bot"
]
}
}
}
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# TeamsFx files
node_modules
.fx/configs/localSettings.json
.fx/states/*.userdata
.DS_Store
.env.teamsfx.local
subscriptionInfo.json
build
.fx/configs/config.local.json
.fx/states/state.local.json
95 changes: 95 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch Remote (Edge)",
"type": "pwa-msedge",
"request": "launch",
"url": "https://teams.microsoft.com/l/app/${teamsAppId}?installAppPackage=true&webjoin=true&${account-hint}",
"presentation": {
"group": "remote",
"order": 1
},
"internalConsoleOptions": "neverOpen"
},
{
"name": "Launch Remote (Chrome)",
"type": "pwa-chrome",
"request": "launch",
"url": "https://teams.microsoft.com/l/app/${teamsAppId}?installAppPackage=true&webjoin=true&${account-hint}",
"presentation": {
"group": "remote",
"order": 2
},
"internalConsoleOptions": "neverOpen"
},
{
"name": "Launch Bot (Edge)",
"type": "pwa-msedge",
"request": "launch",
"url": "https://teams.microsoft.com/l/app/${localTeamsAppId}?installAppPackage=true&webjoin=true&${account-hint}",
"cascadeTerminateToConfigurations": [
"Attach to Bot"
],
"presentation": {
"group": "all",
"hidden": true
},
"internalConsoleOptions": "neverOpen"
},
{
"name": "Launch Bot (Chrome)",
"type": "pwa-chrome",
"request": "launch",
"url": "https://teams.microsoft.com/l/app/${localTeamsAppId}?installAppPackage=true&webjoin=true&${account-hint}",
"cascadeTerminateToConfigurations": [
"Attach to Bot"
],
"presentation": {
"group": "all",
"hidden": true
},
"internalConsoleOptions": "neverOpen"
},
{
"name": "Attach to Bot",
"type": "pwa-node",
"request": "attach",
"port": 9239,
"restart": true,
"presentation": {
"group": "all",
"hidden": true
},
"internalConsoleOptions": "neverOpen"
}
],
"compounds": [
{
"name": "Debug (Edge)",
"configurations": [
"Launch Bot (Edge)",
"Attach to Bot"
],
"preLaunchTask": "Start Teams App Locally",
"presentation": {
"group": "all",
"order": 1
},
"stopAll": true
},
{
"name": "Debug (Chrome)",
"configurations": [
"Launch Bot (Chrome)",
"Attach to Bot"
],
"preLaunchTask": "Start Teams App Locally",
"presentation": {
"group": "all",
"order": 2
},
"stopAll": true
}
]
}
11 changes: 11 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"debug.onTaskErrors": "abort",
"json.schemas": [
{
"fileMatch": [
"/aad.*.json"
],
"schema": {}
}
]
}
122 changes: 122 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
// This file is automatically generated by Teams Toolkit.
// The teamsfx tasks defined in this file require Teams Toolkit version >= 4.1.0.
// See https://aka.ms/teamsfx-debug-tasks for details on how to customize each task and how to integrate with existing Teams Toolkit projects.
{
"version": "2.0.0",
"tasks": [
{
"label": "Start Teams App Locally",
"dependsOn": [
"Validate & install prerequisites",
"Install npm packages",
"Start local tunnel",
"Set up bot",
"Build & upload Teams manifest",
"Start services"
],
"dependsOrder": "sequence"
},
{
// Check if all required prerequisites are installed and will install them if not.
// See https://aka.ms/teamsfx-check-prerequisites-task to know the details and how to customize the args.
"label": "Validate & install prerequisites",
"type": "teamsfx",
"command": "debug-check-prerequisites",
"args": {
"prerequisites": [
"nodejs", // Validate if Node.js is installed.
"m365Account", // Sign-in prompt for Microsoft 365 account, then validate if the account enables the sideloading permission.
"ngrok", // Install Ngrok. Bot project requires a public message endpoint, and ngrok can help create public tunnel for your local service.
"portOccupancy" // Validate available ports to ensure those debug ones are not occupied.
],
"portOccupancy": [
3978, // bot service port
9239 // bot inspector port for Node.js debugger
]
}
},
{
// Check if all the npm packages are installed and will install them if not.
// See https://aka.ms/teamsfx-npm-package-task to know the details and how to customize the args.
"label": "Install npm packages",
"type": "teamsfx",
"command": "debug-npm-install",
"args": {
"projects": [
{
"cwd": "${workspaceFolder}/bot",
"npmInstallArgs": [
"--no-audit"
]
}
]
}
},
{
// Start the local tunnel service to forward public ngrok URL to local port and inspect traffic.
// See https://aka.ms/teamsfx-local-tunnel-task to know the details and how to customize the args.
"label": "Start local tunnel",
"type": "teamsfx",
"command": "debug-start-local-tunnel",
"args": {
"ngrokArgs": "http 3978 --log=stdout --log-format=logfmt"
},
"isBackground": true,
"problemMatcher": "$teamsfx-local-tunnel-watch"
},
{
// Register resources and prepare local launch information for Bot.
// See https://aka.ms/teamsfx-debug-set-up-bot-task to know the details and how to customize the args.
"label": "Set up bot",
"type": "teamsfx",
"command": "debug-set-up-bot",
"args": {
//// Enter your own bot information if using the existing bot. ////
// "botId": "",
// "botPassword": "", // use plain text or environment variable reference like ${env:BOT_PASSWORD}
"botMessagingEndpoint": "/api/messages" // use your own routing "/any/path", or full URL "https://contoso.com/any/path"
}
},
{
// Build and upload Teams manifest.
// See https://aka.ms/teamsfx-debug-prepare-manifest-task to know the details and how to customize the args.
"label": "Build & upload Teams manifest",
"type": "teamsfx",
"command": "debug-prepare-manifest",
"args": {
//// Enter your own Teams app package path if using the existing Teams manifest. ////
// "appPackagePath": ""
}
},
{
"label": "Start services",
"dependsOn": [
"Start bot"
]
},
{
"label": "Start bot",
"type": "shell",
"command": "npm run dev:teamsfx",
"isBackground": true,
"options": {
"cwd": "${workspaceFolder}/bot"
},
"problemMatcher": {
"pattern": [
{
"regexp": "^.*$",
"file": 0,
"location": 1,
"message": 2
}
],
"background": {
"activeOnStart": true,
"beginsPattern": "[nodemon] starting",
"endsPattern": "restify listening to|Bot/ME service listening at|[nodemon] app crashed"
}
}
}
]
}
10 changes: 10 additions & 0 deletions bot/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# dependencies
node_modules/

# misc
.env
.deployment
.DS_Store

# build
lib/
17 changes: 17 additions & 0 deletions bot/.webappignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.fx
.deployment
.vscode
*.js.map
*.ts.map
*.ts
.git*
.tsbuildinfo
CHANGELOG.md
readme.md
local.settings.json
test
tsconfig.json
.DS_Store
node_modules/.bin
node_modules/ts-node
node_modules/typescript
Loading

0 comments on commit cfa40eb

Please sign in to comment.