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
package/src/models/Tier.ts
CHANGED
|
@@ -6,9 +6,15 @@ export interface ITier extends Document {
|
|
|
6
6
|
colorSwatch?: string;
|
|
7
7
|
createdAt?: Date;
|
|
8
8
|
updatedAt?: Date;
|
|
9
|
+
organizationId?: mongoose.Schema.Types.ObjectId;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
const TierSchema = new Schema<ITier>({
|
|
13
|
+
organizationId: {
|
|
14
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
15
|
+
ref: "organization",
|
|
16
|
+
default: null,
|
|
17
|
+
},
|
|
12
18
|
name: {
|
|
13
19
|
type: String,
|
|
14
20
|
unique: true,
|
package/src/models/Trigger.ts
CHANGED
|
@@ -6,9 +6,15 @@ export interface ITrigger extends Document {
|
|
|
6
6
|
slug?: string;
|
|
7
7
|
createdAt?: Date;
|
|
8
8
|
updatedAt?: Date;
|
|
9
|
+
organizationId?: mongoose.Schema.Types.ObjectId;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
const TriggerSchema = new Schema<ITrigger>({
|
|
13
|
+
organizationId: {
|
|
14
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
15
|
+
ref: "organization",
|
|
16
|
+
default: null,
|
|
17
|
+
},
|
|
12
18
|
name: {
|
|
13
19
|
type: String,
|
|
14
20
|
},
|
package/src/models/User.ts
CHANGED
|
@@ -12,6 +12,7 @@ export interface IUser extends Document {
|
|
|
12
12
|
createdAt: Date;
|
|
13
13
|
updatedAt: Date;
|
|
14
14
|
resetLink: string;
|
|
15
|
+
organizationId?: mongoose.Schema.Types.ObjectId;
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
const UserSchema = new Schema<IUser>({
|
|
@@ -43,19 +44,19 @@ const UserSchema = new Schema<IUser>({
|
|
|
43
44
|
type: Boolean,
|
|
44
45
|
default: false,
|
|
45
46
|
},
|
|
46
|
-
|
|
47
|
-
type:
|
|
48
|
-
|
|
49
|
-
},
|
|
50
|
-
updatedAt: {
|
|
51
|
-
type: Date,
|
|
52
|
-
default: new Date(),
|
|
53
|
-
},
|
|
54
|
-
resetLink: {
|
|
55
|
-
type: String,
|
|
47
|
+
organizationId: {
|
|
48
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
49
|
+
ref: "organization",
|
|
56
50
|
default: null,
|
|
57
51
|
},
|
|
52
|
+
}, {
|
|
53
|
+
timestamps: true
|
|
58
54
|
});
|
|
59
55
|
|
|
56
|
+
// Add compound indexes for common query patterns
|
|
57
|
+
UserSchema.index({ organizationId: 1, role: 1 });
|
|
58
|
+
UserSchema.index({ organizationId: 1, client: 1 });
|
|
59
|
+
UserSchema.index({ email: 1 }, { unique: true });
|
|
60
|
+
|
|
60
61
|
const User = model<IUser>("user", UserSchema);
|
|
61
62
|
export default User;
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import mongoose, { Document, Schema, model } from "mongoose";
|
|
2
|
-
|
|
3
|
-
export interface IPageTargeting extends Document {
|
|
4
|
-
condition: string;
|
|
5
|
-
routes: mongoose.Schema.Types.Mixed;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export interface IAudienceTargeting extends Document {
|
|
9
|
-
javascript: string;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface IVariants extends Document {
|
|
13
|
-
name: string;
|
|
14
|
-
javascript?: string;
|
|
15
|
-
css?: string;
|
|
16
|
-
traffic_allocation?: string;
|
|
17
|
-
slug?: string;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface IClientExperiment extends Document {
|
|
21
|
-
organisationId?: string;
|
|
22
|
-
client?: mongoose.Schema.Types.ObjectId;
|
|
23
|
-
viewId?: string;
|
|
24
|
-
javascript: string;
|
|
25
|
-
css: string;
|
|
26
|
-
name?: string;
|
|
27
|
-
status?: string;
|
|
28
|
-
experimentUrl: string;
|
|
29
|
-
pageTargeting: IPageTargeting;
|
|
30
|
-
audienceTargeting: IAudienceTargeting;
|
|
31
|
-
variants: IVariants;
|
|
32
|
-
createdAt?: Date;
|
|
33
|
-
updatedAt?: Date;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const PageTargetingSchema = new Schema<IPageTargeting>({
|
|
37
|
-
condition: {
|
|
38
|
-
type: String,
|
|
39
|
-
default: null,
|
|
40
|
-
},
|
|
41
|
-
routes: {
|
|
42
|
-
type: mongoose.Schema.Types.Mixed,
|
|
43
|
-
},
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
const AudienceTargetingSchema = new Schema<IAudienceTargeting>({
|
|
47
|
-
javascript: {
|
|
48
|
-
type: String,
|
|
49
|
-
default: "return true",
|
|
50
|
-
},
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
const VariantsSchema = new Schema<IVariants>({
|
|
54
|
-
name: {
|
|
55
|
-
type: String,
|
|
56
|
-
default: null,
|
|
57
|
-
},
|
|
58
|
-
traffic_allocation: {
|
|
59
|
-
type: Number,
|
|
60
|
-
default: null,
|
|
61
|
-
},
|
|
62
|
-
javascript: {
|
|
63
|
-
type: String,
|
|
64
|
-
default: null,
|
|
65
|
-
},
|
|
66
|
-
css: {
|
|
67
|
-
type: String,
|
|
68
|
-
default: null,
|
|
69
|
-
},
|
|
70
|
-
slug: {
|
|
71
|
-
type: String,
|
|
72
|
-
default: null,
|
|
73
|
-
},
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
const ClientExperimentSchema = new Schema<IClientExperiment>(
|
|
77
|
-
{
|
|
78
|
-
organisationId: {
|
|
79
|
-
type: String,
|
|
80
|
-
default: null,
|
|
81
|
-
},
|
|
82
|
-
name: String,
|
|
83
|
-
status: {
|
|
84
|
-
type: String,
|
|
85
|
-
default: "draft",
|
|
86
|
-
},
|
|
87
|
-
experimentUrl: String,
|
|
88
|
-
client: {
|
|
89
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
90
|
-
ref: "client",
|
|
91
|
-
},
|
|
92
|
-
viewId: {
|
|
93
|
-
type: String,
|
|
94
|
-
},
|
|
95
|
-
pageTargeting: [PageTargetingSchema],
|
|
96
|
-
audienceTargeting: AudienceTargetingSchema,
|
|
97
|
-
variants: [VariantsSchema],
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
timestamps: true,
|
|
101
|
-
}
|
|
102
|
-
);
|
|
103
|
-
|
|
104
|
-
ClientExperimentSchema.index({
|
|
105
|
-
client: 1,
|
|
106
|
-
});
|
|
107
|
-
|
|
108
|
-
const ClientExperiment = model<IClientExperiment>(
|
|
109
|
-
"clientexperiment",
|
|
110
|
-
ClientExperimentSchema
|
|
111
|
-
);
|
|
112
|
-
|
|
113
|
-
export default ClientExperiment;
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import mongoose, { Document, Schema, model } from "mongoose";
|
|
2
|
-
|
|
3
|
-
export interface IVariations extends Document {
|
|
4
|
-
name: string;
|
|
5
|
-
css_code: string;
|
|
6
|
-
baseline: Boolean;
|
|
7
|
-
traffic_allocation: Number;
|
|
8
|
-
metadata_1: mongoose.Schema.Types.Mixed;
|
|
9
|
-
metadata_2: mongoose.Schema.Types.Mixed;
|
|
10
|
-
metadata_3: mongoose.Schema.Types.Mixed;
|
|
11
|
-
js: string;
|
|
12
|
-
reset_js: string;
|
|
13
|
-
css: string;
|
|
14
|
-
changesets: string;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export interface IExperiments extends Document {
|
|
18
|
-
status: string;
|
|
19
|
-
name: string;
|
|
20
|
-
traffic_allocation: Number;
|
|
21
|
-
audiences_match_type: string;
|
|
22
|
-
metadata_1: mongoose.Schema.Types.Mixed;
|
|
23
|
-
metadata_2: mongoose.Schema.Types.Mixed;
|
|
24
|
-
metadata_3: mongoose.Schema.Types.Mixed;
|
|
25
|
-
integrations_run_mode: mongoose.Schema.Types.Mixed;
|
|
26
|
-
js: string;
|
|
27
|
-
reset_js: string;
|
|
28
|
-
csscode: string;
|
|
29
|
-
audiences?: mongoose.Schema.Types.Array;
|
|
30
|
-
variations: IVariations;
|
|
31
|
-
environments?: mongoose.Schema.Types.Array;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const VariationsSchema = new Schema<IVariations>({
|
|
35
|
-
name: {
|
|
36
|
-
type: String,
|
|
37
|
-
},
|
|
38
|
-
css_code: {
|
|
39
|
-
type: String,
|
|
40
|
-
},
|
|
41
|
-
baseline: {
|
|
42
|
-
type: Boolean,
|
|
43
|
-
},
|
|
44
|
-
traffic_allocation: {
|
|
45
|
-
type: Number,
|
|
46
|
-
},
|
|
47
|
-
metadata_1: {
|
|
48
|
-
type: mongoose.Schema.Types.Mixed,
|
|
49
|
-
},
|
|
50
|
-
metadata_2: {
|
|
51
|
-
type: mongoose.Schema.Types.Mixed,
|
|
52
|
-
},
|
|
53
|
-
metadata_3: {
|
|
54
|
-
type: mongoose.Schema.Types.Mixed,
|
|
55
|
-
},
|
|
56
|
-
js: {
|
|
57
|
-
type: String,
|
|
58
|
-
},
|
|
59
|
-
reset_js: {
|
|
60
|
-
type: String,
|
|
61
|
-
},
|
|
62
|
-
css: {
|
|
63
|
-
type: String,
|
|
64
|
-
},
|
|
65
|
-
changesets: {
|
|
66
|
-
type: String,
|
|
67
|
-
},
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
const ExperimentsSchema = new Schema<IExperiments>({
|
|
71
|
-
status: {
|
|
72
|
-
type: String,
|
|
73
|
-
},
|
|
74
|
-
name: {
|
|
75
|
-
type: String,
|
|
76
|
-
required: true,
|
|
77
|
-
},
|
|
78
|
-
traffic_allocation: {
|
|
79
|
-
type: Number,
|
|
80
|
-
default: 100,
|
|
81
|
-
},
|
|
82
|
-
audiences_match_type: {
|
|
83
|
-
type: String,
|
|
84
|
-
default: "all",
|
|
85
|
-
},
|
|
86
|
-
metadata_1: {
|
|
87
|
-
type: mongoose.Schema.Types.Mixed,
|
|
88
|
-
},
|
|
89
|
-
metadata_2: {
|
|
90
|
-
type: mongoose.Schema.Types.Mixed,
|
|
91
|
-
},
|
|
92
|
-
metadata_3: {
|
|
93
|
-
type: mongoose.Schema.Types.Mixed,
|
|
94
|
-
},
|
|
95
|
-
integrations_run_mode: {
|
|
96
|
-
type: mongoose.Schema.Types.Mixed,
|
|
97
|
-
},
|
|
98
|
-
js: {
|
|
99
|
-
type: String,
|
|
100
|
-
},
|
|
101
|
-
reset_js: {
|
|
102
|
-
type: String,
|
|
103
|
-
},
|
|
104
|
-
csscode: {
|
|
105
|
-
type: String,
|
|
106
|
-
},
|
|
107
|
-
audiences: {
|
|
108
|
-
type: mongoose.Schema.Types.Array,
|
|
109
|
-
},
|
|
110
|
-
variations: VariationsSchema,
|
|
111
|
-
environments: {
|
|
112
|
-
type: mongoose.Schema.Types.Array,
|
|
113
|
-
},
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
const Experiments = model<IExperiments>("experiments", ExperimentsSchema);
|
|
117
|
-
|
|
118
|
-
export default Experiments;
|