@brimble/models 3.2.9 → 3.3.1

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.
@@ -0,0 +1 @@
1
+ $ rm -rf dist && tsc -p .
package/dist/index.d.ts CHANGED
@@ -27,7 +27,9 @@ export { default as ComputeChange } from "./compute";
27
27
  export { default as Region } from "./region";
28
28
  export { default as Volume } from "./volume";
29
29
  export { default as Framework } from "./framework";
30
- 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, } from "./types";
30
+ export { default as Settings } from "./settings";
31
+ export { default as LoadBalancerPort } from "./load-balancer-port";
32
+ 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 } from "./types";
31
33
  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, } from "./enum";
32
34
  import mongoose from "mongoose";
33
35
  export declare const connectToMongo: (mongoUrl: string, config?: mongoose.ConnectOptions) => Promise<void>;
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.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.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.closeMongo = exports.db = exports.connectToMongo = exports.FrameworkApplicationType = exports.SERVER_PROTOCOL = void 0;
15
+ 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.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.closeMongo = exports.db = exports.connectToMongo = exports.FrameworkApplicationType = exports.SERVER_PROTOCOL = exports.BUILD_DISABLED_BY = exports.REGION_CONTINENT = 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");
@@ -73,6 +73,10 @@ var volume_1 = require("./volume");
73
73
  Object.defineProperty(exports, "Volume", { enumerable: true, get: function () { return __importDefault(volume_1).default; } });
74
74
  var framework_1 = require("./framework");
75
75
  Object.defineProperty(exports, "Framework", { enumerable: true, get: function () { return __importDefault(framework_1).default; } });
76
+ var settings_1 = require("./settings");
77
+ Object.defineProperty(exports, "Settings", { enumerable: true, get: function () { return __importDefault(settings_1).default; } });
78
+ var load_balancer_port_1 = require("./load-balancer-port");
79
+ Object.defineProperty(exports, "LoadBalancerPort", { enumerable: true, get: function () { return __importDefault(load_balancer_port_1).default; } });
76
80
  var enum_1 = require("./enum");
77
81
  Object.defineProperty(exports, "GIT_TYPE", { enumerable: true, get: function () { return enum_1.GIT_TYPE; } });
78
82
  Object.defineProperty(exports, "INTEGRATION_TYPES", { enumerable: true, get: function () { return enum_1.INTEGRATION_TYPES; } });
@@ -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 { ILoadBalancerPort } from "./types";
27
+ declare const _default: import("mongoose").Model<ILoadBalancerPort, {}, {}, {}, import("mongoose").Document<unknown, {}, ILoadBalancerPort> & ILoadBalancerPort & {
28
+ _id: import("mongoose").Types.ObjectId;
29
+ }, any>;
30
+ export default _default;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const mongoose_1 = require("mongoose");
4
+ const loadBalancerPortSchema = new mongoose_1.Schema({
5
+ port: {
6
+ type: Number,
7
+ required: true,
8
+ min: 1,
9
+ max: 65535,
10
+ },
11
+ server_id: {
12
+ type: mongoose_1.Schema.Types.ObjectId,
13
+ ref: "Server",
14
+ required: true,
15
+ },
16
+ project_id: {
17
+ type: mongoose_1.Schema.Types.ObjectId,
18
+ ref: "Project",
19
+ required: true,
20
+ },
21
+ }, { timestamps: true });
22
+ exports.default = (0, mongoose_1.model)("LoadBalancerPort", loadBalancerPortSchema, "load_balancer_ports");
package/dist/logs.js CHANGED
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const mongoose_1 = require("mongoose");
4
4
  const enum_1 = require("./enum");
