node-red-contrib-wazo-platform
Advanced tools
Comparing version 0.0.22 to 0.0.23
@@ -62,8 +62,13 @@ module.exports = function(RED) { | ||
const { refreshToken, ...result } = await this.client.auth.logIn({ | ||
username: req.body.username, | ||
password: req.body.password | ||
}); | ||
try { | ||
const { refreshToken, ...result } = await this.client.auth.logIn({ | ||
username: req.body.username, | ||
password: req.body.password | ||
}); | ||
res.send(refreshToken); | ||
res.send(refreshToken); | ||
} | ||
catch(err) { | ||
res.send(err); | ||
} | ||
}); | ||
@@ -81,17 +86,16 @@ | ||
client.setToken(authentication.token); | ||
try { | ||
const url = `https://${req.body.host}:${req.body.port}/api/auth/0.1/users/me/tokens`; | ||
const { ...refreshToken } = await listRefreshToken(url, authentication.token); | ||
res.json(refreshToken); | ||
} | ||
catch(err) { | ||
res.send(err); | ||
} | ||
} | ||
catch(err) { | ||
node.error(err); | ||
res.send(err); | ||
} | ||
try { | ||
const url = `https://${req.body.host}:${req.body.port}/api/auth/0.1/users/me/tokens`; | ||
const { ...refreshToken } = await listRefreshToken(url, authentication.token); | ||
res.json(refreshToken); | ||
} | ||
catch(err) { | ||
node.error(err); | ||
res.send(err); | ||
} | ||
}); | ||
@@ -98,0 +102,0 @@ |
@@ -86,2 +86,9 @@ module.exports = function (RED) { | ||
client.setToken(authentication.token); | ||
try { | ||
const { ...users } = await client.confd.listUsers(); | ||
res.json(users); | ||
} | ||
catch(err) { | ||
res.send(err); | ||
} | ||
} | ||
@@ -91,10 +98,2 @@ catch(err) { | ||
} | ||
try { | ||
const { ...users } = await client.confd.listUsers(); | ||
res.json(users); | ||
} | ||
catch(err) { | ||
res.send(err); | ||
} | ||
}); | ||
@@ -101,0 +100,0 @@ |
@@ -64,15 +64,14 @@ module.exports = function (RED) { | ||
client.setToken(authentication.token); | ||
} | ||
catch(err) { | ||
res.send(err); | ||
} | ||
try { | ||
// FIXME: Remove when SDK will be ready | ||
// const { ...trunks } = await client.confd.listContexts(); | ||
try { | ||
// FIXME: Remove when SDK will be ready | ||
// const { ...trunks } = await client.confd.listContexts(); | ||
const url = `https://${req.body.host}:${req.body.port}/api/confd/1.1/contexts`; | ||
const { ...trunks } = await listContexts(url, authentication.token); | ||
const url = `https://${req.body.host}:${req.body.port}/api/confd/1.1/contexts`; | ||
const { ...trunks } = await listContexts(url, authentication.token); | ||
res.json(trunks); | ||
res.json(trunks); | ||
} | ||
catch(err) { | ||
res.send(err); | ||
} | ||
} | ||
@@ -82,2 +81,3 @@ catch(err) { | ||
} | ||
}); | ||
@@ -84,0 +84,0 @@ |
@@ -76,16 +76,15 @@ module.exports = function (RED) { | ||
try { | ||
const { ...authentication } = await client.auth.refreshToken(req.body.refreshToken); | ||
client.setToken(authentication.token); | ||
} | ||
catch(err) { | ||
res.send(err); | ||
} | ||
const { ...authentication } = await client.auth.refreshToken(req.body.refreshToken); | ||
client.setToken(authentication.token); | ||
try { | ||
// FIXME: Remove when SDK will be ready | ||
// const { ...trunks } = await client.confd.listTrunks(); | ||
try { | ||
// FIXME: Remove when SDK will be ready | ||
// const { ...trunks } = await client.confd.listTrunks(); | ||
const url = `https://${req.body.host}:${req.body.port}/api/confd/1.1/trunks`; | ||
const { ...trunks } = await listTrunks(url, authentication.token); | ||
res.json(trunks); | ||
const url = `https://${req.body.host}:${req.body.port}/api/confd/1.1/trunks`; | ||
const { ...trunks } = await listTrunks(url, authentication.token); | ||
res.json(trunks); | ||
} | ||
catch(err) { | ||
res.send(err); | ||
} | ||
} | ||
@@ -92,0 +91,0 @@ catch(err) { |
{ | ||
"name": "node-red-contrib-wazo-platform", | ||
"version": "0.0.22", | ||
"version": "0.0.23", | ||
"description": "Node Red module for the Wazo Platform API", | ||
@@ -5,0 +5,0 @@ "main": "index.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
878573
686