@brimble/models 1.4.60 → 1.4.61
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/.turbo/turbo-build.log +2 -0
- package/dist/enum/index.d.ts +4 -0
- package/dist/enum/index.js +6 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -1
- package/dist/server.d.ts +4 -0
- package/dist/server.js +23 -0
- package/dist/tenancy.d.ts +4 -0
- package/dist/tenancy.js +22 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/server.d.ts +9 -0
- package/dist/types/server.js +2 -0
- package/dist/types/tenancy.d.ts +11 -0
- package/dist/types/tenancy.js +2 -0
- package/enum/index.ts +5 -0
- package/index.ts +3 -0
- package/package.json +2 -2
- package/server.ts +27 -0
- package/tenancy.ts +26 -0
- package/types/index.ts +2 -0
- package/types/server.ts +14 -0
- package/types/tenancy.ts +16 -0
package/.turbo/turbo-build.log
CHANGED
package/dist/enum/index.d.ts
CHANGED
package/dist/enum/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OAUTH_PERMISSIONS = exports.SUBSCRIPTION_STATUS = exports.PROJECT_STATUS = exports.CARD_TYPES = exports.ROLES = exports.INTEGRATION_PROVIDERS = exports.INTEGRATION_TYPES = exports.ENVIRONMENT = exports.GIT_TYPE = void 0;
|
|
3
|
+
exports.SERVER_STATUS = exports.OAUTH_PERMISSIONS = exports.SUBSCRIPTION_STATUS = exports.PROJECT_STATUS = exports.CARD_TYPES = exports.ROLES = exports.INTEGRATION_PROVIDERS = exports.INTEGRATION_TYPES = exports.ENVIRONMENT = exports.GIT_TYPE = void 0;
|
|
4
4
|
var GIT_TYPE;
|
|
5
5
|
(function (GIT_TYPE) {
|
|
6
6
|
GIT_TYPE["GITHUB"] = "GITHUB";
|
|
@@ -66,3 +66,8 @@ var OAUTH_PERMISSIONS;
|
|
|
66
66
|
OAUTH_PERMISSIONS["READ_PROJECT"] = "read_project";
|
|
67
67
|
OAUTH_PERMISSIONS["UPDATE_CREDENTIALS"] = "update_credentials";
|
|
68
68
|
})(OAUTH_PERMISSIONS = exports.OAUTH_PERMISSIONS || (exports.OAUTH_PERMISSIONS = {}));
|
|
69
|
+
var SERVER_STATUS;
|
|
70
|
+
(function (SERVER_STATUS) {
|
|
71
|
+
SERVER_STATUS["Active"] = "active";
|
|
72
|
+
SERVER_STATUS["InActive"] = "in-active";
|
|
73
|
+
})(SERVER_STATUS = exports.SERVER_STATUS || (exports.SERVER_STATUS = {}));
|
package/dist/index.d.ts
CHANGED
|
@@ -10,8 +10,8 @@ export { default as Member } from "./member";
|
|
|
10
10
|
export { default as Log } from "./logs";
|
|
11
11
|
export { default as SubscriptionPlan } from "./subscription_plan";
|
|
12
12
|
export { default as Card } from "./card";
|
|
13
|
-
export { IUser, IGit, IProject, IFollowing, IIntegration, IEnv, IDomain, IToken, IMember, ITeam, IInstalledIntegration, ILog, ISubscriptionPlan, ICard } from "./types";
|
|
14
|
-
export { GIT_TYPE, INTEGRATION_TYPES, INTEGRATION_PROVIDERS, OAUTH_PERMISSIONS, ENVIRONMENT, ROLES, PROJECT_STATUS, SUBSCRIPTION_STATUS, CARD_TYPES } from "./enum";
|
|
13
|
+
export { IUser, IGit, IProject, IFollowing, IIntegration, IEnv, IServer, ITenancy, IDomain, IToken, IMember, ITeam, IInstalledIntegration, ILog, ISubscriptionPlan, ICard } from "./types";
|
|
14
|
+
export { GIT_TYPE, INTEGRATION_TYPES, INTEGRATION_PROVIDERS, OAUTH_PERMISSIONS, ENVIRONMENT, SERVER_STATUS, ROLES, PROJECT_STATUS, SUBSCRIPTION_STATUS, CARD_TYPES } from "./enum";
|
|
15
15
|
import mongoose from "mongoose";
|
|
16
16
|
export declare const connectToMongo: (mongoUrl: string, retryCount?: number) => Promise<void>;
|
|
17
17
|
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.CARD_TYPES = exports.SUBSCRIPTION_STATUS = exports.PROJECT_STATUS = exports.ROLES = exports.ENVIRONMENT = exports.OAUTH_PERMISSIONS = exports.INTEGRATION_PROVIDERS = exports.INTEGRATION_TYPES = exports.GIT_TYPE = exports.Card = exports.SubscriptionPlan = exports.Log = exports.Member = exports.Team = exports.Token = exports.Env = exports.Domain = exports.Integration = exports.Following = exports.Project = exports.User = void 0;
|
|
15
|
+
exports.closeMongo = exports.db = exports.connectToMongo = exports.CARD_TYPES = exports.SUBSCRIPTION_STATUS = exports.PROJECT_STATUS = exports.ROLES = exports.SERVER_STATUS = exports.ENVIRONMENT = exports.OAUTH_PERMISSIONS = exports.INTEGRATION_PROVIDERS = exports.INTEGRATION_TYPES = exports.GIT_TYPE = exports.Card = exports.SubscriptionPlan = exports.Log = exports.Member = exports.Team = exports.Token = exports.Env = exports.Domain = exports.Integration = exports.Following = 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");
|
|
@@ -43,6 +43,7 @@ Object.defineProperty(exports, "INTEGRATION_TYPES", { enumerable: true, get: fun
|
|
|
43
43
|
Object.defineProperty(exports, "INTEGRATION_PROVIDERS", { enumerable: true, get: function () { return enum_1.INTEGRATION_PROVIDERS; } });
|
|
44
44
|
Object.defineProperty(exports, "OAUTH_PERMISSIONS", { enumerable: true, get: function () { return enum_1.OAUTH_PERMISSIONS; } });
|
|
45
45
|
Object.defineProperty(exports, "ENVIRONMENT", { enumerable: true, get: function () { return enum_1.ENVIRONMENT; } });
|
|
46
|
+
Object.defineProperty(exports, "SERVER_STATUS", { enumerable: true, get: function () { return enum_1.SERVER_STATUS; } });
|
|
46
47
|
Object.defineProperty(exports, "ROLES", { enumerable: true, get: function () { return enum_1.ROLES; } });
|
|
47
48
|
Object.defineProperty(exports, "PROJECT_STATUS", { enumerable: true, get: function () { return enum_1.PROJECT_STATUS; } });
|
|
48
49
|
Object.defineProperty(exports, "SUBSCRIPTION_STATUS", { enumerable: true, get: function () { return enum_1.SUBSCRIPTION_STATUS; } });
|
package/dist/server.d.ts
ADDED
package/dist/server.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mongoose_1 = require("mongoose");
|
|
4
|
+
const enum_1 = require("./enum");
|
|
5
|
+
const tenancySchema = new mongoose_1.Schema({
|
|
6
|
+
name: {
|
|
7
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
8
|
+
ref: "User",
|
|
9
|
+
required: true,
|
|
10
|
+
},
|
|
11
|
+
ip_address: {
|
|
12
|
+
ref: "Team",
|
|
13
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
14
|
+
},
|
|
15
|
+
provider_id: String,
|
|
16
|
+
status: {
|
|
17
|
+
type: String,
|
|
18
|
+
enum: Object.values(enum_1.SERVER_STATUS),
|
|
19
|
+
default: enum_1.SERVER_STATUS.Active,
|
|
20
|
+
},
|
|
21
|
+
size: Number
|
|
22
|
+
}, { timestamps: true });
|
|
23
|
+
exports.default = (0, mongoose_1.model)("Tenancy", tenancySchema);
|
package/dist/tenancy.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mongoose_1 = require("mongoose");
|
|
4
|
+
const tenancySchema = new mongoose_1.Schema({
|
|
5
|
+
user: {
|
|
6
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
7
|
+
ref: "User",
|
|
8
|
+
required: true,
|
|
9
|
+
},
|
|
10
|
+
team: {
|
|
11
|
+
ref: "Team",
|
|
12
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
13
|
+
},
|
|
14
|
+
server: {
|
|
15
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
16
|
+
ref: "Server",
|
|
17
|
+
required: true,
|
|
18
|
+
},
|
|
19
|
+
storage_size: Number,
|
|
20
|
+
memory: Number
|
|
21
|
+
}, { timestamps: true });
|
|
22
|
+
exports.default = (0, mongoose_1.model)("Tenancy", tenancySchema);
|
package/dist/types/index.d.ts
CHANGED
|
@@ -12,3 +12,5 @@ export { IInstalledIntegration } from "./installed_integration";
|
|
|
12
12
|
export { ILog } from "./logs";
|
|
13
13
|
export { ISubscriptionPlan } from "./subscription_plan";
|
|
14
14
|
export { ICard } from "./card";
|
|
15
|
+
export { ITenancy } from "./tenancy";
|
|
16
|
+
export { IServer } from "./server";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Document } from "mongoose";
|
|
2
|
+
import { IServer } from "./server";
|
|
3
|
+
import { ITeam } from "./team";
|
|
4
|
+
import { IUser } from "./user";
|
|
5
|
+
export interface ITenancy extends Document {
|
|
6
|
+
user: IUser;
|
|
7
|
+
team: ITeam;
|
|
8
|
+
server: IServer;
|
|
9
|
+
memory: number;
|
|
10
|
+
storage: number;
|
|
11
|
+
}
|
package/enum/index.ts
CHANGED
package/index.ts
CHANGED
|
@@ -17,6 +17,8 @@ export {
|
|
|
17
17
|
IFollowing,
|
|
18
18
|
IIntegration,
|
|
19
19
|
IEnv,
|
|
20
|
+
IServer,
|
|
21
|
+
ITenancy,
|
|
20
22
|
IDomain,
|
|
21
23
|
IToken,
|
|
22
24
|
IMember,
|
|
@@ -32,6 +34,7 @@ export {
|
|
|
32
34
|
INTEGRATION_PROVIDERS,
|
|
33
35
|
OAUTH_PERMISSIONS,
|
|
34
36
|
ENVIRONMENT,
|
|
37
|
+
SERVER_STATUS,
|
|
35
38
|
ROLES,
|
|
36
39
|
PROJECT_STATUS,
|
|
37
40
|
SUBSCRIPTION_STATUS,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brimble/models",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.61",
|
|
4
4
|
"description": "Brimble models",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -21,5 +21,5 @@
|
|
|
21
21
|
"ts-node": "^8.10.2",
|
|
22
22
|
"typescript": "^4.9.4"
|
|
23
23
|
},
|
|
24
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "1defa1702bd952b9013e004e19787a2d0ecca532"
|
|
25
25
|
}
|
package/server.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { model, Schema } from "mongoose";
|
|
2
|
+
import { ITenancy } from "./types";
|
|
3
|
+
import { SERVER_STATUS } from "./enum";
|
|
4
|
+
|
|
5
|
+
const tenancySchema = new Schema(
|
|
6
|
+
{
|
|
7
|
+
name: {
|
|
8
|
+
type: Schema.Types.ObjectId,
|
|
9
|
+
ref: "User",
|
|
10
|
+
required: true,
|
|
11
|
+
},
|
|
12
|
+
ip_address: {
|
|
13
|
+
ref: "Team",
|
|
14
|
+
type: Schema.Types.ObjectId,
|
|
15
|
+
},
|
|
16
|
+
provider_id: String,
|
|
17
|
+
status: {
|
|
18
|
+
type: String,
|
|
19
|
+
enum: Object.values(SERVER_STATUS),
|
|
20
|
+
default: SERVER_STATUS.Active,
|
|
21
|
+
},
|
|
22
|
+
size: Number
|
|
23
|
+
},
|
|
24
|
+
{ timestamps: true },
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
export default model<ITenancy>("Tenancy", tenancySchema);
|
package/tenancy.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { model, Schema } from "mongoose";
|
|
2
|
+
import { ITenancy } from "./types";
|
|
3
|
+
|
|
4
|
+
const tenancySchema = new Schema(
|
|
5
|
+
{
|
|
6
|
+
user: {
|
|
7
|
+
type: Schema.Types.ObjectId,
|
|
8
|
+
ref: "User",
|
|
9
|
+
required: true,
|
|
10
|
+
},
|
|
11
|
+
team: {
|
|
12
|
+
ref: "Team",
|
|
13
|
+
type: Schema.Types.ObjectId,
|
|
14
|
+
},
|
|
15
|
+
server: {
|
|
16
|
+
type: Schema.Types.ObjectId,
|
|
17
|
+
ref: "Server",
|
|
18
|
+
required: true,
|
|
19
|
+
},
|
|
20
|
+
storage_size: Number,
|
|
21
|
+
memory: Number
|
|
22
|
+
},
|
|
23
|
+
{ timestamps: true },
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
export default model<ITenancy>("Tenancy", tenancySchema);
|
package/types/index.ts
CHANGED
|
@@ -12,3 +12,5 @@ export { IInstalledIntegration } from "./installed_integration";
|
|
|
12
12
|
export { ILog } from "./logs";
|
|
13
13
|
export { ISubscriptionPlan } from "./subscription_plan";
|
|
14
14
|
export { ICard } from "./card";
|
|
15
|
+
export { ITenancy } from "./tenancy";
|
|
16
|
+
export { IServer } from "./server";
|
package/types/server.ts
ADDED
package/types/tenancy.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Document } from "mongoose";
|
|
2
|
+
import { IServer } from "./server";
|
|
3
|
+
import { ITeam } from "./team";
|
|
4
|
+
import { IUser } from "./user";
|
|
5
|
+
|
|
6
|
+
export interface ITenancy extends Document {
|
|
7
|
+
user: IUser;
|
|
8
|
+
|
|
9
|
+
team: ITeam;
|
|
10
|
+
|
|
11
|
+
server: IServer;
|
|
12
|
+
|
|
13
|
+
memory: number;
|
|
14
|
+
|
|
15
|
+
storage: number;
|
|
16
|
+
}
|