5
- // import { SoftDeleteModel, softDeletePlugin } from "soft-delete-plugin-mongoose";
5
+ const soft_delete_plugin_mongoose_1 = require("soft-delete-plugin-mongoose");
6
6
  const LogSchema = new mongoose_1.Schema({
7
7
  name: String,
8
8
  key: String,
@@ -38,5 +38,5 @@ const LogSchema = new mongoose_1.Schema({
38
38
  endTime: mongoose_1.Schema.Types.Date,
39
39
  deleted: mongoose_1.Schema.Types.Boolean,
40
40
  }, { timestamps: true });
41
- // LogSchema.plugin(softDeletePlugin);
41
+ LogSchema.plugin(soft_delete_plugin_mongoose_1.softDeletePlugin);
42
42
  exports.default = (0, mongoose_1.model)("Log", LogSchema);
@@ -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 { ISettings } from "./types";
27
+ declare const _default: import("mongoose").Model<ISettings, {}, {}, {}, import("mongoose").Document<unknown, {}, ISettings> & ISettings & {
28
+ _id: import("mongoose").Types.ObjectId;
29
+ }, any>;
30
+ export default _default;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const mongoose_1 = require("mongoose");
4
+ const settingsSchema = new mongoose_1.Schema({
5
+ vaultEnabled: {
6
+ type: Boolean,
7
+ default: false,
8
+ },
9
+ maintenanceMode: {
10
+ type: Boolean,
11
+ default: false,
12
+ },
13
+ enableSecretRotation: {
14
+ type: String,
15
+ required: false,
16
+ },
17
+ domainPromoEnabled: {
18
+ type: Boolean,
19
+ default: false,
20
+ },
21
+ buildsEnabled: {
22
+ type: Boolean,
23
+ default: false,
24
+ },
25
+ minimumBuildMinutes: {
26
+ type: Number,
27
+ required: false,
28
+ },
29
+ enableLogging: {
30
+ type: Boolean,
31
+ default: false,
32
+ },
33
+ metaSettings: {
34
+ type: Object,
35
+ required: false,
36
+ },
37
+ }, {
38
+ timestamps: true,
39
+ collection: "app_settings",
40
+ });
41
+ exports.default = (0, mongoose_1.model)("Settings", settingsSchema, "app_settings");
@@ -29,3 +29,5 @@ export { IComputeChange } from "./compute";
29
29
  export { IRegion } from "./region";
30
30
  export { IVolume } from "./volume";
31
31
  export { IFramework, BrimbleFrameworkType } from "./framework";
32
+ export { ISettings } from "./settings";
33
+ export { ILoadBalancerPort } from "./load-balancer-port";
@@ -0,0 +1,10 @@
1
+ import { Document } from "mongoose";
2
+ import { IProject } from "./project";
3
+ import { IServer } from "./server";
4
+ export interface ILoadBalancerPort extends Document {
5
+ port: number;
6
+ server_id: IServer;
7
+ project_id: IProject;
8
+ createdAt: Date;
9
+ updatedAt: Date;
10
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,10 @@
1
+ import { Document } from "mongoose";
2
+ export interface ISettings extends Document {
3
+ vaultEnabled: boolean;
4
+ maintenanceMode: boolean;
5
+ buildsEnabled: boolean;
6
+ minimumBuildMinutes: number;
7
+ enableSecretRotation: boolean;
8
+ domainPromoEnabled: boolean;
9
+ metaSettings: Record<string, any>;
10
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/index.ts CHANGED
@@ -27,6 +27,8 @@ export { default as ComputeChange } from "./compute";
27
27
  export { default as Region } from "./region";
28
28
  export { default as Volume } from "./volume";
29
29
  export { default as Framework } from "./framework";
30
+ export { default as Settings } from "./settings";
31
+ export { default as LoadBalancerPort } from "./load-balancer-port";
30
32
 
31
33
  export {
32
34
  IUser,
@@ -61,6 +63,8 @@ export {
61
63
  IVolume,
62
64
  IFramework,
63
65
  BrimbleFrameworkType,
66
+ ISettings,
67
+ ILoadBalancerPort
64
68
  } from "./types";
65
69
  export {
66
70
  GIT_TYPE,
@@ -0,0 +1,26 @@
1
+ import { model, Schema } from "mongoose";
2
+ import { ILoadBalancerPort } from "./types";
3
+
4
+ const loadBalancerPortSchema = new Schema(
5
+ {
6
+ port: {
7
+ type: Number,
8
+ required: true,
9
+ min: 1,
10
+ max: 65535,
11
+ },
12
+ server_id: {
13
+ type: Schema.Types.ObjectId,
14
+ ref: "Server",
15
+ required: true,
16
+ },
17
+ project_id: {
18
+ type: Schema.Types.ObjectId,
19
+ ref: "Project",
20
+ required: true,
21
+ },
22
+ },
23
+ { timestamps: true },
24
+ );
25
+
26
+ export default model<ILoadBalancerPort>("LoadBalancerPort", loadBalancerPortSchema, "load_balancer_ports");
package/logs.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { model, Schema } from "mongoose";
2
2
  import { ENVIRONMENT, PROJECT_STATUS } from "./enum";
3
3
  import { ILog } from "./types";
4
- // import { SoftDeleteModel, softDeletePlugin } from "soft-delete-plugin-mongoose";
4
+ import { softDeletePlugin } from "soft-delete-plugin-mongoose";
5
5
 
6
6
  const LogSchema = new Schema(
7
7
  {
@@ -42,6 +42,6 @@ const LogSchema = new Schema(
42
42
  { timestamps: true },
43
43
  );
44
44
 
45
- // LogSchema.plugin(softDeletePlugin);
45
+ LogSchema.plugin(softDeletePlugin);
46
46
 
47
47
  export default model<ILog>("Log", LogSchema);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brimble/models",
3
- "version": "3.2.9",
3
+ "version": "3.3.1",
4
4
  "description": "Brimble models",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/settings.ts ADDED
@@ -0,0 +1,45 @@
1
+ import { model, Schema } from "mongoose";
2
+ import { ISettings } from "./types";
3
+
4
+ const settingsSchema: Schema = new Schema(
5
+ {
6
+ vaultEnabled: {
7
+ type: Boolean,
8
+ default: false,
9
+ },
10
+ maintenanceMode: {
11
+ type: Boolean,
12
+ default: false,
13
+ },
14
+ enableSecretRotation: {
15
+ type: String,
16
+ required: false,
17
+ },
18
+ domainPromoEnabled: {
19
+ type: Boolean,
20
+ default: false,
21
+ },
22
+ buildsEnabled: {
23
+ type: Boolean,
24
+ default: false,
25
+ },
26
+ minimumBuildMinutes: {
27
+ type: Number,
28
+ required: false,
29
+ },
30
+ enableLogging: {
31
+ type: Boolean,
32
+ default: false,
33
+ },
34
+ metaSettings: {
35
+ type: Object,
36
+ required: false,
37
+ },
38
+ },
39
+ {
40
+ timestamps: true,
41
+ collection: "app_settings",
42
+ },
43
+ );
44
+
45
+ export default model<ISettings>("Settings", settingsSchema, "app_settings");
package/types/index.ts CHANGED
@@ -29,3 +29,5 @@ export { IComputeChange } from "./compute";
29
29
  export { IRegion } from "./region";
30
30
  export { IVolume } from "./volume";
31
31
  export { IFramework, BrimbleFrameworkType } from "./framework";
32
+ export { ISettings } from "./settings";
33
+ export { ILoadBalancerPort } from "./load-balancer-port";
@@ -0,0 +1,11 @@
1
+ import { Document } from "mongoose";
2
+ import { IProject } from "./project";
3
+ import { IServer } from "./server";
4
+
5
+ export interface ILoadBalancerPort extends Document {
6
+ port: number;
7
+ server_id: IServer;
8
+ project_id: IProject;
9
+ createdAt: Date;
10
+ updatedAt: Date;
11
+ }
@@ -0,0 +1,17 @@
1
+ import { Document } from "mongoose";
2
+
3
+ export interface ISettings extends Document {
4
+ vaultEnabled: boolean;
5
+
6
+ maintenanceMode: boolean;
7
+
8
+ buildsEnabled: boolean;
9
+
10
+ minimumBuildMinutes: number;
11
+
12
+ enableSecretRotation: boolean;
13
+
14
+ domainPromoEnabled: boolean;
15
+
16
+ metaSettings: Record<string, any>;
17
+ }