@brimble/models 3.7.92 → 3.7.94

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.
@@ -22,6 +22,10 @@ const collabAnnotationSchema = new Schema(
22
22
  resolvedBy: { type: Schema.Types.ObjectId, ref: "User" },
23
23
  guestName: { type: String },
24
24
  guestEmail: { type: String },
25
+ githubPrCommentId: { type: Number },
26
+ githubPrCommentUrl: { type: String },
27
+ githubIssueUrl: { type: String },
28
+ githubIssueNumber: { type: Number },
25
29
  },
26
30
  { timestamps: true, collection: "annotations" },
27
31
  );
@@ -5,6 +5,7 @@ import { ICollabIntegration } from "./types";
5
5
  const collabIntegrationSchema = new Schema(
6
6
  {
7
7
  projectId: { type: Schema.Types.ObjectId, ref: "Project", required: true, index: true },
8
+ userId: { type: Schema.Types.ObjectId, ref: "User", index: true },
8
9
  type: {
9
10
  type: String,
10
11
  enum: Object.values(COLLAB_INTEGRATION_TYPE),
@@ -0,0 +1,19 @@
1
+ import { model, Schema } from "mongoose";
2
+ import { ICollabPushSubscription } from "./types";
3
+
4
+ const collabPushSubscriptionSchema = new Schema(
5
+ {
6
+ userId: { type: Schema.Types.ObjectId, ref: "User", required: true, index: true },
7
+ endpoint: { type: String, required: true, unique: true },
8
+ keys: {
9
+ p256dh: { type: String, required: true },
10
+ auth: { type: String, required: true },
11
+ },
12
+ domain: { type: String, required: true, index: true },
13
+ },
14
+ { timestamps: { createdAt: true, updatedAt: false }, collection: "push_subscriptions" }
15
+ );
16
+
17
+ collabPushSubscriptionSchema.index({ userId: 1, domain: 1 });
18
+
19
+ export default model<ICollabPushSubscription>("CollabPushSubscription", collabPushSubscriptionSchema);
@@ -21,6 +21,10 @@ const collabAnnotationSchema = new mongoose_1.Schema({
21
21
  resolvedBy: { type: mongoose_1.Schema.Types.ObjectId, ref: "User" },
22
22
  guestName: { type: String },
23
23
  guestEmail: { type: String },
24
+ githubPrCommentId: { type: Number },
25
+ githubPrCommentUrl: { type: String },
26
+ githubIssueUrl: { type: String },
27
+ githubIssueNumber: { type: Number },
24
28
  }, { timestamps: true, collection: "annotations" });
25
29
  collabAnnotationSchema.index({ projectId: 1, pagePath: 1, status: 1 });
26
30
  exports.default = (0, mongoose_1.model)("CollabAnnotation", collabAnnotationSchema);
@@ -4,6 +4,7 @@ const mongoose_1 = require("mongoose");
4
4
  const enum_1 = require("./enum");
5
5
  const collabIntegrationSchema = new mongoose_1.Schema({
6
6
  projectId: { type: mongoose_1.Schema.Types.ObjectId, ref: "Project", required: true, index: true },
7
+ userId: { type: mongoose_1.Schema.Types.ObjectId, ref: "User", index: true },
7
8
  type: {
8
9
  type: String,
9
10
  enum: Object.values(enum_1.COLLAB_INTEGRATION_TYPE),
@@ -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 { ICollabPushSubscription } from "./types";
27
+ declare const _default: import("mongoose").Model<ICollabPushSubscription, {}, {}, {}, import("mongoose").Document<unknown, {}, ICollabPushSubscription> & ICollabPushSubscription & {
28
+ _id: import("mongoose").Types.ObjectId;
29
+ }, any>;
30
+ export default _default;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const mongoose_1 = require("mongoose");
4
+ const collabPushSubscriptionSchema = new mongoose_1.Schema({
5
+ userId: { type: mongoose_1.Schema.Types.ObjectId, ref: "User", required: true, index: true },
6
+ endpoint: { type: String, required: true, unique: true },
7
+ keys: {
8
+ p256dh: { type: String, required: true },
9
+ auth: { type: String, required: true },
10
+ },
11
+ domain: { type: String, required: true, index: true },
12
+ }, { timestamps: { createdAt: true, updatedAt: false }, collection: "push_subscriptions" });
13
+ collabPushSubscriptionSchema.index({ userId: 1, domain: 1 });
14
+ exports.default = (0, mongoose_1.model)("CollabPushSubscription", collabPushSubscriptionSchema);
package/dist/index.d.ts CHANGED
@@ -41,7 +41,8 @@ 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
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
+ export { default as CollabPushSubscription } from "./collab-push-subscription";
45
+ 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, ICollabPushSubscription } from "./types";
45
46
  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";
46
47
  import mongoose from "mongoose";
47
48
  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.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;
15
+ exports.ENVIRONMENT = exports.OAUTH_PERMISSIONS = exports.INTEGRATION_PROVIDERS = exports.INTEGRATION_TYPES = exports.GIT_TYPE = exports.CollabPushSubscription = 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 = exports.SERVER_STATUS = 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");
@@ -101,6 +101,8 @@ var collab_settings_1 = require("./collab-settings");
101
101
  Object.defineProperty(exports, "CollabSettings", { enumerable: true, get: function () { return __importDefault(collab_settings_1).default; } });
102
102
  var collab_share_token_1 = require("./collab-share-token");
103
103
  Object.defineProperty(exports, "CollabShareToken", { enumerable: true, get: function () { return __importDefault(collab_share_token_1).default; } });
104
+ var collab_push_subscription_1 = require("./collab-push-subscription");
105
+ Object.defineProperty(exports, "CollabPushSubscription", { enumerable: true, get: function () { return __importDefault(collab_push_subscription_1).default; } });
104
106
  var enum_1 = require("./enum");
105
107
  Object.defineProperty(exports, "GIT_TYPE", { enumerable: true, get: function () { return enum_1.GIT_TYPE; } });
106
108
  Object.defineProperty(exports, "INTEGRATION_TYPES", { enumerable: true, get: function () { return enum_1.INTEGRATION_TYPES; } });
@@ -17,6 +17,10 @@ export interface ICollabAnnotation extends Document {
17
17
  resolvedBy?: IUser;
18
18
  guestName?: string;
19
19
  guestEmail?: string;
20
+ githubPrCommentId?: number;
21
+ githubPrCommentUrl?: string;
22
+ githubIssueUrl?: string;
23
+ githubIssueNumber?: number;
20
24
  createdAt: Date;
21
25
  updatedAt: Date;
22
26
  }
@@ -1,8 +1,10 @@
1
1
  import { Document } from "mongoose";
2
2
  import { COLLAB_INTEGRATION_TYPE } from "../enum";
3
3
  import { IProject } from "./project";
4
+ import { IUser } from "./user";
4
5
  export interface ICollabIntegration extends Document {
5
6
  projectId: IProject;
7
+ userId: IUser;
6
8
  type: COLLAB_INTEGRATION_TYPE;
7
9
  webhookUrl: string;
8
10
  channelName?: string;
@@ -0,0 +1,12 @@
1
+ import { Document } from "mongoose";
2
+ import { IUser } from "./user";
3
+ export interface ICollabPushSubscription extends Document {
4
+ userId: IUser;
5
+ endpoint: string;
6
+ keys: {
7
+ p256dh: string;
8
+ auth: string;
9
+ };
10
+ domain: string;
11
+ createdAt: Date;
12
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -43,3 +43,4 @@ export type { ICollabComment, ICollabAttachment } from "./collab-comment";
43
43
  export type { ICollabIntegration } from "./collab-integration";
44
44
  export type { ICollabSettings } from "./collab-settings";
45
45
  export type { ICollabShareToken } from "./collab-share-token";
46
+ export type { ICollabPushSubscription } from "./collab-push-subscription";
package/index.ts CHANGED
@@ -41,6 +41,7 @@ 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
43
  export { default as CollabShareToken } from "./collab-share-token";
44
+ export { default as CollabPushSubscription } from "./collab-push-subscription";
44
45
 
45
46
  export {
46
47
  IUser,
@@ -89,7 +90,8 @@ export {
89
90
  ICollabAttachment,
90
91
  ICollabIntegration,
91
92
  ICollabSettings,
92
- ICollabShareToken
93
+ ICollabShareToken,
94
+ ICollabPushSubscription
93
95
  } from "./types";
94
96
  export {
95
97
  GIT_TYPE,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brimble/models",
3
- "version": "3.7.92",
3
+ "version": "3.7.94",
4
4
  "description": "Brimble models",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -18,6 +18,10 @@ export interface ICollabAnnotation extends Document {
18
18
  resolvedBy?: IUser;
19
19
  guestName?: string;
20
20
  guestEmail?: string;
21
+ githubPrCommentId?: number;
22
+ githubPrCommentUrl?: string;
23
+ githubIssueUrl?: string;
24
+ githubIssueNumber?: number;
21
25
  createdAt: Date;
22
26
  updatedAt: Date;
23
27
  }
@@ -1,9 +1,11 @@
1
1
  import { Document } from "mongoose";
2
2
  import { COLLAB_INTEGRATION_TYPE } from "../enum";
3
3
  import { IProject } from "./project";
4
+ import { IUser } from "./user";
4
5
 
5
6
  export interface ICollabIntegration extends Document {
6
7
  projectId: IProject;
8
+ userId: IUser;
7
9
  type: COLLAB_INTEGRATION_TYPE;
8
10
  webhookUrl: string;
9
11
  channelName?: string;
@@ -0,0 +1,10 @@
1
+ import { Document } from "mongoose";
2
+ import { IUser } from "./user";
3
+
4
+ export interface ICollabPushSubscription extends Document {
5
+ userId: IUser;
6
+ endpoint: string;
7
+ keys: { p256dh: string; auth: string };
8
+ domain: string;
9
+ createdAt: Date;
10
+ }
package/types/index.ts CHANGED
@@ -43,3 +43,4 @@ export type { ICollabComment, ICollabAttachment } from "./collab-comment";
43
43
  export type { ICollabIntegration } from "./collab-integration";
44
44
  export type { ICollabSettings } from "./collab-settings";
45
45
  export type { ICollabShareToken } from "./collab-share-token";
46
+ export type { ICollabPushSubscription } from "./collab-push-subscription";