codebase-models 3.1.2 → 3.1.3
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 +1 -3
- package/index.ts +0 -3
- package/package.json +1 -1
- package/dist/src/models/Log.d.ts +0 -47
- package/dist/src/models/Log.js +0 -34
- package/src/models/Log.ts +0 -59
package/dist/index.d.ts
CHANGED
|
@@ -81,6 +81,5 @@ import ThreadMessage from "./src/models/ThreadMessage";
|
|
|
81
81
|
import Provider from "./src/models/Provider";
|
|
82
82
|
import ApiLog from "./src/models/ApiLog";
|
|
83
83
|
import { ProviderType } from "./src/models/Provider";
|
|
84
|
-
import Log from "./src/models/Log";
|
|
85
84
|
export declare function connect(uri: string, options?: mongoose.ConnectOptions | undefined): Promise<typeof mongoose>;
|
|
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,
|
|
85
|
+
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, };
|
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.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.
|
|
16
|
+
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;
|
|
@@ -132,8 +132,6 @@ const ApiLog_1 = __importDefault(require("./src/models/ApiLog"));
|
|
|
132
132
|
exports.ApiLog = ApiLog_1.default;
|
|
133
133
|
const Provider_2 = require("./src/models/Provider");
|
|
134
134
|
Object.defineProperty(exports, "ProviderType", { enumerable: true, get: function () { return Provider_2.ProviderType; } });
|
|
135
|
-
const Log_1 = __importDefault(require("./src/models/Log"));
|
|
136
|
-
exports.Log = Log_1.default;
|
|
137
135
|
function seedRoles() {
|
|
138
136
|
return __awaiter(this, void 0, void 0, function* () {
|
|
139
137
|
const checkRoles = yield Role_1.default.countDocuments();
|
package/index.ts
CHANGED
|
@@ -58,8 +58,6 @@ import ThreadMessage from "./src/models/ThreadMessage";
|
|
|
58
58
|
import Provider from "./src/models/Provider";
|
|
59
59
|
import ApiLog from "./src/models/ApiLog";
|
|
60
60
|
import { ProviderType } from "./src/models/Provider";
|
|
61
|
-
import Log from "./src/models/Log";
|
|
62
|
-
|
|
63
61
|
async function seedRoles() {
|
|
64
62
|
const checkRoles = await Role.countDocuments();
|
|
65
63
|
if (checkRoles < RolesConstants.length) {
|
|
@@ -167,5 +165,4 @@ export {
|
|
|
167
165
|
ThreadMessage,
|
|
168
166
|
ApiLog,
|
|
169
167
|
ProviderType,
|
|
170
|
-
Log,
|
|
171
168
|
};
|
package/package.json
CHANGED
package/dist/src/models/Log.d.ts
DELETED
|
@@ -1,47 +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 { Document } from "mongoose";
|
|
26
|
-
export interface ILogMeta {
|
|
27
|
-
operationType?: string;
|
|
28
|
-
operationName?: string;
|
|
29
|
-
rootFields?: string[];
|
|
30
|
-
userId?: string;
|
|
31
|
-
ip?: string;
|
|
32
|
-
clientFullUrl?: string;
|
|
33
|
-
clientId?: string;
|
|
34
|
-
organizationId?: string;
|
|
35
|
-
timestamp?: string;
|
|
36
|
-
[key: string]: any;
|
|
37
|
-
}
|
|
38
|
-
export interface ILog extends Document {
|
|
39
|
-
level: string;
|
|
40
|
-
message: string;
|
|
41
|
-
meta: ILogMeta;
|
|
42
|
-
timestamp: Date;
|
|
43
|
-
}
|
|
44
|
-
declare const Log: import("mongoose").Model<ILog, {}, {}, {}, Document<unknown, {}, ILog> & ILog & {
|
|
45
|
-
_id: import("mongoose").Types.ObjectId;
|
|
46
|
-
}, any>;
|
|
47
|
-
export default Log;
|
package/dist/src/models/Log.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const mongoose_1 = require("mongoose");
|
|
4
|
-
const LogSchema = new mongoose_1.Schema({
|
|
5
|
-
level: {
|
|
6
|
-
type: String,
|
|
7
|
-
required: true,
|
|
8
|
-
trim: true,
|
|
9
|
-
},
|
|
10
|
-
message: {
|
|
11
|
-
type: String,
|
|
12
|
-
required: true,
|
|
13
|
-
},
|
|
14
|
-
meta: {
|
|
15
|
-
type: mongoose_1.Schema.Types.Mixed,
|
|
16
|
-
default: {},
|
|
17
|
-
},
|
|
18
|
-
timestamp: {
|
|
19
|
-
type: Date,
|
|
20
|
-
default: Date.now,
|
|
21
|
-
},
|
|
22
|
-
}, {
|
|
23
|
-
collection: "logs",
|
|
24
|
-
timestamps: false,
|
|
25
|
-
});
|
|
26
|
-
LogSchema.index({
|
|
27
|
-
"meta.rootFields": 1,
|
|
28
|
-
"meta.userId": 1,
|
|
29
|
-
"meta.clientId": 1,
|
|
30
|
-
"meta.timestamp": -1,
|
|
31
|
-
});
|
|
32
|
-
LogSchema.index({ "meta.operationType": 1 });
|
|
33
|
-
const Log = (0, mongoose_1.model)("Log", LogSchema);
|
|
34
|
-
exports.default = Log;
|
package/src/models/Log.ts
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { Document, Schema, model } from "mongoose";
|
|
2
|
-
|
|
3
|
-
export interface ILogMeta {
|
|
4
|
-
operationType?: string;
|
|
5
|
-
operationName?: string;
|
|
6
|
-
rootFields?: string[];
|
|
7
|
-
userId?: string;
|
|
8
|
-
ip?: string;
|
|
9
|
-
clientFullUrl?: string;
|
|
10
|
-
clientId?: string;
|
|
11
|
-
organizationId?: string;
|
|
12
|
-
timestamp?: string;
|
|
13
|
-
[key: string]: any;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export interface ILog extends Document {
|
|
17
|
-
level: string;
|
|
18
|
-
message: string;
|
|
19
|
-
meta: ILogMeta;
|
|
20
|
-
timestamp: Date;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const LogSchema = new Schema<ILog>(
|
|
24
|
-
{
|
|
25
|
-
level: {
|
|
26
|
-
type: String,
|
|
27
|
-
required: true,
|
|
28
|
-
trim: true,
|
|
29
|
-
},
|
|
30
|
-
message: {
|
|
31
|
-
type: String,
|
|
32
|
-
required: true,
|
|
33
|
-
},
|
|
34
|
-
meta: {
|
|
35
|
-
type: Schema.Types.Mixed,
|
|
36
|
-
default: {},
|
|
37
|
-
},
|
|
38
|
-
timestamp: {
|
|
39
|
-
type: Date,
|
|
40
|
-
default: Date.now,
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
collection: "logs",
|
|
45
|
-
timestamps: false,
|
|
46
|
-
}
|
|
47
|
-
);
|
|
48
|
-
|
|
49
|
-
LogSchema.index({
|
|
50
|
-
"meta.rootFields": 1,
|
|
51
|
-
"meta.userId": 1,
|
|
52
|
-
"meta.clientId": 1,
|
|
53
|
-
"meta.timestamp": -1,
|
|
54
|
-
});
|
|
55
|
-
LogSchema.index({ "meta.operationType": 1 });
|
|
56
|
-
|
|
57
|
-
const Log = model<ILog>("Log", LogSchema);
|
|
58
|
-
|
|
59
|
-
export default Log;
|