@brimble/models 2.4.1 → 2.4.2
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/auto-scaling.ts +72 -0
- package/db-image.ts +6 -6
- package/dist/auto-scaling.d.ts +56 -0
- package/dist/auto-scaling.js +63 -0
- package/dist/domain/index.js +3 -3
- package/dist/enum/index.d.ts +12 -0
- package/dist/enum/index.js +15 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +3 -1
- package/dist/job.js +1 -1
- package/dist/license.js +19 -17
- package/dist/logs.js +2 -2
- package/dist/member-permission.js +3 -3
- package/dist/member.js +1 -1
- package/dist/permission.js +2 -2
- package/dist/plan_configuration.d.ts +2 -2
- package/dist/plan_configuration.js +6 -2
- package/dist/project/index.js +1 -1
- package/dist/role.js +1 -1
- package/dist/server.js +5 -5
- package/dist/subscription.js +4 -4
- package/dist/team.js +2 -2
- package/dist/types/auto-scaling-group.d.ts +15 -0
- package/dist/types/auto-scaling-group.js +2 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/user.js +2 -2
- package/dist/wallet.js +2 -2
- package/domain/index.ts +3 -3
- package/enum/index.ts +37 -23
- package/index.ts +6 -4
- package/job.ts +2 -3
- package/license.ts +57 -52
- package/logs.ts +2 -2
- package/member-permission.ts +7 -4
- package/member.ts +1 -1
- package/package.json +1 -1
- package/permission.ts +6 -6
- package/plan_configuration.ts +32 -21
- package/project/index.ts +1 -1
- package/role.ts +5 -5
- package/server.ts +8 -8
- package/subscription.ts +5 -5
- package/team.ts +2 -2
- package/types/auto-scaling-group.ts +16 -0
- package/types/db-image.ts +9 -9
- package/types/index.ts +3 -2
- package/types/job.ts +16 -16
- package/types/license.ts +14 -15
- package/types/member-permission.ts +4 -4
- package/types/plan_configuration.ts +16 -17
- package/types/role.ts +5 -5
- package/types/server.ts +2 -2
- package/types/subscription.ts +1 -1
- package/types/user.ts +1 -1
- package/user.ts +2 -2
- package/wallet.ts +6 -8
package/auto-scaling.ts
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { model, Schema } from "mongoose";
|
|
2
|
+
import { IAutoScalingGroup } from "./types";
|
|
3
|
+
|
|
4
|
+
const autoScalingGroupSchema = new Schema(
|
|
5
|
+
{
|
|
6
|
+
name: {
|
|
7
|
+
type: String,
|
|
8
|
+
required: true,
|
|
9
|
+
},
|
|
10
|
+
user_id: {
|
|
11
|
+
type: Schema.Types.ObjectId,
|
|
12
|
+
ref: "User",
|
|
13
|
+
required: true,
|
|
14
|
+
},
|
|
15
|
+
team_id: {
|
|
16
|
+
type: Schema.Types.ObjectId,
|
|
17
|
+
ref: "Team",
|
|
18
|
+
required: false,
|
|
19
|
+
},
|
|
20
|
+
subscription_id: {
|
|
21
|
+
type: Schema.Types.ObjectId,
|
|
22
|
+
ref: "Subscription",
|
|
23
|
+
required: true,
|
|
24
|
+
},
|
|
25
|
+
min_containers: {
|
|
26
|
+
type: Number,
|
|
27
|
+
required: true,
|
|
28
|
+
min: 1,
|
|
29
|
+
default: 1,
|
|
30
|
+
},
|
|
31
|
+
max_containers: {
|
|
32
|
+
type: Number,
|
|
33
|
+
required: true,
|
|
34
|
+
default: 10,
|
|
35
|
+
},
|
|
36
|
+
max_memory: {
|
|
37
|
+
type: Number,
|
|
38
|
+
required: false,
|
|
39
|
+
},
|
|
40
|
+
max_cpu: {
|
|
41
|
+
type: Number,
|
|
42
|
+
required: false,
|
|
43
|
+
},
|
|
44
|
+
min_application_response_time: {
|
|
45
|
+
type: Number,
|
|
46
|
+
required: true,
|
|
47
|
+
default: 5,
|
|
48
|
+
},
|
|
49
|
+
active: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
default: true,
|
|
52
|
+
},
|
|
53
|
+
meta: {
|
|
54
|
+
type: Object,
|
|
55
|
+
default: {},
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
timestamps: true,
|
|
60
|
+
collection: "autoscaling_groups",
|
|
61
|
+
},
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
autoScalingGroupSchema.index({ user_id: 1 });
|
|
65
|
+
autoScalingGroupSchema.index({ team_id: 1 });
|
|
66
|
+
autoScalingGroupSchema.index({ subscription_id: 1 });
|
|
67
|
+
|
|
68
|
+
export default model<IAutoScalingGroup>(
|
|
69
|
+
"AutoScalingGroup",
|
|
70
|
+
autoScalingGroupSchema,
|
|
71
|
+
"auto_scaling_groups",
|
|
72
|
+
);
|
package/db-image.ts
CHANGED
|
@@ -10,20 +10,20 @@ const dbImageSchema = new Schema(
|
|
|
10
10
|
required: true,
|
|
11
11
|
},
|
|
12
12
|
image_url: {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
type: String,
|
|
14
|
+
required: true,
|
|
15
15
|
},
|
|
16
16
|
image: {
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
type: String,
|
|
18
|
+
required: true,
|
|
19
19
|
},
|
|
20
20
|
version: {
|
|
21
21
|
type: String,
|
|
22
22
|
required: true,
|
|
23
23
|
},
|
|
24
24
|
envs: {
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
type: Array,
|
|
26
|
+
required: true,
|
|
27
27
|
},
|
|
28
28
|
is_available: {
|
|
29
29
|
type: Boolean,
|
|
@@ -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 { IAutoScalingGroup } from "./types";
|
|
53
|
+
declare const _default: import("mongoose").Model<IAutoScalingGroup, {}, {}, {}, import("mongoose").Document<unknown, {}, IAutoScalingGroup> & IAutoScalingGroup & Required<{
|
|
54
|
+
_id: import("mongoose").Types.ObjectId;
|
|
55
|
+
}>, any>;
|
|
56
|
+
export default _default;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mongoose_1 = require("mongoose");
|
|
4
|
+
const autoScalingGroupSchema = new mongoose_1.Schema({
|
|
5
|
+
name: {
|
|
6
|
+
type: String,
|
|
7
|
+
required: true,
|
|
8
|
+
},
|
|
9
|
+
user_id: {
|
|
10
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
11
|
+
ref: "User",
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
team_id: {
|
|
15
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
16
|
+
ref: "Team",
|
|
17
|
+
required: false,
|
|
18
|
+
},
|
|
19
|
+
subscription_id: {
|
|
20
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
21
|
+
ref: "Subscription",
|
|
22
|
+
required: true,
|
|
23
|
+
},
|
|
24
|
+
min_containers: {
|
|
25
|
+
type: Number,
|
|
26
|
+
required: true,
|
|
27
|
+
min: 1,
|
|
28
|
+
default: 1,
|
|
29
|
+
},
|
|
30
|
+
max_containers: {
|
|
31
|
+
type: Number,
|
|
32
|
+
required: true,
|
|
33
|
+
default: 10,
|
|
34
|
+
},
|
|
35
|
+
max_memory: {
|
|
36
|
+
type: Number,
|
|
37
|
+
required: false,
|
|
38
|
+
},
|
|
39
|
+
max_cpu: {
|
|
40
|
+
type: Number,
|
|
41
|
+
required: false,
|
|
42
|
+
},
|
|
43
|
+
min_application_response_time: {
|
|
44
|
+
type: Number,
|
|
45
|
+
required: true,
|
|
46
|
+
default: 5,
|
|
47
|
+
},
|
|
48
|
+
active: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: true,
|
|
51
|
+
},
|
|
52
|
+
meta: {
|
|
53
|
+
type: Object,
|
|
54
|
+
default: {},
|
|
55
|
+
},
|
|
56
|
+
}, {
|
|
57
|
+
timestamps: true,
|
|
58
|
+
collection: "autoscaling_groups",
|
|
59
|
+
});
|
|
60
|
+
autoScalingGroupSchema.index({ user_id: 1 });
|
|
61
|
+
autoScalingGroupSchema.index({ team_id: 1 });
|
|
62
|
+
autoScalingGroupSchema.index({ subscription_id: 1 });
|
|
63
|
+
exports.default = (0, mongoose_1.model)("AutoScalingGroup", autoScalingGroupSchema, "auto_scaling_groups");
|
package/dist/domain/index.js
CHANGED
|
@@ -58,13 +58,13 @@ const domainSchema = new mongoose_1.Schema({
|
|
|
58
58
|
},
|
|
59
59
|
trigger_created: {
|
|
60
60
|
type: Boolean,
|
|
61
|
-
default: false
|
|
61
|
+
default: false,
|
|
62
62
|
},
|
|
63
63
|
trigger_created_at: {
|
|
64
|
-
type: String
|
|
64
|
+
type: String,
|
|
65
65
|
},
|
|
66
66
|
job_identifier: {
|
|
67
|
-
type: String
|
|
67
|
+
type: String,
|
|
68
68
|
},
|
|
69
69
|
dns: [
|
|
70
70
|
{
|
package/dist/enum/index.d.ts
CHANGED
|
@@ -115,3 +115,15 @@ export declare enum LicenseStatus {
|
|
|
115
115
|
SUSPENDED = "SUSPENDED",
|
|
116
116
|
REVOKED = "REVOKED"
|
|
117
117
|
}
|
|
118
|
+
export declare enum SCALING_STRATEGY {
|
|
119
|
+
Linear = "LINEAR",
|
|
120
|
+
Exponential = "EXPONENTIAL",
|
|
121
|
+
Target = "TARGET"
|
|
122
|
+
}
|
|
123
|
+
export declare enum SCALING_METRIC {
|
|
124
|
+
Cpu = "CPU",
|
|
125
|
+
Memory = "MEMORY",
|
|
126
|
+
RequestCount = "REQUEST_COUNT",
|
|
127
|
+
ResponseTime = "RESPONSE_TIME",
|
|
128
|
+
CustomMetric = "CUSTOM_METRIC"
|
|
129
|
+
}
|
package/dist/enum/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LicenseStatus = exports.JobStatus = exports.DatabaseEngine = exports.ServiceType = 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;
|
|
3
|
+
exports.SCALING_METRIC = exports.SCALING_STRATEGY = exports.LicenseStatus = exports.JobStatus = exports.DatabaseEngine = exports.ServiceType = 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";
|
|
@@ -136,3 +136,17 @@ var LicenseStatus;
|
|
|
136
136
|
LicenseStatus["SUSPENDED"] = "SUSPENDED";
|
|
137
137
|
LicenseStatus["REVOKED"] = "REVOKED";
|
|
138
138
|
})(LicenseStatus = exports.LicenseStatus || (exports.LicenseStatus = {}));
|
|
139
|
+
var SCALING_STRATEGY;
|
|
140
|
+
(function (SCALING_STRATEGY) {
|
|
141
|
+
SCALING_STRATEGY["Linear"] = "LINEAR";
|
|
142
|
+
SCALING_STRATEGY["Exponential"] = "EXPONENTIAL";
|
|
143
|
+
SCALING_STRATEGY["Target"] = "TARGET";
|
|
144
|
+
})(SCALING_STRATEGY = exports.SCALING_STRATEGY || (exports.SCALING_STRATEGY = {}));
|
|
145
|
+
var SCALING_METRIC;
|
|
146
|
+
(function (SCALING_METRIC) {
|
|
147
|
+
SCALING_METRIC["Cpu"] = "CPU";
|
|
148
|
+
SCALING_METRIC["Memory"] = "MEMORY";
|
|
149
|
+
SCALING_METRIC["RequestCount"] = "REQUEST_COUNT";
|
|
150
|
+
SCALING_METRIC["ResponseTime"] = "RESPONSE_TIME";
|
|
151
|
+
SCALING_METRIC["CustomMetric"] = "CUSTOM_METRIC";
|
|
152
|
+
})(SCALING_METRIC = exports.SCALING_METRIC || (exports.SCALING_METRIC = {}));
|
package/dist/index.d.ts
CHANGED
|
@@ -21,8 +21,9 @@ export { default as DbImage } from "./db-image";
|
|
|
21
21
|
export { default as Job } from "./job";
|
|
22
22
|
export { default as Liscense } from "./license";
|
|
23
23
|
export { default as PlanConfiguration } from "./plan_configuration";
|
|
24
|
-
export {
|
|
25
|
-
export {
|
|
24
|
+
export { default as AutoScalingGroup } from "./auto-scaling";
|
|
25
|
+
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 } from "./types";
|
|
26
|
+
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, } from "./enum";
|
|
26
27
|
import mongoose from "mongoose";
|
|
27
28
|
export declare const connectToMongo: (mongoUrl: string, config?: mongoose.ConnectOptions) => Promise<void>;
|
|
28
29
|
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.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.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.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.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");
|
|
@@ -60,6 +60,8 @@ var license_1 = require("./license");
|
|
|
60
60
|
Object.defineProperty(exports, "Liscense", { enumerable: true, get: function () { return __importDefault(license_1).default; } });
|
|
61
61
|
var plan_configuration_1 = require("./plan_configuration");
|
|
62
62
|
Object.defineProperty(exports, "PlanConfiguration", { enumerable: true, get: function () { return __importDefault(plan_configuration_1).default; } });
|
|
63
|
+
var auto_scaling_1 = require("./auto-scaling");
|
|
64
|
+
Object.defineProperty(exports, "AutoScalingGroup", { enumerable: true, get: function () { return __importDefault(auto_scaling_1).default; } });
|
|
63
65
|
var enum_1 = require("./enum");
|
|
64
66
|
Object.defineProperty(exports, "GIT_TYPE", { enumerable: true, get: function () { return enum_1.GIT_TYPE; } });
|
|
65
67
|
Object.defineProperty(exports, "INTEGRATION_TYPES", { enumerable: true, get: function () { return enum_1.INTEGRATION_TYPES; } });
|
package/dist/job.js
CHANGED
|
@@ -49,4 +49,4 @@ const jobSchema = new mongoose_1.Schema({
|
|
|
49
49
|
createdAt: { type: Date, default: Date.now },
|
|
50
50
|
updatedAt: { type: Date, default: Date.now },
|
|
51
51
|
});
|
|
52
|
-
exports.default = (0, mongoose_1.model)(
|
|
52
|
+
exports.default = (0, mongoose_1.model)("Job", jobSchema, "scheduled_jobs");
|
package/dist/license.js
CHANGED
|
@@ -15,50 +15,52 @@ const licenseSchema = new mongoose_1.Schema({
|
|
|
15
15
|
licenseKey: {
|
|
16
16
|
type: String,
|
|
17
17
|
required: true,
|
|
18
|
-
unique: true
|
|
18
|
+
unique: true,
|
|
19
19
|
},
|
|
20
20
|
infisicalIdentity: String,
|
|
21
21
|
userId: {
|
|
22
22
|
type: mongoose_1.Schema.Types.ObjectId,
|
|
23
|
-
ref:
|
|
24
|
-
required: true
|
|
23
|
+
ref: "User",
|
|
24
|
+
required: true,
|
|
25
25
|
},
|
|
26
26
|
teamId: {
|
|
27
27
|
type: mongoose_1.Schema.Types.ObjectId,
|
|
28
|
-
ref:
|
|
29
|
-
required: false
|
|
28
|
+
ref: "Team",
|
|
29
|
+
required: false,
|
|
30
30
|
},
|
|
31
31
|
subscriptionId: {
|
|
32
32
|
type: mongoose_1.Schema.Types.ObjectId,
|
|
33
|
-
ref:
|
|
34
|
-
required: true
|
|
33
|
+
ref: "Subscription",
|
|
34
|
+
required: true,
|
|
35
35
|
},
|
|
36
36
|
status: {
|
|
37
37
|
type: String,
|
|
38
38
|
enum: Object.values(enum_1.LicenseStatus),
|
|
39
|
-
default: enum_1.LicenseStatus.ACTIVE
|
|
39
|
+
default: enum_1.LicenseStatus.ACTIVE,
|
|
40
40
|
},
|
|
41
41
|
tag: String,
|
|
42
|
-
devices: [
|
|
42
|
+
devices: [
|
|
43
|
+
{
|
|
43
44
|
deviceId: {
|
|
44
45
|
type: String,
|
|
45
|
-
required: true
|
|
46
|
+
required: true,
|
|
46
47
|
},
|
|
47
48
|
hostname: String,
|
|
48
49
|
lastSeen: {
|
|
49
50
|
type: Date,
|
|
50
|
-
default: Date.now
|
|
51
|
+
default: Date.now,
|
|
51
52
|
},
|
|
52
53
|
isActive: {
|
|
53
54
|
type: Boolean,
|
|
54
|
-
default: true
|
|
55
|
-
}
|
|
56
|
-
}
|
|
55
|
+
default: true,
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
],
|
|
57
59
|
maxDevices: {
|
|
58
60
|
type: Number,
|
|
59
61
|
required: true,
|
|
60
|
-
default: 1
|
|
61
|
-
}
|
|
62
|
+
default: 1,
|
|
63
|
+
},
|
|
62
64
|
}, { timestamps: true });
|
|
63
65
|
// licenseSchema.index({ userId: 1, status: 1 });
|
|
64
66
|
// licenseSchema.index({ licenseKey: 1 });
|
|
@@ -70,4 +72,4 @@ licenseSchema.methods.cleanupInactiveDevices = function () {
|
|
|
70
72
|
yield this.save();
|
|
71
73
|
});
|
|
72
74
|
};
|
|
73
|
-
exports.default = (0, mongoose_1.model)(
|
|
75
|
+
exports.default = (0, mongoose_1.model)("License", licenseSchema, "licenses");
|
package/dist/logs.js
CHANGED
|
@@ -32,7 +32,7 @@ const LogSchema = new mongoose_1.Schema({
|
|
|
32
32
|
jobs: Array,
|
|
33
33
|
startTime: mongoose_1.Schema.Types.Date,
|
|
34
34
|
endTime: mongoose_1.Schema.Types.Date,
|
|
35
|
-
deleted: mongoose_1.Schema.Types.Boolean
|
|
35
|
+
deleted: mongoose_1.Schema.Types.Boolean,
|
|
36
36
|
}, { timestamps: true });
|
|
37
37
|
// LogSchema.plugin(softDeletePlugin);
|
|
38
|
-
exports.default = (0, mongoose_1.model)(
|
|
38
|
+
exports.default = (0, mongoose_1.model)("Log", LogSchema);
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const mongoose_1 = require("mongoose");
|
|
4
4
|
const memberPermissionSchema = new mongoose_1.Schema({
|
|
5
|
-
permission: { type: mongoose_1.Schema.Types.ObjectId, ref:
|
|
6
|
-
member: { type: mongoose_1.Schema.Types.ObjectId, ref:
|
|
7
|
-
enabled: { type: Boolean, default: false }
|
|
5
|
+
permission: { type: mongoose_1.Schema.Types.ObjectId, ref: "Permission" },
|
|
6
|
+
member: { type: mongoose_1.Schema.Types.ObjectId, ref: "Member" },
|
|
7
|
+
enabled: { type: Boolean, default: false },
|
|
8
8
|
});
|
|
9
9
|
exports.default = (0, mongoose_1.model)("MemberPermission", memberPermissionSchema);
|
package/dist/member.js
CHANGED
|
@@ -29,7 +29,7 @@ const memberSchema = new mongoose_1.Schema({
|
|
|
29
29
|
type: Boolean,
|
|
30
30
|
default: false,
|
|
31
31
|
},
|
|
32
|
-
permissions: [{ type: mongoose_1.Schema.Types.ObjectId, ref:
|
|
32
|
+
permissions: [{ type: mongoose_1.Schema.Types.ObjectId, ref: "MemberPermission" }],
|
|
33
33
|
}, {
|
|
34
34
|
timestamps: {
|
|
35
35
|
createdAt: "created_at",
|
package/dist/permission.js
CHANGED
|
@@ -4,9 +4,9 @@ const mongoose_1 = require("mongoose");
|
|
|
4
4
|
const enum_1 = require("./enum");
|
|
5
5
|
const permissionSchema = new mongoose_1.Schema({
|
|
6
6
|
title: { type: String },
|
|
7
|
-
role: [{ type: mongoose_1.Schema.Types.ObjectId, ref:
|
|
7
|
+
role: [{ type: mongoose_1.Schema.Types.ObjectId, ref: "Role" }],
|
|
8
8
|
request: { type: Object },
|
|
9
9
|
type: { type: String, enum: Object.values(enum_1.PERMISSION_TYPE) },
|
|
10
|
-
enabled: { type: Boolean, default: false, select: true }
|
|
10
|
+
enabled: { type: Boolean, default: false, select: true },
|
|
11
11
|
});
|
|
12
12
|
exports.default = (0, mongoose_1.model)("Permission", permissionSchema);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import mongoose from
|
|
2
|
-
import { IPlanConfiguration } from
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
import { IPlanConfiguration } from "./types/plan_configuration";
|
|
3
3
|
declare const _default: mongoose.Model<IPlanConfiguration, {}, {}, {}, mongoose.Document<unknown, {}, IPlanConfiguration> & IPlanConfiguration & {
|
|
4
4
|
_id: mongoose.Types.ObjectId;
|
|
5
5
|
}, any>;
|
|
@@ -13,10 +13,14 @@ 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
|
-
plan_type: {
|
|
16
|
+
plan_type: {
|
|
17
|
+
type: String,
|
|
18
|
+
enum: Object.values(enum_1.SUBSCRIPTION_PLAN_TYPE),
|
|
19
|
+
required: true,
|
|
20
|
+
},
|
|
17
21
|
memory: { type: Number, required: true },
|
|
18
22
|
build_timeout: { type: Number, required: true },
|
|
19
23
|
storage: { type: Number, required: true },
|
|
20
24
|
cpu: { type: Number, required: true },
|
|
21
25
|
}, { timestamps: true });
|
|
22
|
-
exports.default = (0, mongoose_1.model)(
|
|
26
|
+
exports.default = (0, mongoose_1.model)("PlanConfigurations", PlanConfigurationSchema, "plan_configurations");
|
package/dist/project/index.js
CHANGED
package/dist/role.js
CHANGED
|
@@ -6,6 +6,6 @@ const roleSchema = new mongoose_1.Schema({
|
|
|
6
6
|
type: { type: String, enum: Object.values(enum_1.ROLES) },
|
|
7
7
|
description: { type: String },
|
|
8
8
|
is_custom: { type: Boolean, default: false },
|
|
9
|
-
permissions: [{ type: mongoose_1.Schema.Types.ObjectId, ref:
|
|
9
|
+
permissions: [{ type: mongoose_1.Schema.Types.ObjectId, ref: "Permission" }],
|
|
10
10
|
});
|
|
11
11
|
exports.default = (0, mongoose_1.model)("Role", roleSchema);
|
package/dist/server.js
CHANGED
|
@@ -11,13 +11,13 @@ const serverSchema = new mongoose_1.Schema({
|
|
|
11
11
|
grpc_address: String,
|
|
12
12
|
userId: {
|
|
13
13
|
type: mongoose_1.Schema.Types.ObjectId,
|
|
14
|
-
ref:
|
|
15
|
-
required: true
|
|
14
|
+
ref: "User",
|
|
15
|
+
required: true,
|
|
16
16
|
},
|
|
17
17
|
teamId: {
|
|
18
18
|
type: mongoose_1.Schema.Types.ObjectId,
|
|
19
|
-
ref:
|
|
20
|
-
required: false
|
|
19
|
+
ref: "Team",
|
|
20
|
+
required: false,
|
|
21
21
|
},
|
|
22
22
|
webhook_url: String,
|
|
23
23
|
ip_address: {
|
|
@@ -31,7 +31,7 @@ const serverSchema = new mongoose_1.Schema({
|
|
|
31
31
|
},
|
|
32
32
|
tunnel_token: {
|
|
33
33
|
type: String,
|
|
34
|
-
required: false
|
|
34
|
+
required: false,
|
|
35
35
|
},
|
|
36
36
|
type: String,
|
|
37
37
|
status: {
|
package/dist/subscription.js
CHANGED
|
@@ -47,14 +47,14 @@ const subscriptionSchema = new mongoose_1.Schema({
|
|
|
47
47
|
transaction_retries: Number,
|
|
48
48
|
trigger_created: {
|
|
49
49
|
type: Boolean,
|
|
50
|
-
default: false
|
|
50
|
+
default: false,
|
|
51
51
|
},
|
|
52
52
|
trigger_created_at: {
|
|
53
|
-
type: String
|
|
53
|
+
type: String,
|
|
54
54
|
},
|
|
55
55
|
job_identifier: {
|
|
56
|
-
type: String
|
|
57
|
-
}
|
|
56
|
+
type: String,
|
|
57
|
+
},
|
|
58
58
|
}, {
|
|
59
59
|
timestamps: true,
|
|
60
60
|
collection: "subscriptions",
|
package/dist/team.js
CHANGED
|
@@ -27,13 +27,13 @@ const teamSchema = new mongoose_1.Schema({
|
|
|
27
27
|
},
|
|
28
28
|
build_disabled: {
|
|
29
29
|
type: Boolean,
|
|
30
|
-
default: false
|
|
30
|
+
default: false,
|
|
31
31
|
},
|
|
32
32
|
subscription: {
|
|
33
33
|
type: mongoose_1.Schema.Types.ObjectId,
|
|
34
34
|
required: false,
|
|
35
35
|
ref: "Subscription",
|
|
36
|
-
}
|
|
36
|
+
},
|
|
37
37
|
}, {
|
|
38
38
|
timestamps: true,
|
|
39
39
|
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Types } from "mongoose";
|
|
2
|
+
export interface IAutoScalingGroup extends Document {
|
|
3
|
+
_id: Types.ObjectId;
|
|
4
|
+
name: string;
|
|
5
|
+
user_id: Types.ObjectId;
|
|
6
|
+
team_id?: Types.ObjectId;
|
|
7
|
+
subscription_id: Types.ObjectId;
|
|
8
|
+
min_containers: number;
|
|
9
|
+
max_containers: number;
|
|
10
|
+
min_application_response_time: number;
|
|
11
|
+
active: boolean;
|
|
12
|
+
meta: Record<string, any>;
|
|
13
|
+
createdAt: Date;
|
|
14
|
+
updatedAt: Date;
|
|
15
|
+
}
|
package/dist/types/index.d.ts
CHANGED
package/dist/user.js
CHANGED
|
@@ -33,14 +33,14 @@ const userSchema = new mongoose_1.Schema({
|
|
|
33
33
|
build_disabled: {
|
|
34
34
|
type: Boolean,
|
|
35
35
|
default: false,
|
|
36
|
-
required: false
|
|
36
|
+
required: false,
|
|
37
37
|
},
|
|
38
38
|
tenant: { type: mongoose_1.Schema.Types.ObjectId, ref: "Tenancy", required: false },
|
|
39
39
|
is_waitlist: { type: Boolean, default: true },
|
|
40
40
|
spending_limit: { type: Number },
|
|
41
41
|
notifications: Object,
|
|
42
42
|
disabled: Boolean,
|
|
43
|
-
disabled_at: Date
|
|
43
|
+
disabled_at: Date,
|
|
44
44
|
}, {
|
|
45
45
|
timestamps: {
|
|
46
46
|
createdAt: "created_at",
|
package/dist/wallet.js
CHANGED
package/domain/index.ts
CHANGED
|
@@ -59,13 +59,13 @@ const domainSchema = new Schema(
|
|
|
59
59
|
},
|
|
60
60
|
trigger_created: {
|
|
61
61
|
type: Boolean,
|
|
62
|
-
default: false
|
|
62
|
+
default: false,
|
|
63
63
|
},
|
|
64
64
|
trigger_created_at: {
|
|
65
|
-
type: String
|
|
65
|
+
type: String,
|
|
66
66
|
},
|
|
67
67
|
job_identifier: {
|
|
68
|
-
type: String
|
|
68
|
+
type: String,
|
|
69
69
|
},
|
|
70
70
|
dns: [
|
|
71
71
|
{
|