@pintahub/database-schemas 5.8.0 → 6.0.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.
- package/README.md +77 -23
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/interfaces/Account.d.ts +13 -0
- package/dist/interfaces/Account.d.ts.map +1 -0
- package/dist/interfaces/Account.js +3 -0
- package/dist/interfaces/Account.js.map +1 -0
- package/dist/interfaces/AnnouncementBar.d.ts +15 -0
- package/dist/interfaces/AnnouncementBar.d.ts.map +1 -0
- package/dist/interfaces/AnnouncementBar.js +3 -0
- package/dist/interfaces/AnnouncementBar.js.map +1 -0
- package/dist/interfaces/Artwork.d.ts +15 -0
- package/dist/interfaces/Artwork.d.ts.map +1 -0
- package/dist/interfaces/Artwork.js +3 -0
- package/dist/interfaces/Artwork.js.map +1 -0
- package/dist/interfaces/BlockedLocation.d.ts +9 -0
- package/dist/interfaces/BlockedLocation.d.ts.map +1 -0
- package/dist/interfaces/BlockedLocation.js +3 -0
- package/dist/interfaces/BlockedLocation.js.map +1 -0
- package/dist/interfaces/Collection.d.ts +33 -0
- package/dist/interfaces/Collection.d.ts.map +1 -0
- package/dist/interfaces/Collection.js +3 -0
- package/dist/interfaces/Collection.js.map +1 -0
- package/dist/interfaces/CreatorReport.d.ts +29 -0
- package/dist/interfaces/CreatorReport.d.ts.map +1 -0
- package/dist/interfaces/CreatorReport.js +3 -0
- package/dist/interfaces/CreatorReport.js.map +1 -0
- package/dist/interfaces/CustomField.d.ts +15 -0
- package/dist/interfaces/CustomField.d.ts.map +1 -0
- package/dist/interfaces/CustomField.js +3 -0
- package/dist/interfaces/CustomField.js.map +1 -0
- package/dist/interfaces/Customize.d.ts +12 -0
- package/dist/interfaces/Customize.d.ts.map +1 -0
- package/dist/interfaces/Customize.js +3 -0
- package/dist/interfaces/Customize.js.map +1 -0
- package/dist/interfaces/DimensionObject.d.ts +5 -0
- package/dist/interfaces/DimensionObject.d.ts.map +1 -0
- package/dist/interfaces/DimensionObject.js +3 -0
- package/dist/interfaces/DimensionObject.js.map +1 -0
- package/dist/interfaces/ExportJob.d.ts +17 -0
- package/dist/interfaces/ExportJob.d.ts.map +1 -0
- package/dist/interfaces/ExportJob.js +3 -0
- package/dist/interfaces/ExportJob.js.map +1 -0
- package/dist/interfaces/FavoriteItem.d.ts +10 -0
- package/dist/interfaces/FavoriteItem.d.ts.map +1 -0
- package/dist/interfaces/FavoriteItem.js +3 -0
- package/dist/interfaces/FavoriteItem.js.map +1 -0
- package/dist/interfaces/FieldSetting.d.ts +5 -0
- package/dist/interfaces/FieldSetting.d.ts.map +1 -0
- package/dist/interfaces/FieldSetting.js +3 -0
- package/dist/interfaces/FieldSetting.js.map +1 -0
- package/dist/interfaces/Fulfillment.d.ts +16 -0
- package/dist/interfaces/Fulfillment.d.ts.map +1 -0
- package/dist/interfaces/Fulfillment.js +3 -0
- package/dist/interfaces/Fulfillment.js.map +1 -0
- package/dist/interfaces/Group.d.ts +24 -0
- package/dist/interfaces/Group.d.ts.map +1 -0
- package/dist/interfaces/Group.js +3 -0
- package/dist/interfaces/Group.js.map +1 -0
- package/dist/interfaces/GroupArtwork.d.ts +10 -0
- package/dist/interfaces/GroupArtwork.d.ts.map +1 -0
- package/dist/interfaces/GroupArtwork.js +3 -0
- package/dist/interfaces/GroupArtwork.js.map +1 -0
- package/dist/interfaces/GroupItem.d.ts +12 -0
- package/dist/interfaces/GroupItem.d.ts.map +1 -0
- package/dist/interfaces/GroupItem.js +3 -0
- package/dist/interfaces/GroupItem.js.map +1 -0
- package/dist/interfaces/Image.d.ts +12 -0
- package/dist/interfaces/Image.d.ts.map +1 -0
- package/dist/interfaces/Image.js +3 -0
- package/dist/interfaces/Image.js.map +1 -0
- package/dist/interfaces/ImageObject.d.ts +8 -0
- package/dist/interfaces/ImageObject.d.ts.map +1 -0
- package/dist/interfaces/ImageObject.js +3 -0
- package/dist/interfaces/ImageObject.js.map +1 -0
- package/dist/interfaces/LatestEvent.d.ts +17 -0
- package/dist/interfaces/LatestEvent.d.ts.map +1 -0
- package/dist/interfaces/LatestEvent.js +3 -0
- package/dist/interfaces/LatestEvent.js.map +1 -0
- package/dist/interfaces/LogURL.d.ts +9 -0
- package/dist/interfaces/LogURL.d.ts.map +1 -0
- package/dist/interfaces/LogURL.js +3 -0
- package/dist/interfaces/LogURL.js.map +1 -0
- package/dist/interfaces/MarketingCost.d.ts +19 -0
- package/dist/interfaces/MarketingCost.d.ts.map +1 -0
- package/dist/interfaces/MarketingCost.js +3 -0
- package/dist/interfaces/MarketingCost.js.map +1 -0
- package/dist/interfaces/Media.d.ts +14 -0
- package/dist/interfaces/Media.d.ts.map +1 -0
- package/dist/interfaces/Media.js +3 -0
- package/dist/interfaces/Media.js.map +1 -0
- package/dist/interfaces/MediaUpload.d.ts +18 -0
- package/dist/interfaces/MediaUpload.d.ts.map +1 -0
- package/dist/interfaces/MediaUpload.js +3 -0
- package/dist/interfaces/MediaUpload.js.map +1 -0
- package/dist/interfaces/Menu.d.ts +12 -0
- package/dist/interfaces/Menu.d.ts.map +1 -0
- package/dist/interfaces/Menu.js +3 -0
- package/dist/interfaces/Menu.js.map +1 -0
- package/dist/interfaces/MenuItem.d.ts +17 -0
- package/dist/interfaces/MenuItem.d.ts.map +1 -0
- package/dist/interfaces/MenuItem.js +3 -0
- package/dist/interfaces/MenuItem.js.map +1 -0
- package/dist/interfaces/MoneyObject.d.ts +5 -0
- package/dist/interfaces/MoneyObject.d.ts.map +1 -0
- package/dist/interfaces/MoneyObject.js +3 -0
- package/dist/interfaces/MoneyObject.js.map +1 -0
- package/dist/interfaces/Order.d.ts +41 -0
- package/dist/interfaces/Order.d.ts.map +1 -0
- package/dist/interfaces/Order.js +3 -0
- package/dist/interfaces/Order.js.map +1 -0
- package/dist/interfaces/OrderItem.d.ts +21 -0
- package/dist/interfaces/OrderItem.d.ts.map +1 -0
- package/dist/interfaces/OrderItem.js +3 -0
- package/dist/interfaces/OrderItem.js.map +1 -0
- package/dist/interfaces/Payout.d.ts +14 -0
- package/dist/interfaces/Payout.d.ts.map +1 -0
- package/dist/interfaces/Payout.js +3 -0
- package/dist/interfaces/Payout.js.map +1 -0
- package/dist/interfaces/Post.d.ts +23 -0
- package/dist/interfaces/Post.d.ts.map +1 -0
- package/dist/interfaces/Post.js +3 -0
- package/dist/interfaces/Post.js.map +1 -0
- package/dist/interfaces/PriceRange.d.ts +11 -0
- package/dist/interfaces/PriceRange.d.ts.map +1 -0
- package/dist/interfaces/PriceRange.js +3 -0
- package/dist/interfaces/PriceRange.js.map +1 -0
- package/dist/interfaces/Product.d.ts +68 -0
- package/dist/interfaces/Product.d.ts.map +1 -0
- package/dist/interfaces/Product.js +3 -0
- package/dist/interfaces/Product.js.map +1 -0
- package/dist/interfaces/ProductFeature.d.ts +38 -0
- package/dist/interfaces/ProductFeature.d.ts.map +1 -0
- package/dist/interfaces/ProductFeature.js +3 -0
- package/dist/interfaces/ProductFeature.js.map +1 -0
- package/dist/interfaces/ProductImage.d.ts +18 -0
- package/dist/interfaces/ProductImage.d.ts.map +1 -0
- package/dist/interfaces/ProductImage.js +3 -0
- package/dist/interfaces/ProductImage.js.map +1 -0
- package/dist/interfaces/ProductImport.d.ts +25 -0
- package/dist/interfaces/ProductImport.d.ts.map +1 -0
- package/dist/interfaces/ProductImport.js +3 -0
- package/dist/interfaces/ProductImport.js.map +1 -0
- package/dist/interfaces/ProductRaw.d.ts +28 -0
- package/dist/interfaces/ProductRaw.d.ts.map +1 -0
- package/dist/interfaces/ProductRaw.js +3 -0
- package/dist/interfaces/ProductRaw.js.map +1 -0
- package/dist/interfaces/ProductReport.d.ts +19 -0
- package/dist/interfaces/ProductReport.d.ts.map +1 -0
- package/dist/interfaces/ProductReport.js +3 -0
- package/dist/interfaces/ProductReport.js.map +1 -0
- package/dist/interfaces/ProductTag.d.ts +11 -0
- package/dist/interfaces/ProductTag.d.ts.map +1 -0
- package/dist/interfaces/ProductTag.js +3 -0
- package/dist/interfaces/ProductTag.js.map +1 -0
- package/dist/interfaces/ProductType.d.ts +12 -0
- package/dist/interfaces/ProductType.d.ts.map +1 -0
- package/dist/interfaces/ProductType.js +3 -0
- package/dist/interfaces/ProductType.js.map +1 -0
- package/dist/interfaces/Publication.d.ts +10 -0
- package/dist/interfaces/Publication.d.ts.map +1 -0
- package/dist/interfaces/Publication.js +3 -0
- package/dist/interfaces/Publication.js.map +1 -0
- package/dist/interfaces/RecentView.d.ts +8 -0
- package/dist/interfaces/RecentView.d.ts.map +1 -0
- package/dist/interfaces/RecentView.js +3 -0
- package/dist/interfaces/RecentView.js.map +1 -0
- package/dist/interfaces/RelatedProduct.d.ts +9 -0
- package/dist/interfaces/RelatedProduct.d.ts.map +1 -0
- package/dist/interfaces/RelatedProduct.js +3 -0
- package/dist/interfaces/RelatedProduct.js.map +1 -0
- package/dist/interfaces/Review.d.ts +21 -0
- package/dist/interfaces/Review.d.ts.map +1 -0
- package/dist/interfaces/Review.js +3 -0
- package/dist/interfaces/Review.js.map +1 -0
- package/dist/interfaces/SearchTerm.d.ts +7 -0
- package/dist/interfaces/SearchTerm.d.ts.map +1 -0
- package/dist/interfaces/SearchTerm.js +3 -0
- package/dist/interfaces/SearchTerm.js.map +1 -0
- package/dist/interfaces/Shop.d.ts +13 -0
- package/dist/interfaces/Shop.d.ts.map +1 -0
- package/dist/interfaces/Shop.js +3 -0
- package/dist/interfaces/Shop.js.map +1 -0
- package/dist/interfaces/ShopifyAPI.d.ts +14 -0
- package/dist/interfaces/ShopifyAPI.d.ts.map +1 -0
- package/dist/interfaces/ShopifyAPI.js +3 -0
- package/dist/interfaces/ShopifyAPI.js.map +1 -0
- package/dist/interfaces/ShopifyAPIRequest.d.ts +18 -0
- package/dist/interfaces/ShopifyAPIRequest.d.ts.map +1 -0
- package/dist/interfaces/ShopifyAPIRequest.js +3 -0
- package/dist/interfaces/ShopifyAPIRequest.js.map +1 -0
- package/dist/interfaces/ShopifyObject.d.ts +16 -0
- package/dist/interfaces/ShopifyObject.d.ts.map +1 -0
- package/dist/interfaces/ShopifyObject.js +3 -0
- package/dist/interfaces/ShopifyObject.js.map +1 -0
- package/dist/interfaces/ShortDomain.d.ts +13 -0
- package/dist/interfaces/ShortDomain.d.ts.map +1 -0
- package/dist/interfaces/ShortDomain.js +3 -0
- package/dist/interfaces/ShortDomain.js.map +1 -0
- package/dist/interfaces/ShortLog.d.ts +13 -0
- package/dist/interfaces/ShortLog.d.ts.map +1 -0
- package/dist/interfaces/ShortLog.js +3 -0
- package/dist/interfaces/ShortLog.js.map +1 -0
- package/dist/interfaces/ShortUrl.d.ts +16 -0
- package/dist/interfaces/ShortUrl.d.ts.map +1 -0
- package/dist/interfaces/ShortUrl.js +3 -0
- package/dist/interfaces/ShortUrl.js.map +1 -0
- package/dist/interfaces/Store.d.ts +18 -0
- package/dist/interfaces/Store.d.ts.map +1 -0
- package/dist/interfaces/Store.js +3 -0
- package/dist/interfaces/Store.js.map +1 -0
- package/dist/interfaces/StoreEvent.d.ts +16 -0
- package/dist/interfaces/StoreEvent.d.ts.map +1 -0
- package/dist/interfaces/StoreEvent.js +3 -0
- package/dist/interfaces/StoreEvent.js.map +1 -0
- package/dist/interfaces/StoreSetting.d.ts +61 -0
- package/dist/interfaces/StoreSetting.d.ts.map +1 -0
- package/dist/interfaces/StoreSetting.js +3 -0
- package/dist/interfaces/StoreSetting.js.map +1 -0
- package/dist/interfaces/TempUpload.d.ts +15 -0
- package/dist/interfaces/TempUpload.d.ts.map +1 -0
- package/dist/interfaces/TempUpload.js +3 -0
- package/dist/interfaces/TempUpload.js.map +1 -0
- package/dist/interfaces/TrackPage.d.ts +11 -0
- package/dist/interfaces/TrackPage.d.ts.map +1 -0
- package/dist/interfaces/TrackPage.js +3 -0
- package/dist/interfaces/TrackPage.js.map +1 -0
- package/dist/interfaces/TransferJob.d.ts +25 -0
- package/dist/interfaces/TransferJob.d.ts.map +1 -0
- package/dist/interfaces/TransferJob.js +3 -0
- package/dist/interfaces/TransferJob.js.map +1 -0
- package/dist/interfaces/User.d.ts +9 -0
- package/dist/interfaces/User.d.ts.map +1 -0
- package/dist/interfaces/User.js +3 -0
- package/dist/interfaces/User.js.map +1 -0
- package/dist/interfaces/WebhookEvent.d.ts +10 -0
- package/dist/interfaces/WebhookEvent.d.ts.map +1 -0
- package/dist/interfaces/WebhookEvent.js +3 -0
- package/dist/interfaces/WebhookEvent.js.map +1 -0
- package/dist/interfaces/products/MediaObject.d.ts +10 -0
- package/dist/interfaces/products/MediaObject.d.ts.map +1 -0
- package/dist/interfaces/products/MediaObject.js +3 -0
- package/dist/interfaces/products/MediaObject.js.map +1 -0
- package/dist/interfaces/products/SeoObject.d.ts +5 -0
- package/dist/interfaces/products/SeoObject.d.ts.map +1 -0
- package/dist/interfaces/products/SeoObject.js +3 -0
- package/dist/interfaces/products/SeoObject.js.map +1 -0
- package/dist/interfaces/products/VideoObject.d.ts +8 -0
- package/dist/interfaces/products/VideoObject.d.ts.map +1 -0
- package/dist/interfaces/products/VideoObject.js +3 -0
- package/dist/interfaces/products/VideoObject.js.map +1 -0
- package/dist/interfaces/types/BrandSettings.d.ts +5 -0
- package/dist/interfaces/types/BrandSettings.d.ts.map +1 -0
- package/dist/interfaces/types/BrandSettings.js +3 -0
- package/dist/interfaces/types/BrandSettings.js.map +1 -0
- package/dist/interfaces/types/DMCASetting.d.ts +5 -0
- package/dist/interfaces/types/DMCASetting.d.ts.map +1 -0
- package/dist/interfaces/types/DMCASetting.js +3 -0
- package/dist/interfaces/types/DMCASetting.js.map +1 -0
- package/dist/interfaces/types/FacebookObject.d.ts +5 -0
- package/dist/interfaces/types/FacebookObject.d.ts.map +1 -0
- package/dist/interfaces/types/FacebookObject.js +3 -0
- package/dist/interfaces/types/FacebookObject.js.map +1 -0
- package/dist/interfaces/types/FooterSetting.d.ts +4 -0
- package/dist/interfaces/types/FooterSetting.d.ts.map +1 -0
- package/dist/interfaces/types/FooterSetting.js +3 -0
- package/dist/interfaces/types/FooterSetting.js.map +1 -0
- package/dist/interfaces/types/FreeShippingSetting.d.ts +5 -0
- package/dist/interfaces/types/FreeShippingSetting.d.ts.map +1 -0
- package/dist/interfaces/types/FreeShippingSetting.js +3 -0
- package/dist/interfaces/types/FreeShippingSetting.js.map +1 -0
- package/dist/interfaces/types/GoogleAnalytics.d.ts +4 -0
- package/dist/interfaces/types/GoogleAnalytics.d.ts.map +1 -0
- package/dist/interfaces/types/GoogleAnalytics.js +3 -0
- package/dist/interfaces/types/GoogleAnalytics.js.map +1 -0
- package/dist/interfaces/types/KlaviyoObject.d.ts +5 -0
- package/dist/interfaces/types/KlaviyoObject.d.ts.map +1 -0
- package/dist/interfaces/types/KlaviyoObject.js +3 -0
- package/dist/interfaces/types/KlaviyoObject.js.map +1 -0
- package/dist/interfaces/types/MerchizeSettings.d.ts +5 -0
- package/dist/interfaces/types/MerchizeSettings.d.ts.map +1 -0
- package/dist/interfaces/types/MerchizeSettings.js +3 -0
- package/dist/interfaces/types/MerchizeSettings.js.map +1 -0
- package/dist/interfaces/types/SocialsObject.d.ts +10 -0
- package/dist/interfaces/types/SocialsObject.d.ts.map +1 -0
- package/dist/interfaces/types/SocialsObject.js +3 -0
- package/dist/interfaces/types/SocialsObject.js.map +1 -0
- package/dist/interfaces/types/TopBarSettings.d.ts +4 -0
- package/dist/interfaces/types/TopBarSettings.d.ts.map +1 -0
- package/dist/interfaces/types/TopBarSettings.js +3 -0
- package/dist/interfaces/types/TopBarSettings.js.map +1 -0
- package/dist/interfaces/types/TrustpilotObject.d.ts +6 -0
- package/dist/interfaces/types/TrustpilotObject.d.ts.map +1 -0
- package/dist/interfaces/types/TrustpilotObject.js +3 -0
- package/dist/interfaces/types/TrustpilotObject.js.map +1 -0
- package/dist/schemas/Account.d.ts +31 -0
- package/dist/schemas/Account.d.ts.map +1 -0
- package/{schemas → dist/schemas}/Account.js +6 -16
- package/dist/schemas/Account.js.map +1 -0
- package/dist/schemas/AnnouncementBar.d.ts +31 -0
- package/dist/schemas/AnnouncementBar.d.ts.map +1 -0
- package/{schemas → dist/schemas}/AnnouncementBar.js +7 -18
- package/dist/schemas/AnnouncementBar.js.map +1 -0
- package/dist/schemas/Artwork.d.ts +31 -0
- package/dist/schemas/Artwork.d.ts.map +1 -0
- package/{schemas → dist/schemas}/Artwork.js +7 -18
- package/dist/schemas/Artwork.js.map +1 -0
- package/dist/schemas/BlockedLocation.d.ts +31 -0
- package/dist/schemas/BlockedLocation.d.ts.map +1 -0
- package/{schemas → dist/schemas}/BlockedLocation.js +7 -12
- package/dist/schemas/BlockedLocation.js.map +1 -0
- package/dist/schemas/Collection.d.ts +31 -0
- package/dist/schemas/Collection.d.ts.map +1 -0
- package/{schemas → dist/schemas}/Collection.js +10 -33
- package/dist/schemas/Collection.js.map +1 -0
- package/dist/schemas/CreatorReport.d.ts +35 -0
- package/dist/schemas/CreatorReport.d.ts.map +1 -0
- package/{schemas → dist/schemas}/CreatorReport.js +11 -29
- package/dist/schemas/CreatorReport.js.map +1 -0
- package/dist/schemas/CustomField.d.ts +31 -0
- package/dist/schemas/CustomField.d.ts.map +1 -0
- package/{schemas → dist/schemas}/CustomField.js +8 -16
- package/dist/schemas/CustomField.js.map +1 -0
- package/dist/schemas/Customize.d.ts +31 -0
- package/dist/schemas/Customize.d.ts.map +1 -0
- package/{schemas → dist/schemas}/Customize.js +8 -16
- package/dist/schemas/Customize.js.map +1 -0
- package/dist/schemas/DimensionObject.d.ts +31 -0
- package/dist/schemas/DimensionObject.d.ts.map +1 -0
- package/{schemas → dist/schemas}/DimensionObject.js +6 -9
- package/dist/schemas/DimensionObject.js.map +1 -0
- package/dist/schemas/ExportJob.d.ts +31 -0
- package/dist/schemas/ExportJob.d.ts.map +1 -0
- package/{schemas → dist/schemas}/ExportJob.js +10 -23
- package/dist/schemas/ExportJob.js.map +1 -0
- package/dist/schemas/FavoriteItem.d.ts +31 -0
- package/dist/schemas/FavoriteItem.d.ts.map +1 -0
- package/{schemas → dist/schemas}/FavoriteItem.js +9 -16
- package/dist/schemas/FavoriteItem.js.map +1 -0
- package/dist/schemas/FieldSetting.d.ts +31 -0
- package/dist/schemas/FieldSetting.d.ts.map +1 -0
- package/{schemas → dist/schemas}/FieldSetting.js +6 -9
- package/dist/schemas/FieldSetting.js.map +1 -0
- package/dist/schemas/Fulfillment.d.ts +31 -0
- package/dist/schemas/Fulfillment.d.ts.map +1 -0
- package/{schemas → dist/schemas}/Fulfillment.js +8 -20
- package/dist/schemas/Fulfillment.js.map +1 -0
- package/dist/schemas/Group.d.ts +31 -0
- package/dist/schemas/Group.d.ts.map +1 -0
- package/{schemas → dist/schemas}/Group.js +9 -29
- package/dist/schemas/Group.js.map +1 -0
- package/dist/schemas/GroupArtwork.d.ts +31 -0
- package/dist/schemas/GroupArtwork.d.ts.map +1 -0
- package/{schemas → dist/schemas}/GroupArtwork.js +9 -15
- package/dist/schemas/GroupArtwork.js.map +1 -0
- package/dist/schemas/GroupItem.d.ts +31 -0
- package/dist/schemas/GroupItem.d.ts.map +1 -0
- package/{schemas → dist/schemas}/GroupItem.js +9 -16
- package/dist/schemas/GroupItem.js.map +1 -0
- package/dist/schemas/Image.d.ts +31 -0
- package/dist/schemas/Image.d.ts.map +1 -0
- package/{schemas → dist/schemas}/Image.js +8 -15
- package/dist/schemas/Image.js.map +1 -0
- package/dist/schemas/ImageObject.d.ts +31 -0
- package/dist/schemas/ImageObject.d.ts.map +1 -0
- package/{schemas → dist/schemas}/ImageObject.js +6 -12
- package/dist/schemas/ImageObject.js.map +1 -0
- package/dist/schemas/LatestEvent.d.ts +31 -0
- package/dist/schemas/LatestEvent.d.ts.map +1 -0
- package/{schemas → dist/schemas}/LatestEvent.js +11 -24
- package/dist/schemas/LatestEvent.js.map +1 -0
- package/dist/schemas/LogURL.d.ts +31 -0
- package/dist/schemas/LogURL.d.ts.map +1 -0
- package/{schemas → dist/schemas}/LogURL.js +6 -13
- package/dist/schemas/LogURL.js.map +1 -0
- package/dist/schemas/MarketingCost.d.ts +31 -0
- package/dist/schemas/MarketingCost.d.ts.map +1 -0
- package/{schemas → dist/schemas}/MarketingCost.js +12 -27
- package/dist/schemas/MarketingCost.js.map +1 -0
- package/dist/schemas/Media.d.ts +31 -0
- package/dist/schemas/Media.d.ts.map +1 -0
- package/{schemas → dist/schemas}/Media.js +7 -17
- package/dist/schemas/Media.js.map +1 -0
- package/dist/schemas/MediaUpload.d.ts +31 -0
- package/dist/schemas/MediaUpload.d.ts.map +1 -0
- package/{schemas → dist/schemas}/MediaUpload.js +8 -22
- package/dist/schemas/MediaUpload.js.map +1 -0
- package/dist/schemas/Menu.d.ts +31 -0
- package/dist/schemas/Menu.d.ts.map +1 -0
- package/{schemas → dist/schemas}/Menu.js +7 -15
- package/dist/schemas/Menu.js.map +1 -0
- package/dist/schemas/MenuItem.d.ts +31 -0
- package/dist/schemas/MenuItem.d.ts.map +1 -0
- package/{schemas → dist/schemas}/MenuItem.js +9 -22
- package/dist/schemas/MenuItem.js.map +1 -0
- package/dist/schemas/MoneyObject.d.ts +31 -0
- package/dist/schemas/MoneyObject.d.ts.map +1 -0
- package/{schemas → dist/schemas}/MoneyObject.js +6 -9
- package/dist/schemas/MoneyObject.js.map +1 -0
- package/dist/schemas/Order.d.ts +31 -0
- package/dist/schemas/Order.d.ts.map +1 -0
- package/{schemas → dist/schemas}/Order.js +12 -51
- package/dist/schemas/Order.js.map +1 -0
- package/dist/schemas/OrderItem.d.ts +31 -0
- package/dist/schemas/OrderItem.d.ts.map +1 -0
- package/{schemas → dist/schemas}/OrderItem.js +10 -26
- package/dist/schemas/OrderItem.js.map +1 -0
- package/dist/schemas/Payout.d.ts +31 -0
- package/dist/schemas/Payout.d.ts.map +1 -0
- package/{schemas → dist/schemas}/Payout.js +8 -18
- package/dist/schemas/Payout.js.map +1 -0
- package/dist/schemas/Post.d.ts +31 -0
- package/dist/schemas/Post.d.ts.map +1 -0
- package/{schemas → dist/schemas}/Post.js +12 -31
- package/dist/schemas/Post.js.map +1 -0
- package/dist/schemas/PriceRange.d.ts +31 -0
- package/dist/schemas/PriceRange.d.ts.map +1 -0
- package/{schemas → dist/schemas}/PriceRange.js +8 -14
- package/dist/schemas/PriceRange.js.map +1 -0
- package/dist/schemas/Product.d.ts +31 -0
- package/dist/schemas/Product.d.ts.map +1 -0
- package/{schemas → dist/schemas}/Product.js +44 -117
- package/dist/schemas/Product.js.map +1 -0
- package/dist/schemas/ProductFeature.d.ts +31 -0
- package/dist/schemas/ProductFeature.d.ts.map +1 -0
- package/{schemas → dist/schemas}/ProductFeature.js +12 -37
- package/dist/schemas/ProductFeature.js.map +1 -0
- package/dist/schemas/ProductImage.d.ts +31 -0
- package/dist/schemas/ProductImage.d.ts.map +1 -0
- package/{schemas → dist/schemas}/ProductImage.js +10 -24
- package/dist/schemas/ProductImage.js.map +1 -0
- package/dist/schemas/ProductImport.d.ts +31 -0
- package/dist/schemas/ProductImport.d.ts.map +1 -0
- package/{schemas → dist/schemas}/ProductImport.js +14 -35
- package/dist/schemas/ProductImport.js.map +1 -0
- package/dist/schemas/ProductRaw.d.ts +31 -0
- package/dist/schemas/ProductRaw.d.ts.map +1 -0
- package/{schemas → dist/schemas}/ProductRaw.js +12 -33
- package/dist/schemas/ProductRaw.js.map +1 -0
- package/dist/schemas/ProductReport.d.ts +35 -0
- package/dist/schemas/ProductReport.d.ts.map +1 -0
- package/{schemas → dist/schemas}/ProductReport.js +8 -24
- package/dist/schemas/ProductReport.js.map +1 -0
- package/dist/schemas/ProductTag.d.ts +31 -0
- package/dist/schemas/ProductTag.d.ts.map +1 -0
- package/{schemas → dist/schemas}/ProductTag.js +7 -14
- package/dist/schemas/ProductTag.js.map +1 -0
- package/dist/schemas/ProductType.d.ts +31 -0
- package/dist/schemas/ProductType.d.ts.map +1 -0
- package/{schemas → dist/schemas}/ProductType.js +8 -16
- package/dist/schemas/ProductType.js.map +1 -0
- package/dist/schemas/Publication.d.ts +31 -0
- package/dist/schemas/Publication.d.ts.map +1 -0
- package/{schemas → dist/schemas}/Publication.js +7 -13
- package/dist/schemas/Publication.js.map +1 -0
- package/dist/schemas/RecentView.d.ts +31 -0
- package/dist/schemas/RecentView.d.ts.map +1 -0
- package/{schemas → dist/schemas}/RecentView.js +9 -14
- package/dist/schemas/RecentView.js.map +1 -0
- package/dist/schemas/RelatedProduct.d.ts +31 -0
- package/dist/schemas/RelatedProduct.d.ts.map +1 -0
- package/{schemas → dist/schemas}/RelatedProduct.js +10 -17
- package/dist/schemas/RelatedProduct.js.map +1 -0
- package/dist/schemas/Review.d.ts +31 -0
- package/dist/schemas/Review.d.ts.map +1 -0
- package/{schemas → dist/schemas}/Review.js +9 -27
- package/dist/schemas/Review.js.map +1 -0
- package/dist/schemas/SearchTerm.d.ts +31 -0
- package/dist/schemas/SearchTerm.d.ts.map +1 -0
- package/{schemas → dist/schemas}/SearchTerm.js +7 -10
- package/dist/schemas/SearchTerm.js.map +1 -0
- package/dist/schemas/Shop.d.ts +31 -0
- package/dist/schemas/Shop.d.ts.map +1 -0
- package/{schemas → dist/schemas}/Shop.js +8 -17
- package/dist/schemas/Shop.js.map +1 -0
- package/dist/schemas/ShopifyAPI.d.ts +31 -0
- package/dist/schemas/ShopifyAPI.d.ts.map +1 -0
- package/{schemas → dist/schemas}/ShopifyAPI.js +7 -17
- package/dist/schemas/ShopifyAPI.js.map +1 -0
- package/dist/schemas/ShopifyAPIRequest.d.ts +31 -0
- package/dist/schemas/ShopifyAPIRequest.d.ts.map +1 -0
- package/{schemas → dist/schemas}/ShopifyAPIRequest.js +12 -24
- package/dist/schemas/ShopifyAPIRequest.js.map +1 -0
- package/dist/schemas/ShopifyObject.d.ts +31 -0
- package/dist/schemas/ShopifyObject.d.ts.map +1 -0
- package/{schemas → dist/schemas}/ShopifyObject.js +9 -22
- package/dist/schemas/ShopifyObject.js.map +1 -0
- package/dist/schemas/ShortDomain.d.ts +31 -0
- package/dist/schemas/ShortDomain.d.ts.map +1 -0
- package/{schemas → dist/schemas}/ShortDomain.js +7 -16
- package/dist/schemas/ShortDomain.js.map +1 -0
- package/dist/schemas/ShortLog.d.ts +31 -0
- package/dist/schemas/ShortLog.d.ts.map +1 -0
- package/{schemas → dist/schemas}/ShortLog.js +7 -16
- package/dist/schemas/ShortLog.js.map +1 -0
- package/dist/schemas/ShortUrl.d.ts +31 -0
- package/dist/schemas/ShortUrl.d.ts.map +1 -0
- package/{schemas → dist/schemas}/ShortUrl.js +10 -24
- package/dist/schemas/ShortUrl.js.map +1 -0
- package/dist/schemas/Store.d.ts +31 -0
- package/dist/schemas/Store.d.ts.map +1 -0
- package/{schemas → dist/schemas}/Store.js +8 -22
- package/dist/schemas/Store.js.map +1 -0
- package/dist/schemas/StoreEvent.d.ts +31 -0
- package/dist/schemas/StoreEvent.d.ts.map +1 -0
- package/{schemas → dist/schemas}/StoreEvent.js +11 -26
- package/dist/schemas/StoreEvent.js.map +1 -0
- package/dist/schemas/StoreSetting.d.ts +31 -0
- package/dist/schemas/StoreSetting.d.ts.map +1 -0
- package/{schemas → dist/schemas}/StoreSetting.js +19 -39
- package/dist/schemas/StoreSetting.js.map +1 -0
- package/dist/schemas/TempUpload.d.ts +31 -0
- package/dist/schemas/TempUpload.d.ts.map +1 -0
- package/{schemas → dist/schemas}/TempUpload.js +9 -21
- package/dist/schemas/TempUpload.js.map +1 -0
- package/dist/schemas/TrackPage.d.ts +31 -0
- package/dist/schemas/TrackPage.d.ts.map +1 -0
- package/{schemas → dist/schemas}/TrackPage.js +8 -16
- package/dist/schemas/TrackPage.js.map +1 -0
- package/dist/schemas/TransferJob.d.ts +31 -0
- package/dist/schemas/TransferJob.d.ts.map +1 -0
- package/{schemas → dist/schemas}/TransferJob.js +15 -36
- package/dist/schemas/TransferJob.js.map +1 -0
- package/dist/schemas/User.d.ts +31 -0
- package/dist/schemas/User.d.ts.map +1 -0
- package/{schemas → dist/schemas}/User.js +8 -13
- package/dist/schemas/User.js.map +1 -0
- package/dist/schemas/WebhookEvent.d.ts +31 -0
- package/dist/schemas/WebhookEvent.d.ts.map +1 -0
- package/{schemas → dist/schemas}/WebhookEvent.js +9 -16
- package/dist/schemas/WebhookEvent.js.map +1 -0
- package/dist/schemas/products/MediaObject.d.ts +31 -0
- package/dist/schemas/products/MediaObject.d.ts.map +1 -0
- package/{schemas → dist/schemas}/products/MediaObject.js +6 -14
- package/dist/schemas/products/MediaObject.js.map +1 -0
- package/dist/schemas/products/SeoObject.d.ts +31 -0
- package/dist/schemas/products/SeoObject.d.ts.map +1 -0
- package/{schemas → dist/schemas}/products/SeoObject.js +6 -9
- package/dist/schemas/products/SeoObject.js.map +1 -0
- package/dist/schemas/products/VideoObject.d.ts +31 -0
- package/dist/schemas/products/VideoObject.d.ts.map +1 -0
- package/{schemas → dist/schemas}/products/VideoObject.js +6 -12
- package/dist/schemas/products/VideoObject.js.map +1 -0
- package/dist/schemas/types/BrandSettings.d.ts +31 -0
- package/dist/schemas/types/BrandSettings.d.ts.map +1 -0
- package/{schemas → dist/schemas}/types/BrandSettings.js +6 -9
- package/dist/schemas/types/BrandSettings.js.map +1 -0
- package/dist/schemas/types/DMCASetting.d.ts +31 -0
- package/dist/schemas/types/DMCASetting.d.ts.map +1 -0
- package/{schemas → dist/schemas}/types/DMCASetting.js +6 -9
- package/dist/schemas/types/DMCASetting.js.map +1 -0
- package/dist/schemas/types/FacebookObject.d.ts +31 -0
- package/dist/schemas/types/FacebookObject.d.ts.map +1 -0
- package/{schemas → dist/schemas}/types/FacebookObject.js +6 -9
- package/dist/schemas/types/FacebookObject.js.map +1 -0
- package/dist/schemas/types/FooterSetting.d.ts +31 -0
- package/dist/schemas/types/FooterSetting.d.ts.map +1 -0
- package/dist/schemas/types/FooterSetting.js +13 -0
- package/dist/schemas/types/FooterSetting.js.map +1 -0
- package/dist/schemas/types/FreeShippingSetting.d.ts +31 -0
- package/dist/schemas/types/FreeShippingSetting.d.ts.map +1 -0
- package/{schemas → dist/schemas}/types/FreeShippingSetting.js +6 -9
- package/dist/schemas/types/FreeShippingSetting.js.map +1 -0
- package/dist/schemas/types/GoogleAnalytics.d.ts +31 -0
- package/dist/schemas/types/GoogleAnalytics.d.ts.map +1 -0
- package/dist/schemas/types/GoogleAnalytics.js +13 -0
- package/dist/schemas/types/GoogleAnalytics.js.map +1 -0
- package/dist/schemas/types/KlaviyoObject.d.ts +31 -0
- package/dist/schemas/types/KlaviyoObject.d.ts.map +1 -0
- package/{schemas → dist/schemas}/types/KlaviyoObject.js +6 -9
- package/dist/schemas/types/KlaviyoObject.js.map +1 -0
- package/dist/schemas/types/MerchizeSettings.d.ts +31 -0
- package/dist/schemas/types/MerchizeSettings.d.ts.map +1 -0
- package/{schemas → dist/schemas}/types/MerchizeSettings.js +6 -9
- package/dist/schemas/types/MerchizeSettings.js.map +1 -0
- package/dist/schemas/types/SocialsObject.d.ts +31 -0
- package/dist/schemas/types/SocialsObject.d.ts.map +1 -0
- package/{schemas → dist/schemas}/types/SocialsObject.js +6 -14
- package/dist/schemas/types/SocialsObject.js.map +1 -0
- package/dist/schemas/types/TopBarSettings.d.ts +31 -0
- package/dist/schemas/types/TopBarSettings.d.ts.map +1 -0
- package/dist/schemas/types/TopBarSettings.js +13 -0
- package/dist/schemas/types/TopBarSettings.js.map +1 -0
- package/dist/schemas/types/TrustpilotObject.d.ts +31 -0
- package/dist/schemas/types/TrustpilotObject.d.ts.map +1 -0
- package/{schemas → dist/schemas}/types/TrustpilotObject.js +6 -10
- package/dist/schemas/types/TrustpilotObject.js.map +1 -0
- package/dist/types.d.ts +74 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/docs/contributing.md +278 -0
- package/docs/migration.md +242 -0
- package/docs/usage-js.md +114 -0
- package/docs/usage-ts.md +141 -0
- package/package.json +36 -7
- package/CLAUDE.md +0 -34
- package/index.js +0 -3
- package/schemas/types/FooterSetting.js +0 -15
- package/schemas/types/GoogleAnalytics.js +0 -15
- package/schemas/types/TopBarSettings.js +0 -15
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
# Migration — v5 → v6 (TypeScript rewrite)
|
|
2
|
+
|
|
3
|
+
`@pintahub/database-schemas@6.0.0` is a TypeScript rewrite. Runtime behaviour for existing CommonJS services is **backward compatible** — the public entry still resolves to an absolute path string to a schemas directory. The breaking changes are mostly around peer-dep wiring and the new typed `/types` subpath.
|
|
4
|
+
|
|
5
|
+
This guide covers the two upgrade paths:
|
|
6
|
+
|
|
7
|
+
1. **JS service staying on `schemis`** — minimal change, mostly `package.json`.
|
|
8
|
+
2. **JS service moving to TypeScript + `schemas-ts`** — bigger, but unblocks typed models.
|
|
9
|
+
|
|
10
|
+
If you are starting a new service, skip this file and go straight to [usage-ts.md](./usage-ts.md).
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## What changed in v6
|
|
15
|
+
|
|
16
|
+
| Area | v5 (5.x) | v6 (6.x) |
|
|
17
|
+
| -------------------- | ---------------------------------------------- | -------------------------------------------------------------- |
|
|
18
|
+
| Source language | JavaScript (CJS) | TypeScript, compiled to CJS in `dist/` |
|
|
19
|
+
| Entry | `index.js` → `path.join(__dirname, 'schemas')` | `dist/index.js` → `path.join(__dirname, 'schemas')` |
|
|
20
|
+
| Schema files | `schemas/*.js` (`module.exports = Schema`) | `dist/schemas/*.js` (`module.exports = Schema` via `export =`) |
|
|
21
|
+
| Types | none | `@pintahub/database-schemas/types` re-exports `IXxx` |
|
|
22
|
+
| `peerDependencies` | `mongoose`, `schemis` (both required) | `mongoose` (required); `schemis` / `schemas-ts` (optional) |
|
|
23
|
+
| Files in npm tarball | `index.js`, `schemas/` | `dist/` only |
|
|
24
|
+
|
|
25
|
+
**No schema field, index, or collection name changed.** A v5 consumer that bumps to v6 sees the same MongoDB behaviour. The breaking part is `peerDependencies` — `schemis` is no longer pulled in automatically, you must install it (or `schemas-ts`) explicitly.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Path 1 — Stay on JS, upgrade in place
|
|
30
|
+
|
|
31
|
+
For services that currently look like this:
|
|
32
|
+
|
|
33
|
+
```js
|
|
34
|
+
// src/connections/database.js (v5)
|
|
35
|
+
const {createConnection, createStore} = require('schemis')
|
|
36
|
+
const schemas = require('@pintahub/database-schemas')
|
|
37
|
+
|
|
38
|
+
const connection = createConnection(process.env.MONGODB_URI)
|
|
39
|
+
const store = createStore({connection, schemas})
|
|
40
|
+
|
|
41
|
+
module.exports = store
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Step 1 — bump deps
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
yarn add @pintahub/database-schemas@^6.0.0 schemis@^2.0.2
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
In v5, `schemis` was a peer of this package and you might have been getting it transitively. In v6 it is **optional**, so add it to your own `dependencies` explicitly.
|
|
51
|
+
|
|
52
|
+
### Step 2 — confirm no code change
|
|
53
|
+
|
|
54
|
+
The entry `require('@pintahub/database-schemas')` still returns an absolute path string. `schemis.createStore` still walks that directory. No source-code edits required.
|
|
55
|
+
|
|
56
|
+
### Step 3 — smoke test
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
node -e "const s = require('@pintahub/database-schemas'); console.log(s)"
|
|
60
|
+
# /…/node_modules/@pintahub/database-schemas/dist/schemas
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
node -e "
|
|
65
|
+
const {createStore, createConnection} = require('schemis');
|
|
66
|
+
const schemas = require('@pintahub/database-schemas');
|
|
67
|
+
const conn = createConnection('mongodb://localhost:27017/test');
|
|
68
|
+
const store = createStore({connection: conn, schemas});
|
|
69
|
+
console.log(Object.keys(store.getModel('Store').schema.paths).slice(0, 5));
|
|
70
|
+
conn.close();
|
|
71
|
+
"
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Expected: five field names from the `Store` schema. If you see `Cannot find module 'schemis'`, finish Step 1.
|
|
75
|
+
|
|
76
|
+
### Step 4 — deploy
|
|
77
|
+
|
|
78
|
+
Standard CI/CD. Nothing collection-shaped changed, so there is no data migration.
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## Path 2 — Migrate a service from JS+`schemis` to TS+`schemas-ts`
|
|
83
|
+
|
|
84
|
+
This is a per-service decision. Do it when the service is being touched substantially anyway — don't migrate for its own sake.
|
|
85
|
+
|
|
86
|
+
### Step 0 — pre-flight
|
|
87
|
+
|
|
88
|
+
- Node version ≥ 20.11.0 (`schemas-ts` requires it).
|
|
89
|
+
- The service has no remaining CJS-only deps that block ESM (rare; check `package.json` for `"type": "module"` viability).
|
|
90
|
+
|
|
91
|
+
### Step 1 — set up TypeScript
|
|
92
|
+
|
|
93
|
+
`package.json`:
|
|
94
|
+
|
|
95
|
+
```json
|
|
96
|
+
{
|
|
97
|
+
"type": "module",
|
|
98
|
+
"scripts": {
|
|
99
|
+
"build": "tsc",
|
|
100
|
+
"dev": "tsx watch src/index.ts",
|
|
101
|
+
"start": "node dist/index.js"
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
`tsconfig.json`:
|
|
107
|
+
|
|
108
|
+
```json
|
|
109
|
+
{
|
|
110
|
+
"compilerOptions": {
|
|
111
|
+
"target": "ES2022",
|
|
112
|
+
"module": "NodeNext",
|
|
113
|
+
"moduleResolution": "NodeNext",
|
|
114
|
+
"esModuleInterop": true,
|
|
115
|
+
"skipLibCheck": true,
|
|
116
|
+
"strict": true,
|
|
117
|
+
"outDir": "./dist",
|
|
118
|
+
"rootDir": "./src"
|
|
119
|
+
},
|
|
120
|
+
"include": ["src/**/*"]
|
|
121
|
+
}
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Step 2 — swap the resolver
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
yarn remove schemis
|
|
128
|
+
yarn add @pintahub/database-schemas@^6.0.0 schemas-ts@^1.0.2
|
|
129
|
+
yarn add -D @types/node typescript tsx
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
### Step 3 — rewrite the connection module
|
|
133
|
+
|
|
134
|
+
Before (`src/connections/database.js`):
|
|
135
|
+
|
|
136
|
+
```js
|
|
137
|
+
const {createConnection, createStore} = require('schemis')
|
|
138
|
+
const schemas = require('@pintahub/database-schemas')
|
|
139
|
+
|
|
140
|
+
const connection = createConnection(process.env.MONGODB_URI)
|
|
141
|
+
const store = createStore({connection, schemas})
|
|
142
|
+
|
|
143
|
+
module.exports = store
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
After (`src/connections/database.ts`):
|
|
147
|
+
|
|
148
|
+
```ts
|
|
149
|
+
import {createConnection, createStore} from 'schemas-ts'
|
|
150
|
+
import schemasPath from '@pintahub/database-schemas'
|
|
151
|
+
|
|
152
|
+
const connection = createConnection(process.env.MONGODB_URI!)
|
|
153
|
+
const store = createStore({connection, schemas: schemasPath})
|
|
154
|
+
|
|
155
|
+
export default store
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
The API surface (`getModel`, `getConnection`) is identical between `schemis` and `schemas-ts`, so call sites that only use those two methods do not need to change.
|
|
159
|
+
|
|
160
|
+
### Step 4 — type the call sites incrementally
|
|
161
|
+
|
|
162
|
+
You can migrate file by file. Start with the hottest collections.
|
|
163
|
+
|
|
164
|
+
Before:
|
|
165
|
+
|
|
166
|
+
```js
|
|
167
|
+
const Product = store.getModel('Product')
|
|
168
|
+
const doc = await Product.findOne({_id: id}).lean()
|
|
169
|
+
// doc is `any`
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
After:
|
|
173
|
+
|
|
174
|
+
```ts
|
|
175
|
+
import type {IProduct} from '@pintahub/database-schemas/types'
|
|
176
|
+
|
|
177
|
+
const Product = store.getModel<IProduct>('Product')
|
|
178
|
+
const doc = await Product.findOne({_id: id}).lean()
|
|
179
|
+
// doc is IProduct | null (well, the lean variant — see usage-ts.md)
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Untyped `getModel('Product')` still works during the migration; the generic is opt-in.
|
|
183
|
+
|
|
184
|
+
### Step 5 — extension-explicit imports
|
|
185
|
+
|
|
186
|
+
ESM under `NodeNext` requires `.js` extensions on relative imports — even for files that are `.ts` on disk (TypeScript rewrites the import on the way out, the runtime sees `.js`):
|
|
187
|
+
|
|
188
|
+
```ts
|
|
189
|
+
// in src/foo.ts
|
|
190
|
+
import store from './connections/database.js' // .js, not .ts
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
The compiled output lands at `dist/connections/database.js`, so this is correct at runtime.
|
|
194
|
+
|
|
195
|
+
### Step 6 — verify
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
yarn build
|
|
199
|
+
node --input-type=module -e "
|
|
200
|
+
import('./dist/connections/database.js').then(async ({default: store}) => {
|
|
201
|
+
const Store = store.getModel('Store')
|
|
202
|
+
console.log('paths:', Object.keys(Store.schema.paths).length)
|
|
203
|
+
await store.getConnection().close()
|
|
204
|
+
})
|
|
205
|
+
"
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
Then run the actual service against a staging Mongo and exercise a couple of read paths.
|
|
209
|
+
|
|
210
|
+
### Step 7 — clean up
|
|
211
|
+
|
|
212
|
+
- Remove the now-unused `schemis` line from `package.json` (Step 2 already did this with `yarn remove`).
|
|
213
|
+
- Update CI: build step is now `yarn build`, runtime is `node dist/index.js`.
|
|
214
|
+
- Re-enable `"strict": true` if you suppressed it during the bulk rewrite.
|
|
215
|
+
|
|
216
|
+
---
|
|
217
|
+
|
|
218
|
+
## Mapping cheatsheet
|
|
219
|
+
|
|
220
|
+
| Concept | v5 (`schemis`) | v6 (`schemas-ts`) |
|
|
221
|
+
| --------------------------------------- | ---------------------------------------------- | ---------------------------------------------------------------- |
|
|
222
|
+
| Import the schemas path | `const s = require('@pintahub/database-schemas')` | `import s from '@pintahub/database-schemas'` |
|
|
223
|
+
| Import a typed interface | n/a (no types in v5) | `import type {IOrder} from '@pintahub/database-schemas/types'` |
|
|
224
|
+
| Create connection | `require('schemis').createConnection(uri)` | `import {createConnection} from 'schemas-ts'` |
|
|
225
|
+
| Create store | `createStore({connection, schemas})` | `createStore({connection, schemas: schemasPath})` |
|
|
226
|
+
| Get a model | `store.getModel('Order')` | `store.getModel<IOrder>('Order')` |
|
|
227
|
+
| Custom collection name | `store.getModel('Order', 'archived_orders')` | `store.getModel<IOrder>('Order', 'archived_orders')` |
|
|
228
|
+
| Populate (always explicit `model`) | `.populate({path, model, select})` | `.populate({path, model, select})` |
|
|
229
|
+
|
|
230
|
+
## FAQ
|
|
231
|
+
|
|
232
|
+
**Can two services share one Mongo connection with different resolvers?**
|
|
233
|
+
Yes. The package only exposes a path string; each service builds its own store. Nothing about the Mongo wire protocol cares which resolver wrapped it.
|
|
234
|
+
|
|
235
|
+
**Can a v5 service and a v6 service write the same collection at the same time?**
|
|
236
|
+
Yes. v6 did not change any field name, type, index, or collection name. The only thing that changed is how the schemas are *loaded* in Node.
|
|
237
|
+
|
|
238
|
+
**My CI pulled in `schemis@1.x` after upgrading.**
|
|
239
|
+
v6 marks `schemis` as optional, so your lockfile drops it if you don't list it explicitly. Add `"schemis": "^2.0.2"` (or `"schemas-ts": "^1.0.2"`) to your own `dependencies`.
|
|
240
|
+
|
|
241
|
+
**I see `dist/schemas/Order.js` but the package source is `src/schemas/Order.ts`.**
|
|
242
|
+
Correct — only `dist/` ships in the npm tarball (`"files": ["dist"]` in `package.json`). When you edit a schema, the build step (`yarn build`) is what produces the file your consumers see.
|
package/docs/usage-js.md
ADDED
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
# Usage — CommonJS (JS) services
|
|
2
|
+
|
|
3
|
+
For services written in plain JavaScript (CommonJS) — e.g. `admin-api`, `admin-worker`, legacy workers. Use the [`schemis`](https://www.npmjs.com/package/schemis) resolver.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
yarn add @pintahub/database-schemas schemis mongoose
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Peer-dep matrix:
|
|
12
|
+
|
|
13
|
+
| Package | Version | Notes |
|
|
14
|
+
| ------------------------------- | --------- | --------------------------- |
|
|
15
|
+
| `mongoose` | `^9.1.3` | required peer |
|
|
16
|
+
| `schemis` | `^2.0.2` | CJS resolver |
|
|
17
|
+
| `@pintahub/database-schemas` | `^6.0.0` | this package |
|
|
18
|
+
|
|
19
|
+
`schemas-ts` is **not** needed for JS services.
|
|
20
|
+
|
|
21
|
+
## Bootstrap the store
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
// src/connections/database.js
|
|
25
|
+
const {createConnection, createStore} = require('schemis')
|
|
26
|
+
const schemasPath = require('@pintahub/database-schemas')
|
|
27
|
+
|
|
28
|
+
const uri = process.env.MONGODB_URI || 'mongodb://localhost:27017/dev'
|
|
29
|
+
const connection = createConnection(uri)
|
|
30
|
+
|
|
31
|
+
const store = createStore({connection, schemas: schemasPath})
|
|
32
|
+
|
|
33
|
+
module.exports = store
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
`require('@pintahub/database-schemas')` resolves to an **absolute path string** pointing at `dist/schemas/`. `schemis.createStore` walks that directory and lazy-loads each schema on first `getModel` call.
|
|
37
|
+
|
|
38
|
+
## Use models
|
|
39
|
+
|
|
40
|
+
```js
|
|
41
|
+
const store = require('./connections/database')
|
|
42
|
+
|
|
43
|
+
const Product = store.getModel('Product')
|
|
44
|
+
|
|
45
|
+
const doc = await Product
|
|
46
|
+
.findOne({_id: productId, store: storeId})
|
|
47
|
+
.lean()
|
|
48
|
+
|
|
49
|
+
await Product.updateOne(
|
|
50
|
+
{_id: productId},
|
|
51
|
+
{$set: {status: 'active', updated_at: new Date()}}
|
|
52
|
+
)
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Always filter by `store` for tenant-scoped collections.
|
|
56
|
+
|
|
57
|
+
## Custom collection name
|
|
58
|
+
|
|
59
|
+
Pass a second argument to override the default collection name (Mongoose pluralisation):
|
|
60
|
+
|
|
61
|
+
```js
|
|
62
|
+
const ArchivedOrder = store.getModel('Order', 'archived_orders')
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Populate with explicit `model`
|
|
66
|
+
|
|
67
|
+
`schemis` does not register cross-schema refs globally, so always pass the populated model explicitly:
|
|
68
|
+
|
|
69
|
+
```js
|
|
70
|
+
const TransferJob = store.getModel('TransferJob')
|
|
71
|
+
const Product = store.getModel('Product')
|
|
72
|
+
const Store = store.getModel('Store')
|
|
73
|
+
|
|
74
|
+
const jobs = await TransferJob
|
|
75
|
+
.find({store: storeId})
|
|
76
|
+
.populate({path: 'product', model: Product, select: {title: 1, code: 1}})
|
|
77
|
+
.populate({path: 'destination_store', model: Store, select: {name: 1}})
|
|
78
|
+
.lean()
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Connection lifecycle
|
|
82
|
+
|
|
83
|
+
`createConnection(uri)` returns a Mongoose `Connection` immediately and connects in the background. Wait for it before serving traffic:
|
|
84
|
+
|
|
85
|
+
```js
|
|
86
|
+
const store = require('./connections/database')
|
|
87
|
+
|
|
88
|
+
store.getConnection().once('open', () => {
|
|
89
|
+
console.log('mongo connected')
|
|
90
|
+
// start http server here
|
|
91
|
+
})
|
|
92
|
+
|
|
93
|
+
store.getConnection().on('error', err => {
|
|
94
|
+
console.error('mongo error', err)
|
|
95
|
+
})
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
For graceful shutdown:
|
|
99
|
+
|
|
100
|
+
```js
|
|
101
|
+
process.on('SIGTERM', async () => {
|
|
102
|
+
await store.getConnection().close()
|
|
103
|
+
process.exit(0)
|
|
104
|
+
})
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Common pitfalls
|
|
108
|
+
|
|
109
|
+
- **`Cannot find module '@pintahub/database-schemas'`** — make sure the package is added to `dependencies`, not `devDependencies`.
|
|
110
|
+
- **`Schema hasn't been registered for model "X"`** — you called `mongoose.model('X')` directly instead of `store.getModel('X')`. Always go through the store.
|
|
111
|
+
- **Stale schema after publish** — clear `node_modules/@pintahub/database-schemas` and re-install; the package is pinned by lockfile, not auto-updated.
|
|
112
|
+
- **Two stores for the same connection** — `getModel` caches per store; instantiate one `createStore` per connection and reuse it.
|
|
113
|
+
|
|
114
|
+
See [Contributing](./contributing.md) for adding/changing schemas and bumping the version.
|
package/docs/usage-ts.md
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# Usage — TypeScript / ESM services
|
|
2
|
+
|
|
3
|
+
For services written in TypeScript with ESM output — e.g. `shopify-gateway` and any new service. Use the [`schemas-ts`](https://www.npmjs.com/package/schemas-ts) resolver.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
yarn add @pintahub/database-schemas schemas-ts mongoose
|
|
9
|
+
yarn add -D @types/node typescript
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Peer-dep matrix:
|
|
13
|
+
|
|
14
|
+
| Package | Version | Notes |
|
|
15
|
+
| ------------------------------- | --------- | ------------------------------------ |
|
|
16
|
+
| `mongoose` | `^9.1.3` | required peer |
|
|
17
|
+
| `schemas-ts` | `^1.0.2` | ESM resolver (Node ≥ 20.11) |
|
|
18
|
+
| `@pintahub/database-schemas` | `^6.0.0` | this package |
|
|
19
|
+
|
|
20
|
+
`schemis` is **not** needed for TS services.
|
|
21
|
+
|
|
22
|
+
## `tsconfig.json` baseline
|
|
23
|
+
|
|
24
|
+
```json
|
|
25
|
+
{
|
|
26
|
+
"compilerOptions": {
|
|
27
|
+
"target": "ES2022",
|
|
28
|
+
"module": "NodeNext",
|
|
29
|
+
"moduleResolution": "NodeNext",
|
|
30
|
+
"esModuleInterop": true,
|
|
31
|
+
"skipLibCheck": true,
|
|
32
|
+
"strict": true,
|
|
33
|
+
"outDir": "./dist",
|
|
34
|
+
"rootDir": "./src"
|
|
35
|
+
},
|
|
36
|
+
"include": ["src/**/*"]
|
|
37
|
+
}
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
`module: "NodeNext"` is required for `schemas-ts` (it ships ESM-only) and is what the package's `import.meta.dirname` example relies on.
|
|
41
|
+
|
|
42
|
+
## Bootstrap the store
|
|
43
|
+
|
|
44
|
+
```ts
|
|
45
|
+
// src/connections/database.ts
|
|
46
|
+
import {createConnection, createStore} from 'schemas-ts'
|
|
47
|
+
import schemasPath from '@pintahub/database-schemas'
|
|
48
|
+
|
|
49
|
+
const uri = process.env.MONGODB_URI || 'mongodb://localhost:27017/dev'
|
|
50
|
+
const connection = createConnection(uri)
|
|
51
|
+
|
|
52
|
+
const store = createStore({connection, schemas: schemasPath})
|
|
53
|
+
|
|
54
|
+
export default store
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
The package's default export is an **absolute string** pointing at `dist/schemas/`. `schemas-ts` loads each schema via dynamic `import()` and supports both `export default Schema` and `module.exports = Schema` (this package uses the latter via TypeScript's `export = Schema`).
|
|
58
|
+
|
|
59
|
+
## Typed models
|
|
60
|
+
|
|
61
|
+
`store.getModel<T>(name)` returns `Model<T>`. Use the interface re-exports from the `/types` subpath:
|
|
62
|
+
|
|
63
|
+
```ts
|
|
64
|
+
import store from './connections/database.js'
|
|
65
|
+
import type {IStore, IProduct, IOrder} from '@pintahub/database-schemas/types'
|
|
66
|
+
import type {Model} from 'mongoose'
|
|
67
|
+
|
|
68
|
+
const Store: Model<IStore> = store.getModel<IStore>('Store')
|
|
69
|
+
const Product: Model<IProduct> = store.getModel<IProduct>('Product')
|
|
70
|
+
|
|
71
|
+
const found = await Store.findOne({subdomain: 'foo'}).lean()
|
|
72
|
+
// ^? IStore | null
|
|
73
|
+
|
|
74
|
+
const product = await Product.findOne(
|
|
75
|
+
{_id: productId, store: storeId},
|
|
76
|
+
).lean()
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Every schema in `src/schemas/` has a matching interface in `src/interfaces/`, re-exported through `@pintahub/database-schemas/types`. The interface name is the file name prefixed with `I` — e.g. `Order.ts` → `IOrder`.
|
|
80
|
+
|
|
81
|
+
> **Note** — the runtime export at `@pintahub/database-schemas/types` is empty (`export type` is erased by TypeScript). The subpath exists purely for type imports. Always use `import type {...}` to keep it tree-shake-safe.
|
|
82
|
+
|
|
83
|
+
## Populate with explicit `model`
|
|
84
|
+
|
|
85
|
+
`schemas-ts` does not register cross-schema refs globally either, so pass the populated model explicitly:
|
|
86
|
+
|
|
87
|
+
```ts
|
|
88
|
+
import type {ITransferJob, IProduct, IStore} from '@pintahub/database-schemas/types'
|
|
89
|
+
|
|
90
|
+
const TransferJob = store.getModel<ITransferJob>('TransferJob')
|
|
91
|
+
const Product = store.getModel<IProduct>('Product')
|
|
92
|
+
const Store = store.getModel<IStore>('Store')
|
|
93
|
+
|
|
94
|
+
const jobs = await TransferJob
|
|
95
|
+
.find({store: storeId})
|
|
96
|
+
.populate({path: 'product', model: Product, select: {title: 1, code: 1}})
|
|
97
|
+
.populate({path: 'destination_store', model: Store, select: {name: 1}})
|
|
98
|
+
.lean()
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
## ObjectId fields in the interfaces
|
|
102
|
+
|
|
103
|
+
Foreign-key fields in `IXxx` interfaces are typed as `Types.ObjectId`:
|
|
104
|
+
|
|
105
|
+
```ts
|
|
106
|
+
import type {Types} from 'mongoose'
|
|
107
|
+
import type {IOrder} from '@pintahub/database-schemas/types'
|
|
108
|
+
|
|
109
|
+
const order: IOrder = await Order.findOne({...}).lean() as IOrder
|
|
110
|
+
order.store // Types.ObjectId
|
|
111
|
+
order.store.toString()
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
When you `.populate()` a ref, cast the result to the populated shape — the base interface intentionally keeps the un-populated ObjectId type for accuracy.
|
|
115
|
+
|
|
116
|
+
## Connection lifecycle
|
|
117
|
+
|
|
118
|
+
```ts
|
|
119
|
+
import store from './connections/database.js'
|
|
120
|
+
|
|
121
|
+
const conn = store.getConnection()
|
|
122
|
+
|
|
123
|
+
conn.once('open', () => {
|
|
124
|
+
// safe to start serving traffic
|
|
125
|
+
})
|
|
126
|
+
|
|
127
|
+
process.on('SIGTERM', async () => {
|
|
128
|
+
await conn.close()
|
|
129
|
+
process.exit(0)
|
|
130
|
+
})
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Common pitfalls
|
|
134
|
+
|
|
135
|
+
- **`ERR_REQUIRE_ESM`** — you set `module: "commonjs"` in `tsconfig.json` but `schemas-ts` is ESM-only. Switch to `NodeNext`, or stay on JS and use `schemis` instead (see [usage-js.md](./usage-js.md)).
|
|
136
|
+
- **`Cannot find module '@pintahub/database-schemas/types'`** — your `moduleResolution` is `node` (legacy). Use `NodeNext` or `bundler` so subpath exports resolve.
|
|
137
|
+
- **Type for a field is `any`** — that field is missing from the interface in `src/interfaces/`. Open a PR adding it; both the schema file and interface must move together.
|
|
138
|
+
- **`Model<T>.findOne(...).lean()` returns `T & Document`** — that's normal Mongoose typing; cast or use `.lean<T>()` if you need a plain shape.
|
|
139
|
+
- **Hot reload re-creates the connection on every change** — wrap the bootstrap in a module-level cache or use the dev-server's HMR hooks; `createConnection` is not idempotent.
|
|
140
|
+
|
|
141
|
+
See [Contributing](./contributing.md) for adding/changing schemas and interfaces.
|
package/package.json
CHANGED
|
@@ -1,10 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pintahub/database-schemas",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "",
|
|
5
|
-
"main": "index.js",
|
|
3
|
+
"version": "6.0.1",
|
|
4
|
+
"description": "Pintahub MongoDB schemas (TypeScript). Compatible with both schemis (CJS) and schemas-ts (ESM) resolvers.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist",
|
|
9
|
+
"docs"
|
|
10
|
+
],
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"default": "./dist/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./types": {
|
|
17
|
+
"types": "./dist/types.d.ts",
|
|
18
|
+
"default": "./dist/types.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
6
21
|
"scripts": {
|
|
7
|
-
"
|
|
22
|
+
"build": "tsc",
|
|
23
|
+
"dev": "tsc --watch",
|
|
24
|
+
"prepublishOnly": "tsc"
|
|
8
25
|
},
|
|
9
26
|
"repository": {
|
|
10
27
|
"type": "git",
|
|
@@ -15,10 +32,22 @@
|
|
|
15
32
|
"license": "ISC",
|
|
16
33
|
"homepage": "https://gitlab.com/pintahub/packages/database-schemas#readme",
|
|
17
34
|
"peerDependencies": {
|
|
18
|
-
"mongoose": "^9.1.3"
|
|
19
|
-
|
|
35
|
+
"mongoose": "^9.1.3"
|
|
36
|
+
},
|
|
37
|
+
"peerDependenciesMeta": {
|
|
38
|
+
"schemis": {
|
|
39
|
+
"optional": true
|
|
40
|
+
},
|
|
41
|
+
"schemas-ts": {
|
|
42
|
+
"optional": true
|
|
43
|
+
}
|
|
20
44
|
},
|
|
21
45
|
"devDependencies": {
|
|
22
|
-
"
|
|
46
|
+
"@types/node": "^20.0.0",
|
|
47
|
+
"mongoose": "^9.1.3",
|
|
48
|
+
"schemas-ts": "^1.1.1",
|
|
49
|
+
"schemis": "^2.0.2",
|
|
50
|
+
"tsx": "^4.22.3",
|
|
51
|
+
"typescript": "^5.4.0"
|
|
23
52
|
}
|
|
24
53
|
}
|
package/CLAUDE.md
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
# CLAUDE.md — @pintahub/database-schemas
|
|
2
|
-
|
|
3
|
-
Shared Mongoose schema package for PintaHub microservices. See [README.md](./README.md) for package overview, install, usage examples, full schema catalog, and conventions.
|
|
4
|
-
|
|
5
|
-
This file contains only the rules Claude needs to edit safely. Do not duplicate README content here.
|
|
6
|
-
|
|
7
|
-
## Editing rules
|
|
8
|
-
|
|
9
|
-
- **CommonJS only.** This codebase uses `require` / `module.exports`. Do **not** convert to ES modules — overrides the global "prefer ES modules" preference.
|
|
10
|
-
- **Export Schema, not Model.** Each file in `schemas/` exports a `new Schema({...})` instance. Consumers register models themselves through `schemis`.
|
|
11
|
-
- **JSDoc every field.** Use `/** ... */` immediately above each field — this is the documentation source of truth (no separate docs site).
|
|
12
|
-
- **Embedded sub-documents** declared in `schemas/types/`, `schemas/products/`, or co-located in `schemas/` (e.g. `MoneyObject`) must be created with `{_id: false}`.
|
|
13
|
-
- **Multi-tenancy.** Domain schemas keep an indexed `store` ObjectId ref. When adding a new schema with tenant data, include `store: {type: Schema.Types.ObjectId, ref: 'Store', index: true}`.
|
|
14
|
-
- **Timestamps.** Use explicit `created_at` / `updated_at` Date fields. Do **not** add Mongoose's `timestamps: true` option — it breaks consistency with the rest of the codebase.
|
|
15
|
-
- **Indexes.**
|
|
16
|
-
- Default to `index: true` on the field for single-field indexes.
|
|
17
|
-
- Use `Schema.index({...})` at the bottom of the file for compound or text indexes.
|
|
18
|
-
- **Do not add a B-tree index for fields whose only purpose is Atlas Search** — Atlas Search uses its own Lucene index, and a redundant B-tree wastes write throughput.
|
|
19
|
-
- **No schema-level pre/post hooks** unless explicitly requested. Compute logic happens at the consumer write-path so behavior is visible to service authors.
|
|
20
|
-
- **Version bump on every schema change.** See README "Versioning". Update `package.json` in the same commit:
|
|
21
|
-
- new field / new schema / new index → minor
|
|
22
|
-
- rename / remove / type change → major
|
|
23
|
-
- JSDoc-only → patch
|
|
24
|
-
|
|
25
|
-
## Project context
|
|
26
|
-
|
|
27
|
-
- **Atlas Search migration in progress** for `storefront-api` product search (replacing the legacy `$text` index on Product). The legacy text index stays in place until the migration is complete.
|
|
28
|
-
- **`Product.display_title`** (added 2026-04-17) is the precomputed `alternative_title || title` value used by Atlas Search and frontend display. Consumer services set it at write time — do not add a schema hook for it.
|
|
29
|
-
|
|
30
|
-
## Common tasks
|
|
31
|
-
|
|
32
|
-
- **Add a field to an existing schema:** edit the schema file, add JSDoc + field def, bump `package.json` minor, commit.
|
|
33
|
-
- **Add a new schema:** create `schemas/<Name>.js` exporting `new Schema({...})`, follow conventions above, bump minor.
|
|
34
|
-
- **Add an index:** prefer `index: true` on the field; use `Schema.index({...})` for compound/text indexes; never duplicate Atlas Search coverage.
|
package/index.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const {Schema} = require('mongoose')
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
/** Embedded store footer settings */
|
|
5
|
-
const FooterSetting = new Schema({
|
|
6
|
-
_id: false,
|
|
7
|
-
|
|
8
|
-
/** Footer display content */
|
|
9
|
-
text: {
|
|
10
|
-
type: String,
|
|
11
|
-
trim: true,
|
|
12
|
-
}
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
module.exports = FooterSetting
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const {Schema} = require('mongoose')
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
/** Embedded Google Analytics settings */
|
|
5
|
-
const GoogleAnalytics = new Schema({
|
|
6
|
-
_id: false,
|
|
7
|
-
|
|
8
|
-
/** GA4 Measurement ID, e.g. 'G-XXXXXXXXXX' */
|
|
9
|
-
measurement_id: {
|
|
10
|
-
type: String,
|
|
11
|
-
trim: true,
|
|
12
|
-
},
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
module.exports = GoogleAnalytics
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const {Schema} = require('mongoose')
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
/** Embedded top bar announcement settings */
|
|
5
|
-
const TopBarSettings = new Schema({
|
|
6
|
-
_id: false,
|
|
7
|
-
|
|
8
|
-
/** Announcement display text */
|
|
9
|
-
content: {
|
|
10
|
-
type: String,
|
|
11
|
-
trim: true,
|
|
12
|
-
},
|
|
13
|
-
})
|
|
14
|
-
|
|
15
|
-
module.exports = TopBarSettings
|