@cool-digital-solutions/interferir-models 1.0.17 → 1.0.19
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/index.d.ts +19 -2
- package/dist/index.js +21 -1
- package/dist/schemas/bookmark.schema.d.ts +28 -0
- package/dist/schemas/bookmark.schema.js +43 -0
- package/dist/schemas/company-cluster.schema.d.ts +28 -0
- package/dist/schemas/company-cluster.schema.js +46 -0
- package/dist/schemas/company-marketing.schema.d.ts +28 -0
- package/dist/schemas/company-marketing.schema.js +41 -0
- package/dist/schemas/competitor.schema.js +11 -2
- package/dist/schemas/index.d.ts +12 -1
- package/dist/schemas/index.js +23 -1
- package/dist/schemas/instant-research.schema.js +6 -0
- package/dist/schemas/portia-article.schema.js +1 -0
- package/dist/schemas/related-theme.schema.d.ts +28 -0
- package/dist/schemas/related-theme.schema.js +32 -0
- package/dist/schemas/search-history.schema.js +3 -3
- package/dist/schemas/spark-use-case.schema.js +1 -0
- package/dist/schemas/startup-vector-any-entity.schema.d.ts +28 -0
- package/dist/schemas/startup-vector-any-entity.schema.js +39 -0
- package/dist/schemas/use-case-discovery-problem.schema.d.ts +28 -0
- package/dist/schemas/use-case-discovery-problem.schema.js +32 -0
- package/dist/schemas/use-case-discovery.schema.d.ts +28 -0
- package/dist/schemas/use-case-discovery.schema.js +48 -0
- package/dist/schemas/user.schema.js +1 -0
- package/dist/types/bookmark.type.d.ts +47 -0
- package/dist/types/bookmark.type.js +17 -0
- package/dist/types/company-cluster.type.d.ts +49 -0
- package/dist/types/company-cluster.type.js +10 -0
- package/dist/types/company-marketing.type.d.ts +66 -0
- package/dist/types/company-marketing.type.js +15 -0
- package/dist/types/competitor.type.d.ts +8 -1
- package/dist/types/competitor.type.js +7 -0
- package/dist/types/general-config.type.d.ts +8 -3
- package/dist/types/general-config.type.js +5 -0
- package/dist/types/index.d.ts +8 -1
- package/dist/types/instant-research.type.d.ts +4 -0
- package/dist/types/problem.type.d.ts +1 -0
- package/dist/types/related-theme.type.d.ts +33 -0
- package/dist/types/related-theme.type.js +2 -0
- package/dist/types/search-history.type.d.ts +4 -4
- package/dist/types/spark-use-case.type.d.ts +1 -0
- package/dist/types/spark.type.d.ts +1 -0
- package/dist/types/startup-vector-any-entity.type.d.ts +48 -0
- package/dist/types/startup-vector-any-entity.type.js +15 -0
- package/dist/types/use-case-discovery-problem.type.d.ts +33 -0
- package/dist/types/use-case-discovery-problem.type.js +2 -0
- package/dist/types/use-case-discovery.type.d.ts +50 -0
- package/dist/types/use-case-discovery.type.js +10 -0
- package/dist/types/user.type.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2,8 +2,11 @@ import { IAiConversation, IAiConversationModel } from './types/ai-conversation.t
|
|
|
2
2
|
import { IBackendError, IBackendErrorModel } from './types/backend-error.type';
|
|
3
3
|
import { IBadge, IBadgeModel } from './types/badge.type';
|
|
4
4
|
import { IBatchHistory } from './types/batch-history.type';
|
|
5
|
+
import { IBookmark, IBookmarkModel } from './types/bookmark.type';
|
|
5
6
|
import { ICompany, ICompanyModel } from './types/company.type';
|
|
7
|
+
import { ICompanyCluster, ICompanyClusterModel } from './types/company-cluster.type';
|
|
6
8
|
import { ICompanyFundingRound, ICompanyFundingRoundModel } from './types/company-funding-round.type';
|
|
9
|
+
import { ICompanyMarketing, ICompanyMarketingModel } from './types/company-marketing.type';
|
|
7
10
|
import { ICompetitor, ICompetitorModel } from './types/competitor.type';
|
|
8
11
|
import { IContactMessage, IContactMessageModel } from './types/contact-message.type';
|
|
9
12
|
import { IContactStartup, IContactStartupModel } from './types/contact-startup.type';
|
|
@@ -25,6 +28,7 @@ import { INotification, INotificationModel } from './types/notification.type';
|
|
|
25
28
|
import { IOtp, IOtpModel } from './types/otp.type';
|
|
26
29
|
import { IPortiaArticle, IPortiaArticleModel } from './types/portia-article.type';
|
|
27
30
|
import { IProblem, IProblemModel } from './types/problem.type';
|
|
31
|
+
import { IRelatedTheme, IRelatedThemeModel } from './types/related-theme.type';
|
|
28
32
|
import { ISearchHistory, ISearchHistoryModel } from './types/search-history.type';
|
|
29
33
|
import { ISFCategory, ISFCategoryModel } from './types/sf-category.type';
|
|
30
34
|
import { ISFSubCategory, ISFSubCategoryModel } from './types/sf-sub-category.type';
|
|
@@ -32,12 +36,15 @@ import { ISFTag, ISFTagModel } from './types/sf-tag.type';
|
|
|
32
36
|
import { ISiteMapCache, ISiteMapCacheModel } from './types/site-map-cache.type';
|
|
33
37
|
import { ISparkUseCase, ISparkUseCaseModel } from './types/spark-use-case.type';
|
|
34
38
|
import { ISpark, ISparkModel } from './types/spark.type';
|
|
39
|
+
import { IStartupVectorAnyEntity, IStartupVectorAnyEntityModel } from './types/startup-vector-any-entity.type';
|
|
35
40
|
import { ISuggest, ISuggestModel } from './types/suggest.type';
|
|
36
41
|
import { ITechnology, ITechnologyModel } from './types/technology.type';
|
|
37
42
|
import { ITheme, IThemeModel } from './types/theme.type';
|
|
38
43
|
import { IToken, ITokenModel } from './types/token.type';
|
|
39
44
|
import { IUpdateJob, IUpdateJobModel } from './types/update-job.type';
|
|
40
45
|
import { IUseCase, IUseCaseModel } from './types/use-case.type';
|
|
46
|
+
import { IUseCaseDiscovery, IUseCaseDiscoveryModel } from './types/use-case-discovery.type';
|
|
47
|
+
import { IUseCaseDiscoveryProblem, IUseCaseDiscoveryProblemModel } from './types/use-case-discovery-problem.type';
|
|
41
48
|
import { IUserToken, IUserTokenModel } from './types/user-token.type';
|
|
42
49
|
import { IUserVisit, IUserVisitModel } from './types/user-visit.type';
|
|
43
50
|
import { IUser, IUserModel } from './types/user.type';
|
|
@@ -80,5 +87,15 @@ import SuggestSchema from './schemas/suggest.schema';
|
|
|
80
87
|
import UserVisitSchema from './schemas/user-visit.schema';
|
|
81
88
|
import CompetitorSchema from './schemas/competitor.schema';
|
|
82
89
|
import CompanyFundingRoundSchema from './schemas/company-funding-round.schema';
|
|
83
|
-
|
|
84
|
-
|
|
90
|
+
import BookmarkSchema from './schemas/bookmark.schema';
|
|
91
|
+
import AiConversationSchema from './schemas/ai-conversation.schema';
|
|
92
|
+
import CompanyClusterSchema from './schemas/company-cluster.schema';
|
|
93
|
+
import CompanyMarketingSchema from './schemas/company-marketing.schema';
|
|
94
|
+
import InvestorSchema from './schemas/investor.schema';
|
|
95
|
+
import RelatedThemeSchema from './schemas/related-theme.schema';
|
|
96
|
+
import StartupVectorAnyEntitySchema from './schemas/startup-vector-any-entity.schema';
|
|
97
|
+
import UpdateJobSchema from './schemas/update-job.schema';
|
|
98
|
+
import UseCaseDiscoverySchema from './schemas/use-case-discovery.schema';
|
|
99
|
+
import UseCaseDiscoveryProblemSchema from './schemas/use-case-discovery-problem.schema';
|
|
100
|
+
export { IAiConversation, IAiConversationModel, IBackendError, IBackendErrorModel, IBadge, IBadgeModel, IBatchHistory, IBookmark, IBookmarkModel, ICompany, ICompanyModel, ICompanyCluster, ICompanyClusterModel, ICompanyMarketing, ICompanyMarketingModel, ICompanyFundingRound, ICompanyFundingRoundModel, ICompetitor, ICompetitorModel, IContactMessage, IContactMessageModel, IContactStartup, IContactStartupModel, IContent, IContentModel, IDraftVersion, IDraftVersionModel, IEvidenceLayout, IEvidenceLayoutModel, IEvidence, IEvidenceModel, IFaq, IFaqModel, IFollowContent, IFollowContentModel, IGeneralConfigSub, IGeneralConfigSubModel, IGeneralConfig, IGeneralConfigModel, IImage, IImageModel, IIndustry, IIndustryModel, IInstantResearch, IInstantResearchModel, IInvestor, IInvestorModel, ILike, ILikeModel, INews, INewsModel, INotification, INotificationModel, IOtp, IOtpModel, IPortiaArticle, IPortiaArticleModel, IProblem, IProblemModel, IRelatedTheme, IRelatedThemeModel, ISearchHistory, ISearchHistoryModel, ISFCategory, ISFCategoryModel, ISFSubCategory, ISFSubCategoryModel, ISFTag, ISFTagModel, ISiteMapCache, ISiteMapCacheModel, ISparkUseCase, ISparkUseCaseModel, ISpark, ISparkModel, IStartupVectorAnyEntity, IStartupVectorAnyEntityModel, ISuggest, ISuggestModel, ITechnology, ITechnologyModel, ITheme, IThemeModel, IToken, ITokenModel, IUpdateJob, IUpdateJobModel, IUseCase, IUseCaseModel, IUseCaseDiscovery, IUseCaseDiscoveryModel, IUseCaseDiscoveryProblem, IUseCaseDiscoveryProblemModel, IUserToken, IUserTokenModel, IUserVisit, IUserVisitModel, IUser, IUserModel, };
|
|
101
|
+
export { ThemeSchema, ProblemSchema, SFTagSchema, SFCategorySchema, SFSubCategorySchema, TechnologySchema, IndustrySchema, BackendErrorSchema, EvidenceSchema, EvidenceLayoutSchema, ImageSchema, SearchHistorySchema, TokenSchema, UserTokenSchema, UserSchema, CompanySchema, PortiaArticleSchema, InstantResearchSchema, ContactMessageSchema, ContactStartupSchema, BadgeSchema, ContentSchema, FaqSchema, UseCaseSchema, NewsSchema, LikeSchema, SparkSchema, SparkUseCaseSchema, FollowContentSchema, SiteMapCacheSchema, GeneralConfigSchema, GeneralConfigSubSchema, DraftVersionSchema, NotificationSchema, OtpSchema, SuggestSchema, UserVisitSchema, CompetitorSchema, CompanyFundingRoundSchema, BookmarkSchema, AiConversationSchema, CompanyClusterSchema, CompanyMarketingSchema, InvestorSchema, RelatedThemeSchema, StartupVectorAnyEntitySchema, UpdateJobSchema, UseCaseDiscoverySchema, UseCaseDiscoveryProblemSchema, };
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.CompanyFundingRoundSchema = exports.CompetitorSchema = exports.UserVisitSchema = exports.SuggestSchema = exports.OtpSchema = exports.NotificationSchema = exports.DraftVersionSchema = exports.GeneralConfigSubSchema = exports.GeneralConfigSchema = exports.SiteMapCacheSchema = exports.FollowContentSchema = exports.SparkUseCaseSchema = exports.SparkSchema = exports.LikeSchema = exports.NewsSchema = exports.UseCaseSchema = exports.FaqSchema = exports.ContentSchema = exports.BadgeSchema = exports.ContactStartupSchema = exports.ContactMessageSchema = exports.InstantResearchSchema = exports.PortiaArticleSchema = exports.CompanySchema = exports.UserSchema = exports.UserTokenSchema = exports.TokenSchema = exports.SearchHistorySchema = exports.ImageSchema = exports.EvidenceLayoutSchema = exports.EvidenceSchema = exports.BackendErrorSchema = exports.IndustrySchema = exports.TechnologySchema = exports.SFSubCategorySchema = exports.SFCategorySchema = exports.SFTagSchema = exports.ProblemSchema = exports.ThemeSchema = void 0;
|
|
6
|
+
exports.UseCaseDiscoveryProblemSchema = exports.UseCaseDiscoverySchema = exports.UpdateJobSchema = exports.StartupVectorAnyEntitySchema = exports.RelatedThemeSchema = exports.InvestorSchema = exports.CompanyMarketingSchema = exports.CompanyClusterSchema = exports.AiConversationSchema = exports.BookmarkSchema = exports.CompanyFundingRoundSchema = exports.CompetitorSchema = exports.UserVisitSchema = exports.SuggestSchema = exports.OtpSchema = exports.NotificationSchema = exports.DraftVersionSchema = exports.GeneralConfigSubSchema = exports.GeneralConfigSchema = exports.SiteMapCacheSchema = exports.FollowContentSchema = exports.SparkUseCaseSchema = exports.SparkSchema = exports.LikeSchema = exports.NewsSchema = exports.UseCaseSchema = exports.FaqSchema = exports.ContentSchema = exports.BadgeSchema = exports.ContactStartupSchema = exports.ContactMessageSchema = exports.InstantResearchSchema = exports.PortiaArticleSchema = exports.CompanySchema = exports.UserSchema = exports.UserTokenSchema = exports.TokenSchema = exports.SearchHistorySchema = exports.ImageSchema = exports.EvidenceLayoutSchema = exports.EvidenceSchema = exports.BackendErrorSchema = exports.IndustrySchema = exports.TechnologySchema = exports.SFSubCategorySchema = exports.SFCategorySchema = exports.SFTagSchema = exports.ProblemSchema = exports.ThemeSchema = void 0;
|
|
7
7
|
const theme_schema_1 = __importDefault(require("./schemas/theme.schema"));
|
|
8
8
|
exports.ThemeSchema = theme_schema_1.default;
|
|
9
9
|
const problem_schema_1 = __importDefault(require("./schemas/problem.schema"));
|
|
@@ -82,3 +82,23 @@ const competitor_schema_1 = __importDefault(require("./schemas/competitor.schema
|
|
|
82
82
|
exports.CompetitorSchema = competitor_schema_1.default;
|
|
83
83
|
const company_funding_round_schema_1 = __importDefault(require("./schemas/company-funding-round.schema"));
|
|
84
84
|
exports.CompanyFundingRoundSchema = company_funding_round_schema_1.default;
|
|
85
|
+
const bookmark_schema_1 = __importDefault(require("./schemas/bookmark.schema"));
|
|
86
|
+
exports.BookmarkSchema = bookmark_schema_1.default;
|
|
87
|
+
const ai_conversation_schema_1 = __importDefault(require("./schemas/ai-conversation.schema"));
|
|
88
|
+
exports.AiConversationSchema = ai_conversation_schema_1.default;
|
|
89
|
+
const company_cluster_schema_1 = __importDefault(require("./schemas/company-cluster.schema"));
|
|
90
|
+
exports.CompanyClusterSchema = company_cluster_schema_1.default;
|
|
91
|
+
const company_marketing_schema_1 = __importDefault(require("./schemas/company-marketing.schema"));
|
|
92
|
+
exports.CompanyMarketingSchema = company_marketing_schema_1.default;
|
|
93
|
+
const investor_schema_1 = __importDefault(require("./schemas/investor.schema"));
|
|
94
|
+
exports.InvestorSchema = investor_schema_1.default;
|
|
95
|
+
const related_theme_schema_1 = __importDefault(require("./schemas/related-theme.schema"));
|
|
96
|
+
exports.RelatedThemeSchema = related_theme_schema_1.default;
|
|
97
|
+
const startup_vector_any_entity_schema_1 = __importDefault(require("./schemas/startup-vector-any-entity.schema"));
|
|
98
|
+
exports.StartupVectorAnyEntitySchema = startup_vector_any_entity_schema_1.default;
|
|
99
|
+
const update_job_schema_1 = __importDefault(require("./schemas/update-job.schema"));
|
|
100
|
+
exports.UpdateJobSchema = update_job_schema_1.default;
|
|
101
|
+
const use_case_discovery_schema_1 = __importDefault(require("./schemas/use-case-discovery.schema"));
|
|
102
|
+
exports.UseCaseDiscoverySchema = use_case_discovery_schema_1.default;
|
|
103
|
+
const use_case_discovery_problem_schema_1 = __importDefault(require("./schemas/use-case-discovery-problem.schema"));
|
|
104
|
+
exports.UseCaseDiscoveryProblemSchema = use_case_discovery_problem_schema_1.default;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
+
import { Schema } from 'mongoose';
|
|
26
|
+
import { IBookmark, IBookmarkModel } from '../types/bookmark.type';
|
|
27
|
+
declare const bookmarkSchema: Schema<IBookmark, IBookmarkModel, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, IBookmark>;
|
|
28
|
+
export default bookmarkSchema;
|
|
@@ -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
|
+
const mongoose_1 = require("mongoose");
|
|
7
|
+
const express_http_context_1 = __importDefault(require("express-http-context"));
|
|
8
|
+
const _config_1 = require("../config");
|
|
9
|
+
const bookmark_type_1 = require("../types/bookmark.type");
|
|
10
|
+
const bookmarkSchema = new mongoose_1.Schema({
|
|
11
|
+
user: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User', default: null },
|
|
12
|
+
type: {
|
|
13
|
+
type: String,
|
|
14
|
+
enum: Object.values(bookmark_type_1.BookmarkType),
|
|
15
|
+
required: [true, 'type is required'],
|
|
16
|
+
},
|
|
17
|
+
refModel: {
|
|
18
|
+
type: String,
|
|
19
|
+
enum: Object.values(bookmark_type_1.BookmarkRefModel),
|
|
20
|
+
required: [true, 'type is required'],
|
|
21
|
+
},
|
|
22
|
+
doc: { type: mongoose_1.Schema.Types.ObjectId, refPath: 'refType', default: null },
|
|
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: Number,
|
|
26
|
+
createdDate: Number,
|
|
27
|
+
}, _config_1.schemaOptions);
|
|
28
|
+
bookmarkSchema.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
|
+
bookmarkSchema.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.default = bookmarkSchema;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
+
import { Schema } from 'mongoose';
|
|
26
|
+
import { ICompanyCluster, ICompanyClusterModel } from '../types/company-cluster.type';
|
|
27
|
+
declare const companyClusterSchema: Schema<ICompanyCluster, ICompanyClusterModel, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, ICompanyCluster>;
|
|
28
|
+
export default companyClusterSchema;
|
|
@@ -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
|
+
const mongoose_1 = require("mongoose");
|
|
7
|
+
const express_http_context_1 = __importDefault(require("express-http-context"));
|
|
8
|
+
const _config_1 = require("../config");
|
|
9
|
+
const company_cluster_type_1 = require("../types/company-cluster.type");
|
|
10
|
+
const companyClusterSchema = new mongoose_1.Schema({
|
|
11
|
+
company: { type: mongoose_1.Schema.Types.ObjectId, ref: 'Company', required: true },
|
|
12
|
+
status: { type: String, enum: Object.values(company_cluster_type_1.companyClusterStatus), required: [true, 'status is required!'] },
|
|
13
|
+
entramindId: { type: String, default: '' },
|
|
14
|
+
response: [
|
|
15
|
+
{
|
|
16
|
+
message: { type: String, default: '' },
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
clusters: [
|
|
20
|
+
{
|
|
21
|
+
clusterTitle: { type: String, default: '' },
|
|
22
|
+
usecaseIds: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'UseCase' }],
|
|
23
|
+
providersIds: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'Company' }],
|
|
24
|
+
},
|
|
25
|
+
],
|
|
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: Number,
|
|
29
|
+
createdDate: Number,
|
|
30
|
+
}, _config_1.schemaOptions);
|
|
31
|
+
companyClusterSchema.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
|
+
companyClusterSchema.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.default = companyClusterSchema;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
+
import { Schema } from 'mongoose';
|
|
26
|
+
import { ICompanyMarketing, ICompanyMarketingModel } from '../types/company-marketing.type';
|
|
27
|
+
declare const companyMarketingSchema: Schema<ICompanyMarketing, ICompanyMarketingModel, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, ICompanyMarketing>;
|
|
28
|
+
export default companyMarketingSchema;
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
const mongoose_1 = require("mongoose");
|
|
7
|
+
const express_http_context_1 = __importDefault(require("express-http-context"));
|
|
8
|
+
const _config_1 = require("../config");
|
|
9
|
+
const company_marketing_type_1 = require("../types/company-marketing.type");
|
|
10
|
+
const companyMarketingSchema = new mongoose_1.Schema({
|
|
11
|
+
company: { type: mongoose_1.Schema.Types.ObjectId, ref: 'Company', required: true },
|
|
12
|
+
status: { type: String, enum: Object.values(company_marketing_type_1.CompanyMarketingMapStatus), required: [true, 'status is required!'] },
|
|
13
|
+
competitorType: { type: String, enum: Object.values(company_marketing_type_1.CompetitorType), required: [true, 'type is required!'] },
|
|
14
|
+
entramindId: { type: String, default: '' },
|
|
15
|
+
response: [
|
|
16
|
+
{
|
|
17
|
+
message: { type: String, default: '' },
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
marketingMap: { type: Object, default: {} },
|
|
21
|
+
createdBy: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User', default: null },
|
|
22
|
+
updatedBy: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User', default: null },
|
|
23
|
+
updatedDate: Number,
|
|
24
|
+
createdDate: Number,
|
|
25
|
+
}, _config_1.schemaOptions);
|
|
26
|
+
companyMarketingSchema.pre('save', function (next) {
|
|
27
|
+
const user = express_http_context_1.default.get('user');
|
|
28
|
+
if (user) {
|
|
29
|
+
if (!this.createdBy)
|
|
30
|
+
this.createdBy = user._id;
|
|
31
|
+
this.updatedBy = user._id;
|
|
32
|
+
}
|
|
33
|
+
next();
|
|
34
|
+
});
|
|
35
|
+
companyMarketingSchema.pre('findOneAndUpdate', function (next) {
|
|
36
|
+
const user = express_http_context_1.default.get('user');
|
|
37
|
+
if (user)
|
|
38
|
+
this._update.updatedBy = user._id;
|
|
39
|
+
next();
|
|
40
|
+
});
|
|
41
|
+
exports.default = companyMarketingSchema;
|
|
@@ -6,14 +6,23 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const mongoose_1 = require("mongoose");
|
|
7
7
|
const express_http_context_1 = __importDefault(require("express-http-context"));
|
|
8
8
|
const _config_1 = require("../config");
|
|
9
|
+
const competitor_type_1 = require("../types/competitor.type");
|
|
9
10
|
const competitorSchema = new mongoose_1.Schema({
|
|
10
|
-
company: { type: mongoose_1.Schema.Types.ObjectId, ref: 'Company', default: null
|
|
11
|
-
|
|
11
|
+
company: { type: mongoose_1.Schema.Types.ObjectId, ref: 'Company', default: null },
|
|
12
|
+
competitor: { type: mongoose_1.Schema.Types.ObjectId, ref: 'Company', default: null },
|
|
13
|
+
isPeerWatch: { type: Boolean, default: false },
|
|
14
|
+
type: {
|
|
15
|
+
type: String,
|
|
16
|
+
enum: Object.values(competitor_type_1.CompetitorType),
|
|
17
|
+
default: competitor_type_1.CompetitorType.DEFAULT,
|
|
18
|
+
},
|
|
12
19
|
createdBy: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User', default: null },
|
|
13
20
|
updatedBy: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User', default: null },
|
|
14
21
|
updatedDate: { type: Number, index: -1 },
|
|
15
22
|
createdDate: { type: Number, index: -1 },
|
|
16
23
|
}, _config_1.schemaOptions);
|
|
24
|
+
// Unique by company&competitor
|
|
25
|
+
competitorSchema.index({ company: 1, competitor: 1 }, { unique: true });
|
|
17
26
|
competitorSchema.pre('save', function (next) {
|
|
18
27
|
const user = express_http_context_1.default.get('user');
|
|
19
28
|
if (user) {
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -37,4 +37,15 @@ import SuggestSchema from './suggest.schema';
|
|
|
37
37
|
import UserVisitSchema from './user-visit.schema';
|
|
38
38
|
import CompetitorSchema from './competitor.schema';
|
|
39
39
|
import CompanyFundingRoundSchema from './company-funding-round.schema';
|
|
40
|
-
|
|
40
|
+
import BookmarkSchema from './bookmark.schema';
|
|
41
|
+
import AiConversationSchema from './ai-conversation.schema';
|
|
42
|
+
import BatchHistorySchema from './batch-history.schema';
|
|
43
|
+
import CompanyClusterSchema from './company-cluster.schema';
|
|
44
|
+
import CompanyMarketingSchema from './company-marketing.schema';
|
|
45
|
+
import InvestorSchema from './investor.schema';
|
|
46
|
+
import RelatedThemeSchema from './related-theme.schema';
|
|
47
|
+
import StartupVectorAnyEntitySchema from './startup-vector-any-entity.schema';
|
|
48
|
+
import UpdateJobSchema from './update-job.schema';
|
|
49
|
+
import UseCaseDiscoverySchema from './use-case-discovery.schema';
|
|
50
|
+
import UseCaseDiscoveryProblemSchema from './use-case-discovery-problem.schema';
|
|
51
|
+
export { ThemeSchema, ProblemSchema, SFTagSchema, SFCategorySchema, SFSubCategorySchema, TechnologySchema, IndustrySchema, BackendErrorSchema, EvidenceSchema, EvidenceLayoutSchema, ImageSchema, SearchHistorySchema, TokenSchema, UserTokenSchema, UserSchema, CompanySchema, PortiaArticleSchema, InstantResearchSchema, ContactMessageSchema, ContactStartupSchema, BadgeSchema, ContentSchema, FaqSchema, UseCaseSchema, NewsSchema, LikeSchema, SparkSchema, SparkUseCaseSchema, FollowContentSchema, SiteMapCacheSchema, GeneralConfigSchema, GeneralConfigSubSchema, DraftVersionSchema, NotificationSchema, OtpSchema, SuggestSchema, UserVisitSchema, CompetitorSchema, CompanyFundingRoundSchema, BookmarkSchema, AiConversationSchema, BatchHistorySchema, CompanyClusterSchema, CompanyMarketingSchema, InvestorSchema, RelatedThemeSchema, StartupVectorAnyEntitySchema, UpdateJobSchema, UseCaseDiscoverySchema, UseCaseDiscoveryProblemSchema, };
|
package/dist/schemas/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.CompanyFundingRoundSchema = exports.CompetitorSchema = exports.UserVisitSchema = exports.SuggestSchema = exports.OtpSchema = exports.NotificationSchema = exports.DraftVersionSchema = exports.GeneralConfigSubSchema = exports.GeneralConfigSchema = exports.SiteMapCacheSchema = exports.FollowContentSchema = exports.SparkUseCaseSchema = exports.SparkSchema = exports.LikeSchema = exports.NewsSchema = exports.UseCaseSchema = exports.FaqSchema = exports.ContentSchema = exports.BadgeSchema = exports.ContactStartupSchema = exports.ContactMessageSchema = exports.InstantResearchSchema = exports.PortiaArticleSchema = exports.CompanySchema = exports.UserSchema = exports.UserTokenSchema = exports.TokenSchema = exports.SearchHistorySchema = exports.ImageSchema = exports.EvidenceLayoutSchema = exports.EvidenceSchema = exports.BackendErrorSchema = exports.IndustrySchema = exports.TechnologySchema = exports.SFSubCategorySchema = exports.SFCategorySchema = exports.SFTagSchema = exports.ProblemSchema = exports.ThemeSchema = void 0;
|
|
6
|
+
exports.UseCaseDiscoveryProblemSchema = exports.UseCaseDiscoverySchema = exports.UpdateJobSchema = exports.StartupVectorAnyEntitySchema = exports.RelatedThemeSchema = exports.InvestorSchema = exports.CompanyMarketingSchema = exports.CompanyClusterSchema = exports.BatchHistorySchema = exports.AiConversationSchema = exports.BookmarkSchema = exports.CompanyFundingRoundSchema = exports.CompetitorSchema = exports.UserVisitSchema = exports.SuggestSchema = exports.OtpSchema = exports.NotificationSchema = exports.DraftVersionSchema = exports.GeneralConfigSubSchema = exports.GeneralConfigSchema = exports.SiteMapCacheSchema = exports.FollowContentSchema = exports.SparkUseCaseSchema = exports.SparkSchema = exports.LikeSchema = exports.NewsSchema = exports.UseCaseSchema = exports.FaqSchema = exports.ContentSchema = exports.BadgeSchema = exports.ContactStartupSchema = exports.ContactMessageSchema = exports.InstantResearchSchema = exports.PortiaArticleSchema = exports.CompanySchema = exports.UserSchema = exports.UserTokenSchema = exports.TokenSchema = exports.SearchHistorySchema = exports.ImageSchema = exports.EvidenceLayoutSchema = exports.EvidenceSchema = exports.BackendErrorSchema = exports.IndustrySchema = exports.TechnologySchema = exports.SFSubCategorySchema = exports.SFCategorySchema = exports.SFTagSchema = exports.ProblemSchema = exports.ThemeSchema = void 0;
|
|
7
7
|
const theme_schema_1 = __importDefault(require("./theme.schema"));
|
|
8
8
|
exports.ThemeSchema = theme_schema_1.default;
|
|
9
9
|
const problem_schema_1 = __importDefault(require("./problem.schema"));
|
|
@@ -82,3 +82,25 @@ const competitor_schema_1 = __importDefault(require("./competitor.schema"));
|
|
|
82
82
|
exports.CompetitorSchema = competitor_schema_1.default;
|
|
83
83
|
const company_funding_round_schema_1 = __importDefault(require("./company-funding-round.schema"));
|
|
84
84
|
exports.CompanyFundingRoundSchema = company_funding_round_schema_1.default;
|
|
85
|
+
const bookmark_schema_1 = __importDefault(require("./bookmark.schema"));
|
|
86
|
+
exports.BookmarkSchema = bookmark_schema_1.default;
|
|
87
|
+
const ai_conversation_schema_1 = __importDefault(require("./ai-conversation.schema"));
|
|
88
|
+
exports.AiConversationSchema = ai_conversation_schema_1.default;
|
|
89
|
+
const batch_history_schema_1 = __importDefault(require("./batch-history.schema"));
|
|
90
|
+
exports.BatchHistorySchema = batch_history_schema_1.default;
|
|
91
|
+
const company_cluster_schema_1 = __importDefault(require("./company-cluster.schema"));
|
|
92
|
+
exports.CompanyClusterSchema = company_cluster_schema_1.default;
|
|
93
|
+
const company_marketing_schema_1 = __importDefault(require("./company-marketing.schema"));
|
|
94
|
+
exports.CompanyMarketingSchema = company_marketing_schema_1.default;
|
|
95
|
+
const investor_schema_1 = __importDefault(require("./investor.schema"));
|
|
96
|
+
exports.InvestorSchema = investor_schema_1.default;
|
|
97
|
+
const related_theme_schema_1 = __importDefault(require("./related-theme.schema"));
|
|
98
|
+
exports.RelatedThemeSchema = related_theme_schema_1.default;
|
|
99
|
+
const startup_vector_any_entity_schema_1 = __importDefault(require("./startup-vector-any-entity.schema"));
|
|
100
|
+
exports.StartupVectorAnyEntitySchema = startup_vector_any_entity_schema_1.default;
|
|
101
|
+
const update_job_schema_1 = __importDefault(require("./update-job.schema"));
|
|
102
|
+
exports.UpdateJobSchema = update_job_schema_1.default;
|
|
103
|
+
const use_case_discovery_schema_1 = __importDefault(require("./use-case-discovery.schema"));
|
|
104
|
+
exports.UseCaseDiscoverySchema = use_case_discovery_schema_1.default;
|
|
105
|
+
const use_case_discovery_problem_schema_1 = __importDefault(require("./use-case-discovery-problem.schema"));
|
|
106
|
+
exports.UseCaseDiscoveryProblemSchema = use_case_discovery_problem_schema_1.default;
|
|
@@ -100,6 +100,12 @@ const instantResearchSchema = new mongoose_1.Schema({
|
|
|
100
100
|
},
|
|
101
101
|
lastVisited: { type: Number },
|
|
102
102
|
source: [{ type: String }],
|
|
103
|
+
mappedSource: [
|
|
104
|
+
{
|
|
105
|
+
id: { type: Number },
|
|
106
|
+
source: { type: String },
|
|
107
|
+
},
|
|
108
|
+
],
|
|
103
109
|
description: { type: String },
|
|
104
110
|
showCounts: { type: Boolean, default: false },
|
|
105
111
|
marketResearch: [
|
|
@@ -19,6 +19,7 @@ const portiaArticleSchema = new mongoose_1.Schema({
|
|
|
19
19
|
articleType: {
|
|
20
20
|
type: String,
|
|
21
21
|
enum: Object.values(portia_article_type_1.PortiaArticleTypes),
|
|
22
|
+
default: portia_article_type_1.PortiaArticleTypes.NEWS,
|
|
22
23
|
required: [true, 'articleType is required.'],
|
|
23
24
|
},
|
|
24
25
|
description: { type: String, default: '' },
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
+
import { Schema } from 'mongoose';
|
|
26
|
+
import { IRelatedTheme, IRelatedThemeModel } from '../types/related-theme.type';
|
|
27
|
+
declare const relatedThemeSchema: Schema<IRelatedTheme, IRelatedThemeModel, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, IRelatedTheme>;
|
|
28
|
+
export default relatedThemeSchema;
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
const mongoose_1 = require("mongoose");
|
|
7
|
+
const express_http_context_1 = __importDefault(require("express-http-context"));
|
|
8
|
+
const _config_1 = require("../config");
|
|
9
|
+
const relatedThemeSchema = new mongoose_1.Schema({
|
|
10
|
+
company: { type: mongoose_1.Schema.Types.ObjectId, ref: 'Company', default: null, unique: true },
|
|
11
|
+
themes: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'Theme', default: null }],
|
|
12
|
+
createdBy: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User', default: null },
|
|
13
|
+
updatedBy: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User', default: null },
|
|
14
|
+
updatedDate: { type: Number, index: -1 },
|
|
15
|
+
createdDate: { type: Number, index: -1 },
|
|
16
|
+
}, _config_1.schemaOptions);
|
|
17
|
+
relatedThemeSchema.pre('save', function (next) {
|
|
18
|
+
const user = express_http_context_1.default.get('user');
|
|
19
|
+
if (user) {
|
|
20
|
+
if (!this.createdBy)
|
|
21
|
+
this.createdBy = user._id;
|
|
22
|
+
this.updatedBy = user._id;
|
|
23
|
+
}
|
|
24
|
+
next();
|
|
25
|
+
});
|
|
26
|
+
relatedThemeSchema.pre('findOneAndUpdate', function (next) {
|
|
27
|
+
const user = express_http_context_1.default.get('user');
|
|
28
|
+
if (user)
|
|
29
|
+
this._update.updatedBy = user._id;
|
|
30
|
+
next();
|
|
31
|
+
});
|
|
32
|
+
exports.default = relatedThemeSchema;
|
|
@@ -13,10 +13,10 @@ const searchHistorySchema = new mongoose_1.Schema({
|
|
|
13
13
|
required: [true, 'user required!'],
|
|
14
14
|
index: true,
|
|
15
15
|
},
|
|
16
|
+
searchQuery: { type: Object, required: true },
|
|
17
|
+
searchText: { type: String, default: '' },
|
|
18
|
+
responseTime: { type: Number, required: true },
|
|
16
19
|
problem: { type: String, default: '' },
|
|
17
|
-
usecase: { type: String, default: '' },
|
|
18
|
-
evidenceList: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'Evidence', index: true }],
|
|
19
|
-
searchDate: { type: Number, required: [true, 'searchDate required!'] },
|
|
20
20
|
createdBy: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User', default: null },
|
|
21
21
|
updatedBy: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User', default: null },
|
|
22
22
|
updatedDate: { type: Number, index: -1 },
|
|
@@ -36,6 +36,7 @@ const sparkUseCaseSchema = new mongoose_1.Schema({
|
|
|
36
36
|
requestDeleteMessage: { type: String, default: '' },
|
|
37
37
|
feedbackMessage: { type: String, default: '' },
|
|
38
38
|
actors: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'Company' }],
|
|
39
|
+
customers: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'Company' }],
|
|
39
40
|
themeList: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'Theme' }],
|
|
40
41
|
relatedUseCaseList: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'UseCase' }],
|
|
41
42
|
technologyList: [{ type: String, required: [true, 'technoloyList element is required!'] }],
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
+
import { Schema } from 'mongoose';
|
|
26
|
+
import { IStartupVectorAnyEntity, IStartupVectorAnyEntityModel } from '../types/startup-vector-any-entity.type';
|
|
27
|
+
declare const startupAnyEntitySchema: Schema<IStartupVectorAnyEntity, IStartupVectorAnyEntityModel, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, IStartupVectorAnyEntity>;
|
|
28
|
+
export default startupAnyEntitySchema;
|
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
const mongoose_1 = require("mongoose");
|
|
7
|
+
const express_http_context_1 = __importDefault(require("express-http-context"));
|
|
8
|
+
const _config_1 = require("../config");
|
|
9
|
+
const startup_vector_any_entity_type_1 = require("../types/startup-vector-any-entity.type");
|
|
10
|
+
const startupAnyEntitySchema = new mongoose_1.Schema({
|
|
11
|
+
requesterId: { type: mongoose_1.Schema.Types.ObjectId, required: true },
|
|
12
|
+
requesterType: { type: String, enum: Object.values(startup_vector_any_entity_type_1.RequesterType), required: true },
|
|
13
|
+
requestModel: { type: String, enum: Object.values(startup_vector_any_entity_type_1.RequestModel), required: true },
|
|
14
|
+
requestId: { type: mongoose_1.Schema.Types.ObjectId, required: true },
|
|
15
|
+
requestTitle: { type: String, required: true },
|
|
16
|
+
resultModel: { type: String, enum: Object.values(startup_vector_any_entity_type_1.ResultModel), required: true },
|
|
17
|
+
resultId: { type: mongoose_1.Schema.Types.ObjectId, default: null },
|
|
18
|
+
score: { type: Number, default: 0 },
|
|
19
|
+
createdBy: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User', default: null },
|
|
20
|
+
updatedBy: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User', default: null },
|
|
21
|
+
updatedDate: { type: Number, index: -1 },
|
|
22
|
+
createdDate: { type: Number, index: -1 },
|
|
23
|
+
}, _config_1.schemaOptions);
|
|
24
|
+
startupAnyEntitySchema.pre('save', function (next) {
|
|
25
|
+
const user = express_http_context_1.default.get('user');
|
|
26
|
+
if (user) {
|
|
27
|
+
if (!this.createdBy)
|
|
28
|
+
this.createdBy = user._id;
|
|
29
|
+
this.updatedBy = user._id;
|
|
30
|
+
}
|
|
31
|
+
next();
|
|
32
|
+
});
|
|
33
|
+
startupAnyEntitySchema.pre('findOneAndUpdate', function (next) {
|
|
34
|
+
const user = express_http_context_1.default.get('user');
|
|
35
|
+
if (user)
|
|
36
|
+
this._update.updatedBy = user._id;
|
|
37
|
+
next();
|
|
38
|
+
});
|
|
39
|
+
exports.default = startupAnyEntitySchema;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
+
import { Schema } from 'mongoose';
|
|
26
|
+
import { IUseCaseDiscoveryProblem, IUseCaseDiscoveryProblemModel } from '../types/use-case-discovery-problem.type';
|
|
27
|
+
declare const useCaseDiscoveryProblemSchema: Schema<IUseCaseDiscoveryProblem, IUseCaseDiscoveryProblemModel, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, IUseCaseDiscoveryProblem>;
|
|
28
|
+
export default useCaseDiscoveryProblemSchema;
|