@brimble/models 2.4.85 → 2.4.87

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
@@ -24,8 +24,9 @@ export { default as PlanConfiguration } from "./plan_configuration";
24
24
  export { default as AutoScalingGroup } from "./auto-scaling";
25
25
  export { default as ComputeChange } from "./compute";
26
26
  export { default as Region } from "./region";
27
- export { IUser, IGit, IProject, IPreview, IFollowing, IIntegration, IEnv, IServer, IDomain, IToken, IMember, ITeam, IInstalledIntegration, ILog, ISubscription, ICard, IDns, IRole, IPermission, IMemberPermission, IWallet, IDbImage, IJob, ILicense, IPlanConfiguration, IAutoScalingGroup, IComputeChange, IRegion } from "./types";
28
- 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 } from "./enum";
27
+ export { default as Volume } from "./volume";
28
+ export { IUser, IGit, IProject, IPreview, 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, } from "./types";
29
+ 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, } from "./enum";
29
30
  import mongoose from "mongoose";
30
31
  export declare const connectToMongo: (mongoUrl: string, config?: mongoose.ConnectOptions) => Promise<void>;
31
32
  export declare const db: mongoose.Connection;
package/dist/index.js CHANGED
@@ -12,7 +12,7 @@ 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.closeMongo = exports.db = exports.connectToMongo = 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.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.Preview = exports.DeletedProject = exports.Project = exports.User = void 0;
15
+ exports.closeMongo = exports.db = exports.connectToMongo = 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.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.Preview = exports.DeletedProject = exports.Project = exports.User = void 0;
16
16
  var user_1 = require("./user");
17
17
  Object.defineProperty(exports, "User", { enumerable: true, get: function () { return __importDefault(user_1).default; } });
18
18
  var project_1 = require("./project");
@@ -66,6 +66,8 @@ var compute_1 = require("./compute");
66
66
  Object.defineProperty(exports, "ComputeChange", { enumerable: true, get: function () { return __importDefault(compute_1).default; } });
67
67
  var region_1 = require("./region");
68
68
  Object.defineProperty(exports, "Region", { enumerable: true, get: function () { return __importDefault(region_1).default; } });
69
+ var volume_1 = require("./volume");
70
+ Object.defineProperty(exports, "Volume", { enumerable: true, get: function () { return __importDefault(volume_1).default; } });
69
71
  var enum_1 = require("./enum");
70
72
  Object.defineProperty(exports, "GIT_TYPE", { enumerable: true, get: function () { return enum_1.GIT_TYPE; } });
71
73
  Object.defineProperty(exports, "INTEGRATION_TYPES", { enumerable: true, get: function () { return enum_1.INTEGRATION_TYPES; } });
