@microsoft/agents-hosting 1.6.0-beta.2.ga8529bd583 → 1.6.0-beta.20.gabdeae0c72
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 +5 -5
- 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/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/teamsAttachmentDownloader.js +7 -1
- package/dist/src/app/teamsAttachmentDownloader.js.map +1 -1
- package/dist/src/auth/authConfiguration.d.ts +6 -0
- package/dist/src/auth/authConfiguration.js +4 -2
- package/dist/src/auth/authConfiguration.js.map +1 -1
- package/dist/src/auth/msalTokenProvider.js +16 -12
- package/dist/src/auth/msalTokenProvider.js.map +1 -1
- package/dist/src/cloudAdapter.js +6 -35
- package/dist/src/cloudAdapter.js.map +1 -1
- package/dist/src/connector-client/connectorClient.d.ts +2 -1
- package/dist/src/connector-client/connectorClient.js +10 -5
- package/dist/src/connector-client/connectorClient.js.map +1 -1
- package/dist/src/errorHelper.js +8 -0
- package/dist/src/errorHelper.js.map +1 -1
- package/package.json +5 -5
- package/src/agent-client/agentClient.ts +2 -2
- package/src/agent-client/agentResponseHandler.ts +2 -2
- package/src/app/auth/handlers/azureBotAuthorization.ts +2 -2
- package/src/app/proactive/createConversationOptionsBuilder.ts +8 -4
- package/src/app/teamsAttachmentDownloader.ts +6 -1
- package/src/auth/authConfiguration.ts +10 -1
- package/src/auth/msalTokenProvider.ts +10 -8
- package/src/cloudAdapter.ts +5 -2
- package/src/connector-client/connectorClient.ts +12 -5
- package/src/errorHelper.ts +9 -0
|
@@ -225,7 +225,8 @@ export class ConnectorClient {
|
|
|
225
225
|
headers: {
|
|
226
226
|
'Content-Type': 'application/json'
|
|
227
227
|
},
|
|
228
|
-
data: normalizeOutgoingActivity(body)
|
|
228
|
+
data: normalizeOutgoingActivity(body),
|
|
229
|
+
...(body.channelId === Channels.Msteams && body.isTargetedActivity() ? { params: { isTargetedActivity: 'true' } } : {})
|
|
229
230
|
}
|
|
230
231
|
const response = await this._axiosInstance(config)
|
|
231
232
|
record({ httpStatusCode: response.status?.toString() })
|
|
@@ -280,7 +281,9 @@ export class ConnectorClient {
|
|
|
280
281
|
headers: {
|
|
281
282
|
'Content-Type': 'application/json'
|
|
282
283
|
},
|
|
283
|
-
data: normalizeOutgoingActivity(body)
|
|
284
|
+
data: normalizeOutgoingActivity(body),
|
|
285
|
+
...(body.channelId === Channels.Msteams && body.isTargetedActivity() ? { params: { isTargetedActivity: 'true' } } : {})
|
|
286
|
+
|
|
284
287
|
}
|
|
285
288
|
const response = await this._axiosInstance(config)
|
|
286
289
|
record({ httpStatusCode: response.status?.toString() })
|
|
@@ -311,7 +314,8 @@ export class ConnectorClient {
|
|
|
311
314
|
headers: {
|
|
312
315
|
'Content-Type': 'application/json'
|
|
313
316
|
},
|
|
314
|
-
data: normalizeOutgoingActivity(body)
|
|
317
|
+
data: normalizeOutgoingActivity(body),
|
|
318
|
+
...(body.channelId === Channels.Msteams && body.isTargetedActivity() ? { params: { isTargetedActivity: 'true' } } : {})
|
|
315
319
|
}
|
|
316
320
|
const response = await this._axiosInstance(config)
|
|
317
321
|
record({ httpStatusCode: response.status?.toString() })
|
|
@@ -323,11 +327,13 @@ export class ConnectorClient {
|
|
|
323
327
|
* Deletes an activity from a conversation.
|
|
324
328
|
* @param conversationId - The ID of the conversation.
|
|
325
329
|
* @param activityId - The ID of the activity.
|
|
330
|
+
* @param isTargetedActivity - When true, appends ?isTargetedActivity=true to the request URL.
|
|
326
331
|
* @returns A promise that resolves when the activity is deleted.
|
|
327
332
|
*/
|
|
328
333
|
public async deleteActivity (
|
|
329
334
|
conversationId: string,
|
|
330
|
-
activityId: string
|
|
335
|
+
activityId: string,
|
|
336
|
+
isTargetedActivity?: boolean
|
|
331
337
|
): Promise<void> {
|
|
332
338
|
return trace(ConnectorClientTraceDefinitions.deleteActivity, async ({ record }) => {
|
|
333
339
|
record({ conversationId, activityId })
|
|
@@ -340,7 +346,8 @@ export class ConnectorClient {
|
|
|
340
346
|
url: `v3/conversations/${conversationId}/activities/${activityId}`,
|
|
341
347
|
headers: {
|
|
342
348
|
'Content-Type': 'application/json'
|
|
343
|
-
}
|
|
349
|
+
},
|
|
350
|
+
...(isTargetedActivity ? { params: { isTargetedActivity: 'true' } } : {})
|
|
344
351
|
}
|
|
345
352
|
const response = await this._axiosInstance(config)
|
|
346
353
|
record({ httpStatusCode: response.status?.toString() })
|
package/src/errorHelper.ts
CHANGED
|
@@ -784,6 +784,15 @@ export const Errors: { [key: string]: AgentErrorDefinition } = {
|
|
|
784
784
|
description: 'This proactive operation requires app storage to load and save TurnState. Set options.storage on AgentApplication.'
|
|
785
785
|
},
|
|
786
786
|
|
|
787
|
+
/**
|
|
788
|
+
* Error thrown when CreateConversationOptionsBuilder.build() is called for a Teams channel
|
|
789
|
+
* conversation (withTeamsChannelId) without an activity set via withActivity().
|
|
790
|
+
*/
|
|
791
|
+
CreateConversationBuilderChannelActivityRequired: {
|
|
792
|
+
code: -120753,
|
|
793
|
+
description: 'CreateConversationOptionsBuilder: Teams channel conversations require an initial activity. Call withActivity() before build().'
|
|
794
|
+
},
|
|
795
|
+
|
|
787
796
|
// ============================================================================
|
|
788
797
|
// General Errors (-120990)
|
|
789
798
|
// ============================================================================
|