@cool-digital-solutions/interferir-models 1.1.21 → 1.1.23
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 +6 -2
- package/dist/index.js +5 -1
- package/dist/schemas/ai-assistant.schema.d.ts +28 -0
- package/dist/schemas/ai-assistant.schema.js +34 -0
- package/dist/schemas/index.d.ts +3 -1
- package/dist/schemas/index.js +5 -1
- package/dist/schemas/news-hub.schema.d.ts +28 -0
- package/dist/schemas/news-hub.schema.js +47 -0
- package/dist/schemas/notification.schema.js +4 -2
- package/dist/types/ai-assistant.type.d.ts +35 -0
- package/dist/types/ai-assistant.type.js +2 -0
- package/dist/types/index.d.ts +3 -1
- package/dist/types/news-hub.type.d.ts +42 -0
- package/dist/types/news-hub.type.js +10 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -55,6 +55,7 @@ import { IUser, IUserModel } from './types/user.type';
|
|
|
55
55
|
import { IFoamTree, IFoamTreeModel } from './types/foam-tree.type';
|
|
56
56
|
import { ICompetitorGrid, ICompetitorGridModel } from './types/competitor-grid.type';
|
|
57
57
|
import { IHighlight, IHighlightModel } from './types/highlight.type';
|
|
58
|
+
import { INewsHub, INewsHubModel } from './types/news-hub.type';
|
|
58
59
|
import ThemeSchema from './schemas/theme.schema';
|
|
59
60
|
import ProblemSchema from './schemas/problem.schema';
|
|
60
61
|
import SFTagSchema from './schemas/sf-tag.schema';
|
|
@@ -98,6 +99,7 @@ import BookmarkSchema from './schemas/bookmark.schema';
|
|
|
98
99
|
import AiConversationSchema from './schemas/ai-conversation.schema';
|
|
99
100
|
import AiConversationMessageSchema from './schemas/ai-conversation-message.schema';
|
|
100
101
|
import AiConversationTrackingTaskSchema from './schemas/ai-company-tracking-task.schema';
|
|
102
|
+
import AiAssistantSchema from './schemas/ai-assistant.schema';
|
|
101
103
|
import CompanyClusterSchema from './schemas/company-cluster.schema';
|
|
102
104
|
import CompanyMarketingSchema from './schemas/company-marketing.schema';
|
|
103
105
|
import InvestorSchema from './schemas/investor.schema';
|
|
@@ -111,5 +113,7 @@ import FoamTreeSchema from './schemas/foam-tree.schema';
|
|
|
111
113
|
import FeaturedThemeSchema from './schemas/featured-theme.schema';
|
|
112
114
|
import CompetitorGridSchema from './schemas/competitor-grid.schema';
|
|
113
115
|
import HighlightSchema from './schemas/highlight.schema';
|
|
114
|
-
|
|
115
|
-
|
|
116
|
+
import NewsHubSchema from './schemas/news-hub.schema';
|
|
117
|
+
import { IAiAssistant, IAiAssistantModel } from './types/ai-assistant.type';
|
|
118
|
+
export { IAiConversation, IAiConversationModel, IAiConversationMessage, IAiConversationMessageModel, IAiConversationTrackingTask, IAiConversationTrackingTaskModel, IAiAssistant, IAiAssistantModel, IBackendError, IBackendErrorModel, IBadge, IBadgeModel, IBatchHistory, IBookmark, IBookmarkModel, ICompany, ICompanyModel, ICompanyCluster, ICompanyClusterModel, ICompanyMarketing, ICompanyMarketingModel, ICompanyFundingRound, ICompanyFundingRoundModel, ICompetitor, ICompetitorModel, ICompetitorAnalysis, ICompetitorAnalysisModel, IContactMessage, IContactMessageModel, IContactStartup, IContactStartupModel, IContent, IContentModel, IDraftVersion, IDraftVersionModel, IEvidenceLayout, IEvidenceLayoutModel, IEvidence, IEvidenceModel, IFaq, IFaqModel, IFeaturedTheme, IFeaturedThemeModel, 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, IFoamTree, IFoamTreeModel, ICompetitorGrid, ICompetitorGridModel, IHighlight, IHighlightModel, INewsHub, INewsHubModel, };
|
|
119
|
+
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, AiConversationMessageSchema, AiConversationTrackingTaskSchema, CompanyClusterSchema, CompanyMarketingSchema, InvestorSchema, RelatedThemeSchema, StartupVectorAnyEntitySchema, UpdateJobSchema, UseCaseDiscoverySchema, UseCaseDiscoveryProblemSchema, CompetitorAnalysisSchema, FoamTreeSchema, FeaturedThemeSchema, CompetitorGridSchema, HighlightSchema, NewsHubSchema, AiAssistantSchema, };
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.UseCaseDiscoverySchema = exports.UpdateJobSchema = exports.StartupVectorAnyEntitySchema = exports.RelatedThemeSchema = exports.InvestorSchema = exports.CompanyMarketingSchema = exports.CompanyClusterSchema = exports.AiConversationTrackingTaskSchema = exports.AiConversationMessageSchema = 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
|
-
exports.HighlightSchema = exports.CompetitorGridSchema = exports.FeaturedThemeSchema = exports.FoamTreeSchema = exports.CompetitorAnalysisSchema = exports.UseCaseDiscoveryProblemSchema = void 0;
|
|
7
|
+
exports.AiAssistantSchema = exports.NewsHubSchema = exports.HighlightSchema = exports.CompetitorGridSchema = exports.FeaturedThemeSchema = exports.FoamTreeSchema = exports.CompetitorAnalysisSchema = exports.UseCaseDiscoveryProblemSchema = void 0;
|
|
8
8
|
const theme_schema_1 = __importDefault(require("./schemas/theme.schema"));
|
|
9
9
|
exports.ThemeSchema = theme_schema_1.default;
|
|
10
10
|
const problem_schema_1 = __importDefault(require("./schemas/problem.schema"));
|
|
@@ -91,6 +91,8 @@ const ai_conversation_message_schema_1 = __importDefault(require("./schemas/ai-c
|
|
|
91
91
|
exports.AiConversationMessageSchema = ai_conversation_message_schema_1.default;
|
|
92
92
|
const ai_company_tracking_task_schema_1 = __importDefault(require("./schemas/ai-company-tracking-task.schema"));
|
|
93
93
|
exports.AiConversationTrackingTaskSchema = ai_company_tracking_task_schema_1.default;
|
|
94
|
+
const ai_assistant_schema_1 = __importDefault(require("./schemas/ai-assistant.schema"));
|
|
95
|
+
exports.AiAssistantSchema = ai_assistant_schema_1.default;
|
|
94
96
|
const company_cluster_schema_1 = __importDefault(require("./schemas/company-cluster.schema"));
|
|
95
97
|
exports.CompanyClusterSchema = company_cluster_schema_1.default;
|
|
96
98
|
const company_marketing_schema_1 = __importDefault(require("./schemas/company-marketing.schema"));
|
|
@@ -117,3 +119,5 @@ const competitor_grid_schema_1 = __importDefault(require("./schemas/competitor-g
|
|
|
117
119
|
exports.CompetitorGridSchema = competitor_grid_schema_1.default;
|
|
118
120
|
const highlight_schema_1 = __importDefault(require("./schemas/highlight.schema"));
|
|
119
121
|
exports.HighlightSchema = highlight_schema_1.default;
|
|
122
|
+
const news_hub_schema_1 = __importDefault(require("./schemas/news-hub.schema"));
|
|
123
|
+
exports.NewsHubSchema = news_hub_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 { IAiAssistant, IAiAssistantModel } from '../types';
|
|
27
|
+
declare const aiAssistantSchema: Schema<IAiAssistant, IAiAssistantModel, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, IAiAssistant>;
|
|
28
|
+
export default aiAssistantSchema;
|
|
@@ -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
|
+
const mongoose_1 = require("mongoose");
|
|
7
|
+
const express_http_context_1 = __importDefault(require("express-http-context"));
|
|
8
|
+
const _config_1 = require("../config");
|
|
9
|
+
const aiAssistantSchema = new mongoose_1.Schema({
|
|
10
|
+
name: { type: String, required: true },
|
|
11
|
+
type: { type: String, required: true },
|
|
12
|
+
description: { type: String, required: true },
|
|
13
|
+
profilePicture: { type: mongoose_1.Schema.Types.ObjectId, ref: 'Image', default: null },
|
|
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: Number,
|
|
17
|
+
createdDate: Number,
|
|
18
|
+
}, _config_1.schemaOptions);
|
|
19
|
+
aiAssistantSchema.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
|
+
aiAssistantSchema.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.default = aiAssistantSchema;
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -53,4 +53,6 @@ import UseCaseDiscoveryProblemSchema from './use-case-discovery-problem.schema';
|
|
|
53
53
|
import CompetitorAnalysisSchema from './competitor-analysis.schema';
|
|
54
54
|
import FeaturedThemeSchema from './featured-theme.schema';
|
|
55
55
|
import HighlightSchema from './highlight.schema';
|
|
56
|
-
|
|
56
|
+
import NewsHubSchema from './news-hub.schema';
|
|
57
|
+
import AiAssistantSchema from './ai-assistant.schema';
|
|
58
|
+
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, AiConversationMessageSchema, AiConversationTrackingTaskSchema, BatchHistorySchema, CompanyClusterSchema, CompanyMarketingSchema, InvestorSchema, RelatedThemeSchema, StartupVectorAnyEntitySchema, UpdateJobSchema, UseCaseDiscoverySchema, UseCaseDiscoveryProblemSchema, CompetitorAnalysisSchema, FeaturedThemeSchema, HighlightSchema, NewsHubSchema, AiAssistantSchema, };
|
package/dist/schemas/index.js
CHANGED
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.UpdateJobSchema = exports.StartupVectorAnyEntitySchema = exports.RelatedThemeSchema = exports.InvestorSchema = exports.CompanyMarketingSchema = exports.CompanyClusterSchema = exports.BatchHistorySchema = exports.AiConversationTrackingTaskSchema = exports.AiConversationMessageSchema = 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
|
-
exports.HighlightSchema = exports.FeaturedThemeSchema = exports.CompetitorAnalysisSchema = exports.UseCaseDiscoveryProblemSchema = exports.UseCaseDiscoverySchema = void 0;
|
|
7
|
+
exports.AiAssistantSchema = exports.NewsHubSchema = exports.HighlightSchema = exports.FeaturedThemeSchema = exports.CompetitorAnalysisSchema = exports.UseCaseDiscoveryProblemSchema = exports.UseCaseDiscoverySchema = void 0;
|
|
8
8
|
const theme_schema_1 = __importDefault(require("./theme.schema"));
|
|
9
9
|
exports.ThemeSchema = theme_schema_1.default;
|
|
10
10
|
const problem_schema_1 = __importDefault(require("./problem.schema"));
|
|
@@ -115,3 +115,7 @@ const featured_theme_schema_1 = __importDefault(require("./featured-theme.schema
|
|
|
115
115
|
exports.FeaturedThemeSchema = featured_theme_schema_1.default;
|
|
116
116
|
const highlight_schema_1 = __importDefault(require("./highlight.schema"));
|
|
117
117
|
exports.HighlightSchema = highlight_schema_1.default;
|
|
118
|
+
const news_hub_schema_1 = __importDefault(require("./news-hub.schema"));
|
|
119
|
+
exports.NewsHubSchema = news_hub_schema_1.default;
|
|
120
|
+
const ai_assistant_schema_1 = __importDefault(require("./ai-assistant.schema"));
|
|
121
|
+
exports.AiAssistantSchema = ai_assistant_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 { INewsHub, INewsHubModel } from '../types/news-hub.type';
|
|
27
|
+
declare const newsHubSchema: Schema<INewsHub, INewsHubModel, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, INewsHub>;
|
|
28
|
+
export default newsHubSchema;
|
|
@@ -0,0 +1,47 @@
|
|
|
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 news_hub_type_1 = require("../types/news-hub.type");
|
|
10
|
+
const newsHubSchema = new mongoose_1.Schema({
|
|
11
|
+
user: {
|
|
12
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
13
|
+
ref: 'User',
|
|
14
|
+
required: [true, 'user required!'],
|
|
15
|
+
},
|
|
16
|
+
company: {
|
|
17
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
18
|
+
ref: 'Company',
|
|
19
|
+
required: [true, 'company required!'],
|
|
20
|
+
},
|
|
21
|
+
status: { type: String, enum: Object.values(news_hub_type_1.Status), required: [true, 'status is required!'] },
|
|
22
|
+
errorMessage: { type: String, default: '' },
|
|
23
|
+
result: { type: Object, default: {} },
|
|
24
|
+
createdBy: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User', default: null },
|
|
25
|
+
updatedBy: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User', default: null },
|
|
26
|
+
updatedDate: { type: Number },
|
|
27
|
+
createdDate: { type: Number },
|
|
28
|
+
}, _config_1.schemaOptions);
|
|
29
|
+
newsHubSchema.pre('save', 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) {
|
|
33
|
+
if (!this.createdBy)
|
|
34
|
+
this.createdBy = user._id;
|
|
35
|
+
if (!notUpdatedBy)
|
|
36
|
+
this.updatedBy = user._id;
|
|
37
|
+
}
|
|
38
|
+
next();
|
|
39
|
+
});
|
|
40
|
+
newsHubSchema.pre('findOneAndUpdate', function (next) {
|
|
41
|
+
const user = express_http_context_1.default.get('user');
|
|
42
|
+
const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
|
|
43
|
+
if (user && !notUpdatedBy)
|
|
44
|
+
this._update.updatedBy = user._id;
|
|
45
|
+
next();
|
|
46
|
+
});
|
|
47
|
+
exports.default = newsHubSchema;
|
|
@@ -25,8 +25,10 @@ const notificationSchema = new mongoose_1.Schema({
|
|
|
25
25
|
url: { type: String },
|
|
26
26
|
isRead: { type: Boolean, default: null },
|
|
27
27
|
logoFileName: { type: String },
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
createdBy: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User', default: null },
|
|
29
|
+
updatedBy: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User', default: null },
|
|
30
|
+
updatedDate: { type: Number },
|
|
31
|
+
createdDate: { type: Number },
|
|
30
32
|
}, _config_1.schemaOptions);
|
|
31
33
|
notificationSchema.pre('save', function (next) {
|
|
32
34
|
const user = express_http_context_1.default.get('user');
|
|
@@ -0,0 +1,35 @@
|
|
|
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 { Types } from 'mongoose';
|
|
26
|
+
import { IImage } from './';
|
|
27
|
+
import { BaseModel, BaseSchema } from '../config';
|
|
28
|
+
export interface IAiAssistant extends BaseSchema {
|
|
29
|
+
name: string;
|
|
30
|
+
type: string;
|
|
31
|
+
profilePicture: Types.ObjectId | IImage;
|
|
32
|
+
description: string;
|
|
33
|
+
}
|
|
34
|
+
export interface IAiAssistantModel extends BaseModel<IAiAssistant> {
|
|
35
|
+
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -55,4 +55,6 @@ import { ICompetitorGrid, ICompetitorGridModel, AIStatus } from './competitor-gr
|
|
|
55
55
|
import { IAiConversationMessage, IAiConversationMessageModel } from './ai-conversation-message.type';
|
|
56
56
|
import { IAiConversationTrackingTask, IAiConversationTrackingTaskModel } from './ai-company-tracking-task.type';
|
|
57
57
|
import { IHighlight, IHighlightModel } from './highlight.type';
|
|
58
|
-
|
|
58
|
+
import { INewsHub, INewsHubModel } from './news-hub.type';
|
|
59
|
+
import { IAiAssistant, IAiAssistantModel } from './ai-assistant.type';
|
|
60
|
+
export { IAiConversation, IAiConversationModel, IAiAssistant, IAiAssistantModel, IAiConversationMessage, IAiConversationMessageModel, IAiConversationTrackingTask, IAiConversationTrackingTaskModel, IBackendError, IBackendErrorModel, IBadge, IBadgeModel, IBatchHistory, IBookmark, IBookmarkModel, ICompany, ICompanyModel, ICompanyCluster, ICompanyClusterModel, ICompanyFundingRound, ICompanyFundingRoundModel, ICompanyMarketing, ICompanyMarketingModel, ICompetitor, ICompetitorModel, ICompetitorAnalysis, ICompetitorAnalysisModel, IContactMessage, IContactMessageModel, IContactStartup, IContactStartupModel, IContent, IContentModel, IDraftVersion, IDraftVersionModel, IEvidenceLayout, IEvidenceLayoutModel, IEvidence, IEvidenceModel, IFaq, IFaqModel, IFeaturedTheme, IFeaturedThemeModel, IFoamTree, IFoamTreeModel, 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, IUseCaseDiscovery, IUseCaseDiscoveryModel, IUseCaseDiscoveryProblem, IUseCaseDiscoveryProblemModel, IUseCase, IUseCaseModel, IUserToken, IUserTokenModel, IUserVisit, IUserVisitModel, IUser, IUserModel, ICompetitorGrid, ICompetitorGridModel, AIStatus, IHighlight, IHighlightModel, INewsHub, INewsHubModel, };
|
|
@@ -0,0 +1,42 @@
|
|
|
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 { Types } from 'mongoose';
|
|
26
|
+
import { ICompany, IUser } from './';
|
|
27
|
+
import { BaseModel, BaseSchema } from '../config';
|
|
28
|
+
export declare enum Status {
|
|
29
|
+
SENDING = "sending",
|
|
30
|
+
IN_PROGRESS = "inProgress",
|
|
31
|
+
FINISHED = "finished",
|
|
32
|
+
FAILED = "failed"
|
|
33
|
+
}
|
|
34
|
+
export interface INewsHub extends BaseSchema {
|
|
35
|
+
user: Types.ObjectId | IUser;
|
|
36
|
+
company: Types.ObjectId | ICompany;
|
|
37
|
+
status: Status;
|
|
38
|
+
result?: {};
|
|
39
|
+
errorMessage?: String;
|
|
40
|
+
}
|
|
41
|
+
export interface INewsHubModel extends BaseModel<INewsHub> {
|
|
42
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Status = void 0;
|
|
4
|
+
var Status;
|
|
5
|
+
(function (Status) {
|
|
6
|
+
Status["SENDING"] = "sending";
|
|
7
|
+
Status["IN_PROGRESS"] = "inProgress";
|
|
8
|
+
Status["FINISHED"] = "finished";
|
|
9
|
+
Status["FAILED"] = "failed";
|
|
10
|
+
})(Status || (exports.Status = Status = {}));
|