@brimble/models 3.8.96 → 3.8.98
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/index.d.ts +2 -1
- package/dist/index.js +5 -3
- package/dist/pgbouncer-usage-segment.d.ts +9 -0
- package/dist/pgbouncer-usage-segment.js +43 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/pgbouncer-usage-segment.d.ts +15 -0
- package/dist/types/pgbouncer-usage-segment.js +2 -0
- package/dist/types/volume-usage-segment.d.ts +3 -0
- package/dist/types/volume.d.ts +1 -0
- package/dist/volume-usage-segment.js +14 -0
- package/dist/volume.js +1 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -69,6 +69,7 @@ export { default as SandboxSnapshot } from "./sandbox-snapshot";
|
|
|
69
69
|
export { default as SandboxSnapshotUsageSegment } from "./sandbox-snapshot-usage-segment";
|
|
70
70
|
export { default as SandboxUsageSegment } from "./sandbox-usage-segment";
|
|
71
71
|
export { default as VolumeUsageSegment } from "./volume-usage-segment";
|
|
72
|
+
export { default as PgBouncerUsageSegment } from "./pgbouncer-usage-segment";
|
|
72
73
|
export { default as ObjectStorageUsageSegment } from "./object-storage-usage-segment";
|
|
73
74
|
export { default as IdempotencyRecord } from "./idempotency";
|
|
74
75
|
export { StorageBucket, StorageObject, StorageUpload, StorageToken, StorageCredential, StorageMigration } from "./storage";
|
|
@@ -81,7 +82,7 @@ export { default as QuestParticipation } from "./quest-participation";
|
|
|
81
82
|
export { default as QuestRewardIssuance } from "./quest-reward-issuance";
|
|
82
83
|
export { default as Coupon } from "./coupon";
|
|
83
84
|
export { default as CouponRedemption } from "./coupon-redemption";
|
|
84
|
-
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, IActivityLog, IAlertRule, IAlertRuleState, IAlertEvent, IAlertNotificationResult, IDrain, IProjectDrainSubscription, IOwnershipTransfer, ISandbox, ISandboxSpecs, ISandboxActivity, ISandboxImage, ISandboxSnapshot, ISandboxSnapshotUsageSegment, ISandboxSnapshotUsageSegmentCosts, ISandboxUsageSegment, ISandboxUsageSegmentCurrent, ISandboxUsageSegmentCosts, IVolumeUsageSegment, IVolumeUsageSegmentCosts, 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";
|
|
85
|
+
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, 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";
|
|
85
86
|
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 } from "./enum";
|
|
86
87
|
import mongoose from "mongoose";
|
|
87
88
|
export declare const connectToMongo: (mongoUrl: string, config?: mongoose.ConnectOptions) => Promise<void>;
|
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.
|
|
17
|
-
exports.
|
|
18
|
-
exports.healthCheckMongo = exports.closeMongo = exports.db = exports.connectToMongo = 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 = void 0;
|
|
16
|
+
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.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.EnvironmentVariable = exports.ProjectEnvironment = exports.CashierSubscriptionItem = exports.CashierSubscription = exports.ProjectTagAssignment = exports.Tag = exports.Invoice = exports.AppMessage = void 0;
|
|
17
|
+
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 = 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 = void 0;
|
|
18
|
+
exports.healthCheckMongo = exports.closeMongo = exports.db = exports.connectToMongo = 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;
|
|
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");
|
|
@@ -159,6 +159,8 @@ var sandbox_usage_segment_1 = require("./sandbox-usage-segment");
|
|
|
159
159
|
Object.defineProperty(exports, "SandboxUsageSegment", { enumerable: true, get: function () { return __importDefault(sandbox_usage_segment_1).default; } });
|
|
160
160
|
var volume_usage_segment_1 = require("./volume-usage-segment");
|
|
161
161
|
Object.defineProperty(exports, "VolumeUsageSegment", { enumerable: true, get: function () { return __importDefault(volume_usage_segment_1).default; } });
|
|
162
|
+
var pgbouncer_usage_segment_1 = require("./pgbouncer-usage-segment");
|
|
163
|
+
Object.defineProperty(exports, "PgBouncerUsageSegment", { enumerable: true, get: function () { return __importDefault(pgbouncer_usage_segment_1).default; } });
|
|
162
164
|
var object_storage_usage_segment_1 = require("./object-storage-usage-segment");
|
|
163
165
|
Object.defineProperty(exports, "ObjectStorageUsageSegment", { enumerable: true, get: function () { return __importDefault(object_storage_usage_segment_1).default; } });
|
|
164
166
|
var idempotency_1 = require("./idempotency");
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IPgBouncerUsageSegment } from "./types/pgbouncer-usage-segment";
|
|
2
|
+
declare const _default: import("mongoose").Model<IPgBouncerUsageSegment, {}, {}, {}, import("mongoose").Document<unknown, {}, IPgBouncerUsageSegment, {}, import("mongoose").DefaultSchemaOptions> & IPgBouncerUsageSegment & Required<{
|
|
3
|
+
_id: import("mongoose").Types.ObjectId;
|
|
4
|
+
}> & {
|
|
5
|
+
__v: number;
|
|
6
|
+
} & {
|
|
7
|
+
id: string;
|
|
8
|
+
}, any, IPgBouncerUsageSegment>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mongoose_1 = require("mongoose");
|
|
4
|
+
const pgbouncerUsageSegmentSchema = new mongoose_1.Schema({
|
|
5
|
+
project_id: {
|
|
6
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
7
|
+
ref: "Project",
|
|
8
|
+
required: true,
|
|
9
|
+
index: true,
|
|
10
|
+
},
|
|
11
|
+
user_id: {
|
|
12
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
13
|
+
ref: "User",
|
|
14
|
+
required: true,
|
|
15
|
+
index: true,
|
|
16
|
+
},
|
|
17
|
+
team_id: {
|
|
18
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
19
|
+
ref: "Team",
|
|
20
|
+
default: null,
|
|
21
|
+
index: true,
|
|
22
|
+
},
|
|
23
|
+
costs: {
|
|
24
|
+
startDate: { type: Date, required: true },
|
|
25
|
+
endDate: { type: Date, default: null },
|
|
26
|
+
},
|
|
27
|
+
billed: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: false,
|
|
30
|
+
index: true,
|
|
31
|
+
},
|
|
32
|
+
}, {
|
|
33
|
+
timestamps: true,
|
|
34
|
+
});
|
|
35
|
+
pgbouncerUsageSegmentSchema.index({ user_id: 1, billed: 1, "costs.endDate": 1 });
|
|
36
|
+
pgbouncerUsageSegmentSchema.index({ team_id: 1, billed: 1, "costs.endDate": 1 });
|
|
37
|
+
pgbouncerUsageSegmentSchema.index({ project_id: 1, "costs.endDate": 1 });
|
|
38
|
+
pgbouncerUsageSegmentSchema.index({ project_id: 1 }, {
|
|
39
|
+
unique: true,
|
|
40
|
+
partialFilterExpression: { "costs.endDate": null },
|
|
41
|
+
name: "unique_open_segment_per_pgbouncer_project",
|
|
42
|
+
});
|
|
43
|
+
exports.default = (0, mongoose_1.model)("PgBouncerUsageSegment", pgbouncerUsageSegmentSchema, "pgbouncer_usage_segments");
|
package/dist/types/index.d.ts
CHANGED
|
@@ -70,6 +70,7 @@ export type { ISandboxSnapshot } from "./sandbox-snapshot";
|
|
|
70
70
|
export type { ISandboxSnapshotUsageSegment, ISandboxSnapshotUsageSegmentCosts, } from "./sandbox-snapshot-usage-segment";
|
|
71
71
|
export type { ISandboxUsageSegment, ISandboxUsageSegmentCurrent, ISandboxUsageSegmentCosts, } from "./sandbox-usage-segment";
|
|
72
72
|
export type { IVolumeUsageSegment, IVolumeUsageSegmentCosts, } from "./volume-usage-segment";
|
|
73
|
+
export type { IPgBouncerUsageSegment, IPgBouncerUsageSegmentCosts, } from "./pgbouncer-usage-segment";
|
|
73
74
|
export type { IObjectStorageUsageSegment, IObjectStorageUsageSegmentCosts, IObjectStorageUsageUnitsSummary, } from "./object-storage-usage-segment";
|
|
74
75
|
export type { IIdempotencyRecord } from "./idempotency";
|
|
75
76
|
export type { IStreak, IStreakMilestoneRef } from "./streak";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Document, Types } from "mongoose";
|
|
2
|
+
export interface IPgBouncerUsageSegmentCosts {
|
|
3
|
+
startDate: Date;
|
|
4
|
+
endDate: Date | null;
|
|
5
|
+
}
|
|
6
|
+
export interface IPgBouncerUsageSegment extends Document {
|
|
7
|
+
_id: Types.ObjectId;
|
|
8
|
+
project_id: Types.ObjectId;
|
|
9
|
+
user_id: Types.ObjectId;
|
|
10
|
+
team_id: Types.ObjectId | null;
|
|
11
|
+
costs: IPgBouncerUsageSegmentCosts;
|
|
12
|
+
billed: boolean;
|
|
13
|
+
createdAt: Date;
|
|
14
|
+
updatedAt: Date;
|
|
15
|
+
}
|
|
@@ -9,6 +9,9 @@ export interface IVolumeUsageSegment extends Document {
|
|
|
9
9
|
user_id: Types.ObjectId;
|
|
10
10
|
team_id: Types.ObjectId | null;
|
|
11
11
|
size_gb: number;
|
|
12
|
+
volume_name?: string | null;
|
|
13
|
+
project_id?: Types.ObjectId | null;
|
|
14
|
+
project_name?: string | null;
|
|
12
15
|
costs: IVolumeUsageSegmentCosts;
|
|
13
16
|
billed: boolean;
|
|
14
17
|
createdAt: Date;
|
package/dist/types/volume.d.ts
CHANGED
|
@@ -23,6 +23,20 @@ const volumeUsageSegmentSchema = new mongoose_1.Schema({
|
|
|
23
23
|
type: Number,
|
|
24
24
|
default: 0,
|
|
25
25
|
},
|
|
26
|
+
volume_name: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: null,
|
|
29
|
+
},
|
|
30
|
+
project_id: {
|
|
31
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
32
|
+
ref: "Project",
|
|
33
|
+
default: null,
|
|
34
|
+
index: true,
|
|
35
|
+
},
|
|
36
|
+
project_name: {
|
|
37
|
+
type: String,
|
|
38
|
+
default: null,
|
|
39
|
+
},
|
|
26
40
|
costs: {
|
|
27
41
|
startDate: { type: Date, required: true },
|
|
28
42
|
endDate: { type: Date, default: null },
|
package/dist/volume.js
CHANGED