@brimble/models 3.3.5 → 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/index.d.ts +1 -1
- package/dist/settings.js +4 -0
- package/dist/types/index.d.ts +3 -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/index.ts +3 -0
- package/package.json +1 -1
- package/settings.ts +4 -0
- package/types/index.ts +3 -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
package/dist/index.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ 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
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, } from "./types";
|
|
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
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";
|
|
35
35
|
import mongoose from "mongoose";
|
|
36
36
|
export declare const connectToMongo: (mongoUrl: string, config?: mongoose.ConnectOptions) => Promise<void>;
|
package/dist/settings.js
CHANGED
package/dist/types/index.d.ts
CHANGED
|
@@ -32,3 +32,6 @@ export { IFramework, BrimbleFrameworkType } from "./framework";
|
|
|
32
32
|
export { ISettings } from "./settings";
|
|
33
33
|
export { ILoadBalancerPort } from "./load-balancer-port";
|
|
34
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");
|
package/index.ts
CHANGED
package/package.json
CHANGED
package/settings.ts
CHANGED
package/types/index.ts
CHANGED
|
@@ -32,3 +32,6 @@ export { IFramework, BrimbleFrameworkType } from "./framework";
|
|
|
32
32
|
export { ISettings } from "./settings";
|
|
33
33
|
export { ILoadBalancerPort } from "./load-balancer-port";
|
|
34
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");
|