@aurispec/core-backend 1.0.30 → 1.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/common/enums/ArticleEnum.d.ts +5 -0
- package/dist/common/enums/ArticleEnum.d.ts.map +1 -1
- package/dist/common/enums/ArticleEnum.js +7 -1
- package/dist/common/enums/index.d.ts +2 -0
- package/dist/common/enums/index.d.ts.map +1 -1
- package/dist/common/enums/index.js +2 -0
- package/dist/database/migrations/1775138300445-modified_articles_table.d.ts +7 -0
- package/dist/database/migrations/1775138300445-modified_articles_table.d.ts.map +1 -0
- package/dist/database/migrations/1775138300445-modified_articles_table.js +15 -0
- package/dist/database/migrations/1775153966683-modified_articles_table.d.ts +7 -0
- package/dist/database/migrations/1775153966683-modified_articles_table.d.ts.map +1 -0
- package/dist/database/migrations/1775153966683-modified_articles_table.js +13 -0
- package/dist/models/AdminUserModel.d.ts +2 -0
- package/dist/models/AdminUserModel.d.ts.map +1 -1
- package/dist/models/AdminUserModel.js +9 -0
- package/dist/models/ArticleModel.d.ts +4 -1
- package/dist/models/ArticleModel.d.ts.map +1 -1
- package/dist/models/ArticleModel.js +17 -1
- package/dist/models/UserModel.d.ts +2 -0
- package/dist/models/UserModel.d.ts.map +1 -1
- package/dist/models/UserModel.js +9 -0
- package/package.json +1 -1
|
@@ -4,6 +4,11 @@ export declare enum ArticleVisibility {
|
|
|
4
4
|
DRAFT = "DRAFT",
|
|
5
5
|
BANNED = "BANNED"
|
|
6
6
|
}
|
|
7
|
+
export declare enum ArticleStatus {
|
|
8
|
+
ACTIVE = "ACTIVE",
|
|
9
|
+
PENDING = "PENDING",
|
|
10
|
+
BANNED = "BANNED"
|
|
11
|
+
}
|
|
7
12
|
export declare enum ArticleContentType {
|
|
8
13
|
ARTICLE = "ARTICLE",
|
|
9
14
|
OUTLOOK = "OUTLOOK"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArticleEnum.d.ts","sourceRoot":"","sources":["../../../src/common/enums/ArticleEnum.ts"],"names":[],"mappings":"AAAA,oBAAY,iBAAiB;IACzB,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,MAAM,WAAW;CACpB;AAED,oBAAY,kBAAkB;IAC1B,OAAO,YAAY;IACnB,OAAO,YAAY;CACtB"}
|
|
1
|
+
{"version":3,"file":"ArticleEnum.d.ts","sourceRoot":"","sources":["../../../src/common/enums/ArticleEnum.ts"],"names":[],"mappings":"AAAA,oBAAY,iBAAiB;IACzB,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,MAAM,WAAW;CACpB;AAED,oBAAY,aAAa;IACrB,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,MAAM,WAAW;CACpB;AAED,oBAAY,kBAAkB;IAC1B,OAAO,YAAY;IACnB,OAAO,YAAY;CACtB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ArticleContentType = exports.ArticleVisibility = void 0;
|
|
3
|
+
exports.ArticleContentType = exports.ArticleStatus = exports.ArticleVisibility = void 0;
|
|
4
4
|
var ArticleVisibility;
|
|
5
5
|
(function (ArticleVisibility) {
|
|
6
6
|
ArticleVisibility["PUBLIC"] = "PUBLIC";
|
|
@@ -8,6 +8,12 @@ var ArticleVisibility;
|
|
|
8
8
|
ArticleVisibility["DRAFT"] = "DRAFT";
|
|
9
9
|
ArticleVisibility["BANNED"] = "BANNED";
|
|
10
10
|
})(ArticleVisibility || (exports.ArticleVisibility = ArticleVisibility = {}));
|
|
11
|
+
var ArticleStatus;
|
|
12
|
+
(function (ArticleStatus) {
|
|
13
|
+
ArticleStatus["ACTIVE"] = "ACTIVE";
|
|
14
|
+
ArticleStatus["PENDING"] = "PENDING";
|
|
15
|
+
ArticleStatus["BANNED"] = "BANNED";
|
|
16
|
+
})(ArticleStatus || (exports.ArticleStatus = ArticleStatus = {}));
|
|
11
17
|
var ArticleContentType;
|
|
12
18
|
(function (ArticleContentType) {
|
|
13
19
|
ArticleContentType["ARTICLE"] = "ARTICLE";
|
|
@@ -15,6 +15,8 @@ export declare enum SYS_MODELS {
|
|
|
15
15
|
CONNECTION_MODEL = "ConnectionModel",
|
|
16
16
|
EVENT_MODEL = "EventModel",
|
|
17
17
|
BUSINESS_MODEL = "BusinessModel",
|
|
18
|
+
CATEGORY_MODEL = "CategoryModel",
|
|
19
|
+
OUTLOOK_MODEL = "OutlookModel",
|
|
18
20
|
PRODUCT_MODEL = "ProductModel",
|
|
19
21
|
CHAT_MESSAGE_MODEL = "ChatMessageModel",
|
|
20
22
|
SERVICE_PROVIDER_MODEL = "ServiceProviderModel"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/enums/index.ts"],"names":[],"mappings":"AAAC,oBAAY,MAAM;IACf,MAAM,WAAW;IACjB,QAAQ,aAAa;CACxB;AAED,oBAAY,mBAAmB;IAC3B,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,KAAK,UAAU;CAClB;AAED,oBAAY,UAAU;IAClB,UAAU,cAAc;IACxB,aAAa,iBAAiB;IAC9B,kBAAkB,iBAAiB;IACnC,qBAAqB,wBAAwB;IAC7C,gBAAgB,oBAAoB;IACpC,WAAW,eAAe;IAC1B,cAAc,kBAAkB;IAChC,aAAa,iBAAiB;IAC9B,kBAAkB,qBAAqB;IACvC,sBAAsB,yBAAyB;CAClD;AAEA,oBAAY,YAAY;IACrB,iBAAiB,sBAAsB;CAC1C;AAED,oBAAY,UAAU;IACpB,IAAI,SAAS;IACb,UAAU,eAAe;IACzB,IAAI,SAAS;IACb,QAAQ,aAAa;CACtB;AAED,oBAAY,gBAAgB;IAC1B,MAAM,WAAW;IACjB,MAAM,WAAW;CAClB;AAED,oBAAY,wBAAwB;IAChC,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,QAAQ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IAC1B,MAAM,WAAW;IACjB,MAAM,WAAW;CAClB;AAED,oBAAY,wBAAwB;IAChC,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,QAAQ,aAAa;CACxB;AAED,oBAAY,iBAAiB;IACzB,SAAS,cAAc;IACvB,UAAU,eAAe;IACzB,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,WAAW,gBAAgB;IAC3B,MAAM,WAAW;CACpB;AAED,oBAAY,aAAa;IACvB,WAAW,QAAQ;IACnB,cAAc,SAAS;IACvB,iBAAiB,UAAU;IAC3B,mBAAmB,UAAU;IAC7B,UAAU,YAAY;CACvB;AAED,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,kBAAkB,CAAA;AAChC,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AACjC,cAAc,oBAAoB,CAAA;AAClC,cAAc,mBAAmB,CAAA;AACjC,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA"}
|
|
@@ -35,6 +35,8 @@ var SYS_MODELS;
|
|
|
35
35
|
SYS_MODELS["CONNECTION_MODEL"] = "ConnectionModel";
|
|
36
36
|
SYS_MODELS["EVENT_MODEL"] = "EventModel";
|
|
37
37
|
SYS_MODELS["BUSINESS_MODEL"] = "BusinessModel";
|
|
38
|
+
SYS_MODELS["CATEGORY_MODEL"] = "CategoryModel";
|
|
39
|
+
SYS_MODELS["OUTLOOK_MODEL"] = "OutlookModel";
|
|
38
40
|
SYS_MODELS["PRODUCT_MODEL"] = "ProductModel";
|
|
39
41
|
SYS_MODELS["CHAT_MESSAGE_MODEL"] = "ChatMessageModel";
|
|
40
42
|
SYS_MODELS["SERVICE_PROVIDER_MODEL"] = "ServiceProviderModel";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from "typeorm";
|
|
2
|
+
export declare class ModifiedArticlesTable1775138300445 implements MigrationInterface {
|
|
3
|
+
name: string;
|
|
4
|
+
up(queryRunner: QueryRunner): Promise<void>;
|
|
5
|
+
down(queryRunner: QueryRunner): Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=1775138300445-modified_articles_table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1775138300445-modified_articles_table.d.ts","sourceRoot":"","sources":["../../../src/database/migrations/1775138300445-modified_articles_table.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE1D,qBAAa,kCAAmC,YAAW,kBAAkB;IACzE,IAAI,SAAuC;IAE9B,EAAE,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAK3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAK7D"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ModifiedArticlesTable1775138300445 = void 0;
|
|
4
|
+
class ModifiedArticlesTable1775138300445 {
|
|
5
|
+
name = 'ModifiedArticlesTable1775138300445';
|
|
6
|
+
async up(queryRunner) {
|
|
7
|
+
await queryRunner.query(`CREATE TYPE "public"."articles_status_enum" AS ENUM('ACTIVE', 'PENDING', 'BANNED')`);
|
|
8
|
+
await queryRunner.query(`ALTER TABLE "articles" ADD "status" "public"."articles_status_enum" NOT NULL DEFAULT 'PENDING'`);
|
|
9
|
+
}
|
|
10
|
+
async down(queryRunner) {
|
|
11
|
+
await queryRunner.query(`ALTER TABLE "articles" DROP COLUMN "status"`);
|
|
12
|
+
await queryRunner.query(`DROP TYPE "public"."articles_status_enum"`);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.ModifiedArticlesTable1775138300445 = ModifiedArticlesTable1775138300445;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from "typeorm";
|
|
2
|
+
export declare class ModifiedArticlesTable1775153966683 implements MigrationInterface {
|
|
3
|
+
name: string;
|
|
4
|
+
up(queryRunner: QueryRunner): Promise<void>;
|
|
5
|
+
down(queryRunner: QueryRunner): Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=1775153966683-modified_articles_table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1775153966683-modified_articles_table.d.ts","sourceRoot":"","sources":["../../../src/database/migrations/1775153966683-modified_articles_table.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE1D,qBAAa,kCAAmC,YAAW,kBAAkB;IACzE,IAAI,SAAuC;IAE9B,EAAE,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAI7D"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ModifiedArticlesTable1775153966683 = void 0;
|
|
4
|
+
class ModifiedArticlesTable1775153966683 {
|
|
5
|
+
name = 'ModifiedArticlesTable1775153966683';
|
|
6
|
+
async up(queryRunner) {
|
|
7
|
+
await queryRunner.query(`ALTER TABLE "articles" ADD CONSTRAINT "FK_87bb15395540ae06337a486a77a" FOREIGN KEY ("user_id") REFERENCES "admin_users"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
|
8
|
+
}
|
|
9
|
+
async down(queryRunner) {
|
|
10
|
+
await queryRunner.query(`ALTER TABLE "articles" DROP CONSTRAINT "FK_87bb15395540ae06337a486a77a"`);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
exports.ModifiedArticlesTable1775153966683 = ModifiedArticlesTable1775153966683;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BaseModel } from "./BaseModel";
|
|
2
2
|
import { UserRoles } from "../common/enums/UserEnums";
|
|
3
3
|
import { STATUS } from "../common/enums";
|
|
4
|
+
import { ArticleModel } from "./ArticleModel";
|
|
4
5
|
export declare class AdminUserModel extends BaseModel {
|
|
5
6
|
email: string;
|
|
6
7
|
first_name: string;
|
|
@@ -14,5 +15,6 @@ export declare class AdminUserModel extends BaseModel {
|
|
|
14
15
|
reset_token_expires_at?: Date | null;
|
|
15
16
|
status: STATUS;
|
|
16
17
|
role: UserRoles;
|
|
18
|
+
articles?: ArticleModel[];
|
|
17
19
|
}
|
|
18
20
|
//# sourceMappingURL=AdminUserModel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AdminUserModel.d.ts","sourceRoot":"","sources":["../../src/models/AdminUserModel.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"AdminUserModel.d.ts","sourceRoot":"","sources":["../../src/models/AdminUserModel.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,qBAEa,cAAe,SAAQ,SAAS;IAE3C,KAAK,EAAG,MAAM,CAAC;IAGf,UAAU,EAAG,MAAM,CAAC;IAGpB,SAAS,EAAG,MAAM,CAAC;IAGnB,aAAa,EAAG,MAAM,CAAC;IAGvB,UAAU,CAAC,EAAE,IAAI,CAAC;IAGlB,WAAW,EAAG,OAAO,CAAC;IAGtB,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAGnC,uBAAuB,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAGtC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAG5B,sBAAsB,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAOrC,MAAM,EAAG,MAAM,CAAC;IAOhB,IAAI,EAAG,SAAS,CAAC;IAUjB,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;CAC3B"}
|
|
@@ -15,6 +15,7 @@ const BaseModel_1 = require("./BaseModel");
|
|
|
15
15
|
const UserEnums_1 = require("../common/enums/UserEnums");
|
|
16
16
|
const enums_1 = require("../common/enums");
|
|
17
17
|
const typedi_1 = require("typedi");
|
|
18
|
+
const ArticleModel_1 = require("./ArticleModel");
|
|
18
19
|
let AdminUserModel = class AdminUserModel extends BaseModel_1.BaseModel {
|
|
19
20
|
email;
|
|
20
21
|
first_name;
|
|
@@ -28,6 +29,7 @@ let AdminUserModel = class AdminUserModel extends BaseModel_1.BaseModel {
|
|
|
28
29
|
reset_token_expires_at;
|
|
29
30
|
status;
|
|
30
31
|
role;
|
|
32
|
+
articles;
|
|
31
33
|
};
|
|
32
34
|
exports.AdminUserModel = AdminUserModel;
|
|
33
35
|
__decorate([
|
|
@@ -86,6 +88,13 @@ __decorate([
|
|
|
86
88
|
}),
|
|
87
89
|
__metadata("design:type", String)
|
|
88
90
|
], AdminUserModel.prototype, "role", void 0);
|
|
91
|
+
__decorate([
|
|
92
|
+
(0, typeorm_1.OneToMany)(() => ArticleModel_1.ArticleModel, (articles) => articles.admin, {
|
|
93
|
+
onDelete: "SET NULL",
|
|
94
|
+
onUpdate: "CASCADE",
|
|
95
|
+
}),
|
|
96
|
+
__metadata("design:type", Array)
|
|
97
|
+
], AdminUserModel.prototype, "articles", void 0);
|
|
89
98
|
exports.AdminUserModel = AdminUserModel = __decorate([
|
|
90
99
|
(0, typedi_1.Service)(),
|
|
91
100
|
(0, typeorm_1.Entity)({ name: "admin_users" })
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import { BaseModel } from "./BaseModel";
|
|
2
2
|
import { UserModel } from "./UserModel";
|
|
3
|
-
import { ArticleContentType, ArticleVisibility } from "../common/enums/ArticleEnum";
|
|
3
|
+
import { ArticleContentType, ArticleStatus, ArticleVisibility } from "../common/enums/ArticleEnum";
|
|
4
4
|
import { PostImageModel } from "./PostImageModel";
|
|
5
5
|
import { CommentModel } from "./CommentModel";
|
|
6
|
+
import { AdminUserModel } from "./AdminUserModel";
|
|
6
7
|
export declare class ArticleModel extends BaseModel {
|
|
7
8
|
user_id: number;
|
|
8
9
|
is_sensitive?: boolean;
|
|
9
10
|
visibility: ArticleVisibility;
|
|
10
11
|
content_type: ArticleContentType;
|
|
12
|
+
status: ArticleStatus;
|
|
11
13
|
title?: string | null;
|
|
12
14
|
description: string;
|
|
13
15
|
user: UserModel;
|
|
16
|
+
admin: AdminUserModel;
|
|
14
17
|
images?: PostImageModel[];
|
|
15
18
|
comments?: CommentModel[];
|
|
16
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArticleModel.d.ts","sourceRoot":"","sources":["../../src/models/ArticleModel.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"ArticleModel.d.ts","sourceRoot":"","sources":["../../src/models/ArticleModel.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AACnG,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAChD,OAAQ,EAAC,YAAY,EAAC,MAAO,gBAAgB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,qBAEa,YAAa,SAAQ,SAAS;IAEzC,OAAO,EAAG,MAAM,CAAC;IAGjB,YAAY,CAAC,EAAE,OAAO,CAAC;IAOvB,UAAU,EAAG,iBAAiB,CAAC;IAO/B,YAAY,EAAG,kBAAkB,CAAC;IAOlC,MAAM,EAAG,aAAa,CAAC;IAGvB,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAGtB,WAAW,EAAG,MAAM,CAAC;IAIrB,IAAI,EAAG,SAAS,CAAC;IAIjB,KAAK,EAAG,cAAc,CAAC;IAGvB,MAAM,CAAC,EAAE,cAAc,EAAE,CAAC;IAG1B,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;CAC3B"}
|
|
@@ -16,14 +16,17 @@ const UserModel_1 = require("./UserModel");
|
|
|
16
16
|
const ArticleEnum_1 = require("../common/enums/ArticleEnum");
|
|
17
17
|
const PostImageModel_1 = require("./PostImageModel");
|
|
18
18
|
const CommentModel_1 = require("./CommentModel");
|
|
19
|
+
const AdminUserModel_1 = require("./AdminUserModel");
|
|
19
20
|
let ArticleModel = class ArticleModel extends BaseModel_1.BaseModel {
|
|
20
21
|
user_id;
|
|
21
22
|
is_sensitive;
|
|
22
23
|
visibility;
|
|
23
24
|
content_type;
|
|
25
|
+
status;
|
|
24
26
|
title;
|
|
25
27
|
description;
|
|
26
28
|
user;
|
|
29
|
+
admin;
|
|
27
30
|
images;
|
|
28
31
|
comments;
|
|
29
32
|
};
|
|
@@ -52,6 +55,14 @@ __decorate([
|
|
|
52
55
|
}),
|
|
53
56
|
__metadata("design:type", String)
|
|
54
57
|
], ArticleModel.prototype, "content_type", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
(0, typeorm_1.Column)({
|
|
60
|
+
type: "enum",
|
|
61
|
+
enum: ArticleEnum_1.ArticleStatus,
|
|
62
|
+
default: ArticleEnum_1.ArticleStatus.PENDING,
|
|
63
|
+
}),
|
|
64
|
+
__metadata("design:type", String)
|
|
65
|
+
], ArticleModel.prototype, "status", void 0);
|
|
55
66
|
__decorate([
|
|
56
67
|
(0, typeorm_1.Column)({ type: "varchar", length: 50, nullable: true }),
|
|
57
68
|
__metadata("design:type", Object)
|
|
@@ -61,10 +72,15 @@ __decorate([
|
|
|
61
72
|
__metadata("design:type", String)
|
|
62
73
|
], ArticleModel.prototype, "description", void 0);
|
|
63
74
|
__decorate([
|
|
64
|
-
(0, typeorm_1.ManyToOne)(() => UserModel_1.UserModel, (user) => user.
|
|
75
|
+
(0, typeorm_1.ManyToOne)(() => UserModel_1.UserModel, (user) => user.articles),
|
|
65
76
|
(0, typeorm_1.JoinColumn)({ name: "user_id", referencedColumnName: "id" }),
|
|
66
77
|
__metadata("design:type", UserModel_1.UserModel)
|
|
67
78
|
], ArticleModel.prototype, "user", void 0);
|
|
79
|
+
__decorate([
|
|
80
|
+
(0, typeorm_1.ManyToOne)(() => AdminUserModel_1.AdminUserModel, (admin) => admin.articles),
|
|
81
|
+
(0, typeorm_1.JoinColumn)({ name: "user_id", referencedColumnName: "id" }),
|
|
82
|
+
__metadata("design:type", AdminUserModel_1.AdminUserModel)
|
|
83
|
+
], ArticleModel.prototype, "admin", void 0);
|
|
68
84
|
__decorate([
|
|
69
85
|
(0, typeorm_1.OneToMany)(() => PostImageModel_1.PostImageModel, (images) => images.post),
|
|
70
86
|
__metadata("design:type", Array)
|
|
@@ -13,6 +13,7 @@ import { ConnectionModel } from "./ConnectionModel";
|
|
|
13
13
|
import { ReviewModel } from "./ReviewModel";
|
|
14
14
|
import { SubscriptionHistoryModel } from "./SubscriptionHistoryModel";
|
|
15
15
|
import { BusinessModel } from "./BusinessModel";
|
|
16
|
+
import { ArticleModel } from "./ArticleModel";
|
|
16
17
|
export declare class UserModel extends BaseModel {
|
|
17
18
|
full_name: string;
|
|
18
19
|
terms_and_conditions: boolean;
|
|
@@ -37,6 +38,7 @@ export declare class UserModel extends BaseModel {
|
|
|
37
38
|
transactions?: TransactionModel[];
|
|
38
39
|
user_profile?: UserProfileModel | null;
|
|
39
40
|
events?: EventModel[];
|
|
41
|
+
articles?: ArticleModel[];
|
|
40
42
|
cards?: CardModel[];
|
|
41
43
|
communities?: CommunityModel[];
|
|
42
44
|
comment?: CommentModel[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserModel.d.ts","sourceRoot":"","sources":["../../src/models/UserModel.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC3F,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"UserModel.d.ts","sourceRoot":"","sources":["../../src/models/UserMod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AE,IAAI,GAAG,IAAI,CAAC;IAGrC,KAAK,EAAG,MAAM,CAAC;IAGf,KAAK,CAAC,EAAE,MAAM,CAAC;IAGf,aAAa,CAAC,EAAE,MAAM,CAAC;IAGvB,WAAW,EAAG,OAAO,CAAC;IAGtB,OAAO,CAAC,EAAE,MAAM,CAAC;IAGjB,SAAS,CAAC,EAAE,OAAO,CAAC;IAGpB,SAAS,CAAC,EAAE,IAAI,CAAC;IAOjB,WAAW,EAAG,aAAa,CAAC;IAO5B,aAAa,EAAG,YAAY,CAAC;IAO7B,eAAe,EAAG,iBAAiB,CAAC;IAOpC,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;IAUxB,oBAAoB,CAAC,EAAE,wBAAwB,EAAE,CAAC;IAUlD,YAAY,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAMlC,YAAY,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAUvC,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC;IAUtB,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;IAQ1B,KAAK,CAAC,EAAE,SAAS,EAAE,CAAC;IAQpB,WAAW,CAAC,EAAE,cAAc,EAAE,CAAC;IAS/B,OAAO,CAAC,EAAE,YAAY,EAAE,CAAC;IAQzB,KAAK,CAAC,EAAE,SAAS,EAAE,CAAC;IAQpB,eAAe,CAAC,EAAE,oBAAoB,EAAE,CAAC;IAQzC,gBAAgB,CAAC,EAAE,eAAe,EAAE,CAAC;IAQrC,oBAAoB,CAAC,EAAE,eAAe,EAAE,CAAC;IAQzC,cAAc,CAAC,EAAE,WAAW,EAAE,CAAC;IAQ/B,UAAU,CAAC,EAAE,aAAa,EAAE,CAAC;CAChC"}
|
package/dist/models/UserModel.js
CHANGED
|
@@ -26,6 +26,7 @@ const ConnectionModel_1 = require("./ConnectionModel");
|
|
|
26
26
|
const ReviewModel_1 = require("./ReviewModel");
|
|
27
27
|
const SubscriptionHistoryModel_1 = require("./SubscriptionHistoryModel");
|
|
28
28
|
const BusinessModel_1 = require("./BusinessModel");
|
|
29
|
+
const ArticleModel_1 = require("./ArticleModel");
|
|
29
30
|
let UserModel = class UserModel extends BaseModel_1.BaseModel {
|
|
30
31
|
full_name;
|
|
31
32
|
terms_and_conditions;
|
|
@@ -50,6 +51,7 @@ let UserModel = class UserModel extends BaseModel_1.BaseModel {
|
|
|
50
51
|
transactions;
|
|
51
52
|
user_profile;
|
|
52
53
|
events;
|
|
54
|
+
articles;
|
|
53
55
|
cards;
|
|
54
56
|
communities;
|
|
55
57
|
comment;
|
|
@@ -181,6 +183,13 @@ __decorate([
|
|
|
181
183
|
}),
|
|
182
184
|
__metadata("design:type", Array)
|
|
183
185
|
], UserModel.prototype, "events", void 0);
|
|
186
|
+
__decorate([
|
|
187
|
+
(0, typeorm_1.OneToMany)(() => ArticleModel_1.ArticleModel, (articles) => articles.user, {
|
|
188
|
+
onDelete: "SET NULL",
|
|
189
|
+
onUpdate: "CASCADE",
|
|
190
|
+
}),
|
|
191
|
+
__metadata("design:type", Array)
|
|
192
|
+
], UserModel.prototype, "articles", void 0);
|
|
184
193
|
__decorate([
|
|
185
194
|
(0, typeorm_1.OneToMany)(() => CardModel_1.CardModel, (cards) => cards.user, {
|
|
186
195
|
onDelete: "SET NULL",
|