OOSE Software Development Kit
$ npm install oose-sdk --save
'use strict';
var oose = require('oose-sdk')
oose.api.updateConfig({
prism: {
host: 'prism.oose.io',
port: 5972
}
})
//store the user session
var session = {}
//setup our api and login
var prism = oose.api.prism()
prism.postAsync({
url: prism.url('/user/login'),
json: {
username: 'myusername',
password: 'mypassword'
}
})
.spread(prism.validateResponse())
.spread(function(res,body){
console.log(body)
session = body.session
})
.catch(prism.handleNetworkError)
.catch(oose.NetworkError,function(err){
console.log('A network error occurred: ' + err.message)
})
'use strict';
var oose = require('oose-sdk')
oose.api.updateConfig({
prism: {
port: 3001,
host: '127.0.0.1'
}
})
describe('my test',function(){
before(function(){
return oose.mock.start(3001,'127.0.0.1')
})
after(function(){
return oose.mock.stop()
})
it('should be up',function(){
var prism = oose.api.prism()
return prism.postAsync(prism.url('/ping'))
.spread(function(res,body){
expect(body.pong).to.equal('pong')
})
})
})
passwordReset
msecs not a number issue
rejectUnauthorized: false
by default now. Have
also had to add process.env.NODE_TLS_REJECT_UNAUTHORIZED = 0
unfortunately.ndt
commandprism.login(un,pw)
urlPurchase
and urlStatic
to Prism helperPrism
helpers to access PrismsPrism
helper/content/retrieve
/user/session/renew
socket hang up
to Network error messagesESOCKETTIMEDOUT
api.handleNetworkError()
now handles all TCP/IP unix errorsapi.handleNetworkError()
now maintains the original stack traceapi.handleNetworkError()
api.handleNetworkError()
api.handleNetworkError()
Language | javascript |
Version | 2.0.2 |
Git URL | https://github.com/nullivex/oose-sdk |
License | MIT |
Description | OOSE Software Development Kit |
Keywords |