Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
botframework-schema
Advanced tools
The botframework-schema npm package provides the necessary types and interfaces for building bots using the Microsoft Bot Framework. It includes definitions for activities, channels, and other components that are essential for bot communication and interaction.
Activity
Defines the structure of an activity, which is a fundamental unit of communication in the Bot Framework. This example creates a message activity with a simple text message.
const { ActivityTypes } = require('botframework-schema');
const messageActivity = {
type: ActivityTypes.Message,
text: 'Hello, world!'
};
console.log(messageActivity);
ChannelAccount
Represents a user or bot on a channel. This example creates a ChannelAccount object for a user with an ID and name.
const { ChannelAccount } = require('botframework-schema');
const user = new ChannelAccount({
id: 'user1',
name: 'John Doe'
});
console.log(user);
ConversationReference
Defines a reference to a conversation, which includes details about the activity, user, bot, and conversation. This example creates a ConversationReference object with sample data.
const { ConversationReference } = require('botframework-schema');
const conversationRef = new ConversationReference({
activityId: 'activity1',
user: { id: 'user1', name: 'John Doe' },
bot: { id: 'bot1', name: 'Bot' },
conversation: { id: 'conversation1' }
});
console.log(conversationRef);
The botbuilder package is a comprehensive library for building bots using the Microsoft Bot Framework. It includes higher-level abstractions and tools for managing dialogs, state, and more, compared to the lower-level schema definitions provided by botframework-schema.
The botframework-connector package provides tools for connecting bots to the Bot Framework service. It includes functionality for handling authentication, sending and receiving activities, and managing conversations, which complements the schema definitions in botframework-schema.
The botframework-directlinejs package is a client library for communicating with bots using the Direct Line API. It provides a way to send and receive messages from a bot, which can be used alongside the schema definitions in botframework-schema for building custom clients.
Activity schema for the Microsoft Bot Framework.
To add the preview version of this package to your bot be sure include the @preview tag:
npm install --save botframework-schema@preview
While this package is in preview it's possible for updates to include build breaks. To avoid having any updates break your bot it's recommended that you update the dependency table of your bots package.json
file to lock down the specific version of the package you're using:
{
"dependencies": {
"botbuilder": "4.0.0-preview1.2",
"otframework-schema": "4.0.0-preview1.2"
}
}
FAQs
Activity schema for the Microsoft Bot Framework.
The npm package botframework-schema receives a total of 91,377 weekly downloads. As such, botframework-schema popularity was classified as popular.
We found that botframework-schema demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 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
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.