@cool-digital-solutions/interferir-models 1.0.0
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/config/index.d.ts +75 -0
- package/dist/config/index.js +27 -0
- package/dist/index.d.ts +82 -0
- package/dist/index.js +79 -0
- package/dist/models/ai-conversation.model.d.ts +2 -0
- package/dist/models/ai-conversation.model.js +43 -0
- package/dist/models/backend-error.model.d.ts +2 -0
- package/dist/models/backend-error.model.js +40 -0
- package/dist/models/badge.model.d.ts +2 -0
- package/dist/models/badge.model.js +43 -0
- package/dist/models/batch-history.model.d.ts +33 -0
- package/dist/models/batch-history.model.js +39 -0
- package/dist/models/company.model.d.ts +2 -0
- package/dist/models/company.model.js +180 -0
- package/dist/models/competitor.model.d.ts +2 -0
- package/dist/models/competitor.model.js +33 -0
- package/dist/models/contact-message.model.d.ts +2 -0
- package/dist/models/contact-message.model.js +40 -0
- package/dist/models/contact-startup.model.d.ts +2 -0
- package/dist/models/contact-startup.model.js +28 -0
- package/dist/models/content.model.d.ts +2 -0
- package/dist/models/content.model.js +41 -0
- package/dist/models/draft-version.model.d.ts +2 -0
- package/dist/models/draft-version.model.js +35 -0
- package/dist/models/evidence-layout.model.d.ts +2 -0
- package/dist/models/evidence-layout.model.js +39 -0
- package/dist/models/evidence.model.d.ts +2 -0
- package/dist/models/evidence.model.js +108 -0
- package/dist/models/faq.model.d.ts +2 -0
- package/dist/models/faq.model.js +35 -0
- package/dist/models/follow-content.model.d.ts +2 -0
- package/dist/models/follow-content.model.js +37 -0
- package/dist/models/general-config-sub.model.d.ts +2 -0
- package/dist/models/general-config-sub.model.js +14 -0
- package/dist/models/general-config.model.d.ts +2 -0
- package/dist/models/general-config.model.js +16 -0
- package/dist/models/image.model.d.ts +2 -0
- package/dist/models/image.model.js +46 -0
- package/dist/models/index.d.ts +39 -0
- package/dist/models/index.js +79 -0
- package/dist/models/industry.model.d.ts +2 -0
- package/dist/models/industry.model.js +34 -0
- package/dist/models/instant-research.model.d.ts +2 -0
- package/dist/models/instant-research.model.js +174 -0
- package/dist/models/investor.model.d.ts +2 -0
- package/dist/models/investor.model.js +36 -0
- package/dist/models/like.model.d.ts +2 -0
- package/dist/models/like.model.js +43 -0
- package/dist/models/model-indexes.d.ts +3 -0
- package/dist/models/model-indexes.js +24 -0
- package/dist/models/news.model.d.ts +2 -0
- package/dist/models/news.model.js +77 -0
- package/dist/models/notification.model.d.ts +2 -0
- package/dist/models/notification.model.js +17 -0
- package/dist/models/otp.model.d.ts +2 -0
- package/dist/models/otp.model.js +15 -0
- package/dist/models/portia-article.model.d.ts +2 -0
- package/dist/models/portia-article.model.js +96 -0
- package/dist/models/problem.model.d.ts +2 -0
- package/dist/models/problem.model.js +54 -0
- package/dist/models/search-history.model.d.ts +2 -0
- package/dist/models/search-history.model.js +41 -0
- package/dist/models/sf-category.model.d.ts +2 -0
- package/dist/models/sf-category.model.js +36 -0
- package/dist/models/sf-sub-category.model.d.ts +2 -0
- package/dist/models/sf-sub-category.model.js +35 -0
- package/dist/models/sf-tag.model.d.ts +2 -0
- package/dist/models/sf-tag.model.js +34 -0
- package/dist/models/site-map-cache.model.d.ts +2 -0
- package/dist/models/site-map-cache.model.js +19 -0
- package/dist/models/spark-use-case.model.d.ts +2 -0
- package/dist/models/spark-use-case.model.js +87 -0
- package/dist/models/spark.model.d.ts +2 -0
- package/dist/models/spark.model.js +78 -0
- package/dist/models/suggest.model.d.ts +2 -0
- package/dist/models/suggest.model.js +40 -0
- package/dist/models/technology.model.d.ts +2 -0
- package/dist/models/technology.model.js +34 -0
- package/dist/models/theme.model.d.ts +2 -0
- package/dist/models/theme.model.js +69 -0
- package/dist/models/token.model.d.ts +2 -0
- package/dist/models/token.model.js +15 -0
- package/dist/models/update-job.model.d.ts +2 -0
- package/dist/models/update-job.model.js +37 -0
- package/dist/models/use-case.model.d.ts +2 -0
- package/dist/models/use-case.model.js +83 -0
- package/dist/models/user-token.model.d.ts +2 -0
- package/dist/models/user-token.model.js +33 -0
- package/dist/models/user-visit.model.d.ts +2 -0
- package/dist/models/user-visit.model.js +35 -0
- package/dist/models/user.model.d.ts +2 -0
- package/dist/models/user.model.js +78 -0
- package/dist/types/ai-conversation.type.d.ts +46 -0
- package/dist/types/ai-conversation.type.js +8 -0
- package/dist/types/backend-error.type.d.ts +19 -0
- package/dist/types/backend-error.type.js +10 -0
- package/dist/types/badge.type.d.ts +42 -0
- package/dist/types/badge.type.js +11 -0
- package/dist/types/batch-history.type.d.ts +39 -0
- package/dist/types/batch-history.type.js +10 -0
- package/dist/types/company.type.d.ts +229 -0
- package/dist/types/company.type.js +75 -0
- package/dist/types/competitor.type.d.ts +33 -0
- package/dist/types/competitor.type.js +2 -0
- package/dist/types/contact-message.type.d.ts +46 -0
- package/dist/types/contact-message.type.js +11 -0
- package/dist/types/contact-startup.type.d.ts +43 -0
- package/dist/types/contact-startup.type.js +10 -0
- package/dist/types/content.type.d.ts +33 -0
- package/dist/types/content.type.js +2 -0
- package/dist/types/draft-version.type.d.ts +41 -0
- package/dist/types/draft-version.type.js +12 -0
- package/dist/types/evidence-layout.type.d.ts +13 -0
- package/dist/types/evidence-layout.type.js +2 -0
- package/dist/types/evidence.type.d.ts +102 -0
- package/dist/types/evidence.type.js +11 -0
- package/dist/types/faq.type.d.ts +17 -0
- package/dist/types/faq.type.js +12 -0
- package/dist/types/follow-content.type.d.ts +50 -0
- package/dist/types/follow-content.type.js +17 -0
- package/dist/types/general-config-sub.type.d.ts +17 -0
- package/dist/types/general-config-sub.type.js +14 -0
- package/dist/types/general-config.type.d.ts +55 -0
- package/dist/types/general-config.type.js +25 -0
- package/dist/types/image.type.d.ts +54 -0
- package/dist/types/image.type.js +13 -0
- package/dist/types/index.d.ts +43 -0
- package/dist/types/index.js +2 -0
- package/dist/types/industry.type.d.ts +5 -0
- package/dist/types/industry.type.js +2 -0
- package/dist/types/instant-research.type.d.ts +182 -0
- package/dist/types/instant-research.type.js +37 -0
- package/dist/types/investor.type.d.ts +32 -0
- package/dist/types/investor.type.js +2 -0
- package/dist/types/like.type.d.ts +49 -0
- package/dist/types/like.type.js +16 -0
- package/dist/types/news.type.d.ts +63 -0
- package/dist/types/news.type.js +2 -0
- package/dist/types/notification.type.d.ts +34 -0
- package/dist/types/notification.type.js +2 -0
- package/dist/types/otp.type.d.ts +10 -0
- package/dist/types/otp.type.js +2 -0
- package/dist/types/portia-article.type.d.ts +87 -0
- package/dist/types/portia-article.type.js +23 -0
- package/dist/types/problem.type.d.ts +56 -0
- package/dist/types/problem.type.js +2 -0
- package/dist/types/search-history.type.d.ts +36 -0
- package/dist/types/search-history.type.js +2 -0
- package/dist/types/sf-category.type.d.ts +8 -0
- package/dist/types/sf-category.type.js +2 -0
- package/dist/types/sf-sub-category.type.d.ts +7 -0
- package/dist/types/sf-sub-category.type.js +2 -0
- package/dist/types/sf-tag.type.d.ts +5 -0
- package/dist/types/sf-tag.type.js +2 -0
- package/dist/types/site-map-cache.type.d.ts +11 -0
- package/dist/types/site-map-cache.type.js +2 -0
- package/dist/types/spark-use-case.type.d.ts +93 -0
- package/dist/types/spark-use-case.type.js +18 -0
- package/dist/types/spark.type.d.ts +108 -0
- package/dist/types/spark.type.js +42 -0
- package/dist/types/suggest.type.d.ts +42 -0
- package/dist/types/suggest.type.js +11 -0
- package/dist/types/technology.type.d.ts +5 -0
- package/dist/types/technology.type.js +2 -0
- package/dist/types/theme.type.d.ts +63 -0
- package/dist/types/theme.type.js +2 -0
- package/dist/types/token.type.d.ts +41 -0
- package/dist/types/token.type.js +10 -0
- package/dist/types/update-job.type.d.ts +49 -0
- package/dist/types/update-job.type.js +18 -0
- package/dist/types/use-case.type.d.ts +81 -0
- package/dist/types/use-case.type.js +2 -0
- package/dist/types/user-token.type.d.ts +33 -0
- package/dist/types/user-token.type.js +2 -0
- package/dist/types/user-visit.type.d.ts +41 -0
- package/dist/types/user-visit.type.js +11 -0
- package/dist/types/user.type.d.ts +71 -0
- package/dist/types/user.type.js +15 -0
- package/package.json +28 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GeneralConfigModel = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const general_config_type_1 = require("../types/general-config.type");
|
|
6
|
+
const _config_1 = require("../config");
|
|
7
|
+
const generalConfigSchema = new mongoose_1.Schema({
|
|
8
|
+
generalConfigSub: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'GeneralConfigSub', default: null }],
|
|
9
|
+
type: { type: String, enum: Object.values(general_config_type_1.Type), required: true },
|
|
10
|
+
context: { type: String, enum: Object.values(general_config_type_1.Context), required: true },
|
|
11
|
+
key: { type: String, enum: Object.values(general_config_type_1.Key), required: true },
|
|
12
|
+
value: { type: String, required: true },
|
|
13
|
+
updatedDate: Number,
|
|
14
|
+
createdDate: Number,
|
|
15
|
+
}, _config_1.schemaOptions);
|
|
16
|
+
exports.GeneralConfigModel = (0, mongoose_1.model)('GeneralConfig', generalConfigSchema);
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ImageModel = void 0;
|
|
7
|
+
const mongoose_1 = require("mongoose");
|
|
8
|
+
const express_http_context_1 = __importDefault(require("express-http-context"));
|
|
9
|
+
const image_type_1 = require("../types/image.type");
|
|
10
|
+
const _config_1 = require("../config");
|
|
11
|
+
const imageSchema = new mongoose_1.Schema({
|
|
12
|
+
fileName: { type: String, required: [true, 'fileName required'] },
|
|
13
|
+
originalFileName: { type: String, required: [true, 'originalFileName required'] },
|
|
14
|
+
fileSize: { type: Number, required: [true, 'fileSize required'] },
|
|
15
|
+
imageFor: { type: String, enum: Object.values(image_type_1.ImageFor) },
|
|
16
|
+
uploader: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User', default: null },
|
|
17
|
+
altTags: [
|
|
18
|
+
{
|
|
19
|
+
url: { type: String, default: '' },
|
|
20
|
+
text: { type: String, required: [true, 'text is required'] },
|
|
21
|
+
isDefault: { type: Boolean, default: false },
|
|
22
|
+
isRegex: { type: Boolean, default: false },
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
altTag: { type: String, default: '' },
|
|
26
|
+
createdBy: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User', default: null },
|
|
27
|
+
updatedBy: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User', default: null },
|
|
28
|
+
updatedDate: { type: Number, index: -1 },
|
|
29
|
+
createdDate: { type: Number, index: -1 },
|
|
30
|
+
}, _config_1.schemaOptions);
|
|
31
|
+
imageSchema.pre('save', function (next) {
|
|
32
|
+
const user = express_http_context_1.default.get('user');
|
|
33
|
+
if (user) {
|
|
34
|
+
if (!this.createdBy)
|
|
35
|
+
this.createdBy = user._id;
|
|
36
|
+
this.updatedBy = user._id;
|
|
37
|
+
}
|
|
38
|
+
next();
|
|
39
|
+
});
|
|
40
|
+
imageSchema.pre('findOneAndUpdate', function (next) {
|
|
41
|
+
const user = express_http_context_1.default.get('user');
|
|
42
|
+
if (user)
|
|
43
|
+
this._update.updatedBy = user._id;
|
|
44
|
+
next();
|
|
45
|
+
});
|
|
46
|
+
exports.ImageModel = (0, mongoose_1.model)('Image', imageSchema);
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ThemeModel as Theme } from './theme.model';
|
|
2
|
+
import { ProblemModel as Problem } from './problem.model';
|
|
3
|
+
import { SFTagModel as SFTag } from './sf-tag.model';
|
|
4
|
+
import { SFCategoryModel as SFCategory } from './sf-category.model';
|
|
5
|
+
import { SFSubCategoryModel as SFSubCategory } from './sf-sub-category.model';
|
|
6
|
+
import { TechnologyModel as Technology } from './technology.model';
|
|
7
|
+
import { IndustryModel as Industry } from './industry.model';
|
|
8
|
+
import { BackendErrorModel as BackendError } from './backend-error.model';
|
|
9
|
+
import { EvidenceModel as Evidence } from './evidence.model';
|
|
10
|
+
import { EvidenceLayoutModel as EvidenceLayout } from './evidence-layout.model';
|
|
11
|
+
import { ImageModel as Image } from './image.model';
|
|
12
|
+
import { SearchHistoryModel as SearchHistory } from './search-history.model';
|
|
13
|
+
import { TokenModel as Token } from './token.model';
|
|
14
|
+
import { UserTokenModel as UserToken } from './user-token.model';
|
|
15
|
+
import { UserModel as User } from './user.model';
|
|
16
|
+
import { CompanyModel as Company } from './company.model';
|
|
17
|
+
import { PortiaArticleModel as PortiaArticle } from './portia-article.model';
|
|
18
|
+
import { InstantResearchModel as InstantResearch } from './instant-research.model';
|
|
19
|
+
import { ContactMessageModel as ContactMessage } from './contact-message.model';
|
|
20
|
+
import { ContactStartupModel as ContactStartup } from './contact-startup.model';
|
|
21
|
+
import { BadgeModel as Badge } from './badge.model';
|
|
22
|
+
import { ContentModel as Content } from './content.model';
|
|
23
|
+
import { FaqModel as FAQ } from './faq.model';
|
|
24
|
+
import { UseCaseModel as UseCase } from './use-case.model';
|
|
25
|
+
import { NewsModel as News } from './news.model';
|
|
26
|
+
import { LikeModel as Like } from './like.model';
|
|
27
|
+
import { SparkModel as Spark } from './spark.model';
|
|
28
|
+
import { SparkUseCaseModel as SparkUseCase } from './spark-use-case.model';
|
|
29
|
+
import { FollowContentModel as FollowContent } from './follow-content.model';
|
|
30
|
+
import { SiteMapCacheModel as SiteMapCache } from './site-map-cache.model';
|
|
31
|
+
import { GeneralConfigModel as GeneralConfig } from './general-config.model';
|
|
32
|
+
import { GeneralConfigSubModel as GeneralConfigSub } from './general-config-sub.model';
|
|
33
|
+
import { DraftVersionModel as DraftVersion } from './draft-version.model';
|
|
34
|
+
import { NotificationModel as Notification } from './notification.model';
|
|
35
|
+
import { OtpModel as Otp } from './otp.model';
|
|
36
|
+
import { SuggestModel as Suggest } from './suggest.model';
|
|
37
|
+
import { UserVisitModel as UserVisit } from './user-visit.model';
|
|
38
|
+
import { CompetitorModel as Competitor } from './competitor.model';
|
|
39
|
+
export { User, UserToken, BackendError, Company, ContactMessage, ContactStartup, Evidence, Image, Notification, SearchHistory, Token, EvidenceLayout, Badge, Content, FAQ, Theme, UseCase, News, Like, Spark, SparkUseCase, FollowContent, SiteMapCache, GeneralConfig, GeneralConfigSub, Industry, Technology, SFCategory, SFSubCategory, SFTag, DraftVersion, Problem, PortiaArticle, InstantResearch, Otp, Suggest, UserVisit, Competitor, };
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Competitor = exports.UserVisit = exports.Suggest = exports.Otp = exports.InstantResearch = exports.PortiaArticle = exports.Problem = exports.DraftVersion = exports.SFTag = exports.SFSubCategory = exports.SFCategory = exports.Technology = exports.Industry = exports.GeneralConfigSub = exports.GeneralConfig = exports.SiteMapCache = exports.FollowContent = exports.SparkUseCase = exports.Spark = exports.Like = exports.News = exports.UseCase = exports.Theme = exports.FAQ = exports.Content = exports.Badge = exports.EvidenceLayout = exports.Token = exports.SearchHistory = exports.Notification = exports.Image = exports.Evidence = exports.ContactStartup = exports.ContactMessage = exports.Company = exports.BackendError = exports.UserToken = exports.User = void 0;
|
|
4
|
+
const theme_model_1 = require("./theme.model");
|
|
5
|
+
Object.defineProperty(exports, "Theme", { enumerable: true, get: function () { return theme_model_1.ThemeModel; } });
|
|
6
|
+
const problem_model_1 = require("./problem.model");
|
|
7
|
+
Object.defineProperty(exports, "Problem", { enumerable: true, get: function () { return problem_model_1.ProblemModel; } });
|
|
8
|
+
const sf_tag_model_1 = require("./sf-tag.model");
|
|
9
|
+
Object.defineProperty(exports, "SFTag", { enumerable: true, get: function () { return sf_tag_model_1.SFTagModel; } });
|
|
10
|
+
const sf_category_model_1 = require("./sf-category.model");
|
|
11
|
+
Object.defineProperty(exports, "SFCategory", { enumerable: true, get: function () { return sf_category_model_1.SFCategoryModel; } });
|
|
12
|
+
const sf_sub_category_model_1 = require("./sf-sub-category.model");
|
|
13
|
+
Object.defineProperty(exports, "SFSubCategory", { enumerable: true, get: function () { return sf_sub_category_model_1.SFSubCategoryModel; } });
|
|
14
|
+
const technology_model_1 = require("./technology.model");
|
|
15
|
+
Object.defineProperty(exports, "Technology", { enumerable: true, get: function () { return technology_model_1.TechnologyModel; } });
|
|
16
|
+
const industry_model_1 = require("./industry.model");
|
|
17
|
+
Object.defineProperty(exports, "Industry", { enumerable: true, get: function () { return industry_model_1.IndustryModel; } });
|
|
18
|
+
const backend_error_model_1 = require("./backend-error.model");
|
|
19
|
+
Object.defineProperty(exports, "BackendError", { enumerable: true, get: function () { return backend_error_model_1.BackendErrorModel; } });
|
|
20
|
+
const evidence_model_1 = require("./evidence.model");
|
|
21
|
+
Object.defineProperty(exports, "Evidence", { enumerable: true, get: function () { return evidence_model_1.EvidenceModel; } });
|
|
22
|
+
const evidence_layout_model_1 = require("./evidence-layout.model");
|
|
23
|
+
Object.defineProperty(exports, "EvidenceLayout", { enumerable: true, get: function () { return evidence_layout_model_1.EvidenceLayoutModel; } });
|
|
24
|
+
const image_model_1 = require("./image.model");
|
|
25
|
+
Object.defineProperty(exports, "Image", { enumerable: true, get: function () { return image_model_1.ImageModel; } });
|
|
26
|
+
const search_history_model_1 = require("./search-history.model");
|
|
27
|
+
Object.defineProperty(exports, "SearchHistory", { enumerable: true, get: function () { return search_history_model_1.SearchHistoryModel; } });
|
|
28
|
+
const token_model_1 = require("./token.model");
|
|
29
|
+
Object.defineProperty(exports, "Token", { enumerable: true, get: function () { return token_model_1.TokenModel; } });
|
|
30
|
+
const user_token_model_1 = require("./user-token.model");
|
|
31
|
+
Object.defineProperty(exports, "UserToken", { enumerable: true, get: function () { return user_token_model_1.UserTokenModel; } });
|
|
32
|
+
const user_model_1 = require("./user.model");
|
|
33
|
+
Object.defineProperty(exports, "User", { enumerable: true, get: function () { return user_model_1.UserModel; } });
|
|
34
|
+
const company_model_1 = require("./company.model");
|
|
35
|
+
Object.defineProperty(exports, "Company", { enumerable: true, get: function () { return company_model_1.CompanyModel; } });
|
|
36
|
+
const portia_article_model_1 = require("./portia-article.model");
|
|
37
|
+
Object.defineProperty(exports, "PortiaArticle", { enumerable: true, get: function () { return portia_article_model_1.PortiaArticleModel; } });
|
|
38
|
+
const instant_research_model_1 = require("./instant-research.model");
|
|
39
|
+
Object.defineProperty(exports, "InstantResearch", { enumerable: true, get: function () { return instant_research_model_1.InstantResearchModel; } });
|
|
40
|
+
const contact_message_model_1 = require("./contact-message.model");
|
|
41
|
+
Object.defineProperty(exports, "ContactMessage", { enumerable: true, get: function () { return contact_message_model_1.ContactMessageModel; } });
|
|
42
|
+
const contact_startup_model_1 = require("./contact-startup.model");
|
|
43
|
+
Object.defineProperty(exports, "ContactStartup", { enumerable: true, get: function () { return contact_startup_model_1.ContactStartupModel; } });
|
|
44
|
+
const badge_model_1 = require("./badge.model");
|
|
45
|
+
Object.defineProperty(exports, "Badge", { enumerable: true, get: function () { return badge_model_1.BadgeModel; } });
|
|
46
|
+
const content_model_1 = require("./content.model");
|
|
47
|
+
Object.defineProperty(exports, "Content", { enumerable: true, get: function () { return content_model_1.ContentModel; } });
|
|
48
|
+
const faq_model_1 = require("./faq.model");
|
|
49
|
+
Object.defineProperty(exports, "FAQ", { enumerable: true, get: function () { return faq_model_1.FaqModel; } });
|
|
50
|
+
const use_case_model_1 = require("./use-case.model");
|
|
51
|
+
Object.defineProperty(exports, "UseCase", { enumerable: true, get: function () { return use_case_model_1.UseCaseModel; } });
|
|
52
|
+
const news_model_1 = require("./news.model");
|
|
53
|
+
Object.defineProperty(exports, "News", { enumerable: true, get: function () { return news_model_1.NewsModel; } });
|
|
54
|
+
const like_model_1 = require("./like.model");
|
|
55
|
+
Object.defineProperty(exports, "Like", { enumerable: true, get: function () { return like_model_1.LikeModel; } });
|
|
56
|
+
const spark_model_1 = require("./spark.model");
|
|
57
|
+
Object.defineProperty(exports, "Spark", { enumerable: true, get: function () { return spark_model_1.SparkModel; } });
|
|
58
|
+
const spark_use_case_model_1 = require("./spark-use-case.model");
|
|
59
|
+
Object.defineProperty(exports, "SparkUseCase", { enumerable: true, get: function () { return spark_use_case_model_1.SparkUseCaseModel; } });
|
|
60
|
+
const follow_content_model_1 = require("./follow-content.model");
|
|
61
|
+
Object.defineProperty(exports, "FollowContent", { enumerable: true, get: function () { return follow_content_model_1.FollowContentModel; } });
|
|
62
|
+
const site_map_cache_model_1 = require("./site-map-cache.model");
|
|
63
|
+
Object.defineProperty(exports, "SiteMapCache", { enumerable: true, get: function () { return site_map_cache_model_1.SiteMapCacheModel; } });
|
|
64
|
+
const general_config_model_1 = require("./general-config.model");
|
|
65
|
+
Object.defineProperty(exports, "GeneralConfig", { enumerable: true, get: function () { return general_config_model_1.GeneralConfigModel; } });
|
|
66
|
+
const general_config_sub_model_1 = require("./general-config-sub.model");
|
|
67
|
+
Object.defineProperty(exports, "GeneralConfigSub", { enumerable: true, get: function () { return general_config_sub_model_1.GeneralConfigSubModel; } });
|
|
68
|
+
const draft_version_model_1 = require("./draft-version.model");
|
|
69
|
+
Object.defineProperty(exports, "DraftVersion", { enumerable: true, get: function () { return draft_version_model_1.DraftVersionModel; } });
|
|
70
|
+
const notification_model_1 = require("./notification.model");
|
|
71
|
+
Object.defineProperty(exports, "Notification", { enumerable: true, get: function () { return notification_model_1.NotificationModel; } });
|
|
72
|
+
const otp_model_1 = require("./otp.model");
|
|
73
|
+
Object.defineProperty(exports, "Otp", { enumerable: true, get: function () { return otp_model_1.OtpModel; } });
|
|
74
|
+
const suggest_model_1 = require("./suggest.model");
|
|
75
|
+
Object.defineProperty(exports, "Suggest", { enumerable: true, get: function () { return suggest_model_1.SuggestModel; } });
|
|
76
|
+
const user_visit_model_1 = require("./user-visit.model");
|
|
77
|
+
Object.defineProperty(exports, "UserVisit", { enumerable: true, get: function () { return user_visit_model_1.UserVisitModel; } });
|
|
78
|
+
const competitor_model_1 = require("./competitor.model");
|
|
79
|
+
Object.defineProperty(exports, "Competitor", { enumerable: true, get: function () { return competitor_model_1.CompetitorModel; } });
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.IndustryModel = void 0;
|
|
7
|
+
const mongoose_1 = require("mongoose");
|
|
8
|
+
const express_http_context_1 = __importDefault(require("express-http-context"));
|
|
9
|
+
const _config_1 = require("../config");
|
|
10
|
+
const industrySchema = new mongoose_1.Schema({
|
|
11
|
+
name: { type: String, required: [true, 'name required!'], unique: true },
|
|
12
|
+
synonyms: { type: String, default: '' },
|
|
13
|
+
description: { type: String, default: '' },
|
|
14
|
+
createdBy: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User', default: null },
|
|
15
|
+
updatedBy: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User', default: null },
|
|
16
|
+
updatedDate: { type: Number, index: -1 },
|
|
17
|
+
createdDate: { type: Number, index: -1 },
|
|
18
|
+
}, _config_1.schemaOptions);
|
|
19
|
+
industrySchema.pre('save', function (next) {
|
|
20
|
+
const user = express_http_context_1.default.get('user');
|
|
21
|
+
if (user) {
|
|
22
|
+
if (!this.createdBy)
|
|
23
|
+
this.createdBy = user._id;
|
|
24
|
+
this.updatedBy = user._id;
|
|
25
|
+
}
|
|
26
|
+
next();
|
|
27
|
+
});
|
|
28
|
+
industrySchema.pre('findOneAndUpdate', function (next) {
|
|
29
|
+
const user = express_http_context_1.default.get('user');
|
|
30
|
+
if (user)
|
|
31
|
+
this._update.updatedBy = user._id;
|
|
32
|
+
next();
|
|
33
|
+
});
|
|
34
|
+
exports.IndustryModel = (0, mongoose_1.model)('Industry', industrySchema);
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.InstantResearchModel = void 0;
|
|
7
|
+
const mongoose_1 = require("mongoose");
|
|
8
|
+
const express_http_context_1 = __importDefault(require("express-http-context"));
|
|
9
|
+
const instant_research_type_1 = require("../types/instant-research.type");
|
|
10
|
+
const _config_1 = require("../config");
|
|
11
|
+
const instantResearchSchema = new mongoose_1.Schema({
|
|
12
|
+
userId: { type: mongoose_1.Schema.Types.ObjectId, required: true, ref: 'User' },
|
|
13
|
+
slug: { type: String, required: [true, 'slug is required'], unique: true },
|
|
14
|
+
brief: { type: String, required: true },
|
|
15
|
+
briefWriteUp: { type: String, default: '' },
|
|
16
|
+
titleInfo: {
|
|
17
|
+
type: {
|
|
18
|
+
success: { type: Boolean },
|
|
19
|
+
text: { type: String },
|
|
20
|
+
reason: { type: String },
|
|
21
|
+
},
|
|
22
|
+
default: null,
|
|
23
|
+
},
|
|
24
|
+
targetMarkets: {
|
|
25
|
+
type: {
|
|
26
|
+
region: {
|
|
27
|
+
type: String,
|
|
28
|
+
enum: Object.values(instant_research_type_1.Region),
|
|
29
|
+
default: instant_research_type_1.Region.GLOBAL,
|
|
30
|
+
},
|
|
31
|
+
selectedCountries: {
|
|
32
|
+
type: [String],
|
|
33
|
+
},
|
|
34
|
+
selectedContinents: {
|
|
35
|
+
type: [String],
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
default: null,
|
|
39
|
+
},
|
|
40
|
+
status: {
|
|
41
|
+
type: String,
|
|
42
|
+
enum: Object.values(instant_research_type_1.Status),
|
|
43
|
+
default: instant_research_type_1.Status.BRIEFING,
|
|
44
|
+
},
|
|
45
|
+
reportType: {
|
|
46
|
+
type: String,
|
|
47
|
+
enum: Object.values(instant_research_type_1.ReportType),
|
|
48
|
+
},
|
|
49
|
+
persona: {
|
|
50
|
+
type: String,
|
|
51
|
+
enum: Object.values(instant_research_type_1.Persona),
|
|
52
|
+
},
|
|
53
|
+
executiveSummary: { type: String, default: '' },
|
|
54
|
+
companyAnalysis: {
|
|
55
|
+
finished: { type: Number },
|
|
56
|
+
inProgress: { type: Number },
|
|
57
|
+
},
|
|
58
|
+
metadata: {
|
|
59
|
+
generalInfoSection: {
|
|
60
|
+
portiaArticlesCount: { type: Object, default: { publish: 0, private: 0, draft: 0, prePublish: 0 } },
|
|
61
|
+
useCaseCount: { type: Object, default: { publish: 0, private: 0, draft: 0, prePublish: 0 } },
|
|
62
|
+
useCaseIdentifiedCount: { type: Object, default: { publish: 0, private: 0, draft: 0, prePublish: 0 } },
|
|
63
|
+
},
|
|
64
|
+
enterpriseStartupOthersSection: {
|
|
65
|
+
enterpriseCount: { type: Object, default: { publish: 0, private: 0, draft: 0, prePublish: 0 } },
|
|
66
|
+
startupCount: { type: Object, default: { publish: 0, private: 0, draft: 0, prePublish: 0 } },
|
|
67
|
+
otherCount: { type: Object, default: { publish: 0, private: 0, draft: 0, prePublish: 0 } },
|
|
68
|
+
},
|
|
69
|
+
geographicDistributionSection: {
|
|
70
|
+
startupContinentInfo: [
|
|
71
|
+
{
|
|
72
|
+
type: Object,
|
|
73
|
+
default: {
|
|
74
|
+
name: { type: String, default: '' },
|
|
75
|
+
companyCount: { type: Object, default: { publish: 0, private: 0, draft: 0, prePublish: 0 } },
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
],
|
|
79
|
+
enterpriseContinentInfo: [
|
|
80
|
+
{
|
|
81
|
+
type: Object,
|
|
82
|
+
default: {
|
|
83
|
+
name: { type: String, default: '' },
|
|
84
|
+
companyCount: { type: Object, default: { publish: 0, private: 0, draft: 0, prePublish: 0 } },
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
},
|
|
89
|
+
supercasesUsecasesSection: {
|
|
90
|
+
superCaseCount: { type: Object, default: { publish: 0, private: 0, draft: 0, prePublish: 0 } },
|
|
91
|
+
useCaseCount: { type: Object, default: { publish: 0, private: 0, draft: 0, prePublish: 0 } },
|
|
92
|
+
},
|
|
93
|
+
portiaArticlesByCategorySection: {
|
|
94
|
+
categoryStats: [
|
|
95
|
+
{
|
|
96
|
+
type: Object,
|
|
97
|
+
default: { name: { type: String }, count: { type: Object, default: { publish: 0, private: 0, draft: 0, prePublish: 0 } } },
|
|
98
|
+
},
|
|
99
|
+
],
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
lastVisited: { type: Number },
|
|
103
|
+
source: [{ type: String }],
|
|
104
|
+
description: { type: String },
|
|
105
|
+
showCounts: { type: Boolean, default: false },
|
|
106
|
+
marketResearch: [
|
|
107
|
+
{
|
|
108
|
+
title: String,
|
|
109
|
+
content: String,
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
reportDetails: { type: mongoose_1.Schema.Types.Mixed },
|
|
113
|
+
sectionHeaders: [{ type: String }],
|
|
114
|
+
selectedCompanies: [{ type: String }],
|
|
115
|
+
useCasesByGeography: {
|
|
116
|
+
infoList: [
|
|
117
|
+
{
|
|
118
|
+
technologyTag: { type: String },
|
|
119
|
+
continent: { type: String },
|
|
120
|
+
companyCount: { type: Number },
|
|
121
|
+
},
|
|
122
|
+
],
|
|
123
|
+
},
|
|
124
|
+
instantSparks: [
|
|
125
|
+
{
|
|
126
|
+
sparkId: { type: mongoose_1.Schema.Types.ObjectId },
|
|
127
|
+
status: {
|
|
128
|
+
type: String,
|
|
129
|
+
enum: Object.values(instant_research_type_1.InstantSparkStatus),
|
|
130
|
+
},
|
|
131
|
+
sparkResponse: { type: mongoose_1.Schema.Types.Mixed },
|
|
132
|
+
useCaseCount: { type: Number },
|
|
133
|
+
mainWebpage: {
|
|
134
|
+
companyId: { type: mongoose_1.Schema.Types.ObjectId, ref: 'Companies' },
|
|
135
|
+
score: { type: Number },
|
|
136
|
+
companyName: { type: String },
|
|
137
|
+
webpage: { type: String },
|
|
138
|
+
},
|
|
139
|
+
error: { type: String },
|
|
140
|
+
},
|
|
141
|
+
],
|
|
142
|
+
focusAreas: [{ title: String, total: Number, locations: Object, companies: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'Company' }] }],
|
|
143
|
+
foamTrees: [{ label: { type: String }, weight: { type: Number }, id: { type: String }, type: { type: String }, groups: { type: Array } }],
|
|
144
|
+
writtenBy: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'User' }],
|
|
145
|
+
sfIndustries: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'Industry' }],
|
|
146
|
+
sfTechnologies: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'Technology' }],
|
|
147
|
+
sfCategories: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'SFCategory' }],
|
|
148
|
+
sfSubCategories: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'SFSubCategory' }],
|
|
149
|
+
sfTags: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'SFTag' }],
|
|
150
|
+
isBriefCompleted: { type: Boolean, default: false },
|
|
151
|
+
createdBy: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User', default: null },
|
|
152
|
+
updatedBy: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User', default: null },
|
|
153
|
+
updatedDate: { type: Number, index: -1 },
|
|
154
|
+
createdDate: { type: Number, index: -1 },
|
|
155
|
+
}, _config_1.schemaOptions);
|
|
156
|
+
instantResearchSchema.pre('save', function (next) {
|
|
157
|
+
const user = express_http_context_1.default.get('user');
|
|
158
|
+
const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
|
|
159
|
+
if (user) {
|
|
160
|
+
if (!this.createdBy)
|
|
161
|
+
this.createdBy = user._id;
|
|
162
|
+
if (!notUpdatedBy)
|
|
163
|
+
this.updatedBy = user._id;
|
|
164
|
+
}
|
|
165
|
+
next();
|
|
166
|
+
});
|
|
167
|
+
instantResearchSchema.pre('findOneAndUpdate', function (next) {
|
|
168
|
+
const user = express_http_context_1.default.get('user');
|
|
169
|
+
const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
|
|
170
|
+
if (user && !notUpdatedBy)
|
|
171
|
+
this._update.updatedBy = user._id;
|
|
172
|
+
next();
|
|
173
|
+
});
|
|
174
|
+
exports.InstantResearchModel = (0, mongoose_1.model)('InstantResearch', instantResearchSchema);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.InvestorModel = void 0;
|
|
7
|
+
const mongoose_1 = require("mongoose");
|
|
8
|
+
const express_http_context_1 = __importDefault(require("express-http-context"));
|
|
9
|
+
const _config_1 = require("../config");
|
|
10
|
+
const instantResearchSchema = new mongoose_1.Schema({
|
|
11
|
+
company: { type: mongoose_1.Schema.Types.ObjectId, required: true, ref: 'Company' },
|
|
12
|
+
investor: { type: mongoose_1.Schema.Types.ObjectId, required: true, ref: 'Company' },
|
|
13
|
+
createdBy: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User', default: null },
|
|
14
|
+
updatedBy: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User', default: null },
|
|
15
|
+
updatedDate: { type: Number, index: -1 },
|
|
16
|
+
createdDate: { type: Number, index: -1 },
|
|
17
|
+
}, _config_1.schemaOptions);
|
|
18
|
+
instantResearchSchema.pre('save', function (next) {
|
|
19
|
+
const user = express_http_context_1.default.get('user');
|
|
20
|
+
const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
|
|
21
|
+
if (user) {
|
|
22
|
+
if (!this.createdBy)
|
|
23
|
+
this.createdBy = user._id;
|
|
24
|
+
if (!notUpdatedBy)
|
|
25
|
+
this.updatedBy = user._id;
|
|
26
|
+
}
|
|
27
|
+
next();
|
|
28
|
+
});
|
|
29
|
+
instantResearchSchema.pre('findOneAndUpdate', function (next) {
|
|
30
|
+
const user = express_http_context_1.default.get('user');
|
|
31
|
+
const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
|
|
32
|
+
if (user && !notUpdatedBy)
|
|
33
|
+
this._update.updatedBy = user._id;
|
|
34
|
+
next();
|
|
35
|
+
});
|
|
36
|
+
exports.InvestorModel = (0, mongoose_1.model)('Investor', instantResearchSchema);
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.LikeModel = void 0;
|
|
7
|
+
const mongoose_1 = require("mongoose");
|
|
8
|
+
const express_http_context_1 = __importDefault(require("express-http-context"));
|
|
9
|
+
const like_type_1 = require("../types/like.type");
|
|
10
|
+
const _config_1 = require("../config");
|
|
11
|
+
const likeSchema = new mongoose_1.Schema({
|
|
12
|
+
user: {
|
|
13
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
14
|
+
ref: 'User',
|
|
15
|
+
required: [true, 'user is required'],
|
|
16
|
+
},
|
|
17
|
+
news: { type: mongoose_1.Schema.Types.ObjectId, ref: 'News', default: null },
|
|
18
|
+
theme: { type: mongoose_1.Schema.Types.ObjectId, ref: 'Theme', default: null },
|
|
19
|
+
evidence: { type: mongoose_1.Schema.Types.ObjectId, ref: 'Evidence', default: null },
|
|
20
|
+
usecase: { type: mongoose_1.Schema.Types.ObjectId, ref: 'UseCase', default: null },
|
|
21
|
+
problem: { type: mongoose_1.Schema.Types.ObjectId, ref: 'Problem', default: null },
|
|
22
|
+
type: { type: String, enum: Object.values(like_type_1.LikeContentType) },
|
|
23
|
+
createdBy: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User', default: null },
|
|
24
|
+
updatedBy: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User', default: null },
|
|
25
|
+
updatedDate: { type: Number, index: -1 },
|
|
26
|
+
createdDate: { type: Number, index: -1 },
|
|
27
|
+
}, _config_1.schemaOptions);
|
|
28
|
+
likeSchema.pre('save', function (next) {
|
|
29
|
+
const user = express_http_context_1.default.get('user');
|
|
30
|
+
if (user) {
|
|
31
|
+
if (!this.createdBy)
|
|
32
|
+
this.createdBy = user._id;
|
|
33
|
+
this.updatedBy = user._id;
|
|
34
|
+
}
|
|
35
|
+
next();
|
|
36
|
+
});
|
|
37
|
+
likeSchema.pre('findOneAndUpdate', function (next) {
|
|
38
|
+
const user = express_http_context_1.default.get('user');
|
|
39
|
+
if (user)
|
|
40
|
+
this._update.updatedBy = user._id;
|
|
41
|
+
next();
|
|
42
|
+
});
|
|
43
|
+
exports.LikeModel = (0, mongoose_1.model)('Like', likeSchema);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.INDEX = void 0;
|
|
4
|
+
const INDEX = [
|
|
5
|
+
{ createdDate: -1 },
|
|
6
|
+
{ type: 1 },
|
|
7
|
+
{ updatedDate: 1 },
|
|
8
|
+
{ updatedDate: -1 },
|
|
9
|
+
{ slug: 1, updatedDate: -1 },
|
|
10
|
+
{ slug: -1, updatedDate: -1 },
|
|
11
|
+
{ type: 1, updatedDate: -1 },
|
|
12
|
+
{ type: -1, updatedDate: -1 },
|
|
13
|
+
{ slug: 1 },
|
|
14
|
+
{ slug: -1 },
|
|
15
|
+
{ status: 1 },
|
|
16
|
+
{ status: -1 },
|
|
17
|
+
{ status: 1, updatedDate: -1 },
|
|
18
|
+
{ deleteDate: 1 },
|
|
19
|
+
{ name: 1 },
|
|
20
|
+
{ website: 1 },
|
|
21
|
+
{ websiteBaseDomain: 1 },
|
|
22
|
+
{ profileDetailUrls: 1 },
|
|
23
|
+
];
|
|
24
|
+
exports.INDEX = INDEX;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.NewsModel = void 0;
|
|
7
|
+
const mongoose_1 = require("mongoose");
|
|
8
|
+
const express_http_context_1 = __importDefault(require("express-http-context"));
|
|
9
|
+
const _config_1 = require("../config");
|
|
10
|
+
const newsSchema = new mongoose_1.Schema({
|
|
11
|
+
headline: { type: String, required: [true, 'headline is required!'] },
|
|
12
|
+
slug: { type: String, required: [true, 'slug is required!'], unique: true },
|
|
13
|
+
commentTime: { type: Number, default: 0, index: true },
|
|
14
|
+
images: [
|
|
15
|
+
{
|
|
16
|
+
originalUri: { type: String, default: '' },
|
|
17
|
+
uri: { type: String, default: '' },
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
commentText: { type: String, default: '' },
|
|
21
|
+
url: { type: String, default: '' },
|
|
22
|
+
logo: { type: String, default: '' },
|
|
23
|
+
category: { type: String, default: '' },
|
|
24
|
+
inLanguage: { type: String, default: '' },
|
|
25
|
+
isBasedOnUrl: { type: String, default: '' },
|
|
26
|
+
tags: [
|
|
27
|
+
{
|
|
28
|
+
id: { type: String, default: '' },
|
|
29
|
+
label: { type: String, default: '' },
|
|
30
|
+
tagbase: { type: String, default: '' },
|
|
31
|
+
positions: [
|
|
32
|
+
{
|
|
33
|
+
start: { type: Number, default: 0 },
|
|
34
|
+
end: { type: Number, default: 0 },
|
|
35
|
+
field: { type: String, default: '' },
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
},
|
|
39
|
+
],
|
|
40
|
+
hasRelated: { type: Boolean, default: false },
|
|
41
|
+
useCase: { type: mongoose_1.Schema.Types.ObjectId, ref: 'UseCase', default: null },
|
|
42
|
+
useCaseList: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'UseCase', index: true }],
|
|
43
|
+
likeCount: { type: Number, default: 0 },
|
|
44
|
+
dislikeCount: { type: Number, default: 0 },
|
|
45
|
+
createdBy: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User', default: null },
|
|
46
|
+
updatedBy: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User', default: null },
|
|
47
|
+
updatedDate: Number,
|
|
48
|
+
createdDate: Number,
|
|
49
|
+
}, _config_1.schemaOptions);
|
|
50
|
+
newsSchema.pre('save', function (next) {
|
|
51
|
+
if (this.tags.length > 0) {
|
|
52
|
+
this.tags = this.tags.map((o) => {
|
|
53
|
+
o.label = o.label.toLowerCase();
|
|
54
|
+
return o;
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
const user = express_http_context_1.default.get('user');
|
|
58
|
+
if (user) {
|
|
59
|
+
if (!this.createdBy)
|
|
60
|
+
this.createdBy = user._id;
|
|
61
|
+
this.updatedBy = user._id;
|
|
62
|
+
}
|
|
63
|
+
next();
|
|
64
|
+
});
|
|
65
|
+
newsSchema.pre('findOneAndUpdate', function (next) {
|
|
66
|
+
if (this._update?.tags?.length > 0) {
|
|
67
|
+
this._update.tags = this._update.tags.map((o) => {
|
|
68
|
+
o.label = o.label.toLowerCase();
|
|
69
|
+
return o;
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
const user = express_http_context_1.default.get('user');
|
|
73
|
+
if (user)
|
|
74
|
+
this._update.updatedBy = user._id;
|
|
75
|
+
next();
|
|
76
|
+
});
|
|
77
|
+
exports.NewsModel = (0, mongoose_1.model)('News', newsSchema);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NotificationModel = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const _config_1 = require("../config");
|
|
6
|
+
const notificationSchema = new mongoose_1.Schema({
|
|
7
|
+
user: {
|
|
8
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
9
|
+
ref: 'User',
|
|
10
|
+
required: [true, 'user required!'],
|
|
11
|
+
},
|
|
12
|
+
title: { type: String, required: [true, 'title required!'] },
|
|
13
|
+
message: { type: String, required: [true, 'message required!'] },
|
|
14
|
+
updatedDate: { type: Number, index: -1 },
|
|
15
|
+
createdDate: { type: Number, index: -1 },
|
|
16
|
+
}, _config_1.schemaOptions);
|
|
17
|
+
exports.NotificationModel = (0, mongoose_1.model)('Notification', notificationSchema);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OtpModel = void 0;
|
|
4
|
+
const mongoose_1 = require("mongoose");
|
|
5
|
+
const _config_1 = require("../config");
|
|
6
|
+
const otpSchema = new mongoose_1.Schema({
|
|
7
|
+
code: { type: String, required: true },
|
|
8
|
+
email: { type: String, required: true },
|
|
9
|
+
isVerified: { type: Boolean, required: true, default: false },
|
|
10
|
+
expiresAt: { type: Number, required: true },
|
|
11
|
+
incorrectTryCount: { type: Number, default: 0 },
|
|
12
|
+
updatedDate: Number,
|
|
13
|
+
createdDate: Number,
|
|
14
|
+
}, _config_1.schemaOptions);
|
|
15
|
+
exports.OtpModel = (0, mongoose_1.model)('Otp', otpSchema);
|