@platform-modules/foreign-ministry 1.0.41 → 1.0.43
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 +12 -10
- package/dist/index.d.ts +6 -5
- package/dist/index.js +6 -5
- package/dist/models/CategoriesModel.d.ts +6 -0
- package/dist/models/{HelpContentTagsModel.js → CategoriesModel.js} +16 -11
- package/dist/models/CommentsModel.d.ts +16 -0
- package/dist/models/CommentsModel.js +75 -0
- 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 +21 -0
- package/dist/models/PostsModel.js +87 -0
- package/dist/models/faqsModel.d.ts +4 -1
- package/dist/models/faqsModel.js +16 -3
- package/package.json +1 -1
- package/src/data-source.ts +14 -10
- package/src/index.ts +6 -5
- package/src/models/CategoriesModel.ts +18 -0
- package/src/models/CommentsModel.ts +52 -0
- package/src/models/PostAttachmentsModel.ts +28 -0
- package/src/models/PostReactionsModel.ts +47 -0
- package/src/models/PostsModel.ts +62 -0
- package/src/models/faqsModel.ts +13 -3
- package/src/models/questionTagsModel.ts +22 -0
- package/dist/models/HelpContentAttachmentModel.d.ts +0 -7
- package/dist/models/HelpContentAttachmentModel.js +0 -39
- package/dist/models/HelpContentCategoryModel.d.ts +0 -5
- package/dist/models/HelpContentCategoryModel.js +0 -29
- package/dist/models/HelpContentMappedCategoriesModel.d.ts +0 -6
- package/dist/models/HelpContentMappedCategoriesModel.js +0 -34
- package/dist/models/HelpContentMappedTagsModel.d.ts +0 -6
- package/dist/models/HelpContentMappedTagsModel.js +0 -34
- package/dist/models/HelpContentModel.d.ts +0 -10
- package/dist/models/HelpContentModel.js +0 -54
- package/dist/models/HelpContentTagsModel.d.ts +0 -5
- package/src/models/HelpContentAttachmentModel.ts +0 -27
- package/src/models/HelpContentCategoryModel.ts +0 -17
- package/src/models/HelpContentMappedTagsModel.ts +0 -22
- package/src/models/HelpContentModel.ts +0 -42
- package/src/models/HelpContentTagsModel.ts +0 -17
package/.env
CHANGED
package/dist/data-source.js
CHANGED
|
@@ -25,6 +25,7 @@ const DesignationModel_1 = require("./models/DesignationModel");
|
|
|
25
25
|
const DepartmentsModel_1 = require("./models/DepartmentsModel");
|
|
26
26
|
const DivisionModel_1 = require("./models/DivisionModel");
|
|
27
27
|
const faqsModel_1 = require("./models/faqsModel");
|
|
28
|
+
const questionTagsModel_1 = require("./models/questionTagsModel");
|
|
28
29
|
const ConversationModel_1 = require("./models/ConversationModel");
|
|
29
30
|
const ConversationParticipantModel_1 = require("./models/ConversationParticipantModel");
|
|
30
31
|
const MessageModel_1 = require("./models/MessageModel");
|
|
@@ -32,11 +33,11 @@ const FMServices_1 = require("./models/FMServices");
|
|
|
32
33
|
const FMSubservices_1 = require("./models/FMSubservices");
|
|
33
34
|
const serviceBookmarksModel_1 = require("./models/serviceBookmarksModel");
|
|
34
35
|
const feedbackModel_1 = require("./models/feedbackModel");
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
const
|
|
39
|
-
const
|
|
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");
|
|
40
41
|
exports.AppDataSource = new typeorm_1.DataSource({
|
|
41
42
|
type: 'postgres',
|
|
42
43
|
host: process.env.DB_HOST || 'localhost',
|
|
@@ -67,6 +68,7 @@ exports.AppDataSource = new typeorm_1.DataSource({
|
|
|
67
68
|
DepartmentsModel_1.Departments,
|
|
68
69
|
DivisionModel_1.Division,
|
|
69
70
|
faqsModel_1.Faqs,
|
|
71
|
+
questionTagsModel_1.QuestionTags,
|
|
70
72
|
ConversationModel_1.Conversation,
|
|
71
73
|
ConversationParticipantModel_1.ConversationParticipant,
|
|
72
74
|
MessageModel_1.Message,
|
|
@@ -74,10 +76,10 @@ exports.AppDataSource = new typeorm_1.DataSource({
|
|
|
74
76
|
FMSubservices_1.FMSubServices,
|
|
75
77
|
serviceBookmarksModel_1.ServiceBookmarks,
|
|
76
78
|
feedbackModel_1.Feedback,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
79
|
+
CategoriesModel_1.Categories,
|
|
80
|
+
PostsModel_1.Posts,
|
|
81
|
+
CommentsModel_1.Comments,
|
|
82
|
+
PostAttachmentsModel_1.PostAttachments,
|
|
83
|
+
PostReactionsModel_1.PostReactions
|
|
82
84
|
],
|
|
83
85
|
});
|
package/dist/index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export * from './models/DesignationModel';
|
|
|
18
18
|
export * from './models/DepartmentsModel';
|
|
19
19
|
export * from './models/DivisionModel';
|
|
20
20
|
export * from './models/faqsModel';
|
|
21
|
+
export * from './models/questionTagsModel';
|
|
21
22
|
export * from './models/ConversationModel';
|
|
22
23
|
export * from './models/ConversationParticipantModel';
|
|
23
24
|
export * from './models/MessageModel';
|
|
@@ -25,8 +26,8 @@ export * from './models/FMServices';
|
|
|
25
26
|
export * from './models/FMSubservices';
|
|
26
27
|
export * from './models/serviceBookmarksModel';
|
|
27
28
|
export * from './models/feedbackModel';
|
|
28
|
-
export * from './models/
|
|
29
|
-
export * from './models/
|
|
30
|
-
export * from './models/
|
|
31
|
-
export * from './models/
|
|
32
|
-
export * from './models/
|
|
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';
|
package/dist/index.js
CHANGED
|
@@ -34,6 +34,7 @@ __exportStar(require("./models/DesignationModel"), exports);
|
|
|
34
34
|
__exportStar(require("./models/DepartmentsModel"), exports);
|
|
35
35
|
__exportStar(require("./models/DivisionModel"), exports);
|
|
36
36
|
__exportStar(require("./models/faqsModel"), exports);
|
|
37
|
+
__exportStar(require("./models/questionTagsModel"), exports);
|
|
37
38
|
__exportStar(require("./models/ConversationModel"), exports);
|
|
38
39
|
__exportStar(require("./models/ConversationParticipantModel"), exports);
|
|
39
40
|
__exportStar(require("./models/MessageModel"), exports);
|
|
@@ -41,8 +42,8 @@ __exportStar(require("./models/FMServices"), exports);
|
|
|
41
42
|
__exportStar(require("./models/FMSubservices"), exports);
|
|
42
43
|
__exportStar(require("./models/serviceBookmarksModel"), exports);
|
|
43
44
|
__exportStar(require("./models/feedbackModel"), exports);
|
|
44
|
-
__exportStar(require("./models/
|
|
45
|
-
__exportStar(require("./models/
|
|
46
|
-
__exportStar(require("./models/
|
|
47
|
-
__exportStar(require("./models/
|
|
48
|
-
__exportStar(require("./models/
|
|
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);
|
|
@@ -9,21 +9,26 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.Categories = void 0;
|
|
13
13
|
const typeorm_1 = require("typeorm");
|
|
14
14
|
const BaseModel_1 = require("./BaseModel");
|
|
15
|
-
let
|
|
16
|
-
constructor(
|
|
15
|
+
let Categories = class Categories extends BaseModel_1.BaseModel {
|
|
16
|
+
constructor() {
|
|
17
17
|
super();
|
|
18
|
-
this.name =
|
|
18
|
+
this.name = '';
|
|
19
|
+
this.description = '';
|
|
19
20
|
}
|
|
20
21
|
};
|
|
21
|
-
exports.
|
|
22
|
+
exports.Categories = Categories;
|
|
22
23
|
__decorate([
|
|
23
|
-
(0, typeorm_1.Column)({ nullable: true }),
|
|
24
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 150, nullable: false, unique: true }),
|
|
24
25
|
__metadata("design:type", String)
|
|
25
|
-
],
|
|
26
|
-
|
|
27
|
-
(0, typeorm_1.
|
|
28
|
-
__metadata("design:
|
|
29
|
-
],
|
|
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
|
+
parent_comment_id?: number;
|
|
8
|
+
content: string;
|
|
9
|
+
created_at: Date;
|
|
10
|
+
updated_at: Date;
|
|
11
|
+
post?: Posts;
|
|
12
|
+
user?: User;
|
|
13
|
+
parentComment?: 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.parent_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, "parent_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: 'parent_comment_id' }),
|
|
66
|
+
__metadata("design:type", Comments)
|
|
67
|
+
], Comments.prototype, "parentComment", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, typeorm_1.OneToMany)(() => Comments, comment => comment.parentComment),
|
|
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);
|
|
@@ -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,21 @@
|
|
|
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
|
+
user?: User;
|
|
16
|
+
department?: Departments;
|
|
17
|
+
category?: Categories;
|
|
18
|
+
comments?: Comments[];
|
|
19
|
+
attachments?: PostAttachments[];
|
|
20
|
+
constructor();
|
|
21
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
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
|
+
}
|
|
31
|
+
};
|
|
32
|
+
exports.Posts = Posts;
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: false }),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], Posts.prototype, "title", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: false }),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], Posts.prototype, "content", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
43
|
+
__metadata("design:type", Number)
|
|
44
|
+
], Posts.prototype, "user_id", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
47
|
+
__metadata("design:type", Number)
|
|
48
|
+
], Posts.prototype, "department_id", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, typeorm_1.Column)({ type: 'int', nullable: true }),
|
|
51
|
+
__metadata("design:type", Number)
|
|
52
|
+
], Posts.prototype, "category_id", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, typeorm_1.Column)({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' }),
|
|
55
|
+
__metadata("design:type", Date)
|
|
56
|
+
], Posts.prototype, "created_at", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, typeorm_1.Column)({ type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' }),
|
|
59
|
+
__metadata("design:type", Date)
|
|
60
|
+
], Posts.prototype, "updated_at", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, typeorm_1.ManyToOne)(() => user_1.User, user => user.id),
|
|
63
|
+
(0, typeorm_1.JoinColumn)({ name: 'user_id' }),
|
|
64
|
+
__metadata("design:type", user_1.User)
|
|
65
|
+
], Posts.prototype, "user", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, typeorm_1.ManyToOne)(() => DepartmentsModel_1.Departments, department => department.id),
|
|
68
|
+
(0, typeorm_1.JoinColumn)({ name: 'department_id' }),
|
|
69
|
+
__metadata("design:type", DepartmentsModel_1.Departments)
|
|
70
|
+
], Posts.prototype, "department", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
(0, typeorm_1.ManyToOne)(() => CategoriesModel_1.Categories, category => category.id),
|
|
73
|
+
(0, typeorm_1.JoinColumn)({ name: 'category_id' }),
|
|
74
|
+
__metadata("design:type", CategoriesModel_1.Categories)
|
|
75
|
+
], Posts.prototype, "category", void 0);
|
|
76
|
+
__decorate([
|
|
77
|
+
(0, typeorm_1.OneToMany)(() => CommentsModel_1.Comments, comment => comment.post),
|
|
78
|
+
__metadata("design:type", Array)
|
|
79
|
+
], Posts.prototype, "comments", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
(0, typeorm_1.OneToMany)(() => PostAttachmentsModel_1.PostAttachments, attachment => attachment.post),
|
|
82
|
+
__metadata("design:type", Array)
|
|
83
|
+
], Posts.prototype, "attachments", void 0);
|
|
84
|
+
exports.Posts = Posts = __decorate([
|
|
85
|
+
(0, typeorm_1.Entity)({ name: 'posts' }),
|
|
86
|
+
__metadata("design:paramtypes", [])
|
|
87
|
+
], Posts);
|
|
@@ -4,5 +4,8 @@ export declare class Faqs extends BaseModel {
|
|
|
4
4
|
answer: string;
|
|
5
5
|
category_Id: number;
|
|
6
6
|
sub_category_Id: number;
|
|
7
|
-
|
|
7
|
+
department_Id: number;
|
|
8
|
+
like_count: number;
|
|
9
|
+
dislike_count: number;
|
|
10
|
+
constructor(question: string, answer: string, category_Id: number, sub_category_Id: number, department_Id: number);
|
|
8
11
|
}
|
package/dist/models/faqsModel.js
CHANGED
|
@@ -13,12 +13,13 @@ exports.Faqs = void 0;
|
|
|
13
13
|
const typeorm_1 = require("typeorm");
|
|
14
14
|
const BaseModel_1 = require("./BaseModel");
|
|
15
15
|
let Faqs = class Faqs extends BaseModel_1.BaseModel {
|
|
16
|
-
constructor(question, answer, category_Id, sub_category_Id) {
|
|
16
|
+
constructor(question, answer, category_Id, sub_category_Id, department_Id) {
|
|
17
17
|
super();
|
|
18
18
|
this.question = question,
|
|
19
19
|
this.answer = answer,
|
|
20
20
|
this.category_Id = category_Id,
|
|
21
|
-
this.sub_category_Id = sub_category_Id
|
|
21
|
+
this.sub_category_Id = sub_category_Id,
|
|
22
|
+
this.department_Id = department_Id;
|
|
22
23
|
}
|
|
23
24
|
};
|
|
24
25
|
exports.Faqs = Faqs;
|
|
@@ -38,7 +39,19 @@ __decorate([
|
|
|
38
39
|
(0, typeorm_1.Column)({ nullable: true }),
|
|
39
40
|
__metadata("design:type", Number)
|
|
40
41
|
], Faqs.prototype, "sub_category_Id", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
44
|
+
__metadata("design:type", Number)
|
|
45
|
+
], Faqs.prototype, "department_Id", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
(0, typeorm_1.Column)({ nullable: true, default: 0 }),
|
|
48
|
+
__metadata("design:type", Number)
|
|
49
|
+
], Faqs.prototype, "like_count", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
(0, typeorm_1.Column)({ nullable: true, default: 0 }),
|
|
52
|
+
__metadata("design:type", Number)
|
|
53
|
+
], Faqs.prototype, "dislike_count", void 0);
|
|
41
54
|
exports.Faqs = Faqs = __decorate([
|
|
42
55
|
(0, typeorm_1.Entity)({ name: 'faqs' }),
|
|
43
|
-
__metadata("design:paramtypes", [String, String, Number, Number])
|
|
56
|
+
__metadata("design:paramtypes", [String, String, Number, Number, Number])
|
|
44
57
|
], Faqs);
|
package/package.json
CHANGED
package/src/data-source.ts
CHANGED
|
@@ -24,6 +24,7 @@ import { Division } from './models/DivisionModel';
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
import { Faqs } from './models/faqsModel';
|
|
27
|
+
import { QuestionTags } from './models/questionTagsModel';
|
|
27
28
|
import { Conversation } from './models/ConversationModel';
|
|
28
29
|
import { ConversationParticipant } from './models/ConversationParticipantModel';
|
|
29
30
|
import { Message } from './models/MessageModel';
|
|
@@ -31,11 +32,13 @@ import { FMServices } from './models/FMServices';
|
|
|
31
32
|
import { FMSubServices } from './models/FMSubservices';
|
|
32
33
|
import { ServiceBookmarks } from './models/serviceBookmarksModel';
|
|
33
34
|
import { Feedback } from './models/feedbackModel';
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
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
|
+
|
|
39
42
|
|
|
40
43
|
|
|
41
44
|
export const AppDataSource = new DataSource({
|
|
@@ -68,6 +71,7 @@ export const AppDataSource = new DataSource({
|
|
|
68
71
|
Departments,
|
|
69
72
|
Division,
|
|
70
73
|
Faqs,
|
|
74
|
+
QuestionTags,
|
|
71
75
|
Conversation,
|
|
72
76
|
ConversationParticipant,
|
|
73
77
|
Message,
|
|
@@ -75,10 +79,10 @@ export const AppDataSource = new DataSource({
|
|
|
75
79
|
FMSubServices,
|
|
76
80
|
ServiceBookmarks,
|
|
77
81
|
Feedback,
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
82
|
+
Categories,
|
|
83
|
+
Posts,
|
|
84
|
+
Comments,
|
|
85
|
+
PostAttachments,
|
|
86
|
+
PostReactions
|
|
83
87
|
],
|
|
84
88
|
});
|
package/src/index.ts
CHANGED
|
@@ -18,6 +18,7 @@ export * from './models/DesignationModel';
|
|
|
18
18
|
export * from './models/DepartmentsModel';
|
|
19
19
|
export * from './models/DivisionModel';
|
|
20
20
|
export * from './models/faqsModel';
|
|
21
|
+
export * from './models/questionTagsModel';
|
|
21
22
|
export * from './models/ConversationModel';
|
|
22
23
|
export * from './models/ConversationParticipantModel';
|
|
23
24
|
export * from './models/MessageModel';
|
|
@@ -25,8 +26,8 @@ export * from './models/FMServices';
|
|
|
25
26
|
export * from './models/FMSubservices';
|
|
26
27
|
export * from './models/serviceBookmarksModel';
|
|
27
28
|
export * from './models/feedbackModel';
|
|
28
|
-
export * from './models/
|
|
29
|
-
export * from './models/
|
|
30
|
-
export * from './models/
|
|
31
|
-
export * from './models/
|
|
32
|
-
export * from './models/
|
|
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';
|
|
@@ -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
|
+
}
|