@cool-digital-solutions/interferir-models 1.1.26 → 1.1.28

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.
Files changed (43) hide show
  1. package/dist/schemas/ai-assistant.schema.js +5 -2
  2. package/dist/schemas/ai-company-tracking-task.schema.js +5 -2
  3. package/dist/schemas/ai-conversation-message.schema.js +5 -2
  4. package/dist/schemas/ai-conversation.schema.js +5 -2
  5. package/dist/schemas/backend-error.schema.js +5 -2
  6. package/dist/schemas/badge.schema.js +5 -2
  7. package/dist/schemas/batch-history.schema.js +5 -4
  8. package/dist/schemas/bookmark.schema.js +5 -2
  9. package/dist/schemas/company-cluster.schema.js +5 -2
  10. package/dist/schemas/company-marketing.schema.js +5 -2
  11. package/dist/schemas/competitor.schema.js +3 -1
  12. package/dist/schemas/contact-message.schema.js +5 -2
  13. package/dist/schemas/contact-startup.schema.js +22 -0
  14. package/dist/schemas/content.schema.js +5 -2
  15. package/dist/schemas/draft-version.schema.js +5 -2
  16. package/dist/schemas/evidence-layout.schema.js +5 -2
  17. package/dist/schemas/evidence.schema.js +5 -2
  18. package/dist/schemas/faq.schema.js +5 -2
  19. package/dist/schemas/featured-theme.schema.js +5 -2
  20. package/dist/schemas/foam-tree.schema.js +5 -2
  21. package/dist/schemas/follow-content.schema.js +5 -2
  22. package/dist/schemas/highlight.schema.js +5 -2
  23. package/dist/schemas/image.schema.js +5 -2
  24. package/dist/schemas/industry.schema.js +5 -2
  25. package/dist/schemas/like.schema.js +5 -2
  26. package/dist/schemas/related-theme.schema.js +5 -2
  27. package/dist/schemas/search-history.schema.js +5 -2
  28. package/dist/schemas/sf-category.schema.js +5 -2
  29. package/dist/schemas/sf-sub-category.schema.js +5 -2
  30. package/dist/schemas/sf-tag.schema.js +5 -2
  31. package/dist/schemas/spark-use-case.schema.js +5 -2
  32. package/dist/schemas/spark.schema.js +6 -0
  33. package/dist/schemas/startup-vector-any-entity.schema.js +5 -2
  34. package/dist/schemas/technology.schema.js +5 -2
  35. package/dist/schemas/use-case-discovery-problem.schema.js +5 -2
  36. package/dist/schemas/use-case-discovery.schema.js +5 -2
  37. package/dist/schemas/use-case.schema.js +5 -2
  38. package/dist/schemas/user-token.schema.js +5 -2
  39. package/dist/schemas/user-visit.schema.js +5 -2
  40. package/dist/schemas/user.schema.js +3 -1
  41. package/dist/types/spark.type.d.ts +13 -0
  42. package/dist/types/spark.type.js +8 -1
  43. package/package.json +1 -1
@@ -19,16 +19,19 @@ const aiAssistantSchema = new mongoose_1.Schema({
19
19
  }, _config_1.schemaOptions);
20
20
  aiAssistantSchema.pre('save', function (next) {
21
21
  const user = express_http_context_1.default.get('user');
22
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
22
23
  if (user) {
23
24
  if (!this.createdBy)
24
25
  this.createdBy = user._id;
25
- this.updatedBy = user._id;
26
+ if (!notUpdatedBy)
27
+ this.updatedBy = user._id;
26
28
  }
27
29
  next();
28
30
  });
29
31
  aiAssistantSchema.pre('findOneAndUpdate', function (next) {
30
32
  const user = express_http_context_1.default.get('user');
31
- if (user)
33
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
34
+ if (user && !notUpdatedBy)
32
35
  this._update.updatedBy = user._id;
33
36
  next();
34
37
  });
@@ -22,16 +22,19 @@ const aiConversationTrackingTaskSchema = new mongoose_1.Schema({
22
22
  }, _config_1.schemaOptions);
23
23
  aiConversationTrackingTaskSchema.pre('save', function (next) {
24
24
  const user = express_http_context_1.default.get('user');
25
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
25
26
  if (user) {
26
27
  if (!this.createdBy)
27
28
  this.createdBy = user._id;
28
- this.updatedBy = user._id;
29
+ if (!notUpdatedBy)
30
+ this.updatedBy = user._id;
29
31
  }
30
32
  next();
31
33
  });
32
34
  aiConversationTrackingTaskSchema.pre('findOneAndUpdate', function (next) {
33
35
  const user = express_http_context_1.default.get('user');
34
- if (user)
36
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
37
+ if (user && !notUpdatedBy)
35
38
  this._update.updatedBy = user._id;
36
39
  next();
37
40
  });
@@ -37,16 +37,19 @@ const aiConversationMessageSchema = new mongoose_1.Schema({
37
37
  }, _config_1.schemaOptions);
