@bearei/server-common 0.0.137 → 0.0.138
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/dist/app.entity.d.ts +5 -5
- package/dist/app.entity.js +10 -9
- package/dist/app.entity.js.map +1 -1
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/app.entity.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { BaseEntity } from 'typeorm';
|
|
2
2
|
import { EntityStatus } from './app.interface';
|
|
3
3
|
export declare class CommonEntity extends BaseEntity {
|
|
4
|
-
|
|
4
|
+
primaryId: number;
|
|
5
5
|
id: string;
|
|
6
6
|
entityStatus: EntityStatus;
|
|
7
|
-
createdAt:
|
|
8
|
-
updatedAt:
|
|
9
|
-
version:
|
|
10
|
-
deletedAt:
|
|
7
|
+
createdAt: Date;
|
|
8
|
+
updatedAt: Date;
|
|
9
|
+
version: number;
|
|
10
|
+
deletedAt: Date;
|
|
11
11
|
beforeInsert(): void;
|
|
12
12
|
beforeUpdate(): void;
|
|
13
13
|
beforeSoftRemove(): void;
|
package/dist/app.entity.js
CHANGED
|
@@ -18,7 +18,7 @@ const nanoid_1 = require("nanoid");
|
|
|
18
18
|
const typeorm_1 = require("typeorm");
|
|
19
19
|
const app_interface_1 = require("./app.interface");
|
|
20
20
|
let CommonEntity = class CommonEntity extends typeorm_1.BaseEntity {
|
|
21
|
-
|
|
21
|
+
primaryId;
|
|
22
22
|
id;
|
|
23
23
|
entityStatus;
|
|
24
24
|
createdAt;
|
|
@@ -27,12 +27,13 @@ let CommonEntity = class CommonEntity extends typeorm_1.BaseEntity {
|
|
|
27
27
|
deletedAt;
|
|
28
28
|
beforeInsert() {
|
|
29
29
|
this.id = (0, nanoid_1.nanoid)();
|
|
30
|
-
this.createdAt = (0, dayjs_1.default)().
|
|
30
|
+
this.createdAt = (0, dayjs_1.default)().utc().toDate();
|
|
31
31
|
}
|
|
32
32
|
beforeUpdate() {
|
|
33
|
-
this.updatedAt = (0, dayjs_1.default)().
|
|
33
|
+
this.updatedAt = (0, dayjs_1.default)().utc().toDate();
|
|
34
34
|
}
|
|
35
35
|
beforeSoftRemove() {
|
|
36
|
+
this.deletedAt = (0, dayjs_1.default)().utc().toDate();
|
|
36
37
|
this.entityStatus = app_interface_1.EntityStatus.SOFT_REMOVED;
|
|
37
38
|
}
|
|
38
39
|
beforeRecover() {
|
|
@@ -43,7 +44,7 @@ exports.CommonEntity = CommonEntity;
|
|
|
43
44
|
__decorate([
|
|
44
45
|
(0, typeorm_1.PrimaryGeneratedColumn)('identity'),
|
|
45
46
|
__metadata("design:type", Number)
|
|
46
|
-
], CommonEntity.prototype, "
|
|
47
|
+
], CommonEntity.prototype, "primaryId", void 0);
|
|
47
48
|
__decorate([
|
|
48
49
|
(0, typeorm_1.Column)({ length: 32, nullable: false, type: 'varchar' }),
|
|
49
50
|
__metadata("design:type", String)
|
|
@@ -59,19 +60,19 @@ __decorate([
|
|
|
59
60
|
], CommonEntity.prototype, "entityStatus", void 0);
|
|
60
61
|
__decorate([
|
|
61
62
|
(0, typeorm_1.CreateDateColumn)({ nullable: false, type: 'timestamptz' }),
|
|
62
|
-
__metadata("design:type",
|
|
63
|
+
__metadata("design:type", Date)
|
|
63
64
|
], CommonEntity.prototype, "createdAt", void 0);
|
|
64
65
|
__decorate([
|
|
65
66
|
(0, typeorm_1.UpdateDateColumn)({ nullable: false, type: 'timestamptz' }),
|
|
66
|
-
__metadata("design:type",
|
|
67
|
+
__metadata("design:type", Date)
|
|
67
68
|
], CommonEntity.prototype, "updatedAt", void 0);
|
|
68
69
|
__decorate([
|
|
69
70
|
(0, typeorm_1.VersionColumn)({ nullable: false }),
|
|
70
|
-
__metadata("design:type",
|
|
71
|
+
__metadata("design:type", Number)
|
|
71
72
|
], CommonEntity.prototype, "version", void 0);
|
|
72
73
|
__decorate([
|
|
73
|
-
(0, typeorm_1.DeleteDateColumn)(),
|
|
74
|
-
__metadata("design:type",
|
|
74
|
+
(0, typeorm_1.DeleteDateColumn)({ nullable: false, type: 'timestamptz' }),
|
|
75
|
+
__metadata("design:type", Date)
|
|
75
76
|
], CommonEntity.prototype, "deletedAt", void 0);
|
|
76
77
|
__decorate([
|
|
77
78
|
(0, typeorm_1.BeforeInsert)(),
|
package/dist/app.entity.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.entity.js","sourceRoot":"","sources":["../src/app.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kDAAyB;AACzB,mCAA6B;AAC7B,qCAagB;AAChB,mDAA4C;AAIrC,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,oBAAU;IAEpC,SAAS,CAAQ;IAGjB,EAAE,CAAQ;IAQV,YAAY,CAAc;IAG1B,SAAS,
|
|
1
|
+
{"version":3,"file":"app.entity.js","sourceRoot":"","sources":["../src/app.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,kDAAyB;AACzB,mCAA6B;AAC7B,qCAagB;AAChB,mDAA4C;AAIrC,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,oBAAU;IAEpC,SAAS,CAAQ;IAGjB,EAAE,CAAQ;IAQV,YAAY,CAAc;IAG1B,SAAS,CAAM;IAGf,SAAS,CAAM;IAGf,OAAO,CAAQ;IAGf,SAAS,CAAM;IAGf,YAAY;QACJ,IAAI,CAAC,EAAE,GAAG,IAAA,eAAM,GAAE,CAAA;QAClB,IAAI,CAAC,SAAS,GAAG,IAAA,eAAK,GAAE,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,CAAA;IAC/C,CAAC;IAGD,YAAY;QACJ,IAAI,CAAC,SAAS,GAAG,IAAA,eAAK,GAAE,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,CAAA;IAC/C,CAAC;IAGD,gBAAgB;QACR,IAAI,CAAC,SAAS,GAAG,IAAA,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EAAC,CAAC,IAAI,CAAC,EAAE,EAAC,MAAM,EAAE,IAAI,EAAC,CAAC;GACjB,YAAY,CAgDxB"}
|
package/dist/index.js
CHANGED
|
@@ -13,6 +13,9 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
13
13
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
16
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
20
|
__exportStar(require("./access"), exports);
|
|
18
21
|
__exportStar(require("./action-log"), exports);
|
|
@@ -29,4 +32,7 @@ __exportStar(require("./permission"), exports);
|
|
|
29
32
|
__exportStar(require("./redis"), exports);
|
|
30
33
|
__exportStar(require("./subscription"), exports);
|
|
31
34
|
__exportStar(require("./utils"), exports);
|
|
35
|
+
const dayjs_1 = __importDefault(require("dayjs"));
|
|
36
|
+
const utc_1 = __importDefault(require("dayjs/plugin/utc"));
|
|
37
|
+
dayjs_1.default.extend(utc_1.default);
|
|
32
38
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,2CAAwB;AACxB,+CAA4B;AAC5B,4CAAyB;AACzB,+CAA4B;AAC5B,kDAA+B;AAC/B,mDAAgC;AAChC,yCAAsB;AACtB,6CAA0B;AAC1B,+CAA4B;AAC5B,6CAA0B;AAC1B,wCAAqB;AACrB,+CAA4B;AAC5B,0CAAuB;AACvB,iDAA8B;AAC9B,0CAAuB;AACvB,kDAAyB;AACzB,2DAAkC;AAElC,eAAK,CAAC,MAAM,CAAC,aAAG,CAAC,CAAA"}
|