@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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@modular-rest/server",
3
- "version": "1.10.3",
3
+ "version": "1.10.4",
4
4
  "description": "a nodejs module based on KOAJS for developing Rest-APIs in a modular solution.",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -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
- originalName: String,
7
- fileName: String,
8
- owner: String,
9
- format: String,
10
- // Tag being used as the parent dir for files
11
- // uploadDir/$format/$tag/timestamp.format
12
- tag: String,
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
- permissionGroup: String,
11
- email: String,
12
- phone: String,
13
- password: String,
14
- type: { type: String, default: "user", enum: ["user", "anonymous"] },
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) {