dialogflow: can optionally specify an environment

This commit is contained in:
Dave Horton
2021-01-13 21:21:26 -05:00
parent 2a8f165468
commit 63a00063c1
2 changed files with 3 additions and 1 deletions

View File

@@ -11,7 +11,8 @@ class Dialogflow extends Task {
this.preconditions = TaskPreconditions.Endpoint; this.preconditions = TaskPreconditions.Endpoint;
this.credentials = this.data.credentials; this.credentials = this.data.credentials;
this.project = this.data.project; if (this.data.environment) this.project = `${this.data.project}:${this.data.environment}`;
else this.project = this.data.project;
this.lang = this.data.lang || 'en-US'; this.lang = this.data.lang || 'en-US';
this.welcomeEvent = this.data.welcomeEvent || ''; this.welcomeEvent = this.data.welcomeEvent || '';
if (this.welcomeEvent.length && this.data.welcomeEventParams && typeof this.data.welcomeEventParams === 'object') { if (this.welcomeEvent.length && this.data.welcomeEventParams && typeof this.data.welcomeEventParams === 'object') {

View File

@@ -123,6 +123,7 @@
"properties": { "properties": {
"credentials": "object|string", "credentials": "object|string",
"project": "string", "project": "string",
"environment": "string",
"lang": "string", "lang": "string",
"actionHook": "object|string", "actionHook": "object|string",
"eventHook": "object|string", "eventHook": "object|string",