@brimble/models 3.7.6 → 3.7.8

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.
Files changed (47) hide show
  1. package/branch.ts +22 -0
  2. package/collab-annotation.ts +29 -0
  3. package/collab-comment.ts +25 -0
  4. package/collab-integration.ts +20 -0
  5. package/collab-settings.ts +29 -0
  6. package/dist/branch.d.ts +30 -0
  7. package/dist/branch.js +17 -0
  8. package/dist/collab-annotation.d.ts +30 -0
  9. package/dist/collab-annotation.js +24 -0
  10. package/dist/collab-comment.d.ts +30 -0
  11. package/dist/collab-comment.js +17 -0
  12. package/dist/collab-integration.d.ts +30 -0
  13. package/dist/collab-integration.js +16 -0
  14. package/dist/collab-settings.d.ts +30 -0
  15. package/dist/collab-settings.js +24 -0
  16. package/dist/enum/index.d.ts +22 -0
  17. package/dist/enum/index.js +28 -1
  18. package/dist/env.js +8 -0
  19. package/dist/index.d.ts +7 -2
  20. package/dist/index.js +17 -2
  21. package/dist/project/index.js +6 -0
  22. package/dist/types/branch.d.ts +17 -0
  23. package/dist/types/branch.js +2 -0
  24. package/dist/types/collab-annotation.d.ts +20 -0
  25. package/dist/types/collab-annotation.js +2 -0
  26. package/dist/types/collab-comment.d.ts +18 -0
  27. package/dist/types/collab-comment.js +2 -0
  28. package/dist/types/collab-integration.d.ts +11 -0
  29. package/dist/types/collab-integration.js +2 -0
  30. package/dist/types/collab-settings.d.ts +16 -0
  31. package/dist/types/collab-settings.js +2 -0
  32. package/dist/types/env.d.ts +3 -0
  33. package/dist/types/index.d.ts +5 -0
  34. package/dist/types/project/index.d.ts +2 -0
  35. package/enum/index.ts +27 -0
  36. package/env.ts +8 -0
  37. package/index.ts +18 -2
  38. package/package.json +1 -1
  39. package/project/index.ts +6 -0
  40. package/types/branch.ts +18 -0
  41. package/types/collab-annotation.ts +21 -0
  42. package/types/collab-comment.ts +20 -0
  43. package/types/collab-integration.ts +12 -0
  44. package/types/collab-settings.ts +17 -0
  45. package/types/env.ts +3 -0
  46. package/types/index.ts +5 -0
  47. 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);
