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
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
25
|
import mongoose, { Document } from "mongoose";
|
|
26
26
|
export interface IClientNote extends Document {
|
|
27
|
-
|
|
27
|
+
organizationId?: mongoose.Schema.Types.ObjectId;
|
|
28
28
|
client?: mongoose.Schema.Types.ObjectId;
|
|
29
29
|
viewId?: string;
|
|
30
30
|
pageType?: 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 ClientNoteSchema = 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
|
client: {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
25
|
import mongoose from "mongoose";
|
|
26
26
|
export interface IClientReportsTemp extends Document {
|
|
27
|
-
|
|
27
|
+
organizationId?: mongoose.Schema.Types.ObjectId;
|
|
28
28
|
client?: mongoose.Schema.Types.ObjectId;
|
|
29
29
|
viewId?: string;
|
|
30
30
|
test?: 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 ClientReportsTempSchema = 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
|
client: {
|
|
@@ -42,12 +43,15 @@ const ClientReportsTempSchema = new mongoose_1.Schema({
|
|
|
42
43
|
},
|
|
43
44
|
filters: {
|
|
44
45
|
type: String,
|
|
46
|
+
trim: true,
|
|
45
47
|
},
|
|
46
48
|
metricsFilters: {
|
|
47
49
|
type: String,
|
|
50
|
+
trim: true,
|
|
48
51
|
},
|
|
49
52
|
date: {
|
|
50
53
|
type: Date,
|
|
54
|
+
index: true,
|
|
51
55
|
},
|
|
52
56
|
report: {
|
|
53
57
|
type: mongoose_1.default.Schema.Types.Mixed,
|
|
@@ -55,6 +59,7 @@ const ClientReportsTempSchema = new mongoose_1.Schema({
|
|
|
55
59
|
deactivated: {
|
|
56
60
|
type: Boolean,
|
|
57
61
|
default: false,
|
|
62
|
+
index: true,
|
|
58
63
|
},
|
|
59
64
|
createdBy: {
|
|
60
65
|
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
@@ -63,5 +68,18 @@ const ClientReportsTempSchema = new mongoose_1.Schema({
|
|
|
63
68
|
}, {
|
|
64
69
|
timestamps: true,
|
|
65
70
|
});
|
|
71
|
+
// Compound indexes for common query patterns
|
|
72
|
+
ClientReportsTempSchema.index({ client: 1 });
|
|
73
|
+
ClientReportsTempSchema.index({ client: 1, test: 1 });
|
|
74
|
+
ClientReportsTempSchema.index({ client: 1, deactivated: 1 });
|
|
75
|
+
ClientReportsTempSchema.index({ client: 1, date: -1 });
|
|
76
|
+
ClientReportsTempSchema.index({ createdBy: 1, date: -1 });
|
|
77
|
+
ClientReportsTempSchema.index({ organisationId: 1, client: 1 });
|
|
78
|
+
// Sparse indexes for optional fields
|
|
79
|
+
ClientReportsTempSchema.index({ viewId: 1 }, { sparse: true });
|
|
80
|
+
ClientReportsTempSchema.index({ organisationId: 1 }, { sparse: true });
|
|
81
|
+
ClientReportsTempSchema.index({ test: 1 }, { sparse: true });
|
|
82
|
+
// TTL index for automatic cleanup of old reports
|
|
83
|
+
ClientReportsTempSchema.index({ date: 1 }, { expireAfterSeconds: 86400 }); // 24 hours
|
|
66
84
|
const ClientReportsTemp = (0, mongoose_1.model)("clientreportstemp", ClientReportsTempSchema);
|
|
67
85
|
exports.default = ClientReportsTemp;
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
25
|
import mongoose, { Document } from "mongoose";
|
|
26
26
|
export interface IClientRetention extends Document {
|
|
27
|
+
organizationId?: mongoose.Schema.Types.ObjectId;
|
|
27
28
|
client?: mongoose.Schema.Types.ObjectId;
|
|
28
29
|
viewId?: string;
|
|
29
30
|
year: Number;
|
|
@@ -25,10 +25,16 @@ 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 ClientRetentionSchema = new mongoose_1.Schema({
|
|
28
|
+
organizationId: {
|
|
29
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
30
|
+
ref: "organization",
|
|
31
|
+
default: null,
|
|
32
|
+
},
|
|
28
33
|
client: {
|
|
29
34
|
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
30
35
|
ref: "client",
|
|
31
36
|
required: true,
|
|
37
|
+
index: true,
|
|
32
38
|
},
|
|
33
39
|
viewId: {
|
|
34
40
|
type: String,
|
|
@@ -38,6 +44,7 @@ const ClientRetentionSchema = new mongoose_1.Schema({
|
|
|
38
44
|
type: Number,
|
|
39
45
|
required: true,
|
|
40
46
|
default: new Date().getFullYear(),
|
|
47
|
+
index: true,
|
|
41
48
|
},
|
|
42
49
|
retentions: {
|
|
43
50
|
type: [
|
|
@@ -81,5 +88,16 @@ const ClientRetentionSchema = new mongoose_1.Schema({
|
|
|
81
88
|
}, {
|
|
82
89
|
timestamps: true,
|
|
83
90
|
});
|
|
91
|
+
// Compound indexes for common query patterns
|
|
92
|
+
ClientRetentionSchema.index({ client: 1, year: 1 });
|
|
93
|
+
ClientRetentionSchema.index({ client: 1, viewId: 1 });
|
|
94
|
+
ClientRetentionSchema.index({ year: 1, "retentions.month": 1 });
|
|
95
|
+
ClientRetentionSchema.index({ client: 1, "retentions.active": 1 });
|
|
96
|
+
// Sparse indexes for optional fields
|
|
97
|
+
ClientRetentionSchema.index({ viewId: 1 }, { sparse: true });
|
|
98
|
+
// Partial index for active retentions
|
|
99
|
+
ClientRetentionSchema.index({ "retentions.active": 1 }, { partialFilterExpression: { "retentions.active": true } });
|
|
100
|
+
// Index for sorting by retainer value
|
|
101
|
+
ClientRetentionSchema.index({ "retentions.retainerValue": -1 });
|
|
84
102
|
const ClientRetention = (0, mongoose_1.model)("ClientRetention", ClientRetentionSchema);
|
|
85
103
|
exports.default = ClientRetention;
|
|
@@ -28,7 +28,7 @@ export interface IClientScriptSchema extends Document {
|
|
|
28
28
|
viewId: string;
|
|
29
29
|
}
|
|
30
30
|
export interface IClientScript extends Document {
|
|
31
|
-
|
|
31
|
+
organizationId?: mongoose.Schema.Types.ObjectId;
|
|
32
32
|
client?: mongoose.Schema.Types.ObjectId;
|
|
33
33
|
viewId?: string;
|
|
34
34
|
clientScriptURL: string;
|
|
@@ -25,23 +25,28 @@ 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 ClientScriptSchema = 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
|
client: {
|
|
33
34
|
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
34
35
|
ref: "client",
|
|
36
|
+
index: true,
|
|
35
37
|
},
|
|
36
38
|
viewId: {
|
|
37
39
|
type: String,
|
|
40
|
+
index: true,
|
|
38
41
|
},
|
|
39
42
|
clientScriptURL: {
|
|
40
43
|
type: String,
|
|
44
|
+
trim: true,
|
|
41
45
|
},
|
|
42
46
|
jquery_include: {
|
|
43
47
|
type: String,
|
|
44
48
|
default: "false",
|
|
49
|
+
trim: true,
|
|
45
50
|
},
|
|
46
51
|
debug: {
|
|
47
52
|
type: Boolean,
|
|
@@ -60,6 +65,7 @@ const ClientScriptSchema = new mongoose_1.Schema({
|
|
|
60
65
|
},
|
|
61
66
|
activation_mode: {
|
|
62
67
|
type: String,
|
|
68
|
+
trim: true,
|
|
63
69
|
},
|
|
64
70
|
use_antiflicker: {
|
|
65
71
|
type: Boolean,
|
|
@@ -71,17 +77,21 @@ const ClientScriptSchema = new mongoose_1.Schema({
|
|
|
71
77
|
},
|
|
72
78
|
rules: {
|
|
73
79
|
type: String,
|
|
74
|
-
default: "return true;"
|
|
80
|
+
default: "return true;",
|
|
81
|
+
trim: true,
|
|
75
82
|
},
|
|
76
83
|
rules_tracking: {
|
|
77
84
|
type: String,
|
|
78
|
-
default: "return true;"
|
|
85
|
+
default: "return true;",
|
|
86
|
+
trim: true,
|
|
79
87
|
},
|
|
80
88
|
tracker_url: {
|
|
81
89
|
type: String,
|
|
90
|
+
trim: true,
|
|
82
91
|
},
|
|
83
92
|
asset_url: {
|
|
84
93
|
type: String,
|
|
94
|
+
trim: true,
|
|
85
95
|
},
|
|
86
96
|
metadata_key_exp_1: {
|
|
87
97
|
type: mongoose_1.default.Schema.Types.Mixed,
|
|
@@ -103,6 +113,7 @@ const ClientScriptSchema = new mongoose_1.Schema({
|
|
|
103
113
|
},
|
|
104
114
|
cookie_domain: {
|
|
105
115
|
type: String,
|
|
116
|
+
trim: true,
|
|
106
117
|
},
|
|
107
118
|
snippet_version: {
|
|
108
119
|
type: Number,
|
|
@@ -110,6 +121,7 @@ const ClientScriptSchema = new mongoose_1.Schema({
|
|
|
110
121
|
storage: {
|
|
111
122
|
type: String,
|
|
112
123
|
default: "default",
|
|
124
|
+
trim: true,
|
|
113
125
|
},
|
|
114
126
|
run_only_on_reinit: {
|
|
115
127
|
type: Boolean,
|
|
@@ -124,9 +136,11 @@ const ClientScriptSchema = new mongoose_1.Schema({
|
|
|
124
136
|
},
|
|
125
137
|
jscode: {
|
|
126
138
|
type: String,
|
|
139
|
+
trim: true,
|
|
127
140
|
},
|
|
128
141
|
csscode: {
|
|
129
142
|
type: String,
|
|
143
|
+
trim: true,
|
|
130
144
|
},
|
|
131
145
|
is_spa: {
|
|
132
146
|
type: Boolean,
|
|
@@ -135,9 +149,11 @@ const ClientScriptSchema = new mongoose_1.Schema({
|
|
|
135
149
|
}, {
|
|
136
150
|
timestamps: true,
|
|
137
151
|
});
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
});
|
|
152
|
+
// Compound indexes for common query patterns
|
|
153
|
+
ClientScriptSchema.index({ client: 1 });
|
|
154
|
+
// Sparse indexes for optional fields
|
|
155
|
+
ClientScriptSchema.index({ organisationId: 1 }, { sparse: true });
|
|
156
|
+
ClientScriptSchema.index({ tracker_url: 1 }, { sparse: true });
|
|
157
|
+
ClientScriptSchema.index({ asset_url: 1 }, { sparse: true });
|
|
142
158
|
const ClientScript = (0, mongoose_1.model)("clientscript", ClientScriptSchema);
|
|
143
159
|
exports.default = ClientScript;
|
|
@@ -29,7 +29,7 @@ export interface IClientStrategy extends Document {
|
|
|
29
29
|
startDate?: Date;
|
|
30
30
|
endDate?: Date;
|
|
31
31
|
strategies?: mongoose.Schema.Types.Mixed;
|
|
32
|
-
|
|
32
|
+
organizationId?: mongoose.Schema.Types.ObjectId;
|
|
33
33
|
client?: mongoose.Schema.Types.ObjectId;
|
|
34
34
|
learningsoftime?: mongoose.Schema.Types.Mixed;
|
|
35
35
|
viewId?: string;
|
|
@@ -42,8 +42,9 @@ const ClientStrategySchema = new mongoose_1.Schema({
|
|
|
42
42
|
strategies: {
|
|
43
43
|
type: mongoose_1.default.Schema.Types.Mixed,
|
|
44
44
|
},
|
|
45
|
-
|
|
46
|
-
type:
|
|
45
|
+
organizationId: {
|
|
46
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
47
|
+
ref: "organization",
|
|
47
48
|
default: null,
|
|
48
49
|
},
|
|
49
50
|
client: {
|
|
@@ -26,6 +26,7 @@ import mongoose, { Document } from "mongoose";
|
|
|
26
26
|
export interface IClientSurvay extends Document {
|
|
27
27
|
responses: IResponce;
|
|
28
28
|
user?: mongoose.Schema.Types.ObjectId;
|
|
29
|
+
organizationId?: mongoose.Schema.Types.ObjectId;
|
|
29
30
|
}
|
|
30
31
|
export interface IResponce extends Document {
|
|
31
32
|
question?: String;
|
|
@@ -38,6 +38,11 @@ const ClientSurveySchema = new mongoose_1.Schema({
|
|
|
38
38
|
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
39
39
|
ref: "user",
|
|
40
40
|
},
|
|
41
|
+
organizationId: {
|
|
42
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
43
|
+
ref: "organization",
|
|
44
|
+
default: null,
|
|
45
|
+
},
|
|
41
46
|
}, {
|
|
42
47
|
timestamps: true,
|
|
43
48
|
});
|
|
@@ -27,6 +27,8 @@ export interface IEnvironment extends Document {
|
|
|
27
27
|
name: string;
|
|
28
28
|
rules_js?: string;
|
|
29
29
|
client?: mongoose.Schema.Types.ObjectId;
|
|
30
|
+
organizationId?: mongoose.Schema.Types.ObjectId;
|
|
31
|
+
isActive?: boolean;
|
|
30
32
|
}
|
|
31
33
|
declare const Environment: mongoose.Model<IEnvironment, {}, {}, {}, mongoose.Document<unknown, {}, IEnvironment> & IEnvironment & {
|
|
32
34
|
_id: mongoose.Types.ObjectId;
|
|
@@ -28,18 +28,42 @@ const EnvironmentSchema = new mongoose_1.Schema({
|
|
|
28
28
|
name: {
|
|
29
29
|
type: String,
|
|
30
30
|
required: true,
|
|
31
|
-
default: 'Default'
|
|
31
|
+
default: 'Default',
|
|
32
|
+
trim: true,
|
|
33
|
+
index: true,
|
|
32
34
|
},
|
|
33
35
|
client: {
|
|
34
36
|
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
35
37
|
ref: "client",
|
|
38
|
+
required: true,
|
|
39
|
+
index: true,
|
|
40
|
+
},
|
|
41
|
+
organizationId: {
|
|
42
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
43
|
+
ref: "organization",
|
|
44
|
+
index: true,
|
|
36
45
|
},
|
|
37
46
|
rules_js: {
|
|
38
47
|
type: String,
|
|
39
|
-
default: "return true"
|
|
48
|
+
default: "return true",
|
|
49
|
+
trim: true,
|
|
40
50
|
},
|
|
51
|
+
isActive: {
|
|
52
|
+
type: Boolean,
|
|
53
|
+
default: true,
|
|
54
|
+
index: true,
|
|
55
|
+
}
|
|
41
56
|
}, {
|
|
42
57
|
timestamps: true
|
|
43
58
|
});
|
|
59
|
+
// Compound indexes for common query patterns
|
|
60
|
+
EnvironmentSchema.index({ client: 1, name: 1 }, { unique: true });
|
|
61
|
+
EnvironmentSchema.index({ client: 1, isActive: 1 });
|
|
62
|
+
EnvironmentSchema.index({ organizationId: 1, client: 1 });
|
|
63
|
+
EnvironmentSchema.index({ organizationId: 1, name: 1 }, {
|
|
64
|
+
sparse: true,
|
|
65
|
+
});
|
|
66
|
+
// Text index for full-text search
|
|
67
|
+
EnvironmentSchema.index({ name: 'text' });
|
|
44
68
|
const Environment = (0, mongoose_1.model)("environment", EnvironmentSchema);
|
|
45
69
|
exports.default = Environment;
|
|
@@ -29,6 +29,7 @@ export interface IFaqs extends Document {
|
|
|
29
29
|
keywords?: mongoose.Schema.Types.Array;
|
|
30
30
|
createdAt?: Date;
|
|
31
31
|
updatedAt?: Date;
|
|
32
|
+
organizationId?: mongoose.Schema.Types.ObjectId;
|
|
32
33
|
}
|
|
33
34
|
declare const Faq: mongoose.Model<IFaqs, {}, {}, {}, mongoose.Document<unknown, {}, IFaqs> & IFaqs & {
|
|
34
35
|
_id: mongoose.Types.ObjectId;
|
package/dist/src/models/Faqs.js
CHANGED
|
@@ -42,6 +42,11 @@ const FaqSchema = new mongoose_1.Schema({
|
|
|
42
42
|
type: Date,
|
|
43
43
|
default: new Date(),
|
|
44
44
|
},
|
|
45
|
+
organizationId: {
|
|
46
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
47
|
+
ref: "organization",
|
|
48
|
+
default: null,
|
|
49
|
+
},
|
|
45
50
|
});
|
|
46
51
|
const Faq = (0, mongoose_1.model)("faq", FaqSchema);
|
|
47
52
|
exports.default = Faq;
|
|
@@ -28,7 +28,7 @@ export interface IFeedback extends Document {
|
|
|
28
28
|
details?: string;
|
|
29
29
|
client?: mongoose.Schema.Types.ObjectId;
|
|
30
30
|
thread?: mongoose.Schema.Types.Mixed;
|
|
31
|
-
|
|
31
|
+
organizationId?: mongoose.Schema.Types.ObjectId;
|
|
32
32
|
createdAt?: Date;
|
|
33
33
|
updatedAt?: Date;
|
|
34
34
|
}
|
|
@@ -41,8 +41,9 @@ const FeedbackSchema = new mongoose_1.Schema({
|
|
|
41
41
|
type: mongoose_1.default.Schema.Types.Mixed,
|
|
42
42
|
default: [],
|
|
43
43
|
},
|
|
44
|
-
|
|
45
|
-
type:
|
|
44
|
+
organizationId: {
|
|
45
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
46
|
+
ref: "organization",
|
|
46
47
|
default: null,
|
|
47
48
|
},
|
|
48
49
|
createdAt: {
|
|
@@ -27,13 +27,14 @@ export interface IGoal extends Document {
|
|
|
27
27
|
name: string;
|
|
28
28
|
details?: string;
|
|
29
29
|
slug?: string;
|
|
30
|
-
|
|
30
|
+
organizationId?: mongoose.Schema.Types.ObjectId;
|
|
31
31
|
client?: mongoose.Schema.Types.ObjectId;
|
|
32
32
|
type: string;
|
|
33
33
|
counting_method: string;
|
|
34
34
|
css_selector: string;
|
|
35
35
|
api_name: string;
|
|
36
36
|
rules_js: string;
|
|
37
|
+
isActive?: boolean;
|
|
37
38
|
createdAt?: Date;
|
|
38
39
|
updatedAt?: Date;
|
|
39
40
|
}
|
package/dist/src/models/Goal.js
CHANGED
|
@@ -33,43 +33,65 @@ const GoalSchema = new mongoose_1.Schema({
|
|
|
33
33
|
name: {
|
|
34
34
|
type: String,
|
|
35
35
|
required: true,
|
|
36
|
+
trim: true,
|
|
37
|
+
index: true,
|
|
36
38
|
},
|
|
37
39
|
details: {
|
|
38
40
|
type: String,
|
|
39
41
|
default: "",
|
|
42
|
+
trim: true,
|
|
40
43
|
},
|
|
41
44
|
slug: {
|
|
42
45
|
type: String,
|
|
46
|
+
unique: true,
|
|
47
|
+
sparse: true,
|
|
43
48
|
},
|
|
44
|
-
|
|
45
|
-
type:
|
|
49
|
+
organizationId: {
|
|
50
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
51
|
+
ref: "organization",
|
|
46
52
|
default: null,
|
|
53
|
+
index: true,
|
|
47
54
|
},
|
|
48
55
|
client: {
|
|
49
56
|
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
50
57
|
ref: "client",
|
|
58
|
+
index: true,
|
|
51
59
|
},
|
|
52
60
|
type: {
|
|
53
61
|
type: String,
|
|
62
|
+
trim: true,
|
|
54
63
|
},
|
|
55
64
|
counting_method: {
|
|
56
65
|
type: String,
|
|
66
|
+
trim: true,
|
|
57
67
|
},
|
|
58
68
|
css_selector: {
|
|
59
69
|
type: String,
|
|
70
|
+
trim: true,
|
|
60
71
|
},
|
|
61
|
-
api_name: {
|
|
62
|
-
rules_js: {
|
|
72
|
+
api_name: {
|
|
63
73
|
type: String,
|
|
74
|
+
slug: ["name"],
|
|
75
|
+
slugPaddingSize: 4,
|
|
76
|
+
unique: true,
|
|
77
|
+
trim: true,
|
|
64
78
|
},
|
|
65
|
-
|
|
66
|
-
type:
|
|
67
|
-
|
|
68
|
-
},
|
|
69
|
-
updatedAt: {
|
|
70
|
-
type: Date,
|
|
71
|
-
default: new Date(),
|
|
79
|
+
rules_js: {
|
|
80
|
+
type: String,
|
|
81
|
+
trim: true,
|
|
72
82
|
},
|
|
83
|
+
isActive: {
|
|
84
|
+
type: Boolean,
|
|
85
|
+
default: true,
|
|
86
|
+
index: true,
|
|
87
|
+
}
|
|
88
|
+
}, {
|
|
89
|
+
timestamps: true
|
|
73
90
|
});
|
|
91
|
+
// Compound indexes for common query patterns
|
|
92
|
+
GoalSchema.index({ client: 1 });
|
|
93
|
+
GoalSchema.index({ client: 1, isActive: 1 });
|
|
94
|
+
GoalSchema.index({ organizationId: 1, client: 1 });
|
|
95
|
+
GoalSchema.index({ client: 1, name: 1 }, { unique: true });
|
|
74
96
|
const Goal = (0, mongoose_1.model)("goal", GoalSchema);
|
|
75
97
|
exports.default = Goal;
|
|
@@ -24,12 +24,14 @@
|
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
25
|
import mongoose, { Document } from "mongoose";
|
|
26
26
|
export interface IHypothesis extends Document {
|
|
27
|
+
organizationId?: mongoose.Schema.Types.ObjectId;
|
|
27
28
|
hypothesisNumber?: string;
|
|
28
29
|
name: string;
|
|
29
30
|
action: string;
|
|
30
31
|
result: string;
|
|
31
32
|
expectation: string;
|
|
32
33
|
tagged?: string;
|
|
34
|
+
isActive?: boolean;
|
|
33
35
|
createdAt?: Date;
|
|
34
36
|
updatedAt?: Date;
|
|
35
37
|
}
|
|
@@ -1,38 +1,78 @@
|
|
|
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 HypothesisSchema = new mongoose_1.Schema({
|
|
28
|
+
organizationId: {
|
|
29
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
30
|
+
ref: "organization",
|
|
31
|
+
default: null,
|
|
32
|
+
},
|
|
5
33
|
hypothesisNumber: {
|
|
6
34
|
type: String,
|
|
35
|
+
trim: true,
|
|
36
|
+
index: true,
|
|
7
37
|
},
|
|
8
38
|
name: {
|
|
9
39
|
type: String,
|
|
10
40
|
required: true,
|
|
41
|
+
trim: true,
|
|
42
|
+
index: true,
|
|
11
43
|
},
|
|
12
44
|
action: {
|
|
13
45
|
type: String,
|
|
14
46
|
required: true,
|
|
47
|
+
trim: true,
|
|
15
48
|
},
|
|
16
49
|
result: {
|
|
17
50
|
type: String,
|
|
18
51
|
required: true,
|
|
52
|
+
trim: true,
|
|
19
53
|
},
|
|
20
54
|
expectation: {
|
|
21
55
|
type: String,
|
|
22
56
|
required: true,
|
|
57
|
+
trim: true,
|
|
23
58
|
},
|
|
24
59
|
tagged: {
|
|
25
60
|
type: String,
|
|
26
61
|
default: "General Purpose",
|
|
62
|
+
trim: true,
|
|
63
|
+
index: true,
|
|
27
64
|
},
|
|
28
|
-
|
|
29
|
-
type:
|
|
30
|
-
default:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
},
|
|
65
|
+
isActive: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
default: true,
|
|
68
|
+
index: true,
|
|
69
|
+
}
|
|
70
|
+
}, {
|
|
71
|
+
timestamps: true
|
|
36
72
|
});
|
|
73
|
+
// Compound indexes for common query patterns
|
|
74
|
+
HypothesisSchema.index({ hypothesisNumber: 1, isActive: 1 });
|
|
75
|
+
HypothesisSchema.index({ tagged: 1, isActive: 1 });
|
|
76
|
+
HypothesisSchema.index({ name: 1, isActive: 1 });
|
|
37
77
|
const Hypothesis = (0, mongoose_1.model)("hypos", HypothesisSchema);
|
|
38
78
|
exports.default = Hypothesis;
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
25
|
import mongoose, { Document } from "mongoose";
|
|
26
26
|
export interface IHypothesisSheet extends Document {
|
|
27
|
-
organizationId?:
|
|
27
|
+
organizationId?: mongoose.Schema.Types.ObjectId;
|
|
28
28
|
client?: mongoose.Schema.Types.ObjectId;
|
|
29
29
|
viewId?: string;
|
|
30
30
|
pageelement?: mongoose.Schema.Types.ObjectId;
|
|
@@ -1,14 +1,38 @@
|
|
|
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
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
27
|
};
|
|
5
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const mongoose_1 = require("mongoose");
|
|
29
|
+
const mongoose_1 = __importStar(require("mongoose"));
|
|
7
30
|
const constant_1 = __importDefault(require("../constant"));
|
|
8
31
|
const HypothesisSheetSchema = new mongoose_1.Schema({
|
|
9
32
|
organizationId: {
|
|
10
|
-
type:
|
|
33
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
11
34
|
default: null,
|
|
35
|
+
ref: "organization",
|
|
12
36
|
},
|
|
13
37
|
client: {
|
|
14
38
|
type: mongoose_1.Schema.Types.ObjectId,
|
|
@@ -25,12 +25,15 @@
|
|
|
25
25
|
import mongoose, { Document } from "mongoose";
|
|
26
26
|
export interface ILandingPagesData extends Document {
|
|
27
27
|
conversionRate?: Number;
|
|
28
|
+
lastUpdated?: Date;
|
|
28
29
|
}
|
|
29
30
|
export interface ILandingPages extends Document {
|
|
30
31
|
title: string;
|
|
31
32
|
client?: mongoose.Schema.Types.ObjectId;
|
|
33
|
+
organizationId?: mongoose.Schema.Types.ObjectId;
|
|
32
34
|
screenshot?: string;
|
|
33
35
|
dataPoints?: ILandingPagesData;
|
|
36
|
+
isActive?: boolean;
|
|
34
37
|
}
|
|
35
38
|
declare const LandingPages: mongoose.Model<ILandingPages, {}, {}, {}, mongoose.Document<unknown, {}, ILandingPages> & ILandingPages & {
|
|
36
39
|
_id: mongoose.Types.ObjectId;
|