@brimble/models 1.3.28 → 1.3.30

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.
@@ -1,2 +1,2 @@
1
- @brimble/models:build: cache hit, replaying output 73010679d79fd4df
1
+ @brimble/models:build: cache hit, replaying output 7193f139fb727167
2
2
  @brimble/models:build: $ tsc -p .
package/dist/index.d.ts CHANGED
@@ -7,8 +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";
11
- export { IUser, IGit, IProject, IFollowing, IIntegration, IEnv, IDomain, IToken, IMember, ITeam, IInvitation, } from "./types";
10
+ export { IUser, IGit, IProject, IFollowing, IIntegration, IEnv, IDomain, IToken, IMember, ITeam, } from "./types";
12
11
  export { GIT_TYPE, INTEGRATION_TYPE, OAUTH_PERMISSIONS, ENVIRONMENT, ROLES, } from "./enum";
13
12
  export declare const connectToMongo: (mongoUrl: string) => Promise<void>;
14
13
  export declare const closeMongo: () => void;
package/dist/index.js CHANGED
@@ -31,8 +31,6 @@ 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; } });
36
34
  var enum_1 = require("./enum");
37
35
  Object.defineProperty(exports, "GIT_TYPE", { enumerable: true, get: function () { return enum_1.GIT_TYPE; } });
38
36
  Object.defineProperty(exports, "INTEGRATION_TYPE", { enumerable: true, get: function () { return enum_1.INTEGRATION_TYPE; } });
@@ -14,6 +14,10 @@ const invitationSchema = new mongoose_1.Schema({
14
14
  type: Boolean,
15
15
  default: false,
16
16
  },
17
+ invitedBy: {
18
+ type: mongoose_1.Schema.Types.ObjectId,
19
+ ref: "User",
20
+ },
17
21
  }, {
18
22
  timestamps: true,
19
23
  });
package/dist/member.js CHANGED
@@ -7,6 +7,7 @@ const memberSchema = new mongoose_1.Schema({
7
7
  type: mongoose_1.Schema.Types.ObjectId,
8
8
  ref: "User",
9
9
  },
10
+ email: String,
10
11
  team: {
11
12
  type: mongoose_1.Schema.Types.ObjectId,
12
13
  ref: "Team",
@@ -20,6 +21,10 @@ const memberSchema = new mongoose_1.Schema({
20
21
  type: Boolean,
21
22
  default: false,
22
23
  },
24
+ invitedBy: {
25
+ type: mongoose_1.Schema.Types.ObjectId,
26
+ ref: "User",
27
+ },
23
28
  }, {
24
29
  timestamps: true,
25
30
  });
package/dist/project.js CHANGED
@@ -29,12 +29,21 @@ const projectSchema = new mongoose_1.Schema({
29
29
  type: mongoose_1.Schema.Types.ObjectId,
30
30
  },
31
31
  ],
32
+ team: {
33
+ ref: "Team",
34
+ type: mongoose_1.Schema.Types.ObjectId,
35
+ },
32
36
  pid: Number,
33
37
  port: Number,
34
38
  dir: String,
35
39
  buildCommand: String,
36
40
  outputDirectory: String,
41
+ installCommand: String,
37
42
  repo: Object,
38
43
  rootDir: String,
44
+ isPrivate: {
45
+ type: Boolean,
46
+ default: false,
47
+ },
39
48
  }, { timestamps: true });
40
49
  exports.default = mongoose_1.model("Project", projectSchema);
package/dist/team.js CHANGED
@@ -22,12 +22,6 @@ 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
- ],
31
25
  avatar: {
32
26
  type: String,
33
27
  },
@@ -8,4 +8,3 @@ 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";
@@ -1,6 +1,8 @@
1
1
  import { ITeam } from "./team";
2
+ import { IUser } from "./user";
2
3
  export interface IInvitation extends Document {
3
4
  email: string;
4
5
  team: ITeam;
5
6
  accepted: boolean;
7
+ invitedBy: IUser;
6
8
  }
@@ -5,4 +5,6 @@ export interface IMember extends Document {
5
5
  team: ITeam;
6
6
  role: ROLES;
7
7
  accepted: boolean;
8
+ invitedBy: IUser;
9
+ email: string;
8
10
  }
@@ -1,10 +1,9 @@
1
- import { IMember, IProject, IInvitation } from "./";
1
+ import { IMember, IProject } 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>;
8
7
  avatar: string;
9
8
  isCreator: boolean;
10
9
  }
package/index.ts CHANGED
@@ -7,7 +7,6 @@ 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";
11
10
  export {
12
11
  IUser,
13
12
  IGit,
@@ -19,7 +18,6 @@ export {
19
18
  IToken,
20
19
  IMember,
21
20
  ITeam,
22
- IInvitation,
23
21
  } from "./types";
24
22
  export {
25
23
  GIT_TYPE,
package/member.ts CHANGED
@@ -8,6 +8,7 @@ const memberSchema: Schema = new Schema(
8
8
  type: Schema.Types.ObjectId,
9
9
  ref: "User",
10
10
  },
11
+ email: String,
11
12
  team: {
12
13
  type: Schema.Types.ObjectId,
13
14
  ref: "Team",
@@ -21,6 +22,10 @@ const memberSchema: Schema = new Schema(
21
22
  type: Boolean,
22
23
  default: false,
23
24
  },
25
+ invitedBy: {
26
+ type: Schema.Types.ObjectId,
27
+ ref: "User",
28
+ },
24
29
  },
25
30
  {
26
31
  timestamps: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brimble/models",
3
- "version": "1.3.28",
3
+ "version": "1.3.30",
4
4
  "description": "Brimble models",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/project.ts CHANGED
@@ -30,13 +30,22 @@ const projectSchema = new Schema(
30
30
  type: Schema.Types.ObjectId,
31
31
  },
32
32
  ],
33
+ team: {
34
+ ref: "Team",
35
+ type: Schema.Types.ObjectId,
36
+ },
33
37
  pid: Number,
34
38
  port: Number,
35
39
  dir: String,
36
40
  buildCommand: String,
37
41
  outputDirectory: String,
42
+ installCommand: String,
38
43
  repo: Object,
39
44
  rootDir: String,
45
+ isPrivate: {
46
+ type: Boolean,
47
+ default: false,
48
+ },
40
49
  },
41
50
  { timestamps: true },
42
51
  );
package/team.ts CHANGED
@@ -23,12 +23,6 @@ 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
- ],
32
26
  avatar: {
33
27
  type: String,
34
28
  },
package/types/index.ts CHANGED
@@ -8,4 +8,3 @@ 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";
package/types/member.ts CHANGED
@@ -6,4 +6,6 @@ export interface IMember extends Document {
6
6
  team: ITeam;
7
7
  role: ROLES;
8
8
  accepted: boolean;
9
+ invitedBy: IUser;
10
+ email: string;
9
11
  }
package/types/team.ts CHANGED
@@ -1,11 +1,10 @@
1
- import { IMember, IProject, IInvitation } from "./";
1
+ import { IMember, IProject } 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>;
9
8
  avatar: string;
10
9
  isCreator: boolean;
11
10
  }
package/invitation.ts DELETED
@@ -1,24 +0,0 @@
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);
@@ -1,7 +0,0 @@
1
- import { ITeam } from "./team";
2
-
3
- export interface IInvitation extends Document {
4
- email: string;
5
- team: ITeam;
6
- accepted: boolean;
7
- }