@brimble/models 1.5.22 → 1.5.23

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.
@@ -0,0 +1 @@
1
+ $ rm -rf dist && tsc -p .
package/brimble.json ADDED
@@ -0,0 +1,3 @@
1
+ {
2
+ "project": {}
3
+ }
@@ -4,7 +4,6 @@ export declare enum GIT_TYPE {
4
4
  BITBUCKET = "BITBUCKET"
5
5
  }
6
6
  export declare enum ENVIRONMENT {
7
- DEVELOPMENT = "DEVELOPMENT",
8
7
  PREVIEW = "PREVIEW",
9
8
  PRODUCTION = "PRODUCTION"
10
9
  }
@@ -9,7 +9,6 @@ var GIT_TYPE;
9
9
  })(GIT_TYPE = exports.GIT_TYPE || (exports.GIT_TYPE = {}));
10
10
  var ENVIRONMENT;
11
11
  (function (ENVIRONMENT) {
12
- ENVIRONMENT["DEVELOPMENT"] = "DEVELOPMENT";
13
12
  ENVIRONMENT["PREVIEW"] = "PREVIEW";
14
13
  ENVIRONMENT["PRODUCTION"] = "PRODUCTION";
15
14
  })(ENVIRONMENT = exports.ENVIRONMENT || (exports.ENVIRONMENT = {}));
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const mongoose_1 = require("mongoose");
4
+ const enum_1 = require("../enum");
4
5
  const previewsSchema = new mongoose_1.Schema({
5
6
  name: String,
6
7
  project: {
@@ -17,5 +18,14 @@ const previewsSchema = new mongoose_1.Schema({
17
18
  dir: String,
18
19
  branch: String,
19
20
  issue_comment_id: Number,
21
+ status: {
22
+ type: String,
23
+ enum: Object.values(enum_1.PROJECT_STATUS),
24
+ default: enum_1.PROJECT_STATUS.PENDING,
25
+ },
26
+ log: {
27
+ ref: "Log",
28
+ type: mongoose_1.Schema.Types.ObjectId,
29
+ },
20
30
  }, { timestamps: true });
21
31
  exports.default = (0, mongoose_1.model)("Preview", previewsSchema);
@@ -6,5 +6,5 @@ export interface IEnv extends Document {
6
6
  value: string;
7
7
  project: IProject;
8
8
  user: IUser;
9
- environment: ENVIRONMENT;
9
+ environment: ENVIRONMENT | string;
10
10
  }
@@ -1,6 +1,8 @@
1
1
  import { Document } from "mongoose";
2
2
  import { IServer } from "../server";
3
3
  import { IProject } from ".";
4
+ import { PROJECT_STATUS } from "../../enum";
5
+ import { ILog } from "../logs";
4
6
  export interface IPreview extends Document {
5
7
  name: string;
6
8
  pid: number;
@@ -11,4 +13,6 @@ export interface IPreview extends Document {
11
13
  server: IServer;
12
14
  project: IProject;
13
15
  issue_comment_id: number;
16
+ status: PROJECT_STATUS;
17
+ log: ILog;
14
18
  }
package/enum/index.ts CHANGED
@@ -5,7 +5,6 @@ export enum GIT_TYPE {
5
5
  }
6
6
 
7
7
  export enum ENVIRONMENT {
8
- DEVELOPMENT = "DEVELOPMENT",
9
8
  PREVIEW = "PREVIEW",
10
9
  PRODUCTION = "PRODUCTION",
11
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brimble/models",
3
- "version": "1.5.22",
3
+ "version": "1.5.23",
4
4
  "description": "Brimble models",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,5 +1,6 @@
1
1
  import { Schema, model } from "mongoose";
2
2
  import { IPreview } from "../types";
3
+ import { PROJECT_STATUS } from "../enum";
3
4
 
4
5
  const previewsSchema = new Schema(
5
6
  {
@@ -18,6 +19,15 @@ const previewsSchema = new Schema(
18
19
  dir: String,
19
20
  branch: String,
20
21
  issue_comment_id: Number,
22
+ status: {
23
+ type: String,
24
+ enum: Object.values(PROJECT_STATUS),
25
+ default: PROJECT_STATUS.PENDING,
26
+ },
27
+ log: {
28
+ ref: "Log",
29
+ type: Schema.Types.ObjectId,
30
+ },
21
31
  },
22
32
  { timestamps: true },
23
33
  );
package/types/env.ts CHANGED
@@ -7,5 +7,5 @@ export interface IEnv extends Document {
7
7
  value: string;
8
8
  project: IProject;
9
9
  user: IUser;
10
- environment: ENVIRONMENT;
10
+ environment: ENVIRONMENT | string;
11
11
  }
@@ -1,6 +1,8 @@
1
1
  import { Document } from "mongoose";
2
2
  import { IServer } from "../server";
3
3
  import { IProject } from ".";
4
+ import { PROJECT_STATUS } from "../../enum";
5
+ import { ILog } from "../logs";
4
6
 
5
7
  export interface IPreview extends Document {
6
8
  name: string;
@@ -12,4 +14,6 @@ export interface IPreview extends Document {
12
14
  server: IServer;
13
15
  project: IProject;
14
16
  issue_comment_id: number;
17
+ status: PROJECT_STATUS;
18
+ log: ILog;
15
19
  }