@brimble/models 3.8.215 → 3.8.217

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.
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const mongoose_1 = require("mongoose");
4
4
  const autoScalingGroupSchema = new mongoose_1.Schema({
5
+ project: { type: mongoose_1.Schema.Types.ObjectId, ref: "Project", required: false },
5
6
  name: {
6
7
  type: String,
7
8
  required: true,
@@ -0,0 +1,9 @@
1
+ import type { IConfigApply } from "./types/config-apply";
2
+ declare const _default: import("mongoose").Model<IConfigApply, {}, {}, {}, import("mongoose").Document<unknown, {}, IConfigApply, {}, import("mongoose").DefaultSchemaOptions> & IConfigApply & Required<{
3
+ _id: import("mongoose").Types.ObjectId;
4
+ }> & {
5
+ __v: number;
6
+ } & {
7
+ id: string;
8
+ }, any, IConfigApply>;
9
+ export default _default;
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const mongoose_1 = require("mongoose");
4
+ const configApplySchema = new mongoose_1.Schema({
5
+ project: {
6
+ type: mongoose_1.Schema.Types.ObjectId,
7
+ ref: "Project",
8
+ required: true,
9
+ index: true,
10
+ },
11
+ owner: { type: mongoose_1.Schema.Types.ObjectId, ref: "User", required: true },
12
+ workspace: { type: mongoose_1.Schema.Types.ObjectId, ref: "Team" },
13
+ environment: {
14
+ type: mongoose_1.Schema.Types.ObjectId,
15
+ ref: "ProjectEnvironment",
16
+ required: true,
17
+ },
18
+ preview: { type: mongoose_1.Schema.Types.ObjectId, ref: "Preview" },
19
+ log: { type: mongoose_1.Schema.Types.ObjectId, ref: "Log" },
20
+ commit: { type: String, required: true },
21
+ path: { type: String, required: true },
22
+ source: { type: String, required: true },
23
+ plan: { type: mongoose_1.Schema.Types.Mixed, required: true },
24
+ status: {
25
+ type: String,
26
+ enum: [
27
+ "planned",
28
+ "awaiting_approval",
29
+ "applying",
30
+ "applied",
31
+ "failed",
32
+ "rejected",
33
+ ],
34
+ required: true,
35
+ default: "planned",
36
+ },
37
+ results: [
38
+ {
39
+ _id: false,
40
+ step: { type: String, required: true },
41
+ status: {
42
+ type: String,
43
+ enum: ["pending", "running", "succeeded", "failed"],
44
+ required: true,
45
+ },
46
+ message: String,
47
+ },
48
+ ],
49
+ error: String,
50
+ approved_by: { type: mongoose_1.Schema.Types.ObjectId, ref: "User" },
51
+ }, { timestamps: true });
52
+ configApplySchema.index({ workspace: 1, environment: 1, createdAt: -1 });
53
+ exports.default = (0, mongoose_1.model)("ConfigApply", configApplySchema);
@@ -0,0 +1,48 @@
1
+ import { Schema } from "mongoose";
2
+ import type { ConfigManagedFields } from "./types/config-apply";
3
+ export declare const configManagedFieldsSchema: Schema<ConfigManagedFields, import("mongoose").Model<ConfigManagedFields, any, any, any, any, any, ConfigManagedFields>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, ConfigManagedFields, import("mongoose").Document<unknown, {}, ConfigManagedFields, {
4
+ id: string;
5
+ }, import("mongoose").DefaultSchemaOptions> & Omit<ConfigManagedFields & {
6
+ _id: import("mongoose").Types.ObjectId;
7
+ } & {
8
+ __v: number;
9
+ }, "id"> & {
10
+ id: string;
11
+ }, {
12
+ path?: import("mongoose").SchemaDefinitionProperty<string, ConfigManagedFields, import("mongoose").Document<unknown, {}, ConfigManagedFields, {
13
+ id: string;
14
+ }, import("mongoose").DefaultSchemaOptions> & Omit<ConfigManagedFields & {
15
+ _id: import("mongoose").Types.ObjectId;
16
+ } & {
17
+ __v: number;
18
+ }, "id"> & {
19
+ id: string;
20
+ }> | undefined;
21
+ fields?: import("mongoose").SchemaDefinitionProperty<string[], ConfigManagedFields, import("mongoose").Document<unknown, {}, ConfigManagedFields, {
22
+ id: string;
23
+ }, import("mongoose").DefaultSchemaOptions> & Omit<ConfigManagedFields & {
24
+ _id: import("mongoose").Types.ObjectId;
25
+ } & {
26
+ __v: number;
27
+ }, "id"> & {
28
+ id: string;
29
+ }> | undefined;
30
+ commit?: import("mongoose").SchemaDefinitionProperty<string, ConfigManagedFields, import("mongoose").Document<unknown, {}, ConfigManagedFields, {
31
+ id: string;
32
+ }, import("mongoose").DefaultSchemaOptions> & Omit<ConfigManagedFields & {
33
+ _id: import("mongoose").Types.ObjectId;
34
+ } & {
35
+ __v: number;
36
+ }, "id"> & {
37
+ id: string;
38
+ }> | undefined;
39
+ applied_at?: import("mongoose").SchemaDefinitionProperty<Date, ConfigManagedFields, import("mongoose").Document<unknown, {}, ConfigManagedFields, {
40
+ id: string;
41
+ }, import("mongoose").DefaultSchemaOptions> & Omit<ConfigManagedFields & {
42
+ _id: import("mongoose").Types.ObjectId;
43
+ } & {
44
+ __v: number;
45
+ }, "id"> & {
46
+ id: string;
47
+ }> | undefined;
48
+ }, ConfigManagedFields>;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.configManagedFieldsSchema = void 0;
4
+ const mongoose_1 = require("mongoose");
5
+ exports.configManagedFieldsSchema = new mongoose_1.Schema({
6
+ path: { type: String, required: true },
7
+ fields: { type: [String], required: true },
8
+ commit: { type: String, required: true },
9
+ applied_at: { type: Date, required: true },
10
+ }, { _id: false });
@@ -68,6 +68,7 @@ export declare enum CARD_TYPES {
68
68
  VERVE = "VERVE"
69
69
  }
70
70
  export declare enum PROJECT_STATUS {
71
+ AWAITING_CONFIG_APPROVAL = "AWAITING_CONFIG_APPROVAL",
71
72
  INACTIVE = "INACTIVE",
72
73
  ACTIVE = "ACTIVE",
73
74
  INPROGRESS = "INPROGRESS",
@@ -85,6 +85,7 @@ var CARD_TYPES;
85
85
  })(CARD_TYPES || (exports.CARD_TYPES = CARD_TYPES = {}));
86
86
  var PROJECT_STATUS;
87
87
  (function (PROJECT_STATUS) {
88
+ PROJECT_STATUS["AWAITING_CONFIG_APPROVAL"] = "AWAITING_CONFIG_APPROVAL";
88
89
  PROJECT_STATUS["INACTIVE"] = "INACTIVE";
89
90
  PROJECT_STATUS["ACTIVE"] = "ACTIVE";
90
91
  PROJECT_STATUS["INPROGRESS"] = "INPROGRESS";
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export { default as ConfigApply } from "./config-apply";
1
2
  export { default as User } from "./user";
2
3
  export { default as Project, DeletedProject } from "./project";
3
4
  export { default as ProjectAnalytics } from "./project_analytics";
@@ -108,7 +109,7 @@ export { default as AgentDesignSkillRevision } from "./agent-design-skill-revisi
108
109
  export { default as CreditWallet } from "./credit-wallet";
109
110
  export { default as CreditWalletTransaction } from "./credit-wallet-transaction";
110
111
  export { default as WalletFundingPayment } from "./wallet-funding-payment";
111
- export { IUser, IGit, IOrigin, IProject, IDedicatedEgress, IDatabaseProvisionProgress, IProjectAnalytics, IPreview, IProjectConnection, IProjectNetworkSettings, IRatelimit, RatelimitConfig, RateLimitZone, RateLimitMatcher, DistributedRateLimitConfig, IFollowing, IIntegration, IEnv, IServer, IDomain, IToken, IPlatformApiKey, IMember, ITeam, IInstalledIntegration, ILog, ISubscription, ICard, IPaymentMethod, IDns, IDnsChangeLog, IEmailForward, IRole, IWallet, ICreditWallet, ICreditWalletTransaction, IWalletFundingPayment, IDbImage, IDbImageConnection, IJob, ILicense, IPlanConfiguration, IAutoScalingGroup, IComputeChange, IRegion, IVolume, IFramework, BrimbleFrameworkType, ISettings, ILoadBalancerPort, IDomainRenewal, IDomainTransfer, IWebhookCategory, IWebhookEvent, IWebhookSetting, IIntention, IProvider, BuildProviderRoute, BuildSandboxPoolConfig, BuildSandboxConfig, BuildProviderMeta, 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, ISandboxSize, ISandboxSnapshot, IBackupHistory, IDatabaseUser, IRestoreHistory, IWorkerRun, ISandboxSnapshotUsageSegment, ISandboxSnapshotUsageSegmentCosts, ISandboxUsageSegment, ISandboxUsageSegmentCurrent, ISandboxUsageSegmentCosts, IVolumeUsageSegment, IVolumeUsageSegmentCosts, IPgBouncerUsageSegment, IPgBouncerUsageSegmentCosts, IObjectStorageUsageSegment, IObjectStorageUsageSegmentCosts, IObjectStorageUsageUnitsSummary, IIdempotencyRecord, IStorageBucket, IStorageBucketConnection, IStorageObject, IStorageUpload, IStorageToken, IStorageCredential, IStorageMigration, StorageTokenPermission, StorageLifecycleRule, StorageCorsRule, StorageLifecycleRuleTransition, IStreak, IStreakMilestoneRef, IStreakEvent, IStreakDay, IStreakMilestone, IQuestCampaign, IQuestCriterion, IQuestRequirement, IQuestReward, IQuestParticipation, IQuestCriterionProgress, IQuestRewardIssuance, IQuestIssuedReward, ICoupon, ICouponRedemption, ITicket, ICareerRole, IBlogPost, IChangelogEntry, IChangelogCampaign, ChangelogEmailPayloadEntry, IAgentChat, IAgentChatMessage, IAgentChatFile, IAgentChatModel, IAgentWebsite, IAgentWebsiteSnapshot, IAgentWebsiteFileOverlay, IAgentDesignSkill, IAgentDesignSkillRevision, IAgentDesignSkillFile, IAgentDesignSkillInspection, IAgentDesignSkillLicense, } from "./types";
112
+ export { IUser, IGit, IOrigin, IProject, IDedicatedEgress, IDatabaseProvisionProgress, IProjectAnalytics, IPreview, IProjectConnection, IProjectNetworkSettings, IRatelimit, RatelimitConfig, RateLimitZone, RateLimitMatcher, DistributedRateLimitConfig, IFollowing, IIntegration, IEnv, IServer, IDomain, IToken, IPlatformApiKey, IMember, ITeam, IInstalledIntegration, ILog, ISubscription, ICard, IPaymentMethod, IDns, IDnsChangeLog, IEmailForward, IRole, IWallet, ICreditWallet, ICreditWalletTransaction, IWalletFundingPayment, IDbImage, IDbImageConnection, IJob, ILicense, IPlanConfiguration, IAutoScalingGroup, IComputeChange, IRegion, IVolume, IFramework, BrimbleFrameworkType, ISettings, ILoadBalancerPort, IDomainRenewal, IDomainTransfer, IWebhookCategory, IWebhookEvent, IWebhookSetting, IIntention, IProvider, BuildProviderRoute, BuildSandboxPoolConfig, BuildSandboxConfig, BuildProviderMeta, 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, ISandboxSize, ISandboxSnapshot, IBackupHistory, IDatabaseUser, IRestoreHistory, IWorkerRun, ISandboxSnapshotUsageSegment, ISandboxSnapshotUsageSegmentCosts, ISandboxUsageSegment, ISandboxUsageSegmentCurrent, ISandboxUsageSegmentCosts, IVolumeUsageSegment, IVolumeUsageSegmentCosts, IPgBouncerUsageSegment, IPgBouncerUsageSegmentCosts, IObjectStorageUsageSegment, IObjectStorageUsageSegmentCosts, IObjectStorageUsageUnitsSummary, IIdempotencyRecord, IStorageBucket, IStorageBucketConnection, IStorageObject, IStorageUpload, IStorageToken, IStorageCredential, IStorageMigration, StorageTokenPermission, StorageLifecycleRule, StorageCorsRule, StorageLifecycleRuleTransition, IStreak, IStreakMilestoneRef, IStreakEvent, IStreakDay, IStreakMilestone, IQuestCampaign, IQuestCriterion, IQuestRequirement, IQuestReward, IQuestParticipation, IQuestCriterionProgress, IQuestRewardIssuance, IQuestIssuedReward, ICoupon, ICouponRedemption, ITicket, ICareerRole, IBlogPost, IChangelogEntry, IChangelogCampaign, ChangelogEmailPayloadEntry, IAgentChat, IAgentChatMessage, IAgentChatFile, IAgentChatModel, IAgentWebsite, IAgentWebsiteSnapshot, IAgentWebsiteFileOverlay, IAgentDesignSkill, IAgentDesignSkillRevision, IAgentDesignSkillFile, IAgentDesignSkillInspection, IAgentDesignSkillLicense, IConfigApply, ConfigApplyStatus, ConfigFieldDiff, ConfigFieldValue, ConfigManagedFields, ConfigPlan, ConfigResource, ConfigStep, ConfigStepKind, ConfigStepResult, } from "./types";
112
113
  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, EMAIL_FORWARD_STATUS, DNS_MANAGED_BY, ServiceType, BuildUseCase, BuildMethod, BuildProviderType, BuildDispatch, SCALING_SOURCE, DatabaseEngine, DatabasePasswordChangeMode, DatabasePasswordMode, HaMemberRole, DatabaseInsightsScope, DatabaseProvisionPhase, DatabaseProvisionOperation, DatabaseProvisionStep, EmailDeadLetterStatus, JobStatus, LicenseStatus, REGION_CONTINENT, VOLUME_BACKEND, BUILD_DISABLED_BY, PROJECT_DISABLED_BY, SPENDING_LIMIT_ACTION, TEAM_ACTIVATION_STATUS, 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, BACKUP_DESTINATION_TYPE, DatabaseUserPermission, DatabaseUserStatus, WorkerRunStatus, WorkerRunTrigger, RESTORE_STATUS, StorageBucketStatus, StorageUploadStatus, StorageTokenStatus, PlatformApiKeyStatus, 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, AGENT_CHAT_STATUS, AGENT_CHAT_MESSAGE_ROLE, AGENT_WEBSITE_STATUS, AGENT_WEBSITE_SNAPSHOT_STATUS, AGENT_DESIGN_SKILL_STATUS, AGENT_DESIGN_SKILL_TRUST_LEVEL, AGENT_DESIGN_SKILL_VERDICT, WalletOwnerType, WalletCurrency, WalletTransactionDirection, WalletTransactionType, PaymentProviderName, PaymentStatus, } from "./enum";
113
114
  import mongoose from "mongoose";
114
115
  export declare const connectToMongo: (mongoUrl: string, config?: mongoose.ConnectOptions) => Promise<void>;
package/dist/index.js CHANGED
@@ -12,11 +12,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  return (mod && mod.__esModule) ? mod : { "default": mod };
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
- 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.EmailDeadLetter = exports.DbImage = exports.Wallet = exports.Server = exports.Card = exports.Subscription = exports.Log = exports.Role = exports.PaymentMethod = exports.Member = exports.Team = exports.PlatformApiKey = exports.Token = exports.Env = exports.EmailForward = 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.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.StorageBucketConnection = exports.StorageBucket = exports.IdempotencyRecord = exports.ObjectStorageUsageSegment = exports.PgBouncerUsageSegment = exports.VolumeUsageSegment = exports.SandboxUsageSegment = exports.SandboxSnapshotUsageSegment = exports.WorkerRun = exports.RestoreHistory = exports.DatabaseUser = exports.BackupHistory = exports.SandboxSnapshot = exports.SandboxWarmPoolMember = exports.SandboxWarmPool = exports.SandboxSize = 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 = exports.CollabPushSubscription = void 0;
17
- exports.DatabasePasswordChangeMode = exports.DatabaseEngine = exports.SCALING_SOURCE = exports.BuildDispatch = exports.BuildProviderType = exports.BuildMethod = exports.BuildUseCase = exports.ServiceType = exports.DNS_MANAGED_BY = exports.EMAIL_FORWARD_STATUS = 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 = exports.SUBSCRIPTION_PLAN_TYPE = exports.ROLES = exports.SERVER_STATUS = exports.ENVIRONMENT = exports.OAUTH_PERMISSIONS = exports.INTEGRATION_PROVIDERS = exports.INTEGRATION_TYPES = exports.GIT_TYPE = exports.WalletFundingPayment = exports.CreditWalletTransaction = exports.CreditWallet = exports.AgentDesignSkillRevision = exports.AgentDesignSkill = exports.AgentWebsiteFileOverlay = exports.AgentWebsiteSnapshot = exports.AgentWebsite = exports.AgentChatModel = exports.AgentChatFile = exports.AgentChatMessage = exports.AgentChat = exports.ChangelogCampaign = exports.ChangelogEntry = exports.BlogPost = exports.CareerRole = exports.Ticket = void 0;
18
- exports.XContentTypeOptions = exports.XFrameOptions = exports.StorageMigrationStatus = exports.StorageCredentialStatus = exports.StorageCredentialRole = exports.PlatformApiKeyStatus = exports.StorageTokenStatus = exports.StorageUploadStatus = exports.StorageBucketStatus = exports.RESTORE_STATUS = exports.WorkerRunTrigger = exports.WorkerRunStatus = exports.DatabaseUserStatus = exports.DatabaseUserPermission = exports.BACKUP_DESTINATION_TYPE = 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.TEAM_ACTIVATION_STATUS = exports.SPENDING_LIMIT_ACTION = exports.PROJECT_DISABLED_BY = exports.BUILD_DISABLED_BY = exports.VOLUME_BACKEND = exports.REGION_CONTINENT = exports.LicenseStatus = exports.JobStatus = exports.EmailDeadLetterStatus = exports.DatabaseProvisionStep = exports.DatabaseProvisionOperation = exports.DatabaseProvisionPhase = exports.DatabaseInsightsScope = exports.HaMemberRole = exports.DatabasePasswordMode = void 0;
19
- exports.healthCheckMongo = exports.closeMongo = exports.db = exports.connectToMongo = exports.PaymentStatus = exports.PaymentProviderName = exports.WalletTransactionType = exports.WalletTransactionDirection = exports.WalletCurrency = exports.WalletOwnerType = exports.AGENT_DESIGN_SKILL_VERDICT = exports.AGENT_DESIGN_SKILL_TRUST_LEVEL = exports.AGENT_DESIGN_SKILL_STATUS = exports.AGENT_WEBSITE_SNAPSHOT_STATUS = exports.AGENT_WEBSITE_STATUS = exports.AGENT_CHAT_MESSAGE_ROLE = exports.AGENT_CHAT_STATUS = 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 = void 0;
15
+ 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.EmailDeadLetter = exports.DbImage = exports.Wallet = exports.Server = exports.Card = exports.Subscription = exports.Log = exports.Role = exports.PaymentMethod = exports.Member = exports.Team = exports.PlatformApiKey = exports.Token = exports.Env = exports.EmailForward = 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 = exports.ConfigApply = void 0;
16
+ 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.StorageBucketConnection = exports.StorageBucket = exports.IdempotencyRecord = exports.ObjectStorageUsageSegment = exports.PgBouncerUsageSegment = exports.VolumeUsageSegment = exports.SandboxUsageSegment = exports.SandboxSnapshotUsageSegment = exports.WorkerRun = exports.RestoreHistory = exports.DatabaseUser = exports.BackupHistory = exports.SandboxSnapshot = exports.SandboxWarmPoolMember = exports.SandboxWarmPool = exports.SandboxSize = 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 = exports.CollabPushSubscription = exports.CollabShareToken = void 0;
17
+ exports.DatabaseEngine = exports.SCALING_SOURCE = exports.BuildDispatch = exports.BuildProviderType = exports.BuildMethod = exports.BuildUseCase = exports.ServiceType = exports.DNS_MANAGED_BY = exports.EMAIL_FORWARD_STATUS = 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 = exports.SUBSCRIPTION_PLAN_TYPE = exports.ROLES = exports.SERVER_STATUS = exports.ENVIRONMENT = exports.OAUTH_PERMISSIONS = exports.INTEGRATION_PROVIDERS = exports.INTEGRATION_TYPES = exports.GIT_TYPE = exports.WalletFundingPayment = exports.CreditWalletTransaction = exports.CreditWallet = exports.AgentDesignSkillRevision = exports.AgentDesignSkill = exports.AgentWebsiteFileOverlay = exports.AgentWebsiteSnapshot = exports.AgentWebsite = exports.AgentChatModel = exports.AgentChatFile = exports.AgentChatMessage = exports.AgentChat = exports.ChangelogCampaign = exports.ChangelogEntry = exports.BlogPost = exports.CareerRole = exports.Ticket = exports.CouponRedemption = void 0;
18
+ exports.XFrameOptions = exports.StorageMigrationStatus = exports.StorageCredentialStatus = exports.StorageCredentialRole = exports.PlatformApiKeyStatus = exports.StorageTokenStatus = exports.StorageUploadStatus = exports.StorageBucketStatus = exports.RESTORE_STATUS = exports.WorkerRunTrigger = exports.WorkerRunStatus = exports.DatabaseUserStatus = exports.DatabaseUserPermission = exports.BACKUP_DESTINATION_TYPE = 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.TEAM_ACTIVATION_STATUS = exports.SPENDING_LIMIT_ACTION = exports.PROJECT_DISABLED_BY = exports.BUILD_DISABLED_BY = exports.VOLUME_BACKEND = exports.REGION_CONTINENT = exports.LicenseStatus = exports.JobStatus = exports.EmailDeadLetterStatus = exports.DatabaseProvisionStep = exports.DatabaseProvisionOperation = exports.DatabaseProvisionPhase = exports.DatabaseInsightsScope = exports.HaMemberRole = exports.DatabasePasswordMode = exports.DatabasePasswordChangeMode = void 0;
19
+ exports.healthCheckMongo = exports.closeMongo = exports.db = exports.connectToMongo = exports.PaymentStatus = exports.PaymentProviderName = exports.WalletTransactionType = exports.WalletTransactionDirection = exports.WalletCurrency = exports.WalletOwnerType = exports.AGENT_DESIGN_SKILL_VERDICT = exports.AGENT_DESIGN_SKILL_TRUST_LEVEL = exports.AGENT_DESIGN_SKILL_STATUS = exports.AGENT_WEBSITE_SNAPSHOT_STATUS = exports.AGENT_WEBSITE_STATUS = exports.AGENT_CHAT_MESSAGE_ROLE = exports.AGENT_CHAT_STATUS = 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;
20
+ var config_apply_1 = require("./config-apply");
21
+ Object.defineProperty(exports, "ConfigApply", { enumerable: true, get: function () { return __importDefault(config_apply_1).default; } });
20
22
  var user_1 = require("./user");
21
23
  Object.defineProperty(exports, "User", { enumerable: true, get: function () { return __importDefault(user_1).default; } });
22
24
  var project_1 = require("./project");
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DeletedProject = void 0;
4
+ const config_managed_fields_1 = require("../config-managed-fields");
4
5
  const mongoose_1 = require("mongoose");
5
6
  const enum_1 = require("../enum");
6
7
  const runsCompute = function () {
@@ -15,6 +16,7 @@ const minimumComputeSpec = (label, minimum, unit) => ({
15
16
  message: `${label} must be at least ${minimum}${unit} for projects that run compute`,
16
17
  });
17
18
  const projectSchema = new mongoose_1.Schema({
19
+ managed_by_config: { type: config_managed_fields_1.configManagedFieldsSchema, required: false },
18
20
  name: {
19
21
  type: String,
20
22
  required: true,
@@ -598,7 +600,10 @@ projectSchema.index({ free_tier_expires_at: 1, serviceType: 1, status: 1 }, {
598
600
  });
599
601
  projectSchema.index({ team: 1, project_environment: 1, name: 1 }, {
600
602
  unique: true,
601
- partialFilterExpression: { team: { $type: "objectId" }, isDeleted: { $ne: true } },
603
+ partialFilterExpression: {
604
+ team: { $type: "objectId" },
605
+ isDeleted: { $ne: true },
606
+ },
602
607
  name: "team_env_project_name",
603
608
  });
604
609
  projectSchema.index({ user_id: 1, project_environment: 1, name: 1 }, {
package/dist/storage.js CHANGED
@@ -1,9 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.StorageBucketConnection = exports.StorageMigration = exports.StorageCredential = exports.StorageToken = exports.StorageUpload = exports.StorageObject = exports.StorageBucket = void 0;
4
+ const config_managed_fields_1 = require("./config-managed-fields");
4
5
  const mongoose_1 = require("mongoose");
5
6
  const enum_1 = require("./enum");
6
7
  const storageBucketSchema = new mongoose_1.Schema({
8
+ managed_by_config: { type: config_managed_fields_1.configManagedFieldsSchema, required: false },
7
9
  name: { type: String, required: true, trim: true },
8
10
  project: {
9
11
  type: mongoose_1.Schema.Types.ObjectId,
@@ -5,6 +5,7 @@ import { ITeam } from "./team";
5
5
  export interface IAutoScalingGroup extends Document {
6
6
  _id: Types.ObjectId;
7
7
  name: string;
8
+ project?: Types.ObjectId;
8
9
  replicas: number;
9
10
  user_id?: IUser;
10
11
  team_id?: ITeam;
@@ -0,0 +1,65 @@
1
+ import { Document, Types } from "mongoose";
2
+ export type ConfigStepKind = "noop" | "safe" | "create" | "confirm" | "blocked";
3
+ export type ConfigResource = "environment" | "bucket" | "database" | "service";
4
+ export type ConfigFieldValue = string | number | boolean | null | ConfigFieldValue[] | {
5
+ [key: string]: ConfigFieldValue;
6
+ };
7
+ export type ConfigFieldDiff = {
8
+ path: string;
9
+ before?: ConfigFieldValue;
10
+ after?: ConfigFieldValue;
11
+ kind: ConfigStepKind;
12
+ reason: string;
13
+ };
14
+ export type ConfigStep = {
15
+ id: string;
16
+ resource: ConfigResource;
17
+ name: string;
18
+ kind: ConfigStepKind;
19
+ changes: ConfigFieldDiff[];
20
+ reason: string;
21
+ };
22
+ export type ConfigPlan = {
23
+ steps: ConfigStep[];
24
+ orphaned: {
25
+ resource: ConfigResource;
26
+ name: string;
27
+ }[];
28
+ stateHash: string;
29
+ errors: {
30
+ path: string;
31
+ line: number;
32
+ message: string;
33
+ }[];
34
+ };
35
+ export type ConfigManagedFields = {
36
+ path: string;
37
+ fields: string[];
38
+ commit: string;
39
+ applied_at: Date;
40
+ };
41
+ export type ConfigApplyStatus = "planned" | "awaiting_approval" | "applying" | "applied" | "failed" | "rejected";
42
+ export type ConfigStepResult = {
43
+ step: string;
44
+ status: "pending" | "running" | "succeeded" | "failed";
45
+ message?: string;
46
+ };
47
+ export interface IConfigApply extends Document {
48
+ _id: Types.ObjectId;
49
+ project: Types.ObjectId;
50
+ owner: Types.ObjectId;
51
+ workspace?: Types.ObjectId;
52
+ environment: Types.ObjectId;
53
+ preview?: Types.ObjectId;
54
+ log?: Types.ObjectId;
55
+ commit: string;
56
+ path: string;
57
+ source: string;
58
+ plan: ConfigPlan;
59
+ status: ConfigApplyStatus;
60
+ results: ConfigStepResult[];
61
+ error?: string;
62
+ approved_by?: Types.ObjectId;
63
+ createdAt: Date;
64
+ updatedAt: Date;
65
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -108,3 +108,4 @@ export type { IAgentWebsiteSnapshot } from "./agent-website-snapshot";
108
108
  export type { IAgentWebsiteFileOverlay } from "./agent-website-file-overlay";
109
109
  export type { IAgentDesignSkill } from "./agent-design-skill";
110
110
  export type { IAgentDesignSkillFile, IAgentDesignSkillInspection, IAgentDesignSkillLicense, IAgentDesignSkillRevision, } from "./agent-design-skill-revision";
111
+ export * from "./config-apply";
@@ -1,4 +1,18 @@
1
1
  "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
2
16
  Object.defineProperty(exports, "__esModule", { value: true });
3
17
  exports.BuildUseCase = exports.BuildProviderType = exports.BuildMethod = exports.BuildDispatch = void 0;
4
18
  var provider_1 = require("./provider");
@@ -6,3 +20,4 @@ Object.defineProperty(exports, "BuildDispatch", { enumerable: true, get: functio
6
20
  Object.defineProperty(exports, "BuildMethod", { enumerable: true, get: function () { return provider_1.BuildMethod; } });
7
21
  Object.defineProperty(exports, "BuildProviderType", { enumerable: true, get: function () { return provider_1.BuildProviderType; } });
8
22
  Object.defineProperty(exports, "BuildUseCase", { enumerable: true, get: function () { return provider_1.BuildUseCase; } });
23
+ __exportStar(require("./config-apply"), exports);
@@ -1,3 +1,4 @@
1
+ import type { ConfigManagedFields } from "../config-apply";
1
2
  import { Document, Types } from "mongoose";
2
3
  import { BACKUP_DESTINATION_TYPE, DatabaseProvisionOperation, DatabaseProvisionPhase, DatabaseProvisionStep, GIT_TYPE, HaMemberRole, PROJECT_DISABLED_BY, PROJECT_STATUS, ServiceType } from "../../enum";
3
4
  import { IDomain } from "../domain";
@@ -82,6 +83,7 @@ export interface IDatabaseProvisionProgress {
82
83
  updatedAt: Date;
83
84
  }
84
85
  export interface IProject extends Document {
86
+ managed_by_config?: ConfigManagedFields;
85
87
  name: string;
86
88
  healthCheckPath?: string;
87
89
  preStartCommand?: string;
@@ -1,3 +1,4 @@
1
+ import type { ConfigManagedFields } from "./config-apply";
1
2
  import { Document, Types } from "mongoose";
2
3
  import { IProjectEnvironment } from "./project-environment";
3
4
  import { StorageBucketStatus, StorageCredentialRole, StorageCredentialStatus, StorageMigrationStatus, StorageTokenStatus, StorageUploadStatus } from "../enum";
@@ -21,6 +22,7 @@ export type StorageLifecycleRuleTransition = {
21
22
  storageClass?: string;
22
23
  };
23
24
  export interface IStorageBucket extends Document {
25
+ managed_by_config?: ConfigManagedFields;
24
26
  name: string;
25
27
  project?: Types.ObjectId;
26
28
  project_environment?: IProjectEnvironment | Types.ObjectId;
@@ -36,8 +38,8 @@ export interface IStorageBucket extends Document {
36
38
  storage_decreased_by: number;
37
39
  reserved_bytes: number;
38
40
  quota: number;
39
- cors_rules: StorageCorsRule[];
40
- lifecycle_rules: StorageLifecycleRule[];
41
+ cors_rules?: StorageCorsRule[];
42
+ lifecycle_rules?: StorageLifecycleRule[];
41
43
  status: StorageBucketStatus;
42
44
  starred: boolean;
43
45
  custom_hosts?: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brimble/models",
3
- "version": "3.8.215",
3
+ "version": "3.8.217",
4
4
  "description": "Brimble models",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",