@microsoft/agents-hosting 1.6.0-beta.9.gce9d8facd2 → 1.6.1
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 +4 -9
- package/dist/src/agent-client/agentClient.js +2 -2
- package/dist/src/agent-client/agentClient.js.map +1 -1
- package/dist/src/agent-client/agentResponseHandler.js +2 -2
- package/dist/src/agent-client/agentResponseHandler.js.map +1 -1
- package/dist/src/app/agentApplication.js +28 -2
- package/dist/src/app/agentApplication.js.map +1 -1
- package/dist/src/app/agentApplicationOptions.d.ts +10 -0
- package/dist/src/app/attachmentDownloader.js +5 -10
- package/dist/src/app/attachmentDownloader.js.map +1 -1
- package/dist/src/app/auth/authorizationManager.d.ts +4 -0
- package/dist/src/app/auth/authorizationManager.js +94 -67
- package/dist/src/app/auth/authorizationManager.js.map +1 -1
- package/dist/src/app/auth/handlers/azureBotAuthorization.js +2 -2
- package/dist/src/app/auth/handlers/azureBotAuthorization.js.map +1 -1
- package/dist/src/app/proactive/createConversationOptionsBuilder.js +10 -6
- package/dist/src/app/proactive/createConversationOptionsBuilder.js.map +1 -1
- package/dist/src/app/proactive/proactive.d.ts +1 -0
- package/dist/src/app/proactive/proactive.js +30 -15
- package/dist/src/app/proactive/proactive.js.map +1 -1
- package/dist/src/app/teamsAttachmentDownloader.js +6 -14
- package/dist/src/app/teamsAttachmentDownloader.js.map +1 -1
- package/dist/src/auth/authConfiguration.d.ts +2 -143
- package/dist/src/auth/authConfiguration.js +301 -257
- package/dist/src/auth/authConfiguration.js.map +1 -1
- package/dist/src/auth/jwt-middleware.js +2 -1
- package/dist/src/auth/jwt-middleware.js.map +1 -1
- package/dist/src/auth/msalConnectionManager.js +27 -14
- package/dist/src/auth/msalConnectionManager.js.map +1 -1
- package/dist/src/auth/msalTokenProvider.d.ts +7 -0
- package/dist/src/auth/msalTokenProvider.js +188 -44
- package/dist/src/auth/msalTokenProvider.js.map +1 -1
- package/dist/src/auth/settings.d.ts +327 -0
- package/dist/src/auth/settings.js +158 -0
- package/dist/src/auth/settings.js.map +1 -0
- package/dist/src/cloudAdapter.d.ts +58 -1
- package/dist/src/cloudAdapter.js +232 -52
- package/dist/src/cloudAdapter.js.map +1 -1
- package/dist/src/connector-client/connectorClient.d.ts +12 -8
- package/dist/src/connector-client/connectorClient.js +99 -82
- package/dist/src/connector-client/connectorClient.js.map +1 -1
- package/dist/src/errorHelper.js +85 -7
- package/dist/src/errorHelper.js.map +1 -1
- package/dist/src/getProductInfo.d.ts +23 -0
- package/dist/src/getProductInfo.js +71 -1
- package/dist/src/getProductInfo.js.map +1 -1
- package/dist/src/headerPropagation.d.ts +17 -2
- package/dist/src/headerPropagation.js +46 -24
- package/dist/src/headerPropagation.js.map +1 -1
- package/dist/src/httpClient.d.ts +60 -0
- package/dist/src/httpClient.js +173 -0
- package/dist/src/httpClient.js.map +1 -0
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.js +7 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/oauth/userTokenClient.d.ts +5 -4
- package/dist/src/oauth/userTokenClient.js +97 -78
- package/dist/src/oauth/userTokenClient.js.map +1 -1
- package/dist/src/observability/traces.d.ts +11 -4
- package/dist/src/observability/traces.js +39 -7
- package/dist/src/observability/traces.js.map +1 -1
- package/dist/src/utils/env.d.ts +50 -0
- package/dist/src/utils/env.js +113 -0
- package/dist/src/utils/env.js.map +1 -0
- package/dist/src/utils.d.ts +10 -0
- package/dist/src/utils.js +18 -0
- package/dist/src/utils.js.map +1 -0
- package/package.json +4 -9
- package/src/agent-client/agentClient.ts +2 -2
- package/src/agent-client/agentResponseHandler.ts +2 -2
- package/src/app/agentApplication.ts +30 -3
- package/src/app/agentApplicationOptions.ts +11 -0
- package/src/app/attachmentDownloader.ts +6 -8
- package/src/app/auth/authorizationManager.ts +84 -41
- package/src/app/auth/handlers/azureBotAuthorization.ts +2 -2
- package/src/app/proactive/createConversationOptionsBuilder.ts +8 -4
- package/src/app/proactive/proactive.ts +39 -23
- package/src/app/teamsAttachmentDownloader.ts +7 -11
- package/src/auth/authConfiguration.ts +317 -356
- package/src/auth/jwt-middleware.ts +1 -1
- package/src/auth/msalConnectionManager.ts +27 -10
- package/src/auth/msalTokenProvider.ts +180 -42
- package/src/auth/settings.ts +323 -0
- package/src/cloudAdapter.ts +291 -12
- package/src/connector-client/connectorClient.ts +116 -94
- package/src/errorHelper.ts +96 -7
- package/src/getProductInfo.ts +79 -1
- package/src/headerPropagation.ts +55 -23
- package/src/httpClient.ts +223 -0
- package/src/index.ts +5 -1
- package/src/oauth/userTokenClient.ts +103 -84
- package/src/observability/traces.ts +39 -8
- package/src/utils/env.ts +105 -0
- package/src/utils.ts +14 -0
|
@@ -2,80 +2,8 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
* Represents the authentication configuration.
|
|
8
|
-
*/
|
|
9
|
-
export interface AuthConfiguration {
|
|
10
|
-
/**
|
|
11
|
-
* The tenant ID for the authentication configuration.
|
|
12
|
-
*/
|
|
13
|
-
tenantId?: string;
|
|
14
|
-
/**
|
|
15
|
-
* The client ID for the authentication configuration. Required in production.
|
|
16
|
-
*/
|
|
17
|
-
clientId?: string;
|
|
18
|
-
/**
|
|
19
|
-
* The client secret for the authentication configuration.
|
|
20
|
-
*/
|
|
21
|
-
clientSecret?: string;
|
|
22
|
-
/**
|
|
23
|
-
* The path to the certificate PEM file.
|
|
24
|
-
*/
|
|
25
|
-
certPemFile?: string;
|
|
26
|
-
/**
|
|
27
|
-
* The path to the certificate key file.
|
|
28
|
-
*/
|
|
29
|
-
certKeyFile?: string;
|
|
30
|
-
/**
|
|
31
|
-
* Indicates whether to send the X5C param or not (for SNI authentication).
|
|
32
|
-
*/
|
|
33
|
-
sendX5C?: boolean;
|
|
34
|
-
/**
|
|
35
|
-
* A list of valid issuers for the authentication configuration.
|
|
36
|
-
*/
|
|
37
|
-
issuers?: string[];
|
|
38
|
-
/**
|
|
39
|
-
* The connection name for the authentication configuration.
|
|
40
|
-
*/
|
|
41
|
-
connectionName?: string;
|
|
42
|
-
/**
|
|
43
|
-
* The FIC (First-Party Integration Channel) client ID.
|
|
44
|
-
*/
|
|
45
|
-
FICClientId?: string;
|
|
46
|
-
/**
|
|
47
|
-
* Entra Authentication Endpoint to use.
|
|
48
|
-
*
|
|
49
|
-
* @remarks
|
|
50
|
-
* If not populated the Entra Public Cloud endpoint is assumed.
|
|
51
|
-
* This example of Public Cloud Endpoint is https://login.microsoftonline.com
|
|
52
|
-
* see also https://learn.microsoft.com/entra/identity-platform/authentication-national-cloud
|
|
53
|
-
*/
|
|
54
|
-
authority?: string;
|
|
55
|
-
scope?: string;
|
|
56
|
-
/**
|
|
57
|
-
* A map of connection names to their respective authentication configurations.
|
|
58
|
-
*/
|
|
59
|
-
connections?: Map<string, AuthConfiguration>;
|
|
60
|
-
/**
|
|
61
|
-
* A list of connection map items to map service URLs to connection names.
|
|
62
|
-
*/
|
|
63
|
-
connectionsMap?: ConnectionMapItem[];
|
|
64
|
-
/**
|
|
65
|
-
* An optional alternative blueprint Connection name used when constructing a connector client.
|
|
66
|
-
*/
|
|
67
|
-
altBlueprintConnectionName?: string;
|
|
68
|
-
/**
|
|
69
|
-
* The path to K8s provided token.
|
|
70
|
-
*/
|
|
71
|
-
WIDAssertionFile?: string;
|
|
72
|
-
/**
|
|
73
|
-
* The Azure region for ESTS-R regional token acquisition (e.g. 'westus', 'eastus').
|
|
74
|
-
* When set, MSAL routes token requests to the specified regional endpoint.
|
|
75
|
-
* See https://learn.microsoft.com/en-us/entra/msal/javascript/node/regional-authorities for details.
|
|
76
|
-
*/
|
|
77
|
-
azureRegion?: string;
|
|
78
|
-
}
|
|
5
|
+
import { AuthConfiguration } from './settings';
|
|
6
|
+
export { type AuthConfiguration, AuthType, resolveAuthority } from './settings';
|
|
79
7
|
/**
|
|
80
8
|
* Loads the authentication configuration from environment variables.
|
|
81
9
|
*
|
|
@@ -143,72 +71,3 @@ export declare const loadPrevAuthConfigFromEnv: () => AuthConfiguration;
|
|
|
143
71
|
*
|
|
144
72
|
*/
|
|
145
73
|
export declare function getAuthConfigWithDefaults(config?: AuthConfiguration): AuthConfiguration;
|
|
146
|
-
/**
|
|
147
|
-
* Resolves the full authority URL including the tenant ID.
|
|
148
|
-
* Supports both patterns:
|
|
149
|
-
* - Tenant embedded in authority: https://login.microsoftonline.com/my-tenant
|
|
150
|
-
* - Authority + separate tenantId: https://login.microsoftonline.com + tenantId
|
|
151
|
-
* Also handles trailing slashes on authority.
|
|
152
|
-
*/
|
|
153
|
-
export declare function resolveAuthority(authority?: string, tenantId?: string): string;
|
|
154
|
-
/**
|
|
155
|
-
* A type representing a parser settings object.
|
|
156
|
-
*/
|
|
157
|
-
type ParserSettings<K extends string> = {
|
|
158
|
-
[key in K]: (value: string) => {
|
|
159
|
-
key?: string;
|
|
160
|
-
value?: any;
|
|
161
|
-
} | undefined;
|
|
162
|
-
};
|
|
163
|
-
/**
|
|
164
|
-
* Creates an environment variable parser that maps the variable keys to parsing functions.
|
|
165
|
-
* @param settings An object where each key is an environment variable name and the value is a function
|
|
166
|
-
* that takes the variable value as input and returns an object with optional `key` and `value` properties.
|
|
167
|
-
* @remarks
|
|
168
|
-
* The `key` property in the returned object can be used to rename the environment variable key,
|
|
169
|
-
* while the `value` property contains the parsed value.
|
|
170
|
-
* @returns An object with a `parse` method that takes an environment variable key and value,
|
|
171
|
-
* and returns the parsed result.
|
|
172
|
-
*/
|
|
173
|
-
export declare function envParser<K extends string>(settings: ParserSettings<K> & ThisType<ParserSettings<K>>): {
|
|
174
|
-
/**
|
|
175
|
-
* Parses the given environment variable key and value using the provided settings.
|
|
176
|
-
* @param key The environment variable key.
|
|
177
|
-
* @param value The environment variable value.
|
|
178
|
-
* @returns The parsed result with optional renamed key and parsed value.
|
|
179
|
-
*/
|
|
180
|
-
parse(key: K, value: string): {
|
|
181
|
-
key?: undefined;
|
|
182
|
-
value?: undefined;
|
|
183
|
-
} | {
|
|
184
|
-
key: string;
|
|
185
|
-
value: any;
|
|
186
|
-
};
|
|
187
|
-
};
|
|
188
|
-
/**
|
|
189
|
-
* Utility functions for environment variable parsers.
|
|
190
|
-
*/
|
|
191
|
-
export declare const envParserUtils: {
|
|
192
|
-
/**
|
|
193
|
-
* Bypass parser that returns the value as is.
|
|
194
|
-
* @param value The environment variable value.
|
|
195
|
-
* @returns An object with the original value.
|
|
196
|
-
*/
|
|
197
|
-
bypass: (value: string) => {
|
|
198
|
-
value: string;
|
|
199
|
-
};
|
|
200
|
-
/**
|
|
201
|
-
* Redirects the parsing to another parser for a specific key.
|
|
202
|
-
* @param parser The target parser to redirect to.
|
|
203
|
-
* @param key The key to use in the target parser.
|
|
204
|
-
* @returns A function that takes the environment variable value and returns the parsed result from the target parser.
|
|
205
|
-
*/
|
|
206
|
-
redirect: <Parser extends ReturnType<typeof envParser>>(parser: Parser, key: Parameters<Parser["parse"]>[0]) => (value: string) => {
|
|
207
|
-
key?: undefined;
|
|
208
|
-
value?: undefined;
|
|
209
|
-
} | {
|
|
210
|
-
key: string;
|
|
211
|
-
value: any;
|
|
212
|
-
};
|
|
213
|
-
};
|
|
214
|
-
export {};
|