@brimble/models 3.8.6 → 3.8.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/.claude/settings.local.json +7 -0
- package/activity-log.ts +66 -0
- package/app-message.ts +3 -2
- package/cashier_subscription.ts +7 -3
- package/db-image.ts +5 -0
- package/dist/activity-log.d.ts +30 -0
- package/dist/activity-log.js +61 -0
- package/dist/app-message.js +3 -2
- package/dist/cashier_subscription.js +7 -3
- package/dist/db-image.js +5 -0
- package/dist/domain/index.js +6 -0
- package/dist/enum/index.d.ts +21 -6
- package/dist/enum/index.js +23 -6
- package/dist/env.js +0 -8
- package/dist/environment-variable.d.ts +30 -0
- package/dist/environment-variable.js +16 -0
- package/dist/framework.js +5 -0
- package/dist/index.d.ts +9 -3
- package/dist/index.js +19 -5
- package/dist/member.js +1 -0
- package/dist/ownership-transfer.d.ts +30 -0
- package/dist/ownership-transfer.js +35 -0
- package/dist/plan_configuration.js +5 -0
- package/dist/project/index.js +28 -6
- package/dist/project-environment.d.ts +30 -0
- package/dist/project-environment.js +13 -0
- package/dist/project_analytics.d.ts +30 -0
- package/dist/project_analytics.js +18 -0
- package/dist/sandbox-image.d.ts +30 -0
- package/dist/sandbox-image.js +31 -0
- package/dist/{branch.d.ts → sandbox.d.ts} +2 -2
- package/dist/sandbox.js +105 -0
- package/dist/team.js +34 -0
- package/dist/types/activity-log.d.ts +18 -0
- package/dist/types/app-message.d.ts +3 -2
- package/dist/types/cashier_subscription.d.ts +4 -2
- package/dist/types/db-image.d.ts +1 -0
- package/dist/types/domain/index.d.ts +2 -1
- package/dist/types/env.d.ts +0 -3
- package/dist/types/environment-variable.d.ts +12 -0
- package/dist/types/environment-variable.js +2 -0
- package/dist/types/framework.d.ts +1 -0
- package/dist/types/index.d.ts +7 -1
- package/dist/types/member.d.ts +2 -0
- package/dist/types/ownership-transfer.d.ts +12 -0
- package/dist/types/ownership-transfer.js +2 -0
- package/dist/types/plan_configuration.d.ts +5 -0
- package/dist/types/project/index.d.ts +6 -2
- package/dist/types/project-environment.d.ts +13 -0
- package/dist/types/project-environment.js +2 -0
- package/dist/types/project_analytics.d.ts +11 -0
- package/dist/types/project_analytics.js +2 -0
- package/dist/types/sandbox-image.d.ts +9 -0
- package/dist/types/sandbox-image.js +2 -0
- package/dist/types/sandbox.d.ts +34 -0
- package/dist/types/sandbox.js +2 -0
- package/dist/types/team.d.ts +10 -2
- package/dist/types/user.d.ts +3 -0
- package/dist/types/wallet.d.ts +4 -0
- package/dist/user.js +7 -0
- package/dist/wallet.js +16 -0
- package/domain/index.ts +6 -0
- package/enum/index.ts +22 -5
- package/env.ts +0 -8
- package/environment-variable.ts +21 -0
- package/framework.ts +5 -0
- package/index.ts +19 -4
- package/member.ts +1 -0
- package/ownership-transfer.ts +42 -0
- package/package.json +1 -1
- package/plan_configuration.ts +5 -0
- package/project/index.ts +32 -6
- package/project-environment.ts +18 -0
- package/project_analytics.ts +26 -0
- package/sandbox-image.ts +35 -0
- package/sandbox.ts +107 -0
- package/team.ts +34 -0
- package/types/activity-log.ts +19 -0
- package/types/app-message.ts +3 -2
- package/types/cashier_subscription.ts +4 -2
- package/types/db-image.ts +1 -0
- package/types/domain/index.ts +2 -1
- package/types/env.ts +0 -3
- package/types/environment-variable.ts +13 -0
- package/types/framework.ts +3 -2
- package/types/index.ts +7 -1
- package/types/member.ts +2 -0
- package/types/ownership-transfer.ts +13 -0
- package/types/plan_configuration.ts +5 -0
- package/types/project/index.ts +6 -2
- package/types/project-environment.ts +14 -0
- package/types/project_analytics.ts +12 -0
- package/types/sandbox-image.ts +10 -0
- package/types/sandbox.ts +36 -0
- package/types/team.ts +10 -2
- package/types/user.ts +3 -0
- package/types/wallet.ts +4 -0
- package/user.ts +7 -0
- package/wallet.ts +16 -0
- package/branch.ts +0 -22
- package/dist/branch.js +0 -17
- package/dist/types/branch.d.ts +0 -17
- package/types/branch.ts +0 -18
- /package/dist/types/{branch.js → activity-log.js} +0 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mongoose_1 = require("mongoose");
|
|
4
|
+
const ownershipTransferSchema = new mongoose_1.Schema({
|
|
5
|
+
team: {
|
|
6
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
7
|
+
ref: "Team",
|
|
8
|
+
required: true,
|
|
9
|
+
},
|
|
10
|
+
from_user: {
|
|
11
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
12
|
+
ref: "User",
|
|
13
|
+
required: true,
|
|
14
|
+
},
|
|
15
|
+
to_user: {
|
|
16
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
17
|
+
ref: "User",
|
|
18
|
+
required: true,
|
|
19
|
+
},
|
|
20
|
+
status: {
|
|
21
|
+
type: String,
|
|
22
|
+
enum: ["pending", "accepted", "denied", "expired"],
|
|
23
|
+
default: "pending",
|
|
24
|
+
},
|
|
25
|
+
expires_at: {
|
|
26
|
+
type: Date,
|
|
27
|
+
required: true,
|
|
28
|
+
},
|
|
29
|
+
}, {
|
|
30
|
+
timestamps: {
|
|
31
|
+
createdAt: "created_at",
|
|
32
|
+
updatedAt: "updated_at",
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
exports.default = (0, mongoose_1.model)("OwnershipTransfer", ownershipTransferSchema);
|
|
@@ -15,10 +15,13 @@ const PlanConfigurationSchema = new mongoose_1.Schema({
|
|
|
15
15
|
log_retention: { type: Number, required: true },
|
|
16
16
|
bandwidth: { type: Number, required: true },
|
|
17
17
|
price: { type: Number, required: true },
|
|
18
|
+
password_enabled: { type: Boolean, required: false, default: true },
|
|
18
19
|
autoscaling_enabled: { type: Boolean, default: false, required: false },
|
|
19
20
|
region: { type: mongoose_1.Schema.Types.ObjectId, ref: "Region", required: false },
|
|
20
21
|
multi_region: { type: Boolean, default: false },
|
|
21
22
|
unlimited_projects: { type: Boolean, default: false },
|
|
23
|
+
ai_debug_enabled: { type: Boolean, default: false, required: false },
|
|
24
|
+
ai_debug_limit: { type: Number, default: 0, required: false },
|
|
22
25
|
plan_type: {
|
|
23
26
|
type: String,
|
|
24
27
|
enum: Object.values(enum_1.SUBSCRIPTION_PLAN_TYPE),
|
|
@@ -36,5 +39,7 @@ const PlanConfigurationSchema = new mongoose_1.Schema({
|
|
|
36
39
|
webhook_enabled: { type: Boolean, required: true, default: false },
|
|
37
40
|
can_deploy_all_applications: { type: Boolean, required: true, default: false },
|
|
38
41
|
stripe_prices: { type: mongoose_1.Schema.Types.Mixed, required: false, default: {} },
|
|
42
|
+
sandbox_max_count: { type: Number, required: false, default: 3 },
|
|
43
|
+
sandbox_enabled: { type: Boolean, required: false, default: true }
|
|
39
44
|
}, { timestamps: true });
|
|
40
45
|
exports.default = (0, mongoose_1.model)("PlanConfigurations", PlanConfigurationSchema, "plan_configurations");
|
package/dist/project/index.js
CHANGED
|
@@ -47,6 +47,11 @@ const projectSchema = new mongoose_1.Schema({
|
|
|
47
47
|
ref: "Team",
|
|
48
48
|
type: mongoose_1.Schema.Types.ObjectId,
|
|
49
49
|
},
|
|
50
|
+
watchPaths: {
|
|
51
|
+
type: Array,
|
|
52
|
+
required: false,
|
|
53
|
+
default: [],
|
|
54
|
+
},
|
|
50
55
|
server: {
|
|
51
56
|
ref: "Server",
|
|
52
57
|
type: mongoose_1.Schema.Types.ObjectId,
|
|
@@ -102,6 +107,14 @@ const projectSchema = new mongoose_1.Schema({
|
|
|
102
107
|
type: Boolean,
|
|
103
108
|
default: false,
|
|
104
109
|
},
|
|
110
|
+
free_tier_expires_at: {
|
|
111
|
+
type: Date,
|
|
112
|
+
default: null,
|
|
113
|
+
},
|
|
114
|
+
free_tier_expiry_notified_at: {
|
|
115
|
+
type: Date,
|
|
116
|
+
default: null,
|
|
117
|
+
},
|
|
105
118
|
disabled: {
|
|
106
119
|
type: Boolean,
|
|
107
120
|
default: false,
|
|
@@ -131,12 +144,15 @@ const projectSchema = new mongoose_1.Schema({
|
|
|
131
144
|
type: mongoose_1.Schema.Types.ObjectId,
|
|
132
145
|
},
|
|
133
146
|
],
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
147
|
+
project_environment: {
|
|
148
|
+
ref: "ProjectEnvironment",
|
|
149
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
150
|
+
index: true,
|
|
151
|
+
},
|
|
152
|
+
inherit_environment_vars: {
|
|
153
|
+
type: Boolean,
|
|
154
|
+
default: true,
|
|
155
|
+
},
|
|
140
156
|
replicas: {
|
|
141
157
|
type: Number,
|
|
142
158
|
default: 3,
|
|
@@ -223,5 +239,11 @@ const projectSchema = new mongoose_1.Schema({
|
|
|
223
239
|
required: false,
|
|
224
240
|
},
|
|
225
241
|
}, { timestamps: true });
|
|
242
|
+
// Partial index for the free-tier lifecycle crons. Restricts the index to
|
|
243
|
+
// rows that actually carry an expiry, so paid/legacy projects stay out of it.
|
|
244
|
+
projectSchema.index({ free_tier_expires_at: 1, serviceType: 1, status: 1 }, {
|
|
245
|
+
partialFilterExpression: { free_tier_expires_at: { $type: "date" } },
|
|
246
|
+
name: "free_tier_lifecycle",
|
|
247
|
+
});
|
|
226
248
|
exports.default = (0, mongoose_1.model)("Project", projectSchema);
|
|
227
249
|
exports.DeletedProject = (0, mongoose_1.model)("DeletedProject", projectSchema);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose" />
|
|
25
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
26
|
+
import { IProjectEnvironment } from "./types";
|
|
27
|
+
declare const _default: import("mongoose").Model<IProjectEnvironment, {}, {}, {}, import("mongoose").Document<unknown, {}, IProjectEnvironment> & IProjectEnvironment & {
|
|
28
|
+
_id: import("mongoose").Types.ObjectId;
|
|
29
|
+
}, any>;
|
|
30
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mongoose_1 = require("mongoose");
|
|
4
|
+
const projectEnvironmentSchema = new mongoose_1.Schema({
|
|
5
|
+
name: { type: String, required: true },
|
|
6
|
+
slug: { type: String, required: true },
|
|
7
|
+
owner: { ref: "User", type: mongoose_1.Schema.Types.ObjectId, required: true },
|
|
8
|
+
team: { ref: "Team", type: mongoose_1.Schema.Types.ObjectId },
|
|
9
|
+
inherit_from: { ref: "ProjectEnvironment", type: mongoose_1.Schema.Types.ObjectId },
|
|
10
|
+
isDefault: { type: Boolean, default: false },
|
|
11
|
+
}, { timestamps: true });
|
|
12
|
+
projectEnvironmentSchema.index({ slug: 1, owner: 1, team: 1 }, { unique: true });
|
|
13
|
+
exports.default = (0, mongoose_1.model)("ProjectEnvironment", projectEnvironmentSchema);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose" />
|
|
25
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
26
|
+
import { IProjectAnalytics } from "./types/project_analytics";
|
|
27
|
+
declare const _default: import("mongoose").Model<IProjectAnalytics, {}, {}, {}, import("mongoose").Document<unknown, {}, IProjectAnalytics> & IProjectAnalytics & {
|
|
28
|
+
_id: import("mongoose").Types.ObjectId;
|
|
29
|
+
}, any>;
|
|
30
|
+
export default _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mongoose_1 = require("mongoose");
|
|
4
|
+
const ProjectAnalyticsSchema = new mongoose_1.Schema({
|
|
5
|
+
project: {
|
|
6
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
7
|
+
ref: "Project",
|
|
8
|
+
required: true,
|
|
9
|
+
unique: true,
|
|
10
|
+
index: true,
|
|
11
|
+
},
|
|
12
|
+
provider: { type: String, enum: ["umami"], required: true, default: "umami" },
|
|
13
|
+
websiteId: { type: String, required: true, unique: true },
|
|
14
|
+
shareId: { type: String, default: null },
|
|
15
|
+
domain: { type: String, required: true },
|
|
16
|
+
enabled: { type: Boolean, default: true },
|
|
17
|
+
}, { timestamps: true });
|
|
18
|
+
exports.default = (0, mongoose_1.model)("ProjectAnalytics", ProjectAnalyticsSchema, "project_analytics");
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose" />
|
|
25
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
26
|
+
import { ISandboxImage } from "./types/sandbox-image";
|
|
27
|
+
declare const _default: import("mongoose").Model<ISandboxImage, {}, {}, {}, import("mongoose").Document<unknown, {}, ISandboxImage> & ISandboxImage & {
|
|
28
|
+
_id: import("mongoose").Types.ObjectId;
|
|
29
|
+
}, any>;
|
|
30
|
+
export default _default;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mongoose_1 = require("mongoose");
|
|
4
|
+
const sandboxImageSchema = new mongoose_1.Schema({
|
|
5
|
+
name: {
|
|
6
|
+
type: String,
|
|
7
|
+
required: true,
|
|
8
|
+
unique: true,
|
|
9
|
+
},
|
|
10
|
+
display_name: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
image: {
|
|
15
|
+
type: String,
|
|
16
|
+
required: true,
|
|
17
|
+
},
|
|
18
|
+
description: {
|
|
19
|
+
type: String,
|
|
20
|
+
required: true,
|
|
21
|
+
},
|
|
22
|
+
is_available: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: true,
|
|
25
|
+
},
|
|
26
|
+
is_default: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: false,
|
|
29
|
+
},
|
|
30
|
+
}, { timestamps: true });
|
|
31
|
+
exports.default = (0, mongoose_1.model)("SandboxImage", sandboxImageSchema);
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
/// <reference types="mongoose/types/virtuals" />
|
|
24
24
|
/// <reference types="mongoose" />
|
|
25
25
|
/// <reference types="mongoose/types/inferschematype" />
|
|
26
|
-
import {
|
|
27
|
-
declare const _default: import("mongoose").Model<
|
|
26
|
+
import { ISandbox } from "./types/sandbox";
|
|
27
|
+
declare const _default: import("mongoose").Model<ISandbox, {}, {}, {}, import("mongoose").Document<unknown, {}, ISandbox> & ISandbox & {
|
|
28
28
|
_id: import("mongoose").Types.ObjectId;
|
|
29
29
|
}, any>;
|
|
30
30
|
export default _default;
|
package/dist/sandbox.js
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mongoose_1 = require("mongoose");
|
|
4
|
+
const enum_1 = require("./enum");
|
|
5
|
+
const sandboxSchema = new mongoose_1.Schema({
|
|
6
|
+
user_id: {
|
|
7
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
8
|
+
ref: "User",
|
|
9
|
+
required: true,
|
|
10
|
+
},
|
|
11
|
+
team: {
|
|
12
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
13
|
+
ref: "Team",
|
|
14
|
+
default: null,
|
|
15
|
+
},
|
|
16
|
+
project_environment: {
|
|
17
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
18
|
+
ref: "ProjectEnvironment",
|
|
19
|
+
default: null,
|
|
20
|
+
},
|
|
21
|
+
template: {
|
|
22
|
+
type: String,
|
|
23
|
+
required: true,
|
|
24
|
+
},
|
|
25
|
+
status: {
|
|
26
|
+
type: String,
|
|
27
|
+
enum: Object.values(enum_1.SANDBOX_STATUS),
|
|
28
|
+
required: true,
|
|
29
|
+
default: enum_1.SANDBOX_STATUS.STARTING,
|
|
30
|
+
},
|
|
31
|
+
nomad_job_id: {
|
|
32
|
+
type: String,
|
|
33
|
+
required: true,
|
|
34
|
+
},
|
|
35
|
+
nomad_alloc_id: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: null,
|
|
38
|
+
},
|
|
39
|
+
host: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: null,
|
|
42
|
+
},
|
|
43
|
+
port: {
|
|
44
|
+
type: Number,
|
|
45
|
+
default: null,
|
|
46
|
+
},
|
|
47
|
+
agent_token_hash: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: null,
|
|
50
|
+
},
|
|
51
|
+
region: {
|
|
52
|
+
type: String,
|
|
53
|
+
required: true,
|
|
54
|
+
},
|
|
55
|
+
specs: {
|
|
56
|
+
cpu: { type: Number, default: 2000 },
|
|
57
|
+
memory: { type: Number, default: 2048 },
|
|
58
|
+
disk: { type: Number, default: 5 },
|
|
59
|
+
},
|
|
60
|
+
created_at: {
|
|
61
|
+
type: Date,
|
|
62
|
+
default: Date.now,
|
|
63
|
+
},
|
|
64
|
+
last_activity_at: {
|
|
65
|
+
type: Date,
|
|
66
|
+
default: Date.now,
|
|
67
|
+
},
|
|
68
|
+
expires_at: {
|
|
69
|
+
type: Date,
|
|
70
|
+
required: true,
|
|
71
|
+
},
|
|
72
|
+
destroyed_at: {
|
|
73
|
+
type: Date,
|
|
74
|
+
default: null,
|
|
75
|
+
},
|
|
76
|
+
destroy_reason: {
|
|
77
|
+
type: String,
|
|
78
|
+
enum: Object.values(enum_1.SANDBOX_DESTROY_REASON),
|
|
79
|
+
default: null,
|
|
80
|
+
},
|
|
81
|
+
auto_destroy: {
|
|
82
|
+
type: Boolean,
|
|
83
|
+
default: false,
|
|
84
|
+
},
|
|
85
|
+
destroy_timeout: {
|
|
86
|
+
type: String,
|
|
87
|
+
default: null,
|
|
88
|
+
},
|
|
89
|
+
one_shot: {
|
|
90
|
+
type: Boolean,
|
|
91
|
+
default: false,
|
|
92
|
+
},
|
|
93
|
+
block_outbound: {
|
|
94
|
+
type: Boolean,
|
|
95
|
+
default: false,
|
|
96
|
+
},
|
|
97
|
+
isDeleted: {
|
|
98
|
+
type: Boolean,
|
|
99
|
+
default: false,
|
|
100
|
+
},
|
|
101
|
+
});
|
|
102
|
+
sandboxSchema.index({ user_id: 1, status: 1, isDeleted: 1 });
|
|
103
|
+
sandboxSchema.index({ expires_at: 1 });
|
|
104
|
+
sandboxSchema.index({ last_activity_at: 1, status: 1 });
|
|
105
|
+
exports.default = (0, mongoose_1.model)("Sandbox", sandboxSchema);
|
package/dist/team.js
CHANGED
|
@@ -25,6 +25,23 @@ const teamSchema = new mongoose_1.Schema({
|
|
|
25
25
|
image: {
|
|
26
26
|
type: String,
|
|
27
27
|
},
|
|
28
|
+
ai_usage_count: {
|
|
29
|
+
type: Number,
|
|
30
|
+
default: 0,
|
|
31
|
+
required: false
|
|
32
|
+
},
|
|
33
|
+
build_minutes: {
|
|
34
|
+
type: Number,
|
|
35
|
+
default: 0,
|
|
36
|
+
},
|
|
37
|
+
build_minutes_last_reset_at: {
|
|
38
|
+
type: Date,
|
|
39
|
+
default: null,
|
|
40
|
+
},
|
|
41
|
+
build_minutes_cycle_anchor: {
|
|
42
|
+
type: Date,
|
|
43
|
+
default: null,
|
|
44
|
+
},
|
|
28
45
|
build_disabled: {
|
|
29
46
|
type: Boolean,
|
|
30
47
|
default: false,
|
|
@@ -34,6 +51,23 @@ const teamSchema = new mongoose_1.Schema({
|
|
|
34
51
|
required: false,
|
|
35
52
|
ref: "Subscription",
|
|
36
53
|
},
|
|
54
|
+
size: {
|
|
55
|
+
type: Number,
|
|
56
|
+
required: false,
|
|
57
|
+
},
|
|
58
|
+
enforce_2fa: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: false,
|
|
61
|
+
},
|
|
62
|
+
enforce_2fa_at: {
|
|
63
|
+
type: Date,
|
|
64
|
+
default: null,
|
|
65
|
+
},
|
|
66
|
+
enforce_2fa_by: {
|
|
67
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
68
|
+
ref: "User",
|
|
69
|
+
default: null,
|
|
70
|
+
},
|
|
37
71
|
}, {
|
|
38
72
|
timestamps: true,
|
|
39
73
|
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Document, Types } from "mongoose";
|
|
2
|
+
import { ITeam } from "./team";
|
|
3
|
+
import { IUser } from "./user";
|
|
4
|
+
export interface IActivityLog extends Document {
|
|
5
|
+
user_id: IUser | Types.ObjectId;
|
|
6
|
+
team_id?: ITeam | Types.ObjectId;
|
|
7
|
+
action: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
context?: string;
|
|
10
|
+
metadata?: Record<string, any>;
|
|
11
|
+
ip_address?: string;
|
|
12
|
+
user_agent?: string;
|
|
13
|
+
status: "success" | "failure";
|
|
14
|
+
resource_type?: string;
|
|
15
|
+
resource_id?: Types.ObjectId;
|
|
16
|
+
created_at: Date;
|
|
17
|
+
updated_at: Date;
|
|
18
|
+
}
|
|
@@ -2,10 +2,11 @@ import { Document } from "mongoose";
|
|
|
2
2
|
import { IUser } from "./user";
|
|
3
3
|
import { ITeam } from "./team";
|
|
4
4
|
export interface IAppMessage extends Document {
|
|
5
|
-
userId
|
|
6
|
-
teamId
|
|
5
|
+
userId?: IUser;
|
|
6
|
+
teamId?: ITeam;
|
|
7
7
|
level: string;
|
|
8
8
|
message: string;
|
|
9
|
+
seen: boolean;
|
|
9
10
|
meta?: Record<string, any>;
|
|
10
11
|
route?: string;
|
|
11
12
|
type: string;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Document } from "mongoose";
|
|
2
|
+
import { IUser } from "./user";
|
|
3
|
+
import { ITeam } from "./team";
|
|
2
4
|
export interface ICashierSubscription extends Document {
|
|
3
|
-
user_id:
|
|
5
|
+
user_id: IUser;
|
|
6
|
+
team_id?: ITeam | null;
|
|
4
7
|
type: string;
|
|
5
8
|
stripe_id: string;
|
|
6
9
|
stripe_status: string;
|
|
@@ -8,7 +11,6 @@ export interface ICashierSubscription extends Document {
|
|
|
8
11
|
quantity: number | null;
|
|
9
12
|
trial_ends_at: Date | null;
|
|
10
13
|
ends_at: Date | null;
|
|
11
|
-
team_id: string | null;
|
|
12
14
|
plan_type: string | null;
|
|
13
15
|
domain_id: string | null;
|
|
14
16
|
created_at: Date;
|
package/dist/types/db-image.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Document } from "mongoose";
|
|
2
|
-
import { IPreview, IProject, ISubscription, ITeam, IUser } from "../";
|
|
2
|
+
import { IPreview, IProject, IProjectEnvironment, ISubscription, ITeam, IUser } from "../";
|
|
3
3
|
import { IDns } from "./dns";
|
|
4
4
|
export interface IDomain extends Document {
|
|
5
5
|
name: string;
|
|
@@ -23,6 +23,7 @@ export interface IDomain extends Document {
|
|
|
23
23
|
trigger_created_at: string;
|
|
24
24
|
nameservers: string[];
|
|
25
25
|
dns: IDns[];
|
|
26
|
+
project_environment?: IProjectEnvironment;
|
|
26
27
|
is_pending_verification: boolean;
|
|
27
28
|
redirect?: {
|
|
28
29
|
url: string;
|
package/dist/types/env.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Document } from "mongoose";
|
|
2
2
|
import { ENVIRONMENT } from "../enum";
|
|
3
|
-
import { IBranch } from "./branch";
|
|
4
3
|
import { IProject, IUser } from "./";
|
|
5
4
|
export interface IEnv extends Document {
|
|
6
5
|
name: string;
|
|
@@ -8,8 +7,6 @@ export interface IEnv extends Document {
|
|
|
8
7
|
project: IProject;
|
|
9
8
|
user: IUser;
|
|
10
9
|
environment: ENVIRONMENT | string;
|
|
11
|
-
branch?: IBranch;
|
|
12
|
-
inheritable?: boolean;
|
|
13
10
|
is_system?: boolean;
|
|
14
11
|
createdAt: Date;
|
|
15
12
|
updatedAt: Date;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Document } from "mongoose";
|
|
2
|
+
import { IProjectEnvironment } from "./project-environment";
|
|
3
|
+
import { IUser } from "./user";
|
|
4
|
+
export interface IEnvironmentVariable extends Document {
|
|
5
|
+
name: string;
|
|
6
|
+
value: string;
|
|
7
|
+
project_environment: IProjectEnvironment;
|
|
8
|
+
user: IUser;
|
|
9
|
+
inheritable: boolean;
|
|
10
|
+
createdAt: Date;
|
|
11
|
+
updatedAt: Date;
|
|
12
|
+
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export type { IAutoScalingGroup } from "./auto-scaling-group";
|
|
2
|
-
export type { IBranch } from "./branch";
|
|
3
2
|
export type { ICard } from "./card";
|
|
4
3
|
export type { IComputeChange } from "./compute";
|
|
5
4
|
export type { IDbImage } from "./db-image";
|
|
@@ -24,6 +23,7 @@ export type { IPermission } from "./permission";
|
|
|
24
23
|
export type { IPlanConfiguration } from "./plan_configuration";
|
|
25
24
|
export type { IProvider } from "./provider";
|
|
26
25
|
export type { IProject } from "./project";
|
|
26
|
+
export type { IProjectAnalytics } from "./project_analytics";
|
|
27
27
|
export type { IProjectConnection } from "./project/connection";
|
|
28
28
|
export type { IPreview } from "./project/preview";
|
|
29
29
|
export type { IRegion } from "./region";
|
|
@@ -50,3 +50,9 @@ export type { IInvoice } from "./invoice";
|
|
|
50
50
|
export type { IProjectTagAssignment } from "./project-tag-assignment";
|
|
51
51
|
export type { ITag } from "./tag";
|
|
52
52
|
export type { ICashierSubscription, ICashierSubscriptionItem } from "./cashier_subscription";
|
|
53
|
+
export type { IProjectEnvironment } from "./project-environment";
|
|
54
|
+
export type { IEnvironmentVariable } from "./environment-variable";
|
|
55
|
+
export type { IActivityLog } from "./activity-log";
|
|
56
|
+
export type { IOwnershipTransfer } from "./ownership-transfer";
|
|
57
|
+
export type { ISandbox, ISandboxSpecs } from "./sandbox";
|
|
58
|
+
export type { ISandboxImage } from "./sandbox-image";
|
package/dist/types/member.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { Document } from "mongoose";
|
|
|
2
2
|
import { ROLES } from "../enum";
|
|
3
3
|
import { ITeam, IUser } from "./";
|
|
4
4
|
import { IMemberPermission } from "./member-permission";
|
|
5
|
+
import { IProjectEnvironment } from "./project-environment";
|
|
5
6
|
export interface IMember extends Document {
|
|
6
7
|
user: IUser;
|
|
7
8
|
team: ITeam;
|
|
@@ -11,6 +12,7 @@ export interface IMember extends Document {
|
|
|
11
12
|
email: string;
|
|
12
13
|
featureOnboarded: boolean;
|
|
13
14
|
permissions: IMemberPermission[];
|
|
15
|
+
project_environments: IProjectEnvironment[];
|
|
14
16
|
createdAt: Date;
|
|
15
17
|
updatedAt: Date;
|
|
16
18
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Document } from "mongoose";
|
|
2
|
+
import { ITeam } from "./team";
|
|
3
|
+
import { IUser } from "./user";
|
|
4
|
+
export interface IOwnershipTransfer extends Document {
|
|
5
|
+
team: ITeam;
|
|
6
|
+
from_user: IUser;
|
|
7
|
+
to_user: IUser;
|
|
8
|
+
status: "pending" | "accepted" | "denied" | "expired";
|
|
9
|
+
expires_at: Date;
|
|
10
|
+
created_at: Date;
|
|
11
|
+
updated_at: Date;
|
|
12
|
+
}
|
|
@@ -11,10 +11,13 @@ export interface IPlanConfiguration extends Document {
|
|
|
11
11
|
project_limit: number;
|
|
12
12
|
deploy_private_organization: boolean;
|
|
13
13
|
preview_comments: boolean;
|
|
14
|
+
password_enabled: boolean;
|
|
14
15
|
analytics: boolean;
|
|
15
16
|
build_minutes: number;
|
|
16
17
|
log_retention: number;
|
|
17
18
|
multi_region: boolean;
|
|
19
|
+
ai_debug_enabled: boolean;
|
|
20
|
+
ai_debug_limit: number;
|
|
18
21
|
bandwidth: number;
|
|
19
22
|
pull_request_preview: boolean;
|
|
20
23
|
plan_type: SUBSCRIPTION_PLAN_TYPE;
|
|
@@ -31,4 +34,6 @@ export interface IPlanConfiguration extends Document {
|
|
|
31
34
|
webhook_enabled: boolean;
|
|
32
35
|
can_deploy_all_applications: boolean;
|
|
33
36
|
stripe_prices?: Record<string, string>;
|
|
37
|
+
sandbox_max_count: number;
|
|
38
|
+
sandbox_enabled: boolean;
|
|
34
39
|
}
|