codebase-models 2.1.10 → 2.1.11

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 CHANGED
@@ -73,5 +73,6 @@ import BqPreCompiledData from "./src/models/BqPreCompiledData";
73
73
  import CustomQuery from "./src/models/CustomQuery";
74
74
  import { generateRandomIID } from "./src/constant";
75
75
  import TestTimeline from "./src/models/TestTimeline";
76
+ import CronData from "./src/models/CronData";
76
77
  export declare function connect(uri: string, options?: mongoose.ConnectOptions | undefined): Promise<typeof mongoose>;
77
- export { generateRandomIID, Client, ClientReportsTemp, QueryLog, Report, 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, Segment, SegmentCombination, Snippet, StageInCustomerJourney, Tag, Temp, Tier, Trigger, ClientScript, Audience, Environment, Organization, PrecalculationFilters, BqPreCompiledData, };
78
+ export { generateRandomIID, Client, ClientReportsTemp, QueryLog, Report, 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, Segment, SegmentCombination, Snippet, StageInCustomerJourney, Tag, Temp, Tier, Trigger, ClientScript, Audience, Environment, Organization, PrecalculationFilters, BqPreCompiledData, CronData, };
package/dist/index.js CHANGED
@@ -13,7 +13,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.PrecalculationFilters = exports.Organization = exports.Environment = exports.Audience = exports.ClientScript = exports.Trigger = exports.Tier = exports.Temp = exports.Tag = exports.StageInCustomerJourney = exports.Snippet = exports.SegmentCombination = exports.Segment = 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.Report = exports.QueryLog = exports.ClientReportsTemp = exports.Client = exports.generateRandomIID = exports.connect = void 0;
16
- exports.BqPreCompiledData = void 0;
16
+ exports.CronData = exports.BqPreCompiledData = 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;
@@ -115,6 +115,8 @@ const constant_1 = require("./src/constant");
115
115
  Object.defineProperty(exports, "generateRandomIID", { enumerable: true, get: function () { return constant_1.generateRandomIID; } });
116
116
  const TestTimeline_1 = __importDefault(require("./src/models/TestTimeline"));
117
117
  exports.TestTimeline = TestTimeline_1.default;
