generator-ibm-service-enablement
Advanced tools
Comparing version 1.2.1 to 1.3.0
@@ -5,2 +5,13 @@ # Change Log | ||
<a name="1.3.0"></a> | ||
# [1.3.0](https://github.com/ibm-developer/generator-ibm-service-enablement/compare/v1.2.1...v1.3.0) (2018-05-25) | ||
### Features | ||
* **IAM:** add iam support for Watson Assistant ([2c7a7a9](https://github.com/ibm-developer/generator-ibm-service-enablement/commit/2c7a7a9)) | ||
* **visualRecognition:** add iam support for visual recognition ([51e98c9](https://github.com/ibm-developer/generator-ibm-service-enablement/commit/51e98c9)) | ||
<a name="1.2.1"></a> | ||
@@ -7,0 +18,0 @@ ## [1.2.1](https://github.com/ibm-developer/generator-ibm-service-enablement/compare/v1.2.0...v1.2.1) (2018-05-24) |
{ | ||
"dependencies": { | ||
"watson-developer-cloud": "^2.37.0" | ||
"watson-developer-cloud": "^3.4.2" | ||
} | ||
} | ||
} |
const IBMCloudEnv = require('ibm-cloud-env'); | ||
const ConversationV1 = require('watson-developer-cloud/conversation/v1'); | ||
const AssistantV1 = require('watson-developer-cloud/assistant/v1'); | ||
module.exports = function(app, serviceManager){ | ||
const conversation = new ConversationV1({ | ||
let params = { | ||
version: '2018-02-16', | ||
url: IBMCloudEnv.getString('watson_conversation_url'), | ||
username: IBMCloudEnv.getString('watson_conversation_username'), | ||
password: IBMCloudEnv.getString('watson_conversation_password'), | ||
version_date: ConversationV1.VERSION_DATE_2017_04_21 | ||
}); | ||
serviceManager.set("watson-conversation", conversation); | ||
}; | ||
if (IBMCloudEnv.getString('watson_conversation_apikey')) { | ||
const iam_url = params.url.includes('gateway-s.') ? | ||
'https://iam.stage1.bluemix.net/identity/token' : | ||
'https://iam.bluemix.net/identity/token'; | ||
Object.assign(params, { | ||
iam_apikey: IBMCloudEnv.getString('watson_conversation_apikey'), | ||
iam_url, | ||
}); | ||
} | ||
else { | ||
Object.assign(params, { | ||
username: IBMCloudEnv.getString('watson_conversation_username'), | ||
password: IBMCloudEnv.getString('watson_conversation_password'), | ||
}); | ||
} | ||
const assistant = new AssistantV1(params); | ||
serviceManager.set("watson-conversation", assistant); | ||
}; |
{ | ||
"dependencies": { | ||
"watson-developer-cloud": "^2.37.0" | ||
"watson-developer-cloud": "^3.4.2" | ||
} | ||
} | ||
} |
{ | ||
"dependencies": { | ||
"watson-developer-cloud": "^2.37.0" | ||
"watson-developer-cloud": "^3.4.2" | ||
} | ||
} | ||
} |
{ | ||
"dependencies": { | ||
"watson-developer-cloud": "^2.37.0" | ||
"watson-developer-cloud": "^3.4.2" | ||
} | ||
} | ||
} |
{ | ||
"dependencies": { | ||
"watson-developer-cloud": "^2.37.0" | ||
"watson-developer-cloud": "^3.4.2" | ||
} | ||
} | ||
} |
{ | ||
"dependencies": { | ||
"watson-developer-cloud": "^2.37.0" | ||
"watson-developer-cloud": "^3.4.2" | ||
} | ||
} | ||
} |
{ | ||
"dependencies": { | ||
"watson-developer-cloud": "^2.37.0" | ||
"watson-developer-cloud": "^3.4.2" | ||
} | ||
} | ||
} |
{ | ||
"dependencies": { | ||
"watson-developer-cloud": "^2.37.0" | ||
"watson-developer-cloud": "^3.4.2" | ||
} | ||
} | ||
} |
{ | ||
"dependencies": { | ||
"watson-developer-cloud": "^2.37.0" | ||
"watson-developer-cloud": "^3.4.2" | ||
} | ||
} | ||
} |
{ | ||
"dependencies": { | ||
"watson-developer-cloud": "^2.37.0" | ||
"watson-developer-cloud": "^3.4.2" | ||
} | ||
} | ||
} |
@@ -5,8 +5,24 @@ const IBMCloudEnv = require('ibm-cloud-env'); | ||
module.exports = function(app, serviceManager){ | ||
const visualRecognition = new VisualRecognitionV3({ | ||
url: IBMCloudEnv.getString('watson_visual_recognition_url'), | ||
api_key: IBMCloudEnv.getString('watson_visual_recognition_api_key'), | ||
version_date: VisualRecognitionV3.VERSION_DATE_2016_05_20 | ||
}); | ||
let params = { | ||
version: '2016-05-20' | ||
}; | ||
if (IBMCloudEnv.getString('watson_viusal_recognition_apikey')) { | ||
const iam_url = params.url.includes('gateway-s.') ? | ||
'https://iam.stage1.bluemix.net/identity/token' : | ||
'https://iam.bluemix.net/identity/token'; | ||
Object.assign(params, { | ||
iam_apikey: IBMCloudEnv.getString('watson_viusal_recognition_apikey'), | ||
iam_url, | ||
}); | ||
} | ||
else { | ||
Object.assign(params, { | ||
api_key: IBMCloudEnv.getString('watson_viusal_recognition__api_key'), | ||
}); | ||
} | ||
const visualRecognition = new VisualRecognitionV3(params); | ||
serviceManager.set('watson-visual-recognition', visualRecognition); | ||
}; |
{ | ||
"name": "generator-ibm-service-enablement", | ||
"version": "1.2.1", | ||
"version": "1.3.0", | ||
"description": "This generator adds Service enablement to applications", | ||
@@ -5,0 +5,0 @@ "main": "generators/app/index.js", |
245487
353
4307