@brimble/models 2.4.1 → 2.4.3
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 +5 -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 +17 -0
- package/dist/types/auto-scaling-group.js +2 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/project/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 +5 -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 +18 -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/project/index.ts +1 -0
- 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/enum/index.ts
CHANGED
|
@@ -8,7 +8,7 @@ export enum REQUEST_TYPE {
|
|
|
8
8
|
GET = "GET",
|
|
9
9
|
PUT = "PUT",
|
|
10
10
|
POST = "POST",
|
|
11
|
-
DELETE = "DELETE"
|
|
11
|
+
DELETE = "DELETE",
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export enum ENVIRONMENT {
|
|
@@ -61,11 +61,11 @@ export enum SUBSCRIPTION_STATUS {
|
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
export enum SUBSCRIPTION_PLAN_TYPE {
|
|
64
|
-
FreePlan =
|
|
65
|
-
DeveloperPlan =
|
|
66
|
-
TeamPlan =
|
|
67
|
-
DatabasePlan =
|
|
68
|
-
LiscensePlan =
|
|
64
|
+
FreePlan = "FREE_PLAN",
|
|
65
|
+
DeveloperPlan = "DEVELOPER_PLAN",
|
|
66
|
+
TeamPlan = "TEAM_PLAN",
|
|
67
|
+
DatabasePlan = "DATABASE_PLAN",
|
|
68
|
+
LiscensePlan = "LISCENSE_PLAN",
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
export enum OAUTH_PERMISSIONS {
|
|
@@ -92,30 +92,30 @@ export enum DNS_TYPE {
|
|
|
92
92
|
export enum ROLES {
|
|
93
93
|
CREATOR = "CREATOR",
|
|
94
94
|
ADMINISTRATOR = "ADMINISTRATOR",
|
|
95
|
-
MEMBER = "MEMBER"
|
|
95
|
+
MEMBER = "MEMBER",
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
export enum PERMISSION_TYPE {
|
|
99
|
-
DOMAIN =
|
|
100
|
-
BILLING =
|
|
101
|
-
PROJECT =
|
|
102
|
-
INTEGRATION =
|
|
103
|
-
USERS =
|
|
99
|
+
DOMAIN = "DOMAIN",
|
|
100
|
+
BILLING = "BILLING",
|
|
101
|
+
PROJECT = "PROJECT",
|
|
102
|
+
INTEGRATION = "INTEGRATION",
|
|
103
|
+
USERS = "USERS",
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
export enum ServiceType {
|
|
107
|
-
Database =
|
|
108
|
-
WebService =
|
|
109
|
-
Liscense = "liscense"
|
|
107
|
+
Database = "database",
|
|
108
|
+
WebService = "web-service",
|
|
109
|
+
Liscense = "liscense",
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
export enum DatabaseEngine {
|
|
113
|
-
MySQL =
|
|
114
|
-
PostgreSQL =
|
|
115
|
-
MongoDB =
|
|
116
|
-
Redis =
|
|
117
|
-
WordPress =
|
|
118
|
-
SQLite =
|
|
113
|
+
MySQL = "mysql",
|
|
114
|
+
PostgreSQL = "postgresql",
|
|
115
|
+
MongoDB = "mongodb",
|
|
116
|
+
Redis = "redis",
|
|
117
|
+
WordPress = "wordpress",
|
|
118
|
+
SQLite = "sqlite",
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
export enum JobStatus {
|
|
@@ -130,5 +130,19 @@ export enum LicenseStatus {
|
|
|
130
130
|
ACTIVE = "ACTIVE",
|
|
131
131
|
EXPIRED = "EXPIRED",
|
|
132
132
|
SUSPENDED = "SUSPENDED",
|
|
133
|
-
REVOKED = "REVOKED"
|
|
134
|
-
}
|
|
133
|
+
REVOKED = "REVOKED",
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export enum SCALING_STRATEGY {
|
|
137
|
+
Linear = "LINEAR",
|
|
138
|
+
Exponential = "EXPONENTIAL",
|
|
139
|
+
Target = "TARGET",
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export enum SCALING_METRIC {
|
|
143
|
+
Cpu = "CPU",
|
|
144
|
+
Memory = "MEMORY",
|
|
145
|
+
RequestCount = "REQUEST_COUNT",
|
|
146
|
+
ResponseTime = "RESPONSE_TIME",
|
|
147
|
+
CustomMetric = "CUSTOM_METRIC",
|
|
148
|
+
}
|
package/index.ts
CHANGED
|
@@ -19,8 +19,9 @@ export { default as Server } from "./server";
|
|
|
19
19
|
export { default as Wallet } from "./wallet";
|
|
20
20
|
export { default as DbImage } from "./db-image";
|
|
21
21
|
export { default as Job } from "./job";
|
|
22
|
-
export { default as Liscense } from "./license"
|
|
23
|
-
export { default as PlanConfiguration } from "./plan_configuration"
|
|
22
|
+
export { default as Liscense } from "./license";
|
|
23
|
+
export { default as PlanConfiguration } from "./plan_configuration";
|
|
24
|
+
export { default as AutoScalingGroup } from "./auto-scaling"
|
|
24
25
|
|
|
25
26
|
export {
|
|
26
27
|
IUser,
|
|
@@ -47,7 +48,8 @@ export {
|
|
|
47
48
|
IDbImage,
|
|
48
49
|
IJob,
|
|
49
50
|
ILicense,
|
|
50
|
-
IPlanConfiguration
|
|
51
|
+
IPlanConfiguration,
|
|
52
|
+
IAutoScalingGroup
|
|
51
53
|
} from "./types";
|
|
52
54
|
export {
|
|
53
55
|
GIT_TYPE,
|
|
@@ -67,7 +69,7 @@ export {
|
|
|
67
69
|
ServiceType,
|
|
68
70
|
DatabaseEngine,
|
|
69
71
|
JobStatus,
|
|
70
|
-
LicenseStatus
|
|
72
|
+
LicenseStatus,
|
|
71
73
|
} from "./enum";
|
|
72
74
|
|
|
73
75
|
import mongoose from "mongoose";
|
package/job.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import mongoose, { model, Schema } from "mongoose";
|
|
2
2
|
import { IJob } from "./types/job";
|
|
3
3
|
import { JobStatus } from "./enum";
|
|
4
|
-
|
|
4
|
+
|
|
5
5
|
const jobSchema: Schema = new Schema({
|
|
6
6
|
title: { type: String, required: true },
|
|
7
7
|
jobId: { type: String, required: true, unique: true },
|
|
@@ -27,5 +27,4 @@ const jobSchema: Schema = new Schema({
|
|
|
27
27
|
updatedAt: { type: Date, default: Date.now },
|
|
28
28
|
});
|
|
29
29
|
|
|
30
|
-
export default model<IJob>(
|
|
31
|
-
|
|
30
|
+
export default model<IJob>("Job", jobSchema, "scheduled_jobs");
|
package/license.ts
CHANGED
|
@@ -2,68 +2,73 @@ import { model, Schema } from "mongoose";
|
|
|
2
2
|
import { ILicense } from "./types/license";
|
|
3
3
|
import { LicenseStatus } from "./enum";
|
|
4
4
|
|
|
5
|
-
const licenseSchema: Schema = new Schema(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
teamId: {
|
|
18
|
-
type: Schema.Types.ObjectId,
|
|
19
|
-
ref: 'Team',
|
|
20
|
-
required: false
|
|
21
|
-
},
|
|
22
|
-
subscriptionId: {
|
|
23
|
-
type: Schema.Types.ObjectId,
|
|
24
|
-
ref: 'Subscription',
|
|
25
|
-
required: true
|
|
26
|
-
},
|
|
27
|
-
status: {
|
|
28
|
-
type: String,
|
|
29
|
-
enum: Object.values(LicenseStatus),
|
|
30
|
-
default: LicenseStatus.ACTIVE
|
|
31
|
-
},
|
|
32
|
-
tag: String,
|
|
33
|
-
devices: [{
|
|
34
|
-
deviceId: {
|
|
35
|
-
type: String,
|
|
36
|
-
required: true
|
|
5
|
+
const licenseSchema: Schema = new Schema(
|
|
6
|
+
{
|
|
7
|
+
licenseKey: {
|
|
8
|
+
type: String,
|
|
9
|
+
required: true,
|
|
10
|
+
unique: true,
|
|
11
|
+
},
|
|
12
|
+
infisicalIdentity: String,
|
|
13
|
+
userId: {
|
|
14
|
+
type: Schema.Types.ObjectId,
|
|
15
|
+
ref: "User",
|
|
16
|
+
required: true,
|
|
37
17
|
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
18
|
+
teamId: {
|
|
19
|
+
type: Schema.Types.ObjectId,
|
|
20
|
+
ref: "Team",
|
|
21
|
+
required: false,
|
|
42
22
|
},
|
|
43
|
-
|
|
44
|
-
type:
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
23
|
+
subscriptionId: {
|
|
24
|
+
type: Schema.Types.ObjectId,
|
|
25
|
+
ref: "Subscription",
|
|
26
|
+
required: true,
|
|
27
|
+
},
|
|
28
|
+
status: {
|
|
29
|
+
type: String,
|
|
30
|
+
enum: Object.values(LicenseStatus),
|
|
31
|
+
default: LicenseStatus.ACTIVE,
|
|
32
|
+
},
|
|
33
|
+
tag: String,
|
|
34
|
+
devices: [
|
|
35
|
+
{
|
|
36
|
+
deviceId: {
|
|
37
|
+
type: String,
|
|
38
|
+
required: true,
|
|
39
|
+
},
|
|
40
|
+
hostname: String,
|
|
41
|
+
lastSeen: {
|
|
42
|
+
type: Date,
|
|
43
|
+
default: Date.now,
|
|
44
|
+
},
|
|
45
|
+
isActive: {
|
|
46
|
+
type: Boolean,
|
|
47
|
+
default: true,
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
maxDevices: {
|
|
52
|
+
type: Number,
|
|
53
|
+
required: true,
|
|
54
|
+
default: 1,
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
{ timestamps: true },
|
|
58
|
+
);
|
|
54
59
|
|
|
55
60
|
// licenseSchema.index({ userId: 1, status: 1 });
|
|
56
61
|
// licenseSchema.index({ licenseKey: 1 });
|
|
57
62
|
|
|
58
|
-
licenseSchema.methods.cleanupInactiveDevices = async function() {
|
|
63
|
+
licenseSchema.methods.cleanupInactiveDevices = async function () {
|
|
59
64
|
const thirtyDaysAgo = new Date();
|
|
60
65
|
thirtyDaysAgo.setDate(thirtyDaysAgo.getDate() - 30);
|
|
61
66
|
|
|
62
|
-
this.devices = this.devices.filter(
|
|
63
|
-
device.lastSeen > thirtyDaysAgo || device.isActive
|
|
67
|
+
this.devices = this.devices.filter(
|
|
68
|
+
(device: any) => device.lastSeen > thirtyDaysAgo || device.isActive,
|
|
64
69
|
);
|
|
65
|
-
|
|
70
|
+
|
|
66
71
|
await this.save();
|
|
67
72
|
};
|
|
68
73
|
|
|
69
|
-
export default model<ILicense>(
|
|
74
|
+
export default model<ILicense>("License", licenseSchema, "licenses");
|
package/logs.ts
CHANGED
|
@@ -33,11 +33,11 @@ const LogSchema = new Schema(
|
|
|
33
33
|
jobs: Array,
|
|
34
34
|
startTime: Schema.Types.Date,
|
|
35
35
|
endTime: Schema.Types.Date,
|
|
36
|
-
deleted: Schema.Types.Boolean
|
|
36
|
+
deleted: Schema.Types.Boolean,
|
|
37
37
|
},
|
|
38
38
|
{ timestamps: true },
|
|
39
39
|
);
|
|
40
40
|
|
|
41
41
|
// LogSchema.plugin(softDeletePlugin);
|
|
42
42
|
|
|
43
|
-
export default model<ILog>(
|
|
43
|
+
export default model<ILog>("Log", LogSchema);
|
package/member-permission.ts
CHANGED
|
@@ -2,9 +2,12 @@ import { Schema, model } from "mongoose";
|
|
|
2
2
|
import { IMemberPermission } from "./types/member-permission";
|
|
3
3
|
|
|
4
4
|
const memberPermissionSchema = new Schema({
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
permission: { type: Schema.Types.ObjectId, ref: "Permission" },
|
|
6
|
+
member: { type: Schema.Types.ObjectId, ref: "Member" },
|
|
7
|
+
enabled: { type: Boolean, default: false },
|
|
8
8
|
});
|
|
9
9
|
|
|
10
|
-
export default model<IMemberPermission>(
|
|
10
|
+
export default model<IMemberPermission>(
|
|
11
|
+
"MemberPermission",
|
|
12
|
+
memberPermissionSchema,
|
|
13
|
+
);
|
package/member.ts
CHANGED
|
@@ -30,7 +30,7 @@ const memberSchema: Schema = new Schema(
|
|
|
30
30
|
type: Boolean,
|
|
31
31
|
default: false,
|
|
32
32
|
},
|
|
33
|
-
permissions: [{ type: Schema.Types.ObjectId, ref:
|
|
33
|
+
permissions: [{ type: Schema.Types.ObjectId, ref: "MemberPermission" }],
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
36
|
timestamps: {
|
package/package.json
CHANGED
package/permission.ts
CHANGED
|
@@ -3,11 +3,11 @@ import { IPermission } from "./types/permission";
|
|
|
3
3
|
import { PERMISSION_TYPE } from "./enum";
|
|
4
4
|
|
|
5
5
|
const permissionSchema = new Schema({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
title: { type: String },
|
|
7
|
+
role: [{ type: Schema.Types.ObjectId, ref: "Role" }],
|
|
8
|
+
request: { type: Object },
|
|
9
|
+
type: { type: String, enum: Object.values(PERMISSION_TYPE) },
|
|
10
|
+
enabled: { type: Boolean, default: false, select: true },
|
|
11
11
|
});
|
|
12
12
|
|
|
13
|
-
export default model<IPermission>("Permission", permissionSchema);
|
|
13
|
+
export default model<IPermission>("Permission", permissionSchema);
|
package/plan_configuration.ts
CHANGED
|
@@ -1,23 +1,34 @@
|
|
|
1
|
-
import mongoose, { Schema, Document, model } from
|
|
2
|
-
import { SUBSCRIPTION_PLAN_TYPE } from
|
|
3
|
-
import { IPlanConfiguration } from
|
|
1
|
+
import mongoose, { Schema, Document, model } from "mongoose";
|
|
2
|
+
import { SUBSCRIPTION_PLAN_TYPE } from "./enum";
|
|
3
|
+
import { IPlanConfiguration } from "./types/plan_configuration";
|
|
4
4
|
|
|
5
|
-
const PlanConfigurationSchema = new Schema<IPlanConfiguration>(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
},
|
|
5
|
+
const PlanConfigurationSchema = new Schema<IPlanConfiguration>(
|
|
6
|
+
{
|
|
7
|
+
tag: { type: String, required: true },
|
|
8
|
+
slack_support: { type: Boolean, default: false },
|
|
9
|
+
concurrent_builds: { type: Number, required: true },
|
|
10
|
+
project_limit: { type: Number, required: true },
|
|
11
|
+
deploy_private_organization: { type: Boolean, default: false },
|
|
12
|
+
preview_comments: { type: Boolean, default: false },
|
|
13
|
+
analytics: { type: Boolean, default: false },
|
|
14
|
+
build_minutes: { type: Number, required: true },
|
|
15
|
+
log_retention: { type: Number, required: true },
|
|
16
|
+
bandwidth: { type: Number, required: true },
|
|
17
|
+
plan_type: {
|
|
18
|
+
type: String,
|
|
19
|
+
enum: Object.values(SUBSCRIPTION_PLAN_TYPE),
|
|
20
|
+
required: true,
|
|
21
|
+
},
|
|
22
|
+
memory: { type: Number, required: true },
|
|
23
|
+
build_timeout: { type: Number, required: true },
|
|
24
|
+
storage: { type: Number, required: true },
|
|
25
|
+
cpu: { type: Number, required: true },
|
|
26
|
+
},
|
|
27
|
+
{ timestamps: true },
|
|
28
|
+
);
|
|
22
29
|
|
|
23
|
-
export default model<IPlanConfiguration>(
|
|
30
|
+
export default model<IPlanConfiguration>(
|
|
31
|
+
"PlanConfigurations",
|
|
32
|
+
PlanConfigurationSchema,
|
|
33
|
+
"plan_configurations",
|
|
34
|
+
);
|
package/project/index.ts
CHANGED
|
@@ -127,7 +127,7 @@ const projectSchema = new Schema(
|
|
|
127
127
|
},
|
|
128
128
|
isPaid: {
|
|
129
129
|
type: Boolean,
|
|
130
|
-
default: false
|
|
130
|
+
default: false,
|
|
131
131
|
},
|
|
132
132
|
uri: {
|
|
133
133
|
type: String,
|
|
@@ -141,6 +141,10 @@ const projectSchema = new Schema(
|
|
|
141
141
|
type: Date,
|
|
142
142
|
default: null,
|
|
143
143
|
},
|
|
144
|
+
replica_ready: {
|
|
145
|
+
type: Boolean,
|
|
146
|
+
default: false
|
|
147
|
+
}
|
|
144
148
|
},
|
|
145
149
|
{ timestamps: true },
|
|
146
150
|
);
|
package/role.ts
CHANGED
|
@@ -3,10 +3,10 @@ import { ROLES } from "./enum";
|
|
|
3
3
|
import { IRole } from "./types/role";
|
|
4
4
|
|
|
5
5
|
const roleSchema = new Schema({
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
type: { type: String, enum: Object.values(ROLES) },
|
|
7
|
+
description: { type: String },
|
|
8
|
+
is_custom: { type: Boolean, default: false },
|
|
9
|
+
permissions: [{ type: Schema.Types.ObjectId, ref: "Permission" }],
|
|
10
10
|
});
|
|
11
11
|
|
|
12
|
-
export default model<IRole>("Role", roleSchema);
|
|
12
|
+
export default model<IRole>("Role", roleSchema);
|
package/server.ts
CHANGED
|
@@ -10,15 +10,15 @@ const serverSchema = new Schema(
|
|
|
10
10
|
},
|
|
11
11
|
url: String,
|
|
12
12
|
grpc_address: String,
|
|
13
|
-
userId: {
|
|
14
|
-
type: Schema.Types.ObjectId,
|
|
15
|
-
ref:
|
|
16
|
-
required: true
|
|
13
|
+
userId: {
|
|
14
|
+
type: Schema.Types.ObjectId,
|
|
15
|
+
ref: "User",
|
|
16
|
+
required: true,
|
|
17
17
|
},
|
|
18
18
|
teamId: {
|
|
19
|
-
type: Schema.Types.ObjectId,
|
|
20
|
-
ref:
|
|
21
|
-
required: false
|
|
19
|
+
type: Schema.Types.ObjectId,
|
|
20
|
+
ref: "Team",
|
|
21
|
+
required: false,
|
|
22
22
|
},
|
|
23
23
|
webhook_url: String,
|
|
24
24
|
ip_address: {
|
|
@@ -32,7 +32,7 @@ const serverSchema = new Schema(
|
|
|
32
32
|
},
|
|
33
33
|
tunnel_token: {
|
|
34
34
|
type: String,
|
|
35
|
-
required: false
|
|
35
|
+
required: false,
|
|
36
36
|
},
|
|
37
37
|
type: String,
|
|
38
38
|
status: {
|
package/subscription.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { model, Schema } from "mongoose";
|
|
2
|
-
import {SUBSCRIPTION_PLAN_TYPE, SUBSCRIPTION_STATUS} from "./enum";
|
|
2
|
+
import { SUBSCRIPTION_PLAN_TYPE, SUBSCRIPTION_STATUS } from "./enum";
|
|
3
3
|
import { ISubscription } from "./types";
|
|
4
4
|
|
|
5
5
|
const subscriptionSchema: Schema = new Schema(
|
|
@@ -48,14 +48,14 @@ const subscriptionSchema: Schema = new Schema(
|
|
|
48
48
|
transaction_retries: Number,
|
|
49
49
|
trigger_created: {
|
|
50
50
|
type: Boolean,
|
|
51
|
-
default: false
|
|
51
|
+
default: false,
|
|
52
52
|
},
|
|
53
53
|
trigger_created_at: {
|
|
54
|
-
type: String
|
|
54
|
+
type: String,
|
|
55
55
|
},
|
|
56
56
|
job_identifier: {
|
|
57
|
-
type: String
|
|
58
|
-
}
|
|
57
|
+
type: String,
|
|
58
|
+
},
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
61
|
timestamps: true,
|
package/team.ts
CHANGED
|
@@ -28,13 +28,13 @@ const teamSchema: Schema = new Schema(
|
|
|
28
28
|
},
|
|
29
29
|
build_disabled: {
|
|
30
30
|
type: Boolean,
|
|
31
|
-
default: false
|
|
31
|
+
default: false,
|
|
32
32
|
},
|
|
33
33
|
subscription: {
|
|
34
34
|
type: Schema.Types.ObjectId,
|
|
35
35
|
required: false,
|
|
36
36
|
ref: "Subscription",
|
|
37
|
-
}
|
|
37
|
+
},
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
40
|
timestamps: true,
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Types } from "mongoose";
|
|
2
|
+
|
|
3
|
+
export interface IAutoScalingGroup extends Document {
|
|
4
|
+
_id: Types.ObjectId;
|
|
5
|
+
name: string;
|
|
6
|
+
user_id: Types.ObjectId;
|
|
7
|
+
team_id?: Types.ObjectId;
|
|
8
|
+
subscription_id: Types.ObjectId;
|
|
9
|
+
min_containers: number;
|
|
10
|
+
max_containers: number;
|
|
11
|
+
min_application_response_time: number;
|
|
12
|
+
active: boolean;
|
|
13
|
+
max_cpu: number;
|
|
14
|
+
max_memory: number;
|
|
15
|
+
meta: Record<string, any>;
|
|
16
|
+
createdAt: Date;
|
|
17
|
+
updatedAt: Date;
|
|
18
|
+
}
|
package/types/db-image.ts
CHANGED
|
@@ -2,12 +2,12 @@ import { Document } from "mongoose";
|
|
|
2
2
|
import { DatabaseEngine } from "../enum";
|
|
3
3
|
|
|
4
4
|
export interface IDbImage extends Document {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
5
|
+
name: DatabaseEngine;
|
|
6
|
+
image_url: string;
|
|
7
|
+
version: string;
|
|
8
|
+
envs: string[];
|
|
9
|
+
is_available: boolean;
|
|
10
|
+
is_default: boolean;
|
|
11
|
+
image: string;
|
|
12
|
+
has_port: boolean;
|
|
13
|
+
}
|
package/types/index.ts
CHANGED
|
@@ -21,5 +21,6 @@ export { IMemberPermission } from "./member-permission";
|
|
|
21
21
|
export { IWallet } from "./wallet";
|
|
22
22
|
export { IDbImage } from "./db-image";
|
|
23
23
|
export { IJob } from "./job";
|
|
24
|
-
export { ILicense } from "./license"
|
|
25
|
-
export { IPlanConfiguration } from "./plan_configuration"
|
|
24
|
+
export { ILicense } from "./license";
|
|
25
|
+
export { IPlanConfiguration } from "./plan_configuration";
|
|
26
|
+
export { IAutoScalingGroup } from "./auto-scaling-group";
|
package/types/job.ts
CHANGED
|
@@ -2,19 +2,19 @@ import { Document } from "mongoose";
|
|
|
2
2
|
import { JobStatus } from "../enum";
|
|
3
3
|
|
|
4
4
|
export interface IJob extends Document {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
5
|
+
title: string;
|
|
6
|
+
jobId: string;
|
|
7
|
+
url: string;
|
|
8
|
+
method: string;
|
|
9
|
+
schedule: string;
|
|
10
|
+
headers?: Map<string, string>;
|
|
11
|
+
maxAttempts?: number;
|
|
12
|
+
attempts?: number;
|
|
13
|
+
isRecurring: boolean;
|
|
14
|
+
lastRun?: Date;
|
|
15
|
+
nextRun?: Date;
|
|
16
|
+
body?: any;
|
|
17
|
+
status?: JobStatus;
|
|
18
|
+
createdAt?: Date;
|
|
19
|
+
updatedAt?: Date;
|
|
20
|
+
}
|
package/types/license.ts
CHANGED
|
@@ -2,19 +2,18 @@ import mongoose, { Document } from "mongoose";
|
|
|
2
2
|
import { LicenseStatus } from "../enum";
|
|
3
3
|
|
|
4
4
|
export interface ILicense extends Document {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
5
|
+
licenseKey: string;
|
|
6
|
+
infisicalIdentity: string;
|
|
7
|
+
userId: mongoose.Types.ObjectId;
|
|
8
|
+
teamId: mongoose.Types.ObjectId;
|
|
9
|
+
status: LicenseStatus;
|
|
10
|
+
tag: string;
|
|
11
|
+
subscriptionId: mongoose.Types.ObjectId;
|
|
12
|
+
devices: Array<{
|
|
13
|
+
deviceId: string;
|
|
14
|
+
hostname: string;
|
|
15
|
+
lastSeen: Date;
|
|
16
|
+
isActive: boolean;
|
|
17
|
+
}>;
|
|
18
|
+
maxDevices: number;
|
|
19
19
|
}
|
|
20
|
-
|
|
@@ -3,9 +3,9 @@ import { IPermission } from "./permission";
|
|
|
3
3
|
import { IMember } from "./member";
|
|
4
4
|
|
|
5
5
|
export interface IMemberPermission extends Document {
|
|
6
|
-
|
|
6
|
+
permission: IPermission;
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
member: IMember;
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
}
|
|
10
|
+
enabled: boolean;
|
|
11
|
+
}
|