@brimble/models 3.8.66 → 3.8.68
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/.claude/settings.local.json +7 -0
- package/activity-log.ts +66 -0
- package/dist/activity-log.d.ts +30 -0
- package/dist/activity-log.js +61 -0
- package/dist/domain/index.js +6 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +3 -1
- package/dist/types/activity-log.d.ts +18 -0
- package/dist/types/activity-log.js +2 -0
- package/dist/types/domain/index.d.ts +2 -1
- package/dist/types/index.d.ts +1 -0
- package/domain/index.ts +6 -0
- package/index.ts +2 -0
- package/package.json +1 -1
- package/types/activity-log.ts +19 -0
- package/types/domain/index.ts +2 -1
- package/types/index.ts +1 -0
package/activity-log.ts
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { model, Schema } from "mongoose";
|
|
2
|
+
import { IActivityLog } from "./types";
|
|
3
|
+
|
|
4
|
+
const activityLogSchema: Schema = new Schema(
|
|
5
|
+
{
|
|
6
|
+
user_id: {
|
|
7
|
+
type: Schema.Types.ObjectId,
|
|
8
|
+
ref: "User",
|
|
9
|
+
required: true,
|
|
10
|
+
index: true,
|
|
11
|
+
},
|
|
12
|
+
team_id: {
|
|
13
|
+
type: Schema.Types.ObjectId,
|
|
14
|
+
ref: "Team",
|
|
15
|
+
default: null,
|
|
16
|
+
index: true,
|
|
17
|
+
},
|
|
18
|
+
action: {
|
|
19
|
+
type: String,
|
|
20
|
+
required: true,
|
|
21
|
+
index: true,
|
|
22
|
+
},
|
|
23
|
+
description: {
|
|
24
|
+
type: String,
|
|
25
|
+
},
|
|
26
|
+
context: {
|
|
27
|
+
type: String,
|
|
28
|
+
},
|
|
29
|
+
metadata: {
|
|
30
|
+
type: Schema.Types.Mixed,
|
|
31
|
+
default: {},
|
|
32
|
+
},
|
|
33
|
+
ip_address: {
|
|
34
|
+
type: String,
|
|
35
|
+
},
|
|
36
|
+
user_agent: {
|
|
37
|
+
type: String,
|
|
38
|
+
},
|
|
39
|
+
status: {
|
|
40
|
+
type: String,
|
|
41
|
+
enum: ["success", "failure"],
|
|
42
|
+
default: "success",
|
|
43
|
+
},
|
|
44
|
+
resource_type: {
|
|
45
|
+
type: String,
|
|
46
|
+
},
|
|
47
|
+
resource_id: {
|
|
48
|
+
type: Schema.Types.ObjectId,
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
timestamps: {
|
|
53
|
+
createdAt: "created_at",
|
|
54
|
+
updatedAt: "updated_at",
|
|
55
|
+
},
|
|
56
|
+
collection: "activity_logs",
|
|
57
|
+
},
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
activityLogSchema.index({ user_id: 1, created_at: -1 });
|
|
61
|
+
activityLogSchema.index({ user_id: 1, action: 1, created_at: -1 });
|
|
62
|
+
activityLogSchema.index({ team_id: 1, created_at: -1 });
|
|
63
|
+
activityLogSchema.index({ team_id: 1, action: 1, created_at: -1 });
|
|
64
|
+
activityLogSchema.index({ resource_type: 1, resource_id: 1 });
|
|
65
|
+
|
|
66
|
+
export default model<IActivityLog>("ActivityLog", activityLogSchema);
|
|
@@ -0,0 +1,30 @@
|
|
|
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" />
|
|
25
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
26
|
+
import { IActivityLog } from "./types";
|
|
27
|
+
declare const _default: import("mongoose").Model<IActivityLog, {}, {}, {}, import("mongoose").Document<unknown, {}, IActivityLog> & IActivityLog & {
|
|
28
|
+
_id: import("mongoose").Types.ObjectId;
|
|
29
|
+
}, any>;
|
|
30
|
+
export default _default;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mongoose_1 = require("mongoose");
|
|
4
|
+
const activityLogSchema = new mongoose_1.Schema({
|
|
5
|
+
user_id: {
|
|
6
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
7
|
+
ref: "User",
|
|
8
|
+
required: true,
|
|
9
|
+
index: true,
|
|
10
|
+
},
|
|
11
|
+
team_id: {
|
|
12
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
13
|
+
ref: "Team",
|
|
14
|
+
default: null,
|
|
15
|
+
index: true,
|
|
16
|
+
},
|
|
17
|
+
action: {
|
|
18
|
+
type: String,
|
|
19
|
+
required: true,
|
|
20
|
+
index: true,
|
|
21
|
+
},
|
|
22
|
+
description: {
|
|
23
|
+
type: String,
|
|
24
|
+
},
|
|
25
|
+
context: {
|
|
26
|
+
type: String,
|
|
27
|
+
},
|
|
28
|
+
metadata: {
|
|
29
|
+
type: mongoose_1.Schema.Types.Mixed,
|
|
30
|
+
default: {},
|
|
31
|
+
},
|
|
32
|
+
ip_address: {
|
|
33
|
+
type: String,
|
|
34
|
+
},
|
|
35
|
+
user_agent: {
|
|
36
|
+
type: String,
|
|
37
|
+
},
|
|
38
|
+
status: {
|
|
39
|
+
type: String,
|
|
40
|
+
enum: ["success", "failure"],
|
|
41
|
+
default: "success",
|
|
42
|
+
},
|
|
43
|
+
resource_type: {
|
|
44
|
+
type: String,
|
|
45
|
+
},
|
|
46
|
+
resource_id: {
|
|
47
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
48
|
+
},
|
|
49
|
+
}, {
|
|
50
|
+
timestamps: {
|
|
51
|
+
createdAt: "created_at",
|
|
52
|
+
updatedAt: "updated_at",
|
|
53
|
+
},
|
|
54
|
+
collection: "activity_logs",
|
|
55
|
+
});
|
|
56
|
+
activityLogSchema.index({ user_id: 1, created_at: -1 });
|
|
57
|
+
activityLogSchema.index({ user_id: 1, action: 1, created_at: -1 });
|
|
58
|
+
activityLogSchema.index({ team_id: 1, created_at: -1 });
|
|
59
|
+
activityLogSchema.index({ team_id: 1, action: 1, created_at: -1 });
|
|
60
|
+
activityLogSchema.index({ resource_type: 1, resource_id: 1 });
|
|
61
|
+
exports.default = (0, mongoose_1.model)("ActivityLog", activityLogSchema);
|
package/dist/domain/index.js
CHANGED
|
@@ -90,6 +90,12 @@ const domainSchema = new mongoose_1.Schema({
|
|
|
90
90
|
type: mongoose_1.Schema.Types.ObjectId,
|
|
91
91
|
},
|
|
92
92
|
],
|
|
93
|
+
project_environment: {
|
|
94
|
+
ref: "ProjectEnvironment",
|
|
95
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
96
|
+
required: false,
|
|
97
|
+
default: null,
|
|
98
|
+
},
|
|
93
99
|
is_pending_verification: Boolean,
|
|
94
100
|
redirect: {
|
|
95
101
|
url: String,
|
package/dist/index.d.ts
CHANGED
|
@@ -50,7 +50,8 @@ export { default as CashierSubscription } from "./cashier_subscription";
|
|
|
50
50
|
export { default as CashierSubscriptionItem } from "./cashier_subscription_item";
|
|
51
51
|
export { default as ProjectEnvironment } from "./project-environment";
|
|
52
52
|
export { default as EnvironmentVariable } from "./environment-variable";
|
|
53
|
-
export {
|
|
53
|
+
export { default as ActivityLog } from "./activity-log";
|
|
54
|
+
export { IUser, IGit, IProject, IPreview, IProjectConnection, IFollowing, IIntegration, IEnv, IServer, IDomain, IToken, IMember, ITeam, IInstalledIntegration, ILog, ISubscription, ICard, IDns, IRole, IPermission, IMemberPermission, IWallet, IDbImage, IJob, ILicense, IPlanConfiguration, IAutoScalingGroup, IComputeChange, IRegion, IVolume, IFramework, BrimbleFrameworkType, ISettings, ILoadBalancerPort, IDomainRenewal, IDomainTransfer, IWebhookCategory, IWebhookEvent, IWebhookSetting, IIntention, IProvider, ICollabAnnotation, ICollabComment, ICollabAttachment, ICollabIntegration, ICollabSettings, ICollabShareToken, ICollabPushSubscription, IAppMessage, IInvoice, ITag, IProjectTagAssignment, ICashierSubscription, ICashierSubscriptionItem, IProjectEnvironment, IEnvironmentVariable, IActivityLog, } from "./types";
|
|
54
55
|
export { GIT_TYPE, INTEGRATION_TYPES, INTEGRATION_PROVIDERS, OAUTH_PERMISSIONS, ENVIRONMENT, SERVER_STATUS, ROLES, SUBSCRIPTION_PLAN_TYPE, PROJECT_STATUS, SUBSCRIPTION_STATUS, CARD_TYPES, DNS_TYPE, PERMISSION_TYPE, REQUEST_TYPE, ServiceType, DatabaseEngine, JobStatus, LicenseStatus, REGION_CONTINENT, BUILD_DISABLED_BY, SERVER_PROTOCOL, FrameworkApplicationType, DomainRenewalStatus, DomainTransferProvider, DomainTransferDirection, DomainTransferStatus, NomadDeploymentStatus, COLLAB_ANNOTATION_STATUS, COLLAB_INTEGRATION_TYPE, COLLAB_THEME, COLLAB_TOOLBAR_POSITION, INVOICE_STATUS, INVOICE_PAYMENT_STATUS, INVOICE_TYPE } from "./enum";
|
|
55
56
|
import mongoose from "mongoose";
|
|
56
57
|
export declare const connectToMongo: (mongoUrl: string, config?: mongoose.ConnectOptions) => Promise<void>;
|
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.CashierSubscription = exports.ProjectTagAssignment = exports.Tag = exports.Invoice = exports.AppMessage = exports.CollabPushSubscription = exports.CollabShareToken = exports.CollabSettings = exports.CollabIntegration = exports.CollabComment = exports.CollabAnnotation = exports.Provider = exports.Intention = exports.WebhookSetting = exports.WebhookEvent = exports.WebhookCategory = exports.DomainTransfer = exports.DomainRenewal = exports.LoadBalancerPort = exports.Settings = exports.Framework = exports.Volume = exports.Region = exports.ComputeChange = exports.AutoScalingGroup = exports.PlanConfiguration = exports.Liscense = exports.Job = exports.DbImage = exports.Wallet = exports.Server = exports.Card = exports.Subscription = exports.Log = exports.Role = exports.MemberPermission = exports.Permission = exports.Member = exports.Team = exports.Token = exports.Env = exports.Dns = exports.Domain = exports.Integration = exports.Following = exports.ProjectConnection = exports.Preview = exports.DeletedProject = exports.Project = exports.User = void 0;
|
|
16
|
-
exports.healthCheckMongo = exports.closeMongo = exports.db = exports.connectToMongo = exports.INVOICE_TYPE = exports.INVOICE_PAYMENT_STATUS = exports.INVOICE_STATUS = exports.COLLAB_TOOLBAR_POSITION = exports.COLLAB_THEME = exports.COLLAB_INTEGRATION_TYPE = exports.COLLAB_ANNOTATION_STATUS = exports.NomadDeploymentStatus = exports.DomainTransferStatus = exports.DomainTransferDirection = exports.DomainTransferProvider = exports.DomainRenewalStatus = exports.FrameworkApplicationType = exports.SERVER_PROTOCOL = exports.BUILD_DISABLED_BY = exports.REGION_CONTINENT = exports.LicenseStatus = exports.JobStatus = exports.DatabaseEngine = exports.ServiceType = exports.REQUEST_TYPE = exports.PERMISSION_TYPE = exports.DNS_TYPE = exports.CARD_TYPES = exports.SUBSCRIPTION_STATUS = exports.PROJECT_STATUS = exports.SUBSCRIPTION_PLAN_TYPE = exports.ROLES = exports.SERVER_STATUS = exports.ENVIRONMENT = exports.OAUTH_PERMISSIONS = exports.INTEGRATION_PROVIDERS = exports.INTEGRATION_TYPES = exports.GIT_TYPE = exports.EnvironmentVariable = exports.ProjectEnvironment = exports.CashierSubscriptionItem = void 0;
|
|
16
|
+
exports.healthCheckMongo = exports.closeMongo = exports.db = exports.connectToMongo = exports.INVOICE_TYPE = exports.INVOICE_PAYMENT_STATUS = exports.INVOICE_STATUS = exports.COLLAB_TOOLBAR_POSITION = exports.COLLAB_THEME = exports.COLLAB_INTEGRATION_TYPE = exports.COLLAB_ANNOTATION_STATUS = exports.NomadDeploymentStatus = exports.DomainTransferStatus = exports.DomainTransferDirection = exports.DomainTransferProvider = exports.DomainRenewalStatus = exports.FrameworkApplicationType = exports.SERVER_PROTOCOL = exports.BUILD_DISABLED_BY = exports.REGION_CONTINENT = exports.LicenseStatus = exports.JobStatus = exports.DatabaseEngine = exports.ServiceType = exports.REQUEST_TYPE = exports.PERMISSION_TYPE = exports.DNS_TYPE = exports.CARD_TYPES = exports.SUBSCRIPTION_STATUS = exports.PROJECT_STATUS = exports.SUBSCRIPTION_PLAN_TYPE = exports.ROLES = exports.SERVER_STATUS = exports.ENVIRONMENT = exports.OAUTH_PERMISSIONS = exports.INTEGRATION_PROVIDERS = exports.INTEGRATION_TYPES = exports.GIT_TYPE = exports.ActivityLog = exports.EnvironmentVariable = exports.ProjectEnvironment = exports.CashierSubscriptionItem = void 0;
|
|
17
17
|
var user_1 = require("./user");
|
|
18
18
|
Object.defineProperty(exports, "User", { enumerable: true, get: function () { return __importDefault(user_1).default; } });
|
|
19
19
|
var project_1 = require("./project");
|
|
@@ -119,6 +119,8 @@ var project_environment_1 = require("./project-environment");
|
|
|
119
119
|
Object.defineProperty(exports, "ProjectEnvironment", { enumerable: true, get: function () { return __importDefault(project_environment_1).default; } });
|
|
120
120
|
var environment_variable_1 = require("./environment-variable");
|
|
121
121
|
Object.defineProperty(exports, "EnvironmentVariable", { enumerable: true, get: function () { return __importDefault(environment_variable_1).default; } });
|
|
122
|
+
var activity_log_1 = require("./activity-log");
|
|
123
|
+
Object.defineProperty(exports, "ActivityLog", { enumerable: true, get: function () { return __importDefault(activity_log_1).default; } });
|
|
122
124
|
var enum_1 = require("./enum");
|
|
123
125
|
Object.defineProperty(exports, "GIT_TYPE", { enumerable: true, get: function () { return enum_1.GIT_TYPE; } });
|
|
124
126
|
Object.defineProperty(exports, "INTEGRATION_TYPES", { enumerable: true, get: function () { return enum_1.INTEGRATION_TYPES; } });
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Document, Types } from "mongoose";
|
|
2
|
+
import { ITeam } from "./team";
|
|
3
|
+
import { IUser } from "./user";
|
|
4
|
+
export interface IActivityLog extends Document {
|
|
5
|
+
user_id: IUser | Types.ObjectId;
|
|
6
|
+
team_id?: ITeam | Types.ObjectId;
|
|
7
|
+
action: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
context?: string;
|
|
10
|
+
metadata?: Record<string, any>;
|
|
11
|
+
ip_address?: string;
|
|
12
|
+
user_agent?: string;
|
|
13
|
+
status: "success" | "failure";
|
|
14
|
+
resource_type?: string;
|
|
15
|
+
resource_id?: Types.ObjectId;
|
|
16
|
+
created_at: Date;
|
|
17
|
+
updated_at: Date;
|
|
18
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Document } from "mongoose";
|
|
2
|
-
import { IPreview, IProject, ISubscription, ITeam, IUser } from "../";
|
|
2
|
+
import { IPreview, IProject, IProjectEnvironment, ISubscription, ITeam, IUser } from "../";
|
|
3
3
|
import { IDns } from "./dns";
|
|
4
4
|
export interface IDomain extends Document {
|
|
5
5
|
name: string;
|
|
@@ -23,6 +23,7 @@ export interface IDomain extends Document {
|
|
|
23
23
|
trigger_created_at: string;
|
|
24
24
|
nameservers: string[];
|
|
25
25
|
dns: IDns[];
|
|
26
|
+
project_environment?: IProjectEnvironment;
|
|
26
27
|
is_pending_verification: boolean;
|
|
27
28
|
redirect?: {
|
|
28
29
|
url: string;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -51,3 +51,4 @@ export type { ITag } from "./tag";
|
|
|
51
51
|
export type { ICashierSubscription, ICashierSubscriptionItem } from "./cashier_subscription";
|
|
52
52
|
export type { IProjectEnvironment } from "./project-environment";
|
|
53
53
|
export type { IEnvironmentVariable } from "./environment-variable";
|
|
54
|
+
export type { IActivityLog } from "./activity-log";
|
package/domain/index.ts
CHANGED
|
@@ -91,6 +91,12 @@ const domainSchema = new Schema(
|
|
|
91
91
|
type: Schema.Types.ObjectId,
|
|
92
92
|
},
|
|
93
93
|
],
|
|
94
|
+
project_environment: {
|
|
95
|
+
ref: "ProjectEnvironment",
|
|
96
|
+
type: Schema.Types.ObjectId,
|
|
97
|
+
required: false,
|
|
98
|
+
default: null,
|
|
99
|
+
},
|
|
94
100
|
is_pending_verification: Boolean,
|
|
95
101
|
redirect: {
|
|
96
102
|
url: String,
|
package/index.ts
CHANGED
|
@@ -50,6 +50,7 @@ export { default as CashierSubscription } from "./cashier_subscription";
|
|
|
50
50
|
export { default as CashierSubscriptionItem } from "./cashier_subscription_item";
|
|
51
51
|
export { default as ProjectEnvironment } from "./project-environment";
|
|
52
52
|
export { default as EnvironmentVariable } from "./environment-variable";
|
|
53
|
+
export { default as ActivityLog } from "./activity-log";
|
|
53
54
|
|
|
54
55
|
export {
|
|
55
56
|
IUser,
|
|
@@ -108,6 +109,7 @@ export {
|
|
|
108
109
|
ICashierSubscriptionItem,
|
|
109
110
|
IProjectEnvironment,
|
|
110
111
|
IEnvironmentVariable,
|
|
112
|
+
IActivityLog,
|
|
111
113
|
} from "./types";
|
|
112
114
|
export {
|
|
113
115
|
GIT_TYPE,
|
package/package.json
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Document, Types } from "mongoose";
|
|
2
|
+
import { ITeam } from "./team";
|
|
3
|
+
import { IUser } from "./user";
|
|
4
|
+
|
|
5
|
+
export interface IActivityLog extends Document {
|
|
6
|
+
user_id: IUser | Types.ObjectId;
|
|
7
|
+
team_id?: ITeam | Types.ObjectId;
|
|
8
|
+
action: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
context?: string;
|
|
11
|
+
metadata?: Record<string, any>;
|
|
12
|
+
ip_address?: string;
|
|
13
|
+
user_agent?: string;
|
|
14
|
+
status: "success" | "failure";
|
|
15
|
+
resource_type?: string;
|
|
16
|
+
resource_id?: Types.ObjectId;
|
|
17
|
+
created_at: Date;
|
|
18
|
+
updated_at: Date;
|
|
19
|
+
}
|
package/types/domain/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Document } from "mongoose";
|
|
2
|
-
import { IPreview, IProject, ISubscription, ITeam, IUser } from "../";
|
|
2
|
+
import { IPreview, IProject, IProjectEnvironment, ISubscription, ITeam, IUser } from "../";
|
|
3
3
|
import { IDns } from "./dns";
|
|
4
4
|
|
|
5
5
|
export interface IDomain extends Document {
|
|
@@ -24,6 +24,7 @@ export interface IDomain extends Document {
|
|
|
24
24
|
trigger_created_at: string;
|
|
25
25
|
nameservers: string[];
|
|
26
26
|
dns: IDns[];
|
|
27
|
+
project_environment?: IProjectEnvironment;
|
|
27
28
|
is_pending_verification: boolean;
|
|
28
29
|
redirect?: {
|
|
29
30
|
url: string;
|
package/types/index.ts
CHANGED
|
@@ -51,3 +51,4 @@ export type { ITag } from "./tag";
|
|
|
51
51
|
export type { ICashierSubscription, ICashierSubscriptionItem } from "./cashier_subscription";
|
|
52
52
|
export type { IProjectEnvironment } from "./project-environment";
|
|
53
53
|
export type { IEnvironmentVariable } from "./environment-variable";
|
|
54
|
+
export type { IActivityLog } from "./activity-log";
|