@brimble/models 3.8.186 → 3.8.188
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/changelog-campaign.ts +19 -5
- package/changelog-entry.ts +12 -2
- package/dist/agent-chat-file.js +5 -1
- package/dist/agent-chat-model.js +1 -1
- package/dist/agent-design-skill-revision.js +15 -3
- package/dist/agent-design-skill.js +5 -1
- package/dist/agent-website-file-overlay.js +5 -1
- package/dist/agent-website-snapshot.js +5 -1
- package/dist/app-message.js +12 -2
- package/dist/blog-post.js +7 -1
- package/dist/career-role.js +7 -1
- package/dist/cashier_subscription.js +1 -1
- package/dist/changelog-campaign.js +15 -4
- package/dist/changelog-entry.js +12 -2
- package/dist/collab-annotation.js +6 -1
- package/dist/collab-comment.js +6 -1
- package/dist/collab-integration.js +6 -1
- package/dist/collab-push-subscription.js +10 -2
- package/dist/collab-share-token.js +6 -1
- package/dist/coupon-redemption.js +16 -3
- package/dist/coupon.js +16 -3
- package/dist/db-image.js +6 -6
- package/dist/domain/index.js +1 -1
- package/dist/domain/renewal.js +1 -1
- package/dist/drain.js +28 -5
- package/dist/environment-variable.js +5 -1
- package/dist/framework.js +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/logs.js +2 -2
- package/dist/member.js +3 -1
- package/dist/object-storage-usage-segment.js +10 -2
- package/dist/pgbouncer-usage-segment.js +10 -2
- package/dist/plan_configuration.js +9 -5
- package/dist/platform-api-key.js +17 -3
- package/dist/project/index.js +11 -7
- package/dist/project-drain-subscription.js +12 -2
- package/dist/project-network-settings.js +15 -3
- package/dist/project_analytics.js +6 -1
- package/dist/quest-campaign.js +4 -1
- package/dist/quest-participation.js +16 -3
- package/dist/quest-reward-issuance.js +27 -5
- package/dist/sandbox-snapshot-usage-segment.js +10 -2
- package/dist/sandbox-warm-pool.js +4 -1
- package/dist/sandbox.js +1 -1
- package/dist/server.js +1 -1
- package/dist/settings.js +1 -1
- package/dist/storage.js +178 -30
- package/dist/streak-day.js +10 -2
- package/dist/streak-event.js +10 -2
- package/dist/streak-milestone.js +10 -2
- package/dist/streak.js +11 -2
- package/dist/subscription.js +2 -2
- package/dist/team.js +1 -1
- package/dist/ticket.js +6 -1
- package/dist/types/index.d.ts +3 -3
- package/dist/types/plan_configuration.d.ts +2 -2
- package/dist/user.js +8 -2
- package/dist/volume.js +2 -2
- package/dist/wallet.js +2 -2
- package/dist/webhook-category.js +1 -1
- package/dist/webhook-setting.js +1 -1
- package/package.json +1 -1
|
@@ -35,8 +35,16 @@ const objectStorageUsageSegmentSchema = new mongoose_1.Schema({
|
|
|
35
35
|
}, {
|
|
36
36
|
timestamps: true,
|
|
37
37
|
});
|
|
38
|
-
objectStorageUsageSegmentSchema.index({
|
|
39
|
-
|
|
38
|
+
objectStorageUsageSegmentSchema.index({
|
|
39
|
+
user_id: 1,
|
|
40
|
+
billed: 1,
|
|
41
|
+
"costs.endDate": 1,
|
|
42
|
+
});
|
|
43
|
+
objectStorageUsageSegmentSchema.index({
|
|
44
|
+
team_id: 1,
|
|
45
|
+
billed: 1,
|
|
46
|
+
"costs.endDate": 1,
|
|
47
|
+
});
|
|
40
48
|
objectStorageUsageSegmentSchema.index({ bucket_id: 1, "costs.endDate": 1 });
|
|
41
49
|
objectStorageUsageSegmentSchema.index({ bucket_id: 1 }, {
|
|
42
50
|
unique: true,
|
|
@@ -32,8 +32,16 @@ const pgbouncerUsageSegmentSchema = new mongoose_1.Schema({
|
|
|
32
32
|
}, {
|
|
33
33
|
timestamps: true,
|
|
34
34
|
});
|
|
35
|
-
pgbouncerUsageSegmentSchema.index({
|
|
36
|
-
|
|
35
|
+
pgbouncerUsageSegmentSchema.index({
|
|
36
|
+
user_id: 1,
|
|
37
|
+
billed: 1,
|
|
38
|
+
"costs.endDate": 1,
|
|
39
|
+
});
|
|
40
|
+
pgbouncerUsageSegmentSchema.index({
|
|
41
|
+
team_id: 1,
|
|
42
|
+
billed: 1,
|
|
43
|
+
"costs.endDate": 1,
|
|
44
|
+
});
|
|
37
45
|
pgbouncerUsageSegmentSchema.index({ project_id: 1, "costs.endDate": 1 });
|
|
38
46
|
pgbouncerUsageSegmentSchema.index({ project_id: 1 }, {
|
|
39
47
|
unique: true,
|
|
@@ -44,19 +44,24 @@ const PlanConfigurationSchema = new mongoose_1.Schema({
|
|
|
44
44
|
view_metrics: { type: Boolean, required: false, default: false },
|
|
45
45
|
custom_domain: { type: Boolean, required: true, default: false },
|
|
46
46
|
wildcard_domain: { type: Boolean, required: true, default: false },
|
|
47
|
+
email_forwarding_enabled: { type: Boolean, required: true, default: false },
|
|
47
48
|
webhook_enabled: { type: Boolean, required: true, default: false },
|
|
48
|
-
can_deploy_all_applications: {
|
|
49
|
+
can_deploy_all_applications: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
required: true,
|
|
52
|
+
default: false,
|
|
53
|
+
},
|
|
49
54
|
stripe_prices: { type: mongoose_1.Schema.Types.Mixed, required: false, default: {} },
|
|
50
55
|
sandbox_max_count: { type: Number, required: false, default: 3 },
|
|
51
|
-
|
|
56
|
+
sandbox_hours_max: { type: Number, required: false, default: 16 },
|
|
52
57
|
sandbox_enabled: { type: Boolean, required: false, default: true },
|
|
53
58
|
sandbox_cpu_hours_included: { type: Number, default: 0 },
|
|
54
59
|
sandbox_memory_gb_hours_included: { type: Number, default: 0 },
|
|
55
60
|
sandbox_max_runtime_minutes: { type: Number, default: 0 },
|
|
56
61
|
sandbox_max_vcpu: { type: Number, default: 0 },
|
|
57
62
|
sandbox_max_memory_gb: { type: Number, default: 0 },
|
|
58
|
-
sandbox_default_size: { type: String, default:
|
|
59
|
-
sandbox_allowed_sizes: { type: [String], default: [
|
|
63
|
+
sandbox_default_size: { type: String, default: "sbx.micro" },
|
|
64
|
+
sandbox_allowed_sizes: { type: [String], default: ["sbx.micro"] },
|
|
60
65
|
sandbox_warm_pool_count: { type: Number, default: 5 },
|
|
61
66
|
sandbox_creation_rate_per_minute: { type: Number, default: 0 },
|
|
62
67
|
sandbox_cpu_overage_price: { type: Number, default: 0 },
|
|
@@ -70,6 +75,5 @@ const PlanConfigurationSchema = new mongoose_1.Schema({
|
|
|
70
75
|
agent_chat_enabled: { type: Boolean, default: false },
|
|
71
76
|
agent_chat_tokens_per_session: { type: Number, default: 0 },
|
|
72
77
|
agent_chats_per_day: { type: Number, default: 0 },
|
|
73
|
-
email_forward_limit: { type: Number, default: 1 },
|
|
74
78
|
}, { timestamps: true });
|
|
75
79
|
exports.default = (0, mongoose_1.model)("PlanConfigurations", PlanConfigurationSchema, "plan_configurations");
|
package/dist/platform-api-key.js
CHANGED
|
@@ -6,9 +6,23 @@ const platformApiKeySchema = new mongoose_1.Schema({
|
|
|
6
6
|
name: { type: String, required: true, trim: true, maxlength: 100 },
|
|
7
7
|
key_id: { type: String, required: true, unique: true, index: true },
|
|
8
8
|
key_prefix: { type: String, required: true },
|
|
9
|
-
owner_id: {
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
owner_id: {
|
|
10
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
11
|
+
ref: "User",
|
|
12
|
+
required: true,
|
|
13
|
+
index: true,
|
|
14
|
+
},
|
|
15
|
+
team_id: {
|
|
16
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
17
|
+
ref: "Team",
|
|
18
|
+
default: null,
|
|
19
|
+
index: true,
|
|
20
|
+
},
|
|
21
|
+
subscription_id: {
|
|
22
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
23
|
+
ref: "Subscription",
|
|
24
|
+
default: null,
|
|
25
|
+
},
|
|
12
26
|
permissions: { type: [String], required: true },
|
|
13
27
|
status: {
|
|
14
28
|
type: String,
|
package/dist/project/index.js
CHANGED
|
@@ -22,7 +22,7 @@ const projectSchema = new mongoose_1.Schema({
|
|
|
22
22
|
http2: {
|
|
23
23
|
type: Boolean,
|
|
24
24
|
default: false,
|
|
25
|
-
required: false
|
|
25
|
+
required: false,
|
|
26
26
|
},
|
|
27
27
|
healthCheckPath: {
|
|
28
28
|
type: String,
|
|
@@ -46,7 +46,7 @@ const projectSchema = new mongoose_1.Schema({
|
|
|
46
46
|
},
|
|
47
47
|
workBenchEnabled: {
|
|
48
48
|
type: Boolean,
|
|
49
|
-
default: false
|
|
49
|
+
default: false,
|
|
50
50
|
},
|
|
51
51
|
domains: [
|
|
52
52
|
{
|
|
@@ -95,7 +95,7 @@ const projectSchema = new mongoose_1.Schema({
|
|
|
95
95
|
},
|
|
96
96
|
tlsEnabled: {
|
|
97
97
|
type: Boolean,
|
|
98
|
-
default: false
|
|
98
|
+
default: false,
|
|
99
99
|
},
|
|
100
100
|
pgbouncerEnabled: {
|
|
101
101
|
type: Boolean,
|
|
@@ -319,7 +319,7 @@ const projectSchema = new mongoose_1.Schema({
|
|
|
319
319
|
public: {
|
|
320
320
|
type: Boolean,
|
|
321
321
|
default: true,
|
|
322
|
-
required: false
|
|
322
|
+
required: false,
|
|
323
323
|
},
|
|
324
324
|
screenshot: {
|
|
325
325
|
image: String,
|
|
@@ -411,7 +411,11 @@ const projectSchema = new mongoose_1.Schema({
|
|
|
411
411
|
haCluster: {
|
|
412
412
|
type: {
|
|
413
413
|
clusterName: { type: String, required: true },
|
|
414
|
-
regions: {
|
|
414
|
+
regions: {
|
|
415
|
+
type: [mongoose_1.Schema.Types.ObjectId],
|
|
416
|
+
ref: "Region",
|
|
417
|
+
default: undefined,
|
|
418
|
+
},
|
|
415
419
|
members: [
|
|
416
420
|
{
|
|
417
421
|
index: { type: Number, required: true },
|
|
@@ -512,12 +516,12 @@ const projectSchema = new mongoose_1.Schema({
|
|
|
512
516
|
},
|
|
513
517
|
persistent_mount_path: {
|
|
514
518
|
type: String,
|
|
515
|
-
required: false
|
|
519
|
+
required: false,
|
|
516
520
|
},
|
|
517
521
|
sendReport: {
|
|
518
522
|
type: Boolean,
|
|
519
523
|
default: false,
|
|
520
|
-
required: false
|
|
524
|
+
required: false,
|
|
521
525
|
},
|
|
522
526
|
volumeMount: {
|
|
523
527
|
type: String,
|
|
@@ -2,8 +2,18 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const mongoose_1 = require("mongoose");
|
|
4
4
|
const ProjectDrainSubscriptionSchema = new mongoose_1.Schema({
|
|
5
|
-
drain: {
|
|
6
|
-
|
|
5
|
+
drain: {
|
|
6
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
7
|
+
ref: "Drain",
|
|
8
|
+
required: true,
|
|
9
|
+
index: true,
|
|
10
|
+
},
|
|
11
|
+
project: {
|
|
12
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
13
|
+
ref: "Project",
|
|
14
|
+
required: true,
|
|
15
|
+
index: true,
|
|
16
|
+
},
|
|
7
17
|
enabled: { type: Boolean, default: true },
|
|
8
18
|
disabledAt: { type: Date, default: null },
|
|
9
19
|
}, { timestamps: true });
|
|
@@ -15,9 +15,21 @@ const projectNetworkSettingsSchema = new mongoose_1.Schema({
|
|
|
15
15
|
bypassCache: { type: Boolean, default: false },
|
|
16
16
|
},
|
|
17
17
|
responseRules: {
|
|
18
|
-
xFrameOptions: {
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
xFrameOptions: {
|
|
19
|
+
type: String,
|
|
20
|
+
enum: Object.values(enum_1.XFrameOptions),
|
|
21
|
+
default: enum_1.XFrameOptions.Deny,
|
|
22
|
+
},
|
|
23
|
+
xContentTypeOptions: {
|
|
24
|
+
type: String,
|
|
25
|
+
enum: Object.values(enum_1.XContentTypeOptions),
|
|
26
|
+
default: enum_1.XContentTypeOptions.NoSniff,
|
|
27
|
+
},
|
|
28
|
+
xRobotsTag: {
|
|
29
|
+
type: String,
|
|
30
|
+
enum: Object.values(enum_1.XRobotsTag),
|
|
31
|
+
default: enum_1.XRobotsTag.IndexFollow,
|
|
32
|
+
},
|
|
21
33
|
hstsEnabled: { type: Boolean, default: false },
|
|
22
34
|
markdownForAgents: { type: Boolean, default: false },
|
|
23
35
|
},
|
|
@@ -9,7 +9,12 @@ const ProjectAnalyticsSchema = new mongoose_1.Schema({
|
|
|
9
9
|
unique: true,
|
|
10
10
|
index: true,
|
|
11
11
|
},
|
|
12
|
-
provider: {
|
|
12
|
+
provider: {
|
|
13
|
+
type: String,
|
|
14
|
+
enum: ["umami"],
|
|
15
|
+
required: true,
|
|
16
|
+
default: "umami",
|
|
17
|
+
},
|
|
13
18
|
websiteId: { type: String, required: true, unique: true },
|
|
14
19
|
shareId: { type: String, default: null },
|
|
15
20
|
domain: { type: String, required: true },
|
package/dist/quest-campaign.js
CHANGED
|
@@ -34,6 +34,9 @@ const questCampaignSchema = new mongoose_1.Schema({
|
|
|
34
34
|
rewards: { type: [questRewardSchema], default: [] },
|
|
35
35
|
active: { type: Boolean, default: true, index: true },
|
|
36
36
|
auto_expire: { type: Boolean, default: true },
|
|
37
|
-
}, {
|
|
37
|
+
}, {
|
|
38
|
+
timestamps: { createdAt: "created_at", updatedAt: "updated_at" },
|
|
39
|
+
collection: "quest_campaigns",
|
|
40
|
+
});
|
|
38
41
|
questCampaignSchema.index({ active: 1, start_at: 1, end_at: 1 });
|
|
39
42
|
exports.default = (0, mongoose_1.model)("QuestCampaign", questCampaignSchema);
|
|
@@ -8,14 +8,27 @@ const questCriterionProgressSchema = new mongoose_1.Schema({
|
|
|
8
8
|
met: { type: Boolean, default: false },
|
|
9
9
|
}, { _id: false });
|
|
10
10
|
const questParticipationSchema = new mongoose_1.Schema({
|
|
11
|
-
campaign_id: {
|
|
12
|
-
|
|
11
|
+
campaign_id: {
|
|
12
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
13
|
+
ref: "QuestCampaign",
|
|
14
|
+
required: true,
|
|
15
|
+
index: true,
|
|
16
|
+
},
|
|
17
|
+
user_id: {
|
|
18
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
19
|
+
ref: "User",
|
|
20
|
+
required: true,
|
|
21
|
+
index: true,
|
|
22
|
+
},
|
|
13
23
|
joined_at: { type: Date, required: true },
|
|
14
24
|
slot_number: { type: Number, required: true },
|
|
15
25
|
streak_deducted: { type: Number, default: 0 },
|
|
16
26
|
criteria_progress: { type: [questCriterionProgressSchema], default: [] },
|
|
17
27
|
qualifier_met: { type: Boolean, default: false },
|
|
18
28
|
claimed_at: { type: Date, default: null },
|
|
19
|
-
}, {
|
|
29
|
+
}, {
|
|
30
|
+
timestamps: { createdAt: "created_at", updatedAt: "updated_at" },
|
|
31
|
+
collection: "quest_participations",
|
|
32
|
+
});
|
|
20
33
|
questParticipationSchema.index({ campaign_id: 1, user_id: 1 }, { unique: true });
|
|
21
34
|
exports.default = (0, mongoose_1.model)("QuestParticipation", questParticipationSchema);
|
|
@@ -7,13 +7,35 @@ const questIssuedRewardSchema = new mongoose_1.Schema({
|
|
|
7
7
|
metadata: { type: mongoose_1.Schema.Types.Mixed, default: {} },
|
|
8
8
|
}, { _id: false });
|
|
9
9
|
const questRewardIssuanceSchema = new mongoose_1.Schema({
|
|
10
|
-
participation_id: {
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
participation_id: {
|
|
11
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
12
|
+
ref: "QuestParticipation",
|
|
13
|
+
required: true,
|
|
14
|
+
index: true,
|
|
15
|
+
},
|
|
16
|
+
campaign_id: {
|
|
17
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
18
|
+
ref: "QuestCampaign",
|
|
19
|
+
required: true,
|
|
20
|
+
index: true,
|
|
21
|
+
},
|
|
22
|
+
user_id: {
|
|
23
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
24
|
+
ref: "User",
|
|
25
|
+
required: true,
|
|
26
|
+
index: true,
|
|
27
|
+
},
|
|
13
28
|
rewards: { type: [questIssuedRewardSchema], default: [] },
|
|
14
|
-
status: {
|
|
29
|
+
status: {
|
|
30
|
+
type: String,
|
|
31
|
+
required: true,
|
|
32
|
+
default: enum_1.QuestRewardStatus.Claimed,
|
|
33
|
+
},
|
|
15
34
|
claimed_at: { type: Date, required: true },
|
|
16
35
|
fulfilled_at: { type: Date, default: null },
|
|
17
|
-
}, {
|
|
36
|
+
}, {
|
|
37
|
+
timestamps: { createdAt: "created_at", updatedAt: "updated_at" },
|
|
38
|
+
collection: "quest_reward_issuances",
|
|
39
|
+
});
|
|
18
40
|
questRewardIssuanceSchema.index({ campaign_id: 1, user_id: 1 }, { unique: true });
|
|
19
41
|
exports.default = (0, mongoose_1.model)("QuestRewardIssuance", questRewardIssuanceSchema);
|
|
@@ -38,8 +38,16 @@ const sandboxSnapshotUsageSegmentSchema = new mongoose_1.Schema({
|
|
|
38
38
|
}, {
|
|
39
39
|
timestamps: true,
|
|
40
40
|
});
|
|
41
|
-
sandboxSnapshotUsageSegmentSchema.index({
|
|
42
|
-
|
|
41
|
+
sandboxSnapshotUsageSegmentSchema.index({
|
|
42
|
+
user_id: 1,
|
|
43
|
+
billed: 1,
|
|
44
|
+
"costs.endDate": 1,
|
|
45
|
+
});
|
|
46
|
+
sandboxSnapshotUsageSegmentSchema.index({
|
|
47
|
+
team_id: 1,
|
|
48
|
+
billed: 1,
|
|
49
|
+
"costs.endDate": 1,
|
|
50
|
+
});
|
|
43
51
|
sandboxSnapshotUsageSegmentSchema.index({ snapshot_id: 1, "costs.endDate": 1 });
|
|
44
52
|
sandboxSnapshotUsageSegmentSchema.index({ snapshot_id: 1 }, {
|
|
45
53
|
unique: true,
|
|
@@ -11,6 +11,9 @@ const sandboxWarmPoolSchema = new mongoose_1.Schema({
|
|
|
11
11
|
mem_mb: { type: Number, required: true },
|
|
12
12
|
image_tag: { type: String, default: "" },
|
|
13
13
|
target_count: { type: Number, required: true },
|
|
14
|
-
}, {
|
|
14
|
+
}, {
|
|
15
|
+
timestamps: { createdAt: "created_at", updatedAt: "updated_at" },
|
|
16
|
+
_id: false,
|
|
17
|
+
});
|
|
15
18
|
sandboxWarmPoolSchema.index({ region: 1, size: 1 });
|
|
16
19
|
exports.default = (0, mongoose_1.model)("SandboxWarmPool", sandboxWarmPoolSchema, "sandbox_warm_pools");
|
package/dist/sandbox.js
CHANGED
package/dist/server.js
CHANGED
package/dist/settings.js
CHANGED
package/dist/storage.js
CHANGED
|
@@ -5,10 +5,30 @@ const mongoose_1 = require("mongoose");
|
|
|
5
5
|
const enum_1 = require("./enum");
|
|
6
6
|
const storageBucketSchema = new mongoose_1.Schema({
|
|
7
7
|
name: { type: String, required: true, trim: true },
|
|
8
|
-
project: {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
project: {
|
|
9
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
10
|
+
ref: "Project",
|
|
11
|
+
required: false,
|
|
12
|
+
index: true,
|
|
13
|
+
},
|
|
14
|
+
project_environment: {
|
|
15
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
16
|
+
ref: "ProjectEnvironment",
|
|
17
|
+
required: false,
|
|
18
|
+
index: true,
|
|
19
|
+
},
|
|
20
|
+
user_id: {
|
|
21
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
22
|
+
ref: "User",
|
|
23
|
+
required: false,
|
|
24
|
+
index: true,
|
|
25
|
+
},
|
|
26
|
+
team: {
|
|
27
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
28
|
+
ref: "Team",
|
|
29
|
+
required: false,
|
|
30
|
+
index: true,
|
|
31
|
+
},
|
|
12
32
|
bucket_name: { type: String, required: true, unique: true },
|
|
13
33
|
is_public: { type: Boolean, default: false },
|
|
14
34
|
versioning: { type: Boolean, default: false },
|
|
@@ -21,7 +41,11 @@ const storageBucketSchema = new mongoose_1.Schema({
|
|
|
21
41
|
quota: { type: Number, required: true },
|
|
22
42
|
cors_rules: { type: Array, required: false },
|
|
23
43
|
lifecycle_rules: { type: Array, required: false },
|
|
24
|
-
status: {
|
|
44
|
+
status: {
|
|
45
|
+
type: String,
|
|
46
|
+
enum: Object.values(enum_1.StorageBucketStatus),
|
|
47
|
+
default: enum_1.StorageBucketStatus.Active,
|
|
48
|
+
},
|
|
25
49
|
starred: { type: Boolean, default: false },
|
|
26
50
|
}, { timestamps: true });
|
|
27
51
|
storageBucketSchema.index({ user_id: 1, team: 1, name: 1 }, { unique: true, name: "uniq_storage_bucket_owner_name" });
|
|
@@ -29,9 +53,24 @@ storageBucketSchema.index({ user_id: 1, updatedAt: -1 }, { name: "idx_storage_bu
|
|
|
29
53
|
storageBucketSchema.index({ team: 1, updatedAt: -1 }, { name: "idx_storage_bucket_team_updated_at" });
|
|
30
54
|
storageBucketSchema.index({ user_id: 1, team: 1, project_environment: 1, updatedAt: -1 }, { name: "idx_storage_bucket_environment_updated_at" });
|
|
31
55
|
const storageObjectSchema = new mongoose_1.Schema({
|
|
32
|
-
bucket: {
|
|
33
|
-
|
|
34
|
-
|
|
56
|
+
bucket: {
|
|
57
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
58
|
+
ref: "StorageBucket",
|
|
59
|
+
required: true,
|
|
60
|
+
index: true,
|
|
61
|
+
},
|
|
62
|
+
project: {
|
|
63
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
64
|
+
ref: "Project",
|
|
65
|
+
required: false,
|
|
66
|
+
index: true,
|
|
67
|
+
},
|
|
68
|
+
project_environment: {
|
|
69
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
70
|
+
ref: "ProjectEnvironment",
|
|
71
|
+
required: false,
|
|
72
|
+
index: true,
|
|
73
|
+
},
|
|
35
74
|
key: { type: String, required: true },
|
|
36
75
|
path: { type: String, required: true },
|
|
37
76
|
content_type: { type: String },
|
|
@@ -42,15 +81,35 @@ const storageObjectSchema = new mongoose_1.Schema({
|
|
|
42
81
|
}, { timestamps: true });
|
|
43
82
|
storageObjectSchema.index({ bucket: 1, key: 1 }, { unique: true, name: "uniq_storage_object_bucket_key" });
|
|
44
83
|
const storageUploadSchema = new mongoose_1.Schema({
|
|
45
|
-
bucket: {
|
|
46
|
-
|
|
47
|
-
|
|
84
|
+
bucket: {
|
|
85
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
86
|
+
ref: "StorageBucket",
|
|
87
|
+
required: true,
|
|
88
|
+
index: true,
|
|
89
|
+
},
|
|
90
|
+
project: {
|
|
91
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
92
|
+
ref: "Project",
|
|
93
|
+
required: false,
|
|
94
|
+
index: true,
|
|
95
|
+
},
|
|
96
|
+
project_environment: {
|
|
97
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
98
|
+
ref: "ProjectEnvironment",
|
|
99
|
+
required: false,
|
|
100
|
+
index: true,
|
|
101
|
+
},
|
|
48
102
|
key: { type: String, required: true },
|
|
49
103
|
path: { type: String, required: true },
|
|
50
104
|
upload_id: { type: String, index: true },
|
|
51
105
|
content_type: { type: String },
|
|
52
106
|
size: { type: Number, required: true },
|
|
53
|
-
status: {
|
|
107
|
+
status: {
|
|
108
|
+
type: String,
|
|
109
|
+
enum: Object.values(enum_1.StorageUploadStatus),
|
|
110
|
+
default: enum_1.StorageUploadStatus.Pending,
|
|
111
|
+
index: true,
|
|
112
|
+
},
|
|
54
113
|
expires_at: { type: Date, required: true, index: true },
|
|
55
114
|
completed_at: { type: Date },
|
|
56
115
|
}, { timestamps: true });
|
|
@@ -58,46 +117,135 @@ const storageTokenSchema = new mongoose_1.Schema({
|
|
|
58
117
|
name: { type: String, required: true, trim: true },
|
|
59
118
|
token_hash: { type: String, required: true, unique: true },
|
|
60
119
|
prefix: { type: String, required: true },
|
|
61
|
-
project: {
|
|
120
|
+
project: {
|
|
121
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
122
|
+
ref: "Project",
|
|
123
|
+
required: false,
|
|
124
|
+
index: true,
|
|
125
|
+
},
|
|
62
126
|
buckets: [{ type: mongoose_1.Schema.Types.ObjectId, ref: "StorageBucket" }],
|
|
63
|
-
user_id: {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
127
|
+
user_id: {
|
|
128
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
129
|
+
ref: "User",
|
|
130
|
+
required: false,
|
|
131
|
+
index: true,
|
|
132
|
+
},
|
|
133
|
+
team: {
|
|
134
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
135
|
+
ref: "Team",
|
|
136
|
+
required: false,
|
|
137
|
+
index: true,
|
|
138
|
+
},
|
|
139
|
+
permissions: [
|
|
140
|
+
{
|
|
141
|
+
type: String,
|
|
142
|
+
enum: ["read", "write", "delete", "list", "admin"],
|
|
143
|
+
required: true,
|
|
144
|
+
},
|
|
145
|
+
],
|
|
146
|
+
status: {
|
|
147
|
+
type: String,
|
|
148
|
+
enum: Object.values(enum_1.StorageTokenStatus),
|
|
149
|
+
default: enum_1.StorageTokenStatus.Active,
|
|
150
|
+
},
|
|
67
151
|
last_used_at: { type: Date },
|
|
68
152
|
expires_at: { type: Date },
|
|
69
153
|
}, { timestamps: true });
|
|
70
154
|
storageTokenSchema.index({ project: 1, status: 1 }, { name: "idx_storage_token_project_status" });
|
|
71
155
|
const storageCredentialSchema = new mongoose_1.Schema({
|
|
72
156
|
name: { type: String, required: true, trim: true },
|
|
73
|
-
bucket: {
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
157
|
+
bucket: {
|
|
158
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
159
|
+
ref: "StorageBucket",
|
|
160
|
+
required: true,
|
|
161
|
+
index: true,
|
|
162
|
+
},
|
|
163
|
+
project: {
|
|
164
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
165
|
+
ref: "Project",
|
|
166
|
+
required: false,
|
|
167
|
+
index: true,
|
|
168
|
+
},
|
|
169
|
+
project_environment: {
|
|
170
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
171
|
+
ref: "ProjectEnvironment",
|
|
172
|
+
required: false,
|
|
173
|
+
index: true,
|
|
174
|
+
},
|
|
175
|
+
user_id: {
|
|
176
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
177
|
+
ref: "User",
|
|
178
|
+
required: false,
|
|
179
|
+
index: true,
|
|
180
|
+
},
|
|
181
|
+
team: {
|
|
182
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
183
|
+
ref: "Team",
|
|
184
|
+
required: false,
|
|
185
|
+
index: true,
|
|
186
|
+
},
|
|
78
187
|
provider: { type: String, default: "tigris" },
|
|
79
188
|
provider_org_id: { type: String, required: true },
|
|
80
189
|
access_key_id: { type: String, required: true, unique: true },
|
|
81
190
|
policy_names: [{ type: String }],
|
|
82
|
-
role: {
|
|
83
|
-
|
|
191
|
+
role: {
|
|
192
|
+
type: String,
|
|
193
|
+
enum: Object.values(enum_1.StorageCredentialRole),
|
|
194
|
+
required: true,
|
|
195
|
+
},
|
|
196
|
+
status: {
|
|
197
|
+
type: String,
|
|
198
|
+
enum: Object.values(enum_1.StorageCredentialStatus),
|
|
199
|
+
default: enum_1.StorageCredentialStatus.Active,
|
|
200
|
+
index: true,
|
|
201
|
+
},
|
|
84
202
|
last_rotated_at: { type: Date },
|
|
85
203
|
revoked_at: { type: Date },
|
|
86
204
|
}, { timestamps: true });
|
|
87
205
|
storageCredentialSchema.index({ bucket: 1, status: 1, updatedAt: -1 }, { name: "idx_storage_credential_bucket_status_updated_at" });
|
|
88
206
|
const storageMigrationSchema = new mongoose_1.Schema({
|
|
89
|
-
bucket: {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
207
|
+
bucket: {
|
|
208
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
209
|
+
ref: "StorageBucket",
|
|
210
|
+
required: true,
|
|
211
|
+
index: true,
|
|
212
|
+
},
|
|
213
|
+
project: {
|
|
214
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
215
|
+
ref: "Project",
|
|
216
|
+
required: false,
|
|
217
|
+
index: true,
|
|
218
|
+
},
|
|
219
|
+
project_environment: {
|
|
220
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
221
|
+
ref: "ProjectEnvironment",
|
|
222
|
+
required: false,
|
|
223
|
+
index: true,
|
|
224
|
+
},
|
|
225
|
+
user_id: {
|
|
226
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
227
|
+
ref: "User",
|
|
228
|
+
required: false,
|
|
229
|
+
index: true,
|
|
230
|
+
},
|
|
231
|
+
team: {
|
|
232
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
233
|
+
ref: "Team",
|
|
234
|
+
required: false,
|
|
235
|
+
index: true,
|
|
236
|
+
},
|
|
94
237
|
source_bucket: { type: String, required: true, trim: true },
|
|
95
238
|
source_region: { type: String, required: true, trim: true },
|
|
96
239
|
source_endpoint: { type: String, required: false, trim: true },
|
|
97
240
|
source_prefix: { type: String, required: false, trim: true },
|
|
98
241
|
destination_prefix: { type: String, required: false, trim: true },
|
|
99
242
|
vault_path: { type: String, required: true },
|
|
100
|
-
status: {
|
|
243
|
+
status: {
|
|
244
|
+
type: String,
|
|
245
|
+
enum: Object.values(enum_1.StorageMigrationStatus),
|
|
246
|
+
default: enum_1.StorageMigrationStatus.Queued,
|
|
247
|
+
index: true,
|
|
248
|
+
},
|
|
101
249
|
total_objects: { type: Number, default: 0 },
|
|
102
250
|
copied_objects: { type: Number, default: 0 },
|
|
103
251
|
failed_objects: { type: Number, default: 0 },
|
package/dist/streak-day.js
CHANGED
|
@@ -2,10 +2,18 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const mongoose_1 = require("mongoose");
|
|
4
4
|
const streakDaySchema = new mongoose_1.Schema({
|
|
5
|
-
user_id: {
|
|
5
|
+
user_id: {
|
|
6
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
7
|
+
ref: "User",
|
|
8
|
+
required: true,
|
|
9
|
+
index: true,
|
|
10
|
+
},
|
|
6
11
|
day: { type: Date, required: true },
|
|
7
12
|
action_types: { type: [String], default: [] },
|
|
8
13
|
is_milestone_day: { type: Boolean, default: false },
|
|
9
|
-
}, {
|
|
14
|
+
}, {
|
|
15
|
+
timestamps: { createdAt: "created_at", updatedAt: "updated_at" },
|
|
16
|
+
collection: "streak_days",
|
|
17
|
+
});
|
|
10
18
|
streakDaySchema.index({ user_id: 1, day: 1 }, { unique: true });
|
|
11
19
|
exports.default = (0, mongoose_1.model)("StreakDay", streakDaySchema);
|