@modular-rest/server 1.10.3 → 1.10.4
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/package.json
CHANGED
package/src/class/db_schemas.js
CHANGED
|
@@ -2,13 +2,16 @@ var mongoose = require("mongoose");
|
|
|
2
2
|
var Schema = mongoose.Schema;
|
|
3
3
|
|
|
4
4
|
module.exports = {
|
|
5
|
-
file: new Schema(
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
file: new Schema(
|
|
6
|
+
{
|
|
7
|
+
originalName: String,
|
|
8
|
+
fileName: String,
|
|
9
|
+
owner: String,
|
|
10
|
+
format: String,
|
|
11
|
+
// Tag being used as the parent dir for files
|
|
12
|
+
// uploadDir/$format/$tag/timestamp.format
|
|
13
|
+
tag: String,
|
|
14
|
+
},
|
|
15
|
+
{ timestamps: true }
|
|
16
|
+
),
|
|
14
17
|
};
|
|
@@ -6,13 +6,16 @@ let { Permission, PermissionTypes } = require("../../class/security");
|
|
|
6
6
|
const { config } = require("../../config");
|
|
7
7
|
const triggerOperator = require("./../../class/trigger_operator");
|
|
8
8
|
|
|
9
|
-
let authSchema = new Schema(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
9
|
+
let authSchema = new Schema(
|
|
10
|
+
{
|
|
11
|
+
permissionGroup: String,
|
|
12
|
+
email: String,
|
|
13
|
+
phone: String,
|
|
14
|
+
password: String,
|
|
15
|
+
type: { type: String, default: "user", enum: ["user", "anonymous"] },
|
|
16
|
+
},
|
|
17
|
+
{ timestamps: true }
|
|
18
|
+
);
|
|
16
19
|
|
|
17
20
|
authSchema.index({ email: 1 }, { unique: true });
|
|
18
21
|
authSchema.pre(["save", "updateOne"], function (next) {
|