create-snips-action-typescript
Advanced tools
Comparing version 0.1.3 to 0.1.4
{ | ||
"name": "create-snips-action-typescript", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "Generator for writing Snips action code in Typescript.", | ||
@@ -5,0 +5,0 @@ "main": "script.js", |
@@ -6,3 +6,3 @@ import { configFactory, i18nFactory, httpFactory } from './factories' | ||
export default async function (bootstrapOptions: {[key: string]: any}) { | ||
configFactory.init() | ||
configFactory.init(bootstrapOptions.config) | ||
const config = configFactory.get() | ||
@@ -9,0 +9,0 @@ const language = LANGUAGE_MAPPINGS[config.locale] |
@@ -10,3 +10,3 @@ import fs from 'fs' | ||
function init () { | ||
function init (configOptions = { mock: {}}) { | ||
try { | ||
@@ -20,3 +20,4 @@ // Get the config file. | ||
...config, | ||
...camelize.camelizeKeys(iniConfig[section]) | ||
...camelize.camelizeKeys(iniConfig[section]), | ||
...(configOptions.mock || {}) | ||
} | ||
@@ -23,0 +24,0 @@ } |
@@ -5,2 +5,3 @@ import { getPokemon } from '../api' | ||
import { Handler } from './index' | ||
import { NluSlot, slotType } from 'hermes-javascript' | ||
@@ -11,3 +12,3 @@ export const pokemonHandler: Handler = async function (msg, flow) { | ||
// We discard slots with a confidence value too low. | ||
const pokemonSlot = message.getSlotsByName(msg, 'pokemon_id', { onlyMostConfident: true, threshold: 0.5 }) | ||
const pokemonSlot: NluSlot<slotType.custom> = message.getSlotsByName(msg, 'pokemon_id', { onlyMostConfident: true, threshold: 0.5 }) | ||
@@ -14,0 +15,0 @@ // We need this slot, so if the slot had a low confidence or was not mark as required, |
@@ -42,2 +42,7 @@ /* eslint no-console: off */ | ||
mock: require('../httpMocks').mock(fetchMock.sandbox()) | ||
}, | ||
config: { | ||
mock: { | ||
locale: 'english' | ||
} | ||
} | ||
@@ -44,0 +49,0 @@ } |
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
29845
687