@brimble/models 3.7.8 → 3.7.9

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/collab-comment.ts CHANGED
@@ -14,10 +14,12 @@ const collabAttachmentSchema = new Schema<ICollabAttachment>(
14
14
  const collabCommentSchema = new Schema(
15
15
  {
16
16
  annotationId: { type: Schema.Types.ObjectId, ref: "CollabAnnotation", required: true, index: true },
17
- userId: { type: Schema.Types.ObjectId, ref: "User", required: true },
17
+ userId: { type: Schema.Types.ObjectId, ref: "User" },
18
18
  body: { type: String, required: true },
19
19
  screenshot: { type: String },
20
20
  attachments: { type: [collabAttachmentSchema], default: undefined },
21
+ guestName: { type: String },
22
+ guestEmail: { type: String },
21
23
  },
22
24
  { timestamps: true, collection: "collab_comments" },
23
25
  );
@@ -0,0 +1,15 @@
1
+ import { model, Schema } from "mongoose";
2
+ import { ICollabShareToken } from "./types";
3
+
4
+ const collabShareTokenSchema = new Schema(
5
+ {
6
+ projectId: { type: Schema.Types.ObjectId, ref: "Project", required: true, index: true },
7
+ createdBy: { type: Schema.Types.ObjectId, ref: "User", required: true },
8
+ token: { type: String, required: true, unique: true },
9
+ expiresAt: { type: Date },
10
+ isActive: { type: Boolean, default: true },
11
+ },
12
+ { timestamps: true, collection: "collab_share_tokens" },
13
+ );
14
+
15
+ export default model<ICollabShareToken>("CollabShareToken", collabShareTokenSchema);
@@ -9,9 +9,11 @@ const collabAttachmentSchema = new mongoose_1.Schema({
9
9
  }, { _id: false });
10
10
  const collabCommentSchema = new mongoose_1.Schema({
11
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 },
12
+ userId: { type: mongoose_1.Schema.Types.ObjectId, ref: "User" },
13
13
  body: { type: String, required: true },
14
14
  screenshot: { type: String },
15
15
  attachments: { type: [collabAttachmentSchema], default: undefined },
16
+ guestName: { type: String },
17
+ guestEmail: { type: String },
16
18
  }, { timestamps: true, collection: "collab_comments" });
17
19
  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 { ICollabShareToken } from "./types";
27
+ declare const _default: import("mongoose").Model<ICollabShareToken, {}, {}, {}, import("mongoose").Document<unknown, {}, ICollabShareToken> & ICollabShareToken & {
28
+ _id: import("mongoose").Types.ObjectId;
29
+ }, any>;
30
+ export default _default;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const mongoose_1 = require("mongoose");
4
+ const collabShareTokenSchema = new mongoose_1.Schema({
5
+ projectId: { type: mongoose_1.Schema.Types.ObjectId, ref: "Project", required: true, index: true },
6
+ createdBy: { type: mongoose_1.Schema.Types.ObjectId, ref: "User", required: true },
7
+ token: { type: String, required: true, unique: true },
8
+ expiresAt: { type: Date },
9
+ isActive: { type: Boolean, default: true },
10
+ }, { timestamps: true, collection: "collab_share_tokens" });
11
+ exports.default = (0, mongoose_1.model)("CollabShareToken", collabShareTokenSchema);
package/dist/index.d.ts CHANGED
@@ -40,7 +40,8 @@ export { default as CollabAnnotation } from "./collab-annotation";
40
40
  export { default as CollabComment } from "./collab-comment";
41
41
  export { default as CollabIntegration } from "./collab-integration";
42
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";
43
+ export { default as CollabShareToken } from "./collab-share-token";
44
+ 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, ICollabShareToken } from "./types";
44
45
  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";
45
46
  import mongoose from "mongoose";
46
47
  export declare const connectToMongo: (mongoUrl: string, config?: mongoose.ConnectOptions) => Promise<void>;
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.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;
15
+ exports.SERVER_STATUS = exports.ENVIRONMENT = exports.OAUTH_PERMISSIONS = exports.INTEGRATION_PROVIDERS = exports.INTEGRATION_TYPES = exports.GIT_TYPE = exports.CollabShareToken = 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 = exports.ROLES = 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");
@@ -99,6 +99,8 @@ var collab_integration_1 = require("./collab-integration");
99
99
  Object.defineProperty(exports, "CollabIntegration", { enumerable: true, get: function () { return __importDefault(collab_integration_1).default; } });
