0.1.6 • Published 4 years ago
@botmock/utils v0.1.6
Botmock
Monorepo for the Botmock SDK
Features
- Fetch project data
- Export projects into known platforms such as Bot Framework, Dialogflow, Watson, and Rasa
- Export projects into custom platforms
Packages
@botmock/clientpublic API client@botmock/exportplatform exporter@botmock/cliscaffolding CLI
Quickstart
Prerequisites
- Installation of LTS version of Node.js
Using the client package for simple data fetching
The first step is to install the package.
npm install @botmock/clientNext, bring the package into your Node.js program's scope.
// index.ts
import { Client } from "@botmock/client";The above Client class has method getResources which takes an object describing project resources to be fetched.
The options object contains the following.
| Key name | Type | Description |
|---|---|---|
| teamId | string | id of the team |
| projectId | string | id of the project |
| boardId | string | (optional) id of the board |
| resources | string[] | array of "project", "team", "board", "intents", "variables", or "entities" |
This promise resolves an object containing key, value pairs for each of resources.
Note: Tokens and ids are created and accessed using the Botmock dashboard
// index.ts
import { Client } from "@botmock/client";
const client = new Client({ token: process.env.TOKEN });
(async () => {
const { intents, project, board } = await client.getResources({
resources: ["intents", "project", "board"],
teamId: "424242",
projectId: "424242",
boardId: "424242",
});
})();Next Steps
To see more of what the SDK is capable of, see README.md in each of the directories in /packages.
Development
npm installnpm run bootstrapnpm run tsc