@brimble/models 1.4.49 → 1.4.51
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/CHANGELOG.md +0 -4
- package/dist/enum/index.d.ts +4 -0
- package/dist/enum/index.js +6 -1
- package/dist/follower.js +1 -1
- package/dist/following.js +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +4 -1
- package/dist/installed_integration.js +18 -12
- package/dist/integration.js +6 -0
- package/dist/subscription_plan.d.ts +4 -0
- package/dist/subscription_plan.js +40 -0
- package/dist/team.js +5 -0
- package/dist/token.js +3 -3
- package/dist/types/index.d.ts +1 -0
- package/dist/types/integration.d.ts +2 -1
- package/dist/types/subscription_plan.d.ts +15 -0
- package/dist/types/subscription_plan.js +2 -0
- package/dist/types/team.d.ts +1 -0
- package/enum/index.ts +7 -3
- package/follower.ts +12 -12
- package/following.ts +12 -12
- package/index.ts +3 -0
- package/integration.ts +6 -0
- package/package.json +3 -3
- package/subscription_plan.ts +43 -0
- package/team.ts +5 -0
- package/token.ts +3 -3
- package/types/domain.ts +1 -1
- package/types/following.ts +2 -2
- package/types/index.ts +1 -0
- package/types/integration.ts +3 -1
- package/types/subscription_plan.ts +15 -0
- package/types/team.ts +1 -0
- package/types/token.ts +8 -8
package/.turbo/turbo-build.log
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -7,10 +7,6 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @brimble/models
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
10
|
# [1.2.0-alpha.3](https://github.com/brimblehq/brimble/compare/@brimble/models@1.2.0-alpha.2...@brimble/models@1.2.0-alpha.3) (2022-05-05)
|
|
15
11
|
|
|
16
12
|
**Note:** Version bump only for package @brimble/models
|
package/dist/enum/index.d.ts
CHANGED
|
@@ -40,6 +40,10 @@ export declare enum PROJECT_STATUS {
|
|
|
40
40
|
FAILED = "FAILED",
|
|
41
41
|
PENDING = "PENDING"
|
|
42
42
|
}
|
|
43
|
+
export declare enum SUBSCRIPTION_STATUS {
|
|
44
|
+
ACTIVE = "active",
|
|
45
|
+
INACTIVE = "in-active"
|
|
46
|
+
}
|
|
43
47
|
export declare enum OAUTH_PERMISSIONS {
|
|
44
48
|
READ_USER = "read_user",
|
|
45
49
|
READ_PROJECT = "read_project",
|
package/dist/enum/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.OAUTH_PERMISSIONS = exports.PROJECT_STATUS = exports.ROLES = exports.INTEGRATION_PROVIDERS = exports.INTEGRATION_TYPES = exports.ENVIRONMENT = exports.GIT_TYPE = void 0;
|
|
3
|
+
exports.OAUTH_PERMISSIONS = exports.SUBSCRIPTION_STATUS = exports.PROJECT_STATUS = exports.ROLES = exports.INTEGRATION_PROVIDERS = exports.INTEGRATION_TYPES = exports.ENVIRONMENT = exports.GIT_TYPE = void 0;
|
|
4
4
|
var GIT_TYPE;
|
|
5
5
|
(function (GIT_TYPE) {
|
|
6
6
|
GIT_TYPE["GITHUB"] = "GITHUB";
|
|
@@ -49,6 +49,11 @@ var PROJECT_STATUS;
|
|
|
49
49
|
PROJECT_STATUS["FAILED"] = "FAILED";
|
|
50
50
|
PROJECT_STATUS["PENDING"] = "PENDING";
|
|
51
51
|
})(PROJECT_STATUS = exports.PROJECT_STATUS || (exports.PROJECT_STATUS = {}));
|
|
52
|
+
var SUBSCRIPTION_STATUS;
|
|
53
|
+
(function (SUBSCRIPTION_STATUS) {
|
|
54
|
+
SUBSCRIPTION_STATUS["ACTIVE"] = "active";
|
|
55
|
+
SUBSCRIPTION_STATUS["INACTIVE"] = "in-active";
|
|
56
|
+
})(SUBSCRIPTION_STATUS = exports.SUBSCRIPTION_STATUS || (exports.SUBSCRIPTION_STATUS = {}));
|
|
52
57
|
var OAUTH_PERMISSIONS;
|
|
53
58
|
(function (OAUTH_PERMISSIONS) {
|
|
54
59
|
OAUTH_PERMISSIONS["READ_USER"] = "read_user";
|
package/dist/follower.js
CHANGED
package/dist/following.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -8,8 +8,9 @@ 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 {
|
|
12
|
-
export {
|
|
11
|
+
export { default as SubscriptionPlan } from "./subscription_plan";
|
|
12
|
+
export { IUser, IGit, IProject, IFollowing, IIntegration, IEnv, IDomain, IToken, IMember, ITeam, IInstalledIntegration, ILog, ISubscriptionPlan } from "./types";
|
|
13
|
+
export { GIT_TYPE, INTEGRATION_TYPES, INTEGRATION_PROVIDERS, OAUTH_PERMISSIONS, ENVIRONMENT, ROLES, PROJECT_STATUS, SUBSCRIPTION_STATUS } from "./enum";
|
|
13
14
|
import mongoose from "mongoose";
|
|
14
15
|
export declare const connectToMongo: (mongoUrl: string, retryCount?: number) => Promise<void>;
|
|
15
16
|
export declare const db: mongoose.Connection;
|
package/dist/index.js
CHANGED
|
@@ -12,7 +12,7 @@ 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.PROJECT_STATUS = exports.ROLES = exports.ENVIRONMENT = exports.OAUTH_PERMISSIONS = exports.INTEGRATION_PROVIDERS = exports.INTEGRATION_TYPES = exports.GIT_TYPE = 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.SUBSCRIPTION_STATUS = exports.PROJECT_STATUS = exports.ROLES = exports.ENVIRONMENT = exports.OAUTH_PERMISSIONS = exports.INTEGRATION_PROVIDERS = exports.INTEGRATION_TYPES = exports.GIT_TYPE = exports.SubscriptionPlan = exports.Log = exports.Member = exports.Team = exports.Token = exports.Env = exports.Domain = exports.Integration = exports.Following = 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");
|
|
@@ -33,6 +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 subscription_plan_1 = require("./subscription_plan");
|
|
37
|
+
Object.defineProperty(exports, "SubscriptionPlan", { enumerable: true, get: function () { return __importDefault(subscription_plan_1).default; } });
|
|
36
38
|
var enum_1 = require("./enum");
|
|
37
39
|
Object.defineProperty(exports, "GIT_TYPE", { enumerable: true, get: function () { return enum_1.GIT_TYPE; } });
|
|
38
40
|
Object.defineProperty(exports, "INTEGRATION_TYPES", { enumerable: true, get: function () { return enum_1.INTEGRATION_TYPES; } });
|
|
@@ -41,6 +43,7 @@ Object.defineProperty(exports, "OAUTH_PERMISSIONS", { enumerable: true, get: fun
|
|
|
41
43
|
Object.defineProperty(exports, "ENVIRONMENT", { enumerable: true, get: function () { return enum_1.ENVIRONMENT; } });
|
|
42
44
|
Object.defineProperty(exports, "ROLES", { enumerable: true, get: function () { return enum_1.ROLES; } });
|
|
43
45
|
Object.defineProperty(exports, "PROJECT_STATUS", { enumerable: true, get: function () { return enum_1.PROJECT_STATUS; } });
|
|
46
|
+
Object.defineProperty(exports, "SUBSCRIPTION_STATUS", { enumerable: true, get: function () { return enum_1.SUBSCRIPTION_STATUS; } });
|
|
44
47
|
const mongoose_1 = __importDefault(require("mongoose"));
|
|
45
48
|
const utils_1 = require("@brimble/utils");
|
|
46
49
|
// Connection to Mongo
|
|
@@ -1,21 +1,27 @@
|
|
|
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(
|
|
4
|
+
const installedIntegrationSchema = new mongoose_1.Schema(
|
|
5
|
+
{
|
|
5
6
|
user_id: {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
8
|
+
ref: "User",
|
|
9
|
+
default: null,
|
|
10
|
+
required: false,
|
|
10
11
|
},
|
|
11
12
|
integration_id: {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
14
|
+
ref: "Integration",
|
|
15
|
+
required: true,
|
|
15
16
|
},
|
|
16
17
|
enabled: {
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: true,
|
|
19
20
|
},
|
|
20
|
-
},
|
|
21
|
-
|
|
21
|
+
},
|
|
22
|
+
{ timestamps: true },
|
|
23
|
+
);
|
|
24
|
+
exports.default = mongoose_1.model(
|
|
25
|
+
"InstalledIntegration",
|
|
26
|
+
installedIntegrationSchema,
|
|
27
|
+
);
|
package/dist/integration.js
CHANGED
|
@@ -7,6 +7,12 @@ const integrationSchema = new mongoose_1.Schema({
|
|
|
7
7
|
type: mongoose_1.Schema.Types.ObjectId,
|
|
8
8
|
ref: "User",
|
|
9
9
|
default: null,
|
|
10
|
+
required: true,
|
|
11
|
+
},
|
|
12
|
+
team_id: {
|
|
13
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
14
|
+
ref: "Team",
|
|
15
|
+
default: null,
|
|
10
16
|
required: false,
|
|
11
17
|
},
|
|
12
18
|
name: {
|
|
@@ -0,0 +1,40 @@
|
|
|
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: false,
|
|
30
|
+
},
|
|
31
|
+
amount: Number,
|
|
32
|
+
debit_date: String,
|
|
33
|
+
start_date: String,
|
|
34
|
+
reminder_date: String,
|
|
35
|
+
transaction_retries: Number,
|
|
36
|
+
}, {
|
|
37
|
+
timestamps: true,
|
|
38
|
+
collection: "subscription_plans"
|
|
39
|
+
});
|
|
40
|
+
exports.default = (0, mongoose_1.model)("SubscriptionPlan", subscriptionPlanSchema);
|
package/dist/team.js
CHANGED
package/dist/token.js
CHANGED
|
@@ -14,7 +14,7 @@ const tokenSchema = new mongoose_1.Schema({
|
|
|
14
14
|
},
|
|
15
15
|
description: {
|
|
16
16
|
type: Array,
|
|
17
|
-
required: true
|
|
17
|
+
required: true,
|
|
18
18
|
},
|
|
19
19
|
image: {
|
|
20
20
|
type: String,
|
|
@@ -30,7 +30,7 @@ const tokenSchema = new mongoose_1.Schema({
|
|
|
30
30
|
},
|
|
31
31
|
permissions: {
|
|
32
32
|
type: Array,
|
|
33
|
-
required: true
|
|
34
|
-
}
|
|
33
|
+
required: true,
|
|
34
|
+
},
|
|
35
35
|
}, { timestamps: true });
|
|
36
36
|
exports.default = (0, mongoose_1.model)("Token", tokenSchema);
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Document } from "mongoose";
|
|
2
2
|
import { INTEGRATION_PROVIDERS, INTEGRATION_TYPES } from "../enum";
|
|
3
3
|
export interface IIntegration extends Document {
|
|
4
|
-
user_id: string
|
|
4
|
+
user_id: string;
|
|
5
|
+
team_id?: string;
|
|
5
6
|
app_id?: string;
|
|
6
7
|
name: INTEGRATION_PROVIDERS;
|
|
7
8
|
scope_description?: string[];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Document } from "mongoose";
|
|
2
|
+
import { SUBSCRIPTION_STATUS } from "../enum";
|
|
3
|
+
export interface ISubscriptionPlan 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
|
+
reminder_date: string;
|
|
12
|
+
specifications: {
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
};
|
|
15
|
+
}
|
package/dist/types/team.d.ts
CHANGED
package/enum/index.ts
CHANGED
|
@@ -30,7 +30,7 @@ export enum INTEGRATION_PROVIDERS {
|
|
|
30
30
|
Contentful = "CONTENTFUL",
|
|
31
31
|
Novu = "NOVU",
|
|
32
32
|
Netlify = "NETLIFY",
|
|
33
|
-
GoogleAnalytics = "GOOGLE_ANALYTICS"
|
|
33
|
+
GoogleAnalytics = "GOOGLE_ANALYTICS",
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
export enum ROLES {
|
|
@@ -38,7 +38,6 @@ export enum ROLES {
|
|
|
38
38
|
MEMBER = "MEMBER",
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
|
|
42
41
|
export enum PROJECT_STATUS {
|
|
43
42
|
INACTIVE = "INACTIVE",
|
|
44
43
|
ACTIVE = "ACTIVE",
|
|
@@ -47,8 +46,13 @@ export enum PROJECT_STATUS {
|
|
|
47
46
|
PENDING = "PENDING",
|
|
48
47
|
}
|
|
49
48
|
|
|
49
|
+
export enum SUBSCRIPTION_STATUS {
|
|
50
|
+
ACTIVE = "active",
|
|
51
|
+
INACTIVE = "in-active"
|
|
52
|
+
}
|
|
53
|
+
|
|
50
54
|
export enum OAUTH_PERMISSIONS {
|
|
51
55
|
READ_USER = "read_user",
|
|
52
56
|
READ_PROJECT = "read_project",
|
|
53
57
|
UPDATE_CREDENTIALS = "update_credentials",
|
|
54
|
-
}
|
|
58
|
+
}
|
package/follower.ts
CHANGED
|
@@ -2,18 +2,18 @@ import { model, Schema } from "mongoose";
|
|
|
2
2
|
import { IFollowing } from "./types";
|
|
3
3
|
|
|
4
4
|
const followingSchema: Schema = new Schema(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
},
|
|
11
|
-
followed_id: {
|
|
12
|
-
type: Schema.Types.ObjectId,
|
|
13
|
-
required: true
|
|
14
|
-
},
|
|
5
|
+
{
|
|
6
|
+
user_id: {
|
|
7
|
+
type: Schema.Types.ObjectId,
|
|
8
|
+
ref: "User",
|
|
9
|
+
required: true,
|
|
15
10
|
},
|
|
16
|
-
|
|
11
|
+
followed_id: {
|
|
12
|
+
type: Schema.Types.ObjectId,
|
|
13
|
+
required: true,
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
{ timestamps: true },
|
|
17
17
|
);
|
|
18
18
|
|
|
19
|
-
export default model<IFollowing>("Following", followingSchema);
|
|
19
|
+
export default model<IFollowing>("Following", followingSchema);
|
package/following.ts
CHANGED
|
@@ -2,18 +2,18 @@ import { model, Schema } from "mongoose";
|
|
|
2
2
|
import { IFollowing } from "./types";
|
|
3
3
|
|
|
4
4
|
const followingSchema: Schema = new Schema(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
},
|
|
11
|
-
followed_id: {
|
|
12
|
-
type: Schema.Types.ObjectId,
|
|
13
|
-
required: true
|
|
14
|
-
},
|
|
5
|
+
{
|
|
6
|
+
user_id: {
|
|
7
|
+
type: Schema.Types.ObjectId,
|
|
8
|
+
ref: "User",
|
|
9
|
+
required: true,
|
|
15
10
|
},
|
|
16
|
-
|
|
11
|
+
followed_id: {
|
|
12
|
+
type: Schema.Types.ObjectId,
|
|
13
|
+
required: true,
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
{ timestamps: true },
|
|
17
17
|
);
|
|
18
18
|
|
|
19
|
-
export default model<IFollowing>("Following", followingSchema);
|
|
19
|
+
export default model<IFollowing>("Following", followingSchema);
|
package/index.ts
CHANGED
|
@@ -8,6 +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 "./subscription_plan";
|
|
11
12
|
export {
|
|
12
13
|
IUser,
|
|
13
14
|
IGit,
|
|
@@ -21,6 +22,7 @@ export {
|
|
|
21
22
|
ITeam,
|
|
22
23
|
IInstalledIntegration,
|
|
23
24
|
ILog,
|
|
25
|
+
ISubscriptionPlan
|
|
24
26
|
} from "./types";
|
|
25
27
|
export {
|
|
26
28
|
GIT_TYPE,
|
|
@@ -30,6 +32,7 @@ export {
|
|
|
30
32
|
ENVIRONMENT,
|
|
31
33
|
ROLES,
|
|
32
34
|
PROJECT_STATUS,
|
|
35
|
+
SUBSCRIPTION_STATUS
|
|
33
36
|
} from "./enum";
|
|
34
37
|
|
|
35
38
|
import mongoose from "mongoose";
|
package/integration.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brimble/models",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.51",
|
|
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.5",
|
|
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": "264ae932c5ff30a3bf03fe631b4180dc574e17a3"
|
|
25
25
|
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { model, Schema } from "mongoose";
|
|
2
|
+
import {SUBSCRIPTION_STATUS} from "./enum";
|
|
3
|
+
import {ISubscriptionPlan} from "./types/subscription_plan";
|
|
4
|
+
|
|
5
|
+
const subscriptionPlanSchema: Schema = new Schema({
|
|
6
|
+
team_id: {
|
|
7
|
+
type: Schema.Types.ObjectId,
|
|
8
|
+
required: true,
|
|
9
|
+
ref: "Team",
|
|
10
|
+
},
|
|
11
|
+
admin_id: {
|
|
12
|
+
type: 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(SUBSCRIPTION_STATUS),
|
|
24
|
+
default: SUBSCRIPTION_STATUS.ACTIVE
|
|
25
|
+
},
|
|
26
|
+
specifications: {
|
|
27
|
+
type: Object,
|
|
28
|
+
default: {},
|
|
29
|
+
select: false,
|
|
30
|
+
},
|
|
31
|
+
amount: Number,
|
|
32
|
+
debit_date: String,
|
|
33
|
+
start_date: String,
|
|
34
|
+
reminder_date: String,
|
|
35
|
+
transaction_retries: Number,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
timestamps: true,
|
|
39
|
+
collection: "subscription_plans"
|
|
40
|
+
},
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
export default model<ISubscriptionPlan>("SubscriptionPlan", subscriptionPlanSchema);
|
package/team.ts
CHANGED
package/token.ts
CHANGED
|
@@ -15,7 +15,7 @@ const tokenSchema = new Schema(
|
|
|
15
15
|
},
|
|
16
16
|
description: {
|
|
17
17
|
type: Array,
|
|
18
|
-
required: true
|
|
18
|
+
required: true,
|
|
19
19
|
},
|
|
20
20
|
image: {
|
|
21
21
|
type: String,
|
|
@@ -31,8 +31,8 @@ const tokenSchema = new Schema(
|
|
|
31
31
|
},
|
|
32
32
|
permissions: {
|
|
33
33
|
type: Array,
|
|
34
|
-
required: true
|
|
35
|
-
}
|
|
34
|
+
required: true,
|
|
35
|
+
},
|
|
36
36
|
},
|
|
37
37
|
{ timestamps: true },
|
|
38
38
|
);
|
package/types/domain.ts
CHANGED
package/types/following.ts
CHANGED
package/types/index.ts
CHANGED
package/types/integration.ts
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Document } from "mongoose";
|
|
2
|
+
import {SUBSCRIPTION_STATUS} from "../enum";
|
|
3
|
+
export interface ISubscriptionPlan 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
|
+
reminder_date: string;
|
|
12
|
+
specifications: {
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
}
|
|
15
|
+
}
|
package/types/team.ts
CHANGED
package/types/token.ts
CHANGED
|
@@ -2,19 +2,19 @@ import { Document } from "mongoose";
|
|
|
2
2
|
import { OAUTH_PERMISSIONS } from "../enum";
|
|
3
3
|
|
|
4
4
|
export interface IToken extends Document {
|
|
5
|
-
|
|
5
|
+
name: string;
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
apiKey: string | null;
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
description: string[];
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
image: string;
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
installationUrl?: string;
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
redirectUrl?: string | null;
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
encodedToken: string;
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
permission: OAUTH_PERMISSIONS[];
|
|
20
20
|
}
|