100
100
  var collab_settings_1 = require("./collab-settings");
101
101
  Object.defineProperty(exports, "CollabSettings", { enumerable: true, get: function () { return __importDefault(collab_settings_1).default; } });
102
+ var collab_share_token_1 = require("./collab-share-token");
103
+ Object.defineProperty(exports, "CollabShareToken", { enumerable: true, get: function () { return __importDefault(collab_share_token_1).default; } });
102
104
  var enum_1 = require("./enum");
103
105
  Object.defineProperty(exports, "GIT_TYPE", { enumerable: true, get: function () { return enum_1.GIT_TYPE; } });
104
106
  Object.defineProperty(exports, "INTEGRATION_TYPES", { enumerable: true, get: function () { return enum_1.INTEGRATION_TYPES; } });
@@ -9,10 +9,12 @@ export interface ICollabAttachment {
9
9
  }
10
10
  export interface ICollabComment extends Document {
11
11
  annotationId: ICollabAnnotation;
12
- userId: IUser;
12
+ userId?: IUser;
13
13
  body: string;
14
14
  screenshot?: string;
15
15
  attachments?: ICollabAttachment[];
16
+ guestName?: string;
17
+ guestEmail?: string;
16
18
  createdAt: Date;
17
19
  updatedAt: Date;
18
20
  }
@@ -0,0 +1,12 @@
1
+ import { Document } from "mongoose";
2
+ import { IUser } from "./user";
3
+ import { IProject } from "./project";
4
+ export interface ICollabShareToken extends Document {
5
+ projectId: IProject;
6
+ createdBy: IUser;
7
+ token: string;
8
+ expiresAt?: Date;
9
+ isActive: boolean;
10
+ createdAt: Date;
11
+ updatedAt: Date;
12
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -42,3 +42,4 @@ export type { ICollabAnnotation } from "./collab-annotation";
42
42
  export type { ICollabComment, ICollabAttachment } from "./collab-comment";
43
43
  export type { ICollabIntegration } from "./collab-integration";
44
44
  export type { ICollabSettings } from "./collab-settings";
45
+ export type { ICollabShareToken } from "./collab-share-token";
package/index.ts CHANGED
@@ -40,6 +40,7 @@ export { default as CollabAnnotation } from "./collab-annotation";
40
40
  export { default as CollabComment } from "./collab-comment";
41
41
  export { default as CollabIntegration } from "./collab-integration";
42
42
  export { default as CollabSettings } from "./collab-settings";
43
+ export { default as CollabShareToken } from "./collab-share-token";
43
44
 
44
45
  export {
45
46
  IUser,
@@ -87,7 +88,8 @@ export {
87
88
  ICollabComment,
88
89
  ICollabAttachment,
89
90
  ICollabIntegration,
90
- ICollabSettings
91
+ ICollabSettings,
92
+ ICollabShareToken
91
93
  } from "./types";
92
94
  export {
93
95
  GIT_TYPE,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brimble/models",
3
- "version": "3.7.8",
3
+ "version": "3.7.9",
4
4
  "description": "Brimble models",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -11,10 +11,12 @@ export interface ICollabAttachment {
11
11
 
12
12
  export interface ICollabComment extends Document {
13
13
  annotationId: ICollabAnnotation;
14
- userId: IUser;
14
+ userId?: IUser;
15
15
  body: string;
16
16
  screenshot?: string;
17
17
  attachments?: ICollabAttachment[];
18
+ guestName?: string;
19
+ guestEmail?: string;
18
20
  createdAt: Date;
19
21
  updatedAt: Date;
20
22
  }
@@ -0,0 +1,13 @@
1
+ import { Document } from "mongoose";
2
+ import { IUser } from "./user";
3
+ import { IProject } from "./project";
4
+
5
+ export interface ICollabShareToken extends Document {
6
+ projectId: IProject;
7
+ createdBy: IUser;
8
+ token: string;
9
+ expiresAt?: Date;
10
+ isActive: boolean;
11
+ createdAt: Date;
12
+ updatedAt: Date;
13
+ }
package/types/index.ts CHANGED
@@ -42,3 +42,4 @@ export type { ICollabAnnotation } from "./collab-annotation";
42
42
  export type { ICollabComment, ICollabAttachment } from "./collab-comment";
43
43
  export type { ICollabIntegration } from "./collab-integration";
44
44
  export type { ICollabSettings } from "./collab-settings";
45
+ export type { ICollabShareToken } from "./collab-share-token";