@brimble/models 1.6.5 → 1.6.6

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.
File without changes
@@ -3,6 +3,12 @@ export declare enum GIT_TYPE {
3
3
  GITLAB = "GITLAB",
4
4
  BITBUCKET = "BITBUCKET"
5
5
  }
6
+ export declare enum REQUEST_TYPE {
7
+ GET = "GET",
8
+ PUT = "PUT",
9
+ POST = "POST",
10
+ DELETE = "DELETE"
11
+ }
6
12
  export declare enum ENVIRONMENT {
7
13
  PREVIEW = "PREVIEW",
8
14
  PRODUCTION = "PRODUCTION"
@@ -77,6 +83,6 @@ export declare enum PERMISSION_TYPE {
77
83
  DOMAIN = "DOMAIN",
78
84
  BILLING = "BILLING",
79
85
  PROJECT = "PROJECT",
80
- DNS = "DNS",
86
+ INTEGRATION = "INTEGRATION",
81
87
  USERS = "USERS"
82
88
  }
@@ -1,12 +1,19 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- 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.GIT_TYPE = void 0;
3
+ 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.GIT_TYPE = void 0;
4
4
  var GIT_TYPE;
5
5
  (function (GIT_TYPE) {
6
6
  GIT_TYPE["GITHUB"] = "GITHUB";
7
7
  GIT_TYPE["GITLAB"] = "GITLAB";
8
8
  GIT_TYPE["BITBUCKET"] = "BITBUCKET";
9
9
  })(GIT_TYPE = exports.GIT_TYPE || (exports.GIT_TYPE = {}));
10
+ var REQUEST_TYPE;
11
+ (function (REQUEST_TYPE) {
12
+ REQUEST_TYPE["GET"] = "GET";
13
+ REQUEST_TYPE["PUT"] = "PUT";
14
+ REQUEST_TYPE["POST"] = "POST";
15
+ REQUEST_TYPE["DELETE"] = "DELETE";
16
+ })(REQUEST_TYPE = exports.REQUEST_TYPE || (exports.REQUEST_TYPE = {}));
10
17
  var ENVIRONMENT;
11
18
  (function (ENVIRONMENT) {
12
19
  ENVIRONMENT["PREVIEW"] = "PREVIEW";
@@ -93,6 +100,6 @@ var PERMISSION_TYPE;
93
100
  PERMISSION_TYPE["DOMAIN"] = "DOMAIN";
94
101
  PERMISSION_TYPE["BILLING"] = "BILLING";
95
102
  PERMISSION_TYPE["PROJECT"] = "PROJECT";
96
- PERMISSION_TYPE["DNS"] = "DNS";
103
+ PERMISSION_TYPE["INTEGRATION"] = "INTEGRATION";
97
104
  PERMISSION_TYPE["USERS"] = "USERS";
98
105
  })(PERMISSION_TYPE = exports.PERMISSION_TYPE || (exports.PERMISSION_TYPE = {}));
@@ -5,6 +5,8 @@ const enum_1 = require("./enum");
5
5
  const permissionSchema = new mongoose_1.Schema({
6
6
  title: { type: String },
7
7
  role: [{ type: mongoose_1.Schema.Types.ObjectId, ref: 'Role' }],
8
- type: { type: String, enum: Object.values(enum_1.PERMISSION_TYPE) }
8
+ request: { type: Object },
9
+ type: { type: String, enum: Object.values(enum_1.PERMISSION_TYPE) },
10
+ enabled: { type: Boolean, default: false, select: true }
9
11
  });
10
12
  exports.default = (0, mongoose_1.model)("Permission", permissionSchema);
@@ -111,6 +111,5 @@ const projectSchema = new mongoose_1.Schema({
111
111
  },
112
112
  specs: Object,
113
113
  last_requested: mongoose_1.Schema.Types.Date,
114
- isPaused: Boolean,
115
114
  }, { timestamps: true });
116
115
  exports.default = (0, mongoose_1.model)("Project", projectSchema);
@@ -28,6 +28,5 @@ const previewsSchema = new mongoose_1.Schema({
28
28
  type: mongoose_1.Schema.Types.ObjectId,
29
29
  },
30
30
  last_requested: mongoose_1.Schema.Types.Date,
31
- isPaused: Boolean,
32
31
  }, { timestamps: true });
33
32
  exports.default = (0, mongoose_1.model)("Preview", previewsSchema);
