@brimble/models 3.8.77 → 3.8.79
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/dist/activity-log.d.ts +6 -27
- package/dist/alert-event.d.ts +9 -0
- package/dist/alert-event.js +78 -0
- package/dist/alert-rule-state.d.ts +9 -0
- package/dist/alert-rule-state.js +49 -0
- package/dist/alert-rule.d.ts +9 -0
- package/dist/alert-rule.js +77 -0
- package/dist/app-message.d.ts +6 -27
- package/dist/app-message.js +2 -2
- package/dist/auto-scaling.d.ts +6 -27
- package/dist/card.d.ts +6 -27
- package/dist/cashier_subscription.d.ts +6 -27
- package/dist/cashier_subscription_item.d.ts +6 -27
- package/dist/collab-annotation.d.ts +6 -27
- package/dist/collab-comment.d.ts +6 -27
- package/dist/collab-integration.d.ts +6 -27
- package/dist/collab-push-subscription.d.ts +6 -27
- package/dist/collab-settings.d.ts +6 -27
- package/dist/collab-share-token.d.ts +6 -27
- package/dist/compute.d.ts +6 -27
- package/dist/compute.js +6 -0
- package/dist/db-image.d.ts +6 -27
- package/dist/db-image.js +19 -0
- package/dist/domain/dns-changelog.d.ts +9 -0
- package/dist/domain/dns-changelog.js +82 -0
- package/dist/domain/dns.d.ts +6 -27
- package/dist/domain/index.d.ts +6 -27
- package/dist/domain/index.js +4 -0
- package/dist/domain/renewal.d.ts +6 -27
- package/dist/domain/transfer.d.ts +6 -27
- package/dist/enum/index.d.ts +184 -0
- package/dist/enum/index.js +273 -37
- package/dist/env.d.ts +6 -27
- package/dist/environment-variable.d.ts +6 -27
- package/dist/environment-variable.js +8 -0
- package/dist/follower.d.ts +6 -27
- package/dist/following.d.ts +6 -27
- package/dist/framework.d.ts +6 -27
- package/dist/idempotency.d.ts +9 -0
- package/dist/idempotency.js +17 -0
- package/dist/index.d.ts +25 -2
- package/dist/index.js +92 -3
- package/dist/integration.d.ts +6 -27
- package/dist/intention.d.ts +6 -27
- package/dist/invoice.d.ts +6 -27
- package/dist/job.d.ts +6 -2
- package/dist/job.js +17 -7
- package/dist/license.d.ts +6 -27
- package/dist/load-balancer-port.d.ts +6 -27
- package/dist/logs.d.ts +6 -27
- package/dist/logs.js +0 -2
- package/dist/member-permission.d.ts +6 -27
- package/dist/member.d.ts +6 -27
- package/dist/object-storage-usage-segment.d.ts +9 -0
- package/dist/object-storage-usage-segment.js +46 -0
- package/dist/ownership-transfer.d.ts +6 -27
- package/dist/permission.d.ts +6 -27
- package/dist/plan_configuration.d.ts +6 -2
- package/dist/plan_configuration.js +22 -0
- package/dist/project/connection.d.ts +6 -27
- package/dist/project/index.d.ts +12 -29
- package/dist/project/index.js +29 -0
- package/dist/project/preview.d.ts +6 -27
- package/dist/project-environment.d.ts +6 -27
- package/dist/project-network-settings.d.ts +9 -0
- package/dist/project-network-settings.js +34 -0
- package/dist/project-tag-assignment.d.ts +6 -27
- package/dist/project_analytics.d.ts +6 -27
- package/dist/provider.d.ts +6 -27
- package/dist/provider.js +1 -0
- package/dist/quest-campaign.d.ts +9 -0
- package/dist/quest-campaign.js +39 -0
- package/dist/quest-participation.d.ts +9 -0
- package/dist/quest-participation.js +21 -0
- package/dist/quest-reward-issuance.d.ts +9 -0
- package/dist/quest-reward-issuance.js +19 -0
- package/dist/ratelimit.d.ts +9 -0
- package/dist/ratelimit.js +36 -0
- package/dist/region.d.ts +7 -28
- package/dist/role.d.ts +6 -27
- package/dist/sandbox-activity.d.ts +9 -0
- package/dist/sandbox-activity.js +49 -0
- package/dist/sandbox-image.d.ts +9 -0
- package/dist/sandbox-image.js +31 -0
- package/dist/sandbox-snapshot-usage-segment.d.ts +9 -0
- package/dist/sandbox-snapshot-usage-segment.js +49 -0
- package/dist/sandbox-snapshot.d.ts +9 -0
- package/dist/sandbox-snapshot.js +51 -0
- package/dist/sandbox-usage-segment.d.ts +9 -0
- package/dist/sandbox-usage-segment.js +57 -0
- package/dist/sandbox.d.ts +9 -0
- package/dist/sandbox.js +142 -0
- package/dist/server.d.ts +6 -27
- package/dist/settings.d.ts +6 -27
- package/dist/storage.d.ts +43 -0
- package/dist/storage.js +118 -0
- package/dist/streak-day.d.ts +9 -0
- package/dist/streak-day.js +11 -0
- package/dist/streak-event.d.ts +9 -0
- package/dist/streak-event.js +18 -0
- package/dist/streak-milestone.d.ts +9 -0
- package/dist/streak-milestone.js +11 -0
- package/dist/streak.d.ts +9 -0
- package/dist/streak.js +17 -0
- package/dist/subscription.d.ts +6 -27
- package/dist/tag.d.ts +6 -27
- package/dist/team.d.ts +6 -27
- package/dist/team.js +26 -0
- package/dist/token.d.ts +6 -27
- package/dist/types/alert-event.d.ts +23 -0
- package/dist/types/alert-event.js +2 -0
- package/dist/types/alert-rule-state.d.ts +13 -0
- package/dist/types/alert-rule-state.js +2 -0
- package/dist/types/alert-rule.d.ts +21 -0
- package/dist/types/alert-rule.js +2 -0
- package/dist/types/app-message.d.ts +2 -2
- package/dist/types/auto-scaling-group.d.ts +1 -1
- package/dist/types/compute.d.ts +3 -1
- package/dist/types/db-image.d.ts +5 -1
- package/dist/types/domain/dns-changelog.d.ts +20 -0
- package/dist/types/domain/dns-changelog.js +2 -0
- package/dist/types/domain/index.d.ts +1 -0
- package/dist/types/environment-variable.d.ts +2 -0
- package/dist/types/idempotency.d.ts +10 -0
- package/dist/types/idempotency.js +2 -0
- package/dist/types/index.d.ts +23 -0
- package/dist/types/object-storage-usage-segment.d.ts +23 -0
- package/dist/types/object-storage-usage-segment.js +2 -0
- package/dist/types/plan_configuration.d.ts +22 -0
- package/dist/types/project/index.d.ts +7 -0
- package/dist/types/project-network-settings.d.ts +28 -0
- package/dist/types/project-network-settings.js +2 -0
- package/dist/types/provider.d.ts +1 -0
- package/dist/types/quest-campaign.d.ts +38 -0
- package/dist/types/quest-campaign.js +2 -0
- package/dist/types/quest-participation.d.ts +19 -0
- package/dist/types/quest-participation.js +2 -0
- package/dist/types/quest-reward-issuance.d.ts +17 -0
- package/dist/types/quest-reward-issuance.js +2 -0
- package/dist/types/ratelimit.d.ts +41 -0
- package/dist/types/ratelimit.js +2 -0
- package/dist/types/region.d.ts +2 -2
- package/dist/types/sandbox-activity.d.ts +14 -0
- package/dist/types/sandbox-activity.js +2 -0
- package/dist/types/sandbox-image.d.ts +9 -0
- package/dist/types/sandbox-image.js +2 -0
- package/dist/types/sandbox-snapshot-usage-segment.d.ts +16 -0
- package/dist/types/sandbox-snapshot-usage-segment.js +2 -0
- package/dist/types/sandbox-snapshot.d.ts +16 -0
- package/dist/types/sandbox-snapshot.js +2 -0
- package/dist/types/sandbox-usage-segment.d.ts +25 -0
- package/dist/types/sandbox-usage-segment.js +2 -0
- package/dist/types/sandbox.d.ts +46 -0
- package/dist/types/sandbox.js +2 -0
- package/dist/types/storage.d.ts +131 -0
- package/dist/types/storage.js +2 -0
- package/dist/types/streak-day.d.ts +9 -0
- package/dist/types/streak-day.js +2 -0
- package/dist/types/streak-event.d.ts +13 -0
- package/dist/types/streak-event.js +2 -0
- package/dist/types/streak-milestone.d.ts +10 -0
- package/dist/types/streak-milestone.js +2 -0
- package/dist/types/streak.d.ts +17 -0
- package/dist/types/streak.js +2 -0
- package/dist/types/team.d.ts +8 -2
- package/dist/types/user.d.ts +4 -0
- package/dist/types/volume-usage-segment.d.ts +16 -0
- package/dist/types/volume-usage-segment.js +2 -0
- package/dist/types/volume.d.ts +9 -3
- package/dist/types/wallet.d.ts +1 -0
- package/dist/user.d.ts +6 -27
- package/dist/user.js +14 -0
- package/dist/volume-usage-segment.d.ts +9 -0
- package/dist/volume-usage-segment.js +46 -0
- package/dist/volume.d.ts +6 -27
- package/dist/volume.js +21 -4
- package/dist/wallet.d.ts +6 -27
- package/dist/wallet.js +4 -0
- package/dist/webhook-category.d.ts +6 -27
- package/dist/webhook-event.d.ts +6 -27
- package/dist/webhook-setting.d.ts +6 -27
- package/package.json +9 -5
- package/.claude/settings.local.json +0 -7
- package/.eslintrc.js +0 -26
- package/.prettierrc +0 -4
- package/activity-log.ts +0 -66
- package/app-message.ts +0 -18
- package/auto-scaling.ts +0 -72
- package/card.ts +0 -45
- package/cashier_subscription.ts +0 -35
- package/cashier_subscription_item.ts +0 -25
- package/collab-annotation.ts +0 -36
- package/collab-comment.ts +0 -27
- package/collab-integration.ts +0 -21
- package/collab-push-subscription.ts +0 -19
- package/collab-settings.ts +0 -29
- package/collab-share-token.ts +0 -15
- package/compute.ts +0 -88
- package/db-image.ts +0 -66
- package/domain/dns.ts +0 -34
- package/domain/index.ts +0 -109
- package/domain/renewal.ts +0 -25
- package/domain/transfer.ts +0 -112
- package/enum/index.ts +0 -257
- package/env.ts +0 -38
- package/environment-variable.ts +0 -21
- package/follower.ts +0 -19
- package/following.ts +0 -19
- package/framework.ts +0 -88
- package/index.ts +0 -199
- package/integration.ts +0 -39
- package/intention.ts +0 -40
- package/invoice.ts +0 -36
- package/job.ts +0 -30
- package/load-balancer-port.ts +0 -31
- package/logs.ts +0 -47
- package/member-permission.ts +0 -13
- package/member.ts +0 -44
- package/ownership-transfer.ts +0 -42
- package/permission.ts +0 -13
- package/plan_configuration.ts +0 -48
- package/project/connection.ts +0 -21
- package/project/index.ts +0 -238
- package/project/preview.ts +0 -41
- package/project-environment.ts +0 -18
- package/project-tag-assignment.ts +0 -40
- package/project_analytics.ts +0 -26
- package/provider.ts +0 -11
- package/region.ts +0 -18
- package/role.ts +0 -12
- package/server.ts +0 -105
- package/settings.ts +0 -53
- package/subscription.ts +0 -86
- package/tag.ts +0 -34
- package/team.ts +0 -60
- package/token.ts +0 -40
- package/tsconfig.json +0 -14
- package/types/activity-log.ts +0 -19
- package/types/app-message.ts +0 -16
- package/types/auto-scaling-group.ts +0 -21
- package/types/card.ts +0 -20
- package/types/cashier_subscription.ts +0 -29
- package/types/collab-annotation.ts +0 -28
- package/types/collab-comment.ts +0 -22
- package/types/collab-integration.ts +0 -14
- package/types/collab-push-subscription.ts +0 -10
- package/types/collab-settings.ts +0 -17
- package/types/collab-share-token.ts +0 -13
- package/types/compute.ts +0 -51
- package/types/db-image.ts +0 -18
- package/types/domain/dns.ts +0 -13
- package/types/domain/index.ts +0 -35
- package/types/domain/renewal.ts +0 -11
- package/types/domain/transfer.ts +0 -32
- package/types/env.ts +0 -14
- package/types/environment-variable.ts +0 -13
- package/types/following.ts +0 -6
- package/types/framework.ts +0 -41
- package/types/git.ts +0 -15
- package/types/index.ts +0 -56
- package/types/installed_integration.ts +0 -9
- package/types/integration.ts +0 -24
- package/types/intention.ts +0 -14
- package/types/invoice.ts +0 -16
- package/types/job.ts +0 -20
- package/types/license.ts +0 -19
- package/types/load-balancer-port.ts +0 -13
- package/types/logs.ts +0 -36
- package/types/member-permission.ts +0 -11
- package/types/member.ts +0 -19
- package/types/ownership-transfer.ts +0 -13
- package/types/permission.ts +0 -19
- package/types/plan_configuration.ts +0 -35
- package/types/project/connection.ts +0 -7
- package/types/project/index.ts +0 -96
- package/types/project/preview.ts +0 -22
- package/types/project-environment.ts +0 -14
- package/types/project-tag-assignment.ts +0 -14
- package/types/project_analytics.ts +0 -12
- package/types/provider.ts +0 -8
- package/types/region.ts +0 -16
- package/types/role.ts +0 -13
- package/types/server.ts +0 -59
- package/types/settings.ts +0 -19
- package/types/subscription.ts +0 -34
- package/types/tag.ts +0 -12
- package/types/team.ts +0 -19
- package/types/token.ts +0 -12
- package/types/user.ts +0 -41
- package/types/volume.ts +0 -15
- package/types/wallet.ts +0 -8
- package/types/webhook-category.ts +0 -5
- package/types/webhook-event.ts +0 -8
- package/types/webhook-setting.ts +0 -17
- package/user.ts +0 -61
- package/volume.ts +0 -36
- package/wallet.ts +0 -23
- package/webhook-category.ts +0 -11
- package/webhook-event.ts +0 -20
- package/webhook-setting.ts +0 -48
|
@@ -1,30 +1,9 @@
|
|
|
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
1
|
import { IProjectAnalytics } from "./types/project_analytics";
|
|
27
|
-
declare const _default: import("mongoose").Model<IProjectAnalytics, {}, {}, {}, import("mongoose").Document<unknown, {}, IProjectAnalytics> & IProjectAnalytics & {
|
|
2
|
+
declare const _default: import("mongoose").Model<IProjectAnalytics, {}, {}, {}, import("mongoose").Document<unknown, {}, IProjectAnalytics, {}, import("mongoose").DefaultSchemaOptions> & IProjectAnalytics & Required<{
|
|
28
3
|
_id: import("mongoose").Types.ObjectId;
|
|
29
|
-
}
|
|
4
|
+
}> & {
|
|
5
|
+
__v: number;
|
|
6
|
+
} & {
|
|
7
|
+
id: string;
|
|
8
|
+
}, any, IProjectAnalytics>;
|
|
30
9
|
export default _default;
|
package/dist/provider.d.ts
CHANGED
|
@@ -1,30 +1,9 @@
|
|
|
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
1
|
import { IProvider } from "./types/provider";
|
|
27
|
-
declare const _default: import("mongoose").Model<IProvider, {}, {}, {}, import("mongoose").Document<unknown, {}, IProvider> & IProvider & {
|
|
2
|
+
declare const _default: import("mongoose").Model<IProvider, {}, {}, {}, import("mongoose").Document<unknown, {}, IProvider, {}, import("mongoose").DefaultSchemaOptions> & IProvider & Required<{
|
|
28
3
|
_id: import("mongoose").Types.ObjectId;
|
|
29
|
-
}
|
|
4
|
+
}> & {
|
|
5
|
+
__v: number;
|
|
6
|
+
} & {
|
|
7
|
+
id: string;
|
|
8
|
+
}, any, IProvider>;
|
|
30
9
|
export default _default;
|
package/dist/provider.js
CHANGED
|
@@ -6,5 +6,6 @@ const providerSchema = new mongoose_1.Schema({
|
|
|
6
6
|
slug: { type: String, required: true, unique: true },
|
|
7
7
|
logo: { type: String, required: true },
|
|
8
8
|
enabled: { type: Boolean, default: true },
|
|
9
|
+
suffix: { type: String, required: false },
|
|
9
10
|
});
|
|
10
11
|
exports.default = (0, mongoose_1.model)("Provider", providerSchema, "providers");
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IQuestCampaign } from "./types";
|
|
2
|
+
declare const _default: import("mongoose").Model<IQuestCampaign, {}, {}, {}, import("mongoose").Document<unknown, {}, IQuestCampaign, {}, import("mongoose").DefaultSchemaOptions> & IQuestCampaign & Required<{
|
|
3
|
+
_id: import("mongoose").Types.ObjectId;
|
|
4
|
+
}> & {
|
|
5
|
+
__v: number;
|
|
6
|
+
} & {
|
|
7
|
+
id: string;
|
|
8
|
+
}, any, IQuestCampaign>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mongoose_1 = require("mongoose");
|
|
4
|
+
const questCriterionSchema = new mongoose_1.Schema({
|
|
5
|
+
type: { type: String, required: true },
|
|
6
|
+
label: { type: String, required: true },
|
|
7
|
+
target: { type: Number, required: true },
|
|
8
|
+
entity: { type: String, default: null },
|
|
9
|
+
action: { type: String, default: null },
|
|
10
|
+
service_type: { type: String, default: null },
|
|
11
|
+
distinct: { type: Boolean, default: false },
|
|
12
|
+
milestones: { type: [String], default: [] },
|
|
13
|
+
}, { _id: false });
|
|
14
|
+
const questRequirementSchema = new mongoose_1.Schema({
|
|
15
|
+
type: { type: String, required: true },
|
|
16
|
+
target: { type: Number, default: 0 },
|
|
17
|
+
message: { type: String, default: null },
|
|
18
|
+
}, { _id: false });
|
|
19
|
+
const questRewardSchema = new mongoose_1.Schema({
|
|
20
|
+
type: { type: String, required: true },
|
|
21
|
+
metadata: { type: mongoose_1.Schema.Types.Mixed, default: {} },
|
|
22
|
+
}, { _id: false });
|
|
23
|
+
const questCampaignSchema = new mongoose_1.Schema({
|
|
24
|
+
name: { type: String, required: true },
|
|
25
|
+
slug: { type: String, required: true, unique: true },
|
|
26
|
+
start_at: { type: Date, required: true },
|
|
27
|
+
end_at: { type: Date, required: true },
|
|
28
|
+
eligibility_type: { type: String, required: true },
|
|
29
|
+
min_streak_to_join: { type: Number, default: 0 },
|
|
30
|
+
slots_total: { type: Number, required: true },
|
|
31
|
+
slots_remaining: { type: Number, required: true },
|
|
32
|
+
criteria: { type: [questCriterionSchema], default: [] },
|
|
33
|
+
requirements: { type: [questRequirementSchema], default: [] },
|
|
34
|
+
rewards: { type: [questRewardSchema], default: [] },
|
|
35
|
+
active: { type: Boolean, default: true, index: true },
|
|
36
|
+
auto_expire: { type: Boolean, default: true },
|
|
37
|
+
}, { timestamps: { createdAt: "created_at", updatedAt: "updated_at" }, collection: "quest_campaigns" });
|
|
38
|
+
questCampaignSchema.index({ active: 1, start_at: 1, end_at: 1 });
|
|
39
|
+
exports.default = (0, mongoose_1.model)("QuestCampaign", questCampaignSchema);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IQuestParticipation } from "./types";
|
|
2
|
+
declare const _default: import("mongoose").Model<IQuestParticipation, {}, {}, {}, import("mongoose").Document<unknown, {}, IQuestParticipation, {}, import("mongoose").DefaultSchemaOptions> & IQuestParticipation & Required<{
|
|
3
|
+
_id: import("mongoose").Types.ObjectId;
|
|
4
|
+
}> & {
|
|
5
|
+
__v: number;
|
|
6
|
+
} & {
|
|
7
|
+
id: string;
|
|
8
|
+
}, any, IQuestParticipation>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mongoose_1 = require("mongoose");
|
|
4
|
+
const questCriterionProgressSchema = new mongoose_1.Schema({
|
|
5
|
+
key: { type: String, required: true },
|
|
6
|
+
current: { type: Number, default: 0 },
|
|
7
|
+
target: { type: Number, required: true },
|
|
8
|
+
met: { type: Boolean, default: false },
|
|
9
|
+
}, { _id: false });
|
|
10
|
+
const questParticipationSchema = new mongoose_1.Schema({
|
|
11
|
+
campaign_id: { type: mongoose_1.Schema.Types.ObjectId, ref: "QuestCampaign", required: true, index: true },
|
|
12
|
+
user_id: { type: mongoose_1.Schema.Types.ObjectId, ref: "User", required: true, index: true },
|
|
13
|
+
joined_at: { type: Date, required: true },
|
|
14
|
+
slot_number: { type: Number, required: true },
|
|
15
|
+
streak_deducted: { type: Number, default: 0 },
|
|
16
|
+
criteria_progress: { type: [questCriterionProgressSchema], default: [] },
|
|
17
|
+
qualifier_met: { type: Boolean, default: false },
|
|
18
|
+
claimed_at: { type: Date, default: null },
|
|
19
|
+
}, { timestamps: { createdAt: "created_at", updatedAt: "updated_at" }, collection: "quest_participations" });
|
|
20
|
+
questParticipationSchema.index({ campaign_id: 1, user_id: 1 }, { unique: true });
|
|
21
|
+
exports.default = (0, mongoose_1.model)("QuestParticipation", questParticipationSchema);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IQuestRewardIssuance } from "./types";
|
|
2
|
+
declare const _default: import("mongoose").Model<IQuestRewardIssuance, {}, {}, {}, import("mongoose").Document<unknown, {}, IQuestRewardIssuance, {}, import("mongoose").DefaultSchemaOptions> & IQuestRewardIssuance & Required<{
|
|
3
|
+
_id: import("mongoose").Types.ObjectId;
|
|
4
|
+
}> & {
|
|
5
|
+
__v: number;
|
|
6
|
+
} & {
|
|
7
|
+
id: string;
|
|
8
|
+
}, any, IQuestRewardIssuance>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mongoose_1 = require("mongoose");
|
|
4
|
+
const enum_1 = require("./enum");
|
|
5
|
+
const questIssuedRewardSchema = new mongoose_1.Schema({
|
|
6
|
+
type: { type: String, required: true },
|
|
7
|
+
metadata: { type: mongoose_1.Schema.Types.Mixed, default: {} },
|
|
8
|
+
}, { _id: false });
|
|
9
|
+
const questRewardIssuanceSchema = new mongoose_1.Schema({
|
|
10
|
+
participation_id: { type: mongoose_1.Schema.Types.ObjectId, ref: "QuestParticipation", required: true, index: true },
|
|
11
|
+
campaign_id: { type: mongoose_1.Schema.Types.ObjectId, ref: "QuestCampaign", required: true, index: true },
|
|
12
|
+
user_id: { type: mongoose_1.Schema.Types.ObjectId, ref: "User", required: true, index: true },
|
|
13
|
+
rewards: { type: [questIssuedRewardSchema], default: [] },
|
|
14
|
+
status: { type: String, required: true, default: enum_1.QuestRewardStatus.Claimed },
|
|
15
|
+
claimed_at: { type: Date, required: true },
|
|
16
|
+
fulfilled_at: { type: Date, default: null },
|
|
17
|
+
}, { timestamps: { createdAt: "created_at", updatedAt: "updated_at" }, collection: "quest_reward_issuances" });
|
|
18
|
+
questRewardIssuanceSchema.index({ campaign_id: 1, user_id: 1 }, { unique: true });
|
|
19
|
+
exports.default = (0, mongoose_1.model)("QuestRewardIssuance", questRewardIssuanceSchema);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IRatelimit } from "./types";
|
|
2
|
+
declare const _default: import("mongoose").Model<IRatelimit, {}, {}, {}, import("mongoose").Document<unknown, {}, IRatelimit, {}, import("mongoose").DefaultSchemaOptions> & IRatelimit & Required<{
|
|
3
|
+
_id: import("mongoose").Types.ObjectId;
|
|
4
|
+
}> & {
|
|
5
|
+
__v: number;
|
|
6
|
+
} & {
|
|
7
|
+
id: string;
|
|
8
|
+
}, any, IRatelimit>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mongoose_1 = require("mongoose");
|
|
4
|
+
const ratelimitSchema = new mongoose_1.Schema({
|
|
5
|
+
project: { type: mongoose_1.Schema.Types.ObjectId, ref: "Project", required: true },
|
|
6
|
+
enabled: { type: Boolean, default: true },
|
|
7
|
+
zones: {
|
|
8
|
+
type: [
|
|
9
|
+
{
|
|
10
|
+
name: { type: String, required: true },
|
|
11
|
+
key: { type: String, required: true },
|
|
12
|
+
window: { type: String, required: true },
|
|
13
|
+
events: { type: Number, required: true },
|
|
14
|
+
matcher: {
|
|
15
|
+
methods: [{ type: String }],
|
|
16
|
+
paths: [{ type: String }],
|
|
17
|
+
},
|
|
18
|
+
ipv4Prefix: Number,
|
|
19
|
+
ipv6Prefix: Number,
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
default: [],
|
|
23
|
+
},
|
|
24
|
+
distributed: {
|
|
25
|
+
enabled: { type: Boolean, default: false },
|
|
26
|
+
readInterval: String,
|
|
27
|
+
writeInterval: String,
|
|
28
|
+
purgeAge: String,
|
|
29
|
+
},
|
|
30
|
+
logKey: { type: Boolean, default: false },
|
|
31
|
+
disableMetrics: { type: Boolean, default: false },
|
|
32
|
+
jitter: Number,
|
|
33
|
+
sweepInterval: String,
|
|
34
|
+
}, { timestamps: true });
|
|
35
|
+
ratelimitSchema.index({ project: 1 }, { unique: true });
|
|
36
|
+
exports.default = (0, mongoose_1.model)("Ratelimit", ratelimitSchema, "ratelimits");
|
package/dist/region.d.ts
CHANGED
|
@@ -1,30 +1,9 @@
|
|
|
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/types/inferschematype" />
|
|
25
|
-
import { Schema } from "mongoose";
|
|
26
1
|
import { IRegion } from "./types/region";
|
|
27
|
-
declare const _default: import("mongoose").Model<IRegion, {}, {}, {}, import("mongoose").Document<unknown, {}, IRegion> & IRegion & Required<{
|
|
28
|
-
_id:
|
|
29
|
-
}
|
|
2
|
+
declare const _default: import("mongoose").Model<IRegion, {}, {}, {}, import("mongoose").Document<unknown, {}, IRegion, {}, import("mongoose").DefaultSchemaOptions> & IRegion & Required<{
|
|
3
|
+
_id: import("mongoose").Types.ObjectId;
|
|
4
|
+
}> & {
|
|
5
|
+
__v: number;
|
|
6
|
+
} & {
|
|
7
|
+
id: string;
|
|
8
|
+
}, any, IRegion>;
|
|
30
9
|
export default _default;
|
package/dist/role.d.ts
CHANGED
|
@@ -1,30 +1,9 @@
|
|
|
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
1
|
import { IRole } from "./types/role";
|
|
27
|
-
declare const _default: import("mongoose").Model<IRole, {}, {}, {}, import("mongoose").Document<unknown, {}, IRole> & IRole & {
|
|
2
|
+
declare const _default: import("mongoose").Model<IRole, {}, {}, {}, import("mongoose").Document<unknown, {}, IRole, {}, import("mongoose").DefaultSchemaOptions> & IRole & Required<{
|
|
28
3
|
_id: import("mongoose").Types.ObjectId;
|
|
29
|
-
}
|
|
4
|
+
}> & {
|
|
5
|
+
__v: number;
|
|
6
|
+
} & {
|
|
7
|
+
id: string;
|
|
8
|
+
}, any, IRole>;
|
|
30
9
|
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ISandboxActivity } from "./types/sandbox-activity";
|
|
2
|
+
declare const _default: import("mongoose").Model<ISandboxActivity, {}, {}, {}, import("mongoose").Document<unknown, {}, ISandboxActivity, {}, import("mongoose").DefaultSchemaOptions> & ISandboxActivity & Required<{
|
|
3
|
+
_id: import("mongoose").Types.ObjectId;
|
|
4
|
+
}> & {
|
|
5
|
+
__v: number;
|
|
6
|
+
} & {
|
|
7
|
+
id: string;
|
|
8
|
+
}, any, ISandboxActivity>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mongoose_1 = require("mongoose");
|
|
4
|
+
const sandboxActivitySchema = new mongoose_1.Schema({
|
|
5
|
+
sandbox_id: {
|
|
6
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
7
|
+
ref: "Sandbox",
|
|
8
|
+
required: true,
|
|
9
|
+
index: true,
|
|
10
|
+
},
|
|
11
|
+
user_id: {
|
|
12
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
13
|
+
ref: "User",
|
|
14
|
+
required: true,
|
|
15
|
+
index: true,
|
|
16
|
+
},
|
|
17
|
+
team: {
|
|
18
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
19
|
+
ref: "Team",
|
|
20
|
+
default: null,
|
|
21
|
+
index: true,
|
|
22
|
+
},
|
|
23
|
+
command: {
|
|
24
|
+
type: String,
|
|
25
|
+
required: true,
|
|
26
|
+
},
|
|
27
|
+
started_at: {
|
|
28
|
+
type: Date,
|
|
29
|
+
required: true,
|
|
30
|
+
index: true,
|
|
31
|
+
},
|
|
32
|
+
ended_at: {
|
|
33
|
+
type: Date,
|
|
34
|
+
default: null,
|
|
35
|
+
},
|
|
36
|
+
exit_code: {
|
|
37
|
+
type: Number,
|
|
38
|
+
default: null,
|
|
39
|
+
},
|
|
40
|
+
duration_ms: {
|
|
41
|
+
type: Number,
|
|
42
|
+
default: null,
|
|
43
|
+
},
|
|
44
|
+
error: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: null,
|
|
47
|
+
},
|
|
48
|
+
}, { timestamps: { createdAt: "created_at", updatedAt: "updated_at" } });
|
|
49
|
+
exports.default = (0, mongoose_1.model)("SandboxActivity", sandboxActivitySchema);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ISandboxImage } from "./types/sandbox-image";
|
|
2
|
+
declare const _default: import("mongoose").Model<ISandboxImage, {}, {}, {}, import("mongoose").Document<unknown, {}, ISandboxImage, {}, import("mongoose").DefaultSchemaOptions> & ISandboxImage & Required<{
|
|
3
|
+
_id: import("mongoose").Types.ObjectId;
|
|
4
|
+
}> & {
|
|
5
|
+
__v: number;
|
|
6
|
+
} & {
|
|
7
|
+
id: string;
|
|
8
|
+
}, any, ISandboxImage>;
|
|
9
|
+
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);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ISandboxSnapshotUsageSegment } from "./types/sandbox-snapshot-usage-segment";
|
|
2
|
+
declare const _default: import("mongoose").Model<ISandboxSnapshotUsageSegment, {}, {}, {}, import("mongoose").Document<unknown, {}, ISandboxSnapshotUsageSegment, {}, import("mongoose").DefaultSchemaOptions> & ISandboxSnapshotUsageSegment & Required<{
|
|
3
|
+
_id: import("mongoose").Types.ObjectId;
|
|
4
|
+
}> & {
|
|
5
|
+
__v: number;
|
|
6
|
+
} & {
|
|
7
|
+
id: string;
|
|
8
|
+
}, any, ISandboxSnapshotUsageSegment>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mongoose_1 = require("mongoose");
|
|
4
|
+
const sandboxSnapshotUsageSegmentSchema = new mongoose_1.Schema({
|
|
5
|
+
snapshot_id: {
|
|
6
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
7
|
+
ref: "SandboxSnapshot",
|
|
8
|
+
required: true,
|
|
9
|
+
index: true,
|
|
10
|
+
},
|
|
11
|
+
user_id: {
|
|
12
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
13
|
+
ref: "User",
|
|
14
|
+
required: true,
|
|
15
|
+
index: true,
|
|
16
|
+
},
|
|
17
|
+
team_id: {
|
|
18
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
19
|
+
ref: "Team",
|
|
20
|
+
required: false,
|
|
21
|
+
default: null,
|
|
22
|
+
index: true,
|
|
23
|
+
},
|
|
24
|
+
size_gb: {
|
|
25
|
+
type: Number,
|
|
26
|
+
required: true,
|
|
27
|
+
default: 0,
|
|
28
|
+
},
|
|
29
|
+
costs: {
|
|
30
|
+
startDate: { type: Date, required: true },
|
|
31
|
+
endDate: { type: Date, default: null },
|
|
32
|
+
},
|
|
33
|
+
billed: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: false,
|
|
36
|
+
index: true,
|
|
37
|
+
},
|
|
38
|
+
}, {
|
|
39
|
+
timestamps: true,
|
|
40
|
+
});
|
|
41
|
+
sandboxSnapshotUsageSegmentSchema.index({ user_id: 1, billed: 1, "costs.endDate": 1 });
|
|
42
|
+
sandboxSnapshotUsageSegmentSchema.index({ team_id: 1, billed: 1, "costs.endDate": 1 });
|
|
43
|
+
sandboxSnapshotUsageSegmentSchema.index({ snapshot_id: 1, "costs.endDate": 1 });
|
|
44
|
+
sandboxSnapshotUsageSegmentSchema.index({ snapshot_id: 1 }, {
|
|
45
|
+
unique: true,
|
|
46
|
+
partialFilterExpression: { "costs.endDate": null },
|
|
47
|
+
name: "unique_open_segment_per_snapshot",
|
|
48
|
+
});
|
|
49
|
+
exports.default = (0, mongoose_1.model)("SandboxSnapshotUsageSegment", sandboxSnapshotUsageSegmentSchema, "sandbox_snapshot_usage_segments");
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ISandboxSnapshot } from "./types/sandbox-snapshot";
|
|
2
|
+
declare const _default: import("mongoose").Model<ISandboxSnapshot, {}, {}, {}, import("mongoose").Document<unknown, {}, ISandboxSnapshot, {}, import("mongoose").DefaultSchemaOptions> & ISandboxSnapshot & Required<{
|
|
3
|
+
_id: import("mongoose").Types.ObjectId;
|
|
4
|
+
}> & {
|
|
5
|
+
__v: number;
|
|
6
|
+
} & {
|
|
7
|
+
id: string;
|
|
8
|
+
}, any, ISandboxSnapshot>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mongoose_1 = require("mongoose");
|
|
4
|
+
const enum_1 = require("./enum");
|
|
5
|
+
const sandboxSnapshotSchema = new mongoose_1.Schema({
|
|
6
|
+
user_id: {
|
|
7
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
8
|
+
ref: "User",
|
|
9
|
+
required: true,
|
|
10
|
+
index: true,
|
|
11
|
+
},
|
|
12
|
+
team: {
|
|
13
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
14
|
+
ref: "Team",
|
|
15
|
+
default: null,
|
|
16
|
+
index: true,
|
|
17
|
+
},
|
|
18
|
+
sandbox_id: {
|
|
19
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
20
|
+
ref: "Sandbox",
|
|
21
|
+
required: true,
|
|
22
|
+
index: true,
|
|
23
|
+
},
|
|
24
|
+
name: {
|
|
25
|
+
type: String,
|
|
26
|
+
required: true,
|
|
27
|
+
match: /^[a-z0-9-]{1,40}$/,
|
|
28
|
+
},
|
|
29
|
+
image_tag: {
|
|
30
|
+
type: String,
|
|
31
|
+
required: true,
|
|
32
|
+
},
|
|
33
|
+
source_template: {
|
|
34
|
+
type: String,
|
|
35
|
+
required: true,
|
|
36
|
+
},
|
|
37
|
+
status: {
|
|
38
|
+
type: String,
|
|
39
|
+
enum: Object.values(enum_1.SANDBOX_SNAPSHOT_STATUS),
|
|
40
|
+
default: enum_1.SANDBOX_SNAPSHOT_STATUS.CREATING,
|
|
41
|
+
},
|
|
42
|
+
failure_reason: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: null,
|
|
45
|
+
},
|
|
46
|
+
size_bytes: {
|
|
47
|
+
type: Number,
|
|
48
|
+
default: null,
|
|
49
|
+
},
|
|
50
|
+
}, { timestamps: { createdAt: "created_at", updatedAt: "updated_at" } });
|
|
51
|
+
exports.default = (0, mongoose_1.model)("SandboxSnapshot", sandboxSnapshotSchema);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ISandboxUsageSegment } from "./types/sandbox-usage-segment";
|
|
2
|
+
declare const _default: import("mongoose").Model<ISandboxUsageSegment, {}, {}, {}, import("mongoose").Document<unknown, {}, ISandboxUsageSegment, {}, import("mongoose").DefaultSchemaOptions> & ISandboxUsageSegment & Required<{
|
|
3
|
+
_id: import("mongoose").Types.ObjectId;
|
|
4
|
+
}> & {
|
|
5
|
+
__v: number;
|
|
6
|
+
} & {
|
|
7
|
+
id: string;
|
|
8
|
+
}, any, ISandboxUsageSegment>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mongoose_1 = require("mongoose");
|
|
4
|
+
const sandboxUsageSegmentSchema = new mongoose_1.Schema({
|
|
5
|
+
sandbox_id: {
|
|
6
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
7
|
+
ref: "Sandbox",
|
|
8
|
+
required: true,
|
|
9
|
+
index: true,
|
|
10
|
+
},
|
|
11
|
+
user_id: {
|
|
12
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
13
|
+
ref: "User",
|
|
14
|
+
required: true,
|
|
15
|
+
index: true,
|
|
16
|
+
},
|
|
17
|
+
team_id: {
|
|
18
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
19
|
+
ref: "Team",
|
|
20
|
+
required: false,
|
|
21
|
+
index: true,
|
|
22
|
+
default: null,
|
|
23
|
+
},
|
|
24
|
+
current: {
|
|
25
|
+
cpu: { type: Number, required: true },
|
|
26
|
+
memory: { type: Number, required: true },
|
|
27
|
+
storage: { type: Number, required: true },
|
|
28
|
+
},
|
|
29
|
+
costs: {
|
|
30
|
+
startDate: { type: Date, required: true },
|
|
31
|
+
endDate: { type: Date, default: null },
|
|
32
|
+
},
|
|
33
|
+
billed: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: false,
|
|
36
|
+
index: true,
|
|
37
|
+
},
|
|
38
|
+
region: {
|
|
39
|
+
type: String,
|
|
40
|
+
required: false,
|
|
41
|
+
},
|
|
42
|
+
template: {
|
|
43
|
+
type: String,
|
|
44
|
+
required: false,
|
|
45
|
+
},
|
|
46
|
+
}, {
|
|
47
|
+
timestamps: true,
|
|
48
|
+
});
|
|
49
|
+
sandboxUsageSegmentSchema.index({ user_id: 1, billed: 1, "costs.endDate": 1 });
|
|
50
|
+
sandboxUsageSegmentSchema.index({ team_id: 1, billed: 1, "costs.endDate": 1 });
|
|
51
|
+
sandboxUsageSegmentSchema.index({ sandbox_id: 1, "costs.endDate": 1 });
|
|
52
|
+
sandboxUsageSegmentSchema.index({ sandbox_id: 1 }, {
|
|
53
|
+
unique: true,
|
|
54
|
+
partialFilterExpression: { "costs.endDate": null },
|
|
55
|
+
name: "uniq_open_sandbox_usage_segment_per_sandbox",
|
|
56
|
+
});
|
|
57
|
+
exports.default = (0, mongoose_1.model)("SandboxUsageSegment", sandboxUsageSegmentSchema, "sandbox_usage_segments");
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ISandbox } from "./types/sandbox";
|
|
2
|
+
declare const _default: import("mongoose").Model<ISandbox, {}, {}, {}, import("mongoose").Document<unknown, {}, ISandbox, {}, import("mongoose").DefaultSchemaOptions> & ISandbox & Required<{
|
|
3
|
+
_id: import("mongoose").Types.ObjectId;
|
|
4
|
+
}> & {
|
|
5
|
+
__v: number;
|
|
6
|
+
} & {
|
|
7
|
+
id: string;
|
|
8
|
+
}, any, ISandbox>;
|
|
9
|
+
export default _default;
|