codebase-models 1.0.6 → 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 +5 -4
- package/dist/index.js +20 -11
- package/dist/src/models/Announcement.d.ts +6 -5
- package/dist/src/models/Announcement.js +29 -9
- package/dist/src/models/Audience.d.ts +2 -1
- package/dist/src/models/Audience.js +6 -1
- 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 +3 -1
- package/dist/src/models/Client.js +31 -45
- 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 +25 -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 -0
- package/dist/src/models/Report.js +35 -47
- 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 +18 -17
- 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
|
@@ -1,21 +1,73 @@
|
|
|
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");
|
|
4
|
-
const
|
|
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);
|
|
32
|
+
const StageInCustomerJourneySchema = new mongoose_1.Schema({
|
|
5
33
|
name: {
|
|
6
34
|
type: String,
|
|
35
|
+
required: true,
|
|
36
|
+
trim: true,
|
|
37
|
+
index: true,
|
|
7
38
|
},
|
|
8
39
|
stages: {
|
|
9
40
|
type: String,
|
|
41
|
+
required: true,
|
|
42
|
+
trim: true,
|
|
10
43
|
},
|
|
11
44
|
slug: {
|
|
12
45
|
type: String,
|
|
46
|
+
slug: ["name"],
|
|
47
|
+
slugPaddingSize: 4,
|
|
48
|
+
unique: true,
|
|
49
|
+
trim: true,
|
|
13
50
|
},
|
|
14
51
|
organizationId: {
|
|
15
|
-
type:
|
|
52
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
53
|
+
default: null,
|
|
54
|
+
ref: "organization",
|
|
55
|
+
index: true,
|
|
56
|
+
},
|
|
57
|
+
client: {
|
|
58
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
59
|
+
ref: "client",
|
|
60
|
+
index: true,
|
|
16
61
|
},
|
|
62
|
+
isActive: {
|
|
63
|
+
type: Boolean,
|
|
64
|
+
default: true,
|
|
65
|
+
index: true,
|
|
66
|
+
}
|
|
17
67
|
}, {
|
|
18
68
|
timestamps: true,
|
|
19
69
|
});
|
|
20
|
-
|
|
70
|
+
// Compound indexes for common query patterns
|
|
71
|
+
// StageInCustomerJourneySchema.index({ client: 1, slug: 1 });
|
|
72
|
+
const StageInCustomerJourney = (0, mongoose_1.model)("stageincustomerjourney", StageInCustomerJourneySchema);
|
|
21
73
|
exports.default = StageInCustomerJourney;
|
package/dist/src/models/Tag.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ export interface ITag extends Document {
|
|
|
27
27
|
name: string;
|
|
28
28
|
createdAt?: Date;
|
|
29
29
|
updatedAt?: Date;
|
|
30
|
+
organizationId?: mongoose.Schema.Types.ObjectId;
|
|
30
31
|
}
|
|
31
32
|
declare const Tag: mongoose.Model<ITag, {}, {}, {}, mongoose.Document<unknown, {}, ITag> & ITag & {
|
|
32
33
|
_id: mongoose.Types.ObjectId;
|
package/dist/src/models/Tag.js
CHANGED
|
@@ -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 TagSchema = 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
|
unique: true,
|
|
@@ -28,6 +28,7 @@ export interface ITemp extends Document {
|
|
|
28
28
|
userId: string;
|
|
29
29
|
enabled?: boolean;
|
|
30
30
|
createdAt?: Date;
|
|
31
|
+
organizationId?: mongoose.Schema.Types.ObjectId;
|
|
31
32
|
}
|
|
32
33
|
declare const Temp: mongoose.Model<ITemp, {}, {}, {}, mongoose.Document<unknown, {}, ITemp> & ITemp & {
|
|
33
34
|
_id: mongoose.Types.ObjectId;
|
package/dist/src/models/Temp.js
CHANGED
|
@@ -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 TempSchema = new mongoose_1.Schema({
|
|
28
|
+
organizationId: {
|
|
29
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
30
|
+
ref: "organization",
|
|
31
|
+
default: null,
|
|
32
|
+
},
|
|
5
33
|
secret: {
|
|
6
34
|
type: String,
|
|
7
35
|
},
|
|
@@ -26,8 +26,8 @@ import mongoose, { Document } from "mongoose";
|
|
|
26
26
|
export interface IVariations extends Document {
|
|
27
27
|
name: string;
|
|
28
28
|
css_code: string;
|
|
29
|
-
baseline:
|
|
30
|
-
traffic_allocation:
|
|
29
|
+
baseline: boolean;
|
|
30
|
+
traffic_allocation: number;
|
|
31
31
|
metadata_1: mongoose.Schema.Types.Mixed;
|
|
32
32
|
metadata_2: mongoose.Schema.Types.Mixed;
|
|
33
33
|
metadata_3: mongoose.Schema.Types.Mixed;
|
|
@@ -37,10 +37,10 @@ export interface IVariations extends Document {
|
|
|
37
37
|
changesets: string;
|
|
38
38
|
}
|
|
39
39
|
export interface ITest extends Document {
|
|
40
|
-
|
|
40
|
+
organizationId?: mongoose.Schema.Types.ObjectId;
|
|
41
41
|
status: string;
|
|
42
42
|
name: string;
|
|
43
|
-
traffic_allocation:
|
|
43
|
+
traffic_allocation: number;
|
|
44
44
|
audiences_match_type: string;
|
|
45
45
|
metadata_1: mongoose.Schema.Types.Mixed;
|
|
46
46
|
metadata_2: mongoose.Schema.Types.Mixed;
|
|
@@ -49,37 +49,38 @@ export interface ITest extends Document {
|
|
|
49
49
|
jscode: string;
|
|
50
50
|
reset_js: string;
|
|
51
51
|
csscode: string;
|
|
52
|
-
|
|
52
|
+
htmlcode: string;
|
|
53
|
+
audiences?: mongoose.Schema.Types.ObjectId[];
|
|
53
54
|
variations: IVariations[];
|
|
54
|
-
environments
|
|
55
|
+
environments?: mongoose.Schema.Types.ObjectId[];
|
|
55
56
|
pages?: mongoose.Schema.Types.ObjectId[];
|
|
56
57
|
pageelement?: mongoose.Schema.Types.ObjectId[];
|
|
57
58
|
client?: mongoose.Schema.Types.ObjectId;
|
|
58
|
-
property: mongoose.Schema.Types.Mixed;
|
|
59
|
-
platform: string;
|
|
60
|
-
viewId: string;
|
|
61
59
|
goal?: mongoose.Schema.Types.ObjectId[];
|
|
62
60
|
pagetesttype?: mongoose.Schema.Types.ObjectId[];
|
|
63
|
-
controlimage: string;
|
|
64
|
-
variationimage: string;
|
|
65
61
|
tags?: mongoose.Schema.Types.ObjectId[];
|
|
66
62
|
hypothesis?: mongoose.Schema.Types.ObjectId;
|
|
67
|
-
|
|
63
|
+
trigger?: mongoose.Schema.Types.ObjectId[];
|
|
64
|
+
stageincustomerjourney?: mongoose.Schema.Types.ObjectId;
|
|
65
|
+
property?: mongoose.Schema.Types.Mixed;
|
|
66
|
+
platform: string;
|
|
67
|
+
viewId: string;
|
|
68
|
+
controlimage: string;
|
|
69
|
+
variationimage: string;
|
|
70
|
+
urltargeting: any[];
|
|
68
71
|
pageaudience: string;
|
|
69
72
|
targetaudience: string;
|
|
70
73
|
page: string;
|
|
71
74
|
pageNotContains: string;
|
|
72
75
|
eventparameter: string;
|
|
73
|
-
htmlcode: string;
|
|
74
76
|
testid: string;
|
|
75
77
|
testtool: string;
|
|
78
|
+
personalization: boolean;
|
|
76
79
|
kameleoontestdetails: mongoose.Schema.Types.Mixed;
|
|
77
80
|
vwotestdetails: mongoose.Schema.Types.Mixed;
|
|
78
|
-
|
|
79
|
-
triggerevents?: [];
|
|
80
|
-
stageincustomerjourney?: mongoose.Schema.Types.ObjectId;
|
|
81
|
+
triggerevents: any[];
|
|
81
82
|
selectedevent: string;
|
|
82
|
-
revenue
|
|
83
|
+
revenue: any[];
|
|
83
84
|
significance: string;
|
|
84
85
|
recommendedsamplesize: number;
|
|
85
86
|
livedate: Date;
|
package/dist/src/models/Test.js
CHANGED
|
@@ -25,240 +25,137 @@ 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 VariationsSchema = new mongoose_1.Schema({
|
|
28
|
-
name: {
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
|
|
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
|
-
jscode: {
|
|
50
|
-
type: String,
|
|
51
|
-
},
|
|
52
|
-
reset_js: {
|
|
53
|
-
type: String,
|
|
54
|
-
},
|
|
55
|
-
csscode: {
|
|
56
|
-
type: String,
|
|
57
|
-
},
|
|
58
|
-
changesets: {
|
|
59
|
-
type: String,
|
|
60
|
-
default: "[]",
|
|
61
|
-
},
|
|
28
|
+
name: { type: String, required: true },
|
|
29
|
+
css_code: { type: String, default: "" },
|
|
30
|
+
baseline: { type: Boolean, default: false },
|
|
31
|
+
traffic_allocation: { type: Number, default: 0 },
|
|
32
|
+
metadata_1: { type: mongoose_1.default.Schema.Types.Mixed, default: null },
|
|
33
|
+
metadata_2: { type: mongoose_1.default.Schema.Types.Mixed, default: null },
|
|
34
|
+
metadata_3: { type: mongoose_1.default.Schema.Types.Mixed, default: null },
|
|
35
|
+
jscode: { type: String, default: "" },
|
|
36
|
+
reset_js: { type: String, default: "" },
|
|
37
|
+
csscode: { type: String, default: "" },
|
|
38
|
+
changesets: { type: String, default: "[]" }
|
|
62
39
|
});
|
|
63
40
|
const TestSchema = new mongoose_1.Schema({
|
|
64
|
-
|
|
65
|
-
type:
|
|
66
|
-
|
|
41
|
+
organizationId: {
|
|
42
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
43
|
+
ref: "organization",
|
|
44
|
+
default: null
|
|
67
45
|
},
|
|
68
46
|
status: {
|
|
69
47
|
type: String,
|
|
70
48
|
default: "draft",
|
|
71
|
-
enum: ["live", "draft", "ended", "paused", "preview"
|
|
72
|
-
},
|
|
73
|
-
name: {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
},
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
},
|
|
88
|
-
metadata_2: {
|
|
89
|
-
type: mongoose_1.default.Schema.Types.Mixed,
|
|
90
|
-
},
|
|
91
|
-
metadata_3: {
|
|
92
|
-
type: mongoose_1.default.Schema.Types.Mixed,
|
|
93
|
-
},
|
|
94
|
-
integrations_run_mode: {
|
|
95
|
-
type: mongoose_1.default.Schema.Types.Mixed,
|
|
96
|
-
},
|
|
97
|
-
jscode: {
|
|
98
|
-
type: String,
|
|
99
|
-
default: "",
|
|
100
|
-
},
|
|
101
|
-
reset_js: {
|
|
102
|
-
type: String,
|
|
103
|
-
},
|
|
104
|
-
csscode: {
|
|
105
|
-
type: String,
|
|
106
|
-
},
|
|
49
|
+
enum: ["live", "draft", "ended", "paused", "preview", "running"]
|
|
50
|
+
},
|
|
51
|
+
name: { type: String, required: true },
|
|
52
|
+
traffic_allocation: { type: Number, default: 100 },
|
|
53
|
+
audiences_match_type: { type: String, default: "all" },
|
|
54
|
+
// Metadata fields
|
|
55
|
+
metadata_1: { type: mongoose_1.default.Schema.Types.Mixed, default: null },
|
|
56
|
+
metadata_2: { type: mongoose_1.default.Schema.Types.Mixed, default: null },
|
|
57
|
+
metadata_3: { type: mongoose_1.default.Schema.Types.Mixed, default: null },
|
|
58
|
+
integrations_run_mode: { type: mongoose_1.default.Schema.Types.Mixed, default: null },
|
|
59
|
+
// Code fields
|
|
60
|
+
jscode: { type: String, default: "" },
|
|
61
|
+
reset_js: { type: String, default: "" },
|
|
62
|
+
csscode: { type: String, default: "" },
|
|
63
|
+
htmlcode: { type: String, default: "" },
|
|
64
|
+
// References with proper refs and defaults
|
|
107
65
|
audiences: {
|
|
108
66
|
type: [mongoose_1.default.Schema.Types.ObjectId],
|
|
109
67
|
ref: "audience",
|
|
110
|
-
default: []
|
|
68
|
+
default: []
|
|
111
69
|
},
|
|
112
70
|
pages: {
|
|
113
71
|
type: [mongoose_1.default.Schema.Types.ObjectId],
|
|
114
72
|
ref: "page",
|
|
115
|
-
default: []
|
|
73
|
+
default: []
|
|
116
74
|
},
|
|
117
75
|
variations: [VariationsSchema],
|
|
118
76
|
environments: {
|
|
119
77
|
type: [mongoose_1.default.Schema.Types.ObjectId],
|
|
120
78
|
ref: "environment",
|
|
121
|
-
default: []
|
|
79
|
+
default: []
|
|
122
80
|
},
|
|
123
81
|
pageelement: {
|
|
124
82
|
type: [mongoose_1.default.Schema.Types.ObjectId],
|
|
125
83
|
ref: "pageelement",
|
|
126
|
-
default: []
|
|
84
|
+
default: []
|
|
127
85
|
},
|
|
128
86
|
client: {
|
|
129
87
|
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
130
|
-
ref: "client"
|
|
131
|
-
},
|
|
132
|
-
property: {
|
|
133
|
-
type: mongoose_1.default.Schema.Types.Mixed,
|
|
134
|
-
},
|
|
135
|
-
platform: {
|
|
136
|
-
type: String,
|
|
137
|
-
default: "BQ",
|
|
138
|
-
},
|
|
139
|
-
viewId: {
|
|
140
|
-
type: String,
|
|
88
|
+
ref: "client"
|
|
141
89
|
},
|
|
142
90
|
goal: {
|
|
143
91
|
type: [mongoose_1.default.Schema.Types.ObjectId],
|
|
144
92
|
ref: "goal",
|
|
145
|
-
default: []
|
|
93
|
+
default: []
|
|
146
94
|
},
|
|
147
95
|
pagetesttype: {
|
|
148
96
|
type: [mongoose_1.default.Schema.Types.ObjectId],
|
|
149
97
|
ref: "pagetesttype",
|
|
150
|
-
default: []
|
|
151
|
-
},
|
|
152
|
-
controlimage: {
|
|
153
|
-
type: String,
|
|
154
|
-
default: null,
|
|
155
|
-
},
|
|
156
|
-
variationimage: {
|
|
157
|
-
type: String,
|
|
158
|
-
default: null,
|
|
98
|
+
default: []
|
|
159
99
|
},
|
|
160
100
|
tags: {
|
|
161
101
|
type: [mongoose_1.default.Schema.Types.ObjectId],
|
|
162
102
|
ref: "tag",
|
|
163
|
-
default: []
|
|
103
|
+
default: []
|
|
164
104
|
},
|
|
165
105
|
hypothesis: {
|
|
166
106
|
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
167
|
-
ref: "hypos"
|
|
168
|
-
default: null,
|
|
169
|
-
},
|
|
170
|
-
// Action , Posibility, Hypothesis
|
|
171
|
-
// Check if we need anymore
|
|
172
|
-
urltargeting: {
|
|
173
|
-
type: [],
|
|
174
|
-
default: [],
|
|
175
|
-
},
|
|
176
|
-
// Check if we need anymore
|
|
177
|
-
pageaudience: {
|
|
178
|
-
type: String,
|
|
179
|
-
default: null,
|
|
180
|
-
},
|
|
181
|
-
targetaudience: {
|
|
182
|
-
type: String,
|
|
183
|
-
default: null,
|
|
184
|
-
},
|
|
185
|
-
page: {
|
|
186
|
-
type: String,
|
|
187
|
-
default: null,
|
|
188
|
-
},
|
|
189
|
-
pageNotContains: {
|
|
190
|
-
type: String,
|
|
191
|
-
default: null,
|
|
192
|
-
},
|
|
193
|
-
eventparameter: {
|
|
194
|
-
type: String,
|
|
195
|
-
default: null,
|
|
196
|
-
},
|
|
197
|
-
htmlcode: {
|
|
198
|
-
type: String,
|
|
199
|
-
default: "",
|
|
200
|
-
},
|
|
201
|
-
testid: {
|
|
202
|
-
type: String,
|
|
203
|
-
default: null,
|
|
204
|
-
},
|
|
205
|
-
testtool: {
|
|
206
|
-
type: String,
|
|
207
|
-
default: "",
|
|
208
|
-
},
|
|
209
|
-
kameleoontestdetails: {
|
|
210
|
-
type: mongoose_1.default.Schema.Types.Mixed,
|
|
211
|
-
default: null,
|
|
212
|
-
},
|
|
213
|
-
vwotestdetails: {
|
|
214
|
-
type: mongoose_1.default.Schema.Types.Mixed,
|
|
215
|
-
default: null,
|
|
107
|
+
ref: "hypos"
|
|
216
108
|
},
|
|
217
109
|
trigger: {
|
|
218
110
|
type: [mongoose_1.default.Schema.Types.ObjectId],
|
|
219
111
|
ref: "trigger",
|
|
220
|
-
default: []
|
|
221
|
-
},
|
|
222
|
-
triggerevents: {
|
|
223
|
-
type: [],
|
|
224
|
-
default: [],
|
|
112
|
+
default: []
|
|
225
113
|
},
|
|
226
114
|
stageincustomerjourney: {
|
|
227
115
|
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
228
|
-
ref: "stageincustomerjourney"
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
},
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
},
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
},
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
},
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
},
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
}
|
|
255
|
-
enddate: {
|
|
256
|
-
type: Date,
|
|
257
|
-
default: null,
|
|
258
|
-
},
|
|
116
|
+
ref: "stageincustomerjourney"
|
|
117
|
+
},
|
|
118
|
+
// Test configuration
|
|
119
|
+
property: { type: mongoose_1.default.Schema.Types.Mixed, default: null },
|
|
120
|
+
platform: { type: String, default: "BQ" },
|
|
121
|
+
viewId: { type: String, default: "" },
|
|
122
|
+
controlimage: { type: String, default: null },
|
|
123
|
+
variationimage: { type: String, default: null },
|
|
124
|
+
urltargeting: { type: [], default: [] },
|
|
125
|
+
pageaudience: { type: String, default: null },
|
|
126
|
+
targetaudience: { type: String, default: null },
|
|
127
|
+
page: { type: String, default: null },
|
|
128
|
+
pageNotContains: { type: String, default: null },
|
|
129
|
+
eventparameter: { type: String, default: null },
|
|
130
|
+
testid: { type: String, default: null },
|
|
131
|
+
testtool: { type: String, default: "" },
|
|
132
|
+
personalization: { type: Boolean, default: false },
|
|
133
|
+
kameleoontestdetails: { type: mongoose_1.default.Schema.Types.Mixed, default: null },
|
|
134
|
+
vwotestdetails: { type: mongoose_1.default.Schema.Types.Mixed, default: null },
|
|
135
|
+
triggerevents: { type: [], default: [] },
|
|
136
|
+
selectedevent: { type: String, default: null },
|
|
137
|
+
revenue: { type: [], default: [] },
|
|
138
|
+
significance: { type: String, default: "" },
|
|
139
|
+
recommendedsamplesize: { type: Number, default: null },
|
|
140
|
+
livedate: { type: Date, default: null },
|
|
141
|
+
defaultControl: { type: String, default: null },
|
|
142
|
+
enddate: { type: Date, default: null }
|
|
259
143
|
}, {
|
|
260
|
-
timestamps: true
|
|
144
|
+
timestamps: true
|
|
261
145
|
});
|
|
146
|
+
// Add compound indexes for better query performance
|
|
262
147
|
TestSchema.index({ client: 1, status: 1 });
|
|
148
|
+
TestSchema.index({ client: 1, status: 1, livedate: 1 });
|
|
149
|
+
TestSchema.index({ client: 1, status: 1, enddate: 1 });
|
|
150
|
+
TestSchema.index({ client: 1, testtool: 1, status: 1 });
|
|
151
|
+
TestSchema.index({ name: 1 }, { collation: { locale: 'en', strength: 2 } }); // Case-insensitive search
|
|
152
|
+
TestSchema.index({ "variations._id": 1 });
|
|
153
|
+
TestSchema.index({ status: 1, livedate: 1 });
|
|
154
|
+
TestSchema.index({ status: 1, enddate: 1 });
|
|
155
|
+
// Add partial indexes for better performance
|
|
156
|
+
TestSchema.index({ status: 1 }, { partialFilterExpression: { status: { $in: ['live', 'running', 'draft', 'paused', 'preview', 'ended'] } } });
|
|
157
|
+
TestSchema.index({ client: 1, status: 1 }, { partialFilterExpression: { status: { $in: ['live', 'running', 'draft', 'paused', 'preview', 'ended'] } } });
|
|
158
|
+
// Add TTL index for automatic cleanup of ended tests after 1 year
|
|
159
|
+
TestSchema.index({ enddate: 1 }, { expireAfterSeconds: 31536000 });
|
|
263
160
|
const Test = (0, mongoose_1.model)("test", TestSchema);
|
|
264
161
|
exports.default = Test;
|
|
@@ -31,6 +31,7 @@ export interface ITestSequentialValue extends Document {
|
|
|
31
31
|
nMax: number;
|
|
32
32
|
createdAt?: Date;
|
|
33
33
|
updatedAt?: Date;
|
|
34
|
+
organizationId?: mongoose.Schema.Types.ObjectId;
|
|
34
35
|
}
|
|
35
36
|
declare const TestSequentialValue: mongoose.Model<ITestSequentialValue, {}, {}, {}, mongoose.Document<unknown, {}, ITestSequentialValue> & ITestSequentialValue & {
|
|
36
37
|
_id: mongoose.Types.ObjectId;
|
|
@@ -25,6 +25,11 @@ 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 TestSequentialValueSchema = new mongoose_1.Schema({
|
|
28
|
+
organizationId: {
|
|
29
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
30
|
+
ref: "organization",
|
|
31
|
+
default: null,
|
|
32
|
+
},
|
|
28
33
|
test: {
|
|
29
34
|
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
30
35
|
ref: "test",
|
|
@@ -29,6 +29,7 @@ export interface ITier extends Document {
|
|
|
29
29
|
colorSwatch?: string;
|
|
30
30
|
createdAt?: Date;
|
|
31
31
|
updatedAt?: Date;
|
|
32
|
+
organizationId?: mongoose.Schema.Types.ObjectId;
|
|
32
33
|
}
|
|
33
34
|
declare const Tier: mongoose.Model<ITier, {}, {}, {}, mongoose.Document<unknown, {}, ITier> & ITier & {
|
|
34
35
|
_id: mongoose.Types.ObjectId;
|
package/dist/src/models/Tier.js
CHANGED
|
@@ -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 TierSchema = 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
|
unique: true,
|
|
@@ -29,6 +29,7 @@ export interface ITrigger extends Document {
|
|
|
29
29
|
slug?: string;
|
|
30
30
|
createdAt?: Date;
|
|
31
31
|
updatedAt?: Date;
|
|
32
|
+
organizationId?: mongoose.Schema.Types.ObjectId;
|
|
32
33
|
}
|
|
33
34
|
declare const Trigger: mongoose.Model<ITrigger, {}, {}, {}, mongoose.Document<unknown, {}, ITrigger> & ITrigger & {
|
|
34
35
|
_id: mongoose.Types.ObjectId;
|