Security News
CISA Brings KEV Data to GitHub
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
@botmock/export
Advanced tools
@botmock/export
Exports Botmock project data to development platform format.
npm install @botmock/export
import { DialogflowExporter } from "@botmock/export";
Previous standalone exporters were designed to transform your Botmock project directly into the format required by the end platform. The exporters included in the SDK, however, have been redesigned to be more granular and developer-friendly.
As opposed to being exclusively runnable as a Node.js script, the exporters are now available as individual classes in @botmock/export
.
They can be imported like:
import { DialogflowExporter } from "@botmock/export";
const exporter = new DialogflowExporter({
token: process.env.BOTMOCK_TOKEN,
});
The output of an exporter's export
method can be consumed by a method on FileWriter
.
Each class has an export
async public method, that takes a description of a project and outputs an object containing an unique id for the export, a timestamp, and a data object.
A data object is an object where keys are names of directories that contents of files should go into, and values are objects containing relevant filename
and data
describing what can utimately become file contents.
A project description is an object with the following signature:
export interface ProjectDescription<M, R = any> {
teamId: string;
projectId: string;
boardId?: string;
meta?: M;
apiResponse?: R;
}
This class, importable as:
import { FileWriter } from "@botmock/export";
has a public method writeAllResourcesToFile
on its instances, which takes an object containing key data, and value data object, and returns a result object describing the success or failure of the write.
const writer = new FileWriter({ dir: "../relative/path/to/desired/output/location" });
const { data } = await exporter.export({
teamId: process.env.TEAM_ID,
projectId: process.env.PROJECT_ID,
boardId: process.env.BOARD_ID,
});
const res = await writer.writeAllResourcesToFile({ data });
A successful write will contain a write summary in the value
property of the response, which is a string containing a relative path to the location of the successful write.
An object with the following signature:
interface Ok<V> {
kind: Kind.OK;
value: V;
}
interface Err<V> {
kind: Kind.ERR;
value: V;
}
export type Result<O, V> = Ok<O> | Err<V>;
The Result
is Ok
over a write summary in the case that there were no errors unpacking, or Err
over an Error
object in the case that there was an error.
An object with the following signature
{
bytesWritten: number;
location: string;
}
FAQs
## Overview
The npm package @botmock/export receives a total of 75 weekly downloads. As such, @botmock/export popularity was classified as not popular.
We found that @botmock/export 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
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.