@comasoft/nestjs 0.1.49 → 0.1.51

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,r,n){var i,o=arguments.length,d=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)d=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(d=(o<3?i(d):o>3?i(t,r,d):i(t,r))||d);return o>3&&d&&Object.defineProperty(t,r,d),d},t=this&&this.__metadata||function(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)},r=this&&this.__param||function(e,t){return function(r,n){t(r,n,e)}},n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function fulfilled(e){try{step(n.next(e))}catch(e){o(e)}}function rejected(e){try{step(n.throw(e))}catch(e){o(e)}}function step(e){e.done?i(e.value):function adopt(e){return e instanceof r?e:new r(function(t){t(e)})}(e.value).then(fulfilled,rejected)}step((n=n.apply(e,t||[])).next())})};Object.defineProperty(exports,"__esModule",{value:!0}),exports.CommentService=void 0;const i=require("@nestjs/common"),o=require("@nestjs/typeorm"),d=require("class-transformer"),s=require("typeorm"),a=require("../database/entities"),c=require("../utils"),u=require("./dto");let m=class CommentService{constructor(e,t){this.repository=e,this.dataSource=t}resolveTargetId(e,t,r){return n(this,void 0,void 0,function*(){if(t)return t;if(!r)throw new i.BadRequestException("Either target_id or target_uid is required");throw new i.BadRequestException("resolveTargetId must be implemented in app service")})}updateTargetCommentCount(e,t,r,o){return n(this,void 0,void 0,function*(){throw new i.BadRequestException("updateTargetCommentCount must be implemented in app service")})}calculateTreeStructure(e,t,r){return n(this,void 0,void 0,function*(){if(r){const n=yield this.repository.findOne({where:{id:r,target:e,target_id:t,deleted_at:null}});if(!n)throw new i.NotFoundException("Parent comment not found");const o=yield this.repository.createQueryBuilder("comments").select("MAX(comments.sort)","maxSort").where("comments.target = :target",{target:e}).andWhere("comments.target_id = :target_id",{target_id:t}).andWhere("comments.group_id = :group_id",{group_id:n.group_id}).andWhere("comments.deleted_at IS NULL").getRawOne();return{group_id:n.group_id,depth:n.depth+1,sort:((null==o?void 0:o.maxSort)||0)+1}}{const r=yield this.repository.createQueryBuilder("comments").select("MAX(comments.sort)","maxSort").where("comments.target = :target",{target:e}).andWhere("comments.target_id = :target_id",{target_id:t}).andWhere("comments.parent_id IS NULL").andWhere("comments.deleted_at IS NULL").getRawOne();return{group_id:0,depth:0,sort:((null==r?void 0:r.maxSort)||0)+1}}})}create(e,t){return n(this,void 0,void 0,function*(){const{target:r,target_id:i,target_uid:o,parent_id:s,content:c}=t,m=yield this.resolveTargetId(r,i,o),l=yield this.calculateTreeStructure(r,m,s),p=yield this.dataSource.transaction(t=>n(this,void 0,void 0,function*(){const n=yield t.save(a.Comment,Object.assign(Object.assign({target:r,target_id:m,parent_id:s},l),{user_id:e,content:c}));return s||(yield t.update(a.Comment,n.id,{group_id:n.id})),s&&(yield t.increment(a.Comment,{id:s},"cnt_replies",1)),yield this.updateTargetCommentCount(t,r,m,1),yield t.findOne(a.Comment,{where:{id:n.id}})}));return(0,d.plainToClass)(u.ResponseCommentBaseDto,p)})}paginateRaw(e,t,r){return n(this,void 0,void 0,function*(){const{page:n,limit:i}=t,[o,d]=yield Promise.all([e.skip((n-1)*i).take(i).getRawMany(),e.getCount()]),s=Math.ceil(d/i);return{items:o.map(r),pagination:{page:n,limit:i,count:o.length,count_total:d,count_page:s}}})}findAll(e,t,r,i){return n(this,void 0,void 0,function*(){const{_page:n,_limit:o,_keyword:s,_group:a,_sort:m}=e;let l=this.repository.createQueryBuilder("comments").leftJoin("users","user","comments.user_id = user.id").addSelect(["user.id","user.uid","user.name","user.profile_image","user.info_department","user.info_position"]).where("comments.deleted_at IS NULL");if(t&&l.andWhere("comments.target = :target",{target:t}),r||i){const e=t?yield this.resolveTargetId(t,r,i):r;l.andWhere("comments.target_id = :target_id",{target_id:e})}l=(0,c.applyFiltersAndSorting)(l,{_keyword:s,_group:a,_sort:m,keywordFields:["content"],aliasName:"comments"}),m||l.orderBy("comments.group_id","ASC").addOrderBy("comments.sort","ASC");const p=yield this.paginateRaw(l,{page:n,limit:o},e=>({id:e.comments_id,target:e.comments_target,target_id:e.comments_target_id,parent_id:e.comments_parent_id,group_id:e.comments_group_id,depth:e.comments_depth,sort:e.comments_sort,content:e.comments_content,cnt_likes:e.comments_cnt_likes,cnt_replies:e.comments_cnt_replies,created_at:e.comments_created_at,updated_at:e.comments_updated_at,user:{id:e.user_id,uid:e.user_uid,name:e.user_name,profile_image:e.user_profile_image,info_department:e.user_info_department,info_position:e.user_info_position}}));return(0,d.plainToClass)(u.ResponseCommentsBaseDto,p)})}update(e,t,r){return n(this,void 0,void 0,function*(){const n=yield this.repository.findOne({where:{id:t,deleted_at:null}});if(!n)throw new i.NotFoundException(`Comment with ID ${t} not found`);if(n.user_id!==e)throw new i.BadRequestException("You can only update your own comments");yield this.repository.update(t,r)})}remove(e,t){return n(this,void 0,void 0,function*(){const r=yield this.repository.findOne({where:{id:t,deleted_at:null}});if(!r)throw new i.NotFoundException(`Comment with ID ${t} not found`);if(r.user_id!==e)throw new i.BadRequestException("You can only delete your own comments");yield this.dataSource.transaction(e=>n(this,void 0,void 0,function*(){yield e.softDelete(a.Comment,t),yield e.update(a.Comment,t,{content:""}),r.parent_id&&(yield e.decrement(a.Comment,{id:r.parent_id},"cnt_replies",1)),yield this.updateTargetCommentCount(e,r.target,r.target_id,-1)}))})}};exports.CommentService=m,exports.CommentService=m=e([(0,i.Injectable)(),r(0,(0,o.InjectRepository)(a.Comment)),t("design:paramtypes",[s.Repository,s.DataSource])],m);
1
+ var e=this&&this.__decorate||function(e,t,i,n){var o,r=arguments.length,d=r<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)d=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(d=(r<3?o(d):r>3?o(t,i,d):o(t,i))||d);return r>3&&d&&Object.defineProperty(t,i,d),d},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.CommentService=void 0;const o=require("@nestjs/common"),r=require("@nestjs/typeorm"),d=require("class-transformer"),a=require("typeorm"),s=require("../database/entities"),m=require("../utils"),c=require("./dto");let u=class CommentService{constructor(e,t){this.repository=e,this.dataSource=t}resolveTargetId(e,t,i){return n(this,void 0,void 0,function*(){if(t)return t;if(!i)throw new o.BadRequestException("Either target_id or target_uid is required");throw new o.BadRequestException("resolveTargetId must be implemented in app service")})}updateTargetCommentCount(e,t,i,r){return n(this,void 0,void 0,function*(){throw new o.BadRequestException("updateTargetCommentCount must be implemented in app service")})}calculateTreeStructure(e,t,i){return n(this,void 0,void 0,function*(){if(i){const n=yield this.repository.findOne({where:{id:i,target:e,target_id:t,deleted_at:null}});if(!n)throw new o.NotFoundException("Parent comment not found");const r=yield this.repository.createQueryBuilder("comments").select("MAX(comments.sort)","maxSort").where("comments.target = :target",{target:e}).andWhere("comments.target_id = :target_id",{target_id:t}).andWhere("comments.group_id = :group_id",{group_id:n.group_id}).andWhere("comments.deleted_at IS NULL").getRawOne();return{group_id:n.group_id,depth:n.depth+1,sort:((null==r?void 0:r.maxSort)||0)+1}}{const i=yield this.repository.createQueryBuilder("comments").select("MAX(comments.sort)","maxSort").where("comments.target = :target",{target:e}).andWhere("comments.target_id = :target_id",{target_id:t}).andWhere("comments.parent_id IS NULL").andWhere("comments.deleted_at IS NULL").getRawOne();return{group_id:0,depth:0,sort:((null==i?void 0:i.maxSort)||0)+1}}})}create(e,t){return n(this,void 0,void 0,function*(){const{target:i,target_id:o,target_uid:r,parent_id:a,content:m,meta:u}=t,l=yield this.resolveTargetId(i,o,r),p=yield this.calculateTreeStructure(i,l,a),_=yield this.dataSource.transaction(t=>n(this,void 0,void 0,function*(){const n=yield t.save(s.Comment,Object.assign(Object.assign({target:i,target_id:l,parent_id:a},p),{user_id:e,content:m,meta:u}));return a||(yield t.update(s.Comment,n.id,{group_id:n.id})),a&&(yield t.increment(s.Comment,{id:a},"cnt_replies",1)),yield this.updateTargetCommentCount(t,i,l,1),yield t.findOne(s.Comment,{where:{id:n.id}})}));return(0,d.plainToClass)(c.ResponseCommentBaseDto,_)})}paginateRaw(e,t,i){return n(this,void 0,void 0,function*(){const{page:n,limit:o}=t,[r,d]=yield Promise.all([e.skip((n-1)*o).take(o).getRawMany(),e.getCount()]),a=Math.ceil(d/o);return{items:r.map(i),pagination:{page:n,limit:o,count:r.length,count_total:d,count_page:a}}})}findAll(e,t,i,o){return n(this,void 0,void 0,function*(){const{_page:n,_limit:r,_keyword:a,_group:s,_sort:u}=e;let l=this.repository.createQueryBuilder("comments").leftJoin("users","user","comments.user_id = user.id").addSelect(["user.id","user.uid","user.name","user.profile_image","user.info_department","user.info_position"]).where("comments.deleted_at IS NULL");if(t&&l.andWhere("comments.target = :target",{target:t}),i||o){const e=t?yield this.resolveTargetId(t,i,o):i;l.andWhere("comments.target_id = :target_id",{target_id:e})}l=(0,m.applyFiltersAndSorting)(l,{_keyword:a,_group:s,_sort:u,keywordFields:["content"],aliasName:"comments"}),u||l.orderBy("comments.group_id","ASC").addOrderBy("comments.sort","ASC");const p=yield this.paginateRaw(l,{page:n,limit:r},e=>({id:e.comments_id,target:e.comments_target,target_id:e.comments_target_id,parent_id:e.comments_parent_id,group_id:e.comments_group_id,depth:e.comments_depth,sort:e.comments_sort,content:e.comments_content,meta:e.comments_meta,cnt_likes:e.comments_cnt_likes,cnt_replies:e.comments_cnt_replies,modified_at:e.comments_modified_at,created_at:e.comments_created_at,updated_at:e.comments_updated_at,user:{id:e.user_id,uid:e.user_uid,name:e.user_name,profile_image:e.user_profile_image,info_department:e.user_info_department,info_position:e.user_info_position}}));return(0,d.plainToClass)(c.ResponseCommentsBaseDto,p)})}update(e,t,i){return n(this,void 0,void 0,function*(){const n=yield this.repository.findOne({where:{id:t,deleted_at:null}});if(!n)throw new o.NotFoundException(`Comment with ID ${t} not found`);if(n.user_id!==e)throw new o.BadRequestException("You can only update your own comments");yield this.repository.update(t,Object.assign(Object.assign({},i),{modified_at:new Date}))})}remove(e,t){return n(this,void 0,void 0,function*(){const i=yield this.repository.findOne({where:{id:t,deleted_at:null}});if(!i)throw new o.NotFoundException(`Comment with ID ${t} not found`);if(i.user_id!==e)throw new o.BadRequestException("You can only delete your own comments");yield this.dataSource.transaction(e=>n(this,void 0,void 0,function*(){yield e.softDelete(s.Comment,t),yield e.update(s.Comment,t,{content:""}),i.parent_id&&(yield e.decrement(s.Comment,{id:i.parent_id},"cnt_replies",1)),yield this.updateTargetCommentCount(e,i.target,i.target_id,-1)}))})}};exports.CommentService=u,exports.CommentService=u=e([(0,o.Injectable)(),i(0,(0,r.InjectRepository)(s.Comment)),t("design:paramtypes",[a.Repository,a.DataSource])],u);
@@ -4,4 +4,5 @@ export declare class CreateCommentBaseDto<T = any> {
4
4
  target_uid?: string;
5
5
  parent_id?: number;
6
6
  content: string;
7
+ meta?: Record<string, any>;
7
8
  }
