tango-api-schema 2.0.122 → 2.0.124

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 CHANGED
@@ -32,6 +32,7 @@ import matLogModel from "./schema/matLog.model.js";
32
32
  import billingModel from "./schema/billing.model.js";
33
33
  import auditClientDataModel from "./schema/auditClientData.model.js";
34
34
  import auditLogsModel from "./schema/auditLogs.model.js";
35
+ import internalAuthModel from "./schema/internalAuth.model.js";
35
36
 
36
37
  export default {
37
38
  leadModel,
@@ -67,5 +68,6 @@ export default {
67
68
  auditClientDataModel,
68
69
  matLogModel,
69
70
  billingModel,
70
- auditLogsModel
71
+ auditLogsModel,
72
+ internalAuthModel
71
73
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tango-api-schema",
3
- "version": "2.0.122",
3
+ "version": "2.0.124",
4
4
  "description": "tangoEye model schema",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -13,7 +13,7 @@ const assignAudit = new mongoose.Schema( {
13
13
  clientId: {
14
14
  type: String,
15
15
  },
16
- fileType: {
16
+ auditType: {
17
17
  type: String,
18
18
  },
19
19
  fileDate: {
@@ -27,7 +27,6 @@ const assignAudit = new mongoose.Schema( {
27
27
  },
28
28
  userId: {
29
29
  type: mongoose.Schema.Types.ObjectId,
30
- ref: 'users',
31
30
  },
32
31
  queueName: {
33
32
  type: String,
@@ -81,11 +81,11 @@ const collection = new Schema(
81
81
  },
82
82
  filters: {
83
83
  yolo: {
84
- type: String,
84
+ type: Boolean,
85
85
  default: true,
86
86
  },
87
87
  yoloProcess: {
88
- type: String,
88
+ type: Number,
89
89
  default: 10,
90
90
  },
91
91
  },
@@ -0,0 +1,37 @@
1
+ import mongoose from "mongoose";
2
+ import uniqueValidator from "mongoose-unique-validator";
3
+
4
+ const internalAuth = new mongoose.Schema(
5
+ {
6
+ token: {
7
+ type: String,
8
+ trim: true,
9
+ unique: true,
10
+ required: true,
11
+ },
12
+ type: {
13
+ type: String,
14
+ enum: ["internal-token"],
15
+ default: "internal-token",
16
+ },
17
+ ip: {
18
+ type: String,
19
+ trim: true,
20
+ },
21
+ name:{
22
+ type: String,
23
+ trim: true,
24
+ }
25
+ },
26
+ {
27
+ strict: true,
28
+ versionKey: false,
29
+ timestamps: true,
30
+ }
31
+ );
32
+
33
+ internalAuth.plugin(uniqueValidator)
34
+ internalAuth.index( { createdAt: 1 }, { expires: '1d' })
35
+ internalAuth.index( { name: 1 })
36
+
37
+ export default mongoose.model( 'internalAuth', internalAuth,'internalAuth' );