@brimble/models 1.5.7 → 1.5.8
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/.turbo/turbo-build.log +2 -0
- package/dist/domain.js +11 -4
- package/dist/enum/index.d.ts +1 -1
- package/dist/enum/index.js +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +3 -1
- package/dist/logs.js +5 -0
- package/dist/project/index.d.ts +4 -0
- package/dist/project/index.js +93 -0
- package/dist/project/preview.d.ts +4 -0
- package/dist/project/preview.js +20 -0
- package/dist/types/domain.d.ts +4 -7
- package/dist/types/index.d.ts +1 -0
- package/dist/types/logs.d.ts +2 -1
- package/dist/types/project/index.d.ts +48 -0
- package/dist/types/project/index.js +2 -0
- package/dist/types/project/preview.d.ts +13 -0
- package/dist/types/project/preview.js +2 -0
- package/domain.ts +12 -4
- package/enum/index.ts +1 -1
- package/index.ts +10 -5
- package/logs.ts +6 -1
- package/package.json +2 -2
- package/{project.ts → project/index.ts} +10 -4
- package/project/preview.ts +24 -0
- package/types/domain.ts +4 -7
- package/types/index.ts +2 -1
- package/types/logs.ts +2 -1
- package/types/{project.ts → project/index.ts} +9 -7
- package/types/project/preview.ts +14 -0
package/.turbo/turbo-build.log
CHANGED
package/dist/domain.js
CHANGED
|
@@ -24,10 +24,17 @@ const domainSchema = new mongoose_1.Schema({
|
|
|
24
24
|
type: Boolean,
|
|
25
25
|
default: false,
|
|
26
26
|
},
|
|
27
|
-
|
|
28
|
-
type:
|
|
29
|
-
default:
|
|
30
|
-
|
|
27
|
+
isPurchased: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: false
|
|
30
|
+
},
|
|
31
|
+
isFree: {
|
|
32
|
+
type: Boolean,
|
|
33
|
+
default: false
|
|
34
|
+
},
|
|
35
|
+
preview: {
|
|
36
|
+
ref: "Preview",
|
|
37
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
31
38
|
},
|
|
32
39
|
}, { timestamps: true });
|
|
33
40
|
exports.default = (0, mongoose_1.model)("Domain", domainSchema);
|
package/dist/enum/index.d.ts
CHANGED
package/dist/enum/index.js
CHANGED
|
@@ -10,7 +10,7 @@ var GIT_TYPE;
|
|
|
10
10
|
var ENVIRONMENT;
|
|
11
11
|
(function (ENVIRONMENT) {
|
|
12
12
|
ENVIRONMENT["DEVELOPMENT"] = "DEVELOPMENT";
|
|
13
|
-
ENVIRONMENT["
|
|
13
|
+
ENVIRONMENT["PREVIEW"] = "PREVIEW";
|
|
14
14
|
ENVIRONMENT["PRODUCTION"] = "PRODUCTION";
|
|
15
15
|
})(ENVIRONMENT = exports.ENVIRONMENT || (exports.ENVIRONMENT = {}));
|
|
16
16
|
var INTEGRATION_TYPES;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default as User } from "./user";
|
|
2
2
|
export { default as Project } from "./project";
|
|
3
|
+
export { default as Preview } from "./project/preview";
|
|
3
4
|
export { default as Following } from "./following";
|
|
4
5
|
export { default as Integration } from "./integration";
|
|
5
6
|
export { default as Domain } from "./domain";
|
|
@@ -12,8 +13,8 @@ export { default as SubscriptionPlan } from "./subscription";
|
|
|
12
13
|
export { default as Card } from "./card";
|
|
13
14
|
export { default as Server } from "./server";
|
|
14
15
|
export { default as Tenancy } from "./tenancy";
|
|
15
|
-
export { IUser, IGit, IProject, IFollowing, IIntegration, IEnv, IServer, ITenancy, IDomain, IToken, IMember, ITeam, IInstalledIntegration, ILog, ISubscription, ICard } from "./types";
|
|
16
|
-
export { GIT_TYPE, INTEGRATION_TYPES, INTEGRATION_PROVIDERS, OAUTH_PERMISSIONS, ENVIRONMENT, SERVER_STATUS, ROLES, PROJECT_STATUS, SUBSCRIPTION_STATUS, CARD_TYPES } from "./enum";
|
|
16
|
+
export { IUser, IGit, IProject, IPreview, IFollowing, IIntegration, IEnv, IServer, ITenancy, IDomain, IToken, IMember, ITeam, IInstalledIntegration, ILog, ISubscription, ICard, } from "./types";
|
|
17
|
+
export { GIT_TYPE, INTEGRATION_TYPES, INTEGRATION_PROVIDERS, OAUTH_PERMISSIONS, ENVIRONMENT, SERVER_STATUS, ROLES, PROJECT_STATUS, SUBSCRIPTION_STATUS, CARD_TYPES, } from "./enum";
|
|
17
18
|
import mongoose from "mongoose";
|
|
18
19
|
export declare const connectToMongo: (mongoUrl: string, config?: mongoose.ConnectOptions) => Promise<void>;
|
|
19
20
|
export declare const db: mongoose.Connection;
|
package/dist/index.js
CHANGED
|
@@ -12,11 +12,13 @@ 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.closeMongo = exports.db = exports.connectToMongo = exports.CARD_TYPES = exports.SUBSCRIPTION_STATUS = exports.PROJECT_STATUS = exports.ROLES = exports.SERVER_STATUS = exports.ENVIRONMENT = exports.OAUTH_PERMISSIONS = exports.INTEGRATION_PROVIDERS = exports.INTEGRATION_TYPES = exports.GIT_TYPE = exports.Tenancy = exports.Server = exports.Card = exports.SubscriptionPlan = exports.Log = exports.Member = exports.Team = exports.Token = exports.Env = exports.Domain = exports.Integration = exports.Following = exports.Project = exports.User = void 0;
|
|
15
|
+
exports.closeMongo = exports.db = exports.connectToMongo = exports.CARD_TYPES = exports.SUBSCRIPTION_STATUS = exports.PROJECT_STATUS = exports.ROLES = exports.SERVER_STATUS = exports.ENVIRONMENT = exports.OAUTH_PERMISSIONS = exports.INTEGRATION_PROVIDERS = exports.INTEGRATION_TYPES = exports.GIT_TYPE = exports.Tenancy = exports.Server = exports.Card = exports.SubscriptionPlan = exports.Log = exports.Member = exports.Team = exports.Token = exports.Env = exports.Domain = exports.Integration = exports.Following = exports.Preview = exports.Project = exports.User = void 0;
|
|
16
16
|
var user_1 = require("./user");
|
|
17
17
|
Object.defineProperty(exports, "User", { enumerable: true, get: function () { return __importDefault(user_1).default; } });
|
|
18
18
|
var project_1 = require("./project");
|
|
19
19
|
Object.defineProperty(exports, "Project", { enumerable: true, get: function () { return __importDefault(project_1).default; } });
|
|
20
|
+
var preview_1 = require("./project/preview");
|
|
21
|
+
Object.defineProperty(exports, "Preview", { enumerable: true, get: function () { return __importDefault(preview_1).default; } });
|
|
20
22
|
var following_1 = require("./following");
|
|
21
23
|
Object.defineProperty(exports, "Following", { enumerable: true, get: function () { return __importDefault(following_1).default; } });
|
|
22
24
|
var integration_1 = require("./integration");
|
package/dist/logs.js
CHANGED
|
@@ -18,6 +18,11 @@ const LogSchema = new mongoose_1.Schema({
|
|
|
18
18
|
ref: "User",
|
|
19
19
|
type: mongoose_1.Schema.Types.ObjectId,
|
|
20
20
|
},
|
|
21
|
+
environment: {
|
|
22
|
+
type: String,
|
|
23
|
+
enum: Object.values(enum_1.ENVIRONMENT),
|
|
24
|
+
default: enum_1.ENVIRONMENT.PRODUCTION,
|
|
25
|
+
},
|
|
21
26
|
jobs: Array,
|
|
22
27
|
startTime: mongoose_1.Schema.Types.Date,
|
|
23
28
|
endTime: mongoose_1.Schema.Types.Date,
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mongoose_1 = require("mongoose");
|
|
4
|
+
const enum_1 = require("../enum");
|
|
5
|
+
const projectSchema = new mongoose_1.Schema({
|
|
6
|
+
name: {
|
|
7
|
+
type: String,
|
|
8
|
+
required: true,
|
|
9
|
+
unique: true,
|
|
10
|
+
},
|
|
11
|
+
uuid: {
|
|
12
|
+
type: Number,
|
|
13
|
+
required: true,
|
|
14
|
+
unique: true,
|
|
15
|
+
},
|
|
16
|
+
user_id: {
|
|
17
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
18
|
+
ref: "User",
|
|
19
|
+
required: true,
|
|
20
|
+
},
|
|
21
|
+
domains: [
|
|
22
|
+
{
|
|
23
|
+
ref: "Domain",
|
|
24
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
environments: [
|
|
28
|
+
{
|
|
29
|
+
ref: "Env",
|
|
30
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
team: {
|
|
34
|
+
ref: "Team",
|
|
35
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
36
|
+
},
|
|
37
|
+
server: {
|
|
38
|
+
ref: "Server",
|
|
39
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
40
|
+
},
|
|
41
|
+
pid: Number,
|
|
42
|
+
port: Number,
|
|
43
|
+
ip: String,
|
|
44
|
+
dir: String,
|
|
45
|
+
buildCommand: String,
|
|
46
|
+
outputDirectory: String,
|
|
47
|
+
installCommand: String,
|
|
48
|
+
repo: Object,
|
|
49
|
+
rootDir: String,
|
|
50
|
+
isPrivate: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: false,
|
|
53
|
+
},
|
|
54
|
+
status: {
|
|
55
|
+
type: String,
|
|
56
|
+
enum: Object.values(enum_1.PROJECT_STATUS),
|
|
57
|
+
default: enum_1.PROJECT_STATUS.PENDING,
|
|
58
|
+
},
|
|
59
|
+
framework: String,
|
|
60
|
+
description: String,
|
|
61
|
+
logs: [
|
|
62
|
+
{
|
|
63
|
+
ref: "Log",
|
|
64
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
log: {
|
|
68
|
+
ref: "Log",
|
|
69
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
70
|
+
},
|
|
71
|
+
maintenance: {
|
|
72
|
+
type: Boolean,
|
|
73
|
+
default: false,
|
|
74
|
+
},
|
|
75
|
+
passwordEnabled: {
|
|
76
|
+
type: Boolean,
|
|
77
|
+
default: false,
|
|
78
|
+
},
|
|
79
|
+
password: {
|
|
80
|
+
type: String,
|
|
81
|
+
default: null,
|
|
82
|
+
},
|
|
83
|
+
screenshot: String,
|
|
84
|
+
lastProcessed: Number,
|
|
85
|
+
tracking_token: String,
|
|
86
|
+
previews: [
|
|
87
|
+
{
|
|
88
|
+
ref: "Preview",
|
|
89
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
90
|
+
},
|
|
91
|
+
],
|
|
92
|
+
}, { timestamps: true });
|
|
93
|
+
exports.default = (0, mongoose_1.model)("Project", projectSchema);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mongoose_1 = require("mongoose");
|
|
4
|
+
const previewsSchema = new mongoose_1.Schema({
|
|
5
|
+
name: String,
|
|
6
|
+
project: {
|
|
7
|
+
ref: "Project",
|
|
8
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
9
|
+
},
|
|
10
|
+
server: {
|
|
11
|
+
ref: "Server",
|
|
12
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
13
|
+
},
|
|
14
|
+
pid: Number,
|
|
15
|
+
port: Number,
|
|
16
|
+
ip: String,
|
|
17
|
+
dir: String,
|
|
18
|
+
branch: String,
|
|
19
|
+
}, { timestamps: true });
|
|
20
|
+
exports.default = (0, mongoose_1.model)("Preview", previewsSchema);
|
package/dist/types/domain.d.ts
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import { Document } from "mongoose";
|
|
2
|
-
import { IProject } from "./";
|
|
2
|
+
import { IPreview, IProject } from "./";
|
|
3
3
|
export interface IDomain extends Document {
|
|
4
4
|
name: string;
|
|
5
5
|
project: IProject;
|
|
6
6
|
user_id: string;
|
|
7
7
|
team_id: string;
|
|
8
8
|
primary: boolean;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
key: string;
|
|
13
|
-
expiry: Date;
|
|
14
|
-
};
|
|
9
|
+
preview: IPreview;
|
|
10
|
+
isPurchased: boolean;
|
|
11
|
+
isFree: boolean;
|
|
15
12
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export { IUser } from "./user";
|
|
|
2
2
|
export { IGit } from "./git";
|
|
3
3
|
export { IFollowing } from "./following";
|
|
4
4
|
export { IProject } from "./project";
|
|
5
|
+
export { IPreview } from "./project/preview";
|
|
5
6
|
export { IIntegration } from "./integration";
|
|
6
7
|
export { IEnv } from "./env";
|
|
7
8
|
export { IDomain } from "./domain";
|
package/dist/types/logs.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Document } from "mongoose";
|
|
2
|
-
import { PROJECT_STATUS } from "../enum";
|
|
2
|
+
import { ENVIRONMENT, PROJECT_STATUS } from "../enum";
|
|
3
3
|
import { IProject } from "./project";
|
|
4
4
|
import { IUser } from "./user";
|
|
5
5
|
export interface ILog extends Document {
|
|
@@ -22,6 +22,7 @@ export interface ILog extends Document {
|
|
|
22
22
|
id: number;
|
|
23
23
|
name: string;
|
|
24
24
|
}[];
|
|
25
|
+
environment: ENVIRONMENT;
|
|
25
26
|
startTime: Date | string;
|
|
26
27
|
endTime: Date | string;
|
|
27
28
|
createdAt: Date | string;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Document } from "mongoose";
|
|
2
|
+
import { GIT_TYPE, PROJECT_STATUS } from "../../enum";
|
|
3
|
+
import { IDomain } from "../domain";
|
|
4
|
+
import { IEnv } from "../env";
|
|
5
|
+
import { ILog } from "../logs";
|
|
6
|
+
import { ITeam } from "../team";
|
|
7
|
+
import { IUser } from "../user";
|
|
8
|
+
import { IServer } from "../server";
|
|
9
|
+
import { IPreview } from "./preview";
|
|
10
|
+
export interface IProject extends Document {
|
|
11
|
+
name: string;
|
|
12
|
+
domains: Array<IDomain>;
|
|
13
|
+
environments: Array<IEnv>;
|
|
14
|
+
uuid: number;
|
|
15
|
+
pid: number;
|
|
16
|
+
port: number;
|
|
17
|
+
ip: string;
|
|
18
|
+
dir: string;
|
|
19
|
+
buildCommand: string;
|
|
20
|
+
outputDirectory: string;
|
|
21
|
+
user_id: IUser;
|
|
22
|
+
repo: {
|
|
23
|
+
name: string;
|
|
24
|
+
full_name: string;
|
|
25
|
+
id: number;
|
|
26
|
+
branch: string;
|
|
27
|
+
installationId: number;
|
|
28
|
+
git: GIT_TYPE;
|
|
29
|
+
};
|
|
30
|
+
rootDir?: string;
|
|
31
|
+
team: ITeam;
|
|
32
|
+
server: IServer;
|
|
33
|
+
isPrivate: boolean;
|
|
34
|
+
status: PROJECT_STATUS;
|
|
35
|
+
framework: string;
|
|
36
|
+
description: string;
|
|
37
|
+
logs: Array<ILog>;
|
|
38
|
+
log: ILog;
|
|
39
|
+
maintenance: boolean;
|
|
40
|
+
passwordEnabled: boolean;
|
|
41
|
+
password: string | null;
|
|
42
|
+
screenshot: string;
|
|
43
|
+
createdAt: Date;
|
|
44
|
+
updatedAt: Date;
|
|
45
|
+
lastProcessed: number;
|
|
46
|
+
tracking_token: string;
|
|
47
|
+
previews: IPreview[];
|
|
48
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Document } from "mongoose";
|
|
2
|
+
import { IServer } from "../server";
|
|
3
|
+
import { IProject } from ".";
|
|
4
|
+
export interface IPreview extends Document {
|
|
5
|
+
name: string;
|
|
6
|
+
pid: number;
|
|
7
|
+
port: number;
|
|
8
|
+
ip: string;
|
|
9
|
+
dir: string;
|
|
10
|
+
branch: string;
|
|
11
|
+
server: IServer;
|
|
12
|
+
project: IProject;
|
|
13
|
+
}
|
package/domain.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { model, Schema } from "mongoose";
|
|
2
2
|
import { IDomain } from "./types";
|
|
3
|
+
import { ENVIRONMENT } from "./enum";
|
|
3
4
|
|
|
4
5
|
const domainSchema = new Schema(
|
|
5
6
|
{
|
|
@@ -25,10 +26,17 @@ const domainSchema = new Schema(
|
|
|
25
26
|
type: Boolean,
|
|
26
27
|
default: false,
|
|
27
28
|
},
|
|
28
|
-
|
|
29
|
-
type:
|
|
30
|
-
default:
|
|
31
|
-
|
|
29
|
+
isPurchased: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: false
|
|
32
|
+
},
|
|
33
|
+
isFree: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: false
|
|
36
|
+
},
|
|
37
|
+
preview: {
|
|
38
|
+
ref: "Preview",
|
|
39
|
+
type: Schema.Types.ObjectId,
|
|
32
40
|
},
|
|
33
41
|
},
|
|
34
42
|
{ timestamps: true },
|
package/enum/index.ts
CHANGED
package/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { default as User } from "./user";
|
|
2
2
|
export { default as Project } from "./project";
|
|
3
|
+
export { default as Preview } from "./project/preview";
|
|
3
4
|
export { default as Following } from "./following";
|
|
4
5
|
export { default as Integration } from "./integration";
|
|
5
6
|
export { default as Domain } from "./domain";
|
|
@@ -17,6 +18,7 @@ export {
|
|
|
17
18
|
IUser,
|
|
18
19
|
IGit,
|
|
19
20
|
IProject,
|
|
21
|
+
IPreview,
|
|
20
22
|
IFollowing,
|
|
21
23
|
IIntegration,
|
|
22
24
|
IEnv,
|
|
@@ -29,7 +31,7 @@ export {
|
|
|
29
31
|
IInstalledIntegration,
|
|
30
32
|
ILog,
|
|
31
33
|
ISubscription,
|
|
32
|
-
ICard
|
|
34
|
+
ICard,
|
|
33
35
|
} from "./types";
|
|
34
36
|
export {
|
|
35
37
|
GIT_TYPE,
|
|
@@ -41,27 +43,30 @@ export {
|
|
|
41
43
|
ROLES,
|
|
42
44
|
PROJECT_STATUS,
|
|
43
45
|
SUBSCRIPTION_STATUS,
|
|
44
|
-
CARD_TYPES
|
|
46
|
+
CARD_TYPES,
|
|
45
47
|
} from "./enum";
|
|
46
48
|
|
|
47
49
|
import mongoose from "mongoose";
|
|
48
50
|
import { log } from "@brimble/utils";
|
|
49
51
|
|
|
50
|
-
export const connectToMongo = async (
|
|
52
|
+
export const connectToMongo = async (
|
|
53
|
+
mongoUrl: string,
|
|
54
|
+
config?: mongoose.ConnectOptions,
|
|
55
|
+
): Promise<void> => {
|
|
51
56
|
const options: mongoose.ConnectOptions = {
|
|
52
57
|
useNewUrlParser: true,
|
|
53
58
|
useUnifiedTopology: true,
|
|
54
59
|
poolSize: 10,
|
|
55
60
|
socketTimeoutMS: 30000,
|
|
56
61
|
checkServerIdentity: false,
|
|
57
|
-
...config
|
|
62
|
+
...config,
|
|
58
63
|
};
|
|
59
64
|
mongoose.set("useFindAndModify", false);
|
|
60
65
|
mongoose.set("useCreateIndex", true);
|
|
61
66
|
|
|
62
67
|
// connect to mongo
|
|
63
68
|
mongoose.connect(mongoUrl, options).catch((err) => {
|
|
64
|
-
log.error(`Unable to connect to mongo db, ${err}`)
|
|
69
|
+
log.error(`Unable to connect to mongo db, ${err}`);
|
|
65
70
|
});
|
|
66
71
|
|
|
67
72
|
// listen for connection
|
package/logs.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { model, Schema } from "mongoose";
|
|
2
|
-
import { PROJECT_STATUS } from "./enum";
|
|
2
|
+
import { ENVIRONMENT, PROJECT_STATUS } from "./enum";
|
|
3
3
|
import { ILog } from "./types";
|
|
4
4
|
|
|
5
5
|
const LogSchema = new Schema(
|
|
@@ -19,6 +19,11 @@ const LogSchema = new Schema(
|
|
|
19
19
|
ref: "User",
|
|
20
20
|
type: Schema.Types.ObjectId,
|
|
21
21
|
},
|
|
22
|
+
environment: {
|
|
23
|
+
type: String,
|
|
24
|
+
enum: Object.values(ENVIRONMENT),
|
|
25
|
+
default: ENVIRONMENT.PRODUCTION,
|
|
26
|
+
},
|
|
22
27
|
jobs: Array,
|
|
23
28
|
startTime: Schema.Types.Date,
|
|
24
29
|
endTime: Schema.Types.Date,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brimble/models",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.8",
|
|
4
4
|
"description": "Brimble models",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -21,5 +21,5 @@
|
|
|
21
21
|
"ts-node": "^8.10.2",
|
|
22
22
|
"typescript": "^4.9.4"
|
|
23
23
|
},
|
|
24
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "2515027996da3efffb108d1da660d81d86a1a267"
|
|
25
25
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { model, Schema } from "mongoose";
|
|
2
|
-
import { PROJECT_STATUS } from "
|
|
3
|
-
import { IProject } from "
|
|
2
|
+
import { PROJECT_STATUS } from "../enum";
|
|
3
|
+
import { IProject } from "../types";
|
|
4
4
|
|
|
5
5
|
const projectSchema = new Schema(
|
|
6
6
|
{
|
|
@@ -75,15 +75,21 @@ const projectSchema = new Schema(
|
|
|
75
75
|
},
|
|
76
76
|
passwordEnabled: {
|
|
77
77
|
type: Boolean,
|
|
78
|
-
default: false
|
|
78
|
+
default: false,
|
|
79
79
|
},
|
|
80
80
|
password: {
|
|
81
81
|
type: String,
|
|
82
|
-
default: null
|
|
82
|
+
default: null,
|
|
83
83
|
},
|
|
84
84
|
screenshot: String,
|
|
85
85
|
lastProcessed: Number,
|
|
86
86
|
tracking_token: String,
|
|
87
|
+
previews: [
|
|
88
|
+
{
|
|
89
|
+
ref: "Preview",
|
|
90
|
+
type: Schema.Types.ObjectId,
|
|
91
|
+
},
|
|
92
|
+
],
|
|
87
93
|
},
|
|
88
94
|
{ timestamps: true },
|
|
89
95
|
);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Schema, model } from "mongoose";
|
|
2
|
+
import { IPreview } from "../types";
|
|
3
|
+
|
|
4
|
+
const previewsSchema = new Schema(
|
|
5
|
+
{
|
|
6
|
+
name: String,
|
|
7
|
+
project: {
|
|
8
|
+
ref: "Project",
|
|
9
|
+
type: Schema.Types.ObjectId,
|
|
10
|
+
},
|
|
11
|
+
server: {
|
|
12
|
+
ref: "Server",
|
|
13
|
+
type: Schema.Types.ObjectId,
|
|
14
|
+
},
|
|
15
|
+
pid: Number,
|
|
16
|
+
port: Number,
|
|
17
|
+
ip: String,
|
|
18
|
+
dir: String,
|
|
19
|
+
branch: String,
|
|
20
|
+
},
|
|
21
|
+
{ timestamps: true },
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
export default model<IPreview>("Preview", previewsSchema);
|
package/types/domain.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Document } from "mongoose";
|
|
2
|
-
import { IProject } from "./";
|
|
2
|
+
import { IPreview, IProject } from "./";
|
|
3
3
|
|
|
4
4
|
export interface IDomain extends Document {
|
|
5
5
|
name: string;
|
|
@@ -7,10 +7,7 @@ export interface IDomain extends Document {
|
|
|
7
7
|
user_id: string;
|
|
8
8
|
team_id: string;
|
|
9
9
|
primary: boolean;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
key: string;
|
|
14
|
-
expiry: Date;
|
|
15
|
-
};
|
|
10
|
+
preview: IPreview;
|
|
11
|
+
isPurchased: boolean;
|
|
12
|
+
isFree: boolean;
|
|
16
13
|
}
|
package/types/index.ts
CHANGED
|
@@ -2,6 +2,7 @@ export { IUser } from "./user";
|
|
|
2
2
|
export { IGit } from "./git";
|
|
3
3
|
export { IFollowing } from "./following";
|
|
4
4
|
export { IProject } from "./project";
|
|
5
|
+
export { IPreview } from "./project/preview";
|
|
5
6
|
export { IIntegration } from "./integration";
|
|
6
7
|
export { IEnv } from "./env";
|
|
7
8
|
export { IDomain } from "./domain";
|
|
@@ -13,4 +14,4 @@ export { ILog } from "./logs";
|
|
|
13
14
|
export { ISubscription } from "./subscription";
|
|
14
15
|
export { ICard } from "./card";
|
|
15
16
|
export { ITenancy } from "./tenancy";
|
|
16
|
-
export { IServer } from "./server";
|
|
17
|
+
export { IServer } from "./server";
|
package/types/logs.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Document } from "mongoose";
|
|
2
|
-
import { PROJECT_STATUS } from "../enum";
|
|
2
|
+
import { ENVIRONMENT, PROJECT_STATUS } from "../enum";
|
|
3
3
|
import { IProject } from "./project";
|
|
4
4
|
import { IUser } from "./user";
|
|
5
5
|
|
|
@@ -23,6 +23,7 @@ export interface ILog extends Document {
|
|
|
23
23
|
id: number;
|
|
24
24
|
name: string;
|
|
25
25
|
}[];
|
|
26
|
+
environment: ENVIRONMENT;
|
|
26
27
|
startTime: Date | string;
|
|
27
28
|
endTime: Date | string;
|
|
28
29
|
createdAt: Date | string;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Document } from "mongoose";
|
|
2
|
-
import { GIT_TYPE, PROJECT_STATUS } from "
|
|
3
|
-
import { IDomain } from "
|
|
4
|
-
import { IEnv } from "
|
|
5
|
-
import { ILog } from "
|
|
6
|
-
import { ITeam } from "
|
|
7
|
-
import { IUser } from "
|
|
8
|
-
import { IServer } from "
|
|
2
|
+
import { GIT_TYPE, PROJECT_STATUS } from "../../enum";
|
|
3
|
+
import { IDomain } from "../domain";
|
|
4
|
+
import { IEnv } from "../env";
|
|
5
|
+
import { ILog } from "../logs";
|
|
6
|
+
import { ITeam } from "../team";
|
|
7
|
+
import { IUser } from "../user";
|
|
8
|
+
import { IServer } from "../server";
|
|
9
|
+
import { IPreview } from "./preview";
|
|
9
10
|
|
|
10
11
|
export interface IProject extends Document {
|
|
11
12
|
name: string;
|
|
@@ -44,4 +45,5 @@ export interface IProject extends Document {
|
|
|
44
45
|
updatedAt: Date;
|
|
45
46
|
lastProcessed: number;
|
|
46
47
|
tracking_token: string;
|
|
48
|
+
previews: IPreview[];
|
|
47
49
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Document } from "mongoose";
|
|
2
|
+
import { IServer } from "../server";
|
|
3
|
+
import { IProject } from ".";
|
|
4
|
+
|
|
5
|
+
export interface IPreview extends Document {
|
|
6
|
+
name: string;
|
|
7
|
+
pid: number;
|
|
8
|
+
port: number;
|
|
9
|
+
ip: string;
|
|
10
|
+
dir: string;
|
|
11
|
+
branch: string;
|
|
12
|
+
server: IServer;
|
|
13
|
+
project: IProject;
|
|
14
|
+
}
|