38
38
  aiConversationMessageSchema.pre('save', function (next) {
39
39
  const user = express_http_context_1.default.get('user');
40
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
40
41
  if (user) {
41
42
  if (!this.createdBy)
42
43
  this.createdBy = user._id;
43
- this.updatedBy = user._id;
44
+ if (!notUpdatedBy)
45
+ this.updatedBy = user._id;
44
46
  }
45
47
  next();
46
48
  });
47
49
  aiConversationMessageSchema.pre('findOneAndUpdate', function (next) {
48
50
  const user = express_http_context_1.default.get('user');
49
- if (user)
51
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
52
+ if (user && !notUpdatedBy)
50
53
  this._update.updatedBy = user._id;
51
54
  next();
52
55
  });
@@ -19,16 +19,19 @@ const aiConversationSchema = new mongoose_1.Schema({
19
19
  }, _config_1.schemaOptions);
20
20
  aiConversationSchema.pre('save', function (next) {
21
21
  const user = express_http_context_1.default.get('user');
22
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
22
23
  if (user) {
23
24
  if (!this.createdBy)
24
25
  this.createdBy = user._id;
25
- this.updatedBy = user._id;
26
+ if (!notUpdatedBy)
27
+ this.updatedBy = user._id;
26
28
  }
27
29
  next();
28
30
  });
29
31
  aiConversationSchema.pre('findOneAndUpdate', function (next) {
30
32
  const user = express_http_context_1.default.get('user');
31
- if (user)
33
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
34
+ if (user && !notUpdatedBy)
32
35
  this._update.updatedBy = user._id;
33
36
  next();
34
37
  });
@@ -23,16 +23,19 @@ const backendErrorSchema = new mongoose_1.Schema({
23
23
  }, _config_1.schemaOptions);
24
24
  backendErrorSchema.pre('save', function (next) {
25
25
  const user = express_http_context_1.default.get('user');
26
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
26
27
  if (user) {
27
28
  if (!this.createdBy)
28
29
  this.createdBy = user._id;
29
- this.updatedBy = user._id;
30
+ if (!notUpdatedBy)
31
+ this.updatedBy = user._id;
30
32
  }
31
33
  next();
32
34
  });
33
35
  backendErrorSchema.pre('findOneAndUpdate', function (next) {
34
36
  const user = express_http_context_1.default.get('user');
35
- if (user)
37
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
38
+ if (user && !notUpdatedBy)
36
39
  this._update.updatedBy = user._id;
37
40
  next();
38
41
  });
@@ -26,16 +26,19 @@ const badgeSchema = new mongoose_1.Schema({
26
26
  }, _config_1.schemaOptions);
27
27
  badgeSchema.pre('save', function (next) {
28
28
  const user = express_http_context_1.default.get('user');
29
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
29
30
  if (user) {
30
31
  if (!this.createdBy)
31
32
  this.createdBy = user._id;
32
- this.updatedBy = user._id;
33
+ if (!notUpdatedBy)
34
+ this.updatedBy = user._id;
33
35
  }
34
36
  next();
35
37
  });
36
38
  badgeSchema.pre('findOneAndUpdate', function (next) {
37
39
  const user = express_http_context_1.default.get('user');
38
- if (user)
40
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
41
+ if (user && !notUpdatedBy)
39
42
  this._update.updatedBy = user._id;
40
43
  next();
41
44
  });
@@ -20,19 +20,20 @@ const batchHistorySchema = new mongoose_1.Schema({
20
20
  }, _config_1.schemaOptions);
21
21
  batchHistorySchema.pre('save', function (next) {
22
22
  const user = express_http_context_1.default.get('user');
23
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
23
24
  if (user) {
24
25
  if (!this.createdBy)
25
26
  this.createdBy = user._id;
26
- this.updatedBy = user._id;
27
+ if (!notUpdatedBy)
28
+ this.updatedBy = user._id;
27
29
  }
28
30
  next();
29
31
  });
30
32
  batchHistorySchema.pre('findOneAndUpdate', function (next) {
31
33
  const user = express_http_context_1.default.get('user');
32
- if (user) {
34
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
35
+ if (user && !notUpdatedBy)
33
36
  this._update.updatedBy = user._id;
34
- this._update.documentLastUpdateDate = new Date().getTime();
35
- }
36
37
  next();
37
38
  });
38
39
  exports.default = batchHistorySchema;
@@ -27,16 +27,19 @@ const bookmarkSchema = new mongoose_1.Schema({
27
27
  }, _config_1.schemaOptions);
28
28
  bookmarkSchema.pre('save', function (next) {
29
29
  const user = express_http_context_1.default.get('user');
30
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
30
31
  if (user) {
31
32
  if (!this.createdBy)
32
33
  this.createdBy = user._id;
33
- this.updatedBy = user._id;
34
+ if (!notUpdatedBy)
35
+ this.updatedBy = user._id;
34
36
  }
35
37
  next();
36
38
  });
37
39
  bookmarkSchema.pre('findOneAndUpdate', function (next) {
38
40
  const user = express_http_context_1.default.get('user');
39
- if (user)
41
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
42
+ if (user && !notUpdatedBy)
40
43
  this._update.updatedBy = user._id;
41
44
  next();
42
45
  });
