oracledb 6.6.0 → 6.7.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.
- package/README.md +2 -2
- package/build/Release/oracledb-6.7.0-darwin-arm64.node +0 -0
- package/build/Release/oracledb-6.7.0-darwin-arm64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-6.7.0-darwin-x64.node +0 -0
- package/build/Release/oracledb-6.7.0-darwin-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-6.7.0-js-buildinfo.txt +1 -0
- package/build/Release/oracledb-6.7.0-linux-arm64.node +0 -0
- package/build/Release/oracledb-6.7.0-linux-arm64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-6.7.0-linux-x64.node +0 -0
- package/build/Release/oracledb-6.7.0-linux-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-6.7.0-win32-x64.node +0 -0
- package/build/Release/oracledb-6.7.0-win32-x64.node-buildinfo.txt +1 -0
- package/examples/README.md +2 -0
- package/lib/configProviders/azure.js +26 -15
- package/lib/configProviders/base.js +23 -37
- package/lib/configProviders/ociobject.js +53 -45
- package/lib/connection.js +70 -3
- package/lib/errors.js +13 -6
- package/lib/impl/aqQueue.js +2 -1
- package/lib/impl/base.js +45 -0
- package/lib/impl/connection.js +53 -0
- package/lib/impl/lob.js +2 -1
- package/lib/impl/pool.js +15 -0
- package/lib/impl/resultset.js +2 -1
- package/lib/impl/sodaCollection.js +2 -1
- package/lib/impl/sodaDatabase.js +2 -1
- package/lib/impl/sodaDocCursor.js +2 -1
- package/lib/impl/sodaOperation.js +2 -1
- package/lib/lob.js +3 -2
- package/lib/oracledb.js +220 -35
- package/lib/pool.js +14 -5
- package/lib/settings.js +1 -0
- package/lib/thin/connection.js +150 -91
- package/lib/thin/pool.js +3 -0
- package/lib/thin/protocol/messages/auth.js +12 -6
- package/lib/thin/protocol/messages/base.js +3 -0
- package/lib/thin/protocol/messages/sessionRelease.js +1 -0
- package/lib/thin/protocol/messages/withData.js +2 -7
- package/lib/thin/protocol/protocol.js +23 -0
- package/lib/thin/sqlnet/connStrategy.js +9 -1
- package/lib/thin/sqlnet/constants.js +2 -0
- package/lib/thin/sqlnet/navNodes.js +14 -2
- package/lib/thin/sqlnet/networkSession.js +9 -9
- package/lib/thin/sqlnet/ntTcp.js +1 -1
- package/lib/thin/sqlnet/sessionAtts.js +1 -1
- package/lib/thin/util.js +4 -3
- package/lib/traceHandler.js +133 -0
- package/lib/util.js +179 -33
- package/lib/version.js +1 -1
- package/package.json +1 -1
- package/build/Release/oracledb-6.6.0-darwin-arm64.node +0 -0
- package/build/Release/oracledb-6.6.0-darwin-arm64.node-buildinfo.txt +0 -1
- package/build/Release/oracledb-6.6.0-darwin-x64.node +0 -0
- package/build/Release/oracledb-6.6.0-darwin-x64.node-buildinfo.txt +0 -1
- package/build/Release/oracledb-6.6.0-js-buildinfo.txt +0 -1
- package/build/Release/oracledb-6.6.0-linux-arm64.node +0 -0
- package/build/Release/oracledb-6.6.0-linux-arm64.node-buildinfo.txt +0 -1
- package/build/Release/oracledb-6.6.0-linux-x64.node +0 -0
- package/build/Release/oracledb-6.6.0-linux-x64.node-buildinfo.txt +0 -1
- package/build/Release/oracledb-6.6.0-win32-x64.node +0 -0
- package/build/Release/oracledb-6.6.0-win32-x64.node-buildinfo.txt +0 -1
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
// Copyright (c) 2024, Oracle and/or its affiliates.
|
|
2
|
+
|
|
3
|
+
//-----------------------------------------------------------------------------
|
|
4
|
+
//
|
|
5
|
+
// This software is dual-licensed to you under the Universal Permissive License
|
|
6
|
+
// (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl and Apache License
|
|
7
|
+
// 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose
|
|
8
|
+
// either license.
|
|
9
|
+
//
|
|
10
|
+
// If you elect to accept the software under the Apache License, Version 2.0,
|
|
11
|
+
// the following applies:
|
|
12
|
+
//
|
|
13
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
14
|
+
// you may not use this file except in compliance with the License.
|
|
15
|
+
// You may obtain a copy of the License at
|
|
16
|
+
//
|
|
17
|
+
// https://www.apache.org/licenses/LICENSE-2.0
|
|
18
|
+
//
|
|
19
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
20
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
21
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
22
|
+
// See the License for the specific language governing permissions and
|
|
23
|
+
// limitations under the License.
|
|
24
|
+
//
|
|
25
|
+
//-----------------------------------------------------------------------------
|
|
26
|
+
|
|
27
|
+
'use strict';
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* TraceHandler interface defination which application needs to implement
|
|
31
|
+
* the hooks defined. The hooks will be called by the driver with traceContext
|
|
32
|
+
* data.
|
|
33
|
+
*
|
|
34
|
+
* TraceContext Data details.
|
|
35
|
+
* connectLevelConfig - Connection Config details.
|
|
36
|
+
* protcol - tcp/tcps protocol.
|
|
37
|
+
* user - user/schema associated.
|
|
38
|
+
* instanceName - instance Name.
|
|
39
|
+
* pdbName - PDB name.
|
|
40
|
+
* serviceName - service name.
|
|
41
|
+
* connectString - connect string passed.
|
|
42
|
+
* hostName - host name.
|
|
43
|
+
* port - port number.
|
|
44
|
+
* poolMin - pool Min.
|
|
45
|
+
* poolMax - pool Max.
|
|
46
|
+
* poolIncrement - pool Increment.
|
|
47
|
+
*
|
|
48
|
+
* callLevelConfig - Post connection, call leveldetails.
|
|
49
|
+
* statement - SQL statement.
|
|
50
|
+
* values - Bind values.
|
|
51
|
+
*
|
|
52
|
+
* additionalConfig - Custom Config based on the methods executed.
|
|
53
|
+
* args - input arguments of function.
|
|
54
|
+
* self - the current instance on which function is called.
|
|
55
|
+
* result - the result object returned after calling function.
|
|
56
|
+
* implicitRelease - true if implicit release is done.
|
|
57
|
+
*
|
|
58
|
+
*/
|
|
59
|
+
|
|
60
|
+
class TraceHandlerBase {
|
|
61
|
+
|
|
62
|
+
constructor() {
|
|
63
|
+
this._config = {};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// check if sending traces is enabled.
|
|
67
|
+
isEnabled() {
|
|
68
|
+
return (this._config.enable);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Enable sending traces
|
|
72
|
+
enable() {
|
|
73
|
+
this._config.enable = true;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// Disable sending traces
|
|
77
|
+
disable() {
|
|
78
|
+
this._config.enable = false;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// It is called before invoking a public async method.
|
|
82
|
+
onEnterFn(/*traceContext*/) {
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// It is called after invoking a public async method.
|
|
86
|
+
// The same traceContext object passed inside onEnterFn
|
|
87
|
+
// will be passed in this function.
|
|
88
|
+
onExitFn(/*traceContext*/) {
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
// called when a round trip is begun
|
|
92
|
+
// OpenTelemetry will start a new span as a child of the public API span.
|
|
93
|
+
onBeginRoundTrip(/*traceContext*/) {
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// called when a round trip has ended
|
|
97
|
+
// OpenTelemetry will end the span
|
|
98
|
+
// The same traceContext object passed inside onBeginRoundTrip
|
|
99
|
+
// is passed here.
|
|
100
|
+
onEndRoundTrip(/*traceContext*/) {
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// singleton object pointing to traceHandler instance.
|
|
106
|
+
let _currentTraceObject;
|
|
107
|
+
|
|
108
|
+
// It enables user defined implementation of
|
|
109
|
+
// TraceHandlerBase interface to be used.
|
|
110
|
+
function setTraceInstance(obj) {
|
|
111
|
+
_currentTraceObject = obj;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// It returns the user defined instance implementing the interface.
|
|
115
|
+
function getTraceInstance() {
|
|
116
|
+
return _currentTraceObject;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// returns if tracing is enabled.
|
|
120
|
+
function isEnabled() {
|
|
121
|
+
return _currentTraceObject?.isEnabled();
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
module.exports = {
|
|
125
|
+
// class
|
|
126
|
+
TraceHandlerBase,
|
|
127
|
+
|
|
128
|
+
// methods
|
|
129
|
+
setTraceInstance,
|
|
130
|
+
getTraceInstance,
|
|
131
|
+
isEnabled
|
|
132
|
+
|
|
133
|
+
};
|
package/lib/util.js
CHANGED
|
@@ -32,6 +32,16 @@ const process = require('process');
|
|
|
32
32
|
const util = require('util');
|
|
33
33
|
const types = require('./types.js');
|
|
34
34
|
const constants = require('./constants.js');
|
|
35
|
+
const traceHandler = require('./traceHandler.js');
|
|
36
|
+
|
|
37
|
+
// set of valid network characters
|
|
38
|
+
const validNetworkCharacterSet = new Set(['A', 'B', 'C', 'D', 'E', 'F', 'G',
|
|
39
|
+
'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V',
|
|
40
|
+
'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k',
|
|
41
|
+
'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
|
|
42
|
+
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '<', '>', '/', '\\', ',',
|
|
43
|
+
'.', ':', ';', '\'', '"', '-', '_', '$', '+', '*', '#', '&', '!', '%', '?',
|
|
44
|
+
'@']);
|
|
35
45
|
|
|
36
46
|
// node-oracledb version number
|
|
37
47
|
let packageJSON;
|
|
@@ -54,6 +64,17 @@ const BUILD_FILE = 'oracledb.node';
|
|
|
54
64
|
// Staging directory used by maintainers building the npm package
|
|
55
65
|
const STAGING_DIR = 'package/Staging';
|
|
56
66
|
|
|
67
|
+
//-----------------------------------------------------------------------------
|
|
68
|
+
// assertParamPropNetworkName()
|
|
69
|
+
//
|
|
70
|
+
// Asserts input vaue and sanitized value passes specified condition
|
|
71
|
+
// -----------------------------------------------------------------------------
|
|
72
|
+
function assertParamPropNetworkName(obj, parameterNum, propName) {
|
|
73
|
+
errors.assertParamPropString(obj, parameterNum, propName);
|
|
74
|
+
const sanitizedValue = sanitize(obj[propName]);
|
|
75
|
+
errors.assertParamPropValue(obj[propName] === sanitizedValue, parameterNum, propName);
|
|
76
|
+
}
|
|
77
|
+
|
|
57
78
|
// getInstallURL returns a string with installation URL
|
|
58
79
|
function getInstallURL() {
|
|
59
80
|
return ('Node-oracledb installation instructions: https://node-oracledb.readthedocs.io/en/latest/user_guide/installation.html');
|
|
@@ -113,6 +134,79 @@ function getInstallHelp() {
|
|
|
113
134
|
return mesg;
|
|
114
135
|
}
|
|
115
136
|
|
|
137
|
+
function getOperationName(methodName) {
|
|
138
|
+
const className = (this.constructor.name === 'Object') ? 'oracledb'
|
|
139
|
+
: `oracledb.${this.constructor.name}`;
|
|
140
|
+
return `${className}.${methodName}`;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// It returns an userContext after populating the traceContext with this below data.
|
|
144
|
+
// Operation derived from className, methodName.
|
|
145
|
+
// Initialize the callLevelTraceData.
|
|
146
|
+
// traceContext is filled.
|
|
147
|
+
function traceEnterFn(traceContext) {
|
|
148
|
+
if (!traceHandler.isEnabled()) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// initialize callLevel data
|
|
153
|
+
if (this._impl) {
|
|
154
|
+
this._impl._callLevelTraceData = {};
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
// fill the traceContext.
|
|
158
|
+
traceContext.additionalConfig = {};
|
|
159
|
+
traceContext.additionalConfig.self = this;
|
|
160
|
+
traceContext.additionalConfig.args = traceContext.args;
|
|
161
|
+
traceContext.operation = getOperationName.call(this, traceContext.fn.name);
|
|
162
|
+
traceContext.connectLevelConfig = this._impl?._getConnectTraceConfig();
|
|
163
|
+
traceHandler.getTraceInstance().onEnterFn(traceContext);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// It calls the onExitFn method providing the userContext resturned in onEnterFn.
|
|
167
|
+
function traceExitFn(traceContext, result, err) {
|
|
168
|
+
const callExitFn = traceHandler.isEnabled();
|
|
169
|
+
if (!callExitFn) {
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// Fill the traceContext.
|
|
174
|
+
if (err) {
|
|
175
|
+
traceContext.error = Object.assign(({}, err));
|
|
176
|
+
}
|
|
177
|
+
traceContext.additionalConfig.result = result;
|
|
178
|
+
if (this._impl) {
|
|
179
|
+
// fill function call state.
|
|
180
|
+
traceContext.callLevelConfig = this._impl._callLevelTraceData;
|
|
181
|
+
}
|
|
182
|
+
if (['oracledb.getConnection', 'oracledb.createPool'].includes(traceContext.operation)) {
|
|
183
|
+
if (err) {
|
|
184
|
+
if (traceContext.args && traceContext.args.length >= 1) {
|
|
185
|
+
// connectString and user information is populated in traceContext,
|
|
186
|
+
// which is useful if an error happens and connection object is not created.
|
|
187
|
+
const config = {};
|
|
188
|
+
const inp = traceContext.args[0];
|
|
189
|
+
config.user = inp.user || inp.username;
|
|
190
|
+
config.connectString = inp.connectString || inp.connectionString;
|
|
191
|
+
traceContext.connectLevelConfig = config;
|
|
192
|
+
}
|
|
193
|
+
} else {
|
|
194
|
+
traceContext.connectLevelConfig = result._impl._getConnectTraceConfig();
|
|
195
|
+
}
|
|
196
|
+
} else if (traceContext.operation === 'oracledb.Pool.getConnection') {
|
|
197
|
+
if (!err) {
|
|
198
|
+
// we update the connectTraceConfig with more values with returned conn.
|
|
199
|
+
traceContext.connectLevelConfig = result._impl._getConnectTraceConfig();
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
traceHandler.getTraceInstance().onExitFn(traceContext);
|
|
204
|
+
if (this._impl) {
|
|
205
|
+
// cleanup the function call state.
|
|
206
|
+
this._impl._callLevelTraceData = undefined;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
116
210
|
// The callbackify function is used to wrap async methods to add optional
|
|
117
211
|
// callback support. If the last parameter passed to a method is a function,
|
|
118
212
|
// then it is assumed that the callback pattern is being used and the promise
|
|
@@ -124,9 +218,7 @@ function callbackify(func) {
|
|
|
124
218
|
// if last argument is not a function, simply invoke the function as usual
|
|
125
219
|
// and a promise will be returned
|
|
126
220
|
if (typeof arguments[arguments.length - 1] !== 'function') {
|
|
127
|
-
return func.apply(this, arguments)
|
|
128
|
-
throw errors.transformErr(err, stackCapture);
|
|
129
|
-
});
|
|
221
|
+
return func.apply(this, arguments);
|
|
130
222
|
}
|
|
131
223
|
|
|
132
224
|
// otherwise, resolve or reject the promise and invoke the callback
|
|
@@ -134,9 +226,7 @@ function callbackify(func) {
|
|
|
134
226
|
const cb = arguments[arguments.length - 1];
|
|
135
227
|
func.apply(this, args).then(function(result) {
|
|
136
228
|
cb(null, result);
|
|
137
|
-
},
|
|
138
|
-
cb(errors.transformErr(err, stackCapture));
|
|
139
|
-
});
|
|
229
|
+
}, cb);
|
|
140
230
|
};
|
|
141
231
|
if (func.name) {
|
|
142
232
|
Object.defineProperty(wrapper, 'name', { value: func.name });
|
|
@@ -144,17 +234,30 @@ function callbackify(func) {
|
|
|
144
234
|
return wrapper;
|
|
145
235
|
}
|
|
146
236
|
|
|
147
|
-
//
|
|
148
|
-
//
|
|
149
|
-
|
|
150
|
-
|
|
237
|
+
// the wrapFn() function is used to wrap a single method to ensure that calls
|
|
238
|
+
// are serialized and that concurrent calls are prevented where that is needed;
|
|
239
|
+
// this method also ensures that error information is captured correctly.
|
|
240
|
+
// If tracing is enabled, the hooks onEnterFn and onExitFn are called after
|
|
241
|
+
// the input traceContext is prepared. The func is passed in traceContext
|
|
242
|
+
// which is filled with additional context inside onEnterFn.
|
|
243
|
+
function wrapFn(func, serialize, preventConcurrentErrorCode) {
|
|
244
|
+
const wrapper = async function wrapper() {
|
|
151
245
|
|
|
152
246
|
let connImpl;
|
|
247
|
+
const traceEnabled = traceHandler.isEnabled();
|
|
248
|
+
const traceContext = {fn: func, args: arguments};
|
|
249
|
+
|
|
250
|
+
// if concurrent operations are to be prevented, check for that now
|
|
251
|
+
if (preventConcurrentErrorCode) {
|
|
252
|
+
if (this._isActive)
|
|
253
|
+
errors.throwErr(preventConcurrentErrorCode);
|
|
254
|
+
this._isActive = true;
|
|
255
|
+
}
|
|
153
256
|
|
|
154
257
|
// determine the connection implementation associated with the object, if
|
|
155
258
|
// one currently exists and acquire the "lock"; this simply checks to see
|
|
156
259
|
// if another operation is in progress, and if so, waits for it to complete
|
|
157
|
-
if (this._impl) {
|
|
260
|
+
if (serialize && this._impl) {
|
|
158
261
|
connImpl = this._impl._getConnImpl();
|
|
159
262
|
await connImpl._acquireLock();
|
|
160
263
|
}
|
|
@@ -162,48 +265,54 @@ function serialize(func) {
|
|
|
162
265
|
// call the function and ensure that the lock is "released" once the
|
|
163
266
|
// function has completed -- either successfully or in failure -- but only
|
|
164
267
|
// if a connection implementation is currently associated with this object
|
|
268
|
+
let result, tErr;
|
|
165
269
|
try {
|
|
166
|
-
|
|
270
|
+
if (traceEnabled) {
|
|
271
|
+
traceEnterFn.call(this, traceContext);
|
|
272
|
+
}
|
|
273
|
+
result = await traceContext.fn.apply(this, arguments);
|
|
274
|
+
return result;
|
|
275
|
+
} catch (err) {
|
|
276
|
+
tErr = errors.transformErr(err, wrapper);
|
|
277
|
+
throw tErr;
|
|
167
278
|
} finally {
|
|
168
279
|
if (connImpl)
|
|
169
280
|
connImpl._releaseLock();
|
|
281
|
+
if (preventConcurrentErrorCode) {
|
|
282
|
+
this._isActive = false;
|
|
283
|
+
}
|
|
284
|
+
if (traceEnabled) {
|
|
285
|
+
traceExitFn.call(this, traceContext, result, tErr);
|
|
286
|
+
}
|
|
170
287
|
}
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
288
|
|
|
174
|
-
function preventConcurrent(func, errorCode) {
|
|
175
|
-
return async function() {
|
|
176
|
-
if (this._isActive)
|
|
177
|
-
errors.throwErr(errorCode);
|
|
178
|
-
this._isActive = true;
|
|
179
|
-
try {
|
|
180
|
-
return await func.apply(this, arguments);
|
|
181
|
-
} finally {
|
|
182
|
-
this._isActive = false;
|
|
183
|
-
}
|
|
184
289
|
};
|
|
290
|
+
if (func.name) {
|
|
291
|
+
Object.defineProperty(wrapper, 'name', { value: func.name });
|
|
292
|
+
}
|
|
293
|
+
return wrapper;
|
|
185
294
|
}
|
|
186
295
|
|
|
187
296
|
// The wrapFns() function is used to wrap the named methods on the prototype
|
|
188
|
-
//
|
|
297
|
+
// so that a number of common tasks can be done in a single place; the
|
|
189
298
|
// arguments following the formal arguments contain the names of methods to
|
|
190
299
|
// wrap on the prototype; if the first extra argument is an error code, it is
|
|
191
300
|
// used to wrap to prevent concurrent access
|
|
192
301
|
function wrapFns(proto) {
|
|
193
302
|
let nameIndex = 1;
|
|
303
|
+
let serialize = true;
|
|
194
304
|
let preventConcurrentErrorCode;
|
|
195
305
|
if (typeof arguments[1] === 'number') {
|
|
196
|
-
nameIndex
|
|
306
|
+
nameIndex++;
|
|
197
307
|
preventConcurrentErrorCode = arguments[1];
|
|
308
|
+
} else if (typeof arguments[1] === 'boolean') {
|
|
309
|
+
nameIndex++;
|
|
310
|
+
serialize = arguments[1];
|
|
198
311
|
}
|
|
199
312
|
for (let i = nameIndex; i < arguments.length; i++) {
|
|
200
313
|
const name = arguments[i];
|
|
201
314
|
const f = proto[name];
|
|
202
|
-
|
|
203
|
-
proto[name] = callbackify(preventConcurrent(serialize(f),
|
|
204
|
-
preventConcurrentErrorCode));
|
|
205
|
-
} else
|
|
206
|
-
proto[name] = callbackify(serialize(f));
|
|
315
|
+
proto[name] = callbackify(wrapFn(f, serialize, preventConcurrentErrorCode));
|
|
207
316
|
}
|
|
208
317
|
}
|
|
209
318
|
|
|
@@ -412,6 +521,42 @@ function makeDate(useLocal, year, month, day, hour, minute,
|
|
|
412
521
|
fseconds) - offset * 60000);
|
|
413
522
|
}
|
|
414
523
|
|
|
524
|
+
//---------------------------------------------------------------------------
|
|
525
|
+
// sanitize()
|
|
526
|
+
//
|
|
527
|
+
// this function replaces invalid characters in a string with characters
|
|
528
|
+
// guaranteed to be in the Network Character Set.
|
|
529
|
+
//---------------------------------------------------------------------------
|
|
530
|
+
function sanitize(text) {
|
|
531
|
+
let value = text.split('');
|
|
532
|
+
|
|
533
|
+
// if first character is single/double quote
|
|
534
|
+
if ((value[0] === '\'' || value[0] === '"')) {
|
|
535
|
+
value = value.splice(1);
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
// if last character is single/double quote
|
|
539
|
+
if ((value[value.length - 1] === '\'' || value[value.length - 1] === '"')) {
|
|
540
|
+
value.pop();
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
// look for invalid characters, and replace them with '?'
|
|
544
|
+
// in case of default values and throw an error
|
|
545
|
+
// for user provided values
|
|
546
|
+
for (let i = 0; i < value.length; i++) {
|
|
547
|
+
if (!validNetworkCharacterSet.has(value[i])) {
|
|
548
|
+
value[i] = '?';
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
// if last character is a backslash
|
|
553
|
+
if (value[value.length - 1] === '\\') {
|
|
554
|
+
value[value.length - 1] = '?';
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
return value.join('');
|
|
558
|
+
}
|
|
559
|
+
|
|
415
560
|
// define exports
|
|
416
561
|
module.exports = {
|
|
417
562
|
BINARY_FILE,
|
|
@@ -420,6 +565,7 @@ module.exports = {
|
|
|
420
565
|
RELEASE_DIR,
|
|
421
566
|
STAGING_DIR,
|
|
422
567
|
addTypeProperties,
|
|
568
|
+
assertParamPropNetworkName,
|
|
423
569
|
callbackify,
|
|
424
570
|
denormalizePrivateKey,
|
|
425
571
|
getInstallURL,
|
|
@@ -436,8 +582,8 @@ module.exports = {
|
|
|
436
582
|
isXid,
|
|
437
583
|
normalizeXid,
|
|
438
584
|
makeDate,
|
|
439
|
-
|
|
440
|
-
serialize,
|
|
585
|
+
sanitize,
|
|
441
586
|
verifySodaDoc,
|
|
587
|
+
wrapFn,
|
|
442
588
|
wrapFns
|
|
443
589
|
};
|
package/lib/version.js
CHANGED
package/package.json
CHANGED
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
oracledb-6.6.0-darwin-arm64.node v22.2.0 6e81601d4d09137e859660fbbe090e1b272adbb2 5f182c720d6541c3b267d5d370f606f90b5b0c38 Wed, 17 Jul 2024 06:45:24 GMT
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
oracledb-6.6.0-darwin-x64.node v20.11.1 6e81601d4d09137e859660fbbe090e1b272adbb2 5f182c720d6541c3b267d5d370f606f90b5b0c38 Wed, 17 Jul 2024 04:43:48 GMT
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
6e81601d4d09137e859660fbbe090e1b272adbb2
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
oracledb-6.6.0-linux-arm64.node v20.12.2 6e81601d4d09137e859660fbbe090e1b272adbb2 5f182c720d6541c3b267d5d370f606f90b5b0c38 Wed, 17 Jul 2024 07:10:04 GMT
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
oracledb-6.6.0-linux-x64.node v16.20.2 6e81601d4d09137e859660fbbe090e1b272adbb2 5f182c720d6541c3b267d5d370f606f90b5b0c38 Wed, 17 Jul 2024 07:13:04 GMT
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
oracledb-6.6.0-win32-x64.node v18.16.0 6e81601d4d09137e859660fbbe090e1b272adbb2 5f182c720d6541c3b267d5d370f606f90b5b0c38 Wed, 17 Jul 2024 07:26:50 GMT
|