@brimble/models 3.7.5 → 3.7.7
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/branch.ts +22 -0
- package/dist/branch.d.ts +30 -0
- package/dist/branch.js +17 -0
- package/dist/enum/index.d.ts +4 -0
- package/dist/enum/index.js +6 -1
- package/dist/env.js +8 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +5 -2
- package/dist/load-balancer-port.js +5 -0
- package/dist/project/index.js +6 -0
- package/dist/types/branch.d.ts +17 -0
- package/dist/types/branch.js +2 -0
- package/dist/types/env.d.ts +3 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/load-balancer-port.d.ts +2 -0
- package/dist/types/project/index.d.ts +2 -0
- package/enum/index.ts +5 -0
- package/env.ts +8 -0
- package/index.ts +5 -2
- package/load-balancer-port.ts +5 -0
- package/package.json +1 -1
- package/project/index.ts +6 -0
- package/types/branch.ts +18 -0
- package/types/env.ts +3 -0
- package/types/index.ts +1 -0
- package/types/load-balancer-port.ts +2 -0
- package/types/project/index.ts +2 -0
package/branch.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Schema, model } from "mongoose";
|
|
2
|
+
import { IBranch } from "./types";
|
|
3
|
+
import { BRANCH_TYPE } from "./enum";
|
|
4
|
+
|
|
5
|
+
const branchSchema = new Schema(
|
|
6
|
+
{
|
|
7
|
+
name: { type: String, required: true },
|
|
8
|
+
type: { type: String, enum: Object.values(BRANCH_TYPE), required: true },
|
|
9
|
+
gitRef: { type: String, required: true },
|
|
10
|
+
project: { ref: "Project", type: Schema.Types.ObjectId, required: true },
|
|
11
|
+
inherit_from: { ref: "Branch", type: Schema.Types.ObjectId },
|
|
12
|
+
ancestors: [{ ref: "Branch", type: Schema.Types.ObjectId }],
|
|
13
|
+
created_by: { ref: "User", type: Schema.Types.ObjectId, required: true },
|
|
14
|
+
issue_comment_id: Number,
|
|
15
|
+
pr_number: Number,
|
|
16
|
+
},
|
|
17
|
+
{ timestamps: true },
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
branchSchema.index({ project: 1, name: 1 }, { unique: true });
|
|
21
|
+
|
|
22
|
+
export default model<IBranch>("Branch", branchSchema);
|
package/dist/branch.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
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/types/inferschematype" />
|
|
26
|
+
import { IBranch } from "./types";
|
|
27
|
+
declare const _default: import("mongoose").Model<IBranch, {}, {}, {}, import("mongoose").Document<unknown, {}, IBranch> & IBranch & {
|
|
28
|
+
_id: import("mongoose").Types.ObjectId;
|
|
29
|
+
}, any>;
|
|
30
|
+
export default _default;
|
package/dist/branch.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mongoose_1 = require("mongoose");
|
|
4
|
+
const enum_1 = require("./enum");
|
|
5
|
+
const branchSchema = new mongoose_1.Schema({
|
|
6
|
+
name: { type: String, required: true },
|
|
7
|
+
type: { type: String, enum: Object.values(enum_1.BRANCH_TYPE), required: true },
|
|
8
|
+
gitRef: { type: String, required: true },
|
|
9
|
+
project: { ref: "Project", type: mongoose_1.Schema.Types.ObjectId, required: true },
|
|
10
|
+
inherit_from: { ref: "Branch", type: mongoose_1.Schema.Types.ObjectId },
|
|
11
|
+
ancestors: [{ ref: "Branch", type: mongoose_1.Schema.Types.ObjectId }],
|
|
12
|
+
created_by: { ref: "User", type: mongoose_1.Schema.Types.ObjectId, required: true },
|
|
13
|
+
issue_comment_id: Number,
|
|
14
|
+
pr_number: Number,
|
|
15
|
+
}, { timestamps: true });
|
|
16
|
+
branchSchema.index({ project: 1, name: 1 }, { unique: true });
|
|
17
|
+
exports.default = (0, mongoose_1.model)("Branch", branchSchema);
|
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.NomadDeploymentStatus = exports.DomainRenewalStatus = exports.FrameworkApplicationType = exports.SCALING_METRIC = exports.SCALING_STRATEGY = exports.LicenseStatus = exports.JobStatus = exports.DatabaseEngine = exports.ServiceType = exports.REGION_CONTINENT = 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.BUILD_DISABLED_BY = exports.SERVER_PROTOCOL = exports.GIT_TYPE = void 0;
|
|
3
|
+
exports.BRANCH_TYPE = exports.NomadDeploymentStatus = exports.DomainRenewalStatus = exports.FrameworkApplicationType = exports.SCALING_METRIC = exports.SCALING_STRATEGY = exports.LicenseStatus = exports.JobStatus = exports.DatabaseEngine = exports.ServiceType = exports.REGION_CONTINENT = 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.BUILD_DISABLED_BY = exports.SERVER_PROTOCOL = exports.GIT_TYPE = void 0;
|
|
4
4
|
var GIT_TYPE;
|
|
5
5
|
(function (GIT_TYPE) {
|
|
6
6
|
GIT_TYPE["GITHUB"] = "GITHUB";
|
|
@@ -197,3 +197,8 @@ var NomadDeploymentStatus;
|
|
|
197
197
|
NomadDeploymentStatus["NOMAD_READY"] = "nomad_ready";
|
|
198
198
|
NomadDeploymentStatus["NOMAD_FAILED"] = "nomad_failed";
|
|
199
199
|
})(NomadDeploymentStatus = exports.NomadDeploymentStatus || (exports.NomadDeploymentStatus = {}));
|
|
200
|
+
var BRANCH_TYPE;
|
|
201
|
+
(function (BRANCH_TYPE) {
|
|
202
|
+
BRANCH_TYPE["USER_CREATED"] = "USER_CREATED";
|
|
203
|
+
BRANCH_TYPE["PREVIEW"] = "PREVIEW";
|
|
204
|
+
})(BRANCH_TYPE = exports.BRANCH_TYPE || (exports.BRANCH_TYPE = {}));
|
package/dist/env.js
CHANGED
|
@@ -25,6 +25,14 @@ const envSchema = new mongoose_1.Schema({
|
|
|
25
25
|
default: enum_1.ENVIRONMENT.PRODUCTION,
|
|
26
26
|
required: true,
|
|
27
27
|
},
|
|
28
|
+
branch: {
|
|
29
|
+
ref: "Branch",
|
|
30
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
31
|
+
},
|
|
32
|
+
inheritable: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: true,
|
|
35
|
+
},
|
|
28
36
|
is_system: {
|
|
29
37
|
type: Boolean,
|
|
30
38
|
default: false,
|
package/dist/index.d.ts
CHANGED
|
@@ -35,8 +35,9 @@ export { default as WebhookEvent } from "./webhook-event";
|
|
|
35
35
|
export { default as WebhookSetting } from "./webhook-setting";
|
|
36
36
|
export { default as Intention } from "./intention";
|
|
37
37
|
export { default as Provider } from "./provider";
|
|
38
|
-
export {
|
|
39
|
-
export {
|
|
38
|
+
export { default as Branch } from "./branch";
|
|
39
|
+
export { IUser, IGit, IProject, IPreview, IProjectConnection, IFollowing, IIntegration, IEnv, IServer, IDomain, IToken, IMember, ITeam, IInstalledIntegration, ILog, ISubscription, ICard, IDns, IRole, IPermission, IMemberPermission, IWallet, IDbImage, IJob, ILicense, IPlanConfiguration, IAutoScalingGroup, IComputeChange, IRegion, IVolume, IFramework, BrimbleFrameworkType, ISettings, ILoadBalancerPort, IDomainRenewal, IWebhookCategory, IWebhookEvent, IWebhookSetting, IIntention, IProvider, IBranch } from "./types";
|
|
40
|
+
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, REGION_CONTINENT, BUILD_DISABLED_BY, SERVER_PROTOCOL, FrameworkApplicationType, DomainRenewalStatus, NomadDeploymentStatus, BRANCH_TYPE } from "./enum";
|
|
40
41
|
import mongoose from "mongoose";
|
|
41
42
|
export declare const connectToMongo: (mongoUrl: string, config?: mongoose.ConnectOptions) => Promise<void>;
|
|
42
43
|
export declare const db: mongoose.Connection;
|
package/dist/index.js
CHANGED
|
@@ -12,8 +12,8 @@ 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.
|
|
16
|
-
exports.healthCheckMongo = exports.closeMongo = exports.db = exports.connectToMongo = exports.NomadDeploymentStatus = exports.DomainRenewalStatus = exports.FrameworkApplicationType = exports.SERVER_PROTOCOL = exports.BUILD_DISABLED_BY = exports.REGION_CONTINENT = exports.LicenseStatus = exports.JobStatus = exports.DatabaseEngine = exports.ServiceType = exports.REQUEST_TYPE = exports.PERMISSION_TYPE = void 0;
|
|
15
|
+
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.Branch = exports.Provider = exports.Intention = exports.WebhookSetting = exports.WebhookEvent = exports.WebhookCategory = exports.DomainRenewal = exports.LoadBalancerPort = exports.Settings = exports.Framework = exports.Volume = exports.Region = exports.ComputeChange = 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.ProjectConnection = exports.Preview = exports.DeletedProject = exports.Project = exports.User = void 0;
|
|
16
|
+
exports.healthCheckMongo = exports.closeMongo = exports.db = exports.connectToMongo = exports.BRANCH_TYPE = exports.NomadDeploymentStatus = exports.DomainRenewalStatus = exports.FrameworkApplicationType = exports.SERVER_PROTOCOL = exports.BUILD_DISABLED_BY = exports.REGION_CONTINENT = exports.LicenseStatus = exports.JobStatus = exports.DatabaseEngine = exports.ServiceType = exports.REQUEST_TYPE = exports.PERMISSION_TYPE = exports.DNS_TYPE = void 0;
|
|
17
17
|
var user_1 = require("./user");
|
|
18
18
|
Object.defineProperty(exports, "User", { enumerable: true, get: function () { return __importDefault(user_1).default; } });
|
|
19
19
|
var project_1 = require("./project");
|
|
@@ -89,6 +89,8 @@ var intention_1 = require("./intention");
|
|
|
89
89
|
Object.defineProperty(exports, "Intention", { enumerable: true, get: function () { return __importDefault(intention_1).default; } });
|
|
90
90
|
var provider_1 = require("./provider");
|
|
91
91
|
Object.defineProperty(exports, "Provider", { enumerable: true, get: function () { return __importDefault(provider_1).default; } });
|
|
92
|
+
var branch_1 = require("./branch");
|
|
93
|
+
Object.defineProperty(exports, "Branch", { enumerable: true, get: function () { return __importDefault(branch_1).default; } });
|
|
92
94
|
var enum_1 = require("./enum");
|
|
93
95
|
Object.defineProperty(exports, "GIT_TYPE", { enumerable: true, get: function () { return enum_1.GIT_TYPE; } });
|
|
94
96
|
Object.defineProperty(exports, "INTEGRATION_TYPES", { enumerable: true, get: function () { return enum_1.INTEGRATION_TYPES; } });
|
|
@@ -114,6 +116,7 @@ Object.defineProperty(exports, "SERVER_PROTOCOL", { enumerable: true, get: funct
|
|
|
114
116
|
Object.defineProperty(exports, "FrameworkApplicationType", { enumerable: true, get: function () { return enum_1.FrameworkApplicationType; } });
|
|
115
117
|
Object.defineProperty(exports, "DomainRenewalStatus", { enumerable: true, get: function () { return enum_1.DomainRenewalStatus; } });
|
|
116
118
|
Object.defineProperty(exports, "NomadDeploymentStatus", { enumerable: true, get: function () { return enum_1.NomadDeploymentStatus; } });
|
|
119
|
+
Object.defineProperty(exports, "BRANCH_TYPE", { enumerable: true, get: function () { return enum_1.BRANCH_TYPE; } });
|
|
117
120
|
const mongoose_1 = __importDefault(require("mongoose"));
|
|
118
121
|
const utils_1 = require("@brimble/utils");
|
|
119
122
|
const connectToMongo = (mongoUrl, config) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -18,5 +18,10 @@ const loadBalancerPortSchema = new mongoose_1.Schema({
|
|
|
18
18
|
ref: "Project",
|
|
19
19
|
required: true,
|
|
20
20
|
},
|
|
21
|
+
region_id: {
|
|
22
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
23
|
+
ref: "Region",
|
|
24
|
+
required: true,
|
|
25
|
+
},
|
|
21
26
|
}, { timestamps: true });
|
|
22
27
|
exports.default = (0, mongoose_1.model)("LoadBalancerPort", loadBalancerPortSchema, "load_balancer_ports");
|
package/dist/project/index.js
CHANGED
|
@@ -131,6 +131,12 @@ const projectSchema = new mongoose_1.Schema({
|
|
|
131
131
|
type: mongoose_1.Schema.Types.ObjectId,
|
|
132
132
|
},
|
|
133
133
|
],
|
|
134
|
+
branches: [
|
|
135
|
+
{
|
|
136
|
+
ref: "Branch",
|
|
137
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
138
|
+
},
|
|
139
|
+
],
|
|
134
140
|
replicas: {
|
|
135
141
|
type: Number,
|
|
136
142
|
default: 3,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Document } from "mongoose";
|
|
2
|
+
import { BRANCH_TYPE } from "../enum";
|
|
3
|
+
import { IProject } from "./project";
|
|
4
|
+
import { IUser } from "./user";
|
|
5
|
+
export interface IBranch extends Document {
|
|
6
|
+
name: string;
|
|
7
|
+
type: BRANCH_TYPE;
|
|
8
|
+
gitRef: string;
|
|
9
|
+
project: IProject;
|
|
10
|
+
inherit_from?: IBranch;
|
|
11
|
+
ancestors: IBranch[];
|
|
12
|
+
created_by: IUser;
|
|
13
|
+
pr_number?: number;
|
|
14
|
+
issue_comment_id?: number;
|
|
15
|
+
createdAt: Date;
|
|
16
|
+
updatedAt: Date;
|
|
17
|
+
}
|
package/dist/types/env.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Document } from "mongoose";
|
|
2
2
|
import { ENVIRONMENT } from "../enum";
|
|
3
|
+
import { IBranch } from "./branch";
|
|
3
4
|
import { IProject, IUser } from "./";
|
|
4
5
|
export interface IEnv extends Document {
|
|
5
6
|
name: string;
|
|
@@ -7,6 +8,8 @@ export interface IEnv extends Document {
|
|
|
7
8
|
project: IProject;
|
|
8
9
|
user: IUser;
|
|
9
10
|
environment: ENVIRONMENT | string;
|
|
11
|
+
branch?: IBranch;
|
|
12
|
+
inheritable?: boolean;
|
|
10
13
|
is_system?: boolean;
|
|
11
14
|
createdAt: Date;
|
|
12
15
|
updatedAt: Date;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { Document } from "mongoose";
|
|
2
2
|
import { IProject } from "./project";
|
|
3
|
+
import { IRegion } from "./region";
|
|
3
4
|
import { IServer } from "./server";
|
|
4
5
|
export interface ILoadBalancerPort extends Document {
|
|
5
6
|
port: number;
|
|
6
7
|
server_id: IServer;
|
|
7
8
|
project_id: IProject;
|
|
9
|
+
region_id: IRegion;
|
|
8
10
|
createdAt: Date;
|
|
9
11
|
updatedAt: Date;
|
|
10
12
|
}
|
|
@@ -6,6 +6,7 @@ import { ILog } from "../logs";
|
|
|
6
6
|
import { ITeam } from "../team";
|
|
7
7
|
import { IUser } from "../user";
|
|
8
8
|
import { IServer } from "../server";
|
|
9
|
+
import { IBranch } from "../branch";
|
|
9
10
|
import { IPreview } from "./preview";
|
|
10
11
|
import { IDbImage } from "../db-image";
|
|
11
12
|
import { IAutoScalingGroup } from "../auto-scaling-group";
|
|
@@ -66,6 +67,7 @@ export interface IProject extends Document {
|
|
|
66
67
|
tracking_token: string;
|
|
67
68
|
from: string;
|
|
68
69
|
previews: IPreview[];
|
|
70
|
+
branches: IBranch[];
|
|
69
71
|
replicas: number;
|
|
70
72
|
vaultPath: string | null;
|
|
71
73
|
vaultToken: string | null;
|
package/enum/index.ts
CHANGED
package/env.ts
CHANGED
|
@@ -26,6 +26,14 @@ const envSchema = new Schema(
|
|
|
26
26
|
default: ENVIRONMENT.PRODUCTION,
|
|
27
27
|
required: true,
|
|
28
28
|
},
|
|
29
|
+
branch: {
|
|
30
|
+
ref: "Branch",
|
|
31
|
+
type: Schema.Types.ObjectId,
|
|
32
|
+
},
|
|
33
|
+
inheritable: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: true,
|
|
36
|
+
},
|
|
29
37
|
is_system: {
|
|
30
38
|
type: Boolean,
|
|
31
39
|
default: false,
|
package/index.ts
CHANGED
|
@@ -35,6 +35,7 @@ export { default as WebhookEvent } from "./webhook-event";
|
|
|
35
35
|
export { default as WebhookSetting } from "./webhook-setting";
|
|
36
36
|
export { default as Intention } from "./intention";
|
|
37
37
|
export { default as Provider } from "./provider";
|
|
38
|
+
export { default as Branch } from "./branch";
|
|
38
39
|
|
|
39
40
|
export {
|
|
40
41
|
IUser,
|
|
@@ -76,7 +77,8 @@ export {
|
|
|
76
77
|
IWebhookEvent,
|
|
77
78
|
IWebhookSetting,
|
|
78
79
|
IIntention,
|
|
79
|
-
IProvider
|
|
80
|
+
IProvider,
|
|
81
|
+
IBranch
|
|
80
82
|
} from "./types";
|
|
81
83
|
export {
|
|
82
84
|
GIT_TYPE,
|
|
@@ -102,7 +104,8 @@ export {
|
|
|
102
104
|
SERVER_PROTOCOL,
|
|
103
105
|
FrameworkApplicationType,
|
|
104
106
|
DomainRenewalStatus,
|
|
105
|
-
NomadDeploymentStatus
|
|
107
|
+
NomadDeploymentStatus,
|
|
108
|
+
BRANCH_TYPE
|
|
106
109
|
} from "./enum";
|
|
107
110
|
|
|
108
111
|
import mongoose from "mongoose";
|
package/load-balancer-port.ts
CHANGED
package/package.json
CHANGED
package/project/index.ts
CHANGED
package/types/branch.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Document } from "mongoose";
|
|
2
|
+
import { BRANCH_TYPE } from "../enum";
|
|
3
|
+
import { IProject } from "./project";
|
|
4
|
+
import { IUser } from "./user";
|
|
5
|
+
|
|
6
|
+
export interface IBranch extends Document {
|
|
7
|
+
name: string;
|
|
8
|
+
type: BRANCH_TYPE;
|
|
9
|
+
gitRef: string;
|
|
10
|
+
project: IProject;
|
|
11
|
+
inherit_from?: IBranch;
|
|
12
|
+
ancestors: IBranch[];
|
|
13
|
+
created_by: IUser;
|
|
14
|
+
pr_number?: number;
|
|
15
|
+
issue_comment_id?: number;
|
|
16
|
+
createdAt: Date;
|
|
17
|
+
updatedAt: Date;
|
|
18
|
+
}
|
package/types/env.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Document } from "mongoose";
|
|
2
2
|
import { ENVIRONMENT } from "../enum";
|
|
3
|
+
import { IBranch } from "./branch";
|
|
3
4
|
import { IProject, IUser } from "./";
|
|
4
5
|
|
|
5
6
|
export interface IEnv extends Document {
|
|
@@ -8,6 +9,8 @@ export interface IEnv extends Document {
|
|
|
8
9
|
project: IProject;
|
|
9
10
|
user: IUser;
|
|
10
11
|
environment: ENVIRONMENT | string;
|
|
12
|
+
branch?: IBranch;
|
|
13
|
+
inheritable?: boolean;
|
|
11
14
|
is_system?: boolean;
|
|
12
15
|
createdAt: Date;
|
|
13
16
|
updatedAt: Date;
|
package/types/index.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { Document } from "mongoose";
|
|
2
2
|
import { IProject } from "./project";
|
|
3
|
+
import { IRegion } from "./region";
|
|
3
4
|
import { IServer } from "./server";
|
|
4
5
|
|
|
5
6
|
export interface ILoadBalancerPort extends Document {
|
|
6
7
|
port: number;
|
|
7
8
|
server_id: IServer;
|
|
8
9
|
project_id: IProject;
|
|
10
|
+
region_id: IRegion;
|
|
9
11
|
createdAt: Date;
|
|
10
12
|
updatedAt: Date;
|
|
11
13
|
}
|
package/types/project/index.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { ILog } from "../logs";
|
|
|
6
6
|
import { ITeam } from "../team";
|
|
7
7
|
import { IUser } from "../user";
|
|
8
8
|
import { IServer } from "../server";
|
|
9
|
+
import { IBranch } from "../branch";
|
|
9
10
|
import { IPreview } from "./preview";
|
|
10
11
|
import { IDbImage } from "../db-image";
|
|
11
12
|
import { IAutoScalingGroup } from "../auto-scaling-group";
|
|
@@ -67,6 +68,7 @@ export interface IProject extends Document {
|
|
|
67
68
|
tracking_token: string;
|
|
68
69
|
from: string;
|
|
69
70
|
previews: IPreview[];
|
|
71
|
+
branches: IBranch[];
|
|
70
72
|
replicas: number;
|
|
71
73
|
vaultPath: string | null;
|
|
72
74
|
vaultToken: string | null;
|