@dynamatix/cat-shared 0.0.111 → 0.0.113

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.
@@ -6,55 +6,55 @@ const documentSchema = new mongoose.Schema({
6
6
  required: false
7
7
  },
8
8
  externalDocumentId: { // docId by Apprivo
9
- type: String,
10
- required: true
9
+ type: String,
10
+ required: true
11
11
  },
12
12
  filename: { // doc name to be shown in UI
13
- type: String,
14
- required: false
13
+ type: String,
14
+ required: false
15
15
  },
16
16
  docName: { // doc name of uploaded file to be shown in UI
17
- type: String,
18
- required: false
17
+ type: String,
18
+ required: false
19
19
  },
20
- contentType: {
21
- type: String,
22
- required: false
20
+ contentType: {
21
+ type: String,
22
+ required: false
23
23
  },
24
- documentTypeId: {
25
- type: mongoose.Schema.Types.ObjectId,
26
- ref: "DocumentType",
27
- required: false
24
+ documentTypeId: {
25
+ type: mongoose.Schema.Types.ObjectId,
26
+ ref: "DocumentType",
27
+ required: false
28
28
  },
29
29
  documentUrl: { // uploaded doc url
30
- type: String,
31
- required: false
30
+ type: String,
31
+ required: false
32
32
  },
33
33
  status: { // doc status (pending, approved, rejected, ...)
34
- type: String,
35
- required: false
34
+ type: String,
35
+ required: false
36
36
  },
37
- fileSize: {
38
- type: String,
39
- required: false
37
+ fileSize: {
38
+ type: String,
39
+ required: false
40
40
  },
41
- createdOn: {
42
- type: Date,
43
- required: false
41
+ createdOn: {
42
+ type: Date,
43
+ required: false
44
44
  },
45
- createdBy: {
46
- type: String,
47
- required: false
45
+ createdBy: {
46
+ type: String,
47
+ required: false
48
48
  },
49
- externalData: {
49
+ externalData: {
50
50
  type: {
51
51
  ownerName: { type: String, required: false }
52
- },
53
- required: false
52
+ },
53
+ required: false
54
54
  }
55
55
  }, {
56
56
  timestamps: true
57
57
  });
58
58
 
59
- const DocumentModel = mongoose.model("Document", documentSchema);
59
+ const DocumentModel = mongoose.models.Document || mongoose.model("Document", documentSchema);
60
60
  export default DocumentModel;
@@ -52,5 +52,5 @@ const alertSchema = new mongoose.Schema({
52
52
  alertSchema.index({ source: 1, sourceId: 1 });
53
53
  alertSchema.index({ status: 1, isActive: 1 });
54
54
 
55
- const WorkflowAlertModel = mongoose.model('WorkflowAlert', alertSchema);
55
+ const WorkflowAlertModel = mongoose.models.WorkflowAlert || mongoose.model('WorkflowAlert', alertSchema);
56
56
  export default WorkflowAlertModel;
@@ -26,5 +26,5 @@ const workflowConfigSchema = new mongoose.Schema({
26
26
  timestamps: true
27
27
  });
28
28
 
29
- const WorkflowConfigModel = mongoose.model('WorkflowConfig', workflowConfigSchema);
29
+ const WorkflowConfigModel = mongoose.models.WorkflowConfig || mongoose.model('WorkflowConfig', workflowConfigSchema);
30
30
  export default WorkflowConfigModel;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dynamatix/cat-shared",
3
- "version": "0.0.111",
3
+ "version": "0.0.113",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -10,6 +10,7 @@
10
10
  "type": "module",
11
11
  "description": "",
12
12
  "exports": {
13
+ ".": "./index.js",
13
14
  "./models": "./models/index.js",
14
15
  "./middlewares": "./middlewares/index.js",
15
16
  "./services": "./services/index.js"