@brimble/models 3.8.52 → 3.8.53
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/plan_configuration.js +1 -0
- package/dist/ratelimit.d.ts +9 -0
- package/dist/ratelimit.js +36 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/plan_configuration.d.ts +1 -0
- package/dist/types/ratelimit.d.ts +41 -0
- package/dist/types/ratelimit.js +2 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export { default as ProjectAnalytics } from "./project_analytics";
|
|
|
4
4
|
export { default as Preview } from "./project/preview";
|
|
5
5
|
export { default as ProjectConnection } from "./project/connection";
|
|
6
6
|
export { default as ProjectNetworkSettings } from "./project-network-settings";
|
|
7
|
+
export { default as Ratelimit } from "./ratelimit";
|
|
7
8
|
export { default as Following } from "./following";
|
|
8
9
|
export { default as Integration } from "./integration";
|
|
9
10
|
export { default as Domain } from "./domain";
|
|
@@ -64,7 +65,7 @@ export { default as VolumeUsageSegment } from "./volume-usage-segment";
|
|
|
64
65
|
export { default as ObjectStorageUsageSegment } from "./object-storage-usage-segment";
|
|
65
66
|
export { default as IdempotencyRecord } from "./idempotency";
|
|
66
67
|
export { StorageBucket, StorageObject, StorageUpload, StorageToken, StorageCredential, StorageMigration } from "./storage";
|
|
67
|
-
export { IUser, IGit, IProject, IProjectAnalytics, IPreview, IProjectConnection, IProjectNetworkSettings, IFollowing, IIntegration, IEnv, IServer, IDomain, IToken, IMember, ITeam, IInstalledIntegration, ILog, ISubscription, ICard, IDns, 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, 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 } from "./types";
|
|
68
|
+
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, IDns, 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, 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 } from "./types";
|
|
68
69
|
export { GIT_TYPE, INTEGRATION_TYPES, INTEGRATION_PROVIDERS, OAUTH_PERMISSIONS, ENVIRONMENT, SERVER_STATUS, ROLES, SUBSCRIPTION_PLAN_TYPE, PROJECT_STATUS, SUBSCRIPTION_STATUS, CARD_TYPES, DNS_TYPE, PERMISSION_TYPE, REQUEST_TYPE, ServiceType, DatabaseEngine, JobStatus, LicenseStatus, REGION_CONTINENT, BUILD_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_SNAPSHOT_STATUS, StorageBucketStatus, StorageUploadStatus, StorageTokenStatus, StorageCredentialRole, StorageCredentialStatus, StorageMigrationStatus, XFrameOptions, XContentTypeOptions, XRobotsTag, } from "./enum";
|
|
69
70
|
import mongoose from "mongoose";
|
|
70
71
|
export declare const connectToMongo: (mongoUrl: string, config?: mongoose.ConnectOptions) => Promise<void>;
|
package/dist/index.js
CHANGED
|
@@ -12,9 +12,9 @@ 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.
|
|
16
|
-
exports.
|
|
17
|
-
exports.healthCheckMongo = exports.closeMongo = exports.db = exports.connectToMongo = exports.XRobotsTag = exports.XContentTypeOptions = exports.XFrameOptions = exports.StorageMigrationStatus = exports.StorageCredentialStatus = exports.StorageCredentialRole = exports.StorageTokenStatus = exports.StorageUploadStatus = exports.StorageBucketStatus = exports.SANDBOX_SNAPSHOT_STATUS = 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 = void 0;
|
|
15
|
+
exports.Invoice = exports.AppMessage = 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.Permission = exports.Member = exports.Team = exports.Token = exports.Env = 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.NomadDeploymentStatus = exports.DomainTransferStatus = exports.DomainTransferDirection = exports.DomainTransferProvider = exports.DomainRenewalStatus = exports.FrameworkApplicationType = exports.SERVER_PROTOCOL = exports.BUILD_DISABLED_BY = exports.REGION_CONTINENT = exports.LicenseStatus = exports.JobStatus = exports.DatabaseEngine = exports.ServiceType = exports.REQUEST_TYPE = exports.PERMISSION_TYPE = exports.DNS_TYPE = exports.CARD_TYPES = exports.SUBSCRIPTION_STATUS = 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.StorageMigration = exports.StorageCredential = exports.StorageToken = exports.StorageUpload = exports.StorageObject = exports.StorageBucket = exports.IdempotencyRecord = exports.ObjectStorageUsageSegment = exports.VolumeUsageSegment = exports.SandboxUsageSegment = exports.SandboxSnapshotUsageSegment = exports.SandboxSnapshot = exports.SandboxImage = exports.SandboxActivity = exports.Sandbox = exports.OwnershipTransfer = exports.ActivityLog = exports.EnvironmentVariable = exports.ProjectEnvironment = exports.CashierSubscriptionItem = exports.CashierSubscription = exports.ProjectTagAssignment = exports.Tag = void 0;
|
|
17
|
+
exports.healthCheckMongo = exports.closeMongo = exports.db = exports.connectToMongo = exports.XRobotsTag = exports.XContentTypeOptions = exports.XFrameOptions = exports.StorageMigrationStatus = exports.StorageCredentialStatus = exports.StorageCredentialRole = exports.StorageTokenStatus = exports.StorageUploadStatus = exports.StorageBucketStatus = exports.SANDBOX_SNAPSHOT_STATUS = 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 = void 0;
|
|
18
18
|
var user_1 = require("./user");
|
|
19
19
|
Object.defineProperty(exports, "User", { enumerable: true, get: function () { return __importDefault(user_1).default; } });
|
|
20
20
|
var project_1 = require("./project");
|
|
@@ -28,6 +28,8 @@ var connection_1 = require("./project/connection");
|
|
|
28
28
|
Object.defineProperty(exports, "ProjectConnection", { enumerable: true, get: function () { return __importDefault(connection_1).default; } });
|
|
29
29
|
var project_network_settings_1 = require("./project-network-settings");
|
|
30
30
|
Object.defineProperty(exports, "ProjectNetworkSettings", { enumerable: true, get: function () { return __importDefault(project_network_settings_1).default; } });
|
|
31
|
+
var ratelimit_1 = require("./ratelimit");
|
|
32
|
+
Object.defineProperty(exports, "Ratelimit", { enumerable: true, get: function () { return __importDefault(ratelimit_1).default; } });
|
|
31
33
|
var following_1 = require("./following");
|
|
32
34
|
Object.defineProperty(exports, "Following", { enumerable: true, get: function () { return __importDefault(following_1).default; } });
|
|
33
35
|
var integration_1 = require("./integration");
|
|
@@ -11,6 +11,7 @@ const PlanConfigurationSchema = new mongoose_1.Schema({
|
|
|
11
11
|
preview_comments: { type: Boolean, default: false },
|
|
12
12
|
analytics: { type: Boolean, default: false },
|
|
13
13
|
build_minutes: { type: Number, required: true },
|
|
14
|
+
rate_limit_enabled: { type: Boolean, default: false },
|
|
14
15
|
pull_request_preview: { type: Boolean, default: false, required: false },
|
|
15
16
|
log_retention: { type: Number, required: true },
|
|
16
17
|
bandwidth: { type: Number, required: true },
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IRatelimit } from "./types";
|
|
2
|
+
declare const _default: import("mongoose").Model<IRatelimit, {}, {}, {}, import("mongoose").Document<unknown, {}, IRatelimit, {}, import("mongoose").DefaultSchemaOptions> & IRatelimit & Required<{
|
|
3
|
+
_id: import("mongoose").Types.ObjectId;
|
|
4
|
+
}> & {
|
|
5
|
+
__v: number;
|
|
6
|
+
} & {
|
|
7
|
+
id: string;
|
|
8
|
+
}, any, IRatelimit>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mongoose_1 = require("mongoose");
|
|
4
|
+
const ratelimitSchema = new mongoose_1.Schema({
|
|
5
|
+
project: { type: mongoose_1.Schema.Types.ObjectId, ref: "Project", required: true },
|
|
6
|
+
enabled: { type: Boolean, default: true },
|
|
7
|
+
zones: {
|
|
8
|
+
type: [
|
|
9
|
+
{
|
|
10
|
+
name: { type: String, required: true },
|
|
11
|
+
key: { type: String, required: true },
|
|
12
|
+
window: { type: String, required: true },
|
|
13
|
+
events: { type: Number, required: true },
|
|
14
|
+
matcher: {
|
|
15
|
+
methods: [{ type: String }],
|
|
16
|
+
paths: [{ type: String }],
|
|
17
|
+
},
|
|
18
|
+
ipv4Prefix: Number,
|
|
19
|
+
ipv6Prefix: Number,
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
default: [],
|
|
23
|
+
},
|
|
24
|
+
distributed: {
|
|
25
|
+
enabled: { type: Boolean, default: false },
|
|
26
|
+
readInterval: String,
|
|
27
|
+
writeInterval: String,
|
|
28
|
+
purgeAge: String,
|
|
29
|
+
},
|
|
30
|
+
logKey: { type: Boolean, default: false },
|
|
31
|
+
disableMetrics: { type: Boolean, default: false },
|
|
32
|
+
jitter: Number,
|
|
33
|
+
sweepInterval: String,
|
|
34
|
+
}, { timestamps: true });
|
|
35
|
+
ratelimitSchema.index({ project: 1 }, { unique: true });
|
|
36
|
+
exports.default = (0, mongoose_1.model)("Ratelimit", ratelimitSchema, "ratelimits");
|
package/dist/types/index.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ export type { IProject } from "./project";
|
|
|
26
26
|
export type { IProjectAnalytics } from "./project_analytics";
|
|
27
27
|
export type { IProjectConnection } from "./project/connection";
|
|
28
28
|
export type { IProjectNetworkSettings } from "./project-network-settings";
|
|
29
|
+
export type { IRatelimit, RatelimitConfig, RateLimitZone, RateLimitMatcher, DistributedRateLimitConfig, } from "./ratelimit";
|
|
29
30
|
export type { IPreview } from "./project/preview";
|
|
30
31
|
export type { IRegion } from "./region";
|
|
31
32
|
export type { IRole } from "./role";
|
|
@@ -8,6 +8,7 @@ export interface IPlanConfiguration extends Document {
|
|
|
8
8
|
slack_support: boolean;
|
|
9
9
|
autoscaling_enabled: boolean;
|
|
10
10
|
concurrent_builds: number;
|
|
11
|
+
rate_limit_enabled: boolean;
|
|
11
12
|
project_limit: number;
|
|
12
13
|
deploy_private_organization: boolean;
|
|
13
14
|
preview_comments: boolean;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Document, Types } from "mongoose";
|
|
2
|
+
export type RateLimitMatcher = {
|
|
3
|
+
methods?: string[];
|
|
4
|
+
paths?: string[];
|
|
5
|
+
};
|
|
6
|
+
export type RateLimitZone = {
|
|
7
|
+
name: string;
|
|
8
|
+
key: string;
|
|
9
|
+
window: string;
|
|
10
|
+
events: number;
|
|
11
|
+
matcher?: RateLimitMatcher;
|
|
12
|
+
ipv4Prefix?: number;
|
|
13
|
+
ipv6Prefix?: number;
|
|
14
|
+
};
|
|
15
|
+
export type DistributedRateLimitConfig = {
|
|
16
|
+
enabled: boolean;
|
|
17
|
+
readInterval?: string;
|
|
18
|
+
writeInterval?: string;
|
|
19
|
+
purgeAge?: string;
|
|
20
|
+
};
|
|
21
|
+
export type RatelimitConfig = {
|
|
22
|
+
enabled: boolean;
|
|
23
|
+
zones: RateLimitZone[];
|
|
24
|
+
distributed?: DistributedRateLimitConfig;
|
|
25
|
+
logKey?: boolean;
|
|
26
|
+
disableMetrics?: boolean;
|
|
27
|
+
jitter?: number;
|
|
28
|
+
sweepInterval?: string;
|
|
29
|
+
};
|
|
30
|
+
export interface IRatelimit extends Document {
|
|
31
|
+
project: Types.ObjectId;
|
|
32
|
+
enabled: boolean;
|
|
33
|
+
zones: RateLimitZone[];
|
|
34
|
+
distributed?: DistributedRateLimitConfig;
|
|
35
|
+
logKey: boolean;
|
|
36
|
+
disableMetrics: boolean;
|
|
37
|
+
jitter?: number;
|
|
38
|
+
sweepInterval?: string;
|
|
39
|
+
createdAt: Date;
|
|
40
|
+
updatedAt: Date;
|
|
41
|
+
}
|