Skip to content
This repository has been archived by the owner on Feb 14, 2019. It is now read-only.

Commit

Permalink
Merge pull request #49 from watson-developer-cloud/regenerate-sdk-rel…
Browse files Browse the repository at this point in the history
…ease-10

Regenerate sdk release 10
  • Loading branch information
dpopp07 authored Nov 7, 2018
2 parents e132305 + 4681e3f commit a07b3fb
Show file tree
Hide file tree
Showing 205 changed files with 1,560 additions and 7,054 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"extend": "^3.0.1",
"json-loader": "~0.5.7",
"jsonlint": "^1.6.3",
"watson-developer-cloud": "~3.11.1",
"watson-developer-cloud": "~3.13.0",
"vcap_services": "0.6.0"
},
"devDependencies": {
Expand Down
35 changes: 2 additions & 33 deletions packages/assistant-v1/actions/create-counterexample.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

const AssistantV1 = require('watson-developer-cloud/assistant/v1');
const extend = require('extend');
const vcap = require('vcap_services');

/**
* Create counterexample.
Expand Down Expand Up @@ -44,7 +45,7 @@ const extend = require('extend');
*/
function main(params) {
return new Promise((resolve, reject) => {
const _params = getParams(params, 'conversation');
const _params = vcap.getCredentialsFromServiceBind(params, 'conversation');
_params.headers = extend(
{},
_params.headers,
Expand All @@ -67,37 +68,5 @@ function main(params) {
});
}


/**
* Helper function used to authenticate credentials bound to package using wsk service bind
*
* @param {Object} theParams - parameters sent to service
* @param {string} service - name of service in bluemix used to retrieve credentials, used for IAM instances
*/
function getParams(theParams, service) {
if (Object.keys(theParams).length === 0) {
return theParams;
}
let bxCreds;
// Code that checks parameters bound using service bind
if (theParams.__bx_creds) {
// If user has instance of service
if (theParams.__bx_creds[service]) {
bxCreds = theParams.__bx_creds[service];
} else {
// User has no instances of service
bxCreds = {};
}
} else {
bxCreds = {};
}
const _params = Object.assign({}, bxCreds, theParams);
if (_params.apikey) {
_params.iam_apikey = _params.apikey;
delete _params.apikey;
}
delete _params.__bx_creds;
return _params;
}
global.main = main;
module.exports.test = main;
35 changes: 2 additions & 33 deletions packages/assistant-v1/actions/create-dialog-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

const AssistantV1 = require('watson-developer-cloud/assistant/v1');
const extend = require('extend');
const vcap = require('vcap_services');

/**
* Create dialog node.
Expand Down Expand Up @@ -68,7 +69,7 @@ const extend = require('extend');
*/
function main(params) {
return new Promise((resolve, reject) => {
const _params = getParams(params, 'conversation');
const _params = vcap.getCredentialsFromServiceBind(params, 'conversation');
_params.headers = extend(
{},
_params.headers,
Expand All @@ -91,37 +92,5 @@ function main(params) {
});
}


/**
* Helper function used to authenticate credentials bound to package using wsk service bind
*
* @param {Object} theParams - parameters sent to service
* @param {string} service - name of service in bluemix used to retrieve credentials, used for IAM instances
*/
function getParams(theParams, service) {
if (Object.keys(theParams).length === 0) {
return theParams;
}
let bxCreds;
// Code that checks parameters bound using service bind
if (theParams.__bx_creds) {
// If user has instance of service
if (theParams.__bx_creds[service]) {
bxCreds = theParams.__bx_creds[service];
} else {
// User has no instances of service
bxCreds = {};
}
} else {
bxCreds = {};
}
const _params = Object.assign({}, bxCreds, theParams);
if (_params.apikey) {
_params.iam_apikey = _params.apikey;
delete _params.apikey;
}
delete _params.__bx_creds;
return _params;
}
global.main = main;
module.exports.test = main;
35 changes: 2 additions & 33 deletions packages/assistant-v1/actions/create-entity.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

const AssistantV1 = require('watson-developer-cloud/assistant/v1');
const extend = require('extend');
const vcap = require('vcap_services');

/**
* Create entity.
Expand Down Expand Up @@ -48,7 +49,7 @@ const extend = require('extend');
*/
function main(params) {
return new Promise((resolve, reject) => {
const _params = getParams(params, 'conversation');
const _params = vcap.getCredentialsFromServiceBind(params, 'conversation');
_params.headers = extend(
{},
_params.headers,
Expand All @@ -71,37 +72,5 @@ function main(params) {
});
}


/**
* Helper function used to authenticate credentials bound to package using wsk service bind
*
* @param {Object} theParams - parameters sent to service
* @param {string} service - name of service in bluemix used to retrieve credentials, used for IAM instances
*/
function getParams(theParams, service) {
if (Object.keys(theParams).length === 0) {
return theParams;
}
let bxCreds;
// Code that checks parameters bound using service bind
if (theParams.__bx_creds) {
// If user has instance of service
if (theParams.__bx_creds[service]) {
bxCreds = theParams.__bx_creds[service];
} else {
// User has no instances of service
bxCreds = {};
}
} else {
bxCreds = {};
}
const _params = Object.assign({}, bxCreds, theParams);
if (_params.apikey) {
_params.iam_apikey = _params.apikey;
delete _params.apikey;
}
delete _params.__bx_creds;
return _params;
}
global.main = main;
module.exports.test = main;
35 changes: 2 additions & 33 deletions packages/assistant-v1/actions/create-example.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

const AssistantV1 = require('watson-developer-cloud/assistant/v1');
const extend = require('extend');
const vcap = require('vcap_services');

/**
* Create user input example.
Expand Down Expand Up @@ -46,7 +47,7 @@ const extend = require('extend');
*/
function main(params) {
return new Promise((resolve, reject) => {
const _params = getParams(params, 'conversation');
const _params = vcap.getCredentialsFromServiceBind(params, 'conversation');
_params.headers = extend(
{},
_params.headers,
Expand All @@ -69,37 +70,5 @@ function main(params) {
});
}


/**
* Helper function used to authenticate credentials bound to package using wsk service bind
*
* @param {Object} theParams - parameters sent to service
* @param {string} service - name of service in bluemix used to retrieve credentials, used for IAM instances
*/
function getParams(theParams, service) {
if (Object.keys(theParams).length === 0) {
return theParams;
}
let bxCreds;
// Code that checks parameters bound using service bind
if (theParams.__bx_creds) {
// If user has instance of service
if (theParams.__bx_creds[service]) {
bxCreds = theParams.__bx_creds[service];
} else {
// User has no instances of service
bxCreds = {};
}
} else {
bxCreds = {};
}
const _params = Object.assign({}, bxCreds, theParams);
if (_params.apikey) {
_params.iam_apikey = _params.apikey;
delete _params.apikey;
}
delete _params.__bx_creds;
return _params;
}
global.main = main;
module.exports.test = main;
35 changes: 2 additions & 33 deletions packages/assistant-v1/actions/create-intent.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

const AssistantV1 = require('watson-developer-cloud/assistant/v1');
const extend = require('extend');
const vcap = require('vcap_services');

/**
* Create intent.
Expand Down Expand Up @@ -46,7 +47,7 @@ const extend = require('extend');
*/
function main(params) {
return new Promise((resolve, reject) => {
const _params = getParams(params, 'conversation');
const _params = vcap.getCredentialsFromServiceBind(params, 'conversation');
_params.headers = extend(
{},
_params.headers,
Expand All @@ -69,37 +70,5 @@ function main(params) {
});
}


/**
* Helper function used to authenticate credentials bound to package using wsk service bind
*
* @param {Object} theParams - parameters sent to service
* @param {string} service - name of service in bluemix used to retrieve credentials, used for IAM instances
*/
function getParams(theParams, service) {
if (Object.keys(theParams).length === 0) {
return theParams;
}
let bxCreds;
// Code that checks parameters bound using service bind
if (theParams.__bx_creds) {
// If user has instance of service
if (theParams.__bx_creds[service]) {
bxCreds = theParams.__bx_creds[service];
} else {
// User has no instances of service
bxCreds = {};
}
} else {
bxCreds = {};
}
const _params = Object.assign({}, bxCreds, theParams);
if (_params.apikey) {
_params.iam_apikey = _params.apikey;
delete _params.apikey;
}
delete _params.__bx_creds;
return _params;
}
global.main = main;
module.exports.test = main;
35 changes: 2 additions & 33 deletions packages/assistant-v1/actions/create-synonym.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

const AssistantV1 = require('watson-developer-cloud/assistant/v1');
const extend = require('extend');
const vcap = require('vcap_services');

/**
* Add entity value synonym.
Expand Down Expand Up @@ -45,7 +46,7 @@ const extend = require('extend');
*/
function main(params) {
return new Promise((resolve, reject) => {
const _params = getParams(params, 'conversation');
const _params = vcap.getCredentialsFromServiceBind(params, 'conversation');
_params.headers = extend(
{},
_params.headers,
Expand All @@ -68,37 +69,5 @@ function main(params) {
});
}


/**
* Helper function used to authenticate credentials bound to package using wsk service bind
*
* @param {Object} theParams - parameters sent to service
* @param {string} service - name of service in bluemix used to retrieve credentials, used for IAM instances
*/
function getParams(theParams, service) {
if (Object.keys(theParams).length === 0) {
return theParams;
}
let bxCreds;
// Code that checks parameters bound using service bind
if (theParams.__bx_creds) {
// If user has instance of service
if (theParams.__bx_creds[service]) {
bxCreds = theParams.__bx_creds[service];
} else {
// User has no instances of service
bxCreds = {};
}
} else {
bxCreds = {};
}
const _params = Object.assign({}, bxCreds, theParams);
if (_params.apikey) {
_params.iam_apikey = _params.apikey;
delete _params.apikey;
}
delete _params.__bx_creds;
return _params;
}
global.main = main;
module.exports.test = main;
35 changes: 2 additions & 33 deletions packages/assistant-v1/actions/create-value.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

const AssistantV1 = require('watson-developer-cloud/assistant/v1');
const extend = require('extend');
const vcap = require('vcap_services');

/**
* Add entity value.
Expand Down Expand Up @@ -55,7 +56,7 @@ const extend = require('extend');
*/
function main(params) {
return new Promise((resolve, reject) => {
const _params = getParams(params, 'conversation');
const _params = vcap.getCredentialsFromServiceBind(params, 'conversation');
_params.headers = extend(
{},
_params.headers,
Expand All @@ -78,37 +79,5 @@ function main(params) {
});
}


/**
* Helper function used to authenticate credentials bound to package using wsk service bind
*
* @param {Object} theParams - parameters sent to service
* @param {string} service - name of service in bluemix used to retrieve credentials, used for IAM instances
*/
function getParams(theParams, service) {
if (Object.keys(theParams).length === 0) {
return theParams;
}
let bxCreds;
// Code that checks parameters bound using service bind
if (theParams.__bx_creds) {
// If user has instance of service
if (theParams.__bx_creds[service]) {
bxCreds = theParams.__bx_creds[service];
} else {
// User has no instances of service
bxCreds = {};
}
} else {
bxCreds = {};
}
const _params = Object.assign({}, bxCreds, theParams);
if (_params.apikey) {
_params.iam_apikey = _params.apikey;
delete _params.apikey;
}
delete _params.__bx_creds;
return _params;
}
global.main = main;
module.exports.test = main;
Loading

0 comments on commit a07b3fb

Please sign in to comment.