oracledb 3.0.0 → 3.1.2

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 (112) hide show
  1. package/CHANGELOG.md +135 -8
  2. package/README.md +6 -4
  3. package/build/Release/oracledb-abi48-darwin-x64.node +0 -0
  4. package/build/Release/oracledb-abi48-darwin-x64.node-buildinfo.txt +1 -0
  5. package/build/Release/oracledb-abi48-linux-x64.node +0 -0
  6. package/build/Release/oracledb-abi48-linux-x64.node-buildinfo.txt +1 -0
  7. package/build/Release/oracledb-abi48-win32-x64.node +0 -0
  8. package/build/Release/oracledb-abi48-win32-x64.node-buildinfo.txt +1 -0
  9. package/build/Release/oracledb-abi57-darwin-x64.node +0 -0
  10. package/build/Release/oracledb-abi57-darwin-x64.node-buildinfo.txt +1 -0
  11. package/build/Release/oracledb-abi57-linux-x64.node +0 -0
  12. package/build/Release/oracledb-abi57-linux-x64.node-buildinfo.txt +1 -0
  13. package/build/Release/oracledb-abi57-win32-x64.node +0 -0
  14. package/build/Release/oracledb-abi57-win32-x64.node-buildinfo.txt +1 -0
  15. package/build/Release/oracledb-abi64-darwin-x64.node +0 -0
  16. package/build/Release/oracledb-abi64-darwin-x64.node-buildinfo.txt +1 -0
  17. package/build/Release/oracledb-abi64-linux-x64.node +0 -0
  18. package/build/Release/oracledb-abi64-linux-x64.node-buildinfo.txt +1 -0
  19. package/build/Release/oracledb-abi64-win32-x64.node +0 -0
  20. package/build/Release/oracledb-abi64-win32-x64.node-buildinfo.txt +1 -0
  21. package/build/Release/oracledb-abi67-darwin-x64.node +0 -0
  22. package/build/Release/oracledb-abi67-darwin-x64.node-buildinfo.txt +1 -0
  23. package/build/Release/oracledb-abi67-linux-x64.node +0 -0
  24. package/build/Release/oracledb-abi67-linux-x64.node-buildinfo.txt +1 -0
  25. package/build/Release/oracledb-abi67-win32-x64.node +0 -0
  26. package/build/Release/oracledb-abi67-win32-x64.node-buildinfo.txt +1 -0
  27. package/lib/connection.js +18 -4
  28. package/lib/oracledb.js +44 -92
  29. package/lib/pool.js +36 -2
  30. package/lib/sodaCollection.js +1 -1
  31. package/lib/sodaDatabase.js +1 -1
  32. package/lib/util.js +82 -5
  33. package/package/README.md +32 -101
  34. package/package/install.js +139 -0
  35. package/package/prunebinaries.js +51 -0
  36. package/package.json +4 -11
  37. package/binding.gyp +0 -162
  38. package/lib/rel.txt +0 -1
  39. package/odpi/.npmignore +0 -4
  40. package/odpi/LICENSE.md +0 -218
  41. package/odpi/README.md +0 -61
  42. package/odpi/embed/README.md +0 -4
  43. package/odpi/embed/dpi.c +0 -50
  44. package/odpi/include/dpi.h +0 -1748
  45. package/odpi/src/dpiConn.c +0 -2089
  46. package/odpi/src/dpiContext.c +0 -296
  47. package/odpi/src/dpiData.c +0 -797
  48. package/odpi/src/dpiDebug.c +0 -184
  49. package/odpi/src/dpiDeqOptions.c +0 -370
  50. package/odpi/src/dpiEnqOptions.c +0 -174
  51. package/odpi/src/dpiEnv.c +0 -189
  52. package/odpi/src/dpiError.c +0 -204
  53. package/odpi/src/dpiErrorMessages.h +0 -86
  54. package/odpi/src/dpiGen.c +0 -303
  55. package/odpi/src/dpiGlobal.c +0 -292
  56. package/odpi/src/dpiHandleList.c +0 -117
  57. package/odpi/src/dpiHandlePool.c +0 -118
  58. package/odpi/src/dpiImpl.h +0 -1707
  59. package/odpi/src/dpiLob.c +0 -506
  60. package/odpi/src/dpiMsgProps.c +0 -386
  61. package/odpi/src/dpiObject.c +0 -897
  62. package/odpi/src/dpiObjectAttr.c +0 -115
  63. package/odpi/src/dpiObjectType.c +0 -326
  64. package/odpi/src/dpiOci.c +0 -3527
  65. package/odpi/src/dpiOracleType.c +0 -492
  66. package/odpi/src/dpiPool.c +0 -549
  67. package/odpi/src/dpiRowid.c +0 -136
  68. package/odpi/src/dpiSodaColl.c +0 -685
  69. package/odpi/src/dpiSodaCollCursor.c +0 -143
  70. package/odpi/src/dpiSodaDb.c +0 -432
  71. package/odpi/src/dpiSodaDoc.c +0 -230
  72. package/odpi/src/dpiSodaDocCursor.c +0 -143
  73. package/odpi/src/dpiStmt.c +0 -1797
  74. package/odpi/src/dpiSubscr.c +0 -674
  75. package/odpi/src/dpiUtils.c +0 -410
  76. package/odpi/src/dpiVar.c +0 -1794
  77. package/package/MAKEPKG.BAT +0 -156
  78. package/package/Makefile +0 -85
  79. package/package/createpackage.js +0 -186
  80. package/package/extractpackage.js +0 -76
  81. package/package/getversion.js +0 -37
  82. package/package/oracledbinstall.js +0 -497
  83. package/package/package.json +0 -54
  84. package/package/util.js +0 -286
  85. package/src/njsCommon.cpp +0 -1055
  86. package/src/njsCommon.h +0 -484
  87. package/src/njsConnection.cpp +0 -2926
  88. package/src/njsConnection.h +0 -227
  89. package/src/njsIntLob.cpp +0 -618
  90. package/src/njsIntLob.h +0 -179
  91. package/src/njsMessages.cpp +0 -122
  92. package/src/njsMessages.h +0 -118
  93. package/src/njsOracle.cpp +0 -1274
  94. package/src/njsOracle.h +0 -237
  95. package/src/njsPool.cpp +0 -482
  96. package/src/njsPool.h +0 -132
  97. package/src/njsResultSet.cpp +0 -478
  98. package/src/njsResultSet.h +0 -120
  99. package/src/njsSodaCollection.cpp +0 -507
  100. package/src/njsSodaCollection.h +0 -128
  101. package/src/njsSodaDatabase.cpp +0 -335
  102. package/src/njsSodaDatabase.h +0 -108
  103. package/src/njsSodaDocCursor.cpp +0 -203
  104. package/src/njsSodaDocCursor.h +0 -94
  105. package/src/njsSodaDocument.cpp +0 -412
  106. package/src/njsSodaDocument.h +0 -105
  107. package/src/njsSodaOperation.cpp +0 -557
  108. package/src/njsSodaOperation.h +0 -123
  109. package/src/njsSubscription.cpp +0 -388
  110. package/src/njsSubscription.h +0 -111
  111. package/src/njsUtils.cpp +0 -158
  112. package/src/njsUtils.h +0 -68
