Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
@botbuildercommunity/core
Advanced tools
This package should not be used directly in your Bot Framework chatbot. Instead, it is used in other packages to minimize code repetition.
The CustomWebAdapter adds two extra functions to the default BotAdapter
. retrieveBody
could be used to retrieve the body of a HTTP request and it will automatically serialize JSON and url-encoded content. delay
could be used as a helper function for the delay activity.
It is possible to use the Bot Service OAuth functionality by passing in the optional BotFrameworkAdapterSettings
object. If you want to implement your own OAuth functionality in YourOwnAdapter
, you could override the existing OAuth functions found in IUserTokenProvider
. Sample code for adding OAuth to your bot can be found here.
import { CustomWebAdapter } from '@botbuildercommunity/core';
export class YourOwnAdapter extends CustomWebAdapter {
protected readonly yourOwnAdapterSettings: YourOwnAdapterSettings;
public constructor(yourOwnAdapterSettings: YourOwnAdapterSettings, botFrameworkAdapterSettings?: BotFrameworkAdapterSettings) {
// Add optional botFrameworkAdapterSettings to enable OAuth on custom adapters
super(botFrameworkAdapterSettings);
}
public async processActivity(req: WebRequest, res: WebResponse, logic: (context: TurnContext) => Promise<any>): Promise<void> {
const body = this.retrieveBody(req);
...
}
public async sendActivities(context: TurnContext, activities: Partial<Activity>[]): Promise<ResourceResponse[]> {
const responses: ResourceResponse[] = [];
for (let i = 0; i < activities.length; i++) {
const activity: Partial<Activity> = activities[i];
switch (activity.type) {
case 'delay':
await delay(activity.value);
responses.push({} as ResourceResponse);
break;
...
}
}
}
}
FAQs
Classes used by other (community) libraries.
The npm package @botbuildercommunity/core receives a total of 32 weekly downloads. As such, @botbuildercommunity/core popularity was classified as not popular.
We found that @botbuildercommunity/core demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.