@brimble/models 1.3.23 → 1.3.24

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/dist/index.d.ts CHANGED
@@ -7,7 +7,8 @@ export { default as Env } from "./env";
7
7
  export { default as Token } from "./token";
8
8
  export { default as Team } from "./team";
9
9
  export { default as Member } from "./member";
10
- export { IUser, IGit, IProject, IFollowing, IIntegration, IEnv, IDomain, IToken, IMember, ITeam, } from "./types";
10
+ export { default as Invitation } from "./invitation";
11
+ export { IUser, IGit, IProject, IFollowing, IIntegration, IEnv, IDomain, IToken, IMember, ITeam, IInvitation, } from "./types";
11
12
  export { GIT_TYPE, INTEGRATION_TYPE, OAUTH_PERMISSIONS, ENVIRONMENT, ROLES, } from "./enum";
12
13
  export declare const connectToMongo: (mongoUrl: string) => Promise<void>;
13
14
  export declare const closeMongo: () => void;
package/dist/index.js CHANGED
@@ -31,6 +31,8 @@ var team_1 = require("./team");
31
31
  Object.defineProperty(exports, "Team", { enumerable: true, get: function () { return team_1.default; } });
32
32
  var member_1 = require("./member");
33
33
  Object.defineProperty(exports, "Member", { enumerable: true, get: function () { return member_1.default; } });
34
+ var invitation_1 = require("./invitation");
35
+ Object.defineProperty(exports, "Invitation", { enumerable: true, get: function () { return invitation_1.default; } });
34
36
  var enum_1 = require("./enum");
35
37
  Object.defineProperty(exports, "GIT_TYPE", { enumerable: true, get: function () { return enum_1.GIT_TYPE; } });
36
38
  Object.defineProperty(exports, "INTEGRATION_TYPE", { enumerable: true, get: function () { return enum_1.INTEGRATION_TYPE; } });
@@ -0,0 +1,4 @@
1
+ /// <reference types="mongoose" />
2
+ import { IInvitation } from "./types";
3
+ declare const _default: import("mongoose").Model<IInvitation, {}, {}>;
4
+ export default _default;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const mongoose_1 = require("mongoose");
4
+ const invitationSchema = new mongoose_1.Schema({
5
+ email: {
6
+ type: String,
7
+ required: true,
8
+ },
9
+ team: {
10
+ type: mongoose_1.Schema.Types.ObjectId,
11
+ ref: "Team",
12
+ },
13
+ accepted: {
14
+ type: Boolean,
15
+ default: false,
16
+ },
17
+ }, {
18
+ timestamps: true,
19
+ });
20
+ exports.default = mongoose_1.model("Invitation", invitationSchema);
package/dist/team.js CHANGED
@@ -22,6 +22,12 @@ const teamSchema = new mongoose_1.Schema({
22
22
  ref: "Project",
23
23
  },
24
24
  ],
25
+ invitations: [
26
+ {
27
+ type: mongoose_1.Schema.Types.ObjectId,
28
+ ref: "Invitation",
29
+ },
30
+ ],
25
31
  avatar: {
26
32
  type: String,
27
33
  },
@@ -8,3 +8,4 @@ export { IDomain } from "./domain";
8
8
  export { IToken } from "./token";
9
9
  export { ITeam } from "./team";
10
10
  export { IMember } from "./member";
11
+ export { IInvitation } from "./invitation";
@@ -0,0 +1,6 @@
1
+ import { ITeam } from "./team";
2
+ export interface IInvitation extends Document {
3
+ email: string;
4
+ team: ITeam;
5
+ accepted: boolean;
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,8 +1,9 @@
1
- import { IMember, IProject } from "./";
1
+ import { IMember, IProject, IInvitation } from "./";
2
2
  export interface ITeam extends Document {
3
3
  name: string;
4
4
  description: string;
5
5
  members: Array<IMember>;
6
6
  projects: Array<IProject>;
7
+ invitations: Array<IInvitation>;
7
8
  avatar: string;
8
9
  }
package/index.ts CHANGED
@@ -7,6 +7,7 @@ export { default as Env } from "./env";
7
7
  export { default as Token } from "./token";
8
8
  export { default as Team } from "./team";
9
9
  export { default as Member } from "./member";
10
+ export { default as Invitation } from "./invitation";
10
11
  export {
11
12
  IUser,
12
13
  IGit,
@@ -18,6 +19,7 @@ export {
18
19
  IToken,
19
20
  IMember,
20
21
  ITeam,
22
+ IInvitation,
21
23
  } from "./types";
22
24
  export {
23
25
  GIT_TYPE,
package/invitation.ts ADDED
@@ -0,0 +1,24 @@
1
+ import { model, Schema } from "mongoose";
2
+ import { IInvitation } from "./types";
3
+
4
+ const invitationSchema: Schema = new Schema(
5
+ {
6
+ email: {
7
+ type: String,
8
+ required: true,
9
+ },
10
+ team: {
11
+ type: Schema.Types.ObjectId,
12
+ ref: "Team",
13
+ },
14
+ accepted: {
15
+ type: Boolean,
16
+ default: false,
17
+ },
18
+ },
19
+ {
20
+ timestamps: true,
21
+ },
22
+ );
23
+
24
+ export default model<IInvitation>("Invitation", invitationSchema);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brimble/models",
3
- "version": "1.3.23",
3
+ "version": "1.3.24",
4
4
  "description": "Brimble models",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/team.ts CHANGED
@@ -23,6 +23,12 @@ const teamSchema: Schema = new Schema(
23
23
  ref: "Project",
24
24
  },
25
25
  ],
26
+ invitations: [
27
+ {
28
+ type: Schema.Types.ObjectId,
29
+ ref: "Invitation",
30
+ },
31
+ ],
26
32
  avatar: {
27
33
  type: String,
28
34
  },
package/types/index.ts CHANGED
@@ -8,3 +8,4 @@ export { IDomain } from "./domain";
8
8
  export { IToken } from "./token";
9
9
  export { ITeam } from "./team";
10
10
  export { IMember } from "./member";
11
+ export { IInvitation } from "./invitation";
@@ -0,0 +1,7 @@
1
+ import { ITeam } from "./team";
2
+
3
+ export interface IInvitation extends Document {
4
+ email: string;
5
+ team: ITeam;
6
+ accepted: boolean;
7
+ }
package/types/team.ts CHANGED
@@ -1,9 +1,10 @@
1
- import { IMember, IProject } from "./";
1
+ import { IMember, IProject, IInvitation } from "./";
2
2
 
3
3
  export interface ITeam extends Document {
4
4
  name: string;
5
5
  description: string;
6
6
  members: Array<IMember>;
7
7
  projects: Array<IProject>;
8
+ invitations: Array<IInvitation>;
8
9
  avatar: string;
9
10
  }