@comasoft/nestjs 0.1.64 → 0.1.65

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.
@@ -1 +1 @@
1
- var e=this&&this.__decorate||function(e,t,o,r){var n,p=arguments.length,a=p<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 i=e.length-1;i>=0;i--)(n=e[i])&&(a=(p<3?n(a):p>3?n(t,o,a):n(t,o))||a);return p>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.Category=void 0;const o=require("typeorm");let r=class Category{};exports.Category=r,e([(0,o.PrimaryGeneratedColumn)(),t("design:type",Number)],r.prototype,"id",void 0),e([(0,o.Column)("varchar",{length:25}),t("design:type",String)],r.prototype,"type",void 0),e([(0,o.Column)("varchar",{length:100}),t("design:type",String)],r.prototype,"name",void 0),e([(0,o.Column)("varchar",{length:255,nullable:!0}),t("design:type",String)],r.prototype,"description",void 0),e([(0,o.Column)("varchar",{length:100,nullable:!0}),t("design:type",String)],r.prototype,"slug",void 0),e([(0,o.Column)("int",{nullable:!0}),t("design:type",Number)],r.prototype,"parent_id",void 0),e([(0,o.Column)("smallint",{default:1}),t("design:type",Number)],r.prototype,"depth",void 0),e([(0,o.Column)("int",{default:0}),t("design:type",Number)],r.prototype,"sort",void 0),e([(0,o.Column)("boolean",{default:!0}),t("design:type",Boolean)],r.prototype,"is_active",void 0),e([(0,o.CreateDateColumn)({type:"timestamptz"}),t("design:type",Date)],r.prototype,"created_at",void 0),e([(0,o.UpdateDateColumn)({type:"timestamptz"}),t("design:type",Date)],r.prototype,"updated_at",void 0),e([(0,o.DeleteDateColumn)({type:"timestamptz"}),t("design:type",Date)],r.prototype,"deleted_at",void 0),exports.Category=r=e([(0,o.Entity)("categories"),(0,o.Index)(["id"],{where:"deleted_at IS NULL"}),(0,o.Index)(["type","name"]),(0,o.Index)(["type","parent_id"])],r);
1
+ var e=this&&this.__decorate||function(e,t,o,r){var a,n=arguments.length,i=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,o,r);else for(var p=e.length-1;p>=0;p--)(a=e[p])&&(i=(n<3?a(i):n>3?a(t,o,i):a(t,o))||i);return n>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.Category=void 0;const o=require("typeorm");let r=class Category{};exports.Category=r,e([(0,o.PrimaryGeneratedColumn)({name:"id",primaryKeyConstraintName:"PK_categories"}),t("design:type",Number)],r.prototype,"id",void 0),e([(0,o.Column)("varchar",{length:25}),t("design:type",String)],r.prototype,"type",void 0),e([(0,o.Column)("varchar",{length:100}),t("design:type",String)],r.prototype,"name",void 0),e([(0,o.Column)("varchar",{length:255,nullable:!0}),t("design:type",String)],r.prototype,"description",void 0),e([(0,o.Column)("varchar",{length:100,nullable:!0}),t("design:type",String)],r.prototype,"slug",void 0),e([(0,o.Column)("int",{nullable:!0}),t("design:type",Number)],r.prototype,"parent_id",void 0),e([(0,o.Column)("smallint",{default:1}),t("design:type",Number)],r.prototype,"depth",void 0),e([(0,o.Column)("int",{default:0}),t("design:type",Number)],r.prototype,"sort",void 0),e([(0,o.Column)("boolean",{default:!0}),t("design:type",Boolean)],r.prototype,"is_active",void 0),e([(0,o.CreateDateColumn)({type:"timestamptz"}),t("design:type",Date)],r.prototype,"created_at",void 0),e([(0,o.UpdateDateColumn)({type:"timestamptz"}),t("design:type",Date)],r.prototype,"updated_at",void 0),e([(0,o.DeleteDateColumn)({type:"timestamptz"}),t("design:type",Date)],r.prototype,"deleted_at",void 0),exports.Category=r=e([(0,o.Entity)("categories"),(0,o.Index)("IDX_categories",["id"],{where:"deleted_at IS NULL"}),(0,o.Index)("IDX_categories_type_name",["type","name"]),(0,o.Index)("IDX_categories_type_parent_id",["type","parent_id"])],r);
@@ -1 +1 @@
1
- var e=this&&this.__decorate||function(e,t,o,n){var i,p=arguments.length,r=p<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,o,n);else for(var d=e.length-1;d>=0;d--)(i=e[d])&&(r=(p<3?i(r):p>3?i(t,o,r):i(t,o))||r);return p>3&&r&&Object.defineProperty(t,o,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.Comment=void 0;const o=require("typeorm");let n=class Comment{};exports.Comment=n,e([(0,o.PrimaryGeneratedColumn)(),t("design:type",Number)],n.prototype,"id",void 0),e([(0,o.Column)("varchar",{length:25}),t("design:type",String)],n.prototype,"target",void 0),e([(0,o.Column)("int"),t("design:type",Number)],n.prototype,"target_id",void 0),e([(0,o.Column)("int",{nullable:!0}),t("design:type",Number)],n.prototype,"parent_id",void 0),e([(0,o.Column)("int"),t("design:type",Number)],n.prototype,"group_id",void 0),e([(0,o.Column)("int",{default:0}),t("design:type",Number)],n.prototype,"depth",void 0),e([(0,o.Column)("int",{default:0}),t("design:type",Number)],n.prototype,"sort",void 0),e([(0,o.Column)("int",{nullable:!0}),t("design:type",Number)],n.prototype,"user_id",void 0),e([(0,o.Column)("text"),t("design:type",String)],n.prototype,"content",void 0),e([(0,o.Column)("smallint",{default:0}),t("design:type",Number)],n.prototype,"cnt_likes",void 0),e([(0,o.Column)("smallint",{default:0}),t("design:type",Number)],n.prototype,"cnt_replies",void 0),e([(0,o.Column)("jsonb",{nullable:!0}),t("design:type",Object)],n.prototype,"meta",void 0),e([(0,o.Column)("timestamptz",{nullable:!0}),t("design:type",Date)],n.prototype,"modified_at",void 0),e([(0,o.CreateDateColumn)({type:"timestamptz"}),t("design:type",Date)],n.prototype,"created_at",void 0),e([(0,o.UpdateDateColumn)({type:"timestamptz"}),t("design:type",Date)],n.prototype,"updated_at",void 0),e([(0,o.DeleteDateColumn)({type:"timestamptz"}),t("design:type",Date)],n.prototype,"deleted_at",void 0),exports.Comment=n=e([(0,o.Entity)("comments"),(0,o.Index)(["target","target_id"]),(0,o.Index)(["user_id"])],n);
1
+ var e=this&&this.__decorate||function(e,t,o,n){var i,r=arguments.length,p=r<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--)(i=e[d])&&(p=(r<3?i(p):r>3?i(t,o,p):i(t,o))||p);return r>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.Comment=void 0;const o=require("typeorm");let n=class Comment{};exports.Comment=n,e([(0,o.PrimaryGeneratedColumn)({name:"id",primaryKeyConstraintName:"PK_comments"}),t("design:type",Number)],n.prototype,"id",void 0),e([(0,o.Column)("varchar",{length:25}),t("design:type",String)],n.prototype,"target",void 0),e([(0,o.Column)("int"),t("design:type",Number)],n.prototype,"target_id",void 0),e([(0,o.Column)("int",{nullable:!0}),t("design:type",Number)],n.prototype,"parent_id",void 0),e([(0,o.Column)("int"),t("design:type",Number)],n.prototype,"group_id",void 0),e([(0,o.Column)("int",{default:0}),t("design:type",Number)],n.prototype,"depth",void 0),e([(0,o.Column)("int",{default:0}),t("design:type",Number)],n.prototype,"sort",void 0),e([(0,o.Column)("int",{nullable:!0}),t("design:type",Number)],n.prototype,"user_id",void 0),e([(0,o.Column)("text"),t("design:type",String)],n.prototype,"content",void 0),e([(0,o.Column)("smallint",{default:0}),t("design:type",Number)],n.prototype,"cnt_likes",void 0),e([(0,o.Column)("smallint",{default:0}),t("design:type",Number)],n.prototype,"cnt_replies",void 0),e([(0,o.Column)("jsonb",{nullable:!0}),t("design:type",Object)],n.prototype,"meta",void 0),e([(0,o.Column)("timestamptz",{nullable:!0}),t("design:type",Date)],n.prototype,"modified_at",void 0),e([(0,o.CreateDateColumn)({type:"timestamptz"}),t("design:type",Date)],n.prototype,"created_at",void 0),e([(0,o.UpdateDateColumn)({type:"timestamptz"}),t("design:type",Date)],n.prototype,"updated_at",void 0),e([(0,o.DeleteDateColumn)({type:"timestamptz"}),t("design:type",Date)],n.prototype,"deleted_at",void 0),exports.Comment=n=e([(0,o.Entity)("comments"),(0,o.Index)("IDX_comments_target_target_id",["target","target_id"]),(0,o.Index)("IDX_comments_user_id",["user_id"])],n);
@@ -1 +1 @@
1
- var e=this&&this.__decorate||function(e,t,o,n){var r,i=arguments.length,a=i<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,n);else for(var p=e.length-1;p>=0;p--)(r=e[p])&&(a=(i<3?r(a):i>3?r(t,o,a):r(t,o))||a);return i>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.Config=void 0;const o=require("typeorm");let n=class Config{};exports.Config=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,"key",void 0),e([(0,o.Column)("jsonb",{nullable:!0}),t("design:type",Object)],n.prototype,"value",void 0),e([(0,o.Column)("varchar",{length:255,nullable:!0}),t("design:type",String)],n.prototype,"description",void 0),e([(0,o.Column)("boolean",{default:!0}),t("design:type",Boolean)],n.prototype,"is_active",void 0),e([(0,o.UpdateDateColumn)(),t("design:type",Date)],n.prototype,"updated_at",void 0),exports.Config=n=e([(0,o.Entity)("configs"),(0,o.Index)(["key"])],n);
1
+ var e=this&&this.__decorate||function(e,t,o,n){var i,r=arguments.length,a=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,o):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,n);else for(var p=e.length-1;p>=0;p--)(i=e[p])&&(a=(r<3?i(a):r>3?i(t,o,a):i(t,o))||a);return r>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.Config=void 0;const o=require("typeorm");let n=class Config{};exports.Config=n,e([(0,o.PrimaryGeneratedColumn)({name:"id",primaryKeyConstraintName:"PK_configs"}),t("design:type",Number)],n.prototype,"id",void 0),e([(0,o.Column)("varchar",{length:100}),t("design:type",String)],n.prototype,"key",void 0),e([(0,o.Column)("jsonb",{nullable:!0}),t("design:type",Object)],n.prototype,"value",void 0),e([(0,o.Column)("varchar",{length:255,nullable:!0}),t("design:type",String)],n.prototype,"description",void 0),e([(0,o.Column)("boolean",{default:!0}),t("design:type",Boolean)],n.prototype,"is_active",void 0),e([(0,o.UpdateDateColumn)(),t("design:type",Date)],n.prototype,"updated_at",void 0),exports.Config=n=e([(0,o.Entity)("configs"),(0,o.Index)("IDX_configs_key",["key"])],n);
@@ -1 +1 @@
1
- var e=this&&this.__decorate||function(e,t,o,n){var i,r=arguments.length,p=r<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 a=e.length-1;a>=0;a--)(i=e[a])&&(p=(r<3?i(p):r>3?i(t,o,p):i(t,o))||p);return r>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.File=void 0;const o=require("typeorm"),n=require("../../enums.common");let i=class File{};exports.File=i,e([(0,o.PrimaryGeneratedColumn)(),t("design:type",Number)],i.prototype,"id",void 0),e([(0,o.Column)("enum",{enum:n.FILE_STATUS}),t("design:type",String)],i.prototype,"status",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)("varchar",{length:255}),t("design:type",String)],i.prototype,"original_name",void 0),e([(0,o.Column)("varchar",{length:255,comment:"UUID 기반 파일명"}),t("design:type",String)],i.prototype,"file_name",void 0),e([(0,o.Column)("varchar",{length:255,comment:"[target]/YYMMDD/[file_name]"}),t("design:type",String)],i.prototype,"path",void 0),e([(0,o.Column)("varchar",{length:100}),t("design:type",String)],i.prototype,"mime_type",void 0),e([(0,o.Column)("int"),t("design:type",Number)],i.prototype,"size",void 0),e([(0,o.Column)("jsonb",{nullable:!0}),t("design:type",Object)],i.prototype,"meta",void 0),e([(0,o.Column)("smallint",{default:0,comment:"0: cover, 1: details ..."}),t("design:type",Number)],i.prototype,"group_number",void 0),e([(0,o.Column)("int",{default:0}),t("design:type",Number)],i.prototype,"sort",void 0),e([(0,o.Column)("boolean",{default:!0}),t("design:type",Boolean)],i.prototype,"is_active",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),e([(0,o.DeleteDateColumn)({type:"timestamptz"}),t("design:type",Date)],i.prototype,"deleted_at",void 0),exports.File=i=e([(0,o.Entity)("files"),(0,o.Index)(["id"],{where:"deleted_at IS NULL"}),(0,o.Index)(["target","target_id"]),(0,o.Index)(["user_id"])],i);
1
+ var e=this&&this.__decorate||function(e,t,o,i){var n,r=arguments.length,p=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,o):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)p=Reflect.decorate(e,t,o,i);else for(var a=e.length-1;a>=0;a--)(n=e[a])&&(p=(r<3?n(p):r>3?n(t,o,p):n(t,o))||p);return r>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.File=void 0;const o=require("typeorm"),i=require("../../enums.common");let n=class File{};exports.File=n,e([(0,o.PrimaryGeneratedColumn)({name:"id",primaryKeyConstraintName:"PK_files"}),t("design:type",Number)],n.prototype,"id",void 0),e([(0,o.Column)("enum",{enum:i.FILE_STATUS}),t("design:type",String)],n.prototype,"status",void 0),e([(0,o.Column)("varchar",{length:25}),t("design:type",String)],n.prototype,"target",void 0),e([(0,o.Column)("int"),t("design:type",Number)],n.prototype,"target_id",void 0),e([(0,o.Column)("int",{nullable:!0}),t("design:type",Number)],n.prototype,"user_id",void 0),e([(0,o.Column)("varchar",{length:255}),t("design:type",String)],n.prototype,"original_name",void 0),e([(0,o.Column)("varchar",{length:255,comment:"UUID 기반 파일명"}),t("design:type",String)],n.prototype,"file_name",void 0),e([(0,o.Column)("varchar",{length:255,comment:"[target]/YYMMDD/[file_name]"}),t("design:type",String)],n.prototype,"path",void 0),e([(0,o.Column)("varchar",{length:100}),t("design:type",String)],n.prototype,"mime_type",void 0),e([(0,o.Column)("int"),t("design:type",Number)],n.prototype,"size",void 0),e([(0,o.Column)("jsonb",{nullable:!0}),t("design:type",Object)],n.prototype,"meta",void 0),e([(0,o.Column)("smallint",{default:0,comment:"0: cover, 1: details ..."}),t("design:type",Number)],n.prototype,"group_number",void 0),e([(0,o.Column)("int",{default:0}),t("design:type",Number)],n.prototype,"sort",void 0),e([(0,o.Column)("boolean",{default:!0}),t("design:type",Boolean)],n.prototype,"is_active",void 0),e([(0,o.CreateDateColumn)({type:"timestamptz"}),t("design:type",Date)],n.prototype,"created_at",void 0),e([(0,o.UpdateDateColumn)({type:"timestamptz"}),t("design:type",Date)],n.prototype,"updated_at",void 0),e([(0,o.DeleteDateColumn)({type:"timestamptz"}),t("design:type",Date)],n.prototype,"deleted_at",void 0),exports.File=n=e([(0,o.Entity)("files"),(0,o.Index)("IDX_files",["id"],{where:"deleted_at IS NULL"}),(0,o.Index)("IDX_files_target_target_id",["target","target_id"]),(0,o.Index)("IDX_files_user_id",["user_id"])],n);
@@ -1 +1 @@
1
- var e=this&&this.__decorate||function(e,t,o,r){var i,n=arguments.length,p=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)p=Reflect.decorate(e,t,o,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(p=(n<3?i(p):n>3?i(t,o,p):i(t,o))||p);return n>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.Like=void 0;const o=require("typeorm"),r=require("../../enums.common");let i=class Like{};exports.Like=i,e([(0,o.PrimaryGeneratedColumn)(),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)(["target","target_id","user_id"])],i);
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);
@@ -1 +1 @@
1
- var e=this&&this.__decorate||function(e,t,o,n){var i,r=arguments.length,l=r<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 d=e.length-1;d>=0;d--)(i=e[d])&&(l=(r<3?i(l):r>3?i(t,o,l):i(t,o))||l);return r>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.LogsAudit=void 0;const o=require("typeorm"),n=require("../../enums.common");let i=class LogsAudit{};exports.LogsAudit=i,e([(0,o.PrimaryGeneratedColumn)(),t("design:type",Number)],i.prototype,"id",void 0),e([(0,o.Column)("char",{length:21}),t("design:type",String)],i.prototype,"uid",void 0),e([(0,o.Column)("varchar",{length:255}),t("design:type",String)],i.prototype,"name",void 0),e([(0,o.Column)("varchar",{length:50,nullable:!0}),t("design:type",String)],i.prototype,"entity",void 0),e([(0,o.Column)("int",{nullable:!0,comment:"-1: all, 0: none"}),t("design:type",Number)],i.prototype,"entity_id",void 0),e([(0,o.Column)("jsonb",{nullable:!0}),t("design:type",Array)],i.prototype,"entity_ids",void 0),e([(0,o.Column)("enum",{enum:n.AUDIT_ACTION,nullable:!0}),t("design:type",String)],i.prototype,"action",void 0),e([(0,o.Column)("int",{nullable:!0}),t("design:type",Number)],i.prototype,"user_id",void 0),e([(0,o.Column)("int",{nullable:!0}),t("design:type",Number)],i.prototype,"target_user_id",void 0),e([(0,o.Column)("jsonb",{nullable:!0}),t("design:type",Object)],i.prototype,"changes",void 0),e([(0,o.Column)("varchar",{length:45,nullable:!0}),t("design:type",String)],i.prototype,"ip_address",void 0),e([(0,o.Column)("varchar",{length:255,nullable:!0}),t("design:type",String)],i.prototype,"user_agent",void 0),e([(0,o.Column)("varchar",{length:255,nullable:!0}),t("design:type",String)],i.prototype,"description",void 0),e([(0,o.Column)("jsonb",{nullable:!0}),t("design:type",Object)],i.prototype,"meta",void 0),e([(0,o.Column)("timestamptz"),t("design:type",Date)],i.prototype,"occurred_at",void 0),e([(0,o.CreateDateColumn)({type:"timestamptz"}),t("design:type",Date)],i.prototype,"created_at",void 0),exports.LogsAudit=i=e([(0,o.Entity)("logs_audit"),(0,o.Index)(["uid"]),(0,o.Index)(["name","entity_id"]),(0,o.Index)(["user_id","name","entity_id"])],i);
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);
@@ -1 +1 @@
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)("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);
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);
@@ -11,6 +11,7 @@ export declare class NotificationRecipient extends Relations {
11
11
  recipient: string;
12
12
  title: string;
13
13
  content: string;
14
+ meta: Record<string, any>;
14
15
  variables: Record<string, any>;
15
16
  status: NOTIFICATION_STATUS;
16
17
  sent_at: Date;
@@ -1 +1 @@
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)("varchar",{length:25,nullable:!0}),e("design:type",String)],a.prototype,"type",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)("varchar",{length:255,nullable:!0}),e("design:type",String)],a.prototype,"title",void 0),t([(0,i.Column)("text",{nullable:!0}),e("design:type",String)],a.prototype,"content",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"]),(0,i.Index)(["type"])],a);
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);
@@ -12,6 +12,7 @@ export declare class Notification extends Relations {
12
12
  sender: string;
13
13
  title: string;
14
14
  content: string;
15
+ meta: Record<string, any>;
15
16
  scheduled_at: Date;
16
17
  sent_at: Date;
17
18
  created_at: Date;
@@ -1 +1 @@
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)(),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)("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)(["id"],{where:"deleted_at IS NULL"}),(0,o.Index)(["status"])],a);
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 +1 @@
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
+ 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 +1 @@
1
- var e=this&&this.__decorate||function(e,t,i,a){var n,c=arguments.length,s=c<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(s=(c<3?n(s):c>3?n(t,i,s):n(t,i))||s);return c>3&&s&&Object.defineProperty(t,i,s),s},t=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},i=this&&this.__awaiter||function(e,t,i,a){return new(i||(i=Promise))(function(n,c){function fulfilled(e){try{step(a.next(e))}catch(e){c(e)}}function rejected(e){try{step(a.throw(e))}catch(e){c(e)}}function step(e){e.done?n(e.value):function adopt(e){return e instanceof i?e:new i(function(t){t(e)})}(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.EventNotificationService=void 0;const a=require("@nestjs/common"),n=require("../../notifications");let c=class EventNotificationService{constructor(e,t){this.notificationService=e,this.notificationSendService=t}send(e){return i(this,void 0,void 0,function*(){if(null==e?void 0:e.web){const t=yield this.notificationSendService.send({type:"web",recipients:e.web.recipients,template_key:e.web.template_key,variables:e.web.variables});console.log("📧 [EVENT-NOTIFICATION] Web 발송 결과:",t)}if(null==e?void 0:e.email){yield this.notificationService.create({type:"email",template_key:e.email.template_key,recipients:e.email.recipients,variables:e.email.variables});const t=yield this.notificationSendService.send({type:"email",recipients:e.email.recipients,subject:e.email.subject,body:e.email.body,template_key:e.email.template_key,variables:e.email.variables});console.log("📧 [EVENT-NOTIFICATION] Email 발송 결과:",t)}if(null==e?void 0:e.kakao){yield this.notificationService.create({type:"kakao",template_key:e.kakao.template_key,recipients:e.kakao.recipients,variables:e.kakao.variables});const t=yield this.notificationSendService.send({type:"kakao",recipients:e.kakao.recipients,template_key:e.kakao.template_key,variables:e.kakao.variables});console.log("📱 [EVENT-NOTIFICATION] Kakao 발송 결과:",t)}if(null==e?void 0:e.sms){yield this.notificationService.create({type:"sms",template_key:e.sms.template_key,recipients:e.sms.recipients,variables:e.sms.variables});const t=yield this.notificationSendService.send({type:"sms",recipients:e.sms.recipients,content:e.sms.content,template_key:e.sms.template_key,variables:e.sms.variables});console.log("📱 [EVENT-NOTIFICATION] SMS 발송 결과:",t)}if(null==e?void 0:e.slack){yield this.notificationService.create({type:"slack",template_key:e.slack.template_key,recipients:[{user_id:0,recipient:e.slack.channel}],variables:e.slack.variables});const t=yield this.notificationSendService.send({type:"slack",channel:e.slack.channel,content:e.slack.content,template_key:e.slack.template_key,variables:e.slack.variables});console.log("📢 [EVENT-NOTIFICATION] Slack 발송 결과:",t)}})}};exports.EventNotificationService=c,exports.EventNotificationService=c=e([(0,a.Injectable)(),t("design:paramtypes",[n.NotificationService,n.NotificationSendService])],c);
1
+ var e=this&&this.__decorate||function(e,t,i,a){var n,c=arguments.length,s=c<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var o=e.length-1;o>=0;o--)(n=e[o])&&(s=(c<3?n(s):c>3?n(t,i,s):n(t,i))||s);return c>3&&s&&Object.defineProperty(t,i,s),s},t=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},i=this&&this.__awaiter||function(e,t,i,a){return new(i||(i=Promise))(function(n,c){function fulfilled(e){try{step(a.next(e))}catch(e){c(e)}}function rejected(e){try{step(a.throw(e))}catch(e){c(e)}}function step(e){e.done?n(e.value):function adopt(e){return e instanceof i?e:new i(function(t){t(e)})}(e.value).then(fulfilled,rejected)}step((a=a.apply(e,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.EventNotificationService=void 0;const a=require("@nestjs/common"),n=require("../../notifications");let c=class EventNotificationService{constructor(e,t){this.notificationService=e,this.notificationSendService=t}send(e){return i(this,void 0,void 0,function*(){if(null==e?void 0:e.web){const t=yield this.notificationSendService.send({type:"web",recipients:e.web.recipients,template_key:e.web.template_key,variables:e.web.variables,meta:e.web.meta});console.log("📧 [EVENT-NOTIFICATION] Web 발송 결과:",t)}if(null==e?void 0:e.email){yield this.notificationService.create({type:"email",template_key:e.email.template_key,recipients:e.email.recipients,variables:e.email.variables});const t=yield this.notificationSendService.send({type:"email",recipients:e.email.recipients,subject:e.email.subject,body:e.email.body,template_key:e.email.template_key,variables:e.email.variables});console.log("📧 [EVENT-NOTIFICATION] Email 발송 결과:",t)}if(null==e?void 0:e.kakao){yield this.notificationService.create({type:"kakao",template_key:e.kakao.template_key,recipients:e.kakao.recipients,variables:e.kakao.variables});const t=yield this.notificationSendService.send({type:"kakao",recipients:e.kakao.recipients,template_key:e.kakao.template_key,variables:e.kakao.variables});console.log("📱 [EVENT-NOTIFICATION] Kakao 발송 결과:",t)}if(null==e?void 0:e.sms){yield this.notificationService.create({type:"sms",template_key:e.sms.template_key,recipients:e.sms.recipients,variables:e.sms.variables});const t=yield this.notificationSendService.send({type:"sms",recipients:e.sms.recipients,content:e.sms.content,template_key:e.sms.template_key,variables:e.sms.variables});console.log("📱 [EVENT-NOTIFICATION] SMS 발송 결과:",t)}if(null==e?void 0:e.slack){yield this.notificationService.create({type:"slack",template_key:e.slack.template_key,recipients:[{user_id:0,recipient:e.slack.channel}],variables:e.slack.variables});const t=yield this.notificationSendService.send({type:"slack",channel:e.slack.channel,content:e.slack.content,template_key:e.slack.template_key,variables:e.slack.variables});console.log("📢 [EVENT-NOTIFICATION] Slack 발송 결과:",t)}})}};exports.EventNotificationService=c,exports.EventNotificationService=c=e([(0,a.Injectable)(),t("design:paramtypes",[n.NotificationService,n.NotificationSendService])],c);
@@ -12,6 +12,7 @@ export interface NotificationOptions {
12
12
  content?: string;
13
13
  template_key?: string;
14
14
  variables?: Record<string, any>;
15
+ meta?: Record<string, any>;
15
16
  };
16
17
  email?: {
17
18
  recipients: NotificationRecipient[];
@@ -46,11 +47,13 @@ export type NotificationPayload = {
46
47
  title?: string;
47
48
  content?: string;
48
49
  variables?: Record<string, any>;
50
+ meta?: Record<string, any>;
49
51
  }>;
50
52
  title?: string;
51
53
  content?: string;
52
54
  template_key?: string;
53
55
  variables?: Record<string, any>;
56
+ meta?: Record<string, any>;
54
57
  } | {
55
58
  type: 'email';
56
59
  recipients: Array<{
@@ -1 +1 @@
1
- var e=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var c=e.length-1;c>=0;c--)(s=e[c])&&(a=(n<3?s(a):n>3?s(t,i,a):s(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},t=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},i=this&&this.__awaiter||function(e,t,i,r){return new(i||(i=Promise))(function(s,n){function fulfilled(e){try{step(r.next(e))}catch(e){n(e)}}function rejected(e){try{step(r.throw(e))}catch(e){n(e)}}function step(e){e.done?s(e.value):function adopt(e){return e instanceof i?e:new i(function(t){t(e)})}(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.NotificationSendService=void 0;const r=require("@nestjs/common"),s=require("typeorm"),n=require("./email.service"),a=require("./kakao.service"),c=require("./message-template.service"),o=require("./slack.service"),l=require("./sms.service"),d=require("./web.service");let p=class NotificationSendService{constructor(e,t,i,r,s,n,a){this.emailService=e,this.smsService=t,this.kakaoService=i,this.slackService=r,this.webNotificationService=s,this.messageTemplateService=n,this.dataSource=a}send(e){return i(this,void 0,void 0,function*(){switch(e.type){case"web":return this.sendWeb(e);case"email":return this.sendEmail(e);case"sms":return this.sendSms(e);case"kakao":return this.sendKakao(e);case"slack":return this.sendSlack(e)}})}sendWeb(e){return i(this,void 0,void 0,function*(){const t=[];for(const i of e.recipients){let r,s;if(e.template_key){const t=yield this.messageTemplateService.getTemplate("web",e.template_key);if(!t)throw new Error("Template not found");const n=Object.assign(Object.assign({},e.variables),i.variables);r=this.messageTemplateService.renderTemplate(t,n).title||e.title||"",s=this.messageTemplateService.renderTemplate(t,n).content}else{if(!e.title||!e.content)throw new Error("title, content is required");r=e.title,s=e.content}t.push({recipient:i.recipient,user_id:i.user_id,title:r,content:s,variables:i.variables})}return yield this.webNotificationService.send(Object.assign(Object.assign({},e),{recipients:t}))})}sendEmail(e){return i(this,void 0,void 0,function*(){const t=[];for(const i of e.recipients){let r,s;if(e.template_key){const t=yield this.messageTemplateService.getTemplate("email",e.template_key);if(!t)throw new Error("Template not found");const n=Object.assign(Object.assign({},e.variables),i.variables);r=this.messageTemplateService.renderTemplate(t,n).content,s=t.subject}else{if(!e.subject||!e.body)throw new Error("subject, body is required");r=e.body,s=e.subject}t.push({recipient:i.recipient,user_id:i.user_id,subject:s,text:r,variables:i.variables})}return yield this.emailService.send(t)})}sendSms(e){return i(this,void 0,void 0,function*(){const t=[];for(const i of e.recipients){let r;if(e.template_key){const t=yield this.messageTemplateService.getTemplate("sms",e.template_key);if(!t)throw new Error("Template not found");const s=Object.assign(Object.assign({},e.variables),i.variables);r=this.messageTemplateService.renderTemplate(t,s).content}else{if(!e.content)throw new Error("content is required");r=e.content}t.push({recipient:i.recipient,user_id:i.user_id,content:r,variables:i.variables})}return yield this.smsService.send(t)})}sendKakao(e){return i(this,void 0,void 0,function*(){const t=[];for(const i of e.recipients){let r;if(!e.template_key)throw new Error("template_key is required");const s=yield this.messageTemplateService.getTemplate("kakao",e.template_key);if(!s)throw new Error("Template not found");const n=Object.assign(Object.assign({},e.variables),i.variables);r=this.messageTemplateService.renderTemplate(s,n).content,t.push({recipient:i.recipient,user_id:i.user_id,sender_key:s.sender_key,template_code:s.template_code,message:r})}return yield this.kakaoService.send(t)})}sendSlack(e){return i(this,void 0,void 0,function*(){let t;if(e.template_key){const i=yield this.messageTemplateService.getTemplate("slack",e.template_key);if(!i)throw new Error("Template not found");t=this.messageTemplateService.renderTemplate(i,e.variables||{}).content}else{if(!e.content)throw new Error("content is required");t=e.content}return[yield this.slackService.send(e.channel,t)]})}};exports.NotificationSendService=p,exports.NotificationSendService=p=e([(0,r.Injectable)(),t("design:paramtypes",[n.EmailService,l.SmsService,a.KakaoService,o.SlackService,d.WebNotificationService,c.MessageTemplateService,s.DataSource])],p);
1
+ var e=this&&this.__decorate||function(e,t,i,r){var s,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var c=e.length-1;c>=0;c--)(s=e[c])&&(a=(n<3?s(a):n>3?s(t,i,a):s(t,i))||a);return n>3&&a&&Object.defineProperty(t,i,a),a},t=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},i=this&&this.__awaiter||function(e,t,i,r){return new(i||(i=Promise))(function(s,n){function fulfilled(e){try{step(r.next(e))}catch(e){n(e)}}function rejected(e){try{step(r.throw(e))}catch(e){n(e)}}function step(e){e.done?s(e.value):function adopt(e){return e instanceof i?e:new i(function(t){t(e)})}(e.value).then(fulfilled,rejected)}step((r=r.apply(e,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.NotificationSendService=void 0;const r=require("@nestjs/common"),s=require("typeorm"),n=require("./email.service"),a=require("./kakao.service"),c=require("./message-template.service"),o=require("./slack.service"),l=require("./sms.service"),d=require("./web.service");let m=class NotificationSendService{constructor(e,t,i,r,s,n,a){this.emailService=e,this.smsService=t,this.kakaoService=i,this.slackService=r,this.webNotificationService=s,this.messageTemplateService=n,this.dataSource=a}send(e){return i(this,void 0,void 0,function*(){switch(e.type){case"web":return this.sendWeb(e);case"email":return this.sendEmail(e);case"sms":return this.sendSms(e);case"kakao":return this.sendKakao(e);case"slack":return this.sendSlack(e)}})}sendWeb(e){return i(this,void 0,void 0,function*(){const t=[];for(const i of e.recipients){let r,s;if(e.template_key){const t=yield this.messageTemplateService.getTemplate("web",e.template_key);if(!t)throw new Error("Template not found "+e.template_key);const n=Object.assign(Object.assign({},e.variables),i.variables);r=this.messageTemplateService.renderTemplate(t,n).title||e.title||"",s=this.messageTemplateService.renderTemplate(t,n).content}else{if(!e.title||!e.content)throw new Error("title, content is required");r=e.title,s=e.content}t.push({recipient:i.recipient,user_id:i.user_id,title:r,content:s,variables:i.variables,meta:e.meta})}return yield this.webNotificationService.send(Object.assign(Object.assign({},e),{recipients:t}))})}sendEmail(e){return i(this,void 0,void 0,function*(){const t=[];for(const i of e.recipients){let r,s;if(e.template_key){const t=yield this.messageTemplateService.getTemplate("email",e.template_key);if(!t)throw new Error("Template not found "+e.template_key);const n=Object.assign(Object.assign({},e.variables),i.variables);r=this.messageTemplateService.renderTemplate(t,n).content,s=t.subject}else{if(!e.subject||!e.body)throw new Error("subject, body is required");r=e.body,s=e.subject}t.push({recipient:i.recipient,user_id:i.user_id,subject:s,text:r,variables:i.variables})}return yield this.emailService.send(t)})}sendSms(e){return i(this,void 0,void 0,function*(){const t=[];for(const i of e.recipients){let r;if(e.template_key){const t=yield this.messageTemplateService.getTemplate("sms",e.template_key);if(!t)throw new Error("Template not found "+e.template_key);const s=Object.assign(Object.assign({},e.variables),i.variables);r=this.messageTemplateService.renderTemplate(t,s).content}else{if(!e.content)throw new Error("content is required");r=e.content}t.push({recipient:i.recipient,user_id:i.user_id,content:r,variables:i.variables})}return yield this.smsService.send(t)})}sendKakao(e){return i(this,void 0,void 0,function*(){const t=[];for(const i of e.recipients){let r;if(!e.template_key)throw new Error("template_key is required");const s=yield this.messageTemplateService.getTemplate("kakao",e.template_key);if(!s)throw new Error("Template not found "+e.template_key);const n=Object.assign(Object.assign({},e.variables),i.variables);r=this.messageTemplateService.renderTemplate(s,n).content,t.push({recipient:i.recipient,user_id:i.user_id,sender_key:s.sender_key,template_code:s.template_code,message:r})}return yield this.kakaoService.send(t)})}sendSlack(e){return i(this,void 0,void 0,function*(){let t;if(e.template_key){const i=yield this.messageTemplateService.getTemplate("slack",e.template_key);if(!i)throw new Error("Template not found "+e.template_key);t=this.messageTemplateService.renderTemplate(i,e.variables||{}).content}else{if(!e.content)throw new Error("content is required");t=e.content}return[yield this.slackService.send(e.channel,t)]})}};exports.NotificationSendService=m,exports.NotificationSendService=m=e([(0,r.Injectable)(),t("design:paramtypes",[n.EmailService,l.SmsService,a.KakaoService,o.SlackService,d.WebNotificationService,c.MessageTemplateService,s.DataSource])],m);
@@ -7,7 +7,7 @@ export declare class NotificationService {
7
7
  private readonly notificationRecipientRepository;
8
8
  private readonly configService;
9
9
  constructor(notificationRepository: Repository<Notification>, notificationRecipientRepository: Repository<NotificationRecipient>, configService: ConfigService);
10
- create({ type, template_key, title, content, recipients, variables, }: {
10
+ create({ type, template_key, title, content, recipients, variables, meta, }: {
11
11
  type: string;
12
12
  template_key: string;
13
13
  title?: string;
@@ -18,6 +18,7 @@ export declare class NotificationService {
18
18
  variables?: Record<string, any>;
19
19
  }>;
20
20
  variables?: Record<string, any>;
21
+ meta?: Record<string, any>;
21
22
  }): Promise<{
22
23
  notification: {
23
24
  type: string;
@@ -25,6 +26,7 @@ export declare class NotificationService {
25
26
  title: string;
26
27
  content: string;
27
28
  sender: string;
29
+ meta: Record<string, any>;
28
30
  status: NOTIFICATION_STATUS.PENDING;
29
31
  } & Notification;
30
32
  recipients: NotificationRecipient[];
@@ -1 +1 @@
1
- var e=this&&this.__decorate||function(e,t,i,n){var o,r=arguments.length,c=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(c=(r<3?o(c):r>3?o(t,i,c):o(t,i))||c);return r>3&&c&&Object.defineProperty(t,i,c),c},t=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},i=this&&this.__param||function(e,t){return function(i,n){t(i,n,e)}},n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))(function(o,r){function fulfilled(e){try{step(n.next(e))}catch(e){r(e)}}function rejected(e){try{step(n.throw(e))}catch(e){r(e)}}function step(e){e.done?o(e.value):function adopt(e){return e instanceof i?e:new i(function(t){t(e)})}(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.NotificationService=void 0;const o=require("@nestjs/common"),r=require("@nestjs/config"),c=require("@nestjs/typeorm"),s=require("typeorm"),a=require("../../database/entities"),f=require("../../enums.common");let u=class NotificationService{constructor(e,t,i){this.notificationRepository=e,this.notificationRecipientRepository=t,this.configService=i}create(e){return n(this,arguments,void 0,function*({type:e,template_key:t,title:i,content:n,recipients:o,variables:r}){const c=this.getSenderByType(e),s=yield this.notificationRepository.save({type:e,template_key:t,title:i,content:n,sender:c,status:f.NOTIFICATION_STATUS.PENDING}),a=o.map(t=>this.notificationRecipientRepository.create({notification_id:s.id,type:e,user_id:t.user_id,recipient:t.recipient,title:i,content:n,variables:t.variables,status:f.NOTIFICATION_STATUS.PENDING}));return yield this.notificationRecipientRepository.save(a),{notification:s,recipients:a}})}getSenderByType(e){switch(e){case"web":return"system";case"email":return this.configService.get("EMAIL_FROM")||"noreply@example.com";case"sms":return this.configService.get("SMS_FROM")||"";case"kakao":return this.configService.get("KAKAO_FROM")||"";case"slack":return this.configService.get("SLACK_CHANNEL")||"";default:return""}}findAll(){return n(this,void 0,void 0,function*(){return this.notificationRepository.find({relations:["recipients"],order:{created_at:"DESC"}})})}find(e){return n(this,void 0,void 0,function*(){return this.notificationRepository.findOne({where:{id:e},relations:["recipients"]})})}resend(e,t){return n(this,void 0,void 0,function*(){const i=yield this.notificationRecipientRepository.find({where:t?{notification_id:e,user_id:t}:{notification_id:e}});for(const e of i)e.status=f.NOTIFICATION_STATUS.PENDING,e.failed_at=null,e.reason_failed=null,yield this.notificationRecipientRepository.save(e);return i})}markAsRead(e,t){return n(this,void 0,void 0,function*(){const i=yield this.notificationRecipientRepository.findOne({where:{notification_id:e,user_id:t}});return i&&(i.status=f.NOTIFICATION_STATUS.READ,i.read_at=new Date,yield this.notificationRecipientRepository.save(i)),i})}};exports.NotificationService=u,exports.NotificationService=u=e([(0,o.Injectable)(),i(0,(0,c.InjectRepository)(a.Notification)),i(1,(0,c.InjectRepository)(a.NotificationRecipient)),t("design:paramtypes",[s.Repository,s.Repository,r.ConfigService])],u);
1
+ var e=this&&this.__decorate||function(e,t,i,n){var o,r=arguments.length,c=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(c=(r<3?o(c):r>3?o(t,i,c):o(t,i))||c);return r>3&&c&&Object.defineProperty(t,i,c),c},t=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},i=this&&this.__param||function(e,t){return function(i,n){t(i,n,e)}},n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))(function(o,r){function fulfilled(e){try{step(n.next(e))}catch(e){r(e)}}function rejected(e){try{step(n.throw(e))}catch(e){r(e)}}function step(e){e.done?o(e.value):function adopt(e){return e instanceof i?e:new i(function(t){t(e)})}(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.NotificationService=void 0;const o=require("@nestjs/common"),r=require("@nestjs/config"),c=require("@nestjs/typeorm"),s=require("typeorm"),a=require("../../database/entities"),f=require("../../enums.common");let u=class NotificationService{constructor(e,t,i){this.notificationRepository=e,this.notificationRecipientRepository=t,this.configService=i}create(e){return n(this,arguments,void 0,function*({type:e,template_key:t,title:i,content:n,recipients:o,variables:r,meta:c}){const s=this.getSenderByType(e),a=yield this.notificationRepository.save({type:e,template_key:t,title:i,content:n,sender:s,meta:c,status:f.NOTIFICATION_STATUS.PENDING}),u=o.map(t=>this.notificationRecipientRepository.create({notification_id:a.id,type:e,user_id:t.user_id,recipient:t.recipient,title:i,content:n,meta:c,variables:t.variables,status:f.NOTIFICATION_STATUS.PENDING}));return yield this.notificationRecipientRepository.save(u),{notification:a,recipients:u}})}getSenderByType(e){switch(e){case"web":return"system";case"email":return this.configService.get("EMAIL_FROM")||"noreply@example.com";case"sms":return this.configService.get("SMS_FROM")||"";case"kakao":return this.configService.get("KAKAO_FROM")||"";case"slack":return this.configService.get("SLACK_CHANNEL")||"";default:return""}}findAll(){return n(this,void 0,void 0,function*(){return this.notificationRepository.find({relations:["recipients"],order:{created_at:"DESC"}})})}find(e){return n(this,void 0,void 0,function*(){return this.notificationRepository.findOne({where:{id:e},relations:["recipients"]})})}resend(e,t){return n(this,void 0,void 0,function*(){const i=yield this.notificationRecipientRepository.find({where:t?{notification_id:e,user_id:t}:{notification_id:e}});for(const e of i)e.status=f.NOTIFICATION_STATUS.PENDING,e.failed_at=null,e.reason_failed=null,yield this.notificationRecipientRepository.save(e);return i})}markAsRead(e,t){return n(this,void 0,void 0,function*(){const i=yield this.notificationRecipientRepository.findOne({where:{notification_id:e,user_id:t}});return i&&(i.status=f.NOTIFICATION_STATUS.READ,i.read_at=new Date,yield this.notificationRecipientRepository.save(i)),i})}};exports.NotificationService=u,exports.NotificationService=u=e([(0,o.Injectable)(),i(0,(0,c.InjectRepository)(a.Notification)),i(1,(0,c.InjectRepository)(a.NotificationRecipient)),t("design:paramtypes",[s.Repository,s.Repository,r.ConfigService])],u);
@@ -1 +1 @@
1
- var e,t=this&&this.__decorate||function(e,t,i,n){var o,r=arguments.length,c=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,i,n);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(c=(r<3?o(c):r>3?o(t,i,c):o(t,i))||c);return r>3&&c&&Object.defineProperty(t,i,c),c},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))(function(o,r){function fulfilled(e){try{step(n.next(e))}catch(e){r(e)}}function rejected(e){try{step(n.throw(e))}catch(e){r(e)}}function step(e){e.done?o(e.value):function adopt(e){return e instanceof i?e:new i(function(t){t(e)})}(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.WebNotificationService=void 0;const o=require("@nestjs/common"),r=require("@nestjs/config"),c=require("typeorm"),s=require("../../database/entities"),a=require("../../enums.common");let l=e=class WebNotificationService{constructor(t,i){this.configService=t,this.dataSource=i,this.logger=new o.Logger(e.name)}send(e){return n(this,void 0,void 0,function*(){const{recipients:t,title:i,content:n,template_key:o,variables:r}=e,c=yield this.dataSource.getRepository(s.Notification).save({type:"web",template_key:o,status:a.NOTIFICATION_STATUS.SENT});try{for(const e of t)yield this.sendToUser({notification_id:c.id,user_id:e.user_id,recipient:e.recipient,title:e.title||i||"",content:e.content||n||"",template_key:o,variables:Object.assign(Object.assign({},r),e.variables)});return{success:!0}}catch(e){throw this.logger.error("웹 알림 발송 실패:",e),e}})}sendToUser(e){return n(this,arguments,void 0,function*({notification_id:e,user_id:t,recipient:i,title:n,content:o,template_key:r,variables:c}){yield this.dataSource.getRepository(s.NotificationRecipient).save({notification_id:e,user_id:t,recipient:i,title:n,content:o,template_key:r,variables:c,status:a.NOTIFICATION_STATUS.SENT,type:"web"});const l={user_id:t,title:n,content:o,timestamp:(new Date).toISOString(),variables:c};return this.logger.log(`웹 알림 발송: 사용자 ${t}에게 "${n}" 전송`),l})}};exports.WebNotificationService=l,exports.WebNotificationService=l=e=t([(0,o.Injectable)(),i("design:paramtypes",[r.ConfigService,c.DataSource])],l);
1
+ var e,t=this&&this.__decorate||function(e,t,i,n){var o,r=arguments.length,c=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)c=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(c=(r<3?o(c):r>3?o(t,i,c):o(t,i))||c);return r>3&&c&&Object.defineProperty(t,i,c),c},i=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))(function(o,r){function fulfilled(e){try{step(n.next(e))}catch(e){r(e)}}function rejected(e){try{step(n.throw(e))}catch(e){r(e)}}function step(e){e.done?o(e.value):function adopt(e){return e instanceof i?e:new i(function(t){t(e)})}(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.WebNotificationService=void 0;const o=require("@nestjs/common"),r=require("@nestjs/config"),c=require("typeorm"),a=require("../../database/entities"),s=require("../../enums.common");let l=e=class WebNotificationService{constructor(t,i){this.configService=t,this.dataSource=i,this.logger=new o.Logger(e.name)}send(e){return n(this,void 0,void 0,function*(){const{recipients:t,title:i,content:n,template_key:o,variables:r}=e,c=yield this.dataSource.getRepository(a.Notification).save({type:"web",template_key:o,status:s.NOTIFICATION_STATUS.SENT});try{for(const e of t)yield this.sendToUser({notification_id:c.id,user_id:e.user_id,recipient:e.recipient,title:e.title||i||"",content:e.content||n||"",meta:e.meta,template_key:o,variables:Object.assign(Object.assign({},r),e.variables)});return{success:!0}}catch(e){throw this.logger.error("웹 알림 발송 실패:",e),e}})}sendToUser(e){return n(this,arguments,void 0,function*({notification_id:e,user_id:t,recipient:i,title:n,content:o,meta:r,template_key:c,variables:l}){yield this.dataSource.getRepository(a.NotificationRecipient).save({notification_id:e,user_id:t,recipient:i,title:n,content:o,meta:r,template_key:c,variables:l,status:s.NOTIFICATION_STATUS.SENT,type:"web"});const f={user_id:t,title:n,content:o,timestamp:(new Date).toISOString(),meta:r,variables:l};return this.logger.log(`웹 알림 발송: 사용자 ${t}에게 "${n}" 전송`),f})}};exports.WebNotificationService=l,exports.WebNotificationService=l=e=t([(0,o.Injectable)(),i("design:paramtypes",[r.ConfigService,c.DataSource])],l);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@comasoft/nestjs",
3
- "version": "0.1.64",
3
+ "version": "0.1.65",
4
4
  "description": "",
5
5
  "private": false,
6
6
  "exports": {