@comasoft/nestjs 0.1.3 → 0.1.42
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/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.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.js +1 -240
- 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.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.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.js +1 -49
- package/dist/database/entities/logs-audit.entity.js +1 -72
- package/dist/database/entities/logs-event.entity.js +1 -72
- package/dist/database/entities/notification-recipient.entity.js +1 -74
- 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.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.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.js +1 -17
- 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.js +1 -88
- package/dist/events/types/audit-events.type.js +1 -2
- package/dist/events/types/index.js +1 -17
- package/dist/filters/http-exception.filter.js +1 -78
- package/dist/filters/index.js +1 -17
- package/dist/guards/auth.guard.js +1 -60
- package/dist/guards/jwt.guard.js +1 -17
- 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.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.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 -155
- package/dist/notifications/index.js +1 -18
- package/dist/notifications/notification.module.js +1 -32
- package/dist/notifications/services/email.service.d.ts +3 -14
- package/dist/notifications/services/email.service.js +1 -69
- package/dist/notifications/services/index.js +1 -23
- package/dist/notifications/services/kakao.service.js +1 -94
- package/dist/notifications/services/message-template.service.js +1 -74
- package/dist/notifications/services/notification-send.service.d.ts +1 -12
- package/dist/notifications/services/notification-send.service.js +1 -146
- package/dist/notifications/services/notification.service.js +1 -125
- package/dist/notifications/services/slack.service.d.ts +1 -6
- package/dist/notifications/services/slack.service.js +1 -53
- package/dist/notifications/services/sms.service.js +1 -62
- package/dist/passport/google.strategy.js +1 -43
- package/dist/passport/index.js +1 -20
- package/dist/passport/jwt.strategy.js +1 -55
- package/dist/passport/kakao.strategy.js +1 -43
- 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.js +1 -144
- 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/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 +2 -1
|
@@ -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,o,n){var r,i=arguments.length,p=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)p=Reflect.decorate(e,t,o,n);else for(var d=e.length-1;d>=0;d--)(r=e[d])&&(p=(i<3?r(p):i>3?r(t,o,p):r(t,o))||p);return i>3&&p&&Object.defineProperty(t,o,p),p},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 o=require("typeorm"),n=require("../../enums.common");let r=class LogsAudit{};exports.LogsAudit=r,e([(0,o.PrimaryGeneratedColumn)(),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}),t("design:type",String)],r.prototype,"entity",void 0),e([(0,o.Column)("int"),t("design:type",Number)],r.prototype,"entity_id",void 0),e([(0,o.Column)("enum",{enum:n.AUDIT_ACTION}),t("design:type",String)],r.prototype,"action",void 0),e([(0,o.Column)("int"),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)("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.LogsAudit=r=e([(0,o.Entity)("logs_audit")],r);
|
|
@@ -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)(),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)("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)("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);
|
|
@@ -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 t=this&&this.__decorate||function(t,e,i,o){var n,a=arguments.length,r=a<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,o);else for(var p=t.length-1;p>=0;p--)(n=t[p])&&(r=(a<3?n(r):a>3?n(e,i,r):n(e,i))||r);return a>3&&r&&Object.defineProperty(e,i,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.NotificationRecipient=void 0;const i=require("typeorm"),o=require("../../enums.common"),n=require("./notification.entity");class Relations{}t([(0,i.ManyToOne)(()=>n.Notification,t=>t.recipients),(0,i.JoinColumn)({name:"notification_id"}),e("design:type",n.Notification)],Relations.prototype,"notification",void 0);let a=class NotificationRecipient extends Relations{};exports.NotificationRecipient=a,t([(0,i.PrimaryGeneratedColumn)(),e("design:type",Number)],a.prototype,"id",void 0),t([(0,i.Column)("int"),e("design:type",Number)],a.prototype,"notification_id",void 0),t([(0,i.Column)("int"),e("design:type",Number)],a.prototype,"user_id",void 0),t([(0,i.Column)("varchar",{length:100,nullable:!0}),e("design:type",String)],a.prototype,"recipient",void 0),t([(0,i.Column)("jsonb",{nullable:!0}),e("design:type",Object)],a.prototype,"variables",void 0),t([(0,i.Column)("enum",{enum:o.NOTIFICATION_STATUS}),e("design:type",String)],a.prototype,"status",void 0),t([(0,i.Column)("timestamptz",{nullable:!0}),e("design:type",Date)],a.prototype,"sent_at",void 0),t([(0,i.Column)("timestamptz",{nullable:!0}),e("design:type",Date)],a.prototype,"read_at",void 0),t([(0,i.Column)("timestamptz",{nullable:!0}),e("design:type",Date)],a.prototype,"failed_at",void 0),t([(0,i.Column)("varchar",{length:255,nullable:!0}),e("design:type",String)],a.prototype,"reason_failed",void 0),t([(0,i.CreateDateColumn)({type:"timestamptz"}),e("design:type",Date)],a.prototype,"created_at",void 0),exports.NotificationRecipient=a=t([(0,i.Entity)("notification_recipients"),(0,i.Index)(["notification_id","status"]),(0,i.Index)(["user_id"])],a);
|
|
@@ -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,r=arguments.length,a=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,o,i);else for(var p=t.length-1;p>=0;p--)(n=t[p])&&(a=(r<3?n(a):r>3?n(e,o,a):n(e,o))||a);return r>3&&a&&Object.defineProperty(e,o,a),a},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 r=class Notification extends Relations{};exports.Notification=r,t([(0,o.PrimaryGeneratedColumn)(),e("design:type",Number)],r.prototype,"id",void 0),t([(0,o.Column)("varchar",{length:25}),e("design:type",String)],r.prototype,"type",void 0),t([(0,o.Column)("varchar",{length:25}),e("design:type",String)],r.prototype,"template_key",void 0),t([(0,o.Column)("enum",{enum:i.NOTIFICATION_STATUS}),e("design:type",String)],r.prototype,"status",void 0),t([(0,o.Column)("varchar",{length:25,nullable:!0}),e("design:type",String)],r.prototype,"sender",void 0),t([(0,o.Column)("varchar",{length:100,nullable:!0}),e("design:type",String)],r.prototype,"title",void 0),t([(0,o.Column)("text",{nullable:!0}),e("design:type",String)],r.prototype,"content",void 0),t([(0,o.CreateDateColumn)({type:"timestamptz"}),e("design:type",Date)],r.prototype,"created_at",void 0),t([(0,o.UpdateDateColumn)({type:"timestamptz"}),e("design:type",Date)],r.prototype,"updated_at",void 0),t([(0,o.DeleteDateColumn)({type:"timestamptz"}),e("design:type",Date)],r.prototype,"deleted_at",void 0),exports.Notification=r=t([(0,o.Entity)("notifications"),(0,o.Index)(["id"],{where:"deleted_at IS NULL"}),(0,o.Index)(["status"])],r);
|
|
@@ -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,l=arguments.length,i=l<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 a=e.length-1;a>=0;a--)(r=e[a])&&(i=(l<3?r(i):l>3?r(t,o,i):r(t,o))||i);return l>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)(),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)(["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}});
|
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 a=Object.getOwnPropertyDescriptor(r,t);a&&!("get"in a?!r.__esModule:a.writable||a.configurable)||(a={enumerable:!0,get:function(){return r[t]}}),Object.defineProperty(e,o,a)}: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("./user.decorator"),exports),r(require("./auth.decorator.factory"),exports),r(require("./cookies.decorator"),exports),r(require("./timestamps.decorator"),exports),r(require("./soft-delete.decorator"),exports);
|
|
@@ -1,38 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PatchBody = PatchBody;
|
|
4
|
-
const common_1 = require("@nestjs/common");
|
|
5
|
-
const class_transformer_1 = require("class-transformer");
|
|
6
|
-
const class_validator_1 = require("class-validator");
|
|
7
|
-
function PatchBody(dtoClass) {
|
|
8
|
-
return (target, key, index) => {
|
|
9
|
-
(0, common_1.Body)()(target, key, index);
|
|
10
|
-
const originalMethod = (0, common_1.createParamDecorator)((data, ctx) => {
|
|
11
|
-
const request = ctx.switchToHttp().getRequest();
|
|
12
|
-
const body = request.body;
|
|
13
|
-
const allowedKeys = dtoClass.keys;
|
|
14
|
-
if (!allowedKeys) {
|
|
15
|
-
throw new common_1.InternalServerErrorException('keys is not defined');
|
|
16
|
-
}
|
|
17
|
-
const bodyKeys = Object.keys(body);
|
|
18
|
-
const invalidKeys = bodyKeys.filter((key) => !allowedKeys.includes(key));
|
|
19
|
-
if (invalidKeys.length > 0) {
|
|
20
|
-
throw new common_1.BadRequestException(`Invalid keys: ${invalidKeys.join(', ')}`);
|
|
21
|
-
}
|
|
22
|
-
if (bodyKeys.length === 0) {
|
|
23
|
-
throw new common_1.BadRequestException('At least one field is required');
|
|
24
|
-
}
|
|
25
|
-
const dtoInstance = (0, class_transformer_1.plainToClass)(dtoClass, body, {
|
|
26
|
-
enableImplicitConversion: true,
|
|
27
|
-
});
|
|
28
|
-
const errors = (0, class_validator_1.validateSync)(dtoInstance, {
|
|
29
|
-
skipMissingProperties: true,
|
|
30
|
-
});
|
|
31
|
-
if (errors.length > 0) {
|
|
32
|
-
throw new common_1.BadRequestException(errors);
|
|
33
|
-
}
|
|
34
|
-
return dtoInstance;
|
|
35
|
-
});
|
|
36
|
-
originalMethod()(target, key, index);
|
|
37
|
-
};
|
|
38
|
-
}
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.PatchBody=function PatchBody(r){return(o,s,i)=>{(0,e.Body)()(o,s,i);const a=(0,e.createParamDecorator)((o,s)=>{const i=s.switchToHttp().getRequest().body,a=r.keys;if(!a)throw new e.InternalServerErrorException("keys is not defined");const c=Object.keys(i),l=c.filter(e=>!a.includes(e));if(l.length>0)throw new e.BadRequestException(`Invalid keys: ${l.join(", ")}`);if(0===c.length)throw new e.BadRequestException("At least one field is required");const d=(0,t.plainToClass)(r,i,{enableImplicitConversion:!0}),u=(0,n.validateSync)(d,{skipMissingProperties:!0});if(u.length>0)throw new e.BadRequestException(u);return d});a()(o,s,i)}};const e=require("@nestjs/common"),t=require("class-transformer"),n=require("class-validator");
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SoftDelete = SoftDelete;
|
|
4
|
-
const typeorm_1 = require("typeorm");
|
|
5
|
-
function SoftDelete() {
|
|
6
|
-
return function (constructor) {
|
|
7
|
-
const entity_name = constructor.name.toLowerCase();
|
|
8
|
-
(0, typeorm_1.DeleteDateColumn)({ type: 'timestamptz', nullable: true })(constructor.prototype, 'deleted_at');
|
|
9
|
-
};
|
|
10
|
-
}
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.SoftDelete=function SoftDelete(){return function(t){t.name.toLowerCase();(0,e.DeleteDateColumn)({type:"timestamptz",nullable:!0})(t.prototype,"deleted_at")}};const e=require("typeorm");
|
|
@@ -1,23 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Timestamps = Timestamps;
|
|
4
|
-
const typeorm_1 = require("typeorm");
|
|
5
|
-
function Timestamps(options = {
|
|
6
|
-
created_at: true,
|
|
7
|
-
updated_at: true,
|
|
8
|
-
}) {
|
|
9
|
-
return function (constructor) {
|
|
10
|
-
if (options.created_at !== false) {
|
|
11
|
-
(0, typeorm_1.CreateDateColumn)({
|
|
12
|
-
type: 'timestamptz',
|
|
13
|
-
default: () => 'CURRENT_TIMESTAMP()',
|
|
14
|
-
})(constructor.prototype, 'created_at');
|
|
15
|
-
}
|
|
16
|
-
if (options.updated_at !== false) {
|
|
17
|
-
(0, typeorm_1.UpdateDateColumn)({
|
|
18
|
-
type: 'timestamptz',
|
|
19
|
-
default: () => 'CURRENT_TIMESTAMP()',
|
|
20
|
-
})(constructor.prototype, 'updated_at');
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
}
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.Timestamps=function Timestamps(e={created_at:!0,updated_at:!0}){return function(a){!1!==e.created_at&&(0,t.CreateDateColumn)({type:"timestamptz",default:()=>"CURRENT_TIMESTAMP()"})(a.prototype,"created_at"),!1!==e.updated_at&&(0,t.UpdateDateColumn)({type:"timestamptz",default:()=>"CURRENT_TIMESTAMP()"})(a.prototype,"updated_at")}};const t=require("typeorm");
|
|
@@ -1,8 +1 @@
|
|
|
1
|
-
"
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.User = void 0;
|
|
4
|
-
const common_1 = require("@nestjs/common");
|
|
5
|
-
exports.User = (0, common_1.createParamDecorator)((data, ctx) => {
|
|
6
|
-
const request = ctx.switchToHttp().getRequest();
|
|
7
|
-
return request.user;
|
|
8
|
-
});
|
|
1
|
+
Object.defineProperty(exports,"__esModule",{value:!0}),exports.User=void 0;const e=require("@nestjs/common");exports.User=(0,e.createParamDecorator)((e,r)=>r.switchToHttp().getRequest().user);
|
|
@@ -1,26 +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.AuthUserLocalDto = void 0;
|
|
13
|
-
const class_validator_1 = require("class-validator");
|
|
14
|
-
class AuthUserLocalDto {
|
|
15
|
-
}
|
|
16
|
-
exports.AuthUserLocalDto = AuthUserLocalDto;
|
|
17
|
-
__decorate([
|
|
18
|
-
(0, class_validator_1.IsString)(),
|
|
19
|
-
(0, class_validator_1.IsNotEmpty)(),
|
|
20
|
-
__metadata("design:type", String)
|
|
21
|
-
], AuthUserLocalDto.prototype, "userid", void 0);
|
|
22
|
-
__decorate([
|
|
23
|
-
(0, class_validator_1.IsString)(),
|
|
24
|
-
(0, class_validator_1.IsNotEmpty)(),
|
|
25
|
-
__metadata("design:type", String)
|
|
26
|
-
], AuthUserLocalDto.prototype, "password", void 0);
|
|
1
|
+
var t=this&&this.__decorate||function(t,e,o,r){var s,c=arguments.length,a=c<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,o,r);else for(var i=t.length-1;i>=0;i--)(s=t[i])&&(a=(c<3?s(a):c>3?s(e,o,a):s(e,o))||a);return c>3&&a&&Object.defineProperty(e,o,a),a},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.AuthUserLocalDto=void 0;const o=require("class-validator");class AuthUserLocalDto{}exports.AuthUserLocalDto=AuthUserLocalDto,t([(0,o.IsString)(),(0,o.IsNotEmpty)(),e("design:type",String)],AuthUserLocalDto.prototype,"userid",void 0),t([(0,o.IsString)(),(0,o.IsNotEmpty)(),e("design:type",String)],AuthUserLocalDto.prototype,"password",void 0);
|