@brimble/models 3.8.24 → 3.8.27

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
@@ -54,12 +54,13 @@ export { default as EnvironmentVariable } from "./environment-variable";
54
54
  export { default as ActivityLog } from "./activity-log";
55
55
  export { default as OwnershipTransfer } from "./ownership-transfer";
56
56
  export { default as Sandbox } from "./sandbox";
57
+ export { default as SandboxActivity } from "./sandbox-activity";
57
58
  export { default as SandboxImage } from "./sandbox-image";
58
59
  export { default as SandboxSnapshot } from "./sandbox-snapshot";
59
60
  export { default as SandboxSnapshotUsageSegment } from "./sandbox-snapshot-usage-segment";
60
61
  export { default as SandboxUsageSegment } from "./sandbox-usage-segment";
61
62
  export { default as VolumeUsageSegment } from "./volume-usage-segment";
62
- export { IUser, IGit, IProject, IProjectAnalytics, 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, IOwnershipTransfer, ISandbox, ISandboxSpecs, ISandboxImage, ISandboxSnapshot, ISandboxSnapshotUsageSegment, ISandboxSnapshotUsageSegmentCosts, ISandboxUsageSegment, ISandboxUsageSegmentCurrent, ISandboxUsageSegmentCosts, IVolumeUsageSegment, IVolumeUsageSegmentCosts, } from "./types";
63
+ export { IUser, IGit, IProject, IProjectAnalytics, 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, IOwnershipTransfer, ISandbox, ISandboxSpecs, ISandboxActivity, ISandboxImage, ISandboxSnapshot, ISandboxSnapshotUsageSegment, ISandboxSnapshotUsageSegmentCosts, ISandboxUsageSegment, ISandboxUsageSegmentCurrent, ISandboxUsageSegmentCosts, IVolumeUsageSegment, IVolumeUsageSegmentCosts, } from "./types";
63
64
  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, SANDBOX_TEMPLATE, SANDBOX_STATUS, SANDBOX_DESTROY_REASON, SANDBOX_SNAPSHOT_STATUS, } from "./enum";
64
65
  import mongoose from "mongoose";
65
66
  export declare const connectToMongo: (mongoUrl: string, config?: mongoose.ConnectOptions) => Promise<void>;
package/dist/index.js CHANGED
@@ -13,8 +13,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  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.ProjectAnalytics = exports.DeletedProject = exports.Project = exports.User = void 0;
16
- exports.SANDBOX_SNAPSHOT_STATUS = exports.SANDBOX_DESTROY_REASON = exports.SANDBOX_STATUS = exports.SANDBOX_TEMPLATE = 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.VolumeUsageSegment = exports.SandboxUsageSegment = exports.SandboxSnapshotUsageSegment = exports.SandboxSnapshot = exports.SandboxImage = exports.Sandbox = exports.OwnershipTransfer = exports.ActivityLog = exports.EnvironmentVariable = exports.ProjectEnvironment = exports.CashierSubscriptionItem = exports.CashierSubscription = void 0;
17
- exports.healthCheckMongo = exports.closeMongo = exports.db = exports.connectToMongo = void 0;
16
+ exports.SANDBOX_DESTROY_REASON = exports.SANDBOX_STATUS = exports.SANDBOX_TEMPLATE = 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.VolumeUsageSegment = exports.SandboxUsageSegment = exports.SandboxSnapshotUsageSegment = exports.SandboxSnapshot = exports.SandboxImage = exports.SandboxActivity = exports.Sandbox = exports.OwnershipTransfer = exports.ActivityLog = exports.EnvironmentVariable = exports.ProjectEnvironment = exports.CashierSubscriptionItem = exports.CashierSubscription = void 0;
17
+ exports.healthCheckMongo = exports.closeMongo = exports.db = exports.connectToMongo = exports.SANDBOX_SNAPSHOT_STATUS = void 0;
18
18
  var user_1 = require("./user");
19
19
  Object.defineProperty(exports, "User", { enumerable: true, get: function () { return __importDefault(user_1).default; } });
20
20
  var project_1 = require("./project");
@@ -128,6 +128,8 @@ var ownership_transfer_1 = require("./ownership-transfer");
128
128
  Object.defineProperty(exports, "OwnershipTransfer", { enumerable: true, get: function () { return __importDefault(ownership_transfer_1).default; } });
129
129
  var sandbox_1 = require("./sandbox");
130
130
  Object.defineProperty(exports, "Sandbox", { enumerable: true, get: function () { return __importDefault(sandbox_1).default; } });
131
+ var sandbox_activity_1 = require("./sandbox-activity");
132
+ Object.defineProperty(exports, "SandboxActivity", { enumerable: true, get: function () { return __importDefault(sandbox_activity_1).default; } });
131
133
  var sandbox_image_1 = require("./sandbox-image");
