@brimble/models 3.8.104 → 3.8.106

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.
@@ -0,0 +1,9 @@
1
+ import { IBackupHistory } from "./types/backup-history";
2
+ declare const _default: import("mongoose").Model<IBackupHistory, {}, {}, {}, import("mongoose").Document<unknown, {}, IBackupHistory, {}, import("mongoose").DefaultSchemaOptions> & IBackupHistory & Required<{
3
+ _id: import("mongoose").Types.ObjectId;
4
+ }> & {
5
+ __v: number;
6
+ } & {
7
+ id: string;
8
+ }, any, IBackupHistory>;
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 backupHistorySchema = new mongoose_1.Schema({
6
+ project_id: {
7
+ type: mongoose_1.Schema.Types.ObjectId,
8
+ ref: "Project",
9
+ required: true,
10
+ index: true,
11
+ },
12
+ user_id: {
13
+ type: mongoose_1.Schema.Types.ObjectId,
14
+ ref: "User",
15
+ required: true,
16
+ index: true,
17
+ },
18
+ team: {
19
+ type: mongoose_1.Schema.Types.ObjectId,
20
+ ref: "Team",
21
+ default: null,
22
+ index: true,
23
+ },
24
+ status: {
25
+ type: String,
26
+ enum: Object.values(enum_1.BACKUP_STATUS),
27
+ default: enum_1.BACKUP_STATUS.PENDING,
28
+ },
29
+ trigger: {
30
+ type: String,
31
+ enum: ["scheduled", "manual"],
32
+ required: true,
33
+ },
34
+ object_key: {
35
+ type: String,
36
+ default: null,
37
+ },
38
+ size_bytes: {
39
+ type: Number,
40
+ default: null,
41
+ },
42
+ failure_reason: {
43
+ type: String,
44
+ default: null,
45
+ },
46
+ }, {
47
+ timestamps: { createdAt: "created_at", updatedAt: "updated_at" },
48
+ collection: "backup_histories",
49
+ });
50
+ backupHistorySchema.index({ project_id: 1, created_at: -1 });
51
+ exports.default = (0, mongoose_1.model)("BackupHistory", backupHistorySchema);
package/dist/db-image.js CHANGED
@@ -78,6 +78,10 @@ const dbImageSchema = new mongoose_1.Schema({
78
78
  required: true,
79
79
  type: String,
80
80
  },
81
+ tls_enabled: {
82
+ type: Boolean,
83
+ default: true,
84
+ },
81
85
  params: {
82
86
  required: false,
83
87
  type: Object,
@@ -326,6 +326,13 @@ export declare enum SANDBOX_SNAPSHOT_STATUS {
326
326
  READY = "ready",
327
327
  FAILED = "failed"
328
328
  }
329
+ export declare enum BACKUP_STATUS {
330
+ PENDING = "pending",
331
+ RUNNING = "running",
332
+ COMPLETED = "completed",
333
+ FAILED = "failed",
334
+ DELETED = "deleted"
335
+ }
329
336
  export declare enum StorageBucketStatus {
330
337
  Active = "active",
331
338
  Deleting = "deleting",
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.INVOICE_TYPE = exports.INVOICE_PAYMENT_STATUS = exports.INVOICE_STATUS = exports.COLLAB_TOOLBAR_POSITION = exports.COLLAB_THEME = exports.COLLAB_INTEGRATION_TYPE = exports.COLLAB_ANNOTATION_STATUS = exports.NomadDeploymentStatus = exports.DomainTransferStatus = exports.DomainTransferDirection = exports.DomainTransferProvider = exports.DomainRenewalStatus = exports.FrameworkApplicationType = exports.SCALING_SOURCE = exports.SCALING_METRIC = exports.SCALING_STRATEGY = exports.LicenseStatus = exports.JobStatus = exports.DatabaseEngine = exports.ServiceType = exports.REGION_CONTINENT = exports.PERMISSION_TYPE = exports.ROLES = exports.DNS_CHANGE_SOURCE = exports.DNS_CHANGE_TYPE = exports.DNS_TYPE = exports.SERVER_STATUS = exports.OAUTH_PERMISSIONS = exports.SUBSCRIPTION_PLAN_TYPE = exports.SUBSCRIPTION_STATUS = exports.DrainEventType = exports.LogSource = exports.DrainStatus = exports.DrainType = exports.AlertEventStatus = exports.AlertChannelMode = exports.AlertRuleState = exports.AlertCondition = exports.AlertMetric = exports.PROJECT_STATUS = exports.CARD_TYPES = exports.INTEGRATION_PROVIDERS = exports.INTEGRATION_TYPES = exports.CONFIG_FILE_VISIBILITY = exports.ENVIRONMENT = exports.REQUEST_TYPE = exports.PROJECT_DISABLED_BY = exports.BUILD_DISABLED_BY = exports.SERVER_PROTOCOL = exports.GIT_TYPE = void 0;
4
- exports.CouponRedemptionStatus = exports.CouponScope = exports.CouponDiscountType = exports.QUEST_TARGETLESS_REQUIREMENTS = exports.QUEST_CLAIM_REQUIREMENTS = exports.WorkbenchMode = exports.QuestRequirementType = exports.QuestEntity = exports.QuestCriterionType = exports.QuestRewardStatus = exports.RewardType = exports.EligibilityType = exports.ACTION_TO_MILESTONE = exports.QUEST_COUNTABLE_MILESTONES = exports.MilestoneType = exports.QualifyingActionType = exports.XRobotsTag = exports.XContentTypeOptions = exports.XFrameOptions = exports.StorageMigrationStatus = exports.StorageCredentialStatus = exports.StorageCredentialRole = exports.StorageTokenStatus = exports.StorageUploadStatus = exports.StorageBucketStatus = exports.SANDBOX_SNAPSHOT_STATUS = exports.SANDBOX_EGRESS_MODE = exports.SANDBOX_DESTROY_REASON = exports.SANDBOX_STATUS = exports.SANDBOX_TEMPLATE = void 0;
4
+ exports.CouponRedemptionStatus = exports.CouponScope = exports.CouponDiscountType = exports.QUEST_TARGETLESS_REQUIREMENTS = exports.QUEST_CLAIM_REQUIREMENTS = exports.WorkbenchMode = exports.QuestRequirementType = exports.QuestEntity = exports.QuestCriterionType = exports.QuestRewardStatus = exports.RewardType = exports.EligibilityType = exports.ACTION_TO_MILESTONE = exports.QUEST_COUNTABLE_MILESTONES = exports.MilestoneType = exports.QualifyingActionType = exports.XRobotsTag = exports.XContentTypeOptions = exports.XFrameOptions = exports.StorageMigrationStatus = exports.StorageCredentialStatus = exports.StorageCredentialRole = exports.StorageTokenStatus = exports.StorageUploadStatus = exports.StorageBucketStatus = exports.BACKUP_STATUS = exports.SANDBOX_SNAPSHOT_STATUS = exports.SANDBOX_EGRESS_MODE = exports.SANDBOX_DESTROY_REASON = exports.SANDBOX_STATUS = exports.SANDBOX_TEMPLATE = void 0;
5
5
  var GIT_TYPE;
6
6
  (function (GIT_TYPE) {
7
7
  GIT_TYPE["GITHUB"] = "GITHUB";
@@ -385,6 +385,14 @@ var SANDBOX_SNAPSHOT_STATUS;
385
385
  SANDBOX_SNAPSHOT_STATUS["READY"] = "ready";
386
386
  SANDBOX_SNAPSHOT_STATUS["FAILED"] = "failed";
387
387
  })(SANDBOX_SNAPSHOT_STATUS || (exports.SANDBOX_SNAPSHOT_STATUS = SANDBOX_SNAPSHOT_STATUS = {}));
388
+ var BACKUP_STATUS;
389
+ (function (BACKUP_STATUS) {
390
+ BACKUP_STATUS["PENDING"] = "pending";
391
+ BACKUP_STATUS["RUNNING"] = "running";
392
+ BACKUP_STATUS["COMPLETED"] = "completed";
393
+ BACKUP_STATUS["FAILED"] = "failed";
394
+ BACKUP_STATUS["DELETED"] = "deleted";
395
+ })(BACKUP_STATUS || (exports.BACKUP_STATUS = BACKUP_STATUS = {}));
388
396
  var StorageBucketStatus;
389
397
  (function (StorageBucketStatus) {
390
398
  StorageBucketStatus["Active"] = "active";
package/dist/index.d.ts CHANGED
@@ -67,6 +67,7 @@ export { default as Sandbox } from "./sandbox";
67
67
  export { default as SandboxActivity } from "./sandbox-activity";
68
68
  export { default as SandboxImage } from "./sandbox-image";
69
69
  export { default as SandboxSnapshot } from "./sandbox-snapshot";
70
+ export { default as BackupHistory } from "./backup-history";
70
71
  export { default as SandboxSnapshotUsageSegment } from "./sandbox-snapshot-usage-segment";
71
72
  export { default as SandboxUsageSegment } from "./sandbox-usage-segment";
72
73
  export { default as VolumeUsageSegment } from "./volume-usage-segment";
@@ -83,8 +84,8 @@ export { default as QuestParticipation } from "./quest-participation";
83
84
  export { default as QuestRewardIssuance } from "./quest-reward-issuance";
84
85
  export { default as Coupon } from "./coupon";
85
86
  export { default as CouponRedemption } from "./coupon-redemption";
86
- export { IUser, IGit, IProject, IProjectAnalytics, IPreview, IProjectConnection, IProjectNetworkSettings, IRatelimit, RatelimitConfig, RateLimitZone, RateLimitMatcher, DistributedRateLimitConfig, IFollowing, IIntegration, IEnv, IServer, IDomain, IToken, IMember, ITeam, IInstalledIntegration, ILog, ISubscription, ICard, IPaymentMethod, IDns, IDnsChangeLog, IRole, IPermission, IMemberPermission, IWallet, IDbImage, IJob, ILicense, IPlanConfiguration, IAutoScalingGroup, IComputeChange, IRegion, IVolume, IFramework, BrimbleFrameworkType, ISettings, ILoadBalancerPort, IDomainRenewal, IDomainTransfer, IWebhookCategory, IWebhookEvent, IWebhookSetting, IIntention, IProvider, ICollabAnnotation, ICollabComment, ICollabAttachment, ICollabIntegration, ICollabSettings, ICollabShareToken, ICollabPushSubscription, IAppMessage, IInvoice, ITag, IProjectTagAssignment, ICashierSubscription, ICashierSubscriptionItem, IProjectEnvironment, IEnvironmentVariable, IProjectConfigFile, IActivityLog, IAlertRule, IAlertRuleState, IAlertEvent, IAlertNotificationResult, IDrain, IProjectDrainSubscription, IOwnershipTransfer, ISandbox, ISandboxSpecs, ISandboxActivity, ISandboxImage, ISandboxSnapshot, ISandboxSnapshotUsageSegment, ISandboxSnapshotUsageSegmentCosts, ISandboxUsageSegment, ISandboxUsageSegmentCurrent, ISandboxUsageSegmentCosts, IVolumeUsageSegment, IVolumeUsageSegmentCosts, IPgBouncerUsageSegment, IPgBouncerUsageSegmentCosts, IObjectStorageUsageSegment, IObjectStorageUsageSegmentCosts, IObjectStorageUsageUnitsSummary, IIdempotencyRecord, IStorageBucket, IStorageObject, IStorageUpload, IStorageToken, IStorageCredential, IStorageMigration, StorageTokenPermission, StorageLifecycleRule, StorageCorsRule, StorageLifecycleRuleTransition, IStreak, IStreakMilestoneRef, IStreakEvent, IStreakDay, IStreakMilestone, IQuestCampaign, IQuestCriterion, IQuestRequirement, IQuestReward, IQuestParticipation, IQuestCriterionProgress, IQuestRewardIssuance, IQuestIssuedReward, ICoupon, ICouponRedemption, } from "./types";
87
- export { GIT_TYPE, INTEGRATION_TYPES, INTEGRATION_PROVIDERS, OAUTH_PERMISSIONS, ENVIRONMENT, SERVER_STATUS, ROLES, SUBSCRIPTION_PLAN_TYPE, PROJECT_STATUS, AlertMetric, AlertCondition, AlertRuleState, AlertChannelMode, AlertEventStatus, DrainType, DrainStatus, LogSource, DrainEventType, SUBSCRIPTION_STATUS, CARD_TYPES, DNS_TYPE, DNS_CHANGE_TYPE, DNS_CHANGE_SOURCE, PERMISSION_TYPE, REQUEST_TYPE, ServiceType, SCALING_SOURCE, DatabaseEngine, JobStatus, LicenseStatus, REGION_CONTINENT, BUILD_DISABLED_BY, PROJECT_DISABLED_BY, SERVER_PROTOCOL, FrameworkApplicationType, DomainRenewalStatus, DomainTransferProvider, DomainTransferDirection, DomainTransferStatus, NomadDeploymentStatus, COLLAB_ANNOTATION_STATUS, COLLAB_INTEGRATION_TYPE, COLLAB_THEME, COLLAB_TOOLBAR_POSITION, INVOICE_STATUS, INVOICE_PAYMENT_STATUS, INVOICE_TYPE, SANDBOX_TEMPLATE, SANDBOX_STATUS, SANDBOX_DESTROY_REASON, SANDBOX_EGRESS_MODE, SANDBOX_SNAPSHOT_STATUS, StorageBucketStatus, StorageUploadStatus, StorageTokenStatus, StorageCredentialRole, StorageCredentialStatus, StorageMigrationStatus, XFrameOptions, XContentTypeOptions, XRobotsTag, QualifyingActionType, MilestoneType, QUEST_COUNTABLE_MILESTONES, ACTION_TO_MILESTONE, EligibilityType, RewardType, QuestRewardStatus, QuestCriterionType, QuestEntity, QuestRequirementType, QUEST_CLAIM_REQUIREMENTS, QUEST_TARGETLESS_REQUIREMENTS, WorkbenchMode, CouponDiscountType, CouponScope, CouponRedemptionStatus, CONFIG_FILE_VISIBILITY, } from "./enum";
87
+ export { IUser, IGit, IProject, IProjectAnalytics, IPreview, IProjectConnection, IProjectNetworkSettings, IRatelimit, RatelimitConfig, RateLimitZone, RateLimitMatcher, DistributedRateLimitConfig, IFollowing, IIntegration, IEnv, IServer, IDomain, IToken, IMember, ITeam, IInstalledIntegration, ILog, ISubscription, ICard, IPaymentMethod, IDns, IDnsChangeLog, IRole, IPermission, IMemberPermission, IWallet, IDbImage, IJob, ILicense, IPlanConfiguration, IAutoScalingGroup, IComputeChange, IRegion, IVolume, IFramework, BrimbleFrameworkType, ISettings, ILoadBalancerPort, IDomainRenewal, IDomainTransfer, IWebhookCategory, IWebhookEvent, IWebhookSetting, IIntention, IProvider, ICollabAnnotation, ICollabComment, ICollabAttachment, ICollabIntegration, ICollabSettings, ICollabShareToken, ICollabPushSubscription, IAppMessage, IInvoice, ITag, IProjectTagAssignment, ICashierSubscription, ICashierSubscriptionItem, IProjectEnvironment, IEnvironmentVariable, IProjectConfigFile, IActivityLog, IAlertRule, IAlertRuleState, IAlertEvent, IAlertNotificationResult, IDrain, IProjectDrainSubscription, IOwnershipTransfer, ISandbox, ISandboxSpecs, ISandboxActivity, ISandboxImage, ISandboxSnapshot, IBackupHistory, ISandboxSnapshotUsageSegment, ISandboxSnapshotUsageSegmentCosts, ISandboxUsageSegment, ISandboxUsageSegmentCurrent, ISandboxUsageSegmentCosts, IVolumeUsageSegment, IVolumeUsageSegmentCosts, IPgBouncerUsageSegment, IPgBouncerUsageSegmentCosts, IObjectStorageUsageSegment, IObjectStorageUsageSegmentCosts, IObjectStorageUsageUnitsSummary, IIdempotencyRecord, IStorageBucket, IStorageObject, IStorageUpload, IStorageToken, IStorageCredential, IStorageMigration, StorageTokenPermission, StorageLifecycleRule, StorageCorsRule, StorageLifecycleRuleTransition, IStreak, IStreakMilestoneRef, IStreakEvent, IStreakDay, IStreakMilestone, IQuestCampaign, IQuestCriterion, IQuestRequirement, IQuestReward, IQuestParticipation, IQuestCriterionProgress, IQuestRewardIssuance, IQuestIssuedReward, ICoupon, ICouponRedemption, } from "./types";
88
+ export { GIT_TYPE, INTEGRATION_TYPES, INTEGRATION_PROVIDERS, OAUTH_PERMISSIONS, ENVIRONMENT, SERVER_STATUS, ROLES, SUBSCRIPTION_PLAN_TYPE, PROJECT_STATUS, AlertMetric, AlertCondition, AlertRuleState, AlertChannelMode, AlertEventStatus, DrainType, DrainStatus, LogSource, DrainEventType, SUBSCRIPTION_STATUS, CARD_TYPES, DNS_TYPE, DNS_CHANGE_TYPE, DNS_CHANGE_SOURCE, PERMISSION_TYPE, REQUEST_TYPE, ServiceType, SCALING_SOURCE, DatabaseEngine, JobStatus, LicenseStatus, REGION_CONTINENT, BUILD_DISABLED_BY, PROJECT_DISABLED_BY, SERVER_PROTOCOL, FrameworkApplicationType, DomainRenewalStatus, DomainTransferProvider, DomainTransferDirection, DomainTransferStatus, NomadDeploymentStatus, COLLAB_ANNOTATION_STATUS, COLLAB_INTEGRATION_TYPE, COLLAB_THEME, COLLAB_TOOLBAR_POSITION, INVOICE_STATUS, INVOICE_PAYMENT_STATUS, INVOICE_TYPE, SANDBOX_TEMPLATE, SANDBOX_STATUS, SANDBOX_DESTROY_REASON, SANDBOX_EGRESS_MODE, SANDBOX_SNAPSHOT_STATUS, BACKUP_STATUS, StorageBucketStatus, StorageUploadStatus, StorageTokenStatus, StorageCredentialRole, StorageCredentialStatus, StorageMigrationStatus, XFrameOptions, XContentTypeOptions, XRobotsTag, QualifyingActionType, MilestoneType, QUEST_COUNTABLE_MILESTONES, ACTION_TO_MILESTONE, EligibilityType, RewardType, QuestRewardStatus, QuestCriterionType, QuestEntity, QuestRequirementType, QUEST_CLAIM_REQUIREMENTS, QUEST_TARGETLESS_REQUIREMENTS, WorkbenchMode, CouponDiscountType, CouponScope, CouponRedemptionStatus, CONFIG_FILE_VISIBILITY, } from "./enum";
88
89
  import mongoose from "mongoose";
89
90
  export declare const connectToMongo: (mongoUrl: string, config?: mongoose.ConnectOptions) => Promise<void>;
90
91
  export declare const db: mongoose.Connection;
package/dist/index.js CHANGED
@@ -13,9 +13,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.CollabPushSubscription = exports.CollabShareToken = exports.CollabSettings = exports.CollabIntegration = exports.CollabComment = exports.CollabAnnotation = exports.Provider = exports.Intention = exports.WebhookSetting = exports.WebhookEvent = exports.WebhookCategory = exports.DomainTransfer = exports.DomainRenewal = exports.LoadBalancerPort = exports.Settings = exports.Framework = exports.Volume = exports.Region = exports.ComputeChange = exports.AutoScalingGroup = exports.PlanConfiguration = exports.Liscense = exports.Job = exports.DbImage = exports.Wallet = exports.Server = exports.Card = exports.Subscription = exports.Log = exports.Role = exports.MemberPermission = exports.PaymentMethod = exports.Permission = exports.Member = exports.Team = exports.Token = exports.Env = exports.DnsChangeLog = exports.Dns = exports.Domain = exports.Integration = exports.Following = exports.Ratelimit = exports.ProjectNetworkSettings = exports.ProjectConnection = exports.Preview = exports.ProjectAnalytics = exports.DeletedProject = exports.Project = exports.User = void 0;
16
- exports.PROJECT_STATUS = exports.SUBSCRIPTION_PLAN_TYPE = exports.ROLES = exports.SERVER_STATUS = exports.ENVIRONMENT = exports.OAUTH_PERMISSIONS = exports.INTEGRATION_PROVIDERS = exports.INTEGRATION_TYPES = exports.GIT_TYPE = exports.CouponRedemption = exports.Coupon = exports.QuestRewardIssuance = exports.QuestParticipation = exports.QuestCampaign = exports.StreakMilestone = exports.StreakDay = exports.StreakEvent = exports.Streak = exports.StorageMigration = exports.StorageCredential = exports.StorageToken = exports.StorageUpload = exports.StorageObject = exports.StorageBucket = exports.IdempotencyRecord = exports.ObjectStorageUsageSegment = exports.PgBouncerUsageSegment = exports.VolumeUsageSegment = exports.SandboxUsageSegment = exports.SandboxSnapshotUsageSegment = exports.SandboxSnapshot = exports.SandboxImage = exports.SandboxActivity = exports.Sandbox = exports.OwnershipTransfer = exports.ProjectDrainSubscription = exports.Drain = exports.AlertEvent = exports.AlertRuleStateModel = exports.AlertRule = exports.ActivityLog = exports.ProjectConfigFile = exports.EnvironmentVariable = exports.ProjectEnvironment = exports.CashierSubscriptionItem = exports.CashierSubscription = exports.ProjectTagAssignment = exports.Tag = exports.Invoice = exports.AppMessage = void 0;
17
- exports.XFrameOptions = exports.StorageMigrationStatus = exports.StorageCredentialStatus = exports.StorageCredentialRole = exports.StorageTokenStatus = exports.StorageUploadStatus = exports.StorageBucketStatus = exports.SANDBOX_SNAPSHOT_STATUS = exports.SANDBOX_EGRESS_MODE = exports.SANDBOX_DESTROY_REASON = exports.SANDBOX_STATUS = exports.SANDBOX_TEMPLATE = exports.INVOICE_TYPE = exports.INVOICE_PAYMENT_STATUS = exports.INVOICE_STATUS = exports.COLLAB_TOOLBAR_POSITION = exports.COLLAB_THEME = exports.COLLAB_INTEGRATION_TYPE = exports.COLLAB_ANNOTATION_STATUS = exports.NomadDeploymentStatus = exports.DomainTransferStatus = exports.DomainTransferDirection = exports.DomainTransferProvider = exports.DomainRenewalStatus = exports.FrameworkApplicationType = exports.SERVER_PROTOCOL = exports.PROJECT_DISABLED_BY = exports.BUILD_DISABLED_BY = exports.REGION_CONTINENT = exports.LicenseStatus = exports.JobStatus = exports.DatabaseEngine = exports.SCALING_SOURCE = exports.ServiceType = exports.REQUEST_TYPE = exports.PERMISSION_TYPE = exports.DNS_CHANGE_SOURCE = exports.DNS_CHANGE_TYPE = exports.DNS_TYPE = exports.CARD_TYPES = exports.SUBSCRIPTION_STATUS = exports.DrainEventType = exports.LogSource = exports.DrainStatus = exports.DrainType = exports.AlertEventStatus = exports.AlertChannelMode = exports.AlertRuleState = exports.AlertCondition = exports.AlertMetric = void 0;
18
- exports.healthCheckMongo = exports.closeMongo = exports.db = exports.connectToMongo = exports.CONFIG_FILE_VISIBILITY = exports.CouponRedemptionStatus = exports.CouponScope = exports.CouponDiscountType = exports.WorkbenchMode = exports.QUEST_TARGETLESS_REQUIREMENTS = exports.QUEST_CLAIM_REQUIREMENTS = exports.QuestRequirementType = exports.QuestEntity = exports.QuestCriterionType = exports.QuestRewardStatus = exports.RewardType = exports.EligibilityType = exports.ACTION_TO_MILESTONE = exports.QUEST_COUNTABLE_MILESTONES = exports.MilestoneType = exports.QualifyingActionType = exports.XRobotsTag = exports.XContentTypeOptions = void 0;
16
+ exports.SUBSCRIPTION_PLAN_TYPE = exports.ROLES = exports.SERVER_STATUS = exports.ENVIRONMENT = exports.OAUTH_PERMISSIONS = exports.INTEGRATION_PROVIDERS = exports.INTEGRATION_TYPES = exports.GIT_TYPE = exports.CouponRedemption = exports.Coupon = exports.QuestRewardIssuance = exports.QuestParticipation = exports.QuestCampaign = exports.StreakMilestone = exports.StreakDay = exports.StreakEvent = exports.Streak = exports.StorageMigration = exports.StorageCredential = exports.StorageToken = exports.StorageUpload = exports.StorageObject = exports.StorageBucket = exports.IdempotencyRecord = exports.ObjectStorageUsageSegment = exports.PgBouncerUsageSegment = exports.VolumeUsageSegment = exports.SandboxUsageSegment = exports.SandboxSnapshotUsageSegment = exports.BackupHistory = exports.SandboxSnapshot = exports.SandboxImage = exports.SandboxActivity = exports.Sandbox = exports.OwnershipTransfer = exports.ProjectDrainSubscription = exports.Drain = exports.AlertEvent = exports.AlertRuleStateModel = exports.AlertRule = exports.ActivityLog = exports.ProjectConfigFile = exports.EnvironmentVariable = exports.ProjectEnvironment = exports.CashierSubscriptionItem = exports.CashierSubscription = exports.ProjectTagAssignment = exports.Tag = exports.Invoice = exports.AppMessage = void 0;
17
+ exports.StorageCredentialStatus = exports.StorageCredentialRole = exports.StorageTokenStatus = exports.StorageUploadStatus = exports.StorageBucketStatus = exports.BACKUP_STATUS = exports.SANDBOX_SNAPSHOT_STATUS = exports.SANDBOX_EGRESS_MODE = exports.SANDBOX_DESTROY_REASON = exports.SANDBOX_STATUS = exports.SANDBOX_TEMPLATE = exports.INVOICE_TYPE = exports.INVOICE_PAYMENT_STATUS = exports.INVOICE_STATUS = exports.COLLAB_TOOLBAR_POSITION = exports.COLLAB_THEME = exports.COLLAB_INTEGRATION_TYPE = exports.COLLAB_ANNOTATION_STATUS = exports.NomadDeploymentStatus = exports.DomainTransferStatus = exports.DomainTransferDirection = exports.DomainTransferProvider = exports.DomainRenewalStatus = exports.FrameworkApplicationType = exports.SERVER_PROTOCOL = exports.PROJECT_DISABLED_BY = exports.BUILD_DISABLED_BY = exports.REGION_CONTINENT = exports.LicenseStatus = exports.JobStatus = exports.DatabaseEngine = exports.SCALING_SOURCE = exports.ServiceType = exports.REQUEST_TYPE = exports.PERMISSION_TYPE = exports.DNS_CHANGE_SOURCE = exports.DNS_CHANGE_TYPE = exports.DNS_TYPE = exports.CARD_TYPES = exports.SUBSCRIPTION_STATUS = exports.DrainEventType = exports.LogSource = exports.DrainStatus = exports.DrainType = exports.AlertEventStatus = exports.AlertChannelMode = exports.AlertRuleState = exports.AlertCondition = exports.AlertMetric = exports.PROJECT_STATUS = void 0;
18
+ exports.healthCheckMongo = exports.closeMongo = exports.db = exports.connectToMongo = exports.CONFIG_FILE_VISIBILITY = exports.CouponRedemptionStatus = exports.CouponScope = exports.CouponDiscountType = exports.WorkbenchMode = exports.QUEST_TARGETLESS_REQUIREMENTS = exports.QUEST_CLAIM_REQUIREMENTS = exports.QuestRequirementType = exports.QuestEntity = exports.QuestCriterionType = exports.QuestRewardStatus = exports.RewardType = exports.EligibilityType = exports.ACTION_TO_MILESTONE = exports.QUEST_COUNTABLE_MILESTONES = exports.MilestoneType = exports.QualifyingActionType = exports.XRobotsTag = exports.XContentTypeOptions = exports.XFrameOptions = exports.StorageMigrationStatus = void 0;
19
19
  var user_1 = require("./user");
20
20
  Object.defineProperty(exports, "User", { enumerable: true, get: function () { return __importDefault(user_1).default; } });
21
21
  var project_1 = require("./project");
@@ -155,6 +155,8 @@ var sandbox_image_1 = require("./sandbox-image");
155
155
  Object.defineProperty(exports, "SandboxImage", { enumerable: true, get: function () { return __importDefault(sandbox_image_1).default; } });
156
156
  var sandbox_snapshot_1 = require("./sandbox-snapshot");
157
157
  Object.defineProperty(exports, "SandboxSnapshot", { enumerable: true, get: function () { return __importDefault(sandbox_snapshot_1).default; } });
158
+ var backup_history_1 = require("./backup-history");
159
+ Object.defineProperty(exports, "BackupHistory", { enumerable: true, get: function () { return __importDefault(backup_history_1).default; } });
158
160
  var sandbox_snapshot_usage_segment_1 = require("./sandbox-snapshot-usage-segment");
159
161
  Object.defineProperty(exports, "SandboxSnapshotUsageSegment", { enumerable: true, get: function () { return __importDefault(sandbox_snapshot_usage_segment_1).default; } });
160
162
  var sandbox_usage_segment_1 = require("./sandbox-usage-segment");
@@ -245,6 +247,7 @@ Object.defineProperty(exports, "SANDBOX_STATUS", { enumerable: true, get: functi
245
247
  Object.defineProperty(exports, "SANDBOX_DESTROY_REASON", { enumerable: true, get: function () { return enum_1.SANDBOX_DESTROY_REASON; } });
246
248
  Object.defineProperty(exports, "SANDBOX_EGRESS_MODE", { enumerable: true, get: function () { return enum_1.SANDBOX_EGRESS_MODE; } });
247
249
  Object.defineProperty(exports, "SANDBOX_SNAPSHOT_STATUS", { enumerable: true, get: function () { return enum_1.SANDBOX_SNAPSHOT_STATUS; } });
250
+ Object.defineProperty(exports, "BACKUP_STATUS", { enumerable: true, get: function () { return enum_1.BACKUP_STATUS; } });
248
251
  Object.defineProperty(exports, "StorageBucketStatus", { enumerable: true, get: function () { return enum_1.StorageBucketStatus; } });
249
252
  Object.defineProperty(exports, "StorageUploadStatus", { enumerable: true, get: function () { return enum_1.StorageUploadStatus; } });
250
253
  Object.defineProperty(exports, "StorageTokenStatus", { enumerable: true, get: function () { return enum_1.StorageTokenStatus; } });
@@ -190,6 +190,15 @@ const projectSchema = new mongoose_1.Schema({
190
190
  type: Boolean,
191
191
  default: false,
192
192
  },
193
+ backup_mode: {
194
+ type: String,
195
+ enum: ["automatic", "manual"],
196
+ default: "automatic",
197
+ },
198
+ backup_schedule: {
199
+ type: String,
200
+ default: "0 0 * * * *",
201
+ },
193
202
  free_tier_expires_at: {
194
203
  type: Date,
195
204
  default: null,
@@ -0,0 +1,14 @@
1
+ import { Document, Types } from "mongoose";
2
+ import { BACKUP_STATUS } from "../enum";
3
+ export interface IBackupHistory extends Document {
4
+ project_id: Types.ObjectId;
5
+ user_id: Types.ObjectId;
6
+ team: Types.ObjectId | null;
7
+ status: BACKUP_STATUS;
8
+ trigger: "scheduled" | "manual";
9
+ object_key: string | null;
10
+ size_bytes: number | null;
11
+ failure_reason: string | null;
12
+ created_at: Date;
13
+ updated_at: Date;
14
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -17,6 +17,7 @@ export interface IDbImage extends Document {
17
17
  port: number;
18
18
  volumePath: string;
19
19
  protocol: string;
20
+ tls_enabled: boolean;
20
21
  ha: boolean;
21
22
  workbench: boolean;
22
23
  workbench_mode: WorkbenchMode;
@@ -68,6 +68,7 @@ export type { ISandbox, ISandboxSpecs, ISandboxEgress } from "./sandbox";
68
68
  export type { ISandboxActivity } from "./sandbox-activity";
69
69
  export type { ISandboxImage } from "./sandbox-image";
70
70
  export type { ISandboxSnapshot } from "./sandbox-snapshot";
71
+ export type { IBackupHistory } from "./backup-history";
71
72
  export type { ISandboxSnapshotUsageSegment, ISandboxSnapshotUsageSegmentCosts, } from "./sandbox-snapshot-usage-segment";
72
73
  export type { ISandboxUsageSegment, ISandboxUsageSegmentCurrent, ISandboxUsageSegmentCosts, } from "./sandbox-usage-segment";
73
74
  export type { IVolumeUsageSegment, IVolumeUsageSegmentCosts, } from "./volume-usage-segment";
@@ -28,6 +28,8 @@ export interface IProject extends Document {
28
28
  healthCheckPath?: string;
29
29
  preStartCommand?: string;
30
30
  backupEnabled: boolean;
31
+ backup_mode: "automatic" | "manual";
32
+ backup_schedule: string;
31
33
  http2: boolean;
32
34
  free_tier_expires_at?: Date | null;
33
35
  free_tier_expiry_notified_at?: Date | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brimble/models",
3
- "version": "3.8.104",
3
+ "version": "3.8.106",
4
4
  "description": "Brimble models",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",