oracledb 5.5.0 → 6.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.
Files changed (107) hide show
  1. package/CHANGELOG.md +1 -1875
  2. package/LICENSE.txt +8 -222
  3. package/NOTICE.txt +1 -1
  4. package/README.md +38 -30
  5. package/SECURITY.md +38 -0
  6. package/build/Release/oracledb-6.0.1-darwin-x64.node +0 -0
  7. package/build/Release/oracledb-6.0.1-darwin-x64.node-buildinfo.txt +1 -0
  8. package/build/Release/oracledb-6.0.1-js-buildinfo.txt +1 -0
  9. package/build/Release/oracledb-6.0.1-linux-arm64.node +0 -0
  10. package/build/Release/oracledb-6.0.1-linux-arm64.node-buildinfo.txt +1 -0
  11. package/build/Release/oracledb-6.0.1-linux-x64.node +0 -0
  12. package/build/Release/oracledb-6.0.1-linux-x64.node-buildinfo.txt +1 -0
  13. package/build/Release/oracledb-6.0.1-win32-x64.node +0 -0
  14. package/build/Release/oracledb-6.0.1-win32-x64.node-buildinfo.txt +1 -0
  15. package/examples/README.md +113 -0
  16. package/examples/dbconfig.js +100 -0
  17. package/examples/example.js +156 -0
  18. package/index.js +26 -0
  19. package/lib/aqDeqOptions.js +148 -8
  20. package/lib/aqEnqOptions.js +59 -7
  21. package/lib/aqMessage.js +118 -7
  22. package/lib/aqQueue.js +243 -53
  23. package/lib/connection.js +1326 -465
  24. package/lib/constants.js +203 -0
  25. package/lib/dbObject.js +346 -32
  26. package/lib/errors.js +785 -0
  27. package/lib/impl/aqDeqOptions.js +197 -0
  28. package/lib/impl/aqEnqOptions.js +89 -0
  29. package/lib/impl/aqMessage.js +134 -0
  30. package/lib/impl/aqQueue.js +81 -0
  31. package/lib/impl/connection.js +529 -0
  32. package/lib/impl/dbObject.js +159 -0
  33. package/lib/impl/index.js +59 -0
  34. package/lib/impl/lob.js +85 -0
  35. package/lib/impl/pool.js +195 -0
  36. package/lib/impl/resultset.js +223 -0
  37. package/lib/impl/sodaCollection.js +174 -0
  38. package/lib/impl/sodaDatabase.js +81 -0
  39. package/lib/impl/sodaDocCursor.js +63 -0
  40. package/lib/impl/sodaDocument.js +98 -0
  41. package/lib/impl/sodaOperation.js +109 -0
  42. package/lib/lob.js +157 -68
  43. package/lib/oracledb.js +1047 -345
  44. package/lib/pool.js +654 -465
  45. package/lib/poolStatistics.js +24 -9
  46. package/lib/queryStream.js +16 -8
  47. package/lib/resultset.js +291 -183
  48. package/lib/settings.js +191 -0
  49. package/lib/sodaCollection.js +214 -201
  50. package/lib/sodaDatabase.js +108 -71
  51. package/lib/sodaDocCursor.js +44 -32
  52. package/lib/sodaDocument.js +76 -14
  53. package/lib/sodaOperation.js +131 -118
  54. package/lib/thin/connection.js +1043 -0
  55. package/lib/thin/dbObject.js +630 -0
  56. package/lib/thin/index.js +40 -0
  57. package/lib/thin/lob.js +189 -0
  58. package/lib/thin/pool.js +481 -0
  59. package/lib/thin/protocol/buffer.js +1043 -0
  60. package/lib/thin/protocol/capabilities.js +121 -0
  61. package/lib/thin/protocol/constants.js +765 -0
  62. package/lib/thin/protocol/encryptDecrypt.js +185 -0
  63. package/lib/thin/protocol/messages/auth.js +349 -0
  64. package/lib/thin/protocol/messages/base.js +476 -0
  65. package/lib/thin/protocol/messages/commit.js +56 -0
  66. package/lib/thin/protocol/messages/dataType.js +391 -0
  67. package/lib/thin/protocol/messages/execute.js +312 -0
  68. package/lib/thin/protocol/messages/fetch.js +60 -0
  69. package/lib/thin/protocol/messages/index.js +53 -0
  70. package/lib/thin/protocol/messages/lobOp.js +201 -0
  71. package/lib/thin/protocol/messages/logOff.js +53 -0
  72. package/lib/thin/protocol/messages/ping.js +56 -0
  73. package/lib/thin/protocol/messages/protocol.js +78 -0
  74. package/lib/thin/protocol/messages/rollback.js +56 -0
  75. package/lib/thin/protocol/messages/sessionRelease.js +60 -0
  76. package/lib/thin/protocol/messages/withData.js +812 -0
  77. package/lib/thin/protocol/oson.js +661 -0
  78. package/lib/thin/protocol/packet.js +519 -0
  79. package/lib/thin/protocol/protocol.js +202 -0
  80. package/lib/thin/protocol/utils.js +89 -0
  81. package/lib/thin/resultSet.js +122 -0
  82. package/lib/thin/sqlnet/connStrategy.js +175 -0
  83. package/lib/thin/sqlnet/constants.js +199 -0
  84. package/lib/thin/sqlnet/ezConnectResolver.js +488 -0
  85. package/lib/thin/sqlnet/navNodes.js +870 -0
  86. package/lib/thin/sqlnet/networkSession.js +621 -0
  87. package/lib/thin/sqlnet/ntTcp.js +527 -0
  88. package/lib/thin/sqlnet/nvStrToNvPair.js +783 -0
  89. package/lib/thin/sqlnet/packet.js +405 -0
  90. package/lib/thin/sqlnet/paramParser.js +206 -0
  91. package/lib/thin/sqlnet/sessionAtts.js +160 -0
  92. package/lib/thin/statement.js +300 -0
  93. package/lib/thin/util.js +289 -0
  94. package/lib/transformer.js +252 -0
  95. package/lib/types.js +357 -0
  96. package/lib/util.js +196 -110
  97. package/lib/version.js +36 -0
  98. package/package/README.md +33 -30
  99. package/package/install.js +89 -64
  100. package/package/prunebinaries.js +60 -12
  101. package/package.json +3 -3
  102. package/build/Release/oracledb-5.5.0-darwin-x64.node +0 -0
  103. package/build/Release/oracledb-5.5.0-darwin-x64.node-buildinfo.txt +0 -1
  104. package/build/Release/oracledb-5.5.0-linux-x64.node +0 -0
  105. package/build/Release/oracledb-5.5.0-linux-x64.node-buildinfo.txt +0 -1
  106. package/build/Release/oracledb-5.5.0-win32-x64.node +0 -0
  107. package/build/Release/oracledb-5.5.0-win32-x64.node-buildinfo.txt +0 -1
@@ -0,0 +1,156 @@
1
+ /* Copyright (c) 2018, 2023, 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
+ * NAME
26
+ * example.js
27
+ *
28
+ * DESCRIPTION
29
+ * A basic node-oracledb example.
30
+ *
31
+ * For connection pool examples see connectionpool.js and webapp.js
32
+ * For a ResultSet example see resultset1.js
33
+ * For a query stream example see selectstream.js
34
+ *
35
+ *****************************************************************************/
36
+
37
+ 'use strict';
38
+
39
+ Error.stackTraceLimit = 50;
40
+
41
+ const oracledb = require('oracledb');
42
+ const dbConfig = require('./dbconfig.js');
43
+
44
+ // This example runs in both node-oracledb Thin and Thick modes.
45
+ //
46
+ // Optionally run in node-oracledb Thick mode
47
+ if (process.env.NODE_ORACLEDB_DRIVER_MODE === 'thick') {
48
+
49
+ // Thick mode requires Oracle Client or Oracle Instant Client libraries.
50
+ // On Windows and macOS Intel you can specify the directory containing the
51
+ // libraries at runtime or before Node.js starts. On other platforms (where
52
+ // Oracle libraries are available) the system library search path must always
53
+ // include the Oracle library path before Node.js starts. If the search path
54
+ // is not correct, you will get a DPI-1047 error. See the node-oracledb
55
+ // installation documentation.
56
+ let clientOpts = {};
57
+ if (process.platform === 'win32') { // Windows
58
+ clientOpts = { libDir: 'C:\\oracle\\instantclient_19_17' };
59
+ } else if (process.platform === 'darwin' && process.arch === 'x64') { // macOS Intel
60
+ clientOpts = { libDir: process.env.HOME + '/Downloads/instantclient_19_8' };
61
+ }
62
+ oracledb.initOracleClient(clientOpts); // enable node-oracledb Thick mode
63
+ }
64
+
65
+ async function run() {
66
+ let connection;
67
+
68
+ try {
69
+
70
+ let sql, binds, options, result;
71
+
72
+ connection = await oracledb.getConnection(dbConfig);
73
+
74
+ //
75
+ // Create a table
76
+ //
77
+
78
+ const stmts = [
79
+ `DROP TABLE no_example`,
80
+
81
+ `CREATE TABLE no_example (id NUMBER, data VARCHAR2(20))`
82
+ ];
83
+
84
+ for (const s of stmts) {
85
+ try {
86
+ await connection.execute(s);
87
+ } catch (e) {
88
+ if (e.errorNum != 942)
89
+ console.error(e);
90
+ }
91
+ }
92
+
93
+ //
94
+ // Insert three rows
95
+ //
96
+
97
+ sql = `INSERT INTO no_example VALUES (:1, :2)`;
98
+
99
+ binds = [
100
+ [101, "Alpha" ],
101
+ [102, "Beta" ],
102
+ [103, "Gamma" ]
103
+ ];
104
+
105
+ // For a complete list of options see the documentation.
106
+ options = {
107
+ autoCommit: true,
108
+ // batchErrors: true, // continue processing even if there are data errors
109
+ bindDefs: [
110
+ { type: oracledb.NUMBER },
111
+ { type: oracledb.STRING, maxSize: 20 }
112
+ ]
113
+ };
114
+
115
+ result = await connection.executeMany(sql, binds, options);
116
+
117
+ console.log("Number of rows inserted:", result.rowsAffected);
118
+
119
+ //
120
+ // Query the data
121
+ //
122
+
123
+ sql = `SELECT * FROM no_example`;
124
+
125
+ binds = {};
126
+
127
+ // For a complete list of options see the documentation.
128
+ options = {
129
+ outFormat: oracledb.OUT_FORMAT_OBJECT, // query result format
130
+ // extendedMetaData: true, // get extra metadata
131
+ // fetchArraySize: 100 // internal buffer allocation size for tuning
132
+ };
133
+
134
+ result = await connection.execute(sql, binds, options);
135
+
136
+ // Column metadata can be shown, if desired
137
+ // console.log("Metadata: ");
138
+ // console.dir(result.metaData, { depth: null });
139
+
140
+ console.log("Query results: ");
141
+ console.dir(result.rows, { depth: null });
142
+
143
+ } catch (err) {
144
+ console.error(err);
145
+ } finally {
146
+ if (connection) {
147
+ try {
148
+ await connection.close();
149
+ } catch (err) {
150
+ console.error(err);
151
+ }
152
+ }
153
+ }
154
+ }
155
+
156
+ run();
package/index.js CHANGED
@@ -1 +1,27 @@
1
+ // Copyright (c) 2015, 2023, 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
+
1
27
  module.exports = require('./lib/oracledb.js');
@@ -1,17 +1,24 @@
1
- // Copyright (c) 2019, 2022, Oracle and/or its affiliates.
1
+ // Copyright (c) 2019, 2023, Oracle and/or its affiliates.
2
2
 
3
3
  //-----------------------------------------------------------------------------
4
4
  //
5
- // You may not use the identified files except in compliance with the Apache
6
- // License, Version 2.0 (the "License.")
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.
7
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.
8
15
  // You may obtain a copy of the License at
9
- // http://www.apache.org/licenses/LICENSE-2.0.
10
16
  //
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.
17
+ // https://www.apache.org/licenses/LICENSE-2.0
14
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.
15
22
  // See the License for the specific language governing permissions and
16
23
  // limitations under the License.
17
24
  //
@@ -19,9 +26,142 @@
19
26
 
20
27
  'use strict';
21
28
 
29
+ const { Buffer } = require('buffer');
30
+ const constants = require('./constants.js');
31
+ const errors = require('./errors.js');
32
+
22
33
  class AqDeqOptions {
23
34
 
24
- _extend(oracledb) { //eslint-disable-line
35
+ //---------------------------------------------------------------------------
36
+ // condition
37
+ //
38
+ // Property for the condition to use for dequeuing messages.
39
+ //---------------------------------------------------------------------------
40
+ get condition() {
41
+ return this._impl.getCondition();
42
+ }
43
+
44
+ set condition(value) {
45
+ errors.assertPropValue(typeof value === 'string', "condition");
46
+ this._impl.setCondition(value);
47
+ }
48
+
49
+ //---------------------------------------------------------------------------
50
+ // consumerName
51
+ //
52
+ // Property for the consumer name to use for dequeuing messages.
53
+ //---------------------------------------------------------------------------
54
+ get consumerName() {
55
+ return this._impl.getConsumerName();
56
+ }
57
+
58
+ set consumerName(value) {
59
+ errors.assertPropValue(typeof value === 'string', "consumerName");
60
+ this._impl.setConsumerName(value);
61
+ }
62
+
63
+ //---------------------------------------------------------------------------
64
+ // correlation
65
+ //
66
+ // Property for the correlation to use for dequeuing messages.
67
+ //---------------------------------------------------------------------------
68
+ get correlation() {
69
+ return this._impl.getCorrelation();
70
+ }
71
+
72
+ set correlation(value) {
73
+ errors.assertPropValue(typeof value === 'string', "correlation");
74
+ this._impl.setCorrelation(value);
75
+ }
76
+
77
+ //---------------------------------------------------------------------------
78
+ // mode
79
+ //
80
+ // Property for the mode to use for dequeuing messages.
81
+ //---------------------------------------------------------------------------
82
+ get mode() {
83
+ return this._impl.getMode();
84
+ }
85
+
86
+ set mode(value) {
87
+ errors.assertPropValue(value === constants.AQ_DEQ_MODE_BROWSE ||
88
+ value === constants.AQ_DEQ_MODE_LOCKED ||
89
+ value === constants.AQ_DEQ_MODE_REMOVE ||
90
+ value === constants.AQ_DEQ_MODE_REMOVE_NO_DATA, "mode");
91
+ this._impl.setMode(value);
92
+ }
93
+
94
+ //---------------------------------------------------------------------------
95
+ // msgId
96
+ //
97
+ // Property for the message id to use for dequeuing messages.
98
+ //---------------------------------------------------------------------------
99
+ get msgId() {
100
+ return this._impl.getMsgId();
101
+ }
102
+
103
+ set msgId(value) {
104
+ errors.assertPropValue(Buffer.isBuffer(value), "msgId");
105
+ this._impl.setMsgId(value);
106
+ }
107
+
108
+ //---------------------------------------------------------------------------
109
+ // navigation
110
+ //
111
+ // Property for the navigation to use for dequeuing messages.
112
+ //---------------------------------------------------------------------------
113
+ get navigation() {
114
+ return this._impl.getNavigation();
115
+ }
116
+
117
+ set navigation(value) {
118
+ errors.assertPropValue(value === constants.AQ_DEQ_NAV_FIRST_MSG ||
119
+ value === constants.AQ_DEQ_NAV_NEXT_TRANSACTION ||
120
+ value === constants.AQ_DEQ_NAV_NEXT_MSG, "navigation");
121
+ this._impl.setNavigation(value);
122
+ }
123
+
124
+ //---------------------------------------------------------------------------
125
+ // transformation
126
+ //
127
+ // Property for the transformation to use for dequeuing messages.
128
+ //---------------------------------------------------------------------------
129
+ get transformation() {
130
+ return this._impl.getTransformation();
131
+ }
132
+
133
+ set transformation(value) {
134
+ errors.assertPropValue(typeof value === 'string', "transformation");
135
+ this._impl.setTransformation(value);
136
+ }
137
+
138
+ //---------------------------------------------------------------------------
139
+ // visibility
140
+ //
141
+ // Property for the visibility to use for dequeuing messages.
142
+ //---------------------------------------------------------------------------
143
+ get visibility() {
144
+ return this._impl.getVisibility();
145
+ }
146
+
147
+ set visibility(value) {
148
+ errors.assertPropValue(value === constants.AQ_VISIBILITY_IMMEDIATE ||
149
+ value === constants.AQ_VISIBILITY_ON_COMMIT, "visibility");
150
+ this._impl.setVisibility(value);
151
+ }
152
+
153
+ //---------------------------------------------------------------------------
154
+ // wait
155
+ //
156
+ // Property for the time to wait for dequeuing messages.
157
+ //---------------------------------------------------------------------------
158
+ get wait() {
159
+ return this._impl.getWait();
160
+ }
161
+
162
+ set wait(value) {
163
+ errors.assertPropValue(Number.isInteger(value) && value >= 0, "wait");
164
+ this._impl.setWait(value);
25
165
  }
26
166
 
27
167
  }
@@ -2,16 +2,23 @@
2
2
 
3
3
  //-----------------------------------------------------------------------------
4
4
  //
5
- // You may not use the identified files except in compliance with the Apache
6
- // License, Version 2.0 (the "License.")
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.
7
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.
8
15
  // You may obtain a copy of the License at
9
- // http://www.apache.org/licenses/LICENSE-2.0.
10
16
  //
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.
17
+ // https://www.apache.org/licenses/LICENSE-2.0
14
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.
15
22
  // See the License for the specific language governing permissions and
16
23
  // limitations under the License.
17
24
  //
@@ -19,9 +26,54 @@
19
26
 
20
27
  'use strict';
21
28
 
29
+ const constants = require('./constants.js');
30
+ const errors = require('./errors.js');
31
+
22
32
  class AqEnqOptions {
23
33
 
24
- _extend(oracledb) { //eslint-disable-line
34
+ //---------------------------------------------------------------------------
35
+ // deliveryMode
36
+ //
37
+ // Property for the delivery mode to use for enqueuing messages.
38
+ //---------------------------------------------------------------------------
39
+ get deliveryMode() {
40
+ return this._impl.getDeliveryMode();
41
+ }
42
+
43
+ set deliveryMode(value) {
44
+ errors.assertPropValue(value === constants.AQ_MSG_DELIV_MODE_PERSISTENT ||
45
+ value === constants.AQ_MSG_DELIV_MODE_BUFFERED ||
46
+ value === constants.AQ_MSG_DELIV_MODE_PERSISTENT_OR_BUFFERED, "deliveryMode");
47
+ this._impl.setDeliveryMode(value);
48
+ }
49
+
50
+ //---------------------------------------------------------------------------
51
+ // transformation
52
+ //
53
+ // Property for the transformation to use for enqueuing messages.
54
+ //---------------------------------------------------------------------------
55
+ get transformation() {
56
+ return this._impl.getTransformation();
57
+ }
58
+
59
+ set transformation(value) {
60
+ errors.assertPropValue(typeof value === 'string', "transformation");
61
+ this._impl.setTransformation(value);
62
+ }
63
+
64
+ //---------------------------------------------------------------------------
65
+ // visibility
66
+ //
67
+ // Property for the visibility to use for enqueuing messages.
68
+ //---------------------------------------------------------------------------
69
+ get visibility() {
70
+ return this._impl.getVisibility();
71
+ }
72
+
73
+ set visibility(value) {
74
+ errors.assertPropValue(value === constants.AQ_VISIBILITY_IMMEDIATE ||
75
+ value === constants.AQ_VISIBILITY_ON_COMMIT, "visibility");
76
+ this._impl.setVisibility(value);
25
77
  }
26
78
 
27
79
  }
package/lib/aqMessage.js CHANGED
@@ -2,16 +2,23 @@
2
2
 
3
3
  //-----------------------------------------------------------------------------
4
4
  //
5
- // You may not use the identified files except in compliance with the Apache
6
- // License, Version 2.0 (the "License.")
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.
7
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.
8
15
  // You may obtain a copy of the License at
9
- // http://www.apache.org/licenses/LICENSE-2.0.
10
16
  //
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.
17
+ // https://www.apache.org/licenses/LICENSE-2.0
14
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.
15
22
  // See the License for the specific language governing permissions and
16
23
  // limitations under the License.
17
24
  //
@@ -19,9 +26,113 @@
19
26
 
20
27
  'use strict';
21
28
 
29
+ const DbObjectImpl = require('./impl/dbObject.js');
30
+
22
31
  class AqMessage {
23
32
 
24
- _extend(oracledb) { //eslint-disable-line
33
+ //---------------------------------------------------------------------------
34
+ // correlation
35
+ //
36
+ // Property for the correlation used for the message.
37
+ //---------------------------------------------------------------------------
38
+ get correlation() {
39
+ return this._impl.getCorrelation();
40
+ }
41
+
42
+ //---------------------------------------------------------------------------
43
+ // delay
44
+ //
45
+ // Property for the delay used for the message.
46
+ //---------------------------------------------------------------------------
47
+ get delay() {
48
+ return this._impl.getDelay();
49
+ }
50
+
51
+ //---------------------------------------------------------------------------
52
+ // deliveryMode
53
+ //
54
+ // Property for the delivery mode used for the message.
55
+ //---------------------------------------------------------------------------
56
+ get deliveryMode() {
57
+ return this._impl.getDeliveryMode();
58
+ }
59
+
60
+ //---------------------------------------------------------------------------
61
+ // exceptionQueue
62
+ //
63
+ // Property for the exception queue used for the message.
64
+ //---------------------------------------------------------------------------
65
+ get exceptionQueue() {
66
+ return this._impl.getExceptionQueue();
67
+ }
68
+
69
+ //---------------------------------------------------------------------------
70
+ // expiration
71
+ //
72
+ // Property for the expiration used for the message.
73
+ //---------------------------------------------------------------------------
74
+ get expiration() {
75
+ return this._impl.getExpiration();
76
+ }
77
+
78
+ //---------------------------------------------------------------------------
79
+ // msgId
80
+ //
81
+ // Property for the message id used for the message.
82
+ //---------------------------------------------------------------------------
83
+ get msgId() {
84
+ return this._impl.getMsgId();
85
+ }
86
+
87
+ //---------------------------------------------------------------------------
88
+ // numAttempts
89
+ //
90
+ // Property for the number of attempts used for the message.
91
+ //---------------------------------------------------------------------------
92
+ get numAttempts() {
93
+ return this._impl.getNumAttempts();
94
+ }
95
+
96
+ //---------------------------------------------------------------------------
97
+ // originalMsgId
98
+ //
99
+ // Property for the original message id used for the message.
100
+ //---------------------------------------------------------------------------
101
+ get originalMsgId() {
102
+ return this._impl.getOriginalMsgId();
103
+ }
104
+
105
+ //---------------------------------------------------------------------------
106
+ // payload
107
+ //
108
+ // Property for the payload used for the message.
109
+ //---------------------------------------------------------------------------
110
+ get payload() {
111
+ const payload = this._impl.getPayload();
112
+ if (payload instanceof DbObjectImpl) {
113
+ const obj = Object.create(this._payloadTypeClass.prototype);
114
+ obj._impl = payload;
115
+ return obj;
116
+ }
117
+ return payload;
118
+ }
119
+
120
+ //---------------------------------------------------------------------------
121
+ // priority
122
+ //
123
+ // Property for the priority used for the message.
124
+ //---------------------------------------------------------------------------
125
+ get priority() {
126
+ return this._impl.getPriority();
127
+ }
128
+
129
+ //---------------------------------------------------------------------------
130
+ // state
131
+ //
132
+ // Property for the state used for the message.
133
+ //---------------------------------------------------------------------------
134
+ get state() {
135
+ return this._impl.getState();
25
136
  }
26
137
 
27
138
  }