@platform-modules/foreign-ministry 1.0.46 → 1.0.48
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env +2 -2
- package/dist/data-source.js +10 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/models/CategoriesModel.d.ts +6 -0
- package/dist/models/CategoriesModel.js +34 -0
- package/dist/models/CommentsModel.d.ts +16 -0
- package/dist/models/CommentsModel.js +75 -0
- package/dist/models/ConversationParticipantModel.d.ts +1 -2
- package/dist/models/ConversationParticipantModel.js +2 -7
- package/dist/models/PostAttachmentsModel.d.ts +9 -0
- package/dist/models/PostAttachmentsModel.js +45 -0
- package/dist/models/PostReactionsModel.d.ts +15 -0
- package/dist/models/PostReactionsModel.js +67 -0
- package/dist/models/PostsModel.d.ts +22 -0
- package/dist/models/PostsModel.js +92 -0
- package/package.json +1 -1
- package/src/data-source.ts +12 -0
- package/src/index.ts +5 -0
- package/src/models/CategoriesModel.ts +18 -0
- package/src/models/CommentsModel.ts +52 -0
- package/src/models/ConversationParticipantModel.ts +0 -5
- package/src/models/PostAttachmentsModel.ts +28 -0
- package/src/models/PostReactionsModel.ts +47 -0
- package/src/models/PostsModel.ts +66 -0
package/.env
CHANGED
package/dist/data-source.js
CHANGED
|
@@ -33,6 +33,11 @@ const FMServices_1 = require("./models/FMServices");
|
|
|
33
33
|
const FMSubservices_1 = require("./models/FMSubservices");
|
|
34
34
|
const serviceBookmarksModel_1 = require("./models/serviceBookmarksModel");
|
|
35
35
|
const feedbackModel_1 = require("./models/feedbackModel");
|
|
36
|
+
const CategoriesModel_1 = require("./models/CategoriesModel");
|
|
37
|
+
const PostsModel_1 = require("./models/PostsModel");
|
|
38
|
+
const CommentsModel_1 = require("./models/CommentsModel");
|
|
39
|
+
const PostAttachmentsModel_1 = require("./models/PostAttachmentsModel");
|
|
40
|
+
const PostReactionsModel_1 = require("./models/PostReactionsModel");
|
|
36
41
|
const HelpContentModel_1 = require("./models/HelpContentModel");
|
|
37
42
|
const HelpContentCategoryModel_1 = require("./models/HelpContentCategoryModel");
|
|
38
43
|
const HelpContentAttachmentModel_1 = require("./models/HelpContentAttachmentModel");
|
|
@@ -74,6 +79,11 @@ exports.AppDataSource = new typeorm_1.DataSource({
|
|
|
74
79
|
FMSubservices_1.FMSubServices,
|
|
75
80
|
serviceBookmarksModel_1.ServiceBookmarks,
|
|
76
81
|
feedbackModel_1.Feedback,
|
|
82
|
+
CategoriesModel_1.Categories,
|
|
83
|
+
PostsModel_1.Posts,
|
|
84
|
+
CommentsModel_1.Comments,
|
|
85
|
+
PostAttachmentsModel_1.PostAttachments,
|
|
86
|
+
PostReactionsModel_1.PostReactions,
|
|
77
87
|
HelpContentModel_1.HelpContent,
|
|
78
88
|
HelpContentCategoryModel_1.HelpContentCategories,
|
|
79
89
|
HelpContentAttachmentModel_1.HelpContentAttachments
|
package/dist/index.d.ts
CHANGED
|
@@ -26,6 +26,11 @@ export * from './models/FMServices';
|
|
|
26
26
|
export * from './models/FMSubservices';
|
|
27
27
|
export * from './models/serviceBookmarksModel';
|
|
28
28
|
export * from './models/feedbackModel';
|
|
29
|
+
export * from './models/CategoriesModel';
|
|
30
|
+
export * from './models/PostsModel';
|
|
31
|
+
export * from './models/CommentsModel';
|
|
32
|
+
export * from './models/PostAttachmentsModel';
|
|
33
|
+
export * from './models/PostReactionsModel';
|
|
29
34
|
export * from './models/HelpContentModel';
|
|
30
35
|
export * from './models/HelpContentCategoryModel';
|
|
31
36
|
export * from './models/HelpContentAttachmentModel';
|
package/dist/index.js
CHANGED
|
@@ -42,6 +42,11 @@ __exportStar(require("./models/FMServices"), exports);
|
|
|
42
42
|
__exportStar(require("./models/FMSubservices"), exports);
|
|
43
43
|
__exportStar(require("./models/serviceBookmarksModel"), exports);
|
|
44
44
|
__exportStar(require("./models/feedbackModel"), exports);
|
|
45
|
+
__exportStar(require("./models/CategoriesModel"), exports);
|
|
46
|
+
__exportStar(require("./models/PostsModel"), exports);
|
|
47
|
+
__exportStar(require("./models/CommentsModel"), exports);
|
|
48
|
+
__exportStar(require("./models/PostAttachmentsModel"), exports);
|
|
49
|
+
__exportStar(require("./models/PostReactionsModel"), exports);
|
|
45
50
|
__exportStar(require("./models/HelpContentModel"), exports);
|
|
46
51
|
__exportStar(require("./models/HelpContentCategoryModel"), exports);
|
|
47
52
|
__exportStar(require("./models/HelpContentAttachmentModel"), exports);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Categories = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BaseModel_1 = require("./BaseModel");
|
|
15
|
+
let Categories = class Categories extends BaseModel_1.BaseModel {
|
|
16
|
+
constructor() {
|
|
17
|
+
super();
|
|
18
|
+
this.name = '';
|
|
19
|
+
this.description = '';
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
exports.Categories = Categories;
|
|
23
|
+
__decorate([
|
|
24
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 150, nullable: false, unique: true }),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], Categories.prototype, "name", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
29
|
+
__metadata("design:type", String)
|
|
30
|
+
], Categories.prototype, "description", void 0);
|
|
31
|
+
exports.Categories = Categories = __decorate([
|
|
32
|
+
(0, typeorm_1.Entity)({ name: 'categories' }),
|
|
33
|
+
__metadata("design:paramtypes", [])
|
|
34
|
+
], Categories);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseModel } from './BaseModel';
|
|
2
|
+
import { Posts } from './PostsModel';
|
|
3
|
+
import { User } from './user';
|
|
4
|
+
export declare class Comments extends BaseModel {
|
|
5
|
+
post_id: number;
|
|
6
|
+
user_id: number;
|
|
7
|
+
reply_to_comment_id?: number;
|
|
8
|
+
content: string;
|
|
9
|
+
created_at: Date;
|
|
10
|
+
updated_at: Date;
|
|
11
|
+
post?: Posts;
|
|
12
|
+
user?: User;
|
|
13
|
+
replyToComment?: Comments;
|
|
14
|
+
replies?: Comments[];
|
|
15
|
+
constructor();
|
|
16
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Comments = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BaseModel_1 = require("./BaseModel");
|
|
15
|
+
const PostsModel_1 = require("./PostsModel");
|
|
16
|
+
const user_1 = require("./user");
|
|
17
|
+
let Comments = class Comments extends BaseModel_1.BaseModel {
|
|
18
|
+
constructor() {
|
|
19
|
+
super();
|
|
20
|
+
this.post_id = 0;
|
|
21
|
+
this.user_id = 0;
|
|
22
|
+
this.reply_to_comment_id = 0;
|
|
23
|
+
this.content = '';
|
|
24
|
+
this.created_at = new Date();
|
|
25
|
+
this.updated_at = new Date();
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
exports.Comments = Comments;
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: false }),
|
|
31
|
+
__metadata("design:type", Number)
|
|
32
|
+
], Comments.prototype, "post_id", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: false }),
|
|
35
|
+
__metadata("design:type", Number)
|
|
36
|
+
], Comments.prototype, "user_id", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
39
|
+
__metadata("design:type", Number)
|
|
40
|
+
], Comments.prototype, "reply_to_comment_id", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: false }),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], Comments.prototype, "content", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, typeorm_1.Column)({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' }),
|
|
47
|
+
__metadata("design:type", Date)
|
|
48
|
+
], Comments.prototype, "created_at", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, typeorm_1.Column)({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' }),
|
|
51
|
+
__metadata("design:type", Date)
|
|
52
|
+
], Comments.prototype, "updated_at", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, typeorm_1.ManyToOne)(() => PostsModel_1.Posts, post => post.id),
|
|
55
|
+
(0, typeorm_1.JoinColumn)({ name: 'post_id' }),
|
|
56
|
+
__metadata("design:type", PostsModel_1.Posts)
|
|
57
|
+
], Comments.prototype, "post", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, typeorm_1.ManyToOne)(() => user_1.User, user => user.id),
|
|
60
|
+
(0, typeorm_1.JoinColumn)({ name: 'user_id' }),
|
|
61
|
+
__metadata("design:type", user_1.User)
|
|
62
|
+
], Comments.prototype, "user", void 0);
|
|
63
|
+
__decorate([
|
|
64
|
+
(0, typeorm_1.ManyToOne)(() => Comments, comment => comment.id),
|
|
65
|
+
(0, typeorm_1.JoinColumn)({ name: 'reply_to_comment_id' }),
|
|
66
|
+
__metadata("design:type", Comments)
|
|
67
|
+
], Comments.prototype, "replyToComment", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, typeorm_1.OneToMany)(() => Comments, comment => comment.replyToComment),
|
|
70
|
+
__metadata("design:type", Array)
|
|
71
|
+
], Comments.prototype, "replies", void 0);
|
|
72
|
+
exports.Comments = Comments = __decorate([
|
|
73
|
+
(0, typeorm_1.Entity)({ name: 'comments' }),
|
|
74
|
+
__metadata("design:paramtypes", [])
|
|
75
|
+
], Comments);
|
|
@@ -4,12 +4,11 @@ import { User } from './user';
|
|
|
4
4
|
export declare class ConversationParticipant extends BaseModel {
|
|
5
5
|
conversationId: number;
|
|
6
6
|
userId: number;
|
|
7
|
-
roleId: number;
|
|
8
7
|
joinedAt: Date;
|
|
9
8
|
lastReadAt?: Date;
|
|
10
9
|
createdAt: Date;
|
|
11
10
|
updatedAt?: Date;
|
|
12
11
|
conversation?: Conversation;
|
|
13
12
|
user?: User;
|
|
14
|
-
constructor(conversationId?: number, userId?: number,
|
|
13
|
+
constructor(conversationId?: number, userId?: number, joinedAt?: Date, lastReadAt?: Date, createdAt?: Date, updatedAt?: Date);
|
|
15
14
|
}
|
|
@@ -15,11 +15,10 @@ const BaseModel_1 = require("./BaseModel");
|
|
|
15
15
|
const ConversationModel_1 = require("./ConversationModel");
|
|
16
16
|
const user_1 = require("./user");
|
|
17
17
|
let ConversationParticipant = class ConversationParticipant extends BaseModel_1.BaseModel {
|
|
18
|
-
constructor(conversationId, userId,
|
|
18
|
+
constructor(conversationId, userId, joinedAt, lastReadAt, createdAt, updatedAt) {
|
|
19
19
|
super();
|
|
20
20
|
this.conversationId = conversationId || 0;
|
|
21
21
|
this.userId = userId || 0;
|
|
22
|
-
this.roleId = roleId || 0;
|
|
23
22
|
this.joinedAt = joinedAt || new Date();
|
|
24
23
|
this.lastReadAt = lastReadAt;
|
|
25
24
|
this.createdAt = createdAt || new Date();
|
|
@@ -35,10 +34,6 @@ __decorate([
|
|
|
35
34
|
(0, typeorm_1.Column)({ type: 'int' }),
|
|
36
35
|
__metadata("design:type", Number)
|
|
37
36
|
], ConversationParticipant.prototype, "userId", void 0);
|
|
38
|
-
__decorate([
|
|
39
|
-
(0, typeorm_1.Column)({ type: 'int' }),
|
|
40
|
-
__metadata("design:type", Number)
|
|
41
|
-
], ConversationParticipant.prototype, "roleId", void 0);
|
|
42
37
|
__decorate([
|
|
43
38
|
(0, typeorm_1.Column)({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' }),
|
|
44
39
|
__metadata("design:type", Date)
|
|
@@ -67,7 +62,7 @@ __decorate([
|
|
|
67
62
|
], ConversationParticipant.prototype, "user", void 0);
|
|
68
63
|
exports.ConversationParticipant = ConversationParticipant = __decorate([
|
|
69
64
|
(0, typeorm_1.Entity)({ name: 'conversation_participants' }),
|
|
70
|
-
__metadata("design:paramtypes", [Number, Number,
|
|
65
|
+
__metadata("design:paramtypes", [Number, Number, Date,
|
|
71
66
|
Date,
|
|
72
67
|
Date,
|
|
73
68
|
Date])
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.PostAttachments = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BaseModel_1 = require("./BaseModel");
|
|
15
|
+
const PostsModel_1 = require("./PostsModel");
|
|
16
|
+
let PostAttachments = class PostAttachments extends BaseModel_1.BaseModel {
|
|
17
|
+
constructor() {
|
|
18
|
+
super();
|
|
19
|
+
this.post_id = 0;
|
|
20
|
+
this.file_url = '';
|
|
21
|
+
this.uploaded_at = new Date();
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
exports.PostAttachments = PostAttachments;
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: false }),
|
|
27
|
+
__metadata("design:type", Number)
|
|
28
|
+
], PostAttachments.prototype, "post_id", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: false }),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], PostAttachments.prototype, "file_url", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.Column)({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' }),
|
|
35
|
+
__metadata("design:type", Date)
|
|
36
|
+
], PostAttachments.prototype, "uploaded_at", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.ManyToOne)(() => PostsModel_1.Posts, post => post.id),
|
|
39
|
+
(0, typeorm_1.JoinColumn)({ name: 'post_id' }),
|
|
40
|
+
__metadata("design:type", PostsModel_1.Posts)
|
|
41
|
+
], PostAttachments.prototype, "post", void 0);
|
|
42
|
+
exports.PostAttachments = PostAttachments = __decorate([
|
|
43
|
+
(0, typeorm_1.Entity)({ name: 'post_attachments' }),
|
|
44
|
+
__metadata("design:paramtypes", [])
|
|
45
|
+
], PostAttachments);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BaseModel } from './BaseModel';
|
|
2
|
+
import { Posts } from './PostsModel';
|
|
3
|
+
import { Comments } from './CommentsModel';
|
|
4
|
+
import { User } from './user';
|
|
5
|
+
export declare class PostReactions extends BaseModel {
|
|
6
|
+
post_id?: number;
|
|
7
|
+
comment_id?: number;
|
|
8
|
+
user_id: number;
|
|
9
|
+
reaction_type: string;
|
|
10
|
+
created_at: Date;
|
|
11
|
+
post?: Posts;
|
|
12
|
+
comment?: Comments;
|
|
13
|
+
user?: User;
|
|
14
|
+
constructor();
|
|
15
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.PostReactions = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BaseModel_1 = require("./BaseModel");
|
|
15
|
+
const PostsModel_1 = require("./PostsModel");
|
|
16
|
+
const CommentsModel_1 = require("./CommentsModel");
|
|
17
|
+
const user_1 = require("./user");
|
|
18
|
+
let PostReactions = class PostReactions extends BaseModel_1.BaseModel {
|
|
19
|
+
constructor() {
|
|
20
|
+
super();
|
|
21
|
+
this.post_id = 0;
|
|
22
|
+
this.comment_id = 0;
|
|
23
|
+
this.user_id = 0;
|
|
24
|
+
this.reaction_type = '';
|
|
25
|
+
this.created_at = new Date();
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
exports.PostReactions = PostReactions;
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
31
|
+
__metadata("design:type", Number)
|
|
32
|
+
], PostReactions.prototype, "post_id", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
35
|
+
__metadata("design:type", Number)
|
|
36
|
+
], PostReactions.prototype, "comment_id", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: false }),
|
|
39
|
+
__metadata("design:type", Number)
|
|
40
|
+
], PostReactions.prototype, "user_id", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 50, nullable: false }),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], PostReactions.prototype, "reaction_type", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, typeorm_1.Column)({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' }),
|
|
47
|
+
__metadata("design:type", Date)
|
|
48
|
+
], PostReactions.prototype, "created_at", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, typeorm_1.ManyToOne)(() => PostsModel_1.Posts, post => post.id),
|
|
51
|
+
(0, typeorm_1.JoinColumn)({ name: 'post_id' }),
|
|
52
|
+
__metadata("design:type", PostsModel_1.Posts)
|
|
53
|
+
], PostReactions.prototype, "post", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, typeorm_1.ManyToOne)(() => CommentsModel_1.Comments, comment => comment.id),
|
|
56
|
+
(0, typeorm_1.JoinColumn)({ name: 'comment_id' }),
|
|
57
|
+
__metadata("design:type", CommentsModel_1.Comments)
|
|
58
|
+
], PostReactions.prototype, "comment", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, typeorm_1.ManyToOne)(() => user_1.User, user => user.id),
|
|
61
|
+
(0, typeorm_1.JoinColumn)({ name: 'user_id' }),
|
|
62
|
+
__metadata("design:type", user_1.User)
|
|
63
|
+
], PostReactions.prototype, "user", void 0);
|
|
64
|
+
exports.PostReactions = PostReactions = __decorate([
|
|
65
|
+
(0, typeorm_1.Entity)({ name: 'post_reactions' }),
|
|
66
|
+
__metadata("design:paramtypes", [])
|
|
67
|
+
], PostReactions);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BaseModel } from './BaseModel';
|
|
2
|
+
import { User } from './user';
|
|
3
|
+
import { Departments } from './DepartmentsModel';
|
|
4
|
+
import { Categories } from './CategoriesModel';
|
|
5
|
+
import { Comments } from './CommentsModel';
|
|
6
|
+
import { PostAttachments } from './PostAttachmentsModel';
|
|
7
|
+
export declare class Posts extends BaseModel {
|
|
8
|
+
title: string;
|
|
9
|
+
content: string;
|
|
10
|
+
user_id?: number;
|
|
11
|
+
department_id?: number;
|
|
12
|
+
category_id?: number;
|
|
13
|
+
created_at: Date;
|
|
14
|
+
updated_at: Date;
|
|
15
|
+
is_bookmarked: boolean;
|
|
16
|
+
user?: User;
|
|
17
|
+
department?: Departments;
|
|
18
|
+
category?: Categories;
|
|
19
|
+
comments?: Comments[];
|
|
20
|
+
attachments?: PostAttachments[];
|
|
21
|
+
constructor();
|
|
22
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Posts = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const BaseModel_1 = require("./BaseModel");
|
|
15
|
+
const user_1 = require("./user");
|
|
16
|
+
const DepartmentsModel_1 = require("./DepartmentsModel");
|
|
17
|
+
const CategoriesModel_1 = require("./CategoriesModel");
|
|
18
|
+
const CommentsModel_1 = require("./CommentsModel");
|
|
19
|
+
const PostAttachmentsModel_1 = require("./PostAttachmentsModel");
|
|
20
|
+
let Posts = class Posts extends BaseModel_1.BaseModel {
|
|
21
|
+
constructor() {
|
|
22
|
+
super();
|
|
23
|
+
this.title = '';
|
|
24
|
+
this.content = '';
|
|
25
|
+
this.user_id = 0;
|
|
26
|
+
this.department_id = 0;
|
|
27
|
+
this.category_id = 0;
|
|
28
|
+
this.created_at = new Date();
|
|
29
|
+
this.updated_at = new Date();
|
|
30
|
+
this.is_bookmarked = false;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
exports.Posts = Posts;
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: false }),
|
|
36
|
+
__metadata("design:type", String)
|
|
37
|
+
], Posts.prototype, "title", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: false }),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], Posts.prototype, "content", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
44
|
+
__metadata("design:type", Number)
|
|
45
|
+
], Posts.prototype, "user_id", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
48
|
+
__metadata("design:type", Number)
|
|
49
|
+
], Posts.prototype, "department_id", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
52
|
+
__metadata("design:type", Number)
|
|
53
|
+
], Posts.prototype, "category_id", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, typeorm_1.Column)({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' }),
|
|
56
|
+
__metadata("design:type", Date)
|
|
57
|
+
], Posts.prototype, "created_at", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, typeorm_1.Column)({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' }),
|
|
60
|
+
__metadata("design:type", Date)
|
|
61
|
+
], Posts.prototype, "updated_at", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, typeorm_1.Column)({ type: 'boolean', default: false }),
|
|
64
|
+
__metadata("design:type", Boolean)
|
|
65
|
+
], Posts.prototype, "is_bookmarked", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, typeorm_1.ManyToOne)(() => user_1.User, user => user.id),
|
|
68
|
+
(0, typeorm_1.JoinColumn)({ name: 'user_id' }),
|
|
69
|
+
__metadata("design:type", user_1.User)
|
|
70
|
+
], Posts.prototype, "user", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, typeorm_1.ManyToOne)(() => DepartmentsModel_1.Departments, department => department.id),
|
|
73
|
+
(0, typeorm_1.JoinColumn)({ name: 'department_id' }),
|
|
74
|
+
__metadata("design:type", DepartmentsModel_1.Departments)
|
|
75
|
+
], Posts.prototype, "department", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, typeorm_1.ManyToOne)(() => CategoriesModel_1.Categories, category => category.id),
|
|
78
|
+
(0, typeorm_1.JoinColumn)({ name: 'category_id' }),
|
|
79
|
+
__metadata("design:type", CategoriesModel_1.Categories)
|
|
80
|
+
], Posts.prototype, "category", void 0);
|
|
81
|
+
__decorate([
|
|
82
|
+
(0, typeorm_1.OneToMany)(() => CommentsModel_1.Comments, comment => comment.post),
|
|
83
|
+
__metadata("design:type", Array)
|
|
84
|
+
], Posts.prototype, "comments", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
(0, typeorm_1.OneToMany)(() => PostAttachmentsModel_1.PostAttachments, attachment => attachment.post),
|
|
87
|
+
__metadata("design:type", Array)
|
|
88
|
+
], Posts.prototype, "attachments", void 0);
|
|
89
|
+
exports.Posts = Posts = __decorate([
|
|
90
|
+
(0, typeorm_1.Entity)({ name: 'posts' }),
|
|
91
|
+
__metadata("design:paramtypes", [])
|
|
92
|
+
], Posts);
|
package/package.json
CHANGED
package/src/data-source.ts
CHANGED
|
@@ -32,6 +32,13 @@ import { FMServices } from './models/FMServices';
|
|
|
32
32
|
import { FMSubServices } from './models/FMSubservices';
|
|
33
33
|
import { ServiceBookmarks } from './models/serviceBookmarksModel';
|
|
34
34
|
import { Feedback } from './models/feedbackModel';
|
|
35
|
+
import { Categories } from './models/CategoriesModel';
|
|
36
|
+
import { Posts } from './models/PostsModel';
|
|
37
|
+
import { Comments } from './models/CommentsModel';
|
|
38
|
+
import { PostAttachments } from './models/PostAttachmentsModel';
|
|
39
|
+
import { PostReactions } from './models/PostReactionsModel';
|
|
40
|
+
|
|
41
|
+
|
|
35
42
|
import { HelpContent } from './models/HelpContentModel';
|
|
36
43
|
import { HelpContentCategories } from './models/HelpContentCategoryModel';
|
|
37
44
|
import { HelpContentAttachments } from './models/HelpContentAttachmentModel';
|
|
@@ -75,6 +82,11 @@ export const AppDataSource = new DataSource({
|
|
|
75
82
|
FMSubServices,
|
|
76
83
|
ServiceBookmarks,
|
|
77
84
|
Feedback,
|
|
85
|
+
Categories,
|
|
86
|
+
Posts,
|
|
87
|
+
Comments,
|
|
88
|
+
PostAttachments,
|
|
89
|
+
PostReactions,
|
|
78
90
|
HelpContent,
|
|
79
91
|
HelpContentCategories,
|
|
80
92
|
HelpContentAttachments
|
package/src/index.ts
CHANGED
|
@@ -26,6 +26,11 @@ export * from './models/FMServices';
|
|
|
26
26
|
export * from './models/FMSubservices';
|
|
27
27
|
export * from './models/serviceBookmarksModel';
|
|
28
28
|
export * from './models/feedbackModel';
|
|
29
|
+
export * from './models/CategoriesModel';
|
|
30
|
+
export * from './models/PostsModel';
|
|
31
|
+
export * from './models/CommentsModel';
|
|
32
|
+
export * from './models/PostAttachmentsModel';
|
|
33
|
+
export * from './models/PostReactionsModel';
|
|
29
34
|
export * from './models/HelpContentModel';
|
|
30
35
|
export * from './models/HelpContentCategoryModel';
|
|
31
36
|
export * from './models/HelpContentAttachmentModel';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Column, Entity } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
|
|
4
|
+
@Entity({ name: 'categories' })
|
|
5
|
+
export class Categories extends BaseModel {
|
|
6
|
+
|
|
7
|
+
@Column({ type: 'varchar', length: 150, nullable: false, unique: true })
|
|
8
|
+
name: string;
|
|
9
|
+
|
|
10
|
+
@Column({ type: 'text', nullable: true })
|
|
11
|
+
description?: string;
|
|
12
|
+
|
|
13
|
+
constructor() {
|
|
14
|
+
super();
|
|
15
|
+
this.name = '';
|
|
16
|
+
this.description = '';
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Column, Entity, ManyToOne, JoinColumn, OneToMany } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
import { Posts } from './PostsModel';
|
|
4
|
+
import { User } from './user';
|
|
5
|
+
|
|
6
|
+
@Entity({ name: 'comments' })
|
|
7
|
+
export class Comments extends BaseModel {
|
|
8
|
+
|
|
9
|
+
@Column({ type: 'int', nullable: false })
|
|
10
|
+
post_id: number;
|
|
11
|
+
|
|
12
|
+
@Column({ type: 'int', nullable: false })
|
|
13
|
+
user_id: number;
|
|
14
|
+
|
|
15
|
+
@Column({ type: 'int', nullable: true })
|
|
16
|
+
reply_to_comment_id?: number;
|
|
17
|
+
|
|
18
|
+
@Column({ type: 'text', nullable: false })
|
|
19
|
+
content: string;
|
|
20
|
+
|
|
21
|
+
@Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })
|
|
22
|
+
created_at: Date;
|
|
23
|
+
|
|
24
|
+
@Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })
|
|
25
|
+
updated_at: Date;
|
|
26
|
+
|
|
27
|
+
// Relations
|
|
28
|
+
@ManyToOne(() => Posts, post => post.id)
|
|
29
|
+
@JoinColumn({ name: 'post_id' })
|
|
30
|
+
post?: Posts;
|
|
31
|
+
|
|
32
|
+
@ManyToOne(() => User, user => user.id)
|
|
33
|
+
@JoinColumn({ name: 'user_id' })
|
|
34
|
+
user?: User;
|
|
35
|
+
|
|
36
|
+
@ManyToOne(() => Comments, comment => comment.id)
|
|
37
|
+
@JoinColumn({ name: 'reply_to_comment_id' })
|
|
38
|
+
replyToComment?: Comments;
|
|
39
|
+
|
|
40
|
+
@OneToMany(() => Comments, comment => comment.replyToComment)
|
|
41
|
+
replies?: Comments[];
|
|
42
|
+
|
|
43
|
+
constructor() {
|
|
44
|
+
super();
|
|
45
|
+
this.post_id = 0;
|
|
46
|
+
this.user_id = 0;
|
|
47
|
+
this.reply_to_comment_id = 0;
|
|
48
|
+
this.content = '';
|
|
49
|
+
this.created_at = new Date();
|
|
50
|
+
this.updated_at = new Date();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -12,9 +12,6 @@ export class ConversationParticipant extends BaseModel {
|
|
|
12
12
|
@Column({ type: 'int' })
|
|
13
13
|
userId: number;
|
|
14
14
|
|
|
15
|
-
@Column({ type: 'int' })
|
|
16
|
-
roleId: number;
|
|
17
|
-
|
|
18
15
|
@Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })
|
|
19
16
|
joinedAt: Date;
|
|
20
17
|
|
|
@@ -38,7 +35,6 @@ export class ConversationParticipant extends BaseModel {
|
|
|
38
35
|
constructor(
|
|
39
36
|
conversationId?: number,
|
|
40
37
|
userId?: number,
|
|
41
|
-
roleId?: number,
|
|
42
38
|
joinedAt?: Date,
|
|
43
39
|
lastReadAt?: Date,
|
|
44
40
|
createdAt?: Date,
|
|
@@ -47,7 +43,6 @@ export class ConversationParticipant extends BaseModel {
|
|
|
47
43
|
super();
|
|
48
44
|
this.conversationId = conversationId || 0;
|
|
49
45
|
this.userId = userId || 0;
|
|
50
|
-
this.roleId = roleId || 0;
|
|
51
46
|
this.joinedAt = joinedAt || new Date();
|
|
52
47
|
this.lastReadAt = lastReadAt;
|
|
53
48
|
this.createdAt = createdAt || new Date();
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Column, Entity, ManyToOne, JoinColumn } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
import { Posts } from './PostsModel';
|
|
4
|
+
|
|
5
|
+
@Entity({ name: 'post_attachments' })
|
|
6
|
+
export class PostAttachments extends BaseModel {
|
|
7
|
+
|
|
8
|
+
@Column({ type: 'int', nullable: false })
|
|
9
|
+
post_id: number;
|
|
10
|
+
|
|
11
|
+
@Column({ type: 'text', nullable: false })
|
|
12
|
+
file_url: string;
|
|
13
|
+
|
|
14
|
+
@Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })
|
|
15
|
+
uploaded_at: Date;
|
|
16
|
+
|
|
17
|
+
// Relations
|
|
18
|
+
@ManyToOne(() => Posts, post => post.id)
|
|
19
|
+
@JoinColumn({ name: 'post_id' })
|
|
20
|
+
post?: Posts;
|
|
21
|
+
|
|
22
|
+
constructor() {
|
|
23
|
+
super();
|
|
24
|
+
this.post_id = 0;
|
|
25
|
+
this.file_url = '';
|
|
26
|
+
this.uploaded_at = new Date();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { Column, Entity, ManyToOne, JoinColumn } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
import { Posts } from './PostsModel';
|
|
4
|
+
import { Comments } from './CommentsModel';
|
|
5
|
+
import { User } from './user';
|
|
6
|
+
|
|
7
|
+
@Entity({ name: 'post_reactions' })
|
|
8
|
+
export class PostReactions extends BaseModel {
|
|
9
|
+
|
|
10
|
+
@Column({ type: 'int', nullable: true })
|
|
11
|
+
post_id?: number;
|
|
12
|
+
|
|
13
|
+
@Column({ type: 'int', nullable: true })
|
|
14
|
+
comment_id?: number;
|
|
15
|
+
|
|
16
|
+
@Column({ type: 'int', nullable: false })
|
|
17
|
+
user_id: number;
|
|
18
|
+
|
|
19
|
+
@Column({ type: 'varchar', length: 50, nullable: false })
|
|
20
|
+
reaction_type: string;
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
@Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })
|
|
24
|
+
created_at: Date;
|
|
25
|
+
|
|
26
|
+
// Relations
|
|
27
|
+
@ManyToOne(() => Posts, post => post.id)
|
|
28
|
+
@JoinColumn({ name: 'post_id' })
|
|
29
|
+
post?: Posts;
|
|
30
|
+
|
|
31
|
+
@ManyToOne(() => Comments, comment => comment.id)
|
|
32
|
+
@JoinColumn({ name: 'comment_id' })
|
|
33
|
+
comment?: Comments;
|
|
34
|
+
|
|
35
|
+
@ManyToOne(() => User, user => user.id)
|
|
36
|
+
@JoinColumn({ name: 'user_id' })
|
|
37
|
+
user?: User;
|
|
38
|
+
|
|
39
|
+
constructor() {
|
|
40
|
+
super();
|
|
41
|
+
this.post_id = 0;
|
|
42
|
+
this.comment_id = 0;
|
|
43
|
+
this.user_id = 0;
|
|
44
|
+
this.reaction_type = '';
|
|
45
|
+
this.created_at = new Date();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { Column, Entity, ManyToOne, JoinColumn, OneToMany } from "typeorm";
|
|
2
|
+
import { BaseModel } from './BaseModel';
|
|
3
|
+
import { User } from './user';
|
|
4
|
+
import { Departments } from './DepartmentsModel';
|
|
5
|
+
import { Categories } from './CategoriesModel';
|
|
6
|
+
import { Comments } from './CommentsModel';
|
|
7
|
+
import { PostAttachments } from './PostAttachmentsModel';
|
|
8
|
+
|
|
9
|
+
@Entity({ name: 'posts' })
|
|
10
|
+
export class Posts extends BaseModel {
|
|
11
|
+
|
|
12
|
+
@Column({ type: 'varchar', length: 255, nullable: false })
|
|
13
|
+
title: string;
|
|
14
|
+
|
|
15
|
+
@Column({ type: 'text', nullable: false })
|
|
16
|
+
content: string;
|
|
17
|
+
|
|
18
|
+
@Column({ type: 'int', nullable: true })
|
|
19
|
+
user_id?: number;
|
|
20
|
+
|
|
21
|
+
@Column({ type: 'int', nullable: true })
|
|
22
|
+
department_id?: number;
|
|
23
|
+
|
|
24
|
+
@Column({ type: 'int', nullable: true })
|
|
25
|
+
category_id?: number;
|
|
26
|
+
|
|
27
|
+
@Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })
|
|
28
|
+
created_at: Date;
|
|
29
|
+
|
|
30
|
+
@Column({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' })
|
|
31
|
+
updated_at: Date;
|
|
32
|
+
|
|
33
|
+
@Column({ type: 'boolean', default: false })
|
|
34
|
+
is_bookmarked: boolean;
|
|
35
|
+
|
|
36
|
+
// Relations
|
|
37
|
+
@ManyToOne(() => User, user => user.id)
|
|
38
|
+
@JoinColumn({ name: 'user_id' })
|
|
39
|
+
user?: User;
|
|
40
|
+
|
|
41
|
+
@ManyToOne(() => Departments, department => department.id)
|
|
42
|
+
@JoinColumn({ name: 'department_id' })
|
|
43
|
+
department?: Departments;
|
|
44
|
+
|
|
45
|
+
@ManyToOne(() => Categories, category => category.id)
|
|
46
|
+
@JoinColumn({ name: 'category_id' })
|
|
47
|
+
category?: Categories;
|
|
48
|
+
|
|
49
|
+
@OneToMany(() => Comments, comment => comment.post)
|
|
50
|
+
comments?: Comments[];
|
|
51
|
+
|
|
52
|
+
@OneToMany(() => PostAttachments, attachment => attachment.post)
|
|
53
|
+
attachments?: PostAttachments[];
|
|
54
|
+
|
|
55
|
+
constructor() {
|
|
56
|
+
super();
|
|
57
|
+
this.title = '';
|
|
58
|
+
this.content = '';
|
|
59
|
+
this.user_id = 0;
|
|
60
|
+
this.department_id = 0;
|
|
61
|
+
this.category_id = 0;
|
|
62
|
+
this.created_at = new Date();
|
|
63
|
+
this.updated_at = new Date();
|
|
64
|
+
this.is_bookmarked = false;
|
|
65
|
+
}
|
|
66
|
+
}
|