@microsoft/agents-hosting-express 0.2.14 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import { AgentApplication, AuthConfiguration, TurnState } from '@microsoft/agents-hosting';
|
|
5
|
+
import { ActivityHandler, AgentApplication, AuthConfiguration, TurnState } from '@microsoft/agents-hosting';
|
|
6
6
|
/**
|
|
7
7
|
* Starts an Express server for handling Agent requests.
|
|
8
8
|
*
|
|
@@ -29,4 +29,4 @@ import { AgentApplication, AuthConfiguration, TurnState } from '@microsoft/agent
|
|
|
29
29
|
* startServer(app);
|
|
30
30
|
* ```
|
|
31
31
|
*/
|
|
32
|
-
export declare const startServer: (agent: AgentApplication<TurnState
|
|
32
|
+
export declare const startServer: (agent: AgentApplication<TurnState> | ActivityHandler, authConfiguration?: AuthConfiguration) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startServer.js","sourceRoot":"","sources":["../../src/startServer.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,sDAA2C;AAC3C,
|
|
1
|
+
{"version":3,"file":"startServer.js","sourceRoot":"","sources":["../../src/startServer.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,sDAA2C;AAC3C,8DAAuK;AAEvK;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACI,MAAM,WAAW,GAAG,CAAC,KAAoD,EAAE,iBAAqC,EAAE,EAAE;IACzH,MAAM,UAAU,GAAsB,iBAAiB,aAAjB,iBAAiB,cAAjB,iBAAiB,GAAI,IAAA,sCAAqB,GAAE,CAAA;IAClF,MAAM,OAAO,GAAG,IAAI,6BAAY,CAAC,UAAU,CAAC,CAAA;IAC5C,MAAM,MAAM,GAAG,IAAA,iBAAO,GAAE,CAAA;IACxB,MAAM,CAAC,GAAG,CAAC,iBAAO,CAAC,IAAI,EAAE,CAAC,CAAA;IAC1B,MAAM,CAAC,GAAG,CAAC,IAAA,6BAAY,EAAC,UAAU,CAAC,CAAC,CAAA;IAEpC,MAAM,CAAC,IAAI,CAAC,eAAe,EAAE,CAAC,GAAY,EAAE,GAAa,EAAE,EAAE,CAC3D,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,EAAE,CACpC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,CACnB,CACF,CAAA;IAED,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,IAAI,CAAA;IACrC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,IAAI,EAAE;QAC7B,MAAM,OAAO,GAAG,CAAC,wDAAa,wCAAwC,GAAC,CAAC,CAAC,OAAO,CAAA;QAChF,OAAO,CAAC,GAAG,CAAC,8BAA8B,IAAI,WAAW,OAAO,cAAc,UAAU,CAAC,QAAQ,UAAU,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAA;IACjI,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,CAAA;AAC/B,CAAC,CAAA;AAlBY,QAAA,WAAW,eAkBvB"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@microsoft/agents-hosting-express",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.3.5",
|
|
5
5
|
"homepage": "https://github.com/microsoft/Agents-for-js",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"main": "dist/src/index.js",
|
|
20
20
|
"types": "dist/src/index.d.ts",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@microsoft/agents-hosting": "0.
|
|
22
|
+
"@microsoft/agents-hosting": "0.3.5",
|
|
23
23
|
"express": "^5.1.0"
|
|
24
24
|
},
|
|
25
25
|
"license": "MIT",
|
package/src/startServer.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import express, { Response } from 'express'
|
|
7
|
-
import { AgentApplication, AuthConfiguration, authorizeJWT, CloudAdapter, loadAuthConfigFromEnv, Request, TurnState } from '@microsoft/agents-hosting'
|
|
7
|
+
import { ActivityHandler, AgentApplication, AuthConfiguration, authorizeJWT, CloudAdapter, loadAuthConfigFromEnv, Request, TurnState } from '@microsoft/agents-hosting'
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Starts an Express server for handling Agent requests.
|
|
@@ -32,7 +32,7 @@ import { AgentApplication, AuthConfiguration, authorizeJWT, CloudAdapter, loadAu
|
|
|
32
32
|
* startServer(app);
|
|
33
33
|
* ```
|
|
34
34
|
*/
|
|
35
|
-
export const startServer = (agent: AgentApplication<TurnState
|
|
35
|
+
export const startServer = (agent: AgentApplication<TurnState> | ActivityHandler, authConfiguration?: AuthConfiguration) => {
|
|
36
36
|
const authConfig: AuthConfiguration = authConfiguration ?? loadAuthConfigFromEnv()
|
|
37
37
|
const adapter = new CloudAdapter(authConfig)
|
|
38
38
|
const server = express()
|