@brimble/models 3.7.95 → 3.7.97
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/app-message.ts +17 -0
- package/dist/app-message.d.ts +30 -0
- package/dist/app-message.js +13 -0
- package/dist/enum/index.d.ts +17 -0
- package/dist/enum/index.js +21 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +9 -2
- package/dist/invoice.d.ts +30 -0
- package/dist/invoice.js +28 -0
- package/dist/types/app-message.d.ts +14 -0
- package/dist/types/app-message.js +2 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/invoice.d.ts +15 -0
- package/dist/types/invoice.js +2 -0
- package/enum/index.ts +20 -0
- package/index.ts +9 -2
- package/invoice.ts +36 -0
- package/package.json +1 -1
- package/types/app-message.ts +15 -0
- package/types/index.ts +2 -0
- package/types/invoice.ts +16 -0
package/app-message.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { model, Schema } from "mongoose";
|
|
2
|
+
import { IAppMessage } from "./types";
|
|
3
|
+
|
|
4
|
+
const appMessageSchema = new Schema(
|
|
5
|
+
{
|
|
6
|
+
userId: { type: Schema.Types.ObjectId, ref: "User", required: true, index: true },
|
|
7
|
+
teamId: { type: Schema.Types.ObjectId, ref: "Team", required: true, index: true },
|
|
8
|
+
level: { type: String, required: true },
|
|
9
|
+
message: { type: String, required: true },
|
|
10
|
+
meta: { type: Schema.Types.Mixed },
|
|
11
|
+
route: { type: String },
|
|
12
|
+
type: { type: String, required: true },
|
|
13
|
+
},
|
|
14
|
+
{ timestamps: true, collection: "app_messages" },
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
export default model<IAppMessage>("AppMessage", appMessageSchema);
|
|
@@ -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 { IAppMessage } from "./types";
|
|
27
|
+
declare const _default: import("mongoose").Model<IAppMessage, {}, {}, {}, import("mongoose").Document<unknown, {}, IAppMessage> & IAppMessage & {
|
|
28
|
+
_id: import("mongoose").Types.ObjectId;
|
|
29
|
+
}, any>;
|
|
30
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mongoose_1 = require("mongoose");
|
|
4
|
+
const appMessageSchema = new mongoose_1.Schema({
|
|
5
|
+
userId: { type: mongoose_1.Schema.Types.ObjectId, ref: "User", required: true, index: true },
|
|
6
|
+
teamId: { type: mongoose_1.Schema.Types.ObjectId, ref: "Team", required: true, index: true },
|
|
7
|
+
level: { type: String, required: true },
|
|
8
|
+
message: { type: String, required: true },
|
|
9
|
+
meta: { type: mongoose_1.Schema.Types.Mixed },
|
|
10
|
+
route: { type: String },
|
|
11
|
+
type: { type: String, required: true },
|
|
12
|
+
}, { timestamps: true, collection: "app_messages" });
|
|
13
|
+
exports.default = (0, mongoose_1.model)("AppMessage", appMessageSchema);
|
package/dist/enum/index.d.ts
CHANGED
|
@@ -190,3 +190,20 @@ export declare enum COLLAB_TOOLBAR_POSITION {
|
|
|
190
190
|
BOTTOM = "bottom",
|
|
191
191
|
RIGHT = "right"
|
|
192
192
|
}
|
|
193
|
+
export declare enum INVOICE_STATUS {
|
|
194
|
+
ACTIVE = "ACTIVE",
|
|
195
|
+
PAID = "PAID",
|
|
196
|
+
EXPIRED = "EXPIRED"
|
|
197
|
+
}
|
|
198
|
+
export declare enum INVOICE_PAYMENT_STATUS {
|
|
199
|
+
PENDING = "PENDING",
|
|
200
|
+
PROCESSING = "PROCESSING",
|
|
201
|
+
SUCCESSFUL = "SUCCESSFUL",
|
|
202
|
+
FAILED = "FAILED",
|
|
203
|
+
REFUNDED = "REFUNDED",
|
|
204
|
+
REFUND_PROCESSING = "REFUND_PROCESSING"
|
|
205
|
+
}
|
|
206
|
+
export declare enum INVOICE_TYPE {
|
|
207
|
+
INVOICE = "invoice",
|
|
208
|
+
RECEIPT = "receipt"
|
|
209
|
+
}
|
package/dist/enum/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.COLLAB_TOOLBAR_POSITION = exports.COLLAB_THEME = exports.COLLAB_INTEGRATION_TYPE = exports.COLLAB_ANNOTATION_STATUS = exports.BRANCH_TYPE = exports.NomadDeploymentStatus = 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.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.BRANCH_TYPE = exports.NomadDeploymentStatus = 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";
|
|
@@ -224,3 +224,23 @@ var COLLAB_TOOLBAR_POSITION;
|
|
|
224
224
|
COLLAB_TOOLBAR_POSITION["BOTTOM"] = "bottom";
|
|
225
225
|
COLLAB_TOOLBAR_POSITION["RIGHT"] = "right";
|
|
226
226
|
})(COLLAB_TOOLBAR_POSITION = exports.COLLAB_TOOLBAR_POSITION || (exports.COLLAB_TOOLBAR_POSITION = {}));
|
|
227
|
+
var INVOICE_STATUS;
|
|
228
|
+
(function (INVOICE_STATUS) {
|
|
229
|
+
INVOICE_STATUS["ACTIVE"] = "ACTIVE";
|
|
230
|
+
INVOICE_STATUS["PAID"] = "PAID";
|
|
231
|
+
INVOICE_STATUS["EXPIRED"] = "EXPIRED";
|
|
232
|
+
})(INVOICE_STATUS = exports.INVOICE_STATUS || (exports.INVOICE_STATUS = {}));
|
|
233
|
+
var INVOICE_PAYMENT_STATUS;
|
|
234
|
+
(function (INVOICE_PAYMENT_STATUS) {
|
|
235
|
+
INVOICE_PAYMENT_STATUS["PENDING"] = "PENDING";
|
|
236
|
+
INVOICE_PAYMENT_STATUS["PROCESSING"] = "PROCESSING";
|
|
237
|
+
INVOICE_PAYMENT_STATUS["SUCCESSFUL"] = "SUCCESSFUL";
|
|
238
|
+
INVOICE_PAYMENT_STATUS["FAILED"] = "FAILED";
|
|
239
|
+
INVOICE_PAYMENT_STATUS["REFUNDED"] = "REFUNDED";
|
|
240
|
+
INVOICE_PAYMENT_STATUS["REFUND_PROCESSING"] = "REFUND_PROCESSING";
|
|
241
|
+
})(INVOICE_PAYMENT_STATUS = exports.INVOICE_PAYMENT_STATUS || (exports.INVOICE_PAYMENT_STATUS = {}));
|
|
242
|
+
var INVOICE_TYPE;
|
|
243
|
+
(function (INVOICE_TYPE) {
|
|
244
|
+
INVOICE_TYPE["INVOICE"] = "invoice";
|
|
245
|
+
INVOICE_TYPE["RECEIPT"] = "receipt";
|
|
246
|
+
})(INVOICE_TYPE = exports.INVOICE_TYPE || (exports.INVOICE_TYPE = {}));
|
package/dist/index.d.ts
CHANGED
|
@@ -42,8 +42,10 @@ export { default as CollabIntegration } from "./collab-integration";
|
|
|
42
42
|
export { default as CollabSettings } from "./collab-settings";
|
|
43
43
|
export { default as CollabShareToken } from "./collab-share-token";
|
|
44
44
|
export { default as CollabPushSubscription } from "./collab-push-subscription";
|
|
45
|
-
export {
|
|
46
|
-
export {
|
|
45
|
+
export { default as AppMessage } from "./app-message";
|
|
46
|
+
export { default as Invoice } from "./invoice";
|
|
47
|
+
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, IIntention, IProvider, IBranch, ICollabAnnotation, ICollabComment, ICollabAttachment, ICollabIntegration, ICollabSettings, ICollabShareToken, ICollabPushSubscription, IAppMessage, IInvoice } from "./types";
|
|
48
|
+
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, NomadDeploymentStatus, BRANCH_TYPE, COLLAB_ANNOTATION_STATUS, COLLAB_INTEGRATION_TYPE, COLLAB_THEME, COLLAB_TOOLBAR_POSITION, INVOICE_STATUS, INVOICE_PAYMENT_STATUS, INVOICE_TYPE } from "./enum";
|
|
47
49
|
import mongoose from "mongoose";
|
|
48
50
|
export declare const connectToMongo: (mongoUrl: string, config?: mongoose.ConnectOptions) => Promise<void>;
|
|
49
51
|
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.healthCheckMongo = exports.closeMongo = exports.db = exports.connectToMongo = exports.COLLAB_TOOLBAR_POSITION = exports.COLLAB_THEME = exports.COLLAB_INTEGRATION_TYPE = exports.COLLAB_ANNOTATION_STATUS = exports.BRANCH_TYPE = exports.NomadDeploymentStatus = 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 = void 0;
|
|
15
|
+
exports.INTEGRATION_PROVIDERS = exports.INTEGRATION_TYPES = exports.GIT_TYPE = exports.Invoice = exports.AppMessage = exports.CollabPushSubscription = exports.CollabShareToken = exports.CollabSettings = exports.CollabIntegration = exports.CollabComment = exports.CollabAnnotation = exports.Branch = exports.Provider = exports.Intention = exports.WebhookSetting = exports.WebhookEvent = exports.WebhookCategory = 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.healthCheckMongo = exports.closeMongo = exports.db = exports.connectToMongo = 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.BRANCH_TYPE = exports.NomadDeploymentStatus = 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 = 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");
|
|
@@ -103,6 +103,10 @@ var collab_share_token_1 = require("./collab-share-token");
|
|
|
103
103
|
Object.defineProperty(exports, "CollabShareToken", { enumerable: true, get: function () { return __importDefault(collab_share_token_1).default; } });
|
|
104
104
|
var collab_push_subscription_1 = require("./collab-push-subscription");
|
|
105
105
|
Object.defineProperty(exports, "CollabPushSubscription", { enumerable: true, get: function () { return __importDefault(collab_push_subscription_1).default; } });
|
|
106
|
+
var app_message_1 = require("./app-message");
|
|
107
|
+
Object.defineProperty(exports, "AppMessage", { enumerable: true, get: function () { return __importDefault(app_message_1).default; } });
|
|
108
|
+
var invoice_1 = require("./invoice");
|
|
109
|
+
Object.defineProperty(exports, "Invoice", { enumerable: true, get: function () { return __importDefault(invoice_1).default; } });
|
|
106
110
|
var enum_1 = require("./enum");
|
|
107
111
|
Object.defineProperty(exports, "GIT_TYPE", { enumerable: true, get: function () { return enum_1.GIT_TYPE; } });
|
|
108
112
|
Object.defineProperty(exports, "INTEGRATION_TYPES", { enumerable: true, get: function () { return enum_1.INTEGRATION_TYPES; } });
|
|
@@ -133,6 +137,9 @@ Object.defineProperty(exports, "COLLAB_ANNOTATION_STATUS", { enumerable: true, g
|
|
|
133
137
|
Object.defineProperty(exports, "COLLAB_INTEGRATION_TYPE", { enumerable: true, get: function () { return enum_1.COLLAB_INTEGRATION_TYPE; } });
|
|
134
138
|
Object.defineProperty(exports, "COLLAB_THEME", { enumerable: true, get: function () { return enum_1.COLLAB_THEME; } });
|
|
135
139
|
Object.defineProperty(exports, "COLLAB_TOOLBAR_POSITION", { enumerable: true, get: function () { return enum_1.COLLAB_TOOLBAR_POSITION; } });
|
|
140
|
+
Object.defineProperty(exports, "INVOICE_STATUS", { enumerable: true, get: function () { return enum_1.INVOICE_STATUS; } });
|
|
141
|
+
Object.defineProperty(exports, "INVOICE_PAYMENT_STATUS", { enumerable: true, get: function () { return enum_1.INVOICE_PAYMENT_STATUS; } });
|
|
142
|
+
Object.defineProperty(exports, "INVOICE_TYPE", { enumerable: true, get: function () { return enum_1.INVOICE_TYPE; } });
|
|
136
143
|
const mongoose_1 = __importDefault(require("mongoose"));
|
|
137
144
|
const utils_1 = require("@brimble/utils");
|
|
138
145
|
const connectToMongo = (mongoUrl, config) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -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 { IInvoice } from "./types";
|
|
27
|
+
declare const _default: import("mongoose").Model<IInvoice, {}, {}, {}, import("mongoose").Document<unknown, {}, IInvoice> & IInvoice & {
|
|
28
|
+
_id: import("mongoose").Types.ObjectId;
|
|
29
|
+
}, any>;
|
|
30
|
+
export default _default;
|
package/dist/invoice.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const mongoose_1 = require("mongoose");
|
|
4
|
+
const enum_1 = require("./enum");
|
|
5
|
+
const invoiceSchema = new mongoose_1.Schema({
|
|
6
|
+
ref: String,
|
|
7
|
+
user_id: String,
|
|
8
|
+
subscription_id: String,
|
|
9
|
+
total_amount: Number,
|
|
10
|
+
due: Boolean,
|
|
11
|
+
type: {
|
|
12
|
+
type: String,
|
|
13
|
+
enum: Object.values(enum_1.INVOICE_TYPE),
|
|
14
|
+
},
|
|
15
|
+
status: {
|
|
16
|
+
type: String,
|
|
17
|
+
enum: Object.values(enum_1.INVOICE_STATUS),
|
|
18
|
+
},
|
|
19
|
+
payment_status: {
|
|
20
|
+
type: String,
|
|
21
|
+
enum: Object.values(enum_1.INVOICE_PAYMENT_STATUS),
|
|
22
|
+
},
|
|
23
|
+
billing_period: String,
|
|
24
|
+
}, {
|
|
25
|
+
timestamps: true,
|
|
26
|
+
collection: "invoices",
|
|
27
|
+
});
|
|
28
|
+
exports.default = (0, mongoose_1.model)("Invoice", invoiceSchema);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Document } from "mongoose";
|
|
2
|
+
import { IUser } from "./user";
|
|
3
|
+
import { ITeam } from "./team";
|
|
4
|
+
export interface IAppMessage extends Document {
|
|
5
|
+
userId: IUser;
|
|
6
|
+
teamId: ITeam;
|
|
7
|
+
level: string;
|
|
8
|
+
message: string;
|
|
9
|
+
meta?: Record<string, any>;
|
|
10
|
+
route?: string;
|
|
11
|
+
type: string;
|
|
12
|
+
createdAt: Date;
|
|
13
|
+
updatedAt: Date;
|
|
14
|
+
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -44,3 +44,5 @@ export type { ICollabIntegration } from "./collab-integration";
|
|
|
44
44
|
export type { ICollabSettings } from "./collab-settings";
|
|
45
45
|
export type { ICollabShareToken } from "./collab-share-token";
|
|
46
46
|
export type { ICollabPushSubscription } from "./collab-push-subscription";
|
|
47
|
+
export type { IAppMessage } from "./app-message";
|
|
48
|
+
export type { IInvoice } from "./invoice";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Document } from "mongoose";
|
|
2
|
+
import { INVOICE_STATUS, INVOICE_PAYMENT_STATUS, INVOICE_TYPE } from "../enum";
|
|
3
|
+
export interface IInvoice extends Document {
|
|
4
|
+
ref: string;
|
|
5
|
+
user_id: string;
|
|
6
|
+
subscription_id: string;
|
|
7
|
+
total_amount: number;
|
|
8
|
+
due: boolean;
|
|
9
|
+
type: INVOICE_TYPE;
|
|
10
|
+
status: INVOICE_STATUS;
|
|
11
|
+
payment_status: INVOICE_PAYMENT_STATUS;
|
|
12
|
+
billing_period: string;
|
|
13
|
+
created_at: Date;
|
|
14
|
+
updated_at: Date;
|
|
15
|
+
}
|
package/enum/index.ts
CHANGED
|
@@ -220,3 +220,23 @@ export enum COLLAB_TOOLBAR_POSITION {
|
|
|
220
220
|
BOTTOM = "bottom",
|
|
221
221
|
RIGHT = "right",
|
|
222
222
|
}
|
|
223
|
+
|
|
224
|
+
export enum INVOICE_STATUS {
|
|
225
|
+
ACTIVE = "ACTIVE",
|
|
226
|
+
PAID = "PAID",
|
|
227
|
+
EXPIRED = "EXPIRED",
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export enum INVOICE_PAYMENT_STATUS {
|
|
231
|
+
PENDING = "PENDING",
|
|
232
|
+
PROCESSING = "PROCESSING",
|
|
233
|
+
SUCCESSFUL = "SUCCESSFUL",
|
|
234
|
+
FAILED = "FAILED",
|
|
235
|
+
REFUNDED = "REFUNDED",
|
|
236
|
+
REFUND_PROCESSING = "REFUND_PROCESSING",
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
export enum INVOICE_TYPE {
|
|
240
|
+
INVOICE = "invoice",
|
|
241
|
+
RECEIPT = "receipt",
|
|
242
|
+
}
|
package/index.ts
CHANGED
|
@@ -42,6 +42,8 @@ export { default as CollabIntegration } from "./collab-integration";
|
|
|
42
42
|
export { default as CollabSettings } from "./collab-settings";
|
|
43
43
|
export { default as CollabShareToken } from "./collab-share-token";
|
|
44
44
|
export { default as CollabPushSubscription } from "./collab-push-subscription";
|
|
45
|
+
export { default as AppMessage } from "./app-message";
|
|
46
|
+
export { default as Invoice } from "./invoice";
|
|
45
47
|
|
|
46
48
|
export {
|
|
47
49
|
IUser,
|
|
@@ -91,7 +93,9 @@ export {
|
|
|
91
93
|
ICollabIntegration,
|
|
92
94
|
ICollabSettings,
|
|
93
95
|
ICollabShareToken,
|
|
94
|
-
ICollabPushSubscription
|
|
96
|
+
ICollabPushSubscription,
|
|
97
|
+
IAppMessage,
|
|
98
|
+
IInvoice
|
|
95
99
|
} from "./types";
|
|
96
100
|
export {
|
|
97
101
|
GIT_TYPE,
|
|
@@ -122,7 +126,10 @@ export {
|
|
|
122
126
|
COLLAB_ANNOTATION_STATUS,
|
|
123
127
|
COLLAB_INTEGRATION_TYPE,
|
|
124
128
|
COLLAB_THEME,
|
|
125
|
-
COLLAB_TOOLBAR_POSITION
|
|
129
|
+
COLLAB_TOOLBAR_POSITION,
|
|
130
|
+
INVOICE_STATUS,
|
|
131
|
+
INVOICE_PAYMENT_STATUS,
|
|
132
|
+
INVOICE_TYPE
|
|
126
133
|
} from "./enum";
|
|
127
134
|
|
|
128
135
|
import mongoose from "mongoose";
|
package/invoice.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { model, Schema } from "mongoose";
|
|
2
|
+
import {
|
|
3
|
+
INVOICE_STATUS,
|
|
4
|
+
INVOICE_PAYMENT_STATUS,
|
|
5
|
+
INVOICE_TYPE,
|
|
6
|
+
} from "./enum";
|
|
7
|
+
import { IInvoice } from "./types";
|
|
8
|
+
|
|
9
|
+
const invoiceSchema: Schema = new Schema(
|
|
10
|
+
{
|
|
11
|
+
ref: String,
|
|
12
|
+
user_id: String,
|
|
13
|
+
subscription_id: String,
|
|
14
|
+
total_amount: Number,
|
|
15
|
+
due: Boolean,
|
|
16
|
+
type: {
|
|
17
|
+
type: String,
|
|
18
|
+
enum: Object.values(INVOICE_TYPE),
|
|
19
|
+
},
|
|
20
|
+
status: {
|
|
21
|
+
type: String,
|
|
22
|
+
enum: Object.values(INVOICE_STATUS),
|
|
23
|
+
},
|
|
24
|
+
payment_status: {
|
|
25
|
+
type: String,
|
|
26
|
+
enum: Object.values(INVOICE_PAYMENT_STATUS),
|
|
27
|
+
},
|
|
28
|
+
billing_period: String,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
timestamps: true,
|
|
32
|
+
collection: "invoices",
|
|
33
|
+
},
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
export default model<IInvoice>("Invoice", invoiceSchema);
|
package/package.json
CHANGED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Document } from "mongoose";
|
|
2
|
+
import { IUser } from "./user";
|
|
3
|
+
import { ITeam } from "./team";
|
|
4
|
+
|
|
5
|
+
export interface IAppMessage extends Document {
|
|
6
|
+
userId: IUser;
|
|
7
|
+
teamId: ITeam;
|
|
8
|
+
level: string;
|
|
9
|
+
message: string;
|
|
10
|
+
meta?: Record<string, any>;
|
|
11
|
+
route?: string;
|
|
12
|
+
type: string;
|
|
13
|
+
createdAt: Date;
|
|
14
|
+
updatedAt: Date;
|
|
15
|
+
}
|
package/types/index.ts
CHANGED
|
@@ -44,3 +44,5 @@ export type { ICollabIntegration } from "./collab-integration";
|
|
|
44
44
|
export type { ICollabSettings } from "./collab-settings";
|
|
45
45
|
export type { ICollabShareToken } from "./collab-share-token";
|
|
46
46
|
export type { ICollabPushSubscription } from "./collab-push-subscription";
|
|
47
|
+
export type { IAppMessage } from "./app-message";
|
|
48
|
+
export type { IInvoice } from "./invoice";
|
package/types/invoice.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Document } from "mongoose";
|
|
2
|
+
import { INVOICE_STATUS, INVOICE_PAYMENT_STATUS, INVOICE_TYPE } from "../enum";
|
|
3
|
+
|
|
4
|
+
export interface IInvoice extends Document {
|
|
5
|
+
ref: string;
|
|
6
|
+
user_id: string;
|
|
7
|
+
subscription_id: string;
|
|
8
|
+
total_amount: number;
|
|
9
|
+
due: boolean;
|
|
10
|
+
type: INVOICE_TYPE;
|
|
11
|
+
status: INVOICE_STATUS;
|
|
12
|
+
payment_status: INVOICE_PAYMENT_STATUS;
|
|
13
|
+
billing_period: string;
|
|
14
|
+
created_at: Date;
|
|
15
|
+
updated_at: Date;
|
|
16
|
+
}
|