package/dist/server.js CHANGED
@@ -4,14 +4,18 @@ const mongoose_1 = require("mongoose");
4
4
  const enum_1 = require("./enum");
5
5
  const serverSchema = new mongoose_1.Schema({
6
6
  name: {
7
- type: String,
7
+ type: mongoose_1.Schema.Types.ObjectId,
8
+ ref: "User",
8
9
  required: true,
9
10
  },
10
- ip_address: {
11
+ url: {
11
12
  type: String,
12
13
  required: true,
13
14
  },
14
- url: String,
15
+ ip_address: {
16
+ ref: "Team",
17
+ type: mongoose_1.Schema.Types.ObjectId,
18
+ },
15
19
  server_type: String,
16
20
  status: {
17
21
  type: String,
@@ -1,8 +1,13 @@
1
1
  import { Document } from "mongoose";
2
2
  import { IRole } from "./role";
3
- import { PERMISSION_TYPE } from "../enum";
3
+ import { PERMISSION_TYPE, REQUEST_TYPE } from "../enum";
4
4
  export interface IPermission extends Document {
5
5
  title: string;
6
6
  role: IRole[];
7
7
  type: PERMISSION_TYPE;
8
+ request: {
9
+ route: string;
10
+ type: REQUEST_TYPE;
11
+ };
12
+ enabled: boolean;
8
13
  }
@@ -59,5 +59,4 @@ export interface IProject extends Document {
59
59
  cpu: number;
60
60
  };
61
61
  last_requested: Date;
62
- isPaused: boolean;
63
62
  }
@@ -16,5 +16,4 @@ export interface IPreview extends Document {
16
16
  status: PROJECT_STATUS;
17
17
  log: ILog;
18
18
  last_requested: Date;
19
- isPaused: boolean;
20
19
  }
package/enum/index.ts CHANGED
@@ -4,6 +4,13 @@ export enum GIT_TYPE {
4
4
  BITBUCKET = "BITBUCKET",
5
5
  }
6
6
 
7
+ export enum REQUEST_TYPE {
8
+ GET = "GET",
9
+ PUT = "PUT",
10
+ POST = "POST",
11
+ DELETE = "DELETE"
12
+ }
13
+
7
14
  export enum ENVIRONMENT {
8
15
  PREVIEW = "PREVIEW",
9
16
  PRODUCTION = "PRODUCTION",
@@ -89,6 +96,6 @@ export enum PERMISSION_TYPE {
89
96
  DOMAIN = 'DOMAIN',
90
97
  BILLING = 'BILLING',
91
98
  PROJECT = 'PROJECT',
92
- DNS = 'DNS',
99
+ INTEGRATION = 'INTEGRATION',
93
100
  USERS = 'USERS'
94
101
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brimble/models",
3
- "version": "1.6.5",
3
+ "version": "1.6.6",
4
4
  "description": "Brimble models",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/permission.ts CHANGED
@@ -5,7 +5,9 @@ import { PERMISSION_TYPE } from "./enum";
5
5
  const permissionSchema = new Schema({
6
6
  title: { type: String },
7
7
  role: [{ type: Schema.Types.ObjectId, ref: 'Role' }],
8
- type: { type: String, enum: Object.values(PERMISSION_TYPE) }
8
+ request: { type: Object },
9
+ type: { type: String, enum: Object.values(PERMISSION_TYPE) },
10
+ enabled: { type: Boolean, default: false, select: true }
9
11
  });
10
12
 
11
13
  export default model<IPermission>("Permission", permissionSchema);
@@ -1,6 +1,6 @@
1
1
  import { Document } from "mongoose";
2
2
  import { IRole } from "./role";
3
- import { PERMISSION_TYPE } from "../enum";
3
+ import { PERMISSION_TYPE, REQUEST_TYPE } from "../enum";
4
4
 
5
5
  export interface IPermission extends Document {
6
6
  title: string;
@@ -8,4 +8,12 @@ export interface IPermission extends Document {
8
8
  role: IRole[];
9
9
 
10
10
  type: PERMISSION_TYPE;
11
+
12
+ request: {
13
+ route: string;
14
+
15
+ type: REQUEST_TYPE;
16
+ };
17
+
18
+ enabled: boolean;
11
19
  }
package/brimble.json DELETED
@@ -1,3 +0,0 @@
1
- {
2
- "project": {}
3
- }