@cool-digital-solutions/interferir-models 1.0.50 → 1.0.51
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/schemas/competitor-grid.schema.d.ts +2 -0
- package/dist/schemas/competitor-grid.schema.js +61 -0
- package/dist/types/competitor-grid.type.d.ts +52 -0
- package/dist/types/competitor-grid.type.js +12 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/index.js +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.CompetitorGridModel = void 0;
|
|
7
|
+
const mongoose_1 = require("mongoose");
|
|
8
|
+
const _types_1 = require("../types");
|
|
9
|
+
const express_http_context_1 = __importDefault(require("express-http-context"));
|
|
10
|
+
const mongoose_2 = require("mongoose");
|
|
11
|
+
const competitorGridSchema = new mongoose_1.Schema({
|
|
12
|
+
competitors: {
|
|
13
|
+
type: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'Competitor' }],
|
|
14
|
+
},
|
|
15
|
+
companyId: {
|
|
16
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
17
|
+
ref: 'Company',
|
|
18
|
+
required: true,
|
|
19
|
+
},
|
|
20
|
+
userId: {
|
|
21
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
22
|
+
ref: 'User',
|
|
23
|
+
required: true,
|
|
24
|
+
},
|
|
25
|
+
tableFields: {
|
|
26
|
+
type: [
|
|
27
|
+
{
|
|
28
|
+
companyId: { type: mongoose_1.Schema.Types.ObjectId, ref: 'Company', required: true },
|
|
29
|
+
fieldName: { type: String, required: true },
|
|
30
|
+
fieldDescription: { type: String, required: true },
|
|
31
|
+
source: [{ type: mongoose_1.Schema.Types.Mixed, required: true }],
|
|
32
|
+
order: { type: Number },
|
|
33
|
+
isCreatedWithAi: { type: Boolean, required: true },
|
|
34
|
+
},
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
aiStatus: {
|
|
38
|
+
type: String,
|
|
39
|
+
enum: _types_1.AIStatus,
|
|
40
|
+
required: true,
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
competitorGridSchema.pre('save', function (next) {
|
|
44
|
+
const user = express_http_context_1.default.get('user');
|
|
45
|
+
const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
|
|
46
|
+
if (user) {
|
|
47
|
+
if (!this.createdBy)
|
|
48
|
+
this.createdBy = user._id;
|
|
49
|
+
if (!notUpdatedBy)
|
|
50
|
+
this.updatedBy = user._id;
|
|
51
|
+
}
|
|
52
|
+
next();
|
|
53
|
+
});
|
|
54
|
+
competitorGridSchema.pre('findOneAndUpdate', function (next) {
|
|
55
|
+
const user = express_http_context_1.default.get('user');
|
|
56
|
+
const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
|
|
57
|
+
if (user && !notUpdatedBy)
|
|
58
|
+
this._update.updatedBy = user._id;
|
|
59
|
+
next();
|
|
60
|
+
});
|
|
61
|
+
exports.CompetitorGridModel = (0, mongoose_2.model)('CompetitorGrid', competitorGridSchema);
|
|
@@ -0,0 +1,52 @@
|
|
|
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 { ICompetitor } from './competitor.type';
|
|
26
|
+
import { BaseModel, BaseSchema } from '../config';
|
|
27
|
+
import { Types } from 'mongoose';
|
|
28
|
+
export interface IField {
|
|
29
|
+
companyId: Types.ObjectId;
|
|
30
|
+
fieldName: string;
|
|
31
|
+
fieldDescription: string;
|
|
32
|
+
source: Record<string, any>[];
|
|
33
|
+
order: number;
|
|
34
|
+
isCreatedWithAi: boolean;
|
|
35
|
+
}
|
|
36
|
+
export declare enum AIStatus {
|
|
37
|
+
NOT_STARTED = "notStarted",
|
|
38
|
+
CREATED = "created",
|
|
39
|
+
IN_PROGRESS = "inProgress",
|
|
40
|
+
COMPLETED = "completed",
|
|
41
|
+
FAILED = "failed",
|
|
42
|
+
TIMEOUT = "timeout"
|
|
43
|
+
}
|
|
44
|
+
export interface ICompetitorGrid extends BaseSchema {
|
|
45
|
+
competitors: Types.ObjectId[] | ICompetitor[];
|
|
46
|
+
companyId: Types.ObjectId;
|
|
47
|
+
userId: Types.ObjectId;
|
|
48
|
+
tableFields?: IField[];
|
|
49
|
+
aiStatus?: AIStatus;
|
|
50
|
+
}
|
|
51
|
+
export interface ICompetitorGridModel extends BaseModel<ICompetitorGrid> {
|
|
52
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AIStatus = void 0;
|
|
4
|
+
var AIStatus;
|
|
5
|
+
(function (AIStatus) {
|
|
6
|
+
AIStatus["NOT_STARTED"] = "notStarted";
|
|
7
|
+
AIStatus["CREATED"] = "created";
|
|
8
|
+
AIStatus["IN_PROGRESS"] = "inProgress";
|
|
9
|
+
AIStatus["COMPLETED"] = "completed";
|
|
10
|
+
AIStatus["FAILED"] = "failed";
|
|
11
|
+
AIStatus["TIMEOUT"] = "timeout";
|
|
12
|
+
})(AIStatus || (exports.AIStatus = AIStatus = {}));
|
package/dist/types/index.d.ts
CHANGED
|
@@ -51,4 +51,5 @@ import { IUseCase, IUseCaseModel } from './use-case.type';
|
|
|
51
51
|
import { IUserToken, IUserTokenModel } from './user-token.type';
|
|
52
52
|
import { IUserVisit, IUserVisitModel } from './user-visit.type';
|
|
53
53
|
import { IUser, IUserModel } from './user.type';
|
|
54
|
-
|
|
54
|
+
import { ICompetitorGrid, ICompetitorGridModel, AIStatus } from './competitor-grid.type';
|
|
55
|
+
export { IAiConversation, IAiConversationModel, 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, };
|
package/dist/types/index.js
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AIStatus = void 0;
|
|
4
|
+
const competitor_grid_type_1 = require("./competitor-grid.type");
|
|
5
|
+
Object.defineProperty(exports, "AIStatus", { enumerable: true, get: function () { return competitor_grid_type_1.AIStatus; } });
|