@brimble/models 3.8.65 → 3.8.67
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/.claude/settings.local.json +7 -0
- package/activity-log.ts +66 -0
- package/dist/{branch.d.ts → activity-log.d.ts} +2 -2
- package/dist/activity-log.js +61 -0
- package/dist/enum/index.d.ts +0 -4
- package/dist/enum/index.js +1 -6
- package/dist/env.js +0 -8
- package/dist/environment-variable.d.ts +30 -0
- package/dist/environment-variable.js +16 -0
- package/dist/index.d.ts +5 -3
- package/dist/index.js +8 -5
- package/dist/project/index.js +9 -6
- package/dist/project-environment.d.ts +30 -0
- package/dist/project-environment.js +13 -0
- package/dist/types/activity-log.d.ts +18 -0
- package/dist/types/env.d.ts +0 -3
- package/dist/types/environment-variable.d.ts +12 -0
- package/dist/types/environment-variable.js +2 -0
- package/dist/types/index.d.ts +3 -1
- package/dist/types/project/index.d.ts +3 -2
- package/dist/types/project-environment.d.ts +13 -0
- package/dist/types/project-environment.js +2 -0
- package/enum/index.ts +0 -5
- package/env.ts +0 -8
- package/environment-variable.ts +21 -0
- package/index.ts +6 -3
- package/package.json +1 -1
- package/project/index.ts +9 -6
- package/project-environment.ts +18 -0
- package/types/activity-log.ts +19 -0
- package/types/env.ts +0 -3
- package/types/environment-variable.ts +13 -0
- package/types/index.ts +3 -1
- package/types/project/index.ts +3 -2
- package/types/project-environment.ts +14 -0
- package/branch.ts +0 -22
- package/dist/branch.js +0 -17
- package/dist/types/branch.d.ts +0 -17
- package/types/branch.ts +0 -18
- /package/dist/types/{branch.js → activity-log.js} +0 -0
package/activity-log.ts
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { model, Schema } from "mongoose";
|
|
2
|
+
import { IActivityLog } from "./types";
|
|
3
|
+
|
|
4
|
+
const activityLogSchema: Schema = new Schema(
|
|
5
|
+
{
|
|
6
|
+
user_id: {
|
|
7
|
+
type: Schema.Types.ObjectId,
|
|
8
|
+
ref: "User",
|
|
9
|
+
required: true,
|
|
10
|
+
index: true,
|
|
11
|
+
},
|
|
12
|
+
team_id: {
|
|
13
|
+
type: Schema.Types.ObjectId,
|
|
14
|
+
ref: "Team",
|
|
15
|
+
default: null,
|
|
16
|
+
index: true,
|
|
17
|
+
},
|
|
18
|
+
action: {
|
|
19
|
+
type: String,
|
|
20
|
+
required: true,
|
|
21
|
+
index: true,
|
|
22
|
+
},
|
|
23
|
+
description: {
|
|
24
|
+
type: String,
|
|
25
|
+
},
|
|
26
|
+
context: {
|
|
27
|
+
type: String,
|
|
28
|
+
},
|
|
29
|
+
metadata: {
|
|
30
|
+
type: Schema.Types.Mixed,
|
|
31
|
+
default: {},
|
|
32
|
+
},
|
|
33
|
+
ip_address: {
|
|
34
|
+
type: String,
|
|
35
|
+
},
|
|
36
|
+
user_agent: {
|
|
37
|
+
type: String,
|
|
38
|
+
},
|
|
39
|
+
status: {
|
|
40
|
+
type: String,
|
|
41
|
+
enum: ["success", "failure"],
|
|
42
|
+
default: "success",
|
|
43
|
+
},
|
|
44
|
+
resource_type: {
|
|
45
|
+
type: String,
|
|
46
|
+
},
|
|
47
|
+
resource_id: {
|
|
48
|
+
type: Schema.Types.ObjectId,
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
timestamps: {
|
|
53
|
+
createdAt: "created_at",
|
|
54
|
+
updatedAt: "updated_at",
|
|
55
|
+
},
|
|
56
|
+
collection: "activity_logs",
|
|
57
|
+
},
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
activityLogSchema.index({ user_id: 1, created_at: -1 });
|
|
61
|
+
activityLogSchema.index({ user_id: 1, action: 1, created_at: -1 });
|
|
62
|
+
activityLogSchema.index({ team_id: 1, created_at: -1 });
|
|
63
|
+
activityLogSchema.index({ team_id: 1, action: 1, created_at: -1 });
|
|
64
|
+
activityLogSchema.index({ resource_type: 1, resource_id: 1 });
|
|
65
|
+
|
|
66
|
+
export default model<IActivityLog>("ActivityLog", activityLogSchema);
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
/// <reference types="mongoose/types/virtuals" />
|
|
24
24
|
/// <reference types="mongoose" />
|
|
25
25
|
/// <reference types="mongoose/types/inferschematype" />
|
|
26
|
-
import {
|
|
27
|
-
declare const _default: import("mongoose").Model<
|
|
26
|
+
import { IActivityLog } from "./types";
|
|
27
|
+
declare const _default: import("mongoose").Model<IActivityLog, {}, {}, {}, import("mongoose").Document<unknown, {}, IActivityLog> & IActivityLog & {
|
|
28
28
|
_id: import("mongoose").Types.ObjectId;
|
|
29
29
|
}, any>;
|
|
30
30
|
export default _default;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mongoose_1 = require("mongoose");
|
|
4
|
+
const activityLogSchema = new mongoose_1.Schema({
|
|
5
|
+
user_id: {
|
|
6
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
7
|
+
ref: "User",
|
|
8
|
+
required: true,
|
|
9
|
+
index: true,
|
|
10
|
+
},
|
|
11
|
+
team_id: {
|
|
12
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
13
|
+
ref: "Team",
|
|
14
|
+
default: null,
|
|
15
|
+
index: true,
|
|
16
|
+
},
|
|
17
|
+
action: {
|
|
18
|
+
type: String,
|
|
19
|
+
required: true,
|
|
20
|
+
index: true,
|
|
21
|
+
},
|
|
22
|
+
description: {
|
|
23
|
+
type: String,
|
|
24
|
+
},
|
|
25
|
+
context: {
|
|
26
|
+
type: String,
|
|
27
|
+
},
|
|
28
|
+
metadata: {
|
|
29
|
+
type: mongoose_1.Schema.Types.Mixed,
|
|
30
|
+
default: {},
|
|
31
|
+
},
|
|
32
|
+
ip_address: {
|
|
33
|
+
type: String,
|
|
34
|
+
},
|
|
35
|
+
user_agent: {
|
|
36
|
+
type: String,
|
|
37
|
+
},
|
|
38
|
+
status: {
|
|
39
|
+
type: String,
|
|
40
|
+
enum: ["success", "failure"],
|
|
41
|
+
default: "success",
|
|
42
|
+
},
|
|
43
|
+
resource_type: {
|
|
44
|
+
type: String,
|
|
45
|
+
},
|
|
46
|
+
resource_id: {
|
|
47
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
48
|
+
},
|
|
49
|
+
}, {
|
|
50
|
+
timestamps: {
|
|
51
|
+
createdAt: "created_at",
|
|
52
|
+
updatedAt: "updated_at",
|
|
53
|
+
},
|
|
54
|
+
collection: "activity_logs",
|
|
55
|
+
});
|
|
56
|
+
activityLogSchema.index({ user_id: 1, created_at: -1 });
|
|
57
|
+
activityLogSchema.index({ user_id: 1, action: 1, created_at: -1 });
|
|
58
|
+
activityLogSchema.index({ team_id: 1, created_at: -1 });
|
|
59
|
+
activityLogSchema.index({ team_id: 1, action: 1, created_at: -1 });
|
|
60
|
+
activityLogSchema.index({ resource_type: 1, resource_id: 1 });
|
|
61
|
+
exports.default = (0, mongoose_1.model)("ActivityLog", activityLogSchema);
|
package/dist/enum/index.d.ts
CHANGED
|
@@ -183,10 +183,6 @@ export declare enum NomadDeploymentStatus {
|
|
|
183
183
|
NOMAD_READY = "nomad_ready",
|
|
184
184
|
NOMAD_FAILED = "nomad_failed"
|
|
185
185
|
}
|
|
186
|
-
export declare enum BRANCH_TYPE {
|
|
187
|
-
USER_CREATED = "USER_CREATED",
|
|
188
|
-
PREVIEW = "PREVIEW"
|
|
189
|
-
}
|
|
190
186
|
export declare enum COLLAB_ANNOTATION_STATUS {
|
|
191
187
|
OPEN = "open",
|
|
192
188
|
RESOLVED = "resolved"
|
package/dist/enum/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.INVOICE_TYPE = exports.INVOICE_PAYMENT_STATUS = exports.INVOICE_STATUS = exports.COLLAB_TOOLBAR_POSITION = exports.COLLAB_THEME = exports.COLLAB_INTEGRATION_TYPE = exports.COLLAB_ANNOTATION_STATUS = exports.
|
|
3
|
+
exports.INVOICE_TYPE = exports.INVOICE_PAYMENT_STATUS = exports.INVOICE_STATUS = exports.COLLAB_TOOLBAR_POSITION = exports.COLLAB_THEME = exports.COLLAB_INTEGRATION_TYPE = exports.COLLAB_ANNOTATION_STATUS = exports.NomadDeploymentStatus = exports.DomainTransferStatus = exports.DomainTransferDirection = exports.DomainTransferProvider = 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";
|
|
@@ -215,11 +215,6 @@ var NomadDeploymentStatus;
|
|
|
215
215
|
NomadDeploymentStatus["NOMAD_READY"] = "nomad_ready";
|
|
216
216
|
NomadDeploymentStatus["NOMAD_FAILED"] = "nomad_failed";
|
|
217
217
|
})(NomadDeploymentStatus = exports.NomadDeploymentStatus || (exports.NomadDeploymentStatus = {}));
|
|
218
|
-
var BRANCH_TYPE;
|
|
219
|
-
(function (BRANCH_TYPE) {
|
|
220
|
-
BRANCH_TYPE["USER_CREATED"] = "USER_CREATED";
|
|
221
|
-
BRANCH_TYPE["PREVIEW"] = "PREVIEW";
|
|
222
|
-
})(BRANCH_TYPE = exports.BRANCH_TYPE || (exports.BRANCH_TYPE = {}));
|
|
223
218
|
var COLLAB_ANNOTATION_STATUS;
|
|
224
219
|
(function (COLLAB_ANNOTATION_STATUS) {
|
|
225
220
|
COLLAB_ANNOTATION_STATUS["OPEN"] = "open";
|
package/dist/env.js
CHANGED
|
@@ -25,14 +25,6 @@ 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
|
-
},
|
|
36
28
|
is_system: {
|
|
37
29
|
type: Boolean,
|
|
38
30
|
default: false,
|
|
@@ -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 { IEnvironmentVariable } from "./types";
|
|
27
|
+
declare const _default: import("mongoose").Model<IEnvironmentVariable, {}, {}, {}, import("mongoose").Document<unknown, {}, IEnvironmentVariable> & IEnvironmentVariable & {
|
|
28
|
+
_id: import("mongoose").Types.ObjectId;
|
|
29
|
+
}, any>;
|
|
30
|
+
export default _default;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mongoose_1 = require("mongoose");
|
|
4
|
+
const environmentVariableSchema = new mongoose_1.Schema({
|
|
5
|
+
name: { type: String, required: true },
|
|
6
|
+
value: { type: String, required: true },
|
|
7
|
+
project_environment: {
|
|
8
|
+
ref: "ProjectEnvironment",
|
|
9
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
10
|
+
required: true,
|
|
11
|
+
},
|
|
12
|
+
user: { ref: "User", type: mongoose_1.Schema.Types.ObjectId, required: true },
|
|
13
|
+
inheritable: { type: Boolean, default: true },
|
|
14
|
+
}, { timestamps: true });
|
|
15
|
+
environmentVariableSchema.index({ name: 1, project_environment: 1 }, { unique: true });
|
|
16
|
+
exports.default = (0, mongoose_1.model)("EnvironmentVariable", environmentVariableSchema);
|
package/dist/index.d.ts
CHANGED
|
@@ -36,7 +36,6 @@ export { default as WebhookEvent } from "./webhook-event";
|
|
|
36
36
|
export { default as WebhookSetting } from "./webhook-setting";
|
|
37
37
|
export { default as Intention } from "./intention";
|
|
38
38
|
export { default as Provider } from "./provider";
|
|
39
|
-
export { default as Branch } from "./branch";
|
|
40
39
|
export { default as CollabAnnotation } from "./collab-annotation";
|
|
41
40
|
export { default as CollabComment } from "./collab-comment";
|
|
42
41
|
export { default as CollabIntegration } from "./collab-integration";
|
|
@@ -49,8 +48,11 @@ export { default as Tag } from "./tag";
|
|
|
49
48
|
export { default as ProjectTagAssignment } from "./project-tag-assignment";
|
|
50
49
|
export { default as CashierSubscription } from "./cashier_subscription";
|
|
51
50
|
export { default as CashierSubscriptionItem } from "./cashier_subscription_item";
|
|
52
|
-
export {
|
|
53
|
-
export {
|
|
51
|
+
export { default as ProjectEnvironment } from "./project-environment";
|
|
52
|
+
export { default as EnvironmentVariable } from "./environment-variable";
|
|
53
|
+
export { default as ActivityLog } from "./activity-log";
|
|
54
|
+
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, IDomainTransfer, IWebhookCategory, IWebhookEvent, IWebhookSetting, IIntention, IProvider, ICollabAnnotation, ICollabComment, ICollabAttachment, ICollabIntegration, ICollabSettings, ICollabShareToken, ICollabPushSubscription, IAppMessage, IInvoice, ITag, IProjectTagAssignment, ICashierSubscription, ICashierSubscriptionItem, IProjectEnvironment, IEnvironmentVariable, IActivityLog, } from "./types";
|
|
55
|
+
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, DomainTransferProvider, DomainTransferDirection, DomainTransferStatus, NomadDeploymentStatus, COLLAB_ANNOTATION_STATUS, COLLAB_INTEGRATION_TYPE, COLLAB_THEME, COLLAB_TOOLBAR_POSITION, INVOICE_STATUS, INVOICE_PAYMENT_STATUS, INVOICE_TYPE } from "./enum";
|
|
54
56
|
import mongoose from "mongoose";
|
|
55
57
|
export declare const connectToMongo: (mongoUrl: string, config?: mongoose.ConnectOptions) => Promise<void>;
|
|
56
58
|
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.ProjectTagAssignment = exports.Tag = exports.Invoice = exports.AppMessage = exports.CollabPushSubscription = exports.CollabShareToken = exports.CollabSettings = exports.CollabIntegration = exports.CollabComment = exports.CollabAnnotation = exports.
|
|
16
|
-
exports.healthCheckMongo = exports.closeMongo = exports.db = exports.connectToMongo = exports.INVOICE_TYPE = exports.INVOICE_PAYMENT_STATUS = exports.INVOICE_STATUS = exports.COLLAB_TOOLBAR_POSITION = exports.COLLAB_THEME = exports.COLLAB_INTEGRATION_TYPE = exports.COLLAB_ANNOTATION_STATUS = exports.
|
|
15
|
+
exports.CashierSubscription = exports.ProjectTagAssignment = exports.Tag = exports.Invoice = exports.AppMessage = exports.CollabPushSubscription = exports.CollabShareToken = exports.CollabSettings = exports.CollabIntegration = exports.CollabComment = exports.CollabAnnotation = exports.Provider = exports.Intention = exports.WebhookSetting = exports.WebhookEvent = exports.WebhookCategory = exports.DomainTransfer = 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.INVOICE_TYPE = exports.INVOICE_PAYMENT_STATUS = exports.INVOICE_STATUS = exports.COLLAB_TOOLBAR_POSITION = exports.COLLAB_THEME = exports.COLLAB_INTEGRATION_TYPE = exports.COLLAB_ANNOTATION_STATUS = exports.NomadDeploymentStatus = exports.DomainTransferStatus = exports.DomainTransferDirection = exports.DomainTransferProvider = 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 = 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.ActivityLog = exports.EnvironmentVariable = exports.ProjectEnvironment = exports.CashierSubscriptionItem = 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");
|
|
@@ -91,8 +91,6 @@ var intention_1 = require("./intention");
|
|
|
91
91
|
Object.defineProperty(exports, "Intention", { enumerable: true, get: function () { return __importDefault(intention_1).default; } });
|
|
92
92
|
var provider_1 = require("./provider");
|
|
93
93
|
Object.defineProperty(exports, "Provider", { enumerable: true, get: function () { return __importDefault(provider_1).default; } });
|
|
94
|
-
var branch_1 = require("./branch");
|
|
95
|
-
Object.defineProperty(exports, "Branch", { enumerable: true, get: function () { return __importDefault(branch_1).default; } });
|
|
96
94
|
var collab_annotation_1 = require("./collab-annotation");
|
|
97
95
|
Object.defineProperty(exports, "CollabAnnotation", { enumerable: true, get: function () { return __importDefault(collab_annotation_1).default; } });
|
|
98
96
|
var collab_comment_1 = require("./collab-comment");
|
|
@@ -117,6 +115,12 @@ var cashier_subscription_1 = require("./cashier_subscription");
|
|
|
117
115
|
Object.defineProperty(exports, "CashierSubscription", { enumerable: true, get: function () { return __importDefault(cashier_subscription_1).default; } });
|
|
118
116
|
var cashier_subscription_item_1 = require("./cashier_subscription_item");
|
|
119
117
|
Object.defineProperty(exports, "CashierSubscriptionItem", { enumerable: true, get: function () { return __importDefault(cashier_subscription_item_1).default; } });
|
|
118
|
+
var project_environment_1 = require("./project-environment");
|
|
119
|
+
Object.defineProperty(exports, "ProjectEnvironment", { enumerable: true, get: function () { return __importDefault(project_environment_1).default; } });
|
|
120
|
+
var environment_variable_1 = require("./environment-variable");
|
|
121
|
+
Object.defineProperty(exports, "EnvironmentVariable", { enumerable: true, get: function () { return __importDefault(environment_variable_1).default; } });
|
|
122
|
+
var activity_log_1 = require("./activity-log");
|
|
123
|
+
Object.defineProperty(exports, "ActivityLog", { enumerable: true, get: function () { return __importDefault(activity_log_1).default; } });
|
|
120
124
|
var enum_1 = require("./enum");
|
|
121
125
|
Object.defineProperty(exports, "GIT_TYPE", { enumerable: true, get: function () { return enum_1.GIT_TYPE; } });
|
|
122
126
|
Object.defineProperty(exports, "INTEGRATION_TYPES", { enumerable: true, get: function () { return enum_1.INTEGRATION_TYPES; } });
|
|
@@ -145,7 +149,6 @@ Object.defineProperty(exports, "DomainTransferProvider", { enumerable: true, get
|
|
|
145
149
|
Object.defineProperty(exports, "DomainTransferDirection", { enumerable: true, get: function () { return enum_1.DomainTransferDirection; } });
|
|
146
150
|
Object.defineProperty(exports, "DomainTransferStatus", { enumerable: true, get: function () { return enum_1.DomainTransferStatus; } });
|
|
147
151
|
Object.defineProperty(exports, "NomadDeploymentStatus", { enumerable: true, get: function () { return enum_1.NomadDeploymentStatus; } });
|
|
148
|
-
Object.defineProperty(exports, "BRANCH_TYPE", { enumerable: true, get: function () { return enum_1.BRANCH_TYPE; } });
|
|
149
152
|
Object.defineProperty(exports, "COLLAB_ANNOTATION_STATUS", { enumerable: true, get: function () { return enum_1.COLLAB_ANNOTATION_STATUS; } });
|
|
150
153
|
Object.defineProperty(exports, "COLLAB_INTEGRATION_TYPE", { enumerable: true, get: function () { return enum_1.COLLAB_INTEGRATION_TYPE; } });
|
|
151
154
|
Object.defineProperty(exports, "COLLAB_THEME", { enumerable: true, get: function () { return enum_1.COLLAB_THEME; } });
|
package/dist/project/index.js
CHANGED
|
@@ -131,12 +131,15 @@ const projectSchema = new mongoose_1.Schema({
|
|
|
131
131
|
type: mongoose_1.Schema.Types.ObjectId,
|
|
132
132
|
},
|
|
133
133
|
],
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
134
|
+
project_environment: {
|
|
135
|
+
ref: "ProjectEnvironment",
|
|
136
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
137
|
+
index: true,
|
|
138
|
+
},
|
|
139
|
+
inherit_environment_vars: {
|
|
140
|
+
type: Boolean,
|
|
141
|
+
default: true,
|
|
142
|
+
},
|
|
140
143
|
replicas: {
|
|
141
144
|
type: Number,
|
|
142
145
|
default: 3,
|
|
@@ -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 { IProjectEnvironment } from "./types";
|
|
27
|
+
declare const _default: import("mongoose").Model<IProjectEnvironment, {}, {}, {}, import("mongoose").Document<unknown, {}, IProjectEnvironment> & IProjectEnvironment & {
|
|
28
|
+
_id: import("mongoose").Types.ObjectId;
|
|
29
|
+
}, any>;
|
|
30
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mongoose_1 = require("mongoose");
|
|
4
|
+
const projectEnvironmentSchema = new mongoose_1.Schema({
|
|
5
|
+
name: { type: String, required: true },
|
|
6
|
+
slug: { type: String, required: true },
|
|
7
|
+
owner: { ref: "User", type: mongoose_1.Schema.Types.ObjectId, required: true },
|
|
8
|
+
team: { ref: "Team", type: mongoose_1.Schema.Types.ObjectId },
|
|
9
|
+
inherit_from: { ref: "ProjectEnvironment", type: mongoose_1.Schema.Types.ObjectId },
|
|
10
|
+
isDefault: { type: Boolean, default: false },
|
|
11
|
+
}, { timestamps: true });
|
|
12
|
+
projectEnvironmentSchema.index({ slug: 1, owner: 1, team: 1 }, { unique: true });
|
|
13
|
+
exports.default = (0, mongoose_1.model)("ProjectEnvironment", projectEnvironmentSchema);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Document, Types } from "mongoose";
|
|
2
|
+
import { ITeam } from "./team";
|
|
3
|
+
import { IUser } from "./user";
|
|
4
|
+
export interface IActivityLog extends Document {
|
|
5
|
+
user_id: IUser | Types.ObjectId;
|
|
6
|
+
team_id?: ITeam | Types.ObjectId;
|
|
7
|
+
action: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
context?: string;
|
|
10
|
+
metadata?: Record<string, any>;
|
|
11
|
+
ip_address?: string;
|
|
12
|
+
user_agent?: string;
|
|
13
|
+
status: "success" | "failure";
|
|
14
|
+
resource_type?: string;
|
|
15
|
+
resource_id?: Types.ObjectId;
|
|
16
|
+
created_at: Date;
|
|
17
|
+
updated_at: Date;
|
|
18
|
+
}
|
package/dist/types/env.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Document } from "mongoose";
|
|
2
2
|
import { ENVIRONMENT } from "../enum";
|
|
3
|
-
import { IBranch } from "./branch";
|
|
4
3
|
import { IProject, IUser } from "./";
|
|
5
4
|
export interface IEnv extends Document {
|
|
6
5
|
name: string;
|
|
@@ -8,8 +7,6 @@ export interface IEnv extends Document {
|
|
|
8
7
|
project: IProject;
|
|
9
8
|
user: IUser;
|
|
10
9
|
environment: ENVIRONMENT | string;
|
|
11
|
-
branch?: IBranch;
|
|
12
|
-
inheritable?: boolean;
|
|
13
10
|
is_system?: boolean;
|
|
14
11
|
createdAt: Date;
|
|
15
12
|
updatedAt: Date;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Document } from "mongoose";
|
|
2
|
+
import { IProjectEnvironment } from "./project-environment";
|
|
3
|
+
import { IUser } from "./user";
|
|
4
|
+
export interface IEnvironmentVariable extends Document {
|
|
5
|
+
name: string;
|
|
6
|
+
value: string;
|
|
7
|
+
project_environment: IProjectEnvironment;
|
|
8
|
+
user: IUser;
|
|
9
|
+
inheritable: boolean;
|
|
10
|
+
createdAt: Date;
|
|
11
|
+
updatedAt: Date;
|
|
12
|
+
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export type { IAutoScalingGroup } from "./auto-scaling-group";
|
|
2
|
-
export type { IBranch } from "./branch";
|
|
3
2
|
export type { ICard } from "./card";
|
|
4
3
|
export type { IComputeChange } from "./compute";
|
|
5
4
|
export type { IDbImage } from "./db-image";
|
|
@@ -50,3 +49,6 @@ export type { IInvoice } from "./invoice";
|
|
|
50
49
|
export type { IProjectTagAssignment } from "./project-tag-assignment";
|
|
51
50
|
export type { ITag } from "./tag";
|
|
52
51
|
export type { ICashierSubscription, ICashierSubscriptionItem } from "./cashier_subscription";
|
|
52
|
+
export type { IProjectEnvironment } from "./project-environment";
|
|
53
|
+
export type { IEnvironmentVariable } from "./environment-variable";
|
|
54
|
+
export type { IActivityLog } from "./activity-log";
|
|
@@ -6,10 +6,10 @@ 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";
|
|
10
9
|
import { IPreview } from "./preview";
|
|
11
10
|
import { IDbImage } from "../db-image";
|
|
12
11
|
import { IAutoScalingGroup } from "../auto-scaling-group";
|
|
12
|
+
import { IProjectEnvironment } from "../project-environment";
|
|
13
13
|
import { IRegion } from "../region";
|
|
14
14
|
export interface IProject extends Document {
|
|
15
15
|
name: string;
|
|
@@ -67,7 +67,8 @@ export interface IProject extends Document {
|
|
|
67
67
|
tracking_token: string;
|
|
68
68
|
from: string;
|
|
69
69
|
previews: IPreview[];
|
|
70
|
-
|
|
70
|
+
project_environment?: IProjectEnvironment;
|
|
71
|
+
inherit_environment_vars: boolean;
|
|
71
72
|
replicas: number;
|
|
72
73
|
vaultPath: string | null;
|
|
73
74
|
vaultToken: string | null;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Document } from "mongoose";
|
|
2
|
+
import { ITeam } from "./team";
|
|
3
|
+
import { IUser } from "./user";
|
|
4
|
+
export interface IProjectEnvironment extends Document {
|
|
5
|
+
name: string;
|
|
6
|
+
slug: string;
|
|
7
|
+
owner: IUser;
|
|
8
|
+
team?: ITeam;
|
|
9
|
+
inherit_from?: IProjectEnvironment;
|
|
10
|
+
isDefault: boolean;
|
|
11
|
+
createdAt: Date;
|
|
12
|
+
updatedAt: Date;
|
|
13
|
+
}
|
package/enum/index.ts
CHANGED
|
@@ -212,11 +212,6 @@ export enum NomadDeploymentStatus {
|
|
|
212
212
|
NOMAD_FAILED = 'nomad_failed',
|
|
213
213
|
}
|
|
214
214
|
|
|
215
|
-
export enum BRANCH_TYPE {
|
|
216
|
-
USER_CREATED = "USER_CREATED",
|
|
217
|
-
PREVIEW = "PREVIEW",
|
|
218
|
-
}
|
|
219
|
-
|
|
220
215
|
export enum COLLAB_ANNOTATION_STATUS {
|
|
221
216
|
OPEN = "open",
|
|
222
217
|
RESOLVED = "resolved",
|
package/env.ts
CHANGED
|
@@ -26,14 +26,6 @@ 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
|
-
},
|
|
37
29
|
is_system: {
|
|
38
30
|
type: Boolean,
|
|
39
31
|
default: false,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { model, Schema } from "mongoose";
|
|
2
|
+
import { IEnvironmentVariable } from "./types";
|
|
3
|
+
|
|
4
|
+
const environmentVariableSchema = new Schema(
|
|
5
|
+
{
|
|
6
|
+
name: { type: String, required: true },
|
|
7
|
+
value: { type: String, required: true },
|
|
8
|
+
project_environment: {
|
|
9
|
+
ref: "ProjectEnvironment",
|
|
10
|
+
type: Schema.Types.ObjectId,
|
|
11
|
+
required: true,
|
|
12
|
+
},
|
|
13
|
+
user: { ref: "User", type: Schema.Types.ObjectId, required: true },
|
|
14
|
+
inheritable: { type: Boolean, default: true },
|
|
15
|
+
},
|
|
16
|
+
{ timestamps: true },
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
environmentVariableSchema.index({ name: 1, project_environment: 1 }, { unique: true });
|
|
20
|
+
|
|
21
|
+
export default model<IEnvironmentVariable>("EnvironmentVariable", environmentVariableSchema);
|
package/index.ts
CHANGED
|
@@ -36,7 +36,6 @@ export { default as WebhookEvent } from "./webhook-event";
|
|
|
36
36
|
export { default as WebhookSetting } from "./webhook-setting";
|
|
37
37
|
export { default as Intention } from "./intention";
|
|
38
38
|
export { default as Provider } from "./provider";
|
|
39
|
-
export { default as Branch } from "./branch";
|
|
40
39
|
export { default as CollabAnnotation } from "./collab-annotation";
|
|
41
40
|
export { default as CollabComment } from "./collab-comment";
|
|
42
41
|
export { default as CollabIntegration } from "./collab-integration";
|
|
@@ -49,6 +48,9 @@ export { default as Tag } from "./tag";
|
|
|
49
48
|
export { default as ProjectTagAssignment } from "./project-tag-assignment";
|
|
50
49
|
export { default as CashierSubscription } from "./cashier_subscription";
|
|
51
50
|
export { default as CashierSubscriptionItem } from "./cashier_subscription_item";
|
|
51
|
+
export { default as ProjectEnvironment } from "./project-environment";
|
|
52
|
+
export { default as EnvironmentVariable } from "./environment-variable";
|
|
53
|
+
export { default as ActivityLog } from "./activity-log";
|
|
52
54
|
|
|
53
55
|
export {
|
|
54
56
|
IUser,
|
|
@@ -92,7 +94,6 @@ export {
|
|
|
92
94
|
IWebhookSetting,
|
|
93
95
|
IIntention,
|
|
94
96
|
IProvider,
|
|
95
|
-
IBranch,
|
|
96
97
|
ICollabAnnotation,
|
|
97
98
|
ICollabComment,
|
|
98
99
|
ICollabAttachment,
|
|
@@ -106,6 +107,9 @@ export {
|
|
|
106
107
|
IProjectTagAssignment,
|
|
107
108
|
ICashierSubscription,
|
|
108
109
|
ICashierSubscriptionItem,
|
|
110
|
+
IProjectEnvironment,
|
|
111
|
+
IEnvironmentVariable,
|
|
112
|
+
IActivityLog,
|
|
109
113
|
} from "./types";
|
|
110
114
|
export {
|
|
111
115
|
GIT_TYPE,
|
|
@@ -135,7 +139,6 @@ export {
|
|
|
135
139
|
DomainTransferDirection,
|
|
136
140
|
DomainTransferStatus,
|
|
137
141
|
NomadDeploymentStatus,
|
|
138
|
-
BRANCH_TYPE,
|
|
139
142
|
COLLAB_ANNOTATION_STATUS,
|
|
140
143
|
COLLAB_INTEGRATION_TYPE,
|
|
141
144
|
COLLAB_THEME,
|
package/package.json
CHANGED
package/project/index.ts
CHANGED
|
@@ -131,12 +131,15 @@ const projectSchema = new Schema(
|
|
|
131
131
|
type: Schema.Types.ObjectId,
|
|
132
132
|
},
|
|
133
133
|
],
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
134
|
+
project_environment: {
|
|
135
|
+
ref: "ProjectEnvironment",
|
|
136
|
+
type: Schema.Types.ObjectId,
|
|
137
|
+
index: true,
|
|
138
|
+
},
|
|
139
|
+
inherit_environment_vars: {
|
|
140
|
+
type: Boolean,
|
|
141
|
+
default: true,
|
|
142
|
+
},
|
|
140
143
|
replicas: {
|
|
141
144
|
type: Number,
|
|
142
145
|
default: 3,
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { model, Schema } from "mongoose";
|
|
2
|
+
import { IProjectEnvironment } from "./types";
|
|
3
|
+
|
|
4
|
+
const projectEnvironmentSchema = new Schema(
|
|
5
|
+
{
|
|
6
|
+
name: { type: String, required: true },
|
|
7
|
+
slug: { type: String, required: true },
|
|
8
|
+
owner: { ref: "User", type: Schema.Types.ObjectId, required: true },
|
|
9
|
+
team: { ref: "Team", type: Schema.Types.ObjectId },
|
|
10
|
+
inherit_from: { ref: "ProjectEnvironment", type: Schema.Types.ObjectId },
|
|
11
|
+
isDefault: { type: Boolean, default: false },
|
|
12
|
+
},
|
|
13
|
+
{ timestamps: true },
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
projectEnvironmentSchema.index({ slug: 1, owner: 1, team: 1 }, { unique: true });
|
|
17
|
+
|
|
18
|
+
export default model<IProjectEnvironment>("ProjectEnvironment", projectEnvironmentSchema);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Document, Types } from "mongoose";
|
|
2
|
+
import { ITeam } from "./team";
|
|
3
|
+
import { IUser } from "./user";
|
|
4
|
+
|
|
5
|
+
export interface IActivityLog extends Document {
|
|
6
|
+
user_id: IUser | Types.ObjectId;
|
|
7
|
+
team_id?: ITeam | Types.ObjectId;
|
|
8
|
+
action: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
context?: string;
|
|
11
|
+
metadata?: Record<string, any>;
|
|
12
|
+
ip_address?: string;
|
|
13
|
+
user_agent?: string;
|
|
14
|
+
status: "success" | "failure";
|
|
15
|
+
resource_type?: string;
|
|
16
|
+
resource_id?: Types.ObjectId;
|
|
17
|
+
created_at: Date;
|
|
18
|
+
updated_at: Date;
|
|
19
|
+
}
|
package/types/env.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Document } from "mongoose";
|
|
2
2
|
import { ENVIRONMENT } from "../enum";
|
|
3
|
-
import { IBranch } from "./branch";
|
|
4
3
|
import { IProject, IUser } from "./";
|
|
5
4
|
|
|
6
5
|
export interface IEnv extends Document {
|
|
@@ -9,8 +8,6 @@ export interface IEnv extends Document {
|
|
|
9
8
|
project: IProject;
|
|
10
9
|
user: IUser;
|
|
11
10
|
environment: ENVIRONMENT | string;
|
|
12
|
-
branch?: IBranch;
|
|
13
|
-
inheritable?: boolean;
|
|
14
11
|
is_system?: boolean;
|
|
15
12
|
createdAt: Date;
|
|
16
13
|
updatedAt: Date;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Document } from "mongoose";
|
|
2
|
+
import { IProjectEnvironment } from "./project-environment";
|
|
3
|
+
import { IUser } from "./user";
|
|
4
|
+
|
|
5
|
+
export interface IEnvironmentVariable extends Document {
|
|
6
|
+
name: string;
|
|
7
|
+
value: string;
|
|
8
|
+
project_environment: IProjectEnvironment;
|
|
9
|
+
user: IUser;
|
|
10
|
+
inheritable: boolean;
|
|
11
|
+
createdAt: Date;
|
|
12
|
+
updatedAt: Date;
|
|
13
|
+
}
|
package/types/index.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export type { IAutoScalingGroup } from "./auto-scaling-group";
|
|
2
|
-
export type { IBranch } from "./branch";
|
|
3
2
|
export type { ICard } from "./card";
|
|
4
3
|
export type { IComputeChange } from "./compute";
|
|
5
4
|
export type { IDbImage } from "./db-image";
|
|
@@ -50,3 +49,6 @@ export type { IInvoice } from "./invoice";
|
|
|
50
49
|
export type { IProjectTagAssignment } from "./project-tag-assignment";
|
|
51
50
|
export type { ITag } from "./tag";
|
|
52
51
|
export type { ICashierSubscription, ICashierSubscriptionItem } from "./cashier_subscription";
|
|
52
|
+
export type { IProjectEnvironment } from "./project-environment";
|
|
53
|
+
export type { IEnvironmentVariable } from "./environment-variable";
|
|
54
|
+
export type { IActivityLog } from "./activity-log";
|
package/types/project/index.ts
CHANGED
|
@@ -6,10 +6,10 @@ 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";
|
|
10
9
|
import { IPreview } from "./preview";
|
|
11
10
|
import { IDbImage } from "../db-image";
|
|
12
11
|
import { IAutoScalingGroup } from "../auto-scaling-group";
|
|
12
|
+
import { IProjectEnvironment } from "../project-environment";
|
|
13
13
|
import { IRegion } from "../region";
|
|
14
14
|
|
|
15
15
|
export interface IProject extends Document {
|
|
@@ -68,7 +68,8 @@ export interface IProject extends Document {
|
|
|
68
68
|
tracking_token: string;
|
|
69
69
|
from: string;
|
|
70
70
|
previews: IPreview[];
|
|
71
|
-
|
|
71
|
+
project_environment?: IProjectEnvironment;
|
|
72
|
+
inherit_environment_vars: boolean;
|
|
72
73
|
replicas: number;
|
|
73
74
|
vaultPath: string | null;
|
|
74
75
|
vaultToken: string | null;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Document } from "mongoose";
|
|
2
|
+
import { ITeam } from "./team";
|
|
3
|
+
import { IUser } from "./user";
|
|
4
|
+
|
|
5
|
+
export interface IProjectEnvironment extends Document {
|
|
6
|
+
name: string;
|
|
7
|
+
slug: string;
|
|
8
|
+
owner: IUser;
|
|
9
|
+
team?: ITeam;
|
|
10
|
+
inherit_from?: IProjectEnvironment;
|
|
11
|
+
isDefault: boolean;
|
|
12
|
+
createdAt: Date;
|
|
13
|
+
updatedAt: Date;
|
|
14
|
+
}
|
package/branch.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
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.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
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/types/branch.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
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/types/branch.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
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
|
-
}
|
|
File without changes
|