@cool-digital-solutions/interferir-models 1.0.66 → 1.0.67
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
CHANGED
|
@@ -94,7 +94,6 @@ import CompetitorSchema from './schemas/competitor.schema';
|
|
|
94
94
|
import CompanyFundingRoundSchema from './schemas/company-funding-round.schema';
|
|
95
95
|
import BookmarkSchema from './schemas/bookmark.schema';
|
|
96
96
|
import AiConversationSchema from './schemas/ai-conversation.schema';
|
|
97
|
-
import AiConversationMessageSchema from './schemas/ai-conversation-message.schema';
|
|
98
97
|
import CompanyClusterSchema from './schemas/company-cluster.schema';
|
|
99
98
|
import CompanyMarketingSchema from './schemas/company-marketing.schema';
|
|
100
99
|
import InvestorSchema from './schemas/investor.schema';
|
|
@@ -108,4 +107,4 @@ import FoamTreeSchema from './schemas/foam-tree.schema';
|
|
|
108
107
|
import FeaturedThemeSchema from './schemas/featured-theme.schema';
|
|
109
108
|
import CompetitorGridSchema from './schemas/competitor-grid.schema';
|
|
110
109
|
export { IAiConversation, IAiConversationModel, IAiConversationMessage, IAiConversationMessageModel, 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, };
|
|
111
|
-
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,
|
|
110
|
+
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, CompetitorAnalysisSchema, FoamTreeSchema, FeaturedThemeSchema, CompetitorGridSchema, };
|
package/dist/index.js
CHANGED
|
@@ -3,8 +3,8 @@ 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.UseCaseDiscoveryProblemSchema = exports.UseCaseDiscoverySchema = exports.UpdateJobSchema = exports.StartupVectorAnyEntitySchema = exports.RelatedThemeSchema = exports.InvestorSchema = exports.CompanyMarketingSchema = exports.CompanyClusterSchema = exports.
|
|
7
|
-
exports.CompetitorGridSchema = exports.FeaturedThemeSchema = exports.FoamTreeSchema =
|
|
6
|
+
exports.CompetitorAnalysisSchema = 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
|
+
exports.CompetitorGridSchema = exports.FeaturedThemeSchema = exports.FoamTreeSchema = 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"));
|
|
@@ -87,8 +87,6 @@ const bookmark_schema_1 = __importDefault(require("./schemas/bookmark.schema"));
|
|
|
87
87
|
exports.BookmarkSchema = bookmark_schema_1.default;
|
|
88
88
|
const ai_conversation_schema_1 = __importDefault(require("./schemas/ai-conversation.schema"));
|
|
89
89
|
exports.AiConversationSchema = ai_conversation_schema_1.default;
|
|
90
|
-
const ai_conversation_message_schema_1 = __importDefault(require("./schemas/ai-conversation-message.schema"));
|
|
91
|
-
exports.AiConversationMessageSchema = ai_conversation_message_schema_1.default;
|
|
92
90
|
const company_cluster_schema_1 = __importDefault(require("./schemas/company-cluster.schema"));
|
|
93
91
|
exports.CompanyClusterSchema = company_cluster_schema_1.default;
|
|
94
92
|
const company_marketing_schema_1 = __importDefault(require("./schemas/company-marketing.schema"));
|
|
@@ -24,5 +24,5 @@
|
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
25
|
import { Schema } from 'mongoose';
|
|
26
26
|
import type { IAiConversationMessage, IAiConversationMessageModel } from '../types';
|
|
27
|
-
declare const
|
|
28
|
-
export default
|
|
27
|
+
declare const aiConversationMessageSchema: Schema<IAiConversationMessage, IAiConversationMessageModel, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, IAiConversationMessage>;
|
|
28
|
+
export default aiConversationMessageSchema;
|
|
@@ -7,7 +7,7 @@ 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
9
|
const ai_conversation_message_type_1 = require("src/types/ai-conversation-message.type");
|
|
10
|
-
const
|
|
10
|
+
const aiConversationMessageSchema = new mongoose_1.Schema({
|
|
11
11
|
conversationId: { type: mongoose_1.Schema.Types.ObjectId, ref: 'AiConversation', required: true },
|
|
12
12
|
role: { type: String, enum: Object.values(ai_conversation_message_type_1.ROLE), required: true },
|
|
13
13
|
content: { type: String, required: true },
|
|
@@ -27,7 +27,7 @@ const aiConversationSchema = new mongoose_1.Schema({
|
|
|
27
27
|
updatedDate: Number,
|
|
28
28
|
createdDate: Number,
|
|
29
29
|
}, _config_1.schemaOptions);
|
|
30
|
-
|
|
30
|
+
aiConversationMessageSchema.pre('save', function (next) {
|
|
31
31
|
const user = express_http_context_1.default.get('user');
|
|
32
32
|
if (user) {
|
|
33
33
|
if (!this.createdBy)
|
|
@@ -36,10 +36,10 @@ aiConversationSchema.pre('save', function (next) {
|
|
|
36
36
|
}
|
|
37
37
|
next();
|
|
38
38
|
});
|
|
39
|
-
|
|
39
|
+
aiConversationMessageSchema.pre('findOneAndUpdate', function (next) {
|
|
40
40
|
const user = express_http_context_1.default.get('user');
|
|
41
41
|
if (user)
|
|
42
42
|
this._update.updatedBy = user._id;
|
|
43
43
|
next();
|
|
44
44
|
});
|
|
45
|
-
exports.default =
|
|
45
|
+
exports.default = aiConversationMessageSchema;
|