@salutejs/scenario
Advanced tools
Comparing version 0.6.0 to 0.7.0
@@ -121,6 +121,13 @@ "use strict"; | ||
}, | ||
setPronounceText: function (text) { | ||
setPronounceText: function (text, options) { | ||
if (options === void 0) { options = { ssml: false }; } | ||
if (message.messageName !== 'ANSWER_TO_USER') { | ||
throw new Error('Wrong message type'); | ||
} | ||
if (options.ssml) { | ||
if (!/^<speak>.*<\/speak>$/gi.test(text)) { | ||
text = '<speak>' + text + '</speak>'; | ||
} | ||
message.payload.pronounceTextType = 'application/ssml'; | ||
} | ||
message.payload.pronounceText = text; | ||
@@ -127,0 +134,0 @@ }, |
@@ -68,2 +68,9 @@ "use strict"; | ||
req.variant.slots.forEach(function (slot) { | ||
if (slot.array) { | ||
if (typeof req.variables[slot.name] === 'undefined') { | ||
req.setVariable(slot.name, []); | ||
} | ||
req.variables[slot.name].push(slot.value); | ||
return; | ||
} | ||
req.setVariable(slot.name, slot.value); | ||
@@ -70,0 +77,0 @@ }); |
import { SaluteRequest, ScenarioSchema } from '@salutejs/types'; | ||
export declare function createUserScenario<R extends SaluteRequest = SaluteRequest>(scenarioSchema: ScenarioSchema): { | ||
getByPath: (path: string[]) => { | ||
match: (req: SaluteRequest<Record<string, unknown>, import("@salutejs/types").AppState, { | ||
match: (req: SaluteRequest<Record<string, string>, import("@salutejs/types").AppState, { | ||
payload: unknown; | ||
@@ -9,3 +9,3 @@ type: string; | ||
schema?: string | undefined; | ||
handle: import("@salutejs/types").SaluteHandler<SaluteRequest<Record<string, unknown>, import("@salutejs/types").AppState, { | ||
handle: import("@salutejs/types").SaluteHandler<SaluteRequest<Record<string, string>, import("@salutejs/types").AppState, { | ||
payload: unknown; | ||
@@ -12,0 +12,0 @@ type: string; |
@@ -59,3 +59,3 @@ "use strict"; | ||
var _a; | ||
var result = re.exec((_a = req.message) === null || _a === void 0 ? void 0 : _a.original_text); | ||
var result = re.exec((_a = req.message) === null || _a === void 0 ? void 0 : _a.human_normalized_text); | ||
if (result === null) { | ||
@@ -62,0 +62,0 @@ return false; |
{ | ||
"name": "@salutejs/scenario", | ||
"version": "0.6.0", | ||
"version": "0.7.0", | ||
"description": "Tiny helpers to make scenario for Salute family", | ||
@@ -35,6 +35,6 @@ "author": "SberDevices Frontend Team <sberdevices.frontend@gmail.com>", | ||
"dependencies": { | ||
"@salutejs/types": "0.6.0", | ||
"@salutejs/types": "0.7.0", | ||
"node-fetch": "2.6.1" | ||
}, | ||
"gitHead": "6967e37ba23ba2afdc6333afa3bf0b27e8383b59" | ||
"gitHead": "825720db74b088d4f7e1123b0f34febb1afbfa82" | ||
} |
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
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
159630
1506
+ Added@salutejs/types@0.7.0(transitive)
- Removed@salutejs/types@0.6.0(transitive)
Updated@salutejs/types@0.7.0