@brimble/models 1.5.9 → 1.5.11
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 +1 -1
- package/card.ts +39 -39
- package/dist/domain.js +12 -4
- package/dist/server.js +3 -3
- package/dist/subscription.js +3 -3
- package/dist/team.js +1 -1
- package/dist/tenancy.js +3 -3
- package/dist/types/domain.d.ts +3 -1
- package/domain.ts +12 -4
- package/package.json +3 -3
- package/server.ts +4 -4
- package/subscription.ts +38 -37
- package/team.ts +4 -4
- package/tenancy.ts +4 -4
- package/types/card.ts +9 -9
- package/types/domain.ts +3 -1
- package/types/server.ts +10 -10
- package/types/subscription.ts +14 -14
- package/types/team.ts +2 -2
- package/types/tenancy.ts +1 -1
package/.turbo/turbo-build.log
CHANGED
package/card.ts
CHANGED
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
import { model, Schema } from "mongoose";
|
|
2
|
-
import {CARD_TYPES} from "./enum";
|
|
3
|
-
import {ICard} from "./types";
|
|
2
|
+
import { CARD_TYPES } from "./enum";
|
|
3
|
+
import { ICard } from "./types";
|
|
4
4
|
|
|
5
5
|
const cardSchema = new Schema(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
6
|
+
{
|
|
7
|
+
user_id: {
|
|
8
|
+
ref: "User",
|
|
9
|
+
type: Schema.Types.ObjectId,
|
|
10
|
+
},
|
|
11
|
+
last4: {
|
|
12
|
+
type: String,
|
|
13
|
+
required: true,
|
|
14
|
+
},
|
|
15
|
+
card_type: {
|
|
16
|
+
type: String,
|
|
17
|
+
enum: Object.keys(CARD_TYPES),
|
|
18
|
+
required: true,
|
|
19
|
+
},
|
|
20
|
+
exp_month: {
|
|
21
|
+
type: String,
|
|
22
|
+
required: true,
|
|
23
|
+
},
|
|
24
|
+
exp_year: {
|
|
25
|
+
type: String,
|
|
26
|
+
required: true,
|
|
27
|
+
},
|
|
28
|
+
signature: {
|
|
29
|
+
type: String,
|
|
30
|
+
required: false,
|
|
31
|
+
},
|
|
32
|
+
authorization_code: {
|
|
33
|
+
type: String,
|
|
34
|
+
required: true,
|
|
35
|
+
},
|
|
36
|
+
preferred: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
default: true,
|
|
39
|
+
required: false,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
{ timestamps: true, collection: "cards" },
|
|
43
43
|
);
|
|
44
44
|
|
|
45
45
|
export default model<ICard>("Card", cardSchema);
|
package/dist/domain.js
CHANGED
|
@@ -24,13 +24,21 @@ const domainSchema = new mongoose_1.Schema({
|
|
|
24
24
|
type: Boolean,
|
|
25
25
|
default: false,
|
|
26
26
|
},
|
|
27
|
-
|
|
27
|
+
is_free: {
|
|
28
28
|
type: Boolean,
|
|
29
|
-
default: false
|
|
29
|
+
default: false,
|
|
30
30
|
},
|
|
31
|
-
|
|
31
|
+
privacy_enabled: {
|
|
32
32
|
type: Boolean,
|
|
33
|
-
default: false
|
|
33
|
+
default: false,
|
|
34
|
+
},
|
|
35
|
+
renewal_date: {
|
|
36
|
+
type: String,
|
|
37
|
+
required: false,
|
|
38
|
+
},
|
|
39
|
+
renewal_price: {
|
|
40
|
+
type: Number,
|
|
41
|
+
required: false,
|
|
34
42
|
},
|
|
35
43
|
preview: {
|
|
36
44
|
ref: "Preview",
|
package/dist/server.js
CHANGED
|
@@ -25,11 +25,11 @@ const serverSchema = new mongoose_1.Schema({
|
|
|
25
25
|
default: Boolean,
|
|
26
26
|
is_custom_provision: {
|
|
27
27
|
type: Boolean,
|
|
28
|
-
default: true
|
|
28
|
+
default: true,
|
|
29
29
|
},
|
|
30
30
|
is_downscaled: {
|
|
31
31
|
type: Boolean,
|
|
32
|
-
default: false
|
|
33
|
-
}
|
|
32
|
+
default: false,
|
|
33
|
+
},
|
|
34
34
|
}, { timestamps: true });
|
|
35
35
|
exports.default = (0, mongoose_1.model)("Server", serverSchema);
|
package/dist/subscription.js
CHANGED
|
@@ -21,12 +21,12 @@ const subscriptionPlanSchema = new mongoose_1.Schema({
|
|
|
21
21
|
status: {
|
|
22
22
|
type: String,
|
|
23
23
|
enum: Object.values(enum_1.SUBSCRIPTION_STATUS),
|
|
24
|
-
default: enum_1.SUBSCRIPTION_STATUS.ACTIVE
|
|
24
|
+
default: enum_1.SUBSCRIPTION_STATUS.ACTIVE,
|
|
25
25
|
},
|
|
26
26
|
specifications: {
|
|
27
27
|
type: Object,
|
|
28
28
|
default: {},
|
|
29
|
-
select: true
|
|
29
|
+
select: true,
|
|
30
30
|
},
|
|
31
31
|
amount: Number,
|
|
32
32
|
debit_date: String,
|
|
@@ -36,6 +36,6 @@ const subscriptionPlanSchema = new mongoose_1.Schema({
|
|
|
36
36
|
transaction_retries: Number,
|
|
37
37
|
}, {
|
|
38
38
|
timestamps: true,
|
|
39
|
-
collection: "subscriptions"
|
|
39
|
+
collection: "subscriptions",
|
|
40
40
|
});
|
|
41
41
|
exports.default = (0, mongoose_1.model)("Subscription", subscriptionPlanSchema);
|
package/dist/team.js
CHANGED
|
@@ -30,7 +30,7 @@ const teamSchema = new mongoose_1.Schema({
|
|
|
30
30
|
required: false,
|
|
31
31
|
ref: "Subscription",
|
|
32
32
|
},
|
|
33
|
-
tenant: { type: mongoose_1.Schema.Types.ObjectId, ref: "Tenancy", required: false }
|
|
33
|
+
tenant: { type: mongoose_1.Schema.Types.ObjectId, ref: "Tenancy", required: false },
|
|
34
34
|
}, {
|
|
35
35
|
timestamps: true,
|
|
36
36
|
});
|
package/dist/tenancy.js
CHANGED
|
@@ -18,15 +18,15 @@ const tenancySchema = new mongoose_1.Schema({
|
|
|
18
18
|
},
|
|
19
19
|
username: {
|
|
20
20
|
type: String,
|
|
21
|
-
required: true
|
|
21
|
+
required: true,
|
|
22
22
|
},
|
|
23
23
|
password: {
|
|
24
24
|
type: String,
|
|
25
|
-
required: true
|
|
25
|
+
required: true,
|
|
26
26
|
},
|
|
27
27
|
is_activated: {
|
|
28
28
|
type: Boolean,
|
|
29
|
-
default: false
|
|
29
|
+
default: false,
|
|
30
30
|
},
|
|
31
31
|
}, { timestamps: true });
|
|
32
32
|
exports.default = (0, mongoose_1.model)("Tenancy", tenancySchema);
|
package/dist/types/domain.d.ts
CHANGED
package/domain.ts
CHANGED
|
@@ -26,13 +26,21 @@ const domainSchema = new Schema(
|
|
|
26
26
|
type: Boolean,
|
|
27
27
|
default: false,
|
|
28
28
|
},
|
|
29
|
-
|
|
29
|
+
is_free: {
|
|
30
30
|
type: Boolean,
|
|
31
|
-
default: false
|
|
31
|
+
default: false,
|
|
32
32
|
},
|
|
33
|
-
|
|
33
|
+
privacy_enabled: {
|
|
34
34
|
type: Boolean,
|
|
35
|
-
default: false
|
|
35
|
+
default: false,
|
|
36
|
+
},
|
|
37
|
+
renewal_date: {
|
|
38
|
+
type: String,
|
|
39
|
+
required: false,
|
|
40
|
+
},
|
|
41
|
+
renewal_price: {
|
|
42
|
+
type: Number,
|
|
43
|
+
required: false,
|
|
36
44
|
},
|
|
37
45
|
preview: {
|
|
38
46
|
ref: "Preview",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brimble/models",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.11",
|
|
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.18",
|
|
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": "f45e293ea6fee0dd982f85110379a9a1a45a45de"
|
|
25
25
|
}
|
package/server.ts
CHANGED
|
@@ -32,15 +32,15 @@ const serverSchema = new Schema(
|
|
|
32
32
|
|
|
33
33
|
is_custom_provision: {
|
|
34
34
|
type: Boolean,
|
|
35
|
-
default: true
|
|
35
|
+
default: true,
|
|
36
36
|
},
|
|
37
37
|
|
|
38
38
|
is_downscaled: {
|
|
39
39
|
type: Boolean,
|
|
40
|
-
default: false
|
|
41
|
-
}
|
|
40
|
+
default: false,
|
|
41
|
+
},
|
|
42
42
|
},
|
|
43
43
|
{ timestamps: true },
|
|
44
44
|
);
|
|
45
45
|
|
|
46
|
-
export default model<IServer>("Server", serverSchema);
|
|
46
|
+
export default model<IServer>("Server", serverSchema);
|
package/subscription.ts
CHANGED
|
@@ -1,44 +1,45 @@
|
|
|
1
1
|
import { model, Schema } from "mongoose";
|
|
2
|
-
import {SUBSCRIPTION_STATUS} from "./enum";
|
|
3
|
-
import {ISubscription} from "./types";
|
|
2
|
+
import { SUBSCRIPTION_STATUS } from "./enum";
|
|
3
|
+
import { ISubscription } from "./types";
|
|
4
4
|
|
|
5
|
-
const subscriptionPlanSchema: Schema = new Schema(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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: 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,
|
|
5
|
+
const subscriptionPlanSchema: Schema = new Schema(
|
|
6
|
+
{
|
|
7
|
+
team_id: {
|
|
8
|
+
type: Schema.Types.ObjectId,
|
|
9
|
+
required: true,
|
|
10
|
+
ref: "Team",
|
|
37
11
|
},
|
|
38
|
-
{
|
|
39
|
-
|
|
40
|
-
|
|
12
|
+
admin_id: {
|
|
13
|
+
type: Schema.Types.ObjectId,
|
|
14
|
+
required: true,
|
|
15
|
+
ref: "User",
|
|
41
16
|
},
|
|
17
|
+
plan_code: {
|
|
18
|
+
type: String,
|
|
19
|
+
required: true,
|
|
20
|
+
unique: true,
|
|
21
|
+
},
|
|
22
|
+
status: {
|
|
23
|
+
type: String,
|
|
24
|
+
enum: Object.values(SUBSCRIPTION_STATUS),
|
|
25
|
+
default: SUBSCRIPTION_STATUS.ACTIVE,
|
|
26
|
+
},
|
|
27
|
+
specifications: {
|
|
28
|
+
type: Object,
|
|
29
|
+
default: {},
|
|
30
|
+
select: true,
|
|
31
|
+
},
|
|
32
|
+
amount: Number,
|
|
33
|
+
debit_date: String,
|
|
34
|
+
start_date: String,
|
|
35
|
+
expiry_date: String,
|
|
36
|
+
reminder_date: String,
|
|
37
|
+
transaction_retries: Number,
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
timestamps: true,
|
|
41
|
+
collection: "subscriptions",
|
|
42
|
+
},
|
|
42
43
|
);
|
|
43
44
|
|
|
44
45
|
export default model<ISubscription>("Subscription", subscriptionPlanSchema);
|
package/team.ts
CHANGED
|
@@ -27,11 +27,11 @@ const teamSchema: Schema = new Schema(
|
|
|
27
27
|
type: String,
|
|
28
28
|
},
|
|
29
29
|
subscription: {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
type: Schema.Types.ObjectId,
|
|
31
|
+
required: false,
|
|
32
|
+
ref: "Subscription",
|
|
33
33
|
},
|
|
34
|
-
tenant: { type: Schema.Types.ObjectId, ref: "Tenancy", required: false }
|
|
34
|
+
tenant: { type: Schema.Types.ObjectId, ref: "Tenancy", required: false },
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
timestamps: true,
|
package/tenancy.ts
CHANGED
|
@@ -19,18 +19,18 @@ const tenancySchema = new Schema(
|
|
|
19
19
|
},
|
|
20
20
|
username: {
|
|
21
21
|
type: String,
|
|
22
|
-
required: true
|
|
22
|
+
required: true,
|
|
23
23
|
},
|
|
24
24
|
password: {
|
|
25
25
|
type: String,
|
|
26
|
-
required: true
|
|
26
|
+
required: true,
|
|
27
27
|
},
|
|
28
28
|
is_activated: {
|
|
29
29
|
type: Boolean,
|
|
30
|
-
default: false
|
|
30
|
+
default: false,
|
|
31
31
|
},
|
|
32
32
|
},
|
|
33
33
|
{ timestamps: true },
|
|
34
34
|
);
|
|
35
35
|
|
|
36
|
-
export default model<ITenancy>("Tenancy", tenancySchema);
|
|
36
|
+
export default model<ITenancy>("Tenancy", tenancySchema);
|
package/types/card.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { Document } from "mongoose";
|
|
2
|
-
import {CARD_TYPES} from "../enum";
|
|
2
|
+
import { CARD_TYPES } from "../enum";
|
|
3
3
|
|
|
4
4
|
export interface ICard extends Document {
|
|
5
|
-
|
|
5
|
+
user_id: string;
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
last4: string;
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
card_type: CARD_TYPES;
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
preferred: boolean;
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
exp_month: string;
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
exp_year: string;
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
signature: string;
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
authorization_code: string;
|
|
20
20
|
}
|
package/types/domain.ts
CHANGED
package/types/server.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { Document } from "mongoose";
|
|
2
|
-
import {SERVER_STATUS} from "../enum";
|
|
2
|
+
import { SERVER_STATUS } from "../enum";
|
|
3
3
|
|
|
4
4
|
export interface IServer extends Document {
|
|
5
|
-
|
|
5
|
+
name: string;
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
url: string;
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
ip_address: string;
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
server_type: string;
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
status: SERVER_STATUS;
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
default: boolean;
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
is_custom_provision: boolean;
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
}
|
|
19
|
+
is_downscaled: boolean;
|
|
20
|
+
}
|
package/types/subscription.ts
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { Document } from "mongoose";
|
|
2
|
-
import {SUBSCRIPTION_STATUS} from "../enum";
|
|
2
|
+
import { SUBSCRIPTION_STATUS } from "../enum";
|
|
3
3
|
|
|
4
4
|
export interface ISubscription extends Document {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
5
|
+
team_id: string;
|
|
6
|
+
admin_id: string;
|
|
7
|
+
plan_code: string;
|
|
8
|
+
status: SUBSCRIPTION_STATUS;
|
|
9
|
+
amount: number;
|
|
10
|
+
transaction_retries: number;
|
|
11
|
+
debit_date: string;
|
|
12
|
+
start_date: string;
|
|
13
|
+
expiry_date: string;
|
|
14
|
+
reminder_date: string;
|
|
15
|
+
specifications: {
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
};
|
|
18
18
|
}
|
package/types/team.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Document } from "mongoose";
|
|
2
|
-
import {IMember, IProject, ISubscription, ITenancy} from "./";
|
|
2
|
+
import { IMember, IProject, ISubscription, ITenancy } from "./";
|
|
3
3
|
|
|
4
4
|
export interface ITeam extends Document {
|
|
5
5
|
name: string;
|
|
@@ -10,4 +10,4 @@ export interface ITeam extends Document {
|
|
|
10
10
|
isCreator: boolean;
|
|
11
11
|
tenant: ITenancy;
|
|
12
12
|
subscription: ISubscription;
|
|
13
|
-
}
|
|
13
|
+
}
|
package/types/tenancy.ts
CHANGED