oracledb 6.7.2 → 6.9.0

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.
Files changed (84) hide show
  1. package/LICENSE.txt +1 -1
  2. package/NOTICE.txt +1 -1
  3. package/README.md +39 -3
  4. package/build/Release/oracledb-6.9.0-darwin-arm64.node +0 -0
  5. package/build/Release/oracledb-6.9.0-darwin-arm64.node-buildinfo.txt +1 -0
  6. package/build/Release/oracledb-6.9.0-darwin-x64.node +0 -0
  7. package/build/Release/oracledb-6.9.0-darwin-x64.node-buildinfo.txt +1 -0
  8. package/build/Release/oracledb-6.9.0-js-buildinfo.txt +1 -0
  9. package/build/Release/oracledb-6.9.0-linux-arm64.node +0 -0
  10. package/build/Release/oracledb-6.9.0-linux-arm64.node-buildinfo.txt +1 -0
  11. package/build/Release/oracledb-6.9.0-linux-x64.node +0 -0
  12. package/build/Release/oracledb-6.9.0-linux-x64.node-buildinfo.txt +1 -0
  13. package/build/Release/oracledb-6.9.0-win32-x64.node +0 -0
  14. package/build/Release/oracledb-6.9.0-win32-x64.node-buildinfo.txt +1 -0
  15. package/lib/aqMessage.js +10 -1
  16. package/lib/configProviders/file.js +72 -0
  17. package/lib/connection.js +153 -4
  18. package/lib/dbObject.js +51 -10
  19. package/lib/errors.js +144 -36
  20. package/lib/impl/connection.js +24 -1
  21. package/lib/impl/datahandlers/buffer.js +92 -1
  22. package/lib/impl/datahandlers/constants.js +2 -0
  23. package/lib/impl/datahandlers/oson.js +15 -1
  24. package/lib/impl/datahandlers/vector.js +72 -27
  25. package/lib/impl/pool.js +10 -1
  26. package/lib/impl/resultset.js +5 -4
  27. package/lib/lob.js +9 -1
  28. package/lib/oracledb.js +209 -20
  29. package/lib/pool.js +12 -1
  30. package/lib/poolStatistics.js +3 -1
  31. package/lib/settings.js +5 -1
  32. package/lib/thin/connection.js +130 -12
  33. package/lib/thin/dbObject.js +46 -13
  34. package/lib/thin/lob.js +2 -3
  35. package/lib/thin/pool.js +112 -31
  36. package/lib/thin/protocol/capabilities.js +8 -4
  37. package/lib/thin/protocol/constants.js +31 -1
  38. package/lib/thin/protocol/messages/auth.js +42 -6
  39. package/lib/thin/protocol/messages/base.js +98 -9
  40. package/lib/thin/protocol/messages/dataType.js +2 -1
  41. package/lib/thin/protocol/messages/execute.js +46 -4
  42. package/lib/thin/protocol/messages/fastAuth.js +6 -1
  43. package/lib/thin/protocol/messages/lobOp.js +5 -22
  44. package/lib/thin/protocol/messages/logOff.js +0 -1
  45. package/lib/thin/protocol/messages/sessionRelease.js +0 -1
  46. package/lib/thin/protocol/messages/transactionSwitch.js +12 -4
  47. package/lib/thin/protocol/messages/withData.js +10 -1
  48. package/lib/thin/protocol/packet.js +1 -1
  49. package/lib/thin/protocol/protocol.js +2 -1
  50. package/lib/thin/sqlnet/ANO.js +438 -0
  51. package/lib/thin/sqlnet/connStrategy.js +2 -1
  52. package/lib/thin/sqlnet/constants.js +5 -1
  53. package/lib/thin/sqlnet/ezConnectResolver.js +4 -2
  54. package/lib/thin/sqlnet/navNodes.js +22 -3
  55. package/lib/thin/sqlnet/networkSession.js +94 -16
  56. package/lib/thin/sqlnet/ntTcp.js +50 -3
  57. package/lib/thin/sqlnet/packet.js +32 -4
  58. package/lib/thin/sqlnet/sessionAtts.js +24 -2
  59. package/lib/thin/util.js +3 -8
  60. package/lib/transformer.js +13 -2
  61. package/lib/types.js +220 -8
  62. package/lib/util.js +77 -3
  63. package/lib/version.js +2 -2
  64. package/package/install.js +3 -3
  65. package/package/prunebinaries.js +6 -12
  66. package/package.json +2 -2
  67. package/{lib/configProviders/azure.js → plugins/configProviders/azure/index.js} +70 -63
  68. package/plugins/configProviders/azurevault/index.js +84 -0
  69. package/{lib → plugins}/configProviders/base.js +13 -3
  70. package/{lib/configProviders/ociobject.js → plugins/configProviders/ociobject/index.js} +43 -78
  71. package/plugins/configProviders/ocivault/index.js +100 -0
  72. package/plugins/token/extensionAzure/index.js +101 -0
  73. package/plugins/token/extensionOci/index.js +210 -0
  74. package/build/Release/oracledb-6.7.2-darwin-arm64.node +0 -0
  75. package/build/Release/oracledb-6.7.2-darwin-arm64.node-buildinfo.txt +0 -1
  76. package/build/Release/oracledb-6.7.2-darwin-x64.node +0 -0
  77. package/build/Release/oracledb-6.7.2-darwin-x64.node-buildinfo.txt +0 -1
  78. package/build/Release/oracledb-6.7.2-js-buildinfo.txt +0 -1
  79. package/build/Release/oracledb-6.7.2-linux-arm64.node +0 -0
  80. package/build/Release/oracledb-6.7.2-linux-arm64.node-buildinfo.txt +0 -1
  81. package/build/Release/oracledb-6.7.2-linux-x64.node +0 -0
  82. package/build/Release/oracledb-6.7.2-linux-x64.node-buildinfo.txt +0 -1
  83. package/build/Release/oracledb-6.7.2-win32-x64.node +0 -0
  84. package/build/Release/oracledb-6.7.2-win32-x64.node-buildinfo.txt +0 -1
