You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

@sap/hdi

Package Overview
Dependencies
Maintainers
3
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.3 to 2.1.2

lib/util/schema_escaping.js

12

CHANGELOG.md

@@ -0,1 +1,13 @@

## 2.1.2
Features:
- Updated dependencies
## 2.1.1
Fixes:
- Error with npm-shrinkwrap.json
## 2.1.0
Features:
- Added quoting of schema names
- Switched from hdb to the official @sap/hana-client
## 2.0.3

@@ -2,0 +14,0 @@ Fixes:

71

lib/main/Container.js
'use strict';
const hdb = require('hdb');
const hana_client = require('@sap/hana-client');
const HDIBase = require('./HDIBase');

@@ -29,8 +29,9 @@ const CONSTANTS = require('../util/Constants');

*
* @param {HDB_Client} hdb_connection Client
* @param {HANA_Client} hc_connection Client
* @param {Object} credentials Credentials
* @returns {Promise} Promise
*/
function promise_connect(hdb_connection){
function promise_connect(hc_connection, credentials){
return new Promise((resolve, reject) => {
hdb_connection.connect((e) => {
hc_connection.connect(credentials, (e) => {
if (e){

@@ -117,7 +118,32 @@ reject(e);

super(credentials, paramSchema, apiSchema);
this.lock_connection = hdb.createClient(credentials);
this.lock_connection.on('error', (err) => {
throw new Error(`Network connection error: ${ err}`);
});
this.lock_connection = hana_client.createConnection();
/**
* Acquires a lock on the container's lock table.
* NOTE: Acquiring the lock is not strictly required for a client, so other clients might ignore it.
* Requires EXECUTE privilege on LOCK
* Minimum required HANA server version: 2.00.010
* @param {number} timeout lock wait timeout in milliseconds
* @param {Parameter[]} params parameters controlling the current procedure call
* @param {ResultTupleCB} cb - The callback handling the result.
* @returns {undefined} Returns nothing/undefined.
* @async
*/
this.lock = (timeout, params, cb) => {
try {
typeCheck(params, 'params', Parameter);
} catch (error) {
return cb(error);
}
const command = 'LOCK';
const sql = `call ${this.apiSchema}.${command}(${timeout}, ${this.paramSchema}.${CONSTANTS.PARAMETERS_TABLE}, ?, ?, ?)`;
promise_connect(this.lock_connection, credentials)
.then(() => this.fillHelperTable(CONSTANTS.PARAMETERS_TABLE, params, this.lock_connection, new Set()))
.then(() => this.executeCall(sql, null, {}, this.lock_connection))
.then((res) => cb(null, res))
.catch((e) => {
this.unlock(() => {});
cb(e);
});
};
this.lock_connection.setAutoCommit(false);

@@ -569,31 +595,4 @@ }

/**
* Acquires a lock on the container's lock table.
* NOTE: Acquiring the lock is not strictly required for a client, so other clients might ignore it.
* Requires EXECUTE privilege on LOCK
* Minimum required HANA server version: 2.00.010
* @param {number} timeout lock wait timeout in milliseconds
* @param {Parameter[]} params parameters controlling the current procedure call
* @param {ResultTupleCB} cb - The callback handling the result.
* @returns {undefined} Returns nothing/undefined.
* @async
*/
lock(timeout, params, cb) {
try {
typeCheck(params, 'params', Parameter);
} catch (error) {
return cb(error);
}
const command = 'LOCK';
const sql = `call ${this.apiSchema}.${command}(${timeout}, ${this.paramSchema}.${CONSTANTS.PARAMETERS_TABLE}, ?, ?, ?)`;
promise_connect(this.lock_connection)
.then(() => this.fillHelperTable(CONSTANTS.PARAMETERS_TABLE, params, this.lock_connection, new Set()))
.then(() => this.executeCall(sql, null, {}, this.lock_connection))
.then((res) => cb(null, res))
.catch((e) => {
this.unlock(() => {});
cb(e);
});
}
/**

@@ -600,0 +599,0 @@ * Close the lock_connection to unlock.

'use strict';
const CONSTANTS = require('../util/Constants');
const hdb = require('hdb');
const ResultTuple = require('../ResultTuple');
const APIPrivilege = require('../parameter/APIPrivilege');
const LibraryConfiguration = require('../parameter/LibraryConfiguration');
const hana_client = require('@sap/hana-client');
const async = require('async');
const quote_sql_identifier = require('../util/schema_escaping');
/**

@@ -35,3 +38,3 @@ * Callback that takes errors as the first parameter and a String as the second parameter.

*/
this.apiSchema = apiSchema;
this.apiSchema = quote_sql_identifier(apiSchema);
/**

@@ -41,7 +44,20 @@ * Connection to the HANA database.

*/
this.connection = hdb.createClient(credentials);
this.connection.on('error', (err) => {
throw new Error(`Network connection error: ${ err}`);
});
this.connection = hana_client.createConnection();
/**
* Connect to the HANA DB with the credentials passed to the constructor.
* Requires SELECT privilege on _SYS_DI.TT_*
* @param {StringCB} cb - The callback handling the result.
* @returns {undefined} Returns nothing/undefined.
* @async
*/
this.connect = (cb) => {
this.connection.connect(credentials, ((err) => {
if (err){
return cb(err);
}
return cb(null, 'OK: connected to DB.');
}));
};
/**
* Set to keep track of the created helper tables.

@@ -55,20 +71,16 @@ * @name HDIBase#createdHelperTables

*/
this.paramSchema = paramSchema;
this.paramSchema = quote_sql_identifier(paramSchema);
}
/**
* Connect to the HANA DB with the credentials passed to the constructor.
* Requires SELECT privilege on _SYS_DI.TT_*
* @param {StringCB} cb - The callback handling the result.
* @returns {undefined} Returns nothing/undefined.
* @async
/*
*
* connect(cb) {
* this.connection.connect((err) => {
* if (err) {
* return cb(err);
* }
* cb(null, 'OK: connected to DB.');
* });
* }
*/
connect(cb) {
this.connection.connect((err) => {
if (err) {
return cb(err);
}
cb(null, 'OK: connected to DB.');
});
}

@@ -147,3 +159,4 @@ /**

return new Promise((resolve, reject) => {
connection.prepare(sql, (err, stmt) => {
const hana_util = require('@sap/hana-client/extension/Stream.js');
hana_util.createStatement(connection, sql, (err, stmt) => {
if (err) {

@@ -153,20 +166,19 @@ err.sql = sql;

}
resolve(stmt);
});
}).then((stmt) => new Promise((resolve, reject) => {
// Map Parameter-Objects to simple pairs of Strings.
const parameters = [];
params.forEach((param) => {
param.flatten().forEach((array) => {
parameters.push(array);
const parameters = [];
params.forEach((param) => {
param.flatten().forEach((array) => {
parameters.push(array);
});
});
async.eachLimit(parameters, 1, (param, callback) => {
stmt.exec(param, callback);
}, (e, rows) => {
if (e) {
return reject(e);
}
return resolve(rows);
});
});
stmt.exec(parameters, (err, affectedRows) => {
if (err) {
err.sql = stmt;
reject(err);
}
resolve(`OK: _execute_update: ${ sql }, Affected rows: ${ affectedRows}`);
});
}));
});
}

@@ -194,3 +206,4 @@

return new Promise((resolve, reject) => {
connection.prepare(statement, (err, stmt) => {
const hana_util = require('@sap/hana-client/extension/Stream.js');
hana_util.createProcStatement(connection, statement, (err, stmt) => {
if (err) {

@@ -197,0 +210,0 @@ reject(err);

@@ -16,3 +16,3 @@ 'use strict';

// (data) content of folders is always empty
super(path, Buffer.alloc(0));
super(path, undefined);

@@ -19,0 +19,0 @@ if (!(path === '' || path.endsWith('/'))) {

@@ -37,3 +37,3 @@ 'use strict';

module.exports.isContent = function(value){
if (!(value instanceof ReadStream || value instanceof Buffer || value instanceof Readable || (typeof value.read === 'function' && typeof value.on === 'function'))){
if (!(value === undefined || value instanceof ReadStream || value instanceof Buffer || value instanceof Readable || (typeof value.read === 'function' && typeof value.on === 'function'))){
throw new Error(`Parameter does not have the right type. We expected a ReadStream or Buffer. We found: ${ typeof value}`);

@@ -40,0 +40,0 @@ }

{
"name": "@sap/hdi",
"version": "2.0.3",
"version": "2.1.2",
"dependencies": {
"hdb": {
"version": "0.15.1"
"@sap/hana-client": {
"version": "2.3.123",
"dependencies": {
"debug": {
"version": "3.1.0"
},
"ms": {
"version": "2.0.0"
}
}
},
"iconv-lite": {
"version": "0.4.19"
"async": {
"version": "2.6.1"
},
"lodash": {
"version": "4.17.11"
}
}
}

@@ -1,1 +0,1 @@

{"dependencies":{"hdb":"0.15.1"},"description":"HDI client library for node.js","devDependencies":{"command-line-args":"^4.0.7","command-line-usage":"^4.0.2","eslint":"4.10.0","eslint-plugin-node":"5.2.1","filter-node-package":"2.0.0","ink-docstrap":"1.3.0","istanbul":"^0.4.5","jsdoc":"3.5.5","jshint":"2.9.4","mocha":"3.2.0","node-style":"2.0.1","nyc":"11.2.1","shelljs":"0.6.0","should":"^13.1.3"},"engines":{"node":">=6.0.0"},"main":"index.js","maintainers":[{"name":"https-support.sap.com","email":"do-not-reply@sap.com"}],"name":"@sap/hdi","optionalDependencies":{},"readme":"@sap/hdi\n===============\n\n`@sap/hdi` is a [Node.js](https://nodejs.org) library that allows access to the SQL based API through Node.js. It provides access to the HDI-, Container-Group- and the Container-API.\n\n## Table of contents\n **Using the library**:\n- [General things](#general-things)\n- [Using the HDI API](#using-the-hdi-api)\n- [Using the Container Group API](#using-the-container-group-api)\n- [Using the Container API](#using-the-container-api)\n- [Using the API with xsjs](#using-the-api-with-xsjs)\n\n## General things\n\nAssuming that your **npm registry** is correctly configured and has access to SAP packages, simply running `npm install --save @sap/hdi` will install the package and add it as a dependency to your **package.json**.\n\nWe recommend using version 2.0.0 or higher. V2 of the API brings access to the Container Group API, major refactoring of the HDI and Container API into separate components and lots of pre-defined classes to make working with the API easier.\n\nNote that V2 is not backwards compatible to V1, code written with the old API will ***NOT*** run with new API. This documentation is for the V2 API.\n\nAll APIs require that the connected user has EXECUTE privileges for the corresponding SQL procedures and SELECT for all table types in SYS_DI (TT*).\n\nAlmost all methods are asynchronous and require a standard node-style callback, where the first parameter is any errors that occured and the second is the result.\n\n**This document only provides a really high-level and shallow overview of the API. For a more detailed, technical documentation, refer to the JSDoc. To generate the documentation, run `npm install jsdoc`,`npm install ink-docstrap` and then `npm run documentation`. The documentation can then be found in the `docs` folder.**\n\n\n## Using the HDI API\nAccess to the _SYS_DI API is provided by the `HDI` class. Access to this API requires HANA server version: 1.00.120 or newer. To work with the API, simply construct a new object, as can be seen in the following (ES6-based) example:\n\n```javascript\nconst { HDI } = require('@sap/hdi');\n\n#This credentials object will be directly passed to the hdb client. Any options accepted by the hdb client can be passed.\nconst credentials = {\n host : <host>,\n port : <port>,\n user : <user>,\n password: <password>\n};\n\nconst hdi = new HDI(credentials, parameterSchema);\n\nhdi.connect((error,result) => {\n if(error){\n throw error;\n }\n\n hdi.listLibraries(null,(error,result) => {\n if(error){\n throw error;\n }\n\n console.log(result);\n })\n})\n```\n\nTo construct an access object, you need the credentials for the HANA system and the `parameterSchema`. This schema will be used to create temporary tables to supply data to the underlying sql procedures.\n\n## Using the Container Group API\nThe Container Group API provides access to an **existing** container group. In order to use the API, you might need to first grant the correct rights by using `grantContainerGroupAPIPrivileges` of the HDI class.\n\nTo construct an access object, you need the credentials for the HANA system, the `parameterSchema` and the name of the container group.\n\n## Using the Container API\nThe Container API provides access to an **existing** container. In order to use the API, you might need to first grant the correct rights by using `grantContainerAPIPrivileges` of the ContainerGroup class.\n\nTo construct an access object, you need the credentials for the HANA system, the `parameterSchema` and the name of the container.\n\nExample: Deploying files to a container\n\n```javascript\n'use strict';\n\nconst fs = require('fs');\nconst async = require('async');\nconst path = require('path');\n\nconst {Container, HDI, FileWithContent, FolderWithContent, File, Parameter} = require('@sap/hdi');\n\n// This credentials object will be directly passed to the hdb client. Any options accepted by the hdb client can be passed.\nconst credentials = {\n host: 'host',\n port: 'port',\n user: 'user',\n password: 'password'\n};\n\nconst containerUserCredentials = {\n host: 'host',\n port: 'port',\n user: 'user',\n password: 'password'\n};\n\nconst containerName = 'container_name';\n\nconst hdi = new HDI(credentials, // Credentials to use for the HANA system.\n credentials.user // Schema where the user used for the connection has privileges to create temporary tables, for example the user's own schema.\n);\n\nconst containerUser = new Container(containerName, // Name of the container. Does not have to exist yet but has to exist before calling any methods.\n containerUserCredentials, // Credentials to use for the HANA system.\n containerUserCredentials.user // Schema where the user used for the connection has privileges to create temporary tables, for example the user's own schema.\n);\n\nconst fPath = 'folder/';\n\nconst cPath = 'folder/.hdiconfig';\nconst cContent = fs.createReadStream(`${__dirname}${path.sep}testdata${path.sep}.hdiconfig`);\n\nconst tPath = 'folder/table1.hdbtable';\nconst tContent = fs.createReadStream(`${__dirname}${path.sep}testdata${path.sep}table1.hdbtable`);\n\nconst rContent = fs.createReadStream(`${__dirname}${path.sep}testdata${path.sep}role.hdbrole`);\nconst rPath = 'folder/role.hdbrole';\n\nconst filesFoldersContent = [\n new FolderWithContent(fPath),\n new FileWithContent(cPath, cContent),\n new FileWithContent(tPath, tContent),\n new FileWithContent(rPath, rContent)\n];\n\nconst files = [new File(rPath), new File(cPath), new File(tPath)];\nconst params = [new Parameter('ignore_work', 'TRUE'), new Parameter('ignore_deployed', 'TRUE')];\n/**\n * Get the default privileges to work with a container and grant them to the container user.\n */\nconst handlePrivileges = (cb) => {\n hdi.getDefaultContainerUserPrivileges('', containerUserCredentials.user, (e, privileges) => {\n if (e) {\n return cb(e);\n }\n hdi.grantContainerApiPrivileges(containerName, privileges, null, cb);\n });\n};\n/**\n * Get the default libraries and allow them for the container.\n */\nconst handleLibraries = (cb) => {\n hdi.getDefaultLibraries((e, libraries) => {\n if (e) {\n return cb(e);\n }\n hdi.configureLibraries(containerName, libraries, null, cb);\n });\n};\nconst tasks = [\n (cb) => hdi.connect(cb),\n (cb) => hdi.createContainer(containerName, null, cb),\n handleLibraries,\n handlePrivileges,\n (cb) => containerUser.connect(cb),\n (cb) => containerUser.lock(0, null, cb),\n (cb) => containerUser.write(filesFoldersContent, null, cb),\n (cb) => containerUser.status(null, null, cb),\n (cb) => containerUser.list(null, null, cb),\n (cb) => containerUser.make(files, null, null, null, cb),\n (cb) => containerUser.unlock(cb),\n (cb) => {\n containerUser.disconnect(); cb(null, 'OK: disconnected.');\n },\n (cb) => hdi.dropContainer(containerName, params, cb)\n];\n\nasync.series(tasks, (e, results) => {\n /*\n *Check for errors\n *Check if all results have return code (rc) equal 0\n *If all rc are 0 and there are no errors, everything was successful.\n */\n});\n```\n\n## Using the API with xsjs\nSince most of the methods of the HDI, ContainerGroup and Container class are asynchronous, you need to use the provided `sync` functionality to use them in xsjs code.\nBe aware that this requires a version of xsjs that uses at least `\"@sap/fibrous\": \"0.5.0-0\"` as a dependency. This fixes issues with `sync` in combination with class methods.\n\nIf your version of xsjs is up to date in that regard, simply add `sync` before your method calls. This\n\n```javascript\nconst { HDI } = require('@sap/hdi');\n\n#This credentials object will be directly passed to the hdb client. Any options accepted by the hdb client can be passed.\nconst credentials = {\n host : <host>,\n port : <port>,\n user : <user>,\n password: <password>\n};\n\nconst hdi = new HDI(credentials, parameterSchema);\n\nhdi.connect((error,result) => {\n if(error){\n throw error;\n }\n\n hdi.listLibraries(null,(error,result) => {\n if(error){\n throw error;\n }\n\n console.log(result);\n })\n})\n```\nturns into this:\n```javascript\nvar { HDI } = $.require('@sap/hdi');\n\n#This credentials object will be directly passed to the hdb client. Any options accepted by the hdb client can be passed.\nvar credentials = {\n host : <host>,\n port : <port>,\n user : <user>,\n password: <password>\n};\n\nvar hdi = new HDI(credentials, parameterSchema);\n\nhdi.sync.connect();\nvar libraries = hdi.sync.listLibraries(null);\nconsole.log(libraries);\n```\n","readmeFilename":"README.md","repository":{"type":"git"},"scripts":{"coverage":"nyc --reporter=html mocha test/test.js","documentation":"jsdoc -d ./docs -t ./node_modules/ink-docstrap/template -R README.md -r index.js ./lib/","eslint":"eslint index.js lib/ test/","full_test":"node test/manage.js","lint":"jshint index.js lib/","pre-commit":"mocha test/test.js --reporter progress && npm run lint -- --fix","prepare-release":"clean-packages && npm prune --production && ls -al","test":"jshint index.js lib/","test-all.js":"node test-all-filtered.js","test-dev":"mocha test/test.js"},"version":"2.0.3","license":"SEE LICENSE IN developer-license-3.1.txt"}
{"bundleDependencies":false,"dependencies":{"@sap/hana-client":"2.3.123","async":"2.6.1"},"deprecated":false,"description":"HDI client library for node.js","devDependencies":{"command-line-args":"^4.0.7","command-line-usage":"^4.0.2","eslint":"4.10.0","eslint-plugin-node":"5.2.1","filter-node-package":"2.0.0","ink-docstrap":"1.3.0","istanbul":"^0.4.5","jsdoc":"3.5.5","jshint":"2.9.4","mocha":"3.2.0","node-style":"2.0.1","nyc":"11.2.1","shelljs":"0.6.0","should":"^13.1.3"},"engines":{"node":">=6.0.0"},"main":"index.js","name":"@sap/hdi","repository":{"type":"git"},"scripts":{"coverage":"nyc --reporter=html mocha test/test.js","documentation":"jsdoc -d ./docs -t ./node_modules/ink-docstrap/template -R README.md -r index.js ./lib/","eslint":"eslint index.js lib/ test/","full_test":"node test/manage.js","lint":"jshint index.js lib/","pre-commit":"mocha test/test.js --reporter progress && npm run lint -- --fix","prepare-release":"clean-packages && npm prune --production && ls -al","test":"jshint index.js lib/","test-all.js":"node test-all-filtered.js","test-dev":"mocha test/test.js"},"version":"2.1.2","license":"SEE LICENSE IN developer-license-3.1.txt"}

@@ -24,7 +24,26 @@ @sap/hdi

Almost all methods are asynchronous and require a standard node-style callback, where the first parameter is any errors that occured and the second is the result.
Almost all methods are asynchronous and require a standard node-style callback, where the first parameter is any errors that occurred and the second is the result. Keep in mind that the error-parameter is only supplied when a "technical" error occurs. To check if the action was succesful, you need to check the return code (rc) of the returned result.
In order to "automate" this, for example when chaining multiple calls with async where you want to exit when one of the calls encounters a "non-technical" error, you can wrap your callback with the function below:
```javascript
function wrap (callback) {
return function (error, result) {
if (error) {
return callback(error);
} else {
if (result.rc && result.rc !== 0) {
const e = new Error('HDI call failed!')
e.result = result
return callback(e, result);
} else {
return callback(null, result);
}
}
}
}
```
**This document only provides a really high-level and shallow overview of the API. For a more detailed, technical documentation, refer to the JSDoc. To generate the documentation, run `npm install jsdoc`,`npm install ink-docstrap` and then `npm run documentation`. The documentation can then be found in the `docs` folder.**
## Using the HDI API

@@ -34,5 +53,6 @@ Access to the _SYS_DI API is provided by the `HDI` class. Access to this API requires HANA server version: 1.00.120 or newer. To work with the API, simply construct a new object, as can be seen in the following (ES6-based) example:

```javascript
'use strict';
const { HDI } = require('@sap/hdi');
#This credentials object will be directly passed to the hdb client. Any options accepted by the hdb client can be passed.
// This credentials object will be directly passed to the @sap/hana-client client. Any options accepted by the @sap/hana-client client can be passed.
const credentials = {

@@ -74,3 +94,3 @@ host : <host>,

Example: Deploying files to a container
Example: Deploying files to an existing container, assuming that the container exists and has been configured correctly.

@@ -86,3 +106,3 @@ ```javascript

// This credentials object will be directly passed to the hdb client. Any options accepted by the hdb client can be passed.
// This credentials object will be directly passed to the @sap/hana-client client. Any options accepted by the @sap/hana-client client can be passed.
const credentials = {

@@ -95,20 +115,10 @@ host: 'host',

const containerUserCredentials = {
host: 'host',
port: 'port',
user: 'user',
password: 'password'
};
const containerName = 'container_name';
const hdi = new HDI(credentials, // Credentials to use for the HANA system.
const container = new Container(containerName, // Name of the container. Does not have to exist yet but has to exist before calling any methods.
credentials, // Credentials to use for the HANA system.
credentials.user // Schema where the user used for the connection has privileges to create temporary tables, for example the user's own schema.
);
const containerUser = new Container(containerName, // Name of the container. Does not have to exist yet but has to exist before calling any methods.
containerUserCredentials, // Credentials to use for the HANA system.
containerUserCredentials.user // Schema where the user used for the connection has privileges to create temporary tables, for example the user's own schema.
);
const fPath = 'folder/';

@@ -134,48 +144,44 @@

const params = [new Parameter('ignore_work', 'TRUE'), new Parameter('ignore_deployed', 'TRUE')];
/**
* Get the default privileges to work with a container and grant them to the container user.
*/
const handlePrivileges = (cb) => {
hdi.getDefaultContainerUserPrivileges('', containerUserCredentials.user, (e, privileges) => {
if (e) {
return cb(e);
function wrap (callback) {
return function (error, result) {
if (error) {
return callback(error);
} else {
if (result.rc && result.rc !== 0) {
const e = new Error('HDI call failed!')
e.result = result
return callback(e, result);
} else {
return callback(null, result);
}
}
hdi.grantContainerApiPrivileges(containerName, privileges, null, cb);
});
};
/**
* Get the default libraries and allow them for the container.
*/
const handleLibraries = (cb) => {
hdi.getDefaultLibraries((e, libraries) => {
if (e) {
return cb(e);
}
hdi.configureLibraries(containerName, libraries, null, cb);
});
};
}
}
const tasks = [
(cb) => hdi.connect(cb),
(cb) => hdi.createContainer(containerName, null, cb),
handleLibraries,
handlePrivileges,
(cb) => containerUser.connect(cb),
(cb) => containerUser.lock(0, null, cb),
(cb) => containerUser.write(filesFoldersContent, null, cb),
(cb) => containerUser.status(null, null, cb),
(cb) => containerUser.list(null, null, cb),
(cb) => containerUser.make(files, null, null, null, cb),
(cb) => containerUser.unlock(cb),
(cb) => containerUser.connect(wrap(cb)),
(cb) => containerUser.lock(0, null, wrap(cb)),
(cb) => containerUser.write(filesFoldersContent, null, wrap(cb)),
(cb) => containerUser.status(null, null, wrap(cb)),
(cb) => containerUser.list(null, null, wrap(cb)),
(cb) => containerUser.make(files, null, null, null, wrap(cb)),
(cb) => containerUser.unlock(wrap(cb)),
(cb) => {
containerUser.disconnect(); cb(null, 'OK: disconnected.');
},
(cb) => hdi.dropContainer(containerName, params, cb)
}
];
async.series(tasks, (e, results) => {
/*
*Check for errors
*Check if all results have return code (rc) equal 0
*If all rc are 0 and there are no errors, everything was successful.
*/
if(e){
console.error(e);
process.exit(1);
} else {
console.log(results);
/**
Work with the results.
**/
}
});

@@ -193,3 +199,3 @@ ```

#This credentials object will be directly passed to the hdb client. Any options accepted by the hdb client can be passed.
// This credentials object will be directly passed to the @sap/hana-client client. Any options accepted by the @sap/hana-client client can be passed.
const credentials = {

@@ -222,3 +228,3 @@ host : <host>,

#This credentials object will be directly passed to the hdb client. Any options accepted by the hdb client can be passed.
// This credentials object will be directly passed to the @sap/hana-client client. Any options accepted by the @sap/hana-client client can be passed.
var credentials = {

@@ -225,0 +231,0 @@ host : <host>,

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc