@microsoft/teamsfx 4.0.1-alpha.70b32ec72.0 → 4.0.1-alpha.70da820aa.0
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/README.md +16 -53
- package/package.json +2 -2
package/README.md
CHANGED
@@ -16,15 +16,15 @@ Use the library to:
|
|
16
16
|
|
17
17
|
> Important: Please be advised that access tokens are stored in sessionStorage for you by default. This can make it possible for malicious code in your app (or code pasted into a console on your page) to access APIs at the same privilege level as your client application. Please ensure you only request the minimum necessary scopes from your client application, and perform any sensitive operations from server side code that your client has to authenticate with.
|
18
18
|
|
19
|
-
TeamsFx SDK is pre-configured in scaffolded project using
|
19
|
+
TeamsFx SDK is pre-configured in scaffolded project using Microsoft 365 Agents Toolkit extension for Visual Studio and vscode, or the `atk` cli from the `@microsoft/m365agentstoolkit-cli` npm package.
|
20
20
|
Please check the [README](https://github.com/OfficeDev/TeamsFx/blob/main/packages/vscode-extension/README.md) to see how to create a Teams App project.
|
21
21
|
|
22
22
|
### Prerequisites
|
23
23
|
|
24
24
|
- Node.js version 18 or higher
|
25
25
|
- PNPM version 8 or higher
|
26
|
-
- A project created by the
|
27
|
-
- If your project has installed `
|
26
|
+
- A project created by the Microsoft 365 Agents Toolkit VS Code extension or `atk` CLI tool.
|
27
|
+
- If your project has installed `@microsoft/agents-hosting` related [packages](https://github.com/microsoft/Agents-for-js) as dependencies, ensure they are of the same version.
|
28
28
|
|
29
29
|
### Install the `@microsoft/teamsfx` package
|
30
30
|
|
@@ -437,13 +437,13 @@ const token = appCredential.getToken();
|
|
437
437
|
Add `TeamsBotSsoPrompt` to dialog set.
|
438
438
|
|
439
439
|
```ts
|
440
|
-
|
441
|
-
|
442
|
-
|
440
|
+
import { ConversationState, MemoryStorage } from "@microsoft/agents-hosting";
|
441
|
+
import { DialogSet, WaterfallDialog } from "@microsoft/agents-hosting-dialogs";
|
442
|
+
import {
|
443
443
|
TeamsBotSsoPrompt,
|
444
444
|
OnBehalfOfCredentialAuthConfig,
|
445
445
|
TeamsBotSsoPromptSettings,
|
446
|
-
}
|
446
|
+
} from "@microsoft/teamsfx";
|
447
447
|
|
448
448
|
const convoState = new ConversationState(new MemoryStorage());
|
449
449
|
const dialogState = convoState.createProperty("dialogState");
|
@@ -596,13 +596,13 @@ Also see [Credential](#Credential) for furthur description.
|
|
596
596
|
|
597
597
|
## How to use SDK implemented with `CloudAdapter`
|
598
598
|
|
599
|
-
From
|
599
|
+
From `@microsoft/teamsfx@4.0.0`, `BotBuilderCloudAdapter` has been renamed to `AgentBuilderCloudAdapter`. You can import `ConversationBot` from `AgentBuilderCloudAdapter` to use the latest SDK implemented with `CloudAdapter`.
|
600
600
|
|
601
|
-
1. Install `@microsoft/teamsfx @^
|
601
|
+
1. Install `@microsoft/teamsfx @^4.0.0`, `@microsoft/agents-hosting @^0.2.14`, (and `@types/node @^18.0.0` for TS projects) via `npm install` as follows.
|
602
602
|
|
603
603
|
```sh
|
604
604
|
npm install @microsoft/teamsfx
|
605
|
-
npm install
|
605
|
+
npm install @microsoft/agents-hosting@^0.2.14
|
606
606
|
|
607
607
|
// For TS projects only
|
608
608
|
npm install --save-dev @types/node
|
@@ -612,17 +612,17 @@ From `botbuilder@4.16.0`, `BotFrameworkAdapter` is deprecated, and `CloudAdapter
|
|
612
612
|
|
613
613
|
```ts
|
614
614
|
import { HelloWorldCommandHandler } from "../helloworldCommandHandler";
|
615
|
-
import {
|
616
|
-
import ConversationBot =
|
615
|
+
import { AgentBuilderCloudAdapter } from "@microsoft/teamsfx";
|
616
|
+
import ConversationBot = AgentBuilderCloudAdapter.ConversationBot;
|
617
617
|
import config from "./config";
|
618
618
|
|
619
619
|
export const commandBot = new ConversationBot({
|
620
620
|
// The bot id and password to create CloudAdapter.
|
621
621
|
// See https://aka.ms/about-bot-adapter to learn more about adapters.
|
622
622
|
adapterConfig: {
|
623
|
-
|
624
|
-
|
625
|
-
|
623
|
+
clientId: config.MicrosoftAppId,
|
624
|
+
clientSecret: config.MicrosoftAppPassword,
|
625
|
+
issuers: [],
|
626
626
|
},
|
627
627
|
command: {
|
628
628
|
enabled: true,
|
@@ -665,50 +665,13 @@ From `botbuilder@4.16.0`, `BotFrameworkAdapter` is deprecated, and `CloudAdapter
|
|
665
665
|
});
|
666
666
|
```
|
667
667
|
|
668
|
-
5. If the project has `responseWrapper.ts`, please update the class `responseWrapper` to the class below.
|
669
|
-
|
670
|
-
```ts
|
671
|
-
import { Response } from "botbuilder";
|
672
|
-
|
673
|
-
// A wrapper to convert Azure Functions Response to Bot Builder's Response.
|
674
|
-
export class ResponseWrapper implements Response {
|
675
|
-
socket: any;
|
676
|
-
originalResponse?: any;
|
677
|
-
headers?: any;
|
678
|
-
body?: any;
|
679
|
-
|
680
|
-
constructor(functionResponse?: { [key: string]: any }) {
|
681
|
-
this.socket = undefined;
|
682
|
-
this.originalResponse = functionResponse;
|
683
|
-
}
|
684
|
-
|
685
|
-
end(...args: any[]) {
|
686
|
-
// do nothing since res.end() is deprecated in Azure Functions.
|
687
|
-
}
|
688
|
-
|
689
|
-
header(name: string, value: any) {
|
690
|
-
this.headers[name] = value;
|
691
|
-
}
|
692
|
-
|
693
|
-
send(body: any) {
|
694
|
-
// record the body to be returned later.
|
695
|
-
this.body = body;
|
696
|
-
this.originalResponse.body = body;
|
697
|
-
}
|
698
|
-
status(status: number) {
|
699
|
-
// call Azure Functions' res.status().
|
700
|
-
return this.originalResponse?.status(status);
|
701
|
-
}
|
702
|
-
}
|
703
|
-
```
|
704
|
-
|
705
668
|
## Next steps
|
706
669
|
|
707
670
|
Please take a look at the [Samples](https://github.com/OfficeDev/TeamsFx-Samples) project for detailed examples on how to use this library.
|
708
671
|
|
709
672
|
## Related projects
|
710
673
|
|
711
|
-
- [Microsoft
|
674
|
+
- [Microsoft Microsoft 365 Agents Toolkit for Visual Studio Code](https://github.com/OfficeDev/TeamsFx/tree/main/packages/vscode-extension)
|
712
675
|
- [TeamsFx Cli](https://github.com/OfficeDev/TeamsFx/tree/main/packages/cli)
|
713
676
|
|
714
677
|
## Data Collection.
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@microsoft/teamsfx",
|
3
|
-
"version": "4.0.1-alpha.
|
3
|
+
"version": "4.0.1-alpha.70da820aa.0",
|
4
4
|
"description": "Microsoft Teams Framework for Node.js and browser.",
|
5
5
|
"main": "dist/index.node.cjs.js",
|
6
6
|
"browser": "dist/index.esm2017.js",
|
@@ -140,7 +140,7 @@
|
|
140
140
|
"webpack": "^5.62.1",
|
141
141
|
"yargs": "^17.2.1"
|
142
142
|
},
|
143
|
-
"gitHead": "
|
143
|
+
"gitHead": "9b7f720c2012a8616f84df13700906e9bf2dab8e",
|
144
144
|
"publishConfig": {
|
145
145
|
"access": "public"
|
146
146
|
},
|