codebase-models 1.0.7 → 2.0.0
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/.github/workflows/npm-publish.yml +33 -0
- package/dist/index.d.ts +4 -3
- package/dist/index.js +7 -5
- package/dist/src/models/Announcement.d.ts +6 -5
- package/dist/src/models/Announcement.js +29 -9
- package/dist/src/models/Audience.d.ts +1 -0
- package/dist/src/models/Audience.js +5 -0
- package/dist/src/models/{Experiments.d.ts → BqPreCompiledData.d.ts} +12 -30
- package/dist/src/models/{ClientExperiment.js → BqPreCompiledData.js} +26 -46
- package/dist/src/models/CVRReport.d.ts +1 -0
- package/dist/src/models/CVRReport.js +13 -0
- package/dist/src/models/Client.d.ts +1 -1
- package/dist/src/models/Client.js +31 -51
- package/dist/src/models/ClientAdditionalRevenue.d.ts +1 -1
- package/dist/src/models/ClientAdditionalRevenue.js +3 -2
- package/dist/src/models/ClientLearning.d.ts +1 -1
- package/dist/src/models/ClientLearning.js +10 -6
- package/dist/src/models/ClientLinks.d.ts +1 -1
- package/dist/src/models/ClientLinks.js +15 -6
- package/dist/src/models/ClientNextSteps.d.ts +1 -1
- package/dist/src/models/ClientNextSteps.js +3 -2
- package/dist/src/models/ClientNote.d.ts +1 -1
- package/dist/src/models/ClientNote.js +3 -2
- package/dist/src/models/ClientReportsTemp.d.ts +1 -1
- package/dist/src/models/ClientReportsTemp.js +20 -2
- package/dist/src/models/ClientRetention.d.ts +1 -0
- package/dist/src/models/ClientRetention.js +18 -0
- package/dist/src/models/ClientScript.d.ts +1 -1
- package/dist/src/models/ClientScript.js +24 -8
- package/dist/src/models/ClientStrategy.d.ts +1 -1
- package/dist/src/models/ClientStrategy.js +3 -2
- package/dist/src/models/ClientSurvay.d.ts +1 -0
- package/dist/src/models/ClientSurvay.js +5 -0
- package/dist/src/models/Environment.d.ts +2 -0
- package/dist/src/models/Environment.js +26 -2
- package/dist/src/models/Faqs.d.ts +1 -0
- package/dist/src/models/Faqs.js +5 -0
- package/dist/src/models/Feedback.d.ts +1 -1
- package/dist/src/models/Feedback.js +3 -2
- package/dist/src/models/Goal.d.ts +2 -1
- package/dist/src/models/Goal.js +33 -11
- package/dist/src/models/Hypothesis.d.ts +2 -0
- package/dist/src/models/Hypothesis.js +49 -9
- package/dist/src/models/HypothesisSheet.d.ts +1 -1
- package/dist/src/models/HypothesisSheet.js +26 -2
- package/dist/src/models/LandingPages.d.ts +3 -0
- package/dist/src/models/LandingPages.js +29 -0
- package/dist/src/models/NewIdeas.d.ts +1 -1
- package/dist/src/models/NewIdeas.js +3 -2
- package/dist/src/models/Notification.d.ts +1 -0
- package/dist/src/models/Notification.js +29 -1
- package/dist/src/models/{ClientExperiment.d.ts → Organization.d.ts} +18 -29
- package/dist/src/models/{Experiments.js → Organization.js} +36 -54
- package/dist/src/models/Page.d.ts +3 -1
- package/dist/src/models/Page.js +56 -4
- package/dist/src/models/PageElement.d.ts +3 -0
- package/dist/src/models/PageElement.js +59 -7
- package/dist/src/models/PageTestType.d.ts +2 -0
- package/dist/src/models/PageTestType.js +41 -5
- package/dist/src/models/Portfolio.d.ts +1 -0
- package/dist/src/models/Portfolio.js +5 -0
- package/dist/src/models/PrecalculationFilters.d.ts +36 -0
- package/dist/src/models/PrecalculationFilters.js +77 -0
- package/dist/src/models/QueryLog.d.ts +1 -1
- package/dist/src/models/QueryLog.js +3 -2
- package/dist/src/models/ReadNotification.d.ts +1 -0
- package/dist/src/models/ReadNotification.js +29 -1
- package/dist/src/models/Report.d.ts +2 -1
- package/dist/src/models/Report.js +32 -48
- package/dist/src/models/Role.d.ts +3 -0
- package/dist/src/models/Role.js +50 -7
- package/dist/src/models/SavedSegment.d.ts +1 -0
- package/dist/src/models/SavedSegment.js +5 -0
- package/dist/src/models/Segment.d.ts +1 -0
- package/dist/src/models/Segment.js +5 -0
- package/dist/src/models/SegmentCombination.d.ts +1 -0
- package/dist/src/models/SegmentCombination.js +5 -0
- package/dist/src/models/Snippet.d.ts +2 -1
- package/dist/src/models/Snippet.js +28 -3
- package/dist/src/models/StageInCustomerJourney.d.ts +3 -1
- package/dist/src/models/StageInCustomerJourney.js +56 -4
- package/dist/src/models/Tag.d.ts +1 -0
- package/dist/src/models/Tag.js +29 -1
- package/dist/src/models/Temp.d.ts +1 -0
- package/dist/src/models/Temp.js +29 -1
- package/dist/src/models/Test.d.ts +16 -15
- package/dist/src/models/Test.js +82 -185
- package/dist/src/models/TestSequentialValue.d.ts +1 -0
- package/dist/src/models/TestSequentialValue.js +5 -0
- package/dist/src/models/Tier.d.ts +1 -0
- package/dist/src/models/Tier.js +29 -1
- package/dist/src/models/Trigger.d.ts +1 -0
- package/dist/src/models/Trigger.js +29 -1
- package/dist/src/models/User.d.ts +1 -0
- package/dist/src/models/User.js +9 -10
- package/index.ts +6 -4
- package/package.json +1 -1
- package/src/models/Announcement.ts +50 -27
- package/src/models/Audience.ts +6 -0
- package/src/models/BqPreCompiledData.ts +62 -0
- package/src/models/CVRReport.ts +17 -0
- package/src/models/Client.ts +39 -59
- package/src/models/ClientAdditionalRevenue.ts +4 -3
- package/src/models/ClientLearning.ts +11 -7
- package/src/models/ClientLinks.ts +18 -7
- package/src/models/ClientNextSteps.ts +4 -3
- package/src/models/ClientNote.ts +4 -3
- package/src/models/ClientReportsTemp.ts +24 -3
- package/src/models/ClientRetention.ts +27 -1
- package/src/models/ClientScript.ts +26 -9
- package/src/models/ClientStrategy.ts +4 -3
- package/src/models/ClientSurvay.ts +6 -0
- package/src/models/Environment.ts +31 -3
- package/src/models/Faqs.ts +6 -0
- package/src/models/Feedback.ts +4 -3
- package/src/models/Goal.ts +36 -12
- package/src/models/Hypothesis.ts +29 -8
- package/src/models/HypothesisSheet.ts +3 -2
- package/src/models/LandingPages.ts +34 -0
- package/src/models/NewIdeas.ts +4 -3
- package/src/models/Notification.ts +6 -0
- package/src/models/Organization.ts +86 -0
- package/src/models/Page.ts +62 -5
- package/src/models/PageElement.ts +38 -7
- package/src/models/PageTestType.ts +21 -4
- package/src/models/Portfolio.ts +6 -0
- package/src/models/PrecalculationFilters.ts +67 -0
- package/src/models/QueryLog.ts +4 -3
- package/src/models/ReadNotification.ts +6 -0
- package/src/models/Report.ts +54 -66
- package/src/models/Role.ts +31 -6
- package/src/models/SavedSegment.ts +6 -0
- package/src/models/Segment.ts +6 -0
- package/src/models/SegmentCombination.ts +6 -0
- package/src/models/Snippet.ts +32 -4
- package/src/models/StageInCustomerJourney.ts +33 -5
- package/src/models/Tag.ts +6 -0
- package/src/models/Temp.ts +6 -0
- package/src/models/Test.ts +155 -243
- package/src/models/TestSequentialValue.ts +6 -0
- package/src/models/Tier.ts +6 -0
- package/src/models/Trigger.ts +6 -0
- package/src/models/User.ts +11 -10
- package/src/models/ClientExperiment.ts +0 -113
- package/src/models/Experiments.ts +0 -118
|
@@ -27,28 +27,57 @@ const mongoose_1 = __importStar(require("mongoose"));
|
|
|
27
27
|
const LandingPageDataSchema = new mongoose_1.Schema({
|
|
28
28
|
conversionRate: {
|
|
29
29
|
type: Number,
|
|
30
|
+
min: 0,
|
|
31
|
+
max: 100,
|
|
32
|
+
index: true,
|
|
30
33
|
},
|
|
34
|
+
lastUpdated: {
|
|
35
|
+
type: Date,
|
|
36
|
+
default: Date.now,
|
|
37
|
+
}
|
|
31
38
|
});
|
|
32
39
|
const LandingPagesSchema = new mongoose_1.Schema({
|
|
33
40
|
title: {
|
|
34
41
|
type: String,
|
|
35
42
|
required: true,
|
|
43
|
+
trim: true,
|
|
44
|
+
index: true,
|
|
36
45
|
},
|
|
37
46
|
client: {
|
|
38
47
|
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
39
48
|
ref: "client",
|
|
40
49
|
required: true,
|
|
50
|
+
index: true,
|
|
51
|
+
},
|
|
52
|
+
organizationId: {
|
|
53
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
54
|
+
ref: "organization",
|
|
55
|
+
index: true,
|
|
41
56
|
},
|
|
42
57
|
screenshot: {
|
|
43
58
|
type: String,
|
|
44
59
|
default: null,
|
|
60
|
+
trim: true,
|
|
45
61
|
},
|
|
46
62
|
dataPoints: {
|
|
47
63
|
type: LandingPageDataSchema,
|
|
48
64
|
default: {},
|
|
49
65
|
},
|
|
66
|
+
isActive: {
|
|
67
|
+
type: Boolean,
|
|
68
|
+
default: true,
|
|
69
|
+
index: true,
|
|
70
|
+
}
|
|
50
71
|
}, {
|
|
51
72
|
timestamps: true,
|
|
52
73
|
});
|
|
74
|
+
// Compound indexes for common query patterns
|
|
75
|
+
LandingPagesSchema.index({ client: 1, title: 1 }, { unique: true });
|
|
76
|
+
LandingPagesSchema.index({ client: 1, isActive: 1 });
|
|
77
|
+
LandingPagesSchema.index({ organizationId: 1, client: 1 });
|
|
78
|
+
LandingPagesSchema.index({ organizationId: 1, title: 1 });
|
|
79
|
+
LandingPagesSchema.index({ client: 1, 'dataPoints.conversionRate': -1 });
|
|
80
|
+
// Text index for full-text search
|
|
81
|
+
LandingPagesSchema.index({ title: 'text' });
|
|
53
82
|
const LandingPages = (0, mongoose_1.model)("LandingPages", LandingPagesSchema);
|
|
54
83
|
exports.default = LandingPages;
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
25
|
import mongoose, { Document } from "mongoose";
|
|
26
26
|
export interface INewIdeas extends Document {
|
|
27
|
-
|
|
27
|
+
organizationId?: mongoose.Schema.Types.ObjectId;
|
|
28
28
|
ideaName: string;
|
|
29
29
|
client?: mongoose.Schema.Types.ObjectId;
|
|
30
30
|
hypothesis?: mongoose.Schema.Types.ObjectId;
|
|
@@ -25,8 +25,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
const mongoose_1 = __importStar(require("mongoose"));
|
|
27
27
|
const NewIdeasSchema = new mongoose_1.Schema({
|
|
28
|
-
|
|
29
|
-
type:
|
|
28
|
+
organizationId: {
|
|
29
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
30
|
+
ref: "organization",
|
|
30
31
|
default: null,
|
|
31
32
|
},
|
|
32
33
|
ideaName: {
|
|
@@ -31,6 +31,7 @@ export interface INotification extends Document {
|
|
|
31
31
|
archive?: boolean;
|
|
32
32
|
module?: string;
|
|
33
33
|
moduleData?: string;
|
|
34
|
+
organizationId?: mongoose.Schema.Types.ObjectId;
|
|
34
35
|
}
|
|
35
36
|
declare const Notification: mongoose.Model<INotification, {}, {}, {}, mongoose.Document<unknown, {}, INotification> & INotification & {
|
|
36
37
|
_id: mongoose.Types.ObjectId;
|
|
@@ -1,7 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const mongoose_1 = require("mongoose");
|
|
26
|
+
const mongoose_1 = __importStar(require("mongoose"));
|
|
4
27
|
const NotificationSchema = new mongoose_1.Schema({
|
|
28
|
+
organizationId: {
|
|
29
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
30
|
+
ref: "organization",
|
|
31
|
+
default: null,
|
|
32
|
+
},
|
|
5
33
|
title: {
|
|
6
34
|
type: String,
|
|
7
35
|
},
|
|
@@ -23,36 +23,25 @@
|
|
|
23
23
|
/// <reference types="mongoose/types/virtuals" />
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
25
|
import mongoose, { Document } from "mongoose";
|
|
26
|
-
export interface
|
|
27
|
-
condition: string;
|
|
28
|
-
routes: mongoose.Schema.Types.Mixed;
|
|
29
|
-
}
|
|
30
|
-
export interface IAudienceTargeting extends Document {
|
|
31
|
-
javascript: string;
|
|
32
|
-
}
|
|
33
|
-
export interface IVariants extends Document {
|
|
26
|
+
export interface IOrganization extends Document {
|
|
34
27
|
name: string;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
audienceTargeting: IAudienceTargeting;
|
|
51
|
-
variants: IVariants;
|
|
52
|
-
createdAt?: Date;
|
|
53
|
-
updatedAt?: Date;
|
|
28
|
+
description: string;
|
|
29
|
+
adminEmail: string;
|
|
30
|
+
adminContact: string;
|
|
31
|
+
createdBy: mongoose.Schema.Types.ObjectId;
|
|
32
|
+
address: string;
|
|
33
|
+
city: string;
|
|
34
|
+
state: string;
|
|
35
|
+
zip: string;
|
|
36
|
+
country: string;
|
|
37
|
+
phone: string;
|
|
38
|
+
logo: string;
|
|
39
|
+
website: string;
|
|
40
|
+
createdAt: Date;
|
|
41
|
+
updatedAt: Date;
|
|
42
|
+
isActive: boolean;
|
|
54
43
|
}
|
|
55
|
-
declare const
|
|
44
|
+
declare const Organization: mongoose.Model<IOrganization, {}, {}, {}, mongoose.Document<unknown, {}, IOrganization> & IOrganization & {
|
|
56
45
|
_id: mongoose.Types.ObjectId;
|
|
57
46
|
}, any>;
|
|
58
|
-
export default
|
|
47
|
+
export default Organization;
|
|
@@ -24,85 +24,67 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
const mongoose_1 = __importStar(require("mongoose"));
|
|
27
|
-
const
|
|
27
|
+
const OrganizationSchema = new mongoose_1.Schema({
|
|
28
28
|
name: {
|
|
29
29
|
type: String,
|
|
30
|
+
required: true,
|
|
31
|
+
unique: true,
|
|
30
32
|
},
|
|
31
|
-
|
|
33
|
+
description: {
|
|
32
34
|
type: String,
|
|
35
|
+
required: true,
|
|
33
36
|
},
|
|
34
|
-
|
|
35
|
-
type: Boolean,
|
|
36
|
-
},
|
|
37
|
-
traffic_allocation: {
|
|
38
|
-
type: Number,
|
|
39
|
-
},
|
|
40
|
-
metadata_1: {
|
|
41
|
-
type: mongoose_1.default.Schema.Types.Mixed,
|
|
42
|
-
},
|
|
43
|
-
metadata_2: {
|
|
44
|
-
type: mongoose_1.default.Schema.Types.Mixed,
|
|
45
|
-
},
|
|
46
|
-
metadata_3: {
|
|
47
|
-
type: mongoose_1.default.Schema.Types.Mixed,
|
|
48
|
-
},
|
|
49
|
-
js: {
|
|
37
|
+
adminEmail: {
|
|
50
38
|
type: String,
|
|
39
|
+
required: true,
|
|
51
40
|
},
|
|
52
|
-
|
|
41
|
+
adminContact: {
|
|
53
42
|
type: String,
|
|
43
|
+
required: true,
|
|
54
44
|
},
|
|
55
|
-
|
|
56
|
-
type:
|
|
45
|
+
createdBy: {
|
|
46
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
47
|
+
ref: "user",
|
|
57
48
|
},
|
|
58
|
-
|
|
49
|
+
address: {
|
|
59
50
|
type: String,
|
|
51
|
+
required: true,
|
|
60
52
|
},
|
|
61
|
-
|
|
62
|
-
const ExperimentsSchema = new mongoose_1.Schema({
|
|
63
|
-
status: {
|
|
53
|
+
city: {
|
|
64
54
|
type: String,
|
|
55
|
+
required: true,
|
|
65
56
|
},
|
|
66
|
-
|
|
57
|
+
state: {
|
|
67
58
|
type: String,
|
|
68
59
|
required: true,
|
|
69
60
|
},
|
|
70
|
-
|
|
71
|
-
type: Number,
|
|
72
|
-
default: 100,
|
|
73
|
-
},
|
|
74
|
-
audiences_match_type: {
|
|
61
|
+
zip: {
|
|
75
62
|
type: String,
|
|
76
|
-
|
|
77
|
-
},
|
|
78
|
-
metadata_1: {
|
|
79
|
-
type: mongoose_1.default.Schema.Types.Mixed,
|
|
80
|
-
},
|
|
81
|
-
metadata_2: {
|
|
82
|
-
type: mongoose_1.default.Schema.Types.Mixed,
|
|
83
|
-
},
|
|
84
|
-
metadata_3: {
|
|
85
|
-
type: mongoose_1.default.Schema.Types.Mixed,
|
|
86
|
-
},
|
|
87
|
-
integrations_run_mode: {
|
|
88
|
-
type: mongoose_1.default.Schema.Types.Mixed,
|
|
63
|
+
required: true,
|
|
89
64
|
},
|
|
90
|
-
|
|
65
|
+
country: {
|
|
91
66
|
type: String,
|
|
67
|
+
required: true,
|
|
92
68
|
},
|
|
93
|
-
|
|
69
|
+
phone: {
|
|
94
70
|
type: String,
|
|
71
|
+
required: true,
|
|
95
72
|
},
|
|
96
|
-
|
|
73
|
+
logo: {
|
|
97
74
|
type: String,
|
|
75
|
+
required: true,
|
|
98
76
|
},
|
|
99
|
-
|
|
100
|
-
type:
|
|
77
|
+
website: {
|
|
78
|
+
type: String,
|
|
79
|
+
required: true,
|
|
101
80
|
},
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
81
|
+
isActive: {
|
|
82
|
+
type: Boolean,
|
|
83
|
+
default: true,
|
|
105
84
|
},
|
|
85
|
+
}, {
|
|
86
|
+
timestamps: true
|
|
106
87
|
});
|
|
107
|
-
const
|
|
108
|
-
|
|
88
|
+
const Organization = (0, mongoose_1.model)("organization", OrganizationSchema);
|
|
89
|
+
OrganizationSchema.index({ name: 1, isActive: 1 });
|
|
90
|
+
exports.default = Organization;
|
|
@@ -31,13 +31,15 @@ export interface IUrltargetings extends Document {
|
|
|
31
31
|
export interface IPage extends Document {
|
|
32
32
|
name: string;
|
|
33
33
|
client?: mongoose.Schema.Types.ObjectId;
|
|
34
|
+
organizationId?: mongoose.Schema.Types.ObjectId;
|
|
34
35
|
trigger: string;
|
|
35
36
|
trigger_js: string;
|
|
36
37
|
api_name: string;
|
|
37
38
|
poll_on_rules: Boolean;
|
|
38
39
|
deactivation_mode: string;
|
|
39
40
|
rules_js: string;
|
|
40
|
-
urltargetings: IUrltargetings;
|
|
41
|
+
urltargetings: IUrltargetings[];
|
|
42
|
+
isActive?: boolean;
|
|
41
43
|
}
|
|
42
44
|
declare const Page: mongoose.Model<IPage, {}, {}, {}, mongoose.Document<unknown, {}, IPage> & IPage & {
|
|
43
45
|
_id: mongoose.Types.ObjectId;
|
package/dist/src/models/Page.js
CHANGED
|
@@ -32,45 +32,97 @@ mongoose_1.default.plugin(mongoose_slug_updater_1.default);
|
|
|
32
32
|
const UrltargetingsSchema = new mongoose_1.Schema({
|
|
33
33
|
type: {
|
|
34
34
|
type: String,
|
|
35
|
+
required: true,
|
|
36
|
+
trim: true,
|
|
35
37
|
},
|
|
36
38
|
url: {
|
|
37
39
|
type: String,
|
|
40
|
+
required: true,
|
|
41
|
+
trim: true,
|
|
38
42
|
},
|
|
39
43
|
url_type: {
|
|
40
44
|
type: String,
|
|
45
|
+
required: true,
|
|
46
|
+
trim: true,
|
|
41
47
|
},
|
|
42
48
|
});
|
|
43
49
|
const PageSchema = new mongoose_1.Schema({
|
|
44
50
|
name: {
|
|
45
51
|
type: String,
|
|
46
52
|
required: true,
|
|
53
|
+
trim: true,
|
|
54
|
+
index: true,
|
|
47
55
|
},
|
|
48
56
|
trigger: {
|
|
49
57
|
type: String,
|
|
50
|
-
default: "direct"
|
|
58
|
+
default: "direct",
|
|
59
|
+
trim: true,
|
|
60
|
+
index: true,
|
|
61
|
+
},
|
|
62
|
+
organizationId: {
|
|
63
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
64
|
+
ref: "organization",
|
|
65
|
+
default: null,
|
|
66
|
+
index: true,
|
|
51
67
|
},
|
|
52
68
|
client: {
|
|
53
69
|
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
54
70
|
ref: "client",
|
|
71
|
+
required: true,
|
|
72
|
+
index: true,
|
|
55
73
|
},
|
|
56
74
|
trigger_js: {
|
|
57
75
|
type: String,
|
|
58
|
-
default: ""
|
|
76
|
+
default: "",
|
|
77
|
+
trim: true,
|
|
78
|
+
},
|
|
79
|
+
api_name: {
|
|
80
|
+
type: String,
|
|
81
|
+
slug: ["name"],
|
|
82
|
+
slugPaddingSize: 4,
|
|
83
|
+
unique: true,
|
|
84
|
+
trim: true,
|
|
59
85
|
},
|
|
60
|
-
api_name: { type: String, slug: ["name"], slugPaddingSize: 4, unique: true },
|
|
61
86
|
poll_on_rules: {
|
|
62
87
|
type: Boolean,
|
|
63
88
|
default: false,
|
|
89
|
+
index: true,
|
|
64
90
|
},
|
|
65
91
|
deactivation_mode: {
|
|
66
92
|
type: String,
|
|
67
93
|
default: "reset",
|
|
94
|
+
trim: true,
|
|
68
95
|
},
|
|
69
96
|
rules_js: {
|
|
70
97
|
type: String,
|
|
71
|
-
default: "return true"
|
|
98
|
+
default: "return true",
|
|
99
|
+
trim: true,
|
|
72
100
|
},
|
|
73
101
|
urltargetings: [UrltargetingsSchema],
|
|
102
|
+
isActive: {
|
|
103
|
+
type: Boolean,
|
|
104
|
+
default: true,
|
|
105
|
+
index: true,
|
|
106
|
+
}
|
|
107
|
+
}, {
|
|
108
|
+
timestamps: true
|
|
74
109
|
});
|
|
110
|
+
// Compound indexes for common query patterns
|
|
111
|
+
PageSchema.index({ client: 1, name: 1 }, { unique: true });
|
|
112
|
+
PageSchema.index({ client: 1, isActive: 1 });
|
|
113
|
+
PageSchema.index({ organizationId: 1, client: 1 });
|
|
114
|
+
PageSchema.index({ organizationId: 1, name: 1 });
|
|
115
|
+
// Text index for full-text search
|
|
116
|
+
// PageSchema.index({
|
|
117
|
+
// name: 'text',
|
|
118
|
+
// trigger_js: 'text',
|
|
119
|
+
// rules_js: 'text'
|
|
120
|
+
// }, {
|
|
121
|
+
// weights: {
|
|
122
|
+
// name: 10,
|
|
123
|
+
// trigger_js: 5,
|
|
124
|
+
// rules_js: 5
|
|
125
|
+
// }
|
|
126
|
+
// });
|
|
75
127
|
const Page = (0, mongoose_1.model)("page", PageSchema);
|
|
76
128
|
exports.default = Page;
|
|
@@ -26,6 +26,9 @@ import mongoose, { Document } from "mongoose";
|
|
|
26
26
|
export interface IPageElement extends Document {
|
|
27
27
|
name: string;
|
|
28
28
|
slug?: string;
|
|
29
|
+
organizationId?: mongoose.Schema.Types.ObjectId;
|
|
30
|
+
client?: mongoose.Schema.Types.ObjectId;
|
|
31
|
+
isActive?: boolean;
|
|
29
32
|
createdAt?: Date;
|
|
30
33
|
updatedAt?: Date;
|
|
31
34
|
}
|
|
@@ -1,22 +1,74 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
2
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const mongoose_1 = require("mongoose");
|
|
29
|
+
const mongoose_1 = __importStar(require("mongoose"));
|
|
30
|
+
const mongoose_slug_updater_1 = __importDefault(require("mongoose-slug-updater"));
|
|
31
|
+
mongoose_1.default.plugin(mongoose_slug_updater_1.default);
|
|
4
32
|
const PageElementSchema = new mongoose_1.Schema({
|
|
5
33
|
name: {
|
|
6
34
|
type: String,
|
|
7
35
|
required: true,
|
|
36
|
+
trim: true,
|
|
37
|
+
index: true,
|
|
8
38
|
},
|
|
9
39
|
slug: {
|
|
10
40
|
type: String,
|
|
41
|
+
slug: ["name"],
|
|
42
|
+
slugPaddingSize: 4,
|
|
43
|
+
unique: true,
|
|
44
|
+
trim: true,
|
|
11
45
|
},
|
|
12
|
-
|
|
13
|
-
type:
|
|
14
|
-
|
|
46
|
+
organizationId: {
|
|
47
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
48
|
+
ref: "organization",
|
|
49
|
+
index: true,
|
|
50
|
+
default: null,
|
|
15
51
|
},
|
|
16
|
-
|
|
17
|
-
type:
|
|
18
|
-
|
|
52
|
+
client: {
|
|
53
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
54
|
+
ref: "client",
|
|
55
|
+
required: true,
|
|
56
|
+
index: true,
|
|
19
57
|
},
|
|
58
|
+
isActive: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: true,
|
|
61
|
+
index: true,
|
|
62
|
+
}
|
|
63
|
+
}, {
|
|
64
|
+
timestamps: true
|
|
20
65
|
});
|
|
66
|
+
// Compound indexes for common query patterns
|
|
67
|
+
PageElementSchema.index({ client: 1, name: 1 }, { unique: true });
|
|
68
|
+
PageElementSchema.index({ client: 1, isActive: 1 });
|
|
69
|
+
PageElementSchema.index({ organizationId: 1, client: 1 });
|
|
70
|
+
PageElementSchema.index({ organizationId: 1, name: 1 });
|
|
71
|
+
// Text index for full-text search
|
|
72
|
+
PageElementSchema.index({ name: 'text' });
|
|
21
73
|
const PageElement = (0, mongoose_1.model)("pageelement", PageElementSchema);
|
|
22
74
|
exports.default = PageElement;
|
|
@@ -26,8 +26,10 @@ import mongoose, { Document } from "mongoose";
|
|
|
26
26
|
export interface IPageTestType extends Document {
|
|
27
27
|
name: string;
|
|
28
28
|
details?: string;
|
|
29
|
+
isActive?: boolean;
|
|
29
30
|
createdAt?: Date;
|
|
30
31
|
updatedAt?: Date;
|
|
32
|
+
organizationId?: mongoose.Schema.Types.ObjectId;
|
|
31
33
|
}
|
|
32
34
|
declare const PageTestType: mongoose.Model<IPageTestType, {}, {}, {}, mongoose.Document<unknown, {}, IPageTestType> & IPageTestType & {
|
|
33
35
|
_id: mongoose.Types.ObjectId;
|
|
@@ -1,24 +1,60 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
2
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const mongoose_1 = require("mongoose");
|
|
26
|
+
const mongoose_1 = __importStar(require("mongoose"));
|
|
4
27
|
const PageTestTypeSchema = new mongoose_1.Schema({
|
|
28
|
+
organizationId: {
|
|
29
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
30
|
+
ref: "organization",
|
|
31
|
+
default: null,
|
|
32
|
+
},
|
|
5
33
|
name: {
|
|
6
34
|
type: String,
|
|
7
35
|
required: true,
|
|
8
36
|
unique: true,
|
|
37
|
+
trim: true,
|
|
38
|
+
index: true,
|
|
9
39
|
},
|
|
10
40
|
details: {
|
|
11
41
|
type: String,
|
|
12
42
|
default: "",
|
|
43
|
+
trim: true,
|
|
13
44
|
},
|
|
14
45
|
createdAt: {
|
|
15
46
|
type: Date,
|
|
16
47
|
default: new Date(),
|
|
17
48
|
},
|
|
18
|
-
|
|
19
|
-
type:
|
|
20
|
-
default:
|
|
21
|
-
|
|
49
|
+
isActive: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
default: true,
|
|
52
|
+
index: true,
|
|
53
|
+
}
|
|
54
|
+
}, {
|
|
55
|
+
timestamps: true
|
|
22
56
|
});
|
|
57
|
+
// Compound indexes for common query patterns
|
|
58
|
+
PageTestTypeSchema.index({ name: 1, isActive: 1 });
|
|
23
59
|
const PageTestType = (0, mongoose_1.model)("pagetesttype", PageTestTypeSchema);
|
|
24
60
|
exports.default = PageTestType;
|
|
@@ -26,6 +26,7 @@ import mongoose, { Document } from "mongoose";
|
|
|
26
26
|
export interface IPortfolio extends Document {
|
|
27
27
|
portfoliokey: mongoose.Schema.Types.Mixed;
|
|
28
28
|
portfolioData?: mongoose.Schema.Types.Mixed;
|
|
29
|
+
organizationId?: mongoose.Schema.Types.ObjectId;
|
|
29
30
|
}
|
|
30
31
|
declare const Portfolio: mongoose.Model<IPortfolio, {}, {}, {}, mongoose.Document<unknown, {}, IPortfolio> & IPortfolio & {
|
|
31
32
|
_id: mongoose.Types.ObjectId;
|
|
@@ -33,6 +33,11 @@ const PortfolioSchema = new mongoose_1.Schema({
|
|
|
33
33
|
type: mongoose_1.default.Schema.Types.Mixed,
|
|
34
34
|
default: null,
|
|
35
35
|
},
|
|
36
|
+
organizationId: {
|
|
37
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
38
|
+
ref: "organization",
|
|
39
|
+
default: null,
|
|
40
|
+
},
|
|
36
41
|
}, {
|
|
37
42
|
timestamps: true,
|
|
38
43
|
});
|
|
@@ -0,0 +1,36 @@
|
|
|
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 mongoose, { Document } from "mongoose";
|
|
26
|
+
export interface IPrecalculationFilters extends Document {
|
|
27
|
+
title: string;
|
|
28
|
+
organizationId: mongoose.Schema.Types.ObjectId;
|
|
29
|
+
client: mongoose.Schema.Types.ObjectId;
|
|
30
|
+
filters: any;
|
|
31
|
+
otherFilters: any;
|
|
32
|
+
}
|
|
33
|
+
declare const PrecalculationFilters: mongoose.Model<IPrecalculationFilters, {}, {}, {}, mongoose.Document<unknown, {}, IPrecalculationFilters> & IPrecalculationFilters & {
|
|
34
|
+
_id: mongoose.Types.ObjectId;
|
|
35
|
+
}, any>;
|
|
36
|
+
export default PrecalculationFilters;
|