standardize on passing .query args as array (#356)

This commit is contained in:
Dave Horton
2023-05-22 09:56:05 -04:00
committed by GitHub
parent 32a84b7b19
commit 7393e3bcb7
4 changed files with 12 additions and 12 deletions

View File

@@ -1587,7 +1587,7 @@ class CallSession extends Emitter {
const pp = this._pool.promise();
try {
this.logger.info({accountSid: this.accountSid}, 'performQueueWebhook: looking up account');
const [r] = await pp.query(sqlRetrieveQueueEventHook, this.accountSid);
const [r] = await pp.query(sqlRetrieveQueueEventHook, [this.accountSid]);
if (0 === r.length) {
this.logger.info({accountSid: this.accountSid}, 'performQueueWebhook: no webhook provisioned');
this.queueEventHookRequestor = null;

View File

@@ -100,13 +100,13 @@ module.exports = (logger, srf) => {
const lookupAccountDetails = async(account_sid) => {
const [r] = await pp.query({sql: sqlAccountDetails, nestTables: true}, account_sid);
const [r] = await pp.query({sql: sqlAccountDetails, nestTables: true}, [account_sid]);
if (0 === r.length) throw new Error(`invalid accountSid: ${account_sid}`);
const [r2] = await pp.query(sqlSpeechCredentials, account_sid);
const [r2] = await pp.query(sqlSpeechCredentials, [account_sid]);
const speech = r2.map(speechMapper);
/* add service provider creds unless we have that vendor at the account level */
const [r3] = await pp.query(sqlSpeechCredentialsForSP, account_sid);
const [r3] = await pp.query(sqlSpeechCredentialsForSP, [account_sid]);
r3.forEach((s) => {
if (!speech.find((s2) => s2.vendor === s.vendor)) {
speech.push(speechMapper(s));

14
package-lock.json generated
View File

@@ -9,7 +9,7 @@
"version": "0.8.3",
"license": "MIT",
"dependencies": {
"@jambonz/db-helpers": "^0.7.10",
"@jambonz/db-helpers": "^0.8.1",
"@jambonz/http-health-check": "^0.0.1",
"@jambonz/realtimedb-helpers": "^0.7.2",
"@jambonz/speech-utils": "^0.0.13",
@@ -1595,9 +1595,9 @@
}
},
"node_modules/@jambonz/db-helpers": {
"version": "0.7.10",
"resolved": "https://registry.npmjs.org/@jambonz/db-helpers/-/db-helpers-0.7.10.tgz",
"integrity": "sha512-wVZY7je6j01jZNmnzSiuhUz+ufeVEqh8WLi2RPiOJrNk3lFa6eNJJifCCzi5Z71zzIO8jEnDzj54rvbaFgaMtw==",
"version": "0.8.1",
"resolved": "https://registry.npmjs.org/@jambonz/db-helpers/-/db-helpers-0.8.1.tgz",
"integrity": "sha512-pc5TRAYnb89oyD5Ncy9Ik+v/tBqQcNOthbDwaX1OJyGRhPdolgs4YvOTpc0KpSqx7TDjKPS9n5MlqOFWgyDbTA==",
"dependencies": {
"cidr-matcher": "^2.1.1",
"debug": "^4.3.4",
@@ -10053,9 +10053,9 @@
"dev": true
},
"@jambonz/db-helpers": {
"version": "0.7.10",
"resolved": "https://registry.npmjs.org/@jambonz/db-helpers/-/db-helpers-0.7.10.tgz",
"integrity": "sha512-wVZY7je6j01jZNmnzSiuhUz+ufeVEqh8WLi2RPiOJrNk3lFa6eNJJifCCzi5Z71zzIO8jEnDzj54rvbaFgaMtw==",
"version": "0.8.1",
"resolved": "https://registry.npmjs.org/@jambonz/db-helpers/-/db-helpers-0.8.1.tgz",
"integrity": "sha512-pc5TRAYnb89oyD5Ncy9Ik+v/tBqQcNOthbDwaX1OJyGRhPdolgs4YvOTpc0KpSqx7TDjKPS9n5MlqOFWgyDbTA==",
"requires": {
"cidr-matcher": "^2.1.1",
"debug": "^4.3.4",

View File

@@ -25,7 +25,7 @@
"jslint:fix": "eslint app.js tracer.js lib --fix"
},
"dependencies": {
"@jambonz/db-helpers": "^0.7.10",
"@jambonz/db-helpers": "^0.8.1",
"@jambonz/http-health-check": "^0.0.1",
"@jambonz/realtimedb-helpers": "^0.7.2",
"@jambonz/speech-utils": "^0.0.13",