@comasoft/nestjs 0.1.2 → 0.1.7
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 +2 -0
- package/dist/aws/aws-s3.service.js +1 -158
- package/dist/aws/aws.module.js +1 -25
- package/dist/aws/aws.service.js +1 -21
- package/dist/aws/constants/storage.constant.js +1 -25
- package/dist/aws/dto/create-s3-presigned.dto.js +1 -78
- package/dist/aws/dto/index.js +1 -18
- package/dist/aws/dto/response-s3-presigned.dto.js +1 -110
- package/dist/aws/index.js +1 -20
- package/dist/aws/types/s3.interface.js +1 -2
- package/dist/aws/types/storage.interface.js +1 -2
- package/dist/category/category.module.js +1 -23
- package/dist/category/category.service.d.ts +20 -8
- package/dist/category/category.service.js +1 -124
- package/dist/category/dto/create-category.dto.js +1 -34
- package/dist/category/dto/delete-category.dto.js +1 -6
- package/dist/category/dto/index.js +1 -21
- package/dist/category/dto/response-categories.dto.js +1 -52
- package/dist/category/dto/update-category-sort.dto.js +1 -33
- package/dist/category/dto/update-category.dto.js +1 -9
- package/dist/category/index.js +1 -19
- package/dist/comment/comment.module.js +1 -23
- package/dist/comment/comment.service.d.ts +12 -3
- package/dist/comment/comment.service.js +1 -240
- package/dist/comment/dto/create-comment.dto.d.ts +1 -0
- package/dist/comment/dto/create-comment.dto.js +1 -41
- package/dist/comment/dto/index.js +1 -19
- package/dist/comment/dto/response-comment.dto.d.ts +5 -2
- package/dist/comment/dto/response-comment.dto.js +1 -97
- package/dist/comment/dto/update-comment.dto.js +1 -22
- package/dist/comment/index.js +1 -19
- package/dist/database/entities/category.entity.js +1 -70
- package/dist/database/entities/comment.entity.d.ts +2 -0
- package/dist/database/entities/comment.entity.js +1 -77
- package/dist/database/entities/config.entity.js +1 -44
- package/dist/database/entities/file.entity.js +1 -91
- package/dist/database/entities/index.js +1 -26
- package/dist/database/entities/like.entity.d.ts +1 -0
- package/dist/database/entities/like.entity.js +1 -49
- package/dist/database/entities/logs-audit.entity.d.ts +3 -0
- package/dist/database/entities/logs-audit.entity.js +1 -72
- package/dist/database/entities/logs-event.entity.d.ts +2 -0
- package/dist/database/entities/logs-event.entity.js +1 -72
- package/dist/database/entities/notification-recipient.entity.d.ts +4 -0
- package/dist/database/entities/notification-recipient.entity.js +1 -74
- package/dist/database/entities/notification.entity.d.ts +4 -0
- package/dist/database/entities/notification.entity.js +1 -69
- package/dist/database/entities/role.entity.js +1 -54
- package/dist/decorators/api-custom-params.decorator.js +1 -35
- package/dist/decorators/auth.decorator.factory.js +1 -33
- package/dist/decorators/cookies.decorator.js +1 -9
- package/dist/decorators/custom-params.decorator.js +1 -16
- package/dist/decorators/index.d.ts +0 -2
- package/dist/decorators/index.js +1 -24
- package/dist/decorators/patch-body.decorator.js +1 -38
- package/dist/decorators/soft-delete.decorator.js +1 -10
- package/dist/decorators/timestamps.decorator.js +1 -23
- package/dist/decorators/user.decorator.js +1 -8
- package/dist/dto/auth-user-local.dto.js +1 -26
- package/dist/dto/auth-user-sso.dto.js +1 -21
- package/dist/dto/custom-params.dto.js +1 -46
- package/dist/dto/file.dto.js +1 -70
- package/dist/dto/index.js +1 -26
- package/dist/dto/jwt-user.dto.js +1 -6
- package/dist/dto/pagination.dto.js +1 -36
- package/dist/dto/remove-ids.dto.js +1 -23
- package/dist/dto/response-access-token.dto.js +1 -24
- package/dist/dto/response-id.dto.js +1 -35
- package/dist/dto/response-uid.dto.js +1 -35
- package/dist/dto/update-ids.dto.js +1 -45
- package/dist/dto/update-sort.dto.js +1 -50
- package/dist/enums.common.d.ts +2 -1
- package/dist/enums.common.js +1 -62
- package/dist/events/event-bus.module.js +1 -44
- package/dist/events/index.js +1 -20
- package/dist/events/listeners/audit-event.listener.js +1 -58
- package/dist/events/listeners/index.d.ts +1 -0
- package/dist/events/listeners/index.js +1 -17
- package/dist/events/listeners/notification-event.listener.d.ts +7 -0
- package/dist/events/listeners/notification-event.listener.js +1 -0
- package/dist/events/listeners/system-event.listener.js +1 -58
- package/dist/events/services/event-logger.service.js +1 -34
- package/dist/events/services/event-notification.service.js +1 -104
- package/dist/events/services/event-storage.service.js +1 -79
- package/dist/events/services/index.js +1 -20
- package/dist/events/services/token.service.d.ts +2 -4
- package/dist/events/services/token.service.js +1 -88
- package/dist/events/types/audit-events.type.d.ts +4 -1
- package/dist/events/types/audit-events.type.js +1 -2
- package/dist/events/types/index.js +1 -17
- package/dist/filters/http-exception.filter.d.ts +2 -2
- package/dist/filters/http-exception.filter.js +1 -75
- package/dist/filters/index.js +1 -17
- package/dist/guards/auth.guard.js +1 -60
- package/dist/guards/index.d.ts +3 -0
- package/dist/guards/index.js +1 -0
- package/dist/guards/jwt.guard.js +1 -17
- package/dist/guards/permission.guard.d.ts +10 -0
- package/dist/guards/permission.guard.js +1 -0
- package/dist/guards/role.guard.d.ts +8 -0
- package/dist/guards/role.guard.js +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -36
- package/dist/interceptors/error.interceptor.js +1 -26
- package/dist/interceptors/index.js +1 -18
- package/dist/interceptors/success.interceptor.d.ts +1 -1
- package/dist/interceptors/success.interceptor.js +1 -30
- package/dist/library.module.js +1 -20
- package/dist/like/dto/create-like.dto.js +1 -47
- package/dist/like/dto/index.js +1 -18
- package/dist/like/dto/response-like.dto.js +1 -79
- package/dist/like/index.js +1 -19
- package/dist/like/like.module.js +1 -23
- package/dist/like/like.service.d.ts +2 -2
- package/dist/like/like.service.js +1 -155
- package/dist/logger/index.js +1 -18
- package/dist/logger/pino-options.js +1 -77
- package/dist/logger/pino-pretty-transport.js +1 -164
- package/dist/notifications/index.d.ts +27 -4
- package/dist/notifications/index.js +1 -18
- package/dist/notifications/notification.module.js +1 -32
- package/dist/notifications/services/email.service.d.ts +5 -4
- package/dist/notifications/services/email.service.js +1 -69
- package/dist/notifications/services/index.d.ts +1 -0
- package/dist/notifications/services/index.js +1 -23
- package/dist/notifications/services/kakao.service.d.ts +17 -17
- package/dist/notifications/services/kakao.service.js +1 -94
- package/dist/notifications/services/message-template.service.d.ts +6 -2
- package/dist/notifications/services/message-template.service.js +1 -74
- package/dist/notifications/services/notification-send.service.d.ts +8 -12
- package/dist/notifications/services/notification-send.service.js +1 -146
- package/dist/notifications/services/notification.service.d.ts +3 -1
- package/dist/notifications/services/notification.service.js +1 -125
- package/dist/notifications/services/slack.service.d.ts +6 -1
- package/dist/notifications/services/slack.service.js +1 -53
- package/dist/notifications/services/sms.service.js +1 -62
- package/dist/notifications/services/web.service.d.ts +15 -0
- package/dist/notifications/services/web.service.js +1 -0
- package/dist/passport/google.strategy.d.ts +13 -0
- package/dist/passport/google.strategy.js +1 -0
- package/dist/passport/index.d.ts +4 -0
- package/dist/passport/index.js +1 -0
- package/dist/passport/jwt.strategy.js +1 -55
- package/dist/passport/kakao.strategy.d.ts +2 -1
- package/dist/passport/kakao.strategy.js +1 -36
- package/dist/passport/local.strategy.js +1 -41
- package/dist/redis/index.js +1 -18
- package/dist/redis/redis-constraint.js +1 -4
- package/dist/redis/redis.module.js +1 -62
- package/dist/redis/redis.service.js +1 -76
- package/dist/role/dto/create-role.dto.js +1 -41
- package/dist/role/dto/index.js +1 -19
- package/dist/role/dto/response-roles.dto.js +1 -62
- package/dist/role/dto/update-role.dto.js +1 -9
- package/dist/role/index.js +1 -19
- package/dist/role/role.module.js +1 -23
- package/dist/role/role.service.d.ts +20 -6
- package/dist/role/role.service.js +1 -144
- package/dist/services/file.service.d.ts +4 -4
- package/dist/services/file.service.js +1 -82
- package/dist/services/index.js +1 -18
- package/dist/services/permission-checker.service.js +1 -65
- package/dist/setup-swagger.js +1 -32
- package/dist/shared/error-codes.js +1 -9
- package/dist/utils/common.utils.js +1 -42
- package/dist/utils/enum.utils.js +1 -8
- package/dist/utils/file.utils.d.ts +6 -0
- package/dist/utils/file.utils.js +1 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.js +1 -21
- package/dist/utils/object-diff.js +1 -33
- package/dist/utils/pagination-qb.utils.js +1 -154
- package/dist/utils/pagination.utils.js +1 -32
- package/package.json +3 -2
|
@@ -1,49 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
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;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.Like = void 0;
|
|
13
|
-
const typeorm_1 = require("typeorm");
|
|
14
|
-
const enums_common_1 = require("../../enums.common");
|
|
15
|
-
let Like = class Like {
|
|
16
|
-
};
|
|
17
|
-
exports.Like = Like;
|
|
18
|
-
__decorate([
|
|
19
|
-
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
20
|
-
__metadata("design:type", Number)
|
|
21
|
-
], Like.prototype, "id", void 0);
|
|
22
|
-
__decorate([
|
|
23
|
-
(0, typeorm_1.Column)('varchar', { length: 25 }),
|
|
24
|
-
__metadata("design:type", String)
|
|
25
|
-
], Like.prototype, "target", void 0);
|
|
26
|
-
__decorate([
|
|
27
|
-
(0, typeorm_1.Column)('int'),
|
|
28
|
-
__metadata("design:type", Number)
|
|
29
|
-
], Like.prototype, "target_id", void 0);
|
|
30
|
-
__decorate([
|
|
31
|
-
(0, typeorm_1.Column)('int', { nullable: true }),
|
|
32
|
-
__metadata("design:type", Number)
|
|
33
|
-
], Like.prototype, "user_id", void 0);
|
|
34
|
-
__decorate([
|
|
35
|
-
(0, typeorm_1.Column)('enum', { enum: enums_common_1.LIKE_TYPE }),
|
|
36
|
-
__metadata("design:type", String)
|
|
37
|
-
], Like.prototype, "type", void 0);
|
|
38
|
-
__decorate([
|
|
39
|
-
(0, typeorm_1.CreateDateColumn)({ type: 'timestamptz' }),
|
|
40
|
-
__metadata("design:type", Date)
|
|
41
|
-
], Like.prototype, "created_at", void 0);
|
|
42
|
-
__decorate([
|
|
43
|
-
(0, typeorm_1.UpdateDateColumn)({ type: 'timestamptz' }),
|
|
44
|
-
__metadata("design:type", Date)
|
|
45
|
-
], Like.prototype, "updated_at", void 0);
|
|
46
|
-
exports.Like = Like = __decorate([
|
|
47
|
-
(0, typeorm_1.Entity)('likes'),
|
|
48
|
-
(0, typeorm_1.Index)(['target', 'target_id', 'user_id'])
|
|
49
|
-
], Like);
|
|
1
|
+
var e=this&&this.__decorate||function(e,t,o,r){var i,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var p=e.length-1;p>=0;p--)(i=e[p])&&(a=(n<3?i(a):n>3?i(t,o,a):i(t,o))||a);return n>3&&a&&Object.defineProperty(t,o,a),a},t=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.Like=void 0;const o=require("typeorm"),r=require("../../enums.common");let i=class Like{};exports.Like=i,e([(0,o.PrimaryGeneratedColumn)({name:"id",primaryKeyConstraintName:"PK_likes"}),t("design:type",Number)],i.prototype,"id",void 0),e([(0,o.Column)("varchar",{length:25}),t("design:type",String)],i.prototype,"target",void 0),e([(0,o.Column)("int"),t("design:type",Number)],i.prototype,"target_id",void 0),e([(0,o.Column)("int",{nullable:!0}),t("design:type",Number)],i.prototype,"user_id",void 0),e([(0,o.Column)("enum",{enum:r.LIKE_TYPE}),t("design:type",String)],i.prototype,"type",void 0),e([(0,o.Column)("jsonb",{nullable:!0}),t("design:type",Object)],i.prototype,"meta",void 0),e([(0,o.CreateDateColumn)({type:"timestamptz"}),t("design:type",Date)],i.prototype,"created_at",void 0),e([(0,o.UpdateDateColumn)({type:"timestamptz"}),t("design:type",Date)],i.prototype,"updated_at",void 0),exports.Like=i=e([(0,o.Entity)("likes"),(0,o.Index)("IDX_likes_target_target_id_user_id",["target","target_id","user_id"])],i);
|
|
@@ -5,12 +5,15 @@ export declare class LogsAudit {
|
|
|
5
5
|
name: string;
|
|
6
6
|
entity: string;
|
|
7
7
|
entity_id: number;
|
|
8
|
+
entity_ids?: string[];
|
|
8
9
|
action: AUDIT_ACTION;
|
|
9
10
|
user_id: number;
|
|
11
|
+
target_user_id?: number;
|
|
10
12
|
changes?: Record<string, any>;
|
|
11
13
|
ip_address?: string;
|
|
12
14
|
user_agent?: string;
|
|
13
15
|
description?: string;
|
|
16
|
+
meta?: Record<string, any>;
|
|
14
17
|
occurred_at: Date;
|
|
15
18
|
created_at: Date;
|
|
16
19
|
}
|
|
@@ -1,72 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
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;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.LogsAudit = void 0;
|
|
13
|
-
const typeorm_1 = require("typeorm");
|
|
14
|
-
const enums_common_1 = require("../../enums.common");
|
|
15
|
-
let LogsAudit = class LogsAudit {
|
|
16
|
-
};
|
|
17
|
-
exports.LogsAudit = LogsAudit;
|
|
18
|
-
__decorate([
|
|
19
|
-
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
20
|
-
__metadata("design:type", Number)
|
|
21
|
-
], LogsAudit.prototype, "id", void 0);
|
|
22
|
-
__decorate([
|
|
23
|
-
(0, typeorm_1.Column)('char', { length: 21 }),
|
|
24
|
-
__metadata("design:type", String)
|
|
25
|
-
], LogsAudit.prototype, "uid", void 0);
|
|
26
|
-
__decorate([
|
|
27
|
-
(0, typeorm_1.Column)('varchar', { length: 255 }),
|
|
28
|
-
__metadata("design:type", String)
|
|
29
|
-
], LogsAudit.prototype, "name", void 0);
|
|
30
|
-
__decorate([
|
|
31
|
-
(0, typeorm_1.Column)('varchar', { length: 50 }),
|
|
32
|
-
__metadata("design:type", String)
|
|
33
|
-
], LogsAudit.prototype, "entity", void 0);
|
|
34
|
-
__decorate([
|
|
35
|
-
(0, typeorm_1.Column)('int'),
|
|
36
|
-
__metadata("design:type", Number)
|
|
37
|
-
], LogsAudit.prototype, "entity_id", void 0);
|
|
38
|
-
__decorate([
|
|
39
|
-
(0, typeorm_1.Column)('enum', { enum: enums_common_1.AUDIT_ACTION }),
|
|
40
|
-
__metadata("design:type", String)
|
|
41
|
-
], LogsAudit.prototype, "action", void 0);
|
|
42
|
-
__decorate([
|
|
43
|
-
(0, typeorm_1.Column)('int'),
|
|
44
|
-
__metadata("design:type", Number)
|
|
45
|
-
], LogsAudit.prototype, "user_id", void 0);
|
|
46
|
-
__decorate([
|
|
47
|
-
(0, typeorm_1.Column)('jsonb', { nullable: true }),
|
|
48
|
-
__metadata("design:type", Object)
|
|
49
|
-
], LogsAudit.prototype, "changes", void 0);
|
|
50
|
-
__decorate([
|
|
51
|
-
(0, typeorm_1.Column)('varchar', { length: 45, nullable: true }),
|
|
52
|
-
__metadata("design:type", String)
|
|
53
|
-
], LogsAudit.prototype, "ip_address", void 0);
|
|
54
|
-
__decorate([
|
|
55
|
-
(0, typeorm_1.Column)('varchar', { length: 255, nullable: true }),
|
|
56
|
-
__metadata("design:type", String)
|
|
57
|
-
], LogsAudit.prototype, "user_agent", void 0);
|
|
58
|
-
__decorate([
|
|
59
|
-
(0, typeorm_1.Column)('varchar', { length: 255, nullable: true }),
|
|
60
|
-
__metadata("design:type", String)
|
|
61
|
-
], LogsAudit.prototype, "description", void 0);
|
|
62
|
-
__decorate([
|
|
63
|
-
(0, typeorm_1.Column)('timestamptz'),
|
|
64
|
-
__metadata("design:type", Date)
|
|
65
|
-
], LogsAudit.prototype, "occurred_at", void 0);
|
|
66
|
-
__decorate([
|
|
67
|
-
(0, typeorm_1.CreateDateColumn)({ type: 'timestamptz' }),
|
|
68
|
-
__metadata("design:type", Date)
|
|
69
|
-
], LogsAudit.prototype, "created_at", void 0);
|
|
70
|
-
exports.LogsAudit = LogsAudit = __decorate([
|
|
71
|
-
(0, typeorm_1.Entity)('logs_audit')
|
|
72
|
-
], LogsAudit);
|
|
1
|
+
var e=this&&this.__decorate||function(e,t,n,o){var i,r=arguments.length,l=r<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,n):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,n,o);else for(var d=e.length-1;d>=0;d--)(i=e[d])&&(l=(r<3?i(l):r>3?i(t,n,l):i(t,n))||l);return r>3&&l&&Object.defineProperty(t,n,l),l},t=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.LogsAudit=void 0;const n=require("typeorm"),o=require("../../enums.common");let i=class LogsAudit{};exports.LogsAudit=i,e([(0,n.PrimaryGeneratedColumn)({name:"id",primaryKeyConstraintName:"PK_laudit"}),t("design:type",Number)],i.prototype,"id",void 0),e([(0,n.Column)("char",{length:21}),t("design:type",String)],i.prototype,"uid",void 0),e([(0,n.Column)("varchar",{length:255}),t("design:type",String)],i.prototype,"name",void 0),e([(0,n.Column)("varchar",{length:50,nullable:!0}),t("design:type",String)],i.prototype,"entity",void 0),e([(0,n.Column)("int",{nullable:!0,comment:"-1: all, 0: none"}),t("design:type",Number)],i.prototype,"entity_id",void 0),e([(0,n.Column)("jsonb",{nullable:!0}),t("design:type",Array)],i.prototype,"entity_ids",void 0),e([(0,n.Column)("enum",{enum:o.AUDIT_ACTION,nullable:!0}),t("design:type",String)],i.prototype,"action",void 0),e([(0,n.Column)("int",{nullable:!0}),t("design:type",Number)],i.prototype,"user_id",void 0),e([(0,n.Column)("int",{nullable:!0}),t("design:type",Number)],i.prototype,"target_user_id",void 0),e([(0,n.Column)("jsonb",{nullable:!0}),t("design:type",Object)],i.prototype,"changes",void 0),e([(0,n.Column)("varchar",{length:45,nullable:!0}),t("design:type",String)],i.prototype,"ip_address",void 0),e([(0,n.Column)("varchar",{length:255,nullable:!0}),t("design:type",String)],i.prototype,"user_agent",void 0),e([(0,n.Column)("varchar",{length:255,nullable:!0}),t("design:type",String)],i.prototype,"description",void 0),e([(0,n.Column)("jsonb",{nullable:!0}),t("design:type",Object)],i.prototype,"meta",void 0),e([(0,n.Column)("timestamptz"),t("design:type",Date)],i.prototype,"occurred_at",void 0),e([(0,n.CreateDateColumn)({type:"timestamptz"}),t("design:type",Date)],i.prototype,"created_at",void 0),exports.LogsAudit=i=e([(0,n.Entity)("logs_audit"),(0,n.Index)("IDX_laudit_uid",["uid"]),(0,n.Index)("IDX_laudit_name_entity_id",["name","entity_id"]),(0,n.Index)("IDX_laudit_user_id_name_entity_id",["user_id","name","entity_id"])],i);
|
|
@@ -5,12 +5,14 @@ export declare class LogsEvent {
|
|
|
5
5
|
name: string;
|
|
6
6
|
entity: string;
|
|
7
7
|
entity_id: number;
|
|
8
|
+
entity_ids?: string[];
|
|
8
9
|
action: AUDIT_ACTION;
|
|
9
10
|
user_id: number;
|
|
10
11
|
changes?: Record<string, any>;
|
|
11
12
|
ip_address?: string;
|
|
12
13
|
user_agent?: string;
|
|
13
14
|
description?: string;
|
|
15
|
+
meta?: Record<string, any>;
|
|
14
16
|
occurred_at: Date;
|
|
15
17
|
created_at: Date;
|
|
16
18
|
}
|
|
@@ -1,72 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
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;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.LogsEvent = void 0;
|
|
13
|
-
const typeorm_1 = require("typeorm");
|
|
14
|
-
const enums_common_1 = require("../../enums.common");
|
|
15
|
-
let LogsEvent = class LogsEvent {
|
|
16
|
-
};
|
|
17
|
-
exports.LogsEvent = LogsEvent;
|
|
18
|
-
__decorate([
|
|
19
|
-
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
20
|
-
__metadata("design:type", Number)
|
|
21
|
-
], LogsEvent.prototype, "id", void 0);
|
|
22
|
-
__decorate([
|
|
23
|
-
(0, typeorm_1.Column)('char', { length: 21 }),
|
|
24
|
-
__metadata("design:type", String)
|
|
25
|
-
], LogsEvent.prototype, "uid", void 0);
|
|
26
|
-
__decorate([
|
|
27
|
-
(0, typeorm_1.Column)('varchar', { length: 255 }),
|
|
28
|
-
__metadata("design:type", String)
|
|
29
|
-
], LogsEvent.prototype, "name", void 0);
|
|
30
|
-
__decorate([
|
|
31
|
-
(0, typeorm_1.Column)('varchar', { length: 50, nullable: true }),
|
|
32
|
-
__metadata("design:type", String)
|
|
33
|
-
], LogsEvent.prototype, "entity", void 0);
|
|
34
|
-
__decorate([
|
|
35
|
-
(0, typeorm_1.Column)('int', { nullable: true }),
|
|
36
|
-
__metadata("design:type", Number)
|
|
37
|
-
], LogsEvent.prototype, "entity_id", void 0);
|
|
38
|
-
__decorate([
|
|
39
|
-
(0, typeorm_1.Column)('enum', { enum: enums_common_1.AUDIT_ACTION, nullable: true }),
|
|
40
|
-
__metadata("design:type", String)
|
|
41
|
-
], LogsEvent.prototype, "action", void 0);
|
|
42
|
-
__decorate([
|
|
43
|
-
(0, typeorm_1.Column)('int', { nullable: true }),
|
|
44
|
-
__metadata("design:type", Number)
|
|
45
|
-
], LogsEvent.prototype, "user_id", void 0);
|
|
46
|
-
__decorate([
|
|
47
|
-
(0, typeorm_1.Column)('jsonb', { nullable: true }),
|
|
48
|
-
__metadata("design:type", Object)
|
|
49
|
-
], LogsEvent.prototype, "changes", void 0);
|
|
50
|
-
__decorate([
|
|
51
|
-
(0, typeorm_1.Column)('varchar', { length: 45, nullable: true }),
|
|
52
|
-
__metadata("design:type", String)
|
|
53
|
-
], LogsEvent.prototype, "ip_address", void 0);
|
|
54
|
-
__decorate([
|
|
55
|
-
(0, typeorm_1.Column)('varchar', { length: 255, nullable: true }),
|
|
56
|
-
__metadata("design:type", String)
|
|
57
|
-
], LogsEvent.prototype, "user_agent", void 0);
|
|
58
|
-
__decorate([
|
|
59
|
-
(0, typeorm_1.Column)('varchar', { length: 255, nullable: true }),
|
|
60
|
-
__metadata("design:type", String)
|
|
61
|
-
], LogsEvent.prototype, "description", void 0);
|
|
62
|
-
__decorate([
|
|
63
|
-
(0, typeorm_1.Column)('timestamptz'),
|
|
64
|
-
__metadata("design:type", Date)
|
|
65
|
-
], LogsEvent.prototype, "occurred_at", void 0);
|
|
66
|
-
__decorate([
|
|
67
|
-
(0, typeorm_1.CreateDateColumn)({ type: 'timestamptz' }),
|
|
68
|
-
__metadata("design:type", Date)
|
|
69
|
-
], LogsEvent.prototype, "created_at", void 0);
|
|
70
|
-
exports.LogsEvent = LogsEvent = __decorate([
|
|
71
|
-
(0, typeorm_1.Entity)('logs_event')
|
|
72
|
-
], LogsEvent);
|
|
1
|
+
var e=this&&this.__decorate||function(e,t,o,n){var r,i=arguments.length,l=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)l=Reflect.decorate(e,t,o,n);else for(var p=e.length-1;p>=0;p--)(r=e[p])&&(l=(i<3?r(l):i>3?r(t,o,l):r(t,o))||l);return i>3&&l&&Object.defineProperty(t,o,l),l},t=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.LogsEvent=void 0;const o=require("typeorm"),n=require("../../enums.common");let r=class LogsEvent{};exports.LogsEvent=r,e([(0,o.PrimaryGeneratedColumn)({name:"id",primaryKeyConstraintName:"PK_levent"}),t("design:type",Number)],r.prototype,"id",void 0),e([(0,o.Column)("char",{length:21}),t("design:type",String)],r.prototype,"uid",void 0),e([(0,o.Column)("varchar",{length:255}),t("design:type",String)],r.prototype,"name",void 0),e([(0,o.Column)("varchar",{length:50,nullable:!0}),t("design:type",String)],r.prototype,"entity",void 0),e([(0,o.Column)("int",{nullable:!0}),t("design:type",Number)],r.prototype,"entity_id",void 0),e([(0,o.Column)("jsonb",{nullable:!0}),t("design:type",Array)],r.prototype,"entity_ids",void 0),e([(0,o.Column)("enum",{enum:n.AUDIT_ACTION,nullable:!0}),t("design:type",String)],r.prototype,"action",void 0),e([(0,o.Column)("int",{nullable:!0}),t("design:type",Number)],r.prototype,"user_id",void 0),e([(0,o.Column)("jsonb",{nullable:!0}),t("design:type",Object)],r.prototype,"changes",void 0),e([(0,o.Column)("varchar",{length:45,nullable:!0}),t("design:type",String)],r.prototype,"ip_address",void 0),e([(0,o.Column)("varchar",{length:255,nullable:!0}),t("design:type",String)],r.prototype,"user_agent",void 0),e([(0,o.Column)("varchar",{length:255,nullable:!0}),t("design:type",String)],r.prototype,"description",void 0),e([(0,o.Column)("jsonb",{nullable:!0}),t("design:type",Object)],r.prototype,"meta",void 0),e([(0,o.Column)("timestamptz"),t("design:type",Date)],r.prototype,"occurred_at",void 0),e([(0,o.CreateDateColumn)({type:"timestamptz"}),t("design:type",Date)],r.prototype,"created_at",void 0),exports.LogsEvent=r=e([(0,o.Entity)("logs_event")],r);
|
|
@@ -6,8 +6,12 @@ declare class Relations {
|
|
|
6
6
|
export declare class NotificationRecipient extends Relations {
|
|
7
7
|
id: number;
|
|
8
8
|
notification_id: number;
|
|
9
|
+
type: string;
|
|
9
10
|
user_id: number;
|
|
10
11
|
recipient: string;
|
|
12
|
+
title: string;
|
|
13
|
+
content: string;
|
|
14
|
+
meta: Record<string, any>;
|
|
11
15
|
variables: Record<string, any>;
|
|
12
16
|
status: NOTIFICATION_STATUS;
|
|
13
17
|
sent_at: Date;
|
|
@@ -1,74 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
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;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.NotificationRecipient = void 0;
|
|
13
|
-
const typeorm_1 = require("typeorm");
|
|
14
|
-
const enums_common_1 = require("../../enums.common");
|
|
15
|
-
const notification_entity_1 = require("./notification.entity");
|
|
16
|
-
class Relations {
|
|
17
|
-
}
|
|
18
|
-
__decorate([
|
|
19
|
-
(0, typeorm_1.ManyToOne)(() => notification_entity_1.Notification, (notification) => notification.recipients),
|
|
20
|
-
(0, typeorm_1.JoinColumn)({ name: 'notification_id' }),
|
|
21
|
-
__metadata("design:type", notification_entity_1.Notification)
|
|
22
|
-
], Relations.prototype, "notification", void 0);
|
|
23
|
-
let NotificationRecipient = class NotificationRecipient extends Relations {
|
|
24
|
-
};
|
|
25
|
-
exports.NotificationRecipient = NotificationRecipient;
|
|
26
|
-
__decorate([
|
|
27
|
-
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
28
|
-
__metadata("design:type", Number)
|
|
29
|
-
], NotificationRecipient.prototype, "id", void 0);
|
|
30
|
-
__decorate([
|
|
31
|
-
(0, typeorm_1.Column)('int'),
|
|
32
|
-
__metadata("design:type", Number)
|
|
33
|
-
], NotificationRecipient.prototype, "notification_id", void 0);
|
|
34
|
-
__decorate([
|
|
35
|
-
(0, typeorm_1.Column)('int'),
|
|
36
|
-
__metadata("design:type", Number)
|
|
37
|
-
], NotificationRecipient.prototype, "user_id", void 0);
|
|
38
|
-
__decorate([
|
|
39
|
-
(0, typeorm_1.Column)('varchar', { length: 100, nullable: true }),
|
|
40
|
-
__metadata("design:type", String)
|
|
41
|
-
], NotificationRecipient.prototype, "recipient", void 0);
|
|
42
|
-
__decorate([
|
|
43
|
-
(0, typeorm_1.Column)('jsonb', { nullable: true }),
|
|
44
|
-
__metadata("design:type", Object)
|
|
45
|
-
], NotificationRecipient.prototype, "variables", void 0);
|
|
46
|
-
__decorate([
|
|
47
|
-
(0, typeorm_1.Column)('enum', { enum: enums_common_1.NOTIFICATION_STATUS }),
|
|
48
|
-
__metadata("design:type", String)
|
|
49
|
-
], NotificationRecipient.prototype, "status", void 0);
|
|
50
|
-
__decorate([
|
|
51
|
-
(0, typeorm_1.Column)('timestamptz', { nullable: true }),
|
|
52
|
-
__metadata("design:type", Date)
|
|
53
|
-
], NotificationRecipient.prototype, "sent_at", void 0);
|
|
54
|
-
__decorate([
|
|
55
|
-
(0, typeorm_1.Column)('timestamptz', { nullable: true }),
|
|
56
|
-
__metadata("design:type", Date)
|
|
57
|
-
], NotificationRecipient.prototype, "read_at", void 0);
|
|
58
|
-
__decorate([
|
|
59
|
-
(0, typeorm_1.Column)('timestamptz', { nullable: true }),
|
|
60
|
-
__metadata("design:type", Date)
|
|
61
|
-
], NotificationRecipient.prototype, "failed_at", void 0);
|
|
62
|
-
__decorate([
|
|
63
|
-
(0, typeorm_1.Column)('varchar', { length: 255, nullable: true }),
|
|
64
|
-
__metadata("design:type", String)
|
|
65
|
-
], NotificationRecipient.prototype, "reason_failed", void 0);
|
|
66
|
-
__decorate([
|
|
67
|
-
(0, typeorm_1.CreateDateColumn)({ type: 'timestamptz' }),
|
|
68
|
-
__metadata("design:type", Date)
|
|
69
|
-
], NotificationRecipient.prototype, "created_at", void 0);
|
|
70
|
-
exports.NotificationRecipient = NotificationRecipient = __decorate([
|
|
71
|
-
(0, typeorm_1.Entity)('notification_recipients'),
|
|
72
|
-
(0, typeorm_1.Index)(['notification_id', 'status']),
|
|
73
|
-
(0, typeorm_1.Index)(['user_id'])
|
|
74
|
-
], NotificationRecipient);
|
|
1
|
+
var e=this&&this.__decorate||function(e,t,i,n){var o,a=arguments.length,r=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,i,n);else for(var p=e.length-1;p>=0;p--)(o=e[p])&&(r=(a<3?o(r):a>3?o(t,i,r):o(t,i))||r);return a>3&&r&&Object.defineProperty(t,i,r),r},t=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.NotificationRecipient=void 0;const i=require("typeorm"),n=require("../../enums.common"),o=require("./notification.entity");class Relations{}e([(0,i.ManyToOne)(()=>o.Notification,e=>e.recipients),(0,i.JoinColumn)({name:"notification_id",foreignKeyConstraintName:"FK_nrecipients_notification_id"}),t("design:type",o.Notification)],Relations.prototype,"notification",void 0);let a=class NotificationRecipient extends Relations{};exports.NotificationRecipient=a,e([(0,i.PrimaryGeneratedColumn)({name:"id",primaryKeyConstraintName:"PK_nrecipients"}),t("design:type",Number)],a.prototype,"id",void 0),e([(0,i.Column)("int"),t("design:type",Number)],a.prototype,"notification_id",void 0),e([(0,i.Column)("varchar",{length:25,nullable:!0}),t("design:type",String)],a.prototype,"type",void 0),e([(0,i.Column)("int"),t("design:type",Number)],a.prototype,"user_id",void 0),e([(0,i.Column)("varchar",{length:100,nullable:!0}),t("design:type",String)],a.prototype,"recipient",void 0),e([(0,i.Column)("varchar",{length:255,nullable:!0}),t("design:type",String)],a.prototype,"title",void 0),e([(0,i.Column)("text",{nullable:!0}),t("design:type",String)],a.prototype,"content",void 0),e([(0,i.Column)("jsonb",{nullable:!0}),t("design:type",Object)],a.prototype,"meta",void 0),e([(0,i.Column)("jsonb",{nullable:!0}),t("design:type",Object)],a.prototype,"variables",void 0),e([(0,i.Column)("enum",{enum:n.NOTIFICATION_STATUS}),t("design:type",String)],a.prototype,"status",void 0),e([(0,i.Column)("timestamptz",{nullable:!0}),t("design:type",Date)],a.prototype,"sent_at",void 0),e([(0,i.Column)("timestamptz",{nullable:!0}),t("design:type",Date)],a.prototype,"read_at",void 0),e([(0,i.Column)("timestamptz",{nullable:!0}),t("design:type",Date)],a.prototype,"failed_at",void 0),e([(0,i.Column)("varchar",{length:255,nullable:!0}),t("design:type",String)],a.prototype,"reason_failed",void 0),e([(0,i.CreateDateColumn)({type:"timestamptz"}),t("design:type",Date)],a.prototype,"created_at",void 0),exports.NotificationRecipient=a=e([(0,i.Entity)("notification_recipients"),(0,i.Index)("IDX_nrecipients_notification_id_status",["notification_id","status"]),(0,i.Index)("IDX_nrecipients_user_id",["user_id"]),(0,i.Index)("IDX_nrecipients_type",["type"])],a);
|
|
@@ -6,11 +6,15 @@ declare class Relations {
|
|
|
6
6
|
export declare class Notification extends Relations {
|
|
7
7
|
id: number;
|
|
8
8
|
type: string;
|
|
9
|
+
batch_id: string;
|
|
9
10
|
template_key: string;
|
|
10
11
|
status: NOTIFICATION_STATUS;
|
|
11
12
|
sender: string;
|
|
12
13
|
title: string;
|
|
13
14
|
content: string;
|
|
15
|
+
meta: Record<string, any>;
|
|
16
|
+
scheduled_at: Date;
|
|
17
|
+
sent_at: Date;
|
|
14
18
|
created_at: Date;
|
|
15
19
|
updated_at: Date;
|
|
16
20
|
deleted_at: Date;
|
|
@@ -1,69 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
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;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.Notification = void 0;
|
|
13
|
-
const typeorm_1 = require("typeorm");
|
|
14
|
-
const enums_common_1 = require("../../enums.common");
|
|
15
|
-
const notification_recipient_entity_1 = require("./notification-recipient.entity");
|
|
16
|
-
class Relations {
|
|
17
|
-
}
|
|
18
|
-
__decorate([
|
|
19
|
-
(0, typeorm_1.OneToMany)(() => notification_recipient_entity_1.NotificationRecipient, (recipient) => recipient.notification),
|
|
20
|
-
__metadata("design:type", Array)
|
|
21
|
-
], Relations.prototype, "recipients", void 0);
|
|
22
|
-
let Notification = class Notification extends Relations {
|
|
23
|
-
};
|
|
24
|
-
exports.Notification = Notification;
|
|
25
|
-
__decorate([
|
|
26
|
-
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
27
|
-
__metadata("design:type", Number)
|
|
28
|
-
], Notification.prototype, "id", void 0);
|
|
29
|
-
__decorate([
|
|
30
|
-
(0, typeorm_1.Column)('varchar', { length: 25 }),
|
|
31
|
-
__metadata("design:type", String)
|
|
32
|
-
], Notification.prototype, "type", void 0);
|
|
33
|
-
__decorate([
|
|
34
|
-
(0, typeorm_1.Column)('varchar', { length: 25 }),
|
|
35
|
-
__metadata("design:type", String)
|
|
36
|
-
], Notification.prototype, "template_key", void 0);
|
|
37
|
-
__decorate([
|
|
38
|
-
(0, typeorm_1.Column)('enum', { enum: enums_common_1.NOTIFICATION_STATUS }),
|
|
39
|
-
__metadata("design:type", String)
|
|
40
|
-
], Notification.prototype, "status", void 0);
|
|
41
|
-
__decorate([
|
|
42
|
-
(0, typeorm_1.Column)('varchar', { length: 25, nullable: true }),
|
|
43
|
-
__metadata("design:type", String)
|
|
44
|
-
], Notification.prototype, "sender", void 0);
|
|
45
|
-
__decorate([
|
|
46
|
-
(0, typeorm_1.Column)('varchar', { length: 100, nullable: true }),
|
|
47
|
-
__metadata("design:type", String)
|
|
48
|
-
], Notification.prototype, "title", void 0);
|
|
49
|
-
__decorate([
|
|
50
|
-
(0, typeorm_1.Column)('text', { nullable: true }),
|
|
51
|
-
__metadata("design:type", String)
|
|
52
|
-
], Notification.prototype, "content", void 0);
|
|
53
|
-
__decorate([
|
|
54
|
-
(0, typeorm_1.CreateDateColumn)({ type: 'timestamptz' }),
|
|
55
|
-
__metadata("design:type", Date)
|
|
56
|
-
], Notification.prototype, "created_at", void 0);
|
|
57
|
-
__decorate([
|
|
58
|
-
(0, typeorm_1.UpdateDateColumn)({ type: 'timestamptz' }),
|
|
59
|
-
__metadata("design:type", Date)
|
|
60
|
-
], Notification.prototype, "updated_at", void 0);
|
|
61
|
-
__decorate([
|
|
62
|
-
(0, typeorm_1.DeleteDateColumn)({ type: 'timestamptz' }),
|
|
63
|
-
__metadata("design:type", Date)
|
|
64
|
-
], Notification.prototype, "deleted_at", void 0);
|
|
65
|
-
exports.Notification = Notification = __decorate([
|
|
66
|
-
(0, typeorm_1.Entity)('notifications'),
|
|
67
|
-
(0, typeorm_1.Index)(['id'], { where: 'deleted_at IS NULL' }),
|
|
68
|
-
(0, typeorm_1.Index)(['status'])
|
|
69
|
-
], Notification);
|
|
1
|
+
var t=this&&this.__decorate||function(t,e,o,i){var n,a=arguments.length,r=a<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,o,i);else for(var p=t.length-1;p>=0;p--)(n=t[p])&&(r=(a<3?n(r):a>3?n(e,o,r):n(e,o))||r);return a>3&&r&&Object.defineProperty(e,o,r),r},e=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.Notification=void 0;const o=require("typeorm"),i=require("../../enums.common"),n=require("./notification-recipient.entity");class Relations{}t([(0,o.OneToMany)(()=>n.NotificationRecipient,t=>t.notification),e("design:type",Array)],Relations.prototype,"recipients",void 0);let a=class Notification extends Relations{};exports.Notification=a,t([(0,o.PrimaryGeneratedColumn)({name:"id",primaryKeyConstraintName:"PK_notifications"}),e("design:type",Number)],a.prototype,"id",void 0),t([(0,o.Column)("varchar",{length:25}),e("design:type",String)],a.prototype,"type",void 0),t([(0,o.Column)("varchar",{length:50,nullable:!0}),e("design:type",String)],a.prototype,"batch_id",void 0),t([(0,o.Column)("varchar",{length:50}),e("design:type",String)],a.prototype,"template_key",void 0),t([(0,o.Column)("enum",{enum:i.NOTIFICATION_STATUS}),e("design:type",String)],a.prototype,"status",void 0),t([(0,o.Column)("varchar",{length:50,nullable:!0}),e("design:type",String)],a.prototype,"sender",void 0),t([(0,o.Column)("varchar",{length:100,nullable:!0}),e("design:type",String)],a.prototype,"title",void 0),t([(0,o.Column)("text",{nullable:!0}),e("design:type",String)],a.prototype,"content",void 0),t([(0,o.Column)("jsonb",{nullable:!0}),e("design:type",Object)],a.prototype,"meta",void 0),t([(0,o.Column)("timestamptz",{nullable:!0}),e("design:type",Date)],a.prototype,"scheduled_at",void 0),t([(0,o.Column)("timestamptz",{nullable:!0}),e("design:type",Date)],a.prototype,"sent_at",void 0),t([(0,o.CreateDateColumn)({type:"timestamptz"}),e("design:type",Date)],a.prototype,"created_at",void 0),t([(0,o.UpdateDateColumn)({type:"timestamptz"}),e("design:type",Date)],a.prototype,"updated_at",void 0),t([(0,o.DeleteDateColumn)({type:"timestamptz"}),e("design:type",Date)],a.prototype,"deleted_at",void 0),exports.Notification=a=t([(0,o.Entity)("notifications"),(0,o.Index)("IDX_notifications",["id"],{where:"deleted_at IS NULL"}),(0,o.Index)("IDX_notifications_status",["status"])],a);
|
|
@@ -1,54 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
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;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.Role = void 0;
|
|
13
|
-
const typeorm_1 = require("typeorm");
|
|
14
|
-
class Relations {
|
|
15
|
-
}
|
|
16
|
-
let Role = class Role extends Relations {
|
|
17
|
-
};
|
|
18
|
-
exports.Role = Role;
|
|
19
|
-
__decorate([
|
|
20
|
-
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
21
|
-
__metadata("design:type", Number)
|
|
22
|
-
], Role.prototype, "id", void 0);
|
|
23
|
-
__decorate([
|
|
24
|
-
(0, typeorm_1.Column)('varchar', { length: 100 }),
|
|
25
|
-
__metadata("design:type", String)
|
|
26
|
-
], Role.prototype, "name", void 0);
|
|
27
|
-
__decorate([
|
|
28
|
-
(0, typeorm_1.Column)('varchar', { length: 255, nullable: true }),
|
|
29
|
-
__metadata("design:type", String)
|
|
30
|
-
], Role.prototype, "description", void 0);
|
|
31
|
-
__decorate([
|
|
32
|
-
(0, typeorm_1.Column)('jsonb', { nullable: true }),
|
|
33
|
-
__metadata("design:type", Array)
|
|
34
|
-
], Role.prototype, "permissions", void 0);
|
|
35
|
-
__decorate([
|
|
36
|
-
(0, typeorm_1.Column)('boolean', { default: false, comment: '기본 권한 여부 (삭제불가)' }),
|
|
37
|
-
__metadata("design:type", Boolean)
|
|
38
|
-
], Role.prototype, "is_default", void 0);
|
|
39
|
-
__decorate([
|
|
40
|
-
(0, typeorm_1.Column)('boolean', { default: false, comment: '시스템 권한 여부 (수정,삭제불가)' }),
|
|
41
|
-
__metadata("design:type", Boolean)
|
|
42
|
-
], Role.prototype, "is_system", void 0);
|
|
43
|
-
__decorate([
|
|
44
|
-
(0, typeorm_1.Column)('integer', { default: 0 }),
|
|
45
|
-
__metadata("design:type", Number)
|
|
46
|
-
], Role.prototype, "sort", void 0);
|
|
47
|
-
__decorate([
|
|
48
|
-
(0, typeorm_1.CreateDateColumn)({ type: 'timestamptz' }),
|
|
49
|
-
__metadata("design:type", Date)
|
|
50
|
-
], Role.prototype, "created_at", void 0);
|
|
51
|
-
exports.Role = Role = __decorate([
|
|
52
|
-
(0, typeorm_1.Entity)('roles'),
|
|
53
|
-
(0, typeorm_1.Index)(['name'])
|
|
54
|
-
], Role);
|
|
1
|
+
var e=this&&this.__decorate||function(e,t,o,n){var r,a=arguments.length,i=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,o,n);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(i=(a<3?r(i):a>3?r(t,o,i):r(t,o))||i);return a>3&&i&&Object.defineProperty(t,o,i),i},t=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.Role=void 0;const o=require("typeorm");class Relations{}let n=class Role extends Relations{};exports.Role=n,e([(0,o.PrimaryGeneratedColumn)({name:"id",primaryKeyConstraintName:"PK_roles"}),t("design:type",Number)],n.prototype,"id",void 0),e([(0,o.Column)("varchar",{length:100}),t("design:type",String)],n.prototype,"name",void 0),e([(0,o.Column)("varchar",{length:255,nullable:!0}),t("design:type",String)],n.prototype,"description",void 0),e([(0,o.Column)("jsonb",{nullable:!0}),t("design:type",Array)],n.prototype,"permissions",void 0),e([(0,o.Column)("boolean",{default:!1,comment:"기본 권한 여부 (삭제불가)"}),t("design:type",Boolean)],n.prototype,"is_default",void 0),e([(0,o.Column)("boolean",{default:!1,comment:"시스템 권한 여부 (수정,삭제불가)"}),t("design:type",Boolean)],n.prototype,"is_system",void 0),e([(0,o.Column)("integer",{default:0}),t("design:type",Number)],n.prototype,"sort",void 0),e([(0,o.CreateDateColumn)({type:"timestamptz"}),t("design:type",Date)],n.prototype,"created_at",void 0),exports.Role=n=e([(0,o.Entity)("roles"),(0,o.Index)("IDX_roles_name",["name"])],n);
|
|
@@ -1,35 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ApiCustomParams = void 0;
|
|
4
|
-
const common_1 = require("@nestjs/common");
|
|
5
|
-
const swagger_1 = require("@nestjs/swagger");
|
|
6
|
-
const defaultParamOptions = {
|
|
7
|
-
_page: { name: '_page', required: false, type: Number, example: 1 },
|
|
8
|
-
_limit: { name: '_limit', required: false, type: Number, example: 5 },
|
|
9
|
-
_keyword: { name: '_keyword', required: false, type: String },
|
|
10
|
-
_sort: {
|
|
11
|
-
name: '_sort',
|
|
12
|
-
required: false,
|
|
13
|
-
type: String,
|
|
14
|
-
description: 'Sorting (field1-asc|field2-desc)',
|
|
15
|
-
},
|
|
16
|
-
_group: {
|
|
17
|
-
name: '_group',
|
|
18
|
-
required: false,
|
|
19
|
-
type: String,
|
|
20
|
-
description: 'Group (field1-value1|field2-value2)',
|
|
21
|
-
},
|
|
22
|
-
};
|
|
23
|
-
const ApiCustomParams = (options = {}) => {
|
|
24
|
-
const decos = [];
|
|
25
|
-
for (const key of Object.keys(defaultParamOptions)) {
|
|
26
|
-
if (key in options || key === '_page' || key === '_limit') {
|
|
27
|
-
decos.push(Object.assign(Object.assign({}, defaultParamOptions[key]), options[key]));
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
if (options.custom) {
|
|
31
|
-
decos.push(...options.custom);
|
|
32
|
-
}
|
|
33
|
-
return (0, common_1.applyDecorators)(...decos.map((deco) => (0, swagger_1.ApiQuery)(deco)));
|
|
34
|
-
};
|
|
35
|
-
exports.ApiCustomParams = ApiCustomParams;
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.ApiCustomParams=void 0;const e=require("@nestjs/common"),r=require("@nestjs/swagger"),t={_page:{name:"_page",required:!1,type:Number,example:1},_limit:{name:"_limit",required:!1,type:Number,example:5},_keyword:{name:"_keyword",required:!1,type:String},_sort:{name:"_sort",required:!1,type:String,description:"Sorting (field1-asc|field2-desc)"},_group:{name:"_group",required:!1,type:String,description:"Group (field1-value1|field2-value2)"}};exports.ApiCustomParams=(i={})=>{const s=[];for(const e of Object.keys(t))(e in i||"_page"===e||"_limit"===e)&&s.push(Object.assign(Object.assign({},t[e]),i[e]));return i.custom&&s.push(...i.custom),(0,e.applyDecorators)(...s.map(e=>(0,r.ApiQuery)(e)))};
|
|
@@ -1,33 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createAuthDecorator = createAuthDecorator;
|
|
4
|
-
const common_1 = require("@nestjs/common");
|
|
5
|
-
const swagger_1 = require("@nestjs/swagger");
|
|
6
|
-
const auth_guard_1 = require("../guards/auth.guard");
|
|
7
|
-
const jwt_guard_1 = require("../guards/jwt.guard");
|
|
8
|
-
function createAuthDecorator(roleEnum) {
|
|
9
|
-
return function (...args) {
|
|
10
|
-
const roles = [];
|
|
11
|
-
const permissions = [];
|
|
12
|
-
args.flat().forEach((arg) => {
|
|
13
|
-
if (typeof arg === 'string') {
|
|
14
|
-
if (arg.includes(':')) {
|
|
15
|
-
permissions.push(arg);
|
|
16
|
-
}
|
|
17
|
-
else {
|
|
18
|
-
roles.push(arg);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
const decorators = [
|
|
23
|
-
(0, common_1.SetMetadata)('roles', roles),
|
|
24
|
-
(0, common_1.SetMetadata)('roleEnum', roleEnum),
|
|
25
|
-
(0, common_1.UseGuards)(jwt_guard_1.JwtAuthGuard, auth_guard_1.AuthGuard),
|
|
26
|
-
(0, swagger_1.ApiBearerAuth)('access_token'),
|
|
27
|
-
(0, swagger_1.ApiUnauthorizedResponse)({ description: 'Unauthorized' }),
|
|
28
|
-
];
|
|
29
|
-
if (permissions.length)
|
|
30
|
-
decorators.push((0, common_1.SetMetadata)('permissions', permissions));
|
|
31
|
-
return (0, common_1.applyDecorators)(...decorators);
|
|
32
|
-
};
|
|
33
|
-
}
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.createAuthDecorator=function createAuthDecorator(s){return function(...u){const o=[],n=[];u.flat().forEach(e=>{"string"==typeof e&&(e.includes(":")?n.push(e):o.push(e))});const c=[(0,e.SetMetadata)("roles",o),(0,e.SetMetadata)("roleEnum",s),(0,e.UseGuards)(a.JwtAuthGuard,r.AuthGuard),(0,t.ApiBearerAuth)("access_token"),(0,t.ApiUnauthorizedResponse)({description:"Unauthorized"})];return n.length&&c.push((0,e.SetMetadata)("permissions",n)),(0,e.applyDecorators)(...c)}};const e=require("@nestjs/common"),t=require("@nestjs/swagger"),r=require("../guards/auth.guard"),a=require("../guards/jwt.guard");
|
|
@@ -1,9 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Cookies = void 0;
|
|
4
|
-
const common_1 = require("@nestjs/common");
|
|
5
|
-
exports.Cookies = (0, common_1.createParamDecorator)((data, ctx) => {
|
|
6
|
-
var _a;
|
|
7
|
-
const request = ctx.switchToHttp().getRequest();
|
|
8
|
-
return data ? (_a = request.cookies) === null || _a === void 0 ? void 0 : _a[data] : request.cookies;
|
|
9
|
-
});
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.Cookies=void 0;const e=require("@nestjs/common");exports.Cookies=(0,e.createParamDecorator)((e,o)=>{var t;const r=o.switchToHttp().getRequest();return e?null===(t=r.cookies)||void 0===t?void 0:t[e]:r.cookies});
|
|
@@ -1,16 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CustomParams = void 0;
|
|
4
|
-
const common_1 = require("@nestjs/common");
|
|
5
|
-
exports.CustomParams = (0, common_1.createParamDecorator)((_data, ctx) => {
|
|
6
|
-
const request = ctx.switchToHttp().getRequest();
|
|
7
|
-
const query = request.query;
|
|
8
|
-
const customParams = {
|
|
9
|
-
_page: query._page ? parseInt(query._page, 10) : 1,
|
|
10
|
-
_limit: query._limit ? parseInt(query._limit, 10) : 5,
|
|
11
|
-
_keyword: query._keyword || undefined,
|
|
12
|
-
_group: query._group || undefined,
|
|
13
|
-
_sort: query._sort || undefined,
|
|
14
|
-
};
|
|
15
|
-
return customParams;
|
|
16
|
-
});
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.CustomParams=void 0;const e=require("@nestjs/common");exports.CustomParams=(0,e.createParamDecorator)((e,t)=>{const o=t.switchToHttp().getRequest().query;return{_page:o._page?parseInt(o._page,10):1,_limit:o._limit?parseInt(o._limit,10):5,_keyword:o._keyword||void 0,_group:o._group||void 0,_sort:o._sort||void 0}});
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
export * from './custom-params.decorator';
|
|
2
2
|
export * from './api-custom-params.decorator';
|
|
3
3
|
export * from './patch-body.decorator';
|
|
4
|
-
export * from './user.decorator';
|
|
5
|
-
export * from './auth.decorator.factory';
|
|
6
4
|
export * from './cookies.decorator';
|
|
7
5
|
export * from './timestamps.decorator';
|
|
8
6
|
export * from './soft-delete.decorator';
|
package/dist/decorators/index.js
CHANGED
|
@@ -1,24 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./custom-params.decorator"), exports);
|
|
18
|
-
__exportStar(require("./api-custom-params.decorator"), exports);
|
|
19
|
-
__exportStar(require("./patch-body.decorator"), exports);
|
|
20
|
-
__exportStar(require("./user.decorator"), exports);
|
|
21
|
-
__exportStar(require("./auth.decorator.factory"), exports);
|
|
22
|
-
__exportStar(require("./cookies.decorator"), exports);
|
|
23
|
-
__exportStar(require("./timestamps.decorator"), exports);
|
|
24
|
-
__exportStar(require("./soft-delete.decorator"), exports);
|
|
1
|
+
var e=this&&this.__createBinding||(Object.create?function(e,r,t,o){void 0===o&&(o=t);var i=Object.getOwnPropertyDescriptor(r,t);i&&!("get"in i?!r.__esModule:i.writable||i.configurable)||(i={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,o,i)}:function(e,r,t,o){void 0===o&&(o=t),e[o]=r[t]}),r=this&&this.__exportStar||function(r,t){for(var o in r)"default"===o||Object.prototype.hasOwnProperty.call(t,o)||e(t,r,o)};Object.defineProperty(exports,"__esModule",{value:!0}),r(require("./custom-params.decorator"),exports),r(require("./api-custom-params.decorator"),exports),r(require("./patch-body.decorator"),exports),r(require("./cookies.decorator"),exports),r(require("./timestamps.decorator"),exports),r(require("./soft-delete.decorator"),exports);
|