@cool-digital-solutions/interferir-models 1.0.71 → 1.0.73
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 +2 -1
- package/dist/index.js +4 -2
- package/package.json +1 -1
- package/dist/schemas/ai-conversation-message.schema.d.ts +0 -28
- package/dist/schemas/ai-conversation-message.schema.js +0 -45
- package/dist/types/ai-conversation-message.type.d.ts +0 -55
- package/dist/types/ai-conversation-message.type.js +0 -15
package/dist/index.d.ts
CHANGED
|
@@ -92,6 +92,7 @@ import UserVisitSchema from './schemas/user-visit.schema';
|
|
|
92
92
|
import CompetitorSchema from './schemas/competitor.schema';
|
|
93
93
|
import CompanyFundingRoundSchema from './schemas/company-funding-round.schema';
|
|
94
94
|
import BookmarkSchema from './schemas/bookmark.schema';
|
|
95
|
+
import AiConversationSchema from './schemas/ai-conversation.schema';
|
|
95
96
|
import CompanyClusterSchema from './schemas/company-cluster.schema';
|
|
96
97
|
import CompanyMarketingSchema from './schemas/company-marketing.schema';
|
|
97
98
|
import InvestorSchema from './schemas/investor.schema';
|
|
@@ -105,4 +106,4 @@ import FoamTreeSchema from './schemas/foam-tree.schema';
|
|
|
105
106
|
import FeaturedThemeSchema from './schemas/featured-theme.schema';
|
|
106
107
|
import CompetitorGridSchema from './schemas/competitor-grid.schema';
|
|
107
108
|
export { IAiConversation, IAiConversationModel, 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, };
|
|
108
|
-
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, CompanyClusterSchema, CompanyMarketingSchema, InvestorSchema, RelatedThemeSchema, StartupVectorAnyEntitySchema, UpdateJobSchema, UseCaseDiscoverySchema, UseCaseDiscoveryProblemSchema, CompetitorAnalysisSchema, FoamTreeSchema, FeaturedThemeSchema, CompetitorGridSchema, };
|
|
109
|
+
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.
|
|
7
|
-
exports.CompetitorGridSchema = exports.FeaturedThemeSchema = void 0;
|
|
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"));
|
|
@@ -85,6 +85,8 @@ const company_funding_round_schema_1 = __importDefault(require("./schemas/compan
|
|
|
85
85
|
exports.CompanyFundingRoundSchema = company_funding_round_schema_1.default;
|
|
86
86
|
const bookmark_schema_1 = __importDefault(require("./schemas/bookmark.schema"));
|
|
87
87
|
exports.BookmarkSchema = bookmark_schema_1.default;
|
|
88
|
+
const ai_conversation_schema_1 = __importDefault(require("./schemas/ai-conversation.schema"));
|
|
89
|
+
exports.AiConversationSchema = ai_conversation_schema_1.default;
|
|
88
90
|
const company_cluster_schema_1 = __importDefault(require("./schemas/company-cluster.schema"));
|
|
89
91
|
exports.CompanyClusterSchema = company_cluster_schema_1.default;
|
|
90
92
|
const company_marketing_schema_1 = __importDefault(require("./schemas/company-marketing.schema"));
|
package/package.json
CHANGED
|
@@ -1,28 +0,0 @@
|
|
|
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 type { IAiConversationMessage, IAiConversationMessageModel } from '../types';
|
|
27
|
-
declare const aiConversationMessageSchema: Schema<IAiConversationMessage, IAiConversationMessageModel, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, IAiConversationMessage>;
|
|
28
|
-
export default aiConversationMessageSchema;
|
|
@@ -1,45 +0,0 @@
|
|
|
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 ai_conversation_message_type_1 = require("src/types/ai-conversation-message.type");
|
|
10
|
-
const aiConversationMessageSchema = new mongoose_1.Schema({
|
|
11
|
-
conversationId: { type: mongoose_1.Schema.Types.ObjectId, ref: 'AiConversation', required: true },
|
|
12
|
-
role: { type: String, enum: Object.values(ai_conversation_message_type_1.ROLE), required: true },
|
|
13
|
-
content: { type: String, required: true },
|
|
14
|
-
token: { type: Number, required: true },
|
|
15
|
-
messageDate: { type: Number, required: true },
|
|
16
|
-
isLiked: { type: Boolean, default: null },
|
|
17
|
-
comment: { type: String, default: null },
|
|
18
|
-
reason: { type: String, enum: ai_conversation_message_type_1.IMessageReason, default: ai_conversation_message_type_1.IMessageReason.DEFAULT },
|
|
19
|
-
title: { type: String, required: false },
|
|
20
|
-
cost: { type: Number },
|
|
21
|
-
companies: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'Company', default: null }],
|
|
22
|
-
portiaArticles: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'PortiaArticle', default: null }],
|
|
23
|
-
useCases: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'UseCase', default: null }],
|
|
24
|
-
researches: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'Theme', default: null }],
|
|
25
|
-
createdBy: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User', default: null },
|
|
26
|
-
updatedBy: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User', default: null },
|
|
27
|
-
updatedDate: Number,
|
|
28
|
-
createdDate: Number,
|
|
29
|
-
}, _config_1.schemaOptions);
|
|
30
|
-
aiConversationMessageSchema.pre('save', function (next) {
|
|
31
|
-
const user = express_http_context_1.default.get('user');
|
|
32
|
-
if (user) {
|
|
33
|
-
if (!this.createdBy)
|
|
34
|
-
this.createdBy = user._id;
|
|
35
|
-
this.updatedBy = user._id;
|
|
36
|
-
}
|
|
37
|
-
next();
|
|
38
|
-
});
|
|
39
|
-
aiConversationMessageSchema.pre('findOneAndUpdate', function (next) {
|
|
40
|
-
const user = express_http_context_1.default.get('user');
|
|
41
|
-
if (user)
|
|
42
|
-
this._update.updatedBy = user._id;
|
|
43
|
-
next();
|
|
44
|
-
});
|
|
45
|
-
exports.default = aiConversationMessageSchema;
|
|
@@ -1,55 +0,0 @@
|
|
|
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 { IAiConversation, ICompany, IPortiaArticle, ITheme, IUseCase } from './';
|
|
27
|
-
import { BaseModel, BaseSchema } from '../config';
|
|
28
|
-
export declare enum ROLE {
|
|
29
|
-
USER = "user",
|
|
30
|
-
ASSISTANT = "assistant"
|
|
31
|
-
}
|
|
32
|
-
export declare enum IMessageReason {
|
|
33
|
-
IRRELEVANT_ANSWER = "Irrelevant answer",
|
|
34
|
-
INACCURATE_INFORMATION = "Inaccurate information",
|
|
35
|
-
INADEQUATE_RESPONSE = "Inadequate response",
|
|
36
|
-
DEFAULT = ""
|
|
37
|
-
}
|
|
38
|
-
export interface IAiConversationMessage extends BaseSchema {
|
|
39
|
-
conversationId: Types.ObjectId | IAiConversation;
|
|
40
|
-
role: ROLE;
|
|
41
|
-
content: string;
|
|
42
|
-
token: number;
|
|
43
|
-
messageDate: number;
|
|
44
|
-
isLiked?: boolean;
|
|
45
|
-
comment?: string;
|
|
46
|
-
reason?: IMessageReason;
|
|
47
|
-
title?: string;
|
|
48
|
-
cost?: number;
|
|
49
|
-
companies?: Types.ObjectId[] | ICompany[];
|
|
50
|
-
portiaArticles?: Types.ObjectId[] | IPortiaArticle[];
|
|
51
|
-
useCases?: Types.ObjectId[] | IUseCase[];
|
|
52
|
-
researches?: Types.ObjectId[] | ITheme[];
|
|
53
|
-
}
|
|
54
|
-
export interface IAiConversationMessageModel extends BaseModel<IAiConversationMessage> {
|
|
55
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.IMessageReason = exports.ROLE = void 0;
|
|
4
|
-
var ROLE;
|
|
5
|
-
(function (ROLE) {
|
|
6
|
-
ROLE["USER"] = "user";
|
|
7
|
-
ROLE["ASSISTANT"] = "assistant";
|
|
8
|
-
})(ROLE || (exports.ROLE = ROLE = {}));
|
|
9
|
-
var IMessageReason;
|
|
10
|
-
(function (IMessageReason) {
|
|
11
|
-
IMessageReason["IRRELEVANT_ANSWER"] = "Irrelevant answer";
|
|
12
|
-
IMessageReason["INACCURATE_INFORMATION"] = "Inaccurate information";
|
|
13
|
-
IMessageReason["INADEQUATE_RESPONSE"] = "Inadequate response";
|
|
14
|
-
IMessageReason["DEFAULT"] = "";
|
|
15
|
-
})(IMessageReason || (exports.IMessageReason = IMessageReason = {}));
|