@botmock-api/utils
Advanced tools
Comparing version 1.0.5 to 1.0.7
@@ -0,1 +1,3 @@ | ||
// import { createIntentMap } from "../src"; | ||
test.todo(".."); |
{ | ||
"name": "@botmock-api/utils", | ||
"version": "1.0.5", | ||
"version": "1.0.7", | ||
"description": "utilities for handling data from the Botmock API", | ||
"main": "index.js", | ||
"types": "index.d.ts", | ||
"main": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"scripts": { | ||
"test": "jest", | ||
"build": "babel --out-file index.js src/index.ts" | ||
"build": "tsc ./src/index.ts --outDir dist/", | ||
"prepublishOnly": "tsc ./src/index.ts --outDir dist/" | ||
}, | ||
@@ -35,8 +36,4 @@ "keywords": [ | ||
"devDependencies": { | ||
"@babel/cli": "7.4.4", | ||
"@babel/core": "7.4.5", | ||
"@babel/preset-typescript": "7.3.3", | ||
"@types/jest": "24.0.15", | ||
"@types/node": "12.0.8", | ||
"@types/node-fetch": "2.3.7", | ||
"jest": "24.8.0", | ||
@@ -43,0 +40,0 @@ "ts-jest": "^24.0.2", |
@@ -0,9 +1,21 @@ | ||
type Utterance = { | ||
text: string; | ||
variables: any[]; | ||
}; | ||
type Intent = { | ||
id: string; | ||
name: string; | ||
utterances: {}[]; | ||
utterances: Utterance[]; | ||
}; | ||
type NextMessage = { | ||
message_id: string; | ||
action: any; | ||
conditional: boolean; | ||
intent: { value: string }; | ||
}; | ||
type Message = { | ||
next_message_ids: { message_id: string; intent: { value: string } }[]; | ||
next_message_ids: NextMessage[]; | ||
}; | ||
@@ -30,7 +42,7 @@ | ||
return new Map<string, Intent[]>( | ||
messages.reduce( | ||
(acc, { next_message_ids }) => [ | ||
messages.reduce((acc, { next_message_ids }) => { | ||
return [ | ||
...acc, | ||
...next_message_ids | ||
.filter(({ intent }) => intent.value) | ||
.filter(({ intent = { value: "" } }) => intent.value) | ||
.map(message => [ | ||
@@ -58,6 +70,5 @@ message.message_id, | ||
]) | ||
], | ||
[] | ||
) | ||
]; | ||
}, []) | ||
); | ||
}; |
{ | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"lib": ["es2017", "es7", "es6"], | ||
"outDir": "dist", | ||
"declaration": true, | ||
"sourceMap": true, | ||
"allowJs": true, | ||
"allowUnreachableCode": false, | ||
"baseUrl": ".", | ||
"checkJs": true, | ||
"lib": ["esnext"], | ||
"module": "esnext", | ||
"moduleResolution": "node", | ||
"noImplicitReturns": true, | ||
"noFallthroughCasesInSwitch": true, | ||
"noUnusedLocals": true, | ||
"esModuleInterop": true, | ||
"preserveConstEnums": true, | ||
"pretty": true, | ||
"removeComments": true, | ||
"resolveJsonModule": true, | ||
"sourceMap": true, | ||
"strict": true, | ||
"esModuleInterop": true | ||
"target": "esnext", | ||
"types": [] | ||
}, | ||
"exclude": ["node_modules", "dist"] | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15386
6
11
197