@twilio/autopilot-cli
Advanced tools
Comparing version 0.0.5 to 0.0.6
@@ -18,4 +18,3 @@ | ||
const client = await require('../lib/twilio-assistant/client')(profile), | ||
resource = await require('../lib/twilio-assistant/resource'); | ||
const client = await require('../lib/twilio-assistant/client')(profile); | ||
@@ -25,3 +24,3 @@ | ||
.assistants | ||
.list({ limit : resource.limit }).then((assistants) => { | ||
.list().then((assistants) => { | ||
@@ -28,0 +27,0 @@ let choices = []; |
@@ -16,4 +16,19 @@ const fs = require('fs'); | ||
} | ||
let assistant_Obj = { | ||
friendlyName: schema.uniqueName, | ||
uniqueName: schema.uniqueName, | ||
logQueries: true, | ||
}; | ||
if(schema.hasOwnProperty('defaults') && schema.defaults.hasOwnProperty('defaults')) | ||
assistant_Obj["defaults"] = schema.defaults; | ||
if(schema.hasOwnProperty('styleSheet') && schema.styleSheet.hasOwnProperty('styleSheet')) | ||
assistant_Obj["styleSheet"] = schema.styleSheet; | ||
return await Promise.resolve() | ||
//create new assistant | ||
@@ -23,9 +38,3 @@ .then(async () => { | ||
.assistants | ||
.create({ | ||
friendlyName: schema.uniqueName, | ||
uniqueName: schema.uniqueName, | ||
logQueries: true, | ||
defaults: schema.defaults, | ||
styleSheet: schema.styleSheet | ||
}) | ||
.create(assistant_Obj) | ||
}) | ||
@@ -36,11 +45,9 @@ | ||
if (err.message.includes("UniqueName already in use") || err.message.includes("Failed to create assistant "+schema.uniqueName)) { | ||
assistant_Obj.uniqueName = `${schema.uniqueName}-${Date.now()}`; | ||
assistant_Obj.friendlyName = `${schema.uniqueName}-${Date.now()}`; | ||
return client.autopilot | ||
.assistants | ||
.create({ | ||
friendlyName: `${schema.uniqueName}-${Date.now()}`, | ||
uniqueName: `${schema.uniqueName}-${Date.now()}`, | ||
logQueries: true, | ||
defaults: schema.defaults, | ||
styleSheet: schema.styleSheet | ||
}) | ||
.create(assistant_Obj) | ||
} | ||
@@ -47,0 +54,0 @@ }) |
{ | ||
"name": "@twilio/autopilot-cli", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"bin": { | ||
@@ -5,0 +5,0 @@ "ta": "./bin/cli.js" |
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
93307
2894