@brimble/models 3.2.5 → 3.2.7

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.
@@ -5,6 +5,12 @@ export declare enum GIT_TYPE {
5
5
  DOCKER = "DOCKER",
6
6
  HUGGING_FACE = "HUGGINGFACE"
7
7
  }
8
+ export declare enum SERVER_PROTOCOL {
9
+ TCP = "TCP",
10
+ UDP = "UDP",
11
+ HTTP = "HTTP",
12
+ HTTPS = "HTTPS"
13
+ }
8
14
  export declare enum BUILD_DISABLED_BY {
9
15
  System = "system",
10
16
  User = "user"
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FrameworkApplicationType = exports.SCALING_METRIC = exports.SCALING_STRATEGY = exports.LicenseStatus = exports.JobStatus = exports.DatabaseEngine = exports.ServiceType = exports.REGION_CONTINENT = exports.PERMISSION_TYPE = exports.ROLES = exports.DNS_TYPE = exports.SERVER_STATUS = exports.OAUTH_PERMISSIONS = exports.SUBSCRIPTION_PLAN_TYPE = exports.SUBSCRIPTION_STATUS = exports.PROJECT_STATUS = exports.CARD_TYPES = exports.INTEGRATION_PROVIDERS = exports.INTEGRATION_TYPES = exports.ENVIRONMENT = exports.REQUEST_TYPE = exports.BUILD_DISABLED_BY = exports.GIT_TYPE = void 0;
3
+ exports.FrameworkApplicationType = exports.SCALING_METRIC = exports.SCALING_STRATEGY = exports.LicenseStatus = exports.JobStatus = exports.DatabaseEngine = exports.ServiceType = exports.REGION_CONTINENT = exports.PERMISSION_TYPE = exports.ROLES = exports.DNS_TYPE = exports.SERVER_STATUS = exports.OAUTH_PERMISSIONS = exports.SUBSCRIPTION_PLAN_TYPE = exports.SUBSCRIPTION_STATUS = exports.PROJECT_STATUS = exports.CARD_TYPES = exports.INTEGRATION_PROVIDERS = exports.INTEGRATION_TYPES = exports.ENVIRONMENT = exports.REQUEST_TYPE = exports.BUILD_DISABLED_BY = exports.SERVER_PROTOCOL = exports.GIT_TYPE = void 0;
4
4
  var GIT_TYPE;
5
5
  (function (GIT_TYPE) {
6
6
  GIT_TYPE["GITHUB"] = "GITHUB";
@@ -9,6 +9,13 @@ var GIT_TYPE;
9
9
  GIT_TYPE["DOCKER"] = "DOCKER";
10
10
  GIT_TYPE["HUGGING_FACE"] = "HUGGINGFACE";
11
11
  })(GIT_TYPE = exports.GIT_TYPE || (exports.GIT_TYPE = {}));
12
+ var SERVER_PROTOCOL;
13
+ (function (SERVER_PROTOCOL) {
14
+ SERVER_PROTOCOL["TCP"] = "TCP";
15
+ SERVER_PROTOCOL["UDP"] = "UDP";
16
+ SERVER_PROTOCOL["HTTP"] = "HTTP";
17
+ SERVER_PROTOCOL["HTTPS"] = "HTTPS";
18
+ })(SERVER_PROTOCOL = exports.SERVER_PROTOCOL || (exports.SERVER_PROTOCOL = {}));
12
19
  var BUILD_DISABLED_BY;
13
20
  (function (BUILD_DISABLED_BY) {
14
21
  BUILD_DISABLED_BY["System"] = "system";
package/dist/index.d.ts CHANGED
@@ -29,7 +29,7 @@ export { default as Volume } from "./volume";
29
29
  export { default as Framework } from "./framework";
30
30
  export { default as LoadBalancerPort } from "./load-balancer-port";
31
31
  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, ILoadBalancerPort } from "./types";
32
- 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, FrameworkApplicationType } from "./enum";
32
+ 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";
33
33
  import mongoose from "mongoose";
34
34
  export declare const connectToMongo: (mongoUrl: string, config?: mongoose.ConnectOptions) => Promise<void>;
35
35
  export declare const db: mongoose.Connection;
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.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.LoadBalancerPort = 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.BUILD_DISABLED_BY = void 0;
16
+ exports.closeMongo = exports.db = exports.connectToMongo = exports.FrameworkApplicationType = exports.SERVER_PROTOCOL = exports.BUILD_DISABLED_BY = 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");
@@ -96,6 +96,7 @@ Object.defineProperty(exports, "JobStatus", { enumerable: true, get: function ()
96
96
  Object.defineProperty(exports, "LicenseStatus", { enumerable: true, get: function () { return enum_1.LicenseStatus; } });
97
97
  Object.defineProperty(exports, "REGION_CONTINENT", { enumerable: true, get: function () { return enum_1.REGION_CONTINENT; } });
98
98
  Object.defineProperty(exports, "BUILD_DISABLED_BY", { enumerable: true, get: function () { return enum_1.BUILD_DISABLED_BY; } });
99
+ Object.defineProperty(exports, "SERVER_PROTOCOL", { enumerable: true, get: function () { return enum_1.SERVER_PROTOCOL; } });
99
100
  Object.defineProperty(exports, "FrameworkApplicationType", { enumerable: true, get: function () { return enum_1.FrameworkApplicationType; } });
100
101
  const mongoose_1 = __importDefault(require("mongoose"));
101
102
  const utils_1 = require("@brimble/utils");
@@ -8,6 +8,12 @@ const loadBalancerPortSchema = new mongoose_1.Schema({
8
8
  min: 1,
9
9
  max: 65535,
10
10
  },
11
+ destination_port: {
12
+ type: Number,
13
+ required: true,
14
+ min: 1,
15
+ max: 65535,
16
+ },
11
17
  server_id: {
12
18
  type: mongoose_1.Schema.Types.ObjectId,
13
19
  ref: "Server",
package/dist/server.js CHANGED
@@ -43,6 +43,11 @@ const serverSchema = new mongoose_1.Schema({
43
43
  enum: Object.values(enum_1.SERVER_STATUS),
44
44
  default: enum_1.SERVER_STATUS.Active,
45
45
  },
46
+ protocol: {
47
+ type: String,
48
+ enum: Object.values(enum_1.SERVER_PROTOCOL),
49
+ default: enum_1.SERVER_PROTOCOL.TCP,
50
+ },
46
51
  default: Boolean,
47
52
  is_custom_provision: {
48
53
  type: Boolean,
@@ -3,6 +3,7 @@ import { IProject } from "./project";
3
3
  import { IServer } from "./server";
4
4
  export interface ILoadBalancerPort extends Document {
5
5
  port: number;
6
+ destination_port: number;
6
7
  server_id: IServer;
7
8
  project_id: IProject;
8
9
  createdAt: Date;
@@ -1,5 +1,5 @@
1
1
  import mongoose, { Document } from "mongoose";
2
- import { SERVER_STATUS } from "../enum";
2
+ import { SERVER_STATUS, SERVER_PROTOCOL } from "../enum";
3
3
  import { IRegion } from "./region";
4
4
  export interface IServer extends Document {
5
5
  name: string;
@@ -13,6 +13,7 @@ export interface IServer extends Document {
13
13
  private_ip_address: string;
14
14
  tunnel_token: string;
15
15
  type: string;
16
+ protocol: SERVER_PROTOCOL;
16
17
  status: SERVER_STATUS;
17
18
  default: boolean;
18
19
  tag: string;
package/enum/index.ts CHANGED
@@ -6,6 +6,13 @@ export enum GIT_TYPE {
6
6
  HUGGING_FACE = "HUGGINGFACE",
7
7
  }
8
8
 
9
+ export enum SERVER_PROTOCOL {
10
+ TCP = "TCP",
11
+ UDP = "UDP",
12
+ HTTP = "HTTP",
13
+ HTTPS = "HTTPS",
14
+ }
15
+
9
16
  export enum BUILD_DISABLED_BY {
10
17
  System = "system",
11
18
  User = "user",
package/index.ts CHANGED
@@ -85,7 +85,8 @@ export {
85
85
  LicenseStatus,
86
86
  REGION_CONTINENT,
87
87
  BUILD_DISABLED_BY,
88
- FrameworkApplicationType
88
+ SERVER_PROTOCOL,
89
+ FrameworkApplicationType,
89
90
  } from "./enum";
90
91
 
91
92
  import mongoose from "mongoose";
@@ -9,6 +9,12 @@ const loadBalancerPortSchema = new Schema(
9
9
  min: 1,
10
10
  max: 65535,
11
11
  },
12
+ destination_port: {
13
+ type: Number,
14
+ required: true,
15
+ min: 1,
16
+ max: 65535,
17
+ },
12
18
  server_id: {
13
19
  type: Schema.Types.ObjectId,
14
20
  ref: "Server",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brimble/models",
3
- "version": "3.2.5",
3
+ "version": "3.2.7",
4
4
  "description": "Brimble models",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/server.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { model, Schema } from "mongoose";
2
2
  import { IServer } from "./types";
3
- import { SERVER_STATUS } from "./enum";
3
+ import { SERVER_STATUS, SERVER_PROTOCOL } from "./enum";
4
4
 
5
5
  const serverSchema = new Schema(
6
6
  {
@@ -44,6 +44,11 @@ const serverSchema = new Schema(
44
44
  enum: Object.values(SERVER_STATUS),
45
45
  default: SERVER_STATUS.Active,
46
46
  },
47
+ protocol: {
48
+ type: String,
49
+ enum: Object.values(SERVER_PROTOCOL),
50
+ default: SERVER_PROTOCOL.TCP,
51
+ },
47
52
  default: Boolean,
48
53
  is_custom_provision: {
49
54
  type: Boolean,
@@ -4,6 +4,7 @@ import { IServer } from "./server";
4
4
 
5
5
  export interface ILoadBalancerPort extends Document {
6
6
  port: number;
7
+ destination_port: number;
7
8
  server_id: IServer;
8
9
  project_id: IProject;
9
10
  createdAt: Date;
package/types/server.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import mongoose, { Document } from "mongoose";
2
- import { SERVER_STATUS } from "../enum";
2
+ import { SERVER_STATUS, SERVER_PROTOCOL } from "../enum";
3
3
  import { IRegion } from "./region";
4
4
 
5
5
  export interface IServer extends Document {
@@ -25,6 +25,8 @@ export interface IServer extends Document {
25
25
 
26
26
  type: string;
27
27
 
28
+ protocol: SERVER_PROTOCOL;
29
+
28
30
  status: SERVER_STATUS;
29
31
 
30
32
  default: boolean;