@aurispec/core-backend 1.0.32 → 1.0.34
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/UploadEnum.d.ts +8 -7
- package/dist/common/enums/UploadEnum.d.ts.map +1 -1
- package/dist/common/enums/UploadEnum.js +8 -7
- package/dist/database/migrations/1775330936726-modified_categories_enums_table.d.ts +7 -0
- package/dist/database/migrations/1775330936726-modified_categories_enums_table.d.ts.map +1 -0
- package/dist/database/migrations/1775330936726-modified_categories_enums_table.js +39 -0
- package/dist/database/migrations/1775346015390-modified_articles_table.d.ts +7 -0
- package/dist/database/migrations/1775346015390-modified_articles_table.d.ts.map +1 -0
- package/dist/database/migrations/1775346015390-modified_articles_table.js +17 -0
- package/dist/database/migrations/1775350149576-modified_articles_table.d.ts +7 -0
- package/dist/database/migrations/1775350149576-modified_articles_table.d.ts.map +1 -0
- package/dist/database/migrations/1775350149576-modified_articles_table.js +21 -0
- package/dist/models/ArticleModel.d.ts +6 -1
- package/dist/models/ArticleModel.d.ts.map +1 -1
- package/dist/models/ArticleModel.js +24 -2
- package/dist/models/PlanFeatureModel.d.ts +1 -0
- package/dist/models/PlanFeatureModel.d.ts.map +1 -1
- package/dist/models/PlanFeatureModel.js +5 -0
- package/dist/models/PlanModel.d.ts +3 -0
- package/dist/models/PlanModel.d.ts.map +1 -1
- package/dist/models/PlanModel.js +15 -0
- package/package.json +1 -1
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
export declare enum UploadDirectories {
|
|
2
2
|
EVENTS = "events/cover-images",
|
|
3
3
|
USERS = "users/avatars",
|
|
4
|
-
COMMUNITY_COVER_IMAGES = "
|
|
5
|
-
COMMUNITY_PROFILE_IMAGES = "
|
|
6
|
-
COMMUNITY_POST_IMAGES = "
|
|
7
|
-
ARTICLE_IMAGES = "
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
COMMUNITY_COVER_IMAGES = "communities/cover-images",
|
|
5
|
+
COMMUNITY_PROFILE_IMAGES = "communities/profile-images",
|
|
6
|
+
COMMUNITY_POST_IMAGES = "communities/post-images",
|
|
7
|
+
ARTICLE_IMAGES = "article-images",
|
|
8
|
+
OUTLOOK_IMAGES = "outlook-images",
|
|
9
|
+
PRODUCT_IMAGES = "marketplace/product-images",
|
|
10
|
+
SERVICE_PROVIDERS_IMAGES = "marketplace/service-providers-images",
|
|
11
|
+
BUSINESS_IMAGES = "marketplace/business-id-images"
|
|
11
12
|
}
|
|
12
13
|
export declare enum FILE_HOST_PROVIDER {
|
|
13
14
|
CLOUDINARY = "CLOUDINARY"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UploadEnum.d.ts","sourceRoot":"","sources":["../../../src/common/enums/UploadEnum.ts"],"names":[],"mappings":"AAAA,oBAAY,iBAAiB;IAC3B,MAAM,wBAAwB;IAC9B,KAAK,kBAAkB;IACvB,sBAAsB,
|
|
1
|
+
{"version":3,"file":"UploadEnum.d.ts","sourceRoot":"","sources":["../../../src/common/enums/UploadEnum.ts"],"names":[],"mappings":"AAAA,oBAAY,iBAAiB;IAC3B,MAAM,wBAAwB;IAC9B,KAAK,kBAAkB;IACvB,sBAAsB,6BAA6B;IACnD,wBAAwB,+BAA+B;IACvD,qBAAqB,4BAA4B;IACjD,cAAc,mBAAmB;IACjC,cAAc,mBAAmB;IACjC,cAAc,+BAA+B;IAC7C,wBAAwB,yCAAyC;IACjE,eAAe,mCAAmC;CACnD;AAED,oBAAY,kBAAkB;IAC1B,UAAU,eAAe;CAC5B"}
|
|
@@ -5,13 +5,14 @@ var UploadDirectories;
|
|
|
5
5
|
(function (UploadDirectories) {
|
|
6
6
|
UploadDirectories["EVENTS"] = "events/cover-images";
|
|
7
7
|
UploadDirectories["USERS"] = "users/avatars";
|
|
8
|
-
UploadDirectories["COMMUNITY_COVER_IMAGES"] = "
|
|
9
|
-
UploadDirectories["COMMUNITY_PROFILE_IMAGES"] = "
|
|
10
|
-
UploadDirectories["COMMUNITY_POST_IMAGES"] = "
|
|
11
|
-
UploadDirectories["ARTICLE_IMAGES"] = "
|
|
12
|
-
UploadDirectories["
|
|
13
|
-
UploadDirectories["
|
|
14
|
-
UploadDirectories["
|
|
8
|
+
UploadDirectories["COMMUNITY_COVER_IMAGES"] = "communities/cover-images";
|
|
9
|
+
UploadDirectories["COMMUNITY_PROFILE_IMAGES"] = "communities/profile-images";
|
|
10
|
+
UploadDirectories["COMMUNITY_POST_IMAGES"] = "communities/post-images";
|
|
11
|
+
UploadDirectories["ARTICLE_IMAGES"] = "article-images";
|
|
12
|
+
UploadDirectories["OUTLOOK_IMAGES"] = "outlook-images";
|
|
13
|
+
UploadDirectories["PRODUCT_IMAGES"] = "marketplace/product-images";
|
|
14
|
+
UploadDirectories["SERVICE_PROVIDERS_IMAGES"] = "marketplace/service-providers-images";
|
|
15
|
+
UploadDirectories["BUSINESS_IMAGES"] = "marketplace/business-id-images";
|
|
15
16
|
})(UploadDirectories || (exports.UploadDirectories = UploadDirectories = {}));
|
|
16
17
|
var FILE_HOST_PROVIDER;
|
|
17
18
|
(function (FILE_HOST_PROVIDER) {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from "typeorm";
|
|
2
|
+
export declare class ModifiedCategoriesEnumsTable1775330936726 implements MigrationInterface {
|
|
3
|
+
name: string;
|
|
4
|
+
up(queryRunner: QueryRunner): Promise<void>;
|
|
5
|
+
down(queryRunner: QueryRunner): Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=1775330936726-modified_categories_enums_table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1775330936726-modified_categories_enums_table.d.ts","sourceRoot":"","sources":["../../../src/database/migrations/1775330936726-modified_categories_enums_table.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE1D,qBAAa,yCAA0C,YAAW,kBAAkB;IAChF,IAAI,SAA8C;IAErC,EAAE,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAiB3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAiB7D"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ModifiedCategoriesEnumsTable1775330936726 = void 0;
|
|
4
|
+
class ModifiedCategoriesEnumsTable1775330936726 {
|
|
5
|
+
name = 'ModifiedCategoriesEnumsTable1775330936726';
|
|
6
|
+
async up(queryRunner) {
|
|
7
|
+
await queryRunner.query(`ALTER TABLE "articles" ADD "admin_id" integer`);
|
|
8
|
+
await queryRunner.query(`ALTER TYPE "public"."market_listing_categories_type_enum" RENAME TO "market_listing_categories_type_enum_old"`);
|
|
9
|
+
await queryRunner.query(`CREATE TYPE "public"."market_listing_categories_type_enum" AS ENUM('PostModel', 'ArticleModel', 'CommentModel', 'ArticleCommentModel', 'ConnectionModel', 'EventModel', 'BusinessModel', 'CategoryModel', 'OutlookModel', 'ProductModel', 'ChatMessageModel', 'ServiceProviderModel')`);
|
|
10
|
+
await queryRunner.query(`ALTER TABLE "market_listing_categories" ALTER COLUMN "type" DROP DEFAULT`);
|
|
11
|
+
await queryRunner.query(`ALTER TABLE "market_listing_categories" ALTER COLUMN "type" TYPE "public"."market_listing_categories_type_enum" USING "type"::"text"::"public"."market_listing_categories_type_enum"`);
|
|
12
|
+
await queryRunner.query(`ALTER TABLE "market_listing_categories" ALTER COLUMN "type" SET DEFAULT 'ProductModel'`);
|
|
13
|
+
await queryRunner.query(`DROP TYPE "public"."market_listing_categories_type_enum_old"`);
|
|
14
|
+
await queryRunner.query(`DROP INDEX "public"."IDX_6bc030c54a48f96fd543b56a35"`);
|
|
15
|
+
await queryRunner.query(`ALTER TYPE "public"."bookmarks_bookmarkable_type_enum" RENAME TO "bookmarks_bookmarkable_type_enum_old"`);
|
|
16
|
+
await queryRunner.query(`CREATE TYPE "public"."bookmarks_bookmarkable_type_enum" AS ENUM('PostModel', 'ArticleModel', 'CommentModel', 'ArticleCommentModel', 'ConnectionModel', 'EventModel', 'BusinessModel', 'CategoryModel', 'OutlookModel', 'ProductModel', 'ChatMessageModel', 'ServiceProviderModel')`);
|
|
17
|
+
await queryRunner.query(`ALTER TABLE "bookmarks" ALTER COLUMN "bookmarkable_type" TYPE "public"."bookmarks_bookmarkable_type_enum" USING "bookmarkable_type"::"text"::"public"."bookmarks_bookmarkable_type_enum"`);
|
|
18
|
+
await queryRunner.query(`DROP TYPE "public"."bookmarks_bookmarkable_type_enum_old"`);
|
|
19
|
+
await queryRunner.query(`CREATE INDEX "IDX_6bc030c54a48f96fd543b56a35" ON "bookmarks" ("bookmarkable_id", "user_id", "bookmarkable_type") `);
|
|
20
|
+
await queryRunner.query(`ALTER TABLE "articles" ADD CONSTRAINT "FK_8fb6ceb1e15c9320c4f576b07c7" FOREIGN KEY ("admin_id") REFERENCES "admin_users"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
|
21
|
+
}
|
|
22
|
+
async down(queryRunner) {
|
|
23
|
+
await queryRunner.query(`ALTER TABLE "articles" DROP CONSTRAINT "FK_8fb6ceb1e15c9320c4f576b07c7"`);
|
|
24
|
+
await queryRunner.query(`DROP INDEX "public"."IDX_6bc030c54a48f96fd543b56a35"`);
|
|
25
|
+
await queryRunner.query(`CREATE TYPE "public"."bookmarks_bookmarkable_type_enum_old" AS ENUM('PostModel', 'ArticleModel', 'CommentModel', 'ArticleCommentModel', 'ConnectionModel', 'EventModel', 'BusinessModel', 'ProductModel', 'ChatMessageModel', 'ServiceProviderModel')`);
|
|
26
|
+
await queryRunner.query(`ALTER TABLE "bookmarks" ALTER COLUMN "bookmarkable_type" TYPE "public"."bookmarks_bookmarkable_type_enum_old" USING "bookmarkable_type"::"text"::"public"."bookmarks_bookmarkable_type_enum_old"`);
|
|
27
|
+
await queryRunner.query(`DROP TYPE "public"."bookmarks_bookmarkable_type_enum"`);
|
|
28
|
+
await queryRunner.query(`ALTER TYPE "public"."bookmarks_bookmarkable_type_enum_old" RENAME TO "bookmarks_bookmarkable_type_enum"`);
|
|
29
|
+
await queryRunner.query(`CREATE INDEX "IDX_6bc030c54a48f96fd543b56a35" ON "bookmarks" ("user_id", "bookmarkable_id", "bookmarkable_type") `);
|
|
30
|
+
await queryRunner.query(`CREATE TYPE "public"."market_listing_categories_type_enum_old" AS ENUM('PostModel', 'ArticleModel', 'CommentModel', 'ArticleCommentModel', 'ConnectionModel', 'EventModel', 'BusinessModel', 'ProductModel', 'ChatMessageModel', 'ServiceProviderModel')`);
|
|
31
|
+
await queryRunner.query(`ALTER TABLE "market_listing_categories" ALTER COLUMN "type" DROP DEFAULT`);
|
|
32
|
+
await queryRunner.query(`ALTER TABLE "market_listing_categories" ALTER COLUMN "type" TYPE "public"."market_listing_categories_type_enum_old" USING "type"::"text"::"public"."market_listing_categories_type_enum_old"`);
|
|
33
|
+
await queryRunner.query(`ALTER TABLE "market_listing_categories" ALTER COLUMN "type" SET DEFAULT 'ProductModel'`);
|
|
34
|
+
await queryRunner.query(`DROP TYPE "public"."market_listing_categories_type_enum"`);
|
|
35
|
+
await queryRunner.query(`ALTER TYPE "public"."market_listing_categories_type_enum_old" RENAME TO "market_listing_categories_type_enum"`);
|
|
36
|
+
await queryRunner.query(`ALTER TABLE "articles" DROP COLUMN "admin_id"`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.ModifiedCategoriesEnumsTable1775330936726 = ModifiedCategoriesEnumsTable1775330936726;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from "typeorm";
|
|
2
|
+
export declare class ModifiedArticlesTable1775346015390 implements MigrationInterface {
|
|
3
|
+
name: string;
|
|
4
|
+
up(queryRunner: QueryRunner): Promise<void>;
|
|
5
|
+
down(queryRunner: QueryRunner): Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=1775346015390-modified_articles_table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1775346015390-modified_articles_table.d.ts","sourceRoot":"","sources":["../../../src/database/migrations/1775346015390-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;IAM3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAM7D"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ModifiedArticlesTable1775346015390 = void 0;
|
|
4
|
+
class ModifiedArticlesTable1775346015390 {
|
|
5
|
+
name = 'ModifiedArticlesTable1775346015390';
|
|
6
|
+
async up(queryRunner) {
|
|
7
|
+
await queryRunner.query(`ALTER TABLE "articles" ADD "category_id" integer`);
|
|
8
|
+
await queryRunner.query(`ALTER TABLE "articles" ADD "external_link" character varying(50)`);
|
|
9
|
+
await queryRunner.query(`ALTER TABLE "articles" ADD CONSTRAINT "FK_e025eeefcdb2a269c42484ee43f" FOREIGN KEY ("category_id") REFERENCES "market_listing_categories"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
|
10
|
+
}
|
|
11
|
+
async down(queryRunner) {
|
|
12
|
+
await queryRunner.query(`ALTER TABLE "articles" DROP CONSTRAINT "FK_e025eeefcdb2a269c42484ee43f"`);
|
|
13
|
+
await queryRunner.query(`ALTER TABLE "articles" DROP COLUMN "external_link"`);
|
|
14
|
+
await queryRunner.query(`ALTER TABLE "articles" DROP COLUMN "category_id"`);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.ModifiedArticlesTable1775346015390 = ModifiedArticlesTable1775346015390;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MigrationInterface, QueryRunner } from "typeorm";
|
|
2
|
+
export declare class ModifiedArticlesTable1775350149576 implements MigrationInterface {
|
|
3
|
+
name: string;
|
|
4
|
+
up(queryRunner: QueryRunner): Promise<void>;
|
|
5
|
+
down(queryRunner: QueryRunner): Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=1775350149576-modified_articles_table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"1775350149576-modified_articles_table.d.ts","sourceRoot":"","sources":["../../../src/database/migrations/1775350149576-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;IAQ3C,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;CAQ7D"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ModifiedArticlesTable1775350149576 = void 0;
|
|
4
|
+
class ModifiedArticlesTable1775350149576 {
|
|
5
|
+
name = 'ModifiedArticlesTable1775350149576';
|
|
6
|
+
async up(queryRunner) {
|
|
7
|
+
await queryRunner.query(`ALTER TABLE "articles" DROP CONSTRAINT "FK_87bb15395540ae06337a486a77a"`);
|
|
8
|
+
await queryRunner.query(`DROP INDEX "public"."IDX_ed999910633b8795e4373760d7"`);
|
|
9
|
+
await queryRunner.query(`ALTER TABLE "articles" ALTER COLUMN "user_id" DROP NOT NULL`);
|
|
10
|
+
await queryRunner.query(`CREATE INDEX "IDX_ed999910633b8795e4373760d7" ON "articles" ("is_sensitive", "user_id", "visibility") `);
|
|
11
|
+
await queryRunner.query(`ALTER TABLE "articles" ADD CONSTRAINT "FK_87bb15395540ae06337a486a77a" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
|
12
|
+
}
|
|
13
|
+
async down(queryRunner) {
|
|
14
|
+
await queryRunner.query(`ALTER TABLE "articles" DROP CONSTRAINT "FK_87bb15395540ae06337a486a77a"`);
|
|
15
|
+
await queryRunner.query(`DROP INDEX "public"."IDX_ed999910633b8795e4373760d7"`);
|
|
16
|
+
await queryRunner.query(`ALTER TABLE "articles" ALTER COLUMN "user_id" SET NOT NULL`);
|
|
17
|
+
await queryRunner.query(`CREATE INDEX "IDX_ed999910633b8795e4373760d7" ON "articles" ("user_id", "is_sensitive", "visibility") `);
|
|
18
|
+
await queryRunner.query(`ALTER TABLE "articles" ADD CONSTRAINT "FK_87bb15395540ae06337a486a77a" FOREIGN KEY ("user_id") REFERENCES "users"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.ModifiedArticlesTable1775350149576 = ModifiedArticlesTable1775350149576;
|
|
@@ -4,17 +4,22 @@ import { ArticleContentType, ArticleStatus, ArticleVisibility } from "../common/
|
|
|
4
4
|
import { PostImageModel } from "./PostImageModel";
|
|
5
5
|
import { CommentModel } from "./CommentModel";
|
|
6
6
|
import { AdminUserModel } from "./AdminUserModel";
|
|
7
|
+
import { CategoryModel } from "./CategoryModel";
|
|
7
8
|
export declare class ArticleModel extends BaseModel {
|
|
8
|
-
user_id
|
|
9
|
+
user_id?: number;
|
|
10
|
+
admin_id?: number;
|
|
11
|
+
category_id?: number;
|
|
9
12
|
is_sensitive?: boolean;
|
|
10
13
|
visibility: ArticleVisibility;
|
|
11
14
|
content_type: ArticleContentType;
|
|
12
15
|
status: ArticleStatus;
|
|
13
16
|
title?: string | null;
|
|
17
|
+
external_link?: string | null;
|
|
14
18
|
description: string;
|
|
15
19
|
user: UserModel;
|
|
16
20
|
admin: AdminUserModel;
|
|
17
21
|
images?: PostImageModel[];
|
|
18
22
|
comments?: CommentModel[];
|
|
23
|
+
category: CategoryModel;
|
|
19
24
|
}
|
|
20
25
|
//# sourceMappingURL=ArticleModel.d.ts.map
|
|
@@ -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,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;
|
|
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;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,qBAEa,YAAa,SAAQ,SAAS;IAEzC,OAAO,CAAC,EAAE,MAAM,CAAC;IAGjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,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,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAG9B,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;IAI1B,QAAQ,EAAG,aAAa,CAAC;CAC1B"}
|
|
@@ -17,24 +17,37 @@ const ArticleEnum_1 = require("../common/enums/ArticleEnum");
|
|
|
17
17
|
const PostImageModel_1 = require("./PostImageModel");
|
|
18
18
|
const CommentModel_1 = require("./CommentModel");
|
|
19
19
|
const AdminUserModel_1 = require("./AdminUserModel");
|
|
20
|
+
const CategoryModel_1 = require("./CategoryModel");
|
|
20
21
|
let ArticleModel = class ArticleModel extends BaseModel_1.BaseModel {
|
|
21
22
|
user_id;
|
|
23
|
+
admin_id;
|
|
24
|
+
category_id;
|
|
22
25
|
is_sensitive;
|
|
23
26
|
visibility;
|
|
24
27
|
content_type;
|
|
25
28
|
status;
|
|
26
29
|
title;
|
|
30
|
+
external_link;
|
|
27
31
|
description;
|
|
28
32
|
user;
|
|
29
33
|
admin;
|
|
30
34
|
images;
|
|
31
35
|
comments;
|
|
36
|
+
category;
|
|
32
37
|
};
|
|
33
38
|
exports.ArticleModel = ArticleModel;
|
|
34
39
|
__decorate([
|
|
35
|
-
(0, typeorm_1.Column)(),
|
|
40
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
36
41
|
__metadata("design:type", Number)
|
|
37
42
|
], ArticleModel.prototype, "user_id", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
45
|
+
__metadata("design:type", Number)
|
|
46
|
+
], ArticleModel.prototype, "admin_id", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
49
|
+
__metadata("design:type", Number)
|
|
50
|
+
], ArticleModel.prototype, "category_id", void 0);
|
|
38
51
|
__decorate([
|
|
39
52
|
(0, typeorm_1.Column)({ default: false, nullable: true }),
|
|
40
53
|
__metadata("design:type", Boolean)
|
|
@@ -67,6 +80,10 @@ __decorate([
|
|
|
67
80
|
(0, typeorm_1.Column)({ type: "varchar", length: 50, nullable: true }),
|
|
68
81
|
__metadata("design:type", Object)
|
|
69
82
|
], ArticleModel.prototype, "title", void 0);
|
|
83
|
+
__decorate([
|
|
84
|
+
(0, typeorm_1.Column)({ type: "varchar", length: 50, nullable: true }),
|
|
85
|
+
__metadata("design:type", Object)
|
|
86
|
+
], ArticleModel.prototype, "external_link", void 0);
|
|
70
87
|
__decorate([
|
|
71
88
|
(0, typeorm_1.Column)({ type: "text" }),
|
|
72
89
|
__metadata("design:type", String)
|
|
@@ -78,7 +95,7 @@ __decorate([
|
|
|
78
95
|
], ArticleModel.prototype, "user", void 0);
|
|
79
96
|
__decorate([
|
|
80
97
|
(0, typeorm_1.ManyToOne)(() => AdminUserModel_1.AdminUserModel, (admin) => admin.articles),
|
|
81
|
-
(0, typeorm_1.JoinColumn)({ name: "
|
|
98
|
+
(0, typeorm_1.JoinColumn)({ name: "admin_id", referencedColumnName: "id" }),
|
|
82
99
|
__metadata("design:type", AdminUserModel_1.AdminUserModel)
|
|
83
100
|
], ArticleModel.prototype, "admin", void 0);
|
|
84
101
|
__decorate([
|
|
@@ -89,6 +106,11 @@ __decorate([
|
|
|
89
106
|
(0, typeorm_1.OneToMany)(() => CommentModel_1.CommentModel, (comments) => comments.post),
|
|
90
107
|
__metadata("design:type", Array)
|
|
91
108
|
], ArticleModel.prototype, "comments", void 0);
|
|
109
|
+
__decorate([
|
|
110
|
+
(0, typeorm_1.ManyToOne)(() => CategoryModel_1.CategoryModel),
|
|
111
|
+
(0, typeorm_1.JoinColumn)({ name: "category_id", referencedColumnName: "id" }),
|
|
112
|
+
__metadata("design:type", CategoryModel_1.CategoryModel)
|
|
113
|
+
], ArticleModel.prototype, "category", void 0);
|
|
92
114
|
exports.ArticleModel = ArticleModel = __decorate([
|
|
93
115
|
(0, typeorm_1.Entity)({ name: "articles" }),
|
|
94
116
|
(0, typeorm_1.Index)(["is_sensitive", "user_id", "visibility"])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlanFeatureModel.d.ts","sourceRoot":"","sources":["../../src/models/PlanFeatureModel.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,qBAGa,gBAAiB,SAAQ,SAAS;IAE7C,OAAO,EAAG,MAAM,CAAC;IAGjB,UAAU,EAAG,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"PlanFeatureModel.d.ts","sourceRoot":"","sources":["../../src/models/PlanFeatureModel.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,qBAGa,gBAAiB,SAAQ,SAAS;IAE7C,OAAO,EAAG,MAAM,CAAC;IAGjB,UAAU,EAAG,MAAM,CAAC;IAGpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAIlB,IAAI,EAAG,SAAS,CAAC;IAIjB,OAAO,EAAG,YAAY,CAAC;IAGvB,QAAQ,EAAG,GAAG,GAAG,IAAI,CAAC;CACvB"}
|
|
@@ -17,6 +17,7 @@ const BaseModel_1 = require("./BaseModel");
|
|
|
17
17
|
let PlanFeatureModel = class PlanFeatureModel extends BaseModel_1.BaseModel {
|
|
18
18
|
plan_id;
|
|
19
19
|
feature_id;
|
|
20
|
+
admin_id;
|
|
20
21
|
plan;
|
|
21
22
|
feature;
|
|
22
23
|
metadata;
|
|
@@ -30,6 +31,10 @@ __decorate([
|
|
|
30
31
|
(0, typeorm_1.Column)(),
|
|
31
32
|
__metadata("design:type", Number)
|
|
32
33
|
], PlanFeatureModel.prototype, "feature_id", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
36
|
+
__metadata("design:type", Number)
|
|
37
|
+
], PlanFeatureModel.prototype, "admin_id", void 0);
|
|
33
38
|
__decorate([
|
|
34
39
|
(0, typeorm_1.ManyToOne)(() => PlanModel_1.PlanModel, (planModel) => planModel.planFeatures),
|
|
35
40
|
(0, typeorm_1.JoinColumn)({ name: "plan_id", referencedColumnName: "id" }),
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { UserModel } from "./UserModel";
|
|
2
2
|
import { PlanFeatureModel } from "./PlanFeatureModel";
|
|
3
3
|
import { BaseModel } from "./BaseModel";
|
|
4
|
+
import { STATUS } from "@/common/enums";
|
|
4
5
|
export declare class PlanModel extends BaseModel {
|
|
5
6
|
name: string;
|
|
6
7
|
monthly: string;
|
|
7
8
|
yearly: string;
|
|
9
|
+
admin_id?: number;
|
|
8
10
|
discount: string;
|
|
11
|
+
status: STATUS;
|
|
9
12
|
description: string;
|
|
10
13
|
stripe_monthly_plan_code?: string;
|
|
11
14
|
stripe_yearly_plan_code?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PlanModel.d.ts","sourceRoot":"","sources":["../../src/models/PlanModel.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,EAAC,gBAAgB,EAAC,MAAO,oBAAoB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,qBAEa,SAAU,SAAQ,SAAS;IAEtC,IAAI,EAAG,MAAM,CAAC;IAGd,OAAO,EAAG,MAAM,CAAC;IAGjB,MAAM,EAAG,MAAM,CAAC;IAGhB,QAAQ,
|
|
1
|
+
{"version":3,"file":"PlanModel.d.ts","sourceRoot":"","sources":["../../src/models/PlanModel.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,EAAC,gBAAgB,EAAC,MAAO,oBAAoB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC,qBAEa,SAAU,SAAQ,SAAS;IAEtC,IAAI,EAAG,MAAM,CAAC;IAGd,OAAO,EAAG,MAAM,CAAC;IAGjB,MAAM,EAAG,MAAM,CAAC;IAGhB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,QAAQ,EAAG,MAAM,CAAC;IAOlB,MAAM,EAAG,MAAM,CAAC;IAGhB,WAAW,EAAG,MAAM,CAAC;IAGrB,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAGlC,uBAAuB,CAAC,EAAE,MAAM,CAAC;IAGjC,KAAK,EAAG,SAAS,EAAE,CAAC;IAGpB,YAAY,EAAG,gBAAgB,EAAE,CAAC;CACnC"}
|
package/dist/models/PlanModel.js
CHANGED
|
@@ -14,11 +14,14 @@ const typeorm_1 = require("typeorm");
|
|
|
14
14
|
const UserModel_1 = require("./UserModel");
|
|
15
15
|
const PlanFeatureModel_1 = require("./PlanFeatureModel");
|
|
16
16
|
const BaseModel_1 = require("./BaseModel");
|
|
17
|
+
const enums_1 = require("@/common/enums");
|
|
17
18
|
let PlanModel = class PlanModel extends BaseModel_1.BaseModel {
|
|
18
19
|
name;
|
|
19
20
|
monthly;
|
|
20
21
|
yearly;
|
|
22
|
+
admin_id;
|
|
21
23
|
discount;
|
|
24
|
+
status;
|
|
22
25
|
description;
|
|
23
26
|
stripe_monthly_plan_code;
|
|
24
27
|
stripe_yearly_plan_code;
|
|
@@ -38,10 +41,22 @@ __decorate([
|
|
|
38
41
|
(0, typeorm_1.Column)({ type: "decimal", default: 0 }),
|
|
39
42
|
__metadata("design:type", String)
|
|
40
43
|
], PlanModel.prototype, "yearly", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, typeorm_1.Column)({ nullable: true }),
|
|
46
|
+
__metadata("design:type", Number)
|
|
47
|
+
], PlanModel.prototype, "admin_id", void 0);
|
|
41
48
|
__decorate([
|
|
42
49
|
(0, typeorm_1.Column)({ type: "decimal", default: 0 }),
|
|
43
50
|
__metadata("design:type", String)
|
|
44
51
|
], PlanModel.prototype, "discount", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, typeorm_1.Column)({
|
|
54
|
+
type: "enum",
|
|
55
|
+
enum: enums_1.STATUS,
|
|
56
|
+
default: enums_1.STATUS.INACTIVE
|
|
57
|
+
}),
|
|
58
|
+
__metadata("design:type", String)
|
|
59
|
+
], PlanModel.prototype, "status", void 0);
|
|
45
60
|
__decorate([
|
|
46
61
|
(0, typeorm_1.Column)(),
|
|
47
62
|
__metadata("design:type", String)
|