@@ -0,0 +1,29 @@
1
+ import { model, Schema } from "mongoose";
2
+ import { COLLAB_ANNOTATION_STATUS } from "./enum";
3
+ import { ICollabAnnotation } from "./types";
4
+
5
+ const collabAnnotationSchema = new Schema(
6
+ {
7
+ projectId: { type: Schema.Types.ObjectId, ref: "Project", required: true, index: true },
8
+ userId: { type: Schema.Types.ObjectId, ref: "User", required: true },
9
+ pageUrl: { type: String, required: true },
10
+ pagePath: { type: String, required: true, index: true },
11
+ xPercent: { type: Number, required: true },
12
+ yPercent: { type: Number, required: true },
13
+ elementSelector: { type: String },
14
+ elementOffsetX: { type: Number },
15
+ elementOffsetY: { type: Number },
16
+ status: {
17
+ type: String,
18
+ enum: Object.values(COLLAB_ANNOTATION_STATUS),
19
+ default: COLLAB_ANNOTATION_STATUS.OPEN,
20
+ },
21
+ resolvedAt: { type: Date },
22
+ resolvedBy: { type: Schema.Types.ObjectId, ref: "User" },
23
+ },
24
+ { timestamps: true, collection: "collab_annotations" },
25
+ );
26
+
27
+ collabAnnotationSchema.index({ projectId: 1, pagePath: 1, status: 1 });
28
+
29
+ export default model<ICollabAnnotation>("CollabAnnotation", collabAnnotationSchema);
@@ -0,0 +1,25 @@
1
+ import { model, Schema } from "mongoose";
2
+ import { ICollabComment, ICollabAttachment } from "./types";
3
+
4
+ const collabAttachmentSchema = new Schema<ICollabAttachment>(
5
+ {
6
+ url: { type: String, required: true },
7
+ fileName: { type: String, required: true },
8
+ fileType: { type: String, required: true },
9
+ fileSize: { type: Number, required: true },
10
+ },
11
+ { _id: false },
12
+ );
13
+
14
+ const collabCommentSchema = new Schema(
15
+ {
16
+ annotationId: { type: Schema.Types.ObjectId, ref: "CollabAnnotation", required: true, index: true },
17
+ userId: { type: Schema.Types.ObjectId, ref: "User", required: true },
18
+ body: { type: String, required: true },
19
+ screenshot: { type: String },
20
+ attachments: { type: [collabAttachmentSchema], default: undefined },
21
+ },
22
+ { timestamps: true, collection: "collab_comments" },
23
+ );
24
+
25
+ export default model<ICollabComment>("CollabComment", collabCommentSchema);
@@ -0,0 +1,20 @@
1
+ import { model, Schema } from "mongoose";
2
+ import { COLLAB_INTEGRATION_TYPE } from "./enum";
3
+ import { ICollabIntegration } from "./types";
4
+
5
+ const collabIntegrationSchema = new Schema(
6
+ {
7
+ projectId: { type: Schema.Types.ObjectId, ref: "Project", required: true, index: true },
8
+ type: {
9
+ type: String,
10
+ enum: Object.values(COLLAB_INTEGRATION_TYPE),
11
+ required: true,
12
+ },
13
+ webhookUrl: { type: String, required: true },
14
+ channelName: { type: String },
15
+ enabled: { type: Boolean, default: true },
16
+ },
17
+ { timestamps: true, collection: "collab_integrations" },
18
+ );
19
+
20
+ export default model<ICollabIntegration>("CollabIntegration", collabIntegrationSchema);
@@ -0,0 +1,29 @@
1
+ import { model, Schema } from "mongoose";
2
+ import { COLLAB_THEME, COLLAB_TOOLBAR_POSITION } from "./enum";
3
+ import { ICollabSettings } from "./types";
4
+
5
+ const collabSettingsSchema = new Schema(
6
+ {
7
+ userId: { type: Schema.Types.ObjectId, ref: "User", required: true },
8
+ projectId: { type: Schema.Types.ObjectId, ref: "Project", required: true },
9
+ pushNotifications: { type: Boolean, default: false },
10
+ slackUrl: { type: String },
11
+ discordUrl: { type: String },
12
+ theme: {
13
+ type: String,
14
+ enum: Object.values(COLLAB_THEME),
15
+ default: COLLAB_THEME.SYSTEM,
16
+ },
17
+ toolbarPosition: {
18
+ type: String,
19
+ enum: Object.values(COLLAB_TOOLBAR_POSITION),
20
+ default: COLLAB_TOOLBAR_POSITION.BOTTOM,
21
+ },
22
+ hasOnboarded: { type: Boolean, default: false },
23
+ },
24
+ { timestamps: true, collection: "collab_settings" },
25
+ );
26
+
27
+ collabSettingsSchema.index({ userId: 1, projectId: 1 }, { unique: true });
28
+
29
+ export default model<ICollabSettings>("CollabSettings", collabSettingsSchema);
@@ -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);
@@ -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 { ICollabAnnotation } from "./types";
27
+ declare const _default: import("mongoose").Model<ICollabAnnotation, {}, {}, {}, import("mongoose").Document<unknown, {}, ICollabAnnotation> & ICollabAnnotation & {
28
+ _id: import("mongoose").Types.ObjectId;
29
+ }, any>;
30
+ export default _default;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const mongoose_1 = require("mongoose");
4
+ const enum_1 = require("./enum");
5
+ const collabAnnotationSchema = new mongoose_1.Schema({
6
+ projectId: { type: mongoose_1.Schema.Types.ObjectId, ref: "Project", required: true, index: true },
7
+ userId: { type: mongoose_1.Schema.Types.ObjectId, ref: "User", required: true },
8
+ pageUrl: { type: String, required: true },
9
+ pagePath: { type: String, required: true, index: true },
10
+ xPercent: { type: Number, required: true },
11
+ yPercent: { type: Number, required: true },
12
+ elementSelector: { type: String },
13
+ elementOffsetX: { type: Number },
14
+ elementOffsetY: { type: Number },
15
+ status: {
16
+ type: String,
17
+ enum: Object.values(enum_1.COLLAB_ANNOTATION_STATUS),
18
+ default: enum_1.COLLAB_ANNOTATION_STATUS.OPEN,
19
+ },
20
+ resolvedAt: { type: Date },
21
+ resolvedBy: { type: mongoose_1.Schema.Types.ObjectId, ref: "User" },
22
+ }, { timestamps: true, collection: "collab_annotations" });
23
+ collabAnnotationSchema.index({ projectId: 1, pagePath: 1, status: 1 });
24
+ exports.default = (0, mongoose_1.model)("CollabAnnotation", collabAnnotationSchema);
@@ -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 { ICollabComment } from "./types";
27
+ declare const _default: import("mongoose").Model<ICollabComment, {}, {}, {}, import("mongoose").Document<unknown, {}, ICollabComment> & ICollabComment & {
28
+ _id: import("mongoose").Types.ObjectId;
29
+ }, any>;
30
+ export default _default;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const mongoose_1 = require("mongoose");
4
+ const collabAttachmentSchema = new mongoose_1.Schema({
5
+ url: { type: String, required: true },
6
+ fileName: { type: String, required: true },
7
+ fileType: { type: String, required: true },
8
+ fileSize: { type: Number, required: true },
9
+ }, { _id: false });
10
+ const collabCommentSchema = new mongoose_1.Schema({
11
+ annotationId: { type: mongoose_1.Schema.Types.ObjectId, ref: "CollabAnnotation", required: true, index: true },
12
+ userId: { type: mongoose_1.Schema.Types.ObjectId, ref: "User", required: true },
13
+ body: { type: String, required: true },
14
+ screenshot: { type: String },
15
+ attachments: { type: [collabAttachmentSchema], default: undefined },
16
+ }, { timestamps: true, collection: "collab_comments" });
17
+ exports.default = (0, mongoose_1.model)("CollabComment", collabCommentSchema);
@@ -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 { ICollabIntegration } from "./types";
27
+ declare const _default: import("mongoose").Model<ICollabIntegration, {}, {}, {}, import("mongoose").Document<unknown, {}, ICollabIntegration> & ICollabIntegration & {
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 enum_1 = require("./enum");
5
+ const collabIntegrationSchema = new mongoose_1.Schema({
6
+ projectId: { type: mongoose_1.Schema.Types.ObjectId, ref: "Project", required: true, index: true },
7
+ type: {
8
+ type: String,
9
+ enum: Object.values(enum_1.COLLAB_INTEGRATION_TYPE),
10
+ required: true,
11
+ },
12
+ webhookUrl: { type: String, required: true },
13
+ channelName: { type: String },
14
+ enabled: { type: Boolean, default: true },
15
+ }, { timestamps: true, collection: "collab_integrations" });
16
+ exports.default = (0, mongoose_1.model)("CollabIntegration", collabIntegrationSchema);
@@ -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 { ICollabSettings } from "./types";
27
+ declare const _default: import("mongoose").Model<ICollabSettings, {}, {}, {}, import("mongoose").Document<unknown, {}, ICollabSettings> & ICollabSettings & {
28
+ _id: import("mongoose").Types.ObjectId;
29
+ }, any>;
30
+ export default _default;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const mongoose_1 = require("mongoose");
4
+ const enum_1 = require("./enum");
5
+ const collabSettingsSchema = new mongoose_1.Schema({
6
+ userId: { type: mongoose_1.Schema.Types.ObjectId, ref: "User", required: true },
7
+ projectId: { type: mongoose_1.Schema.Types.ObjectId, ref: "Project", required: true },
8
+ pushNotifications: { type: Boolean, default: false },
9
+ slackUrl: { type: String },
10
+ discordUrl: { type: String },
11
+ theme: {
12
+ type: String,
13
+ enum: Object.values(enum_1.COLLAB_THEME),
14
+ default: enum_1.COLLAB_THEME.SYSTEM,
15
+ },
16
+ toolbarPosition: {
17
+ type: String,
18
+ enum: Object.values(enum_1.COLLAB_TOOLBAR_POSITION),
19
+ default: enum_1.COLLAB_TOOLBAR_POSITION.BOTTOM,
20
+ },
21
+ hasOnboarded: { type: Boolean, default: false },
22
+ }, { timestamps: true, collection: "collab_settings" });
23
+ collabSettingsSchema.index({ userId: 1, projectId: 1 }, { unique: true });
24
+ exports.default = (0, mongoose_1.model)("CollabSettings", collabSettingsSchema);
@@ -168,3 +168,25 @@ export declare enum NomadDeploymentStatus {
168
168
  NOMAD_READY = "nomad_ready",
169
169
  NOMAD_FAILED = "nomad_failed"
170
170
  }
171
+ export declare enum BRANCH_TYPE {
172
+ USER_CREATED = "USER_CREATED",
173
+ PREVIEW = "PREVIEW"
174
+ }
175
+ export declare enum COLLAB_ANNOTATION_STATUS {
176
+ OPEN = "open",
177
+ RESOLVED = "resolved"
178
+ }
179
+ export declare enum COLLAB_INTEGRATION_TYPE {
180
+ SLACK = "slack",
181
+ DISCORD = "discord"
182
+ }
183
+ export declare enum COLLAB_THEME {
184
+ LIGHT = "light",
185
+ DARK = "dark",
186
+ SYSTEM = "system"
187
+ }
188
+ export declare enum COLLAB_TOOLBAR_POSITION {
189
+ LEFT = "left",
190
+ BOTTOM = "bottom",
191
+ RIGHT = "right"
192
+ }
@@ -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.COLLAB_TOOLBAR_POSITION = exports.COLLAB_THEME = exports.COLLAB_INTEGRATION_TYPE = exports.COLLAB_ANNOTATION_STATUS = 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,30 @@ 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 = {}));
205
+ var COLLAB_ANNOTATION_STATUS;
206
+ (function (COLLAB_ANNOTATION_STATUS) {
207
+ COLLAB_ANNOTATION_STATUS["OPEN"] = "open";
208
+ COLLAB_ANNOTATION_STATUS["RESOLVED"] = "resolved";
209
+ })(COLLAB_ANNOTATION_STATUS = exports.COLLAB_ANNOTATION_STATUS || (exports.COLLAB_ANNOTATION_STATUS = {}));
210
+ var COLLAB_INTEGRATION_TYPE;
211
+ (function (COLLAB_INTEGRATION_TYPE) {
212
+ COLLAB_INTEGRATION_TYPE["SLACK"] = "slack";
213
+ COLLAB_INTEGRATION_TYPE["DISCORD"] = "discord";
214
+ })(COLLAB_INTEGRATION_TYPE = exports.COLLAB_INTEGRATION_TYPE || (exports.COLLAB_INTEGRATION_TYPE = {}));
215
+ var COLLAB_THEME;
216
+ (function (COLLAB_THEME) {
217
+ COLLAB_THEME["LIGHT"] = "light";
218
+ COLLAB_THEME["DARK"] = "dark";
219
+ COLLAB_THEME["SYSTEM"] = "system";
220
+ })(COLLAB_THEME = exports.COLLAB_THEME || (exports.COLLAB_THEME = {}));
221
+ var COLLAB_TOOLBAR_POSITION;
222
+ (function (COLLAB_TOOLBAR_POSITION) {
223
+ COLLAB_TOOLBAR_POSITION["LEFT"] = "left";
224
+ COLLAB_TOOLBAR_POSITION["BOTTOM"] = "bottom";
225
+ COLLAB_TOOLBAR_POSITION["RIGHT"] = "right";
226
+ })(COLLAB_TOOLBAR_POSITION = exports.COLLAB_TOOLBAR_POSITION || (exports.COLLAB_TOOLBAR_POSITION = {}));
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,13 @@ 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 { 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 } from "./types";
39
- 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 } from "./enum";
38
+ export { default as Branch } from "./branch";
39
+ export { default as CollabAnnotation } from "./collab-annotation";
40
+ export { default as CollabComment } from "./collab-comment";
41
+ export { default as CollabIntegration } from "./collab-integration";
42
+ export { default as CollabSettings } from "./collab-settings";
43
+ 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, ICollabAnnotation, ICollabComment, ICollabAttachment, ICollabIntegration, ICollabSettings } from "./types";
44
+ 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, COLLAB_ANNOTATION_STATUS, COLLAB_INTEGRATION_TYPE, COLLAB_THEME, COLLAB_TOOLBAR_POSITION } from "./enum";
40
45
  import mongoose from "mongoose";
