@microsoft/agents-hosting-express 1.1.0-alpha.2 → 1.1.0-alpha.58
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.
package/dist/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": "1.1.0-alpha.
|
|
4
|
+
"version": "1.1.0-alpha.58",
|
|
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": "1.1.0-alpha.
|
|
22
|
+
"@microsoft/agents-hosting": "1.1.0-alpha.58",
|
|
23
23
|
"express": "^5.1.0"
|
|
24
24
|
},
|
|
25
25
|
"license": "MIT",
|
|
@@ -10,7 +10,7 @@ import { ActivityHandler, AgentApplication, AuthConfiguration, TurnState } from
|
|
|
10
10
|
* @param agent - The AgentApplication or ActivityHandler instance to process incoming activities.
|
|
11
11
|
* @param authConfiguration - Optional custom authentication configuration. If not provided,
|
|
12
12
|
* configuration will be loaded from environment variables using loadAuthConfigFromEnv().
|
|
13
|
-
* @returns express - The Express server instance.
|
|
13
|
+
* @returns {express.Express} - The Express server instance.
|
|
14
14
|
*
|
|
15
15
|
* @remarks
|
|
16
16
|
* This function sets up an Express server with the necessary middleware and routes for handling
|
package/dist/src/startServer.js
CHANGED
|
@@ -17,7 +17,7 @@ const package_json_1 = require("@microsoft/agents-hosting/package.json");
|
|
|
17
17
|
* @param agent - The AgentApplication or ActivityHandler instance to process incoming activities.
|
|
18
18
|
* @param authConfiguration - Optional custom authentication configuration. If not provided,
|
|
19
19
|
* configuration will be loaded from environment variables using loadAuthConfigFromEnv().
|
|
20
|
-
* @returns express - The Express server instance.
|
|
20
|
+
* @returns {express.Express} - The Express server instance.
|
|
21
21
|
*
|
|
22
22
|
* @remarks
|
|
23
23
|
* This function sets up an Express server with the necessary middleware and routes for handling
|
|
@@ -40,7 +40,7 @@ const package_json_1 = require("@microsoft/agents-hosting/package.json");
|
|
|
40
40
|
*
|
|
41
41
|
*/
|
|
42
42
|
const startServer = (agent, authConfiguration) => {
|
|
43
|
-
const authConfig =
|
|
43
|
+
const authConfig = (0, agents_hosting_1.getAuthConfigWithDefaults)(authConfiguration);
|
|
44
44
|
let adapter;
|
|
45
45
|
let headerPropagation;
|
|
46
46
|
if (agent instanceof agents_hosting_1.ActivityHandler || !agent.adapter) {
|
|
@@ -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,8DAAwM;AACxM,yEAAgE;AAChE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACI,MAAM,WAAW,GAAG,CAAC,KAA8D,EAAE,iBAAqC,EAAoB,EAAE;IACrJ,MAAM,UAAU,GAAsB,IAAA,0CAAyB,EAAC,iBAAiB,CAAC,CAAA;IAClF,IAAI,OAAqB,CAAA;IACzB,IAAI,iBAA0D,CAAA;IAC9D,IAAI,KAAK,YAAY,gCAAe,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QACvD,OAAO,GAAG,IAAI,6BAAY,EAAE,CAAA;IAC9B,CAAC;SAAM,CAAC;QACN,OAAO,GAAG,KAAK,CAAC,OAAuB,CAAA;QACvC,iBAAiB,GAAI,KAA+C,aAA/C,KAAK,uBAAL,KAAK,CAA4C,OAAO,CAAC,iBAAiB,CAAA;IACjG,CAAC;IAED,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,EAClB,iBAAiB,CAAC,CACrB,CAAA;IAED,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,IAAI,CAAA;IACrC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,KAAK,IAAI,EAAE;QAC7B,OAAO,CAAC,GAAG,CAAC,8BAA8B,IAAI,WAAW,sBAAO,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;IAC7B,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AA1BY,QAAA,WAAW,eA0BvB"}
|
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": "1.1.0-alpha.
|
|
4
|
+
"version": "1.1.0-alpha.58",
|
|
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": "1.1.0-alpha.
|
|
22
|
+
"@microsoft/agents-hosting": "1.1.0-alpha.58",
|
|
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 { ActivityHandler, AgentApplication, AuthConfiguration, authorizeJWT, CloudAdapter,
|
|
7
|
+
import { ActivityHandler, AgentApplication, AuthConfiguration, authorizeJWT, CloudAdapter, getAuthConfigWithDefaults, HeaderPropagationDefinition, Request, TurnState } from '@microsoft/agents-hosting'
|
|
8
8
|
import { version } from '@microsoft/agents-hosting/package.json'
|
|
9
9
|
/**
|
|
10
10
|
* Starts an Express server for handling Agent requests.
|
|
@@ -12,7 +12,7 @@ import { version } from '@microsoft/agents-hosting/package.json'
|
|
|
12
12
|
* @param agent - The AgentApplication or ActivityHandler instance to process incoming activities.
|
|
13
13
|
* @param authConfiguration - Optional custom authentication configuration. If not provided,
|
|
14
14
|
* configuration will be loaded from environment variables using loadAuthConfigFromEnv().
|
|
15
|
-
* @returns express - The Express server instance.
|
|
15
|
+
* @returns {express.Express} - The Express server instance.
|
|
16
16
|
*
|
|
17
17
|
* @remarks
|
|
18
18
|
* This function sets up an Express server with the necessary middleware and routes for handling
|
|
@@ -35,7 +35,7 @@ import { version } from '@microsoft/agents-hosting/package.json'
|
|
|
35
35
|
*
|
|
36
36
|
*/
|
|
37
37
|
export const startServer = (agent: AgentApplication<TurnState<any, any>> | ActivityHandler, authConfiguration?: AuthConfiguration) : express.Express => {
|
|
38
|
-
const authConfig: AuthConfiguration = authConfiguration
|
|
38
|
+
const authConfig: AuthConfiguration = getAuthConfigWithDefaults(authConfiguration)
|
|
39
39
|
let adapter: CloudAdapter
|
|
40
40
|
let headerPropagation: HeaderPropagationDefinition | undefined
|
|
41
41
|
if (agent instanceof ActivityHandler || !agent.adapter) {
|