@riocrypto/common 1.0.378 → 1.0.380
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/build/models/admin-auth.d.ts +10 -2
- package/build/models/admin-auth.js +5 -0
- package/build/models/auth.d.ts +1 -1
- package/build/models/auth.js +4 -0
- package/build/models/bank-payout.d.ts +1 -1
- package/build/models/bank-payout.js +4 -0
- package/build/models/business-user.js +4 -0
- package/build/models/order.js +4 -0
- package/build/models/partner.js +4 -0
- package/build/models/user.js +4 -0
- package/package.json +1 -1
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
import { Mongoose, Document } from "mongoose";
|
|
1
|
+
import { Mongoose, Model, Document } from "mongoose";
|
|
2
|
+
interface AdminAuthAttrs {
|
|
3
|
+
email: string;
|
|
4
|
+
password: string;
|
|
5
|
+
previousPasswords?: string[];
|
|
6
|
+
}
|
|
2
7
|
interface AdminAuthDoc extends Document {
|
|
3
8
|
email: string;
|
|
4
9
|
password: string;
|
|
5
10
|
previousPasswords?: string[];
|
|
6
11
|
}
|
|
7
|
-
|
|
12
|
+
interface AdminAuthModel extends Model<AdminAuthDoc> {
|
|
13
|
+
build(attrs: AdminAuthAttrs): AdminAuthDoc;
|
|
14
|
+
}
|
|
15
|
+
declare const buildAdminAuth: (mongoose: Mongoose) => AdminAuthModel;
|
|
8
16
|
export { buildAdminAuth, AdminAuthDoc };
|
|
@@ -12,6 +12,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.buildAdminAuth = void 0;
|
|
13
13
|
const password_1 = require("../services/password");
|
|
14
14
|
const buildAdminAuth = (mongoose) => {
|
|
15
|
+
// if model is already defined, return it
|
|
16
|
+
if (mongoose.models.AdminAuth) {
|
|
17
|
+
return mongoose.models.AdminAuth;
|
|
18
|
+
}
|
|
15
19
|
const AdminSchema = new mongoose.Schema({
|
|
16
20
|
email: {
|
|
17
21
|
type: String,
|
|
@@ -50,5 +54,6 @@ const buildAdminAuth = (mongoose) => {
|
|
|
50
54
|
return new AdminAuth(attrs);
|
|
51
55
|
};
|
|
52
56
|
const AdminAuth = mongoose.model("Admin", AdminSchema);
|
|
57
|
+
return AdminAuth;
|
|
53
58
|
};
|
|
54
59
|
exports.buildAdminAuth = buildAdminAuth;
|
package/build/models/auth.d.ts
CHANGED
|
@@ -20,5 +20,5 @@ interface AuthDoc extends Document {
|
|
|
20
20
|
interface AuthModel extends Model<AuthDoc> {
|
|
21
21
|
build(attrs: AuthAttrs): AuthDoc;
|
|
22
22
|
}
|
|
23
|
-
declare const buildAuth: (mongoose: Mongoose) => AuthModel;
|
|
23
|
+
declare const buildAuth: (mongoose: Mongoose) => Model<any, {}, {}, {}, any, any> | AuthModel;
|
|
24
24
|
export { buildAuth, AuthDoc };
|
package/build/models/auth.js
CHANGED
|
@@ -12,6 +12,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.buildAuth = void 0;
|
|
13
13
|
const password_1 = require("../services/password");
|
|
14
14
|
const buildAuth = (mongoose) => {
|
|
15
|
+
// if model is already defined, return it
|
|
16
|
+
if (mongoose.models.Auth) {
|
|
17
|
+
return mongoose.models.Auth;
|
|
18
|
+
}
|
|
15
19
|
const AuthSchema = new mongoose.Schema({
|
|
16
20
|
phoneNumber: {
|
|
17
21
|
type: String,
|
|
@@ -16,5 +16,5 @@ interface BankPayoutDoc extends Document {
|
|
|
16
16
|
interface BankPayoutModel extends Model<BankPayoutDoc> {
|
|
17
17
|
build(attrs: BankPayoutAttrs): BankPayoutDoc;
|
|
18
18
|
}
|
|
19
|
-
declare const buildBankPayout: (mongoose: Mongoose) => BankPayoutModel;
|
|
19
|
+
declare const buildBankPayout: (mongoose: Mongoose) => Model<any, {}, {}, {}, any, any> | BankPayoutModel;
|
|
20
20
|
export { buildBankPayout, BankPayoutDoc };
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.buildBankPayout = void 0;
|
|
4
4
|
const buildBankPayout = (mongoose) => {
|
|
5
|
+
// if model is already defined, return it
|
|
6
|
+
if (mongoose.models.BankPayout) {
|
|
7
|
+
return mongoose.models.BankPayout;
|
|
8
|
+
}
|
|
5
9
|
const BankPayoutSchema = new mongoose.Schema({
|
|
6
10
|
orderId: {
|
|
7
11
|
type: String,
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.buildBusinessUser = void 0;
|
|
4
4
|
const buildBusinessUser = (mongoose) => {
|
|
5
|
+
// if model is already defined, return it
|
|
6
|
+
if (mongoose.models.BusinessUser) {
|
|
7
|
+
return mongoose.models.BusinessUser;
|
|
8
|
+
}
|
|
5
9
|
const BusinessUserSchema = new mongoose.Schema({
|
|
6
10
|
type: {
|
|
7
11
|
type: String,
|
package/build/models/order.js
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.buildOrder = void 0;
|
|
4
4
|
const buildOrder = (mongoose) => {
|
|
5
|
+
// if model is already defined, return it
|
|
6
|
+
if (mongoose.models.Order) {
|
|
7
|
+
return mongoose.models.Order;
|
|
8
|
+
}
|
|
5
9
|
const orderSchema = new mongoose.Schema({
|
|
6
10
|
userId: {
|
|
7
11
|
type: String,
|
package/build/models/partner.js
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.buildPartner = void 0;
|
|
4
4
|
const buildPartner = (mongoose) => {
|
|
5
|
+
// if model is already defined, return it
|
|
6
|
+
if (mongoose.models.Partner) {
|
|
7
|
+
return mongoose.models.Partner;
|
|
8
|
+
}
|
|
5
9
|
const PartnerSchema = new mongoose.Schema({
|
|
6
10
|
name: {
|
|
7
11
|
type: String,
|
package/build/models/user.js
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.buildUser = void 0;
|
|
4
4
|
const buildUser = (mongoose) => {
|
|
5
|
+
// if model is already defined, return it
|
|
6
|
+
if (mongoose.models.User) {
|
|
7
|
+
return mongoose.models.User;
|
|
8
|
+
}
|
|
5
9
|
const userSchema = new mongoose.Schema({
|
|
6
10
|
type: {
|
|
7
11
|
type: String,
|