@sap/async-xsjs 1.0.8 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,35 @@ This project adheres to [Semantic Versioning](http://semver.org/).
5
5
 
6
6
  The format is based on [Keep a Changelog](http://keepachangelog.com/).
7
7
 
8
+ <a name="2.0.1"></a>
9
+ ## 2.0.1 - 2024-07-23
10
+
11
+ ### Fixed
12
+ - Fixed executePromise and executeBatch function in the hdb connection interface
13
+
14
+ ### Updated
15
+ - Dependent node module versions updated to latest versions to support Node 20.
16
+ - Updated hana-client to v2.21.28
17
+ - Updated express version to 4.19.2 to fix the security vulnerability.
18
+ - Updated @sap/node-jwt version to 1.6.23 to fix the security vulnerability.
19
+ - Updated @sap/node-vsi version to 1.4.27 to fix the security vulnerability.
20
+ - Updated nodemailer version to 6.9.9 to fix the security vulnerability.
21
+ - Updated moment-timezone version to 0.5.35 to fix the security vulnerability.
22
+
23
+ <a name="2.0.0"></a>
24
+ ## 2.0.0 - 2023-12-08
25
+
26
+ ### Added
27
+ - Added Node.js 20.x support.
28
+
29
+ ### Updated
30
+ - Dependent node module versions updated to latest versions to support Node 20.
31
+ - Updated axios version to 1.6.2 to fix the security vulnerability.
32
+
33
+ ### Removed
34
+ - Removed support Node.js 16.x
35
+ - Removed text-mining and text-analysis features.
36
+
8
37
  <a name="1.0.8"></a>
9
38
  ## 1.0.8 - 2023-10-20
10
39
 
@@ -71,4 +100,4 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/).
71
100
  <a name="1.0.0"></a>
72
101
  ## 1.0.0 - 2023-01-26
73
102
 
74
- ### Initial release
103
+ ### Initial release
package/lib/logging.js CHANGED
@@ -3,7 +3,7 @@
3
3
  var logging = require('@sap/logging');
4
4
 
5
5
  var CATEGORY = '/CompatibilityLayer';
6
- var appContext = logging.createAppContext({ csnComponent: 'BC-XS-JS' });
6
+ var appContext = logging.createAppContext({ csnComponent: 'BC-XS-ASYNCJS' });
7
7
  var logContext = appContext.createLogContext({ id: '' });
8
8
  var logger = logContext.getLogger(CATEGORY);
9
9
  logger.warn = logger.warning;
package/lib/runtime.js CHANGED
@@ -318,7 +318,6 @@ Runtime.prototype.createBaseContext = function (req, locale, traceOptions) {
318
318
  var dbReqOptions = hanaDbOptions.forRequest(req, locale);
319
319
  context.db = new xs.db.DB(dbReqOptions);
320
320
  context.hdb = new xs.db.HDB(dbReqOptions, traceObject._tracer);
321
- context.text = xs.text.create(context.db);
322
321
  }
323
322
 
324
323
  var secStoreDbOptions = this.get('secureStoreDbOptions');
@@ -6,11 +6,17 @@ module.exports.executeBatchPromise = executeBatchPromise;
6
6
 
7
7
  async function executeBatchPromise (stmt, args) {
8
8
  var err = null;
9
- try {
10
- await stmt.executeBatch(args);
11
- } catch (error) {
9
+ await new Promise((resolve, reject) => {
10
+ stmt.executeBatch(args, {}, (error, res) => {
11
+ if (error) {
12
+ reject(error);
13
+ } else {
14
+ resolve(res);
15
+ }
16
+ });
17
+ }).catch(error => {
12
18
  err = error;
13
- }
19
+ });
14
20
  var statuses = stmt.getRowStatus();
15
21
 
16
22
  if (!err) {
@@ -490,12 +490,27 @@ async function executePromise(tracer, client, sql, sqlArgs) {
490
490
  if (isBatch) {
491
491
  result = await executeBatchPromise(statement, args);
492
492
  } else {
493
- result = await statement.execute(args);
493
+ result = await new Promise((resolve, reject) => {
494
+ statement.execute(args, {}, (err, res) => {
495
+ if (err) {
496
+ reject(err);
497
+ } else {
498
+ resolve(res);
499
+ }
500
+ });
501
+ });
494
502
  }
495
503
  return result;
496
504
  } else {
497
-
498
- var rows = await statement.execute(args) || [];
505
+ var rows = await new Promise((resolve, reject) => {
506
+ statement.execute(args, {}, (err, res) => {
507
+ if (err) {
508
+ reject(err);
509
+ } else {
510
+ resolve(res);
511
+ }
512
+ });
513
+ }) || [];
499
514
  Object.defineProperty(rows, 'columnInfo', { value: statement.getColumnInfo() });
500
515
  await afterStatementDropPromise(tracer, statement);
501
516
  return rows;
@@ -522,4 +537,4 @@ function applyDefaultConversions(tracer, sqlArgs, parameterInfo) {
522
537
 
523
538
  return convert(tracer, current, parameterInfo[i].nativeType);
524
539
  });
525
- }
540
+ }
package/lib/xsjs/index.js CHANGED
@@ -10,4 +10,3 @@ exports.security = require('./security');
10
10
  exports.trace = require('./trace/trace');
11
11
  exports.util = require('./util');
12
12
  exports.require = require('./require');
13
- exports.text = require('./text');