package/lib/types.js CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright (c) 2022, 2024, Oracle and/or its affiliates.
1
+ // Copyright (c) 2022, 2025, Oracle and/or its affiliates.
2
2
 
3
3
  //-----------------------------------------------------------------------------
4
4
  //
@@ -33,6 +33,7 @@ const util = require('util');
33
33
  const dbTypeByNum = new Map();
34
34
  const dbTypeByOraTypeNum = new Map();
35
35
  const dbTypeByColumnTypeName = new Map();
36
+ const MAX_UINT32 = Math.pow(2, 32) - 1;
36
37
 
37
38
  // define class used for database types
38
39
  class DbType {
@@ -145,7 +146,7 @@ const DB_TYPE_INTERVAL_DS = new DbType(2015,
145
146
  { oraTypeNum: 183, bufferSizeFactor: 11 });
146
147
  const DB_TYPE_INTERVAL_YM = new DbType(2016,
147
148
  "DB_TYPE_INTERVAL_YM", "INTERVAL YEAR TO MONTH",
148
- { oraTypeNum: 182 });
149
+ { oraTypeNum: 182, bufferSizeFactor: 5 });
149
150
  const DB_TYPE_JSON = new DbType(2027,
150
151
  "DB_TYPE_JSON", "JSON",
151
152
  { oraTypeNum: 119 });
@@ -321,14 +322,9 @@ const DB_TYPE_FETCH_TYPE_MAP = new Map([
321
322
  ]);
322
323
 
323
324
  // additional aliases for types by column type name
324
- dbTypeByColumnTypeName.set("DOUBLE PRECISION", DB_TYPE_NUMBER);
325
- dbTypeByColumnTypeName.set("FLOAT", DB_TYPE_NUMBER);
326
- dbTypeByColumnTypeName.set("INTEGER", DB_TYPE_NUMBER);
327
325
  dbTypeByColumnTypeName.set("PL/SQL BOOLEAN", DB_TYPE_BOOLEAN);
