@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
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Document, Types } from "mongoose";
|
|
2
|
+
import { ISandbox } from "./sandbox";
|
|
3
|
+
import { IUser } from "./user";
|
|
4
|
+
import { ITeam } from "./team";
|
|
5
|
+
export interface ISandboxUsageSegmentCurrent {
|
|
6
|
+
cpu: number;
|
|
7
|
+
memory: number;
|
|
8
|
+
storage: number;
|
|
9
|
+
}
|
|
10
|
+
export interface ISandboxUsageSegmentCosts {
|
|
11
|
+
startDate: Date;
|
|
12
|
+
endDate: Date | null;
|
|
13
|
+
}
|
|
14
|
+
export interface ISandboxUsageSegment extends Document {
|
|
15
|
+
sandbox_id: ISandbox | Types.ObjectId;
|
|
16
|
+
user_id: IUser | Types.ObjectId;
|
|
17
|
+
team_id: ITeam | Types.ObjectId | null;
|
|
18
|
+
current: ISandboxUsageSegmentCurrent;
|
|
19
|
+
costs: ISandboxUsageSegmentCosts;
|
|
20
|
+
billed: boolean;
|
|
21
|
+
region?: string;
|
|
22
|
+
template?: string;
|
|
23
|
+
createdAt: Date;
|
|
24
|
+
updatedAt: Date;
|
|
25
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Document, Types } from "mongoose";
|
|
2
|
+
import { IUser } from "./user";
|
|
3
|
+
import { ITeam } from "./team";
|
|
4
|
+
import { IProjectEnvironment } from "./project-environment";
|
|
5
|
+
import { SANDBOX_STATUS, SANDBOX_DESTROY_REASON, SANDBOX_EGRESS_MODE } from "../enum";
|
|
6
|
+
import { IRegion } from "./region";
|
|
7
|
+
export interface ISandboxSpecs {
|
|
8
|
+
cpu: number;
|
|
9
|
+
memory: number;
|
|
10
|
+
disk: number;
|
|
11
|
+
}
|
|
12
|
+
export interface ISandboxEgress {
|
|
13
|
+
mode: SANDBOX_EGRESS_MODE;
|
|
14
|
+
allow: string[];
|
|
15
|
+
}
|
|
16
|
+
export interface ISandbox extends Document {
|
|
17
|
+
name: string;
|
|
18
|
+
user_id: IUser | Types.ObjectId;
|
|
19
|
+
team: ITeam | Types.ObjectId | null;
|
|
20
|
+
project_environment: IProjectEnvironment | Types.ObjectId | null;
|
|
21
|
+
template: string;
|
|
22
|
+
status: SANDBOX_STATUS;
|
|
23
|
+
nomad_job_id: string;
|
|
24
|
+
nomad_alloc_id: string | null;
|
|
25
|
+
region: IRegion;
|
|
26
|
+
specs: ISandboxSpecs;
|
|
27
|
+
created_at: Date;
|
|
28
|
+
last_activity_at: Date;
|
|
29
|
+
expires_at: Date;
|
|
30
|
+
destroyed_at: Date | null;
|
|
31
|
+
destroy_reason: SANDBOX_DESTROY_REASON | null;
|
|
32
|
+
auto_destroy: boolean;
|
|
33
|
+
destroy_timeout: string | null;
|
|
34
|
+
one_shot: boolean;
|
|
35
|
+
block_outbound: boolean;
|
|
36
|
+
egress?: ISandboxEgress | null;
|
|
37
|
+
persistent: boolean;
|
|
38
|
+
persistent_disk_gb: number | null;
|
|
39
|
+
csi_volume_id: string | null;
|
|
40
|
+
paused_at: Date | null;
|
|
41
|
+
image_override: string | null;
|
|
42
|
+
from_snapshot: Types.ObjectId | null;
|
|
43
|
+
snapshot_mode: "automatic" | "manual";
|
|
44
|
+
snapshot_frequency: string | null;
|
|
45
|
+
isDeleted: boolean;
|
|
46
|
+
}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { Document, Types } from "mongoose";
|
|
2
|
+
import { IProjectEnvironment } from "./project-environment";
|
|
3
|
+
import { StorageBucketStatus, StorageCredentialRole, StorageCredentialStatus, StorageMigrationStatus, StorageTokenStatus, StorageUploadStatus } from "../enum";
|
|
4
|
+
export type StorageTokenPermission = "read" | "write" | "delete" | "list" | "admin";
|
|
5
|
+
export type StorageCorsRule = {
|
|
6
|
+
allowedHeaders?: string[];
|
|
7
|
+
allowedMethods?: string[];
|
|
8
|
+
allowedOrigins?: string[];
|
|
9
|
+
exposeHeaders?: string[];
|
|
10
|
+
maxAgeSeconds?: number;
|
|
11
|
+
[key: string]: unknown;
|
|
12
|
+
};
|
|
13
|
+
export type StorageLifecycleRule = {
|
|
14
|
+
id?: string;
|
|
15
|
+
prefix?: string;
|
|
16
|
+
expirationDays?: number;
|
|
17
|
+
transitions?: StorageLifecycleRuleTransition[];
|
|
18
|
+
};
|
|
19
|
+
export type StorageLifecycleRuleTransition = {
|
|
20
|
+
days?: number;
|
|
21
|
+
storageClass?: string;
|
|
22
|
+
};
|
|
23
|
+
export interface IStorageBucket extends Document {
|
|
24
|
+
name: string;
|
|
25
|
+
project?: Types.ObjectId;
|
|
26
|
+
project_environment?: IProjectEnvironment | Types.ObjectId;
|
|
27
|
+
user_id?: Types.ObjectId;
|
|
28
|
+
team?: Types.ObjectId;
|
|
29
|
+
bucket_name: string;
|
|
30
|
+
is_public: boolean;
|
|
31
|
+
versioning: boolean;
|
|
32
|
+
provider: string;
|
|
33
|
+
region: string;
|
|
34
|
+
storage_used: number;
|
|
35
|
+
reserved_bytes: number;
|
|
36
|
+
quota: number;
|
|
37
|
+
cors_rules: StorageCorsRule[];
|
|
38
|
+
lifecycle_rules: StorageLifecycleRule[];
|
|
39
|
+
status: StorageBucketStatus;
|
|
40
|
+
createdAt: Date;
|
|
41
|
+
updatedAt: Date;
|
|
42
|
+
}
|
|
43
|
+
export interface IStorageObject extends Document {
|
|
44
|
+
bucket: Types.ObjectId;
|
|
45
|
+
project?: Types.ObjectId;
|
|
46
|
+
project_environment?: IProjectEnvironment | Types.ObjectId;
|
|
47
|
+
key: string;
|
|
48
|
+
path: string;
|
|
49
|
+
content_type?: string;
|
|
50
|
+
size: number;
|
|
51
|
+
etag?: string;
|
|
52
|
+
public_url?: string;
|
|
53
|
+
last_modified?: Date;
|
|
54
|
+
createdAt: Date;
|
|
55
|
+
updatedAt: Date;
|
|
56
|
+
}
|
|
57
|
+
export interface IStorageUpload extends Document {
|
|
58
|
+
bucket: Types.ObjectId;
|
|
59
|
+
project?: Types.ObjectId;
|
|
60
|
+
project_environment?: IProjectEnvironment | Types.ObjectId;
|
|
61
|
+
key: string;
|
|
62
|
+
path: string;
|
|
63
|
+
upload_id?: string;
|
|
64
|
+
content_type?: string;
|
|
65
|
+
size: number;
|
|
66
|
+
status: StorageUploadStatus;
|
|
67
|
+
expires_at: Date;
|
|
68
|
+
completed_at?: Date;
|
|
69
|
+
createdAt: Date;
|
|
70
|
+
updatedAt: Date;
|
|
71
|
+
}
|
|
72
|
+
export interface IStorageToken extends Document {
|
|
73
|
+
name: string;
|
|
74
|
+
token_hash: string;
|
|
75
|
+
prefix: string;
|
|
76
|
+
project?: Types.ObjectId;
|
|
77
|
+
buckets: Types.ObjectId[];
|
|
78
|
+
user_id?: Types.ObjectId;
|
|
79
|
+
team?: Types.ObjectId;
|
|
80
|
+
permissions: StorageTokenPermission[];
|
|
81
|
+
status: StorageTokenStatus;
|
|
82
|
+
last_used_at?: Date;
|
|
83
|
+
expires_at?: Date;
|
|
84
|
+
createdAt: Date;
|
|
85
|
+
updatedAt: Date;
|
|
86
|
+
}
|
|
87
|
+
export interface IStorageCredential extends Document {
|
|
88
|
+
name: string;
|
|
89
|
+
bucket: Types.ObjectId;
|
|
90
|
+
project?: Types.ObjectId;
|
|
91
|
+
project_environment?: IProjectEnvironment | Types.ObjectId;
|
|
92
|
+
user_id?: Types.ObjectId;
|
|
93
|
+
team?: Types.ObjectId;
|
|
94
|
+
provider: string;
|
|
95
|
+
provider_org_id: string;
|
|
96
|
+
access_key_id: string;
|
|
97
|
+
policy_names: string[];
|
|
98
|
+
role: StorageCredentialRole;
|
|
99
|
+
status: StorageCredentialStatus;
|
|
100
|
+
last_rotated_at?: Date;
|
|
101
|
+
revoked_at?: Date;
|
|
102
|
+
createdAt: Date;
|
|
103
|
+
updatedAt: Date;
|
|
104
|
+
}
|
|
105
|
+
export interface IStorageMigration extends Document {
|
|
106
|
+
bucket: Types.ObjectId;
|
|
107
|
+
project?: Types.ObjectId;
|
|
108
|
+
project_environment?: IProjectEnvironment | Types.ObjectId;
|
|
109
|
+
user_id?: Types.ObjectId;
|
|
110
|
+
team?: Types.ObjectId;
|
|
111
|
+
source_bucket: string;
|
|
112
|
+
source_region: string;
|
|
113
|
+
source_endpoint?: string;
|
|
114
|
+
source_prefix?: string;
|
|
115
|
+
destination_prefix?: string;
|
|
116
|
+
vault_path: string;
|
|
117
|
+
status: StorageMigrationStatus;
|
|
118
|
+
total_objects: number;
|
|
119
|
+
copied_objects: number;
|
|
120
|
+
failed_objects: number;
|
|
121
|
+
total_bytes: number;
|
|
122
|
+
copied_bytes: number;
|
|
123
|
+
continuation_token?: string;
|
|
124
|
+
last_source_key?: string;
|
|
125
|
+
error_message?: string;
|
|
126
|
+
started_at?: Date;
|
|
127
|
+
completed_at?: Date;
|
|
128
|
+
cancelled_at?: Date;
|
|
129
|
+
createdAt: Date;
|
|
130
|
+
updatedAt: Date;
|
|
131
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Document, Types } from "mongoose";
|
|
2
|
+
import { QualifyingActionType } from "../enum";
|
|
3
|
+
export interface IStreakEvent extends Document {
|
|
4
|
+
user_id: Types.ObjectId;
|
|
5
|
+
action_type: QualifyingActionType;
|
|
6
|
+
project_id: Types.ObjectId | null;
|
|
7
|
+
resource_id: Types.ObjectId | null;
|
|
8
|
+
service_type: string | null;
|
|
9
|
+
system_day: Date;
|
|
10
|
+
dedupe_key: string;
|
|
11
|
+
created_at?: Date;
|
|
12
|
+
updated_at?: Date;
|
|
13
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Document, Types } from "mongoose";
|
|
2
|
+
import { MilestoneType } from "../enum";
|
|
3
|
+
export interface IStreakMilestone extends Document {
|
|
4
|
+
user_id: Types.ObjectId;
|
|
5
|
+
type: MilestoneType;
|
|
6
|
+
action: string;
|
|
7
|
+
date: Date;
|
|
8
|
+
created_at?: Date;
|
|
9
|
+
updated_at?: Date;
|
|
10
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Document, Types } from "mongoose";
|
|
2
|
+
import { MilestoneType } from "../enum";
|
|
3
|
+
export interface IStreakMilestoneRef {
|
|
4
|
+
type: MilestoneType;
|
|
5
|
+
date: Date;
|
|
6
|
+
}
|
|
7
|
+
export interface IStreak extends Document {
|
|
8
|
+
user_id: Types.ObjectId;
|
|
9
|
+
current_count: number;
|
|
10
|
+
longest_count: number;
|
|
11
|
+
last_active_day: Date | null;
|
|
12
|
+
last_processed_day: Date | null;
|
|
13
|
+
last_milestone: IStreakMilestoneRef | null;
|
|
14
|
+
last_streak_email_day: Date | null;
|
|
15
|
+
created_at?: Date;
|
|
16
|
+
updated_at?: Date;
|
|
17
|
+
}
|
package/dist/types/team.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Document } from "mongoose";
|
|
2
|
-
import { IMember, IProject, ISubscription } from "./";
|
|
1
|
+
import { Document, Types } from "mongoose";
|
|
2
|
+
import { IMember, IProject, ISubscription, IUser } from "./";
|
|
3
3
|
import { BUILD_DISABLED_BY } from "../enum";
|
|
4
4
|
export interface ITeam extends Document {
|
|
5
5
|
name: string;
|
|
@@ -7,6 +7,7 @@ export interface ITeam extends Document {
|
|
|
7
7
|
size: number;
|
|
8
8
|
members: IMember[];
|
|
9
9
|
projects: IProject[];
|
|
10
|
+
ai_usage_count: number;
|
|
10
11
|
image: string;
|
|
11
12
|
isCreator: boolean;
|
|
12
13
|
build_minutes: number;
|
|
@@ -14,5 +15,10 @@ export interface ITeam extends Document {
|
|
|
14
15
|
build_minutes_cycle_anchor: Date | null;
|
|
15
16
|
build_disabled: boolean;
|
|
16
17
|
build_disabled_by: BUILD_DISABLED_BY;
|
|
18
|
+
sandbox_disabled: boolean;
|
|
19
|
+
sandbox_disabled_by: "system" | "payment_failure" | null;
|
|
17
20
|
subscription: ISubscription;
|
|
21
|
+
enforce_2fa: boolean;
|
|
22
|
+
enforce_2fa_at: Date | null;
|
|
23
|
+
enforce_2fa_by: IUser | Types.ObjectId | null;
|
|
18
24
|
}
|
package/dist/types/user.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export interface IUser extends Document {
|
|
|
12
12
|
verification_token: number;
|
|
13
13
|
token?: string;
|
|
14
14
|
company?: string;
|
|
15
|
+
ai_usage_count: number;
|
|
15
16
|
github: IGit;
|
|
16
17
|
gitlab: IGit;
|
|
17
18
|
location: string;
|
|
@@ -26,6 +27,8 @@ export interface IUser extends Document {
|
|
|
26
27
|
is_waitlist: boolean;
|
|
27
28
|
build_disabled: boolean;
|
|
28
29
|
build_disabled_by: BUILD_DISABLED_BY;
|
|
30
|
+
sandbox_disabled: boolean;
|
|
31
|
+
sandbox_disabled_by: "system" | "payment_failure" | null;
|
|
29
32
|
spending_limit: number;
|
|
30
33
|
build_minutes: number;
|
|
31
34
|
disabled: boolean;
|
|
@@ -35,6 +38,7 @@ export interface IUser extends Document {
|
|
|
35
38
|
email: boolean;
|
|
36
39
|
mute: boolean;
|
|
37
40
|
};
|
|
41
|
+
totp_enabled?: boolean;
|
|
38
42
|
created_at: Date;
|
|
39
43
|
updated_at: Date;
|
|
40
44
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Document, Types } from "mongoose";
|
|
2
|
+
export interface IVolumeUsageSegmentCosts {
|
|
3
|
+
startDate: Date;
|
|
4
|
+
endDate: Date | null;
|
|
5
|
+
}
|
|
6
|
+
export interface IVolumeUsageSegment extends Document {
|
|
7
|
+
_id: Types.ObjectId;
|
|
8
|
+
volume_id: Types.ObjectId;
|
|
9
|
+
user_id: Types.ObjectId;
|
|
10
|
+
team_id: Types.ObjectId | null;
|
|
11
|
+
size_gb: number;
|
|
12
|
+
costs: IVolumeUsageSegmentCosts;
|
|
13
|
+
billed: boolean;
|
|
14
|
+
createdAt: Date;
|
|
15
|
+
updatedAt: Date;
|
|
16
|
+
}
|
package/dist/types/volume.d.ts
CHANGED
|
@@ -1,14 +1,20 @@
|
|
|
1
|
-
import { Document } from "mongoose";
|
|
1
|
+
import { Document, Types } from "mongoose";
|
|
2
2
|
import { IUser } from "./user";
|
|
3
3
|
import { ITeam } from "./team";
|
|
4
|
-
import {
|
|
4
|
+
import { IRegion } from "./region";
|
|
5
5
|
export interface IVolume extends Document {
|
|
6
6
|
name: string;
|
|
7
7
|
user?: IUser;
|
|
8
8
|
team?: ITeam;
|
|
9
|
-
|
|
9
|
+
namespace: string;
|
|
10
10
|
size: number;
|
|
11
|
+
type: string;
|
|
11
12
|
mount_path?: string;
|
|
13
|
+
csi_volume_id: string | null;
|
|
14
|
+
region: IRegion | null;
|
|
15
|
+
attached_sandbox_id: Types.ObjectId | null;
|
|
16
|
+
attached_project_id: Types.ObjectId | null;
|
|
17
|
+
last_attached_at: Date | null;
|
|
12
18
|
created_at?: Date;
|
|
13
19
|
updated_at?: Date;
|
|
14
20
|
}
|
package/dist/types/wallet.d.ts
CHANGED
package/dist/user.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 { IUser } from "./types";
|
|
27
|
-
declare const _default: import("mongoose").Model<IUser, {}, {}, {}, import("mongoose").Document<unknown, {}, IUser> & IUser & {
|
|
2
|
+
declare const _default: import("mongoose").Model<IUser, {}, {}, {}, import("mongoose").Document<unknown, {}, IUser, {}, import("mongoose").DefaultSchemaOptions> & IUser & Required<{
|
|
28
3
|
_id: import("mongoose").Types.ObjectId;
|
|
29
|
-
}
|
|
4
|
+
}> & {
|
|
5
|
+
__v: number;
|
|
6
|
+
} & {
|
|
7
|
+
id: string;
|
|
8
|
+
}, any, IUser>;
|
|
30
9
|
export default _default;
|
package/dist/user.js
CHANGED
|
@@ -39,6 +39,19 @@ const userSchema = new mongoose_1.Schema({
|
|
|
39
39
|
type: String,
|
|
40
40
|
required: false,
|
|
41
41
|
},
|
|
42
|
+
sandbox_disabled: {
|
|
43
|
+
type: Boolean,
|
|
44
|
+
default: false,
|
|
45
|
+
},
|
|
46
|
+
sandbox_disabled_by: {
|
|
47
|
+
type: String,
|
|
48
|
+
default: null,
|
|
49
|
+
},
|
|
50
|
+
ai_usage_count: {
|
|
51
|
+
type: Number,
|
|
52
|
+
default: 0,
|
|
53
|
+
required: false
|
|
54
|
+
},
|
|
42
55
|
tenant: { type: mongoose_1.Schema.Types.ObjectId, ref: "Tenancy", required: false },
|
|
43
56
|
is_waitlist: { type: Boolean, default: true },
|
|
44
57
|
spending_limit: { type: Number },
|
|
@@ -47,6 +60,7 @@ const userSchema = new mongoose_1.Schema({
|
|
|
47
60
|
disabled: Boolean,
|
|
48
61
|
disabled_at: Date,
|
|
49
62
|
has_payment_method: Boolean,
|
|
63
|
+
totp_enabled: { type: Boolean, default: false },
|
|
50
64
|
}, {
|
|
51
65
|
timestamps: {
|
|
52
66
|
createdAt: "created_at",
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IVolumeUsageSegment } from "./types/volume-usage-segment";
|
|
2
|
+
declare const _default: import("mongoose").Model<IVolumeUsageSegment, {}, {}, {}, import("mongoose").Document<unknown, {}, IVolumeUsageSegment, {}, import("mongoose").DefaultSchemaOptions> & IVolumeUsageSegment & Required<{
|
|
3
|
+
_id: import("mongoose").Types.ObjectId;
|
|
4
|
+
}> & {
|
|
5
|
+
__v: number;
|
|
6
|
+
} & {
|
|
7
|
+
id: string;
|
|
8
|
+
}, any, IVolumeUsageSegment>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mongoose_1 = require("mongoose");
|
|
4
|
+
const volumeUsageSegmentSchema = new mongoose_1.Schema({
|
|
5
|
+
volume_id: {
|
|
6
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
7
|
+
ref: "Volume",
|
|
8
|
+
required: true,
|
|
9
|
+
},
|
|
10
|
+
user_id: {
|
|
11
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
12
|
+
ref: "User",
|
|
13
|
+
required: true,
|
|
14
|
+
index: true,
|
|
15
|
+
},
|
|
16
|
+
team_id: {
|
|
17
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
18
|
+
ref: "Team",
|
|
19
|
+
default: null,
|
|
20
|
+
index: true,
|
|
21
|
+
},
|
|
22
|
+
size_gb: {
|
|
23
|
+
type: Number,
|
|
24
|
+
default: 0,
|
|
25
|
+
},
|
|
26
|
+
costs: {
|
|
27
|
+
startDate: { type: Date, required: true },
|
|
28
|
+
endDate: { type: Date, default: null },
|
|
29
|
+
},
|
|
30
|
+
billed: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: false,
|
|
33
|
+
index: true,
|
|
34
|
+
},
|
|
35
|
+
}, {
|
|
36
|
+
timestamps: true,
|
|
37
|
+
});
|
|
38
|
+
volumeUsageSegmentSchema.index({ user_id: 1, billed: 1, "costs.endDate": 1 });
|
|
39
|
+
volumeUsageSegmentSchema.index({ team_id: 1, billed: 1, "costs.endDate": 1 });
|
|
40
|
+
volumeUsageSegmentSchema.index({ volume_id: 1, "costs.endDate": 1 });
|
|
41
|
+
volumeUsageSegmentSchema.index({ volume_id: 1 }, {
|
|
42
|
+
unique: true,
|
|
43
|
+
partialFilterExpression: { "costs.endDate": null },
|
|
44
|
+
name: "unique_open_segment_per_volume",
|
|
45
|
+
});
|
|
46
|
+
exports.default = (0, mongoose_1.model)("VolumeUsageSegment", volumeUsageSegmentSchema, "volume_usage_segments");
|
package/dist/volume.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 { IVolume } from "./types";
|
|
27
|
-
declare const _default: import("mongoose").Model<IVolume, {}, {}, {}, import("mongoose").Document<unknown, {}, IVolume> & IVolume & {
|
|
2
|
+
declare const _default: import("mongoose").Model<IVolume, {}, {}, {}, import("mongoose").Document<unknown, {}, IVolume, {}, import("mongoose").DefaultSchemaOptions> & IVolume & Required<{
|
|
28
3
|
_id: import("mongoose").Types.ObjectId;
|
|
29
|
-
}
|
|
4
|
+
}> & {
|
|
5
|
+
__v: number;
|
|
6
|
+
} & {
|
|
7
|
+
id: string;
|
|
8
|
+
}, any, IVolume>;
|
|
30
9
|
export default _default;
|
package/dist/volume.js
CHANGED
|
@@ -15,13 +15,30 @@ const volumeSchema = new mongoose_1.Schema({
|
|
|
15
15
|
ref: "Team",
|
|
16
16
|
default: null,
|
|
17
17
|
},
|
|
18
|
-
|
|
19
|
-
type:
|
|
20
|
-
required:
|
|
21
|
-
|
|
18
|
+
namespace: {
|
|
19
|
+
type: String,
|
|
20
|
+
required: false
|
|
21
|
+
},
|
|
22
|
+
type: {
|
|
23
|
+
type: String,
|
|
24
|
+
required: false,
|
|
25
|
+
default: "project"
|
|
22
26
|
},
|
|
23
27
|
size: { type: Number, required: true },
|
|
24
28
|
mount_path: { type: String },
|
|
29
|
+
csi_volume_id: { type: String, default: null },
|
|
30
|
+
region: { type: mongoose_1.Schema.Types.ObjectId, ref: "Region", default: null },
|
|
31
|
+
attached_sandbox_id: {
|
|
32
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
33
|
+
ref: "Sandbox",
|
|
34
|
+
default: null,
|
|
35
|
+
},
|
|
36
|
+
attached_project_id: {
|
|
37
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
38
|
+
ref: "Project",
|
|
39
|
+
default: null,
|
|
40
|
+
},
|
|
41
|
+
last_attached_at: { type: Date, default: null },
|
|
25
42
|
}, {
|
|
26
43
|
timestamps: {
|
|
27
44
|
createdAt: "created_at",
|
package/dist/wallet.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 { IWallet } from "./types/wallet";
|
|
27
|
-
declare const _default: import("mongoose").Model<IWallet, {}, {}, {}, import("mongoose").Document<unknown, {}, IWallet> & IWallet & {
|
|
2
|
+
declare const _default: import("mongoose").Model<IWallet, {}, {}, {}, import("mongoose").Document<unknown, {}, IWallet, {}, import("mongoose").DefaultSchemaOptions> & IWallet & Required<{
|
|
28
3
|
_id: import("mongoose").Types.ObjectId;
|
|
29
|
-
}
|
|
4
|
+
}> & {
|
|
5
|
+
__v: number;
|
|
6
|
+
} & {
|
|
7
|
+
id: string;
|
|
8
|
+
}, any, IWallet>;
|
|
30
9
|
export default _default;
|