@pintahub/database-schemas 4.5.0 → 4.6.1

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 (73) hide show
  1. package/.claude/settings.local.json +9 -0
  2. package/CLAUDE.md +16 -66
  3. package/package.json +1 -1
  4. package/schemas/Account.js +11 -1
  5. package/schemas/AnnouncementBar.js +12 -1
  6. package/schemas/Artwork.js +12 -1
  7. package/schemas/BlockedLocation.js +6 -0
  8. package/schemas/Collection.js +24 -0
  9. package/schemas/CreatorReport.js +33 -0
  10. package/schemas/CustomField.js +9 -0
  11. package/schemas/Customize.js +13 -0
  12. package/schemas/DimensionObject.js +3 -0
  13. package/schemas/ExportJob.js +19 -1
  14. package/schemas/FavoriteItem.js +8 -1
  15. package/schemas/FieldSetting.js +3 -0
  16. package/schemas/Fulfillment.js +13 -1
  17. package/schemas/Group.js +21 -1
  18. package/schemas/GroupArtwork.js +7 -1
  19. package/schemas/GroupItem.js +9 -1
  20. package/schemas/Image.js +8 -0
  21. package/schemas/ImageObject.js +6 -0
  22. package/schemas/LatestEvent.js +14 -0
  23. package/schemas/LogURL.js +7 -0
  24. package/schemas/MarketingCost.js +13 -0
  25. package/schemas/Media.js +11 -0
  26. package/schemas/MediaUpload.js +16 -1
  27. package/schemas/Menu.js +9 -0
  28. package/schemas/MenuItem.js +14 -0
  29. package/schemas/MoneyObject.js +3 -0
  30. package/schemas/Order.js +38 -1
  31. package/schemas/OrderItem.js +17 -1
  32. package/schemas/Payout.js +10 -1
  33. package/schemas/Post.js +19 -1
  34. package/schemas/PriceRange.js +6 -0
  35. package/schemas/Product.js +67 -5
  36. package/schemas/ProductFeature.js +26 -0
  37. package/schemas/ProductImage.js +15 -0
  38. package/schemas/ProductImport.js +26 -0
  39. package/schemas/ProductRaw.js +22 -0
  40. package/schemas/ProductReport.js +104 -0
  41. package/schemas/ProductTag.js +8 -1
  42. package/schemas/ProductType.js +9 -1
  43. package/schemas/Publication.js +7 -0
  44. package/schemas/RecentView.js +5 -1
  45. package/schemas/Review.js +18 -1
  46. package/schemas/SearchTerm.js +4 -0
  47. package/schemas/Shop.js +10 -0
  48. package/schemas/ShopifyAPI.js +11 -1
  49. package/schemas/ShopifyObject.js +14 -1
  50. package/schemas/ShortDomain.js +10 -1
  51. package/schemas/ShortLog.js +10 -0
  52. package/schemas/ShortUrl.js +14 -0
  53. package/schemas/Store.js +19 -1
  54. package/schemas/StoreEvent.js +13 -1
  55. package/schemas/StoreSetting.js +25 -1
  56. package/schemas/TrackPage.js +9 -1
  57. package/schemas/TransferJob.js +22 -0
  58. package/schemas/User.js +6 -0
  59. package/schemas/WebhookEvent.js +7 -1
  60. package/schemas/products/MediaObject.js +8 -0
  61. package/schemas/products/SeoObject.js +3 -0
  62. package/schemas/products/VideoObject.js +6 -0
  63. package/schemas/types/BrandSettings.js +3 -0
  64. package/schemas/types/DMCASetting.js +3 -0
  65. package/schemas/types/FacebookObject.js +3 -0
  66. package/schemas/types/FooterSetting.js +2 -0
  67. package/schemas/types/FreeShippingSetting.js +3 -0
  68. package/schemas/types/GoogleAnalytics.js +2 -0
  69. package/schemas/types/KlaviyoObject.js +3 -0
  70. package/schemas/types/MerchizeSettings.js +3 -0
  71. package/schemas/types/SocialsObject.js +8 -0
  72. package/schemas/types/TopBarSettings.js +2 -0
  73. package/schemas/types/TrustpilotObject.js +4 -0
