@brimble/models 1.6.4 → 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.
- package/dist/enum/index.d.ts +6 -0
- package/dist/enum/index.js +8 -1
- package/dist/permission.js +3 -2
- package/dist/types/permission.d.ts +6 -2
- package/enum/index.ts +7 -0
- package/package.json +1 -1
- package/permission.ts +3 -2
- package/project/index.ts +1 -0
- package/project/preview.ts +1 -0
- package/server.ts +3 -16
- package/types/permission.ts +8 -2
- package/types/project/index.ts +1 -0
- package/types/project/preview.ts +1 -0
package/dist/enum/index.d.ts
CHANGED
|
@@ -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"
|
package/dist/enum/index.js
CHANGED
|
@@ -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";
|
package/dist/permission.js
CHANGED
|
@@ -5,7 +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
|
-
|
|
9
|
-
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 }
|
|
10
11
|
});
|
|
11
12
|
exports.default = (0, mongoose_1.model)("Permission", permissionSchema);
|
|
@@ -1,9 +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
|
-
|
|
8
|
+
request: {
|
|
9
|
+
route: string;
|
|
10
|
+
type: REQUEST_TYPE;
|
|
11
|
+
};
|
|
12
|
+
enabled: boolean;
|
|
9
13
|
}
|
package/enum/index.ts
CHANGED
package/package.json
CHANGED
package/permission.ts
CHANGED
|
@@ -5,8 +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
|
-
|
|
9
|
-
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 }
|
|
10
11
|
});
|
|
11
12
|
|
|
12
13
|
export default model<IPermission>("Permission", permissionSchema);
|
package/project/index.ts
CHANGED
package/project/preview.ts
CHANGED
package/server.ts
CHANGED
|
@@ -5,43 +5,30 @@ import { SERVER_STATUS } from "./enum";
|
|
|
5
5
|
const serverSchema = new Schema(
|
|
6
6
|
{
|
|
7
7
|
name: {
|
|
8
|
-
type: Schema.Types.ObjectId,
|
|
9
|
-
ref: "User",
|
|
10
|
-
required: true,
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
url: {
|
|
14
8
|
type: String,
|
|
15
9
|
required: true,
|
|
16
10
|
},
|
|
17
|
-
|
|
18
11
|
ip_address: {
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
type: String,
|
|
13
|
+
required: true,
|
|
21
14
|
},
|
|
22
|
-
|
|
15
|
+
url: String,
|
|
23
16
|
server_type: String,
|
|
24
|
-
|
|
25
17
|
status: {
|
|
26
18
|
type: String,
|
|
27
19
|
enum: Object.values(SERVER_STATUS),
|
|
28
20
|
default: SERVER_STATUS.Active,
|
|
29
21
|
},
|
|
30
|
-
|
|
31
22
|
default: Boolean,
|
|
32
|
-
|
|
33
23
|
is_custom_provision: {
|
|
34
24
|
type: Boolean,
|
|
35
25
|
default: true,
|
|
36
26
|
},
|
|
37
|
-
|
|
38
27
|
is_downscaled: {
|
|
39
28
|
type: Boolean,
|
|
40
29
|
default: false,
|
|
41
30
|
},
|
|
42
|
-
|
|
43
31
|
region: String,
|
|
44
|
-
|
|
45
32
|
tag: String,
|
|
46
33
|
},
|
|
47
34
|
{ timestamps: true },
|
package/types/permission.ts
CHANGED
|
@@ -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;
|
|
@@ -9,5 +9,11 @@ export interface IPermission extends Document {
|
|
|
9
9
|
|
|
10
10
|
type: PERMISSION_TYPE;
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
request: {
|
|
13
|
+
route: string;
|
|
14
|
+
|
|
15
|
+
type: REQUEST_TYPE;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
enabled: boolean;
|
|
13
19
|
}
|
package/types/project/index.ts
CHANGED