@brimble/models 1.3.2 → 1.3.3

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
@@ -5,4 +5,5 @@ export { default as Integration } from "./integration";
5
5
  export { default as Domain } from "./domain";
6
6
  export { default as Env } from "./env";
7
7
  export { IUser, IGit, IProject, IFollowing, IIntegration, IEnv, IDomain, } from "./types";
8
+ export { GIT_TYPE, INTEGRATION_TYPE } from "./enum";
8
9
  export declare const connectToMongo: (mongoUrl: string) => Promise<void>;
package/dist/index.js CHANGED
@@ -25,6 +25,9 @@ var domain_1 = require("./domain");
25
25
  Object.defineProperty(exports, "Domain", { enumerable: true, get: function () { return domain_1.default; } });
26
26
  var env_1 = require("./env");
27
27
  Object.defineProperty(exports, "Env", { enumerable: true, get: function () { return env_1.default; } });
28
+ var enum_1 = require("./enum");
29
+ Object.defineProperty(exports, "GIT_TYPE", { enumerable: true, get: function () { return enum_1.GIT_TYPE; } });
30
+ Object.defineProperty(exports, "INTEGRATION_TYPE", { enumerable: true, get: function () { return enum_1.INTEGRATION_TYPE; } });
28
31
  const mongoose_1 = __importDefault(require("mongoose"));
29
32
  const utils_1 = require("@brimble/utils");
30
33
  // Connection to Mongo
@@ -36,7 +39,7 @@ exports.connectToMongo = (mongoUrl) => __awaiter(void 0, void 0, void 0, functio
36
39
  mongoose_1.default.connect(mongoUrl, options);
37
40
  // listen for connection
38
41
  mongoose_1.default.connection.on("connected", () => {
39
- utils_1.log.info("Database connection successful");
42
+ console.log("Database connection successful 🚀");
40
43
  });
41
44
  // listen for error
42
45
  mongoose_1.default.connection.on("error", ({ message }) => {
package/dist/project.js CHANGED
@@ -43,5 +43,6 @@ const projectSchema = new mongoose_1.Schema({
43
43
  outputDirectory: {
44
44
  type: String,
45
45
  },
46
+ repo: Object,
46
47
  }, { timestamps: true });
47
48
  exports.default = mongoose_1.model("Project", projectSchema);
package/dist/user.js CHANGED
@@ -35,21 +35,26 @@ const userSchema = new mongoose_1.Schema({
35
35
  following: [
36
36
  {
37
37
  type: mongoose_1.default.Schema.Types.ObjectId,
38
- ref: "Following"
39
- }
38
+ ref: "Following",
39
+ },
40
40
  ],
41
41
  verification_token: {
42
42
  type: Number,
43
43
  select: false,
44
44
  },
45
45
  location: {
46
- type: String
46
+ type: String,
47
47
  },
48
48
  interests: {
49
- type: Array
49
+ type: Array,
50
50
  },
51
51
  github: Object,
52
52
  gitlab: Object,
53
53
  bitbucket: Object,
54
+ access_code: {
55
+ type: Number,
56
+ select: false,
57
+ },
58
+ company: String,
54
59
  }, { timestamps: true });
55
60
  exports.default = mongoose_1.model("User", userSchema);
package/index.ts CHANGED
@@ -13,6 +13,7 @@ export {
13
13
  IEnv,
14
14
  IDomain,
15
15
  } from "./types";
16
+ export { GIT_TYPE, INTEGRATION_TYPE } from "./enum";
16
17
 
17
18
  import mongoose from "mongoose";
18
19
  import { log } from "@brimble/utils";
@@ -28,7 +29,7 @@ export const connectToMongo = async (mongoUrl: string): Promise<void> => {
28
29
 
29
30
  // listen for connection
30
31
  mongoose.connection.on("connected", () => {
31
- log.info("Database connection successful");
32
+ console.log("Database connection successful 🚀");
32
33
  });
33
34
 
34
35
  // listen for error
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brimble/models",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "description": "Brimble models",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/project.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { model, Schema } from "mongoose";
2
- import { GIT_TYPE } from "./enum";
3
2
  import { IProject } from "./types";
4
3
 
5
4
  const projectSchema = new Schema(
@@ -45,6 +44,7 @@ const projectSchema = new Schema(
45
44
  outputDirectory: {
46
45
  type: String,
47
46
  },
47
+ repo: Object,
48
48
  },
49
49
  { timestamps: true },
50
50
  );
package/user.ts CHANGED
@@ -18,24 +18,29 @@ const userSchema: Schema = new Schema(
18
18
  following: [
19
19
  {
20
20
  type: mongoose.Schema.Types.ObjectId,
21
- ref: "Following"
22
- }
21
+ ref: "Following",
22
+ },
23
23
  ],
24
24
  verification_token: {
25
25
  type: Number,
26
26
  select: false,
27
27
  },
28
28
  location: {
29
- type: String
29
+ type: String,
30
30
  },
31
31
  interests: {
32
- type: Array
32
+ type: Array,
33
33
  },
34
34
  github: Object,
35
35
  gitlab: Object,
36
36
  bitbucket: Object,
37
+ access_code: {
38
+ type: Number,
39
+ select: false,
40
+ },
41
+ company: String,
37
42
  },
38
- { timestamps: true }
43
+ { timestamps: true },
39
44
  );
40
45
 
41
46
  export default model<IUser>("User", userSchema);