328
326
  dbTypeByColumnTypeName.set("PL/SQL BINARY INTEGER", DB_TYPE_BINARY_INTEGER);
329
327
  dbTypeByColumnTypeName.set("PL/SQL PLS INTEGER", DB_TYPE_BINARY_INTEGER);
330
- dbTypeByColumnTypeName.set("REAL", DB_TYPE_NUMBER);
331
- dbTypeByColumnTypeName.set("SMALLINT", DB_TYPE_NUMBER);
332
328
  dbTypeByColumnTypeName.set("TIMESTAMP WITH LOCAL TZ", DB_TYPE_TIMESTAMP_LTZ);
333
329
  dbTypeByColumnTypeName.set("TIMESTAMP WITH TZ", DB_TYPE_TIMESTAMP_TZ);
334
330
 
@@ -339,6 +335,219 @@ class JsonId extends Uint8Array {
339
335
  }
340
336
  }
341
337
 
338
+ // Represents the SparseVector.
339
+ // indices must be an regular Array
340
+ // values can be regular or typedArray.
341
+ class SparseVector {
342
+ constructor(input) {
343
+ this._indices = new Uint32Array(0);
344
+ this._values = new Float64Array(0);
345
+ this._numDimensions = 0;
346
+
347
+ if (!input) {
348
+ return;
349
+ }
350
+ if (typeof input === 'object' &&
351
+ "numDimensions" in input &&
352
+ "indices" in input &&
353
+ "values" in input
354
+ ) {
355
+ // Object has valid properties for Sparse.
356
+ this._fromObject(input);
357
+ } else if (typeof input === 'string') {
358
+ // initialize from string.
359
+ this._fromString(input);
360
+ } else if (this._validDenseArray(input)) {
361
+ // dense array
362
+ this._fromDense(input);
363
+ } else {
364
+ errors.throwErr(errors.ERR_VECTOR_SPARSE_INVALID_INPUT);
365
+ }
366
+ }
367
+
368
+ _validDenseArray(value) {
369
+ return (value instanceof Float32Array ||
370
+ value instanceof Float64Array ||
371
+ value instanceof Int8Array || (Object.getPrototypeOf(value)
372
+ === Uint8Array.prototype) || Array.isArray(value));
373
+ }
374
+
375
+ // Check if indexArray and valuesArray have the same length
376
+ static _validateLengths(indices, values) {
377
+ if (indices.length !== values.length) {
378
+ if (!(values instanceof Uint8Array)) {
379
+ // Skip for binary vector format
380
+ errors.throwErr(errors.ERR_VECTOR_SPARSE_INDICES_VALUES_NOT_EQUAL);
381
+ }
382
+ }
383
+ }
384
+
385
+ _updateProperties(dims, indices, values) {
386
+ if (!this._validDenseArray(values)) {
387
+ errors.throwErr(errors.ERR_VECTOR_SPARSE_VALUES_IS_NOT_ARRAY);
388
+ }
389
+ if (!(indices instanceof Uint32Array) && !Array.isArray(indices)) {
390
+ errors.throwErr(errors.ERR_VECTOR_SPARSE_INDICES_IS_NOT_ARRAY);
391
+ }
392
+ SparseVector._validateLengths(indices, values);
393
+ if (!(typeof dims === 'number' && Number.isInteger(dims) && dims > 0)) {
394
+ errors.throwErr(errors.ERR_VECTOR_SPARSE_DIMS_IS_NOT_INTEGER);
395
+ }
396
+
397
+ this._numDimensions = dims;
398
+ this._indices = indices;
399
+ this._values = values;
400
+ this._convertToTypedArrays();
401
+ }
402
+
403
+ _fromObject(input) {
404
+ this._updateProperties(input.numDimensions, input.indices, input.values);
405
+ }
406
+
407
+ _convertToTypedArrays() {
408
+ // convert to typed arrays.
409
+ if (!(this._indices instanceof Uint32Array)) {
410
+ // validate elements are valid uint32 type.
411
+ const indices = new Uint32Array(this._indices.map((x, index) => {
412
+ if (typeof x !== 'number' || !Number.isInteger(x)) {
413
+ errors.throwErr(errors.ERR_VECTOR_SPARSE_INDICES_ELEM_IS_NOT_VALID, index);
414
+ }
415
+ if (x < 0 || x > MAX_UINT32 || x > (this.numDimensions - 1)) {
416
+ errors.throwErr(errors.ERR_VECTOR_SPARSE_INDICES_ELEM_IS_NOT_VALID,
417
+ index);
418
+ }
419
+ return x;
420
+ }));
421
+ this._indices = indices;
422
+ }
423
+
424
+ this._values = Array.isArray(this._values) ? new Float64Array(this._values)
425
+ : this._values;
426
+ }
427
+
428
+ // Initialize the state using the dense array.
429
+ // The length of input is assumed to be same as
430
+ // dimensions of sparse Vector column.
431
+ // values will be an array even if input is a typedArray.
432
+ _fromDense(input) {
433
+ this._indices = [];
434
+ this._values = [];
435
+
436
+ for (let i = 0; i < input.length; i++) {
437
+ if (input[i] !== 0) {
438
+ this._indices.push(i);
439
+ this._values.push(input[i]);
440
+ }
441
+ }
442
+ this._numDimensions = input.length;
443
+ this._convertToTypedArrays();
444
+ }
445
+
446
+ // parse a string input into a sparse vector
447
+ _fromString(str) {
448
+ let data;
449
+
450
+ // verify it is a valid JSON
451
+ try {
452
+ // use simple tokenizer?
453
+ data = JSON.parse(str);
454
+ } catch (e) {
455
+ errors.throwErr(errors.ERR_VECTOR_SPARSE_INVALID_JSON);
456
+ }
457
+
458
+ // Check if data is an array with exactly 3 elements
459
+ if (!Array.isArray(data) || data.length !== 3) {
460
+ errors.throwErr(errors.ERR_VECTOR_SPARSE_INVALID_STRING);
461
+ }
462
+
463
+ const [dims, indices, values] = data;
464
+ this._updateProperties(dims, indices, values);
465
+ }
466
+
467
+ // Internal method to create an instance
468
+ static create(sparseValue) {
469
+ SparseVector._validateLengths(sparseValue.indices, sparseValue.values);
470
+ const instance = Object.create(this.prototype);
471
+ instance._numDimensions = sparseValue.numDimensions;
472
+ instance._indices = sparseValue.indices;
473
+ instance._values = sparseValue.values;
474
+ return instance;
475
+ }
476
+
477
+ get indices() {
478
+ return this._indices;
479
+ }
480
+
481
+ get values() {
482
+ return this._values;
483
+ }
484
+
485
+ get numDimensions() {
486
+ return this._numDimensions;
487
+ }
488
+
489
+ toJSON() {
490
+ return {
491
+ numDimensions: this._numDimensions,
492
+ indices: this._indices,
493
+ values: this._values,
494
+ };
495
+ }
496
+
497
+ // It always constructs a typedArray.
498
+ _createEmptyArray(input, len) {
499
+ if (Array.isArray(input)) {
500
+ return new Float64Array(len);
501
+ } else {
502
+ // same typedArray of input type.
503
+ return new input.constructor(len);
504
+ }
505
+ }
506
+
507
+ // Convert sparse vector to a dense vector
508
+ // It returns typed array.
509
+ dense() {
510
+ if (this._numDimensions === 0) {
511
+ return null;
512
+ }
513
+ const dense = this._createEmptyArray(this._values, this._numDimensions);
514
+ this._indices.forEach((index, i) => {
515
+ dense[index] = this._values[i];
516
+ });
517
+ return dense;
518
+ }
519
+ }
520
+
521
+ // Interval Year-to-Month Class
522
+ class IntervalYM {
523
+ constructor(obj) {
524
+ if (obj) {
525
+ errors.assertParamPropInt(obj, 1, "years");
526
+ errors.assertParamPropInt(obj, 1, "months");
527
+ }
528
+ this.years = obj?.years || 0;
529
+ this.months = obj?.months || 0;
530
+ }
531
+ }
532
+
533
+ // Interval Day-to-Second Class
534
+ class IntervalDS {
535
+ constructor(obj) {
536
+ if (obj) {
537
+ errors.assertParamPropInt(obj, 1, "days");
538
+ errors.assertParamPropInt(obj, 1, "hours");
539
+ errors.assertParamPropInt(obj, 1, "minutes");
540
+ errors.assertParamPropInt(obj, 1, "seconds");
541
+ errors.assertParamPropInt(obj, 1, "fseconds");
542
+ }
543
+ this.days = obj?.days || 0;
544
+ this.hours = obj?.hours || 0;
545
+ this.minutes = obj?.minutes || 0;
546
+ this.seconds = obj?.seconds || 0;
547
+ this.fseconds = obj?.fseconds || 0;
548
+ }
549
+ }
550
+
342
551
  module.exports = {
343
552
  DbType,
344
553
  DB_TYPE_BFILE,
@@ -376,5 +585,8 @@ module.exports = {
376
585
  getTypeByColumnTypeName,
377
586
  getTypeByNum,
378
587
  getTypeByOraTypeNum,
379
- JsonId
588
+ JsonId,
589
+ SparseVector,
590
+ IntervalYM,
591
+ IntervalDS
380
592
  };
package/lib/util.js CHANGED
@@ -1,4 +1,4 @@
1
- // Copyright (c) 2016, 2023, Oracle and/or its affiliates.
1
+ // Copyright (c) 2016, 2025, Oracle and/or its affiliates.
2
2
 
3
3
  //-----------------------------------------------------------------------------
4
4
  //
@@ -33,6 +33,26 @@ const util = require('util');
33
33
  const types = require('./types.js');
34
34
  const constants = require('./constants.js');
35
35
  const traceHandler = require('./traceHandler.js');
36
+ const crypto = require("crypto");
37
+
38
+ const pemHeaders = [
39
+ '-----BEGIN CERTIFICATE-----',
40
+ '-----BEGIN PUBLIC KEY-----',
41
+ '-----BEGIN PRIVATE KEY-----',
42
+ '-----BEGIN RSA PRIVATE KEY-----',
43
+ '-----BEGIN DSA PRIVATE KEY-----',
44
+ '-----BEGIN EC PRIVATE KEY-----',
45
+ '-----BEGIN ENCRYPTED PRIVATE KEY-----'
46
+ ];
47
+ const pemFooters = [
48
+ '-----END CERTIFICATE-----',
49
+ '-----END PUBLIC KEY-----',
50
+ '-----END PRIVATE KEY-----',
51
+ '-----END RSA PRIVATE KEY-----',
52
+ '-----END DSA PRIVATE KEY-----',
53
+ '-----END EC PRIVATE KEY-----',
54
+ '-----END ENCRYPTED PRIVATE KEY-----'
55
+ ];
36
56
 
37
57
  // set of valid network characters
38
58
  const validNetworkCharacterSet = new Set(['A', 'B', 'C', 'D', 'E', 'F', 'G',
@@ -80,6 +100,13 @@ function getInstallURL() {
80
100
  return ('Node-oracledb installation instructions: https://node-oracledb.readthedocs.io/en/latest/user_guide/installation.html');
81
101
  }
82
102
 
103
+ // check if a file has contents of a .pem file
104
+ function isPemFile(content) {
105
+ //remove any line breaks at the end of the content
106
+ content = content.trim();
107
+ return pemHeaders.some(header => content.includes(header)) &&
108
+ pemFooters.some(footer => content.endsWith(footer));
109
+ }
83
110
 
84
111
  // getInstallHelp returns a string with installation usage tips that may be helpful
85
112
  function getInstallHelp() {
@@ -372,6 +399,21 @@ function isShardingKey(value) {
372
399
  return true;
373
400
  }
374
401
 
402
+ function isAppContext(value) {
403
+ if (!Array.isArray(value))
404
+ return false;
405
+ for (let i = 0; i < value.length; i++) {
406
+ const element = value[i];
407
+ if (!Array.isArray(element) || element.length !== 3)
408
+ return false;
409
+ for (let j = 0; j < 3; j++) {
410
+ if (typeof element[j] !== 'string')
411
+ return false;
412
+ }
413
+ }
414
+ return true;
415
+ }
416
+
375
417
  function isSodaDocument(value) {
376
418
  return (value != null && value._sodaDocumentMarker);
377
419
  }
@@ -414,6 +456,34 @@ function normalizeXid(value) {
414
456
  return normalizedXid;
415
457
  }
416
458
 
459
+ //---------------------------------------------------------------------------
460
+ // isTransactionId()
461
+ //
462
+ // Validates if the given value is a sessionless transactionId
463
+ //---------------------------------------------------------------------------
464
+ function isTransactionId(value) {
465
+ return Buffer.isBuffer(value) || (typeof value === 'string');
466
+ }
467
+
468
+ //---------------------------------------------------------------------------
469
+ // normalizeTransactionId()
470
+ //
471
+ // Returns the normalized value of a sessionless transactionId as a buffer
472
+ // In case the value is null a random 36-byte UUID buffer is returned
473
+ //---------------------------------------------------------------------------
474
+ function normalizeTransactionId(value) {
475
+ let normalizedTransactionId = value;
476
+ if (normalizedTransactionId === undefined)
477
+ normalizedTransactionId = crypto.randomUUID();
478
+ if (typeof normalizedTransactionId === 'string') {
479
+ normalizedTransactionId = Buffer.from(normalizedTransactionId);
480
+ const len = normalizedTransactionId.length;
481
+ if ((len === 0) || (len > 64))
482
+ errors.throwErr(errors.ERR_INVALID_TRANSACTION_SIZE, len);
483
+ }
484
+ return normalizedTransactionId;
485
+ }
486
+
417
487
  function verifySodaDoc(content) {
418
488
  if (isSodaDocument(content))
419
489
  return content._impl;
@@ -501,7 +571,7 @@ function isVectorValue(value) {
501
571
  return (value instanceof Float32Array ||
502
572
  value instanceof Float64Array ||
503
573
  value instanceof Int8Array || (Object.getPrototypeOf(value)
504
- === Uint8Array.prototype));
574
+ === Uint8Array.prototype) || value instanceof types.SparseVector);
505
575
  }
506
576
 
507
577
  //-----------------------------------------------------------------------------
@@ -573,15 +643,19 @@ module.exports = {
573
643
  isObjectOrArray,
574
644
  isPrivilege,
575
645
  isShardingKey,
646
+ isAppContext,
576
647
  isSodaDocument,
577
648
  isTokenExpired,
578
649
  isTokenValid,
650
+ isTransactionId,
579
651
  isVectorValue,
580
652
  isXid,
653
+ normalizeTransactionId,
581
654
  normalizeXid,
582
655
  makeDate,
583
656
  sanitize,
584
657
  verifySodaDoc,
585
658
  wrapFn,
586
- wrapFns
659
+ wrapFns,
660
+ isPemFile
587
661
  };
package/lib/version.js CHANGED
@@ -30,7 +30,7 @@
30
30
 
31
31
  module.exports = {
32
32
  VERSION_MAJOR: 6,
33
- VERSION_MINOR: 7,
34
- VERSION_PATCH: 2,
33
+ VERSION_MINOR: 9,
34
+ VERSION_PATCH: 0,
35
35
  VERSION_SUFFIX: ''
36
36
  };
@@ -68,7 +68,7 @@ function warn(message) { // eslint-disable-line
68
68
  console.error.apply(console, args);
69
69
  }
70
70
 
71
- // This version of node-oracledb works with Node.js 14.6 or later.
71
+ // This version of node-oracledb works with Node.js 14.17 or later.
72
72
  // Note: the checked version is the minimum required for Node-API
73
73
  // compatibility. When new Node.js versions are released, older Node.js
74
74
  // versions are dropped from the node-oracledb test plan.
@@ -76,8 +76,8 @@ function warn(message) { // eslint-disable-line
76
76
  // Keep this code in sync with lib/oracledb.js
77
77
  function checkVersion() {
78
78
  const vs = process.version.substring(1).split(".").map(Number);
79
- errors.assert(vs[0] > 14 || (vs[0] === 14 && vs[1] >= 6),
80
- errors.ERR_NODE_TOO_OLD, nodbUtil.PACKAGE_JSON_VERSION, "14.6");
79
+ errors.assert(vs[0] > 14 || (vs[0] === 14 && vs[1] >= 17),
80
+ errors.ERR_NODE_TOO_OLD, nodbUtil.PACKAGE_JSON_VERSION, "14.17");
81
81
  }
82
82
 
83
83
  // Check for the binary node-oracledb module needed for "Thick mode".
@@ -1,4 +1,4 @@
1
- /* Copyright (c) 2019, 2023, Oracle and/or its affiliates. */
1
+ /* Copyright (c) 2019, 2025, Oracle and/or its affiliates. */
2
2
 
3
3
  /******************************************************************************
4
4
  *
@@ -47,11 +47,11 @@ const nodbUtil = require('../lib/util.js');
47
47
 
48
48
  const dir = nodbUtil.RELEASE_DIR; // contains the binaries
49
49
 
50
- let re = new RegExp(nodbUtil.BINARY_FILE);
50
+ const re = new RegExp(nodbUtil.BINARY_FILE);
51
51
 
52
52
  try {
53
- let f = fs.readdirSync(dir);
54
- let opt = process.argv[2];
53
+ const f = fs.readdirSync(dir);
54
+ const opt = process.argv[2];
55
55
 
56
56
  if (opt) {
57
57
  // 'npm run prune <option>' is called
@@ -76,18 +76,12 @@ try {
76
76
  console.error(err.message);
77
77
  }
78
78
 
79
- async function removeFileorDir(fileOrDirPath) {
79
+ function removeFileorDir(fileOrDirPath) {
80
80
  try {
81
81
  const isDir = fs.statSync(fileOrDirPath).isDirectory();
82
82
  if (isDir) {
83
83
  // Remove the directory and its files recursively
84
- // Use fs.promises for Node.js versions 14.6-14.13,
85
- // which do not support fs.rmSync()
86
- const vs = process.version.substring(1).split(".").map(Number);
87
- if (vs[0] > 14 || (vs[0] === 14 && vs[1] >= 14))
88
- fs.rmSync(fileOrDirPath, { recursive: true, force: true });
89
- else
90
- await fs.promises.rmdir(fileOrDirPath, { recursive: true, force: true });
84
+ fs.rmSync(fileOrDirPath, { recursive: true, force: true });
91
85
  } else {
92
86
  // Remove the file or the symlink synchronously
93
87
  fs.unlinkSync(fileOrDirPath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oracledb",
3
- "version": "6.7.2",
3
+ "version": "6.9.0",
4
4
  "description": "A Node.js module for Oracle Database access from JavaScript and TypeScript",
5
5
  "license": "(Apache-2.0 OR UPL-1.0)",
6
6
  "homepage": "http://oracle.github.io/node-oracledb/",
@@ -34,7 +34,7 @@
34
34
  "prune": "node package/prunebinaries.js"
35
35
  },
36
36
  "engines": {
37
- "node": ">=14.6"
37
+ "node": ">=14.17"
38
38
  },
39
39
  "maintainers": [
40
40
  {