@brimble/models 3.3.4 → 3.3.6
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/domain/renewal.d.ts +30 -0
- package/dist/domain/renewal.js +21 -0
- package/dist/enum/index.d.ts +5 -0
- package/dist/enum/index.js +7 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +5 -2
- package/dist/settings.js +4 -0
- package/dist/types/domain/renewal.d.ts +10 -0
- package/dist/types/domain/renewal.js +2 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/webhook-category.d.ts +4 -0
- package/dist/types/webhook-category.js +2 -0
- package/dist/types/webhook-event.d.ts +7 -0
- package/dist/types/webhook-event.js +2 -0
- package/dist/types/webhook-setting.d.ts +12 -0
- package/dist/types/webhook-setting.js +2 -0
- package/dist/webhook-event.d.ts +30 -0
- package/dist/webhook-event.js +19 -0
- package/dist/webhook-setting.d.ts +30 -0
- package/dist/webhook-setting.js +37 -0
- package/domain/renewal.ts +25 -0
- package/enum/index.ts +6 -0
- package/index.ts +9 -1
- package/package.json +1 -1
- package/settings.ts +4 -0
- package/types/domain/renewal.ts +11 -0
- package/types/index.ts +4 -0
- package/types/webhook-category.ts +5 -0
- package/types/webhook-event.ts +8 -0
- package/types/webhook-setting.ts +13 -0
- package/webhook-category +11 -0
- package/webhook-event.ts +20 -0
- package/webhook-setting.ts +35 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose" />
|
|
25
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
26
|
+
import { IDomainRenewal } from "../types";
|
|
27
|
+
declare const _default: import("mongoose").Model<IDomainRenewal, {}, {}, {}, import("mongoose").Document<unknown, {}, IDomainRenewal> & IDomainRenewal & {
|
|
28
|
+
_id: import("mongoose").Types.ObjectId;
|
|
29
|
+
}, any>;
|
|
30
|
+
export default _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mongoose_1 = require("mongoose");
|
|
4
|
+
const enum_1 = require("../enum");
|
|
5
|
+
const domainRenewalSchema = new mongoose_1.Schema({
|
|
6
|
+
domain_id: {
|
|
7
|
+
ref: "Domain",
|
|
8
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
9
|
+
required: true,
|
|
10
|
+
},
|
|
11
|
+
status: {
|
|
12
|
+
type: String,
|
|
13
|
+
required: true,
|
|
14
|
+
enum: Object.values(enum_1.DomainRenewalStatus)
|
|
15
|
+
},
|
|
16
|
+
attempts: {
|
|
17
|
+
type: Number,
|
|
18
|
+
required: true,
|
|
19
|
+
},
|
|
20
|
+
}, { timestamps: true });
|
|
21
|
+
exports.default = (0, mongoose_1.model)("DomainRenewal", domainRenewalSchema, "domain_renewals");
|
package/dist/enum/index.d.ts
CHANGED
package/dist/enum/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
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.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";
|
|
@@ -183,3 +183,9 @@ var FrameworkApplicationType;
|
|
|
183
183
|
FrameworkApplicationType["Static"] = "static";
|
|
184
184
|
FrameworkApplicationType["Backend"] = "backend";
|
|
185
185
|
})(FrameworkApplicationType = exports.FrameworkApplicationType || (exports.FrameworkApplicationType = {}));
|
|
186
|
+
var DomainRenewalStatus;
|
|
187
|
+
(function (DomainRenewalStatus) {
|
|
188
|
+
DomainRenewalStatus["Pending"] = "pending";
|
|
189
|
+
DomainRenewalStatus["Completed"] = "completed";
|
|
190
|
+
DomainRenewalStatus["Failed"] = "failed";
|
|
191
|
+
})(DomainRenewalStatus = exports.DomainRenewalStatus || (exports.DomainRenewalStatus = {}));
|
package/dist/index.d.ts
CHANGED
|
@@ -29,8 +29,9 @@ export { default as Volume } from "./volume";
|
|
|
29
29
|
export { default as Framework } from "./framework";
|
|
30
30
|
export { default as Settings } from "./settings";
|
|
31
31
|
export { default as LoadBalancerPort } from "./load-balancer-port";
|
|
32
|
-
export {
|
|
33
|
-
export {
|
|
32
|
+
export { default as DomainRenewal } from "./domain/renewal";
|
|
33
|
+
export { IUser, IGit, IProject, 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, IWebhookCategory, IWebhookEvent, IWebhookSetting } from "./types";
|
|
34
|
+
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, } from "./enum";
|
|
34
35
|
import mongoose from "mongoose";
|
|
35
36
|
export declare const connectToMongo: (mongoUrl: string, config?: mongoose.ConnectOptions) => Promise<void>;
|
|
36
37
|
export declare const db: mongoose.Connection;
|
package/dist/index.js
CHANGED
|
@@ -12,8 +12,8 @@ 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.closeMongo = exports.db = exports.connectToMongo = exports.FrameworkApplicationType = exports.SERVER_PROTOCOL = exports.BUILD_DISABLED_BY = exports.REGION_CONTINENT = void 0;
|
|
15
|
+
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.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.ProjectConnection = exports.Preview = exports.DeletedProject = exports.Project = exports.User = void 0;
|
|
16
|
+
exports.closeMongo = exports.db = exports.connectToMongo = exports.DomainRenewalStatus = exports.FrameworkApplicationType = exports.SERVER_PROTOCOL = exports.BUILD_DISABLED_BY = exports.REGION_CONTINENT = exports.LicenseStatus = void 0;
|
|
17
17
|
var user_1 = require("./user");
|
|
18
18
|
Object.defineProperty(exports, "User", { enumerable: true, get: function () { return __importDefault(user_1).default; } });
|
|
19
19
|
var project_1 = require("./project");
|
|
@@ -77,6 +77,8 @@ var settings_1 = require("./settings");
|
|
|
77
77
|
Object.defineProperty(exports, "Settings", { enumerable: true, get: function () { return __importDefault(settings_1).default; } });
|
|
78
78
|
var load_balancer_port_1 = require("./load-balancer-port");
|
|
79
79
|
Object.defineProperty(exports, "LoadBalancerPort", { enumerable: true, get: function () { return __importDefault(load_balancer_port_1).default; } });
|
|
80
|
+
var renewal_1 = require("./domain/renewal");
|
|
81
|
+
Object.defineProperty(exports, "DomainRenewal", { enumerable: true, get: function () { return __importDefault(renewal_1).default; } });
|
|
80
82
|
var enum_1 = require("./enum");
|
|
81
83
|
Object.defineProperty(exports, "GIT_TYPE", { enumerable: true, get: function () { return enum_1.GIT_TYPE; } });
|
|
82
84
|
Object.defineProperty(exports, "INTEGRATION_TYPES", { enumerable: true, get: function () { return enum_1.INTEGRATION_TYPES; } });
|
|
@@ -100,6 +102,7 @@ Object.defineProperty(exports, "REGION_CONTINENT", { enumerable: true, get: func
|
|
|
100
102
|
Object.defineProperty(exports, "BUILD_DISABLED_BY", { enumerable: true, get: function () { return enum_1.BUILD_DISABLED_BY; } });
|
|
101
103
|
Object.defineProperty(exports, "SERVER_PROTOCOL", { enumerable: true, get: function () { return enum_1.SERVER_PROTOCOL; } });
|
|
102
104
|
Object.defineProperty(exports, "FrameworkApplicationType", { enumerable: true, get: function () { return enum_1.FrameworkApplicationType; } });
|
|
105
|
+
Object.defineProperty(exports, "DomainRenewalStatus", { enumerable: true, get: function () { return enum_1.DomainRenewalStatus; } });
|
|
103
106
|
const mongoose_1 = __importDefault(require("mongoose"));
|
|
104
107
|
const utils_1 = require("@brimble/utils");
|
|
105
108
|
const connectToMongo = (mongoUrl, config) => __awaiter(void 0, void 0, void 0, function* () {
|
package/dist/settings.js
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Document } from "mongoose";
|
|
2
|
+
import { IDomain } from "../";
|
|
3
|
+
import { DomainRenewalStatus } from "../../enum";
|
|
4
|
+
export interface IDomainRenewal extends Document {
|
|
5
|
+
domain_id: IDomain;
|
|
6
|
+
status: DomainRenewalStatus;
|
|
7
|
+
attempts: number;
|
|
8
|
+
createdAt: Date;
|
|
9
|
+
updatedAt: Date;
|
|
10
|
+
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -31,3 +31,7 @@ export { IVolume } from "./volume";
|
|
|
31
31
|
export { IFramework, BrimbleFrameworkType } from "./framework";
|
|
32
32
|
export { ISettings } from "./settings";
|
|
33
33
|
export { ILoadBalancerPort } from "./load-balancer-port";
|
|
34
|
+
export { IDomainRenewal } from "./domain/renewal";
|
|
35
|
+
export { IWebhookSetting } from "./webhook-setting";
|
|
36
|
+
export { IWebhookEvent } from "./webhook-event";
|
|
37
|
+
export { IWebhookCategory } from "./webhook-category";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Document } from "mongoose";
|
|
2
|
+
import { IWebhookEvent } from "./webhook-event";
|
|
3
|
+
import { ISubscription } from "./subscription";
|
|
4
|
+
import { IUser } from "./user";
|
|
5
|
+
export interface IWebhookSetting extends Document {
|
|
6
|
+
user_id: IUser;
|
|
7
|
+
subscription_id: ISubscription;
|
|
8
|
+
webhookUrl: string;
|
|
9
|
+
discordUrl: string;
|
|
10
|
+
slackUrl: string;
|
|
11
|
+
events: IWebhookEvent[];
|
|
12
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose" />
|
|
25
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
26
|
+
import { IWebhookEvent } from "./types/webhook-event";
|
|
27
|
+
declare const _default: import("mongoose").Model<IWebhookEvent, {}, {}, {}, import("mongoose").Document<unknown, {}, IWebhookEvent> & IWebhookEvent & {
|
|
28
|
+
_id: import("mongoose").Types.ObjectId;
|
|
29
|
+
}, any>;
|
|
30
|
+
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mongoose_1 = require("mongoose");
|
|
4
|
+
const webhookEventSchema = new mongoose_1.Schema({
|
|
5
|
+
name: {
|
|
6
|
+
type: String,
|
|
7
|
+
required: true,
|
|
8
|
+
},
|
|
9
|
+
category: {
|
|
10
|
+
ref: "WebhookCategory",
|
|
11
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
description: {
|
|
15
|
+
type: String,
|
|
16
|
+
required: true,
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
exports.default = (0, mongoose_1.model)("WebhookEvent", webhookEventSchema, "webhook_event");
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/// <reference types="mongoose/types/aggregate" />
|
|
2
|
+
/// <reference types="mongoose/types/callback" />
|
|
3
|
+
/// <reference types="mongoose/types/collection" />
|
|
4
|
+
/// <reference types="mongoose/types/connection" />
|
|
5
|
+
/// <reference types="mongoose/types/cursor" />
|
|
6
|
+
/// <reference types="mongoose/types/document" />
|
|
7
|
+
/// <reference types="mongoose/types/error" />
|
|
8
|
+
/// <reference types="mongoose/types/expressions" />
|
|
9
|
+
/// <reference types="mongoose/types/helpers" />
|
|
10
|
+
/// <reference types="mongoose/types/middlewares" />
|
|
11
|
+
/// <reference types="mongoose/types/indexes" />
|
|
12
|
+
/// <reference types="mongoose/types/models" />
|
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions" />
|
|
14
|
+
/// <reference types="mongoose/types/pipelinestage" />
|
|
15
|
+
/// <reference types="mongoose/types/populate" />
|
|
16
|
+
/// <reference types="mongoose/types/query" />
|
|
17
|
+
/// <reference types="mongoose/types/schemaoptions" />
|
|
18
|
+
/// <reference types="mongoose/types/schematypes" />
|
|
19
|
+
/// <reference types="mongoose/types/session" />
|
|
20
|
+
/// <reference types="mongoose/types/types" />
|
|
21
|
+
/// <reference types="mongoose/types/utility" />
|
|
22
|
+
/// <reference types="mongoose/types/validation" />
|
|
23
|
+
/// <reference types="mongoose/types/virtuals" />
|
|
24
|
+
/// <reference types="mongoose" />
|
|
25
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
26
|
+
import { IWebhookSetting } from "./types/webhook-setting";
|
|
27
|
+
declare const _default: import("mongoose").Model<IWebhookSetting, {}, {}, {}, import("mongoose").Document<unknown, {}, IWebhookSetting> & IWebhookSetting & {
|
|
28
|
+
_id: import("mongoose").Types.ObjectId;
|
|
29
|
+
}, any>;
|
|
30
|
+
export default _default;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const mongoose_1 = require("mongoose");
|
|
7
|
+
const webhook_event_1 = __importDefault(require("./webhook-event"));
|
|
8
|
+
const webhookSettingSchema = new mongoose_1.Schema({
|
|
9
|
+
user_id: {
|
|
10
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
11
|
+
ref: "User",
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
subscription_id: {
|
|
15
|
+
type: mongoose_1.Schema.Types.ObjectId,
|
|
16
|
+
ref: "Subscription",
|
|
17
|
+
required: true,
|
|
18
|
+
},
|
|
19
|
+
webhookUrl: {
|
|
20
|
+
type: String,
|
|
21
|
+
required: true,
|
|
22
|
+
},
|
|
23
|
+
discordUrl: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: false,
|
|
26
|
+
},
|
|
27
|
+
slackUrl: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: false,
|
|
30
|
+
},
|
|
31
|
+
events: {
|
|
32
|
+
type: [mongoose_1.Schema.Types.ObjectId],
|
|
33
|
+
ref: webhook_event_1.default,
|
|
34
|
+
default: [],
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
exports.default = (0, mongoose_1.model)("WebhookSetting", webhookSettingSchema, "webhook_settings");
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { model, Schema } from "mongoose";
|
|
2
|
+
import { IDomainRenewal } from "../types";
|
|
3
|
+
import { DomainRenewalStatus } from "../enum";
|
|
4
|
+
|
|
5
|
+
const domainRenewalSchema = new Schema(
|
|
6
|
+
{
|
|
7
|
+
domain_id: {
|
|
8
|
+
ref: "Domain",
|
|
9
|
+
type: Schema.Types.ObjectId,
|
|
10
|
+
required: true,
|
|
11
|
+
},
|
|
12
|
+
status: {
|
|
13
|
+
type: String,
|
|
14
|
+
required: true,
|
|
15
|
+
enum: Object.values(DomainRenewalStatus)
|
|
16
|
+
},
|
|
17
|
+
attempts: {
|
|
18
|
+
type: Number,
|
|
19
|
+
required: true,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
{ timestamps: true },
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
export default model<IDomainRenewal>("DomainRenewal", domainRenewalSchema, "domain_renewals");
|
package/enum/index.ts
CHANGED
package/index.ts
CHANGED
|
@@ -29,6 +29,9 @@ export { default as Volume } from "./volume";
|
|
|
29
29
|
export { default as Framework } from "./framework";
|
|
30
30
|
export { default as Settings } from "./settings";
|
|
31
31
|
export { default as LoadBalancerPort } from "./load-balancer-port";
|
|
32
|
+
export { default as DomainRenewal } from "./domain/renewal";
|
|
33
|
+
|
|
34
|
+
|
|
32
35
|
|
|
33
36
|
export {
|
|
34
37
|
IUser,
|
|
@@ -64,7 +67,11 @@ export {
|
|
|
64
67
|
IFramework,
|
|
65
68
|
BrimbleFrameworkType,
|
|
66
69
|
ISettings,
|
|
67
|
-
ILoadBalancerPort
|
|
70
|
+
ILoadBalancerPort,
|
|
71
|
+
IDomainRenewal,
|
|
72
|
+
IWebhookCategory,
|
|
73
|
+
IWebhookEvent,
|
|
74
|
+
IWebhookSetting
|
|
68
75
|
} from "./types";
|
|
69
76
|
export {
|
|
70
77
|
GIT_TYPE,
|
|
@@ -89,6 +96,7 @@ export {
|
|
|
89
96
|
BUILD_DISABLED_BY,
|
|
90
97
|
SERVER_PROTOCOL,
|
|
91
98
|
FrameworkApplicationType,
|
|
99
|
+
DomainRenewalStatus,
|
|
92
100
|
} from "./enum";
|
|
93
101
|
|
|
94
102
|
import mongoose from "mongoose";
|
package/package.json
CHANGED
package/settings.ts
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Document } from "mongoose";
|
|
2
|
+
import { IDomain } from "../";
|
|
3
|
+
import { DomainRenewalStatus } from "../../enum";
|
|
4
|
+
|
|
5
|
+
export interface IDomainRenewal extends Document {
|
|
6
|
+
domain_id: IDomain;
|
|
7
|
+
status: DomainRenewalStatus;
|
|
8
|
+
attempts: number;
|
|
9
|
+
createdAt: Date;
|
|
10
|
+
updatedAt: Date;
|
|
11
|
+
}
|
package/types/index.ts
CHANGED
|
@@ -31,3 +31,7 @@ export { IVolume } from "./volume";
|
|
|
31
31
|
export { IFramework, BrimbleFrameworkType } from "./framework";
|
|
32
32
|
export { ISettings } from "./settings";
|
|
33
33
|
export { ILoadBalancerPort } from "./load-balancer-port";
|
|
34
|
+
export { IDomainRenewal } from "./domain/renewal";
|
|
35
|
+
export { IWebhookSetting } from "./webhook-setting";
|
|
36
|
+
export { IWebhookEvent } from "./webhook-event";
|
|
37
|
+
export { IWebhookCategory } from "./webhook-category";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Document } from "mongoose";
|
|
2
|
+
import { IWebhookEvent } from "./webhook-event";
|
|
3
|
+
import { ISubscription } from "./subscription";
|
|
4
|
+
import { IUser } from "./user";
|
|
5
|
+
|
|
6
|
+
export interface IWebhookSetting extends Document {
|
|
7
|
+
user_id: IUser;
|
|
8
|
+
subscription_id: ISubscription;
|
|
9
|
+
webhookUrl: string;
|
|
10
|
+
discordUrl: string;
|
|
11
|
+
slackUrl: string;
|
|
12
|
+
events: IWebhookEvent[];
|
|
13
|
+
}
|
package/webhook-category
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { model, Schema } from "mongoose";
|
|
2
|
+
import { IWebhookCategory } from "./types/webhook-category";
|
|
3
|
+
|
|
4
|
+
const webhookCategorySchema: Schema = new Schema({
|
|
5
|
+
category: {
|
|
6
|
+
type: String,
|
|
7
|
+
required: true,
|
|
8
|
+
}
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export default model<IWebhookCategory>("WebhookCategory", webhookCategorySchema, "webhook_category");
|
package/webhook-event.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { model, Schema } from "mongoose";
|
|
2
|
+
import { IWebhookEvent } from "./types/webhook-event";
|
|
3
|
+
|
|
4
|
+
const webhookEventSchema: Schema = new Schema({
|
|
5
|
+
name: {
|
|
6
|
+
type: String,
|
|
7
|
+
required: true,
|
|
8
|
+
},
|
|
9
|
+
category: {
|
|
10
|
+
ref: "WebhookCategory",
|
|
11
|
+
type: Schema.Types.ObjectId,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
description: {
|
|
15
|
+
type: String,
|
|
16
|
+
required: true,
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
export default model<IWebhookEvent>("WebhookEvent", webhookEventSchema, "webhook_event");
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { model, Schema } from "mongoose";
|
|
2
|
+
import { IWebhookSetting } from "./types/webhook-setting";
|
|
3
|
+
import WebhookEvent from "./webhook-event";
|
|
4
|
+
|
|
5
|
+
const webhookSettingSchema: Schema = new Schema({
|
|
6
|
+
user_id: {
|
|
7
|
+
type: Schema.Types.ObjectId,
|
|
8
|
+
ref: "User",
|
|
9
|
+
required: true,
|
|
10
|
+
},
|
|
11
|
+
subscription_id: {
|
|
12
|
+
type: Schema.Types.ObjectId,
|
|
13
|
+
ref: "Subscription",
|
|
14
|
+
required: true,
|
|
15
|
+
},
|
|
16
|
+
webhookUrl: {
|
|
17
|
+
type: String,
|
|
18
|
+
required: true,
|
|
19
|
+
},
|
|
20
|
+
discordUrl: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: false,
|
|
23
|
+
},
|
|
24
|
+
slackUrl: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: false,
|
|
27
|
+
},
|
|
28
|
+
events: {
|
|
29
|
+
type: [Schema.Types.ObjectId],
|
|
30
|
+
ref: WebhookEvent,
|
|
31
|
+
default: [],
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export default model<IWebhookSetting>("WebhookSetting", webhookSettingSchema, "webhook_settings");
|