132
134
  Object.defineProperty(exports, "SandboxImage", { enumerable: true, get: function () { return __importDefault(sandbox_image_1).default; } });
133
135
  var sandbox_snapshot_1 = require("./sandbox-snapshot");
@@ -234,6 +234,10 @@ const projectSchema = new mongoose_1.Schema({
234
234
  type: String,
235
235
  default: null,
236
236
  },
237
+ persistent_mount_path: {
238
+ type: String,
239
+ required: false
240
+ },
237
241
  volumeMount: {
238
242
  type: String,
239
243
  required: false,
@@ -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 { ISandboxActivity } from "./types/sandbox-activity";
27
+ declare const _default: import("mongoose").Model<ISandboxActivity, {}, {}, {}, import("mongoose").Document<unknown, {}, ISandboxActivity> & ISandboxActivity & {
28
+ _id: import("mongoose").Types.ObjectId;
29
+ }, any>;
30
+ export default _default;
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const mongoose_1 = require("mongoose");
4
+ const sandboxActivitySchema = new mongoose_1.Schema({
5
+ sandbox_id: {
6
+ type: mongoose_1.Schema.Types.ObjectId,
7
+ ref: "Sandbox",
8
+ required: true,
9
+ index: true,
10
+ },
11
+ user_id: {
12
+ type: mongoose_1.Schema.Types.ObjectId,
13
+ ref: "User",
14
+ required: true,
15
+ index: true,
16
+ },
17
+ team: {
18
+ type: mongoose_1.Schema.Types.ObjectId,
19
+ ref: "Team",
20
+ default: null,
21
+ index: true,
22
+ },
23
+ command: {
24
+ type: String,
25
+ required: true,
26
+ },
27
+ started_at: {
28
+ type: Date,
29
+ required: true,
30
+ index: true,
31
+ },
32
+ ended_at: {
33
+ type: Date,
34
+ default: null,
35
+ },
36
+ exit_code: {
37
+ type: Number,
38
+ default: null,
39
+ },
40
+ duration_ms: {
41
+ type: Number,
42
+ default: null,
43
+ },
44
+ error: {
45
+ type: String,
46
+ default: null,
47
+ },
48
+ }, { timestamps: { createdAt: "created_at", updatedAt: "updated_at" } });
49
+ exports.default = (0, mongoose_1.model)("SandboxActivity", sandboxActivitySchema);
package/dist/sandbox.js CHANGED
@@ -46,9 +46,9 @@ const sandboxSchema = new mongoose_1.Schema({
46
46
  required: true,
47
47
  },
48
48
  specs: {
49
- cpu: { type: Number, default: 2000 },
50
- memory: { type: Number, default: 2048 },
51
- disk: { type: Number, default: 5 },
49
+ cpu: { type: Number, default: 500 },
50
+ memory: { type: Number, default: 512 },
51
+ disk: { type: Number, default: 2 },
52
52
  },
53
53
  created_at: {
54
54
  type: Date,
@@ -55,6 +55,7 @@ export type { IEnvironmentVariable } from "./environment-variable";
55
55
  export type { IActivityLog } from "./activity-log";
56
56
  export type { IOwnershipTransfer } from "./ownership-transfer";
57
57
  export type { ISandbox, ISandboxSpecs } from "./sandbox";
58
+ export type { ISandboxActivity } from "./sandbox-activity";
58
59
  export type { ISandboxImage } from "./sandbox-image";
59
60
  export type { ISandboxSnapshot } from "./sandbox-snapshot";
60
61
  export type { ISandboxSnapshotUsageSegment, ISandboxSnapshotUsageSegmentCosts, } from "./sandbox-snapshot-usage-segment";
@@ -29,6 +29,7 @@ export interface IProject extends Document {
29
29
  dir: string;
30
30
  tlsEnabled: boolean;
31
31
  dbImage: IDbImage;
32
+ persistent_mount_path: string;
32
33
  installCommand: string;
33
34
  buildCommand: string;
34
35
  startCommand: string;
@@ -0,0 +1,14 @@
1
+ import { Document, Types } from "mongoose";
2
+ export interface ISandboxActivity extends Document {
3
+ sandbox_id: Types.ObjectId;
4
+ user_id: Types.ObjectId;
5
+ team: Types.ObjectId | null;
6
+ command: string;
7
+ started_at: Date;
8
+ ended_at: Date | null;
9
+ exit_code: number | null;
10
+ duration_ms: number | null;
11
+ error: string | null;
12
+ created_at?: Date;
13
+ updated_at?: Date;
14
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/index.ts CHANGED
@@ -54,6 +54,7 @@ export { default as EnvironmentVariable } from "./environment-variable";
54
54
  export { default as ActivityLog } from "./activity-log";
55
55
  export { default as OwnershipTransfer } from "./ownership-transfer";
56
56
  export { default as Sandbox } from "./sandbox";
57
+ export { default as SandboxActivity } from "./sandbox-activity";
57
58
  export { default as SandboxImage } from "./sandbox-image";
58
59
  export { default as SandboxSnapshot } from "./sandbox-snapshot";
59
60
  export { default as SandboxSnapshotUsageSegment } from "./sandbox-snapshot-usage-segment";
@@ -122,6 +123,7 @@ export {
122
123
  IOwnershipTransfer,
123
124
  ISandbox,
124
125
  ISandboxSpecs,
126
+ ISandboxActivity,
125
127
  ISandboxImage,
126
128
  ISandboxSnapshot,
127
129
  ISandboxSnapshotUsageSegment,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brimble/models",
3
- "version": "3.8.24",
3
+ "version": "3.8.27",
4
4
  "description": "Brimble models",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/project/index.ts CHANGED
@@ -234,6 +234,10 @@ const projectSchema = new Schema(
234
234
  type: String,
235
235
  default: null,
236
236
  },
237
+ persistent_mount_path: {
238
+ type: String,
239
+ required: false
240
+ },
237
241
  volumeMount: {
238
242
  type: String,
239
243
  required: false,
@@ -0,0 +1,53 @@
1
+ import { model, Schema } from "mongoose";
2
+ import { ISandboxActivity } from "./types/sandbox-activity";
3
+
4
+ const sandboxActivitySchema: Schema = new Schema(
5
+ {
6
+ sandbox_id: {
7
+ type: Schema.Types.ObjectId,
8
+ ref: "Sandbox",
9
+ required: true,
10
+ index: true,
11
+ },
12
+ user_id: {
13
+ type: Schema.Types.ObjectId,
14
+ ref: "User",
15
+ required: true,
16
+ index: true,
17
+ },
18
+ team: {
19
+ type: Schema.Types.ObjectId,
20
+ ref: "Team",
21
+ default: null,
22
+ index: true,
23
+ },
24
+ command: {
25
+ type: String,
26
+ required: true,
27
+ },
28
+ started_at: {
29
+ type: Date,
30
+ required: true,
31
+ index: true,
32
+ },
33
+ ended_at: {
34
+ type: Date,
35
+ default: null,
36
+ },
37
+ exit_code: {
38
+ type: Number,
39
+ default: null,
40
+ },
41
+ duration_ms: {
42
+ type: Number,
43
+ default: null,
44
+ },
45
+ error: {
46
+ type: String,
47
+ default: null,
48
+ },
49
+ },
50
+ { timestamps: { createdAt: "created_at", updatedAt: "updated_at" } },
51
+ );
52
+
53
+ export default model<ISandboxActivity>("SandboxActivity", sandboxActivitySchema);
package/sandbox.ts CHANGED
@@ -46,9 +46,9 @@ const sandboxSchema: Schema = new Schema({
46
46
  required: true,
47
47
  },
48
48
  specs: {
49
- cpu: { type: Number, default: 2000 },
50
- memory: { type: Number, default: 2048 },
51
- disk: { type: Number, default: 5 },
49
+ cpu: { type: Number, default: 500 },
50
+ memory: { type: Number, default: 512 },
51
+ disk: { type: Number, default: 2 },
52
52
  },
53
53
  created_at: {
54
54
  type: Date,
package/types/index.ts CHANGED
@@ -55,6 +55,7 @@ export type { IEnvironmentVariable } from "./environment-variable";
55
55
  export type { IActivityLog } from "./activity-log";
56
56
  export type { IOwnershipTransfer } from "./ownership-transfer";
57
57
  export type { ISandbox, ISandboxSpecs } from "./sandbox";
58
+ export type { ISandboxActivity } from "./sandbox-activity";
58
59
  export type { ISandboxImage } from "./sandbox-image";
59
60
  export type { ISandboxSnapshot } from "./sandbox-snapshot";
60
61
  export type {
@@ -30,6 +30,7 @@ export interface IProject extends Document {
30
30
  dir: string;
31
31
  tlsEnabled: boolean;
32
32
  dbImage: IDbImage;
33
+ persistent_mount_path: string;
33
34
  installCommand: string;
34
35
  buildCommand: string;
35
36
  startCommand: string;
@@ -0,0 +1,15 @@
1
+ import { Document, Types } from "mongoose";
2
+
3
+ export interface ISandboxActivity extends Document {
4
+ sandbox_id: Types.ObjectId;
5
+ user_id: Types.ObjectId;
6
+ team: Types.ObjectId | null;
7
+ command: string;
8
+ started_at: Date;
9
+ ended_at: Date | null;
10
+ exit_code: number | null;
11
+ duration_ms: number | null;
12
+ error: string | null;
13
+ created_at?: Date;
14
+ updated_at?: Date;
15
+ }