bson 6.7.0 → 6.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -0
- package/bson.d.ts +31 -7
- package/lib/bson.bundle.js +265 -202
- package/lib/bson.bundle.js.map +1 -1
- package/lib/bson.cjs +265 -202
- package/lib/bson.cjs.map +1 -1
- package/lib/bson.mjs +265 -202
- package/lib/bson.mjs.map +1 -1
- package/lib/bson.rn.cjs +269 -204
- package/lib/bson.rn.cjs.map +1 -1
- package/package.json +21 -21
- package/src/bson_value.ts +2 -1
- package/src/constants.ts +3 -0
- package/src/decimal128.ts +1 -1
- package/src/extended_json.ts +3 -2
- package/src/long.ts +43 -21
- package/src/objectid.ts +25 -4
- package/src/parser/calculate_size.ts +1 -1
- package/src/parser/serializer.ts +196 -188
- package/src/parser/utils.ts +43 -9
- package/src/timestamp.ts +19 -3
package/README.md
CHANGED
|
@@ -11,6 +11,33 @@ You can learn more about it in [the specification](http://bsonspec.org).
|
|
|
11
11
|
- [Documentation](#documentation)
|
|
12
12
|
- [FAQ](#faq)
|
|
13
13
|
|
|
14
|
+
|
|
15
|
+
### Release Integrity
|
|
16
|
+
|
|
17
|
+
Releases are created automatically and signed using the [Node team's GPG key](https://pgp.mongodb.com/node-driver.asc). This applies to the git tag as well as all release packages provided as part of a GitHub release. To verify the provided packages, download the key and import it using gpg:
|
|
18
|
+
|
|
19
|
+
```shell
|
|
20
|
+
gpg --import node-driver.asc
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
The GitHub release contains a detached signature file for the NPM package (named
|
|
24
|
+
`bson-X.Y.Z.tgz.sig`).
|
|
25
|
+
|
|
26
|
+
The following command returns the link npm package.
|
|
27
|
+
```shell
|
|
28
|
+
npm view bson@vX.Y.Z dist.tarball
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Using the result of the above command, a `curl` command can return the official npm package for the release.
|
|
32
|
+
|
|
33
|
+
To verify the integrity of the downloaded package, run the following command:
|
|
34
|
+
```shell
|
|
35
|
+
gpg --verify bson-X.Y.Z.tgz.sig bson-X.Y.Z.tgz
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
>[!Note]
|
|
39
|
+
No verification is done when using npm to install the package. The contents of the Github tarball and npm's tarball are identical.
|
|
40
|
+
|
|
14
41
|
## Bugs / Feature Requests
|
|
15
42
|
|
|
16
43
|
Think you've found a bug? Want to see a new feature in `bson`? Please open a case in our issue management tool, JIRA:
|
package/bson.d.ts
CHANGED
|
@@ -151,6 +151,10 @@ declare namespace BSON {
|
|
|
151
151
|
}
|
|
152
152
|
export { BSON }
|
|
153
153
|
|
|
154
|
+
/* Excluded from this release type: BSON_MAJOR_VERSION */
|
|
155
|
+
|
|
156
|
+
/* Excluded from this release type: BSON_VERSION_SYMBOL */
|
|
157
|
+
|
|
154
158
|
/**
|
|
155
159
|
* @public
|
|
156
160
|
* @experimental
|
|
@@ -311,6 +315,7 @@ export declare type BSONType = (typeof BSONType)[keyof typeof BSONType];
|
|
|
311
315
|
export declare abstract class BSONValue {
|
|
312
316
|
/** @public */
|
|
313
317
|
abstract get _bsontype(): string;
|
|
318
|
+
/* Excluded from this release type: [BSON_VERSION_SYMBOL] */
|
|
314
319
|
/**
|
|
315
320
|
* @public
|
|
316
321
|
* Prints a human-readable string of BSON value information
|
|
@@ -760,18 +765,26 @@ export declare class Long extends BSONValue {
|
|
|
760
765
|
unsigned: boolean;
|
|
761
766
|
/**
|
|
762
767
|
* Constructs a 64 bit two's-complement integer, given its low and high 32 bit values as *signed* integers.
|
|
763
|
-
* See the from* functions below for more convenient ways of constructing Longs.
|
|
764
|
-
*
|
|
765
|
-
* Acceptable signatures are:
|
|
766
|
-
* - Long(low, high, unsigned?)
|
|
767
|
-
* - Long(bigint, unsigned?)
|
|
768
|
-
* - Long(string, unsigned?)
|
|
769
768
|
*
|
|
770
769
|
* @param low - The low (signed) 32 bits of the long
|
|
771
770
|
* @param high - The high (signed) 32 bits of the long
|
|
772
771
|
* @param unsigned - Whether unsigned or not, defaults to signed
|
|
773
772
|
*/
|
|
774
|
-
constructor(low
|
|
773
|
+
constructor(low: number, high?: number, unsigned?: boolean);
|
|
774
|
+
/**
|
|
775
|
+
* Constructs a 64 bit two's-complement integer, given a bigint representation.
|
|
776
|
+
*
|
|
777
|
+
* @param value - BigInt representation of the long value
|
|
778
|
+
* @param unsigned - Whether unsigned or not, defaults to signed
|
|
779
|
+
*/
|
|
780
|
+
constructor(value: bigint, unsigned?: boolean);
|
|
781
|
+
/**
|
|
782
|
+
* Constructs a 64 bit two's-complement integer, given a string representation.
|
|
783
|
+
*
|
|
784
|
+
* @param value - String representation of the long value
|
|
785
|
+
* @param unsigned - Whether unsigned or not, defaults to signed
|
|
786
|
+
*/
|
|
787
|
+
constructor(value: string, unsigned?: boolean);
|
|
775
788
|
static TWO_PWR_24: Long;
|
|
776
789
|
/** Maximum unsigned value. */
|
|
777
790
|
static MAX_UNSIGNED_VALUE: Long;
|
|
@@ -1277,6 +1290,7 @@ export declare class ObjectId extends BSONValue {
|
|
|
1277
1290
|
*/
|
|
1278
1291
|
get id(): Uint8Array;
|
|
1279
1292
|
set id(value: Uint8Array);
|
|
1293
|
+
/* Excluded from this release type: validateHexString */
|
|
1280
1294
|
/** Returns the ObjectId id as a 24 lowercase character hex string representation */
|
|
1281
1295
|
toHexString(): string;
|
|
1282
1296
|
/* Excluded from this release type: getInc */
|
|
@@ -1464,10 +1478,20 @@ declare function stringify(value: any, replacer?: (number | string)[] | ((this:
|
|
|
1464
1478
|
/**
|
|
1465
1479
|
* @public
|
|
1466
1480
|
* @category BSONType
|
|
1481
|
+
*
|
|
1482
|
+
* A special type for _internal_ MongoDB use and is **not** associated with the regular Date type.
|
|
1467
1483
|
*/
|
|
1468
1484
|
export declare class Timestamp extends LongWithoutOverridesClass {
|
|
1469
1485
|
get _bsontype(): 'Timestamp';
|
|
1470
1486
|
static readonly MAX_VALUE: Long;
|
|
1487
|
+
/**
|
|
1488
|
+
* An incrementing ordinal for operations within a given second.
|
|
1489
|
+
*/
|
|
1490
|
+
get i(): number;
|
|
1491
|
+
/**
|
|
1492
|
+
* A `time_t` value measuring seconds since the Unix epoch
|
|
1493
|
+
*/
|
|
1494
|
+
get t(): number;
|
|
1471
1495
|
/**
|
|
1472
1496
|
* @param int - A 64-bit bigint representing the Timestamp.
|
|
1473
1497
|
*/
|