
Security News
Node.js TSC Votes to Stop Distributing Corepack
Corepack will be phased out from future Node.js releases following a TSC vote.
@botmock-api/client
Advanced tools
nodejs client for interacting with the botmock api
1.x
master
now tracks version 1.x
of the package. For 0.1.x
see branch legacy
.
Note: In order to get started with this client, you'll need to get your access token from https://app.botmock.com. After you sign in, go to the Account Settings page by clicking on your profile picture on the top right. Then click on "Developer API" from the dropdown menu. Give your token a name, check the box, and hit "Create". Remember to note down your token since it will not be shown after it is generated.
npm i @botmock-api/client
Batcher
import { Batcher } from "@botmock-api/client";
const config = {
token: process.env.BOTMOCK_TOKEN,
teamId: process.env.BOTMOCK_TEAM_ID,
projectId: process.env.BOTMOCK_PROJECT_ID,
boardId: process.env.BOTMOCK_BOARD_ID,
};
const { data } = await new Batcher(config).batchRequest([
"project",
"board",
"intents",
"entities",
"variables",
]);
batchRequest
batcher.batchRequest(string[]): Promise<null | { data: JSONResponse }>
Fetches an array of Botmock project resources using the fetcher
Botmock
import { Botmock } from "@botmock-api/client";
const client = new Botmock({ token: process.env.BOTMOCK_TOKEN });
client.getProject(opt): Promise<any>
Gets project from a teamId
and projectId
within opt
const project = await client.getProject({ teamId, projectId });
client.getTeam(teamId): Promise<any>
Gets team from a teamId
const team = await client.getTeam(teamId);
client.getBoard(opt): Promise<any>
Gets board data from a teamId
, projectId
and boardId
const board = await client.getBoard({ teamId, projectId, boardId });
client.getIntents(opt): Promise<any>
Gets all intents from a teamId
and projectId
const intents = await client.getIntents({ teamId, projectId });
client.getVariables(opt): Promise<any>
Gets all variables from a teamId
and projectId
const variables = await client.getVariables({ teamId, projectId });
client.getEntities(opt): Promise<any>
Gets all entities from a teamId
and projectId
const entities = await client.getEntities({ teamId, projectId });
Events containing errors and also successes can be listened to in the following ways.
const client = new Botmock({ token: process.env.BOTMOCK_TOKEN });
client.on("error", ({ error, endpoint }: { error: FetchError, endpoint: string }) => {
console.error(error, endpoint);
});
client.on("success", ({ endpoint, timestamp }: { endpoint: string, timestamp: number }) => {
console.error(endpoint, timestamp);
});
To test the package, simply enter the command below into the command line:
npm test
FAQs
nodejs client for interacting with the botmock api
The npm package @botmock-api/client receives a total of 16 weekly downloads. As such, @botmock-api/client popularity was classified as not popular.
We found that @botmock-api/client demonstrated a not healthy version release cadence and project activity because the last version was released 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
Corepack will be phased out from future Node.js releases following a TSC vote.
Research
Security News
Research uncovers Black Basta's plans to exploit package registries for ransomware delivery alongside evidence of similar attacks already targeting open source ecosystems.
Security News
Oxlint's beta release introduces 500+ built-in linting rules while delivering twice the speed of previous versions, with future support planned for custom plugins and improved IDE integration.