tango-api-schema 1.0.13 → 1.0.14
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/index.js +7 -1
- package/package.json +1 -1
- package/schema/applicationDefault.model.js +24 -0
- package/schema/stores.model.js +6 -0
- package/schema/user.model.js +95 -0
- package/schema/userRole.model.js +28 -0
package/index.js
CHANGED
|
@@ -7,6 +7,9 @@ import dailyAuditStoreFilesModel from "./schema/dailyAuditStoreFiles.model.js";
|
|
|
7
7
|
import tokenModel from "./schema/token.model.js";
|
|
8
8
|
import nobModel from './schema/nob.model.js';
|
|
9
9
|
import nobClientModel from './schema/nobClient.model.js';
|
|
10
|
+
import applicationDefaultModel from "./schema/applicationDefault.model.js";
|
|
11
|
+
import userModel from "./schema/user.model.js";
|
|
12
|
+
import userRoleModel from "./schema/userRole.model.js";
|
|
10
13
|
|
|
11
14
|
export default {
|
|
12
15
|
clientModel,
|
|
@@ -17,5 +20,8 @@ export default {
|
|
|
17
20
|
dailyAuditStoreFilesModel,
|
|
18
21
|
tokenModel,
|
|
19
22
|
nobModel,
|
|
20
|
-
nobClientModel
|
|
23
|
+
nobClientModel,
|
|
24
|
+
applicationDefaultModel,
|
|
25
|
+
userModel,
|
|
26
|
+
userRoleModel
|
|
21
27
|
};
|
package/package.json
CHANGED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import mongoose from 'mongoose';
|
|
2
|
+
|
|
3
|
+
const collection = new mongoose.Schema(
|
|
4
|
+
{
|
|
5
|
+
type: {
|
|
6
|
+
type: String,
|
|
7
|
+
},
|
|
8
|
+
subType: {
|
|
9
|
+
type: String,
|
|
10
|
+
},
|
|
11
|
+
data: {
|
|
12
|
+
type: Object,
|
|
13
|
+
},
|
|
14
|
+
active: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
timestamps: true,
|
|
20
|
+
strict: true,
|
|
21
|
+
versionKey: false,
|
|
22
|
+
} );
|
|
23
|
+
|
|
24
|
+
export default mongoose.model( 'applicationDefault', collection );
|
package/schema/stores.model.js
CHANGED
|
@@ -254,6 +254,9 @@ const collection = new mongoose.Schema(
|
|
|
254
254
|
ipListStatus: {
|
|
255
255
|
type: Boolean,
|
|
256
256
|
},
|
|
257
|
+
ipManufacturerStatus: {
|
|
258
|
+
type: Boolean,
|
|
259
|
+
},
|
|
257
260
|
preRequisite: {
|
|
258
261
|
type: Boolean,
|
|
259
262
|
default: false,
|
|
@@ -276,6 +279,9 @@ const collection = new mongoose.Schema(
|
|
|
276
279
|
type: String,
|
|
277
280
|
},
|
|
278
281
|
},
|
|
282
|
+
pendingInit: { //next level of initialization
|
|
283
|
+
type: String,
|
|
284
|
+
},
|
|
279
285
|
},
|
|
280
286
|
{
|
|
281
287
|
timestamps: true,
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @name api_auth_models_user
|
|
3
|
+
* @description User Model
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
// NPM Modules
|
|
7
|
+
import mongoose from "mongoose";
|
|
8
|
+
import uniqueValidator from "mongoose-unique-validator";
|
|
9
|
+
|
|
10
|
+
// Model
|
|
11
|
+
const collection = new mongoose.Schema(
|
|
12
|
+
{
|
|
13
|
+
userBrand: [
|
|
14
|
+
{
|
|
15
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
16
|
+
ref: "Brand",
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
name: {
|
|
20
|
+
type: String,
|
|
21
|
+
trim: true,
|
|
22
|
+
},
|
|
23
|
+
phone: {
|
|
24
|
+
type: String,
|
|
25
|
+
trim: true,
|
|
26
|
+
required: true,
|
|
27
|
+
unique: true,
|
|
28
|
+
},
|
|
29
|
+
dialCode: {
|
|
30
|
+
type: String,
|
|
31
|
+
trim: true,
|
|
32
|
+
},
|
|
33
|
+
email: {
|
|
34
|
+
type: String,
|
|
35
|
+
trim: true,
|
|
36
|
+
required: true,
|
|
37
|
+
unique: true,
|
|
38
|
+
},
|
|
39
|
+
password: {
|
|
40
|
+
type: String,
|
|
41
|
+
},
|
|
42
|
+
userType: {
|
|
43
|
+
type: String,
|
|
44
|
+
enum: ["client", "admin"],
|
|
45
|
+
},
|
|
46
|
+
roleId: {
|
|
47
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
48
|
+
ref: "userRole",
|
|
49
|
+
required: true,
|
|
50
|
+
},
|
|
51
|
+
emailVerify: {
|
|
52
|
+
type: Boolean,
|
|
53
|
+
default: false,
|
|
54
|
+
},
|
|
55
|
+
phoneVerify: {
|
|
56
|
+
type: Boolean,
|
|
57
|
+
default: false,
|
|
58
|
+
},
|
|
59
|
+
groups: [
|
|
60
|
+
{
|
|
61
|
+
type: Schema.Types.ObjectId,
|
|
62
|
+
ref: "Group",
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
active: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
default: false,
|
|
68
|
+
},
|
|
69
|
+
authentication: {
|
|
70
|
+
user2faCode: {
|
|
71
|
+
type: String,
|
|
72
|
+
},
|
|
73
|
+
user2faEnabled: {
|
|
74
|
+
type: Boolean,
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
refreshToken: {
|
|
79
|
+
type: String,
|
|
80
|
+
},
|
|
81
|
+
login: {
|
|
82
|
+
type: Boolean,
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
timestamps: true,
|
|
87
|
+
strict: true,
|
|
88
|
+
versionKey: false,
|
|
89
|
+
}
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
// Plugins
|
|
93
|
+
collection.plugin(uniqueValidator);
|
|
94
|
+
|
|
95
|
+
export default model("User", collection);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import mongoose from 'mongoose';
|
|
2
|
+
|
|
3
|
+
const collection =new mongoose.Schema( {
|
|
4
|
+
roleName: {
|
|
5
|
+
type: String,
|
|
6
|
+
},
|
|
7
|
+
roleType: {
|
|
8
|
+
type: String,
|
|
9
|
+
},
|
|
10
|
+
createdId: {
|
|
11
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
12
|
+
ref: 'User',
|
|
13
|
+
},
|
|
14
|
+
access: [ {
|
|
15
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
16
|
+
ref: 'applicationDefault',
|
|
17
|
+
} ],
|
|
18
|
+
active: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
default: true,
|
|
21
|
+
},
|
|
22
|
+
}, {
|
|
23
|
+
timestamps: true,
|
|
24
|
+
strict: true,
|
|
25
|
+
versionKey: false,
|
|
26
|
+
} );
|
|
27
|
+
|
|
28
|
+
export default mongoose.model( 'userRole', collection );
|