codebase-models 3.1.8 → 3.1.9
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 +1 -2
- package/dist/index.js +2 -4
- package/dist/src/models/Snippet.d.ts +0 -1
- package/dist/src/models/Snippet.js +1 -6
- package/index.ts +2 -4
- package/package.json +1 -1
- package/src/models/Snippet.ts +6 -11
- package/dist/src/models/SnippetVersion.d.ts +0 -34
- package/dist/src/models/SnippetVersion.js +0 -55
- package/src/models/SnippetVersion.ts +0 -46
package/dist/index.d.ts
CHANGED
|
@@ -57,7 +57,6 @@ import Organization from "./src/models/Organization";
|
|
|
57
57
|
import Role from "./src/models/Role";
|
|
58
58
|
import SavedSegment from "./src/models/SavedSegment";
|
|
59
59
|
import Snippet from "./src/models/Snippet";
|
|
60
|
-
import SnippetVersion from "./src/models/SnippetVersion";
|
|
61
60
|
import StageInCustomerJourney from "./src/models/StageInCustomerJourney";
|
|
62
61
|
import Tag from "./src/models/Tag";
|
|
63
62
|
import Temp from "./src/models/Temp";
|
|
@@ -84,4 +83,4 @@ import ApiLog from "./src/models/ApiLog";
|
|
|
84
83
|
import { ProviderType } from "./src/models/Provider";
|
|
85
84
|
import OldReport from "./src/models/OldReport";
|
|
86
85
|
export declare function connect(uri: string, options?: mongoose.ConnectOptions | undefined): Promise<typeof mongoose>;
|
|
87
|
-
export { generateRandomIID, RolesConstants, Client, ClientReportsTemp, Report, Provider, Test, TestSequentialValue, User, AppEvent, Announcement, ClientAdditionalRevenue, ClientLearning, ClientLinks, ClientNextStep, ClientNote, ClientRetention, ClientStrategy, ClientSurvey, CVRReport, Faq, Feedback, Goal, Hypothesis, HypothesisSheet, LandingPages, NewIdeas, Notification, Page, PageElement, PageTestType, Portfolio, ReadNotification, Role, CustomQuery, SavedSegment, TestTimeline, Snippet,
|
|
86
|
+
export { generateRandomIID, RolesConstants, Client, ClientReportsTemp, Report, Provider, Test, TestSequentialValue, User, AppEvent, Announcement, ClientAdditionalRevenue, ClientLearning, ClientLinks, ClientNextStep, ClientNote, ClientRetention, ClientStrategy, ClientSurvey, CVRReport, Faq, Feedback, Goal, Hypothesis, HypothesisSheet, LandingPages, NewIdeas, Notification, Page, PageElement, PageTestType, Portfolio, ReadNotification, Role, CustomQuery, SavedSegment, TestTimeline, Snippet, StageInCustomerJourney, Tag, Temp, Tier, Trigger, ClientScript, Audience, Environment, Organization, PrecalculationFilters, BqPreCompiledData, CronData, CronConfig, UserPermission, UserOrganization, Package, Invitation, Thread, ThreadMessage, ApiLog, ProviderType, OldReport, };
|
package/dist/index.js
CHANGED
|
@@ -12,8 +12,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
13
|
};
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.PrecalculationFilters = exports.Organization = exports.Environment = exports.Audience = exports.ClientScript = exports.Trigger = exports.Tier = exports.Temp = exports.Tag = exports.StageInCustomerJourney = exports.
|
|
16
|
-
exports.OldReport = exports.ProviderType = exports.ApiLog = exports.ThreadMessage = exports.Thread = exports.Invitation = exports.Package = exports.UserOrganization = exports.UserPermission = exports.CronConfig = exports.CronData =
|
|
15
|
+
exports.BqPreCompiledData = exports.PrecalculationFilters = exports.Organization = exports.Environment = exports.Audience = exports.ClientScript = exports.Trigger = exports.Tier = exports.Temp = exports.Tag = exports.StageInCustomerJourney = exports.Snippet = exports.TestTimeline = exports.SavedSegment = exports.CustomQuery = exports.Role = exports.ReadNotification = exports.Portfolio = exports.PageTestType = exports.PageElement = exports.Page = exports.Notification = exports.NewIdeas = exports.LandingPages = exports.HypothesisSheet = exports.Hypothesis = exports.Goal = exports.Feedback = exports.Faq = exports.CVRReport = exports.ClientSurvey = exports.ClientStrategy = exports.ClientRetention = exports.ClientNote = exports.ClientNextStep = exports.ClientLinks = exports.ClientLearning = exports.ClientAdditionalRevenue = exports.Announcement = exports.AppEvent = exports.User = exports.TestSequentialValue = exports.Test = exports.Provider = exports.Report = exports.ClientReportsTemp = exports.Client = exports.RolesConstants = exports.generateRandomIID = exports.connect = void 0;
|
|
16
|
+
exports.OldReport = exports.ProviderType = exports.ApiLog = exports.ThreadMessage = exports.Thread = exports.Invitation = exports.Package = exports.UserOrganization = exports.UserPermission = exports.CronConfig = exports.CronData = void 0;
|
|
17
17
|
const mongoose_1 = __importDefault(require("mongoose"));
|
|
18
18
|
const Client_1 = __importDefault(require("./src/models/Client"));
|
|
19
19
|
exports.Client = Client_1.default;
|
|
@@ -83,8 +83,6 @@ const SavedSegment_1 = __importDefault(require("./src/models/SavedSegment"));
|
|
|
83
83
|
exports.SavedSegment = SavedSegment_1.default;
|
|
84
84
|
const Snippet_1 = __importDefault(require("./src/models/Snippet"));
|
|
85
85
|
exports.Snippet = Snippet_1.default;
|
|
86
|
-
const SnippetVersion_1 = __importDefault(require("./src/models/SnippetVersion"));
|
|
87
|
-
exports.SnippetVersion = SnippetVersion_1.default;
|
|
88
86
|
const StageInCustomerJourney_1 = __importDefault(require("./src/models/StageInCustomerJourney"));
|
|
89
87
|
exports.StageInCustomerJourney = StageInCustomerJourney_1.default;
|
|
90
88
|
const Tag_1 = __importDefault(require("./src/models/Tag"));
|
|
@@ -37,7 +37,6 @@ export interface ISnippet extends Document {
|
|
|
37
37
|
status?: string;
|
|
38
38
|
isActive?: boolean;
|
|
39
39
|
organizationId?: mongoose.Schema.Types.ObjectId;
|
|
40
|
-
versions?: mongoose.Schema.Types.ObjectId[];
|
|
41
40
|
}
|
|
42
41
|
declare const Snippet: mongoose.Model<any, {}, {}, {}, any, any>;
|
|
43
42
|
export default Snippet;
|
|
@@ -86,12 +86,7 @@ const SnippetSchema = new mongoose_1.Schema({
|
|
|
86
86
|
isActive: {
|
|
87
87
|
type: Boolean,
|
|
88
88
|
default: true,
|
|
89
|
-
}
|
|
90
|
-
versions: {
|
|
91
|
-
type: [mongoose_1.default.Schema.Types.ObjectId],
|
|
92
|
-
ref: "snippetversion",
|
|
93
|
-
default: [],
|
|
94
|
-
},
|
|
89
|
+
}
|
|
95
90
|
}, {
|
|
96
91
|
timestamps: true,
|
|
97
92
|
});
|
package/index.ts
CHANGED
|
@@ -34,7 +34,6 @@ import Organization from "./src/models/Organization";
|
|
|
34
34
|
import Role from "./src/models/Role";
|
|
35
35
|
import SavedSegment from "./src/models/SavedSegment";
|
|
36
36
|
import Snippet from "./src/models/Snippet";
|
|
37
|
-
import SnippetVersion from "./src/models/SnippetVersion";
|
|
38
37
|
import StageInCustomerJourney from "./src/models/StageInCustomerJourney";
|
|
39
38
|
import Tag from "./src/models/Tag";
|
|
40
39
|
import Temp from "./src/models/Temp";
|
|
@@ -80,7 +79,7 @@ async function seedRoles() {
|
|
|
80
79
|
},
|
|
81
80
|
},
|
|
82
81
|
]);
|
|
83
|
-
})
|
|
82
|
+
})
|
|
84
83
|
);
|
|
85
84
|
console.log("Roles seeded successfully");
|
|
86
85
|
}
|
|
@@ -88,7 +87,7 @@ async function seedRoles() {
|
|
|
88
87
|
|
|
89
88
|
export async function connect(
|
|
90
89
|
uri: string,
|
|
91
|
-
options?: mongoose.ConnectOptions | undefined
|
|
90
|
+
options?: mongoose.ConnectOptions | undefined
|
|
92
91
|
): Promise<typeof mongoose> {
|
|
93
92
|
if (uri) {
|
|
94
93
|
if (mongoose.connection.readyState === 1) {
|
|
@@ -146,7 +145,6 @@ export {
|
|
|
146
145
|
SavedSegment,
|
|
147
146
|
TestTimeline,
|
|
148
147
|
Snippet,
|
|
149
|
-
SnippetVersion,
|
|
150
148
|
StageInCustomerJourney,
|
|
151
149
|
Tag,
|
|
152
150
|
Temp,
|
package/package.json
CHANGED
package/src/models/Snippet.ts
CHANGED
|
@@ -14,7 +14,6 @@ export interface ISnippet extends Document {
|
|
|
14
14
|
status?: string;
|
|
15
15
|
isActive?: boolean;
|
|
16
16
|
organizationId?: mongoose.Schema.Types.ObjectId;
|
|
17
|
-
versions?: mongoose.Schema.Types.ObjectId[];
|
|
18
17
|
}
|
|
19
18
|
|
|
20
19
|
const SnippetSchema = new Schema<ISnippet>(
|
|
@@ -23,6 +22,7 @@ const SnippetSchema = new Schema<ISnippet>(
|
|
|
23
22
|
type: mongoose.Schema.Types.ObjectId,
|
|
24
23
|
ref: "organization",
|
|
25
24
|
default: null,
|
|
25
|
+
|
|
26
26
|
},
|
|
27
27
|
name: {
|
|
28
28
|
type: String,
|
|
@@ -75,21 +75,16 @@ const SnippetSchema = new Schema<ISnippet>(
|
|
|
75
75
|
status: {
|
|
76
76
|
type: String,
|
|
77
77
|
default: "live",
|
|
78
|
-
enum: ["live", "draft",
|
|
78
|
+
enum: ["live", "draft","running","paused","preview","ended"],
|
|
79
79
|
},
|
|
80
80
|
isActive: {
|
|
81
81
|
type: Boolean,
|
|
82
82
|
default: true,
|
|
83
|
-
}
|
|
84
|
-
versions: {
|
|
85
|
-
type: [mongoose.Schema.Types.ObjectId],
|
|
86
|
-
ref: "snippetversion",
|
|
87
|
-
default: [],
|
|
88
|
-
},
|
|
83
|
+
}
|
|
89
84
|
},
|
|
90
85
|
{
|
|
91
86
|
timestamps: true,
|
|
92
|
-
}
|
|
87
|
+
}
|
|
93
88
|
);
|
|
94
89
|
|
|
95
90
|
// Compound indexes for common query patterns
|
|
@@ -98,7 +93,7 @@ SnippetSchema.index({ organisationId: 1, client: 1 });
|
|
|
98
93
|
SnippetSchema.index({ client: 1, tags: 1 });
|
|
99
94
|
SnippetSchema.index({ client: 1, pageelement: 1 });
|
|
100
95
|
|
|
101
|
-
|
|
102
|
-
|
|
96
|
+
|
|
97
|
+
const Snippet = mongoose.models.snippet || model<ISnippet>("snippet", SnippetSchema);
|
|
103
98
|
|
|
104
99
|
export default Snippet;
|
|
@@ -1,34 +0,0 @@
|
|
|
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 ISnippetVersion extends Document {
|
|
27
|
-
snippetId: mongoose.Schema.Types.ObjectId;
|
|
28
|
-
htmlcode?: string;
|
|
29
|
-
csscode?: string;
|
|
30
|
-
jscode?: string;
|
|
31
|
-
createdBy?: mongoose.Schema.Types.ObjectId;
|
|
32
|
-
}
|
|
33
|
-
declare const SnippetVersion: mongoose.Model<any, {}, {}, {}, any, any>;
|
|
34
|
-
export default SnippetVersion;
|
|
@@ -1,55 +0,0 @@
|
|
|
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 SnippetVersionSchema = new mongoose_1.Schema({
|
|
28
|
-
snippetId: {
|
|
29
|
-
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
30
|
-
ref: "snippet",
|
|
31
|
-
required: true,
|
|
32
|
-
},
|
|
33
|
-
htmlcode: {
|
|
34
|
-
type: String,
|
|
35
|
-
default: "",
|
|
36
|
-
},
|
|
37
|
-
csscode: {
|
|
38
|
-
type: String,
|
|
39
|
-
default: "",
|
|
40
|
-
},
|
|
41
|
-
jscode: {
|
|
42
|
-
type: String,
|
|
43
|
-
default: "",
|
|
44
|
-
},
|
|
45
|
-
createdBy: {
|
|
46
|
-
type: mongoose_1.default.Schema.Types.ObjectId,
|
|
47
|
-
ref: "user",
|
|
48
|
-
},
|
|
49
|
-
}, {
|
|
50
|
-
timestamps: true,
|
|
51
|
-
});
|
|
52
|
-
SnippetVersionSchema.index({ snippetId: 1, createdAt: -1 });
|
|
53
|
-
const SnippetVersion = mongoose_1.default.models.snippetversion ||
|
|
54
|
-
(0, mongoose_1.model)("snippetversion", SnippetVersionSchema);
|
|
55
|
-
exports.default = SnippetVersion;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import mongoose, { Document, Schema, model } from "mongoose";
|
|
2
|
-
|
|
3
|
-
export interface ISnippetVersion extends Document {
|
|
4
|
-
snippetId: mongoose.Schema.Types.ObjectId;
|
|
5
|
-
htmlcode?: string;
|
|
6
|
-
csscode?: string;
|
|
7
|
-
jscode?: string;
|
|
8
|
-
createdBy?: mongoose.Schema.Types.ObjectId;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const SnippetVersionSchema = new Schema<ISnippetVersion>(
|
|
12
|
-
{
|
|
13
|
-
snippetId: {
|
|
14
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
15
|
-
ref: "snippet",
|
|
16
|
-
required: true,
|
|
17
|
-
},
|
|
18
|
-
htmlcode: {
|
|
19
|
-
type: String,
|
|
20
|
-
default: "",
|
|
21
|
-
},
|
|
22
|
-
csscode: {
|
|
23
|
-
type: String,
|
|
24
|
-
default: "",
|
|
25
|
-
},
|
|
26
|
-
jscode: {
|
|
27
|
-
type: String,
|
|
28
|
-
default: "",
|
|
29
|
-
},
|
|
30
|
-
createdBy: {
|
|
31
|
-
type: mongoose.Schema.Types.ObjectId,
|
|
32
|
-
ref: "user",
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
timestamps: true,
|
|
37
|
-
},
|
|
38
|
-
);
|
|
39
|
-
|
|
40
|
-
SnippetVersionSchema.index({ snippetId: 1, createdAt: -1 });
|
|
41
|
-
|
|
42
|
-
const SnippetVersion =
|
|
43
|
-
mongoose.models.snippetversion ||
|
|
44
|
-
model<ISnippetVersion>("snippetversion", SnippetVersionSchema);
|
|
45
|
-
|
|
46
|
-
export default SnippetVersion;
|