@@ -13,6 +13,7 @@ const PlanConfigurationSchema = new mongoose_1.Schema({
13
13
  build_minutes: { type: Number, required: true },
14
14
  log_retention: { type: Number, required: true },
15
15
  bandwidth: { type: Number, required: true },
16
+ price: { type: Number, required: true },
16
17
  plan_type: {
17
18
  type: String,
18
19
  enum: Object.values(enum_1.SUBSCRIPTION_PLAN_TYPE),
@@ -21,7 +21,7 @@ const projectSchema = new mongoose_1.Schema({
21
21
  },
22
22
  healthCheckPath: {
23
23
  type: String,
24
- required: false
24
+ required: false,
25
25
  },
26
26
  domains: [
27
27
  {
@@ -80,15 +80,15 @@ const projectSchema = new mongoose_1.Schema({
80
80
  },
81
81
  passwordEnabled: {
82
82
  type: Boolean,
83
- default: false
83
+ default: false,
84
84
  },
85
85
  backupEnabled: {
86
86
  type: Boolean,
87
- default: false
87
+ default: false,
88
88
  },
89
89
  disabled: {
90
90
  type: Boolean,
91
- default: false
91
+ default: false,
92
92
  },
93
93
  password: {
94
94
  type: String,
@@ -14,7 +14,7 @@ const previewsSchema = new mongoose_1.Schema({
14
14
  },
15
15
  healthCheckPath: {
16
16
  type: String,
17
- required: false
17
+ required: false,
18
18
  },
19
19
  pid: Number,
20
20
  port: Number,
package/dist/server.js CHANGED
@@ -21,7 +21,7 @@ const serverSchema = new mongoose_1.Schema({
21
21
  },
22
22
  domain: {
23
23
  required: false,
24
- type: String
24
+ type: String,
25
25
  },
26
26
  webhook_url: String,
27
27
  ip_address: {
@@ -56,7 +56,7 @@ const serverSchema = new mongoose_1.Schema({
56
56
  tag: String,
57
57
  firewall_id: {
58
58
  required: false,
59
- type: String
59
+ type: String,
60
60
  },
61
61
  specifications: {
62
62
  type: Object,
@@ -26,3 +26,4 @@ export { IPlanConfiguration } from "./plan_configuration";
26
26
  export { IAutoScalingGroup } from "./auto-scaling-group";
27
27
  export { IComputeChange } from "./compute";
28
28
  export { IRegion } from "./region";
29
+ export { IVolume } from "./volume";
@@ -2,6 +2,7 @@ import { Document } from "mongoose";
2
2
  import { SUBSCRIPTION_PLAN_TYPE } from "../enum";
3
3
  export interface IPlanConfiguration extends Document {
4
4
  tag: string;
5
+ price: number;
5
6
  slack_support: boolean;
6
7
  concurrent_builds: number;
7
8
  project_limit: number;
@@ -1,3 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- ;
@@ -0,0 +1,14 @@
1
+ import { Document } from "mongoose";
2
+ import { IUser } from "./user";
3
+ import { ITeam } from "./team";
4
+ import { ISubscription } from "./subscription";
5
+ export interface IVolume extends Document {
6
+ name: string;
7
+ user?: IUser;
8
+ team?: ITeam;
9
+ subscription: ISubscription;
10
+ size: number;
11
+ mount_path?: string;
12
+ created_at?: Date;
13
+ updated_at?: Date;
14
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,56 @@
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-delete/node_modules/mongoose/types/aggregate" />
26
+ /// <reference types="mongoose-delete/node_modules/mongoose/types/callback" />
27
+ /// <reference types="mongoose-delete/node_modules/mongoose/types/collection" />
28
+ /// <reference types="mongoose-delete/node_modules/mongoose/types/connection" />
29
+ /// <reference types="mongoose-delete/node_modules/mongoose/types/cursor" />
30
+ /// <reference types="mongoose-delete/node_modules/mongoose/types/document" />
31
+ /// <reference types="mongoose-delete/node_modules/mongoose/types/error" />
32
+ /// <reference types="mongoose-delete/node_modules/mongoose/types/expressions" />
33
+ /// <reference types="mongoose-delete/node_modules/mongoose/types/helpers" />
34
+ /// <reference types="mongoose-delete/node_modules/mongoose/types/middlewares" />
35
+ /// <reference types="mongoose-delete/node_modules/mongoose/types/indexes" />
36
+ /// <reference types="mongoose-delete/node_modules/mongoose/types/models" />
37
+ /// <reference types="mongoose-delete/node_modules/mongoose/types/mongooseoptions" />
38
+ /// <reference types="mongoose-delete/node_modules/mongoose/types/pipelinestage" />
39
+ /// <reference types="mongoose-delete/node_modules/mongoose/types/populate" />
40
+ /// <reference types="mongoose-delete/node_modules/mongoose/types/query" />
41
+ /// <reference types="mongoose-delete/node_modules/mongoose/types/schemaoptions" />
42
+ /// <reference types="mongoose-delete/node_modules/mongoose/types/schematypes" />
43
+ /// <reference types="mongoose-delete/node_modules/mongoose/types/session" />
44
+ /// <reference types="mongoose-delete/node_modules/mongoose/types/types" />
45
+ /// <reference types="mongoose-delete/node_modules/mongoose/types/utility" />
46
+ /// <reference types="mongoose-delete/node_modules/mongoose/types/validation" />
47
+ /// <reference types="mongoose-delete/node_modules/mongoose/types/virtuals" />
48
+ /// <reference types="mongoose-delete/node_modules/mongoose" />
49
+ /// <reference types="mongoose/types/inferschematype" />
50
+ /// <reference types="mongoose-delete/node_modules/mongoose/types/inferschematype" />
51
+ /// <reference types="mongoose-delete/node_modules/mongoose/types/inferrawdoctype" />
52
+ import { IVolume } from "./types";
53
+ declare const _default: import("mongoose").Model<IVolume, {}, {}, {}, import("mongoose").Document<unknown, {}, IVolume> & IVolume & {
54
+ _id: import("mongoose").Types.ObjectId;
55
+ }, any>;
56
+ export default _default;
package/dist/volume.js ADDED
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const mongoose_1 = require("mongoose");
4
+ const volumeSchema = new mongoose_1.Schema({
5
+ name: String,
6
+ user: {
7
+ type: mongoose_1.Schema.Types.ObjectId,
8
+ required: false,
9
+ ref: "User",
10
+ default: null,
11
+ },
12
+ team: {
13
+ type: mongoose_1.Schema.Types.ObjectId,
14
+ required: false,
15
+ ref: "Team",
16
+ default: null,
17
+ },
18
+ subscription: {
19
+ type: mongoose_1.Schema.Types.ObjectId,
20
+ required: true,
21
+ ref: "Subscription",
22
+ },
23
+ size: { type: Number, required: true },
24
+ mount_path: { type: String },
25
+ }, {
26
+ timestamps: {
27
+ createdAt: "created_at",
28
+ updatedAt: "updated_at",
29
+ },
30
+ });
31
+ exports.default = (0, mongoose_1.model)("Volume", volumeSchema);
package/enum/index.ts CHANGED
@@ -2,7 +2,7 @@ export enum GIT_TYPE {
2
2
  GITHUB = "GITHUB",
3
3
  GITLAB = "GITLAB",
4
4
  BITBUCKET = "BITBUCKET",
5
- DOCKER = "DOCKER"
5
+ DOCKER = "DOCKER",
6
6
  }
7
7
 
8
8
  export enum REQUEST_TYPE {
@@ -115,7 +115,7 @@ export enum ServiceType {
115
115
  Database = "database",
116
116
  WebService = "web-service",
117
117
  Liscense = "liscense",
118
- Worker = "worker"
118
+ Worker = "worker",
119
119
  }
120
120
 
121
121
  export enum DatabaseEngine {
package/env.ts CHANGED
@@ -30,4 +30,4 @@ const envSchema = new Schema(
30
30
  { timestamps: true },
31
31
  );
32
32
 
33
- export default model<IEnv>("Env", envSchema);
33
+ export default model<IEnv>("Env", envSchema);
package/index.ts CHANGED
@@ -24,6 +24,7 @@ export { default as PlanConfiguration } from "./plan_configuration";
24
24
  export { default as AutoScalingGroup } from "./auto-scaling";
25
25
  export { default as ComputeChange } from "./compute";
26
26
  export { default as Region } from "./region";
27
+ export { default as Volume } from "./volume";
27
28
 
28
29
  export {
29
30
  IUser,
@@ -53,7 +54,8 @@ export {
53
54
  IPlanConfiguration,
54
55
  IAutoScalingGroup,
55
56
  IComputeChange,
56
- IRegion
57
+ IRegion,
58
+ IVolume,
57
59
  } from "./types";
58
60
  export {
59
61
  GIT_TYPE,
@@ -74,7 +76,7 @@ export {
74
76
  DatabaseEngine,
75
77
  JobStatus,
76
78
  LicenseStatus,
77
- REGION_CONTINENT
79
+ REGION_CONTINENT,
78
80
  } from "./enum";
79
81
 
80
82
  import mongoose from "mongoose";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brimble/models",
3
- "version": "2.4.85",
3
+ "version": "2.4.87",
4
4
  "description": "Brimble models",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -14,6 +14,7 @@ const PlanConfigurationSchema = new Schema<IPlanConfiguration>(
14
14
  build_minutes: { type: Number, required: true },
15
15
  log_retention: { type: Number, required: true },
16
16
  bandwidth: { type: Number, required: true },
17
+ price: { type: Number, required: true },
17
18
  plan_type: {
18
19
  type: String,
19
20
  enum: Object.values(SUBSCRIPTION_PLAN_TYPE),
package/project/index.ts CHANGED
@@ -21,7 +21,7 @@ const projectSchema = new Schema(
21
21
  },
22
22
  healthCheckPath: {
23
23
  type: String,
24
- required: false
24
+ required: false,
25
25
  },
26
26
  domains: [
27
27
  {
@@ -80,15 +80,15 @@ const projectSchema = new Schema(
80
80
  },
81
81
  passwordEnabled: {
82
82
  type: Boolean,
83
- default: false
83
+ default: false,
84
84
  },
85
85
  backupEnabled: {
86
86
  type: Boolean,
87
- default: false
87
+ default: false,
88
88
  },
89
89
  disabled: {
90
90
  type: Boolean,
91
- default: false
91
+ default: false,
92
92
  },
93
93
  password: {
94
94
  type: String,
@@ -15,7 +15,7 @@ const previewsSchema = new Schema(
15
15
  },
16
16
  healthCheckPath: {
17
17
  type: String,
18
- required: false
18
+ required: false,
19
19
  },
20
20
  pid: Number,
21
21
  port: Number,
package/server.ts CHANGED
@@ -22,7 +22,7 @@ const serverSchema = new Schema(
22
22
  },
23
23
  domain: {
24
24
  required: false,
25
- type: String
25
+ type: String,
26
26
  },
27
27
  webhook_url: String,
28
28
  ip_address: {
@@ -57,7 +57,7 @@ const serverSchema = new Schema(
57
57
  tag: String,
58
58
  firewall_id: {
59
59
  required: false,
60
- type: String
60
+ type: String,
61
61
  },
62
62
  specifications: {
63
63
  type: Object,
package/types/index.ts CHANGED
@@ -26,3 +26,4 @@ export { IPlanConfiguration } from "./plan_configuration";
26
26
  export { IAutoScalingGroup } from "./auto-scaling-group";
27
27
  export { IComputeChange } from "./compute";
28
28
  export { IRegion } from "./region";
29
+ export { IVolume } from "./volume";
@@ -3,6 +3,7 @@ import { SUBSCRIPTION_PLAN_TYPE } from "../enum";
3
3
 
4
4
  export interface IPlanConfiguration extends Document {
5
5
  tag: string;
6
+ price: number;
6
7
  slack_support: boolean;
7
8
  concurrent_builds: number;
8
9
  project_limit: number;
package/types/region.ts CHANGED
@@ -5,4 +5,4 @@ export interface IRegion extends Document {
5
5
  country: string;
6
6
  continent?: REGION_CONTINENT;
7
7
  enabled?: boolean;
8
- };
8
+ }
@@ -0,0 +1,16 @@
1
+ import { Document } from "mongoose";
2
+ import { IUser } from "./user";
3
+ import { ITeam } from "./team";
4
+ import { ISubscription } from "./subscription";
5
+ import { IRegion } from "./region";
6
+
7
+ export interface IVolume extends Document {
8
+ name: string;
9
+ user?: IUser;
10
+ team?: ITeam;
11
+ subscription: ISubscription;
12
+ size: number;
13
+ mount_path?: string;
14
+ created_at?: Date;
15
+ updated_at?: Date;
16
+ }
package/volume.ts ADDED
@@ -0,0 +1,36 @@
1
+ import { model, Schema } from "mongoose";
2
+
3
+ import { IVolume } from "./types";
4
+
5
+ const volumeSchema: Schema = new Schema(
6
+ {
7
+ name: String,
8
+ user: {
9
+ type: Schema.Types.ObjectId,
10
+ required: false,
11
+ ref: "User",
12
+ default: null,
13
+ },
14
+ team: {
15
+ type: Schema.Types.ObjectId,
16
+ required: false,
17
+ ref: "Team",
18
+ default: null,
19
+ },
20
+ subscription: {
21
+ type: Schema.Types.ObjectId,
22
+ required: true,
23
+ ref: "Subscription",
24
+ },
25
+ size: { type: Number, required: true },
26
+ mount_path: { type: String },
27
+ },
28
+ {
29
+ timestamps: {
30
+ createdAt: "created_at",
31
+ updatedAt: "updated_at",
32
+ },
33
+ },
34
+ );
35
+
36
+ export default model<IVolume>("Volume", volumeSchema);