@brimble/models 1.4.87 → 1.4.89
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 +0 -2
- package/brimble.json +3 -0
- package/dist/activity.d.ts +4 -0
- package/dist/activity.js +25 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/installed_integration.js +12 -18
- package/dist/invitation.d.ts +4 -0
- package/dist/invitation.js +24 -0
- package/dist/logs.d.ts +0 -0
- package/dist/logs.js +0 -0
- package/dist/subscription.d.ts +4 -0
- package/dist/subscription.js +41 -0
- package/dist/team.js +1 -1
- package/dist/tenancy.js +0 -4
- package/dist/types/activity.d.ts +10 -0
- package/dist/types/activity.js +2 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/invitation.d.ts +8 -0
- package/dist/types/invitation.js +2 -0
- package/dist/types/logs.d.ts +0 -0
- package/dist/types/logs.js +0 -0
- package/dist/types/server.d.ts +1 -0
- package/dist/types/subscription.d.ts +16 -0
- package/dist/types/subscription.js +2 -0
- package/dist/types/team.d.ts +2 -2
- package/index.ts +2 -2
- package/package.json +3 -3
- package/{subscription_plan.ts → subscription.ts} +4 -3
- package/team.ts +1 -1
- package/tenancy.ts +0 -4
- package/types/index.ts +1 -1
- package/types/server.ts +2 -0
- package/types/{subscription_plan.ts → subscription.ts} +3 -1
- package/types/team.ts +2 -2
- package/yarn-error.log +3546 -2678
package/.turbo/turbo-build.log
CHANGED
package/brimble.json
ADDED
package/dist/activity.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mongoose_1 = require("mongoose");
|
|
4
|
+
const enum_1 = require("./enum");
|
|
5
|
+
const activitySchema = new mongoose_1.Schema({
|
|
6
|
+
type: {
|
|
7
|
+
type: String,
|
|
8
|
+
enum: Object.values(enum_1.ACTIVITY_TYPE),
|
|
9
|
+
required: true,
|
|
10
|
+
},
|
|
11
|
+
authUser: {
|
|
12
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
13
|
+
ref: "User",
|
|
14
|
+
required: true,
|
|
15
|
+
},
|
|
16
|
+
project: {
|
|
17
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
18
|
+
ref: "Project",
|
|
19
|
+
},
|
|
20
|
+
user: {
|
|
21
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
22
|
+
ref: "User",
|
|
23
|
+
},
|
|
24
|
+
}, { timestamps: true });
|
|
25
|
+
exports.default = mongoose_1.model("Activity", activitySchema);
|
package/dist/index.d.ts
CHANGED
|
@@ -8,11 +8,11 @@ export { default as Token } from "./token";
|
|
|
8
8
|
export { default as Team } from "./team";
|
|
9
9
|
export { default as Member } from "./member";
|
|
10
10
|
export { default as Log } from "./logs";
|
|
11
|
-
export { default as SubscriptionPlan } from "./
|
|
11
|
+
export { default as SubscriptionPlan } from "./subscription";
|
|
12
12
|
export { default as Card } from "./card";
|
|
13
13
|
export { default as Server } from "./server";
|
|
14
14
|
export { default as Tenancy } from "./tenancy";
|
|
15
|
-
export { IUser, IGit, IProject, IFollowing, IIntegration, IEnv, IServer, ITenancy, IDomain, IToken, IMember, ITeam, IInstalledIntegration, ILog,
|
|
15
|
+
export { IUser, IGit, IProject, IFollowing, IIntegration, IEnv, IServer, ITenancy, IDomain, IToken, IMember, ITeam, IInstalledIntegration, ILog, ISubscription, ICard } from "./types";
|
|
16
16
|
export { GIT_TYPE, INTEGRATION_TYPES, INTEGRATION_PROVIDERS, OAUTH_PERMISSIONS, ENVIRONMENT, SERVER_STATUS, ROLES, PROJECT_STATUS, SUBSCRIPTION_STATUS, CARD_TYPES } from "./enum";
|
|
17
17
|
import mongoose from "mongoose";
|
|
18
18
|
export declare const connectToMongo: (mongoUrl: string, config?: mongoose.ConnectOptions) => Promise<void>;
|
package/dist/index.js
CHANGED
|
@@ -33,8 +33,8 @@ var member_1 = require("./member");
|
|
|
33
33
|
Object.defineProperty(exports, "Member", { enumerable: true, get: function () { return __importDefault(member_1).default; } });
|
|
34
34
|
var logs_1 = require("./logs");
|
|
35
35
|
Object.defineProperty(exports, "Log", { enumerable: true, get: function () { return __importDefault(logs_1).default; } });
|
|
36
|
-
var
|
|
37
|
-
Object.defineProperty(exports, "SubscriptionPlan", { enumerable: true, get: function () { return __importDefault(
|
|
36
|
+
var subscription_1 = require("./subscription");
|
|
37
|
+
Object.defineProperty(exports, "SubscriptionPlan", { enumerable: true, get: function () { return __importDefault(subscription_1).default; } });
|
|
38
38
|
var card_1 = require("./card");
|
|
39
39
|
Object.defineProperty(exports, "Card", { enumerable: true, get: function () { return __importDefault(card_1).default; } });
|
|
40
40
|
var server_1 = require("./server");
|
|
@@ -1,27 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const mongoose_1 = require("mongoose");
|
|
4
|
-
const installedIntegrationSchema = new mongoose_1.Schema(
|
|
5
|
-
{
|
|
4
|
+
const installedIntegrationSchema = new mongoose_1.Schema({
|
|
6
5
|
user_id: {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
7
|
+
ref: "User",
|
|
8
|
+
default: null,
|
|
9
|
+
required: false,
|
|
11
10
|
},
|
|
12
11
|
integration_id: {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
13
|
+
ref: "Integration",
|
|
14
|
+
required: true,
|
|
16
15
|
},
|
|
17
16
|
enabled: {
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
type: Boolean,
|
|
18
|
+
default: true,
|
|
20
19
|
},
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
);
|
|
24
|
-
exports.default = mongoose_1.model(
|
|
25
|
-
"InstalledIntegration",
|
|
26
|
-
installedIntegrationSchema,
|
|
27
|
-
);
|
|
20
|
+
}, { timestamps: true });
|
|
21
|
+
exports.default = (0, mongoose_1.model)("InstalledIntegration", installedIntegrationSchema);
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
invitedBy: {
|
|
18
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
19
|
+
ref: "User",
|
|
20
|
+
},
|
|
21
|
+
}, {
|
|
22
|
+
timestamps: true,
|
|
23
|
+
});
|
|
24
|
+
exports.default = mongoose_1.model("Invitation", invitationSchema);
|
package/dist/logs.d.ts
CHANGED
|
File without changes
|
package/dist/logs.js
CHANGED
|
File without changes
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mongoose_1 = require("mongoose");
|
|
4
|
+
const enum_1 = require("./enum");
|
|
5
|
+
const subscriptionPlanSchema = new mongoose_1.Schema({
|
|
6
|
+
team_id: {
|
|
7
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
8
|
+
required: true,
|
|
9
|
+
ref: "Team",
|
|
10
|
+
},
|
|
11
|
+
admin_id: {
|
|
12
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
13
|
+
required: true,
|
|
14
|
+
ref: "User",
|
|
15
|
+
},
|
|
16
|
+
plan_code: {
|
|
17
|
+
type: String,
|
|
18
|
+
required: true,
|
|
19
|
+
unique: true,
|
|
20
|
+
},
|
|
21
|
+
status: {
|
|
22
|
+
type: String,
|
|
23
|
+
enum: Object.values(enum_1.SUBSCRIPTION_STATUS),
|
|
24
|
+
default: enum_1.SUBSCRIPTION_STATUS.ACTIVE
|
|
25
|
+
},
|
|
26
|
+
specifications: {
|
|
27
|
+
type: Object,
|
|
28
|
+
default: {},
|
|
29
|
+
select: true
|
|
30
|
+
},
|
|
31
|
+
amount: Number,
|
|
32
|
+
debit_date: String,
|
|
33
|
+
start_date: String,
|
|
34
|
+
expiry_date: String,
|
|
35
|
+
reminder_date: String,
|
|
36
|
+
transaction_retries: Number,
|
|
37
|
+
}, {
|
|
38
|
+
timestamps: true,
|
|
39
|
+
collection: "subscriptions"
|
|
40
|
+
});
|
|
41
|
+
exports.default = (0, mongoose_1.model)("Subscription", subscriptionPlanSchema);
|
package/dist/team.js
CHANGED
|
@@ -28,7 +28,7 @@ const teamSchema = new mongoose_1.Schema({
|
|
|
28
28
|
subscription: {
|
|
29
29
|
type: mongoose_1.Schema.Types.ObjectId,
|
|
30
30
|
required: false,
|
|
31
|
-
ref: "
|
|
31
|
+
ref: "Subscription",
|
|
32
32
|
},
|
|
33
33
|
tenant: { type: mongoose_1.Schema.Types.ObjectId, ref: "Tenancy", required: false }
|
|
34
34
|
}, {
|
package/dist/tenancy.js
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Document } from "mongoose";
|
|
2
|
+
import { ACTIVITY_TYPE } from "../enum";
|
|
3
|
+
import { IProject } from "./project";
|
|
4
|
+
import { IUser } from "./user";
|
|
5
|
+
export interface IActivity extends Document {
|
|
6
|
+
type: ACTIVITY_TYPE;
|
|
7
|
+
project: IProject;
|
|
8
|
+
user: IUser;
|
|
9
|
+
authUser: IUser;
|
|
10
|
+
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export { ITeam } from "./team";
|
|
|
10
10
|
export { IMember } from "./member";
|
|
11
11
|
export { IInstalledIntegration } from "./installed_integration";
|
|
12
12
|
export { ILog } from "./logs";
|
|
13
|
-
export {
|
|
13
|
+
export { ISubscription } from "./subscription";
|
|
14
14
|
export { ICard } from "./card";
|
|
15
15
|
export { ITenancy } from "./tenancy";
|
|
16
16
|
export { IServer } from "./server";
|
package/dist/types/logs.d.ts
CHANGED
|
File without changes
|
package/dist/types/logs.js
CHANGED
|
File without changes
|
package/dist/types/server.d.ts
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Document } from "mongoose";
|
|
2
|
+
import { SUBSCRIPTION_STATUS } from "../enum";
|
|
3
|
+
export interface ISubscription extends Document {
|
|
4
|
+
team_id: string;
|
|
5
|
+
admin_id: string;
|
|
6
|
+
plan_code: string;
|
|
7
|
+
status: SUBSCRIPTION_STATUS;
|
|
8
|
+
amount: number;
|
|
9
|
+
debit_date: string;
|
|
10
|
+
start_date: string;
|
|
11
|
+
expiry_date: string;
|
|
12
|
+
reminder_date: string;
|
|
13
|
+
specifications: {
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
};
|
|
16
|
+
}
|
package/dist/types/team.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Document } from "mongoose";
|
|
2
|
-
import { IMember, IProject,
|
|
2
|
+
import { IMember, IProject, ISubscription, ITenancy } from "./";
|
|
3
3
|
export interface ITeam extends Document {
|
|
4
4
|
name: string;
|
|
5
5
|
description: string;
|
|
@@ -8,5 +8,5 @@ export interface ITeam extends Document {
|
|
|
8
8
|
image: string;
|
|
9
9
|
isCreator: boolean;
|
|
10
10
|
tenant: ITenancy;
|
|
11
|
-
subscription:
|
|
11
|
+
subscription: ISubscription;
|
|
12
12
|
}
|
package/index.ts
CHANGED
|
@@ -8,7 +8,7 @@ export { default as Token } from "./token";
|
|
|
8
8
|
export { default as Team } from "./team";
|
|
9
9
|
export { default as Member } from "./member";
|
|
10
10
|
export { default as Log } from "./logs";
|
|
11
|
-
export { default as SubscriptionPlan } from "./
|
|
11
|
+
export { default as SubscriptionPlan } from "./subscription";
|
|
12
12
|
export { default as Card } from "./card";
|
|
13
13
|
export { default as Server } from "./server";
|
|
14
14
|
export { default as Tenancy } from "./tenancy";
|
|
@@ -28,7 +28,7 @@ export {
|
|
|
28
28
|
ITeam,
|
|
29
29
|
IInstalledIntegration,
|
|
30
30
|
ILog,
|
|
31
|
-
|
|
31
|
+
ISubscription,
|
|
32
32
|
ICard
|
|
33
33
|
} from "./types";
|
|
34
34
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brimble/models",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.89",
|
|
4
4
|
"description": "Brimble models",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
},
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@brimble/utils": "^1.5.
|
|
12
|
+
"@brimble/utils": "^1.5.11",
|
|
13
13
|
"dotenv": "^8.2.0",
|
|
14
14
|
"mongoose": "^5.8.11",
|
|
15
15
|
"uuid": "^8.3.2"
|
|
@@ -21,5 +21,5 @@
|
|
|
21
21
|
"ts-node": "^8.10.2",
|
|
22
22
|
"typescript": "^4.9.4"
|
|
23
23
|
},
|
|
24
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "21b7f00dfe504e262ca156fe04fb94e19fcbae5d"
|
|
25
25
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { model, Schema } from "mongoose";
|
|
2
2
|
import {SUBSCRIPTION_STATUS} from "./enum";
|
|
3
|
-
import {
|
|
3
|
+
import {ISubscription} from "./types";
|
|
4
4
|
|
|
5
5
|
const subscriptionPlanSchema: Schema = new Schema({
|
|
6
6
|
team_id: {
|
|
@@ -31,13 +31,14 @@ const subscriptionPlanSchema: Schema = new Schema({
|
|
|
31
31
|
amount: Number,
|
|
32
32
|
debit_date: String,
|
|
33
33
|
start_date: String,
|
|
34
|
+
expiry_date: String,
|
|
34
35
|
reminder_date: String,
|
|
35
36
|
transaction_retries: Number,
|
|
36
37
|
},
|
|
37
38
|
{
|
|
38
39
|
timestamps: true,
|
|
39
|
-
collection: "
|
|
40
|
+
collection: "subscriptions"
|
|
40
41
|
},
|
|
41
42
|
);
|
|
42
43
|
|
|
43
|
-
export default model<
|
|
44
|
+
export default model<ISubscription>("Subscription", subscriptionPlanSchema);
|
package/team.ts
CHANGED
package/tenancy.ts
CHANGED
package/types/index.ts
CHANGED
|
@@ -10,7 +10,7 @@ export { ITeam } from "./team";
|
|
|
10
10
|
export { IMember } from "./member";
|
|
11
11
|
export { IInstalledIntegration } from "./installed_integration";
|
|
12
12
|
export { ILog } from "./logs";
|
|
13
|
-
export {
|
|
13
|
+
export { ISubscription } from "./subscription";
|
|
14
14
|
export { ICard } from "./card";
|
|
15
15
|
export { ITenancy } from "./tenancy";
|
|
16
16
|
export { IServer } from "./server";
|
package/types/server.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Document } from "mongoose";
|
|
2
2
|
import {SUBSCRIPTION_STATUS} from "../enum";
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
export interface ISubscription extends Document {
|
|
4
5
|
team_id: string;
|
|
5
6
|
admin_id: string;
|
|
6
7
|
plan_code: string;
|
|
@@ -8,6 +9,7 @@ export interface ISubscriptionPlan extends Document {
|
|
|
8
9
|
amount: number;
|
|
9
10
|
debit_date: string;
|
|
10
11
|
start_date: string;
|
|
12
|
+
expiry_date: string;
|
|
11
13
|
reminder_date: string;
|
|
12
14
|
specifications: {
|
|
13
15
|
[key: string]: any;
|
package/types/team.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Document } from "mongoose";
|
|
2
|
-
import {IMember, IProject,
|
|
2
|
+
import {IMember, IProject, ISubscription, ITenancy} from "./";
|
|
3
3
|
|
|
4
4
|
export interface ITeam extends Document {
|
|
5
5
|
name: string;
|
|
@@ -9,5 +9,5 @@ export interface ITeam extends Document {
|
|
|
9
9
|
image: string;
|
|
10
10
|
isCreator: boolean;
|
|
11
11
|
tenant: ITenancy;
|
|
12
|
-
subscription:
|
|
12
|
+
subscription: ISubscription;
|
|
13
13
|
}
|