@@ -1 +1 @@
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 s=e.length-1;s>=0;s--)(a=e[s])&&(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.CreateCommentBaseDto=void 0;const o=require("class-validator");class CreateCommentBaseDto{}exports.CreateCommentBaseDto=CreateCommentBaseDto,e([(0,o.IsEnum)(Object.values({})),t("design:type",Object)],CreateCommentBaseDto.prototype,"target",void 0),e([(0,o.ValidateIf)(e=>!e.target_uid),(0,o.IsNumber)(),(0,o.Min)(1),t("design:type",Number)],CreateCommentBaseDto.prototype,"target_id",void 0),e([(0,o.ValidateIf)(e=>!e.target_id),(0,o.IsString)(),t("design:type",String)],CreateCommentBaseDto.prototype,"target_uid",void 0),e([(0,o.IsNumber)(),(0,o.Min)(1),(0,o.IsOptional)(),t("design:type",Number)],CreateCommentBaseDto.prototype,"parent_id",void 0),e([(0,o.IsString)(),t("design:type",String)],CreateCommentBaseDto.prototype,"content",void 0);
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 s=e.length-1;s>=0;s--)(a=e[s])&&(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.CreateCommentBaseDto=void 0;const o=require("class-validator");class CreateCommentBaseDto{}exports.CreateCommentBaseDto=CreateCommentBaseDto,e([(0,o.IsEnum)(Object.values({})),t("design:type",Object)],CreateCommentBaseDto.prototype,"target",void 0),e([(0,o.ValidateIf)(e=>!e.target_uid),(0,o.IsNumber)(),(0,o.Min)(1),t("design:type",Number)],CreateCommentBaseDto.prototype,"target_id",void 0),e([(0,o.ValidateIf)(e=>!e.target_id),(0,o.IsString)(),t("design:type",String)],CreateCommentBaseDto.prototype,"target_uid",void 0),e([(0,o.IsNumber)(),(0,o.Min)(1),(0,o.IsOptional)(),t("design:type",Number)],CreateCommentBaseDto.prototype,"parent_id",void 0),e([(0,o.IsString)(),t("design:type",String)],CreateCommentBaseDto.prototype,"content",void 0),e([(0,o.IsObject)(),(0,o.IsOptional)(),t("design:type",Object)],CreateCommentBaseDto.prototype,"meta",void 0);
@@ -18,9 +18,9 @@ export declare class ResponseCommentBaseDto<T = any> {
18
18
  content: string;
19
19
  cnt_likes: number;
20
20
  cnt_replies: number;
21
+ meta: Record<string, any>;
22
+ modified_at: Date;
21
23
  created_at: Date;
22
- updated_at: Date;
23
- deleted_at: Date;
24
24
  }
25
25
  export declare class ResponseCommentsBaseDto<T = any> {
26
26
  items: ResponseCommentBaseDto<T>[];
@@ -1 +1 @@
1
- var e=this&&this.__decorate||function(e,o,t,s){var p,n=arguments.length,r=n<3?o:null===s?s=Object.getOwnPropertyDescriptor(o,t):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,o,t,s);else for(var i=e.length-1;i>=0;i--)(p=e[i])&&(r=(n<3?p(r):n>3?p(o,t,r):p(o,t))||r);return n>3&&r&&Object.defineProperty(o,t,r),r},o=this&&this.__metadata||function(e,o){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,o)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.ResponseCommentsBaseDto=exports.ResponseCommentBaseDto=void 0;const t=require("class-transformer"),s=require("../../dto");class UserDto{}e([(0,t.Expose)(),o("design:type",String)],UserDto.prototype,"uid",void 0),e([(0,t.Expose)(),o("design:type",String)],UserDto.prototype,"name",void 0),e([(0,t.Expose)(),o("design:type",String)],UserDto.prototype,"profile_image",void 0),e([(0,t.Expose)(),o("design:type",String)],UserDto.prototype,"info_department",void 0),e([(0,t.Expose)(),o("design:type",String)],UserDto.prototype,"info_position",void 0);class ResponseCommentBaseDto{}exports.ResponseCommentBaseDto=ResponseCommentBaseDto,e([(0,t.Expose)(),o("design:type",Number)],ResponseCommentBaseDto.prototype,"id",void 0),e([(0,t.Expose)(),o("design:type",Object)],ResponseCommentBaseDto.prototype,"target",void 0),e([(0,t.Expose)(),o("design:type",Number)],ResponseCommentBaseDto.prototype,"target_id",void 0),e([(0,t.Expose)(),o("design:type",Number)],ResponseCommentBaseDto.prototype,"parent_id",void 0),e([(0,t.Expose)(),o("design:type",Number)],ResponseCommentBaseDto.prototype,"group_id",void 0),e([(0,t.Expose)(),o("design:type",Number)],ResponseCommentBaseDto.prototype,"depth",void 0),e([(0,t.Expose)(),o("design:type",Number)],ResponseCommentBaseDto.prototype,"sort",void 0),e([(0,t.Expose)(),(0,t.Type)(()=>UserDto),o("design:type",UserDto)],ResponseCommentBaseDto.prototype,"user",void 0),e([(0,t.Expose)(),o("design:type",String)],ResponseCommentBaseDto.prototype,"content",void 0),e([(0,t.Expose)(),o("design:type",Number)],ResponseCommentBaseDto.prototype,"cnt_likes",void 0),e([(0,t.Expose)(),o("design:type",Number)],ResponseCommentBaseDto.prototype,"cnt_replies",void 0),e([(0,t.Expose)(),o("design:type",Date)],ResponseCommentBaseDto.prototype,"created_at",void 0),e([(0,t.Expose)(),o("design:type",Date)],ResponseCommentBaseDto.prototype,"updated_at",void 0),e([(0,t.Expose)(),o("design:type",Date)],ResponseCommentBaseDto.prototype,"deleted_at",void 0);class ResponseCommentsBaseDto{}exports.ResponseCommentsBaseDto=ResponseCommentsBaseDto,e([(0,t.Expose)(),(0,t.Type)(()=>ResponseCommentBaseDto),o("design:type",Array)],ResponseCommentsBaseDto.prototype,"items",void 0),e([(0,t.Expose)(),(0,t.Type)(()=>s.PaginationDto),o("design:type",s.PaginationDto)],ResponseCommentsBaseDto.prototype,"pagination",void 0);
1
+ var e=this&&this.__decorate||function(e,o,t,s){var p,n=arguments.length,i=n<3?o:null===s?s=Object.getOwnPropertyDescriptor(o,t):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,o,t,s);else for(var r=e.length-1;r>=0;r--)(p=e[r])&&(i=(n<3?p(i):n>3?p(o,t,i):p(o,t))||i);return n>3&&i&&Object.defineProperty(o,t,i),i},o=this&&this.__metadata||function(e,o){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,o)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.ResponseCommentsBaseDto=exports.ResponseCommentBaseDto=void 0;const t=require("class-transformer"),s=require("../../dto");class UserDto{}e([(0,t.Expose)(),o("design:type",String)],UserDto.prototype,"uid",void 0),e([(0,t.Expose)(),o("design:type",String)],UserDto.prototype,"name",void 0),e([(0,t.Expose)(),o("design:type",String)],UserDto.prototype,"profile_image",void 0),e([(0,t.Expose)(),o("design:type",String)],UserDto.prototype,"info_department",void 0),e([(0,t.Expose)(),o("design:type",String)],UserDto.prototype,"info_position",void 0);class ResponseCommentBaseDto{}exports.ResponseCommentBaseDto=ResponseCommentBaseDto,e([(0,t.Expose)(),o("design:type",Number)],ResponseCommentBaseDto.prototype,"id",void 0),e([(0,t.Expose)(),o("design:type",Object)],ResponseCommentBaseDto.prototype,"target",void 0),e([(0,t.Expose)(),o("design:type",Number)],ResponseCommentBaseDto.prototype,"target_id",void 0),e([(0,t.Expose)(),o("design:type",Number)],ResponseCommentBaseDto.prototype,"parent_id",void 0),e([(0,t.Expose)(),o("design:type",Number)],ResponseCommentBaseDto.prototype,"group_id",void 0),e([(0,t.Expose)(),o("design:type",Number)],ResponseCommentBaseDto.prototype,"depth",void 0),e([(0,t.Expose)(),o("design:type",Number)],ResponseCommentBaseDto.prototype,"sort",void 0),e([(0,t.Expose)(),(0,t.Type)(()=>UserDto),o("design:type",UserDto)],ResponseCommentBaseDto.prototype,"user",void 0),e([(0,t.Expose)(),o("design:type",String)],ResponseCommentBaseDto.prototype,"content",void 0),e([(0,t.Expose)(),o("design:type",Number)],ResponseCommentBaseDto.prototype,"cnt_likes",void 0),e([(0,t.Expose)(),o("design:type",Number)],ResponseCommentBaseDto.prototype,"cnt_replies",void 0),e([(0,t.Expose)(),o("design:type",Object)],ResponseCommentBaseDto.prototype,"meta",void 0),e([(0,t.Expose)(),o("design:type",Date)],ResponseCommentBaseDto.prototype,"modified_at",void 0),e([(0,t.Expose)(),o("design:type",Date)],ResponseCommentBaseDto.prototype,"created_at",void 0);class ResponseCommentsBaseDto{}exports.ResponseCommentsBaseDto=ResponseCommentsBaseDto,e([(0,t.Expose)(),(0,t.Type)(()=>ResponseCommentBaseDto),o("design:type",Array)],ResponseCommentsBaseDto.prototype,"items",void 0),e([(0,t.Expose)(),(0,t.Type)(()=>s.PaginationDto),o("design:type",s.PaginationDto)],ResponseCommentsBaseDto.prototype,"pagination",void 0);
@@ -10,6 +10,8 @@ export declare class Comment {
10
10
  content: string;
11
11
  cnt_likes: number;
12
12
  cnt_replies: number;
13
+ meta?: Record<string, any>;
14
+ modified_at?: Date;
13
15
  created_at: Date;
14
16
  updated_at: Date;
15
17
  deleted_at: Date;
@@ -1 +1 @@
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.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.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,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);
@@ -5,6 +5,7 @@ export declare class Like {
5
5
  target_id: number;
6
6
  user_id: number;
7
7
  type: LIKE_TYPE;
8
+ meta?: Record<string, any>;
8
9
  created_at: Date;
9
10
  updated_at: Date;
10
11
  }
@@ -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.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,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);
@@ -11,6 +11,7 @@ export declare class LogsEvent {
11
11
  ip_address?: string;
12
12
  user_agent?: string;
13
13
  description?: string;
14
+ meta?: Record<string, any>;
14
15
  occurred_at: Date;
15
16
  created_at: Date;
16
17
  }
@@ -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)("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
+ 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)("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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@comasoft/nestjs",
3
- "version": "0.1.49",
3
+ "version": "0.1.51",
4
4
  "description": "",
5
5
  "private": false,
6
6
  "exports": {