@pintahub/database-schemas 4.5.0 → 4.6.0

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 +8 -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
@@ -13,92 +13,117 @@ const FooterSetting = require('./types/FooterSetting')
13
13
  const FreeShippingSetting = require('./types/FreeShippingSetting')
14
14
 
15
15
 
16
+ /** Store configuration and integrations */
16
17
  const StoreSetting = new Schema({
18
+ /** @ref Store */
17
19
  store: {
18
20
  type: Schema.Types.ObjectId,
19
21
  index: true,
20
22
  required: true,
21
23
  },
22
24
 
25
+ /** Store contact email */
23
26
  contact_email: {
24
27
  type: String,
25
28
  trim: true,
26
29
  },
27
30
 
31
+ /** Brand color settings */
28
32
  brand: {
29
33
  type: BrandSettings,
30
34
  },
31
35
 
36
+ /** Store logo image */
32
37
  logo: {
33
38
  type: ImageObject,
34
39
  },
35
40
 
41
+ /** Description */
36
42
  description: {
37
43
  type: String,
38
44
  trim: true,
39
45
  },
40
46
 
47
+ /** Store physical address */
41
48
  address: {
42
49
  type: String,
43
50
  trim: true,
44
51
  },
45
52
 
53
+ /** Trustpilot review integration */
46
54
  trustpilot: {
47
55
  type: TrustpilotObject,
48
56
  },
49
57
 
58
+ /** Social media profile links */
50
59
  socials: {
51
60
  type: SocialsObject,
52
61
  },
53
62
 
63
+ /** Merchize print-on-demand integration */
54
64
  merchize: {
55
65
  type: MerchizeSettings,
56
66
  },
57
67
 
68
+ /** Google Analytics tracking */
58
69
  google_analytics: {
59
70
  type: GoogleAnalytics,
60
71
  },
61
72
 
73
+ /** Klaviyo email marketing integration */
62
74
  klaviyo: {
63
75
  type: KlaviyoObject,
64
76
  },
65
77
 
78
+ /** Facebook pixel tracking */
66
79
  facebook: {
67
80
  type: FacebookObject,
68
81
  },
69
82
 
83
+ /** Top bar announcement settings */
70
84
  top_bar: {
71
85
  type: TopBarSettings,
72
86
  },
73
87
 
88
+ /** Disable add-to-cart button globally */
74
89
  disable_atc: {
75
90
  type: Boolean,
76
91
  default: false,
77
92
  },
78
93
 
94
+ /** DMCA protection badge */
79
95
  dmca: {
80
96
  type: DMCASetting,
81
97
  },
82
98
 
99
+ /** Footer content settings */
83
100
  footer: {
84
101
  type: FooterSetting,
85
102
  },
86
103
 
104
+ /** Free shipping threshold settings */
87
105
  free_shipping: {
88
106
  type: FreeShippingSetting,
89
107
  },
90
108
 
109
+ /**
110
+ * Product tags display mode:
111
+ * - show: display tags on product pages
112
+ * - hide: hide tags
113
+ */
91
114
  tags_mode: {
92
115
  type: String,
93
116
  trim: true,
94
117
  enum: ['show', 'hide']
95
118
  },
96
119
 
120
+ /** Last update timestamp */
97
121
  updated_at: {
98
122
  type: Date,
99
123
  default: Date.now
100
124
  },
101
125
 
126
+ /** Record creation timestamp */
102
127
  created_at: {
103
128
  type: Date,
104
129
  default: Date.now
@@ -106,4 +131,3 @@ const StoreSetting = new Schema({
106
131
  })
107
132
 
108
133
  module.exports = StoreSetting
109
-
@@ -1,41 +1,49 @@
1
1
  const {Schema} = require('mongoose')
2
2
 
3
3
 
4
+ /** Page access log — TTL: 7 days */
4
5
  const TrackPage = 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
+ /** URL */
11
14
  url: {
12
15
  type: String,
13
16
  trim: true,
14
17
  },
15
18
 
19
+ /** HTTP response status code */
16
20
  status_code: {
17
21
  type: Number,
18
22
  },
19
23
 
24
+ /** IP address */
20
25
  ip: {
21
26
  type: String,
22
27
  trim: true,
23
28
  },
24
29
 
30
+ /** Browser user agent string */
25
31
  user_agent: {
26
32
  type: String,
27
33
  trim: true,
28
34
  },
29
35
 
36
+ /** Last update timestamp */
30
37
  updated_at: {
31
38
  type: Date,
32
39
  default: Date.now
33
40
  },
34
41
 
42
+ /** TTL: auto-expires after 7 days */
35
43
  created_at: {
36
44
  type: Date,
37
45
  default: Date.now,
38
- expires: 3_600 * 24 * 7//2 days
46
+ expires: 3_600 * 24 * 7//7 days
39
47
  }
40
48
  })
41
49
 
@@ -1,39 +1,47 @@
1
1
  const {Schema} = require('mongoose')
2
2
 
3
3
 
4
+ /** Embedded product field overrides for transfer */
4
5
  const OverrideProduct = new Schema({
5
6
  _id: false,
6
7
 
8
+ /** Product type */
7
9
  product_type: {
8
10
  type: String,
9
11
  trim: true,
10
12
  },
11
13
  })
12
14
 
15
+ /** Product transfer job between stores */
13
16
  const TransferJob = new Schema({
17
+ /** @ref Store — source store */
14
18
  store: {
15
19
  type: Schema.Types.ObjectId,
16
20
  index: true,
17
21
  required: true,
18
22
  },
19
23
 
24
+ /** @ref Product — source product to transfer */
20
25
  product: {
21
26
  type: Schema.Types.ObjectId,
22
27
  required: true,
23
28
  index: true,
24
29
  },
25
30
 
31
+ /** Product type */
26
32
  product_type: {
27
33
  type: String,
28
34
  trim: true,
29
35
  index: true,
30
36
  },
31
37
 
38
+ /** @ref Store — destination store */
32
39
  destination_store: {
33
40
  type: Schema.Types.ObjectId,
34
41
  required: true,
35
42
  },
36
43
 
44
+ /** Transfer status, e.g. 'pending', 'processing', 'completed', 'failed' */
37
45
  status: {
38
46
  type: String,
39
47
  trim: true,
@@ -41,69 +49,83 @@ const TransferJob = new Schema({
41
49
  index: true,
42
50
  },
43
51
 
52
+ /** @ref Product — created product in destination store */
44
53
  destination_product: {
45
54
  type: Schema.Types.ObjectId,
46
55
  index: true,
47
56
  },
48
57
 
58
+ /** Product field overrides for the destination */
49
59
  override_product: {
50
60
  type: OverrideProduct,
51
61
  default: {},
52
62
  },
53
63
 
64
+ /** Transfer step statuses */
54
65
  steps: {
55
66
  type: Schema.Types.Mixed,
56
67
  default: {}
57
68
  },
58
69
 
70
+ /** Current processing step name */
59
71
  current_step: {
60
72
  type: String,
61
73
  trim: true,
62
74
  },
63
75
 
76
+ /** Media files to transfer */
64
77
  media: {
65
78
  type: [Schema.Types.Mixed],
66
79
  default: []
67
80
  },
68
81
 
82
+ /** When processing started */
69
83
  processed_at: {
70
84
  type: Date,
71
85
  index: true,
72
86
  },
73
87
 
88
+ /** When job completed */
74
89
  completed_at: {
75
90
  type: Date,
76
91
  },
77
92
 
93
+ /** When job failed */
78
94
  failed_at: {
79
95
  type: Date,
80
96
  },
81
97
 
98
+ /** Processing retry count */
82
99
  attempts: {
83
100
  type: Number,
84
101
  default: 0,
85
102
  index: true
86
103
  },
87
104
 
105
+ /** Total processing time in milliseconds */
88
106
  total_time: {
89
107
  type: Number,
90
108
  default: 0,
91
109
  },
92
110
 
111
+ /** Error message if failed */
93
112
  error_message: {
94
113
  type: String,
95
114
  trim: true,
96
115
  },
97
116
 
117
+ /** Detailed error data */
98
118
  errors: {
99
119
  type: Schema.Types.Mixed,
100
120
  },
101
121
 
122
+ /** Last update timestamp */
102
123
  updated_at: {
103
124
  type: Date,
104
125
  default: Date.now
105
126
  },
106
127
 
128
+ /** Record creation timestamp */
107
129
  created_at: {
108
130
  type: Date,
109
131
  default: Date.now
package/schemas/User.js CHANGED
@@ -1,30 +1,36 @@
1
1
  const {Schema} = require('mongoose')
2
2
 
3
3
 
4
+ /** User-to-Store relationship (maps accounts to stores with roles) */
4
5
  const User = 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 Account */
11
14
  account: {
12
15
  type: Schema.Types.ObjectId,
13
16
  index: true,
14
17
  required: true,
15
18
  },
16
19
 
20
+ /** User role in this store, e.g. 'seller', 'admin' */
17
21
  role: {
18
22
  type: String,
19
23
  trim: true,
20
24
  default: 'seller'
21
25
  },
22
26
 
27
+ /** Last update timestamp */
23
28
  updated_at: {
24
29
  type: Date,
25
30
  default: Date.now
26
31
  },
27
32
 
33
+ /** Record creation timestamp */
28
34
  created_at: {
29
35
  type: Date,
30
36
  default: Date.now
@@ -1,35 +1,42 @@
1
1
  const {Schema} = require('mongoose')
2
2
 
3
3
 
4
+ /** Webhook event queue — TTL: 2 days */
4
5
  const WebhookEvent = 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
+ /** Event topic, e.g. 'orders/create', 'products/update' */
11
14
  topic: {
12
15
  type: String,
13
16
  index: true,
14
17
  required: true,
15
18
  },
16
19
 
20
+ /** Event payload data */
17
21
  payload: {
18
22
  type: Schema.Types.Mixed,
19
23
  default: {},
20
24
  },
21
25
 
26
+ /** Whether this is a test webhook */
22
27
  is_test: {
23
28
  type: Boolean,
24
29
  default: false,
25
30
  },
26
31
 
32
+ /** Processing status, e.g. 'pending', 'processed' */
27
33
  status: {
28
34
  type: String,
29
35
  default: 'pending',
30
36
  index: true,
31
37
  },
32
38
 
39
+ /** TTL: auto-expires after 2 days */
33
40
  created_at: {
34
41
  type: Date,
35
42
  default: Date.now,
@@ -40,4 +47,3 @@ const WebhookEvent = new Schema({
40
47
 
41
48
 
42
49
  module.exports = WebhookEvent
43
-
@@ -1,37 +1,45 @@
1
1
  const {Schema} = require('mongoose')
2
2
 
3
3
 
4
+ /** Embedded product media sub-document */
4
5
  const MediaObject = new Schema({
5
6
  _id: false,
6
7
 
8
+ /** External identifier */
7
9
  id: {
8
10
  type: String,
9
11
  trim: true,
10
12
  },
11
13
 
14
+ /** URL */
12
15
  url: {
13
16
  type: String,
14
17
  trim: true,
15
18
  },
16
19
 
20
+ /** Alternative text for accessibility */
17
21
  alt_text: {
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
  },
29
35
 
36
+ /** MIME type */
30
37
  mime_type: {
31
38
  type: String,
32
39
  trim: true,
33
40
  },
34
41
 
42
+ /** Media content type, e.g. 'IMAGE', 'VIDEO' */
35
43
  content_type: {
36
44
  type: String,
37
45
  trim: true,
@@ -1,14 +1,17 @@
1
1
  const {Schema} = require('mongoose')
2
2
 
3
3
 
4
+ /** Embedded SEO metadata sub-document */
4
5
  const SeoObject = new Schema({
5
6
  _id: false,
6
7
 
8
+ /** Display title */
7
9
  title: {
8
10
  type: String,
9
11
  trim: true,
10
12
  },
11
13
 
14
+ /** Description */
12
15
  description: {
13
16
  type: String,
14
17
  trim: true,
@@ -1,27 +1,33 @@
1
1
  const {Schema} = require('mongoose')
2
2
 
3
3
 
4
+ /** Embedded product video sub-document */
4
5
  const VideoObject = new Schema({
5
6
  _id: false,
6
7
 
8
+ /** External identifier */
7
9
  id: {
8
10
  type: String,
9
11
  trim: true,
10
12
  },
11
13
 
14
+ /** URL */
12
15
  url: {
13
16
  type: String,
14
17
  trim: true,
15
18
  },
16
19
 
20
+ /** Width in pixels */
17
21
  width: {
18
22
  type: Number,
19
23
  },
20
24
 
25
+ /** Height in pixels */
21
26
  height: {
22
27
  type: Number,
23
28
  },
24
29
 
30
+ /** MIME type */
25
31
  mime_type: {
26
32
  type: String,
27
33
  trim: true,
@@ -1,14 +1,17 @@
1
1
  const {Schema} = require('mongoose')
2
2
 
3
3
 
4
+ /** Embedded store brand color settings */
4
5
  const BrandSettings = new Schema({
5
6
  _id: false,
6
7
 
8
+ /** Primary brand color (hex) */
7
9
  primary_color: {
8
10
  type: String,
9
11
  trim: true,
10
12
  },
11
13
 
14
+ /** Secondary brand color (hex) */
12
15
  secondary_color: {
13
16
  type: String,
14
17
  trim: true,
@@ -1,14 +1,17 @@
1
1
  const {Schema} = require('mongoose')
2
2
 
3
3
 
4
+ /** Embedded DMCA protection settings */
4
5
  const DMCASetting = new Schema({
5
6
  _id: false,
6
7
 
8
+ /** DMCA status: 'enabled' or 'disabled' */
7
9
  status: {
8
10
  type: String,
9
11
  trim: true
10
12
  },
11
13
 
14
+ /** DMCA badge/certificate URL */
12
15
  url: {
13
16
  type: String,
14
17
  trim: true,
@@ -1,14 +1,17 @@
1
1
  const {Schema} = require('mongoose')
2
2
 
3
3
 
4
+ /** Embedded Facebook pixel integration settings */
4
5
  const FacebookObject = new Schema({
5
6
  _id: false,
6
7
 
8
+ /** Facebook Pixel ID */
7
9
  pixel_id: {
8
10
  type: String,
9
11
  trim: true,
10
12
  },
11
13
 
14
+ /** Facebook Conversions API access token */
12
15
  access_token: {
13
16
  type: String,
14
17
  trim: true,
@@ -1,9 +1,11 @@
1
1
  const {Schema} = require('mongoose')
2
2
 
3
3
 
4
+ /** Embedded store footer settings */
4
5
  const FooterSetting = new Schema({
5
6
  _id: false,
6
7
 
8
+ /** Footer display content */
7
9
  text: {
8
10
  type: String,
9
11
  trim: true,
@@ -1,15 +1,18 @@
1
1
  const {Schema} = require('mongoose')
2
2
 
3
3
 
4
+ /** Embedded free shipping threshold settings */
4
5
  const FreeShippingSetting = new Schema({
5
6
  _id: false,
6
7
 
8
+ /** 'enabled' or 'disabled' */
7
9
  status: {
8
10
  type: String,
9
11
  trim: true,
10
12
  default: 'disabled',
11
13
  },
12
14
 
15
+ /** Minimum order amount to qualify for free shipping */
13
16
  threshold: {
14
17
  type: Number,
15
18
  }
@@ -1,9 +1,11 @@
1
1
  const {Schema} = require('mongoose')
2
2
 
3
3
 
4
+ /** Embedded Google Analytics settings */
4
5
  const GoogleAnalytics = new Schema({
5
6
  _id: false,
6
7
 
8
+ /** GA4 Measurement ID, e.g. 'G-XXXXXXXXXX' */
7
9
  measurement_id: {
8
10
  type: String,
9
11
  trim: true,
@@ -1,14 +1,17 @@
1
1
  const {Schema} = require('mongoose')
2
2
 
3
3
 
4
+ /** Embedded Klaviyo email marketing settings */
4
5
  const KlaviyoObject = new Schema({
5
6
  _id: false,
6
7
 
8
+ /** Klaviyo public API key */
7
9
  public_api_key: {
8
10
  type: String,
9
11
  trim: true,
10
12
  },
11
13
 
14
+ /** Integration status: 'enabled' or 'disabled' */
12
15
  status: {
13
16
  type: String,
14
17
  trim: true,
@@ -1,14 +1,17 @@
1
1
  const {Schema} = require('mongoose')
2
2
 
3
3
 
4
+ /** Embedded Merchize print-on-demand integration settings */
4
5
  const MerchizeSettings = new Schema({
5
6
  _id: false,
6
7
 
8
+ /** Merchize API base URL */
7
9
  base_url: {
8
10
  type: String,
9
11
  trim: true,
10
12
  },
11
13
 
14
+ /** API access token */
12
15
  access_token: {
13
16
  type: String,
14
17
  trim: true,
@@ -1,39 +1,47 @@
1
1
  const {Schema} = require('mongoose')
2
2
 
3
3
 
4
+ /** Embedded social media profile links */
4
5
  const SocialsObject = new Schema({
5
6
  _id: false,
6
7
 
8
+ /** Facebook profile URL */
7
9
  facebook: {
8
10
  type: String,
9
11
  trim: true,
10
12
  },
11
13
 
14
+ /** Twitter profile URL */
12
15
  twitter: {
13
16
  type: String,
14
17
  trim: true,
15
18
  },
16
19
 
20
+ /** Instagram profile URL */
17
21
  instagram: {
18
22
  type: String,
19
23
  trim: true,
20
24
  },
21
25
 
26
+ /** Pinterest profile URL */
22
27
  pinterest: {
23
28
  type: String,
24
29
  trim: true,
25
30
  },
26
31
 
32
+ /** YouTube channel URL */
27
33
  youtube: {
28
34
  type: String,
29
35
  trim: true,
30
36
  },
31
37
 
38
+ /** LinkedIn profile URL */
32
39
  linkedin: {
33
40
  type: String,
34
41
  trim: true,
35
42
  },
36
43
 
44
+ /** TikTok profile URL */
37
45
  tiktok: {
38
46
  type: String,
39
47
  trim: true,
@@ -1,9 +1,11 @@
1
1
  const {Schema} = require('mongoose')
2
2
 
3
3
 
4
+ /** Embedded top bar announcement settings */
4
5
  const TopBarSettings = new Schema({
5
6
  _id: false,
6
7
 
8
+ /** Announcement display text */
7
9
  content: {
8
10
  type: String,
9
11
  trim: true,