codebase-models 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +8 -1
- package/dist/index.js +60 -6
- package/dist/src/models/AppEvent.d.ts +56 -0
- package/dist/src/models/AppEvent.js +66 -0
- package/dist/src/models/Audience.d.ts +34 -0
- package/dist/src/models/Audience.js +43 -0
- package/dist/src/models/ClientExperiment.d.ts +58 -0
- package/dist/src/models/ClientExperiment.js +92 -0
- package/dist/src/models/ClientScript.d.ts +66 -0
- package/dist/src/models/ClientScript.js +143 -0
- package/dist/src/models/ClientSurvay.js +1 -1
- package/dist/src/models/Environment.d.ts +34 -0
- package/dist/src/models/Environment.js +45 -0
- package/dist/src/models/Experiments.d.ts +58 -0
- package/dist/src/models/Experiments.js +108 -0
- package/dist/src/models/Goal.d.ts +6 -0
- package/dist/src/models/Goal.js +46 -1
- package/dist/src/models/Notification.js +5 -5
- package/dist/src/models/Page.d.ts +45 -0
- package/dist/src/models/Page.js +76 -0
- package/dist/src/models/SegmentCombination.js +1 -1
- package/dist/src/models/Test.d.ts +28 -4
- package/dist/src/models/Test.js +92 -15
- package/index.ts +14 -0
- package/package.json +1 -1
- package/src/models/AppEvent.ts +81 -0
- package/src/models/Audience.ts +27 -0
- package/src/models/ClientExperiment.ts +113 -0
- package/src/models/ClientScript.ts +164 -0
- package/src/models/Environment.ts +29 -0
- package/src/models/Experiments.ts +118 -0
- package/src/models/Goal.ts +25 -0
- package/src/models/Page.ts +69 -0
- package/src/models/Test.ts +122 -19
|
@@ -0,0 +1,143 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
const mongoose_1 = __importStar(require("mongoose"));
|
|
27
|
+
const ClientScriptSchema = new mongoose_1.Schema({
|
|
28
|
+
organisationId: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: null,
|
|
31
|
+
},
|
|
32
|
+
client: {
|
|
33
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
34
|
+
ref: "client",
|
|
35
|
+
},
|
|
36
|
+
viewId: {
|
|
37
|
+
type: String,
|
|
38
|
+
},
|
|
39
|
+
clientScriptURL: {
|
|
40
|
+
type: String,
|
|
41
|
+
},
|
|
42
|
+
jquery_include: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: "false",
|
|
45
|
+
},
|
|
46
|
+
debug: {
|
|
47
|
+
type: Boolean,
|
|
48
|
+
default: false,
|
|
49
|
+
},
|
|
50
|
+
restrict_debug: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: false,
|
|
53
|
+
},
|
|
54
|
+
adhere_dnt: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
default: false,
|
|
57
|
+
},
|
|
58
|
+
max_cookie_lifetime: {
|
|
59
|
+
type: Number,
|
|
60
|
+
},
|
|
61
|
+
activation_mode: {
|
|
62
|
+
type: String,
|
|
63
|
+
},
|
|
64
|
+
use_antiflicker: {
|
|
65
|
+
type: Boolean,
|
|
66
|
+
default: false,
|
|
67
|
+
},
|
|
68
|
+
snippet_revision: {
|
|
69
|
+
type: Number,
|
|
70
|
+
default: 1,
|
|
71
|
+
},
|
|
72
|
+
rules: {
|
|
73
|
+
type: String,
|
|
74
|
+
default: "return true;"
|
|
75
|
+
},
|
|
76
|
+
rules_tracking: {
|
|
77
|
+
type: String,
|
|
78
|
+
default: "return true;"
|
|
79
|
+
},
|
|
80
|
+
tracker_url: {
|
|
81
|
+
type: String,
|
|
82
|
+
},
|
|
83
|
+
asset_url: {
|
|
84
|
+
type: String,
|
|
85
|
+
},
|
|
86
|
+
metadata_key_exp_1: {
|
|
87
|
+
type: mongoose_1.default.Schema.Types.Mixed,
|
|
88
|
+
},
|
|
89
|
+
metadata_key_exp_2: {
|
|
90
|
+
type: mongoose_1.default.Schema.Types.Mixed,
|
|
91
|
+
},
|
|
92
|
+
metadata_key_exp_3: {
|
|
93
|
+
type: mongoose_1.default.Schema.Types.Mixed,
|
|
94
|
+
},
|
|
95
|
+
metadata_key_var_1: {
|
|
96
|
+
type: mongoose_1.default.Schema.Types.Mixed,
|
|
97
|
+
},
|
|
98
|
+
metadata_key_var_2: {
|
|
99
|
+
type: mongoose_1.default.Schema.Types.Mixed,
|
|
100
|
+
},
|
|
101
|
+
metadata_key_var_3: {
|
|
102
|
+
type: mongoose_1.default.Schema.Types.Mixed,
|
|
103
|
+
},
|
|
104
|
+
cookie_domain: {
|
|
105
|
+
type: String,
|
|
106
|
+
},
|
|
107
|
+
snippet_version: {
|
|
108
|
+
type: Number,
|
|
109
|
+
},
|
|
110
|
+
storage: {
|
|
111
|
+
type: String,
|
|
112
|
+
default: "default",
|
|
113
|
+
},
|
|
114
|
+
run_only_on_reinit: {
|
|
115
|
+
type: Boolean,
|
|
116
|
+
default: false,
|
|
117
|
+
},
|
|
118
|
+
allow_in_iframes: {
|
|
119
|
+
type: Boolean,
|
|
120
|
+
default: false,
|
|
121
|
+
},
|
|
122
|
+
visual_editor_version: {
|
|
123
|
+
type: Number,
|
|
124
|
+
},
|
|
125
|
+
jscode: {
|
|
126
|
+
type: String,
|
|
127
|
+
},
|
|
128
|
+
csscode: {
|
|
129
|
+
type: String,
|
|
130
|
+
},
|
|
131
|
+
is_spa: {
|
|
132
|
+
type: Boolean,
|
|
133
|
+
default: false,
|
|
134
|
+
},
|
|
135
|
+
}, {
|
|
136
|
+
timestamps: true,
|
|
137
|
+
});
|
|
138
|
+
ClientScriptSchema.index({
|
|
139
|
+
client: 1,
|
|
140
|
+
viewId: 1,
|
|
141
|
+
});
|
|
142
|
+
const ClientScript = (0, mongoose_1.model)("clientscript", ClientScriptSchema);
|
|
143
|
+
exports.default = ClientScript;
|
|
@@ -0,0 +1,34 @@
|
|
|
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 IEnvironment extends Document {
|
|
27
|
+
name: string;
|
|
28
|
+
rules_js?: string;
|
|
29
|
+
client?: mongoose.Schema.Types.ObjectId;
|
|
30
|
+
}
|
|
31
|
+
declare const Environment: mongoose.Model<IEnvironment, {}, {}, {}, mongoose.Document<unknown, {}, IEnvironment> & IEnvironment & {
|
|
32
|
+
_id: mongoose.Types.ObjectId;
|
|
33
|
+
}, any>;
|
|
34
|
+
export default Environment;
|
|
@@ -0,0 +1,45 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
const mongoose_1 = __importStar(require("mongoose"));
|
|
27
|
+
const EnvironmentSchema = new mongoose_1.Schema({
|
|
28
|
+
name: {
|
|
29
|
+
type: String,
|
|
30
|
+
required: true,
|
|
31
|
+
default: 'Default'
|
|
32
|
+
},
|
|
33
|
+
client: {
|
|
34
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
35
|
+
ref: "client",
|
|
36
|
+
},
|
|
37
|
+
rules_js: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: "return true"
|
|
40
|
+
},
|
|
41
|
+
}, {
|
|
42
|
+
timestamps: true
|
|
43
|
+
});
|
|
44
|
+
const Environment = (0, mongoose_1.model)("environment", EnvironmentSchema);
|
|
45
|
+
exports.default = Environment;
|
|
@@ -0,0 +1,58 @@
|
|
|
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 IVariations extends Document {
|
|
27
|
+
name: string;
|
|
28
|
+
css_code: string;
|
|
29
|
+
baseline: Boolean;
|
|
30
|
+
traffic_allocation: Number;
|
|
31
|
+
metadata_1: mongoose.Schema.Types.Mixed;
|
|
32
|
+
metadata_2: mongoose.Schema.Types.Mixed;
|
|
33
|
+
metadata_3: mongoose.Schema.Types.Mixed;
|
|
34
|
+
js: string;
|
|
35
|
+
reset_js: string;
|
|
36
|
+
css: string;
|
|
37
|
+
changesets: string;
|
|
38
|
+
}
|
|
39
|
+
export interface IExperiments extends Document {
|
|
40
|
+
status: string;
|
|
41
|
+
name: string;
|
|
42
|
+
traffic_allocation: Number;
|
|
43
|
+
audiences_match_type: string;
|
|
44
|
+
metadata_1: mongoose.Schema.Types.Mixed;
|
|
45
|
+
metadata_2: mongoose.Schema.Types.Mixed;
|
|
46
|
+
metadata_3: mongoose.Schema.Types.Mixed;
|
|
47
|
+
integrations_run_mode: mongoose.Schema.Types.Mixed;
|
|
48
|
+
js: string;
|
|
49
|
+
reset_js: string;
|
|
50
|
+
csscode: string;
|
|
51
|
+
audiences: mongoose.Schema.Types.Array;
|
|
52
|
+
variations: IVariations;
|
|
53
|
+
environments: mongoose.Schema.Types.Array;
|
|
54
|
+
}
|
|
55
|
+
declare const Experiments: mongoose.Model<IExperiments, {}, {}, {}, mongoose.Document<unknown, {}, IExperiments> & IExperiments & {
|
|
56
|
+
_id: mongoose.Types.ObjectId;
|
|
57
|
+
}, any>;
|
|
58
|
+
export default Experiments;
|
|
@@ -0,0 +1,108 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
const mongoose_1 = __importStar(require("mongoose"));
|
|
27
|
+
const VariationsSchema = new mongoose_1.Schema({
|
|
28
|
+
name: {
|
|
29
|
+
type: String,
|
|
30
|
+
},
|
|
31
|
+
css_code: {
|
|
32
|
+
type: String,
|
|
33
|
+
},
|
|
34
|
+
baseline: {
|
|
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: {
|
|
50
|
+
type: String,
|
|
51
|
+
},
|
|
52
|
+
reset_js: {
|
|
53
|
+
type: String,
|
|
54
|
+
},
|
|
55
|
+
css: {
|
|
56
|
+
type: String,
|
|
57
|
+
},
|
|
58
|
+
changesets: {
|
|
59
|
+
type: String,
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
const ExperimentsSchema = new mongoose_1.Schema({
|
|
63
|
+
status: {
|
|
64
|
+
type: String,
|
|
65
|
+
},
|
|
66
|
+
name: {
|
|
67
|
+
type: String,
|
|
68
|
+
required: true,
|
|
69
|
+
},
|
|
70
|
+
traffic_allocation: {
|
|
71
|
+
type: Number,
|
|
72
|
+
default: 100,
|
|
73
|
+
},
|
|
74
|
+
audiences_match_type: {
|
|
75
|
+
type: String,
|
|
76
|
+
default: "all",
|
|
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,
|
|
89
|
+
},
|
|
90
|
+
js: {
|
|
91
|
+
type: String,
|
|
92
|
+
},
|
|
93
|
+
reset_js: {
|
|
94
|
+
type: String,
|
|
95
|
+
},
|
|
96
|
+
csscode: {
|
|
97
|
+
type: String,
|
|
98
|
+
},
|
|
99
|
+
audiences: {
|
|
100
|
+
type: mongoose_1.default.Schema.Types.Array,
|
|
101
|
+
},
|
|
102
|
+
variations: VariationsSchema,
|
|
103
|
+
environments: {
|
|
104
|
+
type: mongoose_1.default.Schema.Types.Array,
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
const Experiments = (0, mongoose_1.model)("experiments", ExperimentsSchema);
|
|
108
|
+
exports.default = Experiments;
|
|
@@ -28,6 +28,12 @@ export interface IGoal extends Document {
|
|
|
28
28
|
details?: string;
|
|
29
29
|
slug?: string;
|
|
30
30
|
organisationId?: string;
|
|
31
|
+
client?: mongoose.Schema.Types.ObjectId;
|
|
32
|
+
type: string;
|
|
33
|
+
counting_method: string;
|
|
34
|
+
css_selector: string;
|
|
35
|
+
api_name: string;
|
|
36
|
+
rules_js: string;
|
|
31
37
|
createdAt?: Date;
|
|
32
38
|
updatedAt?: Date;
|
|
33
39
|
}
|
package/dist/src/models/Goal.js
CHANGED
|
@@ -1,6 +1,34 @@
|
|
|
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 GoalSchema = new mongoose_1.Schema({
|
|
5
33
|
name: {
|
|
6
34
|
type: String,
|
|
@@ -17,6 +45,23 @@ const GoalSchema = new mongoose_1.Schema({
|
|
|
17
45
|
type: String,
|
|
18
46
|
default: null,
|
|
19
47
|
},
|
|
48
|
+
client: {
|
|
49
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
50
|
+
ref: "client",
|
|
51
|
+
},
|
|
52
|
+
type: {
|
|
53
|
+
type: String,
|
|
54
|
+
},
|
|
55
|
+
counting_method: {
|
|
56
|
+
type: String,
|
|
57
|
+
},
|
|
58
|
+
css_selector: {
|
|
59
|
+
type: String,
|
|
60
|
+
},
|
|
61
|
+
api_name: { type: String, slug: ["name"], slugPaddingSize: 4, unique: true },
|
|
62
|
+
rules_js: {
|
|
63
|
+
type: String,
|
|
64
|
+
},
|
|
20
65
|
createdAt: {
|
|
21
66
|
type: Date,
|
|
22
67
|
default: new Date(),
|
|
@@ -3,10 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const mongoose_1 = require("mongoose");
|
|
4
4
|
const NotificationSchema = new mongoose_1.Schema({
|
|
5
5
|
title: {
|
|
6
|
-
type: String
|
|
6
|
+
type: String,
|
|
7
7
|
},
|
|
8
8
|
body: {
|
|
9
|
-
type: String
|
|
9
|
+
type: String,
|
|
10
10
|
},
|
|
11
11
|
users: {
|
|
12
12
|
type: [mongoose_1.Schema.Types.ObjectId],
|
|
@@ -21,11 +21,11 @@ const NotificationSchema = new mongoose_1.Schema({
|
|
|
21
21
|
default: false,
|
|
22
22
|
},
|
|
23
23
|
module: {
|
|
24
|
-
type: String
|
|
24
|
+
type: String,
|
|
25
25
|
},
|
|
26
26
|
moduleData: {
|
|
27
|
-
type: String
|
|
28
|
-
}
|
|
27
|
+
type: String,
|
|
28
|
+
},
|
|
29
29
|
}, {
|
|
30
30
|
timestamps: true,
|
|
31
31
|
});
|
|
@@ -0,0 +1,45 @@
|
|
|
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 IUrltargetings extends Document {
|
|
27
|
+
type: string;
|
|
28
|
+
url: string;
|
|
29
|
+
url_type: string;
|
|
30
|
+
}
|
|
31
|
+
export interface IPage extends Document {
|
|
32
|
+
name: string;
|
|
33
|
+
client?: mongoose.Schema.Types.ObjectId;
|
|
34
|
+
trigger: string;
|
|
35
|
+
trigger_js: string;
|
|
36
|
+
api_name: string;
|
|
37
|
+
poll_on_rules: Boolean;
|
|
38
|
+
deactivation_mode: string;
|
|
39
|
+
rules_js: string;
|
|
40
|
+
urltargetings: IUrltargetings;
|
|
41
|
+
}
|
|
42
|
+
declare const Page: mongoose.Model<IPage, {}, {}, {}, mongoose.Document<unknown, {}, IPage> & IPage & {
|
|
43
|
+
_id: mongoose.Types.ObjectId;
|
|
44
|
+
}, any>;
|
|
45
|
+
export default Page;
|
|
@@ -0,0 +1,76 @@
|
|
|
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
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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 UrltargetingsSchema = new mongoose_1.Schema({
|
|
33
|
+
type: {
|
|
34
|
+
type: String,
|
|
35
|
+
},
|
|
36
|
+
url: {
|
|
37
|
+
type: String,
|
|
38
|
+
},
|
|
39
|
+
url_type: {
|
|
40
|
+
type: String,
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
const PageSchema = new mongoose_1.Schema({
|
|
44
|
+
name: {
|
|
45
|
+
type: String,
|
|
46
|
+
required: true,
|
|
47
|
+
},
|
|
48
|
+
trigger: {
|
|
49
|
+
type: String,
|
|
50
|
+
default: "direct"
|
|
51
|
+
},
|
|
52
|
+
client: {
|
|
53
|
+
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
54
|
+
ref: "client",
|
|
55
|
+
},
|
|
56
|
+
trigger_js: {
|
|
57
|
+
type: String,
|
|
58
|
+
default: ""
|
|
59
|
+
},
|
|
60
|
+
api_name: { type: String, slug: ["name"], slugPaddingSize: 4, unique: true },
|
|
61
|
+
poll_on_rules: {
|
|
62
|
+
type: Boolean,
|
|
63
|
+
default: false,
|
|
64
|
+
},
|
|
65
|
+
deactivation_mode: {
|
|
66
|
+
type: String,
|
|
67
|
+
default: "reset",
|
|
68
|
+
},
|
|
69
|
+
rules_js: {
|
|
70
|
+
type: String,
|
|
71
|
+
default: "return true"
|
|
72
|
+
},
|
|
73
|
+
urltargetings: [UrltargetingsSchema],
|
|
74
|
+
});
|
|
75
|
+
const Page = (0, mongoose_1.model)("page", PageSchema);
|
|
76
|
+
exports.default = Page;
|
|
@@ -23,9 +23,36 @@
|
|
|
23
23
|
/// <reference types="mongoose/types/virtuals" />
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
25
|
import mongoose, { Document } from "mongoose";
|
|
26
|
-
export interface
|
|
26
|
+
export interface IVariations extends Document {
|
|
27
27
|
name: string;
|
|
28
|
+
css_code: string;
|
|
29
|
+
baseline: Boolean;
|
|
30
|
+
traffic_allocation: Number;
|
|
31
|
+
metadata_1: mongoose.Schema.Types.Mixed;
|
|
32
|
+
metadata_2: mongoose.Schema.Types.Mixed;
|
|
33
|
+
metadata_3: mongoose.Schema.Types.Mixed;
|
|
34
|
+
jscode: string;
|
|
35
|
+
reset_js: string;
|
|
36
|
+
csscode: string;
|
|
37
|
+
changesets: string;
|
|
38
|
+
}
|
|
39
|
+
export interface ITest extends Document {
|
|
28
40
|
organisationId?: string;
|
|
41
|
+
status: string;
|
|
42
|
+
name: string;
|
|
43
|
+
traffic_allocation: Number;
|
|
44
|
+
audiences_match_type: string;
|
|
45
|
+
metadata_1: mongoose.Schema.Types.Mixed;
|
|
46
|
+
metadata_2: mongoose.Schema.Types.Mixed;
|
|
47
|
+
metadata_3: mongoose.Schema.Types.Mixed;
|
|
48
|
+
integrations_run_mode: mongoose.Schema.Types.Mixed;
|
|
49
|
+
jscode: string;
|
|
50
|
+
reset_js: string;
|
|
51
|
+
csscode: string;
|
|
52
|
+
audiences: mongoose.Schema.Types.ObjectId[];
|
|
53
|
+
variations: IVariations[];
|
|
54
|
+
environments: mongoose.Schema.Types.Array;
|
|
55
|
+
pages?: mongoose.Schema.Types.ObjectId[];
|
|
29
56
|
pageelement?: mongoose.Schema.Types.ObjectId[];
|
|
30
57
|
client?: mongoose.Schema.Types.ObjectId;
|
|
31
58
|
property: mongoose.Schema.Types.Mixed;
|
|
@@ -44,8 +71,6 @@ export interface ITest extends Document {
|
|
|
44
71
|
pageNotContains: string;
|
|
45
72
|
eventparameter: string;
|
|
46
73
|
htmlcode: string;
|
|
47
|
-
csscode: string;
|
|
48
|
-
jscode: string;
|
|
49
74
|
testid: string;
|
|
50
75
|
testtool: string;
|
|
51
76
|
kameleoontestdetails: mongoose.Schema.Types.Mixed;
|
|
@@ -57,7 +82,6 @@ export interface ITest extends Document {
|
|
|
57
82
|
revenue?: [];
|
|
58
83
|
significance: string;
|
|
59
84
|
recommendedsamplesize: number;
|
|
60
|
-
status: string;
|
|
61
85
|
livedate: Date;
|
|
62
86
|
defaultControl: string;
|
|
63
87
|
enddate: Date;
|