@pintahub/database-schemas 4.2.2 → 4.2.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": "@pintahub/database-schemas",
3
- "version": "4.2.2",
3
+ "version": "4.2.4",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -10,33 +10,53 @@ const LatestEvent = new Schema({
10
10
 
11
11
  product: {
12
12
  type: Schema.Types.ObjectId,
13
- index: true,
14
13
  },
15
14
 
16
15
  session_id: {
17
16
  type: String,
18
17
  trim: true,
19
- index: true,
20
18
  },
21
19
 
22
20
  name: {
23
21
  type: String,
24
22
  trim: true,
25
23
  lowercase: true,
26
- index: true,
24
+ },
25
+
26
+ url: {
27
+ type: String,
28
+ trim: true,
29
+ },
30
+
31
+ ip: {
32
+ type: String,
33
+ trim: true,
27
34
  },
28
35
 
29
36
  country: {
30
37
  type: String,
31
38
  trim: true,
32
- index: true,
33
39
  uppercase: true,
34
40
  },
35
41
 
42
+ user_agent: {
43
+ type: String,
44
+ trim: true,
45
+ },
46
+
47
+ meta: {
48
+ type: Schema.Types.Mixed,
49
+ default: {}
50
+ },
51
+
52
+ viewer_type: {
53
+ type: String,
54
+ trim: true,
55
+ },
56
+
36
57
  referrer_domain: {
37
58
  type: String,
38
59
  trim: true,
39
- index: true,
40
60
  },
41
61
 
42
62
  from_event: {
@@ -47,19 +67,8 @@ const LatestEvent = new Schema({
47
67
  type: Date,
48
68
  default: Date.now,
49
69
  index: true,
50
- expires: 3_600 * 24 * 90//90 days
70
+ expires: 3_600 * 24 * 30//30 days
51
71
  }
52
72
  })
53
73
 
54
-
55
- LatestEvent.index({
56
- store: 1,
57
- product: 1,
58
- name: 1,
59
- session_id: 1,
60
- country: 1,
61
- created_at: 1,
62
- })
63
-
64
74
  module.exports = LatestEvent
65
-
@@ -19,6 +19,12 @@ const MarketingCost = new Schema({
19
19
  trim: true
20
20
  },
21
21
 
22
+ campaign_id: {
23
+ type: String,
24
+ trim: true,
25
+ index: true,
26
+ },
27
+
22
28
  account_name: {
23
29
  type: String,
24
30
  trim: true,