@forklaunch/core 0.2.35 → 0.2.37
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/lib/src/database/index.d.ts +1 -0
- package/lib/src/database/index.d.ts.map +1 -1
- package/lib/src/database/index.js +1 -0
- package/lib/src/database/mikro/models/entities/mongo.base.entity.d.ts +34 -0
- package/lib/src/database/mikro/models/entities/mongo.base.entity.d.ts.map +1 -0
- package/lib/src/database/mikro/models/entities/mongo.base.entity.js +51 -0
- package/lib/tests/configInjector.test.js +0 -4
- package/package.json +4 -3
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/database/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC"}
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/database/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC;AACpD,cAAc,2CAA2C,CAAC"}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import { ObjectId } from '@mikro-orm/mongodb';
|
2
|
+
/**
|
3
|
+
* Abstract class representing a base entity.
|
4
|
+
*/
|
5
|
+
export declare abstract class MongoBaseEntity {
|
6
|
+
/**
|
7
|
+
* The serialized unique identifier for the entity.
|
8
|
+
*
|
9
|
+
* @type {string}
|
10
|
+
* @readonly
|
11
|
+
*/
|
12
|
+
_id: ObjectId;
|
13
|
+
/**
|
14
|
+
* The unique identifier for the entity.
|
15
|
+
*
|
16
|
+
* @type {string}
|
17
|
+
* @readonly
|
18
|
+
*/
|
19
|
+
id: string;
|
20
|
+
/**
|
21
|
+
* The date when the entity was created.
|
22
|
+
*
|
23
|
+
* @type {Date}
|
24
|
+
*/
|
25
|
+
createdAt: Date;
|
26
|
+
/**
|
27
|
+
* The date when the entity was last updated.
|
28
|
+
*
|
29
|
+
* @type {Date}
|
30
|
+
* @readonly
|
31
|
+
*/
|
32
|
+
updatedAt: Date;
|
33
|
+
}
|
34
|
+
//# sourceMappingURL=mongo.base.entity.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"mongo.base.entity.d.ts","sourceRoot":"","sources":["../../../../../../src/database/mikro/models/entities/mongo.base.entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C;;GAEG;AACH,8BAAsB,eAAe;IACnC;;;;;OAKG;IAEH,GAAG,EAAG,QAAQ,CAAC;IAEf;;;;;OAKG;IAEH,EAAE,EAAG,MAAM,CAAC;IAEZ;;;;OAIG;IAEH,SAAS,EAAE,IAAI,CAAc;IAE7B;;;;;OAKG;IAEH,SAAS,EAAE,IAAI,CAAc;CAC9B"}
|
@@ -0,0 +1,51 @@
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
6
|
+
};
|
7
|
+
import { PrimaryKey, Property, SerializedPrimaryKey } from '@mikro-orm/core';
|
8
|
+
/**
|
9
|
+
* Abstract class representing a base entity.
|
10
|
+
*/
|
11
|
+
export class MongoBaseEntity {
|
12
|
+
/**
|
13
|
+
* The serialized unique identifier for the entity.
|
14
|
+
*
|
15
|
+
* @type {string}
|
16
|
+
* @readonly
|
17
|
+
*/
|
18
|
+
_id;
|
19
|
+
/**
|
20
|
+
* The unique identifier for the entity.
|
21
|
+
*
|
22
|
+
* @type {string}
|
23
|
+
* @readonly
|
24
|
+
*/
|
25
|
+
id;
|
26
|
+
/**
|
27
|
+
* The date when the entity was created.
|
28
|
+
*
|
29
|
+
* @type {Date}
|
30
|
+
*/
|
31
|
+
createdAt = new Date();
|
32
|
+
/**
|
33
|
+
* The date when the entity was last updated.
|
34
|
+
*
|
35
|
+
* @type {Date}
|
36
|
+
* @readonly
|
37
|
+
*/
|
38
|
+
updatedAt = new Date();
|
39
|
+
}
|
40
|
+
__decorate([
|
41
|
+
PrimaryKey()
|
42
|
+
], MongoBaseEntity.prototype, "_id", void 0);
|
43
|
+
__decorate([
|
44
|
+
SerializedPrimaryKey()
|
45
|
+
], MongoBaseEntity.prototype, "id", void 0);
|
46
|
+
__decorate([
|
47
|
+
Property()
|
48
|
+
], MongoBaseEntity.prototype, "createdAt", void 0);
|
49
|
+
__decorate([
|
50
|
+
Property({ onUpdate: () => new Date() })
|
51
|
+
], MongoBaseEntity.prototype, "updatedAt", void 0);
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@forklaunch/core",
|
3
|
-
"version": "0.2.
|
3
|
+
"version": "0.2.37",
|
4
4
|
"description": "forklaunch-js core package. Contains useful building blocks.",
|
5
5
|
"files": [
|
6
6
|
"lib"
|
@@ -18,13 +18,14 @@
|
|
18
18
|
"homepage": "https://github.com/forklaunch/forklaunch-js#readme",
|
19
19
|
"dependencies": {
|
20
20
|
"@mikro-orm/core": "^6.4.0",
|
21
|
+
"@mikro-orm/mongodb": "^6.4.2",
|
21
22
|
"cors": "^2.8.5",
|
22
23
|
"jose": "^5.9.6",
|
23
24
|
"openapi3-ts": "^4.4.0",
|
24
25
|
"redis": "^4.7.0",
|
25
26
|
"uuid": "^11.0.3",
|
26
|
-
"@forklaunch/
|
27
|
-
"@forklaunch/
|
27
|
+
"@forklaunch/common": "0.1.14",
|
28
|
+
"@forklaunch/validator": "0.3.13"
|
28
29
|
},
|
29
30
|
"devDependencies": {
|
30
31
|
"@eslint/js": "^9.16.0",
|