@aneuhold/core-ts-db-lib 2.0.83 → 2.0.85
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 +14 -0
- package/lib/documents/BaseDocument.d.ts +5 -2
- package/lib/documents/BaseDocument.d.ts.map +1 -1
- package/lib/documents/BaseDocument.js +5 -2
- package/lib/documents/BaseDocument.js.map +1 -1
- package/lib/documents/BaseDocument.ts +5 -2
- package/lib/services/DocumentService.d.ts +8 -1
- package/lib/services/DocumentService.d.ts.map +1 -1
- package/lib/services/DocumentService.js +5 -0
- package/lib/services/DocumentService.js.map +1 -1
- package/lib/services/DocumentService.ts +8 -1
- package/package.json +10 -10
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,18 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## 🔖 [2.0.85] (2025-10-25)
|
|
9
|
+
|
|
10
|
+
### 🏗️ Changed
|
|
11
|
+
|
|
12
|
+
- Updated dependencies in package.json for compatibility and security improvements
|
|
13
|
+
|
|
14
|
+
## 🔖 [2.0.84] (2025-10-17)
|
|
15
|
+
|
|
16
|
+
### 🏗️ Changed
|
|
17
|
+
|
|
18
|
+
- Improved and expanded JSDoc comments and documentation for public types and methods throughout the package
|
|
19
|
+
|
|
8
20
|
## 🔖 [2.0.83] (2025-07-04)
|
|
9
21
|
|
|
10
22
|
### 🏗️ Changed
|
|
@@ -38,6 +50,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
|
|
|
38
50
|
|
|
39
51
|
<!-- Link References -->
|
|
40
52
|
|
|
53
|
+
[2.0.85]: https://github.com/aneuhold/ts-libs/compare/core-ts-db-lib-v2.0.84...core-ts-db-lib-v2.0.85
|
|
54
|
+
[2.0.84]: https://github.com/aneuhold/ts-libs/compare/core-ts-db-lib-v2.0.83...core-ts-db-lib-v2.0.84
|
|
41
55
|
[2.0.83]: https://github.com/aneuhold/ts-libs/compare/core-ts-db-lib-v2.0.82...core-ts-db-lib-v2.0.83
|
|
42
56
|
[2.0.82]: https://github.com/aneuhold/ts-libs/compare/core-ts-db-lib-v2.0.81...core-ts-db-lib-v2.0.82
|
|
43
57
|
[2.0.81]: https://github.com/aneuhold/ts-libs/compare/core-ts-db-lib-v2.0.80...core-ts-db-lib-v2.0.81
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { Document, ObjectId } from 'bson';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* Base class for all document types stored in a document database.
|
|
4
|
+
*
|
|
5
|
+
* Provides the common `_id` field required by MongoDB and other
|
|
6
|
+
* document databases. All document types should extend this class.
|
|
5
7
|
*/
|
|
6
8
|
export default abstract class BaseDocument implements Document {
|
|
9
|
+
/** The unique identifier for this document */
|
|
7
10
|
_id: ObjectId;
|
|
8
11
|
}
|
|
9
12
|
//# sourceMappingURL=BaseDocument.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseDocument.d.ts","sourceRoot":"","sources":["../../src/documents/BaseDocument.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAE1C
|
|
1
|
+
{"version":3,"file":"BaseDocument.d.ts","sourceRoot":"","sources":["../../src/documents/BaseDocument.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,MAAM,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,YAAa,YAAW,QAAQ;IAC5D,8CAA8C;IAC9C,GAAG,EAAE,QAAQ,CAAkB;CAChC"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { ObjectId } from 'bson';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* Base class for all document types stored in a document database.
|
|
4
|
+
*
|
|
5
|
+
* Provides the common `_id` field required by MongoDB and other
|
|
6
|
+
* document databases. All document types should extend this class.
|
|
5
7
|
*/
|
|
6
8
|
export default class BaseDocument {
|
|
9
|
+
/** The unique identifier for this document */
|
|
7
10
|
_id = new ObjectId();
|
|
8
11
|
}
|
|
9
12
|
//# sourceMappingURL=BaseDocument.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseDocument.js","sourceRoot":"","sources":["../../src/documents/BaseDocument.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,QAAQ,EAAE,MAAM,MAAM,CAAC;AAE1C
|
|
1
|
+
{"version":3,"file":"BaseDocument.js","sourceRoot":"","sources":["../../src/documents/BaseDocument.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,QAAQ,EAAE,MAAM,MAAM,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAgB,YAAY;IACxC,8CAA8C;IAC9C,GAAG,GAAa,IAAI,QAAQ,EAAE,CAAC;CAChC"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { Document, ObjectId } from 'bson';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Base class for all document types stored in a document database.
|
|
5
|
+
*
|
|
6
|
+
* Provides the common `_id` field required by MongoDB and other
|
|
7
|
+
* document databases. All document types should extend this class.
|
|
6
8
|
*/
|
|
7
9
|
export default abstract class BaseDocument implements Document {
|
|
10
|
+
/** The unique identifier for this document */
|
|
8
11
|
_id: ObjectId = new ObjectId();
|
|
9
12
|
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import BaseDocument from '../documents/BaseDocument.js';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* Utility type for mapping document IDs to their corresponding documents.
|
|
4
|
+
*
|
|
5
|
+
* @template T - The type of document being mapped, must extend BaseDocument.
|
|
4
6
|
*/
|
|
5
7
|
export type DocumentMap<T extends BaseDocument> = {
|
|
6
8
|
[docId: string]: T | undefined;
|
|
@@ -9,6 +11,11 @@ export type DocumentMap<T extends BaseDocument> = {
|
|
|
9
11
|
* A service for low-level utilities related to documents.
|
|
10
12
|
*/
|
|
11
13
|
export default class DocumentService {
|
|
14
|
+
/**
|
|
15
|
+
* Creates a deep copy of an object using EJSON serialization.
|
|
16
|
+
*
|
|
17
|
+
* @param obj - The object to copy.
|
|
18
|
+
*/
|
|
12
19
|
static deepCopy<T extends object>(obj: T): T;
|
|
13
20
|
}
|
|
14
21
|
//# sourceMappingURL=DocumentService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentService.d.ts","sourceRoot":"","sources":["../../src/services/DocumentService.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,8BAA8B,CAAC;AAExD
|
|
1
|
+
{"version":3,"file":"DocumentService.d.ts","sourceRoot":"","sources":["../../src/services/DocumentService.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,8BAA8B,CAAC;AAExD;;;;GAIG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,YAAY,IAAI;IAChD,CAAC,KAAK,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS,CAAC;CAChC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,eAAe;IAClC;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAC,CAAC,SAAS,MAAM,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC;CAG7C"}
|
|
@@ -3,6 +3,11 @@ import { EJSON } from 'bson';
|
|
|
3
3
|
* A service for low-level utilities related to documents.
|
|
4
4
|
*/
|
|
5
5
|
export default class DocumentService {
|
|
6
|
+
/**
|
|
7
|
+
* Creates a deep copy of an object using EJSON serialization.
|
|
8
|
+
*
|
|
9
|
+
* @param obj - The object to copy.
|
|
10
|
+
*/
|
|
6
11
|
static deepCopy(obj) {
|
|
7
12
|
return EJSON.parse(EJSON.stringify(obj, { relaxed: false }));
|
|
8
13
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentService.js","sourceRoot":"","sources":["../../src/services/DocumentService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"DocumentService.js","sourceRoot":"","sources":["../../src/services/DocumentService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAY7B;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,eAAe;IAClC;;;;OAIG;IACH,MAAM,CAAC,QAAQ,CAAmB,GAAM;QACtC,OAAO,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAM,CAAC;IACpE,CAAC;CACF"}
|
|
@@ -2,7 +2,9 @@ import { EJSON } from 'bson';
|
|
|
2
2
|
import BaseDocument from '../documents/BaseDocument.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* Utility type for mapping document IDs to their corresponding documents.
|
|
6
|
+
*
|
|
7
|
+
* @template T - The type of document being mapped, must extend BaseDocument.
|
|
6
8
|
*/
|
|
7
9
|
export type DocumentMap<T extends BaseDocument> = {
|
|
8
10
|
[docId: string]: T | undefined;
|
|
@@ -12,6 +14,11 @@ export type DocumentMap<T extends BaseDocument> = {
|
|
|
12
14
|
* A service for low-level utilities related to documents.
|
|
13
15
|
*/
|
|
14
16
|
export default class DocumentService {
|
|
17
|
+
/**
|
|
18
|
+
* Creates a deep copy of an object using EJSON serialization.
|
|
19
|
+
*
|
|
20
|
+
* @param obj - The object to copy.
|
|
21
|
+
*/
|
|
15
22
|
static deepCopy<T extends object>(obj: T): T {
|
|
16
23
|
return EJSON.parse(EJSON.stringify(obj, { relaxed: false })) as T;
|
|
17
24
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@aneuhold/core-ts-db-lib",
|
|
3
3
|
"author": "Anton G. Neuhold Jr.",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"version": "2.0.
|
|
5
|
+
"version": "2.0.85",
|
|
6
6
|
"description": "A core database library used for personal projects",
|
|
7
7
|
"packageManager": "pnpm@10.12.1",
|
|
8
8
|
"type": "module",
|
|
@@ -50,18 +50,18 @@
|
|
|
50
50
|
],
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@aneuhold/core-ts-lib": "*",
|
|
53
|
-
"bson": "^6.
|
|
53
|
+
"bson": "^6.10.4"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@aneuhold/local-npm-registry": "*",
|
|
57
|
-
"@aneuhold/main-scripts": "^2.
|
|
58
|
-
"@types/node": "^
|
|
59
|
-
"eslint": "^9.
|
|
60
|
-
"jsr": "^0.13.
|
|
61
|
-
"prettier": "^3.
|
|
57
|
+
"@aneuhold/main-scripts": "^2.6.1",
|
|
58
|
+
"@types/node": "^24.9.1",
|
|
59
|
+
"eslint": "^9.38.0",
|
|
60
|
+
"jsr": "^0.13.5",
|
|
61
|
+
"prettier": "^3.6.2",
|
|
62
62
|
"rimraf": "^6.0.1",
|
|
63
|
-
"tsx": "^4.20.
|
|
64
|
-
"typescript": "^5.
|
|
65
|
-
"vitest": "^
|
|
63
|
+
"tsx": "^4.20.6",
|
|
64
|
+
"typescript": "^5.9.3",
|
|
65
|
+
"vitest": "^4.0.3"
|
|
66
66
|
}
|
|
67
67
|
}
|