41
46
  export declare const connectToMongo: (mongoUrl: string, config?: mongoose.ConnectOptions) => Promise<void>;
42
47
  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.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.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.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.ROLES = exports.SERVER_STATUS = exports.ENVIRONMENT = exports.OAUTH_PERMISSIONS = exports.INTEGRATION_PROVIDERS = exports.INTEGRATION_TYPES = exports.GIT_TYPE = exports.CollabSettings = exports.CollabIntegration = exports.CollabComment = exports.CollabAnnotation = 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.COLLAB_TOOLBAR_POSITION = exports.COLLAB_THEME = exports.COLLAB_INTEGRATION_TYPE = exports.COLLAB_ANNOTATION_STATUS = 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 = exports.CARD_TYPES = exports.SUBSCRIPTION_STATUS = exports.PROJECT_STATUS = exports.SUBSCRIPTION_PLAN_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,16 @@ 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; } });
94
+ var collab_annotation_1 = require("./collab-annotation");
95
+ Object.defineProperty(exports, "CollabAnnotation", { enumerable: true, get: function () { return __importDefault(collab_annotation_1).default; } });
96
+ var collab_comment_1 = require("./collab-comment");
97
+ Object.defineProperty(exports, "CollabComment", { enumerable: true, get: function () { return __importDefault(collab_comment_1).default; } });
98
+ var collab_integration_1 = require("./collab-integration");
99
+ Object.defineProperty(exports, "CollabIntegration", { enumerable: true, get: function () { return __importDefault(collab_integration_1).default; } });
100
+ var collab_settings_1 = require("./collab-settings");
101
+ Object.defineProperty(exports, "CollabSettings", { enumerable: true, get: function () { return __importDefault(collab_settings_1).default; } });
92
102
  var enum_1 = require("./enum");