118
+ const CronData_1 = __importDefault(require("./src/models/CronData"));
119
+ exports.CronData = CronData_1.default;
118
120
  function seedRoles() {
119
121
  return __awaiter(this, void 0, void 0, function* () {
120
122
  const checkRoles = yield Role_1.default.countDocuments();
@@ -0,0 +1,33 @@
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 ICronData extends Document {
27
+ test?: mongoose.Schema.Types.ObjectId;
28
+ client?: mongoose.Schema.Types.ObjectId;
29
+ result?: mongoose.Schema.Types.Mixed;
30
+ organizationId?: mongoose.Schema.Types.ObjectId;
31
+ }
32
+ declare const CronData: mongoose.Model<any, {}, {}, {}, any, any>;
33
+ export default CronData;
@@ -0,0 +1,49 @@
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 CronDataSchema = new mongoose_1.Schema({
28
+ test: {
29
+ type: mongoose_1.default.Schema.Types.ObjectId,
30
+ ref: "test",
31
+ },
32
+ client: {
33
+ type: mongoose_1.default.Schema.Types.ObjectId,
34
+ ref: "client",
35
+ },
36
+ result: {
37
+ type: mongoose_1.default.Schema.Types.Mixed,
38
+ },
39
+ organizationId: {
40
+ type: mongoose_1.default.Schema.Types.ObjectId,
41
+ ref: "organization",
42
+ default: null,
43
+ },
44
+ }, {
45
+ timestamps: true
46
+ });
47
+ CronDataSchema.index({ test: 1 }, { unique: true });
48
+ const CronData = mongoose_1.default.models.cronData || (0, mongoose_1.model)("cronData", CronDataSchema);
49
+ exports.default = CronData;
@@ -91,6 +91,7 @@ export interface ITest extends Document {
91
91
  livedate: Date;
92
92
  defaultControl: string;
93
93
  enddate: Date;
94
+ cronData: mongoose.Schema.Types.ObjectId;
94
95
  createdBy: mongoose.Schema.Types.ObjectId;
95
96
  }
96
97
  declare const Test: mongoose.Model<any, {}, {}, {}, any, any>;
@@ -156,6 +156,7 @@ const TestSchema = new mongoose_1.Schema({
156
156
  livedate: { type: Date, default: null },
157
157
  defaultControl: { type: String, default: null },
158
158
  enddate: { type: Date, default: null },
159
+ cronData: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "cronData", default: null },
159
160
  createdBy: { type: mongoose_1.default.Schema.Types.ObjectId, ref: "user", default: null }
160
161
  }, {
161
162
  timestamps: true
package/index.ts CHANGED
@@ -50,6 +50,7 @@ import BqPreCompiledData from "./src/models/BqPreCompiledData";
50
50
  import CustomQuery from "./src/models/CustomQuery";
51
51
  import { generateRandomIID } from "./src/constant";
52
52
  import TestTimeline from "./src/models/TestTimeline";
53
+ import CronData from "./src/models/CronData";
53
54
  async function seedRoles() {
54
55
  const checkRoles = await Role.countDocuments();
55
56
  if (checkRoles < 5) {
@@ -148,4 +149,5 @@ export {
148
149
  Organization,
149
150
  PrecalculationFilters,
150
151
  BqPreCompiledData,
151
- };
152
+ CronData,
153
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codebase-models",
3
- "version": "2.1.10",
3
+ "version": "2.1.11",
4
4
  "description": "Common models for codebase",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -0,0 +1,33 @@
1
+ import mongoose, { Document, Schema, model } from "mongoose";
2
+
3
+ export interface ICronData extends Document {
4
+ test?: mongoose.Schema.Types.ObjectId;
5
+ client?: mongoose.Schema.Types.ObjectId;
6
+ result?: mongoose.Schema.Types.Mixed;
7
+ organizationId?: mongoose.Schema.Types.ObjectId;
8
+ }
9
+ const CronDataSchema = new Schema<ICronData>({
10
+ test: {
11
+ type: mongoose.Schema.Types.ObjectId,
12
+ ref: "test",
13
+ },
14
+ client: {
15
+ type: mongoose.Schema.Types.ObjectId,
16
+ ref: "client",
17
+ },
18
+ result: {
19
+ type: mongoose.Schema.Types.Mixed,
20
+ },
21
+ organizationId: {
22
+ type: mongoose.Schema.Types.ObjectId,
23
+ ref: "organization",
24
+ default: null,
25
+ },
26
+ }, {
27
+ timestamps: true
28
+ });
29
+
30
+ CronDataSchema.index({ test: 1 }, { unique: true });
31
+
32
+ const CronData = mongoose.models.cronData || model<ICronData>("cronData", CronDataSchema);
33
+ export default CronData;
@@ -75,6 +75,7 @@ export interface ITest extends Document {
75
75
  livedate: Date;
76
76
  defaultControl: string;
77
77
  enddate: Date;
78
+ cronData: mongoose.Schema.Types.ObjectId;
78
79
  createdBy: mongoose.Schema.Types.ObjectId;
79
80
  }
80
81
 
@@ -206,6 +207,7 @@ const TestSchema = new Schema<ITest>(
206
207
  livedate: { type: Date, default: null },
207
208
  defaultControl: { type: String, default: null },
208
209
  enddate: { type: Date, default: null },
210
+ cronData: { type: mongoose.Schema.Types.ObjectId, ref: "cronData", default: null },
209
211
  createdBy: { type: mongoose.Schema.Types.ObjectId, ref: "user", default: null }
210
212
  },
211
213
  {