@@ -31,16 +31,19 @@ const companyClusterSchema = new mongoose_1.Schema({
31
31
  }, _config_1.schemaOptions);
32
32
  companyClusterSchema.pre('save', function (next) {
33
33
  const user = express_http_context_1.default.get('user');
34
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
34
35
  if (user) {
35
36
  if (!this.createdBy)
36
37
  this.createdBy = user._id;
37
- this.updatedBy = user._id;
38
+ if (!notUpdatedBy)
39
+ this.updatedBy = user._id;
38
40
  }
39
41
  next();
40
42
  });
41
43
  companyClusterSchema.pre('findOneAndUpdate', function (next) {
42
44
  const user = express_http_context_1.default.get('user');
43
- if (user)
45
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
46
+ if (user && !notUpdatedBy)
44
47
  this._update.updatedBy = user._id;
45
48
  next();
46
49
  });
@@ -25,16 +25,19 @@ const companyMarketingSchema = new mongoose_1.Schema({
25
25
  }, _config_1.schemaOptions);
26
26
  companyMarketingSchema.pre('save', function (next) {
27
27
  const user = express_http_context_1.default.get('user');
28
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
28
29
  if (user) {
29
30
  if (!this.createdBy)
30
31
  this.createdBy = user._id;
31
- this.updatedBy = user._id;
32
+ if (!notUpdatedBy)
33
+ this.updatedBy = user._id;
32
34
  }
33
35
  next();
34
36
  });
35
37
  companyMarketingSchema.pre('findOneAndUpdate', function (next) {
36
38
  const user = express_http_context_1.default.get('user');
37
- if (user)
39
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
40
+ if (user && !notUpdatedBy)
38
41
  this._update.updatedBy = user._id;
39
42
  next();
40
43
  });