93
103
  Object.defineProperty(exports, "GIT_TYPE", { enumerable: true, get: function () { return enum_1.GIT_TYPE; } });
94
104
  Object.defineProperty(exports, "INTEGRATION_TYPES", { enumerable: true, get: function () { return enum_1.INTEGRATION_TYPES; } });
@@ -114,6 +124,11 @@ Object.defineProperty(exports, "SERVER_PROTOCOL", { enumerable: true, get: funct
114
124
  Object.defineProperty(exports, "FrameworkApplicationType", { enumerable: true, get: function () { return enum_1.FrameworkApplicationType; } });
115
125
  Object.defineProperty(exports, "DomainRenewalStatus", { enumerable: true, get: function () { return enum_1.DomainRenewalStatus; } });
116
126
  Object.defineProperty(exports, "NomadDeploymentStatus", { enumerable: true, get: function () { return enum_1.NomadDeploymentStatus; } });
127
+ Object.defineProperty(exports, "BRANCH_TYPE", { enumerable: true, get: function () { return enum_1.BRANCH_TYPE; } });
128
+ Object.defineProperty(exports, "COLLAB_ANNOTATION_STATUS", { enumerable: true, get: function () { return enum_1.COLLAB_ANNOTATION_STATUS; } });
129
+ Object.defineProperty(exports, "COLLAB_INTEGRATION_TYPE", { enumerable: true, get: function () { return enum_1.COLLAB_INTEGRATION_TYPE; } });
130
+ Object.defineProperty(exports, "COLLAB_THEME", { enumerable: true, get: function () { return enum_1.COLLAB_THEME; } });
131
+ Object.defineProperty(exports, "COLLAB_TOOLBAR_POSITION", { enumerable: true, get: function () { return enum_1.COLLAB_TOOLBAR_POSITION; } });
117
132
  const mongoose_1 = __importDefault(require("mongoose"));
118
133
  const utils_1 = require("@brimble/utils");
119
134
  const connectToMongo = (mongoUrl, config) => __awaiter(void 0, void 0, void 0, function* () {
@@ -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
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,20 @@
1
+ import { Document } from "mongoose";
2
+ import { COLLAB_ANNOTATION_STATUS } from "../enum";
3
+ import { IUser } from "./user";
4
+ import { IProject } from "./project";
5
+ export interface ICollabAnnotation extends Document {
6
+ projectId: IProject;
7
+ userId: IUser;
8
+ pageUrl: string;
9
+ pagePath: string;
10
+ xPercent: number;
11
+ yPercent: number;
12
+ elementSelector?: string;
13
+ elementOffsetX?: number;
14
+ elementOffsetY?: number;
15
+ status: COLLAB_ANNOTATION_STATUS;
16
+ resolvedAt?: Date;
17
+ resolvedBy?: IUser;
18
+ createdAt: Date;
19
+ updatedAt: Date;
20
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,18 @@
1
+ import { Document } from "mongoose";
2
+ import { IUser } from "./user";
3
+ import { ICollabAnnotation } from "./collab-annotation";
4
+ export interface ICollabAttachment {
5
+ url: string;
6
+ fileName: string;
7
+ fileType: string;
8
+ fileSize: number;
9
+ }
10
+ export interface ICollabComment extends Document {
11
+ annotationId: ICollabAnnotation;
12
+ userId: IUser;
13
+ body: string;
14
+ screenshot?: string;
15
+ attachments?: ICollabAttachment[];
16
+ createdAt: Date;
17
+ updatedAt: Date;
18
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,11 @@
1
+ import { Document } from "mongoose";
2
+ import { COLLAB_INTEGRATION_TYPE } from "../enum";
3
+ import { IProject } from "./project";
4
+ export interface ICollabIntegration extends Document {
5
+ projectId: IProject;
6
+ type: COLLAB_INTEGRATION_TYPE;
7
+ webhookUrl: string;
8
+ channelName?: string;
9
+ enabled: boolean;
10
+ createdAt: Date;
11
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,16 @@
1
+ import { Document } from "mongoose";
2
+ import { COLLAB_THEME, COLLAB_TOOLBAR_POSITION } from "../enum";
3
+ import { IUser } from "./user";
4
+ import { IProject } from "./project";
5
+ export interface ICollabSettings extends Document {
6
+ userId: IUser;
7
+ projectId: IProject;
8
+ pushNotifications: boolean;
9
+ slackUrl?: string;
10
+ discordUrl?: string;
11
+ theme: COLLAB_THEME;
12
+ toolbarPosition: COLLAB_TOOLBAR_POSITION;
13
+ hasOnboarded: boolean;
14
+ createdAt: Date;
15
+ updatedAt: Date;
16
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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;
@@ -1,4 +1,5 @@
1
1
  export type { IAutoScalingGroup } from "./auto-scaling-group";
2
+ export type { IBranch } from "./branch";
2
3
  export type { ICard } from "./card";
3
4
  export type { IComputeChange } from "./compute";
4
5
  export type { IDbImage } from "./db-image";
@@ -37,3 +38,7 @@ export type { IWallet } from "./wallet";
37
38
  export type { IWebhookCategory } from "./webhook-category";
38
39
  export type { IWebhookEvent } from "./webhook-event";
39
40
  export type { IWebhookSetting } from "./webhook-setting";
41
+ export type { ICollabAnnotation } from "./collab-annotation";
42
+ export type { ICollabComment, ICollabAttachment } from "./collab-comment";
43
+ export type { ICollabIntegration } from "./collab-integration";
44
+ export type { ICollabSettings } from "./collab-settings";
@@ -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
@@ -193,3 +193,30 @@ export enum NomadDeploymentStatus {
193
193
  NOMAD_READY = 'nomad_ready',
194
194
  NOMAD_FAILED = 'nomad_failed',
195
195
  }
196
+
197
+ export enum BRANCH_TYPE {
198
+ USER_CREATED = "USER_CREATED",
199
+ PREVIEW = "PREVIEW",
200
+ }
201
+
202
+ export enum COLLAB_ANNOTATION_STATUS {
203
+ OPEN = "open",
204
+ RESOLVED = "resolved",
205
+ }
206
+
207
+ export enum COLLAB_INTEGRATION_TYPE {
208
+ SLACK = "slack",
209
+ DISCORD = "discord",
210
+ }
211
+
212
+ export enum COLLAB_THEME {
213
+ LIGHT = "light",
214
+ DARK = "dark",
215
+ SYSTEM = "system",
216
+ }
217
+
218
+ export enum COLLAB_TOOLBAR_POSITION {
219
+ LEFT = "left",
220
+ BOTTOM = "bottom",
221
+ RIGHT = "right",
222
+ }
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,11 @@ 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";
39
+ export { default as CollabAnnotation } from "./collab-annotation";
40
+ export { default as CollabComment } from "./collab-comment";
41
+ export { default as CollabIntegration } from "./collab-integration";
42
+ export { default as CollabSettings } from "./collab-settings";
38
43
 
39
44
  export {
40
45
  IUser,
@@ -76,7 +81,13 @@ export {
76
81
  IWebhookEvent,
77
82
  IWebhookSetting,
78
83
  IIntention,
79
- IProvider
84
+ IProvider,
85
+ IBranch,
86
+ ICollabAnnotation,
87
+ ICollabComment,
88
+ ICollabAttachment,
89
+ ICollabIntegration,
90
+ ICollabSettings
80
91
  } from "./types";
81
92
  export {
82
93
  GIT_TYPE,
@@ -102,7 +113,12 @@ export {
102
113
  SERVER_PROTOCOL,
103
114
  FrameworkApplicationType,
104
115
  DomainRenewalStatus,
105
- NomadDeploymentStatus
116
+ NomadDeploymentStatus,
117
+ BRANCH_TYPE,
118
+ COLLAB_ANNOTATION_STATUS,
119
+ COLLAB_INTEGRATION_TYPE,
120
+ COLLAB_THEME,
121
+ COLLAB_TOOLBAR_POSITION
106
122
  } from "./enum";
107
123
 
108
124
  import mongoose from "mongoose";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brimble/models",
3
- "version": "3.7.6",
3
+ "version": "3.7.8",
4
4
  "description": "Brimble models",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/project/index.ts CHANGED
@@ -131,6 +131,12 @@ const projectSchema = new Schema(
131
131
  type: Schema.Types.ObjectId,
132
132
  },
133
133
  ],
134
+ branches: [
135
+ {
136
+ ref: "Branch",
137
+ type: Schema.Types.ObjectId,
138
+ },
139
+ ],
134
140
  replicas: {
135
141
  type: Number,
136
142
  default: 3,
@@ -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
+ }
@@ -0,0 +1,21 @@
1
+ import { Document } from "mongoose";
2
+ import { COLLAB_ANNOTATION_STATUS } from "../enum";
3
+ import { IUser } from "./user";
4
+ import { IProject } from "./project";
5
+
6
+ export interface ICollabAnnotation extends Document {
7
+ projectId: IProject;
8
+ userId: IUser;
9
+ pageUrl: string;
10
+ pagePath: string;
11
+ xPercent: number;
12
+ yPercent: number;
13
+ elementSelector?: string;
14
+ elementOffsetX?: number;
15
+ elementOffsetY?: number;
16
+ status: COLLAB_ANNOTATION_STATUS;
17
+ resolvedAt?: Date;
18
+ resolvedBy?: IUser;
19
+ createdAt: Date;
20
+ updatedAt: Date;
21
+ }
@@ -0,0 +1,20 @@
1
+ import { Document } from "mongoose";
2
+ import { IUser } from "./user";
3
+ import { ICollabAnnotation } from "./collab-annotation";
4
+
5
+ export interface ICollabAttachment {
6
+ url: string;
7
+ fileName: string;
8
+ fileType: string;
9
+ fileSize: number;
10
+ }
11
+
12
+ export interface ICollabComment extends Document {
13
+ annotationId: ICollabAnnotation;
14
+ userId: IUser;
15
+ body: string;
16
+ screenshot?: string;
17
+ attachments?: ICollabAttachment[];
18
+ createdAt: Date;
19
+ updatedAt: Date;
20
+ }
@@ -0,0 +1,12 @@
1
+ import { Document } from "mongoose";
2
+ import { COLLAB_INTEGRATION_TYPE } from "../enum";
3
+ import { IProject } from "./project";
4
+
5
+ export interface ICollabIntegration extends Document {
6
+ projectId: IProject;
7
+ type: COLLAB_INTEGRATION_TYPE;
8
+ webhookUrl: string;
9
+ channelName?: string;
10
+ enabled: boolean;
11
+ createdAt: Date;
12
+ }
@@ -0,0 +1,17 @@
1
+ import { Document } from "mongoose";
2
+ import { COLLAB_THEME, COLLAB_TOOLBAR_POSITION } from "../enum";
3
+ import { IUser } from "./user";
4
+ import { IProject } from "./project";
5
+
6
+ export interface ICollabSettings extends Document {
7
+ userId: IUser;
8
+ projectId: IProject;
9
+ pushNotifications: boolean;
10
+ slackUrl?: string;
11
+ discordUrl?: string;
12
+ theme: COLLAB_THEME;
13
+ toolbarPosition: COLLAB_TOOLBAR_POSITION;
14
+ hasOnboarded: boolean;
15
+ createdAt: Date;
16
+ updatedAt: Date;
17
+ }
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,4 +1,5 @@
1
1
  export type { IAutoScalingGroup } from "./auto-scaling-group";
2
+ export type { IBranch } from "./branch";
2
3
  export type { ICard } from "./card";
3
4
  export type { IComputeChange } from "./compute";
4
5
  export type { IDbImage } from "./db-image";
@@ -37,3 +38,7 @@ export type { IWallet } from "./wallet";
37
38
  export type { IWebhookCategory } from "./webhook-category";
38
39
  export type { IWebhookEvent } from "./webhook-event";
39
40
  export type { IWebhookSetting } from "./webhook-setting";
41
+ export type { ICollabAnnotation } from "./collab-annotation";
42
+ export type { ICollabComment, ICollabAttachment } from "./collab-comment";
43
+ export type { ICollabIntegration } from "./collab-integration";
44
+ export type { ICollabSettings } from "./collab-settings";
@@ -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;