@@ -1,28 +1,34 @@
1
1
  const {Schema} = require('mongoose')
2
2
 
3
3
 
4
+ /** Embedded image reference sub-document. Used in Product, Collection, Post, StoreSetting. */
4
5
  const ImageObject = new Schema({
5
6
  _id: false,
6
7
 
8
+ /** Image source ID */
7
9
  id: {
8
10
  type: String,
9
11
  trim: true,
10
12
  },
11
13
 
14
+ /** Alternative text for accessibility */
12
15
  altText: {
13
16
  type: String,
14
17
  trim: true,
15
18
  },
16
19
 
20
+ /** Image URL */
17
21
  url: {
18
22
  type: String,
19
23
  trim: true,
20
24
  },
21
25
 
26
+ /** Width in pixels */
22
27
  width: {
23
28
  type: Number,
24
29
  },
25
30
 
31
+ /** Height in pixels */
26
32
  height: {
27
33
  type: Number,
28
34
  }
@@ -1,68 +1,82 @@
1
1
  const {Schema} = require('mongoose')
2
2
 
3
3
 
4
+ /** Latest event snapshots — TTL: 30 days */
4
5
  const LatestEvent = new Schema({
6
+ /** @ref Store */
5
7
  store: {
6
8
  type: Schema.Types.ObjectId,
7
9
  index: true,
8
10
  required: true,
9
11
  },
10
12
 
13
+ /** @ref Product — related product (if applicable) */
11
14
  product: {
12
15
  type: Schema.Types.ObjectId,
13
16
  },
14
17
 
18
+ /** Visitor session identifier */
15
19
  session_id: {
16
20
  type: String,
17
21
  trim: true,
18
22
  },
19
23
 
24
+ /** Event name, e.g. 'page_view', 'add_to_cart' */
20
25
  name: {
21
26
  type: String,
22
27
  trim: true,
23
28
  lowercase: true,
24
29
  },
25
30
 
31
+ /** URL */
26
32
  url: {
27
33
  type: String,
28
34
  trim: true,
29
35
  },
30
36
 
37
+ /** IP address */
31
38
  ip: {
32
39
  type: String,
33
40
  trim: true,
34
41
  },
35
42
 
43
+ /** ISO country code (uppercase) */
36
44
  country: {
37
45
  type: String,
38
46
  trim: true,
39
47
  uppercase: true,
40
48
  },
41
49
 
50
+ /** Browser user agent string */
42
51
  user_agent: {
43
52
  type: String,
44
53
  trim: true,
45
54
  },
46
55
 
56
+ /** Extra event data */
47
57
  meta: {
48
58
  type: Schema.Types.Mixed,
49
59
  default: {}
50
60
  },
51
61
 
62
+ /** Visitor type: 'human' or 'bot' */
52
63
  viewer_type: {
53
64
  type: String,
54
65
  trim: true,
55
66
  },
56
67
 
68
+ /** HTTP referrer domain */
57
69
  referrer_domain: {
58
70
  type: String,
59
71
  trim: true,
60
72
  },
61
73
 
74
+ /** @ref StoreEvent — original event this snapshot was derived from */
62
75
  from_event: {
63
76
  type: Schema.Types.ObjectId,
64
77
  },
65
78
 
79
+ /** TTL: auto-expires after 30 days */
66
80
  created_at: {
67
81
  type: Date,
68
82
  default: Date.now,
package/schemas/LogURL.js CHANGED
@@ -1,33 +1,40 @@
1
1
  const {Schema} = require('mongoose')
2
2
 
3
3
 
4
+ /** General URL logging */
4
5
  const LogURL = new Schema({
6
+ /** Original URL */
5
7
  url: {
6
8
  type: String,
7
9
  trim: true,
8
10
  },
9
11
 
12
+ /** Redirect target URL */
10
13
  destination_url: {
11
14
  type: String,
12
15
  trim: true,
13
16
  },
14
17
 
18
+ /** Country code (default 'VN') */
15
19
  country: {
16
20
  type: String,
17
21
  trim: true,
18
22
  default: 'VN'
19
23
  },
20
24
 
25
+ /** Domain name */
21
26
  domain: {
22
27
  type: String,
23
28
  trim: true,
24
29
  },
25
30
 
31
+ /** Last update timestamp */
26
32
  updated_at: {
27
33
  type: Date,
28
34
  default: Date.now
29
35
  },
30
36
 
37
+ /** Record creation timestamp */
31
38
  created_at: {
32
39
  type: Date,
33
40
  default: Date.now
@@ -2,67 +2,80 @@ const {Schema} = require('mongoose')
2
2
  const MoneyObject = require('./MoneyObject')
3
3
 
4
4
 
5
+ /** Ad campaign cost tracking per product */
5
6
  const MarketingCost = new Schema({
7
+ /** @ref Store */
6
8
  store: {
7
9
  type: Schema.Types.ObjectId,
8
10
  index: true,
9
11
  required: true
10
12
  },
11
13
 
14
+ /** @ref Product */
12
15
  product: {
13
16
  type: Schema.Types.ObjectId,
14
17
  index: true
15
18
  },
16
19
 
20
+ /** When the associated product was published */
17
21
  product_published_at: {
18
22
  type: Date,
19
23
  index: true,
20
24
  },
21
25
 
26
+ /** Ad campaign name */
22
27
  campaign_name: {
23
28
  type: String,
24
29
  trim: true
25
30
  },
26
31
 
32
+ /** Ad platform campaign ID */
27
33
  campaign_id: {
28
34
  type: String,
29
35
  trim: true,
30
36
  index: true,
31
37
  },
32
38
 
39
+ /** Date the campaign ran */
33
40
  campaign_date: {
34
41
  type: Date,
35
42
  index: true,
36
43
  },
37
44
 
45
+ /** Ad account name */
38
46
  account_name: {
39
47
  type: String,
40
48
  trim: true,
41
49
  index: true,
42
50
  },
43
51
 
52
+ /** Campaign cost amount */
44
53
  cost: {
45
54
  type: MoneyObject,
46
55
  required: true
47
56
  },
48
57
 
58
+ /** Cost date */
49
59
  date: {
50
60
  type: Date,
51
61
  required: true,
52
62
  index: true
53
63
  },
54
64
 
65
+ /** Date as string "YYYY-MM-DD" for grouping */
55
66
  date_string: {
56
67
  type: String,
57
68
  required: true,
58
69
  index: true
59
70
  },
60
71
 
72
+ /** Last update timestamp */
61
73
  updated_at: {
62
74
  type: Date,
63
75
  default: Date.now
64
76
  },
65
77
 
78
+ /** Record creation timestamp */
66
79
  created_at: {
67
80
  type: Date,
68
81
  default: Date.now
package/schemas/Media.js CHANGED
@@ -1,24 +1,29 @@
1
1
  const {Schema} = require('mongoose')
2
2
 
3
3
 
4
+ /** General media files */
4
5
  const Media = new Schema({
6
+ /** @ref Store */
5
7
  store: {
6
8
  type: Schema.Types.ObjectId,
7
9
  index: true,
8
10
  required: true,
9
11
  },
10
12
 
13
+ /** External media ID */
11
14
  id: {
12
15
  type: String,
13
16
  trim: true,
14
17
  index: true,
15
18
  },
16
19
 
20
+ /** URL */
17
21
  url: {
18
22
  type: String,
19
23
  trim: true,
20
24
  },
21
25
 
26
+ /** Upload/processing status, e.g. 'pending', 'completed' */
22
27
  status: {
23
28
  type: String,
24
29
  trim: true,
@@ -26,32 +31,38 @@ const Media = new Schema({
26
31
  default: 'pending'
27
32
  },
28
33
 
34
+ /** Media type, e.g. 'MediaImage' */
29
35
  type: {
30
36
  type: String,
31
37
  trim: true,
32
38
  default: 'MediaImage',
33
39
  },
34
40
 
41
+ /** MIME type, e.g. image/png */
35
42
  mimetype: {
36
43
  type: String,
37
44
  trim: true,
38
45
  },
39
46
 
47
+ /** File size in bytes */
40
48
  size: {
41
49
  type: Number,
42
50
  },
43
51
 
52
+ /** Processing retry count */
44
53
  attempts: {
45
54
  type: Number,
46
55
  default: 0,
47
56
  index: true
48
57
  },
49
58
 
59
+ /** Last update timestamp */
50
60
  updated_at: {
51
61
  type: Date,
52
62
  default: Date.now
53
63
  },
54
64
 
65
+ /** Record creation timestamp */
55
66
  created_at: {
56
67
  type: Date,
57
68
  default: Date.now,
@@ -1,78 +1,93 @@
1
1
  const {Schema} = require('mongoose')
2
2
 
3
3
 
4
+ /** Media upload tracking per product */
4
5
  const MediaUpload = new Schema({
6
+ /** @ref Store */
5
7
  store: {
6
8
  type: Schema.Types.ObjectId,
7
9
  index: true,
8
10
  required: true,
9
11
  },
10
12
 
13
+ /** @ref Product */
11
14
  product: {
12
15
  type: Schema.Types.ObjectId,
13
16
  index: true,
14
17
  required: true,
15
18
  },
16
19
 
20
+ /** Sort order */
17
21
  position: {
18
22
  type: Number,
19
23
  default: 0,
20
24
  index: true,
21
25
  },
22
26
 
27
+ /** Variant color to match this media to */
23
28
  color: {
24
29
  type: String,
25
30
  trim: true,
26
31
  },
27
32
 
33
+ /** Whether this media has been matched to a variant */
28
34
  is_matched: {
29
35
  type: Boolean,
30
36
  default: false,
31
37
  },
32
38
 
39
+ /** Original file name */
33
40
  file_name: {
34
41
  type: String,
35
42
  trim: true,
36
43
  },
37
44
 
45
+ /** Storage file path */
38
46
  path_file: {
39
47
  type: String,
40
48
  trim: true,
41
49
  },
42
50
 
51
+ /** File size in bytes */
43
52
  size: {
44
53
  type: Number,
45
54
  },
46
55
 
56
+ /** MIME type, e.g. image/png */
47
57
  mimetype: {
48
58
  type: String,
49
59
  trim: true,
50
60
  },
51
61
 
62
+ /** Upload status, e.g. 'pending', 'completed' */
52
63
  status: {
53
64
  type: String,
54
65
  trim: true,
55
66
  default: 'pending',
56
67
  },
57
68
 
69
+ /** When the upload was processed */
58
70
  processed_at: {
59
71
  type: Date,
60
72
  },
61
73
 
74
+ /** External media ID */
62
75
  id: {
63
76
  type: String,
64
77
  trim: true,
65
78
  },
66
79
 
80
+ /** Last update timestamp */
67
81
  updated_at: {
68
82
  type: Date,
69
83
  default: Date.now
70
84
  },
71
85
 
86
+ /** Record creation timestamp */
72
87
  created_at: {
73
88
  type: Date,
74
89
  default: Date.now
75
90
  }
76
91
  })
77
92
 
78
- module.exports = MediaUpload
93
+ module.exports = MediaUpload
package/schemas/Menu.js CHANGED
@@ -1,46 +1,55 @@
1
1
  const {Schema} = require('mongoose')
2
2
 
3
3
 
4
+ /** Navigation menu */
4
5
  const Menu = new Schema({
6
+ /** @ref Store */
5
7
  store: {
6
8
  type: Schema.Types.ObjectId,
7
9
  index: true,
8
10
  required: true,
9
11
  },
10
12
 
13
+ /** Shopify menu ID */
11
14
  id: {
12
15
  type: String,
13
16
  trim: true,
14
17
  index: true,
15
18
  },
16
19
 
20
+ /** URL-friendly slug */
17
21
  handle: {
18
22
  type: String,
19
23
  trim: true,
20
24
  index: true,
21
25
  },
22
26
 
27
+ /** Display title */
23
28
  title: {
24
29
  type: String,
25
30
  trim: true,
26
31
  },
27
32
 
33
+ /** Number of menu items */
28
34
  items_count: {
29
35
  type: Number,
30
36
  default: 0,
31
37
  },
32
38
 
39
+ /** Shopify sync identifier */
33
40
  sync_id: {
34
41
  type: String,
35
42
  trim: true,
36
43
  index: true,
37
44
  },
38
45
 
46
+ /** Last update timestamp */
39
47
  updated_at: {
40
48
  type: Date,
41
49
  default: Date.now
42
50
  },
43
51
 
52
+ /** Record creation timestamp */
44
53
  created_at: {
45
54
  type: Date,
46
55
  default: Date.now,
@@ -1,73 +1,87 @@
1
1
  const {Schema} = require('mongoose')
2
2
 
3
3
 
4
+ /** Navigation menu item (hierarchical via parent ref) */
4
5
  const MenuItem = new Schema({
6
+ /** @ref Store */
5
7
  store: {
6
8
  type: Schema.Types.ObjectId,
7
9
  index: true,
8
10
  required: true,
9
11
  },
10
12
 
13
+ /** @ref Menu */
11
14
  menu: {
12
15
  type: Schema.Types.ObjectId,
13
16
  index: true,
14
17
  required: true,
15
18
  },
16
19
 
20
+ /** Shopify menu item ID */
17
21
  id: {
18
22
  type: String,
19
23
  trim: true,
20
24
  index: true,
21
25
  },
22
26
 
27
+ /** Display title */
23
28
  title: {
24
29
  type: String,
25
30
  trim: true,
26
31
  },
27
32
 
33
+ /** Link destination URL */
28
34
  url: {
29
35
  type: String,
30
36
  trim: true,
31
37
  },
32
38
 
39
+ /** Link type, e.g. 'http', 'collection', 'page' */
33
40
  type: {
34
41
  type: String,
35
42
  trim: true,
36
43
  },
37
44
 
45
+ /** Number of child menu items */
38
46
  items_count: {
39
47
  type: Number,
40
48
  default: 0,
41
49
  },
42
50
 
51
+ /** @ref MenuItem — parent item for nesting */
43
52
  parent: {
44
53
  type: Schema.Types.ObjectId,
45
54
  index: true,
46
55
  },
47
56
 
57
+ /** Sort order */
48
58
  position: {
49
59
  type: Number,
50
60
  default: 0,
51
61
  index: true,
52
62
  },
53
63
 
64
+ /** Nesting level (0 = top level) */
54
65
  depth: {
55
66
  type: Number,
56
67
  default: 0,
57
68
  index: true,
58
69
  },
59
70
 
71
+ /** Shopify sync identifier */
60
72
  sync_id: {
61
73
  type: String,
62
74
  trim: true,
63
75
  index: true,
64
76
  },
65
77
 
78
+ /** Last update timestamp */
66
79
  updated_at: {
67
80
  type: Date,
68
81
  default: Date.now
69
82
  },
70
83
 
84
+ /** Record creation timestamp */
71
85
  created_at: {
72
86
  type: Date,
73
87
  default: Date.now,
@@ -1,14 +1,17 @@
1
1
  const {Schema} = require('mongoose')
2
2
 
3
3
 
4
+ /** Embedded sub-document for monetary values */
4
5
  const MoneyObject = new Schema({
5
6
  _id: false,
6
7
 
8
+ /** Monetary value */
7
9
  amount: {
8
10
  type: Number,
9
11
  index: true,
10
12
  },
11
13
 
14
+ /** ISO 4217 currency code, default 'USD' */
12
15
  currency: {
13
16
  type: String,
14
17
  trim: true,