New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@botmock/export

Package Overview
Dependencies
Maintainers
5
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@botmock/export - npm Package Compare versions

Comparing version 0.6.0 to 0.7.0

1

lib/dialogflow/index.js

@@ -374,3 +374,2 @@ "use strict";

catch (_a) { }
assert_1.notDeepEqual(platformNames, []);
}

@@ -377,0 +376,0 @@ return platformNames;

1

lib/types/index.d.ts

@@ -14,2 +14,3 @@ import { JSONResponse } from "@botmock/client";

export declare enum Ext {
LG = ".lg",
JSON = ".json",

@@ -16,0 +17,0 @@ YAML = ".yml",

@@ -18,2 +18,3 @@ "use strict";

(function (Ext) {
Ext["LG"] = ".lg";
Ext["JSON"] = ".json";

@@ -20,0 +21,0 @@ Ext["YAML"] = ".yml";

@@ -22,3 +22,3 @@ "use strict";

};
var _jsonWriteOptions, _directoryRoot, _createWriteResult, _transformMd, _transformYml, _unpackResource;
var _jsonWriteOptions, _directoryRoot, _createWriteResult, _transformMd, _transformLg, _transformYml, _unpackResource;
Object.defineProperty(exports, "__esModule", { value: true });

@@ -72,5 +72,6 @@ const yaml_1 = require("yaml");

});
_transformMd.set(this, (data) => {
_transformMd.set(this, (data, options) => {
let MD;
(function (MD) {
MD["H1"] = "#";
MD["H2"] = "##";

@@ -91,5 +92,10 @@ MD["L1"] = "*";

}
return `${str}${os_1.EOL}${MD.H2} ${key}${os_1.EOL}${values}`;
const hash = (options === null || options === void 0 ? void 0 : options.shouldUseH1) ? MD.H1 : MD.H2;
return `${str}${os_1.EOL}${hash} ${key}${os_1.EOL}${values}`;
}, "");
});
_transformLg.set(this, (data) => {
const raw = __classPrivateFieldGet(this, _transformMd).call(this, data, { shouldUseH1: true });
return raw;
});
_transformYml.set(this, (data) => {

@@ -117,2 +123,5 @@ return yaml_1.stringify(data).split(os_1.EOL).reduce((str, line) => {

break;
case types_1.Ext.LG:
await fs_extra_1.writeFile(path, __classPrivateFieldGet(this, _transformLg).call(this, data), { encoding: "utf8" });
break;
}

@@ -177,3 +186,3 @@ const { size } = await fs_extra_1.stat(path);

exports.FileWriter = FileWriter;
_jsonWriteOptions = new WeakMap(), _directoryRoot = new WeakMap(), _createWriteResult = new WeakMap(), _transformMd = new WeakMap(), _transformYml = new WeakMap(), _unpackResource = new WeakMap();
_jsonWriteOptions = new WeakMap(), _directoryRoot = new WeakMap(), _createWriteResult = new WeakMap(), _transformMd = new WeakMap(), _transformLg = new WeakMap(), _transformYml = new WeakMap(), _unpackResource = new WeakMap();
//# sourceMappingURL=index.js.map
{
"name": "@botmock/export",
"version": "0.6.0",
"version": "0.7.0",
"description": "",

@@ -36,3 +36,3 @@ "contributors": [

"dependencies": {
"@botmock/client": "0.1.3",
"@botmock/client": "^0.2.0",
"@sentry/node": "^5.17.0",

@@ -45,3 +45,3 @@ "@types/fs-extra": "^9.0.0",

"node-fetch": "2.6.0",
"uuid": "8.1.0",
"uuid": "8.2.0",
"yaml": "^1.9.2"

@@ -52,6 +52,6 @@ },

"@types/jest": "25.2.3",
"jest": "26.0.1",
"jest": "26.1.0",
"pascal-case": "3.1.1",
"ts-jest": "26.1.0"
"ts-jest": "26.1.1"
}
}

@@ -7,8 +7,6 @@ # Platforms

> **Note**: This package works best in a **[TypeScript](https://www.typescriptlang.org/v2/) environment**. You can bootstrap one by running `npx @botmock/cli` and following the wizard.
> **Note**: This package works best in a **[TypeScript](https://www.typescriptlang.org/v2/) environment**. You can bootstrap one by running `npx @botmock/cli` and following the wizard. If you are not yet familiar with TypeScript, visit [the docs](https://www.typescriptlang.org/v2/docs/handbook/typescript-from-scratch.html) to learn more.
## Dialogflow
> **Note**: if you've used `npx @botmock/cli` remember to run `npm install`.
Dialogflow expects a `.zip` file which contains a directory structure of `.json` files.

@@ -132,4 +130,2 @@

> **Note**: if you've used `npx @botmock/cli` remember to run `npm install`.
Lex expects a `.zip` file which contains a `.json` file.

@@ -185,3 +181,3 @@

{
"description": "98e7cd89-2781-467e-912d-13ed64b24eaa",
"description": "d0d3886f-1cca-4719-a69a-4dbf3531cfd2",
"name": "begin",

@@ -217,3 +213,3 @@ "version": "2",

{
"description": "3070d958-f765-4a62-88a0-bb9c10856e33",
"description": "55bda384-227d-4d36-b596-b4ec16571e2f",
"name": "one",

@@ -249,3 +245,3 @@ "version": "2",

{
"description": "50bc923e-f235-42c7-b9e0-706b06fccd7e",
"description": "f5c48855-1cc0-4259-be20-4d3941e79d95",
"name": "second_intent",

@@ -321,3 +317,3 @@ "version": "2",

"idleSessionTTLInSeconds": 800,
"description": "6/3/2020",
"description": "6/19/2020",
"clarificationPrompt": {

@@ -343,3 +339,2 @@ "messages": [

```

@@ -349,4 +344,2 @@

> **Note**: if you've used `npx @botmock/cli` remember to run `npm install`.
Luis expects a `.json` file.

@@ -402,2 +395,5 @@

"name": "one"
},
{
"name": "second_intent"
}

@@ -433,2 +429,13 @@ ],

"entities": []
},
{
"text": "give ReservationPersonsNumber",
"intent": "second_intent",
"entities": [
{
"entity": "ReservationPersonsNumber",
"startPos": 5,
"endPos": 28
}
]
}

@@ -442,4 +449,2 @@ ]

> **Note**: if you've used `npx @botmock/cli` remember to run `npm install`.
> **Note**: this guide assumes a local installation of the [Rasa CLI](https://rasa.com/docs/rasa/user-guide/installation/)

@@ -483,5 +488,7 @@

```yaml
intents:
- begin
- one
- second_intent

@@ -495,4 +502,8 @@ actions:

- ReservationPersonsNumber
slots: []
slots:
- ReservationPersonsNumber:
type: text
initial_value: null
templates:

@@ -505,3 +516,5 @@ utter_first_block:

utter_response_block:
text: Says!
buttons:
- title: Button
payload: Button

@@ -512,4 +525,2 @@ ```

> **Note**: if you've used `npx @botmock/cli` remember to run `npm install`.
Skills kit expects a single `.json` file.

@@ -589,2 +600,9 @@

"slots": []
},
{
"name": "second_intent",
"samples": [
"give {ReservationPersonsNumber}"
],
"slots": []
}

@@ -619,3 +637,27 @@ ],

]
}
},
"dialog": {
"delegationStrategy": "SKILL_RESPONSE",
"intents": [
{
"name": "second_intent",
"delegationStrategy": "ALWAYS",
"confirmationRequired": false,
"elicitationRequired": true,
"prompts": {},
"slots": []
}
]
},
"prompts": [
{
"id": "Elicit.Slot.351530ec-cfd3-4913-b793-9ee7fe228407",
"variations": [
{
"type": "PlainText",
"value": "missing persons!"
}
]
}
]
}

@@ -627,4 +669,2 @@

> **Note**: if you've used `npx @botmock/cli` remember to run `npm install`.
Watson expects a single `.json` file.

@@ -689,2 +729,11 @@

"description": "2020-05-04 14:54:42.000000"
},
{
"intent": "second_intent",
"examples": [
{
"text": "give %ReservationPersonsNumber%"
}
],
"description": "2020-06-03 15:08:15.000000"
}

@@ -789,2 +838,28 @@ ],

"dialog_node": "52611df2-7216-4c0c-94bf-3707b08eda4b"
},
{
"type": "standard",
"output": {
"generic": [
{
"title": "Your text goes here...",
"response_type": "option",
"options": [
{
"label": "Button",
"value": {
"input": {
"text": "Button"
}
}
}
]
}
]
},
"parent": "52611df2-7216-4c0c-94bf-3707b08eda4b",
"context": {},
"metadata": {},
"conditions": "second_intent",
"dialog_node": "7e236f12-d02a-4eac-8939-1221533baa4c"
}

@@ -791,0 +866,0 @@ ],

@@ -22,10 +22,8 @@ # `@botmock/export`

> **Note**: migrating from standalone exporters
### **Note**: migrating from standalone exporters
> The previous exporters were designed to transform your Botmock project directly into the format required by the end platform by cloning a particular repository, running `npm install` and then `npm start`.
> The [previous exporters]() were designed to transform your Botmock project directly into the format required by the end platform by cloning a particular repository, running `npm install` and then `npm start`. `@botmock/export`, however, has been **redesigned to be more granular and developer-friendly**. Let's see what this means.
> `@botmock/export`, however, it has been **redesigned to be more granular and developer-friendly**.
---
> Let's see what this means.
This short example shows how to use the included `DialogflowExporter` to export data from a specific Botmock project to the Dialogflow platform.

@@ -59,3 +57,3 @@

*/
async function main(args: string[]): Promise<void> {
async function main(): Promise<void> {
const exporter = new DialogflowExporter({ token: process.env.TOKEN as string });

@@ -68,8 +66,6 @@ const { data } = await exporter.exportProjectUnderDataTransformations({ projectReference });

console.log(writeResult.value);
} else {
console.error(writeResult.value);
}
}
main(process.argv.slice(2)).catch((err: Error) => {
main().catch((err: Error) => {
console.error(err);

@@ -81,3 +77,3 @@ });

What if you are targeting a platform that is not included in the stock exporters?
What if you are targeting a **platform that is not included in the stock exporters**?

@@ -88,3 +84,3 @@ `BaseExporter` is available on `@botmock/export` for this reason.

Create a new file "./exporter.ts", and enter the following.
Create a new file "./exporter.ts", and add the following.

@@ -95,3 +91,3 @@ ```typescript

Imagine we have our own platform called "Flatland".
Imagine we have our own platform called "Flatland", and imagine this platform describes projects via a `.yml` file and `.json` file.

@@ -125,94 +121,491 @@ We would like to integrate data from Botmock into it.

```typescript
```json
{
intents: [
"intents": [
{
id: '6ef70cd0-9c20-11ea-9d3b-91ab6dd1aa2f',
name: 'begin',
utterances: [Object],
created_at: [Object],
updated_at: [Object],
is_global: false,
slots: []
"id": "6ef70cd0-9c20-11ea-9d3b-91ab6dd1aa2f",
"name": "begin",
"utterances": {
"en": [
{
"text": "hi",
"variables": []
}
]
},
"created_at": {
"date": "2020-05-22 11:36:10.000000",
"timezone_type": 3,
"timezone": "UTC"
},
"updated_at": {
"date": "2020-05-22 11:36:10.000000",
"timezone_type": 3,
"timezone": "UTC"
},
"is_global": false,
"slots": []
},
{
id: '2ff08a20-8e17-11ea-9af2-3b66755d0983',
name: 'one',
utterances: [Object],
created_at: [Object],
updated_at: [Object],
is_global: false,
slots: []
"id": "2ff08a20-8e17-11ea-9af2-3b66755d0983",
"name": "one",
"utterances": {
"en": [
{
"text": "one",
"variables": []
}
]
},
"created_at": {
"date": "2020-05-04 14:54:42.000000",
"timezone_type": 3,
"timezone": "UTC"
},
"updated_at": {
"date": "2020-05-04 14:54:42.000000",
"timezone_type": 3,
"timezone": "UTC"
},
"is_global": false,
"slots": []
},
{
"id": "0c900ab0-a5ac-11ea-b102-696fc338cf15",
"name": "second_intent",
"utterances": {
"en": [
{
"text": "give %ReservationPersonsNumber%",
"variables": [
{
"id": "fe1c9ed0-8e0e-11ea-a54c-35dc7cb8db58",
"name": "%ReservationPersonsNumber%",
"type": "int",
"entity": "d9e693a0-4455-11ea-b208-ab55d7896de3",
"default_value": "",
"start_index": 5
}
]
}
]
},
"created_at": {
"date": "2020-06-03 15:08:15.000000",
"timezone_type": 3,
"timezone": "UTC"
},
"updated_at": {
"date": "2020-06-03 15:08:15.000000",
"timezone_type": 3,
"timezone": "UTC"
},
"is_global": false,
"slots": [
{
"id": "f0256a7b-600a-45a1-a818-9fadadce0ae4",
"variable_id": "fe1c9ed0-8e0e-11ea-a54c-35dc7cb8db58",
"is_required": true,
"prompt": "missing persons!"
}
]
}
],
entities: [
"entities": [
{
id: 'fe1a7800-8e0e-11ea-b472-e3ecdf3932f8',
name: 'DinnerOrLunch',
data: [Object],
created_at: [Object],
updated_at: [Object]
"id": "fe1a7800-8e0e-11ea-b472-e3ecdf3932f8",
"name": "DinnerOrLunch",
"data": {
"en": [
{
"value": "dinner",
"synonyms": []
},
{
"value": "lunch",
"synonyms": []
}
]
},
"created_at": {
"date": "2020-05-04 13:56:03.000000",
"timezone_type": 3,
"timezone": "UTC"
},
"updated_at": {
"date": "2020-05-04 13:56:03.000000",
"timezone_type": 3,
"timezone": "UTC"
}
},
{
id: 'fe1e56d0-8e0e-11ea-8a1a-45ca961859cb',
name: 'ReservationPersonsNumber',
data: [Object],
created_at: [Object],
updated_at: [Object]
"id": "fe1e56d0-8e0e-11ea-8a1a-45ca961859cb",
"name": "ReservationPersonsNumber",
"data": {
"en": [
{
"value": "42",
"synonyms": []
}
]
},
"created_at": {
"date": "2020-05-04 13:56:03.000000",
"timezone_type": 3,
"timezone": "UTC"
},
"updated_at": {
"date": "2020-05-04 13:56:03.000000",
"timezone_type": 3,
"timezone": "UTC"
}
}
],
variables: [
"variables": [
{
id: 'fe17b400-8e0e-11ea-89b9-93f612e81ac2',
name: 'DinnerOrLunch',
default_value: 'dinner',
type: 'text',
entity: 'f62f1e60-4455-11ea-ae09-b7ba8a9ae270',
created_at: [Object],
updated_at: [Object]
"id": "fe17b400-8e0e-11ea-89b9-93f612e81ac2",
"name": "DinnerOrLunch",
"default_value": "dinner",
"type": "text",
"entity": "f62f1e60-4455-11ea-ae09-b7ba8a9ae270",
"created_at": {
"date": "2020-05-04 13:56:03.000000",
"timezone_type": 3,
"timezone": "UTC"
},
"updated_at": {
"date": "2020-05-04 13:56:03.000000",
"timezone_type": 3,
"timezone": "UTC"
}
},
{
id: 'fe1c9ed0-8e0e-11ea-a54c-35dc7cb8db58',
name: 'ReservationPersonsNumber',
default_value: '',
type: 'int',
entity: 'd9e693a0-4455-11ea-b208-ab55d7896de3',
created_at: [Object],
updated_at: [Object]
"id": "fe1c9ed0-8e0e-11ea-a54c-35dc7cb8db58",
"name": "ReservationPersonsNumber",
"default_value": "",
"type": "int",
"entity": "d9e693a0-4455-11ea-b208-ab55d7896de3",
"created_at": {
"date": "2020-05-04 13:56:03.000000",
"timezone_type": 3,
"timezone": "UTC"
},
"updated_at": {
"date": "2020-05-04 13:56:03.000000",
"timezone_type": 3,
"timezone": "UTC"
}
}
],
project: {
id: '8d550c20-8d3a-11ea-aa4e-5f57749d4d32',
name: 'basic',
type: 'flow',
platform: 'multi-channel',
channels: [ 'generic' ],
locales: [ 'en' ],
created_at: {
date: '2020-05-03 12:35:20.000000',
timezone_type: 3,
timezone: 'UTC'
"project": {
"id": "8d550c20-8d3a-11ea-aa4e-5f57749d4d32",
"name": "basic",
"type": "flow",
"platform": "multi-channel",
"channels": [
"google-actions",
"generic"
],
"locales": [
"en",
"es"
],
"created_at": {
"date": "2020-05-03 12:35:20.000000",
"timezone_type": 3,
"timezone": "UTC"
},
updated_at: {
date: '2020-05-28 15:02:13.000000',
timezone_type: 3,
timezone: 'UTC'
"updated_at": {
"date": "2020-06-17 13:28:26.000000",
"timezone_type": 3,
"timezone": "UTC"
}
},
board: {
board: { root_messages: [Array], messages: [Array] },
slots: {
'6ef70cd0-9c20-11ea-9d3b-91ab6dd1aa2f': [],
'2ff08a20-8e17-11ea-9af2-3b66755d0983': []
"board": {
"board": {
"root_messages": [
"8d585900-8d3a-11ea-b32a-67229b391039"
],
"messages": [
{
"message_id": "8d585900-8d3a-11ea-b32a-67229b391039",
"message_type": "response",
"next_message_ids": [
{
"message_id": "0ac39c3f-ebfe-4f31-8ec9-a551395e4d6b",
"action": "*",
"intent": {
"label": "begin",
"value": "6ef70cd0-9c20-11ea-9d3b-91ab6dd1aa2f"
},
"conditional": {
"id": "g-V7kpFszuWdt8q_wdDnXor",
"rules": [],
"combinator": "and",
"not": false
}
}
],
"previous_message_ids": [],
"is_root": true,
"node_name": "Starting Point",
"payload": {
"en": {
"generic": {
"blocks": []
}
}
}
},
{
"message_id": "0ac39c3f-ebfe-4f31-8ec9-a551395e4d6b",
"message_type": "response",
"next_message_ids": [
{
"message_id": "52611df2-7216-4c0c-94bf-3707b08eda4b",
"action": "*",
"intent": {
"label": "one",
"value": "2ff08a20-8e17-11ea-9af2-3b66755d0983"
},
"conditional": {
"id": "g-CSNPKr7MiwLxfeUMUdb3A",
"rules": [],
"combinator": "and",
"not": false
}
}
],
"previous_message_ids": [
{
"message_id": "8d585900-8d3a-11ea-b32a-67229b391039",
"action": "*"
}
],
"is_root": false,
"node_name": "First block",
"payload": {
"en": {
"generic": {
"blocks": [
{
"component_type": "text",
"nodeName": "Bot Says",
"context": [],
"text": "one thing",
"audio_file": "",
"ssml": "",
"delay": 2000,
"alternate_replies": [
"another thing"
]
},
{
"component_type": "text",
"nodeName": "Bot Says",
"context": [],
"text": "one more thing!",
"audio_file": "",
"ssml": "",
"delay": 2000
},
{
"component_type": "button",
"nodeName": "Button",
"context": [],
"text": "one",
"buttons": [
{
"type": "postback",
"title": "one",
"payload": "ONE"
}
],
"audio_file": "",
"ssml": "",
"delay": 2000,
"nextMessagesIds": []
}
]
}
}
}
},
{
"message_id": "52611df2-7216-4c0c-94bf-3707b08eda4b",
"message_type": "response",
"next_message_ids": [
{
"message_id": "7e236f12-d02a-4eac-8939-1221533baa4c",
"action": "*",
"intent": {
"label": "second_intent",
"value": "0c900ab0-a5ac-11ea-b102-696fc338cf15"
},
"conditional": {
"id": "g-P6xjtHxlyKJ6wHjN8FLYw",
"rules": [],
"combinator": "and",
"not": false
}
}
],
"previous_message_ids": [
{
"message_id": "0ac39c3f-ebfe-4f31-8ec9-a551395e4d6b",
"action": "*"
}
],
"is_root": false,
"node_name": "Response block",
"payload": {
"en": {
"generic": {
"blocks": [
{
"component_type": "text",
"nodeName": "Bot Says",
"context": [],
"text": "Says!",
"audio_file": "",
"ssml": "",
"delay": 2000
}
]
},
"google-actions": {
"blocks": [
{
"component_type": "text",
"nodeName": "Bot Says",
"text": "Your text here",
"buttons": [],
"ssml": "",
"audio_file": "",
"delay": 2000
},
{
"component_type": "card",
"nodeName": "Card",
"image_url": "https://app.botmock.com/img/placeholder.png",
"title": "This is your card title",
"subtitle": "",
"text": "This is the body of the card.",
"link": "",
"ssml": "",
"audio_file": "",
"delay": 2000
}
]
}
}
}
},
{
"message_id": "7e236f12-d02a-4eac-8939-1221533baa4c",
"message_type": "response",
"next_message_ids": [],
"previous_message_ids": [
{
"message_id": "52611df2-7216-4c0c-94bf-3707b08eda4b",
"action": "*"
}
],
"is_root": false,
"node_name": "Response block",
"payload": {
"en": {
"google-actions": {
"blocks": []
},
"generic": {
"blocks": [
{
"component_type": "quick_replies",
"nodeName": "Quick Replies",
"text": "Your text goes here...",
"quick_replies": [
{
"content_type": "text",
"title": "Button",
"image_url": "",
"payload": "BUTTON"
}
],
"audio_file": "",
"ssml": "",
"delay": 2000
}
]
}
},
"es": {
"google-actions": {
"blocks": []
},
"generic": {
"blocks": []
}
}
}
}
]
},
variables: [ [Object], [Object] ],
created_at: {
date: '2020-05-03 12:35:20.000000',
timezone_type: 3,
timezone: 'UTC'
"slots": {
"6ef70cd0-9c20-11ea-9d3b-91ab6dd1aa2f": [],
"2ff08a20-8e17-11ea-9af2-3b66755d0983": [],
"0c900ab0-a5ac-11ea-b102-696fc338cf15": [
{
"id": "f0256a7b-600a-45a1-a818-9fadadce0ae4",
"variable_id": "fe1c9ed0-8e0e-11ea-a54c-35dc7cb8db58",
"is_required": true,
"prompt": "missing persons!"
}
]
},
updated_at: {
date: '2020-05-28 15:02:12.000000',
timezone_type: 3,
timezone: 'UTC'
"variables": [
{
"id": "fe17b400-8e0e-11ea-89b9-93f612e81ac2",
"name": "DinnerOrLunch",
"default_value": "dinner",
"type": "text",
"entity": "f62f1e60-4455-11ea-ae09-b7ba8a9ae270",
"created_at": {
"date": "2020-05-04 13:56:03.000000",
"timezone_type": 3,
"timezone": "UTC"
},
"updated_at": {
"date": "2020-05-04 13:56:03.000000",
"timezone_type": 3,
"timezone": "UTC"
}
},
{
"id": "fe1c9ed0-8e0e-11ea-a54c-35dc7cb8db58",
"name": "ReservationPersonsNumber",
"default_value": "",
"type": "int",
"entity": "d9e693a0-4455-11ea-b208-ab55d7896de3",
"created_at": {
"date": "2020-05-04 13:56:03.000000",
"timezone_type": 3,
"timezone": "UTC"
},
"updated_at": {
"date": "2020-05-04 13:56:03.000000",
"timezone_type": 3,
"timezone": "UTC"
}
}
],
"created_at": {
"date": "2020-05-03 12:35:20.000000",
"timezone_type": 3,
"timezone": "UTC"
},
"updated_at": {
"date": "2020-06-17 13:28:11.000000",
"timezone_type": 3,
"timezone": "UTC"
}

@@ -337,3 +730,5 @@ }

"mlMinConfidence": 0.3,
"supportedLanguages": [],
"supportedLanguages": [
"es"
],
"onePlatformApiVersion": "v2",

@@ -492,3 +887,3 @@ "analyzeQueryTextSentiment": false,

{
"id": "2defbb68-eb41-475e-91b7-d2fc88c81563",
"id": "ed59bc6f-b208-42a8-bbaa-253747941ee1",
"data": [

@@ -505,3 +900,3 @@ {

{
"id": "e9cb633f-9c60-4cd3-a1f7-27b02ab1483a",
"id": "f22e3a1d-c811-4838-8c54-74e7539c0cbb",
"data": [

@@ -539,3 +934,9 @@ {

"action": "input.welcome",
"affectedContexts": [],
"affectedContexts": [
{
"name": "second_intent",
"parameters": {},
"lifespan": 5
}
],
"parameters": [],

@@ -548,2 +949,25 @@ "messages": [

"speech": "Says!"
},
{
"type": "simple_response",
"lang": "en",
"condition": "",
"textToSpeech": "Your text here"
},
{
"type": 4,
"lang": "en",
"condition": "",
"payload": {
"component_type": "card",
"nodeName": "Card",
"image_url": "https://app.botmock.com/img/placeholder.png",
"title": "This is your card title",
"subtitle": "",
"text": "This is the body of the card.",
"link": "",
"ssml": "",
"audio_file": "",
"delay": 2000
}
}

@@ -566,3 +990,3 @@ ],

{
"id": "32a1bfef-77e2-4ad2-b0e0-7432520d114b",
"id": "aa82f86e-82a0-42e9-b330-47868471c263",
"data": [

@@ -579,3 +1003,3 @@ {

{
"id": "741ea8e0-fa85-4eb3-9430-85796d1efbe2",
"id": "0be85546-26f3-4539-b490-bb12d3f5ece2",
"data": [

@@ -594,2 +1018,99 @@ {

]
},
{
"filenames": [
"second_intent.json",
"second_intent_usersays_en.json"
],
"data": [
{
"id": "7e236f12-d02a-4eac-8939-1221533baa4c",
"name": "second_intent",
"auto": true,
"contexts": [
"second_intent",
"one",
"begin"
],
"responses": [
{
"resetContexts": false,
"action": "input.welcome",
"affectedContexts": [],
"parameters": [
{
"id": "fe1c9ed0-8e0e-11ea-a54c-35dc7cb8db58",
"required": false,
"name": "ReservationPersonsNumber",
"value": "$",
"promptMessages": [],
"noMatchPromptMessages": [],
"outputDialogContexts": [],
"isList": false
}
],
"messages": [
{
"type": 4,
"lang": "en",
"condition": "",
"payload": {
"component_type": "quick_replies",
"nodeName": "Quick Replies",
"text": "Your text goes here...",
"quick_replies": [
{
"content_type": "text",
"title": "Button",
"image_url": "",
"payload": "BUTTON"
}
],
"audio_file": "",
"ssml": "",
"delay": 2000
}
}
],
"defaultResponsePlatforms": {},
"speech": []
}
],
"priority": 5000,
"webhookUsed": false,
"webhookForSlotFilling": false,
"fallbackIntent": false,
"events": [],
"conditionalResponses": [],
"condition": "",
"conditionalFollowupEvents": []
},
[
{
"id": "cad355d2-20bb-44b8-9fa4-0531d1307ea5",
"data": [
{
"text": "hi",
"userDefined": false
}
],
"isTemplate": false,
"count": 0,
"updated": 0
},
{
"id": "baf89010-c0d5-4159-a162-651b7a31aac2",
"data": [
{
"text": "give $ReservationPersonsNumber",
"userDefined": false
}
],
"isTemplate": false,
"count": 0,
"updated": 0,
"isAuto": false
}
]
]
}

@@ -596,0 +1117,0 @@ ]

@@ -1,2 +0,2 @@

import { notDeepEqual, notStrictEqual, strictEqual } from "assert";
import { notStrictEqual, strictEqual } from "assert";
import { v4 } from "uuid";

@@ -120,4 +120,2 @@ import BaseExporter from '../base-exporter';

* @param blocks {@link Botmock.Responses} Responses per platform per language
* @todo Assert message combinations are legal
* @todo Support google actions
*/

@@ -414,3 +412,2 @@ #mapResponsesToMessages = (responseData: Botmock.Responses): Dialogflow.Message[] => {

} catch { }
notDeepEqual(platformNames, []);
}

@@ -417,0 +414,0 @@ return platformNames;

@@ -17,2 +17,3 @@ import { JSONResponse } from "@botmock/client";

export enum Ext {
LG = ".lg",
JSON = ".json",

@@ -19,0 +20,0 @@ YAML = ".yml",

@@ -41,3 +41,9 @@ import { stringify } from "yaml";

interface Config {
/**
* Path that shoud be considered root directory of all generated files.
*/
directoryRoot?: string;
/**
* {@link https://github.com/jprichardson/node-fs-extra/blob/master/docs/writeJson.md Options} that can be passed to the inner write methods.
*/
jsonWriteOptions?: WriteOptions;

@@ -134,4 +140,5 @@ }

*/
#transformMd = <T = LowLevelAsset<any>["data"]>(data: T): string => {
#transformMd = <T = LowLevelAsset<any>["data"]>(data: T, options?: { shouldUseH1: boolean; }): string => {
enum MD {
H1 = "#",
H2 = "##",

@@ -153,6 +160,15 @@ L1 = "*",

}
return `${str}${EOL}${MD.H2} ${key}${EOL}${values}`;
const hash = options?.shouldUseH1 ? MD.H1 : MD.H2;
return `${str}${EOL}${hash} ${key}${EOL}${values}`;
}, "");
};
/**
* Transforms lg representation to actual file contents
* @param data Object representation of lg file contents
*/
#transformLg = <T = LowLevelAsset<any>["data"]>(data: T): string => {
const raw = this.#transformMd(data, { shouldUseH1: true });
return raw;
};
/**
* Transforms yml representation to actual file contents

@@ -191,2 +207,5 @@ * @param data Object representation of yml file contents

break;
case Ext.LG:
await writeFile(path, this.#transformLg(data), { encoding: "utf8" });
break;
}

@@ -193,0 +212,0 @@ const { size } = await stat(path);

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc