oracledb 5.5.0 → 6.0.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/CHANGELOG.md +1 -1875
- package/LICENSE.txt +8 -222
- package/NOTICE.txt +1 -1
- package/README.md +38 -30
- package/SECURITY.md +38 -0
- package/build/Release/oracledb-6.0.0-darwin-x64.node +0 -0
- package/build/Release/oracledb-6.0.0-darwin-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-6.0.0-js-buildinfo.txt +1 -0
- package/build/Release/oracledb-6.0.0-linux-arm64.node +0 -0
- package/build/Release/oracledb-6.0.0-linux-arm64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-6.0.0-linux-x64.node +0 -0
- package/build/Release/oracledb-6.0.0-linux-x64.node-buildinfo.txt +1 -0
- package/build/Release/oracledb-6.0.0-win32-x64.node +0 -0
- package/build/Release/oracledb-6.0.0-win32-x64.node-buildinfo.txt +1 -0
- package/examples/README.md +113 -0
- package/examples/dbconfig.js +100 -0
- package/examples/example.js +156 -0
- package/index.js +26 -0
- package/lib/aqDeqOptions.js +146 -7
- package/lib/aqEnqOptions.js +59 -7
- package/lib/aqMessage.js +118 -7
- package/lib/aqQueue.js +242 -53
- package/lib/connection.js +1324 -465
- package/lib/constants.js +203 -0
- package/lib/dbObject.js +346 -32
- package/lib/errors.js +781 -0
- package/lib/impl/aqDeqOptions.js +197 -0
- package/lib/impl/aqEnqOptions.js +89 -0
- package/lib/impl/aqMessage.js +134 -0
- package/lib/impl/aqQueue.js +81 -0
- package/lib/impl/connection.js +529 -0
- package/lib/impl/dbObject.js +159 -0
- package/lib/impl/index.js +59 -0
- package/lib/impl/lob.js +85 -0
- package/lib/impl/pool.js +195 -0
- package/lib/impl/resultset.js +223 -0
- package/lib/impl/sodaCollection.js +174 -0
- package/lib/impl/sodaDatabase.js +81 -0
- package/lib/impl/sodaDocCursor.js +63 -0
- package/lib/impl/sodaDocument.js +98 -0
- package/lib/impl/sodaOperation.js +109 -0
- package/lib/lob.js +156 -68
- package/lib/oracledb.js +1047 -345
- package/lib/pool.js +654 -465
- package/lib/poolStatistics.js +23 -9
- package/lib/queryStream.js +14 -7
- package/lib/resultset.js +291 -183
- package/lib/settings.js +191 -0
- package/lib/sodaCollection.js +214 -201
- package/lib/sodaDatabase.js +107 -71
- package/lib/sodaDocCursor.js +44 -32
- package/lib/sodaDocument.js +76 -14
- package/lib/sodaOperation.js +131 -118
- package/lib/thin/connection.js +1038 -0
- package/lib/thin/dbObject.js +629 -0
- package/lib/thin/index.js +40 -0
- package/lib/thin/lob.js +188 -0
- package/lib/thin/pool.js +481 -0
- package/lib/thin/protocol/buffer.js +1040 -0
- package/lib/thin/protocol/capabilities.js +116 -0
- package/lib/thin/protocol/constants.js +764 -0
- package/lib/thin/protocol/encryptDecrypt.js +185 -0
- package/lib/thin/protocol/messages/auth.js +348 -0
- package/lib/thin/protocol/messages/base.js +475 -0
- package/lib/thin/protocol/messages/commit.js +56 -0
- package/lib/thin/protocol/messages/dataType.js +382 -0
- package/lib/thin/protocol/messages/execute.js +312 -0
- package/lib/thin/protocol/messages/fetch.js +60 -0
- package/lib/thin/protocol/messages/index.js +53 -0
- package/lib/thin/protocol/messages/lobOp.js +200 -0
- package/lib/thin/protocol/messages/logOff.js +53 -0
- package/lib/thin/protocol/messages/ping.js +56 -0
- package/lib/thin/protocol/messages/protocol.js +78 -0
- package/lib/thin/protocol/messages/rollback.js +56 -0
- package/lib/thin/protocol/messages/sessionRelease.js +60 -0
- package/lib/thin/protocol/messages/withData.js +811 -0
- package/lib/thin/protocol/oson.js +660 -0
- package/lib/thin/protocol/packet.js +520 -0
- package/lib/thin/protocol/protocol.js +202 -0
- package/lib/thin/protocol/utils.js +88 -0
- package/lib/thin/resultSet.js +122 -0
- package/lib/thin/sqlnet/connStrategy.js +175 -0
- package/lib/thin/sqlnet/constants.js +199 -0
- package/lib/thin/sqlnet/ezConnectResolver.js +488 -0
- package/lib/thin/sqlnet/navNodes.js +870 -0
- package/lib/thin/sqlnet/networkSession.js +620 -0
- package/lib/thin/sqlnet/ntTcp.js +525 -0
- package/lib/thin/sqlnet/nvStrToNvPair.js +783 -0
- package/lib/thin/sqlnet/packet.js +405 -0
- package/lib/thin/sqlnet/paramParser.js +205 -0
- package/lib/thin/sqlnet/sessionAtts.js +160 -0
- package/lib/thin/statement.js +301 -0
- package/lib/thin/util.js +289 -0
- package/lib/transformer.js +250 -0
- package/lib/types.js +357 -0
- package/lib/util.js +194 -110
- package/lib/version.js +36 -0
- package/package/README.md +33 -30
- package/package/install.js +89 -64
- package/package/prunebinaries.js +60 -12
- package/package.json +3 -3
- package/build/Release/oracledb-5.5.0-darwin-x64.node +0 -0
- package/build/Release/oracledb-5.5.0-darwin-x64.node-buildinfo.txt +0 -1
- package/build/Release/oracledb-5.5.0-linux-x64.node +0 -0
- package/build/Release/oracledb-5.5.0-linux-x64.node-buildinfo.txt +0 -1
- package/build/Release/oracledb-5.5.0-win32-x64.node +0 -0
- package/build/Release/oracledb-5.5.0-win32-x64.node-buildinfo.txt +0 -1
package/lib/sodaDatabase.js
CHANGED
|
@@ -1,17 +1,24 @@
|
|
|
1
|
-
// Copyright (c) 2018,
|
|
1
|
+
// Copyright (c) 2018, 2023, Oracle and/or its affiliates.
|
|
2
2
|
|
|
3
3
|
//-----------------------------------------------------------------------------
|
|
4
4
|
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
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
|
-
//
|
|
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,82 +26,64 @@
|
|
|
19
26
|
|
|
20
27
|
'use strict';
|
|
21
28
|
|
|
29
|
+
const SodaCollection = require('./sodaCollection.js');
|
|
30
|
+
const SodaDocument = require('./sodaDocument.js');
|
|
31
|
+
const errors = require('./errors.js');
|
|
22
32
|
const nodbUtil = require('./util.js');
|
|
23
|
-
|
|
24
|
-
//-----------------------------------------------------------------------------
|
|
25
|
-
// createCollection()
|
|
26
|
-
// Creates a SODA collection.
|
|
27
|
-
//-----------------------------------------------------------------------------
|
|
28
|
-
async function createCollection(name, a2) {
|
|
29
|
-
let options = {};
|
|
30
|
-
|
|
31
|
-
nodbUtil.checkArgCount(arguments, 1, 2);
|
|
32
|
-
nodbUtil.assert(typeof name === 'string', 'NJS-005', 1);
|
|
33
|
-
|
|
34
|
-
if (arguments.length == 2) {
|
|
35
|
-
nodbUtil.assert(nodbUtil.isObject(a2), 'NJS-005', 2);
|
|
36
|
-
options = a2;
|
|
37
|
-
if (options.metaData) {
|
|
38
|
-
if (!nodbUtil.isObject(options.metaData)) {
|
|
39
|
-
throw new Error(nodbUtil.getErrorMessage('NJS-005', 2));
|
|
40
|
-
}
|
|
41
|
-
options.metaData = JSON.stringify(options.metaData);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return await this._createCollection(name, options);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
//-----------------------------------------------------------------------------
|
|
50
|
-
// openCollection()
|
|
51
|
-
// Open an existing SODA collection and return it to the caller.
|
|
52
|
-
//-----------------------------------------------------------------------------
|
|
53
|
-
async function openCollection(name) {
|
|
54
|
-
nodbUtil.checkArgCount(arguments, 1, 1);
|
|
55
|
-
nodbUtil.assert(typeof name === 'string', 'NJS-005', 1);
|
|
56
|
-
return await this._openCollection(name);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
//-----------------------------------------------------------------------------
|
|
61
|
-
// getCollectionNames()
|
|
62
|
-
// Return an array of the names of the collections in the database.
|
|
63
|
-
//-----------------------------------------------------------------------------
|
|
64
|
-
async function getCollectionNames(a1) {
|
|
65
|
-
let options = {};
|
|
66
|
-
|
|
67
|
-
nodbUtil.checkArgCount(arguments, 0, 1);
|
|
68
|
-
if (arguments.length == 1) {
|
|
69
|
-
nodbUtil.assert(nodbUtil.isObject(a1), 'NJS-005', 1);
|
|
70
|
-
options = a1;
|
|
71
|
-
}
|
|
72
|
-
return await this._getCollectionNames(options);
|
|
73
|
-
}
|
|
74
|
-
|
|
33
|
+
const settings = require('./settings.js');
|
|
75
34
|
|
|
76
35
|
class SodaDatabase {
|
|
77
36
|
|
|
78
|
-
_extend() {
|
|
79
|
-
this.createCollection = nodbUtil.callbackify(nodbUtil.serialize(createCollection));
|
|
80
|
-
this.getCollectionNames = nodbUtil.callbackify(nodbUtil.serialize(getCollectionNames));
|
|
81
|
-
this.openCollection = nodbUtil.callbackify(nodbUtil.serialize(openCollection));
|
|
82
|
-
}
|
|
83
|
-
|
|
84
37
|
_getConnection() {
|
|
85
38
|
return this._connection;
|
|
86
39
|
}
|
|
87
40
|
|
|
88
|
-
|
|
41
|
+
//---------------------------------------------------------------------------
|
|
42
|
+
// createCollection()
|
|
43
|
+
//
|
|
44
|
+
// Creates a SODA collection.
|
|
45
|
+
//---------------------------------------------------------------------------
|
|
46
|
+
async createCollection(name, a2) {
|
|
47
|
+
const options = {autoCommit: settings.autoCommit};
|
|
48
|
+
|
|
49
|
+
errors.assertArgCount(arguments, 1, 2);
|
|
50
|
+
errors.assertParamValue(typeof name === 'string', 1);
|
|
51
|
+
|
|
52
|
+
if (arguments.length == 2) {
|
|
53
|
+
errors.assertParamValue(nodbUtil.isObject(a2), 2);
|
|
54
|
+
if (a2.mode !== undefined) {
|
|
55
|
+
errors.assertParamPropValue(Number.isInteger(a2.mode) && a2.mode > 0,
|
|
56
|
+
2, "mode");
|
|
57
|
+
options.mode = a2.mode;
|
|
58
|
+
}
|
|
59
|
+
if (a2.metaData !== undefined) {
|
|
60
|
+
errors.assertParamPropValue(nodbUtil.isObject(a2.metaData), 2,
|
|
61
|
+
"metaData");
|
|
62
|
+
options.metaData = JSON.stringify(a2.metaData);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const coll = new SodaCollection();
|
|
67
|
+
coll._impl = await this._impl.createCollection(name, options);
|
|
68
|
+
return coll;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
//---------------------------------------------------------------------------
|
|
72
|
+
// createDocument()
|
|
73
|
+
//
|
|
74
|
+
// Creates a SODA document.
|
|
75
|
+
//---------------------------------------------------------------------------
|
|
89
76
|
createDocument(content, a2) {
|
|
90
77
|
let options = {};
|
|
91
78
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
nodbUtil.isObject(content),
|
|
79
|
+
errors.assertArgCount(arguments, 1, 2);
|
|
80
|
+
errors.assertParamValue(Buffer.isBuffer(content) ||
|
|
81
|
+
typeof content === 'string' || nodbUtil.isObject(content), 1);
|
|
95
82
|
if (arguments.length > 1) {
|
|
96
|
-
|
|
83
|
+
errors.assertParamValue(nodbUtil.isObject(a2), 2);
|
|
97
84
|
options = a2;
|
|
85
|
+
errors.assertParamPropString(options, 2, "key");
|
|
86
|
+
errors.assertParamPropString(options, 2, "mediaType");
|
|
98
87
|
}
|
|
99
88
|
|
|
100
89
|
if (typeof content === 'string') {
|
|
@@ -103,10 +92,57 @@ class SodaDatabase {
|
|
|
103
92
|
content = Buffer.from(JSON.stringify(content));
|
|
104
93
|
}
|
|
105
94
|
|
|
106
|
-
|
|
95
|
+
const doc = new SodaDocument();
|
|
96
|
+
doc._impl = this._impl.createDocument(content, options);
|
|
97
|
+
return doc;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
//---------------------------------------------------------------------------
|
|
101
|
+
// getCollectionNames()
|
|
102
|
+
//
|
|
103
|
+
// Return an array of the names of the collections in the database.
|
|
104
|
+
//---------------------------------------------------------------------------
|
|
105
|
+
async getCollectionNames(a1) {
|
|
106
|
+
let options = {};
|
|
107
|
+
|
|
108
|
+
errors.assertArgCount(arguments, 0, 1);
|
|
109
|
+
if (arguments.length == 1) {
|
|
110
|
+
errors.assertParamValue(nodbUtil.isObject(a1), 1);
|
|
111
|
+
options = a1;
|
|
112
|
+
if (options.startsWith !== undefined) {
|
|
113
|
+
errors.assertParamPropValue(typeof options.startsWith === 'string', 1,
|
|
114
|
+
"startsWith");
|
|
115
|
+
}
|
|
116
|
+
if (options.limit !== undefined) {
|
|
117
|
+
errors.assertParamPropValue(Number.isInteger(options.limit), 1,
|
|
118
|
+
"limit");
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return await this._impl.getCollectionNames(options);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
//---------------------------------------------------------------------------
|
|
125
|
+
// openCollection()
|
|
126
|
+
//
|
|
127
|
+
// Open an existing SODA collection and return it to the caller.
|
|
128
|
+
//---------------------------------------------------------------------------
|
|
129
|
+
async openCollection(name) {
|
|
130
|
+
errors.assertArgCount(arguments, 1, 1);
|
|
131
|
+
errors.assertParamValue(typeof name === 'string', 1);
|
|
132
|
+
const options = {autoCommit: settings.autoCommit};
|
|
133
|
+
const collImpl = await this._impl.openCollection(name, options);
|
|
134
|
+
if (collImpl) {
|
|
135
|
+
const coll = new SodaCollection();
|
|
136
|
+
coll._impl = collImpl;
|
|
137
|
+
return coll;
|
|
138
|
+
}
|
|
107
139
|
}
|
|
108
140
|
|
|
109
141
|
}
|
|
110
142
|
|
|
143
|
+
nodbUtil.wrapFns(SodaDatabase.prototype,
|
|
144
|
+
"createCollection",
|
|
145
|
+
"getCollectionNames",
|
|
146
|
+
"openCollection");
|
|
111
147
|
|
|
112
148
|
module.exports = SodaDatabase;
|
package/lib/sodaDocCursor.js
CHANGED
|
@@ -1,17 +1,24 @@
|
|
|
1
|
-
// Copyright (c) 2018,
|
|
1
|
+
// Copyright (c) 2018, 2023, Oracle and/or its affiliates.
|
|
2
2
|
|
|
3
3
|
//-----------------------------------------------------------------------------
|
|
4
4
|
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
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
|
-
//
|
|
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,39 +26,44 @@
|
|
|
19
26
|
|
|
20
27
|
'use strict';
|
|
21
28
|
|
|
29
|
+
const errors = require('./errors.js');
|
|
22
30
|
const nodbUtil = require('./util.js');
|
|
23
|
-
|
|
24
|
-
//-----------------------------------------------------------------------------
|
|
25
|
-
// getNext()
|
|
26
|
-
// Return the new document available from the cursor.
|
|
27
|
-
//-----------------------------------------------------------------------------
|
|
28
|
-
async function getNext() {
|
|
29
|
-
nodbUtil.checkArgCount(arguments, 0, 0);
|
|
30
|
-
return await this._getNext();
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
//-----------------------------------------------------------------------------
|
|
35
|
-
// close()
|
|
36
|
-
// Close the cursor and make it unusable for further operations.
|
|
37
|
-
//----------------------------------------------------------------------------
|
|
38
|
-
async function close() {
|
|
39
|
-
nodbUtil.checkArgCount(arguments, 0, 0);
|
|
40
|
-
await this._close();
|
|
41
|
-
}
|
|
42
|
-
|
|
31
|
+
const SodaDocument = require('./sodaDocument.js');
|
|
43
32
|
|
|
44
33
|
class SodaDocCursor {
|
|
45
34
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
35
|
+
//---------------------------------------------------------------------------
|
|
36
|
+
// close()
|
|
37
|
+
//
|
|
38
|
+
// Close the cursor and make it unusable for further operations.
|
|
39
|
+
//--------------------------------------------------------------------------
|
|
40
|
+
async close() {
|
|
41
|
+
errors.assertArgCount(arguments, 0, 0);
|
|
42
|
+
errors.assert(this._impl, errors.ERR_INVALID_SODA_DOC_CURSOR);
|
|
43
|
+
await this._impl.close();
|
|
44
|
+
delete this._impl;
|
|
49
45
|
}
|
|
50
46
|
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
//---------------------------------------------------------------------------
|
|
48
|
+
// getNext()
|
|
49
|
+
//
|
|
50
|
+
// Return the next document available from the cursor.
|
|
51
|
+
//---------------------------------------------------------------------------
|
|
52
|
+
async getNext() {
|
|
53
|
+
errors.assertArgCount(arguments, 0, 0);
|
|
54
|
+
errors.assert(this._impl, errors.ERR_INVALID_SODA_DOC_CURSOR);
|
|
55
|
+
const docImpl = await this._impl.getNext();
|
|
56
|
+
if (docImpl) {
|
|
57
|
+
const doc = new SodaDocument();
|
|
58
|
+
doc._impl = docImpl;
|
|
59
|
+
return doc;
|
|
60
|
+
}
|
|
53
61
|
}
|
|
54
62
|
|
|
55
63
|
}
|
|
56
64
|
|
|
65
|
+
nodbUtil.wrapFns(SodaDocCursor.prototype,
|
|
66
|
+
"close",
|
|
67
|
+
"getNext");
|
|
68
|
+
|
|
57
69
|
module.exports = SodaDocCursor;
|
package/lib/sodaDocument.js
CHANGED
|
@@ -2,16 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
//-----------------------------------------------------------------------------
|
|
4
4
|
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
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
|
-
//
|
|
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
|
//
|
|
@@ -21,25 +28,80 @@
|
|
|
21
28
|
|
|
22
29
|
class SodaDocument {
|
|
23
30
|
|
|
24
|
-
|
|
25
|
-
|
|
31
|
+
//---------------------------------------------------------------------------
|
|
32
|
+
// createdOn
|
|
33
|
+
//
|
|
34
|
+
// Property for the created date of the document.
|
|
35
|
+
//---------------------------------------------------------------------------
|
|
36
|
+
get createdOn() {
|
|
37
|
+
return this._impl.getCreatedOn();
|
|
26
38
|
}
|
|
27
39
|
|
|
28
|
-
|
|
40
|
+
//---------------------------------------------------------------------------
|
|
41
|
+
// getContent()
|
|
42
|
+
//
|
|
43
|
+
// Returns the document content as a Javascript object.
|
|
44
|
+
//---------------------------------------------------------------------------
|
|
29
45
|
getContent() {
|
|
30
|
-
return JSON.parse(this.
|
|
46
|
+
return JSON.parse(this._impl.getContentAsString());
|
|
31
47
|
}
|
|
32
48
|
|
|
33
|
-
|
|
49
|
+
//---------------------------------------------------------------------------
|
|
50
|
+
// getContentAsBuffer()
|
|
51
|
+
//
|
|
52
|
+
// Returns the document content as a buffer.
|
|
53
|
+
//---------------------------------------------------------------------------
|
|
34
54
|
getContentAsBuffer() {
|
|
35
|
-
return this.
|
|
55
|
+
return this._impl.getContentAsBuffer();
|
|
36
56
|
}
|
|
37
57
|
|
|
38
|
-
|
|
58
|
+
//---------------------------------------------------------------------------
|
|
59
|
+
// getContentAsString()
|
|
60
|
+
//
|
|
61
|
+
// Returns the document content as a string.
|
|
62
|
+
//---------------------------------------------------------------------------
|
|
39
63
|
getContentAsString() {
|
|
40
|
-
return this.
|
|
64
|
+
return this._impl.getContentAsString();
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
//---------------------------------------------------------------------------
|
|
68
|
+
// key
|
|
69
|
+
//
|
|
70
|
+
// Property for the key of the document.
|
|
71
|
+
//---------------------------------------------------------------------------
|
|
72
|
+
get key() {
|
|
73
|
+
return this._impl.getKey();
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
//---------------------------------------------------------------------------
|
|
77
|
+
// lastModified
|
|
78
|
+
//
|
|
79
|
+
// Property for the last modified date of the document.
|
|
80
|
+
//---------------------------------------------------------------------------
|
|
81
|
+
get lastModified() {
|
|
82
|
+
return this._impl.getLastModified();
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
//---------------------------------------------------------------------------
|
|
86
|
+
// mediaType
|
|
87
|
+
//
|
|
88
|
+
// Property for the media type of the document.
|
|
89
|
+
//---------------------------------------------------------------------------
|
|
90
|
+
get mediaType() {
|
|
91
|
+
return this._impl.getMediaType();
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
//---------------------------------------------------------------------------
|
|
95
|
+
// verison
|
|
96
|
+
//
|
|
97
|
+
// Property for the version of the document.
|
|
98
|
+
//---------------------------------------------------------------------------
|
|
99
|
+
get version() {
|
|
100
|
+
return this._impl.getVersion();
|
|
41
101
|
}
|
|
42
102
|
|
|
43
103
|
}
|
|
44
104
|
|
|
105
|
+
SodaDocument.prototype._sodaDocumentMarker = true;
|
|
106
|
+
|
|
45
107
|
module.exports = SodaDocument;
|