@@ -1,156 +0,0 @@
1
- @echo off
2
- REM Copyright (c) 2017, Oracle and/or its affiliates. All Rights reserved
3
- REM
4
- REM ******************************************************************************
5
- REM *
6
- REM * You may not use the identified files except in compliance with the Apache
7
- REM * License, Version 2.0 (the "License.")
8
- REM *
9
- REM * You may obtain a copy of the License at
10
- REM * http://www.apache.org/licenses/LICENSE-2.0.
11
- REM *
12
- REM * Unless required by applicable law or agreed to in writing, software
13
- REM * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14
- REM * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- REM *
16
- REM * See the License for the specific language governing permissions and
17
- REM * limitations under the License.
18
- REM *
19
- REM * NAME
20
- REM * MAKEPKG.BAT
21
- REM *
22
- REM * DESCRIPTION
23
- REM * Create/cleanup of binary package for the current node-oracledb binary.
24
- REM *
25
- REM *****************************************************************************
26
-
27
- REM
28
- REM usage: MAKEPKG.BAT [<cmd>]
29
- REM : Possible values for <cmd> are: CLEANUP, CREATEBINARY
30
- REM and CREATESTAGEBINARY
31
- REM
32
- REM expected to run this batch file from package sub-directory,
33
- REM where a fresh clone is created.
34
- REM
35
-
36
- REM expecting 1 parameter, make sure we have some arguments
37
- if "%1" == "" GOTO usage
38
-
39
- REM jump to appropriate sections based on <cmd>
40
- if "%1" == "CLEANUP" GOTO cleanup
41
- if "%1" == "CREATEBINARY" GOTO createbinary
42
- if "%1" == "CREATESTAGEBINARY" GOTO createstagebinary
43
- goto usage
44
-
45
- REM cleanup section, remove file(s) created by this batch file
46
- :cleanup
47
- echo "cleanup section"
48
- del ..\package-lock.json
49
- del SHASUMS256.txt oracledb-v*-node-*.gz
50
- goto exit
51
-
52
-
53
- REM compile, package to gz file
54
- :createstagebinary
55
- echo "createstagebinary section"
56
-
57
- REM Append SHA to LICENSE.MD
58
- git checkout ..\LICENSE.md
59
- setlocal enabledelayedexpansion
60
- REM compose a string with commands to execute one by one
61
-
62
- REM start with empty string
63
- set CONCAT_STR=
64
- REM capture SHA
65
- FOR /F "tokens=* USEBACKQ" %%F IN (`git --git-dir=..\.git rev-parse HEAD`) DO (
66
- SET CONCAT_STR=%%F
67
- )
68
-
69
- set DATE_STR=
70
- FOR /F "tokens=* USEBACKQ" %%F IN (`DATE /T`) DO ( SET DATE_STR=%%F )
71
-
72
- REM append output of other commands
73
- set CMD_STR="git --git-dir=..\odpi\.git rev-parse HEAD && node --version"
74
- for /f %%i in ('%CMD_STR%') do set "CONCAT_STR=!CONCAT_STR! %%i"
75
- set CONCAT_STR=!CONCAT_STR! !DATE_STR!
76
- echo !CONCAT_STR! >> ..\LICENSE.MD
77
-
78
- REM Compile node-oracledb
79
- cd ..
80
- CALL npm install
81
- echo "NODE oracledb compiled"
82
- cd package
83
- echo "==> Staging Binary package created for Node.js "
84
-
85
- Set "hostname=%NODE_ORACLEDB_PACKAGE_HOSTNAME%"
86
- Set "pathname=%NODE_ORACLEDB_PACKAGE_URL_PATH%"
87
- Set "newname=%NODE_PKG_HOSTNAME%"
88
- echo ON
89
- echo %hostname%
90
- echo %pathname%
91
- echo %newname%
92
-
93
- sed "s/github.com/%hostname%/g" oracledbinstall.js
94
- sed "s/oracle\/node-oracledb\/releases\/download\//%pathname%/g" oracledbinstall.js
95
-
96
- del /S *.gz
97
-
98
- node createpackage.js
99
- xcopy /Y "package.json" "../package.json"
100
- npm pack
101
- Setlocal enabledelayedexpansion
102
-
103
- Set "Pattern=oracledb"
104
- Set "Replace=oracledb-staging"
105
-
106
- For %%a in (*.gz) Do (
107
- Set "File=%%~a"
108
- Ren "%%a" "!File:%Pattern%=%Replace%!"
109
- )
110
-
111
- goto exit
112
-
113
- REM compile, package to gz file
114
- :createbinary
115
- echo "createbinary section"
116
-
117
- REM Append SHA to LICENSE.MD
118
- git checkout ..\LICENSE.md
119
- setlocal enabledelayedexpansion
120
- REM compose a string with commands to execute one by one
121
-
122
- REM start with empty string
123
- set CONCAT_STR=
124
- REM capture SHA
125
- FOR /F "tokens=* USEBACKQ" %%F IN (`git --git-dir=..\.git rev-parse HEAD`) DO (
126
- SET CONCAT_STR=%%F
127
- )
128
-
129
- set DATE_STR=
130
- FOR /F "tokens=* USEBACKQ" %%F IN (`DATE /T`) DO ( SET DATE_STR=%%F )
131
-
132
- REM append output of other commands
133
- set CMD_STR="git --git-dir=..\odpi\.git rev-parse HEAD && node --version"
134
- for /f %%i in ('%CMD_STR%') do set "CONCAT_STR=!CONCAT_STR! %%i"
135
- set CONCAT_STR=!CONCAT_STR! !DATE_STR!
136
- echo !CONCAT_STR! >> ..\LICENSE.MD
137
-
138
- REM Compile node-oracledb
139
- cd ..
140
- CALL npm install
141
- echo "NODE oracledb compiled"
142
- cd package
143
- echo "==> Binary package created for Node.js "
144
-
145
- REM create compressed file
146
- node createpackage.js
147
- goto exit
148
-
149
- REM display usage string
150
- :usage
151
- echo "usage: MAKEPKG.BAT [<cmd>]
152
- goto exit
153
-
154
-
155
- REM Exit point
156
- :exit
package/package/Makefile DELETED
@@ -1,85 +0,0 @@
1
- # Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
2
- #
3
- # You may not use the identified files except in compliance with the Apache
4
- # License, Version 2.0 (the "License.")
5
- #
6
- # You may obtain a copy of the License at
7
- # http://www.apache.org/licenses/LICENSE-2.0.
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11
- # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- #
13
- # See the License for the specific language governing permissions and
14
- # limitations under the License.
15
-
16
- CP=cp
17
- MV=mv
18
- CD=cd
19
- ECHO=echo
20
- DATE=date -u
21
- SED=sed
22
- RMDIR=rm -rf
23
- RMALL=rm -f
24
- GIT=git
25
- NODE=node
26
- NPM=npm
27
-
28
- GITSHA=$(shell $(GIT) --git-dir=../.git rev-parse --verify HEAD)
29
- SUBMOD=$(shell $(GIT) --git-dir=../odpi/.git rev-parse --verify HEAD)
30
- NODEVER=$(shell $(NODE) --version)
31
- BUILDDATE=$(shell $(DATE))
32
-
33
- # createpackage.js assumes these paths
34
- BINARY_PATH_LOCAL=../build/Release/oracledb.node
35
- LICENSE_PATH_LOCAL=../LICENSE.md
36
-
37
- # Find the node-oracledb version number
38
- VER=$(shell $(NODE) getversion.js)
39
-
40
- # The staging-oracledb-X.Y.Z.tgz package will try to download binaries from
41
- # https://$NODE_ORACLEDB_PACKAGE_HOSTNAME/$NODE_ORACLEDB_PACKAGE_URL_PATH/vX.Y.Z/
42
- ifndef NODE_ORACLEDB_PACKAGE_HOSTNAME
43
- NODE_ORACLEDB_PACKAGE_HOSTNAME=your-staging-server.example.com
44
- endif
45
- ifndef NODE_ORACLEDB_PACKAGE_URL_PATH
46
- NODE_ORACLEDB_PACKAGE_URL_PATH=/your-url-path-to-directory/
47
- endif
48
-
49
- # Create the generic 'npm install' package with a package.json that
50
- # invokes oracledbinstall.js at install time
51
- npmpackage:
52
- $(ECHO) "$(GITSHA) $(BUILDDATE)" > ../lib/rel.txt
53
- $(NPM) pack .. && $(MV) oracledb-$(VER).tgz oracledb-src-$(VER).tgz
54
- @$(ECHO) "==> Created generic GitHub source package for node-oracledb $(VER)"
55
-
56
- $(SED) -e "s#'github.com'#'$(NODE_ORACLEDB_PACKAGE_HOSTNAME)'#" oracledbinstall.js > oracledbinstall.js.tmp && $(MV) oracledbinstall.js.tmp oracledbinstall.js
57
- $(SED) -e "s#'/oracle/node-oracledb/releases/download/'#'$(NODE_ORACLEDB_PACKAGE_URL_PATH)'#" oracledbinstall.js > oracledbinstall.js.tmp && $(MV) oracledbinstall.js.tmp oracledbinstall.js
58
- $(CP) package.json ../package.json
59
- $(NPM) pack .. && $(MV) oracledb-$(VER).tgz staging-oracledb-$(VER).tgz
60
- @$(ECHO) "==> Created generic npm staging package for node-oracledb $(VER)"
61
-
62
- $(GIT) checkout oracledbinstall.js && $(NPM) pack ..
63
- $(GIT) checkout ../package.json
64
- @$(RMALL) ../lib/rel.txt
65
- @$(ECHO) "==> Created generic npm production package for node-oracledb $(VER)"
66
-
67
- # Create a package containing (i) the license file and (ii) the
68
- # node-oracledb binary for the current environment
69
- binarypackage: $(BINARY_PATH_LOCAL) $(LICENSE_PATH_LOCAL)
70
- $(GIT) checkout $(LICENSE_PATH_LOCAL)
71
- $(CP) $(LICENSE_PATH_LOCAL) $(LICENSE_PATH_LOCAL).bk && $(ECHO) "$(GITSHA) $(SUBMOD) $(NODEVER) $(BUILDDATE)" >> $(LICENSE_PATH_LOCAL)
72
- $(NODE) createpackage.js
73
- $(MV) $(LICENSE_PATH_LOCAL).bk $(LICENSE_PATH_LOCAL)
74
- @$(ECHO) "==> Created binary package for Node.js `$(NODE) --version`"
75
-
76
- # Build the node-oracledb binary
77
- $(BINARY_PATH_LOCAL): cleanbinary
78
- ($(CD) .. && $(NPM) install)
79
-
80
- clean: cleanbinary
81
- $(RMALL) ../package-lock.json
82
- $(RMALL) oracledb-$(VER).tgz staging-oracledb-$(VER).tgz SHASUMS256.txt oracledb-v*-node-*.gz
83
-
84
- cleanbinary:
85
- $(RMALL) $(BINARY_PATH_LOCAL)
@@ -1,186 +0,0 @@
1
- /* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. */
2
-
3
- /******************************************************************************
4
- *
5
- * You may not use the identified files except in compliance with the Apache
6
- * License, Version 2.0 (the "License.")
7
- *
8
- * You may obtain a copy of the License at
9
- * http://www.apache.org/licenses/LICENSE-2.0.
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- *
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- *
18
- * NAME
19
- * createpackage.js
20
- *
21
- * DESCRIPTION
22
- * Creates a binary package for the current node-oracledb binary. A
23
- * custom package format is used. The package uses a custom format
24
- * with three components: length bytes (giving the length of the
25
- * license file), the license file, and then the node-oracledb
26
- * binary. The package is gzipped.
27
- *
28
- *****************************************************************************/
29
-
30
- 'use strict';
31
-
32
- const fs = require('fs');
33
- const Readable = require('stream').Readable;
34
- const zlib = require('zlib');
35
- const path = require('path');
36
- const util = require('util');
37
- const packageUtil = require('./util.js');
38
-
39
- packageUtil.initDynamicProps();
40
-
41
- // writeFileToReadable is used to buffer the contents of files to a readable
42
- // stream that can be written out later.
43
- function writeFileToReadable(path, readable) {
44
- return new Promise((resolve, reject) => {
45
- packageUtil.trace('In writeFileToReadable', path, util.inspect(readable, {depth: 0}));
46
-
47
- const rs = fs.createReadStream(path);
48
-
49
- rs.on('data', chunk => {
50
- readable.push(chunk);
51
- });
52
-
53
- rs.on('error', err => {
54
- reject(err);
55
- });
56
-
57
- rs.on('close', () => {
58
- resolve();
59
- });
60
- });
61
- }
62
-
63
- // createPackage is used to create a custom file that combines the node-oracledb
64
- // binary with the license. This function is meant to be used at the command line.
65
- function createPackage() {
66
- packageUtil.trace('In createPackage');
67
-
68
- let binaryPath = packageUtil.BINARY_PATH_LOCAL;
69
-
70
- for (let x = 2; x < process.argv.length; x += 1) {
71
- let argParts = process.argv[x].split('=');
72
- let argName = argParts[0];
73
- let argVal = argParts[1];
74
-
75
- if (argName === 'path') {
76
- binaryPath = argVal;
77
- }
78
- }
79
-
80
- if (!binaryPath.endsWith(packageUtil.BINARY_FILE_NAME)) {
81
- throw new Error('path should resolve to a file named ' + packageUtil.BINARY_FILE_NAME);
82
- }
83
-
84
- let binaryStats = fs.statSync(binaryPath);
85
-
86
- if (!binaryStats.isFile()) {
87
- throw new Error('path did not resolve to a file');
88
- }
89
-
90
- // Requiring in the binary ensures that it matches the version of Node.js currently
91
- // running. This is important as the process variable is used to file naming.
92
- require(path.normalize(binaryPath + '/../../../'));
93
-
94
- let licensePath;
95
-
96
- if (binaryPath != packageUtil.BINARY_PATH_LOCAL) {
97
- licensePath = path.normalize(binaryPath + '/../../../' + packageUtil.LICENSE_FILE_NAME);
98
- } else {
99
- licensePath = packageUtil.LICENSE_PATH_LOCAL;
100
- }
101
-
102
- class TempReadable extends Readable {
103
- constructor(options) {
104
- super(options);
105
- }
106
-
107
- _read(size) {} // Must be implemented but not used
108
- }
109
-
110
- const tempReadable = new TempReadable({
111
- highWaterMark: 1048576 // 1 MB
112
- });
113
-
114
- packageUtil.getSha(binaryPath)
115
- .then(binarySha => {
116
- const newShaLine = binarySha + ' ' + packageUtil.dynamicProps.BINARY_BUILD_NAME;
117
- let shaFileContents;
118
-
119
- try {
120
- shaFileContents = fs.readFileSync(packageUtil.SHA_FILE_NAME, {encoding: 'utf8'});
121
- shaFileContents = shaFileContents.split('\n');
122
-
123
- let updatedLine = false;
124
-
125
- for (let x = 0; x < shaFileContents.length; x += 1) {
126
- const line = shaFileContents[x];
127
-
128
- if (line.split(' ')[1] === packageUtil.dynamicProps.BINARY_BUILD_NAME) {
129
- shaFileContents[x] = newShaLine;
130
- updatedLine = true;
131
- break;
132
- }
133
- }
134
-
135
- if (!updatedLine) {
136
- shaFileContents.splice(shaFileContents.length - 1, 0, newShaLine);
137
- }
138
-
139
- shaFileContents = shaFileContents.join('\n');
140
- } catch (err) {
141
- shaFileContents = newShaLine + '\n';
142
- }
143
-
144
- fs.writeFileSync(packageUtil.SHA_FILE_NAME, shaFileContents);
145
-
146
- let stats = fs.statSync(licensePath);
147
- let licenseSize = stats.size.toString();
148
-
149
- let zerosToAppend = packageUtil.LICENSE_HEADER_BYTES - licenseSize.length;
150
- let paddedZeros = '';
151
-
152
- for (let x = 0; x < zerosToAppend; x += 1) {
153
- paddedZeros += '0';
154
- }
155
-
156
- licenseSize = paddedZeros + licenseSize;
157
-
158
- // The following line generates an error on Node.js 4.0, but not 4.8.5. Not sure
159
- // when the correct API was added.
160
- const licenseSizeBuf = Buffer.from(licenseSize, 'ascii');
161
-
162
- tempReadable.push(licenseSizeBuf);
163
- })
164
- .then(() => {
165
- return writeFileToReadable(licensePath, tempReadable);
166
- })
167
- .then(() => {
168
- return writeFileToReadable(binaryPath, tempReadable);
169
- })
170
- .then(() => {
171
- const ws = fs.createWriteStream(packageUtil.dynamicProps.PACKAGE_FILE_NAME);
172
- const gzip = zlib.createGzip();
173
- const filestream = tempReadable.pipe(gzip).pipe(ws);
174
-
175
- tempReadable.push(null); // Signal the end of data in
176
-
177
- filestream.on('close', () => {
178
- console.log('Package created: ' + packageUtil.dynamicProps.PACKAGE_FILE_NAME);
179
- });
180
- })
181
- .catch(err => {
182
- console.log('Error creating package', err);
183
- });
184
- }
185
-
186
- createPackage();
@@ -1,76 +0,0 @@
1
- /* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */
2
-
3
- /******************************************************************************
4
- *
5
- * You may not use the identified files except in compliance with the Apache
6
- * License, Version 2.0 (the "License.")
7
- *
8
- * You may obtain a copy of the License at
9
- * http://www.apache.org/licenses/LICENSE-2.0.
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- *
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- *
18
- * NAME
19
- * extractpackage.js
20
- *
21
- * DESCRIPTION
22
- * This script is a command-line interface to extract node-oracledb
23
- * binaries from an available binary package, see
24
- * https://oracle.github.io/node-oracledb/INSTALL.html
25
- *
26
- * USAGE
27
- * Run this script like:
28
- * node extractpackage.js path=oracledb-vX.Y.Z-node-vNN-platform-architecture.gz
29
- * For example:
30
- * node extractpackage.js path=oracledb-v2.0.14-node-v57-darwin-x64.gz
31
- *
32
- * The extracted binary can be manually moved to the correct directory.
33
- *
34
- *****************************************************************************/
35
-
36
- 'use strict';
37
-
38
- // This module is meant to be used with Node.js at the command line. It breaks
39
- // apart a custom file that combines the node-oracledb license and binary into
40
- // two separate files.
41
-
42
- const fs = require('fs');
43
- const packageUtil = require('./util.js');
44
- let packagePath;
45
-
46
- for (let x = 1; x < process.argv.length; x += 1) {
47
- let argParts = process.argv[x].split('=');
48
- let argName = argParts[0];
49
- let argVal = argParts[1];
50
-
51
- if (argName === 'path') {
52
- packagePath = argVal;
53
- }
54
- }
55
-
56
- if (packagePath === undefined) {
57
- throw new Error('path must be specified: node extractpackage.js path=/path/to/package.gz');
58
- } else {
59
- let stats = fs.statSync(packagePath);
60
-
61
- if (!stats.isFile()) {
62
- throw new Error('path did not resolve to a file');
63
- }
64
- }
65
-
66
- packageUtil.extract({
67
- packagePath: packagePath,
68
- writeLicense: true
69
- })
70
- .then(() => {
71
- packageUtil.log('Package extracted');
72
- })
73
- .catch(err => {
74
- packageUtil.error('Error extracting package');
75
- packageUtil.error(err.message);
76
- });
@@ -1,37 +0,0 @@
1
- /* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. */
2
-
3
- /******************************************************************************
4
- *
5
- * You may not use the identified files except in compliance with the Apache
6
- * License, Version 2.0 (the "License.")
7
- *
8
- * You may obtain a copy of the License at
9
- * http://www.apache.org/licenses/LICENSE-2.0.
10
- *
11
- * Unless required by applicable law or agreed to in writing, software
12
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- *
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- *
18
- * NAME
19
- * getversion.js
20
- *
21
- * DESCRIPTION
22
- * Extracts the version from the package.json file.
23
- *
24
- *****************************************************************************/
25
-
26
- 'use strict';
27
-
28
- let packageJSON;
29
-
30
- try {
31
- packageJSON = require('../package.json');
32
- } catch (err) {
33
- throw new Error('package.json is required to extract the node-oracledb version number');
34
- }
35
-
36
- console.log(packageJSON.version);
37
-