@brimble/models 3.8.51 → 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/enum/index.d.ts +16 -0
- package/dist/enum/index.js +20 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +10 -3
- package/dist/plan_configuration.js +1 -0
- package/dist/project-network-settings.d.ts +9 -0
- package/dist/project-network-settings.js +34 -0
- package/dist/ratelimit.d.ts +9 -0
- package/dist/ratelimit.js +36 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/plan_configuration.d.ts +1 -0
- package/dist/types/project-network-settings.d.ts +28 -0
- package/dist/types/project-network-settings.js +2 -0
- package/dist/types/ratelimit.d.ts +41 -0
- package/dist/types/ratelimit.js +2 -0
- package/package.json +1 -1
package/dist/enum/index.d.ts
CHANGED
|
@@ -276,3 +276,19 @@ export declare enum StorageMigrationStatus {
|
|
|
276
276
|
Failed = "failed",
|
|
277
277
|
Cancelled = "cancelled"
|
|
278
278
|
}
|
|
279
|
+
export declare enum XFrameOptions {
|
|
280
|
+
Deny = "DENY",
|
|
281
|
+
SameOrigin = "SAMEORIGIN",
|
|
282
|
+
Disabled = "disabled"
|
|
283
|
+
}
|
|
284
|
+
export declare enum XContentTypeOptions {
|
|
285
|
+
NoSniff = "nosniff",
|
|
286
|
+
Disabled = "disabled"
|
|
287
|
+
}
|
|
288
|
+
export declare enum XRobotsTag {
|
|
289
|
+
IndexFollow = "index, follow",
|
|
290
|
+
NoIndexNoFollow = "noindex, nofollow",
|
|
291
|
+
NoIndexFollow = "noindex, follow",
|
|
292
|
+
IndexNoFollow = "index, nofollow",
|
|
293
|
+
Disabled = "disabled"
|
|
294
|
+
}
|
package/dist/enum/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
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 = exports.NomadDeploymentStatus = exports.DomainTransferStatus = exports.DomainTransferDirection = exports.DomainTransferProvider = exports.DomainRenewalStatus = exports.FrameworkApplicationType = exports.SCALING_METRIC = exports.SCALING_STRATEGY = exports.LicenseStatus = exports.JobStatus = exports.DatabaseEngine = exports.ServiceType = exports.REGION_CONTINENT = exports.PERMISSION_TYPE = exports.ROLES = exports.DNS_TYPE = exports.SERVER_STATUS = exports.OAUTH_PERMISSIONS = exports.SUBSCRIPTION_PLAN_TYPE = exports.SUBSCRIPTION_STATUS = exports.PROJECT_STATUS = exports.CARD_TYPES = exports.INTEGRATION_PROVIDERS = exports.INTEGRATION_TYPES = exports.ENVIRONMENT = exports.REQUEST_TYPE = exports.BUILD_DISABLED_BY = exports.SERVER_PROTOCOL = exports.GIT_TYPE = void 0;
|
|
3
|
+
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 = exports.NomadDeploymentStatus = exports.DomainTransferStatus = exports.DomainTransferDirection = exports.DomainTransferProvider = exports.DomainRenewalStatus = exports.FrameworkApplicationType = exports.SCALING_METRIC = exports.SCALING_STRATEGY = exports.LicenseStatus = exports.JobStatus = exports.DatabaseEngine = exports.ServiceType = exports.REGION_CONTINENT = exports.PERMISSION_TYPE = exports.ROLES = exports.DNS_TYPE = exports.SERVER_STATUS = exports.OAUTH_PERMISSIONS = exports.SUBSCRIPTION_PLAN_TYPE = exports.SUBSCRIPTION_STATUS = exports.PROJECT_STATUS = exports.CARD_TYPES = exports.INTEGRATION_PROVIDERS = exports.INTEGRATION_TYPES = exports.ENVIRONMENT = exports.REQUEST_TYPE = exports.BUILD_DISABLED_BY = exports.SERVER_PROTOCOL = exports.GIT_TYPE = void 0;
|
|
4
4
|
var GIT_TYPE;
|
|
5
5
|
(function (GIT_TYPE) {
|
|
6
6
|
GIT_TYPE["GITHUB"] = "GITHUB";
|
|
@@ -325,3 +325,22 @@ var StorageMigrationStatus;
|
|
|
325
325
|
StorageMigrationStatus["Failed"] = "failed";
|
|
326
326
|
StorageMigrationStatus["Cancelled"] = "cancelled";
|
|
327
327
|
})(StorageMigrationStatus || (exports.StorageMigrationStatus = StorageMigrationStatus = {}));
|
|
328
|
+
var XFrameOptions;
|
|
329
|
+
(function (XFrameOptions) {
|
|
330
|
+
XFrameOptions["Deny"] = "DENY";
|
|
331
|
+
XFrameOptions["SameOrigin"] = "SAMEORIGIN";
|
|
332
|
+
XFrameOptions["Disabled"] = "disabled";
|
|
333
|
+
})(XFrameOptions || (exports.XFrameOptions = XFrameOptions = {}));
|
|
334
|
+
var XContentTypeOptions;
|
|
335
|
+
(function (XContentTypeOptions) {
|
|
336
|
+
XContentTypeOptions["NoSniff"] = "nosniff";
|
|
337
|
+
XContentTypeOptions["Disabled"] = "disabled";
|
|
338
|
+
})(XContentTypeOptions || (exports.XContentTypeOptions = XContentTypeOptions = {}));
|
|
339
|
+
var XRobotsTag;
|
|
340
|
+
(function (XRobotsTag) {
|
|
341
|
+
XRobotsTag["IndexFollow"] = "index, follow";
|
|
342
|
+
XRobotsTag["NoIndexNoFollow"] = "noindex, nofollow";
|
|
343
|
+
XRobotsTag["NoIndexFollow"] = "noindex, follow";
|
|
344
|
+
XRobotsTag["IndexNoFollow"] = "index, nofollow";
|
|
345
|
+
XRobotsTag["Disabled"] = "disabled";
|
|
346
|
+
})(XRobotsTag || (exports.XRobotsTag = XRobotsTag = {}));
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ export { default as Project, DeletedProject } from "./project";
|
|
|
3
3
|
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
|
+
export { default as ProjectNetworkSettings } from "./project-network-settings";
|
|
7
|
+
export { default as Ratelimit } from "./ratelimit";
|
|
6
8
|
export { default as Following } from "./following";
|
|
7
9
|
export { default as Integration } from "./integration";
|
|
8
10
|
export { default as Domain } from "./domain";
|
|
@@ -63,8 +65,8 @@ export { default as VolumeUsageSegment } from "./volume-usage-segment";
|
|
|
63
65
|
export { default as ObjectStorageUsageSegment } from "./object-storage-usage-segment";
|
|
64
66
|
export { default as IdempotencyRecord } from "./idempotency";
|
|
65
67
|
export { StorageBucket, StorageObject, StorageUpload, StorageToken, StorageCredential, StorageMigration } from "./storage";
|
|
66
|
-
export { IUser, IGit, IProject, IProjectAnalytics, IPreview, IProjectConnection, 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";
|
|
67
|
-
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, } from "./enum";
|
|
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";
|
|
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";
|
|
68
70
|
import mongoose from "mongoose";
|
|
69
71
|
export declare const connectToMongo: (mongoUrl: string, config?: mongoose.ConnectOptions) => Promise<void>;
|
|
70
72
|
export declare const db: mongoose.Connection;
|
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.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 = 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");
|
|
@@ -26,6 +26,10 @@ var preview_1 = require("./project/preview");
|
|
|
26
26
|
Object.defineProperty(exports, "Preview", { enumerable: true, get: function () { return __importDefault(preview_1).default; } });
|
|
27
27
|
var connection_1 = require("./project/connection");
|
|
28
28
|
Object.defineProperty(exports, "ProjectConnection", { enumerable: true, get: function () { return __importDefault(connection_1).default; } });
|
|
29
|
+
var project_network_settings_1 = require("./project-network-settings");
|
|
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; } });
|
|
29
33
|
var following_1 = require("./following");
|
|
30
34
|
Object.defineProperty(exports, "Following", { enumerable: true, get: function () { return __importDefault(following_1).default; } });
|
|
31
35
|
var integration_1 = require("./integration");
|
|
@@ -196,6 +200,9 @@ Object.defineProperty(exports, "StorageTokenStatus", { enumerable: true, get: fu
|
|
|
196
200
|
Object.defineProperty(exports, "StorageCredentialRole", { enumerable: true, get: function () { return enum_1.StorageCredentialRole; } });
|
|
197
201
|
Object.defineProperty(exports, "StorageCredentialStatus", { enumerable: true, get: function () { return enum_1.StorageCredentialStatus; } });
|
|
198
202
|
Object.defineProperty(exports, "StorageMigrationStatus", { enumerable: true, get: function () { return enum_1.StorageMigrationStatus; } });
|
|
203
|
+
Object.defineProperty(exports, "XFrameOptions", { enumerable: true, get: function () { return enum_1.XFrameOptions; } });
|
|
204
|
+
Object.defineProperty(exports, "XContentTypeOptions", { enumerable: true, get: function () { return enum_1.XContentTypeOptions; } });
|
|
205
|
+
Object.defineProperty(exports, "XRobotsTag", { enumerable: true, get: function () { return enum_1.XRobotsTag; } });
|
|
199
206
|
const mongoose_1 = __importDefault(require("mongoose"));
|
|
200
207
|
const utils_1 = require("@brimble/utils");
|
|
201
208
|
const connectToMongo = (mongoUrl, config) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -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 { IProjectNetworkSettings } from "./types";
|
|
2
|
+
declare const _default: import("mongoose").Model<IProjectNetworkSettings, {}, {}, {}, import("mongoose").Document<unknown, {}, IProjectNetworkSettings, {}, import("mongoose").DefaultSchemaOptions> & IProjectNetworkSettings & Required<{
|
|
3
|
+
_id: import("mongoose").Types.ObjectId;
|
|
4
|
+
}> & {
|
|
5
|
+
__v: number;
|
|
6
|
+
} & {
|
|
7
|
+
id: string;
|
|
8
|
+
}, any, IProjectNetworkSettings>;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mongoose_1 = require("mongoose");
|
|
4
|
+
const enum_1 = require("./enum");
|
|
5
|
+
const projectNetworkSettingsSchema = new mongoose_1.Schema({
|
|
6
|
+
project: {
|
|
7
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
8
|
+
ref: "Project",
|
|
9
|
+
required: true,
|
|
10
|
+
unique: true,
|
|
11
|
+
index: true,
|
|
12
|
+
},
|
|
13
|
+
cache: {
|
|
14
|
+
purgeOnDeploy: { type: Boolean, default: true },
|
|
15
|
+
bypassCache: { type: Boolean, default: false },
|
|
16
|
+
},
|
|
17
|
+
responseRules: {
|
|
18
|
+
xFrameOptions: { type: String, enum: Object.values(enum_1.XFrameOptions), default: enum_1.XFrameOptions.Deny },
|
|
19
|
+
xContentTypeOptions: { type: String, enum: Object.values(enum_1.XContentTypeOptions), default: enum_1.XContentTypeOptions.NoSniff },
|
|
20
|
+
xRobotsTag: { type: String, enum: Object.values(enum_1.XRobotsTag), default: enum_1.XRobotsTag.IndexFollow },
|
|
21
|
+
hstsEnabled: { type: Boolean, default: false },
|
|
22
|
+
markdownForAgents: { type: Boolean, default: false },
|
|
23
|
+
},
|
|
24
|
+
firewall: {
|
|
25
|
+
pathBlocking: { type: Boolean, default: true },
|
|
26
|
+
browserIntegrityCheck: { type: Boolean, default: true },
|
|
27
|
+
underAttackMode: { type: Boolean, default: false },
|
|
28
|
+
},
|
|
29
|
+
cloudflare: {
|
|
30
|
+
lastSyncedAt: { type: Date },
|
|
31
|
+
syncError: { type: String },
|
|
32
|
+
},
|
|
33
|
+
}, { timestamps: true, collection: "project_network_settings" });
|
|
34
|
+
exports.default = (0, mongoose_1.model)("ProjectNetworkSettings", projectNetworkSettingsSchema);
|
|
@@ -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
|
@@ -25,6 +25,8 @@ export type { IProvider } from "./provider";
|
|
|
25
25
|
export type { IProject } from "./project";
|
|
26
26
|
export type { IProjectAnalytics } from "./project_analytics";
|
|
27
27
|
export type { IProjectConnection } from "./project/connection";
|
|
28
|
+
export type { IProjectNetworkSettings } from "./project-network-settings";
|
|
29
|
+
export type { IRatelimit, RatelimitConfig, RateLimitZone, RateLimitMatcher, DistributedRateLimitConfig, } from "./ratelimit";
|
|
28
30
|
export type { IPreview } from "./project/preview";
|
|
29
31
|
export type { IRegion } from "./region";
|
|
30
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,28 @@
|
|
|
1
|
+
import { Document } from "mongoose";
|
|
2
|
+
import { XContentTypeOptions, XFrameOptions, XRobotsTag } from "../enum";
|
|
3
|
+
import { IProject } from "./project";
|
|
4
|
+
export interface IProjectNetworkSettings extends Document {
|
|
5
|
+
project: IProject;
|
|
6
|
+
cache: {
|
|
7
|
+
purgeOnDeploy: boolean;
|
|
8
|
+
bypassCache: boolean;
|
|
9
|
+
};
|
|
10
|
+
responseRules: {
|
|
11
|
+
xFrameOptions: XFrameOptions;
|
|
12
|
+
xContentTypeOptions: XContentTypeOptions;
|
|
13
|
+
xRobotsTag: XRobotsTag;
|
|
14
|
+
hstsEnabled: boolean;
|
|
15
|
+
markdownForAgents: boolean;
|
|
16
|
+
};
|
|
17
|
+
firewall: {
|
|
18
|
+
pathBlocking: boolean;
|
|
19
|
+
browserIntegrityCheck: boolean;
|
|
20
|
+
underAttackMode: boolean;
|
|
21
|
+
};
|
|
22
|
+
cloudflare: {
|
|
23
|
+
lastSyncedAt?: Date;
|
|
24
|
+
syncError?: string;
|
|
25
|
+
};
|
|
26
|
+
createdAt: Date;
|
|
27
|
+
updatedAt: Date;
|
|
28
|
+
}
|
|
@@ -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
|
+
}
|