@@ -50,10 +50,12 @@ const competitorSchema = new mongoose_1.Schema({
50
50
  competitorSchema.index({ company: 1, competitor: 1 }, { unique: true });
51
51
  competitorSchema.pre('save', function (next) {
52
52
  const user = express_http_context_1.default.get('user');
53
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
53
54
  if (user) {
54
55
  if (!this.createdBy)
55
56
  this.createdBy = user._id;
56
- this.updatedBy = user._id;
57
+ if (!notUpdatedBy)
58
+ this.updatedBy = user._id;
57
59
  }
58
60
  next();
59
61
  });
@@ -23,16 +23,19 @@ const contactMessageSchema = new mongoose_1.Schema({
23
23
  }, _config_1.schemaOptions);
24
24
  contactMessageSchema.pre('save', function (next) {
25
25
  const user = express_http_context_1.default.get('user');
26
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
26
27
  if (user) {
27
28
  if (!this.createdBy)
28
29
  this.createdBy = user._id;
29
- this.updatedBy = user._id;
30
+ if (!notUpdatedBy)
31
+ this.updatedBy = user._id;
30
32
  }
31
33
  next();
32
34
  });
33
35
  contactMessageSchema.pre('findOneAndUpdate', function (next) {
34
36
  const user = express_http_context_1.default.get('user');
35
- if (user)
37
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
38
+ if (user && !notUpdatedBy)
36
39
  this._update.updatedBy = user._id;
37
40
  next();
38
41
  });
@@ -1,6 +1,10 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  const mongoose_1 = require("mongoose");
7
+ const express_http_context_1 = __importDefault(require("express-http-context"));
4
8
  const contact_startup_type_1 = require("../types/contact-startup.type");
5
9
  const _config_1 = require("../config");
6
10
  const contactStartupSchema = new mongoose_1.Schema({
@@ -25,4 +29,22 @@ const contactStartupSchema = new mongoose_1.Schema({
25
29
  updatedDate: { type: Number, index: -1 },
26
30
  createdDate: { type: Number, index: -1 },
27
31
  }, _config_1.schemaOptions);
32
+ contactStartupSchema.pre('save', function (next) {
33
+ const user = express_http_context_1.default.get('user');
34
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
35
+ if (user) {
36
+ if (!this.createdBy)
37
+ this.createdBy = user._id;
38
+ if (!notUpdatedBy)
39
+ this.updatedBy = user._id;
40
+ }
41
+ next();
42
+ });
43
+ contactStartupSchema.pre('findOneAndUpdate', function (next) {
44
+ const user = express_http_context_1.default.get('user');
45
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
46
+ if (user && !notUpdatedBy)
47
+ this._update.updatedBy = user._id;
48
+ next();
49
+ });
28
50
  exports.default = contactStartupSchema;
@@ -24,16 +24,19 @@ const contentSchema = new mongoose_1.Schema({
24
24
  }, schemaOptions);
25
25
  contentSchema.pre('save', function (next) {
26
26
  const user = express_http_context_1.default.get('user');
27
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
27
28
  if (user) {
28
29
  if (!this.createdBy)
29
30
  this.createdBy = user._id;
30
- this.updatedBy = user._id;
31
+ if (!notUpdatedBy)
32
+ this.updatedBy = user._id;
31
33
  }
32
34
  next();
33
35
  });
34
36
  contentSchema.pre('findOneAndUpdate', function (next) {
35
37
  const user = express_http_context_1.default.get('user');
36
- if (user)
38
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
39
+ if (user && !notUpdatedBy)
37
40
  this._update.updatedBy = user._id;
38
41
  next();
39
42
  });
@@ -18,16 +18,19 @@ const draftVersionSchema = new mongoose_1.Schema({
18
18
  }, _config_1.schemaOptions);
19
19
  draftVersionSchema.pre('save', function (next) {
20
20
  const user = express_http_context_1.default.get('user');
21
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
21
22
  if (user) {
22
23
  if (!this.createdBy)
23
24
  this.createdBy = user._id;
24
- this.updatedBy = user._id;
25
+ if (!notUpdatedBy)
26
+ this.updatedBy = user._id;
25
27
  }
26
28
  next();
27
29
  });
28
30
  draftVersionSchema.pre('findOneAndUpdate', function (next) {
29
31
  const user = express_http_context_1.default.get('user');
30
- if (user)
32
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
33
+ if (user && !notUpdatedBy)
31
34
  this._update.updatedBy = user._id;
32
35
  next();
33
36
  });
@@ -22,16 +22,19 @@ const evidenceLayoutSchema = new mongoose_1.Schema({
22
22
  }, _config_1.schemaOptions);
23
23
  evidenceLayoutSchema.pre('save', function (next) {
24
24
  const user = express_http_context_1.default.get('user');
25
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
25
26
  if (user) {
26
27
  if (!this.createdBy)
27
28
  this.createdBy = user._id;
28
- this.updatedBy = user._id;
29
+ if (!notUpdatedBy)
30
+ this.updatedBy = user._id;
29
31
  }
30
32
  next();
31
33
  });
32
34
  evidenceLayoutSchema.pre('findOneAndUpdate', function (next) {
33
35
  const user = express_http_context_1.default.get('user');
34
- if (user)
36
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
37
+ if (user && !notUpdatedBy)
35
38
  this._update.updatedBy = user._id;
36
39
  next();
37
40
  });
@@ -92,16 +92,19 @@ const evidenceSchema = new mongoose_1.Schema({
92
92
  }, _config_1.schemaOptions);
93
93
  evidenceSchema.pre('save', function (next) {
94
94
  const user = express_http_context_1.default.get('user');
95
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
95
96
  if (user) {
96
97
  if (!this.createdBy)
97
98
  this.createdBy = user._id;
98
- this.updatedBy = user._id;
99
+ if (!notUpdatedBy)
100
+ this.updatedBy = user._id;
99
101
  }
100
102
  next();
101
103
  });
102
104
  evidenceSchema.pre('findOneAndUpdate', function (next) {
103
105
  const user = express_http_context_1.default.get('user');
104
- if (user)
106
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
107
+ if (user && !notUpdatedBy)
105
108
  this._update.updatedBy = user._id;
106
109
  next();
107
110
  });
@@ -18,16 +18,19 @@ const faqSchema = new mongoose_1.Schema({
18
18
  }, _config_1.schemaOptions);
19
19
  faqSchema.pre('save', function (next) {
20
20
  const user = express_http_context_1.default.get('user');
21
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
21
22
  if (user) {
22
23
  if (!this.createdBy)
23
24
  this.createdBy = user._id;
24
- this.updatedBy = user._id;
25
+ if (!notUpdatedBy)
26
+ this.updatedBy = user._id;
25
27
  }
26
28
  next();
27
29
  });
28
30
  faqSchema.pre('findOneAndUpdate', function (next) {
29
31
  const user = express_http_context_1.default.get('user');
30
- if (user)
32
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
33
+ if (user && !notUpdatedBy)
31
34
  this._update.updatedBy = user._id;
32
35
  next();
33
36
  });
@@ -16,16 +16,19 @@ const featuredThemeSchema = new mongoose_1.Schema({
16
16
  }, _config_1.schemaOptions);
17
17
  featuredThemeSchema.pre('save', function (next) {
18
18
  const user = express_http_context_1.default.get('user');
19
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
19
20
  if (user) {
20
21
  if (!this.createdBy)
21
22
  this.createdBy = user._id;
22
- this.updatedBy = user._id;
23
+ if (!notUpdatedBy)
24
+ this.updatedBy = user._id;
23
25
  }
24
26
  next();
25
27
  });
26
28
  featuredThemeSchema.pre('findOneAndUpdate', function (next) {
27
29
  const user = express_http_context_1.default.get('user');
28
- if (user)
30
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
31
+ if (user && !notUpdatedBy)
29
32
  this._update.updatedBy = user._id;
30
33
  next();
31
34
  });
@@ -26,16 +26,19 @@ const foamTreeSchema = new mongoose_1.Schema({
26
26
  }, _config_1.schemaOptions);
27
27
  foamTreeSchema.pre('save', function (next) {
28
28
  const user = express_http_context_1.default.get('user');
29
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
29
30
  if (user) {
30
31
  if (!this.createdBy)
31
32
  this.createdBy = user._id;
32
- this.updatedBy = user._id;
33
+ if (!notUpdatedBy)
34
+ this.updatedBy = user._id;
33
35
  }
34
36
  next();
35
37
  });
36
38
  foamTreeSchema.pre('findOneAndUpdate', function (next) {
37
39
  const user = express_http_context_1.default.get('user');
38
- if (user)
40
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
41
+ if (user && !notUpdatedBy)
39
42
  this._update.updatedBy = user._id;
40
43
  next();
41
44
  });
@@ -20,16 +20,19 @@ const followContentSchema = new mongoose_1.Schema({
20
20
  }, _config_1.schemaOptions);
21
21
  followContentSchema.pre('save', function (next) {
22
22
  const user = express_http_context_1.default.get('user');
23
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
23
24
  if (user) {
24
25
  if (!this.createdBy)
25
26
  this.createdBy = user._id;
26
- this.updatedBy = user._id;
27
+ if (!notUpdatedBy)
28
+ this.updatedBy = user._id;
27
29
  }
28
30
  next();
29
31
  });
30
32
  followContentSchema.pre('findOneAndUpdate', function (next) {
31
33
  const user = express_http_context_1.default.get('user');
32
- if (user)
34
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
35
+ if (user && !notUpdatedBy)
33
36
  this._update.updatedBy = user._id;
34
37
  next();
35
38
  });
@@ -30,16 +30,19 @@ const aiIHighlightSchema = new mongoose_1.Schema({
30
30
  }, _config_1.schemaOptions);
31
31
  aiIHighlightSchema.pre('save', function (next) {
32
32
  const user = express_http_context_1.default.get('user');
33
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
33
34
  if (user) {
34
35
  if (!this.createdBy)
35
36
  this.createdBy = user._id;
36
- this.updatedBy = user._id;
37
+ if (!notUpdatedBy)
38
+ this.updatedBy = user._id;
37
39
  }
38
40
  next();
39
41
  });
40
42
  aiIHighlightSchema.pre('findOneAndUpdate', function (next) {
41
43
  const user = express_http_context_1.default.get('user');
42
- if (user)
44
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
45
+ if (user && !notUpdatedBy)
43
46
  this._update.updatedBy = user._id;
44
47
  next();
45
48
  });
@@ -29,16 +29,19 @@ const imageSchema = new mongoose_1.Schema({
29
29
  }, _config_1.schemaOptions);
30
30
  imageSchema.pre('save', function (next) {
31
31
  const user = express_http_context_1.default.get('user');
32
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
32
33
  if (user) {
33
34
  if (!this.createdBy)
34
35
  this.createdBy = user._id;
35
- this.updatedBy = user._id;
36
+ if (!notUpdatedBy)
37
+ this.updatedBy = user._id;
36
38
  }
37
39
  next();
38
40
  });
39
41
  imageSchema.pre('findOneAndUpdate', function (next) {
40
42
  const user = express_http_context_1.default.get('user');
41
- if (user)
43
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
44
+ if (user && !notUpdatedBy)
42
45
  this._update.updatedBy = user._id;
43
46
  next();
44
47
  });
@@ -17,16 +17,19 @@ const industrySchema = new mongoose_1.Schema({
17
17
  }, _config_1.schemaOptions);
18
18
  industrySchema.pre('save', function (next) {
19
19
  const user = express_http_context_1.default.get('user');
20
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
20
21
  if (user) {
21
22
  if (!this.createdBy)
22
23
  this.createdBy = user._id;
23
- this.updatedBy = user._id;
24
+ if (!notUpdatedBy)
25
+ this.updatedBy = user._id;
24
26
  }
25
27
  next();
26
28
  });
27
29
  industrySchema.pre('findOneAndUpdate', function (next) {
28
30
  const user = express_http_context_1.default.get('user');
29
- if (user)
31
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
32
+ if (user && !notUpdatedBy)
30
33
  this._update.updatedBy = user._id;
31
34
  next();
32
35
  });
@@ -27,16 +27,19 @@ const likeSchema = new mongoose_1.Schema({
27
27
  }, _config_1.schemaOptions);
28
28
  likeSchema.pre('save', function (next) {
29
29
  const user = express_http_context_1.default.get('user');
30
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
30
31
  if (user) {
31
32
  if (!this.createdBy)
32
33
  this.createdBy = user._id;
33
- this.updatedBy = user._id;
34
+ if (!notUpdatedBy)
35
+ this.updatedBy = user._id;
34
36
  }
35
37
  next();
36
38
  });
37
39
  likeSchema.pre('findOneAndUpdate', function (next) {
38
40
  const user = express_http_context_1.default.get('user');
39
- if (user)
41
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
42
+ if (user && !notUpdatedBy)
40
43
  this._update.updatedBy = user._id;
41
44
  next();
42
45
  });
@@ -16,16 +16,19 @@ const relatedThemeSchema = new mongoose_1.Schema({
16
16
  }, _config_1.schemaOptions);
17
17
  relatedThemeSchema.pre('save', function (next) {
18
18
  const user = express_http_context_1.default.get('user');
19
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
19
20
  if (user) {
20
21
  if (!this.createdBy)
21
22
  this.createdBy = user._id;
22
- this.updatedBy = user._id;
23
+ if (!notUpdatedBy)
24
+ this.updatedBy = user._id;
23
25
  }
24
26
  next();
25
27
  });
26
28
  relatedThemeSchema.pre('findOneAndUpdate', function (next) {
27
29
  const user = express_http_context_1.default.get('user');
28
- if (user)
30
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
31
+ if (user && !notUpdatedBy)
29
32
  this._update.updatedBy = user._id;
30
33
  next();
31
34
  });
@@ -23,16 +23,19 @@ const searchHistorySchema = new mongoose_1.Schema({
23
23
  }, _config_1.schemaOptions);
24
24
  searchHistorySchema.pre('save', function (next) {
25
25
  const user = express_http_context_1.default.get('user');
26
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
26
27
  if (user) {
27
28
  if (!this.createdBy)
28
29
  this.createdBy = user._id;
29
- this.updatedBy = user._id;
30
+ if (!notUpdatedBy)
31
+ this.updatedBy = user._id;
30
32
  }
31
33
  next();
32
34
  });
33
35
  searchHistorySchema.pre('findOneAndUpdate', function (next) {
34
36
  const user = express_http_context_1.default.get('user');
35
- if (user)
37
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
38
+ if (user && !notUpdatedBy)
36
39
  this._update.updatedBy = user._id;
37
40
  next();
38
41
  });
@@ -19,16 +19,19 @@ const sfCategorySchema = new mongoose_1.Schema({
19
19
  }, _config_1.schemaOptions);
20
20
  sfCategorySchema.pre('save', function (next) {
21
21
  const user = express_http_context_1.default.get('user');
22
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
22
23
  if (user) {
23
24
  if (!this.createdBy)
24
25
  this.createdBy = user._id;
25
- this.updatedBy = user._id;
26
+ if (!notUpdatedBy)
27
+ this.updatedBy = user._id;
26
28
  }
27
29
  next();
28
30
  });
29
31
  sfCategorySchema.pre('findOneAndUpdate', function (next) {
30
32
  const user = express_http_context_1.default.get('user');
31
- if (user)
33
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
34
+ if (user && !notUpdatedBy)
32
35
  this._update.updatedBy = user._id;
33
36
  next();
34
37
  });
@@ -18,16 +18,19 @@ const sfSubCategorySchema = new mongoose_1.Schema({
18
18
  }, _config_1.schemaOptions);
19
19
  sfSubCategorySchema.pre('save', function (next) {
20
20
  const user = express_http_context_1.default.get('user');
21
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
21
22
  if (user) {
22
23
  if (!this.createdBy)
23
24
  this.createdBy = user._id;
24
- this.updatedBy = user._id;
25
+ if (!notUpdatedBy)
26
+ this.updatedBy = user._id;
25
27
  }
26
28
  next();
27
29
  });
28
30
  sfSubCategorySchema.pre('findOneAndUpdate', function (next) {
29
31
  const user = express_http_context_1.default.get('user');
30
- if (user)
32
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
33
+ if (user && !notUpdatedBy)
31
34
  this._update.updatedBy = user._id;
32
35
  next();
33
36
  });
@@ -17,16 +17,19 @@ const sfTagSchema = new mongoose_1.Schema({
17
17
  }, _config_1.schemaOptions);
18
18
  sfTagSchema.pre('save', function (next) {
19
19
  const user = express_http_context_1.default.get('user');
20
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
20
21
  if (user) {
21
22
  if (!this.createdBy)
22
23
  this.createdBy = user._id;
23
- this.updatedBy = user._id;
24
+ if (!notUpdatedBy)
25
+ this.updatedBy = user._id;
24
26
  }
25
27
  next();
26
28
  });
27
29
  sfTagSchema.pre('findOneAndUpdate', function (next) {
28
30
  const user = express_http_context_1.default.get('user');
29
- if (user)
31
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
32
+ if (user && !notUpdatedBy)
30
33
  this._update.updatedBy = user._id;
31
34
  next();
32
35
  });
@@ -71,16 +71,19 @@ const sparkUseCaseSchema = new mongoose_1.Schema({
71
71
  }, _config_1.schemaOptions);
72
72
  sparkUseCaseSchema.pre('save', function (next) {
73
73
  const user = express_http_context_1.default.get('user');
74
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
74
75
  if (user) {
75
76
  if (!this.createdBy)
76
77
  this.createdBy = user._id;
77
- this.updatedBy = user._id;
78
+ if (!notUpdatedBy)
79
+ this.updatedBy = user._id;
78
80
  }
79
81
  next();
80
82
  });
81
83
  sparkUseCaseSchema.pre('findOneAndUpdate', function (next) {
82
84
  const user = express_http_context_1.default.get('user');
83
- if (user)
85
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
86
+ if (user && !notUpdatedBy)
84
87
  this._update.updatedBy = user._id;
85
88
  next();
86
89
  });
@@ -49,6 +49,12 @@ const sparkSchema = new mongoose_1.Schema({
49
49
  extraParameter: {
50
50
  sendedNotWorkingAlertEmail: { type: Boolean, default: false },
51
51
  },
52
+ cronJob: {
53
+ startDate: { type: Number, default: 0 },
54
+ endDate: { type: Number, default: 0 },
55
+ status: { type: String, enum: Object.values(spark_type_1.CronJobStatus), default: spark_type_1.CronJobStatus.PENDING },
56
+ message: [{ type: String, default: '' }],
57
+ },
52
58
  rawContent: { type: String, default: '' },
53
59
  createdBy: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User', default: null },
54
60
  updatedBy: { type: mongoose_1.Schema.Types.ObjectId, ref: 'User', default: null },
@@ -23,16 +23,19 @@ const startupAnyEntitySchema = new mongoose_1.Schema({
23
23
  }, _config_1.schemaOptions);
24
24
  startupAnyEntitySchema.pre('save', function (next) {
25
25
  const user = express_http_context_1.default.get('user');
26
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
26
27
  if (user) {
27
28
  if (!this.createdBy)
28
29
  this.createdBy = user._id;
29
- this.updatedBy = user._id;
30
+ if (!notUpdatedBy)
31
+ this.updatedBy = user._id;
30
32
  }
31
33
  next();
32
34
  });
33
35
  startupAnyEntitySchema.pre('findOneAndUpdate', function (next) {
34
36
  const user = express_http_context_1.default.get('user');
35
- if (user)
37
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
38
+ if (user && !notUpdatedBy)
36
39
  this._update.updatedBy = user._id;
37
40
  next();
38
41
  });
@@ -17,16 +17,19 @@ const technologySchema = new mongoose_1.Schema({
17
17
  }, _config_1.schemaOptions);
18
18
  technologySchema.pre('save', function (next) {
19
19
  const user = express_http_context_1.default.get('user');
20
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
20
21
  if (user) {
21
22
  if (!this.createdBy)
22
23
  this.createdBy = user._id;
23
- this.updatedBy = user._id;
24
+ if (!notUpdatedBy)
25
+ this.updatedBy = user._id;
24
26
  }
25
27
  next();
26
28
  });
27
29
  technologySchema.pre('findOneAndUpdate', function (next) {
28
30
  const user = express_http_context_1.default.get('user');
29
- if (user)
31
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
32
+ if (user && !notUpdatedBy)
30
33
  this._update.updatedBy = user._id;
31
34
  next();
32
35
  });
@@ -16,16 +16,19 @@ const useCaseDiscoveryProblemSchema = new mongoose_1.Schema({
16
16
  }, _config_1.schemaOptions);
17
17
  useCaseDiscoveryProblemSchema.pre('save', function (next) {
18
18
  const user = express_http_context_1.default.get('user');
19
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
19
20
  if (user) {
20
21
  if (!this.createdBy)
21
22
  this.createdBy = user._id;
22
- this.updatedBy = user._id;
23
+ if (!notUpdatedBy)
24
+ this.updatedBy = user._id;
23
25
  }
24
26
  next();
25
27
  });
26
28
  useCaseDiscoveryProblemSchema.pre('findOneAndUpdate', function (next) {
27
29
  const user = express_http_context_1.default.get('user');
28
- if (user)
30
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
31
+ if (user && !notUpdatedBy)
29
32
  this._update.updatedBy = user._id;
30
33
  next();
31
34
  });
@@ -33,16 +33,19 @@ const useCaseDiscoverySchema = new mongoose_1.Schema({
33
33
  }, _config_1.schemaOptions);
34
34
  useCaseDiscoverySchema.pre('save', function (next) {
35
35
  const user = express_http_context_1.default.get('user');
36
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
36
37
  if (user) {
37
38
  if (!this.createdBy)
38
39
  this.createdBy = user._id;
39
- this.updatedBy = user._id;
40
+ if (!notUpdatedBy)
41
+ this.updatedBy = user._id;
40
42
  }
41
43
  next();
42
44
  });
43
45
  useCaseDiscoverySchema.pre('findOneAndUpdate', function (next) {
44
46
  const user = express_http_context_1.default.get('user');
45
- if (user)
47
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
48
+ if (user && !notUpdatedBy)
46
49
  this._update.updatedBy = user._id;
47
50
  next();
48
51
  });
@@ -79,16 +79,19 @@ const useCaseSchema = new mongoose_1.Schema({
79
79
  }, _config_1.schemaOptions);
80
80
  useCaseSchema.pre('save', function (next) {
81
81
  const user = express_http_context_1.default.get('user');
82
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
82
83
  if (user) {
83
84
  if (!this.createdBy)
84
85
  this.createdBy = user._id;
85
- this.updatedBy = user._id;
86
+ if (!notUpdatedBy)
87
+ this.updatedBy = user._id;
86
88
  }
87
89
  next();
88
90
  });
89
91
  useCaseSchema.pre('findOneAndUpdate', function (next) {
90
92
  const user = express_http_context_1.default.get('user');
91
- if (user)
93
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
94
+ if (user && !notUpdatedBy)
92
95
  this._update.updatedBy = user._id;
93
96
  next();
94
97
  });
@@ -16,16 +16,19 @@ const userTokenSchema = new mongoose_1.Schema({
16
16
  }, _config_1.schemaOptions);
17
17
  userTokenSchema.pre('save', function (next) {
18
18
  const user = express_http_context_1.default.get('user');
19
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
19
20
  if (user) {
20
21
  if (!this.createdBy)
21
22
  this.createdBy = user._id;
22
- this.updatedBy = user._id;
23
+ if (!notUpdatedBy)
24
+ this.updatedBy = user._id;
23
25
  }
24
26
  next();
25
27
  });
26
28
  userTokenSchema.pre('findOneAndUpdate', function (next) {
27
29
  const user = express_http_context_1.default.get('user');
28
- if (user)
30
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
31
+ if (user && !notUpdatedBy)
29
32
  this._update.updatedBy = user._id;
30
33
  next();
31
34
  });
@@ -18,16 +18,19 @@ const userVisitSchema = new mongoose_1.Schema({
18
18
  }, _config_1.schemaOptions);
19
19
  userVisitSchema.pre('save', function (next) {
20
20
  const user = express_http_context_1.default.get('user');
21
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
21
22
  if (user) {
22
23
  if (!this.createdBy)
23
24
  this.createdBy = user._id;
24
- this.updatedBy = user._id;
25
+ if (!notUpdatedBy)
26
+ this.updatedBy = user._id;
25
27
  }
26
28
  next();
27
29
  });
28
30
  userVisitSchema.pre('findOneAndUpdate', function (next) {
29
31
  const user = express_http_context_1.default.get('user');
30
- if (user)
32
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
33
+ if (user && !notUpdatedBy)
31
34
  this._update.updatedBy = user._id;
32
35
  next();
33
36
  });
@@ -64,10 +64,12 @@ userSchema.pre('save', function (next) {
64
64
  if (this.email)
65
65
  this.email = this.email.toLowerCase();
66
66
  const user = express_http_context_1.default.get('user');
67
+ const notUpdatedBy = express_http_context_1.default.get('notUpdatedBy');
67
68
  if (user) {
68
69
  if (!this.createdBy)
69
70
  this.createdBy = user._id;
70
- this.updatedBy = user._id;
71
+ if (!notUpdatedBy)
72
+ this.updatedBy = user._id;
71
73
  }
72
74
  next();
73
75
  });
@@ -60,6 +60,12 @@ export declare enum SparkPriorityLevel {
60
60
  high = 2,
61
61
  urgent = 3
62
62
  }
63
+ export declare enum CronJobStatus {
64
+ PENDING = "pending",
65
+ IN_PROGRESS = "inProgress",
66
+ COMPLETED = "completed",
67
+ FAILED = "failed"
68
+ }
63
69
  interface EntramindResponseMessage {
64
70
  message: string;
65
71
  date: number;
@@ -69,6 +75,12 @@ interface Requester {
69
75
  requesterId: Types.ObjectId[];
70
76
  requesterType: SparkRequesterType;
71
77
  }
78
+ interface CronJob {
79
+ startDate: number;
80
+ endDate: number;
81
+ status: CronJobStatus;
82
+ message: string[];
83
+ }
72
84
  interface ExtraParameter {
73
85
  sendedNotWorkingAlertEmail: boolean;
74
86
  }
@@ -94,6 +106,7 @@ export interface ISpark extends BaseSchema {
94
106
  autoPublish?: boolean;
95
107
  extraParameter: ExtraParameter;
96
108
  rawContent?: string;
109
+ cronJob: CronJob;
97
110
  }
98
111
  export interface GetAllSpark extends ISpark {
99
112
  useCaseCount: number;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SparkPriorityLevel = exports.SparkPriorityList = exports.SparkRequesterType = exports.EntramindStatusList = exports.SparkStatusList = void 0;
3
+ exports.CronJobStatus = exports.SparkPriorityLevel = exports.SparkPriorityList = exports.SparkRequesterType = exports.EntramindStatusList = exports.SparkStatusList = void 0;
4
4
  var SparkStatusList;
5
5
  (function (SparkStatusList) {
6
6
  SparkStatusList["READY"] = "ready";
@@ -40,3 +40,10 @@ var SparkPriorityLevel;
40
40
  SparkPriorityLevel[SparkPriorityLevel["high"] = 2] = "high";
41
41
  SparkPriorityLevel[SparkPriorityLevel["urgent"] = 3] = "urgent";
42
42
  })(SparkPriorityLevel || (exports.SparkPriorityLevel = SparkPriorityLevel = {}));
43
+ var CronJobStatus;
44
+ (function (CronJobStatus) {
45
+ CronJobStatus["PENDING"] = "pending";
46
+ CronJobStatus["IN_PROGRESS"] = "inProgress";
47
+ CronJobStatus["COMPLETED"] = "completed";
48
+ CronJobStatus["FAILED"] = "failed";
49
+ })(CronJobStatus || (exports.CronJobStatus = CronJobStatus = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cool-digital-solutions/interferir-models",
3
- "version": "1.1.26",
3
+ "version": "1.1.28",
4
4
  "main": "./dist/index.js",
5
5
  "files": [
6
6
  "dist/**/*"