diff --git a/.gitignore b/.gitignore index 4ee8b3f9..dbb92fda 100644 --- a/.gitignore +++ b/.gitignore @@ -70,6 +70,9 @@ core.* # API compiled output (generated by tsc, baked into Docker images) /api/dist/ +# TypeScript incremental build cache (machine-specific) +*.tsbuildinfo + # Control Panel runtime data (managed deployments + backups) /changemaker-control-panel/instances/ /changemaker-control-panel/backups/ diff --git a/admin/tsconfig.tsbuildinfo b/admin/tsconfig.tsbuildinfo deleted file mode 100644 index 132d0dc0..00000000 --- a/admin/tsconfig.tsbuildinfo +++ /dev/null @@ -1 +0,0 @@ -{"root":["./src/App.tsx","./src/main.tsx","./src/vite-env.d.ts","./src/components/AdBanner.tsx","./src/components/AppLayout.tsx","./src/components/AuthModal.tsx","./src/components/ErrorBoundary.tsx","./src/components/FeatureGate.tsx","./src/components/GrapesJSEditor.tsx","./src/components/MediaPublicLayout.tsx","./src/components/ProtectedRoute.tsx","./src/components/PublicLayout.tsx","./src/components/PublicNavBar.tsx","./src/components/PublicSearchModal.tsx","./src/components/QrCodeModal.tsx","./src/components/VolunteerFooterNav.tsx","./src/components/VolunteerLayout.tsx","./src/components/calendar/EventSubmissionForm.tsx","./src/components/calendar/UnifiedCalendar.tsx","./src/components/canvass/AddLocationDrawer.tsx","./src/components/canvass/AddressSearchOverlay.tsx","./src/components/canvass/AdminLiveMap.tsx","./src/components/canvass/BottomControlPanel.tsx","./src/components/canvass/CanvassBottomToolbar.tsx","./src/components/canvass/CanvassHeader.tsx","./src/components/canvass/CanvassLegend.tsx","./src/components/canvass/CanvassMarker.tsx","./src/components/canvass/CanvassMarkerGroup.tsx","./src/components/canvass/CanvassTrendsCard.tsx","./src/components/canvass/CutCampaignAnalyticsCard.tsx","./src/components/canvass/DocsSearchOverlay.tsx","./src/components/canvass/ExportContactsModal.tsx","./src/components/canvass/GPSTracker.tsx","./src/components/canvass/HistoricalRoutesDrawer.tsx","./src/components/canvass/LocationEditDrawer.tsx","./src/components/canvass/MapCrosshair.tsx","./src/components/canvass/SessionTimer.tsx","./src/components/canvass/VisitRecordingForm.tsx","./src/components/canvass/VolunteerMapDrawer.tsx","./src/components/canvass/VolunteerMapHeader.tsx","./src/components/canvass/VolunteerMarker.tsx","./src/components/canvass/WalkingRouteLine.tsx","./src/components/canvass/canvassClusterUtils.ts","./src/components/chat/ChatPanel.tsx","./src/components/chat/ChatPanelTray.tsx","./src/components/chat/ChatWidgetFAB.tsx","./src/components/chat/RocketChatWidget.tsx","./src/components/command-palette/CommandPalette.tsx","./src/components/command-palette/registry.ts","./src/components/command-palette/scopeFilter.ts","./src/components/command-palette/types.ts","./src/components/command-palette/useCommandIndex.ts","./src/components/command-palette/useEntitySearch.ts","./src/components/dashboard/ActivityFeedCard.tsx","./src/components/dashboard/CampaignEffectivenessCard.tsx","./src/components/dashboard/ChatNotifierCard.tsx","./src/components/dashboard/ContainerMemoryChart.tsx","./src/components/dashboard/ContainerPopover.tsx","./src/components/dashboard/DocsAnalyticsCard.tsx","./src/components/dashboard/DonationSummaryCard.tsx","./src/components/dashboard/GiteaActivityCard.tsx","./src/components/dashboard/LatencyBandsChart.tsx","./src/components/dashboard/MiniDonutChart.tsx","./src/components/dashboard/NewsletterStatsCard.tsx","./src/components/dashboard/RecentCommentsCard.tsx","./src/components/dashboard/RecentSignupsCard.tsx","./src/components/dashboard/RequestTrafficChart.tsx","./src/components/dashboard/RocketChatStatsCard.tsx","./src/components/dashboard/SystemAlertsCard.tsx","./src/components/dashboard/SystemGauges.tsx","./src/components/dashboard/TodayEventsCard.tsx","./src/components/dashboard/TopVideosCard.tsx","./src/components/dashboard/UpcomingMeetingsCard.tsx","./src/components/dashboard/UpcomingShiftsCard.tsx","./src/components/dashboard/VaultwardenAdoptionCard.tsx","./src/components/email-templates/EmailTemplateEditor.tsx","./src/components/email-templates/TestEmailModal.tsx","./src/components/email-templates/VariablesPanel.tsx","./src/components/email-templates/VersionHistoryDrawer.tsx","./src/components/email-templates/VideoVariableEditor.tsx","./src/components/influence/CampaignFormWidget.tsx","./src/components/landing-pages/LandingPageEditor.tsx","./src/components/map/AddLocationMode.tsx","./src/components/map/AdminMapView.tsx","./src/components/map/AreaImportWizard.tsx","./src/components/map/CutDrawingMode.tsx","./src/components/map/CutEditorMap.tsx","./src/components/map/CutOverlayControls.tsx","./src/components/map/CutOverlays.tsx","./src/components/map/DynamicTileLayer.tsx","./src/components/map/EventLayerToggle.tsx","./src/components/map/EventMarkers.tsx","./src/components/map/MapControls.tsx","./src/components/map/MapLegend.tsx","./src/components/map/MoveLocationMode.tsx","./src/components/map/NorthCompass.tsx","./src/components/map/TileLayerToggle.tsx","./src/components/map/mapIcons.ts","./src/components/map/mapUtils.ts","./src/components/map/tileLayers.ts","./src/components/media/AdPickerModal.tsx","./src/components/media/AddToPlaylistModal.tsx","./src/components/media/AdvancedVideoPlayer.tsx","./src/components/media/AlbumCard.tsx","./src/components/media/AlbumDetailDrawer.tsx","./src/components/media/AnalyticsChart.tsx","./src/components/media/BulkAccessLevelModal.tsx","./src/components/media/BulkActionsBar.tsx","./src/components/media/BulkAddToPlaylistModal.tsx","./src/components/media/ChatNotificationToast.tsx","./src/components/media/CommentSection.tsx","./src/components/media/CreateAlbumModal.tsx","./src/components/media/CreatePlaylistModal.tsx","./src/components/media/DeleteConfirmModal.tsx","./src/components/media/EditPhotoModal.tsx","./src/components/media/EditPlaylistModal.tsx","./src/components/media/EditVideoModal.tsx","./src/components/media/ExpandedAlbumCard.tsx","./src/components/media/ExpandedPhotoCard.tsx","./src/components/media/ExpandedVideoCard.tsx","./src/components/media/FeaturedPlaylistCarousel.tsx","./src/components/media/FetchVideosDrawer.tsx","./src/components/media/GalleryAdCard.tsx","./src/components/media/LiveChat.tsx","./src/components/media/MediaBottomNav.tsx","./src/components/media/MediaSidebar.tsx","./src/components/media/PhotoCard.tsx","./src/components/media/PhotoInsertModal.tsx","./src/components/media/PhotoPickerModal.tsx","./src/components/media/PhotoViewerModal.tsx","./src/components/media/PlaylistCard.tsx","./src/components/media/PlaylistSidebarPanel.tsx","./src/components/media/ProgressBarMarkers.tsx","./src/components/media/PublicAlbumCard.tsx","./src/components/media/PublicPhotoCard.tsx","./src/components/media/PublicVideoCard.tsx","./src/components/media/PublishModal.tsx","./src/components/media/QuickAnalyticsModal.tsx","./src/components/media/ReactionButtons.tsx","./src/components/media/RelatedVideosList.tsx","./src/components/media/ScheduleBadge.tsx","./src/components/media/ScheduleCalendarDrawer.tsx","./src/components/media/SchedulePublishModal.tsx","./src/components/media/SharedMediaCard.tsx","./src/components/media/UploadPhotoDrawer.tsx","./src/components/media/UploadVideoDrawer.tsx","./src/components/media/VideoActions.tsx","./src/components/media/VideoAnalyticsModal.tsx","./src/components/media/VideoCard.tsx","./src/components/media/VideoPickerModal.tsx","./src/components/media/VideoPlayer.tsx","./src/components/media/VideoViewerModal.tsx","./src/components/media/ViewersTable.tsx","./src/components/media/chatbar/ChatBar.tsx","./src/components/media/chatbar/ChatBarContext.tsx","./src/components/media/chatbar/MiniChatWindow.tsx","./src/components/media/chatbar/MiniLiveChat.tsx","./src/components/media/chatbar/MinimizedChat.tsx","./src/components/observability/AlertsTable.tsx","./src/components/observability/IframeErrorBoundary.tsx","./src/components/observability/MetricsGrid.tsx","./src/components/observability/ServiceStatusCard.tsx","./src/components/payments/DonateInsertModal.tsx","./src/components/payments/DonationWidget.tsx","./src/components/payments/PricingWidget.tsx","./src/components/payments/ProductInsertModal.tsx","./src/components/payments/ProductWidget.tsx","./src/components/people/ConnectionForm.tsx","./src/components/people/ConnectionGraph.tsx","./src/components/people/ContactAddressPanel.tsx","./src/components/people/ContactEmailPanel.tsx","./src/components/people/ContactPhonePanel.tsx","./src/components/people/CreateUserFromContactModal.tsx","./src/components/people/DuplicateDetectionDrawer.tsx","./src/components/people/EngagementSummaryPanel.tsx","./src/components/people/HouseholdPanel.tsx","./src/components/people/MergeContactModal.tsx","./src/components/people/PersonActivityTimeline.tsx","./src/components/people/PersonCard.tsx","./src/components/people/PersonDetailDrawer.tsx","./src/components/people/ProfileLinkActions.tsx","./src/components/people/ProfilePreviewModal.tsx","./src/components/people/TagManagementModal.tsx","./src/components/people/UserAccountStatusPanel.tsx","./src/components/people/VideoCallModal.tsx","./src/components/public/ActivityFeed.tsx","./src/components/public/HomepageSection.tsx","./src/components/public/NewsletterSignup.tsx","./src/components/public/RelatedContent.tsx","./src/components/public/ShiftSignupModal.tsx","./src/components/shifts/EditModeModal.tsx","./src/components/shifts/ShiftsCalendar.tsx","./src/components/social/FeedCard.tsx","./src/components/social/FriendButton.tsx","./src/components/social/FriendSuggestions.tsx","./src/components/social/FriendsAttendingBadge.tsx","./src/components/social/FriendsCampaignBadge.tsx","./src/components/social/FriendsOnMap.tsx","./src/components/social/GroupCard.tsx","./src/components/social/MessageButton.tsx","./src/components/social/NotificationBell.tsx","./src/components/social/OnlineIndicator.tsx","./src/components/social/PokeButton.tsx","./src/components/social/RecommendVideoModal.tsx","./src/components/social/SocialNetworkGraph.tsx","./src/components/social/SocialUserNode.tsx","./src/components/social/UserAvatar.tsx","./src/contexts/ExpandedVideoContext.tsx","./src/contexts/MediaAuthContext.tsx","./src/hooks/useChatNotifications.ts","./src/hooks/useDebounce.ts","./src/hooks/useDocsSearch.ts","./src/hooks/useDocumentTitle.ts","./src/hooks/useKeyboardShortcuts.ts","./src/hooks/useLocalStorage.ts","./src/hooks/useMkDocsBuild.ts","./src/hooks/usePageAds.ts","./src/hooks/usePostalCode.ts","./src/hooks/useSSE.ts","./src/lib/api.ts","./src/lib/media-api.ts","./src/lib/media-public-api.ts","./src/lib/service-url.ts","./src/pages/CampaignEmailsDrawer.tsx","./src/pages/CampaignsPage.tsx","./src/pages/CanvassDashboardPage.tsx","./src/pages/CodeEditorPage.tsx","./src/pages/CutExportPage.tsx","./src/pages/CutsPage.tsx","./src/pages/DashboardPage.tsx","./src/pages/DataQualityDashboardPage.tsx","./src/pages/DocsAnalyticsPage.tsx","./src/pages/DocsCommentsPage.tsx","./src/pages/DocsPage.tsx","./src/pages/EmailQueuePage.tsx","./src/pages/EmailTemplateEditorPage.tsx","./src/pages/EmailTemplatesPage.tsx","./src/pages/ExcalidrawPage.tsx","./src/pages/GancioPage.tsx","./src/pages/GiteaPage.tsx","./src/pages/JitsiAuthPage.tsx","./src/pages/JitsiMeetPage.tsx","./src/pages/LandingPagesPage.tsx","./src/pages/ListmonkPage.tsx","./src/pages/LocationsPage.tsx","./src/pages/LoginPage.tsx","./src/pages/MailHogPage.tsx","./src/pages/MapSettingsPage.tsx","./src/pages/MeetingPlannerPage.tsx","./src/pages/MiniQRPage.tsx","./src/pages/MkDocsSettingsPage.tsx","./src/pages/N8nPage.tsx","./src/pages/NavigationSettingsPage.tsx","./src/pages/NocoDBPage.tsx","./src/pages/NotFoundPage.tsx","./src/pages/ObservabilityPage.tsx","./src/pages/PangolinPage.tsx","./src/pages/PeoplePage.tsx","./src/pages/RepresentativesPage.tsx","./src/pages/ResetPasswordPage.tsx","./src/pages/ResponsesPage.tsx","./src/pages/RocketChatPage.tsx","./src/pages/SettingsPage.tsx","./src/pages/ShiftsPage.tsx","./src/pages/UsersPage.tsx","./src/pages/VaultwardenPage.tsx","./src/pages/VerifyEmailPage.tsx","./src/pages/WalkSheetPage.tsx","./src/pages/influence/CampaignEffectivenessPage.tsx","./src/pages/influence/CampaignModerationPage.tsx","./src/pages/media/AdAnalyticsDashboardPage.tsx","./src/pages/media/AnalyticsDashboardPage.tsx","./src/pages/media/CommentModerationPage.tsx","./src/pages/media/GalleryAdsPage.tsx","./src/pages/media/LibraryPage.tsx","./src/pages/media/MediaJobsPage.tsx","./src/pages/media/PlaylistManagementPage.tsx","./src/pages/payments/DonationPagesPage.tsx","./src/pages/payments/DonationsPage.tsx","./src/pages/payments/PaymentSettingsPage.tsx","./src/pages/payments/PaymentsDashboardPage.tsx","./src/pages/payments/PlansPage.tsx","./src/pages/payments/ProductsPage.tsx","./src/pages/payments/SubscribersPage.tsx","./src/pages/public/CampaignPage.tsx","./src/pages/public/CampaignsListPage.tsx","./src/pages/public/ContactProfilePage.tsx","./src/pages/public/CreateCampaignPage.tsx","./src/pages/public/DonatePage.tsx","./src/pages/public/DonationPagesListPage.tsx","./src/pages/public/EventsPage.tsx","./src/pages/public/HomePage.tsx","./src/pages/public/LandingPage.tsx","./src/pages/public/MapPage.tsx","./src/pages/public/MediaGalleryPage.tsx","./src/pages/public/MediaViewerPage.tsx","./src/pages/public/MeetingJoinPage.tsx","./src/pages/public/MyCampaignsPage.tsx","./src/pages/public/MySettingsPage.tsx","./src/pages/public/MyStatsPage.tsx","./src/pages/public/PagesIndexPage.tsx","./src/pages/public/PaymentSuccessPage.tsx","./src/pages/public/PlanDetailPage.tsx","./src/pages/public/PlaylistBrowsePage.tsx","./src/pages/public/PlaylistViewerPage.tsx","./src/pages/public/PollsListPage.tsx","./src/pages/public/PricingPage.tsx","./src/pages/public/ProductDetailPage.tsx","./src/pages/public/QuickJoinPage.tsx","./src/pages/public/ResponseWallPage.tsx","./src/pages/public/SchedulingPollPage.tsx","./src/pages/public/ShiftsPage.tsx","./src/pages/public/ShopPage.tsx","./src/pages/public/ShortsPage.tsx","./src/pages/sms/NewConversationModal.tsx","./src/pages/sms/SmsCampaignsPage.tsx","./src/pages/sms/SmsContactsPage.tsx","./src/pages/sms/SmsConversationsPage.tsx","./src/pages/sms/SmsDashboardPage.tsx","./src/pages/sms/SmsSetupPage.tsx","./src/pages/sms/SmsTemplatesPage.tsx","./src/pages/social/SocialDashboardPage.tsx","./src/pages/social/SocialGraphPage.tsx","./src/pages/social/SocialModerationPage.tsx","./src/pages/volunteer/AchievementsPage.tsx","./src/pages/volunteer/DiscoverPage.tsx","./src/pages/volunteer/FriendsPage.tsx","./src/pages/volunteer/GroupDetailPage.tsx","./src/pages/volunteer/MyActivityPage.tsx","./src/pages/volunteer/MyRoutesPage.tsx","./src/pages/volunteer/NotificationsPage.tsx","./src/pages/volunteer/SocialFeedPage.tsx","./src/pages/volunteer/SocialProfilePage.tsx","./src/pages/volunteer/VolunteerChatPage.tsx","./src/pages/volunteer/VolunteerMapPage.tsx","./src/pages/volunteer/VolunteerShiftsPage.tsx","./src/stores/auth.store.ts","./src/stores/canvass.store.ts","./src/stores/chat-widget.store.ts","./src/stores/command-palette.store.ts","./src/stores/favorites.store.ts","./src/stores/settings.store.ts","./src/stores/social.store.ts","./src/stores/tracking.store.ts","./src/types/api.ts","./src/types/canvass.ts","./src/types/gallery-ads.ts","./src/types/media.ts","./src/types/sms.ts","./src/types/social.ts","./src/types/tracking.ts","./src/utils/badges.ts","./src/utils/color.ts","./src/utils/galleryAdMerge.ts","./src/utils/menu-items.ts","./src/utils/photoCardHtml.ts","./src/utils/representatives.ts","./src/utils/roles.ts","./src/utils/sanitize.ts","./src/utils/url-validator.ts","./src/utils/video.ts","./src/utils/videoCardHtml.ts"],"version":"5.9.3"} \ No newline at end of file diff --git a/api/dist/config/database.d.ts b/api/dist/config/database.d.ts deleted file mode 100644 index a11e8d35..00000000 --- a/api/dist/config/database.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { PrismaClient } from '@prisma/client'; -declare const prisma: PrismaClient<{ - log: ("error" | "query" | "warn")[]; -}, "error" | "query" | "warn", import("@prisma/client/runtime/library").DefaultArgs>; -export { prisma }; -//# sourceMappingURL=database.d.ts.map \ No newline at end of file diff --git a/api/dist/config/database.d.ts.map b/api/dist/config/database.d.ts.map deleted file mode 100644 index 79c84943..00000000 --- a/api/dist/config/database.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../src/config/database.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,QAAA,MAAM,MAAM;;oFAEV,CAAC;AAEH,OAAO,EAAE,MAAM,EAAE,CAAC"} \ No newline at end of file diff --git a/api/dist/config/database.js b/api/dist/config/database.js deleted file mode 100644 index 2b0be75c..00000000 --- a/api/dist/config/database.js +++ /dev/null @@ -1,10 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.prisma = void 0; -const client_1 = require("@prisma/client"); -const env_1 = require("./env"); -const prisma = new client_1.PrismaClient({ - log: env_1.env.NODE_ENV === 'development' ? ['query', 'error', 'warn'] : ['error'], -}); -exports.prisma = prisma; -//# sourceMappingURL=database.js.map \ No newline at end of file diff --git a/api/dist/config/database.js.map b/api/dist/config/database.js.map deleted file mode 100644 index 492a2acf..00000000 --- a/api/dist/config/database.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"database.js","sourceRoot":"","sources":["../../src/config/database.ts"],"names":[],"mappings":";;;AAAA,2CAA8C;AAC9C,+BAA4B;AAE5B,MAAM,MAAM,GAAG,IAAI,qBAAY,CAAC;IAC9B,GAAG,EAAE,SAAG,CAAC,QAAQ,KAAK,aAAa,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;CAC7E,CAAC,CAAC;AAEM,wBAAM"} \ No newline at end of file diff --git a/api/dist/config/env.d.ts b/api/dist/config/env.d.ts deleted file mode 100644 index 039f9416..00000000 --- a/api/dist/config/env.d.ts +++ /dev/null @@ -1,582 +0,0 @@ -import { z } from 'zod'; -declare const envSchema: z.ZodObject<{ - NODE_ENV: z.ZodDefault>; - PORT: z.ZodDefault; - API_URL: z.ZodDefault; - ADMIN_URL: z.ZodDefault; - DOMAIN: z.ZodDefault; - INSTANCE_LABEL: z.ZodDefault; - BUNKER_OPS_ENABLED: z.ZodDefault; - BUNKER_OPS_REMOTE_WRITE_URL: z.ZodDefault; - DATABASE_URL: z.ZodString; - REDIS_URL: z.ZodDefault; - JWT_ACCESS_SECRET: z.ZodString; - JWT_REFRESH_SECRET: z.ZodString; - JWT_INVITE_SECRET: z.ZodString; - JWT_ACCESS_EXPIRY: z.ZodDefault; - JWT_REFRESH_EXPIRY: z.ZodDefault; - ENCRYPTION_KEY: z.ZodOptional; - INITIAL_ADMIN_EMAIL: z.ZodDefault; - INITIAL_ADMIN_PASSWORD: z.ZodEffects, string, string | undefined>; - SMTP_HOST: z.ZodDefault; - SMTP_PORT: z.ZodDefault; - SMTP_USER: z.ZodDefault; - SMTP_PASS: z.ZodDefault; - SMTP_FROM: z.ZodDefault; - SMTP_FROM_NAME: z.ZodDefault; - EMAIL_TEST_MODE: z.ZodDefault; - TEST_EMAIL_RECIPIENT: z.ZodDefault; - LISTMONK_URL: z.ZodDefault; - LISTMONK_ADMIN_USER: z.ZodDefault; - LISTMONK_ADMIN_PASSWORD: z.ZodDefault; - LISTMONK_SYNC_ENABLED: z.ZodDefault; - LISTMONK_WEBHOOK_SECRET: z.ZodDefault; - LISTMONK_PROXY_PORT: z.ZodDefault; - REPRESENT_API_URL: z.ZodDefault; - CORS_ORIGINS: z.ZodDefault; - RATE_LIMIT_WINDOW_MS: z.ZodDefault; - RATE_LIMIT_MAX: z.ZodDefault; - MAPBOX_API_KEY: z.ZodOptional; - GEOCODING_RATE_LIMIT_MS: z.ZodDefault; - GEOCODING_CACHE_ENABLED: z.ZodDefault; - GEOCODING_CACHE_TTL_HOURS: z.ZodDefault; - GOOGLE_MAPS_API_KEY: z.ZodOptional; - GOOGLE_MAPS_ENABLED: z.ZodDefault; - GEOCODING_PARALLEL_ENABLED: z.ZodDefault; - GEOCODING_BATCH_SIZE: z.ZodDefault; - BULK_GEOCODE_ENABLED: z.ZodDefault; - BULK_GEOCODE_MAX_BATCH: z.ZodDefault; - NOCODB_URL: z.ZodDefault; - NOCODB_PORT: z.ZodDefault; - NOCODB_EMBED_PORT: z.ZodDefault; - N8N_URL: z.ZodDefault; - N8N_PORT: z.ZodDefault; - N8N_EMBED_PORT: z.ZodDefault; - GITEA_URL: z.ZodDefault; - GITEA_PORT: z.ZodDefault; - GITEA_EMBED_PORT: z.ZodDefault; - MAILHOG_URL: z.ZodDefault; - MAILHOG_EMBED_PORT: z.ZodDefault; - MINI_QR_URL: z.ZodDefault; - MINI_QR_PORT: z.ZodDefault; - MINI_QR_EMBED_PORT: z.ZodDefault; - EXCALIDRAW_URL: z.ZodDefault; - EXCALIDRAW_PORT: z.ZodDefault; - EXCALIDRAW_EMBED_PORT: z.ZodDefault; - HOMEPAGE_URL: z.ZodDefault; - HOMEPAGE_EMBED_PORT: z.ZodDefault; - VAULTWARDEN_URL: z.ZodDefault; - VAULTWARDEN_ADMIN_TOKEN: z.ZodDefault; - VAULTWARDEN_EMBED_PORT: z.ZodDefault; - ROCKETCHAT_URL: z.ZodDefault; - ROCKETCHAT_ADMIN_USER: z.ZodDefault; - ROCKETCHAT_ADMIN_PASSWORD: z.ZodDefault; - ROCKETCHAT_EMBED_PORT: z.ZodDefault; - ENABLE_CHAT: z.ZodDefault; - GANCIO_URL: z.ZodDefault; - GANCIO_PORT: z.ZodDefault; - GANCIO_EMBED_PORT: z.ZodDefault; - GANCIO_ADMIN_USER: z.ZodDefault; - GANCIO_ADMIN_PASSWORD: z.ZodDefault; - GANCIO_SYNC_ENABLED: z.ZodDefault; - ENABLE_MEET: z.ZodDefault; - JITSI_APP_ID: z.ZodDefault; - JITSI_APP_SECRET: z.ZodDefault; - JITSI_URL: z.ZodDefault; - JITSI_EMBED_PORT: z.ZodDefault; - PANGOLIN_API_URL: z.ZodEffects, string, string | undefined>; - PANGOLIN_API_KEY: z.ZodDefault; - PANGOLIN_ORG_ID: z.ZodDefault; - PANGOLIN_SITE_ID: z.ZodDefault; - PANGOLIN_ENDPOINT: z.ZodDefault; - PANGOLIN_NEWT_ID: z.ZodDefault; - PANGOLIN_NEWT_SECRET: z.ZodDefault; - NAR_DATA_DIR: z.ZodDefault; - OVERPASS_API_URL: z.ZodDefault; - OVERPASS_MIN_DELAY_MS: z.ZodDefault; - AREA_IMPORT_MAX_GRID_POINTS: z.ZodDefault; - ENABLE_PAYMENTS: z.ZodDefault; - ENABLE_MEDIA_FEATURES: z.ZodDefault; - MEDIA_API_PORT: z.ZodDefault; - MEDIA_API_PUBLIC_URL: z.ZodDefault; - MEDIA_ROOT: z.ZodDefault; - MEDIA_UPLOADS: z.ZodDefault; - MAX_UPLOAD_SIZE_GB: z.ZodDefault; - GITEA_REGISTRY: z.ZodDefault; - GITEA_REGISTRY_USER: z.ZodDefault; - GITEA_REGISTRY_PASS: z.ZodDefault; - GITEA_COMMENTS_ENABLED: z.ZodDefault; - GITEA_API_TOKEN: z.ZodDefault; - GITEA_COMMENTS_REPO_OWNER: z.ZodDefault; - GITEA_COMMENTS_REPO_NAME: z.ZodDefault; - GITEA_OAUTH_CLIENT_ID: z.ZodDefault; - GITEA_OAUTH_CLIENT_SECRET: z.ZodDefault; - ENABLE_SMS: z.ZodDefault; - TERMUX_API_URL: z.ZodDefault; - TERMUX_API_KEY: z.ZodDefault; - SMS_DELAY_BETWEEN_MS: z.ZodDefault; - SMS_MAX_RETRIES: z.ZodDefault; - SMS_RESPONSE_SYNC_INTERVAL_MS: z.ZodDefault; - SMS_DEVICE_MONITOR_INTERVAL_MS: z.ZodDefault; - CODE_SERVER_URL: z.ZodDefault; - CODE_SERVER_PORT: z.ZodDefault; - MKDOCS_PREVIEW_URL: z.ZodDefault; - MKDOCS_PORT: z.ZodDefault; - MKDOCS_DOCS_PATH: z.ZodDefault; - MKDOCS_CONFIG_PATH: z.ZodDefault; - MKDOCS_CONTAINER_NAME: z.ZodDefault; - MKDOCS_SITE_SERVER_URL: z.ZodDefault; - MKDOCS_SITE_SERVER_PORT: z.ZodDefault; - PROMETHEUS_URL: z.ZodDefault; - PROMETHEUS_PORT: z.ZodDefault; - GRAFANA_URL: z.ZodDefault; - GRAFANA_PORT: z.ZodDefault; - GRAFANA_EMBED_PORT: z.ZodDefault; - ALERTMANAGER_URL: z.ZodDefault; - ALERTMANAGER_PORT: z.ZodDefault; - ALERTMANAGER_EMBED_PORT: z.ZodDefault; - CADVISOR_URL: z.ZodDefault; - CADVISOR_PORT: z.ZodDefault; - NODE_EXPORTER_URL: z.ZodDefault; - NODE_EXPORTER_PORT: z.ZodDefault; - REDIS_EXPORTER_URL: z.ZodDefault; - REDIS_EXPORTER_PORT: z.ZodDefault; - GOTIFY_URL: z.ZodDefault; - GOTIFY_PORT: z.ZodDefault; -}, "strip", z.ZodTypeAny, { - NODE_ENV: "development" | "production" | "test"; - PORT: number; - API_URL: string; - ADMIN_URL: string; - DOMAIN: string; - INSTANCE_LABEL: string; - BUNKER_OPS_ENABLED: string; - BUNKER_OPS_REMOTE_WRITE_URL: string; - DATABASE_URL: string; - REDIS_URL: string; - JWT_ACCESS_SECRET: string; - JWT_REFRESH_SECRET: string; - JWT_INVITE_SECRET: string; - JWT_ACCESS_EXPIRY: string; - JWT_REFRESH_EXPIRY: string; - INITIAL_ADMIN_EMAIL: string; - INITIAL_ADMIN_PASSWORD: string; - SMTP_HOST: string; - SMTP_PORT: number; - SMTP_USER: string; - SMTP_PASS: string; - SMTP_FROM: string; - SMTP_FROM_NAME: string; - EMAIL_TEST_MODE: string; - TEST_EMAIL_RECIPIENT: string; - LISTMONK_URL: string; - LISTMONK_ADMIN_USER: string; - LISTMONK_ADMIN_PASSWORD: string; - LISTMONK_SYNC_ENABLED: string; - LISTMONK_WEBHOOK_SECRET: string; - LISTMONK_PROXY_PORT: number; - REPRESENT_API_URL: string; - CORS_ORIGINS: string; - RATE_LIMIT_WINDOW_MS: number; - RATE_LIMIT_MAX: number; - GEOCODING_RATE_LIMIT_MS: number; - GEOCODING_CACHE_ENABLED: string; - GEOCODING_CACHE_TTL_HOURS: number; - GOOGLE_MAPS_ENABLED: string; - GEOCODING_PARALLEL_ENABLED: string; - GEOCODING_BATCH_SIZE: number; - BULK_GEOCODE_ENABLED: string; - BULK_GEOCODE_MAX_BATCH: number; - NOCODB_URL: string; - NOCODB_PORT: number; - NOCODB_EMBED_PORT: number; - N8N_URL: string; - N8N_PORT: number; - N8N_EMBED_PORT: number; - GITEA_URL: string; - GITEA_PORT: number; - GITEA_EMBED_PORT: number; - MAILHOG_URL: string; - MAILHOG_EMBED_PORT: number; - MINI_QR_URL: string; - MINI_QR_PORT: number; - MINI_QR_EMBED_PORT: number; - EXCALIDRAW_URL: string; - EXCALIDRAW_PORT: number; - EXCALIDRAW_EMBED_PORT: number; - HOMEPAGE_URL: string; - HOMEPAGE_EMBED_PORT: number; - VAULTWARDEN_URL: string; - VAULTWARDEN_ADMIN_TOKEN: string; - VAULTWARDEN_EMBED_PORT: number; - ROCKETCHAT_URL: string; - ROCKETCHAT_ADMIN_USER: string; - ROCKETCHAT_ADMIN_PASSWORD: string; - ROCKETCHAT_EMBED_PORT: number; - ENABLE_CHAT: string; - GANCIO_URL: string; - GANCIO_PORT: number; - GANCIO_EMBED_PORT: number; - GANCIO_ADMIN_USER: string; - GANCIO_ADMIN_PASSWORD: string; - GANCIO_SYNC_ENABLED: string; - ENABLE_MEET: string; - JITSI_APP_ID: string; - JITSI_APP_SECRET: string; - JITSI_URL: string; - JITSI_EMBED_PORT: number; - PANGOLIN_API_URL: string; - PANGOLIN_API_KEY: string; - PANGOLIN_ORG_ID: string; - PANGOLIN_SITE_ID: string; - PANGOLIN_ENDPOINT: string; - PANGOLIN_NEWT_ID: string; - PANGOLIN_NEWT_SECRET: string; - NAR_DATA_DIR: string; - OVERPASS_API_URL: string; - OVERPASS_MIN_DELAY_MS: number; - AREA_IMPORT_MAX_GRID_POINTS: number; - ENABLE_PAYMENTS: string; - ENABLE_MEDIA_FEATURES: string; - MEDIA_API_PORT: number; - MEDIA_API_PUBLIC_URL: string; - MEDIA_ROOT: string; - MEDIA_UPLOADS: string; - MAX_UPLOAD_SIZE_GB: number; - GITEA_REGISTRY: string; - GITEA_REGISTRY_USER: string; - GITEA_REGISTRY_PASS: string; - GITEA_COMMENTS_ENABLED: string; - GITEA_API_TOKEN: string; - GITEA_COMMENTS_REPO_OWNER: string; - GITEA_COMMENTS_REPO_NAME: string; - GITEA_OAUTH_CLIENT_ID: string; - GITEA_OAUTH_CLIENT_SECRET: string; - ENABLE_SMS: string; - TERMUX_API_URL: string; - TERMUX_API_KEY: string; - SMS_DELAY_BETWEEN_MS: number; - SMS_MAX_RETRIES: number; - SMS_RESPONSE_SYNC_INTERVAL_MS: number; - SMS_DEVICE_MONITOR_INTERVAL_MS: number; - CODE_SERVER_URL: string; - CODE_SERVER_PORT: number; - MKDOCS_PREVIEW_URL: string; - MKDOCS_PORT: number; - MKDOCS_DOCS_PATH: string; - MKDOCS_CONFIG_PATH: string; - MKDOCS_CONTAINER_NAME: string; - MKDOCS_SITE_SERVER_URL: string; - MKDOCS_SITE_SERVER_PORT: number; - PROMETHEUS_URL: string; - PROMETHEUS_PORT: number; - GRAFANA_URL: string; - GRAFANA_PORT: number; - GRAFANA_EMBED_PORT: number; - ALERTMANAGER_URL: string; - ALERTMANAGER_PORT: number; - ALERTMANAGER_EMBED_PORT: number; - CADVISOR_URL: string; - CADVISOR_PORT: number; - NODE_EXPORTER_URL: string; - NODE_EXPORTER_PORT: number; - REDIS_EXPORTER_URL: string; - REDIS_EXPORTER_PORT: number; - GOTIFY_URL: string; - GOTIFY_PORT: number; - ENCRYPTION_KEY?: string | undefined; - MAPBOX_API_KEY?: string | undefined; - GOOGLE_MAPS_API_KEY?: string | undefined; -}, { - DATABASE_URL: string; - JWT_ACCESS_SECRET: string; - JWT_REFRESH_SECRET: string; - JWT_INVITE_SECRET: string; - NODE_ENV?: "development" | "production" | "test" | undefined; - PORT?: number | undefined; - API_URL?: string | undefined; - ADMIN_URL?: string | undefined; - DOMAIN?: string | undefined; - INSTANCE_LABEL?: string | undefined; - BUNKER_OPS_ENABLED?: string | undefined; - BUNKER_OPS_REMOTE_WRITE_URL?: string | undefined; - REDIS_URL?: string | undefined; - JWT_ACCESS_EXPIRY?: string | undefined; - JWT_REFRESH_EXPIRY?: string | undefined; - ENCRYPTION_KEY?: string | undefined; - INITIAL_ADMIN_EMAIL?: string | undefined; - INITIAL_ADMIN_PASSWORD?: string | undefined; - SMTP_HOST?: string | undefined; - SMTP_PORT?: number | undefined; - SMTP_USER?: string | undefined; - SMTP_PASS?: string | undefined; - SMTP_FROM?: string | undefined; - SMTP_FROM_NAME?: string | undefined; - EMAIL_TEST_MODE?: string | undefined; - TEST_EMAIL_RECIPIENT?: string | undefined; - LISTMONK_URL?: string | undefined; - LISTMONK_ADMIN_USER?: string | undefined; - LISTMONK_ADMIN_PASSWORD?: string | undefined; - LISTMONK_SYNC_ENABLED?: string | undefined; - LISTMONK_WEBHOOK_SECRET?: string | undefined; - LISTMONK_PROXY_PORT?: number | undefined; - REPRESENT_API_URL?: string | undefined; - CORS_ORIGINS?: string | undefined; - RATE_LIMIT_WINDOW_MS?: number | undefined; - RATE_LIMIT_MAX?: number | undefined; - MAPBOX_API_KEY?: string | undefined; - GEOCODING_RATE_LIMIT_MS?: number | undefined; - GEOCODING_CACHE_ENABLED?: string | undefined; - GEOCODING_CACHE_TTL_HOURS?: number | undefined; - GOOGLE_MAPS_API_KEY?: string | undefined; - GOOGLE_MAPS_ENABLED?: string | undefined; - GEOCODING_PARALLEL_ENABLED?: string | undefined; - GEOCODING_BATCH_SIZE?: number | undefined; - BULK_GEOCODE_ENABLED?: string | undefined; - BULK_GEOCODE_MAX_BATCH?: number | undefined; - NOCODB_URL?: string | undefined; - NOCODB_PORT?: number | undefined; - NOCODB_EMBED_PORT?: number | undefined; - N8N_URL?: string | undefined; - N8N_PORT?: number | undefined; - N8N_EMBED_PORT?: number | undefined; - GITEA_URL?: string | undefined; - GITEA_PORT?: number | undefined; - GITEA_EMBED_PORT?: number | undefined; - MAILHOG_URL?: string | undefined; - MAILHOG_EMBED_PORT?: number | undefined; - MINI_QR_URL?: string | undefined; - MINI_QR_PORT?: number | undefined; - MINI_QR_EMBED_PORT?: number | undefined; - EXCALIDRAW_URL?: string | undefined; - EXCALIDRAW_PORT?: number | undefined; - EXCALIDRAW_EMBED_PORT?: number | undefined; - HOMEPAGE_URL?: string | undefined; - HOMEPAGE_EMBED_PORT?: number | undefined; - VAULTWARDEN_URL?: string | undefined; - VAULTWARDEN_ADMIN_TOKEN?: string | undefined; - VAULTWARDEN_EMBED_PORT?: number | undefined; - ROCKETCHAT_URL?: string | undefined; - ROCKETCHAT_ADMIN_USER?: string | undefined; - ROCKETCHAT_ADMIN_PASSWORD?: string | undefined; - ROCKETCHAT_EMBED_PORT?: number | undefined; - ENABLE_CHAT?: string | undefined; - GANCIO_URL?: string | undefined; - GANCIO_PORT?: number | undefined; - GANCIO_EMBED_PORT?: number | undefined; - GANCIO_ADMIN_USER?: string | undefined; - GANCIO_ADMIN_PASSWORD?: string | undefined; - GANCIO_SYNC_ENABLED?: string | undefined; - ENABLE_MEET?: string | undefined; - JITSI_APP_ID?: string | undefined; - JITSI_APP_SECRET?: string | undefined; - JITSI_URL?: string | undefined; - JITSI_EMBED_PORT?: number | undefined; - PANGOLIN_API_URL?: string | undefined; - PANGOLIN_API_KEY?: string | undefined; - PANGOLIN_ORG_ID?: string | undefined; - PANGOLIN_SITE_ID?: string | undefined; - PANGOLIN_ENDPOINT?: string | undefined; - PANGOLIN_NEWT_ID?: string | undefined; - PANGOLIN_NEWT_SECRET?: string | undefined; - NAR_DATA_DIR?: string | undefined; - OVERPASS_API_URL?: string | undefined; - OVERPASS_MIN_DELAY_MS?: number | undefined; - AREA_IMPORT_MAX_GRID_POINTS?: number | undefined; - ENABLE_PAYMENTS?: string | undefined; - ENABLE_MEDIA_FEATURES?: string | undefined; - MEDIA_API_PORT?: number | undefined; - MEDIA_API_PUBLIC_URL?: string | undefined; - MEDIA_ROOT?: string | undefined; - MEDIA_UPLOADS?: string | undefined; - MAX_UPLOAD_SIZE_GB?: number | undefined; - GITEA_REGISTRY?: string | undefined; - GITEA_REGISTRY_USER?: string | undefined; - GITEA_REGISTRY_PASS?: string | undefined; - GITEA_COMMENTS_ENABLED?: string | undefined; - GITEA_API_TOKEN?: string | undefined; - GITEA_COMMENTS_REPO_OWNER?: string | undefined; - GITEA_COMMENTS_REPO_NAME?: string | undefined; - GITEA_OAUTH_CLIENT_ID?: string | undefined; - GITEA_OAUTH_CLIENT_SECRET?: string | undefined; - ENABLE_SMS?: string | undefined; - TERMUX_API_URL?: string | undefined; - TERMUX_API_KEY?: string | undefined; - SMS_DELAY_BETWEEN_MS?: number | undefined; - SMS_MAX_RETRIES?: number | undefined; - SMS_RESPONSE_SYNC_INTERVAL_MS?: number | undefined; - SMS_DEVICE_MONITOR_INTERVAL_MS?: number | undefined; - CODE_SERVER_URL?: string | undefined; - CODE_SERVER_PORT?: number | undefined; - MKDOCS_PREVIEW_URL?: string | undefined; - MKDOCS_PORT?: number | undefined; - MKDOCS_DOCS_PATH?: string | undefined; - MKDOCS_CONFIG_PATH?: string | undefined; - MKDOCS_CONTAINER_NAME?: string | undefined; - MKDOCS_SITE_SERVER_URL?: string | undefined; - MKDOCS_SITE_SERVER_PORT?: number | undefined; - PROMETHEUS_URL?: string | undefined; - PROMETHEUS_PORT?: number | undefined; - GRAFANA_URL?: string | undefined; - GRAFANA_PORT?: number | undefined; - GRAFANA_EMBED_PORT?: number | undefined; - ALERTMANAGER_URL?: string | undefined; - ALERTMANAGER_PORT?: number | undefined; - ALERTMANAGER_EMBED_PORT?: number | undefined; - CADVISOR_URL?: string | undefined; - CADVISOR_PORT?: number | undefined; - NODE_EXPORTER_URL?: string | undefined; - NODE_EXPORTER_PORT?: number | undefined; - REDIS_EXPORTER_URL?: string | undefined; - REDIS_EXPORTER_PORT?: number | undefined; - GOTIFY_URL?: string | undefined; - GOTIFY_PORT?: number | undefined; -}>; -export type Env = z.infer; -export declare const env: { - NODE_ENV: "development" | "production" | "test"; - PORT: number; - API_URL: string; - ADMIN_URL: string; - DOMAIN: string; - INSTANCE_LABEL: string; - BUNKER_OPS_ENABLED: string; - BUNKER_OPS_REMOTE_WRITE_URL: string; - DATABASE_URL: string; - REDIS_URL: string; - JWT_ACCESS_SECRET: string; - JWT_REFRESH_SECRET: string; - JWT_INVITE_SECRET: string; - JWT_ACCESS_EXPIRY: string; - JWT_REFRESH_EXPIRY: string; - INITIAL_ADMIN_EMAIL: string; - INITIAL_ADMIN_PASSWORD: string; - SMTP_HOST: string; - SMTP_PORT: number; - SMTP_USER: string; - SMTP_PASS: string; - SMTP_FROM: string; - SMTP_FROM_NAME: string; - EMAIL_TEST_MODE: string; - TEST_EMAIL_RECIPIENT: string; - LISTMONK_URL: string; - LISTMONK_ADMIN_USER: string; - LISTMONK_ADMIN_PASSWORD: string; - LISTMONK_SYNC_ENABLED: string; - LISTMONK_WEBHOOK_SECRET: string; - LISTMONK_PROXY_PORT: number; - REPRESENT_API_URL: string; - CORS_ORIGINS: string; - RATE_LIMIT_WINDOW_MS: number; - RATE_LIMIT_MAX: number; - GEOCODING_RATE_LIMIT_MS: number; - GEOCODING_CACHE_ENABLED: string; - GEOCODING_CACHE_TTL_HOURS: number; - GOOGLE_MAPS_ENABLED: string; - GEOCODING_PARALLEL_ENABLED: string; - GEOCODING_BATCH_SIZE: number; - BULK_GEOCODE_ENABLED: string; - BULK_GEOCODE_MAX_BATCH: number; - NOCODB_URL: string; - NOCODB_PORT: number; - NOCODB_EMBED_PORT: number; - N8N_URL: string; - N8N_PORT: number; - N8N_EMBED_PORT: number; - GITEA_URL: string; - GITEA_PORT: number; - GITEA_EMBED_PORT: number; - MAILHOG_URL: string; - MAILHOG_EMBED_PORT: number; - MINI_QR_URL: string; - MINI_QR_PORT: number; - MINI_QR_EMBED_PORT: number; - EXCALIDRAW_URL: string; - EXCALIDRAW_PORT: number; - EXCALIDRAW_EMBED_PORT: number; - HOMEPAGE_URL: string; - HOMEPAGE_EMBED_PORT: number; - VAULTWARDEN_URL: string; - VAULTWARDEN_ADMIN_TOKEN: string; - VAULTWARDEN_EMBED_PORT: number; - ROCKETCHAT_URL: string; - ROCKETCHAT_ADMIN_USER: string; - ROCKETCHAT_ADMIN_PASSWORD: string; - ROCKETCHAT_EMBED_PORT: number; - ENABLE_CHAT: string; - GANCIO_URL: string; - GANCIO_PORT: number; - GANCIO_EMBED_PORT: number; - GANCIO_ADMIN_USER: string; - GANCIO_ADMIN_PASSWORD: string; - GANCIO_SYNC_ENABLED: string; - ENABLE_MEET: string; - JITSI_APP_ID: string; - JITSI_APP_SECRET: string; - JITSI_URL: string; - JITSI_EMBED_PORT: number; - PANGOLIN_API_URL: string; - PANGOLIN_API_KEY: string; - PANGOLIN_ORG_ID: string; - PANGOLIN_SITE_ID: string; - PANGOLIN_ENDPOINT: string; - PANGOLIN_NEWT_ID: string; - PANGOLIN_NEWT_SECRET: string; - NAR_DATA_DIR: string; - OVERPASS_API_URL: string; - OVERPASS_MIN_DELAY_MS: number; - AREA_IMPORT_MAX_GRID_POINTS: number; - ENABLE_PAYMENTS: string; - ENABLE_MEDIA_FEATURES: string; - MEDIA_API_PORT: number; - MEDIA_API_PUBLIC_URL: string; - MEDIA_ROOT: string; - MEDIA_UPLOADS: string; - MAX_UPLOAD_SIZE_GB: number; - GITEA_REGISTRY: string; - GITEA_REGISTRY_USER: string; - GITEA_REGISTRY_PASS: string; - GITEA_COMMENTS_ENABLED: string; - GITEA_API_TOKEN: string; - GITEA_COMMENTS_REPO_OWNER: string; - GITEA_COMMENTS_REPO_NAME: string; - GITEA_OAUTH_CLIENT_ID: string; - GITEA_OAUTH_CLIENT_SECRET: string; - ENABLE_SMS: string; - TERMUX_API_URL: string; - TERMUX_API_KEY: string; - SMS_DELAY_BETWEEN_MS: number; - SMS_MAX_RETRIES: number; - SMS_RESPONSE_SYNC_INTERVAL_MS: number; - SMS_DEVICE_MONITOR_INTERVAL_MS: number; - CODE_SERVER_URL: string; - CODE_SERVER_PORT: number; - MKDOCS_PREVIEW_URL: string; - MKDOCS_PORT: number; - MKDOCS_DOCS_PATH: string; - MKDOCS_CONFIG_PATH: string; - MKDOCS_CONTAINER_NAME: string; - MKDOCS_SITE_SERVER_URL: string; - MKDOCS_SITE_SERVER_PORT: number; - PROMETHEUS_URL: string; - PROMETHEUS_PORT: number; - GRAFANA_URL: string; - GRAFANA_PORT: number; - GRAFANA_EMBED_PORT: number; - ALERTMANAGER_URL: string; - ALERTMANAGER_PORT: number; - ALERTMANAGER_EMBED_PORT: number; - CADVISOR_URL: string; - CADVISOR_PORT: number; - NODE_EXPORTER_URL: string; - NODE_EXPORTER_PORT: number; - REDIS_EXPORTER_URL: string; - REDIS_EXPORTER_PORT: number; - GOTIFY_URL: string; - GOTIFY_PORT: number; - ENCRYPTION_KEY?: string | undefined; - MAPBOX_API_KEY?: string | undefined; - GOOGLE_MAPS_API_KEY?: string | undefined; -}; -export {}; -//# sourceMappingURL=env.d.ts.map \ No newline at end of file diff --git a/api/dist/config/env.d.ts.map b/api/dist/config/env.d.ts.map deleted file mode 100644 index fdea75da..00000000 --- a/api/dist/config/env.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"env.d.ts","sourceRoot":"","sources":["../../src/config/env.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2Nb,CAAC;AAEH,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AAY5C,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAgB,CAAC"} \ No newline at end of file diff --git a/api/dist/config/env.js b/api/dist/config/env.js deleted file mode 100644 index e115537d..00000000 --- a/api/dist/config/env.js +++ /dev/null @@ -1,202 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.env = void 0; -const dotenv_1 = __importDefault(require("dotenv")); -const zod_1 = require("zod"); -dotenv_1.default.config(); -const envSchema = zod_1.z.object({ - // Server - NODE_ENV: zod_1.z.enum(['development', 'production', 'test']).default('development'), - PORT: zod_1.z.coerce.number().default(4000), - API_URL: zod_1.z.string().default('http://localhost:4000'), - ADMIN_URL: zod_1.z.string().default('http://localhost:3000'), - DOMAIN: zod_1.z.string().default('cmlite.org'), - // Bunker Ops (Fleet Management) - INSTANCE_LABEL: zod_1.z.string().default(''), - BUNKER_OPS_ENABLED: zod_1.z.string().default('false'), - BUNKER_OPS_REMOTE_WRITE_URL: zod_1.z.string().default(''), - // Database - DATABASE_URL: zod_1.z.string(), - // Redis - REDIS_URL: zod_1.z.string().default('redis://redis-changemaker:6379'), - // JWT - JWT_ACCESS_SECRET: zod_1.z.string().min(32), - JWT_REFRESH_SECRET: zod_1.z.string().min(32), - JWT_INVITE_SECRET: zod_1.z.string().min(32), - JWT_ACCESS_EXPIRY: zod_1.z.string().default('15m'), - JWT_REFRESH_EXPIRY: zod_1.z.string().default('7d'), - // Encryption (for DB-stored secrets like SMTP password; falls back to JWT_ACCESS_SECRET) - ENCRYPTION_KEY: zod_1.z.string().min(32, 'ENCRYPTION_KEY must be at least 32 characters').optional(), - // Initial Super Admin (auto-created during database seeding) - INITIAL_ADMIN_EMAIL: zod_1.z.string().email().default('admin@cmlite.org'), - INITIAL_ADMIN_PASSWORD: zod_1.z.string().min(12).default('REQUIRED_STRONG_PASSWORD_CHANGE_THIS') - .refine((val) => val !== 'REQUIRED_STRONG_PASSWORD_CHANGE_THIS', { message: 'INITIAL_ADMIN_PASSWORD must be changed from the default placeholder value' }), - // SMTP - SMTP_HOST: zod_1.z.string().default('mailhog-changemaker'), - SMTP_PORT: zod_1.z.coerce.number().default(1025), - SMTP_USER: zod_1.z.string().default(''), - SMTP_PASS: zod_1.z.string().default(''), - SMTP_FROM: zod_1.z.string().default('noreply@cmlite.org'), - SMTP_FROM_NAME: zod_1.z.string().default('Changemaker Lite'), - EMAIL_TEST_MODE: zod_1.z.string().default('true'), - TEST_EMAIL_RECIPIENT: zod_1.z.string().default('admin@cmlite.org'), - // Listmonk - LISTMONK_URL: zod_1.z.string().default('http://listmonk-app:9000'), - LISTMONK_ADMIN_USER: zod_1.z.string().default('admin'), - LISTMONK_ADMIN_PASSWORD: zod_1.z.string().default(''), - LISTMONK_SYNC_ENABLED: zod_1.z.string().default('false'), - LISTMONK_WEBHOOK_SECRET: zod_1.z.string().default(''), - LISTMONK_PROXY_PORT: zod_1.z.coerce.number().default(9002), - // Represent API (Canadian electoral data) - REPRESENT_API_URL: zod_1.z.string().default('https://represent.opennorth.ca'), - // CORS - CORS_ORIGINS: zod_1.z.string().default('http://localhost:3000'), - // Rate Limiting - RATE_LIMIT_WINDOW_MS: zod_1.z.coerce.number().default(15 * 60 * 1000), - RATE_LIMIT_MAX: zod_1.z.coerce.number().default(500), - // Geocoding - MAPBOX_API_KEY: zod_1.z.string().optional(), - GEOCODING_RATE_LIMIT_MS: zod_1.z.coerce.number().default(1100), - GEOCODING_CACHE_ENABLED: zod_1.z.string().default('true'), - GEOCODING_CACHE_TTL_HOURS: zod_1.z.coerce.number().default(24), - // Phase 2: Performance & Accuracy - GOOGLE_MAPS_API_KEY: zod_1.z.string().optional(), - GOOGLE_MAPS_ENABLED: zod_1.z.string().default('false'), - GEOCODING_PARALLEL_ENABLED: zod_1.z.string().default('true'), - GEOCODING_BATCH_SIZE: zod_1.z.coerce.number().default(10), - // Bulk Re-Geocoding (Phase 3) - BULK_GEOCODE_ENABLED: zod_1.z.string().default('true'), - BULK_GEOCODE_MAX_BATCH: zod_1.z.coerce.number().default(5000), - // Platform Services (NocoDB, n8n, Gitea) - NOCODB_URL: zod_1.z.string().default('http://changemaker-v2-nocodb:8080'), - NOCODB_PORT: zod_1.z.coerce.number().default(8091), - NOCODB_EMBED_PORT: zod_1.z.coerce.number().default(8881), - N8N_URL: zod_1.z.string().default('http://n8n-changemaker:5678'), - N8N_PORT: zod_1.z.coerce.number().default(5678), - N8N_EMBED_PORT: zod_1.z.coerce.number().default(8882), - GITEA_URL: zod_1.z.string().default('http://gitea-changemaker:3000'), - GITEA_PORT: zod_1.z.coerce.number().default(3030), - GITEA_EMBED_PORT: zod_1.z.coerce.number().default(8883), - // MailHog (email testing UI) - MAILHOG_URL: zod_1.z.string().default('http://mailhog-changemaker:8025'), - MAILHOG_EMBED_PORT: zod_1.z.coerce.number().default(8884), - // Mini QR (QR code generator) - MINI_QR_URL: zod_1.z.string().default('http://mini-qr:8080'), - MINI_QR_PORT: zod_1.z.coerce.number().default(8089), - MINI_QR_EMBED_PORT: zod_1.z.coerce.number().default(8885), - // Excalidraw (collaborative whiteboard) - EXCALIDRAW_URL: zod_1.z.string().default('http://excalidraw-changemaker:80'), - EXCALIDRAW_PORT: zod_1.z.coerce.number().default(8090), - EXCALIDRAW_EMBED_PORT: zod_1.z.coerce.number().default(8886), - // Homepage (service dashboard) - HOMEPAGE_URL: zod_1.z.string().default('http://homepage-changemaker:3000'), - HOMEPAGE_EMBED_PORT: zod_1.z.coerce.number().default(8887), - // Vaultwarden (password manager) - VAULTWARDEN_URL: zod_1.z.string().default('http://vaultwarden-changemaker:80'), - VAULTWARDEN_ADMIN_TOKEN: zod_1.z.string().default(''), - VAULTWARDEN_EMBED_PORT: zod_1.z.coerce.number().default(8890), - // Rocket.Chat (team chat) - ROCKETCHAT_URL: zod_1.z.string().default('http://rocketchat-changemaker:3000'), - ROCKETCHAT_ADMIN_USER: zod_1.z.string().default(''), - ROCKETCHAT_ADMIN_PASSWORD: zod_1.z.string().default(''), - ROCKETCHAT_EMBED_PORT: zod_1.z.coerce.number().default(8891), - ENABLE_CHAT: zod_1.z.string().default('false'), - // Gancio (event management) - GANCIO_URL: zod_1.z.string().default('http://gancio-changemaker:13120'), - GANCIO_PORT: zod_1.z.coerce.number().default(8092), - GANCIO_EMBED_PORT: zod_1.z.coerce.number().default(8892), - GANCIO_ADMIN_USER: zod_1.z.string().default('admin'), - GANCIO_ADMIN_PASSWORD: zod_1.z.string().default(''), - GANCIO_SYNC_ENABLED: zod_1.z.string().default('false'), - // Jitsi Meet (video conferencing) - ENABLE_MEET: zod_1.z.string().default('false'), - JITSI_APP_ID: zod_1.z.string().default('changemaker'), - JITSI_APP_SECRET: zod_1.z.string().default(''), - JITSI_URL: zod_1.z.string().default('http://jitsi-web-changemaker:80'), - JITSI_EMBED_PORT: zod_1.z.coerce.number().default(8893), - // Pangolin (tunnel / reverse proxy) - PANGOLIN_API_URL: zod_1.z.string() - .default('') - .refine((url) => !url || url.startsWith('https://'), { message: 'PANGOLIN_API_URL must use HTTPS for secure credential transmission' }), - PANGOLIN_API_KEY: zod_1.z.string().default(''), - PANGOLIN_ORG_ID: zod_1.z.string().default(''), - PANGOLIN_SITE_ID: zod_1.z.string().default(''), - PANGOLIN_ENDPOINT: zod_1.z.string().default(''), - PANGOLIN_NEWT_ID: zod_1.z.string().default(''), - PANGOLIN_NEWT_SECRET: zod_1.z.string().default(''), - // NAR (National Address Register) - NAR_DATA_DIR: zod_1.z.string().default('/data'), - // Overpass / Area Import - OVERPASS_API_URL: zod_1.z.string().default('https://overpass-api.de/api/interpreter'), - OVERPASS_MIN_DELAY_MS: zod_1.z.coerce.number().default(30000), - AREA_IMPORT_MAX_GRID_POINTS: zod_1.z.coerce.number().default(500), - // Payments (Stripe) - ENABLE_PAYMENTS: zod_1.z.string().default('false'), - // Media Management - ENABLE_MEDIA_FEATURES: zod_1.z.string().default('false'), - MEDIA_API_PORT: zod_1.z.coerce.number().default(4100), - MEDIA_API_PUBLIC_URL: zod_1.z.string().default('http://media-api:4100'), - MEDIA_ROOT: zod_1.z.string().default('/media/library'), - MEDIA_UPLOADS: zod_1.z.string().default('/media/uploads'), - MAX_UPLOAD_SIZE_GB: zod_1.z.coerce.number().default(10), - // Container Registry - GITEA_REGISTRY: zod_1.z.string().default('gitea.bnkops.com/admin'), - GITEA_REGISTRY_USER: zod_1.z.string().default(''), - GITEA_REGISTRY_PASS: zod_1.z.string().default(''), - // Gitea Docs Comments - GITEA_COMMENTS_ENABLED: zod_1.z.string().default('false'), - GITEA_API_TOKEN: zod_1.z.string().default(''), - GITEA_COMMENTS_REPO_OWNER: zod_1.z.string().default(''), - GITEA_COMMENTS_REPO_NAME: zod_1.z.string().default('docs-comments'), - GITEA_OAUTH_CLIENT_ID: zod_1.z.string().default(''), - GITEA_OAUTH_CLIENT_SECRET: zod_1.z.string().default(''), - // SMS Campaigns (Termux Android bridge) - ENABLE_SMS: zod_1.z.string().default('false'), - TERMUX_API_URL: zod_1.z.string().default('http://10.0.0.193:5001'), - TERMUX_API_KEY: zod_1.z.string().default(''), - SMS_DELAY_BETWEEN_MS: zod_1.z.coerce.number().default(3000), - SMS_MAX_RETRIES: zod_1.z.coerce.number().default(3), - SMS_RESPONSE_SYNC_INTERVAL_MS: zod_1.z.coerce.number().default(30000), - SMS_DEVICE_MONITOR_INTERVAL_MS: zod_1.z.coerce.number().default(30000), - // Docs / Code Server - CODE_SERVER_URL: zod_1.z.string().default('http://code-server-changemaker:8080'), - CODE_SERVER_PORT: zod_1.z.coerce.number().default(8888), - MKDOCS_PREVIEW_URL: zod_1.z.string().default('http://mkdocs-changemaker:8000'), - MKDOCS_PORT: zod_1.z.coerce.number().default(4003), - MKDOCS_DOCS_PATH: zod_1.z.string().default('/mkdocs/docs'), - MKDOCS_CONFIG_PATH: zod_1.z.string().default('/mkdocs/mkdocs.yml'), - MKDOCS_CONTAINER_NAME: zod_1.z.string().default('mkdocs-changemaker'), - MKDOCS_SITE_SERVER_URL: zod_1.z.string().default('http://mkdocs-site-server-changemaker:80'), - MKDOCS_SITE_SERVER_PORT: zod_1.z.coerce.number().default(4004), - // Monitoring Services (behind 'monitoring' profile) - PROMETHEUS_URL: zod_1.z.string().default('http://prometheus-changemaker:9090'), - PROMETHEUS_PORT: zod_1.z.coerce.number().default(9090), - GRAFANA_URL: zod_1.z.string().default('http://grafana-changemaker:3000'), - GRAFANA_PORT: zod_1.z.coerce.number().default(3005), - GRAFANA_EMBED_PORT: zod_1.z.coerce.number().default(8894), - ALERTMANAGER_URL: zod_1.z.string().default('http://alertmanager-changemaker:9093'), - ALERTMANAGER_PORT: zod_1.z.coerce.number().default(9093), - ALERTMANAGER_EMBED_PORT: zod_1.z.coerce.number().default(8895), - CADVISOR_URL: zod_1.z.string().default('http://cadvisor-changemaker:8080'), - CADVISOR_PORT: zod_1.z.coerce.number().default(8086), - NODE_EXPORTER_URL: zod_1.z.string().default('http://node-exporter-changemaker:9100'), - NODE_EXPORTER_PORT: zod_1.z.coerce.number().default(9100), - REDIS_EXPORTER_URL: zod_1.z.string().default('http://redis-exporter-changemaker:9121'), - REDIS_EXPORTER_PORT: zod_1.z.coerce.number().default(9121), - GOTIFY_URL: zod_1.z.string().default('http://gotify-changemaker:80'), - GOTIFY_PORT: zod_1.z.coerce.number().default(8889), -}); -function validateEnv() { - const result = envSchema.safeParse(process.env); - if (!result.success) { - console.error('Invalid environment variables:'); - console.error(result.error.flatten().fieldErrors); - process.exit(1); - } - return result.data; -} -exports.env = validateEnv(); -//# sourceMappingURL=env.js.map \ No newline at end of file diff --git a/api/dist/config/env.js.map b/api/dist/config/env.js.map deleted file mode 100644 index ef25c12d..00000000 --- a/api/dist/config/env.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"env.js","sourceRoot":"","sources":["../../src/config/env.ts"],"names":[],"mappings":";;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IAChD,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,OAAO,CAAC,KAAK,CAAC,gCAAgC,CAAC,CAAC;QAChD,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,WAAW,CAAC,CAAC;QAClD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC;AACrB,CAAC;AAEY,QAAA,GAAG,GAAG,WAAW,EAAE,CAAC"} \ No newline at end of file diff --git a/api/dist/config/redis.d.ts b/api/dist/config/redis.d.ts deleted file mode 100644 index f74ba4be..00000000 --- a/api/dist/config/redis.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -import Redis from 'ioredis'; -export declare const redis: Redis; -//# sourceMappingURL=redis.d.ts.map \ No newline at end of file diff --git a/api/dist/config/redis.d.ts.map b/api/dist/config/redis.d.ts.map deleted file mode 100644 index ba31e89c..00000000 --- a/api/dist/config/redis.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"redis.d.ts","sourceRoot":"","sources":["../../src/config/redis.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,SAAS,CAAC;AAI5B,eAAO,MAAM,KAAK,OAOhB,CAAC"} \ No newline at end of file diff --git a/api/dist/config/redis.js b/api/dist/config/redis.js deleted file mode 100644 index 02b3b700..00000000 --- a/api/dist/config/redis.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.redis = void 0; -const ioredis_1 = __importDefault(require("ioredis")); -const env_1 = require("./env"); -const logger_1 = require("../utils/logger"); -exports.redis = new ioredis_1.default(env_1.env.REDIS_URL, { - maxRetriesPerRequest: null, - enableReadyCheck: true, - retryStrategy(times) { - const delay = Math.min(times * 50, 2000); - return delay; - }, -}); -exports.redis.on('connect', () => { - logger_1.logger.info('Redis connected'); -}); -exports.redis.on('error', (err) => { - logger_1.logger.error('Redis connection error:', err); -}); -//# sourceMappingURL=redis.js.map \ No newline at end of file diff --git a/api/dist/config/redis.js.map b/api/dist/config/redis.js.map deleted file mode 100644 index 3762c000..00000000 --- a/api/dist/config/redis.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"redis.js","sourceRoot":"","sources":["../../src/config/redis.ts"],"names":[],"mappings":";;;;;;AAAA,sDAA4B;AAC5B,+BAA4B;AAC5B,4CAAyC;AAE5B,QAAA,KAAK,GAAG,IAAI,iBAAK,CAAC,SAAG,CAAC,SAAS,EAAE;IAC5C,oBAAoB,EAAE,IAAI;IAC1B,gBAAgB,EAAE,IAAI;IACtB,aAAa,CAAC,KAAK;QACjB,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,GAAG,EAAE,EAAE,IAAI,CAAC,CAAC;QACzC,OAAO,KAAK,CAAC;IACf,CAAC;CACF,CAAC,CAAC;AAEH,aAAK,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE;IACvB,eAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;AACjC,CAAC,CAAC,CAAC;AAEH,aAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;IACxB,eAAM,CAAC,KAAK,CAAC,yBAAyB,EAAE,GAAG,CAAC,CAAC;AAC/C,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/api/dist/media-server.d.ts b/api/dist/media-server.d.ts deleted file mode 100644 index e59f1ffe..00000000 --- a/api/dist/media-server.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {}; -//# sourceMappingURL=media-server.d.ts.map \ No newline at end of file diff --git a/api/dist/media-server.d.ts.map b/api/dist/media-server.d.ts.map deleted file mode 100644 index 6706de99..00000000 --- a/api/dist/media-server.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"media-server.d.ts","sourceRoot":"","sources":["../src/media-server.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/api/dist/media-server.js b/api/dist/media-server.js deleted file mode 100644 index d7015910..00000000 --- a/api/dist/media-server.js +++ /dev/null @@ -1,172 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const fastify_1 = __importDefault(require("fastify")); -const cors_1 = __importDefault(require("@fastify/cors")); -const multipart_1 = __importDefault(require("@fastify/multipart")); -const env_1 = require("./config/env"); -const logger_1 = require("./utils/logger"); -const videos_routes_1 = require("./modules/media/routes/videos.routes"); -const video_streaming_routes_1 = require("./modules/media/routes/video-streaming.routes"); -const reactions_routes_1 = require("./modules/media/routes/reactions.routes"); -const public_routes_1 = require("./modules/media/routes/public.routes"); -const chat_stream_routes_1 = require("./modules/media/routes/chat-stream.routes"); -const comments_routes_1 = require("./modules/media/routes/comments.routes"); -const upload_routes_1 = require("./modules/media/routes/upload.routes"); -const video_actions_routes_1 = require("./modules/media/routes/video-actions.routes"); -const video_schedule_routes_1 = require("./modules/media/routes/video-schedule.routes"); -const video_tracking_routes_1 = require("./modules/media/routes/video-tracking.routes"); -const comment_admin_routes_1 = require("./modules/media/routes/comment-admin.routes"); -const chat_notifications_routes_1 = require("./modules/media/routes/chat-notifications.routes"); -const chat_threads_routes_1 = require("./modules/media/routes/chat-threads.routes"); -const user_profile_routes_1 = require("./modules/media/routes/user-profile.routes"); -const shorts_routes_1 = require("./modules/media/routes/shorts.routes"); -const upvote_routes_1 = require("./modules/media/routes/upvote.routes"); -const video_schedule_queue_service_1 = require("./services/video-schedule-queue.service"); -const video_fetch_queue_service_1 = require("./services/video-fetch-queue.service"); -const fetch_routes_1 = require("./modules/media/routes/fetch.routes"); -const playlists_public_routes_1 = require("./modules/media/routes/playlists-public.routes"); -const playlists_user_routes_1 = require("./modules/media/routes/playlists-user.routes"); -const playlists_admin_routes_1 = require("./modules/media/routes/playlists-admin.routes"); -const photos_routes_1 = require("./modules/media/routes/photos.routes"); -const photo_upload_routes_1 = require("./modules/media/routes/photo-upload.routes"); -const photo_albums_routes_1 = require("./modules/media/routes/photo-albums.routes"); -const photos_public_routes_1 = require("./modules/media/routes/photos-public.routes"); -const photo_engagement_routes_1 = require("./modules/media/routes/photo-engagement.routes"); -// Add BigInt serialization support for Prisma BigInt fields -// This converts BigInt values to strings when JSON.stringify() is called -BigInt.prototype.toJSON = function () { - return this.toString(); -}; -const fastify = (0, fastify_1.default)({ - logger: { - level: env_1.env.NODE_ENV === 'production' ? 'info' : 'debug', - }, - maxParamLength: 500, - trustProxy: true, -}); -// Graceful shutdown handler -process.on('SIGTERM', async () => { - logger_1.logger.info('SIGTERM received, shutting down gracefully...'); - await video_schedule_queue_service_1.videoScheduleQueueService.close(); - await video_fetch_queue_service_1.videoFetchQueueService.close(); - fastify.close(() => { - logger_1.logger.info('Media API server closed'); - process.exit(0); - }); -}); -// Global error handlers -process.on('unhandledRejection', (reason, promise) => { - logger_1.logger.error('Unhandled Promise Rejection in Media API', { reason: JSON.stringify(reason), promise: JSON.stringify(promise) }); -}); -process.on('uncaughtException', (error) => { - logger_1.logger.error('Uncaught Exception in Media API', { error: error instanceof Error ? error.message : JSON.stringify(error) }); - fastify.close(() => { - process.exit(1); - }); -}); -// Start server -const start = async () => { - try { - // CORS configuration — allow admin app + MkDocs docs site - const allowedOrigins = env_1.env.CORS_ORIGINS.split(',').map(o => o.trim()); - // Auto-add MkDocs origins so video cards/players work in docs - const mkdocsOrigin = `http://localhost:${env_1.env.MKDOCS_PORT || 4003}`; - if (!allowedOrigins.includes(mkdocsOrigin)) { - allowedOrigins.push(mkdocsOrigin); - } - // Also allow the docs subdomain in production (docs.domain.org) - for (const origin of [...allowedOrigins]) { - const match = origin.match(/^(https?:\/\/)app\./); - if (match) { - const docsOrigin = origin.replace(/^(https?:\/\/)app\./, '$1docs.'); - if (!allowedOrigins.includes(docsOrigin)) { - allowedOrigins.push(docsOrigin); - } - } - } - await fastify.register(cors_1.default, { - origin: (origin, cb) => { - // Allow requests with no origin (mobile apps, curl, etc.) - if (!origin) { - cb(null, true); - return; - } - // Check if origin is in allowed list - if (allowedOrigins.includes(origin)) { - cb(null, true); - } - else { - cb(new Error('CORS not allowed'), false); - } - }, - credentials: true, - }); - // Multipart support for file uploads (10GB limit) - await fastify.register(multipart_1.default, { - limits: { - fileSize: env_1.env.MAX_UPLOAD_SIZE_GB * 1024 * 1024 * 1024, - }, - }); - // Health check - fastify.get('/health', async () => { - return { - status: 'ok', - timestamp: new Date().toISOString(), - service: 'media-api' - }; - }); - // Register routes - await fastify.register(videos_routes_1.videosRoutes, { prefix: '/api/videos' }); - await fastify.register(video_streaming_routes_1.videoStreamingRoutes, { prefix: '/api/videos' }); - await fastify.register(upload_routes_1.uploadRoutes, { prefix: '/api/videos' }); - await fastify.register(video_actions_routes_1.videoActionsRoutes, { prefix: '/api/videos' }); - await fastify.register(video_schedule_routes_1.videoScheduleRoutes, { prefix: '/api/videos' }); - await fastify.register(video_tracking_routes_1.videoTrackingRoutes, { prefix: '/api/track' }); - await fastify.register(reactions_routes_1.reactionsRoutes, { prefix: '/api/reactions' }); - await fastify.register(public_routes_1.publicRoutes, { prefix: '/api' }); - await fastify.register(comments_routes_1.commentsRoutes, { prefix: '/api' }); - await fastify.register(chat_stream_routes_1.chatStreamRoutes, { prefix: '/api' }); - await fastify.register(comment_admin_routes_1.commentAdminRoutes, { prefix: '/api/media' }); - await fastify.register(chat_notifications_routes_1.chatNotificationsRoutes, { prefix: '/api/media' }); - await fastify.register(chat_threads_routes_1.chatThreadsRoutes, { prefix: '/api/media' }); - await fastify.register(user_profile_routes_1.userProfileRoutes, { prefix: '/api/media' }); - await fastify.register(fetch_routes_1.fetchRoutes, { prefix: '/api/videos' }); - await fastify.register(shorts_routes_1.shortsRoutes, { prefix: '/api' }); - await fastify.register(upvote_routes_1.upvoteRoutes, { prefix: '/api' }); - await fastify.register(playlists_public_routes_1.playlistsPublicRoutes, { prefix: '/api/playlists' }); - await fastify.register(playlists_user_routes_1.playlistsUserRoutes, { prefix: '/api/playlists' }); - await fastify.register(playlists_admin_routes_1.playlistsAdminRoutes, { prefix: '/api/media' }); - // Photo gallery routes - await fastify.register(photos_routes_1.photosRoutes, { prefix: '/api/photos' }); - await fastify.register(photo_upload_routes_1.photoUploadRoutes, { prefix: '/api/photos' }); - await fastify.register(photo_albums_routes_1.photoAlbumsRoutes, { prefix: '/api/albums' }); - await fastify.register(photos_public_routes_1.photosPublicRoutes, { prefix: '/api' }); - await fastify.register(photo_engagement_routes_1.photoEngagementRoutes, { prefix: '/api' }); - // 404 handler for unmatched routes - fastify.setNotFoundHandler((_request, reply) => { - reply.status(404).send({ error: { message: 'Route not found', code: 'NOT_FOUND' } }); - }); - const port = env_1.env.MEDIA_API_PORT; - const host = '0.0.0.0'; - await fastify.listen({ port, host }); - logger_1.logger.info(`Media API listening on http://${host}:${port}`); - // Start video schedule queue worker - video_schedule_queue_service_1.videoScheduleQueueService.startWorker(); - logger_1.logger.info('Video schedule queue worker initialized'); - // Start video fetch queue worker - video_fetch_queue_service_1.videoFetchQueueService.startWorker(); - logger_1.logger.info('Video fetch queue worker initialized'); - if (env_1.env.ENABLE_MEDIA_FEATURES !== 'true') { - logger_1.logger.warn('Media features are disabled (ENABLE_MEDIA_FEATURES=false)'); - } - } - catch (err) { - logger_1.logger.error('Media API startup error', { error: err instanceof Error ? err.message : JSON.stringify(err) }); - process.exit(1); - } -}; -start(); -//# sourceMappingURL=media-server.js.map \ No newline at end of file diff --git a/api/dist/media-server.js.map b/api/dist/media-server.js.map deleted file mode 100644 index 44077a40..00000000 --- a/api/dist/media-server.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"media-server.js","sourceRoot":"","sources":["../src/media-server.ts"],"names":[],"mappings":";;;;;AAAA,sDAA8B;AAC9B,yDAAiC;AACjC,mEAA2C;AAC3C,sCAAm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CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,iBAAiB,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,CAAC,CAAC;QACvF,CAAC,CAAC,CAAC;QAEH,MAAM,IAAI,GAAG,SAAG,CAAC,cAAc,CAAC;QAChC,MAAM,IAAI,GAAG,SAAS,CAAC;QAEvB,MAAM,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QACrC,eAAM,CAAC,IAAI,CAAC,iCAAiC,IAAI,IAAI,IAAI,EAAE,CAAC,CAAC;QAE7D,oCAAoC;QACpC,wDAAyB,CAAC,WAAW,EAAE,CAAC;QACxC,eAAM,CAAC,IAAI,CAAC,yCAAyC,CAAC,CAAC;QAEvD,iCAAiC;QACjC,kDAAsB,CAAC,WAAW,EAAE,CAAC;QACrC,eAAM,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;QAEpD,IAAI,SAAG,CAAC,qBAAqB,KAAK,MAAM,EAAE,CAAC;YACzC,eAAM,CAAC,IAAI,CAAC,2DAA2D,CAAC,CAAC;QAC3E,CAAC;IACH,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,eAAM,CAAC,KAAK,CAAC,yBAAyB,EAAE,EAAE,KAAK,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC7G,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC;AAEF,KAAK,EAAE,CAAC"} \ No newline at end of file diff --git a/api/dist/middleware/auth.middleware.d.ts b/api/dist/middleware/auth.middleware.d.ts deleted file mode 100644 index 52a548f7..00000000 --- a/api/dist/middleware/auth.middleware.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { Request, Response, NextFunction } from 'express'; -export declare function authenticate(req: Request, _res: Response, next: NextFunction): void; -export declare function optionalAuth(req: Request, _res: Response, next: NextFunction): void; -//# sourceMappingURL=auth.middleware.d.ts.map \ No newline at end of file diff --git a/api/dist/middleware/auth.middleware.d.ts.map b/api/dist/middleware/auth.middleware.d.ts.map deleted file mode 100644 index 5aefea6d..00000000 --- a/api/dist/middleware/auth.middleware.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"auth.middleware.d.ts","sourceRoot":"","sources":["../../src/middleware/auth.middleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAa1D,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,QAoB5E;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,QAsB5E"} \ No newline at end of file diff --git a/api/dist/middleware/auth.middleware.js b/api/dist/middleware/auth.middleware.js deleted file mode 100644 index 63134691..00000000 --- a/api/dist/middleware/auth.middleware.js +++ /dev/null @@ -1,52 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.authenticate = authenticate; -exports.optionalAuth = optionalAuth; -const jsonwebtoken_1 = __importDefault(require("jsonwebtoken")); -const env_1 = require("../config/env"); -const error_handler_1 = require("./error-handler"); -function authenticate(req, _res, next) { - const header = req.headers.authorization; - if (!header?.startsWith('Bearer ')) { - throw new error_handler_1.AppError(401, 'Authentication required', 'AUTH_REQUIRED'); - } - const token = header.slice(7); - try { - const payload = jsonwebtoken_1.default.verify(token, env_1.env.JWT_ACCESS_SECRET, { algorithms: ['HS256'] }); - req.user = { - id: payload.id, - email: payload.email, - role: payload.role, - roles: payload.roles || [payload.role], // Backwards compat: old JWTs without roles - }; - next(); - } - catch { - throw new error_handler_1.AppError(401, 'Invalid or expired token', 'INVALID_TOKEN'); - } -} -function optionalAuth(req, _res, next) { - const header = req.headers.authorization; - if (!header?.startsWith('Bearer ')) { - next(); - return; - } - const token = header.slice(7); - try { - const payload = jsonwebtoken_1.default.verify(token, env_1.env.JWT_ACCESS_SECRET, { algorithms: ['HS256'] }); - req.user = { - id: payload.id, - email: payload.email, - role: payload.role, - roles: payload.roles || [payload.role], - }; - } - catch { - // Token invalid — continue without user - } - next(); -} -//# sourceMappingURL=auth.middleware.js.map \ No newline at end of file diff --git a/api/dist/middleware/auth.middleware.js.map b/api/dist/middleware/auth.middleware.js.map deleted file mode 100644 index b400ce31..00000000 --- a/api/dist/middleware/auth.middleware.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"auth.middleware.js","sourceRoot":"","sources":["../../src/middleware/auth.middleware.ts"],"names":[],"mappings":";;;;;AAaA,oCAoBC;AAED,oCAsBC;AAxDD,gEAA+B;AAE/B,uCAAoC;AACpC,mDAA2C;AAS3C,SAAgB,YAAY,CAAC,GAAY,EAAE,IAAc,EAAE,IAAkB;IAC3E,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC;IACzC,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QACnC,MAAM,IAAI,wBAAQ,CAAC,GAAG,EAAE,yBAAyB,EAAE,eAAe,CAAC,CAAC;IACtE,CAAC;IAED,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAE9B,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,sBAAG,CAAC,MAAM,CAAC,KAAK,EAAE,SAAG,CAAC,iBAAiB,EAAE,EAAE,UAAU,EAAE,CAAC,OAAO,CAAC,EAAE,CAAiB,CAAC;QACpG,GAAG,CAAC,IAAI,GAAG;YACT,EAAE,EAAE,OAAO,CAAC,EAAE;YACd,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,2CAA2C;SACpF,CAAC;QACF,IAAI,EAAE,CAAC;IACT,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,wBAAQ,CAAC,GAAG,EAAE,0BAA0B,EAAE,eAAe,CAAC,CAAC;IACvE,CAAC;AACH,CAAC;AAED,SAAgB,YAAY,CAAC,GAAY,EAAE,IAAc,EAAE,IAAkB;IAC3E,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,aAAa,CAAC;IACzC,IAAI,CAAC,MAAM,EAAE,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QACnC,IAAI,EAAE,CAAC;QACP,OAAO;IACT,CAAC;IAED,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAE9B,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,sBAAG,CAAC,MAAM,CAAC,KAAK,EAAE,SAAG,CAAC,iBAAiB,EAAE,EAAE,UAAU,EAAE,CAAC,OAAO,CAAC,EAAE,CAAiB,CAAC;QACpG,GAAG,CAAC,IAAI,GAAG;YACT,EAAE,EAAE,OAAO,CAAC,EAAE;YACd,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC;SACvC,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC;QACP,wCAAwC;IAC1C,CAAC;IAED,IAAI,EAAE,CAAC;AACT,CAAC"} \ No newline at end of file diff --git a/api/dist/middleware/error-handler.d.ts b/api/dist/middleware/error-handler.d.ts deleted file mode 100644 index 1fc29393..00000000 --- a/api/dist/middleware/error-handler.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { Request, Response, NextFunction } from 'express'; -export declare class AppError extends Error { - statusCode: number; - code?: string | undefined; - constructor(statusCode: number, message: string, code?: string | undefined); -} -export declare function errorHandler(err: Error, _req: Request, res: Response, _next: NextFunction): void; -//# sourceMappingURL=error-handler.d.ts.map \ No newline at end of file diff --git a/api/dist/middleware/error-handler.d.ts.map b/api/dist/middleware/error-handler.d.ts.map deleted file mode 100644 index 2ba153dc..00000000 --- a/api/dist/middleware/error-handler.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"error-handler.d.ts","sourceRoot":"","sources":["../../src/middleware/error-handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAK1D,qBAAa,QAAS,SAAQ,KAAK;IAExB,UAAU,EAAE,MAAM;IAElB,IAAI,CAAC,EAAE,MAAM;gBAFb,UAAU,EAAE,MAAM,EACzB,OAAO,EAAE,MAAM,EACR,IAAI,CAAC,EAAE,MAAM,YAAA;CAKvB;AAED,wBAAgB,YAAY,CAC1B,GAAG,EAAE,KAAK,EACV,IAAI,EAAE,OAAO,EACb,GAAG,EAAE,QAAQ,EACb,KAAK,EAAE,YAAY,QAqCpB"} \ No newline at end of file diff --git a/api/dist/middleware/error-handler.js b/api/dist/middleware/error-handler.js deleted file mode 100644 index fd905133..00000000 --- a/api/dist/middleware/error-handler.js +++ /dev/null @@ -1,52 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.AppError = void 0; -exports.errorHandler = errorHandler; -const zod_1 = require("zod"); -const logger_1 = require("../utils/logger"); -const env_1 = require("../config/env"); -class AppError extends Error { - statusCode; - code; - constructor(statusCode, message, code) { - super(message); - this.statusCode = statusCode; - this.code = code; - this.name = 'AppError'; - } -} -exports.AppError = AppError; -function errorHandler(err, _req, res, _next) { - if (err instanceof AppError) { - res.status(err.statusCode).json({ - error: { - message: err.message, - code: err.code, - }, - }); - return; - } - if (err instanceof zod_1.ZodError) { - const fieldErrors = err.flatten().fieldErrors; - const errorCount = Object.keys(fieldErrors).length; - res.status(400).json({ - error: { - message: 'Validation error', - code: 'VALIDATION_ERROR', - // Only expose details in development - ...(env_1.env.NODE_ENV === 'development' && { details: fieldErrors }), - // In production, only show count - ...(env_1.env.NODE_ENV === 'production' && { fieldCount: errorCount }), - }, - }); - return; - } - logger_1.logger.error('Unhandled error:', err); - res.status(500).json({ - error: { - message: env_1.env.NODE_ENV === 'production' ? 'Internal server error' : err.message, - code: 'INTERNAL_ERROR', - }, - }); -} -//# sourceMappingURL=error-handler.js.map \ No newline at end of file diff --git a/api/dist/middleware/error-handler.js.map b/api/dist/middleware/error-handler.js.map deleted file mode 100644 index ef7ddcd9..00000000 --- a/api/dist/middleware/error-handler.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"error-handler.js","sourceRoot":"","sources":["../../src/middleware/error-handler.ts"],"names":[],"mappings":";;;AAgBA,oCAyCC;AAxDD,6BAA+B;AAC/B,4CAAyC;AACzC,uCAAoC;AAEpC,MAAa,QAAS,SAAQ,KAAK;IAExB;IAEA;IAHT,YACS,UAAkB,EACzB,OAAe,EACR,IAAa;QAEpB,KAAK,CAAC,OAAO,CAAC,CAAC;QAJR,eAAU,GAAV,UAAU,CAAQ;QAElB,SAAI,GAAJ,IAAI,CAAS;QAGpB,IAAI,CAAC,IAAI,GAAG,UAAU,CAAC;IACzB,CAAC;CACF;AATD,4BASC;AAED,SAAgB,YAAY,CAC1B,GAAU,EACV,IAAa,EACb,GAAa,EACb,KAAmB;IAEnB,IAAI,GAAG,YAAY,QAAQ,EAAE,CAAC;QAC5B,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC;YAC9B,KAAK,EAAE;gBACL,OAAO,EAAE,GAAG,CAAC,OAAO;gBACpB,IAAI,EAAE,GAAG,CAAC,IAAI;aACf;SACF,CAAC,CAAC;QACH,OAAO;IACT,CAAC;IAED,IAAI,GAAG,YAAY,cAAQ,EAAE,CAAC;QAC5B,MAAM,WAAW,GAAG,GAAG,CAAC,OAAO,EAAE,CAAC,WAAW,CAAC;QAC9C,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,MAAM,CAAC;QAEnD,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;YACnB,KAAK,EAAE;gBACL,OAAO,EAAE,kBAAkB;gBAC3B,IAAI,EAAE,kBAAkB;gBACxB,qCAAqC;gBACrC,GAAG,CAAC,SAAG,CAAC,QAAQ,KAAK,aAAa,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC;gBAC/D,iCAAiC;gBACjC,GAAG,CAAC,SAAG,CAAC,QAAQ,KAAK,YAAY,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC;aACjE;SACF,CAAC,CAAC;QACH,OAAO;IACT,CAAC;IAED,eAAM,CAAC,KAAK,CAAC,kBAAkB,EAAE,GAAG,CAAC,CAAC;IAEtC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;QACnB,KAAK,EAAE;YACL,OAAO,EAAE,SAAG,CAAC,QAAQ,KAAK,YAAY,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO;YAC9E,IAAI,EAAE,gBAAgB;SACvB;KACF,CAAC,CAAC;AACL,CAAC"} \ No newline at end of file diff --git a/api/dist/middleware/rate-limit.d.ts b/api/dist/middleware/rate-limit.d.ts deleted file mode 100644 index 2d4e1666..00000000 --- a/api/dist/middleware/rate-limit.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -export declare const globalRateLimit: import("express-rate-limit").RateLimitRequestHandler; -export declare const emailRateLimit: import("express-rate-limit").RateLimitRequestHandler; -export declare const responseRateLimit: import("express-rate-limit").RateLimitRequestHandler; -export declare const shiftSignupRateLimit: import("express-rate-limit").RateLimitRequestHandler; -export declare const canvassVisitRateLimit: import("express-rate-limit").RateLimitRequestHandler; -export declare const canvassBulkVisitRateLimit: import("express-rate-limit").RateLimitRequestHandler; -export declare const gpsTrackingRateLimit: import("express-rate-limit").RateLimitRequestHandler; -export declare const canvassGeocodeRateLimit: import("express-rate-limit").RateLimitRequestHandler; -export declare const adTrackingRateLimit: import("express-rate-limit").RateLimitRequestHandler; -export declare const quickJoinRateLimit: import("express-rate-limit").RateLimitRequestHandler; -export declare const authRateLimit: import("express-rate-limit").RateLimitRequestHandler; -export declare const observabilityRateLimit: import("express-rate-limit").RateLimitRequestHandler; -export declare const docsAnalyticsRateLimit: import("express-rate-limit").RateLimitRequestHandler; -export declare const docsCommentAnonRateLimit: import("express-rate-limit").RateLimitRequestHandler; -export declare const docsCommentAuthRateLimit: import("express-rate-limit").RateLimitRequestHandler; -export declare const docsCommentFetchRateLimit: import("express-rate-limit").RateLimitRequestHandler; -export declare const profileViewRateLimit: import("express-rate-limit").RateLimitRequestHandler; -export declare const profileEditRateLimit: import("express-rate-limit").RateLimitRequestHandler; -export declare const profilePhotoRateLimit: import("express-rate-limit").RateLimitRequestHandler; -export declare const profilePasswordRateLimit: import("express-rate-limit").RateLimitRequestHandler; -export declare const eventSubmissionRateLimit: import("express-rate-limit").RateLimitRequestHandler; -export declare const errorReportRateLimit: import("express-rate-limit").RateLimitRequestHandler; -export declare const healthMetricsRateLimit: import("express-rate-limit").RateLimitRequestHandler; -//# sourceMappingURL=rate-limit.d.ts.map \ No newline at end of file diff --git a/api/dist/middleware/rate-limit.d.ts.map b/api/dist/middleware/rate-limit.d.ts.map deleted file mode 100644 index 3d738252..00000000 --- a/api/dist/middleware/rate-limit.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rate-limit.d.ts","sourceRoot":"","sources":["../../src/middleware/rate-limit.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,eAAe,sDAe1B,CAAC;AAEH,eAAO,MAAM,cAAc,sDAezB,CAAC;AAEH,eAAO,MAAM,iBAAiB,sDAe5B,CAAC;AAEH,eAAO,MAAM,oBAAoB,sDAe/B,CAAC;AAEH,eAAO,MAAM,qBAAqB,sDAehC,CAAC;AAEH,eAAO,MAAM,yBAAyB,sDAepC,CAAC;AAEH,eAAO,MAAM,oBAAoB,sDAe/B,CAAC;AAEH,eAAO,MAAM,uBAAuB,sDAelC,CAAC;AAEH,eAAO,MAAM,mBAAmB,sDAe9B,CAAC;AAEH,eAAO,MAAM,kBAAkB,sDAe7B,CAAC;AAEH,eAAO,MAAM,aAAa,sDAexB,CAAC;AAEH,eAAO,MAAM,sBAAsB,sDAejC,CAAC;AAEH,eAAO,MAAM,sBAAsB,sDAejC,CAAC;AAEH,eAAO,MAAM,wBAAwB,sDAenC,CAAC;AAEH,eAAO,MAAM,wBAAwB,sDAenC,CAAC;AAEH,eAAO,MAAM,yBAAyB,sDAepC,CAAC;AAEH,eAAO,MAAM,oBAAoB,sDAe/B,CAAC;AAEH,eAAO,MAAM,oBAAoB,sDAe/B,CAAC;AAEH,eAAO,MAAM,qBAAqB,sDAehC,CAAC;AAEH,eAAO,MAAM,wBAAwB,sDAenC,CAAC;AAEH,eAAO,MAAM,wBAAwB,sDAenC,CAAC;AAEH,eAAO,MAAM,oBAAoB,sDAe/B,CAAC;AAEH,eAAO,MAAM,sBAAsB,sDAejC,CAAC"} \ No newline at end of file diff --git a/api/dist/middleware/rate-limit.js b/api/dist/middleware/rate-limit.js deleted file mode 100644 index cb8f22c8..00000000 --- a/api/dist/middleware/rate-limit.js +++ /dev/null @@ -1,379 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.healthMetricsRateLimit = exports.errorReportRateLimit = exports.eventSubmissionRateLimit = exports.profilePasswordRateLimit = exports.profilePhotoRateLimit = exports.profileEditRateLimit = exports.profileViewRateLimit = exports.docsCommentFetchRateLimit = exports.docsCommentAuthRateLimit = exports.docsCommentAnonRateLimit = exports.docsAnalyticsRateLimit = exports.observabilityRateLimit = exports.authRateLimit = exports.quickJoinRateLimit = exports.adTrackingRateLimit = exports.canvassGeocodeRateLimit = exports.gpsTrackingRateLimit = exports.canvassBulkVisitRateLimit = exports.canvassVisitRateLimit = exports.shiftSignupRateLimit = exports.responseRateLimit = exports.emailRateLimit = exports.globalRateLimit = void 0; -const express_rate_limit_1 = __importDefault(require("express-rate-limit")); -const rate_limit_redis_1 = __importDefault(require("rate-limit-redis")); -const redis_1 = require("../config/redis"); -const env_1 = require("../config/env"); -exports.globalRateLimit = (0, express_rate_limit_1.default)({ - windowMs: env_1.env.RATE_LIMIT_WINDOW_MS, - max: env_1.env.RATE_LIMIT_MAX, - standardHeaders: true, - legacyHeaders: false, - store: new rate_limit_redis_1.default({ - sendCommand: (command, ...args) => redis_1.redis.call(command, ...args), - prefix: 'rl:global:', - }), - message: { - error: { - message: 'Too many requests, please try again later', - code: 'RATE_LIMIT_EXCEEDED', - }, - }, -}); -exports.emailRateLimit = (0, express_rate_limit_1.default)({ - windowMs: 60 * 60 * 1000, // 1 hour - max: 30, - standardHeaders: true, - legacyHeaders: false, - store: new rate_limit_redis_1.default({ - sendCommand: (command, ...args) => redis_1.redis.call(command, ...args), - prefix: 'rl:email:', - }), - message: { - error: { - message: 'Too many email requests, please try again later', - code: 'EMAIL_RATE_LIMIT_EXCEEDED', - }, - }, -}); -exports.responseRateLimit = (0, express_rate_limit_1.default)({ - windowMs: 60 * 60 * 1000, // 1 hour - max: 10, - standardHeaders: true, - legacyHeaders: false, - store: new rate_limit_redis_1.default({ - sendCommand: (command, ...args) => redis_1.redis.call(command, ...args), - prefix: 'rl:response:', - }), - message: { - error: { - message: 'Too many response submissions, please try again later', - code: 'RESPONSE_RATE_LIMIT_EXCEEDED', - }, - }, -}); -exports.shiftSignupRateLimit = (0, express_rate_limit_1.default)({ - windowMs: 60 * 60 * 1000, // 1 hour - max: 10, - standardHeaders: true, - legacyHeaders: false, - store: new rate_limit_redis_1.default({ - sendCommand: (command, ...args) => redis_1.redis.call(command, ...args), - prefix: 'rl:shift-signup:', - }), - message: { - error: { - message: 'Too many signup attempts, please try again later', - code: 'SHIFT_SIGNUP_RATE_LIMIT_EXCEEDED', - }, - }, -}); -exports.canvassVisitRateLimit = (0, express_rate_limit_1.default)({ - windowMs: 60 * 1000, // 1 minute - max: 30, - standardHeaders: true, - legacyHeaders: false, - store: new rate_limit_redis_1.default({ - sendCommand: (command, ...args) => redis_1.redis.call(command, ...args), - prefix: 'rl:canvass-visit:', - }), - message: { - error: { - message: 'Too many visit recordings, please slow down', - code: 'CANVASS_VISIT_RATE_LIMIT_EXCEEDED', - }, - }, -}); -exports.canvassBulkVisitRateLimit = (0, express_rate_limit_1.default)({ - windowMs: 60 * 1000, // 1 minute - max: 5, // Stricter limit for bulk operations - standardHeaders: true, - legacyHeaders: false, - store: new rate_limit_redis_1.default({ - sendCommand: (command, ...args) => redis_1.redis.call(command, ...args), - prefix: 'rl:canvass-visit-bulk:', - }), - message: { - error: { - message: 'Too many bulk visit recordings, please slow down', - code: 'CANVASS_BULK_VISIT_RATE_LIMIT_EXCEEDED', - }, - }, -}); -exports.gpsTrackingRateLimit = (0, express_rate_limit_1.default)({ - windowMs: 60 * 1000, // 1 minute - max: 6, - standardHeaders: true, - legacyHeaders: false, - store: new rate_limit_redis_1.default({ - sendCommand: (command, ...args) => redis_1.redis.call(command, ...args), - prefix: 'rl:gps-tracking:', - }), - message: { - error: { - message: 'Too many GPS tracking requests, please slow down', - code: 'GPS_TRACKING_RATE_LIMIT_EXCEEDED', - }, - }, -}); -exports.canvassGeocodeRateLimit = (0, express_rate_limit_1.default)({ - windowMs: 60 * 1000, // 1 minute - max: 10, - standardHeaders: true, - legacyHeaders: false, - store: new rate_limit_redis_1.default({ - sendCommand: (command, ...args) => redis_1.redis.call(command, ...args), - prefix: 'rl:canvass-geocode:', - }), - message: { - error: { - message: 'Too many geocode requests, please slow down', - code: 'CANVASS_GEOCODE_RATE_LIMIT_EXCEEDED', - }, - }, -}); -exports.adTrackingRateLimit = (0, express_rate_limit_1.default)({ - windowMs: 60 * 1000, // 1 minute - max: 60, // 60 events/min per IP (generous for scroll-heavy gallery pages) - standardHeaders: true, - legacyHeaders: false, - store: new rate_limit_redis_1.default({ - sendCommand: (command, ...args) => redis_1.redis.call(command, ...args), - prefix: 'rl:ad-track:', - }), - message: { - error: { - message: 'Too many tracking requests', - code: 'RATE_LIMIT_EXCEEDED', - }, - }, -}); -exports.quickJoinRateLimit = (0, express_rate_limit_1.default)({ - windowMs: 60 * 60 * 1000, // 1 hour - max: 10, - standardHeaders: true, - legacyHeaders: false, - store: new rate_limit_redis_1.default({ - sendCommand: (command, ...args) => redis_1.redis.call(command, ...args), - prefix: 'rl:quick-join:', - }), - message: { - error: { - message: 'Too many join attempts, please try again later', - code: 'QUICK_JOIN_RATE_LIMIT_EXCEEDED', - }, - }, -}); -exports.authRateLimit = (0, express_rate_limit_1.default)({ - windowMs: 15 * 60 * 1000, - max: 10, // Reduced from 20 to prevent brute force attacks - standardHeaders: true, - legacyHeaders: false, - store: new rate_limit_redis_1.default({ - sendCommand: (command, ...args) => redis_1.redis.call(command, ...args), - prefix: 'rl:auth:', - }), - message: { - error: { - message: 'Too many authentication attempts, please try again later', - code: 'AUTH_RATE_LIMIT_EXCEEDED', - }, - }, -}); -exports.observabilityRateLimit = (0, express_rate_limit_1.default)({ - windowMs: 60 * 1000, // 1 minute - max: 20, // 20 requests per minute (stricter than global 500/min) - standardHeaders: true, - legacyHeaders: false, - store: new rate_limit_redis_1.default({ - sendCommand: (command, ...args) => redis_1.redis.call(command, ...args), - prefix: 'rl:observability:', - }), - message: { - error: { - message: 'Too many observability requests, please try again later', - code: 'OBSERVABILITY_RATE_LIMIT_EXCEEDED', - }, - }, -}); -exports.docsAnalyticsRateLimit = (0, express_rate_limit_1.default)({ - windowMs: 60 * 1000, // 1 minute - max: 60, // 60 requests/min per IP - standardHeaders: true, - legacyHeaders: false, - store: new rate_limit_redis_1.default({ - sendCommand: (command, ...args) => redis_1.redis.call(command, ...args), - prefix: 'rl:docs-analytics:', - }), - message: { - error: { - message: 'Too many tracking requests, please slow down', - code: 'DOCS_ANALYTICS_RATE_LIMIT_EXCEEDED', - }, - }, -}); -exports.docsCommentAnonRateLimit = (0, express_rate_limit_1.default)({ - windowMs: 60 * 60 * 1000, // 1 hour - max: 5, - standardHeaders: true, - legacyHeaders: false, - store: new rate_limit_redis_1.default({ - sendCommand: (command, ...args) => redis_1.redis.call(command, ...args), - prefix: 'rl:docs-comment-anon:', - }), - message: { - error: { - message: 'Too many anonymous comments, please try again later', - code: 'DOCS_COMMENT_ANON_RATE_LIMIT_EXCEEDED', - }, - }, -}); -exports.docsCommentAuthRateLimit = (0, express_rate_limit_1.default)({ - windowMs: 60 * 60 * 1000, // 1 hour - max: 30, - standardHeaders: true, - legacyHeaders: false, - store: new rate_limit_redis_1.default({ - sendCommand: (command, ...args) => redis_1.redis.call(command, ...args), - prefix: 'rl:docs-comment-auth:', - }), - message: { - error: { - message: 'Too many comments, please try again later', - code: 'DOCS_COMMENT_AUTH_RATE_LIMIT_EXCEEDED', - }, - }, -}); -exports.docsCommentFetchRateLimit = (0, express_rate_limit_1.default)({ - windowMs: 60 * 1000, // 1 minute - max: 60, - standardHeaders: true, - legacyHeaders: false, - store: new rate_limit_redis_1.default({ - sendCommand: (command, ...args) => redis_1.redis.call(command, ...args), - prefix: 'rl:docs-comment-fetch:', - }), - message: { - error: { - message: 'Too many comment fetch requests, please slow down', - code: 'DOCS_COMMENT_FETCH_RATE_LIMIT_EXCEEDED', - }, - }, -}); -exports.profileViewRateLimit = (0, express_rate_limit_1.default)({ - windowMs: 60 * 1000, // 1 minute - max: 60, // 60 requests per minute (shared across profile, photo, activity endpoints) - standardHeaders: true, - legacyHeaders: false, - store: new rate_limit_redis_1.default({ - sendCommand: (command, ...args) => redis_1.redis.call(command, ...args), - prefix: 'rl:profile-view:', - }), - message: { - error: { - message: 'Too many profile requests, please try again later', - code: 'PROFILE_VIEW_RATE_LIMIT_EXCEEDED', - }, - }, -}); -exports.profileEditRateLimit = (0, express_rate_limit_1.default)({ - windowMs: 60 * 60 * 1000, // 1 hour - max: 20, - standardHeaders: true, - legacyHeaders: false, - store: new rate_limit_redis_1.default({ - sendCommand: (command, ...args) => redis_1.redis.call(command, ...args), - prefix: 'rl:profile-edit:', - }), - message: { - error: { - message: 'Too many profile edit requests, please try again later', - code: 'PROFILE_EDIT_RATE_LIMIT_EXCEEDED', - }, - }, -}); -exports.profilePhotoRateLimit = (0, express_rate_limit_1.default)({ - windowMs: 60 * 60 * 1000, // 1 hour - max: 5, - standardHeaders: true, - legacyHeaders: false, - store: new rate_limit_redis_1.default({ - sendCommand: (command, ...args) => redis_1.redis.call(command, ...args), - prefix: 'rl:profile-photo:', - }), - message: { - error: { - message: 'Too many photo uploads, please try again later', - code: 'PROFILE_PHOTO_RATE_LIMIT_EXCEEDED', - }, - }, -}); -exports.profilePasswordRateLimit = (0, express_rate_limit_1.default)({ - windowMs: 15 * 60 * 1000, // 15 minutes - max: 5, // Stricter than auth (10/15min) — profile passwords may be simpler - standardHeaders: true, - legacyHeaders: false, - store: new rate_limit_redis_1.default({ - sendCommand: (command, ...args) => redis_1.redis.call(command, ...args), - prefix: 'rl:profile-password:', - }), - message: { - error: { - message: 'Too many password attempts, please try again later', - code: 'PROFILE_PASSWORD_RATE_LIMIT_EXCEEDED', - }, - }, -}); -exports.eventSubmissionRateLimit = (0, express_rate_limit_1.default)({ - windowMs: 60 * 60 * 1000, // 1 hour - max: 5, - standardHeaders: true, - legacyHeaders: false, - store: new rate_limit_redis_1.default({ - sendCommand: (command, ...args) => redis_1.redis.call(command, ...args), - prefix: 'rl:event-submit:', - }), - message: { - error: { - message: 'Too many event submissions, please try again later', - code: 'EVENT_SUBMISSION_RATE_LIMIT_EXCEEDED', - }, - }, -}); -exports.errorReportRateLimit = (0, express_rate_limit_1.default)({ - windowMs: 60 * 60 * 1000, // 1 hour - max: 5, - standardHeaders: true, - legacyHeaders: false, - store: new rate_limit_redis_1.default({ - sendCommand: (command, ...args) => redis_1.redis.call(command, ...args), - prefix: 'rl:error-report:', - }), - message: { - error: { - message: 'Too many error reports, please try again later', - code: 'ERROR_REPORT_RATE_LIMIT_EXCEEDED', - }, - }, -}); -exports.healthMetricsRateLimit = (0, express_rate_limit_1.default)({ - windowMs: 60 * 1000, // 1 minute - max: 30, // 30 requests per minute - standardHeaders: true, - legacyHeaders: false, - store: new rate_limit_redis_1.default({ - sendCommand: (command, ...args) => redis_1.redis.call(command, ...args), - prefix: 'rl:health-metrics:', - }), - message: { - error: { - message: 'Too many health check requests, please try again later', - code: 'HEALTH_METRICS_RATE_LIMIT_EXCEEDED', - }, - }, -}); -//# sourceMappingURL=rate-limit.js.map \ No newline at end of file diff --git a/api/dist/middleware/rate-limit.js.map b/api/dist/middleware/rate-limit.js.map deleted file mode 100644 index 79069ce2..00000000 --- a/api/dist/middleware/rate-limit.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rate-limit.js","sourceRoot":"","sources":["../../src/middleware/rate-limit.ts"],"names":[],"mappings":";;;;;;AAAA,4EAA2C;AAC3C,wEAA0C;AAC1C,2CAAwC;AACxC,uCAAoC;AAEvB,QAAA,eAAe,GAAG,IAAA,4BAAS,EAAC;IACvC,QAAQ,EAAE,SAAG,CAAC,oBAAoB;IAClC,GAAG,EAAE,SAAG,CAAC,cAAc;IACvB,eAAe,EAAE,IAAI;IACrB,aAAa,EAAE,KAAK;IACpB,KAAK,EAAE,IAAI,0BAAU,CAAC;QACpB,WAAW,EAAE,CAAC,OAAe,EAAE,GAAG,IAAc,EAAE,EAAE,CAAC,aAAK,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAiB;QACjG,MAAM,EAAE,YAAY;KACrB,CAAC;IACF,OAAO,EAAE;QACP,KAAK,EAAE;YACL,OAAO,EAAE,2CAA2C;YACpD,IAAI,EAAE,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B,GAAG,IAAA,4BAAS,EAAC;IAC5C,QAAQ,EAAE,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,SAAS;IACnC,GAAG,EAAE,CAAC;IACN,eAAe,EAAE,IAAI;IACrB,aAAa,EAAE,KAAK;IACpB,KAAK,EAAE,IAAI,0BAAU,CAAC;QACpB,WAAW,EAAE,CAAC,OAAe,EAAE,GAAG,IAAc,EAAE,EAAE,CAAC,aAAK,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAiB;QACjG,MAAM,EAAE,kBAAkB;KAC3B,CAAC;IACF,OAAO,EAAE;QACP,KAAK,EAAE;YACL,OAAO,EAAE,gDAAgD;YACzD,IAAI,EAAE,kCAAkC;SACzC;KACF;CACF,CAAC,CAAC;AAEU,QAAA,sBAAsB,GAAG,IAAA,4BAAS,EAAC;IAC9C,QAAQ,EAAE,EAAE,GAAG,IAAI,EAAE,WAAW;IAChC,GAAG,EAAE,EAAE,EAAE,yBAAyB;IAClC,eAAe,EAAE,IAAI;IACrB,aAAa,EAAE,KAAK;IACpB,KAAK,EAAE,IAAI,0BAAU,CAAC;QACpB,WAAW,EAAE,CAAC,OAAe,EAAE,GAAG,IAAc,EAAE,EAAE,CAAC,aAAK,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAiB;QACjG,MAAM,EAAE,oBAAoB;KAC7B,CAAC;IACF,OAAO,EAAE;QACP,KAAK,EAAE;YACL,OAAO,EAAE,wDAAwD;YACjE,IAAI,EAAE,oCAAoC;SAC3C;KACF;CACF,CAAC,CAAC"} \ No newline at end of file diff --git a/api/dist/middleware/rbac.middleware.d.ts b/api/dist/middleware/rbac.middleware.d.ts deleted file mode 100644 index 2dfd751b..00000000 --- a/api/dist/middleware/rbac.middleware.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -import { Request, Response, NextFunction } from 'express'; -import { UserRole } from '@prisma/client'; -export declare function requireRole(...roles: UserRole[]): (req: Request, _res: Response, next: NextFunction) => void; -export declare function requireNonTemp(req: Request, _res: Response, next: NextFunction): void; -//# sourceMappingURL=rbac.middleware.d.ts.map \ No newline at end of file diff --git a/api/dist/middleware/rbac.middleware.d.ts.map b/api/dist/middleware/rbac.middleware.d.ts.map deleted file mode 100644 index 29072e84..00000000 --- a/api/dist/middleware/rbac.middleware.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rbac.middleware.d.ts","sourceRoot":"","sources":["../../src/middleware/rbac.middleware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG1C,wBAAgB,WAAW,CAAC,GAAG,KAAK,EAAE,QAAQ,EAAE,IACtC,KAAK,OAAO,EAAE,MAAM,QAAQ,EAAE,MAAM,YAAY,UAqBzD;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,YAAY,QAY9E"} \ No newline at end of file diff --git a/api/dist/middleware/rbac.middleware.js b/api/dist/middleware/rbac.middleware.js deleted file mode 100644 index 1705433b..00000000 --- a/api/dist/middleware/rbac.middleware.js +++ /dev/null @@ -1,36 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.requireRole = requireRole; -exports.requireNonTemp = requireNonTemp; -const client_1 = require("@prisma/client"); -const error_handler_1 = require("./error-handler"); -function requireRole(...roles) { - return (req, _res, next) => { - if (!req.user) { - throw new error_handler_1.AppError(401, 'Authentication required', 'AUTH_REQUIRED'); - } - // Check multi-role array (falls back to single role via auth middleware) - const userRoles = req.user.roles || [req.user.role]; - // SUPER_ADMIN bypasses all role checks - if (userRoles.includes(client_1.UserRole.SUPER_ADMIN)) { - return next(); - } - const hasRole = userRoles.some(r => roles.includes(r)); - if (!hasRole) { - throw new error_handler_1.AppError(403, 'Insufficient permissions', 'FORBIDDEN'); - } - next(); - }; -} -function requireNonTemp(req, _res, next) { - if (!req.user) { - throw new error_handler_1.AppError(401, 'Authentication required', 'AUTH_REQUIRED'); - } - const userRoles = req.user.roles || [req.user.role]; - // User is "temp only" if their only role is TEMP - if (userRoles.length === 1 && userRoles[0] === client_1.UserRole.TEMP) { - throw new error_handler_1.AppError(403, 'Temporary accounts cannot access this resource', 'TEMP_FORBIDDEN'); - } - next(); -} -//# sourceMappingURL=rbac.middleware.js.map \ No newline at end of file diff --git a/api/dist/middleware/rbac.middleware.js.map b/api/dist/middleware/rbac.middleware.js.map deleted file mode 100644 index 0133466a..00000000 --- a/api/dist/middleware/rbac.middleware.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"rbac.middleware.js","sourceRoot":"","sources":["../../src/middleware/rbac.middleware.ts"],"names":[],"mappings":";;AAIA,kCAsBC;AAED,wCAYC;AAvCD,2CAA0C;AAC1C,mDAA2C;AAE3C,SAAgB,WAAW,CAAC,GAAG,KAAiB;IAC9C,OAAO,CAAC,GAAY,EAAE,IAAc,EAAE,IAAkB,EAAE,EAAE;QAC1D,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;YACd,MAAM,IAAI,wBAAQ,CAAC,GAAG,EAAE,yBAAyB,EAAE,eAAe,CAAC,CAAC;QACtE,CAAC;QAED,yEAAyE;QACzE,MAAM,SAAS,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEpD,uCAAuC;QACvC,IAAI,SAAS,CAAC,QAAQ,CAAC,iBAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;YAC7C,OAAO,IAAI,EAAE,CAAC;QAChB,CAAC;QAED,MAAM,OAAO,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;QAEvD,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,wBAAQ,CAAC,GAAG,EAAE,0BAA0B,EAAE,WAAW,CAAC,CAAC;QACnE,CAAC;QAED,IAAI,EAAE,CAAC;IACT,CAAC,CAAC;AACJ,CAAC;AAED,SAAgB,cAAc,CAAC,GAAY,EAAE,IAAc,EAAE,IAAkB;IAC7E,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;QACd,MAAM,IAAI,wBAAQ,CAAC,GAAG,EAAE,yBAAyB,EAAE,eAAe,CAAC,CAAC;IACtE,CAAC;IAED,MAAM,SAAS,GAAG,GAAG,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACpD,iDAAiD;IACjD,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,IAAI,SAAS,CAAC,CAAC,CAAC,KAAK,iBAAQ,CAAC,IAAI,EAAE,CAAC;QAC7D,MAAM,IAAI,wBAAQ,CAAC,GAAG,EAAE,gDAAgD,EAAE,gBAAgB,CAAC,CAAC;IAC9F,CAAC;IAED,IAAI,EAAE,CAAC;AACT,CAAC"} \ No newline at end of file diff --git a/api/dist/middleware/validate.d.ts b/api/dist/middleware/validate.d.ts deleted file mode 100644 index 58ec1a45..00000000 --- a/api/dist/middleware/validate.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { Request, Response, NextFunction } from 'express'; -import { ZodSchema } from 'zod'; -export declare function validate(schema: ZodSchema, source?: 'body' | 'query' | 'params'): (req: Request, _res: Response, next: NextFunction) => void; -//# sourceMappingURL=validate.d.ts.map \ No newline at end of file diff --git a/api/dist/middleware/validate.d.ts.map b/api/dist/middleware/validate.d.ts.map deleted file mode 100644 index 2757bc06..00000000 --- a/api/dist/middleware/validate.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/middleware/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAY,MAAM,KAAK,CAAC;AAG1C,wBAAgB,QAAQ,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,GAAE,MAAM,GAAG,OAAO,GAAG,QAAiB,IAC9E,KAAK,OAAO,EAAE,MAAM,QAAQ,EAAE,MAAM,YAAY,UAczD"} \ No newline at end of file diff --git a/api/dist/middleware/validate.js b/api/dist/middleware/validate.js deleted file mode 100644 index c59dcf90..00000000 --- a/api/dist/middleware/validate.js +++ /dev/null @@ -1,23 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.validate = validate; -const zod_1 = require("zod"); -const error_handler_1 = require("./error-handler"); -function validate(schema, source = 'body') { - return (req, _res, next) => { - try { - const data = schema.parse(req[source]); - req[source] = data; - next(); - } - catch (err) { - if (err instanceof zod_1.ZodError) { - // Sanitize validation errors - only expose field count, not detailed messages - const fieldCount = err.errors.length; - throw new error_handler_1.AppError(400, `Invalid request data: ${fieldCount} field(s) failed validation`, 'VALIDATION_ERROR'); - } - throw err; - } - }; -} -//# sourceMappingURL=validate.js.map \ No newline at end of file diff --git a/api/dist/middleware/validate.js.map b/api/dist/middleware/validate.js.map deleted file mode 100644 index 4215eb6c..00000000 --- a/api/dist/middleware/validate.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../src/middleware/validate.ts"],"names":[],"mappings":";;AAIA,4BAeC;AAlBD,6BAA0C;AAC1C,mDAA2C;AAE3C,SAAgB,QAAQ,CAAC,MAAiB,EAAE,SAAsC,MAAM;IACtF,OAAO,CAAC,GAAY,EAAE,IAAc,EAAE,IAAkB,EAAE,EAAE;QAC1D,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;YACvC,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;YACnB,IAAI,EAAE,CAAC;QACT,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,GAAG,YAAY,cAAQ,EAAE,CAAC;gBAC5B,8EAA8E;gBAC9E,MAAM,UAAU,GAAG,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC;gBACrC,MAAM,IAAI,wBAAQ,CAAC,GAAG,EAAE,yBAAyB,UAAU,6BAA6B,EAAE,kBAAkB,CAAC,CAAC;YAChH,CAAC;YACD,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/auth/auth.routes.d.ts b/api/dist/modules/auth/auth.routes.d.ts deleted file mode 100644 index 68eef5ac..00000000 --- a/api/dist/modules/auth/auth.routes.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const router: import("express-serve-static-core").Router; -export { router as authRouter }; -//# sourceMappingURL=auth.routes.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/auth/auth.routes.d.ts.map b/api/dist/modules/auth/auth.routes.d.ts.map deleted file mode 100644 index 9d7e7214..00000000 --- a/api/dist/modules/auth/auth.routes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"auth.routes.d.ts","sourceRoot":"","sources":["../../../src/modules/auth/auth.routes.ts"],"names":[],"mappings":"AAmBA,QAAA,MAAM,MAAM,4CAAW,CAAC;AAmUxB,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/auth/auth.routes.js b/api/dist/modules/auth/auth.routes.js deleted file mode 100644 index 6a69ef0d..00000000 --- a/api/dist/modules/auth/auth.routes.js +++ /dev/null @@ -1,279 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.authRouter = void 0; -const express_1 = require("express"); -const zod_1 = require("zod"); -const bcryptjs_1 = __importDefault(require("bcryptjs")); -const client_1 = require("@prisma/client"); -const auth_service_1 = require("./auth.service"); -const auth_schemas_1 = require("./auth.schemas"); -const validate_1 = require("../../middleware/validate"); -const auth_middleware_1 = require("../../middleware/auth.middleware"); -const rate_limit_1 = require("../../middleware/rate-limit"); -const database_1 = require("../../config/database"); -const verification_token_service_1 = require("../../services/verification-token.service"); -const password_reset_token_service_1 = require("../../services/password-reset-token.service"); -const email_service_1 = require("../../services/email.service"); -const settings_service_1 = require("../settings/settings.service"); -const env_1 = require("../../config/env"); -const logger_1 = require("../../utils/logger"); -const auth_rate_limits_1 = require("./auth.rate-limits"); -const profile_service_1 = require("../people/profile.service"); -const router = (0, express_1.Router)(); -exports.authRouter = router; -// POST /api/auth/login -router.post('/login', rate_limit_1.authRateLimit, (0, validate_1.validate)(auth_schemas_1.loginSchema), async (req, res, next) => { - try { - const result = await auth_service_1.authService.login(req.body.email, req.body.password); - res.json(result); - } - catch (err) { - next(err); - } -}); -// POST /api/auth/register -router.post('/register', rate_limit_1.authRateLimit, (0, validate_1.validate)(auth_schemas_1.registerSchema), async (req, res, next) => { - try { - const result = await auth_service_1.authService.register(req.body); - res.status(201).json(result); - } - catch (err) { - next(err); - } -}); -// POST /api/auth/verify-email -const verifyEmailSchema = zod_1.z.object({ token: zod_1.z.string().min(1) }); -router.post('/verify-email', rate_limit_1.authRateLimit, (0, validate_1.validate)(verifyEmailSchema), async (req, res, next) => { - try { - const { token } = req.body; - const result = await verification_token_service_1.verificationTokenService.verifyToken(token); - if (!result.valid || !result.userId) { - res.status(400).json({ - error: { message: result.error || 'Invalid token', code: 'INVALID_TOKEN' }, - }); - return; - } - const settings = await settings_service_1.siteSettingsService.get(); - const autoApprove = settings.autoApproveVerifiedUsers; - const newStatus = autoApprove ? client_1.UserStatus.ACTIVE : client_1.UserStatus.PENDING_APPROVAL; - await database_1.prisma.user.update({ - where: { id: result.userId }, - data: { emailVerified: true, status: newStatus }, - }); - // If not auto-approved, notify admins - if (!autoApprove) { - const user = await database_1.prisma.user.findUnique({ where: { id: result.userId } }); - if (user) { - const admins = await database_1.prisma.user.findMany({ - where: { role: client_1.UserRole.SUPER_ADMIN, status: client_1.UserStatus.ACTIVE }, - select: { email: true }, - }); - if (admins.length > 0) { - await email_service_1.emailService.sendPendingApprovalNotification({ - adminEmails: admins.map(a => a.email), - newUserEmail: user.email, - newUserName: user.name || '', - }).catch(err => logger_1.logger.error('Failed to send approval notification:', err)); - } - } - } - res.json({ - verified: true, - approved: autoApprove, - message: autoApprove - ? 'Email verified. You can now log in.' - : 'Email verified. Your account is pending admin approval.', - }); - } - catch (err) { - next(err); - } -}); -// POST /api/auth/resend-verification -const resendVerificationSchema = zod_1.z.object({ email: zod_1.z.string().email() }); -router.post('/resend-verification', (0, auth_rate_limits_1.createVerificationRateLimit)(), (0, validate_1.validate)(resendVerificationSchema), async (req, res, next) => { - try { - // Always return success to prevent user enumeration - res.json({ message: 'If your email is registered and pending verification, a new verification link has been sent.' }); - // Send asynchronously (don't block response) - const user = await database_1.prisma.user.findUnique({ where: { email: req.body.email } }); - if (user && user.status === client_1.UserStatus.PENDING_VERIFICATION) { - const token = await verification_token_service_1.verificationTokenService.createToken(user.id); - const adminUrl = env_1.env.ADMIN_URL || 'http://localhost:3000'; - const verificationUrl = `${adminUrl}/verify-email?token=${token}`; - await email_service_1.emailService.sendVerificationEmail({ - recipientEmail: user.email, - recipientName: user.name || 'there', - verificationUrl, - }).catch(err => logger_1.logger.error('Failed to resend verification email:', err)); - } - } - catch (err) { - next(err); - } -}); -// POST /api/auth/forgot-password -const forgotPasswordSchema = zod_1.z.object({ email: zod_1.z.string().email() }); -router.post('/forgot-password', (0, auth_rate_limits_1.createResetRateLimit)(), (0, validate_1.validate)(forgotPasswordSchema), async (req, res, next) => { - try { - // Always return success to prevent user enumeration - res.json({ message: 'If your email is registered, a password reset link has been sent.' }); - // Send asynchronously - const user = await database_1.prisma.user.findUnique({ where: { email: req.body.email } }); - if (user && user.status === client_1.UserStatus.ACTIVE) { - const token = await password_reset_token_service_1.passwordResetTokenService.createToken(user.id); - const adminUrl = env_1.env.ADMIN_URL || 'http://localhost:3000'; - const resetUrl = `${adminUrl}/reset-password?token=${token}`; - await email_service_1.emailService.sendPasswordResetEmail({ - recipientEmail: user.email, - recipientName: user.name || 'there', - resetUrl, - }).catch(err => logger_1.logger.error('Failed to send password reset email:', err)); - } - } - catch (err) { - next(err); - } -}); -// POST /api/auth/reset-password -const resetPasswordSchema = zod_1.z.object({ - token: zod_1.z.string().min(1), - password: zod_1.z.string() - .min(12, 'Password must be at least 12 characters') - .regex(/[A-Z]/, 'Password must contain at least one uppercase letter') - .regex(/[a-z]/, 'Password must contain at least one lowercase letter') - .regex(/[0-9]/, 'Password must contain at least one digit'), -}); -router.post('/reset-password', rate_limit_1.authRateLimit, (0, validate_1.validate)(resetPasswordSchema), async (req, res, next) => { - try { - const { token, password } = req.body; - const result = await password_reset_token_service_1.passwordResetTokenService.validateToken(token); - if (!result.valid || !result.userId) { - res.status(400).json({ - error: { message: result.error || 'Invalid token', code: 'INVALID_TOKEN' }, - }); - return; - } - const hashedPassword = await bcryptjs_1.default.hash(password, 12); - // Update password, mark token used, invalidate all refresh tokens — all in one transaction - await database_1.prisma.$transaction(async (tx) => { - await tx.user.update({ - where: { id: result.userId }, - data: { password: hashedPassword }, - }); - await tx.refreshToken.deleteMany({ where: { userId: result.userId } }); - await tx.passwordResetToken.update({ - where: { token }, - data: { usedAt: new Date() }, - }); - }); - res.json({ message: 'Password has been reset. You can now log in with your new password.' }); - } - catch (err) { - next(err); - } -}); -// POST /api/auth/refresh -router.post('/refresh', rate_limit_1.authRateLimit, (0, validate_1.validate)(auth_schemas_1.refreshSchema), async (req, res, next) => { - try { - const result = await auth_service_1.authService.refreshTokens(req.body.refreshToken); - res.json(result); - } - catch (err) { - next(err); - } -}); -// POST /api/auth/logout -router.post('/logout', rate_limit_1.authRateLimit, (0, validate_1.validate)(auth_schemas_1.refreshSchema), async (req, res, next) => { - try { - await auth_service_1.authService.logout(req.body.refreshToken); - res.json({ message: 'Logged out' }); - } - catch (err) { - next(err); - } -}); -// GET /api/auth/me/profile-token -router.get('/me/profile-token', auth_middleware_1.authenticate, async (req, res, next) => { - try { - const userId = req.user.id; - // Look up existing Contact linked to this user - let contact = await database_1.prisma.contact.findUnique({ where: { userId } }); - // Auto-create Contact if none exists - if (!contact) { - const user = await database_1.prisma.user.findUnique({ - where: { id: userId }, - select: { name: true, email: true }, - }); - if (!user) { - res.status(401).json({ error: { message: 'Invalid token', code: 'INVALID_TOKEN' } }); - return; - } - try { - contact = await database_1.prisma.contact.create({ - data: { - displayName: user.name || user.email, - firstName: user.name?.split(' ')[0] || null, - lastName: user.name?.split(' ').slice(1).join(' ') || null, - email: user.email, - userId, - primarySource: 'USER', - }, - }); - } - catch (err) { - // Race condition: another request created the Contact — retry lookup - if (err.code === 'P2002') { - contact = await database_1.prisma.contact.findUnique({ where: { userId } }); - } - if (!contact) - throw err; - } - } - // Generate profile token if Contact doesn't have one - if (!contact.profileToken) { - const result = await profile_service_1.profileService.generateProfileToken(contact.id); - res.json({ token: result.token }); - return; - } - res.json({ token: contact.profileToken }); - } - catch (err) { - next(err); - } -}); -// GET /api/auth/me -router.get('/me', auth_middleware_1.authenticate, async (req, res, next) => { - try { - const user = await database_1.prisma.user.findUnique({ - where: { id: req.user.id }, - select: { - id: true, - email: true, - name: true, - phone: true, - role: true, - roles: true, - status: true, - permissions: true, - createdVia: true, - emailVerified: true, - lastLoginAt: true, - createdAt: true, - updatedAt: true, - }, - }); - if (!user) { - res.status(401).json({ error: { message: 'Invalid token', code: 'INVALID_TOKEN' } }); - return; - } - res.json(user); - } - catch (err) { - next(err); - } -}); -//# sourceMappingURL=auth.routes.js.map \ No newline at end of file diff --git a/api/dist/modules/auth/auth.routes.js.map b/api/dist/modules/auth/auth.routes.js.map deleted file mode 100644 index 114a67f2..00000000 --- a/api/dist/modules/auth/auth.routes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"au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GAAa,EAAE,IAAkB,EAAE,EAAE;IACxD,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,iBAAM,CAAC,IAAI,CAAC,UAAU,CAAC;YACxC,KAAK,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,IAAK,CAAC,EAAE,EAAE;YAC3B,MAAM,EAAE;gBACN,EAAE,EAAE,IAAI;gBACR,KAAK,EAAE,IAAI;gBACX,IAAI,EAAE,IAAI;gBACV,KAAK,EAAE,IAAI;gBACX,IAAI,EAAE,IAAI;gBACV,KAAK,EAAE,IAAI;gBACX,MAAM,EAAE,IAAI;gBACZ,WAAW,EAAE,IAAI;gBACjB,UAAU,EAAE,IAAI;gBAChB,aAAa,EAAE,IAAI;gBACnB,WAAW,EAAE,IAAI;gBACjB,SAAS,EAAE,IAAI;gBACf,SAAS,EAAE,IAAI;aAChB;SACF,CAAC,CAAC;QAEH,IAAI,CAAC,IAAI,EAAE,CAAC;YACV,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,eAAe,EAAE,EAAE,CAAC,CAAC;YACrF,OAAO;QACT,CAAC;QAED,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,GAAG,CAAC,CAAC;IACZ,CAAC;AACH,CAAC,CACF,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/auth/auth.schemas.d.ts b/api/dist/modules/auth/auth.schemas.d.ts deleted file mode 100644 index e628b0ef..00000000 --- a/api/dist/modules/auth/auth.schemas.d.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { z } from 'zod'; -export declare const loginSchema: z.ZodObject<{ - email: z.ZodString; - password: z.ZodString; -}, "strip", z.ZodTypeAny, { - email: string; - password: string; -}, { - email: string; - password: string; -}>; -export declare const registerSchema: z.ZodObject<{ - email: z.ZodString; - password: z.ZodString; - name: z.ZodOptional; - phone: z.ZodOptional; - inviteCode: z.ZodOptional; -}, "strip", z.ZodTypeAny, { - email: string; - password: string; - name?: string | undefined; - phone?: string | undefined; - inviteCode?: string | undefined; -}, { - email: string; - password: string; - name?: string | undefined; - phone?: string | undefined; - inviteCode?: string | undefined; -}>; -export declare const refreshSchema: z.ZodObject<{ - refreshToken: z.ZodString; -}, "strip", z.ZodTypeAny, { - refreshToken: string; -}, { - refreshToken: string; -}>; -export type LoginInput = z.infer; -export type RegisterInput = z.infer; -export type RefreshInput = z.infer; -//# sourceMappingURL=auth.schemas.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/auth/auth.schemas.d.ts.map b/api/dist/modules/auth/auth.schemas.d.ts.map deleted file mode 100644 index 926cb062..00000000 --- a/api/dist/modules/auth/auth.schemas.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"auth.schemas.d.ts","sourceRoot":"","sources":["../../../src/modules/auth/auth.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,WAAW;;;;;;;;;EAGtB,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;EAWzB,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;EAExB,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,WAAW,CAAC,CAAC;AACrD,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAC3D,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/auth/auth.schemas.js b/api/dist/modules/auth/auth.schemas.js deleted file mode 100644 index 71ccc323..00000000 --- a/api/dist/modules/auth/auth.schemas.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.refreshSchema = exports.registerSchema = exports.loginSchema = void 0; -const zod_1 = require("zod"); -exports.loginSchema = zod_1.z.object({ - email: zod_1.z.string().email(), - password: zod_1.z.string().min(1, 'Password is required'), -}); -exports.registerSchema = zod_1.z.object({ - email: zod_1.z.string().email(), - password: zod_1.z.string() - .min(12, 'Password must be at least 12 characters') - .regex(/[A-Z]/, 'Password must contain at least one uppercase letter') - .regex(/[a-z]/, 'Password must contain at least one lowercase letter') - .regex(/[0-9]/, 'Password must contain at least one digit'), - name: zod_1.z.string().optional(), - phone: zod_1.z.string().optional(), - inviteCode: zod_1.z.string().max(20).optional(), - // Role removed from public registration - must be set server-side only -}); -exports.refreshSchema = zod_1.z.object({ - refreshToken: zod_1.z.string().min(1, 'Refresh token is required'), -}); -//# sourceMappingURL=auth.schemas.js.map \ No newline at end of file diff --git a/api/dist/modules/auth/auth.schemas.js.map b/api/dist/modules/auth/auth.schemas.js.map deleted file mode 100644 index 34697a55..00000000 --- a/api/dist/modules/auth/auth.schemas.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"auth.schemas.js","sourceRoot":"","sources":["../../../src/modules/auth/auth.schemas.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAGX,QAAA,WAAW,GAAG,OAAC,CAAC,MAAM,CAAC;IAClC,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE;IACzB,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,sBAAsB,CAAC;CACpD,CAAC,CAAC;AAEU,QAAA,cAAc,GAAG,OAAC,CAAC,MAAM,CAAC;IACrC,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE;IACzB,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE;SACjB,GAAG,CAAC,EAAE,EAAE,yCAAyC,CAAC;SAClD,KAAK,CAAC,OAAO,EAAE,qDAAqD,CAAC;SACrE,KAAK,CAAC,OAAO,EAAE,qDAAqD,CAAC;SACrE,KAAK,CAAC,OAAO,EAAE,0CAA0C,CAAC;IAC7D,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;IACzC,uEAAuE;CACxE,CAAC,CAAC;AAEU,QAAA,aAAa,GAAG,OAAC,CAAC,MAAM,CAAC;IACpC,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,2BAA2B,CAAC;CAC7D,CAAC,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/auth/auth.service.d.ts b/api/dist/modules/auth/auth.service.d.ts deleted file mode 100644 index 84ff4410..00000000 --- a/api/dist/modules/auth/auth.service.d.ts +++ /dev/null @@ -1,109 +0,0 @@ -import { UserRole } from '@prisma/client'; -import type { RegisterInput } from './auth.schemas'; -export interface TokenPair { - accessToken: string; - refreshToken: string; -} -type UserForToken = { - id: string; - email: string; - role: UserRole; - roles?: unknown; -}; -export declare const authService: { - login(email: string, password: string): Promise<{ - accessToken: string; - refreshToken: string; - user: { - status: import(".prisma/client").$Enums.UserStatus; - id: string; - email: string; - name: string | null; - phone: string | null; - pronouns: string | null; - role: import(".prisma/client").$Enums.UserRole; - roles: import("@prisma/client/runtime/library").JsonValue; - permissions: import("@prisma/client/runtime/library").JsonValue | null; - createdVia: import(".prisma/client").$Enums.UserCreatedVia; - expiresAt: Date | null; - expireDays: number | null; - lastLoginAt: Date | null; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - }; - }>; - register(data: RegisterInput): Promise<{ - user: { - status: import(".prisma/client").$Enums.UserStatus; - id: string; - email: string; - name: string | null; - phone: string | null; - pronouns: string | null; - role: import(".prisma/client").$Enums.UserRole; - roles: import("@prisma/client/runtime/library").JsonValue; - permissions: import("@prisma/client/runtime/library").JsonValue | null; - createdVia: import(".prisma/client").$Enums.UserCreatedVia; - expiresAt: Date | null; - expireDays: number | null; - lastLoginAt: Date | null; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - }; - requiresVerification: boolean; - message: string; - } | { - accessToken: string; - refreshToken: string; - user: { - status: import(".prisma/client").$Enums.UserStatus; - id: string; - email: string; - name: string | null; - phone: string | null; - pronouns: string | null; - role: import(".prisma/client").$Enums.UserRole; - roles: import("@prisma/client/runtime/library").JsonValue; - permissions: import("@prisma/client/runtime/library").JsonValue | null; - createdVia: import(".prisma/client").$Enums.UserCreatedVia; - expiresAt: Date | null; - expireDays: number | null; - lastLoginAt: Date | null; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - }; - requiresVerification?: undefined; - message?: undefined; - }>; - refreshTokens(refreshToken: string): Promise<{ - accessToken: string; - refreshToken: string; - user: { - status: import(".prisma/client").$Enums.UserStatus; - id: string; - email: string; - name: string | null; - phone: string | null; - pronouns: string | null; - role: import(".prisma/client").$Enums.UserRole; - roles: import("@prisma/client/runtime/library").JsonValue; - permissions: import("@prisma/client/runtime/library").JsonValue | null; - createdVia: import(".prisma/client").$Enums.UserCreatedVia; - expiresAt: Date | null; - expireDays: number | null; - lastLoginAt: Date | null; - emailVerified: boolean; - createdAt: Date; - updatedAt: Date; - }; - }>; - logout(refreshToken: string): Promise; - generateAccessToken(user: UserForToken): string; - generateRefreshToken(user: UserForToken): Promise; - generateTokenPair(user: UserForToken): Promise; -}; -export {}; -//# sourceMappingURL=auth.service.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/auth/auth.service.d.ts.map b/api/dist/modules/auth/auth.service.d.ts.map deleted file mode 100644 index cc3d246e..00000000 --- a/api/dist/modules/auth/auth.service.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"auth.service.d.ts","sourceRoot":"","sources":["../../../src/modules/auth/auth.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAc,MAAM,gBAAgB,CAAC;AAUtD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AASpD,MAAM,WAAW,SAAS;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,KAAK,YAAY,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAUnF,eAAO,MAAM,WAAW;iBACH,MAAM,YAAY,MAAM;qBAf9B,MAAM;sBACL,MAAM;;;;;;;;;;;;;;;;;;;;mBA+EC,aAAa;;;;;;;;;;;;;;;;;;;;;;qBAhFrB,MAAM;sBACL,MAAM;;;;;;;;;;;;;;;;;;;;;;gCAiLc,MAAM;;;;;;;;;;;;;;;;;;;;;;yBAsEb,MAAM;8BAIP,YAAY,GAAG,MAAM;+BAcd,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC;4BA2BjC,YAAY,GAAG,OAAO,CAAC,SAAS,CAAC;CAKhE,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/auth/auth.service.js b/api/dist/modules/auth/auth.service.js deleted file mode 100644 index ccfc108b..00000000 --- a/api/dist/modules/auth/auth.service.js +++ /dev/null @@ -1,305 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.authService = void 0; -const bcryptjs_1 = __importDefault(require("bcryptjs")); -const jsonwebtoken_1 = __importDefault(require("jsonwebtoken")); -const client_1 = require("@prisma/client"); -const database_1 = require("../../config/database"); -const env_1 = require("../../config/env"); -const error_handler_1 = require("../../middleware/error-handler"); -const metrics_1 = require("../../utils/metrics"); -const settings_service_1 = require("../settings/settings.service"); -const verification_token_service_1 = require("../../services/verification-token.service"); -const email_service_1 = require("../../services/email.service"); -const roles_1 = require("../../utils/roles"); -const logger_1 = require("../../utils/logger"); -/** Parse the roles JSON field into a UserRole[] array */ -function parseRoles(user) { - if (Array.isArray(user.roles) && user.roles.length > 0) { - return user.roles; - } - return [user.role]; -} -exports.authService = { - async login(email, password) { - const user = await database_1.prisma.user.findUnique({ where: { email } }); - if (!user) { - (0, metrics_1.recordLoginAttempt)('failure'); - throw new error_handler_1.AppError(401, 'Invalid email or password', 'INVALID_CREDENTIALS'); - } - const valid = await bcryptjs_1.default.compare(password, user.password); - if (!valid) { - (0, metrics_1.recordLoginAttempt)('failure'); - throw new error_handler_1.AppError(401, 'Invalid email or password', 'INVALID_CREDENTIALS'); - } - // Status-specific errors - if (user.status === client_1.UserStatus.PENDING_VERIFICATION) { - (0, metrics_1.recordLoginAttempt)('failure'); - throw new error_handler_1.AppError(403, 'Please verify your email address before logging in', 'EMAIL_NOT_VERIFIED'); - } - if (user.status === client_1.UserStatus.PENDING_APPROVAL) { - (0, metrics_1.recordLoginAttempt)('failure'); - throw new error_handler_1.AppError(403, 'Your account is pending admin approval', 'ACCOUNT_PENDING'); - } - if (user.status !== client_1.UserStatus.ACTIVE) { - (0, metrics_1.recordLoginAttempt)('failure'); - throw new error_handler_1.AppError(403, `Account is ${user.status.toLowerCase()}`, 'ACCOUNT_INACTIVE'); - } - if (user.expiresAt && user.expiresAt < new Date()) { - (0, metrics_1.recordLoginAttempt)('failure'); - throw new error_handler_1.AppError(403, 'Account has expired', 'ACCOUNT_EXPIRED'); - } - (0, metrics_1.recordLoginAttempt)('success'); - await database_1.prisma.user.update({ - where: { id: user.id }, - data: { lastLoginAt: new Date() }, - }); - // Fire-and-forget: log USER_LOGIN activity on linked Contact - database_1.prisma.contact.findFirst({ - where: { userId: user.id, mergedIntoId: null }, - }).then(async (contact) => { - if (contact) { - await database_1.prisma.contactActivity.create({ - data: { - contactId: contact.id, - type: 'USER_LOGIN', - title: 'User logged in', - description: `Login from ${user.email}`, - }, - }); - } - }).catch(err => { - logger_1.logger.warn('Login activity logging failed:', err); - }); - const tokens = await this.generateTokenPair(user); - const { password: _, ...userWithoutPassword } = user; - return { user: userWithoutPassword, ...tokens }; - }, - async register(data) { - // Check if public registration is enabled - const settings = await settings_service_1.siteSettingsService.get(); - if (!settings.enablePublicRegistration) { - throw new error_handler_1.AppError(403, 'Public registration is currently disabled', 'REGISTRATION_DISABLED'); - } - const existing = await database_1.prisma.user.findUnique({ where: { email: data.email } }); - if (existing) { - throw new error_handler_1.AppError(409, 'Email already registered', 'EMAIL_EXISTS'); - } - const hashedPassword = await bcryptjs_1.default.hash(data.password, 12); - // Determine if email verification is needed - const smtpReady = await email_service_1.emailService.isSmtpConfigured(); - const requireVerification = settings.enableEmailVerification && smtpReady; - const user = await database_1.prisma.user.create({ - data: { - email: data.email, - password: hashedPassword, - name: data.name, - phone: data.phone, - role: client_1.UserRole.USER, - roles: JSON.parse(JSON.stringify([client_1.UserRole.USER])), - status: requireVerification ? client_1.UserStatus.PENDING_VERIFICATION : client_1.UserStatus.ACTIVE, - emailVerified: !requireVerification, - createdVia: 'SELF_REGISTRATION', - }, - }); - // Fire-and-forget: process referral if invite code provided - if (data.inviteCode) { - Promise.resolve().then(() => __importStar(require('../social/referral.service'))).then(({ referralService }) => { - referralService.processRegistrationReferral(user.id, data.inviteCode).catch(err => { - logger_1.logger.warn('Referral processing failed:', err); - }); - }).catch(() => { }); - } - // Fire-and-forget: auto-link or create Contact if People feature is enabled - settings_service_1.siteSettingsService.get().then(async (s) => { - if (!s.enablePeople) - return; - // Check for existing Contact with matching email → link - const existingContact = await database_1.prisma.contact.findFirst({ - where: { email: { equals: data.email, mode: 'insensitive' }, userId: null, mergedIntoId: null }, - }); - if (existingContact) { - await database_1.prisma.contact.update({ where: { id: existingContact.id }, data: { userId: user.id } }); - logger_1.logger.info(`Auto-linked contact ${existingContact.id} to registered user ${user.id}`); - } - else { - // Create new Contact linked to the user - await database_1.prisma.contact.create({ - data: { - displayName: data.name || data.email, - firstName: data.name?.split(' ')[0] || null, - lastName: data.name?.split(' ').slice(1).join(' ') || null, - email: data.email, - phone: data.phone || null, - primarySource: 'USER', - userId: user.id, - tags: [], - }, - }); - logger_1.logger.info(`Auto-created contact for registered user ${user.id}`); - } - }).catch(err => { - logger_1.logger.warn('Contact auto-creation on register failed:', err); - }); - // If verification required, send email and don't issue tokens - if (requireVerification) { - const token = await verification_token_service_1.verificationTokenService.createToken(user.id); - const adminUrl = env_1.env.ADMIN_URL || 'http://localhost:3000'; - const verificationUrl = `${adminUrl}/verify-email?token=${token}`; - await email_service_1.emailService.sendVerificationEmail({ - recipientEmail: user.email, - recipientName: user.name || 'there', - verificationUrl, - }); - const { password: _, ...userWithoutPassword } = user; - return { - user: userWithoutPassword, - requiresVerification: true, - message: 'Please check your email to verify your account', - }; - } - // No verification needed — issue tokens immediately - const tokens = await this.generateTokenPair(user); - const { password: _, ...userWithoutPassword } = user; - return { user: userWithoutPassword, ...tokens }; - }, - async refreshTokens(refreshToken) { - let payload; - try { - payload = jsonwebtoken_1.default.verify(refreshToken, env_1.env.JWT_REFRESH_SECRET, { algorithms: ['HS256'] }); - } - catch { - throw new error_handler_1.AppError(401, 'Invalid refresh token', 'INVALID_REFRESH_TOKEN'); - } - const stored = await database_1.prisma.refreshToken.findUnique({ - where: { token: refreshToken }, - include: { user: true }, - }); - if (!stored) { - throw new error_handler_1.AppError(401, 'Refresh token not found', 'INVALID_REFRESH_TOKEN'); - } - // Check user status — banned/inactive users must not get new tokens - if (stored.user.status !== client_1.UserStatus.ACTIVE) { - await database_1.prisma.refreshToken.delete({ where: { id: stored.id } }); - throw new error_handler_1.AppError(401, 'Account is not active', 'ACCOUNT_INACTIVE'); - } - // Check account expiry - if (stored.user.expiresAt && stored.user.expiresAt < new Date()) { - await database_1.prisma.refreshToken.delete({ where: { id: stored.id } }); - throw new error_handler_1.AppError(401, 'Account has expired', 'ACCOUNT_EXPIRED'); - } - if (stored.expiresAt < new Date()) { - await database_1.prisma.refreshToken.delete({ where: { id: stored.id } }); - throw new error_handler_1.AppError(401, 'Refresh token expired', 'REFRESH_TOKEN_EXPIRED'); - } - // Rotate: delete old and create new atomically - const tokens = await database_1.prisma.$transaction(async (tx) => { - await tx.refreshToken.delete({ where: { id: stored.id } }); - const userRoles = parseRoles(stored.user); - const accessToken = this.generateAccessToken(stored.user); - const refreshPayload = { - id: stored.user.id, - email: stored.user.email, - role: (0, roles_1.getPrimaryRole)(userRoles), - roles: userRoles, - }; - const refreshToken = jsonwebtoken_1.default.sign(refreshPayload, env_1.env.JWT_REFRESH_SECRET, { - algorithm: 'HS256', - expiresIn: env_1.env.JWT_REFRESH_EXPIRY, - }); - const decoded = jsonwebtoken_1.default.decode(refreshToken); - const expiresAt = new Date(decoded.exp * 1000); - await tx.refreshToken.create({ - data: { - token: refreshToken, - userId: stored.user.id, - expiresAt, - }, - }); - return { accessToken, refreshToken }; - }); - const { password: _, ...userWithoutPassword } = stored.user; - return { user: userWithoutPassword, ...tokens }; - }, - async logout(refreshToken) { - await database_1.prisma.refreshToken.deleteMany({ where: { token: refreshToken } }); - }, - generateAccessToken(user) { - const userRoles = parseRoles(user); - const payload = { - id: user.id, - email: user.email, - role: (0, roles_1.getPrimaryRole)(userRoles), - roles: userRoles, - }; - return jsonwebtoken_1.default.sign(payload, env_1.env.JWT_ACCESS_SECRET, { - algorithm: 'HS256', - expiresIn: env_1.env.JWT_ACCESS_EXPIRY, - }); - }, - async generateRefreshToken(user) { - const userRoles = parseRoles(user); - const payload = { - id: user.id, - email: user.email, - role: (0, roles_1.getPrimaryRole)(userRoles), - roles: userRoles, - }; - const token = jsonwebtoken_1.default.sign(payload, env_1.env.JWT_REFRESH_SECRET, { - algorithm: 'HS256', - expiresIn: env_1.env.JWT_REFRESH_EXPIRY, - }); - const decoded = jsonwebtoken_1.default.decode(token); - const expiresAt = new Date(decoded.exp * 1000); - await database_1.prisma.refreshToken.create({ - data: { - token, - userId: user.id, - expiresAt, - }, - }); - return token; - }, - async generateTokenPair(user) { - const accessToken = this.generateAccessToken(user); - const refreshToken = await this.generateRefreshToken(user); - return { accessToken, refreshToken }; - }, -}; -//# sourceMappingURL=auth.service.js.map \ No newline at end of file diff --git a/api/dist/modules/auth/auth.service.js.map b/api/dist/modules/auth/auth.service.js.map deleted file mode 100644 index eb81f5c4..00000000 --- a/api/dist/modules/auth/auth.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"auth.service.js","sourceRoot":"","sources":["../../../src/modules/auth/auth.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,wDAA8B;AAC9B,gEAAgD;AAChD,2CAAsD;AACtD,oDAA+C;AAC/C,0CAAuC;AACvC,kEAA0D;AAC1D,iDAAyD;AACzD,mEAAmE;AACnE,0FAAqF;AACrF,gEAA4D;AA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9D,CAAC,CAAC;QAEH,MAAM,OAAO,GAAG,sBAAG,CAAC,MAAM,CAAC,KAAK,CAAoB,CAAC;QACrD,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,GAAG,GAAG,IAAI,CAAC,CAAC;QAE/C,MAAM,iBAAM,CAAC,YAAY,CAAC,MAAM,CAAC;YAC/B,IAAI,EAAE;gBACJ,KAAK;gBACL,MAAM,EAAE,IAAI,CAAC,EAAE;gBACf,SAAS;aACV;SACF,CAAC,CAAC;QAEH,OAAO,KAAK,CAAC;IACf,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,IAAkB;QACxC,MAAM,WAAW,GAAG,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;QACnD,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;QAC3D,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC;IACvC,CAAC;CACF,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/docs/docs-files.service.d.ts b/api/dist/modules/docs/docs-files.service.d.ts deleted file mode 100644 index a214ea10..00000000 --- a/api/dist/modules/docs/docs-files.service.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -export interface FileNode { - name: string; - path: string; - isDirectory: boolean; - children?: FileNode[]; -} -/** - * Resolve and validate a relative path within MKDOCS_DOCS_PATH. - * Throws if the resolved path escapes the docs root. - */ -declare function safeResolve(relativePath: string): string; -export declare class PathTraversalError extends Error { - constructor(); -} -export declare class FileNotFoundError extends Error { - constructor(filePath: string); -} -/** - * Recursively list the file tree under MKDOCS_DOCS_PATH. - * Cached in Redis with 1-hour TTL for root calls. - */ -declare function listTree(dir?: string, relBase?: string): Promise; -declare function readFileContent(relativePath: string): Promise; -declare function writeFileContent(relativePath: string, content: string): Promise; -declare function createFile(relativePath: string, content?: string, isDirectory?: boolean): Promise; -declare function deleteFile(relativePath: string): Promise; -declare function renameFile(fromPath: string, toPath: string): Promise; -declare function isEditableFile(relativePath: string): boolean; -declare function uploadFile(relativePath: string, sourcePath: string): Promise; -declare function invalidateTreeCache(): Promise; -/** - * Flatten a FileNode tree into file-only entries, then filter by - * case-insensitive query match on name or path. Name matches score - * higher so they sort first. - */ -declare function searchFiles(query: string, limit?: number): Promise<{ - name: string; - path: string; -}[]>; -export declare const docsFilesService: { - listTree: typeof listTree; - readFileContent: typeof readFileContent; - writeFileContent: typeof writeFileContent; - createFile: typeof createFile; - deleteFile: typeof deleteFile; - renameFile: typeof renameFile; - uploadFile: typeof uploadFile; - safeResolve: typeof safeResolve; - isEditableFile: typeof isEditableFile; - invalidateTreeCache: typeof invalidateTreeCache; - searchFiles: typeof searchFiles; -}; -export {}; -//# sourceMappingURL=docs-files.service.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/docs/docs-files.service.d.ts.map b/api/dist/modules/docs/docs-files.service.d.ts.map deleted file mode 100644 index 5a70d817..00000000 --- a/api/dist/modules/docs/docs-files.service.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"docs-files.service.d.ts","sourceRoot":"","sources":["../../../src/modules/docs/docs-files.service.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC;CACvB;AAcD;;;GAGG;AACH,iBAAS,WAAW,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAQjD;AAED,qBAAa,kBAAmB,SAAQ,KAAK;;CAK5C;AAED,qBAAa,iBAAkB,SAAQ,KAAK;gBAC9B,QAAQ,EAAE,MAAM;CAI7B;AAED;;;GAGG;AACH,iBAAe,QAAQ,CAAC,GAAG,GAAE,MAAkB,EAAE,OAAO,GAAE,MAAW,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC,CAiD1F;AAED,iBAAe,eAAe,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAmCpE;AAED,iBAAe,gBAAgB,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAYpF;AAED,iBAAe,UAAU,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CA0BtG;AAED,iBAAe,UAAU,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA8B7D;AAED,iBAAe,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAyBzE;AAED,iBAAS,cAAc,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAGrD;AAOD,iBAAe,UAAU,CAAC,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAgBjF;AAED,iBAAe,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC,CAMlD;AAED;;;;GAIG;AACH,iBAAe,WAAW,CACxB,KAAK,EAAE,MAAM,EACb,KAAK,SAAI,GACR,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAAE,CAAC,CAyB3C;AAED,eAAO,MAAM,gBAAgB;;;;;;;;;;;;CAY5B,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/docs/docs-files.service.js b/api/dist/modules/docs/docs-files.service.js deleted file mode 100644 index 36899623..00000000 --- a/api/dist/modules/docs/docs-files.service.js +++ /dev/null @@ -1,312 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.docsFilesService = exports.FileNotFoundError = exports.PathTraversalError = void 0; -const promises_1 = require("fs/promises"); -const path_1 = require("path"); -const crypto_1 = __importDefault(require("crypto")); -const env_1 = require("../../config/env"); -const redis_1 = require("../../config/redis"); -const logger_1 = require("../../utils/logger"); -const metrics_1 = require("../../utils/metrics"); -const DOCS_ROOT = (0, path_1.resolve)(env_1.env.MKDOCS_DOCS_PATH); -// Redis cache configuration -const CACHE_KEY_PREFIX = 'DOCS_CACHE:'; -const TREE_CACHE_KEY = `${CACHE_KEY_PREFIX}tree`; -const TREE_CACHE_TTL = 30; // 30 seconds — short so external changes show quickly -const FILE_CONTENT_CACHE_TTL = 60 * 60; // 1 hour for file content -function hashFilePath(path) { - return crypto_1.default.createHash('sha256').update(path).digest('hex').substring(0, 16); -} -/** - * Resolve and validate a relative path within MKDOCS_DOCS_PATH. - * Throws if the resolved path escapes the docs root. - */ -function safeResolve(relativePath) { - const normalized = (0, path_1.normalize)(relativePath).replace(/^(\.\.(\/|\\|$))+/, ''); - const resolved = (0, path_1.resolve)(DOCS_ROOT, normalized); - // Use DOCS_ROOT + sep to prevent prefix attacks (e.g., /mkdocs/docs-evil matching /mkdocs/docs) - if (resolved !== DOCS_ROOT && !resolved.startsWith(DOCS_ROOT + '/')) { - throw new PathTraversalError(); - } - return resolved; -} -class PathTraversalError extends Error { - constructor() { - super('Path traversal not allowed'); - this.name = 'PathTraversalError'; - } -} -exports.PathTraversalError = PathTraversalError; -class FileNotFoundError extends Error { - constructor(filePath) { - super(`File not found: ${filePath}`); - this.name = 'FileNotFoundError'; - } -} -exports.FileNotFoundError = FileNotFoundError; -/** - * Recursively list the file tree under MKDOCS_DOCS_PATH. - * Cached in Redis with 1-hour TTL for root calls. - */ -async function listTree(dir = DOCS_ROOT, relBase = '') { - // Try cache for root call only - if (dir === DOCS_ROOT && !relBase) { - try { - const cached = await redis_1.redis.get(TREE_CACHE_KEY); - if (cached) { - metrics_1.cm_docs_cache_hits.inc({ type: 'tree' }); - return JSON.parse(cached); - } - metrics_1.cm_docs_cache_misses.inc({ type: 'tree' }); - } - catch (err) { - logger_1.logger.warn('Failed to get cached docs tree:', err); - metrics_1.cm_docs_cache_misses.inc({ type: 'tree' }); - } - } - const entries = await (0, promises_1.readdir)(dir, { withFileTypes: true }); - const sorted = entries - .filter(e => !e.name.startsWith('.')) - .sort((a, b) => { - if (a.isDirectory() && !b.isDirectory()) - return -1; - if (!a.isDirectory() && b.isDirectory()) - return 1; - return a.name.localeCompare(b.name); - }); - // Parallel I/O instead of sequential for better performance - const nodes = await Promise.all(sorted.map(async (entry) => { - const relPath = relBase ? `${relBase}/${entry.name}` : entry.name; - if (entry.isDirectory()) { - const children = await listTree((0, path_1.join)(dir, entry.name), relPath); - return { name: entry.name, path: relPath, isDirectory: true, children }; - } - else { - return { name: entry.name, path: relPath, isDirectory: false }; - } - })); - // Cache root result - if (dir === DOCS_ROOT && !relBase) { - try { - await redis_1.redis.setex(TREE_CACHE_KEY, TREE_CACHE_TTL, JSON.stringify(nodes)); - } - catch (err) { - logger_1.logger.warn('Failed to cache docs tree:', err); - } - } - return nodes; -} -async function readFileContent(relativePath) { - const cacheKey = `${CACHE_KEY_PREFIX}file:${hashFilePath(relativePath)}`; - // Try cache first - try { - const cached = await redis_1.redis.get(cacheKey); - if (cached) { - metrics_1.cm_docs_cache_hits.inc({ type: 'file' }); - return cached; - } - metrics_1.cm_docs_cache_misses.inc({ type: 'file' }); - } - catch (err) { - logger_1.logger.warn('Failed to get cached file content:', err); - metrics_1.cm_docs_cache_misses.inc({ type: 'file' }); - } - // Read from disk - const fullPath = safeResolve(relativePath); - try { - const content = await (0, promises_1.readFile)(fullPath, 'utf-8'); - // Cache the result - try { - await redis_1.redis.setex(cacheKey, FILE_CONTENT_CACHE_TTL, content); - } - catch (err) { - logger_1.logger.warn('Failed to cache file content:', err); - } - return content; - } - catch (err) { - if (err.code === 'ENOENT') { - throw new FileNotFoundError(relativePath); - } - throw err; - } -} -async function writeFileContent(relativePath, content) { - const fullPath = safeResolve(relativePath); - await (0, promises_1.mkdir)((0, path_1.dirname)(fullPath), { recursive: true }); - await (0, promises_1.writeFile)(fullPath, content, 'utf-8'); - // Invalidate file cache (content changed, structure unchanged) - const cacheKey = `${CACHE_KEY_PREFIX}file:${hashFilePath(relativePath)}`; - try { - await redis_1.redis.del(cacheKey); - } - catch (err) { - logger_1.logger.warn('Failed to invalidate file cache:', err); - } -} -async function createFile(relativePath, content, isDirectory) { - const fullPath = safeResolve(relativePath); - try { - await (0, promises_1.stat)(fullPath); - throw new Error(`Already exists: ${relativePath}`); - } - catch (err) { - if (err.code !== 'ENOENT') { - if (err.message?.startsWith('Already exists')) - throw err; - throw err; - } - } - if (isDirectory) { - await (0, promises_1.mkdir)(fullPath, { recursive: true }); - } - else { - await (0, promises_1.mkdir)((0, path_1.dirname)(fullPath), { recursive: true }); - await (0, promises_1.writeFile)(fullPath, content || '', 'utf-8'); - } - // Invalidate tree cache (structure changed) - try { - await redis_1.redis.del(TREE_CACHE_KEY); - } - catch (err) { - logger_1.logger.warn('Failed to invalidate tree cache:', err); - } -} -async function deleteFile(relativePath) { - const fullPath = safeResolve(relativePath); - try { - const info = await (0, promises_1.stat)(fullPath); - if (info.isDirectory()) { - const entries = await (0, promises_1.readdir)(fullPath); - if (entries.length > 0) { - throw new Error('Directory is not empty'); - } - await (0, promises_1.rm)(fullPath, { recursive: false }); - } - else { - await (0, promises_1.rm)(fullPath); - } - } - catch (err) { - if (err.code === 'ENOENT') { - throw new FileNotFoundError(relativePath); - } - throw err; - } - // Invalidate both tree and file cache - const fileCacheKey = `${CACHE_KEY_PREFIX}file:${hashFilePath(relativePath)}`; - try { - await Promise.all([ - redis_1.redis.del(TREE_CACHE_KEY), - redis_1.redis.del(fileCacheKey), - ]); - } - catch (err) { - logger_1.logger.warn('Failed to invalidate caches on delete:', err); - } -} -async function renameFile(fromPath, toPath) { - const fullFrom = safeResolve(fromPath); - const fullTo = safeResolve(toPath); - try { - await (0, promises_1.stat)(fullFrom); - } - catch { - throw new FileNotFoundError(fromPath); - } - await (0, promises_1.mkdir)((0, path_1.dirname)(fullTo), { recursive: true }); - await (0, promises_1.rename)(fullFrom, fullTo); - // Invalidate tree and both file paths - const fromCacheKey = `${CACHE_KEY_PREFIX}file:${hashFilePath(fromPath)}`; - const toCacheKey = `${CACHE_KEY_PREFIX}file:${hashFilePath(toPath)}`; - try { - await Promise.all([ - redis_1.redis.del(TREE_CACHE_KEY), - redis_1.redis.del(fromCacheKey), - redis_1.redis.del(toCacheKey), - ]); - } - catch (err) { - logger_1.logger.warn('Failed to invalidate caches on rename:', err); - } -} -function isEditableFile(relativePath) { - const ext = (0, path_1.extname)(relativePath).toLowerCase(); - return ['.md', '.txt', '.yml', '.yaml', '.json', '.css', '.html', '.js'].includes(ext); -} -const ALLOWED_UPLOAD_EXTENSIONS = new Set([ - '.png', '.jpg', '.jpeg', '.gif', '.svg', '.webp', '.ico', - '.pdf', '.zip', -]); -async function uploadFile(relativePath, sourcePath) { - const ext = (0, path_1.extname)(relativePath).toLowerCase(); - if (!ALLOWED_UPLOAD_EXTENSIONS.has(ext)) { - throw new Error(`File type not allowed: ${ext}`); - } - const fullPath = safeResolve(relativePath); - await (0, promises_1.mkdir)((0, path_1.dirname)(fullPath), { recursive: true }); - await (0, promises_1.copyFile)(sourcePath, fullPath); - // Invalidate tree cache (structure changed) - try { - await redis_1.redis.del(TREE_CACHE_KEY); - } - catch (err) { - logger_1.logger.warn('Failed to invalidate tree cache after upload:', err); - } -} -async function invalidateTreeCache() { - try { - await redis_1.redis.del(TREE_CACHE_KEY); - } - catch (err) { - logger_1.logger.warn('Failed to invalidate tree cache:', err); - } -} -/** - * Flatten a FileNode tree into file-only entries, then filter by - * case-insensitive query match on name or path. Name matches score - * higher so they sort first. - */ -async function searchFiles(query, limit = 5) { - const tree = await listTree(); - const q = query.toLowerCase(); - const matches = []; - function walk(nodes) { - for (const node of nodes) { - if (node.isDirectory) { - if (node.children) - walk(node.children); - } - else { - const nameLower = node.name.toLowerCase(); - const pathLower = node.path.toLowerCase(); - if (nameLower.includes(q)) { - matches.push({ name: node.name, path: node.path, score: 2 }); - } - else if (pathLower.includes(q)) { - matches.push({ name: node.name, path: node.path, score: 1 }); - } - } - } - } - walk(tree); - matches.sort((a, b) => b.score - a.score); - return matches.slice(0, limit).map(({ name, path }) => ({ name, path })); -} -exports.docsFilesService = { - listTree, - readFileContent, - writeFileContent, - createFile, - deleteFile, - renameFile, - uploadFile, - safeResolve, - isEditableFile, - invalidateTreeCache, - searchFiles, -}; -//# sourceMappingURL=docs-files.service.js.map \ No newline at end of file diff --git a/api/dist/modules/docs/docs-files.service.js.map b/api/dist/modules/docs/docs-files.service.js.map deleted file mode 100644 index d9e0414a..00000000 --- a/api/dist/modules/docs/docs-files.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"docs-files.service.js","sourceRoot":"","sources":["../../../src/modules/docs/docs-files.service.ts"],"names":[],"mappings":";;;;;;AAAA,0CAA8F;AAC9F,+BAAiF;AACjF,oDAA4B;AAC5B,0CAAuC;AACvC,8CAA2C;AAC3C,+CAA4C;AAC5C,iDAA+E;AAS/E,MAAM,SAAS,GAAG,IAAA,cAAW,EAAC,SAAG,CAAC,gBAAgB,CAAC,CAAC;AAEpD,4BAA4B;AAC5B,MAAM,gBAAgB,GAAG,aAAa,CAAC;AACvC,MAAM,cAAc,GAAG,GAAG,gBAAgB,MAAM,CAAC;AACjD,MAAM,cAAc,GAAG,EAAE,CAAC,CAAC,sDAAsD;AACjF,MAAM,sBAAsB,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,0BAA0B;AAElE,SAAS,YAAY,CAAC,IAAY;IAChC,OAAO,gBAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACjF,CAAC;AAED;;;GAGG;AACH,SAAS,WAAW,CAAC,YAAoB;IACvC,MAAM,UAAU,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ff --git a/api/dist/modules/docs/docs.routes.d.ts b/api/dist/modules/docs/docs.routes.d.ts deleted file mode 100644 index 01af5c73..00000000 --- a/api/dist/modules/docs/docs.routes.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export declare const docsRouter: import("express-serve-static-core").Router; -//# sourceMappingURL=docs.routes.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/docs/docs.routes.d.ts.map b/api/dist/modules/docs/docs.routes.d.ts.map deleted file mode 100644 index 7726e9d3..00000000 --- a/api/dist/modules/docs/docs.routes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"docs.routes.d.ts","sourceRoot":"","sources":["../../../src/modules/docs/docs.routes.ts"],"names":[],"mappings":"AA4YA,eAAO,MAAM,UAAU,4CAAS,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/docs/docs.routes.js b/api/dist/modules/docs/docs.routes.js deleted file mode 100644 index 543e9922..00000000 --- a/api/dist/modules/docs/docs.routes.js +++ /dev/null @@ -1,336 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.docsRouter = void 0; -const express_1 = require("express"); -const multer_1 = __importDefault(require("multer")); -const promises_1 = require("fs/promises"); -const path_1 = require("path"); -const auth_middleware_1 = require("../../middleware/auth.middleware"); -const rbac_middleware_1 = require("../../middleware/rbac.middleware"); -const env_1 = require("../../config/env"); -const roles_1 = require("../../utils/roles"); -const logger_1 = require("../../utils/logger"); -const health_check_1 = require("../../utils/health-check"); -const metrics_1 = require("../../utils/metrics"); -const docs_files_service_1 = require("./docs-files.service"); -const docs_collab_service_1 = require("./docs-collab.service"); -const mkdocs_config_service_1 = require("./mkdocs-config.service"); -const header_builder_service_1 = require("./header-builder.service"); -const header_builder_schemas_1 = require("./header-builder.schemas"); -const router = (0, express_1.Router)(); -router.use(auth_middleware_1.authenticate); -router.use(rbac_middleware_1.requireNonTemp); -// Removed duplicated isServiceOnline - now using shared utility from utils/health-check.ts -// GET /api/docs/status — check MkDocs and Code Server availability (content editors only) -router.get('/status', (0, rbac_middleware_1.requireRole)(...roles_1.CONTENT_ROLES), async (_req, res, next) => { - try { - const [mkdocsOnline, codeServerOnline, siteServerOnline] = await Promise.all([ - (0, health_check_1.isServiceOnline)(env_1.env.MKDOCS_PREVIEW_URL), - (0, health_check_1.isServiceOnline)(env_1.env.CODE_SERVER_URL), - (0, health_check_1.isServiceOnline)(env_1.env.MKDOCS_SITE_SERVER_URL), - ]); - res.json({ - mkdocs: { online: mkdocsOnline, url: env_1.env.MKDOCS_PREVIEW_URL }, - codeServer: { online: codeServerOnline, url: env_1.env.CODE_SERVER_URL }, - siteServer: { online: siteServerOnline, url: env_1.env.MKDOCS_SITE_SERVER_URL }, - }); - } - catch (err) { - logger_1.logger.error('Failed to check docs status', err); - next(err); - } -}); -// GET /api/docs/config — return public-facing port numbers for iframe URLs (content editors only) -router.get('/config', (0, rbac_middleware_1.requireRole)(...roles_1.CONTENT_ROLES), async (_req, res, _next) => { - res.json({ - codeServerPort: env_1.env.CODE_SERVER_PORT, - mkdocsPort: env_1.env.MKDOCS_PORT, - mkdocsSitePort: env_1.env.MKDOCS_SITE_SERVER_PORT, - }); -}); -// --- MkDocs Config Endpoints --- -// GET /api/docs/mkdocs-config — read raw mkdocs.yml content (content editors only) -router.get('/mkdocs-config', (0, rbac_middleware_1.requireRole)(...roles_1.CONTENT_ROLES), async (_req, res, next) => { - try { - const content = await mkdocs_config_service_1.mkdocsConfigService.readConfig(); - res.json({ content }); - } - catch (err) { - logger_1.logger.error('Failed to read mkdocs config', err); - next(err); - } -}); -// PUT /api/docs/mkdocs-config — validate + write mkdocs.yml (SUPER_ADMIN only) -router.put('/mkdocs-config', (0, rbac_middleware_1.requireRole)(...roles_1.CONTENT_ROLES), async (req, res, next) => { - try { - const { content } = req.body; - if (typeof content !== 'string') { - res.status(400).json({ error: { message: 'Content string required', code: 'VALIDATION_ERROR' } }); - return; - } - await mkdocs_config_service_1.mkdocsConfigService.writeConfig(content); - res.json({ success: true }); - } - catch (err) { - if (err.message?.startsWith('Invalid YAML')) { - res.status(400).json({ error: { message: err.message, code: 'VALIDATION_ERROR' } }); - return; - } - logger_1.logger.error('Failed to write mkdocs config', err); - next(err); - } -}); -// POST /api/docs/build — trigger mkdocs build in container -router.post('/build', (0, rbac_middleware_1.requireRole)(...roles_1.CONTENT_ROLES), async (_req, res, next) => { - try { - const result = await mkdocs_config_service_1.mkdocsConfigService.triggerBuild(); - res.json(result); - } - catch (err) { - logger_1.logger.error('MkDocs build failed', err); - next(err); - } -}); -// --- Header Builder --- -// GET /api/docs/header-config — read header nav bar config (content editors only) -router.get('/header-config', (0, rbac_middleware_1.requireRole)(...roles_1.CONTENT_ROLES), async (_req, res, next) => { - try { - const config = await header_builder_service_1.headerBuilderService.readConfig(); - res.json(config); - } - catch (err) { - logger_1.logger.error('Failed to read header config', err); - next(err); - } -}); -// PUT /api/docs/header-config — save header nav bar config + regenerate template -router.put('/header-config', (0, rbac_middleware_1.requireRole)(...roles_1.CONTENT_ROLES), async (req, res, next) => { - try { - const parsed = header_builder_schemas_1.headerConfigSchema.safeParse(req.body); - if (!parsed.success) { - res.status(400).json({ - error: { message: 'Invalid header config', code: 'VALIDATION_ERROR', details: parsed.error.flatten().fieldErrors }, - }); - return; - } - await header_builder_service_1.headerBuilderService.writeConfig(parsed.data); - // Invalidate docs file tree cache so the new main.html shows up - await docs_files_service_1.docsFilesService.invalidateTreeCache(); - res.json({ success: true }); - } - catch (err) { - logger_1.logger.error('Failed to save header config', err); - next(err); - } -}); -// --- File Upload --- -const ALLOWED_UPLOAD_EXTENSIONS = new Set([ - '.png', '.jpg', '.jpeg', '.gif', '.svg', '.webp', '.ico', - '.pdf', '.zip', -]); -const upload = (0, multer_1.default)({ - storage: multer_1.default.diskStorage({}), // temp dir - limits: { fileSize: 20 * 1024 * 1024 }, // 20MB - fileFilter: (_req, file, cb) => { - const ext = (0, path_1.extname)(file.originalname).toLowerCase(); - if (ALLOWED_UPLOAD_EXTENSIONS.has(ext)) { - cb(null, true); - } - else { - cb(new Error(`File type not allowed: ${ext}`)); - } - }, -}); -// POST /api/docs/upload — upload binary file (image, pdf, etc.) -router.post('/upload', (0, rbac_middleware_1.requireRole)(...roles_1.CONTENT_ROLES), upload.single('file'), async (req, res, next) => { - const tempPath = req.file?.path; - try { - metrics_1.cm_docs_operations.inc({ operation: 'upload' }); - if (!req.file) { - res.status(400).json({ error: { message: 'No file provided', code: 'VALIDATION_ERROR' } }); - return; - } - const targetDir = req.body.path || ''; - const fileName = (0, path_1.basename)(req.file.originalname).replace(/[^a-zA-Z0-9._-]/g, '_'); - const relativePath = targetDir ? `${targetDir}/${fileName}` : fileName; - await docs_files_service_1.docsFilesService.uploadFile(relativePath, req.file.path); - // Clean up temp file - try { - await (0, promises_1.rm)(req.file.path); - } - catch { /* ignore */ } - res.json({ success: true, path: relativePath }); - } - catch (err) { - // Clean up temp file on error - if (tempPath) { - try { - await (0, promises_1.rm)(tempPath); - } - catch { /* ignore */ } - } - handleFileError(err, res, next); - } -}); -// --- File Management Endpoints --- -// GET /api/docs/files — list file tree (content editors only) -router.get('/files', (0, rbac_middleware_1.requireRole)(...roles_1.CONTENT_ROLES), async (req, res, next) => { - try { - metrics_1.cm_docs_operations.inc({ operation: 'list' }); - if (req.query['force'] === 'true') { - await docs_files_service_1.docsFilesService.invalidateTreeCache(); - } - const tree = await docs_files_service_1.docsFilesService.listTree(); - res.json(tree); - } - catch (err) { - logger_1.logger.error('Failed to list docs files', err); - next(err); - } -}); -// GET /api/docs/files/search — search files by name/path (content editors only) -router.get('/files/search', (0, rbac_middleware_1.requireRole)(...roles_1.CONTENT_ROLES), async (req, res, next) => { - try { - const search = String(req.query['search'] ?? req.query['q'] ?? '').trim(); - if (!search) { - res.json({ files: [] }); - return; - } - const limit = Math.min(Math.max(Number(req.query['limit']) || 5, 1), 20); - const files = await docs_files_service_1.docsFilesService.searchFiles(search, limit); - res.json({ files }); - } - catch (err) { - logger_1.logger.error('Failed to search docs files', err); - next(err); - } -}); -// POST /api/docs/files/rename — rename/move file -router.post('/files/rename', (0, rbac_middleware_1.requireRole)(...roles_1.CONTENT_ROLES), async (req, res, next) => { - try { - metrics_1.cm_docs_operations.inc({ operation: 'rename' }); - const { from, to } = req.body; - if (!from || !to) { - res.status(400).json({ error: { message: 'Both "from" and "to" paths are required', code: 'VALIDATION_ERROR' } }); - return; - } - await docs_files_service_1.docsFilesService.renameFile(from, to); - // Invalidate old path's collaboration state - docs_collab_service_1.docsCollabService.invalidateDocument(from).catch(() => { }); - res.json({ success: true }); - } - catch (err) { - handleFileError(err, res, next); - } -}); -// GET /api/docs/files/* — read file content (content editors only) -router.get('/files/*', (0, rbac_middleware_1.requireRole)(...roles_1.CONTENT_ROLES), async (req, res, next) => { - try { - metrics_1.cm_docs_operations.inc({ operation: 'read' }); - const filePath = extractWildcardPath(req); - if (!filePath) { - res.status(400).json({ error: { message: 'File path required', code: 'VALIDATION_ERROR' } }); - return; - } - const content = await docs_files_service_1.docsFilesService.readFileContent(filePath); - res.json({ path: filePath, content }); - } - catch (err) { - handleFileError(err, res, next); - } -}); -// PUT /api/docs/files/* — write/update file content -router.put('/files/*', (0, rbac_middleware_1.requireRole)(...roles_1.CONTENT_ROLES), async (req, res, next) => { - try { - metrics_1.cm_docs_operations.inc({ operation: 'write' }); - const filePath = extractWildcardPath(req); - if (!filePath) { - res.status(400).json({ error: { message: 'File path required', code: 'VALIDATION_ERROR' } }); - return; - } - const { content } = req.body; - if (typeof content !== 'string') { - res.status(400).json({ error: { message: 'Content string required', code: 'VALIDATION_ERROR' } }); - return; - } - await docs_files_service_1.docsFilesService.writeFileContent(filePath, content); - // Invalidate collaboration state so next session starts fresh from disk - docs_collab_service_1.docsCollabService.invalidateDocument(filePath).catch(() => { }); - res.json({ success: true, path: filePath }); - } - catch (err) { - handleFileError(err, res, next); - } -}); -// POST /api/docs/files/* — create new file or folder -router.post('/files/*', (0, rbac_middleware_1.requireRole)(...roles_1.CONTENT_ROLES), async (req, res, next) => { - try { - metrics_1.cm_docs_operations.inc({ operation: 'create' }); - const filePath = extractWildcardPath(req); - if (!filePath) { - res.status(400).json({ error: { message: 'File path required', code: 'VALIDATION_ERROR' } }); - return; - } - const { content, isDirectory } = req.body; - await docs_files_service_1.docsFilesService.createFile(filePath, content, isDirectory); - res.status(201).json({ success: true, path: filePath }); - } - catch (err) { - handleFileError(err, res, next); - } -}); -// DELETE /api/docs/files/* — delete file or empty folder -router.delete('/files/*', (0, rbac_middleware_1.requireRole)(...roles_1.CONTENT_ROLES), async (req, res, next) => { - try { - metrics_1.cm_docs_operations.inc({ operation: 'delete' }); - const filePath = extractWildcardPath(req); - if (!filePath) { - res.status(400).json({ error: { message: 'File path required', code: 'VALIDATION_ERROR' } }); - return; - } - await docs_files_service_1.docsFilesService.deleteFile(filePath); - // Invalidate collaboration state for deleted file - docs_collab_service_1.docsCollabService.invalidateDocument(filePath).catch(() => { }); - res.json({ success: true }); - } - catch (err) { - handleFileError(err, res, next); - } -}); -/** - * Extract the wildcard path from Express 5 req.params. - * Express 5 uses params[0] for * routes. - */ -function extractWildcardPath(req) { - // Express 5: req.params is array-like for * routes - const params = req.params; - const wildcardParam = params[0] || params['0']; - if (Array.isArray(wildcardParam)) - return wildcardParam.join('/'); - return wildcardParam || ''; -} -function handleFileError(err, res, next) { - if (err instanceof docs_files_service_1.PathTraversalError) { - res.status(403).json({ error: { message: 'Path traversal not allowed', code: 'FORBIDDEN' } }); - return; - } - if (err instanceof docs_files_service_1.FileNotFoundError) { - res.status(404).json({ error: { message: err.message, code: 'NOT_FOUND' } }); - return; - } - if (err.message?.startsWith('Already exists')) { - res.status(409).json({ error: { message: err.message, code: 'CONFLICT' } }); - return; - } - if (err.message === 'Directory is not empty') { - res.status(400).json({ error: { message: 'Directory is not empty', code: 'VALIDATION_ERROR' } }); - return; - } - logger_1.logger.error('Docs file operation failed', err); - next(err); -} -exports.docsRouter = router; -//# sourceMappingURL=docs.routes.js.map \ No newline at end of file diff --git a/api/dist/modules/docs/docs.routes.js.map b/api/dist/modules/docs/docs.routes.js.map deleted file mode 100644 index b273362e..00000000 --- a/api/dist/modules/docs/docs.routes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"docs.routes.js","sourceRoot":"","sources":["../../../src/modules/docs/docs.routes.ts"],"names":[],"mappings":";;;;;;AAAA,qCAAkE;AAClE,oDAA4B;AAC5B,0CAAiC;AACjC,+BAAyC;AACzC,sEAAgE;AAChE,sEAA+E;AAC/E,0CAAuC;AACvC,6CAAkD;AAClD,+CAA4C;AAC5C,2DAA2D;AAC3D,iDAAyD;AACzD,6DAA+F;AAC/F,+DAA0D;AAC1D,mEAA8D;AAC9D,qEAAgE;AAChE,qEAA8D;AAE9D,MAAM,MAAM,GAAG,IAAA,gBAAM,GAAE,CAAC;AACxB,MAAM,CAAC,GAAG,CAAC,8BAAY,CAAC,CAAC;AACzB,MAAM,CAAC,GAAG,CAAC,gCAAc,CAAC,CAAC;AAE3B,2FAA2F;AAE3F,0FAA0F;AAC1F,MAAM,CAAC,GAAG,CACR,SAAS,EACT,IAAA,6BAAW,EAAC,GAAG,qBAAa,CAAC,EAC7B,KAAK,EAAE,IAAa,EAAE,GAAa,EAAE,IAAkB,EAAE,EAAE;IACzD,IAAI,CAAC;QACH,MAAM,CAAC,YAAY,EAAE,gBAAgB,EAAE,gBAAgB,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;YAC3E,IAAA,8BAAe,EAAC,SAAG,CAAC,kBAAkB,CAAC;YACvC,IAAA,8BAAe,EAAC,SAAG,CAAC,eAAe,CAAC;YACpC,IAAA,8BAAe,EAAC,SAAG,CAAC,sBAAsB,CAAC;SAC5C,CAAC,CAAC;QAEH,GAAG,CAAC,IAAI,CAAC;YACP,MAAM,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,EAAE,SAAG,CAAC,kBAAkB,EA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D,IAAI,GAAG,YAAY,sCAAiB,EAAE,CAAC;QACrC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,EAAG,GAAa,CAAC,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,CAAC,CAAC;QACxF,OAAO;IACT,CAAC;IACD,IAAK,GAAa,CAAC,OAAO,EAAE,UAAU,CAAC,gBAAgB,CAAC,EAAE,CAAC;QACzD,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,EAAG,GAAa,CAAC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,CAAC,CAAC;QACvF,OAAO;IACT,CAAC;IACD,IAAK,GAAa,CAAC,OAAO,KAAK,wBAAwB,EAAE,CAAC;QACxD,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,wBAAwB,EAAE,IAAI,EAAE,kBAAkB,EAAE,EAAE,CAAC,CAAC;QACjG,OAAO;IACT,CAAC;IACD,eAAM,CAAC,KAAK,CAAC,4BAA4B,EAAE,GAAG,CAAC,CAAC;IAChD,IAAI,CAAC,GAAG,CAAC,CAAC;AACZ,CAAC;AAEY,QAAA,UAAU,GAAG,MAAM,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/docs/mkdocs-config.service.d.ts b/api/dist/modules/docs/mkdocs-config.service.d.ts deleted file mode 100644 index 069e13fa..00000000 --- a/api/dist/modules/docs/mkdocs-config.service.d.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { Document } from 'yaml'; -/** - * Parse mkdocs.yml content with support for !!python/name: tags. - * Returns a yaml Document that preserves comments and formatting. - */ -declare function parseConfig(content: string): Document; -/** - * Validate that a string is valid YAML (with python tags support). - * Returns null if valid, error message if invalid. - */ -declare function validateYaml(content: string): string | null; -declare function readConfig(): Promise; -declare function writeConfig(content: string): Promise; -/** - * Trigger `mkdocs build --clean` via the build trigger HTTP server - * running inside the MkDocs container on port 8001. - */ -declare function triggerBuild(): Promise<{ - success: boolean; - output: string; - duration: number; -}>; -export declare const mkdocsConfigService: { - readConfig: typeof readConfig; - writeConfig: typeof writeConfig; - validateYaml: typeof validateYaml; - parseConfig: typeof parseConfig; - triggerBuild: typeof triggerBuild; -}; -export {}; -//# sourceMappingURL=mkdocs-config.service.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/docs/mkdocs-config.service.d.ts.map b/api/dist/modules/docs/mkdocs-config.service.d.ts.map deleted file mode 100644 index e010614c..00000000 --- a/api/dist/modules/docs/mkdocs-config.service.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mkdocs-config.service.d.ts","sourceRoot":"","sources":["../../../src/modules/docs/mkdocs-config.service.ts"],"names":[],"mappings":"AAGA,OAAO,EAAiB,QAAQ,EAAE,MAAM,MAAM,CAAC;AAqB/C;;;GAGG;AACH,iBAAS,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,QAAQ,CAS9C;AAED;;;GAGG;AACH,iBAAS,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAWpD;AAED,iBAAe,UAAU,IAAI,OAAO,CAAC,MAAM,CAAC,CAE3C;AAED,iBAAe,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAezD;AAED;;;GAGG;AACH,iBAAe,YAAY,IAAI,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,CAyB7F;AAED,eAAO,MAAM,mBAAmB;;;;;;CAM/B,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/docs/mkdocs-config.service.js b/api/dist/modules/docs/mkdocs-config.service.js deleted file mode 100644 index 68e9b1ff..00000000 --- a/api/dist/modules/docs/mkdocs-config.service.js +++ /dev/null @@ -1,108 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.mkdocsConfigService = void 0; -const promises_1 = require("fs/promises"); -const env_1 = require("../../config/env"); -const logger_1 = require("../../utils/logger"); -const yaml_1 = require("yaml"); -/** - * Custom YAML tag schema to preserve !!python/name: and !!python/object: tags. - * Without this, the yaml library would reject these custom tags. - */ -const pythonNameTag = { - identify: () => false, - tag: '!python/name', - collection: undefined, - resolve: (str) => str, -}; -const pythonObjectTag = { - identify: () => false, - tag: '!python/object', - collection: undefined, - resolve: (str) => str, -}; -/** - * Parse mkdocs.yml content with support for !!python/name: tags. - * Returns a yaml Document that preserves comments and formatting. - */ -function parseConfig(content) { - return (0, yaml_1.parseDocument)(content, { - customTags: (tags) => [ - ...tags, - pythonNameTag, - pythonObjectTag, - ], - keepSourceTokens: true, - }); -} -/** - * Validate that a string is valid YAML (with python tags support). - * Returns null if valid, error message if invalid. - */ -function validateYaml(content) { - try { - const doc = parseConfig(content); - const errors = doc.errors; - if (errors.length > 0) { - return errors.map(e => e.message).join('; '); - } - return null; - } - catch (err) { - return err.message; - } -} -async function readConfig() { - return (0, promises_1.readFile)(env_1.env.MKDOCS_CONFIG_PATH, 'utf-8'); -} -async function writeConfig(content) { - // Validate YAML first - const error = validateYaml(content); - if (error) { - throw new Error(`Invalid YAML: ${error}`); - } - // Create backup - try { - await (0, promises_1.copyFile)(env_1.env.MKDOCS_CONFIG_PATH, `${env_1.env.MKDOCS_CONFIG_PATH}.bak`); - } - catch { - logger_1.logger.warn('Could not create backup of mkdocs.yml'); - } - await (0, promises_1.writeFile)(env_1.env.MKDOCS_CONFIG_PATH, content, 'utf-8'); -} -/** - * Trigger `mkdocs build --clean` via the build trigger HTTP server - * running inside the MkDocs container on port 8001. - */ -async function triggerBuild() { - const buildUrl = `${env_1.env.MKDOCS_PREVIEW_URL.replace(':8000', ':8001')}/build`; - const startTime = Date.now(); - try { - const controller = new AbortController(); - const timeout = setTimeout(() => controller.abort(), 130_000); - const response = await fetch(buildUrl, { - method: 'POST', - signal: controller.signal, - }); - clearTimeout(timeout); - const data = await response.json(); - return data; - } - catch (err) { - const duration = Date.now() - startTime; - logger_1.logger.error('MkDocs build failed', err); - return { - success: false, - output: `Build error: ${err.message}`, - duration, - }; - } -} -exports.mkdocsConfigService = { - readConfig, - writeConfig, - validateYaml, - parseConfig, - triggerBuild, -}; -//# sourceMappingURL=mkdocs-config.service.js.map \ No newline at end of file diff --git a/api/dist/modules/docs/mkdocs-config.service.js.map b/api/dist/modules/docs/mkdocs-config.service.js.map deleted file mode 100644 index 2d4eb16c..00000000 --- a/api/dist/modules/docs/mkdocs-config.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"mkdocs-config.service.js","sourceRoot":"","sources":["../../../src/modules/docs/mkdocs-config.service.ts"],"names":[],"mappings":";;;AAAA,0CAA4D;AAC5D,0CAAuC;AACvC,+CAA4C;AAC5C,+BAA+C;AAG/C;;;GAGG;AACH,MAAM,aAAa,GAAc;IAC/B,QAAQ,EAAE,GAAG,EAAE,CAAC,KAAK;IACrB,GAAG,EAAE,cAAc;IACnB,UAAU,EAAE,SAAkB;IAC9B,OAAO,EAAE,CAAC,GAAW,EAAE,EAAE,CAAC,GAAG;CAC9B,CAAC;AAEF,MAAM,eAAe,GAAc;IACjC,QAAQ,EAAE,GAAG,EAAE,CAAC,KAAK;IACrB,GAAG,EAAE,gBAAgB;IACrB,UAAU,EAAE,SAAkB;IAC9B,OAAO,EAAE,CAAC,GAAW,EAAE,EAAE,CAAC,GAAG;CAC9B,CAAC;AAEF;;;GAGG;AACH,SAAS,WAAW,CAAC,OAAe;IAClC,OAAO,IAAA,oBAAa,EAAC,OAAO,EAAE;QAC5B,UAAU,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC;YACpB,GAAG,IAAI;YACP,aAAa;YACb,eAAe;SAChB;QACD,gBAAgB,EAAE,IAAI;KACvB,CAAC,CAAC;AACL,CAAC;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AAE,OAAO,CAAC,QAAQ,CAAC;IAC7E,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAE7B,IAAI,CAAC;QACH,MAAM,UAAU,GAAG,IAAI,eAAe,EAAE,CAAC;QACzC,MAAM,OAAO,GAAG,UAAU,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,EAAE,OAAO,CAAC,CAAC;QAE9D,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,QAAQ,EAAE;YACrC,MAAM,EAAE,MAAM;YACd,MAAM,EAAE,UAAU,CAAC,MAAM;SAC1B,CAAC,CAAC;QACH,YAAY,CAAC,OAAO,CAAC,CAAC;QAEtB,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAA4D,CAAC;QAC7F,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC;QACxC,eAAM,CAAC,KAAK,CAAC,qBAAqB,EAAE,GAAG,CAAC,CAAC;QACzC,OAAO;YACL,OAAO,EAAE,KAAK;YACd,MAAM,EAAE,gBAAiB,GAAa,CAAC,OAAO,EAAE;YAChD,QAAQ;SACT,CAAC;IACJ,CAAC;AACH,CAAC;AAEY,QAAA,mBAAmB,GAAG;IACjC,UAAU;IACV,WAAW;IACX,YAAY;IACZ,WAAW;IACX,YAAY;CACb,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/email-templates/email-templates-admin.routes.d.ts b/api/dist/modules/email-templates/email-templates-admin.routes.d.ts deleted file mode 100644 index 954e23be..00000000 --- a/api/dist/modules/email-templates/email-templates-admin.routes.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const router: import("express-serve-static-core").Router; -export default router; -//# sourceMappingURL=email-templates-admin.routes.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/email-templates/email-templates-admin.routes.d.ts.map b/api/dist/modules/email-templates/email-templates-admin.routes.d.ts.map deleted file mode 100644 index 139fa47f..00000000 --- a/api/dist/modules/email-templates/email-templates-admin.routes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"email-templates-admin.routes.d.ts","sourceRoot":"","sources":["../../../src/modules/email-templates/email-templates-admin.routes.ts"],"names":[],"mappings":"AAuBA,QAAA,MAAM,MAAM,4CAAW,CAAC;AAqUxB,eAAe,MAAM,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/email-templates/email-templates-admin.routes.js b/api/dist/modules/email-templates/email-templates-admin.routes.js deleted file mode 100644 index 49d9bfb2..00000000 --- a/api/dist/modules/email-templates/email-templates-admin.routes.js +++ /dev/null @@ -1,272 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const express_1 = require("express"); -const email_templates_service_1 = require("./email-templates.service"); -const email_service_1 = require("../../services/email.service"); -const validate_1 = require("../../middleware/validate"); -const email_templates_schemas_1 = require("./email-templates.schemas"); -const logger_1 = require("../../utils/logger"); -const auth_middleware_1 = require("../../middleware/auth.middleware"); -const rbac_middleware_1 = require("../../middleware/rbac.middleware"); -const client_1 = require("@prisma/client"); -const roles_1 = require("../../utils/roles"); -const express_rate_limit_1 = __importDefault(require("express-rate-limit")); -const rate_limit_redis_1 = __importDefault(require("rate-limit-redis")); -const redis_1 = require("../../config/redis"); -const seed_email_templates_1 = require("../../scripts/seed-email-templates"); -const router = (0, express_1.Router)(); -// All email template routes require authentication -router.use(auth_middleware_1.authenticate); -// All routes require broadcast admin role -const requireBroadcastRole = (0, rbac_middleware_1.requireRole)(...roles_1.BROADCAST_ROLES); -/** - * List email templates - * GET /email-templates - */ -router.get('/', requireBroadcastRole, (0, validate_1.validate)(email_templates_schemas_1.listEmailTemplatesSchema, 'query'), async (req, res) => { - try { - const result = await email_templates_service_1.emailTemplatesService.list(req.query); - res.json(result); - } - catch (error) { - logger_1.logger.error('Error listing email templates:', error); - res.status(500).json({ error: 'Failed to list email templates' }); - } -}); -/** - * Get single email template - * GET /email-templates/:id - */ -router.get('/:id', requireBroadcastRole, async (req, res) => { - try { - const template = await email_templates_service_1.emailTemplatesService.getById(req.params.id); - res.json(template); - } - catch (error) { - if (error instanceof Error && error.message === 'Template not found') { - res.status(404).json({ error: 'Template not found' }); - return; - } - logger_1.logger.error('Error getting email template:', error); - res.status(500).json({ error: 'Failed to get email template' }); - } -}); -/** - * Create email template - * POST /email-templates - */ -router.post('/', requireBroadcastRole, (0, validate_1.validate)(email_templates_schemas_1.createEmailTemplateSchema), async (req, res) => { - try { - const template = await email_templates_service_1.emailTemplatesService.create(req.body, req.user.id); - res.status(201).json(template); - } - catch (error) { - if (error instanceof Error && error.message.includes('already exists')) { - res.status(409).json({ error: error.message }); - return; - } - if (error instanceof Error && error.message.includes('validation failed')) { - res.status(400).json({ error: error.message }); - return; - } - logger_1.logger.error('Error creating email template:', error); - res.status(500).json({ error: 'Failed to create email template' }); - } -}); -/** - * Update email template - * PUT /email-templates/:id - */ -router.put('/:id', requireBroadcastRole, (0, validate_1.validate)(email_templates_schemas_1.updateEmailTemplateSchema), async (req, res) => { - try { - const template = await email_templates_service_1.emailTemplatesService.update(req.params.id, req.body, req.user.id); - // Clear cache so changes take effect immediately - email_service_1.emailService.clearDatabaseCache(template.key); - logger_1.logger.info(`Cleared template cache for: ${template.key}`); - res.json(template); - } - catch (error) { - if (error instanceof Error && error.message === 'Template not found') { - res.status(404).json({ error: 'Template not found' }); - return; - } - if (error instanceof Error && error.message.includes('validation failed')) { - res.status(400).json({ error: error.message }); - return; - } - logger_1.logger.error('Error updating email template:', error); - res.status(500).json({ error: 'Failed to update email template' }); - } -}); -/** - * Delete email template - * DELETE /email-templates/:id - */ -router.delete('/:id', requireBroadcastRole, async (req, res) => { - try { - // Fetch template before deleting to get the key - const template = await email_templates_service_1.emailTemplatesService.getById(req.params.id); - await email_templates_service_1.emailTemplatesService.delete(req.params.id); - // Clear cache for deleted template - email_service_1.emailService.clearDatabaseCache(template.key); - logger_1.logger.info(`Cleared template cache for deleted template: ${template.key}`); - res.status(204).send(); - } - catch (error) { - if (error instanceof Error && error.message === 'Template not found') { - res.status(404).json({ error: 'Template not found' }); - return; - } - if (error instanceof Error && error.message.includes('Cannot delete system templates')) { - res.status(403).json({ error: error.message }); - return; - } - logger_1.logger.error('Error deleting email template:', error); - res.status(500).json({ error: 'Failed to delete email template' }); - } -}); -/** - * Get version history - * GET /email-templates/:id/versions - */ -router.get('/:id/versions', requireBroadcastRole, async (req, res) => { - try { - const versions = await email_templates_service_1.emailTemplatesService.getVersions(req.params.id); - res.json(versions); - } - catch (error) { - logger_1.logger.error('Error getting template versions:', error); - res.status(500).json({ error: 'Failed to get template versions' }); - } -}); -/** - * Get specific version - * GET /email-templates/:id/versions/:versionNumber - */ -router.get('/:id/versions/:versionNumber', requireBroadcastRole, async (req, res) => { - try { - const version = await email_templates_service_1.emailTemplatesService.getVersion(req.params.id, parseInt(req.params.versionNumber, 10)); - res.json(version); - } - catch (error) { - if (error instanceof Error && error.message === 'Version not found') { - res.status(404).json({ error: 'Version not found' }); - return; - } - logger_1.logger.error('Error getting template version:', error); - res.status(500).json({ error: 'Failed to get template version' }); - } -}); -/** - * Rollback to previous version - * POST /email-templates/:id/rollback - */ -router.post('/:id/rollback', requireBroadcastRole, (0, validate_1.validate)(email_templates_schemas_1.rollbackToVersionSchema), async (req, res) => { - try { - const template = await email_templates_service_1.emailTemplatesService.rollbackToVersion(req.params.id, req.body, req.user.id); - res.json(template); - } - catch (error) { - if (error instanceof Error && (error.message === 'Template not found' || error.message === 'Version not found')) { - res.status(404).json({ error: error.message }); - return; - } - logger_1.logger.error('Error rolling back template:', error); - res.status(500).json({ error: 'Failed to rollback template' }); - } -}); -/** - * Validate template syntax - * POST /email-templates/validate - */ -router.post('/validate', requireBroadcastRole, (0, validate_1.validate)(email_templates_schemas_1.validateTemplateSchema), async (req, res) => { - try { - const result = email_templates_service_1.emailTemplatesService.validateTemplate(req.body); - res.json(result); - } - catch (error) { - logger_1.logger.error('Error validating template:', error); - res.status(500).json({ error: 'Failed to validate template' }); - } -}); -/** - * Send test email - * POST /email-templates/:id/test - * Rate limited to 10 per 15 minutes per user - */ -router.post('/:id/test', requireBroadcastRole, (0, express_rate_limit_1.default)({ - windowMs: 15 * 60 * 1000, // 15 minutes - max: 10, - standardHeaders: true, - legacyHeaders: false, - store: new rate_limit_redis_1.default({ - sendCommand: (command, ...args) => redis_1.redis.call(command, ...args), - prefix: 'rl:email-template-test:', - }), - keyGenerator: (req) => req.user.id, -}), (0, validate_1.validate)(email_templates_schemas_1.sendTestEmailSchema), async (req, res) => { - try { - const result = await email_templates_service_1.emailTemplatesService.sendTestEmail(req.params.id, req.body, req.user.id); - res.json(result); - } - catch (error) { - if (error instanceof Error && error.message === 'Template not found') { - res.status(404).json({ error: 'Template not found' }); - return; - } - logger_1.logger.error('Error sending test email:', error); - res.status(500).json({ error: 'Failed to send test email' }); - } -}); -/** - * Get test logs for template - * GET /email-templates/:id/test-logs - */ -router.get('/:id/test-logs', requireBroadcastRole, async (req, res) => { - try { - const limit = req.query.limit ? parseInt(req.query.limit, 10) : 10; - const logs = await email_templates_service_1.emailTemplatesService.getTestLogs(req.params.id, limit); - res.json(logs); - } - catch (error) { - logger_1.logger.error('Error getting test logs:', error); - res.status(500).json({ error: 'Failed to get test logs' }); - } -}); -/** - * Seed templates from filesystem (SUPER_ADMIN only) - * POST /email-templates/seed - */ -router.post('/seed', (0, rbac_middleware_1.requireRole)(client_1.UserRole.SUPER_ADMIN), async (req, res) => { - try { - await (0, seed_email_templates_1.seedEmailTemplates)(); - logger_1.logger.info('Email templates seeded via API'); - res.json({ success: true, message: 'Templates seeded successfully' }); - } - catch (error) { - logger_1.logger.error('Error seeding templates:', error); - res.status(500).json({ error: 'Failed to seed templates' }); - } -}); -/** - * Clear template cache (SUPER_ADMIN only) - * POST /email-templates/clear-cache - * Body: { key?: string } - Optional template key to clear. If not provided, clears all. - */ -router.post('/clear-cache', (0, rbac_middleware_1.requireRole)(client_1.UserRole.SUPER_ADMIN), async (req, res) => { - try { - const { key } = req.body; - email_service_1.emailService.clearDatabaseCache(key); - logger_1.logger.info(`Template cache cleared${key ? ` for: ${key}` : ' (all)'}`); - res.json({ success: true, cleared: key || 'all' }); - } - catch (error) { - logger_1.logger.error('Error clearing template cache:', error); - res.status(500).json({ error: 'Failed to clear template cache' }); - } -}); -exports.default = router; -//# sourceMappingURL=email-templates-admin.routes.js.map \ No newline at end of file diff --git a/api/dist/modules/email-templates/email-templates-admin.routes.js.map b/api/dist/modules/email-templates/email-templates-admin.routes.js.map deleted file mode 100644 index 56488f11..00000000 --- a/api/dist/modules/email-templates/email-templates-admin.routes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"email-templates-admin.routes.js","sourceRoot":"","sources":["../../../src/modules/email-templates/email-templates-admin.routes.ts"],"names":[],"mappings":";;;;;AAAA,qCAAiC;AACjC,uEAAkE;AAClE,gEAA4D;AAC5D,wDAAqD;AACrD,uEAOmC;AACnC,+CAA4C;AAC5C,sEAAgE;AAChE,sEAA+D;AAC/D,2CAA0C;AAE1C,6CAAoD;AACpD,4EAA2C;AAC3C,wEAA0C;AAC1C,8CAA2C;AAC3C,6EAAwE;AAExE,MAAM,MAAM,GAAG,IAAA,gBAAM,GAAE,CAAC;AAExB,mDAAmD;AACnD,MAAM,CAAC,GAAG,CAAC,8BAAY,CAAC,CAAC;AAEzB,0CAA0C;AAC1C,MAAM,oBAAoB,GAAG,IAAA,6BAAW,EAAC,GAAG,uBAAe,CAAC,CAAC;AAE7D;;;GAGG;AACH,MAAM,CAAC,GAAG,CACR,GAAG,EACH,oBAAoB,EACpB,IAAA,mBAAQ,EAAC,kDAAwB,EAAE,OAAO,CAAC,EAC3C,KAAK,EAAE,GAAY,EAAE,GAAa,EAAiB,EAAE;IACnD,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MA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AE,KAAK,EAAE,0BAA0B,EAAE,CAAC,CAAC;IAC9D,CAAC;AACH,CAAC,CACF,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,IAAI,CACT,cAAc,EACd,IAAA,6BAAW,EAAC,iBAAQ,CAAC,WAAW,CAAC,EACjC,KAAK,EAAE,GAAY,EAAE,GAAa,EAAiB,EAAE;IACnD,IAAI,CAAC;QACH,MAAM,EAAE,GAAG,EAAE,GAAG,GAAG,CAAC,IAAI,CAAC;QACzB,4BAAY,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC;QACrC,eAAM,CAAC,IAAI,CAAC,yBAAyB,GAAG,CAAC,CAAC,CAAC,SAAS,GAAG,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;QACxE,GAAG,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,KAAK,EAAE,CAAC,CAAC;IACrD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,eAAM,CAAC,KAAK,CAAC,gCAAgC,EAAE,KAAK,CAAC,CAAC;QACtD,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,gCAAgC,EAAE,CAAC,CAAC;IACpE,CAAC;AACH,CAAC,CACF,CAAC;AAEF,kBAAe,MAAM,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/email-templates/email-templates.schemas.d.ts b/api/dist/modules/email-templates/email-templates.schemas.d.ts deleted file mode 100644 index 1a588350..00000000 --- a/api/dist/modules/email-templates/email-templates.schemas.d.ts +++ /dev/null @@ -1,327 +0,0 @@ -import { z } from 'zod'; -export declare const EmailTemplateVariableTypeSchema: z.ZodEnum<["TEXT", "VIDEO"]>; -export type EmailTemplateVariableTypeType = z.infer; -export declare const emailTemplateVariableSchema: z.ZodEffects; - type: z.ZodDefault>; - videoId: z.ZodOptional; - isRequired: z.ZodDefault; - isConditional: z.ZodDefault; - sampleValue: z.ZodOptional; - sortOrder: z.ZodDefault; -}, "strip", z.ZodTypeAny, { - type: "VIDEO" | "TEXT"; - key: string; - sortOrder: number; - label: string; - isRequired: boolean; - isConditional: boolean; - videoId?: number | undefined; - description?: string | undefined; - sampleValue?: string | undefined; -}, { - key: string; - label: string; - type?: "VIDEO" | "TEXT" | undefined; - videoId?: number | undefined; - description?: string | undefined; - sortOrder?: number | undefined; - isRequired?: boolean | undefined; - isConditional?: boolean | undefined; - sampleValue?: string | undefined; -}>, { - type: "VIDEO" | "TEXT"; - key: string; - sortOrder: number; - label: string; - isRequired: boolean; - isConditional: boolean; - videoId?: number | undefined; - description?: string | undefined; - sampleValue?: string | undefined; -}, { - key: string; - label: string; - type?: "VIDEO" | "TEXT" | undefined; - videoId?: number | undefined; - description?: string | undefined; - sortOrder?: number | undefined; - isRequired?: boolean | undefined; - isConditional?: boolean | undefined; - sampleValue?: string | undefined; -}>; -export declare const listEmailTemplatesSchema: z.ZodObject<{ - page: z.ZodDefault; - limit: z.ZodDefault; - search: z.ZodOptional; - category: z.ZodOptional>; - isActive: z.ZodOptional; -}, "strip", z.ZodTypeAny, { - limit: number; - page: number; - search?: string | undefined; - category?: "INFLUENCE" | "MAP" | "SYSTEM" | "PAYMENT" | undefined; - isActive?: boolean | undefined; -}, { - search?: string | undefined; - category?: "INFLUENCE" | "MAP" | "SYSTEM" | "PAYMENT" | undefined; - limit?: number | undefined; - isActive?: boolean | undefined; - page?: number | undefined; -}>; -export type ListEmailTemplatesDto = z.infer; -export declare const createEmailTemplateSchema: z.ZodObject<{ - key: z.ZodString; - name: z.ZodString; - description: z.ZodOptional; - category: z.ZodNativeEnum<{ - INFLUENCE: "INFLUENCE"; - MAP: "MAP"; - SYSTEM: "SYSTEM"; - PAYMENT: "PAYMENT"; - }>; - subjectLine: z.ZodString; - htmlContent: z.ZodString; - textContent: z.ZodString; - isActive: z.ZodDefault; - variables: z.ZodOptional; - type: z.ZodDefault>; - videoId: z.ZodOptional; - isRequired: z.ZodDefault; - isConditional: z.ZodDefault; - sampleValue: z.ZodOptional; - sortOrder: z.ZodDefault; - }, "strip", z.ZodTypeAny, { - type: "VIDEO" | "TEXT"; - key: string; - sortOrder: number; - label: string; - isRequired: boolean; - isConditional: boolean; - videoId?: number | undefined; - description?: string | undefined; - sampleValue?: string | undefined; - }, { - key: string; - label: string; - type?: "VIDEO" | "TEXT" | undefined; - videoId?: number | undefined; - description?: string | undefined; - sortOrder?: number | undefined; - isRequired?: boolean | undefined; - isConditional?: boolean | undefined; - sampleValue?: string | undefined; - }>, { - type: "VIDEO" | "TEXT"; - key: string; - sortOrder: number; - label: string; - isRequired: boolean; - isConditional: boolean; - videoId?: number | undefined; - description?: string | undefined; - sampleValue?: string | undefined; - }, { - key: string; - label: string; - type?: "VIDEO" | "TEXT" | undefined; - videoId?: number | undefined; - description?: string | undefined; - sortOrder?: number | undefined; - isRequired?: boolean | undefined; - isConditional?: boolean | undefined; - sampleValue?: string | undefined; - }>, "many">>; -}, "strip", z.ZodTypeAny, { - name: string; - category: "INFLUENCE" | "MAP" | "SYSTEM" | "PAYMENT"; - key: string; - isActive: boolean; - subjectLine: string; - htmlContent: string; - textContent: string; - description?: string | undefined; - variables?: { - type: "VIDEO" | "TEXT"; - key: string; - sortOrder: number; - label: string; - isRequired: boolean; - isConditional: boolean; - videoId?: number | undefined; - description?: string | undefined; - sampleValue?: string | undefined; - }[] | undefined; -}, { - name: string; - category: "INFLUENCE" | "MAP" | "SYSTEM" | "PAYMENT"; - key: string; - subjectLine: string; - htmlContent: string; - textContent: string; - isActive?: boolean | undefined; - description?: string | undefined; - variables?: { - key: string; - label: string; - type?: "VIDEO" | "TEXT" | undefined; - videoId?: number | undefined; - description?: string | undefined; - sortOrder?: number | undefined; - isRequired?: boolean | undefined; - isConditional?: boolean | undefined; - sampleValue?: string | undefined; - }[] | undefined; -}>; -export type CreateEmailTemplateDto = z.infer; -export declare const updateEmailTemplateSchema: z.ZodObject<{ - name: z.ZodOptional; - description: z.ZodNullable>; - category: z.ZodOptional>; - subjectLine: z.ZodOptional; - htmlContent: z.ZodOptional; - textContent: z.ZodOptional; - isActive: z.ZodOptional; - variables: z.ZodOptional; - type: z.ZodDefault>; - videoId: z.ZodOptional; - isRequired: z.ZodDefault; - isConditional: z.ZodDefault; - sampleValue: z.ZodOptional; - sortOrder: z.ZodDefault; - }, "strip", z.ZodTypeAny, { - type: "VIDEO" | "TEXT"; - key: string; - sortOrder: number; - label: string; - isRequired: boolean; - isConditional: boolean; - videoId?: number | undefined; - description?: string | undefined; - sampleValue?: string | undefined; - }, { - key: string; - label: string; - type?: "VIDEO" | "TEXT" | undefined; - videoId?: number | undefined; - description?: string | undefined; - sortOrder?: number | undefined; - isRequired?: boolean | undefined; - isConditional?: boolean | undefined; - sampleValue?: string | undefined; - }>, { - type: "VIDEO" | "TEXT"; - key: string; - sortOrder: number; - label: string; - isRequired: boolean; - isConditional: boolean; - videoId?: number | undefined; - description?: string | undefined; - sampleValue?: string | undefined; - }, { - key: string; - label: string; - type?: "VIDEO" | "TEXT" | undefined; - videoId?: number | undefined; - description?: string | undefined; - sortOrder?: number | undefined; - isRequired?: boolean | undefined; - isConditional?: boolean | undefined; - sampleValue?: string | undefined; - }>, "many">>; -}, "strip", z.ZodTypeAny, { - name?: string | undefined; - category?: "INFLUENCE" | "MAP" | "SYSTEM" | "PAYMENT" | undefined; - isActive?: boolean | undefined; - description?: string | null | undefined; - subjectLine?: string | undefined; - htmlContent?: string | undefined; - textContent?: string | undefined; - variables?: { - type: "VIDEO" | "TEXT"; - key: string; - sortOrder: number; - label: string; - isRequired: boolean; - isConditional: boolean; - videoId?: number | undefined; - description?: string | undefined; - sampleValue?: string | undefined; - }[] | undefined; -}, { - name?: string | undefined; - category?: "INFLUENCE" | "MAP" | "SYSTEM" | "PAYMENT" | undefined; - isActive?: boolean | undefined; - description?: string | null | undefined; - subjectLine?: string | undefined; - htmlContent?: string | undefined; - textContent?: string | undefined; - variables?: { - key: string; - label: string; - type?: "VIDEO" | "TEXT" | undefined; - videoId?: number | undefined; - description?: string | undefined; - sortOrder?: number | undefined; - isRequired?: boolean | undefined; - isConditional?: boolean | undefined; - sampleValue?: string | undefined; - }[] | undefined; -}>; -export type UpdateEmailTemplateDto = z.infer; -export declare const rollbackToVersionSchema: z.ZodObject<{ - versionNumber: z.ZodNumber; - changeNotes: z.ZodOptional; -}, "strip", z.ZodTypeAny, { - versionNumber: number; - changeNotes?: string | undefined; -}, { - versionNumber: number; - changeNotes?: string | undefined; -}>; -export type RollbackToVersionDto = z.infer; -export declare const validateTemplateSchema: z.ZodObject<{ - htmlContent: z.ZodString; - textContent: z.ZodString; - subjectLine: z.ZodOptional; -}, "strip", z.ZodTypeAny, { - htmlContent: string; - textContent: string; - subjectLine?: string | undefined; -}, { - htmlContent: string; - textContent: string; - subjectLine?: string | undefined; -}>; -export type ValidateTemplateDto = z.infer; -export declare const sendTestEmailSchema: z.ZodObject<{ - recipientEmail: z.ZodString; - testData: z.ZodRecord; -}, "strip", z.ZodTypeAny, { - recipientEmail: string; - testData: Record; -}, { - recipientEmail: string; - testData: Record; -}>; -export type SendTestEmailDto = z.infer; -//# sourceMappingURL=email-templates.schemas.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/email-templates/email-templates.schemas.d.ts.map b/api/dist/modules/email-templates/email-templates.schemas.d.ts.map deleted file mode 100644 index 7ae2dcfa..00000000 --- a/api/dist/modules/email-templates/email-templates.schemas.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"email-templates.schemas.d.ts","sourceRoot":"","sources":["../../../src/modules/email-templates/email-templates.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,+BAA+B,8BAA4B,CAAC;AACzE,MAAM,MAAM,6BAA6B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AAG5F,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmBvC,CAAC;AAGF,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;EAMnC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAG7E,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUpC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAG/E,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASpC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAG/E,eAAO,MAAM,uBAAuB;;;;;;;;;EAGlC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAG3E,eAAO,MAAM,sBAAsB;;;;;;;;;;;;EAIjC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAGzE,eAAO,MAAM,mBAAmB;;;;;;;;;EAG9B,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/email-templates/email-templates.schemas.js b/api/dist/modules/email-templates/email-templates.schemas.js deleted file mode 100644 index 5a450573..00000000 --- a/api/dist/modules/email-templates/email-templates.schemas.js +++ /dev/null @@ -1,73 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.sendTestEmailSchema = exports.validateTemplateSchema = exports.rollbackToVersionSchema = exports.updateEmailTemplateSchema = exports.createEmailTemplateSchema = exports.listEmailTemplatesSchema = exports.emailTemplateVariableSchema = exports.EmailTemplateVariableTypeSchema = void 0; -const zod_1 = require("zod"); -const client_1 = require("@prisma/client"); -// Variable type enum -exports.EmailTemplateVariableTypeSchema = zod_1.z.enum(['TEXT', 'VIDEO']); -// Variable schema -exports.emailTemplateVariableSchema = zod_1.z.object({ - key: zod_1.z.string().regex(/^[A-Z_]+$/, 'Variable key must be uppercase letters and underscores'), - label: zod_1.z.string().min(1).max(100), - description: zod_1.z.string().max(500).optional(), - type: exports.EmailTemplateVariableTypeSchema.default('TEXT'), - videoId: zod_1.z.number().int().positive().optional(), - isRequired: zod_1.z.boolean().default(true), - isConditional: zod_1.z.boolean().default(false), - sampleValue: zod_1.z.string().max(1000).optional(), - sortOrder: zod_1.z.number().int().min(0).default(0), -}).refine((data) => { - // VIDEO type must have videoId - if (data.type === 'VIDEO' && !data.videoId) { - return false; - } - return true; -}, { message: 'VIDEO variables must have a videoId', path: ['videoId'] }); -// List templates -exports.listEmailTemplatesSchema = zod_1.z.object({ - page: zod_1.z.coerce.number().int().min(1).default(1), - limit: zod_1.z.coerce.number().int().min(1).max(100).default(20), - search: zod_1.z.string().max(200).optional(), - category: zod_1.z.nativeEnum(client_1.EmailTemplateCategory).optional(), - isActive: zod_1.z.coerce.boolean().optional(), -}); -// Create template -exports.createEmailTemplateSchema = zod_1.z.object({ - key: zod_1.z.string().regex(/^[a-z0-9-]+$/, 'Template key must be lowercase alphanumeric with hyphens').min(1).max(100), - name: zod_1.z.string().min(1).max(200), - description: zod_1.z.string().max(1000).optional(), - category: zod_1.z.nativeEnum(client_1.EmailTemplateCategory), - subjectLine: zod_1.z.string().min(1).max(500), - htmlContent: zod_1.z.string().min(1).max(100000, 'HTML content exceeds 100KB limit'), - textContent: zod_1.z.string().min(1).max(50000, 'Text content exceeds 50KB limit'), - isActive: zod_1.z.boolean().default(true), - variables: zod_1.z.array(exports.emailTemplateVariableSchema).optional(), -}); -// Update template -exports.updateEmailTemplateSchema = zod_1.z.object({ - name: zod_1.z.string().min(1).max(200).optional(), - description: zod_1.z.string().max(1000).optional().nullable(), - category: zod_1.z.nativeEnum(client_1.EmailTemplateCategory).optional(), - subjectLine: zod_1.z.string().min(1).max(500).optional(), - htmlContent: zod_1.z.string().min(1).max(100000, 'HTML content exceeds 100KB limit').optional(), - textContent: zod_1.z.string().min(1).max(50000, 'Text content exceeds 50KB limit').optional(), - isActive: zod_1.z.boolean().optional(), - variables: zod_1.z.array(exports.emailTemplateVariableSchema).optional(), -}); -// Rollback to version -exports.rollbackToVersionSchema = zod_1.z.object({ - versionNumber: zod_1.z.number().int().min(1), - changeNotes: zod_1.z.string().max(500).optional(), -}); -// Validate template -exports.validateTemplateSchema = zod_1.z.object({ - htmlContent: zod_1.z.string().min(1).max(100000), - textContent: zod_1.z.string().min(1).max(50000), - subjectLine: zod_1.z.string().min(1).max(500).optional(), -}); -// Send test email -exports.sendTestEmailSchema = zod_1.z.object({ - recipientEmail: zod_1.z.string().email('Invalid email address').max(255), - testData: zod_1.z.record(zod_1.z.string(), zod_1.z.string()), -}); -//# sourceMappingURL=email-templates.schemas.js.map \ No newline at end of file diff --git a/api/dist/modules/email-templates/email-templates.schemas.js.map b/api/dist/modules/email-templates/email-templates.schemas.js.map deleted file mode 100644 index 1f3c1ece..00000000 --- a/api/dist/modules/email-templates/email-templates.schemas.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"email-templates.schemas.js","sourceRoot":"","sources":["../../../src/modules/email-templates/email-templates.schemas.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,2CAAuD;AAEvD,qBAAqB;AACR,QAAA,+BAA+B,GAAG,OAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAA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;CAC3D,CAAC,CAAC;AAIH,sBAAsB;AACT,QAAA,uBAAuB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC9C,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACtC,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;CAC5C,CAAC,CAAC;AAIH,oBAAoB;AACP,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC;IAC1C,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC;IACzC,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;CACnD,CAAC,CAAC;AAIH,kBAAkB;AACL,QAAA,mBAAmB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC1C,cAAc,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IAClE,QAAQ,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC;CAC3C,CAAC,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/email-templates/email-templates.service.d.ts b/api/dist/modules/email-templates/email-templates.service.d.ts deleted file mode 100644 index ae2efe15..00000000 --- a/api/dist/modules/email-templates/email-templates.service.d.ts +++ /dev/null @@ -1,266 +0,0 @@ -import { Prisma } from '@prisma/client'; -import type { ListEmailTemplatesDto, CreateEmailTemplateDto, UpdateEmailTemplateDto, RollbackToVersionDto, ValidateTemplateDto, SendTestEmailDto } from './email-templates.schemas'; -interface EmailTemplatesListResponse { - templates: any[]; - pagination: { - page: number; - limit: number; - total: number; - totalPages: number; - }; -} -interface ValidationResult { - valid: boolean; - errors: string[]; - warnings?: string[]; - extractedVariables?: string[]; -} -export declare class EmailTemplatesService { - /** - * List email templates with pagination, search, and filters - */ - list(params: ListEmailTemplatesDto): Promise; - /** - * Get a single email template by ID - */ - getById(id: string): Promise<{ - _count: { - versions: number; - testLogs: number; - }; - createdBy: { - id: string; - email: string; - name: string | null; - }; - variables: { - type: import(".prisma/client").$Enums.EmailTemplateVariableType; - id: string; - videoId: number | null; - key: string; - description: string | null; - sortOrder: number; - label: string; - templateId: string; - isRequired: boolean; - isConditional: boolean; - sampleValue: string | null; - }[]; - updatedBy: { - id: string; - email: string; - name: string | null; - } | null; - } & { - id: string; - name: string; - createdAt: Date; - updatedAt: Date; - category: import(".prisma/client").$Enums.EmailTemplateCategory; - key: string; - isActive: boolean; - description: string | null; - subjectLine: string; - htmlContent: string; - textContent: string; - isSystem: boolean; - createdByUserId: string; - updatedByUserId: string | null; - }>; - /** - * Get template by key - */ - getByKey(key: string): Promise<({ - variables: { - type: import(".prisma/client").$Enums.EmailTemplateVariableType; - id: string; - videoId: number | null; - key: string; - description: string | null; - sortOrder: number; - label: string; - templateId: string; - isRequired: boolean; - isConditional: boolean; - sampleValue: string | null; - }[]; - } & { - id: string; - name: string; - createdAt: Date; - updatedAt: Date; - category: import(".prisma/client").$Enums.EmailTemplateCategory; - key: string; - isActive: boolean; - description: string | null; - subjectLine: string; - htmlContent: string; - textContent: string; - isSystem: boolean; - createdByUserId: string; - updatedByUserId: string | null; - }) | null>; - /** - * Create a new email template - */ - create(data: CreateEmailTemplateDto, userId: string): Promise<{ - variables: { - type: import(".prisma/client").$Enums.EmailTemplateVariableType; - id: string; - videoId: number | null; - key: string; - description: string | null; - sortOrder: number; - label: string; - templateId: string; - isRequired: boolean; - isConditional: boolean; - sampleValue: string | null; - }[]; - } & { - id: string; - name: string; - createdAt: Date; - updatedAt: Date; - category: import(".prisma/client").$Enums.EmailTemplateCategory; - key: string; - isActive: boolean; - description: string | null; - subjectLine: string; - htmlContent: string; - textContent: string; - isSystem: boolean; - createdByUserId: string; - updatedByUserId: string | null; - }>; - /** - * Update an email template - */ - update(id: string, data: UpdateEmailTemplateDto, userId: string): Promise<{ - variables: { - type: import(".prisma/client").$Enums.EmailTemplateVariableType; - id: string; - videoId: number | null; - key: string; - description: string | null; - sortOrder: number; - label: string; - templateId: string; - isRequired: boolean; - isConditional: boolean; - sampleValue: string | null; - }[]; - } & { - id: string; - name: string; - createdAt: Date; - updatedAt: Date; - category: import(".prisma/client").$Enums.EmailTemplateCategory; - key: string; - isActive: boolean; - description: string | null; - subjectLine: string; - htmlContent: string; - textContent: string; - isSystem: boolean; - createdByUserId: string; - updatedByUserId: string | null; - }>; - /** - * Delete an email template - */ - delete(id: string): Promise; - /** - * Get version history for a template - */ - getVersions(templateId: string): Promise<({ - createdBy: { - id: string; - email: string; - name: string | null; - }; - } & { - id: string; - createdAt: Date; - subjectLine: string; - htmlContent: string; - textContent: string; - createdByUserId: string; - versionNumber: number; - changeNotes: string | null; - templateId: string; - })[]>; - /** - * Get a specific version - */ - getVersion(templateId: string, versionNumber: number): Promise<{ - createdBy: { - id: string; - email: string; - name: string | null; - }; - } & { - id: string; - createdAt: Date; - subjectLine: string; - htmlContent: string; - textContent: string; - createdByUserId: string; - versionNumber: number; - changeNotes: string | null; - templateId: string; - }>; - /** - * Rollback to a previous version - */ - rollbackToVersion(templateId: string, data: RollbackToVersionDto, userId: string): Promise<{ - id: string; - name: string; - createdAt: Date; - updatedAt: Date; - category: import(".prisma/client").$Enums.EmailTemplateCategory; - key: string; - isActive: boolean; - description: string | null; - subjectLine: string; - htmlContent: string; - textContent: string; - isSystem: boolean; - createdByUserId: string; - updatedByUserId: string | null; - }>; - /** - * Validate template syntax - */ - validateTemplate(data: ValidateTemplateDto): ValidationResult; - /** - * Send test email - */ - sendTestEmail(templateId: string, data: SendTestEmailDto, userId: string): Promise<{ - success: boolean; - messageId: string | undefined; - }>; - /** - * Get test logs for a template - */ - getTestLogs(templateId: string, limit?: number): Promise<({ - sentBy: { - id: string; - email: string; - name: string | null; - }; - } & { - id: string; - success: boolean; - messageId: string | null; - recipientEmail: string; - sentAt: Date; - templateId: string; - testData: Prisma.JsonValue; - errorMessage: string | null; - sentByUserId: string; - })[]>; -} -export declare const emailTemplatesService: EmailTemplatesService; -export {}; -//# sourceMappingURL=email-templates.service.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/email-templates/email-templates.service.d.ts.map b/api/dist/modules/email-templates/email-templates.service.d.ts.map deleted file mode 100644 index 14baacda..00000000 --- a/api/dist/modules/email-templates/email-templates.service.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"email-templates.service.d.ts","sourceRoot":"","sources":["../../../src/modules/email-templates/email-templates.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,KAAK,EACV,qBAAqB,EACrB,sBAAsB,EACtB,sBAAsB,EACtB,oBAAoB,EACpB,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,2BAA2B,CAAC;AAMnC,UAAU,0BAA0B;IAClC,SAAS,EAAE,GAAG,EAAE,CAAC;IACjB,UAAU,EAAE;QACV,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;CACH;AAED,UAAU,gBAAgB;IACxB,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC/B;AAED,qBAAa,qBAAqB;IAChC;;OAEG;IACG,IAAI,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAuD9E;;OAEG;IACG,OAAO,CAAC,EAAE,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA6BxB;;OAEG;IACG,QAAQ,CAAC,GAAG,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAa1B;;OAEG;IACG,MAAM,CAAC,IAAI,EAAE,sBAAsB,EAAE,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAsEzD;;OAEG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,sBAAsB,EAAE,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA8ErE;;OAEG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM;IAiBvB;;OAEG;IACG,WAAW,CAAC,UAAU,EAAE,MAAM;;;;;;;;;;;;;;;;;IAcpC;;OAEG;IACG,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM;;;;;;;;;;;;;;;;;IAsB1D;;OAEG;IACG,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAoB,EAAE,MAAM,EAAE,MAAM;;;;;;;;;;;;;;;;IAgDtF;;OAEG;IACH,gBAAgB,CAAC,IAAI,EAAE,mBAAmB,GAAG,gBAAgB;IA2D7D;;OAEG;IACG,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM;;;;IAmE9E;;OAEG;IACG,WAAW,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,SAAK;;;;;;;;;;;;;;;;;CAcjD;AAED,eAAO,MAAM,qBAAqB,uBAA8B,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/email-templates/email-templates.service.js b/api/dist/modules/email-templates/email-templates.service.js deleted file mode 100644 index 2f077733..00000000 --- a/api/dist/modules/email-templates/email-templates.service.js +++ /dev/null @@ -1,467 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.emailTemplatesService = exports.EmailTemplatesService = void 0; -const client_1 = require("@prisma/client"); -const logger_1 = require("../../utils/logger"); -const email_service_1 = require("../../services/email.service"); -const prisma = new client_1.PrismaClient(); -class EmailTemplatesService { - /** - * List email templates with pagination, search, and filters - */ - async list(params) { - const { page, limit, search, category, isActive } = params; - const skip = (page - 1) * limit; - // Build where clause - const where = { - ...(search && { - OR: [ - { key: { contains: search, mode: 'insensitive' } }, - { name: { contains: search, mode: 'insensitive' } }, - { description: { contains: search, mode: 'insensitive' } }, - ], - }), - ...(category && { category }), - ...(isActive !== undefined && { isActive }), - }; - const [data, total] = await Promise.all([ - prisma.emailTemplate.findMany({ - where, - skip, - take: limit, - orderBy: [{ isSystem: 'desc' }, { category: 'asc' }, { name: 'asc' }], - include: { - variables: { - orderBy: { sortOrder: 'asc' }, - }, - _count: { - select: { - versions: true, - testLogs: true, - }, - }, - createdBy: { - select: { id: true, name: true, email: true }, - }, - updatedBy: { - select: { id: true, name: true, email: true }, - }, - }, - }), - prisma.emailTemplate.count({ where }), - ]); - return { - templates: data, - pagination: { - page, - limit, - total, - totalPages: Math.ceil(total / limit), - }, - }; - } - /** - * Get a single email template by ID - */ - async getById(id) { - const template = await prisma.emailTemplate.findUnique({ - where: { id }, - include: { - variables: { - orderBy: { sortOrder: 'asc' }, - }, - _count: { - select: { - versions: true, - testLogs: true, - }, - }, - createdBy: { - select: { id: true, name: true, email: true }, - }, - updatedBy: { - select: { id: true, name: true, email: true }, - }, - }, - }); - if (!template) { - throw new Error('Template not found'); - } - return template; - } - /** - * Get template by key - */ - async getByKey(key) { - const template = await prisma.emailTemplate.findUnique({ - where: { key }, - include: { - variables: { - orderBy: { sortOrder: 'asc' }, - }, - }, - }); - return template; - } - /** - * Create a new email template - */ - async create(data, userId) { - // Check for duplicate key - const existing = await prisma.emailTemplate.findUnique({ - where: { key: data.key }, - }); - if (existing) { - throw new Error(`Template with key "${data.key}" already exists`); - } - // Validate template content - const validation = this.validateTemplate({ - htmlContent: data.htmlContent, - textContent: data.textContent, - subjectLine: data.subjectLine, - }); - if (!validation.valid) { - throw new Error(`Template validation failed: ${validation.errors.join(', ')}`); - } - // Create template with variables and initial version in transaction - const template = await prisma.$transaction(async (tx) => { - const newTemplate = await tx.emailTemplate.create({ - data: { - key: data.key, - name: data.name, - description: data.description, - category: data.category, - subjectLine: data.subjectLine, - htmlContent: data.htmlContent, - textContent: data.textContent, - isSystem: false, // User-created templates are never system templates - isActive: data.isActive ?? true, - createdByUserId: userId, - variables: data.variables - ? { - create: data.variables, - } - : undefined, - }, - include: { - variables: true, - }, - }); - // Create initial version - await tx.emailTemplateVersion.create({ - data: { - templateId: newTemplate.id, - versionNumber: 1, - subjectLine: data.subjectLine, - htmlContent: data.htmlContent, - textContent: data.textContent, - changeNotes: 'Initial version', - createdByUserId: userId, - }, - }); - return newTemplate; - }); - logger_1.logger.info(`Email template created: ${template.key} by user ${userId}`); - // Clear email service cache for this template - email_service_1.emailService.clearDatabaseCache(template.key); - return template; - } - /** - * Update an email template - */ - async update(id, data, userId) { - const existing = await this.getById(id); - // Validate template content if provided - if (data.htmlContent || data.textContent) { - const validation = this.validateTemplate({ - htmlContent: data.htmlContent ?? existing.htmlContent, - textContent: data.textContent ?? existing.textContent, - subjectLine: data.subjectLine ?? existing.subjectLine, - }); - if (!validation.valid) { - throw new Error(`Template validation failed: ${validation.errors.join(', ')}`); - } - } - // Update template and create new version if content changed - const template = await prisma.$transaction(async (tx) => { - // Update template - const updated = await tx.emailTemplate.update({ - where: { id }, - data: { - ...(data.name && { name: data.name }), - ...(data.description !== undefined && { description: data.description }), - ...(data.category && { category: data.category }), - ...(data.subjectLine && { subjectLine: data.subjectLine }), - ...(data.htmlContent && { htmlContent: data.htmlContent }), - ...(data.textContent && { textContent: data.textContent }), - ...(data.isActive !== undefined && { isActive: data.isActive }), - updatedByUserId: userId, - // Handle variables update - ...(data.variables && { - variables: { - deleteMany: {}, - create: data.variables, - }, - }), - }, - include: { - variables: true, - }, - }); - // Create new version if content changed - if (data.subjectLine || data.htmlContent || data.textContent) { - const latestVersion = await tx.emailTemplateVersion.findFirst({ - where: { templateId: id }, - orderBy: { versionNumber: 'desc' }, - }); - const nextVersionNumber = (latestVersion?.versionNumber ?? 0) + 1; - await tx.emailTemplateVersion.create({ - data: { - templateId: id, - versionNumber: nextVersionNumber, - subjectLine: data.subjectLine ?? existing.subjectLine, - htmlContent: data.htmlContent ?? existing.htmlContent, - textContent: data.textContent ?? existing.textContent, - changeNotes: `Updated via admin interface`, - createdByUserId: userId, - }, - }); - logger_1.logger.info(`Created version ${nextVersionNumber} for template ${existing.key}`); - } - return updated; - }); - logger_1.logger.info(`Email template updated: ${existing.key} by user ${userId}`); - // Clear email service cache - email_service_1.emailService.clearDatabaseCache(existing.key); - return template; - } - /** - * Delete an email template - */ - async delete(id) { - const existing = await this.getById(id); - if (existing.isSystem) { - throw new Error('Cannot delete system templates'); - } - await prisma.emailTemplate.delete({ - where: { id }, - }); - logger_1.logger.info(`Email template deleted: ${existing.key}`); - // Clear email service cache - email_service_1.emailService.clearDatabaseCache(existing.key); - } - /** - * Get version history for a template - */ - async getVersions(templateId) { - const versions = await prisma.emailTemplateVersion.findMany({ - where: { templateId }, - orderBy: { versionNumber: 'desc' }, - include: { - createdBy: { - select: { id: true, name: true, email: true }, - }, - }, - }); - return versions; - } - /** - * Get a specific version - */ - async getVersion(templateId, versionNumber) { - const version = await prisma.emailTemplateVersion.findUnique({ - where: { - templateId_versionNumber: { - templateId, - versionNumber, - }, - }, - include: { - createdBy: { - select: { id: true, name: true, email: true }, - }, - }, - }); - if (!version) { - throw new Error('Version not found'); - } - return version; - } - /** - * Rollback to a previous version - */ - async rollbackToVersion(templateId, data, userId) { - const template = await this.getById(templateId); - const targetVersion = await this.getVersion(templateId, data.versionNumber); - // Create new version with content from target version - const result = await prisma.$transaction(async (tx) => { - const latestVersion = await tx.emailTemplateVersion.findFirst({ - where: { templateId }, - orderBy: { versionNumber: 'desc' }, - }); - const nextVersionNumber = (latestVersion?.versionNumber ?? 0) + 1; - // Update template to target version content - const updated = await tx.emailTemplate.update({ - where: { id: templateId }, - data: { - subjectLine: targetVersion.subjectLine, - htmlContent: targetVersion.htmlContent, - textContent: targetVersion.textContent, - updatedByUserId: userId, - }, - }); - // Create new version (rollback creates a new version, doesn't revert history) - await tx.emailTemplateVersion.create({ - data: { - templateId, - versionNumber: nextVersionNumber, - subjectLine: targetVersion.subjectLine, - htmlContent: targetVersion.htmlContent, - textContent: targetVersion.textContent, - changeNotes: data.changeNotes ?? `Rolled back to version ${data.versionNumber}`, - createdByUserId: userId, - }, - }); - return updated; - }); - logger_1.logger.info(`Template ${template.key} rolled back to version ${data.versionNumber} by user ${userId}`); - // Clear email service cache - email_service_1.emailService.clearDatabaseCache(template.key); - return result; - } - /** - * Validate template syntax - */ - validateTemplate(data) { - const errors = []; - const warnings = []; - const variables = new Set(); - // Extract variables from content - const variableRegex = /\{\{([A-Z_]+)\}\}/g; - const conditionalRegex = /\{\{#if\s+([A-Z_]+)\}\}|\{\{\/if\}\}/g; - // Check HTML content - let match; - while ((match = variableRegex.exec(data.htmlContent)) !== null) { - variables.add(match[1]); - } - while ((match = conditionalRegex.exec(data.htmlContent)) !== null) { - if (match[1]) - variables.add(match[1]); - } - // Check text content - while ((match = variableRegex.exec(data.textContent)) !== null) { - variables.add(match[1]); - } - while ((match = conditionalRegex.exec(data.textContent)) !== null) { - if (match[1]) - variables.add(match[1]); - } - // Check subject line if provided - if (data.subjectLine) { - while ((match = variableRegex.exec(data.subjectLine)) !== null) { - variables.add(match[1]); - } - } - // Check for unmatched conditionals - const ifCount = (data.htmlContent.match(/\{\{#if/g) || []).length; - const endifCount = (data.htmlContent.match(/\{\{\/if\}\}/g) || []).length; - if (ifCount !== endifCount) { - errors.push('Unmatched {{#if}} conditional blocks in HTML content'); - } - const ifCountText = (data.textContent.match(/\{\{#if/g) || []).length; - const endifCountText = (data.textContent.match(/\{\{\/if\}\}/g) || []).length; - if (ifCountText !== endifCountText) { - errors.push('Unmatched {{#if}} conditional blocks in text content'); - } - // Warn if no variables found - if (variables.size === 0) { - warnings.push('No template variables found'); - } - return { - valid: errors.length === 0, - errors, - warnings, - extractedVariables: Array.from(variables), - }; - } - /** - * Send test email - */ - async sendTestEmail(templateId, data, userId) { - const template = await this.getById(templateId); - try { - // Process template with test data - let htmlContent = template.htmlContent; - let textContent = template.textContent; - let subjectLine = template.subjectLine; - // Replace variables - for (const [key, value] of Object.entries(data.testData)) { - const regex = new RegExp(`\\{\\{${key}\\}\\}`, 'g'); - htmlContent = htmlContent.replace(regex, value); - textContent = textContent.replace(regex, value); - subjectLine = subjectLine.replace(regex, value); - } - // Handle conditionals (simple implementation) - for (const [key, value] of Object.entries(data.testData)) { - const ifRegex = new RegExp(`\\{\\{#if\\s+${key}\\}\\}([\\s\\S]*?)\\{\\{\\/if\\}\\}`, 'g'); - const shouldShow = value && value !== 'false' && value !== '0'; - htmlContent = htmlContent.replace(ifRegex, shouldShow ? '$1' : ''); - textContent = textContent.replace(ifRegex, shouldShow ? '$1' : ''); - } - // Send email via email service - const result = await email_service_1.emailService.sendEmail({ - to: data.recipientEmail, - subject: subjectLine, - text: textContent, - html: htmlContent, - }); - // Log test email - await prisma.emailTemplateTestLog.create({ - data: { - templateId, - recipientEmail: data.recipientEmail, - testData: data.testData, - success: true, - messageId: result.messageId, - sentByUserId: userId, - }, - }); - logger_1.logger.info(`Test email sent for template ${template.key} to ${data.recipientEmail}`); - return { success: true, messageId: result.messageId }; - } - catch (error) { - // Log failed test - await prisma.emailTemplateTestLog.create({ - data: { - templateId, - recipientEmail: data.recipientEmail, - testData: data.testData, - success: false, - errorMessage: error instanceof Error ? error.message : String(error), - sentByUserId: userId, - }, - }); - logger_1.logger.error(`Test email failed for template ${template.key}: ${error}`); - throw error; - } - } - /** - * Get test logs for a template - */ - async getTestLogs(templateId, limit = 10) { - const logs = await prisma.emailTemplateTestLog.findMany({ - where: { templateId }, - orderBy: { sentAt: 'desc' }, - take: limit, - include: { - sentBy: { - select: { id: true, name: true, email: true }, - }, - }, - }); - return logs; - } -} -exports.EmailTemplatesService = EmailTemplatesService; -exports.emailTemplatesService = new EmailTemplatesService(); -//# sourceMappingURL=email-templates.service.js.map \ No newline at end of file diff --git a/api/dist/modules/email-templates/email-templates.service.js.map b/api/dist/modules/email-templates/email-templates.service.js.map deleted file mode 100644 index 6de318b8..00000000 --- a/api/dist/modules/email-templates/email-templates.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"email-templates.service.js","sourceRoot":"","sources":["../../../src/modules/email-templates/email-templates.service.ts"],"names":[],"mappings":";;;AAAA,2CAAsD;AAStD,+CAA4C;AAC5C,gEAA4D;AAE5D,MAAM,MAAM,GAAG,IAAI,qBAAY,EAAE,CAAC;AAmBlC,MAAa,qBAAqB;IAChC;;OAEG;IACH,KAAK,CAAC,IAAI,CAAC,MAA6B;QACtC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC;QAC3D,MAAM,IAAI,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC;QAEhC,qBAAqB;QACrB,MAAM,KAAK,GAAmC;YAC5C,GAAG,CAAC,MAAM,IAAI;gBACZ,EAAE,EAAE;oBACF,EAAE,GAAG,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,aAAiC,EAAE,EAAE;oBACtE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,aAAiC,EAAE,EAAE;oBACvE,EAAE,WAAW,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,aAAiC,EAAE,EAAE;iBAC/E;aACF,CAAC;YACF,GAAG,CAAC,QAAQ,IAAI,EAAE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E,KAAK;oBACd,YAAY,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;oBACpE,YAAY,EAAE,MAAM;iBACrB;aACF,CAAC,CAAC;YAEH,eAAM,CAAC,KAAK,CAAC,kCAAkC,QAAQ,CAAC,GAAG,KAAK,KAAK,EAAE,CAAC,CAAC;YAEzE,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,WAAW,CAAC,UAAkB,EAAE,KAAK,GAAG,EAAE;QAC9C,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,oBAAoB,CAAC,QAAQ,CAAC;YACtD,KAAK,EAAE,EAAE,UAAU,EAAE;YACrB,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE;YAC3B,IAAI,EAAE,KAAK;YACX,OAAO,EAAE;gBACP,MAAM,EAAE;oBACN,MAAM,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE;iBAC9C;aACF;SACF,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC;IACd,CAAC;CACF;AA3gBD,sDA2gBC;AAEY,QAAA,qBAAqB,GAAG,IAAI,qBAAqB,EAAE,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/influence/campaign-emails/campaign-emails.routes.d.ts b/api/dist/modules/influence/campaign-emails/campaign-emails.routes.d.ts deleted file mode 100644 index b9e39364..00000000 --- a/api/dist/modules/influence/campaign-emails/campaign-emails.routes.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -declare const publicRouter: import("express-serve-static-core").Router; -declare const adminRouter: import("express-serve-static-core").Router; -export { publicRouter as campaignEmailsPublicRouter, adminRouter as campaignEmailsAdminRouter }; -//# sourceMappingURL=campaign-emails.routes.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/influence/campaign-emails/campaign-emails.routes.d.ts.map b/api/dist/modules/influence/campaign-emails/campaign-emails.routes.d.ts.map deleted file mode 100644 index bea4f649..00000000 --- a/api/dist/modules/influence/campaign-emails/campaign-emails.routes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"campaign-emails.routes.d.ts","sourceRoot":"","sources":["../../../../src/modules/influence/campaign-emails/campaign-emails.routes.ts"],"names":[],"mappings":"AAcA,QAAA,MAAM,YAAY,4CAAW,CAAC;AAqC9B,QAAA,MAAM,WAAW,4CAAW,CAAC;AAiC7B,OAAO,EAAE,YAAY,IAAI,0BAA0B,EAAE,WAAW,IAAI,yBAAyB,EAAE,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/influence/campaign-emails/campaign-emails.routes.js b/api/dist/modules/influence/campaign-emails/campaign-emails.routes.js deleted file mode 100644 index 48b0bb4d..00000000 --- a/api/dist/modules/influence/campaign-emails/campaign-emails.routes.js +++ /dev/null @@ -1,66 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.campaignEmailsAdminRouter = exports.campaignEmailsPublicRouter = void 0; -const express_1 = require("express"); -const campaign_emails_service_1 = require("./campaign-emails.service"); -const campaign_emails_schemas_1 = require("./campaign-emails.schemas"); -const validate_1 = require("../../../middleware/validate"); -const auth_middleware_1 = require("../../../middleware/auth.middleware"); -const rbac_middleware_1 = require("../../../middleware/rbac.middleware"); -const rate_limit_1 = require("../../../middleware/rate-limit"); -const roles_1 = require("../../../utils/roles"); -// --- Public Routes (no auth) --- -const publicRouter = (0, express_1.Router)(); -exports.campaignEmailsPublicRouter = publicRouter; -// POST /api/campaigns/:slug/send-email -publicRouter.post('/:slug/send-email', rate_limit_1.emailRateLimit, (0, validate_1.validate)(campaign_emails_schemas_1.sendCampaignEmailSchema), async (req, res, next) => { - try { - const slug = req.params.slug; - const senderIp = req.ip || req.socket.remoteAddress; - const result = await campaign_emails_service_1.campaignEmailsService.sendEmail(slug, req.body, senderIp); - res.status(201).json(result); - } - catch (err) { - next(err); - } -}); -// POST /api/campaigns/:slug/track-mailto -publicRouter.post('/:slug/track-mailto', rate_limit_1.emailRateLimit, (0, validate_1.validate)(campaign_emails_schemas_1.trackMailtoSchema), async (req, res, next) => { - try { - const slug = req.params.slug; - const senderIp = req.ip || req.socket.remoteAddress; - const result = await campaign_emails_service_1.campaignEmailsService.trackMailto(slug, req.body, senderIp); - res.status(201).json(result); - } - catch (err) { - next(err); - } -}); -// --- Admin Routes (auth required) --- -const adminRouter = (0, express_1.Router)(); -exports.campaignEmailsAdminRouter = adminRouter; -adminRouter.use(auth_middleware_1.authenticate); -adminRouter.use((0, rbac_middleware_1.requireRole)(...roles_1.INFLUENCE_ROLES)); -// GET /api/campaigns/:id/emails -adminRouter.get('/:id/emails', (0, validate_1.validate)(campaign_emails_schemas_1.listCampaignEmailsSchema, 'query'), async (req, res, next) => { - try { - const id = req.params.id; - const result = await campaign_emails_service_1.campaignEmailsService.listByCampaign(id, req.query); - res.json(result); - } - catch (err) { - next(err); - } -}); -// GET /api/campaigns/:id/email-stats -adminRouter.get('/:id/email-stats', async (req, res, next) => { - try { - const id = req.params.id; - const stats = await campaign_emails_service_1.campaignEmailsService.getStats(id); - res.json(stats); - } - catch (err) { - next(err); - } -}); -//# sourceMappingURL=campaign-emails.routes.js.map \ No newline at end of file diff --git a/api/dist/modules/influence/campaign-emails/campaign-emails.routes.js.map b/api/dist/modules/influence/campaign-emails/campaign-emails.routes.js.map deleted file mode 100644 index bb6a00e3..00000000 --- a/api/dist/modules/influence/campaign-emails/campaign-emails.routes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"campaign-emails.routes.js","sourceRoot":"","sources":["../../../../src/modules/influence/campaign-emails/campaign-emails.routes.ts"],"names":[],"mappings":";;;AAAA,qCAAkE;AAClE,uEAAkE;AAClE,uEAImC;AACnC,2DAAwD;AACxD,yEAAmE;AACnE,yEAAkE;AAClE,+DAAgE;AAChE,gDAAuD;AAEvD,kCAAkC;AAClC,MAAM,YAAY,GAAG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api/dist/modules/influence/campaign-emails/campaign-emails.schemas.d.ts b/api/dist/modules/influence/campaign-emails/campaign-emails.schemas.d.ts deleted file mode 100644 index 99b23e6a..00000000 --- a/api/dist/modules/influence/campaign-emails/campaign-emails.schemas.d.ts +++ /dev/null @@ -1,116 +0,0 @@ -import { z } from 'zod'; -export declare const sendCampaignEmailSchema: z.ZodObject<{ - userEmail: z.ZodString; - userName: z.ZodString; - postalCode: z.ZodString; - recipientEmail: z.ZodString; - recipientName: z.ZodOptional; - recipientTitle: z.ZodOptional; - recipientLevel: z.ZodOptional>; - emailMethod: z.ZodNativeEnum<{ - SMTP: "SMTP"; - MAILTO: "MAILTO"; - }>; - customEmailSubject: z.ZodOptional; - customEmailBody: z.ZodOptional; -}, "strip", z.ZodTypeAny, { - userEmail: string; - userName: string; - recipientEmail: string; - emailMethod: "SMTP" | "MAILTO"; - postalCode: string; - recipientName?: string | undefined; - recipientTitle?: string | undefined; - recipientLevel?: "FEDERAL" | "PROVINCIAL" | "MUNICIPAL" | "SCHOOL_BOARD" | undefined; - customEmailSubject?: string | undefined; - customEmailBody?: string | undefined; -}, { - userEmail: string; - userName: string; - recipientEmail: string; - emailMethod: "SMTP" | "MAILTO"; - postalCode: string; - recipientName?: string | undefined; - recipientTitle?: string | undefined; - recipientLevel?: "FEDERAL" | "PROVINCIAL" | "MUNICIPAL" | "SCHOOL_BOARD" | undefined; - customEmailSubject?: string | undefined; - customEmailBody?: string | undefined; -}>; -export declare const trackMailtoSchema: z.ZodObject<{ - recipientEmail: z.ZodString; - recipientName: z.ZodOptional; - recipientTitle: z.ZodOptional; - recipientLevel: z.ZodOptional>; - userEmail: z.ZodOptional; - userName: z.ZodOptional; - postalCode: z.ZodOptional; -}, "strip", z.ZodTypeAny, { - recipientEmail: string; - userEmail?: string | undefined; - userName?: string | undefined; - recipientName?: string | undefined; - recipientTitle?: string | undefined; - recipientLevel?: "FEDERAL" | "PROVINCIAL" | "MUNICIPAL" | "SCHOOL_BOARD" | undefined; - postalCode?: string | undefined; -}, { - recipientEmail: string; - userEmail?: string | undefined; - userName?: string | undefined; - recipientName?: string | undefined; - recipientTitle?: string | undefined; - recipientLevel?: "FEDERAL" | "PROVINCIAL" | "MUNICIPAL" | "SCHOOL_BOARD" | undefined; - postalCode?: string | undefined; -}>; -export declare const listCampaignEmailsSchema: z.ZodObject<{ - page: z.ZodDefault; - limit: z.ZodDefault; - status: z.ZodOptional>; - emailMethod: z.ZodOptional>; -}, "strip", z.ZodTypeAny, { - limit: number; - page: number; - status?: "QUEUED" | "SENT" | "FAILED" | "CLICKED" | "USER_INFO_CAPTURED" | undefined; - emailMethod?: "SMTP" | "MAILTO" | undefined; -}, { - status?: "QUEUED" | "SENT" | "FAILED" | "CLICKED" | "USER_INFO_CAPTURED" | undefined; - limit?: number | undefined; - page?: number | undefined; - emailMethod?: "SMTP" | "MAILTO" | undefined; -}>; -export declare const campaignSlugParamSchema: z.ZodObject<{ - slug: z.ZodString; -}, "strip", z.ZodTypeAny, { - slug: string; -}, { - slug: string; -}>; -export declare const campaignIdParamSchema: z.ZodObject<{ - id: z.ZodString; -}, "strip", z.ZodTypeAny, { - id: string; -}, { - id: string; -}>; -export type SendCampaignEmailInput = z.infer; -export type TrackMailtoInput = z.infer; -export type ListCampaignEmailsInput = z.infer; -//# sourceMappingURL=campaign-emails.schemas.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/influence/campaign-emails/campaign-emails.schemas.d.ts.map b/api/dist/modules/influence/campaign-emails/campaign-emails.schemas.d.ts.map deleted file mode 100644 index 39bdad4b..00000000 --- a/api/dist/modules/influence/campaign-emails/campaign-emails.schemas.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"campaign-emails.schemas.d.ts","sourceRoot":"","sources":["../../../../src/modules/influence/campaign-emails/campaign-emails.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWlC,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQ5B,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;EAKnC,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;EAElC,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;EAEhC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAC7E,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AACjE,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/influence/campaign-emails/campaign-emails.schemas.js b/api/dist/modules/influence/campaign-emails/campaign-emails.schemas.js deleted file mode 100644 index f234c9cd..00000000 --- a/api/dist/modules/influence/campaign-emails/campaign-emails.schemas.js +++ /dev/null @@ -1,39 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.campaignIdParamSchema = exports.campaignSlugParamSchema = exports.listCampaignEmailsSchema = exports.trackMailtoSchema = exports.sendCampaignEmailSchema = void 0; -const zod_1 = require("zod"); -const client_1 = require("@prisma/client"); -exports.sendCampaignEmailSchema = zod_1.z.object({ - userEmail: zod_1.z.string().email('Valid email is required'), - userName: zod_1.z.string().min(1, 'Name is required'), - postalCode: zod_1.z.string().min(1, 'Postal code is required'), - recipientEmail: zod_1.z.string().email('Valid recipient email is required'), - recipientName: zod_1.z.string().optional(), - recipientTitle: zod_1.z.string().optional(), - recipientLevel: zod_1.z.nativeEnum(client_1.GovernmentLevel).optional(), - emailMethod: zod_1.z.nativeEnum(client_1.EmailMethod), - customEmailSubject: zod_1.z.string().optional(), - customEmailBody: zod_1.z.string().optional(), -}); -exports.trackMailtoSchema = zod_1.z.object({ - recipientEmail: zod_1.z.string().email('Valid recipient email is required'), - recipientName: zod_1.z.string().optional(), - recipientTitle: zod_1.z.string().optional(), - recipientLevel: zod_1.z.nativeEnum(client_1.GovernmentLevel).optional(), - userEmail: zod_1.z.string().email().optional(), - userName: zod_1.z.string().optional(), - postalCode: zod_1.z.string().optional(), -}); -exports.listCampaignEmailsSchema = zod_1.z.object({ - page: zod_1.z.coerce.number().int().positive().default(1), - limit: zod_1.z.coerce.number().int().positive().max(100).default(20), - status: zod_1.z.nativeEnum(client_1.CampaignEmailStatus).optional(), - emailMethod: zod_1.z.nativeEnum(client_1.EmailMethod).optional(), -}); -exports.campaignSlugParamSchema = zod_1.z.object({ - slug: zod_1.z.string().min(1), -}); -exports.campaignIdParamSchema = zod_1.z.object({ - id: zod_1.z.string().min(1), -}); -//# sourceMappingURL=campaign-emails.schemas.js.map \ No newline at end of file diff --git a/api/dist/modules/influence/campaign-emails/campaign-emails.schemas.js.map b/api/dist/modules/influence/campaign-emails/campaign-emails.schemas.js.map deleted file mode 100644 index 6f6765ad..00000000 --- a/api/dist/modules/influence/campaign-emails/campaign-emails.schemas.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"campaign-emails.schemas.js","sourceRoot":"","sources":["../../../../src/modules/influence/campaign-emails/campaign-emails.schemas.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,2CAAmF;AAEtE,QAAA,uBAAuB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC9C,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,yBAAyB,CAAC;IACtD,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,kBAAkB,CAAC;IAC/C,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,yBAAyB,CAAC;IACxD,cAAc,EAAE,OAAC,CAAC,MA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C,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IAC9D,MAAM,EAAE,OAAC,CAAC,UAAU,CAAC,4BAAmB,CAAC,CAAC,QAAQ,EAAE;IACpD,WAAW,EAAE,OAAC,CAAC,UAAU,CAAC,oBAAW,CAAC,CAAC,QAAQ,EAAE;CAClD,CAAC,CAAC;AAEU,QAAA,uBAAuB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC9C,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CACxB,CAAC,CAAC;AAEU,QAAA,qBAAqB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC5C,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CACtB,CAAC,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/influence/campaign-emails/campaign-emails.service.d.ts b/api/dist/modules/influence/campaign-emails/campaign-emails.service.d.ts deleted file mode 100644 index 4eb36910..00000000 --- a/api/dist/modules/influence/campaign-emails/campaign-emails.service.d.ts +++ /dev/null @@ -1,36 +0,0 @@ -import type { SendCampaignEmailInput, TrackMailtoInput, ListCampaignEmailsInput } from './campaign-emails.schemas'; -export declare const campaignEmailsService: { - sendEmail(slug: string, data: SendCampaignEmailInput, senderIp?: string): Promise<{ - id: string; - status: import(".prisma/client").$Enums.CampaignEmailStatus; - emailMethod: import(".prisma/client").$Enums.EmailMethod; - }>; - trackMailto(slug: string, data: TrackMailtoInput, senderIp?: string): Promise<{ - id: string; - status: import(".prisma/client").$Enums.CampaignEmailStatus; - emailMethod: import(".prisma/client").$Enums.EmailMethod; - }>; - listByCampaign(campaignId: string, filters: ListCampaignEmailsInput): Promise<{ - emails: { - status: import(".prisma/client").$Enums.CampaignEmailStatus; - id: string; - subject: string; - userEmail: string | null; - userName: string | null; - userPostalCode: string | null; - recipientEmail: string; - recipientName: string | null; - recipientLevel: import(".prisma/client").$Enums.GovernmentLevel | null; - emailMethod: import(".prisma/client").$Enums.EmailMethod; - sentAt: Date; - }[]; - pagination: { - page: number; - limit: number; - total: number; - totalPages: number; - }; - }>; - getStats(campaignId: string): Promise>; -}; -//# sourceMappingURL=campaign-emails.service.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/influence/campaign-emails/campaign-emails.service.d.ts.map b/api/dist/modules/influence/campaign-emails/campaign-emails.service.d.ts.map deleted file mode 100644 index 5707e29e..00000000 --- a/api/dist/modules/influence/campaign-emails/campaign-emails.service.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"campaign-emails.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/influence/campaign-emails/campaign-emails.service.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAEnH,eAAO,MAAM,qBAAqB;oBACV,MAAM,QAAQ,sBAAsB,aAAa,MAAM;;;;;sBA+GrD,MAAM,QAAQ,gBAAgB,aAAa,MAAM;;;;;+BAwDxC,MAAM,WAAW,uBAAuB;;;;;;;;;;;;;;;;;;;;;yBA0C9C,MAAM;CAqClC,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/influence/campaign-emails/campaign-emails.service.js b/api/dist/modules/influence/campaign-emails/campaign-emails.service.js deleted file mode 100644 index 57f4c2ce..00000000 --- a/api/dist/modules/influence/campaign-emails/campaign-emails.service.js +++ /dev/null @@ -1,268 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -exports.campaignEmailsService = void 0; -const client_1 = require("@prisma/client"); -const database_1 = require("../../../config/database"); -const error_handler_1 = require("../../../middleware/error-handler"); -const email_queue_service_1 = require("../../../services/email-queue.service"); -const metrics_1 = require("../../../utils/metrics"); -const crm_activity_1 = require("../../../utils/crm-activity"); -const group_service_1 = require("../../social/group.service"); -const achievements_service_1 = require("../../social/achievements.service"); -exports.campaignEmailsService = { - async sendEmail(slug, data, senderIp) { - const campaign = await database_1.prisma.campaign.findUnique({ - where: { slug }, - select: { - id: true, - slug: true, - title: true, - status: true, - emailSubject: true, - emailBody: true, - allowSmtpEmail: true, - allowMailtoLink: true, - allowEmailEditing: true, - }, - }); - if (!campaign) { - throw new error_handler_1.AppError(404, 'Campaign not found', 'CAMPAIGN_NOT_FOUND'); - } - if (campaign.status !== client_1.CampaignStatus.ACTIVE) { - throw new error_handler_1.AppError(400, 'Campaign is not active', 'CAMPAIGN_NOT_ACTIVE'); - } - if (data.emailMethod === client_1.EmailMethod.SMTP && !campaign.allowSmtpEmail) { - throw new error_handler_1.AppError(400, 'SMTP email is not enabled for this campaign', 'SMTP_NOT_ALLOWED'); - } - if (data.emailMethod === client_1.EmailMethod.MAILTO && !campaign.allowMailtoLink) { - throw new error_handler_1.AppError(400, 'Mailto link is not enabled for this campaign', 'MAILTO_NOT_ALLOWED'); - } - // Determine subject and body (custom only if campaign allows editing) - const subject = (campaign.allowEmailEditing && data.customEmailSubject) - ? data.customEmailSubject - : campaign.emailSubject; - const message = (campaign.allowEmailEditing && data.customEmailBody) - ? data.customEmailBody - : campaign.emailBody; - const status = data.emailMethod === client_1.EmailMethod.SMTP - ? client_1.CampaignEmailStatus.QUEUED - : client_1.CampaignEmailStatus.CLICKED; - const campaignEmail = await database_1.prisma.campaignEmail.create({ - data: { - campaignId: campaign.id, - campaignSlug: campaign.slug, - userEmail: data.userEmail, - userName: data.userName, - userPostalCode: data.postalCode, - recipientEmail: data.recipientEmail, - recipientName: data.recipientName, - recipientTitle: data.recipientTitle, - recipientLevel: data.recipientLevel, - emailMethod: data.emailMethod, - subject, - message, - status, - senderIp, - }, - }); - if (data.emailMethod === client_1.EmailMethod.SMTP) { - await email_queue_service_1.emailQueueService.addCampaignEmail({ - campaignEmailId: campaignEmail.id, - recipientEmail: data.recipientEmail, - recipientName: data.recipientName, - recipientLevel: data.recipientLevel, - userEmail: data.userEmail, - userName: data.userName, - postalCode: data.postalCode, - subject, - message, - campaignTitle: campaign.title, - }); - } - (0, metrics_1.recordCampaignEmail)(campaign.id); - // CRM activity (fire-and-forget) - (0, crm_activity_1.recordCrmActivity)({ - email: data.userEmail, - activityType: 'EMAIL_SENT', - title: `Sent campaign email: ${campaign.title}`, - metadata: { campaignId: campaign.id, campaignSlug: campaign.slug, recipientEmail: data.recipientEmail, emailMethod: data.emailMethod }, - }).catch(() => { }); - // Social group sync (fire-and-forget) - group_service_1.groupService.syncCampaignTeam(campaign.id).catch(() => { }); - // Achievement check for registered users (fire-and-forget) - database_1.prisma.user.findUnique({ where: { email: data.userEmail }, select: { id: true } }) - .then((user) => { - if (user) - achievements_service_1.achievementsService.checkAndUnlock(user.id, ['campaigns']).catch(() => { }); - }) - .catch(() => { }); - // Fire-and-forget: check campaign milestones - Promise.resolve().then(() => __importStar(require('../../social/impact-stories.service'))).then(({ impactStoriesService }) => { - impactStoriesService.checkMilestones(campaign.id).catch(() => { }); - }).catch(() => { }); - return { - id: campaignEmail.id, - status: campaignEmail.status, - emailMethod: campaignEmail.emailMethod, - }; - }, - async trackMailto(slug, data, senderIp) { - const campaign = await database_1.prisma.campaign.findUnique({ - where: { slug }, - select: { - id: true, - slug: true, - title: true, - status: true, - emailSubject: true, - emailBody: true, - allowMailtoLink: true, - }, - }); - if (!campaign) { - throw new error_handler_1.AppError(404, 'Campaign not found', 'CAMPAIGN_NOT_FOUND'); - } - if (campaign.status !== client_1.CampaignStatus.ACTIVE) { - throw new error_handler_1.AppError(400, 'Campaign is not active', 'CAMPAIGN_NOT_ACTIVE'); - } - const campaignEmail = await database_1.prisma.campaignEmail.create({ - data: { - campaignId: campaign.id, - campaignSlug: campaign.slug, - userEmail: data.userEmail, - userName: data.userName, - userPostalCode: data.postalCode, - recipientEmail: data.recipientEmail, - recipientName: data.recipientName, - recipientTitle: data.recipientTitle, - recipientLevel: data.recipientLevel, - emailMethod: client_1.EmailMethod.MAILTO, - subject: campaign.emailSubject, - message: campaign.emailBody, - status: client_1.CampaignEmailStatus.CLICKED, - senderIp, - }, - }); - // Social group sync (fire-and-forget) - group_service_1.groupService.syncCampaignTeam(campaign.id).catch(() => { }); - // Fire-and-forget: check campaign milestones - Promise.resolve().then(() => __importStar(require('../../social/impact-stories.service'))).then(({ impactStoriesService }) => { - impactStoriesService.checkMilestones(campaign.id).catch(() => { }); - }).catch(() => { }); - return { - id: campaignEmail.id, - status: campaignEmail.status, - emailMethod: campaignEmail.emailMethod, - }; - }, - async listByCampaign(campaignId, filters) { - const { page, limit, status, emailMethod } = filters; - const skip = (page - 1) * limit; - const where = { campaignId }; - if (status) - where.status = status; - if (emailMethod) - where.emailMethod = emailMethod; - const [emails, total] = await Promise.all([ - database_1.prisma.campaignEmail.findMany({ - where, - skip, - take: limit, - orderBy: { sentAt: 'desc' }, - select: { - id: true, - userEmail: true, - userName: true, - userPostalCode: true, - recipientEmail: true, - recipientName: true, - recipientLevel: true, - emailMethod: true, - subject: true, - status: true, - sentAt: true, - }, - }), - database_1.prisma.campaignEmail.count({ where }), - ]); - return { - emails, - pagination: { - page, - limit, - total, - totalPages: Math.ceil(total / limit), - }, - }; - }, - async getStats(campaignId) { - const [totals, byMethod] = await Promise.all([ - database_1.prisma.campaignEmail.groupBy({ - by: ['status'], - where: { campaignId }, - _count: true, - }), - database_1.prisma.campaignEmail.groupBy({ - by: ['emailMethod'], - where: { campaignId }, - _count: true, - }), - ]); - const stats = { - total: 0, - queued: 0, - sent: 0, - failed: 0, - clicked: 0, - smtpCount: 0, - mailtoCount: 0, - }; - for (const row of totals) { - stats.total += row._count; - const key = row.status.toLowerCase(); - if (key in stats) - stats[key] = row._count; - } - for (const row of byMethod) { - if (row.emailMethod === client_1.EmailMethod.SMTP) - stats.smtpCount = row._count; - if (row.emailMethod === client_1.EmailMethod.MAILTO) - stats.mailtoCount = row._count; - } - return stats; - }, -}; -//# sourceMappingURL=campaign-emails.service.js.map \ No newline at end of file diff --git a/api/dist/modules/influence/campaign-emails/campaign-emails.service.js.map b/api/dist/modules/influence/campaign-emails/campaign-emails.service.js.map deleted file mode 100644 index f8c3984f..00000000 --- a/api/dist/modules/influence/campaign-emails/campaign-emails.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"campaign-emails.service.js","sourceRoot":"","sources":["../../../../src/modules/influence/campaign-emails/campaign-emails.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA0F;AAC1F,uDAAkD;AAClD,qEAA6D;AAC7D,+EAA0E;AAC1E,oDAA6D;AAC7D,8DAAgE;AAChE,8DAA0D;AAC1D,4EAAwE;AAG3D,QAAA,qBAAqB,GAAG;IACnC,KAAK,CAAC,SAAS,CAAC,IAAY,EAAE,IAA4B,EAAE,QAAiB;QAC3E,MAAM,QAAQ,GAAG,MAAM,iBAAM,CAAC,QAAQ,CAAC,UAAU,CAAC;YACh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GAA2B;YACpC,KAAK,EAAE,CAAC;YACR,MAAM,EAAE,CAAC;YACT,IAAI,EAAE,CAAC;YACP,MAAM,EAAE,CAAC;YACT,OAAO,EAAE,CAAC;YACV,SAAS,EAAE,CAAC;YACZ,WAAW,EAAE,CAAC;SACf,CAAC;QAEF,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;YACzB,KAAK,CAAC,KAAK,IAAI,GAAG,CAAC,MAAM,CAAC;YAC1B,MAAM,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC;YACrC,IAAI,GAAG,IAAI,KAAK;gBAAE,KAAK,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC;QAC5C,CAAC;QAED,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;YAC3B,IAAI,GAAG,CAAC,WAAW,KAAK,oBAAW,CAAC,IAAI;gBAAE,KAAK,CAAC,SAAS,GAAG,GAAG,CAAC,MAAM,CAAC;YACvE,IAAI,GAAG,CAAC,WAAW,KAAK,oBAAW,CAAC,MAAM;gBAAE,KAAK,CAAC,WAAW,GAAG,GAAG,CAAC,MAAM,CAAC;QAC7E,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;CACF,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/influence/campaigns/campaigns-public.routes.d.ts b/api/dist/modules/influence/campaigns/campaigns-public.routes.d.ts deleted file mode 100644 index 6ec1f6f8..00000000 --- a/api/dist/modules/influence/campaigns/campaigns-public.routes.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const router: import("express-serve-static-core").Router; -export { router as campaignPublicRouter }; -//# sourceMappingURL=campaigns-public.routes.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/influence/campaigns/campaigns-public.routes.d.ts.map b/api/dist/modules/influence/campaigns/campaigns-public.routes.d.ts.map deleted file mode 100644 index 4a7acbf6..00000000 --- a/api/dist/modules/influence/campaigns/campaigns-public.routes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"campaigns-public.routes.d.ts","sourceRoot":"","sources":["../../../../src/modules/influence/campaigns/campaigns-public.routes.ts"],"names":[],"mappings":"AAKA,QAAA,MAAM,MAAM,4CAAW,CAAC;AA2HxB,OAAO,EAAE,MAAM,IAAI,oBAAoB,EAAE,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/influence/campaigns/campaigns-public.routes.js b/api/dist/modules/influence/campaigns/campaigns-public.routes.js deleted file mode 100644 index 4289886e..00000000 --- a/api/dist/modules/influence/campaigns/campaigns-public.routes.js +++ /dev/null @@ -1,120 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.campaignPublicRouter = void 0; -const express_1 = require("express"); -const campaigns_service_1 = require("./campaigns.service"); -const database_1 = require("../../../config/database"); -const redis_1 = require("../../../config/redis"); -const router = (0, express_1.Router)(); -exports.campaignPublicRouter = router; -// GET /api/campaigns/public — list all active campaigns (public) -router.get('/public', async (_req, res, next) => { - try { - const campaigns = await campaigns_service_1.campaignsService.findActiveCampaigns(); - res.json(campaigns); - } - catch (err) { - next(err); - } -}); -// GET /api/campaigns/:slug/details — public campaign data (ACTIVE only) -router.get('/:slug/details', async (req, res, next) => { - try { - const slug = req.params.slug; - const campaign = await campaigns_service_1.campaignsService.findBySlugPublic(slug); - res.json(campaign); - } - catch (err) { - next(err); - } -}); -// GET /api/campaigns/:slug/related — related campaigns + upcoming shifts -router.get('/:slug/related', async (req, res, next) => { - try { - const slug = req.params.slug; - const cacheKey = `campaign:related:${slug}`; - // Check cache - try { - const cached = await redis_1.redis.get(cacheKey); - if (cached) { - res.json(JSON.parse(cached)); - return; - } - } - catch { /* cache miss */ } - // Find current campaign - const campaign = await database_1.prisma.campaign.findFirst({ - where: { slug, status: 'ACTIVE' }, - select: { id: true, targetGovernmentLevels: true }, - }); - if (!campaign) { - res.json({ campaigns: [], shifts: [] }); - return; - } - // Related campaigns: same gov levels, exclude current, limit 3 - const relatedCampaigns = await database_1.prisma.campaign.findMany({ - where: { - status: 'ACTIVE', - id: { not: campaign.id }, - ...(campaign.targetGovernmentLevels.length > 0 && { - targetGovernmentLevels: { hasSome: campaign.targetGovernmentLevels }, - }), - }, - select: { - id: true, - slug: true, - title: true, - description: true, - _count: { select: { emails: true } }, - }, - orderBy: { createdAt: 'desc' }, - take: 3, - }); - // Related shifts: upcoming, limit 3 - const today = new Date(); - today.setHours(0, 0, 0, 0); - const relatedShifts = await database_1.prisma.shift.findMany({ - where: { - date: { gte: today }, - status: 'OPEN', - }, - select: { - id: true, - title: true, - date: true, - startTime: true, - location: true, - maxVolunteers: true, - _count: { select: { signups: true } }, - }, - orderBy: { date: 'asc' }, - take: 3, - }); - const result = { - campaigns: relatedCampaigns.map(c => ({ - id: c.id, - slug: c.slug, - title: c.title, - description: c.description?.slice(0, 150) ?? null, - emailCount: c._count.emails, - })), - shifts: relatedShifts.map(s => ({ - id: s.id, - title: s.title, - startTime: `${s.date.toISOString().split('T')[0]}T${s.startTime}:00`, - location: s.location, - currentVolunteers: s._count.signups, - maxVolunteers: s.maxVolunteers, - })), - }; - try { - await redis_1.redis.setex(cacheKey, 300, JSON.stringify(result)); - } - catch { /* non-critical */ } - res.json(result); - } - catch (err) { - next(err); - } -}); -//# sourceMappingURL=campaigns-public.routes.js.map \ No newline at end of file diff --git a/api/dist/modules/influence/campaigns/campaigns-public.routes.js.map b/api/dist/modules/influence/campaigns/campaigns-public.routes.js.map deleted file mode 100644 index e6ca77bc..00000000 --- a/api/dist/modules/influence/campaigns/campaigns-public.routes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"campaigns-public.routes.js","sourceRoot":"","sources":["../../../../src/modules/influence/campaigns/campaigns-public.routes.ts"],"names":[],"mappings":";;;AAAA,qCAAkE;AAClE,2DAAuD;AACvD,uDAAkD;AAClD,iDAA8C;AAE9C,MAAM,MAAM,GAAG,IAAA,gBAAM,GAAE,CAAC;AA2HL,sCAAoB;AAzHvC,iEAAiE;A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AAM,CAAC,OAAO;gBACnC,aAAa,EAAE,CAAC,CAAC,aAAa;aAC/B,CAAC,CAAC;SACJ,CAAC;QAEF,IAAI,CAAC;YAAC,MAAM,aAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;QAAC,CAAC;QAAC,MAAM,CAAC,CAAC,kBAAkB,CAAC,CAAC;QAE9F,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACnB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,GAAG,CAAC,CAAC;IACZ,CAAC;AACH,CAAC,CACF,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/influence/campaigns/campaigns.routes.d.ts b/api/dist/modules/influence/campaigns/campaigns.routes.d.ts deleted file mode 100644 index 9c3b2dcd..00000000 --- a/api/dist/modules/influence/campaigns/campaigns.routes.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const router: import("express-serve-static-core").Router; -export { router as campaignsRouter }; -//# sourceMappingURL=campaigns.routes.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/influence/campaigns/campaigns.routes.d.ts.map b/api/dist/modules/influence/campaigns/campaigns.routes.d.ts.map deleted file mode 100644 index 6fa8a75e..00000000 --- a/api/dist/modules/influence/campaigns/campaigns.routes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"campaigns.routes.d.ts","sourceRoot":"","sources":["../../../../src/modules/influence/campaigns/campaigns.routes.ts"],"names":[],"mappings":"AAQA,QAAA,MAAM,MAAM,4CAAW,CAAC;AA6ExB,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/influence/campaigns/campaigns.routes.js b/api/dist/modules/influence/campaigns/campaigns.routes.js deleted file mode 100644 index af31fd99..00000000 --- a/api/dist/modules/influence/campaigns/campaigns.routes.js +++ /dev/null @@ -1,69 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.campaignsRouter = void 0; -const express_1 = require("express"); -const campaigns_service_1 = require("./campaigns.service"); -const campaigns_schemas_1 = require("./campaigns.schemas"); -const validate_1 = require("../../../middleware/validate"); -const auth_middleware_1 = require("../../../middleware/auth.middleware"); -const rbac_middleware_1 = require("../../../middleware/rbac.middleware"); -const roles_1 = require("../../../utils/roles"); -const router = (0, express_1.Router)(); -exports.campaignsRouter = router; -// All campaign admin routes require authentication + admin role -router.use(auth_middleware_1.authenticate); -router.use((0, rbac_middleware_1.requireRole)(...roles_1.INFLUENCE_ROLES)); -// GET /api/campaigns — list campaigns with pagination/filters -router.get('/', (0, validate_1.validate)(campaigns_schemas_1.listCampaignsSchema, 'query'), async (req, res, next) => { - try { - const result = await campaigns_service_1.campaignsService.findAll(req.query, req.user); - res.json(result); - } - catch (err) { - next(err); - } -}); -// GET /api/campaigns/:id — get single campaign -router.get('/:id', async (req, res, next) => { - try { - const id = req.params.id; - const campaign = await campaigns_service_1.campaignsService.findById(id); - res.json(campaign); - } - catch (err) { - next(err); - } -}); -// POST /api/campaigns — create campaign -router.post('/', (0, validate_1.validate)(campaigns_schemas_1.createCampaignSchema), async (req, res, next) => { - try { - const campaign = await campaigns_service_1.campaignsService.create(req.body, req.user); - res.status(201).json(campaign); - } - catch (err) { - next(err); - } -}); -// PUT /api/campaigns/:id — update campaign -router.put('/:id', (0, validate_1.validate)(campaigns_schemas_1.updateCampaignSchema), async (req, res, next) => { - try { - const id = req.params.id; - const campaign = await campaigns_service_1.campaignsService.update(id, req.body); - res.json(campaign); - } - catch (err) { - next(err); - } -}); -// DELETE /api/campaigns/:id — delete campaign -router.delete('/:id', async (req, res, next) => { - try { - const id = req.params.id; - await campaigns_service_1.campaignsService.delete(id); - res.status(204).send(); - } - catch (err) { - next(err); - } -}); -//# sourceMappingURL=campaigns.routes.js.map \ No newline at end of file diff --git a/api/dist/modules/influence/campaigns/campaigns.routes.js.map b/api/dist/modules/influence/campaigns/campaigns.routes.js.map deleted file mode 100644 index 4e04841d..00000000 --- a/api/dist/modules/influence/campaigns/campaigns.routes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"campaigns.routes.js","sourceRoot":"","sources":["../../../../src/modules/influence/campaigns/campaigns.routes.ts"],"names":[],"mappings":";;;AAAA,qCAAkE;AAClE,2DAAuD;AACvD,2DAAsG;AACtG,2DAAwD;AACxD,yEAAmE;AACnE,yEAAkE;AAClE,gDAAuD;AAEvD,MAAM,MAAM,GAAG,IAAA,gBAAM,GAAE,CAAC;AA6EL,iCAAe;AA3ElC,gEAAgE;AAChE,MAAM,CAAC,GAAG,CAAC,8BAAY,CAAC,CAAC;AACzB,MAAM,CAAC,GAAG,CAAC,IAAA,6BAAW,EAAC,GAAG,uBAAe,CAAC,CAAC,CAAC;AAE5C,8DAA8D;AAC9D,MAAM,CAAC,GAAG,CACR,GAAG,EACH,IAAA,mBAAQ,EAAC,uCAAmB,EAAE,OAAO,CAAC,EACtC,KAAK,EAAE,GAAY,EAAE,GAAa,EAAE,IAAkB,EAAE,EAAE;IACxD,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,oCAAgB,CAAC,OAAO,CAAC,GAAG,CAAC,KAAY,EAAE,GAAG,CAAC,IAAK,CAAC,CAAC;QAC3E,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACnB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,GAAG,CAAC,CAAC;IACZ,CAAC;AACH,CAAC,CACF,CAAC;AAEF,+CAA+C;AAC/C,MAAM,CAAC,GAAG,CACR,MAAM,EACN,KAAK,EAAE,GAAY,EAAE,GAAa,EAAE,IAAkB,EAAE,EAAE;IACxD,IAAI,CAAC;QACH,MAAM,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC,EAAY,CAAC;QACnC,MAAM,QAAQ,GAAG,MAAM,oCAAgB,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;Q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ACxD,IAAI,CAAC;QACH,MAAM,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC,EAAY,CAAC;QACnC,MAAM,oCAAgB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;QAClC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IACzB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,GAAG,CAAC,CAAC;IACZ,CAAC;AACH,CAAC,CACF,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/influence/campaigns/campaigns.schemas.d.ts b/api/dist/modules/influence/campaigns/campaigns.schemas.d.ts deleted file mode 100644 index 3bb7df4d..00000000 --- a/api/dist/modules/influence/campaigns/campaigns.schemas.d.ts +++ /dev/null @@ -1,261 +0,0 @@ -import { z } from 'zod'; -export declare const createCampaignSchema: z.ZodObject<{ - title: z.ZodString; - description: z.ZodOptional; - emailSubject: z.ZodString; - emailBody: z.ZodString; - callToAction: z.ZodOptional; - status: z.ZodDefault>>; - targetGovernmentLevels: z.ZodDefault, "many">>>; - allowSmtpEmail: z.ZodDefault>; - allowMailtoLink: z.ZodDefault>; - collectUserInfo: z.ZodDefault>; - showEmailCount: z.ZodDefault>; - showCallCount: z.ZodDefault>; - allowEmailEditing: z.ZodDefault>; - allowCustomRecipients: z.ZodDefault>; - showResponseWall: z.ZodDefault>; - highlightCampaign: z.ZodDefault>; - coverPhoto: z.ZodOptional; - coverVideoId: z.ZodOptional>; -}, "strip", z.ZodTypeAny, { - status: "ACTIVE" | "ARCHIVED" | "DRAFT" | "PAUSED"; - title: string; - emailSubject: string; - emailBody: string; - allowSmtpEmail: boolean; - allowMailtoLink: boolean; - collectUserInfo: boolean; - showEmailCount: boolean; - showCallCount: boolean; - allowEmailEditing: boolean; - allowCustomRecipients: boolean; - showResponseWall: boolean; - highlightCampaign: boolean; - targetGovernmentLevels: ("FEDERAL" | "PROVINCIAL" | "MUNICIPAL" | "SCHOOL_BOARD")[]; - description?: string | undefined; - coverPhoto?: string | undefined; - coverVideoId?: number | null | undefined; - callToAction?: string | undefined; -}, { - title: string; - emailSubject: string; - emailBody: string; - status?: "ACTIVE" | "ARCHIVED" | "DRAFT" | "PAUSED" | undefined; - description?: string | undefined; - coverPhoto?: string | undefined; - coverVideoId?: number | null | undefined; - callToAction?: string | undefined; - allowSmtpEmail?: boolean | undefined; - allowMailtoLink?: boolean | undefined; - collectUserInfo?: boolean | undefined; - showEmailCount?: boolean | undefined; - showCallCount?: boolean | undefined; - allowEmailEditing?: boolean | undefined; - allowCustomRecipients?: boolean | undefined; - showResponseWall?: boolean | undefined; - highlightCampaign?: boolean | undefined; - targetGovernmentLevels?: ("FEDERAL" | "PROVINCIAL" | "MUNICIPAL" | "SCHOOL_BOARD")[] | undefined; -}>; -export declare const updateCampaignSchema: z.ZodObject<{ - title: z.ZodOptional; - description: z.ZodOptional>; - emailSubject: z.ZodOptional; - emailBody: z.ZodOptional; - callToAction: z.ZodOptional>; - status: z.ZodOptional>; - targetGovernmentLevels: z.ZodOptional, "many">>; - allowSmtpEmail: z.ZodOptional; - allowMailtoLink: z.ZodOptional; - collectUserInfo: z.ZodOptional; - showEmailCount: z.ZodOptional; - showCallCount: z.ZodOptional; - allowEmailEditing: z.ZodOptional; - allowCustomRecipients: z.ZodOptional; - showResponseWall: z.ZodOptional; - highlightCampaign: z.ZodOptional; - coverPhoto: z.ZodOptional>; - coverVideoId: z.ZodOptional>; -}, "strip", z.ZodTypeAny, { - status?: "ACTIVE" | "ARCHIVED" | "DRAFT" | "PAUSED" | undefined; - title?: string | undefined; - description?: string | null | undefined; - coverPhoto?: string | null | undefined; - coverVideoId?: number | null | undefined; - emailSubject?: string | undefined; - emailBody?: string | undefined; - callToAction?: string | null | undefined; - allowSmtpEmail?: boolean | undefined; - allowMailtoLink?: boolean | undefined; - collectUserInfo?: boolean | undefined; - showEmailCount?: boolean | undefined; - showCallCount?: boolean | undefined; - allowEmailEditing?: boolean | undefined; - allowCustomRecipients?: boolean | undefined; - showResponseWall?: boolean | undefined; - highlightCampaign?: boolean | undefined; - targetGovernmentLevels?: ("FEDERAL" | "PROVINCIAL" | "MUNICIPAL" | "SCHOOL_BOARD")[] | undefined; -}, { - status?: "ACTIVE" | "ARCHIVED" | "DRAFT" | "PAUSED" | undefined; - title?: string | undefined; - description?: string | null | undefined; - coverPhoto?: string | null | undefined; - coverVideoId?: number | null | undefined; - emailSubject?: string | undefined; - emailBody?: string | undefined; - callToAction?: string | null | undefined; - allowSmtpEmail?: boolean | undefined; - allowMailtoLink?: boolean | undefined; - collectUserInfo?: boolean | undefined; - showEmailCount?: boolean | undefined; - showCallCount?: boolean | undefined; - allowEmailEditing?: boolean | undefined; - allowCustomRecipients?: boolean | undefined; - showResponseWall?: boolean | undefined; - highlightCampaign?: boolean | undefined; - targetGovernmentLevels?: ("FEDERAL" | "PROVINCIAL" | "MUNICIPAL" | "SCHOOL_BOARD")[] | undefined; -}>; -export declare const listCampaignsSchema: z.ZodObject<{ - page: z.ZodDefault; - limit: z.ZodDefault; - search: z.ZodOptional; - status: z.ZodOptional>; -}, "strip", z.ZodTypeAny, { - limit: number; - page: number; - status?: "ACTIVE" | "ARCHIVED" | "DRAFT" | "PAUSED" | undefined; - search?: string | undefined; -}, { - status?: "ACTIVE" | "ARCHIVED" | "DRAFT" | "PAUSED" | undefined; - search?: string | undefined; - limit?: number | undefined; - page?: number | undefined; -}>; -export declare const campaignIdSchema: z.ZodObject<{ - id: z.ZodString; -}, "strip", z.ZodTypeAny, { - id: string; -}, { - id: string; -}>; -export declare const createUserCampaignSchema: z.ZodObject<{ - title: z.ZodString; - description: z.ZodOptional; - emailSubject: z.ZodString; - emailBody: z.ZodString; - callToAction: z.ZodOptional; - targetGovernmentLevels: z.ZodArray, "many">; -}, "strip", z.ZodTypeAny, { - title: string; - emailSubject: string; - emailBody: string; - targetGovernmentLevels: ("FEDERAL" | "PROVINCIAL" | "MUNICIPAL" | "SCHOOL_BOARD")[]; - description?: string | undefined; - callToAction?: string | undefined; -}, { - title: string; - emailSubject: string; - emailBody: string; - targetGovernmentLevels: ("FEDERAL" | "PROVINCIAL" | "MUNICIPAL" | "SCHOOL_BOARD")[]; - description?: string | undefined; - callToAction?: string | undefined; -}>; -export declare const updateUserCampaignSchema: z.ZodObject<{ - title: z.ZodOptional; - description: z.ZodOptional>; - emailSubject: z.ZodOptional; - emailBody: z.ZodOptional; - callToAction: z.ZodOptional>; - targetGovernmentLevels: z.ZodOptional, "many">>; -}, "strip", z.ZodTypeAny, { - title?: string | undefined; - description?: string | undefined; - emailSubject?: string | undefined; - emailBody?: string | undefined; - callToAction?: string | undefined; - targetGovernmentLevels?: ("FEDERAL" | "PROVINCIAL" | "MUNICIPAL" | "SCHOOL_BOARD")[] | undefined; -}, { - title?: string | undefined; - description?: string | undefined; - emailSubject?: string | undefined; - emailBody?: string | undefined; - callToAction?: string | undefined; - targetGovernmentLevels?: ("FEDERAL" | "PROVINCIAL" | "MUNICIPAL" | "SCHOOL_BOARD")[] | undefined; -}>; -export declare const moderateCampaignSchema: z.ZodObject<{ - action: z.ZodEnum<["approve", "reject", "request_changes"]>; - reason: z.ZodOptional; - notes: z.ZodOptional; -}, "strip", z.ZodTypeAny, { - action: "approve" | "reject" | "request_changes"; - reason?: string | undefined; - notes?: string | undefined; -}, { - action: "approve" | "reject" | "request_changes"; - reason?: string | undefined; - notes?: string | undefined; -}>; -export declare const listModerationQueueSchema: z.ZodObject<{ - page: z.ZodDefault; - limit: z.ZodDefault; - search: z.ZodOptional; - moderationStatus: z.ZodOptional>; -}, "strip", z.ZodTypeAny, { - limit: number; - page: number; - search?: string | undefined; - moderationStatus?: "APPROVED" | "PENDING_REVIEW" | "REJECTED" | "CHANGES_REQUESTED" | undefined; -}, { - search?: string | undefined; - limit?: number | undefined; - page?: number | undefined; - moderationStatus?: "APPROVED" | "PENDING_REVIEW" | "REJECTED" | "CHANGES_REQUESTED" | undefined; -}>; -export type CreateCampaignInput = z.infer; -export type UpdateCampaignInput = z.infer; -export type ListCampaignsInput = z.infer; -export type CreateUserCampaignInput = z.infer; -export type UpdateUserCampaignInput = z.infer; -export type ModerateCampaignInput = z.infer; -export type ListModerationQueueInput = z.infer; -//# sourceMappingURL=campaigns.schemas.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/influence/campaigns/campaigns.schemas.d.ts.map b/api/dist/modules/influence/campaigns/campaigns.schemas.d.ts.map deleted file mode 100644 index 036fcd0b..00000000 --- a/api/dist/modules/influence/campaigns/campaigns.schemas.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"campaigns.schemas.d.ts","sourceRoot":"","sources":["../../../../src/modules/influence/campaigns/campaigns.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmB/B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmB/B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;EAK9B,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;EAE3B,CAAC;AAGH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;EAOnC,CAAC;AAGH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;EAAqC,CAAC;AAG3E,eAAO,MAAM,sBAAsB;;;;;;;;;;;;EAIjC,CAAC;AAGH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;EAKpC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACvE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACvE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACrE,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC/E,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC/E,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAC3E,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/influence/campaigns/campaigns.schemas.js b/api/dist/modules/influence/campaigns/campaigns.schemas.js deleted file mode 100644 index 0726f1fb..00000000 --- a/api/dist/modules/influence/campaigns/campaigns.schemas.js +++ /dev/null @@ -1,79 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.listModerationQueueSchema = exports.moderateCampaignSchema = exports.updateUserCampaignSchema = exports.createUserCampaignSchema = exports.campaignIdSchema = exports.listCampaignsSchema = exports.updateCampaignSchema = exports.createCampaignSchema = void 0; -const zod_1 = require("zod"); -const client_1 = require("@prisma/client"); -exports.createCampaignSchema = zod_1.z.object({ - title: zod_1.z.string().min(1, 'Title is required').max(200), - description: zod_1.z.string().max(2000).optional(), - emailSubject: zod_1.z.string().min(1, 'Email subject is required').max(200), - emailBody: zod_1.z.string().min(1, 'Email body is required').max(10000), - callToAction: zod_1.z.string().max(500).optional(), - status: zod_1.z.nativeEnum(client_1.CampaignStatus).optional().default(client_1.CampaignStatus.DRAFT), - targetGovernmentLevels: zod_1.z.array(zod_1.z.nativeEnum(client_1.GovernmentLevel)).optional().default([]), - allowSmtpEmail: zod_1.z.boolean().optional().default(true), - allowMailtoLink: zod_1.z.boolean().optional().default(true), - collectUserInfo: zod_1.z.boolean().optional().default(true), - showEmailCount: zod_1.z.boolean().optional().default(true), - showCallCount: zod_1.z.boolean().optional().default(true), - allowEmailEditing: zod_1.z.boolean().optional().default(false), - allowCustomRecipients: zod_1.z.boolean().optional().default(false), - showResponseWall: zod_1.z.boolean().optional().default(false), - highlightCampaign: zod_1.z.boolean().optional().default(false), - coverPhoto: zod_1.z.string().url().max(500).optional(), - coverVideoId: zod_1.z.number().int().positive().nullable().optional(), -}); -exports.updateCampaignSchema = zod_1.z.object({ - title: zod_1.z.string().min(1).max(200).optional(), - description: zod_1.z.string().max(2000).nullable().optional(), - emailSubject: zod_1.z.string().min(1).max(200).optional(), - emailBody: zod_1.z.string().min(1).max(10000).optional(), - callToAction: zod_1.z.string().max(500).nullable().optional(), - status: zod_1.z.nativeEnum(client_1.CampaignStatus).optional(), - targetGovernmentLevels: zod_1.z.array(zod_1.z.nativeEnum(client_1.GovernmentLevel)).optional(), - allowSmtpEmail: zod_1.z.boolean().optional(), - allowMailtoLink: zod_1.z.boolean().optional(), - collectUserInfo: zod_1.z.boolean().optional(), - showEmailCount: zod_1.z.boolean().optional(), - showCallCount: zod_1.z.boolean().optional(), - allowEmailEditing: zod_1.z.boolean().optional(), - allowCustomRecipients: zod_1.z.boolean().optional(), - showResponseWall: zod_1.z.boolean().optional(), - highlightCampaign: zod_1.z.boolean().optional(), - coverPhoto: zod_1.z.string().url().max(500).nullable().optional(), - coverVideoId: zod_1.z.number().int().positive().nullable().optional(), -}); -exports.listCampaignsSchema = zod_1.z.object({ - page: zod_1.z.coerce.number().int().positive().default(1), - limit: zod_1.z.coerce.number().int().positive().max(100).default(20), - search: zod_1.z.string().optional(), - status: zod_1.z.nativeEnum(client_1.CampaignStatus).optional(), -}); -exports.campaignIdSchema = zod_1.z.object({ - id: zod_1.z.string().min(1), -}); -// User-submitted campaign (restricted fields) -exports.createUserCampaignSchema = zod_1.z.object({ - title: zod_1.z.string().min(3, 'Title must be at least 3 characters').max(200), - description: zod_1.z.string().max(2000).optional(), - emailSubject: zod_1.z.string().min(3, 'Email subject is required').max(200), - emailBody: zod_1.z.string().min(10, 'Email body must be at least 10 characters').max(5000), - callToAction: zod_1.z.string().max(500).optional(), - targetGovernmentLevels: zod_1.z.array(zod_1.z.nativeEnum(client_1.GovernmentLevel)).min(1, 'Select at least one government level'), -}); -// Update own user campaign (same restricted fields) -exports.updateUserCampaignSchema = exports.createUserCampaignSchema.partial(); -// Admin moderation action -exports.moderateCampaignSchema = zod_1.z.object({ - action: zod_1.z.enum(['approve', 'reject', 'request_changes']), - reason: zod_1.z.string().max(2000).optional(), - notes: zod_1.z.string().max(2000).optional(), -}); -// Moderation queue filters -exports.listModerationQueueSchema = zod_1.z.object({ - page: zod_1.z.coerce.number().int().positive().default(1), - limit: zod_1.z.coerce.number().int().positive().max(100).default(20), - search: zod_1.z.string().optional(), - moderationStatus: zod_1.z.nativeEnum(client_1.CampaignModerationStatus).optional(), -}); -//# sourceMappingURL=campaigns.schemas.js.map \ No newline at end of file diff --git a/api/dist/modules/influence/campaigns/campaigns.schemas.js.map b/api/dist/modules/influence/campaigns/campaigns.schemas.js.map deleted file mode 100644 index ac5e380d..00000000 --- a/api/dist/modules/influence/campaigns/campaigns.schemas.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"campaigns.schemas.js","sourceRoot":"","sources":["../../../../src/modules/influence/campaigns/campaigns.schemas.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,2CAA2F;AAE9E,QAAA,oBAAoB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3C,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,mBAAmB,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IACtD,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;IAC5C,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GA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C,IAAI,CAAC,CAAC,QAAQ,EAAE;IACvC,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;CACvC,CAAC,CAAC;AAEH,2BAA2B;AACd,QAAA,yBAAyB,GAAG,OAAC,CAAC,MAAM,CAAC;IAChD,IAAI,EAAE,OAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IACnD,KAAK,EAAE,OAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IAC9D,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,gBAAgB,EAAE,OAAC,CAAC,UAAU,CAAC,iCAAwB,CAAC,CAAC,QAAQ,EAAE;CACpE,CAAC,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/influence/campaigns/campaigns.service.d.ts b/api/dist/modules/influence/campaigns/campaigns.service.d.ts deleted file mode 100644 index c0483a6c..00000000 --- a/api/dist/modules/influence/campaigns/campaigns.service.d.ts +++ /dev/null @@ -1,467 +0,0 @@ -import { UserRole } from '@prisma/client'; -import type { CreateCampaignInput, UpdateCampaignInput, ListCampaignsInput, CreateUserCampaignInput, ModerateCampaignInput, ListModerationQueueInput } from './campaigns.schemas'; -interface AuthUser { - id: string; - email: string; - role: UserRole; -} -export declare const campaignsService: { - findAll(filters: ListCampaignsInput, user?: AuthUser): Promise<{ - campaigns: { - status: import(".prisma/client").$Enums.CampaignStatus; - id: string; - createdAt: Date; - updatedAt: Date; - _count: { - responses: number; - emails: number; - }; - title: string; - description: string | null; - slug: string; - coverPhoto: string | null; - coverVideoId: number | null; - moderationNotes: string | null; - createdByUserId: string | null; - emailSubject: string; - emailBody: string; - callToAction: string | null; - allowSmtpEmail: boolean; - allowMailtoLink: boolean; - collectUserInfo: boolean; - showEmailCount: boolean; - showCallCount: boolean; - allowEmailEditing: boolean; - allowCustomRecipients: boolean; - showResponseWall: boolean; - highlightCampaign: boolean; - targetGovernmentLevels: import(".prisma/client").$Enums.GovernmentLevel[]; - createdByUserEmail: string | null; - createdByUserName: string | null; - isUserGenerated: boolean; - moderationStatus: import(".prisma/client").$Enums.CampaignModerationStatus | null; - reviewedByUserId: string | null; - reviewedAt: Date | null; - rejectionReason: string | null; - }[]; - pagination: { - page: number; - limit: number; - total: number; - totalPages: number; - }; - }>; - findById(id: string): Promise<{ - status: import(".prisma/client").$Enums.CampaignStatus; - id: string; - createdAt: Date; - updatedAt: Date; - _count: { - responses: number; - emails: number; - }; - title: string; - description: string | null; - slug: string; - coverPhoto: string | null; - coverVideoId: number | null; - moderationNotes: string | null; - createdByUserId: string | null; - emailSubject: string; - emailBody: string; - callToAction: string | null; - allowSmtpEmail: boolean; - allowMailtoLink: boolean; - collectUserInfo: boolean; - showEmailCount: boolean; - showCallCount: boolean; - allowEmailEditing: boolean; - allowCustomRecipients: boolean; - showResponseWall: boolean; - highlightCampaign: boolean; - targetGovernmentLevels: import(".prisma/client").$Enums.GovernmentLevel[]; - createdByUserEmail: string | null; - createdByUserName: string | null; - isUserGenerated: boolean; - moderationStatus: import(".prisma/client").$Enums.CampaignModerationStatus | null; - reviewedByUserId: string | null; - reviewedAt: Date | null; - rejectionReason: string | null; - }>; - findBySlug(slug: string): Promise<{ - status: import(".prisma/client").$Enums.CampaignStatus; - id: string; - createdAt: Date; - updatedAt: Date; - _count: { - responses: number; - emails: number; - }; - title: string; - description: string | null; - slug: string; - coverPhoto: string | null; - coverVideoId: number | null; - moderationNotes: string | null; - createdByUserId: string | null; - emailSubject: string; - emailBody: string; - callToAction: string | null; - allowSmtpEmail: boolean; - allowMailtoLink: boolean; - collectUserInfo: boolean; - showEmailCount: boolean; - showCallCount: boolean; - allowEmailEditing: boolean; - allowCustomRecipients: boolean; - showResponseWall: boolean; - highlightCampaign: boolean; - targetGovernmentLevels: import(".prisma/client").$Enums.GovernmentLevel[]; - createdByUserEmail: string | null; - createdByUserName: string | null; - isUserGenerated: boolean; - moderationStatus: import(".prisma/client").$Enums.CampaignModerationStatus | null; - reviewedByUserId: string | null; - reviewedAt: Date | null; - rejectionReason: string | null; - }>; - create(data: CreateCampaignInput, user: AuthUser): Promise<{ - status: import(".prisma/client").$Enums.CampaignStatus; - id: string; - createdAt: Date; - updatedAt: Date; - _count: { - responses: number; - emails: number; - }; - title: string; - description: string | null; - slug: string; - coverPhoto: string | null; - coverVideoId: number | null; - moderationNotes: string | null; - createdByUserId: string | null; - emailSubject: string; - emailBody: string; - callToAction: string | null; - allowSmtpEmail: boolean; - allowMailtoLink: boolean; - collectUserInfo: boolean; - showEmailCount: boolean; - showCallCount: boolean; - allowEmailEditing: boolean; - allowCustomRecipients: boolean; - showResponseWall: boolean; - highlightCampaign: boolean; - targetGovernmentLevels: import(".prisma/client").$Enums.GovernmentLevel[]; - createdByUserEmail: string | null; - createdByUserName: string | null; - isUserGenerated: boolean; - moderationStatus: import(".prisma/client").$Enums.CampaignModerationStatus | null; - reviewedByUserId: string | null; - reviewedAt: Date | null; - rejectionReason: string | null; - }>; - update(id: string, data: UpdateCampaignInput): Promise<{ - status: import(".prisma/client").$Enums.CampaignStatus; - id: string; - createdAt: Date; - updatedAt: Date; - _count: { - responses: number; - emails: number; - }; - title: string; - description: string | null; - slug: string; - coverPhoto: string | null; - coverVideoId: number | null; - moderationNotes: string | null; - createdByUserId: string | null; - emailSubject: string; - emailBody: string; - callToAction: string | null; - allowSmtpEmail: boolean; - allowMailtoLink: boolean; - collectUserInfo: boolean; - showEmailCount: boolean; - showCallCount: boolean; - allowEmailEditing: boolean; - allowCustomRecipients: boolean; - showResponseWall: boolean; - highlightCampaign: boolean; - targetGovernmentLevels: import(".prisma/client").$Enums.GovernmentLevel[]; - createdByUserEmail: string | null; - createdByUserName: string | null; - isUserGenerated: boolean; - moderationStatus: import(".prisma/client").$Enums.CampaignModerationStatus | null; - reviewedByUserId: string | null; - reviewedAt: Date | null; - rejectionReason: string | null; - }>; - findActiveCampaigns(): Promise<{ - status: import(".prisma/client").$Enums.CampaignStatus; - id: string; - createdAt: Date; - updatedAt: Date; - _count: { - responses: number; - emails: number; - }; - title: string; - description: string | null; - slug: string; - coverPhoto: string | null; - coverVideoId: number | null; - emailSubject: string; - emailBody: string; - callToAction: string | null; - allowSmtpEmail: boolean; - allowMailtoLink: boolean; - collectUserInfo: boolean; - showEmailCount: boolean; - showCallCount: boolean; - allowEmailEditing: boolean; - allowCustomRecipients: boolean; - showResponseWall: boolean; - highlightCampaign: boolean; - targetGovernmentLevels: import(".prisma/client").$Enums.GovernmentLevel[]; - createdByUserName: string | null; - isUserGenerated: boolean; - moderationStatus: import(".prisma/client").$Enums.CampaignModerationStatus | null; - }[]>; - findBySlugPublic(slug: string): Promise<{ - status: import(".prisma/client").$Enums.CampaignStatus; - id: string; - createdAt: Date; - updatedAt: Date; - _count: { - responses: number; - emails: number; - }; - title: string; - description: string | null; - slug: string; - coverPhoto: string | null; - coverVideoId: number | null; - emailSubject: string; - emailBody: string; - callToAction: string | null; - allowSmtpEmail: boolean; - allowMailtoLink: boolean; - collectUserInfo: boolean; - showEmailCount: boolean; - showCallCount: boolean; - allowEmailEditing: boolean; - allowCustomRecipients: boolean; - showResponseWall: boolean; - highlightCampaign: boolean; - targetGovernmentLevels: import(".prisma/client").$Enums.GovernmentLevel[]; - createdByUserName: string | null; - isUserGenerated: boolean; - moderationStatus: import(".prisma/client").$Enums.CampaignModerationStatus | null; - }>; - delete(id: string): Promise; - createUserCampaign(data: CreateUserCampaignInput, user: AuthUser): Promise<{ - status: import(".prisma/client").$Enums.CampaignStatus; - id: string; - createdAt: Date; - updatedAt: Date; - _count: { - responses: number; - emails: number; - }; - title: string; - description: string | null; - slug: string; - coverPhoto: string | null; - coverVideoId: number | null; - moderationNotes: string | null; - createdByUserId: string | null; - emailSubject: string; - emailBody: string; - callToAction: string | null; - allowSmtpEmail: boolean; - allowMailtoLink: boolean; - collectUserInfo: boolean; - showEmailCount: boolean; - showCallCount: boolean; - allowEmailEditing: boolean; - allowCustomRecipients: boolean; - showResponseWall: boolean; - highlightCampaign: boolean; - targetGovernmentLevels: import(".prisma/client").$Enums.GovernmentLevel[]; - createdByUserEmail: string | null; - createdByUserName: string | null; - isUserGenerated: boolean; - moderationStatus: import(".prisma/client").$Enums.CampaignModerationStatus | null; - reviewedByUserId: string | null; - reviewedAt: Date | null; - rejectionReason: string | null; - }>; - findUserCampaigns(userId: string): Promise<{ - status: import(".prisma/client").$Enums.CampaignStatus; - id: string; - createdAt: Date; - updatedAt: Date; - _count: { - responses: number; - emails: number; - }; - title: string; - description: string | null; - slug: string; - coverPhoto: string | null; - coverVideoId: number | null; - moderationNotes: string | null; - createdByUserId: string | null; - emailSubject: string; - emailBody: string; - callToAction: string | null; - allowSmtpEmail: boolean; - allowMailtoLink: boolean; - collectUserInfo: boolean; - showEmailCount: boolean; - showCallCount: boolean; - allowEmailEditing: boolean; - allowCustomRecipients: boolean; - showResponseWall: boolean; - highlightCampaign: boolean; - targetGovernmentLevels: import(".prisma/client").$Enums.GovernmentLevel[]; - createdByUserEmail: string | null; - createdByUserName: string | null; - isUserGenerated: boolean; - moderationStatus: import(".prisma/client").$Enums.CampaignModerationStatus | null; - reviewedByUserId: string | null; - reviewedAt: Date | null; - rejectionReason: string | null; - }[]>; - updateUserCampaign(id: string, data: Partial, user: AuthUser): Promise<{ - status: import(".prisma/client").$Enums.CampaignStatus; - id: string; - createdAt: Date; - updatedAt: Date; - _count: { - responses: number; - emails: number; - }; - title: string; - description: string | null; - slug: string; - coverPhoto: string | null; - coverVideoId: number | null; - moderationNotes: string | null; - createdByUserId: string | null; - emailSubject: string; - emailBody: string; - callToAction: string | null; - allowSmtpEmail: boolean; - allowMailtoLink: boolean; - collectUserInfo: boolean; - showEmailCount: boolean; - showCallCount: boolean; - allowEmailEditing: boolean; - allowCustomRecipients: boolean; - showResponseWall: boolean; - highlightCampaign: boolean; - targetGovernmentLevels: import(".prisma/client").$Enums.GovernmentLevel[]; - createdByUserEmail: string | null; - createdByUserName: string | null; - isUserGenerated: boolean; - moderationStatus: import(".prisma/client").$Enums.CampaignModerationStatus | null; - reviewedByUserId: string | null; - reviewedAt: Date | null; - rejectionReason: string | null; - }>; - findModerationQueue(filters: ListModerationQueueInput): Promise<{ - campaigns: { - status: import(".prisma/client").$Enums.CampaignStatus; - id: string; - createdAt: Date; - updatedAt: Date; - _count: { - responses: number; - emails: number; - }; - title: string; - description: string | null; - slug: string; - coverPhoto: string | null; - coverVideoId: number | null; - moderationNotes: string | null; - createdByUserId: string | null; - emailSubject: string; - emailBody: string; - callToAction: string | null; - allowSmtpEmail: boolean; - allowMailtoLink: boolean; - collectUserInfo: boolean; - showEmailCount: boolean; - showCallCount: boolean; - allowEmailEditing: boolean; - allowCustomRecipients: boolean; - showResponseWall: boolean; - highlightCampaign: boolean; - targetGovernmentLevels: import(".prisma/client").$Enums.GovernmentLevel[]; - createdByUserEmail: string | null; - createdByUserName: string | null; - isUserGenerated: boolean; - moderationStatus: import(".prisma/client").$Enums.CampaignModerationStatus | null; - reviewedByUserId: string | null; - reviewedAt: Date | null; - rejectionReason: string | null; - }[]; - pagination: { - page: number; - limit: number; - total: number; - totalPages: number; - }; - }>; - getModerationStats(): Promise<{ - total: number; - pending: number; - approved: number; - rejected: number; - changesRequested: number; - }>; - moderateCampaign(id: string, input: ModerateCampaignInput, reviewer: AuthUser): Promise<{ - status: import(".prisma/client").$Enums.CampaignStatus; - id: string; - createdAt: Date; - updatedAt: Date; - _count: { - responses: number; - emails: number; - }; - title: string; - description: string | null; - slug: string; - coverPhoto: string | null; - coverVideoId: number | null; - moderationNotes: string | null; - createdByUserId: string | null; - emailSubject: string; - emailBody: string; - callToAction: string | null; - allowSmtpEmail: boolean; - allowMailtoLink: boolean; - collectUserInfo: boolean; - showEmailCount: boolean; - showCallCount: boolean; - allowEmailEditing: boolean; - allowCustomRecipients: boolean; - showResponseWall: boolean; - highlightCampaign: boolean; - targetGovernmentLevels: import(".prisma/client").$Enums.GovernmentLevel[]; - createdByUserEmail: string | null; - createdByUserName: string | null; - isUserGenerated: boolean; - moderationStatus: import(".prisma/client").$Enums.CampaignModerationStatus | null; - reviewedByUserId: string | null; - reviewedAt: Date | null; - rejectionReason: string | null; - }>; -}; -export {}; -//# sourceMappingURL=campaigns.service.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/influence/campaigns/campaigns.service.d.ts.map b/api/dist/modules/influence/campaigns/campaigns.service.d.ts.map deleted file mode 100644 index 4af12606..00000000 --- a/api/dist/modules/influence/campaigns/campaigns.service.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"campaigns.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/influence/campaigns/campaigns.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,QAAQ,EAA4B,MAAM,gBAAgB,CAAC;AAI5E,OAAO,KAAK,EACV,mBAAmB,EAAE,mBAAmB,EAAE,kBAAkB,EAC5D,uBAAuB,EAA2B,qBAAqB,EAAE,wBAAwB,EAClG,MAAM,qBAAqB,CAAC;AAiH7B,UAAU,QAAQ;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,QAAQ,CAAC;CAChB;AAED,eAAO,MAAM,gBAAgB;qBACJ,kBAAkB,SAAS,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0CvC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAaF,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAaV,mBAAmB,QAAQ,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAgCrC,MAAM,QAAQ,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BA0CrB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;eAiBlB,MAAM;6BAWQ,uBAAuB,QAAQ,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BAwCtC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAQT,MAAM,QAAQ,OAAO,CAAC,uBAAuB,CAAC,QAAQ,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCA2CxD,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBA0ChC,MAAM,SAAS,qBAAqB,YAAY,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqCpF,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/influence/campaigns/campaigns.service.js b/api/dist/modules/influence/campaigns/campaigns.service.js deleted file mode 100644 index f9d9c707..00000000 --- a/api/dist/modules/influence/campaigns/campaigns.service.js +++ /dev/null @@ -1,408 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.campaignsService = void 0; -const client_1 = require("@prisma/client"); -const database_1 = require("../../../config/database"); -const error_handler_1 = require("../../../middleware/error-handler"); -const roles_1 = require("../../../utils/roles"); -function escapeHtml(unsafe) { - return unsafe - .replace(/&/g, '&') - .replace(//g, '>') - .replace(/"/g, '"') - .replace(/'/g, '''); -} -const campaignSelect = { - id: true, - slug: true, - title: true, - description: true, - emailSubject: true, - emailBody: true, - callToAction: true, - coverPhoto: true, - coverVideoId: true, - status: true, - allowSmtpEmail: true, - allowMailtoLink: true, - collectUserInfo: true, - showEmailCount: true, - showCallCount: true, - allowEmailEditing: true, - allowCustomRecipients: true, - showResponseWall: true, - highlightCampaign: true, - targetGovernmentLevels: true, - createdByUserId: true, - createdByUserEmail: true, - createdByUserName: true, - isUserGenerated: true, - moderationStatus: true, - reviewedByUserId: true, - reviewedAt: true, - rejectionReason: true, - moderationNotes: true, - createdAt: true, - updatedAt: true, - _count: { - select: { - emails: true, - responses: true, - }, - }, -}; -/** Public-facing select — strips admin-only fields (emails, internal IDs, moderation notes) */ -const publicCampaignSelect = { - id: true, - slug: true, - title: true, - description: true, - emailSubject: true, - emailBody: true, - callToAction: true, - coverPhoto: true, - coverVideoId: true, - status: true, - allowSmtpEmail: true, - allowMailtoLink: true, - collectUserInfo: true, - showEmailCount: true, - showCallCount: true, - allowEmailEditing: true, - allowCustomRecipients: true, - showResponseWall: true, - highlightCampaign: true, - targetGovernmentLevels: true, - createdByUserName: true, - isUserGenerated: true, - moderationStatus: true, - createdAt: true, - updatedAt: true, - _count: { - select: { - emails: true, - responses: true, - }, - }, -}; -function generateSlug(title) { - return title - .toLowerCase() - .replace(/[^a-z0-9]+/g, '-') - .replace(/^-+|-+$/g, '') - .slice(0, 80); -} -async function resolveSlugCollision(slug, excludeId) { - let candidate = slug; - let suffix = 2; - while (true) { - const existing = await database_1.prisma.campaign.findUnique({ - where: { slug: candidate }, - select: { id: true }, - }); - if (!existing || (excludeId && existing.id === excludeId)) { - return candidate; - } - candidate = `${slug}-${suffix}`; - suffix++; - } -} -exports.campaignsService = { - async findAll(filters, user) { - const { page, limit, search, status } = filters; - const skip = (page - 1) * limit; - const where = {}; - if (search) { - where.OR = [ - { title: { contains: search, mode: 'insensitive' } }, - { description: { contains: search, mode: 'insensitive' } }, - ]; - } - if (status) - where.status = status; - // Non-admin users only see their own campaigns - if (user && !(0, roles_1.hasAnyRole)(user, roles_1.ADMIN_ROLES)) { - where.createdByUserId = user.id; - } - const [campaigns, total] = await Promise.all([ - database_1.prisma.campaign.findMany({ - where, - select: campaignSelect, - skip, - take: limit, - orderBy: { createdAt: 'desc' }, - }), - database_1.prisma.campaign.count({ where }), - ]); - return { - campaigns, - pagination: { - page, - limit, - total, - totalPages: Math.ceil(total / limit), - }, - }; - }, - async findById(id) { - const campaign = await database_1.prisma.campaign.findUnique({ - where: { id }, - select: campaignSelect, - }); - if (!campaign) { - throw new error_handler_1.AppError(404, 'Campaign not found', 'CAMPAIGN_NOT_FOUND'); - } - return campaign; - }, - async findBySlug(slug) { - const campaign = await database_1.prisma.campaign.findUnique({ - where: { slug }, - select: campaignSelect, - }); - if (!campaign) { - throw new error_handler_1.AppError(404, 'Campaign not found', 'CAMPAIGN_NOT_FOUND'); - } - return campaign; - }, - async create(data, user) { - const baseSlug = generateSlug(data.title); - const slug = await resolveSlugCollision(baseSlug); - // Look up user name from DB - const dbUser = await database_1.prisma.user.findUnique({ - where: { id: user.id }, - select: { name: true }, - }); - // If highlighting this campaign, unset any other highlighted campaign - if (data.highlightCampaign) { - await database_1.prisma.campaign.updateMany({ - where: { highlightCampaign: true }, - data: { highlightCampaign: false }, - }); - } - const campaign = await database_1.prisma.campaign.create({ - data: { - ...data, - slug, - createdByUserId: user.id, - createdByUserEmail: user.email, - createdByUserName: dbUser?.name ?? null, - }, - select: campaignSelect, - }); - return campaign; - }, - async update(id, data) { - const existing = await database_1.prisma.campaign.findUnique({ where: { id } }); - if (!existing) { - throw new error_handler_1.AppError(404, 'Campaign not found', 'CAMPAIGN_NOT_FOUND'); - } - const updateData = { ...data }; - // Regenerate slug if title changes - if (data.title && data.title !== existing.title) { - const baseSlug = generateSlug(data.title); - updateData.slug = await resolveSlugCollision(baseSlug, id); - } - // If highlighting this campaign, unset any other highlighted campaign - if (data.highlightCampaign) { - await database_1.prisma.campaign.updateMany({ - where: { highlightCampaign: true, id: { not: id } }, - data: { highlightCampaign: false }, - }); - } - const campaign = await database_1.prisma.campaign.update({ - where: { id }, - data: updateData, - select: campaignSelect, - }); - return campaign; - }, - async findActiveCampaigns() { - return database_1.prisma.campaign.findMany({ - where: { status: 'ACTIVE' }, - select: publicCampaignSelect, - orderBy: [ - { highlightCampaign: 'desc' }, - { createdAt: 'desc' }, - ], - }); - }, - async findBySlugPublic(slug) { - const campaign = await database_1.prisma.campaign.findUnique({ - where: { slug }, - select: publicCampaignSelect, - }); - if (!campaign) { - throw new error_handler_1.AppError(404, 'Campaign not found', 'CAMPAIGN_NOT_FOUND'); - } - if (campaign.status !== 'ACTIVE') { - throw new error_handler_1.AppError(404, 'Campaign not found', 'CAMPAIGN_NOT_FOUND'); - } - return campaign; - }, - async delete(id) { - const existing = await database_1.prisma.campaign.findUnique({ where: { id } }); - if (!existing) { - throw new error_handler_1.AppError(404, 'Campaign not found', 'CAMPAIGN_NOT_FOUND'); - } - await database_1.prisma.campaign.delete({ where: { id } }); - }, - // --- User-Generated Campaign Methods --- - async createUserCampaign(data, user) { - const baseSlug = generateSlug(data.title); - const slug = await resolveSlugCollision(baseSlug); - const dbUser = await database_1.prisma.user.findUnique({ - where: { id: user.id }, - select: { name: true }, - }); - const campaign = await database_1.prisma.campaign.create({ - data: { - slug, - title: escapeHtml(data.title), - description: data.description ? escapeHtml(data.description) : null, - emailSubject: escapeHtml(data.emailSubject), - emailBody: escapeHtml(data.emailBody), - callToAction: data.callToAction ? escapeHtml(data.callToAction) : null, - targetGovernmentLevels: data.targetGovernmentLevels, - status: 'DRAFT', - isUserGenerated: true, - moderationStatus: client_1.CampaignModerationStatus.PENDING_REVIEW, - allowSmtpEmail: false, - allowMailtoLink: true, - collectUserInfo: true, - showEmailCount: true, - showCallCount: false, - allowEmailEditing: false, - allowCustomRecipients: false, - showResponseWall: false, - highlightCampaign: false, - createdByUserId: user.id, - createdByUserEmail: user.email, - createdByUserName: dbUser?.name ?? null, - }, - select: campaignSelect, - }); - return campaign; - }, - async findUserCampaigns(userId) { - return database_1.prisma.campaign.findMany({ - where: { createdByUserId: userId, isUserGenerated: true }, - select: campaignSelect, - orderBy: { createdAt: 'desc' }, - }); - }, - async updateUserCampaign(id, data, user) { - const existing = await database_1.prisma.campaign.findUnique({ where: { id } }); - if (!existing) { - throw new error_handler_1.AppError(404, 'Campaign not found', 'CAMPAIGN_NOT_FOUND'); - } - if (existing.createdByUserId !== user.id) { - throw new error_handler_1.AppError(403, 'You can only edit your own campaigns', 'FORBIDDEN'); - } - if (!existing.isUserGenerated) { - throw new error_handler_1.AppError(403, 'Cannot edit admin-created campaigns', 'FORBIDDEN'); - } - if (existing.moderationStatus !== client_1.CampaignModerationStatus.CHANGES_REQUESTED && - existing.moderationStatus !== client_1.CampaignModerationStatus.PENDING_REVIEW) { - throw new error_handler_1.AppError(400, 'Campaign cannot be edited in its current state', 'INVALID_STATE'); - } - const updateData = {}; - if (data.title) { - updateData.title = escapeHtml(data.title); - const baseSlug = generateSlug(data.title); - updateData.slug = await resolveSlugCollision(baseSlug, id); - } - if (data.description !== undefined) - updateData.description = data.description ? escapeHtml(data.description) : null; - if (data.emailSubject) - updateData.emailSubject = escapeHtml(data.emailSubject); - if (data.emailBody) - updateData.emailBody = escapeHtml(data.emailBody); - if (data.callToAction !== undefined) - updateData.callToAction = data.callToAction ? escapeHtml(data.callToAction) : null; - if (data.targetGovernmentLevels) - updateData.targetGovernmentLevels = data.targetGovernmentLevels; - // Reset to pending review on edit - updateData.moderationStatus = client_1.CampaignModerationStatus.PENDING_REVIEW; - updateData.rejectionReason = null; - return database_1.prisma.campaign.update({ - where: { id }, - data: updateData, - select: campaignSelect, - }); - }, - // --- Moderation Methods --- - async findModerationQueue(filters) { - const { page, limit, search, moderationStatus } = filters; - const skip = (page - 1) * limit; - const where = { isUserGenerated: true }; - if (moderationStatus) - where.moderationStatus = moderationStatus; - if (search) { - where.OR = [ - { title: { contains: search, mode: 'insensitive' } }, - { createdByUserName: { contains: search, mode: 'insensitive' } }, - { createdByUserEmail: { contains: search, mode: 'insensitive' } }, - ]; - } - const [campaigns, total] = await Promise.all([ - database_1.prisma.campaign.findMany({ - where, - select: campaignSelect, - skip, - take: limit, - orderBy: { createdAt: 'desc' }, - }), - database_1.prisma.campaign.count({ where }), - ]); - return { - campaigns, - pagination: { page, limit, total, totalPages: Math.ceil(total / limit) }, - }; - }, - async getModerationStats() { - const [total, pending, approved, rejected, changesRequested] = await Promise.all([ - database_1.prisma.campaign.count({ where: { isUserGenerated: true } }), - database_1.prisma.campaign.count({ where: { moderationStatus: client_1.CampaignModerationStatus.PENDING_REVIEW } }), - database_1.prisma.campaign.count({ where: { moderationStatus: client_1.CampaignModerationStatus.APPROVED } }), - database_1.prisma.campaign.count({ where: { moderationStatus: client_1.CampaignModerationStatus.REJECTED } }), - database_1.prisma.campaign.count({ where: { moderationStatus: client_1.CampaignModerationStatus.CHANGES_REQUESTED } }), - ]); - return { total, pending, approved, rejected, changesRequested }; - }, - async moderateCampaign(id, input, reviewer) { - const existing = await database_1.prisma.campaign.findUnique({ where: { id } }); - if (!existing) { - throw new error_handler_1.AppError(404, 'Campaign not found', 'CAMPAIGN_NOT_FOUND'); - } - if (!existing.isUserGenerated) { - throw new error_handler_1.AppError(400, 'Only user-generated campaigns can be moderated', 'INVALID_STATE'); - } - const updateData = { - reviewedByUserId: reviewer.id, - reviewedAt: new Date(), - moderationNotes: input.notes ?? null, - }; - switch (input.action) { - case 'approve': - updateData.moderationStatus = client_1.CampaignModerationStatus.APPROVED; - updateData.status = 'ACTIVE'; - updateData.rejectionReason = null; - break; - case 'reject': - updateData.moderationStatus = client_1.CampaignModerationStatus.REJECTED; - updateData.rejectionReason = input.reason ?? null; - break; - case 'request_changes': - updateData.moderationStatus = client_1.CampaignModerationStatus.CHANGES_REQUESTED; - updateData.rejectionReason = input.reason ?? null; - break; - } - return database_1.prisma.campaign.update({ - where: { id }, - data: updateData, - select: campaignSelect, - }); - }, -}; -//# sourceMappingURL=campaigns.service.js.map \ No newline at end of file diff --git a/api/dist/modules/influence/campaigns/campaigns.service.js.map b/api/dist/modules/influence/campaigns/campaigns.service.js.map deleted file mode 100644 index c6099cba..00000000 --- a/api/dist/modules/influence/campaigns/campaigns.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"campaigns.service.js","sourceRoot":"","sources":["../../../../src/modules/influence/campaigns/campaigns.service.ts"],"names":[],"mappings":";;;A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AAgB,GAAG,iCAAwB,CAAC,QAAQ,CAAC;gBAChE,UAAU,CAAC,eAAe,GAAG,KAAK,CAAC,MAAM,IAAI,IAAI,CAAC;gBAClD,MAAM;YACR,KAAK,iBAAiB;gBACpB,UAAU,CAAC,gBAAgB,GAAG,iCAAwB,CAAC,iBAAiB,CAAC;gBACzE,UAAU,CAAC,eAAe,GAAG,KAAK,CAAC,MAAM,IAAI,IAAI,CAAC;gBAClD,MAAM;QACV,CAAC;QAED,OAAO,iBAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;YAC5B,KAAK,EAAE,EAAE,EAAE,EAAE;YACb,IAAI,EAAE,UAAU;YAChB,MAAM,EAAE,cAAc;SACvB,CAAC,CAAC;IACL,CAAC;CACF,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/influence/email-queue/email-queue.routes.d.ts b/api/dist/modules/influence/email-queue/email-queue.routes.d.ts deleted file mode 100644 index e24d0eb9..00000000 --- a/api/dist/modules/influence/email-queue/email-queue.routes.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const router: import("express-serve-static-core").Router; -export { router as emailQueueRouter }; -//# sourceMappingURL=email-queue.routes.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/influence/email-queue/email-queue.routes.d.ts.map b/api/dist/modules/influence/email-queue/email-queue.routes.d.ts.map deleted file mode 100644 index 2c8e3fc3..00000000 --- a/api/dist/modules/influence/email-queue/email-queue.routes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"email-queue.routes.d.ts","sourceRoot":"","sources":["../../../../src/modules/influence/email-queue/email-queue.routes.ts"],"names":[],"mappings":"AAMA,QAAA,MAAM,MAAM,4CAAW,CAAC;AAwDxB,OAAO,EAAE,MAAM,IAAI,gBAAgB,EAAE,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/influence/email-queue/email-queue.routes.js b/api/dist/modules/influence/email-queue/email-queue.routes.js deleted file mode 100644 index 6716be1f..00000000 --- a/api/dist/modules/influence/email-queue/email-queue.routes.js +++ /dev/null @@ -1,53 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.emailQueueRouter = void 0; -const express_1 = require("express"); -const auth_middleware_1 = require("../../../middleware/auth.middleware"); -const rbac_middleware_1 = require("../../../middleware/rbac.middleware"); -const email_queue_service_1 = require("../../../services/email-queue.service"); -const roles_1 = require("../../../utils/roles"); -const router = (0, express_1.Router)(); -exports.emailQueueRouter = router; -router.use(auth_middleware_1.authenticate); -router.use((0, rbac_middleware_1.requireRole)(...roles_1.INFLUENCE_ROLES)); -// GET /api/email-queue/stats -router.get('/stats', async (_req, res, next) => { - try { - const stats = await email_queue_service_1.emailQueueService.getStats(); - res.json(stats); - } - catch (err) { - next(err); - } -}); -// POST /api/email-queue/pause -router.post('/pause', async (_req, res, next) => { - try { - await email_queue_service_1.emailQueueService.pause(); - res.json({ message: 'Queue paused' }); - } - catch (err) { - next(err); - } -}); -// POST /api/email-queue/resume -router.post('/resume', async (_req, res, next) => { - try { - await email_queue_service_1.emailQueueService.resume(); - res.json({ message: 'Queue resumed' }); - } - catch (err) { - next(err); - } -}); -// POST /api/email-queue/clean -router.post('/clean', async (_req, res, next) => { - try { - const cleaned = await email_queue_service_1.emailQueueService.clean(); - res.json({ message: `Cleaned ${cleaned} completed jobs`, cleaned }); - } - catch (err) { - next(err); - } -}); -//# sourceMappingURL=email-queue.routes.js.map \ No newline at end of file diff --git a/api/dist/modules/influence/email-queue/email-queue.routes.js.map b/api/dist/modules/influence/email-queue/email-queue.routes.js.map deleted file mode 100644 index f1465529..00000000 --- a/api/dist/modules/influence/email-queue/email-queue.routes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"email-queue.routes.js","sourceRoot":"","sources":["../../../../src/modules/influence/email-queue/email-queue.routes.ts"],"names":[],"mappings":";;;AAAA,qCAAkE;AAClE,yEAAmE;AACnE,yEAAkE;AAClE,+EAA0E;AAC1E,gDAAuD;AAEvD,MAAM,MAAM,GAAG,IAAA,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AEF,8BAA8B;AAC9B,MAAM,CAAC,IAAI,CACT,QAAQ,EACR,KAAK,EAAE,IAAa,EAAE,GAAa,EAAE,IAAkB,EAAE,EAAE;IACzD,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,MAAM,uCAAiB,CAAC,KAAK,EAAE,CAAC;QAChD,GAAG,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,WAAW,OAAO,iBAAiB,EAAE,OAAO,EAAE,CAAC,CAAC;IACtE,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,GAAG,CAAC,CAAC;IACZ,CAAC;AACH,CAAC,CACF,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/influence/postal-codes/postal-codes.schemas.d.ts b/api/dist/modules/influence/postal-codes/postal-codes.schemas.d.ts deleted file mode 100644 index 7966cb28..00000000 --- a/api/dist/modules/influence/postal-codes/postal-codes.schemas.d.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { z } from 'zod'; -/** Strip spaces, uppercase */ -export declare function normalizePostalCode(raw: string): string; -/** Validate Canadian postal code (all provinces) */ -export declare function isValidCanadianPostalCode(code: string): boolean; -export declare const postalCodeParamSchema: z.ZodObject<{ - postalCode: z.ZodEffects, string, string>; -}, "strip", z.ZodTypeAny, { - postalCode: string; -}, { - postalCode: string; -}>; -export declare const postalCodeQuerySchema: z.ZodObject<{ - refresh: z.ZodDefault>>; -}, "strip", z.ZodTypeAny, { - refresh: "false" | "true"; -}, { - refresh?: "false" | "true" | undefined; -}>; -export type PostalCodeParam = z.infer; -export type PostalCodeQuery = z.infer; -//# sourceMappingURL=postal-codes.schemas.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/influence/postal-codes/postal-codes.schemas.d.ts.map b/api/dist/modules/influence/postal-codes/postal-codes.schemas.d.ts.map deleted file mode 100644 index cdaa21d2..00000000 --- a/api/dist/modules/influence/postal-codes/postal-codes.schemas.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"postal-codes.schemas.d.ts","sourceRoot":"","sources":["../../../../src/modules/influence/postal-codes/postal-codes.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,8BAA8B;AAC9B,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED,oDAAoD;AACpD,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE/D;AAED,eAAO,MAAM,qBAAqB;;;;;;EAKhC,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;EAEhC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/influence/postal-codes/postal-codes.schemas.js b/api/dist/modules/influence/postal-codes/postal-codes.schemas.js deleted file mode 100644 index 01eba3f2..00000000 --- a/api/dist/modules/influence/postal-codes/postal-codes.schemas.js +++ /dev/null @@ -1,24 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.postalCodeQuerySchema = exports.postalCodeParamSchema = void 0; -exports.normalizePostalCode = normalizePostalCode; -exports.isValidCanadianPostalCode = isValidCanadianPostalCode; -const zod_1 = require("zod"); -/** Strip spaces, uppercase */ -function normalizePostalCode(raw) { - return raw.replace(/\s/g, '').toUpperCase(); -} -/** Validate Canadian postal code (all provinces) */ -function isValidCanadianPostalCode(code) { - return /^[ABCEGHJKLMNPRSTVXY]\d[ABCEGHJKLMNPRSTVWXYZ]\d[ABCEGHJKLMNPRSTVWXYZ]\d$/.test(code); -} -exports.postalCodeParamSchema = zod_1.z.object({ - postalCode: zod_1.z - .string() - .transform(normalizePostalCode) - .refine(isValidCanadianPostalCode, { message: 'Invalid Canadian postal code' }), -}); -exports.postalCodeQuerySchema = zod_1.z.object({ - refresh: zod_1.z.enum(['true', 'false']).optional().default('false'), -}); -//# sourceMappingURL=postal-codes.schemas.js.map \ No newline at end of file diff --git a/api/dist/modules/influence/postal-codes/postal-codes.schemas.js.map b/api/dist/modules/influence/postal-codes/postal-codes.schemas.js.map deleted file mode 100644 index 8e199d2a..00000000 --- a/api/dist/modules/influence/postal-codes/postal-codes.schemas.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"postal-codes.schemas.js","sourceRoot":"","sources":["../../../../src/modules/influence/postal-codes/postal-codes.schemas.ts"],"names":[],"mappings":";;;AAGA,kDAEC;AAGD,8DAEC;AAVD,6BAAwB;AAExB,8BAA8B;AAC9B,SAAgB,mBAAmB,CAAC,GAAW;IAC7C,OAAO,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;AAC9C,CAAC;AAED,oDAAoD;AACpD,SAAgB,yBAAyB,CAAC,IAAY;IACpD,OAAO,0EAA0E,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC/F,CAAC;AAEY,QAAA,qBAAqB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC5C,UAAU,EAAE,OAAC;SACV,MAAM,EAAE;SACR,SAAS,CAAC,mBAAmB,CAAC;SAC9B,MAAM,CAAC,yBAAyB,EAAE,EAAE,OAAO,EAAE,8BAA8B,EAAE,CAAC;CAClF,CAAC,CAAC;AAEU,QAAA,qBAAqB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC5C,OAAO,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC;CAC/D,CAAC,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/influence/postal-codes/postal-codes.service.d.ts b/api/dist/modules/influence/postal-codes/postal-codes.service.d.ts deleted file mode 100644 index b9408660..00000000 --- a/api/dist/modules/influence/postal-codes/postal-codes.service.d.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { Prisma } from '@prisma/client'; -interface UpsertData { - postalCode: string; - city?: string | null; - province?: string | null; - centroidLat?: number | null; - centroidLng?: number | null; -} -export declare const postalCodesService: { - upsert(data: UpsertData): Promise<{ - id: string; - city: string | null; - postalCode: string; - province: string | null; - lastUpdated: Date; - centroidLat: Prisma.Decimal | null; - centroidLng: Prisma.Decimal | null; - }>; - findByPostalCode(code: string): Promise<{ - id: string; - city: string | null; - postalCode: string; - province: string | null; - lastUpdated: Date; - centroidLat: Prisma.Decimal | null; - centroidLng: Prisma.Decimal | null; - } | null>; - findAll(filters: { - page: number; - limit: number; - search?: string; - }): Promise<{ - postalCodes: { - id: string; - city: string | null; - postalCode: string; - province: string | null; - lastUpdated: Date; - centroidLat: Prisma.Decimal | null; - centroidLng: Prisma.Decimal | null; - }[]; - pagination: { - page: number; - limit: number; - total: number; - totalPages: number; - }; - }>; - delete(code: string): Promise<{ - id: string; - city: string | null; - postalCode: string; - province: string | null; - lastUpdated: Date; - centroidLat: Prisma.Decimal | null; - centroidLng: Prisma.Decimal | null; - }>; -}; -export {}; -//# sourceMappingURL=postal-codes.service.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/influence/postal-codes/postal-codes.service.d.ts.map b/api/dist/modules/influence/postal-codes/postal-codes.service.d.ts.map deleted file mode 100644 index a3ebf891..00000000 --- a/api/dist/modules/influence/postal-codes/postal-codes.service.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"postal-codes.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/influence/postal-codes/postal-codes.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAGxC,UAAU,UAAU;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,eAAO,MAAM,kBAAkB;iBACV,UAAU;;;;;;;;;2BAoBA,MAAM;;;;;;;;;qBAMZ;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;;;;;;;;;;;;;;;;;iBA6BpD,MAAM;;;;;;;;;CAK1B,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/influence/postal-codes/postal-codes.service.js b/api/dist/modules/influence/postal-codes/postal-codes.service.js deleted file mode 100644 index ab3d7fc8..00000000 --- a/api/dist/modules/influence/postal-codes/postal-codes.service.js +++ /dev/null @@ -1,61 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.postalCodesService = void 0; -const database_1 = require("../../../config/database"); -exports.postalCodesService = { - async upsert(data) { - return database_1.prisma.postalCodeCache.upsert({ - where: { postalCode: data.postalCode }, - update: { - city: data.city ?? undefined, - province: data.province ?? undefined, - centroidLat: data.centroidLat ?? undefined, - centroidLng: data.centroidLng ?? undefined, - lastUpdated: new Date(), - }, - create: { - postalCode: data.postalCode, - city: data.city ?? null, - province: data.province ?? null, - centroidLat: data.centroidLat ?? null, - centroidLng: data.centroidLng ?? null, - }, - }); - }, - async findByPostalCode(code) { - return database_1.prisma.postalCodeCache.findUnique({ - where: { postalCode: code }, - }); - }, - async findAll(filters) { - const { page, limit, search } = filters; - const skip = (page - 1) * limit; - const where = {}; - if (search) { - where.OR = [ - { postalCode: { contains: search, mode: 'insensitive' } }, - { city: { contains: search, mode: 'insensitive' } }, - { province: { contains: search, mode: 'insensitive' } }, - ]; - } - const [items, total] = await Promise.all([ - database_1.prisma.postalCodeCache.findMany({ - where, - skip, - take: limit, - orderBy: { lastUpdated: 'desc' }, - }), - database_1.prisma.postalCodeCache.count({ where }), - ]); - return { - postalCodes: items, - pagination: { page, limit, total, totalPages: Math.ceil(total / limit) }, - }; - }, - async delete(code) { - return database_1.prisma.postalCodeCache.delete({ - where: { postalCode: code }, - }); - }, -}; -//# sourceMappingURL=postal-codes.service.js.map \ No newline at end of file diff --git a/api/dist/modules/influence/postal-codes/postal-codes.service.js.map b/api/dist/modules/influence/postal-codes/postal-codes.service.js.map deleted file mode 100644 index efa3fdd7..00000000 --- a/api/dist/modules/influence/postal-codes/postal-codes.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"postal-codes.service.js","sourceRoot":"","sources":["../../../../src/modules/influence/postal-codes/postal-codes.service.ts"],"names":[],"mappings":";;;AACA,uDAAkD;AAUrC,QAAA,kBAAkB,GAAG;IAChC,KAAK,CAAC,MAAM,CAAC,IAAgB;QAC3B,OAAO,iBAAM,CAAC,eAAe,CAAC,MAAM,CAAC;YACnC,KAAK,EAAE,EAAE,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE;YACtC,MAAM,EAAE;gBACN,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,SAAS;gBAC5B,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,SAAS;gBACpC,WAAW,EAAE,IAAI,CAAC,WAAW,IAAI,SAAS;gBAC1C,WAAW,EAAE,IAAI,CAAC,WAAW,IAAI,SAAS;gBAC1C,WAAW,EAAE,IAAI,IAAI,EAAE;aACxB;YACD,MAAM,EAAE;gBACN,UAAU,EAAE,IAAI,CAAC,UAAU;gBAC3B,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,IAAI;gBACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,IAAI;gBAC/B,WAAW,EAAE,IAAI,CAAC,WAAW,IAAI,IAAI;gBACrC,WAAW,EAAE,IAAI,CAAC,WAAW,IAAI,IAAI;aACtC;SACF,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,IAAY;QACjC,OAAO,iBAAM,CAAC,eAAe,CAAC,UAA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AC;YACnC,KAAK,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE;SAC5B,CAAC,CAAC;IACL,CAAC;CACF,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/influence/representatives/represent-api.client.d.ts b/api/dist/modules/influence/representatives/represent-api.client.d.ts deleted file mode 100644 index a1f1a8c8..00000000 --- a/api/dist/modules/influence/representatives/represent-api.client.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -export interface RepresentOffice { - type?: string; - tel?: string; - fax?: string; - postal?: string; -} -export interface RepresentRepresentative { - name: string; - email: string | null; - elected_office: string; - district_name: string; - party_name: string | null; - representative_set_name: string; - url: string; - photo_url: string | null; - offices: RepresentOffice[]; -} -export interface RepresentPostalCodeResponse { - city: string | null; - province: string | null; - centroid: { - type: string; - coordinates: [number, number]; - } | null; - representatives_centroid: RepresentRepresentative[]; - representatives_concordance: RepresentRepresentative[]; -} -declare class RepresentApiClient { - private baseUrl; - constructor(); - getByPostalCode(code: string): Promise; - testConnection(): Promise<{ - ok: boolean; - message: string; - }>; -} -export declare const representApiClient: RepresentApiClient; -export {}; -//# sourceMappingURL=represent-api.client.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/influence/representatives/represent-api.client.d.ts.map b/api/dist/modules/influence/representatives/represent-api.client.d.ts.map deleted file mode 100644 index d70a9384..00000000 --- a/api/dist/modules/influence/representatives/represent-api.client.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"represent-api.client.d.ts","sourceRoot":"","sources":["../../../../src/modules/influence/representatives/represent-api.client.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,uBAAuB,EAAE,MAAM,CAAC;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,OAAO,EAAE,eAAe,EAAE,CAAC;CAC5B;AAED,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACpB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;KAAE,GAAG,IAAI,CAAC;IACjE,wBAAwB,EAAE,uBAAuB,EAAE,CAAC;IACpD,2BAA2B,EAAE,uBAAuB,EAAE,CAAC;CACxD;AAuBD,cAAM,kBAAkB;IACtB,OAAO,CAAC,OAAO,CAAS;;IAMlB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,2BAA2B,CAAC;IA6BnE,cAAc,IAAI,OAAO,CAAC;QAAE,EAAE,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CAyBlE;AAED,eAAO,MAAM,kBAAkB,oBAA2B,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/influence/representatives/represent-api.client.js b/api/dist/modules/influence/representatives/represent-api.client.js deleted file mode 100644 index 98b34387..00000000 --- a/api/dist/modules/influence/representatives/represent-api.client.js +++ /dev/null @@ -1,77 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.representApiClient = void 0; -const env_1 = require("../../../config/env"); -const logger_1 = require("../../../utils/logger"); -// --- In-memory sliding window rate limiter (55/min, under 60/min API limit) --- -const RATE_LIMIT = 55; -const RATE_WINDOW_MS = 60_000; -const requestTimestamps = []; -function checkRateLimit() { - const now = Date.now(); - // Remove timestamps outside the window - while (requestTimestamps.length > 0 && requestTimestamps[0] < now - RATE_WINDOW_MS) { - requestTimestamps.shift(); - } - return requestTimestamps.length < RATE_LIMIT; -} -function recordRequest() { - requestTimestamps.push(Date.now()); -} -// --- API Client --- -class RepresentApiClient { - baseUrl; - constructor() { - this.baseUrl = env_1.env.REPRESENT_API_URL; - } - async getByPostalCode(code) { - if (!checkRateLimit()) { - throw new Error('Represent API rate limit reached. Please try again in a minute.'); - } - const url = `${this.baseUrl}/postcodes/${code}/`; - logger_1.logger.debug(`Represent API request: ${url}`); - const controller = new AbortController(); - const timeout = setTimeout(() => controller.abort(), 10_000); - try { - recordRequest(); - const response = await fetch(url, { - signal: controller.signal, - headers: { Accept: 'application/json' }, - }); - if (!response.ok) { - const text = await response.text().catch(() => ''); - throw new Error(`Represent API error ${response.status}: ${text}`); - } - return (await response.json()); - } - finally { - clearTimeout(timeout); - } - } - async testConnection() { - try { - const url = `${this.baseUrl}/boundary-sets/?limit=1`; - const controller = new AbortController(); - const timeout = setTimeout(() => controller.abort(), 10_000); - try { - const response = await fetch(url, { - signal: controller.signal, - headers: { Accept: 'application/json' }, - }); - if (!response.ok) { - return { ok: false, message: `HTTP ${response.status}` }; - } - return { ok: true, message: 'Represent API is reachable' }; - } - finally { - clearTimeout(timeout); - } - } - catch (err) { - const message = err instanceof Error ? err.message : 'Unknown error'; - return { ok: false, message }; - } - } -} -exports.representApiClient = new RepresentApiClient(); -//# sourceMappingURL=represent-api.client.js.map \ No newline at end of file diff --git a/api/dist/modules/influence/representatives/represent-api.client.js.map b/api/dist/modules/influence/representatives/represent-api.client.js.map deleted file mode 100644 index be429814..00000000 --- a/api/dist/modules/influence/representatives/represent-api.client.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"represent-api.client.js","sourceRoot":"","sources":["../../../../src/modules/influence/representatives/represent-api.client.ts"],"names":[],"mappings":";;;AAAA,6CAA0C;AAC1C,kDAA+C;AA+B/C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O,GAAG,EAAE,CAAC;YACb,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;YACrE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;QAChC,CAAC;IACH,CAAC;CACF;AAEY,QAAA,kBAAkB,GAAG,IAAI,kBAAkB,EAAE,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/influence/representatives/representatives.routes.d.ts b/api/dist/modules/influence/representatives/representatives.routes.d.ts deleted file mode 100644 index 4d9b1adf..00000000 --- a/api/dist/modules/influence/representatives/representatives.routes.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const router: import("express-serve-static-core").Router; -export { router as representativesRouter }; -//# sourceMappingURL=representatives.routes.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/influence/representatives/representatives.routes.d.ts.map b/api/dist/modules/influence/representatives/representatives.routes.d.ts.map deleted file mode 100644 index 164403e5..00000000 --- a/api/dist/modules/influence/representatives/representatives.routes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"representatives.routes.d.ts","sourceRoot":"","sources":["../../../../src/modules/influence/representatives/representatives.routes.ts"],"names":[],"mappings":"AASA,QAAA,MAAM,MAAM,4CAAW,CAAC;AAiHxB,OAAO,EAAE,MAAM,IAAI,qBAAqB,EAAE,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/influence/representatives/representatives.routes.js b/api/dist/modules/influence/representatives/representatives.routes.js deleted file mode 100644 index 3a6f26a7..00000000 --- a/api/dist/modules/influence/representatives/representatives.routes.js +++ /dev/null @@ -1,97 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.representativesRouter = void 0; -const express_1 = require("express"); -const representatives_service_1 = require("./representatives.service"); -const representatives_schemas_1 = require("./representatives.schemas"); -const postal_codes_schemas_1 = require("../postal-codes/postal-codes.schemas"); -const validate_1 = require("../../../middleware/validate"); -const auth_middleware_1 = require("../../../middleware/auth.middleware"); -const rbac_middleware_1 = require("../../../middleware/rbac.middleware"); -const roles_1 = require("../../../utils/roles"); -const router = (0, express_1.Router)(); -exports.representativesRouter = router; -// ============================================= -// PUBLIC ROUTES (no auth required) -// ============================================= -// GET /api/representatives/by-postal/:postalCode — cache-first lookup -router.get('/by-postal/:postalCode', (0, validate_1.validate)(postal_codes_schemas_1.postalCodeParamSchema, 'params'), (0, validate_1.validate)(postal_codes_schemas_1.postalCodeQuerySchema, 'query'), async (req, res, next) => { - try { - const code = req.params.postalCode; - const refresh = req.query.refresh === 'true'; - const result = await representatives_service_1.representativesService.lookupByPostalCode(code, refresh); - res.json(result); - } - catch (err) { - next(err); - } -}); -// GET /api/representatives/test-connection — Represent API health check -router.get('/test-connection', async (_req, res, next) => { - try { - const result = await representatives_service_1.representativesService.testApiConnection(); - res.json(result); - } - catch (err) { - next(err); - } -}); -// ============================================= -// ADMIN ROUTES (auth + role required) -// ============================================= -router.use(auth_middleware_1.authenticate); -router.use((0, rbac_middleware_1.requireRole)(...roles_1.INFLUENCE_ROLES)); -// GET /api/representatives/cache-stats — cache statistics -router.get('/cache-stats', async (_req, res, next) => { - try { - const stats = await representatives_service_1.representativesService.getCacheStats(); - res.json(stats); - } - catch (err) { - next(err); - } -}); -// GET /api/representatives — list all cached reps (paginated) -router.get('/', (0, validate_1.validate)(representatives_schemas_1.listRepresentativesSchema, 'query'), async (req, res, next) => { - try { - const result = await representatives_service_1.representativesService.findAll(req.query); - res.json(result); - } - catch (err) { - next(err); - } -}); -// GET /api/representatives/:id — single cached rep -router.get('/:id', async (req, res, next) => { - try { - const id = req.params.id; - const rep = await representatives_service_1.representativesService.findById(id); - res.json(rep); - } - catch (err) { - next(err); - } -}); -// DELETE /api/representatives/by-postal/:postalCode — clear cache for postal code -router.delete('/by-postal/:postalCode', (0, validate_1.validate)(postal_codes_schemas_1.postalCodeParamSchema, 'params'), async (req, res, next) => { - try { - const code = req.params.postalCode; - const result = await representatives_service_1.representativesService.clearByPostalCode(code); - res.json(result); - } - catch (err) { - next(err); - } -}); -// DELETE /api/representatives/:id — delete single cached rep -router.delete('/:id', async (req, res, next) => { - try { - const id = req.params.id; - await representatives_service_1.representativesService.deleteById(id); - res.status(204).send(); - } - catch (err) { - next(err); - } -}); -//# sourceMappingURL=representatives.routes.js.map \ No newline at end of file diff --git a/api/dist/modules/influence/representatives/representatives.routes.js.map b/api/dist/modules/influence/representatives/representatives.routes.js.map deleted file mode 100644 index 07a0d8c8..00000000 --- a/api/dist/modules/influence/representatives/representatives.routes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"representatives.routes.js","sourceRoot":"","sources":["../../../../src/modules/influence/representatives/representatives.routes.ts"],"names":[],"mappings":";;;AAAA,qCAAkE;AAClE,uEAAmE;AACnE,uEAAsE;AACtE,+EAAoG;AACpG,2DAAwD;AACxD,yEAAmE;AACnE,yEAAkE;AAClE,gDAAuD;AAEvD,MAAM,MAAM,GAAG,IAAA,gBAAM,GAAE,CAAC;AAiHL,uCAAqB;AA/GxC,gDAAgD;AAChD,mCAAmC;AACnC,gDAAgD;AAEhD,sEAAsE;AACtE,MAAM,CAAC,GAAG,CACR,wBAAwB,EACxB,IAAA,mBAAQ,EAAC,4CAAqB,EAAE,QAAQ,CAAC,EACzC,IAAA,mBAAQ,EAAC,4CAAqB,EAAE,OAAO,CAAC,EACxC,KAAK,EAAE,GAAY,EAAE,GAAa,EAAE,IAAkB,EAAE,EAAE;IACxD,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,UAAoB,CAAC;QAC7C,MAAM,OAAO,GAAG,GAAG,CAAC,KAAK,CAAC,OAAO,KAAK,MAAM,CAAC;QAC7C,MAAM,MAAM,GAAG,MAAM,gDAAsB,CAAC,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC9E,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACnB,CAAC;IAA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AAC,MAAM,CAAC,EAAY,CAAC;QACnC,MAAM,gDAAsB,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;QAC5C,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IACzB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,GAAG,CAAC,CAAC;IACZ,CAAC;AACH,CAAC,CACF,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/influence/representatives/representatives.schemas.d.ts b/api/dist/modules/influence/representatives/representatives.schemas.d.ts deleted file mode 100644 index 1b3847ef..00000000 --- a/api/dist/modules/influence/representatives/representatives.schemas.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { z } from 'zod'; -export declare const listRepresentativesSchema: z.ZodObject<{ - page: z.ZodDefault; - limit: z.ZodDefault; - search: z.ZodOptional; - postalCode: z.ZodOptional; -}, "strip", z.ZodTypeAny, { - limit: number; - page: number; - search?: string | undefined; - postalCode?: string | undefined; -}, { - search?: string | undefined; - limit?: number | undefined; - page?: number | undefined; - postalCode?: string | undefined; -}>; -export type ListRepresentativesInput = z.infer; -//# sourceMappingURL=representatives.schemas.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/influence/representatives/representatives.schemas.d.ts.map b/api/dist/modules/influence/representatives/representatives.schemas.d.ts.map deleted file mode 100644 index a68f205a..00000000 --- a/api/dist/modules/influence/representatives/representatives.schemas.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"representatives.schemas.d.ts","sourceRoot":"","sources":["../../../../src/modules/influence/representatives/representatives.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;EAKpC,CAAC;AAEH,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/influence/representatives/representatives.schemas.js b/api/dist/modules/influence/representatives/representatives.schemas.js deleted file mode 100644 index ef18bca1..00000000 --- a/api/dist/modules/influence/representatives/representatives.schemas.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.listRepresentativesSchema = void 0; -const zod_1 = require("zod"); -exports.listRepresentativesSchema = zod_1.z.object({ - page: zod_1.z.coerce.number().int().positive().default(1), - limit: zod_1.z.coerce.number().int().positive().max(100).default(20), - search: zod_1.z.string().optional(), - postalCode: zod_1.z.string().optional(), -}); -//# sourceMappingURL=representatives.schemas.js.map \ No newline at end of file diff --git a/api/dist/modules/influence/representatives/representatives.schemas.js.map b/api/dist/modules/influence/representatives/representatives.schemas.js.map deleted file mode 100644 index 091dcce2..00000000 --- a/api/dist/modules/influence/representatives/representatives.schemas.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"representatives.schemas.js","sourceRoot":"","sources":["../../../../src/modules/influence/representatives/representatives.schemas.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAEX,QAAA,yBAAyB,GAAG,OAAC,CAAC,MAAM,CAAC;IAChD,IAAI,EAAE,OAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IACnD,KAAK,EAAE,OAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IAC9D,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC7B,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/influence/representatives/representatives.service.d.ts b/api/dist/modules/influence/representatives/representatives.service.d.ts deleted file mode 100644 index 34b47854..00000000 --- a/api/dist/modules/influence/representatives/representatives.service.d.ts +++ /dev/null @@ -1,98 +0,0 @@ -import { Prisma } from '@prisma/client'; -import type { ListRepresentativesInput } from './representatives.schemas'; -export declare const representativesService: { - lookupByPostalCode(code: string, forceRefresh?: boolean): Promise<{ - source: "cache"; - postalCode: string; - location: { - city: string | null; - province: string | null; - }; - representatives: { - id: string; - email: string | null; - name: string | null; - url: string | null; - postalCode: string; - cachedAt: Date; - districtName: string | null; - electedOffice: string | null; - partyName: string | null; - representativeSetName: string | null; - photoUrl: string | null; - offices: Prisma.JsonValue | null; - }[]; - } | { - source: "api"; - postalCode: string; - location: { - city: string | null; - province: string | null; - }; - representatives: { - id: null; - postalCode: string; - name: string | null; - email: string | null; - districtName: string | null; - electedOffice: string | null; - partyName: string | null; - representativeSetName: string | null; - url: string | null; - photoUrl: string | null; - offices: import("./represent-api.client").RepresentOffice[]; - cachedAt: string; - }[]; - }>; - findAll(filters: ListRepresentativesInput): Promise<{ - representatives: { - id: string; - email: string | null; - name: string | null; - url: string | null; - postalCode: string; - cachedAt: Date; - districtName: string | null; - electedOffice: string | null; - partyName: string | null; - representativeSetName: string | null; - photoUrl: string | null; - offices: Prisma.JsonValue | null; - }[]; - pagination: { - page: number; - limit: number; - total: number; - totalPages: number; - }; - }>; - findById(id: string): Promise<{ - id: string; - email: string | null; - name: string | null; - url: string | null; - postalCode: string; - cachedAt: Date; - districtName: string | null; - electedOffice: string | null; - partyName: string | null; - representativeSetName: string | null; - photoUrl: string | null; - offices: Prisma.JsonValue | null; - }>; - clearByPostalCode(code: string): Promise<{ - deleted: number; - postalCode: string; - }>; - deleteById(id: string): Promise; - testApiConnection(): Promise<{ - ok: boolean; - message: string; - }>; - getCacheStats(): Promise<{ - totalRepresentatives: number; - postalCodesWithRepresentatives: number; - totalPostalCodes: number; - }>; -}; -//# sourceMappingURL=representatives.service.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/influence/representatives/representatives.service.d.ts.map b/api/dist/modules/influence/representatives/representatives.service.d.ts.map deleted file mode 100644 index 8f5bb84f..00000000 --- a/api/dist/modules/influence/representatives/representatives.service.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"representatives.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/influence/representatives/representatives.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAMxC,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAC;AAY1E,eAAO,MAAM,sBAAsB;6BACF,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAiGd,wBAAwB;;;;;;;;;;;;;;;;;;;;;;iBAmC5B,MAAM;;;;;;;;;;;;;;4BAQK,MAAM;;;;mBAOf,MAAM;;;;;;;;;;CAyB5B,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/influence/representatives/representatives.service.js b/api/dist/modules/influence/representatives/representatives.service.js deleted file mode 100644 index 093b5e77..00000000 --- a/api/dist/modules/influence/representatives/representatives.service.js +++ /dev/null @@ -1,175 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.representativesService = void 0; -const client_1 = require("@prisma/client"); -const database_1 = require("../../../config/database"); -const logger_1 = require("../../../utils/logger"); -const error_handler_1 = require("../../../middleware/error-handler"); -const represent_api_client_1 = require("./represent-api.client"); -const postal_codes_service_1 = require("../postal-codes/postal-codes.service"); -function deduplicateReps(reps) { - const seen = new Set(); - return reps.filter((rep) => { - const key = `${rep.name}|${rep.elected_office}`; - if (seen.has(key)) - return false; - seen.add(key); - return true; - }); -} -exports.representativesService = { - async lookupByPostalCode(code, forceRefresh = false) { - // 1. Check cache unless forcing refresh - if (!forceRefresh) { - const cached = await database_1.prisma.representative.findMany({ - where: { postalCode: code }, - }); - if (cached.length > 0) { - const postalInfo = await postal_codes_service_1.postalCodesService.findByPostalCode(code); - return { - source: 'cache', - postalCode: code, - location: { - city: postalInfo?.city ?? null, - province: postalInfo?.province ?? null, - }, - representatives: cached, - }; - } - } - // 2. Call Represent API - const apiResponse = await represent_api_client_1.representApiClient.getByPostalCode(code); - // Merge centroid + concordance reps and deduplicate - const allReps = [ - ...(apiResponse.representatives_centroid || []), - ...(apiResponse.representatives_concordance || []), - ]; - const uniqueReps = deduplicateReps(allReps); - // 3. Fire-and-forget cache write - const cacheWrite = async () => { - try { - // Delete old cached reps for this postal code - await database_1.prisma.representative.deleteMany({ where: { postalCode: code } }); - // Cache new reps - if (uniqueReps.length > 0) { - await database_1.prisma.representative.createMany({ - data: uniqueReps.map((rep) => ({ - postalCode: code, - name: rep.name || null, - email: rep.email || null, - districtName: rep.district_name || null, - electedOffice: rep.elected_office || null, - partyName: rep.party_name || null, - representativeSetName: rep.representative_set_name || null, - url: rep.url || null, - photoUrl: rep.photo_url || null, - offices: rep.offices ? rep.offices : client_1.Prisma.JsonNull, - })), - }); - } - // Upsert postal code cache - const coords = apiResponse.centroid?.coordinates; - await postal_codes_service_1.postalCodesService.upsert({ - postalCode: code, - city: apiResponse.city, - province: apiResponse.province, - centroidLat: coords ? coords[1] : null, - centroidLng: coords ? coords[0] : null, - }); - } - catch (err) { - logger_1.logger.error('Failed to cache representatives', { postalCode: code, error: err }); - } - }; - // Don't await — fire and forget - cacheWrite(); - // 4. Build response from API data - return { - source: 'api', - postalCode: code, - location: { - city: apiResponse.city ?? null, - province: apiResponse.province ?? null, - }, - representatives: uniqueReps.map((rep) => ({ - id: null, - postalCode: code, - name: rep.name || null, - email: rep.email || null, - districtName: rep.district_name || null, - electedOffice: rep.elected_office || null, - partyName: rep.party_name || null, - representativeSetName: rep.representative_set_name || null, - url: rep.url || null, - photoUrl: rep.photo_url || null, - offices: rep.offices ?? null, - cachedAt: new Date().toISOString(), - })), - }; - }, - async findAll(filters) { - const { page, limit, search, postalCode } = filters; - const skip = (page - 1) * limit; - const where = {}; - if (postalCode) { - where.postalCode = postalCode; - } - if (search) { - where.OR = [ - { name: { contains: search, mode: 'insensitive' } }, - { email: { contains: search, mode: 'insensitive' } }, - { districtName: { contains: search, mode: 'insensitive' } }, - { electedOffice: { contains: search, mode: 'insensitive' } }, - ]; - } - const [representatives, total] = await Promise.all([ - database_1.prisma.representative.findMany({ - where, - skip, - take: limit, - orderBy: { cachedAt: 'desc' }, - }), - database_1.prisma.representative.count({ where }), - ]); - return { - representatives, - pagination: { page, limit, total, totalPages: Math.ceil(total / limit) }, - }; - }, - async findById(id) { - const rep = await database_1.prisma.representative.findUnique({ where: { id } }); - if (!rep) { - throw new error_handler_1.AppError(404, 'Representative not found', 'REPRESENTATIVE_NOT_FOUND'); - } - return rep; - }, - async clearByPostalCode(code) { - const result = await database_1.prisma.representative.deleteMany({ - where: { postalCode: code }, - }); - return { deleted: result.count, postalCode: code }; - }, - async deleteById(id) { - const existing = await database_1.prisma.representative.findUnique({ where: { id } }); - if (!existing) { - throw new error_handler_1.AppError(404, 'Representative not found', 'REPRESENTATIVE_NOT_FOUND'); - } - await database_1.prisma.representative.delete({ where: { id } }); - }, - async testApiConnection() { - return represent_api_client_1.representApiClient.testConnection(); - }, - async getCacheStats() { - const [totalReps, postalCodesWithReps, totalPostalCodes] = await Promise.all([ - database_1.prisma.representative.count(), - database_1.prisma.representative.groupBy({ by: ['postalCode'] }).then((g) => g.length), - database_1.prisma.postalCodeCache.count(), - ]); - return { - totalRepresentatives: totalReps, - postalCodesWithRepresentatives: postalCodesWithReps, - totalPostalCodes, - }; - }, -}; -//# sourceMappingURL=representatives.service.js.map \ No newline at end of file diff --git a/api/dist/modules/influence/representatives/representatives.service.js.map b/api/dist/modules/influence/representatives/representatives.service.js.map deleted file mode 100644 index 8354c1c2..00000000 --- a/api/dist/modules/influence/representatives/representatives.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"representatives.service.js","sourceRoot":"","sources":["../../../../src/modules/influence/representatives/representatives.service.ts"],"names":[],"mappings":";;;AAAA,2CAAwC;AACxC,uDAAkD;AAClD,kDAA+C;AAC/C,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AED,KAAK,CAAC,iBAAiB;QACrB,OAAO,yCAAkB,CAAC,cAAc,EAAE,CAAC;IAC7C,CAAC;IAED,KAAK,CAAC,aAAa;QACjB,MAAM,CAAC,SAAS,EAAE,mBAAmB,EAAE,gBAAgB,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;YAC3E,iBAAM,CAAC,cAAc,CAAC,KAAK,EAAE;YAC7B,iBAAM,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;YAC3E,iBAAM,CAAC,eAAe,CAAC,KAAK,EAAE;SAC/B,CAAC,CAAC;QAEH,OAAO;YACL,oBAAoB,EAAE,SAAS;YAC/B,8BAA8B,EAAE,mBAAmB;YACnD,gBAAgB;SACjB,CAAC;IACJ,CAAC;CACF,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/influence/responses/responses.routes.d.ts b/api/dist/modules/influence/responses/responses.routes.d.ts deleted file mode 100644 index 1a9812dc..00000000 --- a/api/dist/modules/influence/responses/responses.routes.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -declare const campaignPublicRouter: import("express-serve-static-core").Router; -declare const responsesPublicRouter: import("express-serve-static-core").Router; -declare const responsesAdminRouter: import("express-serve-static-core").Router; -export { campaignPublicRouter as responseCampaignPublicRouter, responsesPublicRouter, responsesAdminRouter }; -//# sourceMappingURL=responses.routes.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/influence/responses/responses.routes.d.ts.map b/api/dist/modules/influence/responses/responses.routes.d.ts.map deleted file mode 100644 index c06bb025..00000000 --- a/api/dist/modules/influence/responses/responses.routes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"responses.routes.d.ts","sourceRoot":"","sources":["../../../../src/modules/influence/responses/responses.routes.ts"],"names":[],"mappings":"AAgBA,QAAA,MAAM,oBAAoB,4CAAW,CAAC;AAiDtC,QAAA,MAAM,qBAAqB,4CAAW,CAAC;AA6EvC,QAAA,MAAM,oBAAoB,4CAAW,CAAC;AA6DtC,OAAO,EAAE,oBAAoB,IAAI,4BAA4B,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/influence/responses/responses.routes.js b/api/dist/modules/influence/responses/responses.routes.js deleted file mode 100644 index 25fb5cd7..00000000 --- a/api/dist/modules/influence/responses/responses.routes.js +++ /dev/null @@ -1,198 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.responsesAdminRouter = exports.responsesPublicRouter = exports.responseCampaignPublicRouter = void 0; -const express_1 = require("express"); -const responses_service_1 = require("./responses.service"); -const responses_schemas_1 = require("./responses.schemas"); -const validate_1 = require("../../../middleware/validate"); -const auth_middleware_1 = require("../../../middleware/auth.middleware"); -const auth_middleware_2 = require("../../../middleware/auth.middleware"); -const rbac_middleware_1 = require("../../../middleware/rbac.middleware"); -const rate_limit_1 = require("../../../middleware/rate-limit"); -const roles_1 = require("../../../utils/roles"); -// --- Campaign-scoped public routes (mount at /api/campaigns) --- -const campaignPublicRouter = (0, express_1.Router)(); -exports.responseCampaignPublicRouter = campaignPublicRouter; -// GET /api/campaigns/:slug/responses -campaignPublicRouter.get('/:slug/responses', (0, validate_1.validate)(responses_schemas_1.listPublicResponsesSchema, 'query'), async (req, res, next) => { - try { - const slug = req.params.slug; - const result = await responses_service_1.responsesService.listApproved(slug, req.query); - res.json(result); - } - catch (err) { - next(err); - } -}); -// GET /api/campaigns/:slug/response-stats -campaignPublicRouter.get('/:slug/response-stats', async (req, res, next) => { - try { - const slug = req.params.slug; - const stats = await responses_service_1.responsesService.getStats(slug); - res.json(stats); - } - catch (err) { - next(err); - } -}); -// POST /api/campaigns/:slug/responses -campaignPublicRouter.post('/:slug/responses', rate_limit_1.responseRateLimit, (0, validate_1.validate)(responses_schemas_1.submitResponseSchema), async (req, res, next) => { - try { - const slug = req.params.slug; - const senderIp = req.ip || req.socket.remoteAddress; - const result = await responses_service_1.responsesService.submitResponse(slug, req.body, senderIp); - res.status(201).json(result); - } - catch (err) { - next(err); - } -}); -// --- Response-scoped public routes (mount at /api/responses) --- -const responsesPublicRouter = (0, express_1.Router)(); -exports.responsesPublicRouter = responsesPublicRouter; -// POST /api/responses/:id/upvote -responsesPublicRouter.post('/:id/upvote', auth_middleware_2.optionalAuth, async (req, res, next) => { - try { - const id = req.params.id; - const userIp = req.ip || req.socket.remoteAddress; - const userId = req.user?.id; - const result = await responses_service_1.responsesService.upvote(id, userIp, userId); - res.json(result); - } - catch (err) { - next(err); - } -}); -// DELETE /api/responses/:id/upvote -responsesPublicRouter.delete('/:id/upvote', auth_middleware_2.optionalAuth, async (req, res, next) => { - try { - const id = req.params.id; - const userIp = req.ip || req.socket.remoteAddress; - const userId = req.user?.id; - const result = await responses_service_1.responsesService.removeUpvote(id, userIp, userId); - res.json(result); - } - catch (err) { - next(err); - } -}); -// GET /api/responses/:id/verify/:token — returns HTML page -responsesPublicRouter.get('/:id/verify/:token', async (req, res, next) => { - try { - const id = req.params.id; - const token = req.params.token; - const result = await responses_service_1.responsesService.verify(id, token); - const html = result.success - ? buildResultPage('Response Verified', `Thank you for verifying this response for the "${result.campaignTitle}" campaign. The response has been approved and will now appear on the public response wall.`, '#16a34a') - : buildResultPage('Verification Failed', result.reason || 'Unable to verify this response.', '#dc2626'); - res.type('html').send(html); - } - catch (err) { - next(err); - } -}); -// GET /api/responses/:id/report/:token — returns HTML page -responsesPublicRouter.get('/:id/report/:token', async (req, res, next) => { - try { - const id = req.params.id; - const token = req.params.token; - const result = await responses_service_1.responsesService.report(id, token); - const html = result.success - ? buildResultPage('Response Reported', `This response for the "${result.campaignTitle}" campaign has been flagged as invalid and removed from the public response wall. Thank you for letting us know.`, '#dc2626') - : buildResultPage('Report Failed', result.reason || 'Unable to process this report.', '#dc2626'); - res.type('html').send(html); - } - catch (err) { - next(err); - } -}); -// --- Admin routes (mount at /api/responses) --- -const responsesAdminRouter = (0, express_1.Router)(); -exports.responsesAdminRouter = responsesAdminRouter; -responsesAdminRouter.use(auth_middleware_1.authenticate); -responsesAdminRouter.use((0, rbac_middleware_1.requireRole)(...roles_1.INFLUENCE_ROLES)); -// GET /api/responses -responsesAdminRouter.get('/', (0, validate_1.validate)(responses_schemas_1.listAdminResponsesSchema, 'query'), async (req, res, next) => { - try { - const result = await responses_service_1.responsesService.findAll(req.query); - res.json(result); - } - catch (err) { - next(err); - } -}); -// PATCH /api/responses/:id/status -responsesAdminRouter.patch('/:id/status', (0, validate_1.validate)(responses_schemas_1.updateResponseStatusSchema), async (req, res, next) => { - try { - const id = req.params.id; - const result = await responses_service_1.responsesService.updateStatus(id, req.body); - res.json(result); - } - catch (err) { - next(err); - } -}); -// POST /api/responses/:id/resend-verification -responsesAdminRouter.post('/:id/resend-verification', async (req, res, next) => { - try { - const id = req.params.id; - const result = await responses_service_1.responsesService.resendVerification(id); - res.json(result); - } - catch (err) { - next(err); - } -}); -// DELETE /api/responses/:id -responsesAdminRouter.delete('/:id', async (req, res, next) => { - try { - const id = req.params.id; - await responses_service_1.responsesService.deleteResponse(id); - res.status(204).send(); - } - catch (err) { - next(err); - } -}); -// --- HTML page builder for verify/report endpoints --- -function escapeHtml(unsafe) { - return unsafe - .replace(/&/g, '&') - .replace(//g, '>') - .replace(/"/g, '"') - .replace(/'/g, '''); -} -function buildResultPage(title, message, accentColor) { - const escapedTitle = escapeHtml(title); - const escapedMessage = escapeHtml(message); - return ` - - - - - ${escapedTitle} - Changemaker Lite - - - -
-
-
${accentColor === '#16a34a' ? '✓' : '✗'}
-

${escapedTitle}

-

${escapedMessage}

-
-
Powered by Changemaker Lite
-
- -`; -} -//# sourceMappingURL=responses.routes.js.map \ No newline at end of file diff --git a/api/dist/modules/influence/responses/responses.routes.js.map b/api/dist/modules/influence/responses/responses.routes.js.map deleted file mode 100644 index 19c8730e..00000000 --- a/api/dist/modules/influence/responses/responses.routes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"responses.routes.js","sourceRoot":"","sources":["../../../../src/modules/influence/responses/responses.routes.ts"],"names":[],"mappings":";;;AAAA,qCAAkE;AAClE,2DAAuD;AACvD,2DAK6B;AAC7B,2DAAwD;AACxD,yEAAmE;AACnE,yEAAmE;AACnE,yEAAkE;AAClE,+DAAmE;AACnE,gDAAuD;AAEvD,kEAAkE;AAClE,MAAM,oBAAoB,GAAG,IAAA,gBAAM,GAAE,CAAC;AA2LL,4DAA4B;AAzL7D,qCAAqC;AACrC,oBAAoB,CAAC,GAAG,CACtB,kBAAkB,EAClB,IAAA,mBAAQ,EAAC,6CAAyB,EAAE,OAAO,CAAC,EAC5C,KAAK,EAAE,GAAY,EAAE,GAAa,EAAE,IAAkB,EAAE,EAAE;IACxD,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,IAAc,CAAC;QACvC,MAAM,MAAM,GAAG,MAAM,oCAAgB,CAAC,YAAY,CAAC,IAAI,EAAE,GAAG,CAAC,KAAY,CAAC,CAAC;QAC3E,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACnB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,GAAG,CAAC,CAAC;IACZ,CAAC;AACH,CAAC,CACF,CAAC;AAEF,0CAA0C;AAC1C,oBAAoB,CAAC,GAAG,CACtB,uBAAuB,EACvB,KAAK,EAAE,GAAY,EAAE,GAAa,EAAE,IAAkB,EAAE,EAAE;IACxD,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,IAAc,CAAC;QACvC,MAAM,KAAK,GAAG,MAAM,oCAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACpD,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,GAAG,CAA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C"} \ No newline at end of file diff --git a/api/dist/modules/influence/responses/responses.schemas.d.ts b/api/dist/modules/influence/responses/responses.schemas.d.ts deleted file mode 100644 index b0c27a40..00000000 --- a/api/dist/modules/influence/responses/responses.schemas.d.ts +++ /dev/null @@ -1,110 +0,0 @@ -import { z } from 'zod'; -export declare const submitResponseSchema: z.ZodObject<{ - representativeName: z.ZodString; - representativeLevel: z.ZodNativeEnum<{ - FEDERAL: "FEDERAL"; - PROVINCIAL: "PROVINCIAL"; - MUNICIPAL: "MUNICIPAL"; - SCHOOL_BOARD: "SCHOOL_BOARD"; - }>; - responseType: z.ZodNativeEnum<{ - EMAIL: "EMAIL"; - LETTER: "LETTER"; - PHONE_CALL: "PHONE_CALL"; - MEETING: "MEETING"; - SOCIAL_MEDIA: "SOCIAL_MEDIA"; - OTHER: "OTHER"; - }>; - responseText: z.ZodString; - representativeTitle: z.ZodOptional; - representativeEmail: z.ZodOptional; - userComment: z.ZodOptional; - submittedByName: z.ZodOptional; - submittedByEmail: z.ZodOptional; - isAnonymous: z.ZodDefault>; - sendVerification: z.ZodDefault>; -}, "strip", z.ZodTypeAny, { - representativeName: string; - representativeLevel: "FEDERAL" | "PROVINCIAL" | "MUNICIPAL" | "SCHOOL_BOARD"; - responseType: "EMAIL" | "LETTER" | "PHONE_CALL" | "MEETING" | "SOCIAL_MEDIA" | "OTHER"; - responseText: string; - isAnonymous: boolean; - sendVerification: boolean; - representativeTitle?: string | undefined; - representativeEmail?: string | undefined; - userComment?: string | undefined; - submittedByName?: string | undefined; - submittedByEmail?: string | undefined; -}, { - representativeName: string; - representativeLevel: "FEDERAL" | "PROVINCIAL" | "MUNICIPAL" | "SCHOOL_BOARD"; - responseType: "EMAIL" | "LETTER" | "PHONE_CALL" | "MEETING" | "SOCIAL_MEDIA" | "OTHER"; - responseText: string; - representativeTitle?: string | undefined; - representativeEmail?: string | undefined; - userComment?: string | undefined; - submittedByName?: string | undefined; - submittedByEmail?: string | undefined; - isAnonymous?: boolean | undefined; - sendVerification?: boolean | undefined; -}>; -export declare const listPublicResponsesSchema: z.ZodObject<{ - page: z.ZodDefault; - limit: z.ZodDefault; - sort: z.ZodDefault>>; - level: z.ZodOptional>; -}, "strip", z.ZodTypeAny, { - sort: "upvotes" | "recent" | "verified"; - limit: number; - page: number; - level?: "FEDERAL" | "PROVINCIAL" | "MUNICIPAL" | "SCHOOL_BOARD" | undefined; -}, { - sort?: "upvotes" | "recent" | "verified" | undefined; - level?: "FEDERAL" | "PROVINCIAL" | "MUNICIPAL" | "SCHOOL_BOARD" | undefined; - limit?: number | undefined; - page?: number | undefined; -}>; -export declare const listAdminResponsesSchema: z.ZodObject<{ - page: z.ZodDefault; - limit: z.ZodDefault; - status: z.ZodOptional>; - campaignId: z.ZodOptional; - search: z.ZodOptional; -}, "strip", z.ZodTypeAny, { - limit: number; - page: number; - status?: "APPROVED" | "PENDING" | "REJECTED" | undefined; - search?: string | undefined; - campaignId?: string | undefined; -}, { - status?: "APPROVED" | "PENDING" | "REJECTED" | undefined; - search?: string | undefined; - limit?: number | undefined; - page?: number | undefined; - campaignId?: string | undefined; -}>; -export declare const updateResponseStatusSchema: z.ZodObject<{ - status: z.ZodNativeEnum<{ - PENDING: "PENDING"; - APPROVED: "APPROVED"; - REJECTED: "REJECTED"; - }>; -}, "strip", z.ZodTypeAny, { - status: "APPROVED" | "PENDING" | "REJECTED"; -}, { - status: "APPROVED" | "PENDING" | "REJECTED"; -}>; -export type SubmitResponseInput = z.infer; -export type ListPublicResponsesInput = z.infer; -export type ListAdminResponsesInput = z.infer; -export type UpdateResponseStatusInput = z.infer; -//# sourceMappingURL=responses.schemas.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/influence/responses/responses.schemas.d.ts.map b/api/dist/modules/influence/responses/responses.schemas.d.ts.map deleted file mode 100644 index e79093f5..00000000 --- a/api/dist/modules/influence/responses/responses.schemas.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"responses.schemas.d.ts","sourceRoot":"","sources":["../../../../src/modules/influence/responses/responses.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAY/B,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;EAKpC,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;EAMnC,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;;EAErC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACvE,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AACjF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC/E,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/influence/responses/responses.schemas.js b/api/dist/modules/influence/responses/responses.schemas.js deleted file mode 100644 index 7533f64a..00000000 --- a/api/dist/modules/influence/responses/responses.schemas.js +++ /dev/null @@ -1,35 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.updateResponseStatusSchema = exports.listAdminResponsesSchema = exports.listPublicResponsesSchema = exports.submitResponseSchema = void 0; -const zod_1 = require("zod"); -const client_1 = require("@prisma/client"); -exports.submitResponseSchema = zod_1.z.object({ - representativeName: zod_1.z.string().min(1, 'Representative name is required').max(200), - representativeLevel: zod_1.z.nativeEnum(client_1.GovernmentLevel), - responseType: zod_1.z.nativeEnum(client_1.ResponseType), - responseText: zod_1.z.string().min(1, 'Response text is required').max(5000), - representativeTitle: zod_1.z.string().max(200).optional(), - representativeEmail: zod_1.z.string().email().optional(), - userComment: zod_1.z.string().max(1000).optional(), - submittedByName: zod_1.z.string().max(200).optional(), - submittedByEmail: zod_1.z.string().email().optional(), - isAnonymous: zod_1.z.boolean().optional().default(false), - sendVerification: zod_1.z.boolean().optional().default(false), -}); -exports.listPublicResponsesSchema = zod_1.z.object({ - page: zod_1.z.coerce.number().int().positive().default(1), - limit: zod_1.z.coerce.number().int().positive().max(100).default(20), - sort: zod_1.z.enum(['recent', 'upvotes', 'verified']).optional().default('recent'), - level: zod_1.z.nativeEnum(client_1.GovernmentLevel).optional(), -}); -exports.listAdminResponsesSchema = zod_1.z.object({ - page: zod_1.z.coerce.number().int().positive().default(1), - limit: zod_1.z.coerce.number().int().positive().max(100).default(20), - status: zod_1.z.nativeEnum(client_1.ResponseStatus).optional(), - campaignId: zod_1.z.string().optional(), - search: zod_1.z.string().optional(), -}); -exports.updateResponseStatusSchema = zod_1.z.object({ - status: zod_1.z.nativeEnum(client_1.ResponseStatus), -}); -//# sourceMappingURL=responses.schemas.js.map \ No newline at end of file diff --git a/api/dist/modules/influence/responses/responses.schemas.js.map b/api/dist/modules/influence/responses/responses.schemas.js.map deleted file mode 100644 index c41658fe..00000000 --- a/api/dist/modules/influence/responses/responses.schemas.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"responses.schemas.js","sourceRoot":"","sources":["../../../../src/modules/influence/responses/responses.schemas.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,2CAA+E;AAElE,QAAA,oBAAoB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC3C,kBAAkB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,iCAAiC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;IACjF,mBAAmB,EAAE,OAAC,CAAC,UAAU,CAAC,wBAAe,CAAC;IAClD,YAAY,EAAE,OAAC,CAAC,UAAU,CAAC,qBAAY,CAAC;IACxC,YAAY,EAAE,OAAC,CAA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C,UAAU,CAAC,wBAAe,CAAC,CAAC,QAAQ,EAAE;CAChD,CAAC,CAAC;AAEU,QAAA,wBAAwB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC/C,IAAI,EAAE,OAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IACnD,KAAK,EAAE,OAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IAC9D,MAAM,EAAE,OAAC,CAAC,UAAU,CAAC,uBAAc,CAAC,CAAC,QAAQ,EAAE;IAC/C,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC9B,CAAC,CAAC;AAEU,QAAA,0BAA0B,GAAG,OAAC,CAAC,MAAM,CAAC;IACjD,MAAM,EAAE,OAAC,CAAC,UAAU,CAAC,uBAAc,CAAC;CACrC,CAAC,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/influence/responses/responses.service.d.ts b/api/dist/modules/influence/responses/responses.service.d.ts deleted file mode 100644 index c8c94014..00000000 --- a/api/dist/modules/influence/responses/responses.service.d.ts +++ /dev/null @@ -1,129 +0,0 @@ -import type { SubmitResponseInput, ListPublicResponsesInput, ListAdminResponsesInput, UpdateResponseStatusInput } from './responses.schemas'; -export declare const responsesService: { - submitResponse(slug: string, data: SubmitResponseInput, senderIp?: string): Promise<{ - id: string; - status: import(".prisma/client").$Enums.ResponseStatus; - verificationSent: boolean; - }>; - listApproved(slug: string, filters: ListPublicResponsesInput): Promise<{ - responses: { - id: string; - createdAt: Date; - upvoteCount: number; - representativeName: string; - representativeTitle: string | null; - representativeLevel: import(".prisma/client").$Enums.GovernmentLevel; - responseType: import(".prisma/client").$Enums.ResponseType; - responseText: string; - userComment: string | null; - submittedByName: string | null; - isAnonymous: boolean; - isVerified: boolean; - verifiedAt: Date | null; - }[]; - pagination: { - page: number; - limit: number; - total: number; - totalPages: number; - }; - }>; - getStats(slug: string): Promise<{ - total: number; - verified: number; - totalUpvotes: number; - byLevel: Record; - }>; - upvote(responseId: string, userIp?: string, userId?: string): Promise<{ - success: boolean; - alreadyUpvoted?: undefined; - } | { - success: boolean; - alreadyUpvoted: boolean; - }>; - removeUpvote(responseId: string, userIp?: string, userId?: string): Promise<{ - success: boolean; - }>; - verify(responseId: string, token: string): Promise<{ - success: boolean; - reason: string; - campaignTitle?: undefined; - } | { - success: boolean; - campaignTitle: string; - reason?: undefined; - }>; - report(responseId: string, token: string): Promise<{ - success: boolean; - reason: string; - campaignTitle?: undefined; - } | { - success: boolean; - campaignTitle: string; - reason?: undefined; - }>; - findAll(filters: ListAdminResponsesInput): Promise<{ - responses: { - status: import(".prisma/client").$Enums.ResponseStatus; - id: string; - createdAt: Date; - upvoteCount: number; - campaign: { - id: string; - title: string; - slug: string; - }; - representativeName: string; - representativeTitle: string | null; - representativeLevel: import(".prisma/client").$Enums.GovernmentLevel; - representativeEmail: string | null; - responseType: import(".prisma/client").$Enums.ResponseType; - responseText: string; - userComment: string | null; - submittedByName: string | null; - submittedByEmail: string | null; - isAnonymous: boolean; - isVerified: boolean; - verifiedAt: Date | null; - verifiedBy: string | null; - }[]; - pagination: { - page: number; - limit: number; - total: number; - totalPages: number; - }; - }>; - updateStatus(id: string, data: UpdateResponseStatusInput): Promise<{ - status: import(".prisma/client").$Enums.ResponseStatus; - id: string; - createdAt: Date; - updatedAt: Date; - upvoteCount: number; - submittedByUserId: string | null; - campaignId: string; - campaignSlug: string; - representativeName: string; - representativeTitle: string | null; - representativeLevel: import(".prisma/client").$Enums.GovernmentLevel; - representativeEmail: string | null; - responseType: import(".prisma/client").$Enums.ResponseType; - responseText: string; - userComment: string | null; - screenshotUrl: string | null; - submittedByName: string | null; - submittedByEmail: string | null; - isAnonymous: boolean; - isVerified: boolean; - verificationToken: string | null; - verificationSentAt: Date | null; - verifiedAt: Date | null; - verifiedBy: string | null; - submittedIp: string | null; - }>; - deleteResponse(id: string): Promise; - resendVerification(id: string): Promise<{ - success: boolean; - }>; -}; -//# sourceMappingURL=responses.service.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/influence/responses/responses.service.d.ts.map b/api/dist/modules/influence/responses/responses.service.d.ts.map deleted file mode 100644 index 840a4fd5..00000000 --- a/api/dist/modules/influence/responses/responses.service.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"responses.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/influence/responses/responses.service.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EACV,mBAAmB,EACnB,wBAAwB,EACxB,uBAAuB,EACvB,yBAAyB,EAC1B,MAAM,qBAAqB,CAAC;AAI7B,eAAO,MAAM,gBAAgB;yBAGA,MAAM,QAAQ,mBAAmB,aAAa,MAAM;;;;;uBA8FtD,MAAM,WAAW,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;mBA0D7C,MAAM;;;;;;uBA2BF,MAAM,WAAW,MAAM,WAAW,MAAM;;;;;;;6BAgClC,MAAM,WAAW,MAAM,WAAW,MAAM;;;uBAwB9C,MAAM,SAAS,MAAM;;;;;;;;;uBAqCrB,MAAM,SAAS,MAAM;;;;;;;;;qBA6BvB,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAwDvB,MAAM,QAAQ,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAUrC,MAAM;2BAOF,MAAM;;;CA6CpC,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/influence/responses/responses.service.js b/api/dist/modules/influence/responses/responses.service.js deleted file mode 100644 index beed69c6..00000000 --- a/api/dist/modules/influence/responses/responses.service.js +++ /dev/null @@ -1,400 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.responsesService = void 0; -const crypto_1 = require("crypto"); -const client_1 = require("@prisma/client"); -const database_1 = require("../../../config/database"); -const error_handler_1 = require("../../../middleware/error-handler"); -const email_service_1 = require("../../../services/email.service"); -const notification_queue_service_1 = require("../../../services/notification-queue.service"); -const notification_helper_1 = require("../../../services/notification.helper"); -const env_1 = require("../../../config/env"); -const logger_1 = require("../../../utils/logger"); -const metrics_1 = require("../../../utils/metrics"); -const rocketchat_webhook_service_1 = require("../../../services/rocketchat-webhook.service"); -const VERIFICATION_EXPIRY_DAYS = 30; -exports.responsesService = { - // --- Public --- - async submitResponse(slug, data, senderIp) { - const campaign = await database_1.prisma.campaign.findUnique({ - where: { slug }, - select: { id: true, slug: true, title: true, status: true, showResponseWall: true }, - }); - if (!campaign) { - throw new error_handler_1.AppError(404, 'Campaign not found', 'CAMPAIGN_NOT_FOUND'); - } - if (campaign.status !== client_1.CampaignStatus.ACTIVE) { - throw new error_handler_1.AppError(400, 'Campaign is not active', 'CAMPAIGN_NOT_ACTIVE'); - } - if (!campaign.showResponseWall) { - throw new error_handler_1.AppError(400, 'Response wall is not enabled for this campaign', 'RESPONSE_WALL_DISABLED'); - } - let verificationToken = null; - let verificationSentAt = null; - if (data.sendVerification && data.representativeEmail) { - verificationToken = (0, crypto_1.randomBytes)(32).toString('hex'); - verificationSentAt = new Date(); - } - const response = await database_1.prisma.representativeResponse.create({ - data: { - campaignId: campaign.id, - campaignSlug: campaign.slug, - representativeName: data.representativeName, - representativeTitle: data.representativeTitle, - representativeLevel: data.representativeLevel, - representativeEmail: data.representativeEmail, - responseType: data.responseType, - responseText: data.responseText, - userComment: data.userComment, - submittedByName: data.submittedByName, - submittedByEmail: data.submittedByEmail, - isAnonymous: data.isAnonymous, - status: client_1.ResponseStatus.PENDING, - verificationToken, - verificationSentAt, - submittedIp: senderIp, - }, - }); - if (verificationToken && data.representativeEmail) { - const baseUrl = env_1.env.API_URL; - await email_service_1.emailService.sendResponseVerification({ - recipientEmail: data.representativeEmail, - campaignTitle: campaign.title, - responseType: data.responseType, - responseText: data.responseText, - submitterName: data.isAnonymous ? 'Anonymous' : (data.submittedByName || 'Anonymous'), - verificationUrl: `${baseUrl}/api/responses/${response.id}/verify/${verificationToken}`, - reportUrl: `${baseUrl}/api/responses/${response.id}/report/${verificationToken}`, - }); - } - (0, metrics_1.recordResponseSubmission)(); - // Notification: admin response submitted alert - try { - if (await (0, notification_helper_1.isNotificationEnabled)('notifyAdminResponseSubmitted')) { - const adminEmails = await (0, notification_helper_1.getAdminEmailsByRole)([client_1.UserRole.SUPER_ADMIN, client_1.UserRole.INFLUENCE_ADMIN]); - if (adminEmails.length > 0) { - const adminUrl = `${env_1.env.ADMIN_URL || 'http://localhost:3000'}/app/influence/responses`; - await notification_queue_service_1.notificationQueueService.enqueue({ - type: 'admin-response-submitted', - adminEmails, - campaignTitle: campaign.title, - representativeName: data.representativeName, - responseType: data.responseType, - submitterName: data.isAnonymous ? 'Anonymous' : (data.submittedByName || 'Anonymous'), - adminUrl, - }); - } - } - } - catch (err) { - logger_1.logger.error('Failed to enqueue response submitted notification:', err); - } - // Notify Rocket.Chat - rocketchat_webhook_service_1.rocketchatWebhookService.onCampaignResponseSubmitted({ - campaignTitle: campaign.title, - representativeName: data.representativeName, - }).catch(() => { }); - return { - id: response.id, - status: response.status, - verificationSent: !!verificationToken, - }; - }, - async listApproved(slug, filters) { - const { page, limit, sort, level } = filters; - const skip = (page - 1) * limit; - const where = { - campaignSlug: slug, - status: client_1.ResponseStatus.APPROVED, - }; - if (level) - where.representativeLevel = level; - let orderBy; - switch (sort) { - case 'upvotes': - orderBy = { upvoteCount: 'desc' }; - break; - case 'verified': - orderBy = { isVerified: 'desc' }; - break; - default: - orderBy = { createdAt: 'desc' }; - } - const [responses, total] = await Promise.all([ - database_1.prisma.representativeResponse.findMany({ - where, - skip, - take: limit, - orderBy, - select: { - id: true, - representativeName: true, - representativeTitle: true, - representativeLevel: true, - responseType: true, - responseText: true, - userComment: true, - submittedByName: true, - isAnonymous: true, - isVerified: true, - verifiedAt: true, - upvoteCount: true, - createdAt: true, - }, - }), - database_1.prisma.representativeResponse.count({ where }), - ]); - return { - responses, - pagination: { - page, - limit, - total, - totalPages: Math.ceil(total / limit), - }, - }; - }, - async getStats(slug) { - const where = { campaignSlug: slug, status: client_1.ResponseStatus.APPROVED }; - const [total, verified, upvoteSum, byLevel] = await Promise.all([ - database_1.prisma.representativeResponse.count({ where }), - database_1.prisma.representativeResponse.count({ where: { ...where, isVerified: true } }), - database_1.prisma.representativeResponse.aggregate({ where, _sum: { upvoteCount: true } }), - database_1.prisma.representativeResponse.groupBy({ - by: ['representativeLevel'], - where, - _count: true, - }), - ]); - const levelBreakdown = {}; - for (const row of byLevel) { - levelBreakdown[row.representativeLevel] = row._count; - } - return { - total, - verified, - totalUpvotes: upvoteSum._sum.upvoteCount || 0, - byLevel: levelBreakdown, - }; - }, - async upvote(responseId, userIp, userId) { - // Verify response exists and is approved - const response = await database_1.prisma.representativeResponse.findUnique({ - where: { id: responseId }, - select: { id: true, status: true }, - }); - if (!response) - throw new error_handler_1.AppError(404, 'Response not found', 'RESPONSE_NOT_FOUND'); - if (response.status !== client_1.ResponseStatus.APPROVED) - throw new error_handler_1.AppError(400, 'Response is not approved', 'RESPONSE_NOT_APPROVED'); - try { - await database_1.prisma.responseUpvote.create({ - data: { - responseId, - userId: userId || null, - upvotedIp: !userId ? (userIp || null) : null, - }, - }); - await database_1.prisma.representativeResponse.update({ - where: { id: responseId }, - data: { upvoteCount: { increment: 1 } }, - }); - return { success: true }; - } - catch (err) { - if (err.code === 'P2002') { - return { success: false, alreadyUpvoted: true }; - } - throw err; - } - }, - async removeUpvote(responseId, userIp, userId) { - const where = { responseId }; - if (userId) { - where.userId = userId; - } - else if (userIp) { - where.upvotedIp = userIp; - } - else { - return { success: false }; - } - const deleted = await database_1.prisma.responseUpvote.deleteMany({ where }); - if (deleted.count > 0) { - await database_1.prisma.representativeResponse.update({ - where: { id: responseId }, - data: { - upvoteCount: { decrement: 1 }, - }, - }); - } - return { success: deleted.count > 0 }; - }, - async verify(responseId, token) { - const response = await database_1.prisma.representativeResponse.findUnique({ - where: { id: responseId }, - select: { - id: true, - verificationToken: true, - verificationSentAt: true, - representativeEmail: true, - campaign: { select: { title: true } }, - }, - }); - if (!response || response.verificationToken !== token) { - return { success: false, reason: 'Invalid verification link' }; - } - // Check 30-day expiry - if (response.verificationSentAt) { - const daysSinceSent = (Date.now() - response.verificationSentAt.getTime()) / (1000 * 60 * 60 * 24); - if (daysSinceSent > VERIFICATION_EXPIRY_DAYS) { - return { success: false, reason: 'Verification link has expired' }; - } - } - await database_1.prisma.representativeResponse.update({ - where: { id: responseId }, - data: { - isVerified: true, - verifiedAt: new Date(), - verifiedBy: response.representativeEmail || 'Representative', - status: client_1.ResponseStatus.APPROVED, - }, - }); - return { success: true, campaignTitle: response.campaign.title }; - }, - async report(responseId, token) { - const response = await database_1.prisma.representativeResponse.findUnique({ - where: { id: responseId }, - select: { - id: true, - verificationToken: true, - representativeEmail: true, - campaign: { select: { title: true } }, - }, - }); - if (!response || response.verificationToken !== token) { - return { success: false, reason: 'Invalid verification link' }; - } - await database_1.prisma.representativeResponse.update({ - where: { id: responseId }, - data: { - status: client_1.ResponseStatus.REJECTED, - isVerified: false, - verifiedBy: `Disputed by ${response.representativeEmail || 'representative'}`, - }, - }); - return { success: true, campaignTitle: response.campaign.title }; - }, - // --- Admin --- - async findAll(filters) { - const { page, limit, status, campaignId, search } = filters; - const skip = (page - 1) * limit; - const where = {}; - if (status) - where.status = status; - if (campaignId) - where.campaignId = campaignId; - if (search) { - where.OR = [ - { representativeName: { contains: search, mode: 'insensitive' } }, - { responseText: { contains: search, mode: 'insensitive' } }, - { submittedByName: { contains: search, mode: 'insensitive' } }, - ]; - } - const [responses, total] = await Promise.all([ - database_1.prisma.representativeResponse.findMany({ - where, - skip, - take: limit, - orderBy: { createdAt: 'desc' }, - select: { - id: true, - representativeName: true, - representativeTitle: true, - representativeLevel: true, - representativeEmail: true, - responseType: true, - responseText: true, - userComment: true, - submittedByName: true, - submittedByEmail: true, - isAnonymous: true, - status: true, - isVerified: true, - verifiedAt: true, - verifiedBy: true, - upvoteCount: true, - createdAt: true, - campaign: { select: { id: true, title: true, slug: true } }, - }, - }), - database_1.prisma.representativeResponse.count({ where }), - ]); - return { - responses, - pagination: { - page, - limit, - total, - totalPages: Math.ceil(total / limit), - }, - }; - }, - async updateStatus(id, data) { - const existing = await database_1.prisma.representativeResponse.findUnique({ where: { id } }); - if (!existing) - throw new error_handler_1.AppError(404, 'Response not found', 'RESPONSE_NOT_FOUND'); - return database_1.prisma.representativeResponse.update({ - where: { id }, - data: { status: data.status }, - }); - }, - async deleteResponse(id) { - const existing = await database_1.prisma.representativeResponse.findUnique({ where: { id } }); - if (!existing) - throw new error_handler_1.AppError(404, 'Response not found', 'RESPONSE_NOT_FOUND'); - await database_1.prisma.representativeResponse.delete({ where: { id } }); - }, - async resendVerification(id) { - const response = await database_1.prisma.representativeResponse.findUnique({ - where: { id }, - select: { - id: true, - representativeEmail: true, - representativeName: true, - responseType: true, - responseText: true, - submittedByName: true, - isAnonymous: true, - verificationToken: true, - campaign: { select: { title: true } }, - }, - }); - if (!response) - throw new error_handler_1.AppError(404, 'Response not found', 'RESPONSE_NOT_FOUND'); - if (!response.representativeEmail) { - throw new error_handler_1.AppError(400, 'No representative email on record', 'NO_REPRESENTATIVE_EMAIL'); - } - // Regenerate token - const verificationToken = response.verificationToken || (0, crypto_1.randomBytes)(32).toString('hex'); - await database_1.prisma.representativeResponse.update({ - where: { id }, - data: { - verificationToken, - verificationSentAt: new Date(), - }, - }); - const baseUrl = env_1.env.API_URL; - await email_service_1.emailService.sendResponseVerification({ - recipientEmail: response.representativeEmail, - campaignTitle: response.campaign.title, - responseType: response.responseType, - responseText: response.responseText, - submitterName: response.isAnonymous ? 'Anonymous' : (response.submittedByName || 'Anonymous'), - verificationUrl: `${baseUrl}/api/responses/${id}/verify/${verificationToken}`, - reportUrl: `${baseUrl}/api/responses/${id}/report/${verificationToken}`, - }); - return { success: true }; - }, -}; -//# sourceMappingURL=responses.service.js.map \ No newline at end of file diff --git a/api/dist/modules/influence/responses/responses.service.js.map b/api/dist/modules/influence/responses/responses.service.js.map deleted file mode 100644 index 17e82049..00000000 --- a/api/dist/modules/influence/responses/responses.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"responses.service.js","sourceRoot":"","sources":["../../../../src/modules/influence/responses/responses.service.ts"],"names":[],"mappings":";;;AAAA,mCAAqC;AACrC,2CAAkF;AAClF,uDAAkD;AAClD,qEAA6D;AAC7D,mEAA+D;AAC/D,6FAAwF;AACxF,+EAAoG;AACpG,6CAA0C;AAC1C,kDAA+C;AAC/C,oDAAkE;AAClE,6FAAwF;AAQxF,MAAM,wBAAwB,GAAG,EAAE,CAAC;AAEvB,QAAA,gBAAgB,GAAG;IAC9B,iBAAiB;IAEjB,KAAK,CAAC,cAAc,CAAC,IAAY,EAAE,IAAyB,EAAE,QAAiB;QAC7E,MAAM,QAAQ,GAAG,MAAM,iBAAM,CAAC,QAAQ,CAAC,UAAU,CAAC;YAChD,KAAK,EAAE,EAAE,IAAI,EAAE;YACf,MAAM,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE;SACpF,CAAC,CAAC;QAEH,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,wBAAQ,CAAC,GAAG,EAAE,oBAAoB,EAAE,oBAAoB,CAAC,CAAC;QACtE,CAAC;QACD,IAAI,QAAQ,CAAC,MAAM,KAAK,uBAAc,CAAC,MAAM,EAAE,CAAC;YAC9C,MAAM,IAAI,wBAAQ,CAAC,GAAG,EAAE,wBAAwB,EAAE,qBAAqB,CAAC,CAAC;QAC3E,CAAC;QACD,IAAI,CAAC,QAAQ,CAAC,gBAAgB,EAAE,CAAC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mBAAmB;YAC5C,aAAa,EAAE,QAAQ,CAAC,QAAQ,CAAC,KAAK;YACtC,YAAY,EAAE,QAAQ,CAAC,YAAY;YACnC,YAAY,EAAE,QAAQ,CAAC,YAAY;YACnC,aAAa,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,eAAe,IAAI,WAAW,CAAC;YAC7F,eAAe,EAAE,GAAG,OAAO,kBAAkB,EAAE,WAAW,iBAAiB,EAAE;YAC7E,SAAS,EAAE,GAAG,OAAO,kBAAkB,EAAE,WAAW,iBAAiB,EAAE;SACxE,CAAC,CAAC;QAEH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC;CACF,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/listmonk/listmonk.routes.d.ts b/api/dist/modules/listmonk/listmonk.routes.d.ts deleted file mode 100644 index 4c1a443f..00000000 --- a/api/dist/modules/listmonk/listmonk.routes.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const router: import("express-serve-static-core").Router; -export { router as listmonkRouter }; -//# sourceMappingURL=listmonk.routes.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/listmonk/listmonk.routes.d.ts.map b/api/dist/modules/listmonk/listmonk.routes.d.ts.map deleted file mode 100644 index 3742584a..00000000 --- a/api/dist/modules/listmonk/listmonk.routes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"listmonk.routes.d.ts","sourceRoot":"","sources":["../../../src/modules/listmonk/listmonk.routes.ts"],"names":[],"mappings":"AASA,QAAA,MAAM,MAAM,4CAAW,CAAC;AAwJxB,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/listmonk/listmonk.routes.js b/api/dist/modules/listmonk/listmonk.routes.js deleted file mode 100644 index 8efa267d..00000000 --- a/api/dist/modules/listmonk/listmonk.routes.js +++ /dev/null @@ -1,132 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.listmonkRouter = void 0; -const express_1 = require("express"); -const auth_middleware_1 = require("../../middleware/auth.middleware"); -const rbac_middleware_1 = require("../../middleware/rbac.middleware"); -const listmonk_client_1 = require("../../services/listmonk.client"); -const listmonk_sync_service_1 = require("../../services/listmonk-sync.service"); -const listmonk_event_sync_service_1 = require("../../services/listmonk-event-sync.service"); -const env_1 = require("../../config/env"); -const roles_1 = require("../../utils/roles"); -const router = (0, express_1.Router)(); -exports.listmonkRouter = router; -router.use(auth_middleware_1.authenticate); -router.use((0, rbac_middleware_1.requireRole)(...roles_1.BROADCAST_ROLES)); -// GET /api/listmonk — sync status -router.get('/', async (_req, res, next) => { - try { - const status = listmonk_sync_service_1.listmonkSyncService.getStatus(); - // Live connection check - const connected = await listmonk_client_1.listmonkClient.checkHealth(); - res.json({ ...status, connected }); - } - catch (err) { - next(err); - } -}); -// GET /api/listmonk/stats — list subscriber counts -router.get('/stats', async (_req, res, next) => { - try { - const stats = await listmonk_sync_service_1.listmonkSyncService.getStats(); - res.json(stats); - } - catch (err) { - next(err); - } -}); -// POST /api/listmonk/test-connection -router.post('/test-connection', async (_req, res, next) => { - try { - const healthy = await listmonk_client_1.listmonkClient.checkHealth(); - res.json({ - success: healthy, - message: healthy ? 'Listmonk is reachable' : 'Listmonk is not reachable', - }); - } - catch (err) { - next(err); - } -}); -// POST /api/listmonk/sync/participants -router.post('/sync/participants', async (_req, res, next) => { - try { - const results = await listmonk_sync_service_1.listmonkSyncService.syncCampaignParticipants(); - listmonk_sync_service_1.listmonkSyncService.setLastSyncAt(new Date()); - res.json({ - success: true, - message: `Synced ${results.success}/${results.total} campaign participants`, - results, - }); - } - catch (err) { - listmonk_sync_service_1.listmonkSyncService.setLastError(err instanceof Error ? err.message : String(err)); - next(err); - } -}); -// POST /api/listmonk/sync/locations -router.post('/sync/locations', async (_req, res, next) => { - try { - const results = await listmonk_sync_service_1.listmonkSyncService.syncLocations(); - listmonk_sync_service_1.listmonkSyncService.setLastSyncAt(new Date()); - res.json({ - success: true, - message: `Synced ${results.success}/${results.total} locations`, - results, - }); - } - catch (err) { - listmonk_sync_service_1.listmonkSyncService.setLastError(err instanceof Error ? err.message : String(err)); - next(err); - } -}); -// POST /api/listmonk/sync/users -router.post('/sync/users', async (_req, res, next) => { - try { - const results = await listmonk_sync_service_1.listmonkSyncService.syncUsers(); - listmonk_sync_service_1.listmonkSyncService.setLastSyncAt(new Date()); - res.json({ - success: true, - message: `Synced ${results.success}/${results.total} users`, - results, - }); - } - catch (err) { - listmonk_sync_service_1.listmonkSyncService.setLastError(err instanceof Error ? err.message : String(err)); - next(err); - } -}); -// POST /api/listmonk/sync/all -router.post('/sync/all', async (_req, res, next) => { - try { - const results = await listmonk_sync_service_1.listmonkSyncService.syncAll(); - res.json({ - success: true, - message: 'All syncs completed', - results, - }); - } - catch (err) { - next(err); - } -}); -// POST /api/listmonk/reinitialize -router.post('/reinitialize', async (_req, res, next) => { - try { - await listmonk_sync_service_1.listmonkSyncService.reinitialize(); - res.json({ success: true, message: 'Lists reinitialized' }); - } - catch (err) { - next(err); - } -}); -// GET /api/listmonk/event-sync-stats — event-driven sync stats -router.get('/event-sync-stats', (_req, res) => { - res.json(listmonk_event_sync_service_1.listmonkEventSyncService.getStats()); -}); -// GET /api/listmonk/proxy-url — get proxy port + token for iframe embedding -router.get('/proxy-url', (req, res, _next) => { - const token = req.headers.authorization?.slice(7) || ''; - res.json({ port: env_1.env.LISTMONK_PROXY_PORT, token }); -}); -//# sourceMappingURL=listmonk.routes.js.map \ No newline at end of file diff --git a/api/dist/modules/listmonk/listmonk.routes.js.map b/api/dist/modules/listmonk/listmonk.routes.js.map deleted file mode 100644 index d9e467a9..00000000 --- a/api/dist/modules/listmonk/listmonk.routes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"listmonk.routes.js","sourceRoot":"","sources":["../../../src/modules/listmonk/listmonk.routes.ts"],"names":[],"mappings":";;;AAA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route.service.d.ts deleted file mode 100644 index 3d5bdcb6..00000000 --- a/api/dist/modules/map/canvass/canvass-route.service.d.ts +++ /dev/null @@ -1,16 +0,0 @@ -export interface RouteLocation { - id: string; - latitude: number; - longitude: number; -} -export interface RouteResult { - orderedLocations: RouteLocation[]; - totalDistanceMeters: number; - estimatedMinutes: number; -} -/** - * Nearest-neighbor walking route algorithm. - * Starts from volunteer GPS position or cut polygon centroid. - */ -export declare function calculateWalkingRoute(locations: RouteLocation[], startLat?: number, startLng?: number, cutGeojson?: string): RouteResult; -//# sourceMappingURL=canvass-route.service.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/map/canvass/canvass-route.service.d.ts.map b/api/dist/modules/map/canvass/canvass-route.service.d.ts.map deleted file mode 100644 index 8822edb1..00000000 --- a/api/dist/modules/map/canvass/canvass-route.service.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"canvass-route.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/map/canvass/canvass-route.service.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,WAAW;IAC1B,gBAAgB,EAAE,aAAa,EAAE,CAAC;IAClC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAKD;;;GAGG;AACH,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,aAAa,EAAE,EAC1B,QAAQ,CAAC,EAAE,MAAM,EACjB,QAAQ,CAAC,EAAE,MAAM,EACjB,UAAU,CAAC,EAAE,MAAM,GAClB,WAAW,CAwDb"} \ No newline at end of file diff --git a/api/dist/modules/map/canvass/canvass-route.service.js b/api/dist/modules/map/canvass/canvass-route.service.js deleted file mode 100644 index 453234f8..00000000 --- a/api/dist/modules/map/canvass/canvass-route.service.js +++ /dev/null @@ -1,62 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.calculateWalkingRoute = calculateWalkingRoute; -const spatial_1 = require("../../../utils/spatial"); -const WALKING_SPEED_MPS = 5000 / 60; // 5 km/h in meters per minute -const MINUTES_PER_DOOR = 2; -/** - * Nearest-neighbor walking route algorithm. - * Starts from volunteer GPS position or cut polygon centroid. - */ -function calculateWalkingRoute(locations, startLat, startLng, cutGeojson) { - if (locations.length === 0) { - return { orderedLocations: [], totalDistanceMeters: 0, estimatedMinutes: 0 }; - } - // Determine starting point - let currentLat; - let currentLng; - if (startLat !== undefined && startLng !== undefined) { - currentLat = startLat; - currentLng = startLng; - } - else if (cutGeojson) { - const polygons = (0, spatial_1.parseGeoJsonPolygon)(cutGeojson); - const centroid = (0, spatial_1.calculateCentroid)(polygons[0]); - currentLat = centroid.lat; - currentLng = centroid.lng; - } - else { - // Use first location as starting point - currentLat = locations[0].latitude; - currentLng = locations[0].longitude; - } - const remaining = [...locations]; - const ordered = []; - let totalDistance = 0; - while (remaining.length > 0) { - let nearestIdx = 0; - let nearestDist = Infinity; - for (let i = 0; i < remaining.length; i++) { - const loc = remaining[i]; - const dist = (0, spatial_1.haversineDistance)(currentLat, currentLng, loc.latitude, loc.longitude); - if (dist < nearestDist) { - nearestDist = dist; - nearestIdx = i; - } - } - const nearest = remaining.splice(nearestIdx, 1)[0]; - ordered.push(nearest); - totalDistance += nearestDist; - currentLat = nearest.latitude; - currentLng = nearest.longitude; - } - const walkingMinutes = totalDistance / WALKING_SPEED_MPS; - const doorMinutes = ordered.length * MINUTES_PER_DOOR; - const estimatedMinutes = Math.round(walkingMinutes + doorMinutes); - return { - orderedLocations: ordered, - totalDistanceMeters: Math.round(totalDistance), - estimatedMinutes, - }; -} -//# sourceMappingURL=canvass-route.service.js.map \ No newline at end of file diff --git a/api/dist/modules/map/canvass/canvass-route.service.js.map b/api/dist/modules/map/canvass/canvass-route.service.js.map deleted file mode 100644 index e0b03bc8..00000000 --- a/api/dist/modules/map/canvass/canvass-route.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"canvass-route.service.js","sourceRoot":"","sources":["../../../../src/modules/map/canvass/canvass-route.service.ts"],"names":[],"mappings":";;AAqBA,sDA6DC;AAlFD,oDAAmG;AAcnG,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAAE,CAAC,CAAC,8BAA8B;AACnE,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAE3B;;;GAGG;AACH,SAAgB,qBAAqB,CACnC,SAA0B,EAC1B,QAAiB,EACjB,QAAiB,EACjB,UAAmB;IAEnB,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC3B,OAAO,EAAE,gBAAgB,EAAE,EAAE,EAAE,mBAAmB,EAAE,CAAC,EAAE,gBAAgB,EAAE,CAAC,EAAE,CAAC;IAC/E,CAAC;IAED,2BAA2B;IAC3B,IAAI,UAAkB,CAAC;IACvB,IAAI,UAAkB,CAAC;IAEvB,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QACrD,UAAU,GAAG,QAAQ,CAAC;QACtB,UAAU,GAAG,QAAQ,CAAC;IACxB,CAAC;SAAM,IAAI,UAAU,EAAE,CAAC;QACtB,MAAM,QAAQ,GAAG,IAAA,6BAAmB,EAAC,UAAU,CAAC,CAAC;QACjD,MAAM,QAAQ,GAAG,IAAA,2BAAiB,EAAC,QAAQ,CAAC,CAAC,CAAE,CAAC,CAAC;QACjD,UAAU,GAAG,QAAQ,CAAC,GAAG,CAAC;QAC1B,UAAU,GAAG,QAAQ,CAAC,GAAG,CAAC;IAC5B,CAAC;SAAM,CAAC;QACN,uCAAuC;QACvC,UAAU,GAAG,SAAS,CAAC,CAAC,CAAE,CAAC,QAAQ,CAAC;QACpC,UAAU,GAAG,SAAS,CAAC,CAAC,CAAE,CAAC,SAAS,CAAC;IACvC,CAAC;IAED,MAAM,SAAS,GAAG,CAAC,GAAG,SAAS,CAAC,CAA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git a/api/dist/modules/map/canvass/canvass.routes.d.ts b/api/dist/modules/map/canvass/canvass.routes.d.ts deleted file mode 100644 index 834b379a..00000000 --- a/api/dist/modules/map/canvass/canvass.routes.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -declare const volunteerRouter: import("express-serve-static-core").Router; -declare const adminRouter: import("express-serve-static-core").Router; -export { volunteerRouter as canvassVolunteerRouter, adminRouter as canvassAdminRouter }; -//# sourceMappingURL=canvass.routes.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/map/canvass/canvass.routes.d.ts.map b/api/dist/modules/map/canvass/canvass.routes.d.ts.map deleted file mode 100644 index 325c3866..00000000 --- a/api/dist/modules/map/canvass/canvass.routes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"canvass.routes.d.ts","sourceRoot":"","sources":["../../../../src/modules/map/canvass/canvass.routes.ts"],"names":[],"mappings":"AAyBA,QAAA,MAAM,eAAe,4CAAW,CAAC;AAgQjC,QAAA,MAAM,WAAW,4CAAW,CAAC;AAoG7B,OAAO,EAAE,eAAe,IAAI,sBAAsB,EAAE,WAAW,IAAI,kBAAkB,EAAE,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/canvass/canvass.routes.js b/api/dist/modules/map/canvass/canvass.routes.js deleted file mode 100644 index 80bd8982..00000000 --- a/api/dist/modules/map/canvass/canvass.routes.js +++ /dev/null @@ -1,286 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.canvassAdminRouter = exports.canvassVolunteerRouter = void 0; -const express_1 = require("express"); -const client_1 = require("@prisma/client"); -const canvass_service_1 = require("./canvass.service"); -const canvass_schemas_1 = require("./canvass.schemas"); -const locations_schemas_1 = require("../locations/locations.schemas"); -const locations_service_1 = require("../locations/locations.service"); -const geocoding_service_1 = require("../geocoding/geocoding.service"); -const validate_1 = require("../../../middleware/validate"); -const auth_middleware_1 = require("../../../middleware/auth.middleware"); -const rbac_middleware_1 = require("../../../middleware/rbac.middleware"); -const rate_limit_1 = require("../../../middleware/rate-limit"); -const roles_1 = require("../../../utils/roles"); -// ─── Volunteer Router ──────────────────────────────────────────────── -const volunteerRouter = (0, express_1.Router)(); -exports.canvassVolunteerRouter = volunteerRouter; -volunteerRouter.use(auth_middleware_1.authenticate); -// GET /api/map/canvass/my/assignments -volunteerRouter.get('/my/assignments', async (req, res, next) => { - try { - const assignments = await canvass_service_1.canvassService.getMyAssignments(req.user.id); - res.json(assignments); - } - catch (err) { - next(err); - } -}); -// GET /api/map/canvass/my/stats -volunteerRouter.get('/my/stats', async (req, res, next) => { - try { - const stats = await canvass_service_1.canvassService.getMyStats(req.user.id); - res.json(stats); - } - catch (err) { - next(err); - } -}); -// GET /api/map/canvass/my/visits -volunteerRouter.get('/my/visits', (0, validate_1.validate)(canvass_schemas_1.listMyVisitsSchema, 'query'), async (req, res, next) => { - try { - const result = await canvass_service_1.canvassService.getMyVisits(req.user.id, req.query); - res.json(result); - } - catch (err) { - next(err); - } -}); -// GET /api/map/canvass/my/session -volunteerRouter.get('/my/session', async (req, res, next) => { - try { - const session = await canvass_service_1.canvassService.getActiveSession(req.user.id); - res.json(session); - } - catch (err) { - next(err); - } -}); -// POST /api/map/canvass/sessions -volunteerRouter.post('/sessions', (0, validate_1.validate)(canvass_schemas_1.startSessionSchema), async (req, res, next) => { - try { - const session = await canvass_service_1.canvassService.startSession(req.user.id, req.body); - res.status(201).json(session); - } - catch (err) { - next(err); - } -}); -// POST /api/map/canvass/sessions/:id/end -volunteerRouter.post('/sessions/:id/end', async (req, res, next) => { - try { - const id = req.params.id; - const session = await canvass_service_1.canvassService.endSession(id, req.user.id); - res.json(session); - } - catch (err) { - next(err); - } -}); -// GET /api/map/canvass/cuts/:cutId/locations -volunteerRouter.get('/cuts/:cutId/locations', async (req, res, next) => { - try { - const cutId = req.params.cutId; - const bounds = req.query.minLat ? { - minLat: parseFloat(req.query.minLat), - maxLat: parseFloat(req.query.maxLat), - minLng: parseFloat(req.query.minLng), - maxLng: parseFloat(req.query.maxLng), - } : undefined; - const limit = req.query.limit ? parseInt(req.query.limit) : undefined; - const locations = await canvass_service_1.canvassService.getCutLocationsForCanvass(cutId, req.user.id, bounds, limit); - res.json(locations); - } - catch (err) { - next(err); - } -}); -// GET /api/map/canvass/cuts/:cutId/route -volunteerRouter.get('/cuts/:cutId/route', (0, validate_1.validate)(canvass_schemas_1.walkingRouteSchema, 'query'), async (req, res, next) => { - try { - const cutId = req.params.cutId; - const route = await canvass_service_1.canvassService.getWalkingRoute(cutId, req.user.id, req.query); - res.json(route); - } - catch (err) { - next(err); - } -}); -// GET /api/map/canvass/locations — all locations with visit annotations -volunteerRouter.get('/locations', async (req, res, next) => { - try { - const bounds = req.query.minLat ? { - minLat: parseFloat(req.query.minLat), - maxLat: parseFloat(req.query.maxLat), - minLng: parseFloat(req.query.minLng), - maxLng: parseFloat(req.query.maxLng), - } : undefined; - const limit = req.query.limit ? parseInt(req.query.limit) : undefined; - const locations = await canvass_service_1.canvassService.getAllLocationsForCanvass(req.user.id, bounds, limit); - res.json(locations); - } - catch (err) { - next(err); - } -}); -// PUT /api/map/canvass/locations/:id — role-gated address editing (deprecated path, should be /addresses/:id) -volunteerRouter.put('/locations/:id', (0, validate_1.validate)(canvass_schemas_1.volunteerUpdateLocationSchema), async (req, res, next) => { - try { - const id = req.params.id; - const address = await canvass_service_1.canvassService.updateAddressAsVolunteer(id, req.user.id, req.user.role, req.body); - res.json(address); - } - catch (err) { - next(err); - } -}); -// POST /api/map/canvass/locations — create a new location (role-gated fields) -volunteerRouter.post('/locations', (0, validate_1.validate)(canvass_schemas_1.volunteerCreateLocationSchema), async (req, res, next) => { - try { - const data = { ...req.body }; - // Strip fields based on role - const userRoles = req.user.roles || [req.user.role]; - const isAdmin = userRoles.some((r) => r === client_1.UserRole.SUPER_ADMIN || r === client_1.UserRole.MAP_ADMIN); - if (!isAdmin) { - delete data.firstName; - delete data.lastName; - delete data.email; - delete data.phone; - } - if (userRoles.length === 1 && userRoles[0] === client_1.UserRole.TEMP) { - delete data.supportLevel; - delete data.sign; - delete data.signSize; - delete data.notes; - } - const location = await locations_service_1.locationsService.create(data, req.user.id); - res.status(201).json(location); - } - catch (err) { - next(err); - } -}); -// POST /api/map/canvass/reverse-geocode — reverse geocode lat/lng -volunteerRouter.post('/reverse-geocode', (0, validate_1.validate)(locations_schemas_1.reverseGeocodeSchema), async (req, res, next) => { - try { - const result = await locations_service_1.locationsService.reverseGeocode(req.body.latitude, req.body.longitude); - res.json(result); - } - catch (err) { - next(err); - } -}); -// POST /api/map/canvass/geocode-search — geocode an address for map flyTo -volunteerRouter.post('/geocode-search', rate_limit_1.canvassGeocodeRateLimit, (0, validate_1.validate)(locations_schemas_1.geocodeAddressSchema), async (req, res, next) => { - try { - const result = await geocoding_service_1.geocodingService.geocode(req.body.address); - if (!result) { - res.status(404).json({ error: { message: 'Address not found', code: 'GEOCODE_FAILED' } }); - return; - } - res.json(result); - } - catch (err) { - next(err); - } -}); -// POST /api/map/canvass/visits -volunteerRouter.post('/visits', rate_limit_1.canvassVisitRateLimit, (0, validate_1.validate)(canvass_schemas_1.recordVisitSchema), async (req, res, next) => { - try { - const visit = await canvass_service_1.canvassService.recordVisit(req.user.id, req.body); - res.status(201).json(visit); - } - catch (err) { - next(err); - } -}); -// POST /api/map/canvass/visits/bulk - Record visit to all unvisited units in building -volunteerRouter.post('/visits/bulk', rate_limit_1.canvassBulkVisitRateLimit, // Stricter rate limit for bulk operations -(0, validate_1.validate)(canvass_schemas_1.bulkRecordVisitSchema), async (req, res, next) => { - try { - const result = await canvass_service_1.canvassService.recordBulkVisit(req.user.id, req.body); - res.status(201).json(result); - } - catch (err) { - next(err); - } -}); -// ─── Admin Router ──────────────────────────────────────────────────── -const adminRouter = (0, express_1.Router)(); -exports.canvassAdminRouter = adminRouter; -adminRouter.use(auth_middleware_1.authenticate); -adminRouter.use((0, rbac_middleware_1.requireRole)(...roles_1.MAP_ROLES)); -// GET /api/map/canvass/stats -adminRouter.get('/stats', async (_req, res, next) => { - try { - const stats = await canvass_service_1.canvassService.getAdminStats(); - res.json(stats); - } - catch (err) { - next(err); - } -}); -// GET /api/map/canvass/stats/cuts/:cutId -adminRouter.get('/stats/cuts/:cutId', async (req, res, next) => { - try { - const cutId = req.params.cutId; - const stats = await canvass_service_1.canvassService.getCutStats(cutId); - res.json(stats); - } - catch (err) { - next(err); - } -}); -// GET /api/map/canvass/activity -adminRouter.get('/activity', (0, validate_1.validate)(canvass_schemas_1.adminActivitySchema, 'query'), async (req, res, next) => { - try { - const result = await canvass_service_1.canvassService.getAdminActivity(req.query); - res.json(result); - } - catch (err) { - next(err); - } -}); -// GET /api/map/canvass/volunteers -adminRouter.get('/volunteers', async (_req, res, next) => { - try { - const volunteers = await canvass_service_1.canvassService.getVolunteers(); - res.json(volunteers); - } - catch (err) { - next(err); - } -}); -// GET /api/map/canvass/volunteers/:userId -adminRouter.get('/volunteers/:userId', async (req, res, next) => { - try { - const userId = req.params.userId; - const stats = await canvass_service_1.canvassService.getVolunteerStats(userId); - res.json(stats); - } - catch (err) { - next(err); - } -}); -// GET /api/map/canvass/visits -adminRouter.get('/visits', (0, validate_1.validate)(canvass_schemas_1.adminVisitsSchema, 'query'), async (req, res, next) => { - try { - const result = await canvass_service_1.canvassService.getAdminVisits(req.query); - res.json(result); - } - catch (err) { - next(err); - } -}); -// GET /api/map/canvass/trends -adminRouter.get('/trends', (0, validate_1.validate)(canvass_schemas_1.outcomeTrendsQuerySchema, 'query'), async (req, res, next) => { - try { - const result = await canvass_service_1.canvassService.getOutcomeTrends(req.query); - res.json(result); - } - catch (err) { - next(err); - } -}); -//# sourceMappingURL=canvass.routes.js.map \ No newline at end of file diff --git a/api/dist/modules/map/canvass/canvass.routes.js.map b/api/dist/modules/map/canvass/canvass.routes.js.map deleted file mode 100644 index b6ddfa8e..00000000 --- a/api/dist/modules/map/canvass/canvass.routes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"canvass.routes.js","sourceRoot":"","sources":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C,MAAM,CAAC,CAAC;IACnB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,GAAG,CAAC,CAAC;IACZ,CAAC;AACH,CAAC,CACF,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/canvass/canvass.schemas.d.ts b/api/dist/modules/map/canvass/canvass.schemas.d.ts deleted file mode 100644 index a7f39d56..00000000 --- a/api/dist/modules/map/canvass/canvass.schemas.d.ts +++ /dev/null @@ -1,278 +0,0 @@ -import { z } from 'zod'; -export declare const recordVisitSchema: z.ZodObject<{ - addressId: z.ZodString; - outcome: z.ZodNativeEnum<{ - NOT_HOME: "NOT_HOME"; - REFUSED: "REFUSED"; - MOVED: "MOVED"; - ALREADY_VOTED: "ALREADY_VOTED"; - SPOKE_WITH: "SPOKE_WITH"; - LEFT_LITERATURE: "LEFT_LITERATURE"; - COME_BACK_LATER: "COME_BACK_LATER"; - }>; - supportLevel: z.ZodOptional>; - signRequested: z.ZodDefault>; - signSize: z.ZodOptional; - notes: z.ZodOptional; - durationSeconds: z.ZodOptional; - sessionId: z.ZodOptional; - shiftId: z.ZodOptional; - updateLocation: z.ZodDefault>; -}, "strip", z.ZodTypeAny, { - outcome: "NOT_HOME" | "REFUSED" | "MOVED" | "ALREADY_VOTED" | "SPOKE_WITH" | "LEFT_LITERATURE" | "COME_BACK_LATER"; - signRequested: boolean; - addressId: string; - updateLocation: boolean; - durationSeconds?: number | undefined; - sessionId?: string | undefined; - notes?: string | undefined; - shiftId?: string | undefined; - supportLevel?: "LEVEL_1" | "LEVEL_2" | "LEVEL_3" | "LEVEL_4" | undefined; - signSize?: string | undefined; -}, { - outcome: "NOT_HOME" | "REFUSED" | "MOVED" | "ALREADY_VOTED" | "SPOKE_WITH" | "LEFT_LITERATURE" | "COME_BACK_LATER"; - addressId: string; - durationSeconds?: number | undefined; - sessionId?: string | undefined; - notes?: string | undefined; - shiftId?: string | undefined; - supportLevel?: "LEVEL_1" | "LEVEL_2" | "LEVEL_3" | "LEVEL_4" | undefined; - signRequested?: boolean | undefined; - signSize?: string | undefined; - updateLocation?: boolean | undefined; -}>; -export declare const bulkRecordVisitSchema: z.ZodObject<{ - locationId: z.ZodString; - outcome: z.ZodEnum<["NOT_HOME", "REFUSED", "MOVED"]>; - notes: z.ZodOptional; - sessionId: z.ZodOptional; - shiftId: z.ZodOptional; -}, "strip", z.ZodTypeAny, { - outcome: "NOT_HOME" | "REFUSED" | "MOVED"; - locationId: string; - sessionId?: string | undefined; - notes?: string | undefined; - shiftId?: string | undefined; -}, { - outcome: "NOT_HOME" | "REFUSED" | "MOVED"; - locationId: string; - sessionId?: string | undefined; - notes?: string | undefined; - shiftId?: string | undefined; -}>; -export declare const startSessionSchema: z.ZodObject<{ - cutId: z.ZodString; - shiftId: z.ZodOptional; - startLatitude: z.ZodOptional; - startLongitude: z.ZodOptional; -}, "strip", z.ZodTypeAny, { - cutId: string; - shiftId?: string | undefined; - startLatitude?: number | undefined; - startLongitude?: number | undefined; -}, { - cutId: string; - shiftId?: string | undefined; - startLatitude?: number | undefined; - startLongitude?: number | undefined; -}>; -export declare const endSessionSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>; -export declare const walkingRouteSchema: z.ZodObject<{ - excludeVisited: z.ZodDefault>; - startLatitude: z.ZodOptional; - startLongitude: z.ZodOptional; -}, "strip", z.ZodTypeAny, { - excludeVisited: boolean; - startLatitude?: number | undefined; - startLongitude?: number | undefined; -}, { - startLatitude?: number | undefined; - startLongitude?: number | undefined; - excludeVisited?: boolean | undefined; -}>; -export declare const listMyVisitsSchema: z.ZodObject<{ - page: z.ZodDefault; - limit: z.ZodDefault; -}, "strip", z.ZodTypeAny, { - limit: number; - page: number; -}, { - limit?: number | undefined; - page?: number | undefined; -}>; -export declare const adminActivitySchema: z.ZodObject<{ - page: z.ZodDefault; - limit: z.ZodDefault; - cutId: z.ZodOptional; - userId: z.ZodOptional; - outcome: z.ZodOptional>; -}, "strip", z.ZodTypeAny, { - limit: number; - page: number; - userId?: string | undefined; - outcome?: "NOT_HOME" | "REFUSED" | "MOVED" | "ALREADY_VOTED" | "SPOKE_WITH" | "LEFT_LITERATURE" | "COME_BACK_LATER" | undefined; - cutId?: string | undefined; -}, { - limit?: number | undefined; - userId?: string | undefined; - page?: number | undefined; - outcome?: "NOT_HOME" | "REFUSED" | "MOVED" | "ALREADY_VOTED" | "SPOKE_WITH" | "LEFT_LITERATURE" | "COME_BACK_LATER" | undefined; - cutId?: string | undefined; -}>; -export declare const adminVisitsSchema: z.ZodObject<{ - page: z.ZodDefault; - limit: z.ZodDefault; - cutId: z.ZodOptional; - userId: z.ZodOptional; - shiftId: z.ZodOptional; - outcome: z.ZodOptional>; - sortBy: z.ZodDefault>>; - sortOrder: z.ZodDefault>>; -}, "strip", z.ZodTypeAny, { - limit: number; - page: number; - sortBy: "outcome" | "visitedAt"; - sortOrder: "asc" | "desc"; - userId?: string | undefined; - outcome?: "NOT_HOME" | "REFUSED" | "MOVED" | "ALREADY_VOTED" | "SPOKE_WITH" | "LEFT_LITERATURE" | "COME_BACK_LATER" | undefined; - cutId?: string | undefined; - shiftId?: string | undefined; -}, { - limit?: number | undefined; - userId?: string | undefined; - page?: number | undefined; - sortBy?: "outcome" | "visitedAt" | undefined; - sortOrder?: "asc" | "desc" | undefined; - outcome?: "NOT_HOME" | "REFUSED" | "MOVED" | "ALREADY_VOTED" | "SPOKE_WITH" | "LEFT_LITERATURE" | "COME_BACK_LATER" | undefined; - cutId?: string | undefined; - shiftId?: string | undefined; -}>; -export declare const volunteerUpdateLocationSchema: z.ZodObject<{ - supportLevel: z.ZodOptional>>; - sign: z.ZodOptional; - signSize: z.ZodOptional>; - notes: z.ZodOptional>; - firstName: z.ZodOptional>; - lastName: z.ZodOptional>; - address: z.ZodOptional>; - unitNumber: z.ZodOptional>; - email: z.ZodUnion<[z.ZodOptional>, z.ZodLiteral<"">]>; - phone: z.ZodOptional>; -}, "strip", z.ZodTypeAny, { - email?: string | null | undefined; - phone?: string | null | undefined; - notes?: string | null | undefined; - firstName?: string | null | undefined; - lastName?: string | null | undefined; - supportLevel?: "LEVEL_1" | "LEVEL_2" | "LEVEL_3" | "LEVEL_4" | null | undefined; - address?: string | null | undefined; - unitNumber?: string | null | undefined; - sign?: boolean | undefined; - signSize?: string | null | undefined; -}, { - email?: string | null | undefined; - phone?: string | null | undefined; - notes?: string | null | undefined; - firstName?: string | null | undefined; - lastName?: string | null | undefined; - supportLevel?: "LEVEL_1" | "LEVEL_2" | "LEVEL_3" | "LEVEL_4" | null | undefined; - address?: string | null | undefined; - unitNumber?: string | null | undefined; - sign?: boolean | undefined; - signSize?: string | null | undefined; -}>; -export declare const volunteerCreateLocationSchema: z.ZodObject<{ - address: z.ZodString; - latitude: z.ZodNumber; - longitude: z.ZodNumber; - unitNumber: z.ZodOptional; - supportLevel: z.ZodOptional>; - sign: z.ZodDefault>; - signSize: z.ZodOptional; - notes: z.ZodOptional; - firstName: z.ZodOptional; - lastName: z.ZodOptional; - email: z.ZodUnion<[z.ZodOptional, z.ZodLiteral<"">]>; - phone: z.ZodOptional; -}, "strip", z.ZodTypeAny, { - latitude: number; - longitude: number; - address: string; - sign: boolean; - email?: string | undefined; - phone?: string | undefined; - notes?: string | undefined; - firstName?: string | undefined; - lastName?: string | undefined; - supportLevel?: "LEVEL_1" | "LEVEL_2" | "LEVEL_3" | "LEVEL_4" | undefined; - unitNumber?: string | undefined; - signSize?: string | undefined; -}, { - latitude: number; - longitude: number; - address: string; - email?: string | undefined; - phone?: string | undefined; - notes?: string | undefined; - firstName?: string | undefined; - lastName?: string | undefined; - supportLevel?: "LEVEL_1" | "LEVEL_2" | "LEVEL_3" | "LEVEL_4" | undefined; - unitNumber?: string | undefined; - sign?: boolean | undefined; - signSize?: string | undefined; -}>; -export type RecordVisitInput = z.infer; -export type BulkRecordVisitInput = z.infer; -export type StartSessionInput = z.infer; -export type WalkingRouteInput = z.infer; -export type ListMyVisitsInput = z.infer; -export type AdminActivityInput = z.infer; -export type AdminVisitsInput = z.infer; -export declare const outcomeTrendsQuerySchema: z.ZodObject<{ - granularity: z.ZodDefault>; - dateFrom: z.ZodOptional; - dateTo: z.ZodOptional; -}, "strip", z.ZodTypeAny, { - granularity: "week" | "day"; - dateFrom?: string | undefined; - dateTo?: string | undefined; -}, { - dateFrom?: string | undefined; - dateTo?: string | undefined; - granularity?: "week" | "day" | undefined; -}>; -export type VolunteerUpdateLocationInput = z.infer; -export type VolunteerCreateLocationInput = z.infer; -export type OutcomeTrendsQueryInput = z.infer; -//# sourceMappingURL=canvass.schemas.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/map/canvass/canvass.schemas.d.ts.map b/api/dist/modules/map/canvass/canvass.schemas.d.ts.map deleted file mode 100644 index 925afd1c..00000000 --- a/api/dist/modules/map/canvass/canvass.schemas.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"canvass.schemas.d.ts","sourceRoot":"","sources":["../../../../src/modules/map/canvass/canvass.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAW5B,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;EAMhC,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;EAK7B,CAAC;AAEH,eAAO,MAAM,gBAAgB,gDAE3B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;EAI7B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;EAG7B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;EAM9B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAS5B,CAAC;AAEH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAYxC,CAAC;AAEH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAexC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AACjE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACzE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AACnE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AACnE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AACnE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACrE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AACjE,eAAO,MAAM,wBAAwB;;;;;;;;;;;;EAInC,CAAC;AAEH,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AACzF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AACzF,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/canvass/canvass.schemas.js b/api/dist/modules/map/canvass/canvass.schemas.js deleted file mode 100644 index 422c4878..00000000 --- a/api/dist/modules/map/canvass/canvass.schemas.js +++ /dev/null @@ -1,94 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.outcomeTrendsQuerySchema = exports.volunteerCreateLocationSchema = exports.volunteerUpdateLocationSchema = exports.adminVisitsSchema = exports.adminActivitySchema = exports.listMyVisitsSchema = exports.walkingRouteSchema = exports.endSessionSchema = exports.startSessionSchema = exports.bulkRecordVisitSchema = exports.recordVisitSchema = void 0; -const zod_1 = require("zod"); -const client_1 = require("@prisma/client"); -exports.recordVisitSchema = zod_1.z.object({ - addressId: zod_1.z.string().min(1), // Changed from locationId - outcome: zod_1.z.nativeEnum(client_1.VisitOutcome), - supportLevel: zod_1.z.nativeEnum(client_1.SupportLevel).optional(), - signRequested: zod_1.z.boolean().optional().default(false), - signSize: zod_1.z.string().optional(), - notes: zod_1.z.string().optional(), - durationSeconds: zod_1.z.number().int().optional(), - sessionId: zod_1.z.string().optional(), - shiftId: zod_1.z.string().optional(), - updateLocation: zod_1.z.boolean().optional().default(true), -}); -exports.bulkRecordVisitSchema = zod_1.z.object({ - locationId: zod_1.z.string().min(1), // Building ID - outcome: zod_1.z.enum(['NOT_HOME', 'REFUSED', 'MOVED']), // Only non-contact outcomes - notes: zod_1.z.string().optional(), - sessionId: zod_1.z.string().optional(), - shiftId: zod_1.z.string().optional(), -}); -exports.startSessionSchema = zod_1.z.object({ - cutId: zod_1.z.string().min(1), - shiftId: zod_1.z.string().optional(), - startLatitude: zod_1.z.number().optional(), - startLongitude: zod_1.z.number().optional(), -}); -exports.endSessionSchema = zod_1.z.object({ -// no body required — session id from URL -}); -exports.walkingRouteSchema = zod_1.z.object({ - excludeVisited: zod_1.z.coerce.boolean().optional().default(false), - startLatitude: zod_1.z.coerce.number().optional(), - startLongitude: zod_1.z.coerce.number().optional(), -}); -exports.listMyVisitsSchema = zod_1.z.object({ - page: zod_1.z.coerce.number().int().positive().default(1), - limit: zod_1.z.coerce.number().int().positive().max(100).default(20), -}); -exports.adminActivitySchema = zod_1.z.object({ - page: zod_1.z.coerce.number().int().positive().default(1), - limit: zod_1.z.coerce.number().int().positive().max(100).default(20), - cutId: zod_1.z.string().optional(), - userId: zod_1.z.string().optional(), - outcome: zod_1.z.nativeEnum(client_1.VisitOutcome).optional(), -}); -exports.adminVisitsSchema = zod_1.z.object({ - page: zod_1.z.coerce.number().int().positive().default(1), - limit: zod_1.z.coerce.number().int().positive().max(100).default(50), - cutId: zod_1.z.string().optional(), - userId: zod_1.z.string().optional(), - shiftId: zod_1.z.string().optional(), - outcome: zod_1.z.nativeEnum(client_1.VisitOutcome).optional(), - sortBy: zod_1.z.enum(['visitedAt', 'outcome']).optional().default('visitedAt'), - sortOrder: zod_1.z.enum(['asc', 'desc']).optional().default('desc'), -}); -exports.volunteerUpdateLocationSchema = zod_1.z.object({ - supportLevel: zod_1.z.nativeEnum(client_1.SupportLevel).nullable().optional(), - sign: zod_1.z.boolean().optional(), - signSize: zod_1.z.string().nullable().optional(), - notes: zod_1.z.string().nullable().optional(), - // Admin-only fields (stripped by service for non-admins) - firstName: zod_1.z.string().nullable().optional(), - lastName: zod_1.z.string().nullable().optional(), - address: zod_1.z.string().nullable().optional(), - unitNumber: zod_1.z.string().nullable().optional(), - email: zod_1.z.string().email().nullable().optional().or(zod_1.z.literal('')), - phone: zod_1.z.string().nullable().optional(), -}); -exports.volunteerCreateLocationSchema = zod_1.z.object({ - address: zod_1.z.string().min(1, 'Address is required'), - latitude: zod_1.z.number().min(-90).max(90), - longitude: zod_1.z.number().min(-180).max(180), - unitNumber: zod_1.z.string().optional(), - // USER+ fields (stripped by route for TEMPs) - supportLevel: zod_1.z.nativeEnum(client_1.SupportLevel).optional(), - sign: zod_1.z.boolean().optional().default(false), - signSize: zod_1.z.string().optional(), - notes: zod_1.z.string().optional(), - // Admin-only fields - firstName: zod_1.z.string().optional(), - lastName: zod_1.z.string().optional(), - email: zod_1.z.string().email().optional().or(zod_1.z.literal('')), - phone: zod_1.z.string().optional(), -}); -exports.outcomeTrendsQuerySchema = zod_1.z.object({ - granularity: zod_1.z.enum(['day', 'week']).default('day'), - dateFrom: zod_1.z.string().optional(), - dateTo: zod_1.z.string().optional(), -}); -//# sourceMappingURL=canvass.schemas.js.map \ No newline at end of file diff --git a/api/dist/modules/map/canvass/canvass.schemas.js.map b/api/dist/modules/map/canvass/canvass.schemas.js.map deleted file mode 100644 index b369a14a..00000000 --- a/api/dist/modules/map/canvass/canvass.schemas.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"canvass.schemas.js","sourceRoot":"","sources":["../../../../src/modules/map/canvass/canvass.schemas.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,2CAA4D;AAE/C,QAAA,iBAAiB,GAAG,OAAC,CAAC,MAAM,CAAC;IACxC,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,0BAA0B;IACxD,OAAO,EAAE,OAAC,CAAC,UAAU,CAAC,qBAAY,CAAC;IACnC,YAAY,EAAE,OAAC,CAAC,UAAU,CAAC,qBAAY,CAAC,CAAC,QAAQ,EAAE;IACnD,aAAa,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IACpD,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,eAAe,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IAC5C,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAChC,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC9B,cAAc,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;CACrD,CAAC,CAAC;AAEU,QAAA,qBAAqB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC5C,UAAU,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,E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E,OAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;IACnD,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC9B,CAAC,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/canvass/canvass.service.d.ts b/api/dist/modules/map/canvass/canvass.service.d.ts deleted file mode 100644 index d66da479..00000000 --- a/api/dist/modules/map/canvass/canvass.service.d.ts +++ /dev/null @@ -1,332 +0,0 @@ -import { Prisma, UserRole } from '@prisma/client'; -import type { RecordVisitInput, BulkRecordVisitInput, StartSessionInput, WalkingRouteInput, ListMyVisitsInput, AdminActivityInput, AdminVisitsInput, VolunteerUpdateLocationInput, OutcomeTrendsQueryInput } from './canvass.schemas'; -export declare const canvassService: { - getMyAssignments(userId: string): Promise<{ - shiftId: string; - shiftTitle: string; - shiftDate: Date; - startTime: string; - endTime: string; - location: string | null; - cutId: string; - cutName: string; - completionPercentage: number; - }[]>; - getMyStats(userId: string): Promise<{ - totalVisits: number; - todayVisits: number; - byOutcome: Record; - sessions: number; - }>; - getMyVisits(userId: string, filters: ListMyVisitsInput): Promise<{ - visits: ({ - address: { - id: string; - location: { - address: string; - }; - unitNumber: string | null; - }; - } & { - id: string; - durationSeconds: number | null; - userId: string; - sessionId: string | null; - notes: string | null; - outcome: import(".prisma/client").$Enums.VisitOutcome; - shiftId: string | null; - supportLevel: import(".prisma/client").$Enums.SupportLevel | null; - signRequested: boolean; - signSize: string | null; - visitedAt: Date; - addressId: string; - })[]; - pagination: { - page: number; - limit: number; - total: number; - totalPages: number; - }; - }>; - getActiveSession(userId: string): Promise<({ - shift: { - id: string; - title: string; - } | null; - cut: { - id: string; - name: string; - }; - } & { - status: import(".prisma/client").$Enums.CanvassSessionStatus; - id: string; - userId: string; - cutId: string; - shiftId: string | null; - startedAt: Date; - endedAt: Date | null; - startLatitude: Prisma.Decimal | null; - startLongitude: Prisma.Decimal | null; - }) | null>; - startSession(userId: string, data: StartSessionInput): Promise<{ - shift: { - id: string; - title: string; - } | null; - cut: { - id: string; - name: string; - }; - } & { - status: import(".prisma/client").$Enums.CanvassSessionStatus; - id: string; - userId: string; - cutId: string; - shiftId: string | null; - startedAt: Date; - endedAt: Date | null; - startLatitude: Prisma.Decimal | null; - startLongitude: Prisma.Decimal | null; - }>; - endSession(sessionId: string, userId: string): Promise<{ - status: import(".prisma/client").$Enums.CanvassSessionStatus; - id: string; - userId: string; - cutId: string; - shiftId: string | null; - startedAt: Date; - endedAt: Date | null; - startLatitude: Prisma.Decimal | null; - startLongitude: Prisma.Decimal | null; - }>; - getCutLocationsForCanvass(cutId: string, userId: string, bounds?: { - minLat: number; - maxLat: number; - minLng: number; - maxLng: number; - }, limit?: number): Promise<{ - location: { - latitude: number; - longitude: number; - id: string; - address: string; - buildingNotes: string | null; - }; - lastVisit: { - outcome: import(".prisma/client").$Enums.VisitOutcome; - visitedAt: Date; - visitorName: string | null; - isMyVisit: boolean; - } | null; - id: string; - email: string | null; - phone: string | null; - notes: string | null; - firstName: string | null; - lastName: string | null; - supportLevel: import(".prisma/client").$Enums.SupportLevel | null; - unitNumber: string | null; - sign: boolean; - signSize: string | null; - }[]>; - getAllLocationsForCanvass(userId: string, bounds?: { - minLat: number; - maxLat: number; - minLng: number; - maxLng: number; - }, limit?: number): Promise<{ - location: { - latitude: number; - longitude: number; - id: string; - address: string; - buildingNotes: string | null; - }; - lastVisit: { - outcome: import(".prisma/client").$Enums.VisitOutcome; - visitedAt: Date; - visitorName: string | null; - isMyVisit: boolean; - } | null; - id: string; - email: string | null; - phone: string | null; - notes: string | null; - firstName: string | null; - lastName: string | null; - supportLevel: import(".prisma/client").$Enums.SupportLevel | null; - unitNumber: string | null; - sign: boolean; - signSize: string | null; - }[]>; - updateAddressAsVolunteer(addressId: string, userId: string, role: UserRole, data: VolunteerUpdateLocationInput): Promise<{ - id: string; - email: string | null; - phone: string | null; - createdAt: Date; - updatedAt: Date; - notes: string | null; - createdByUserId: string | null; - updatedByUserId: string | null; - firstName: string | null; - lastName: string | null; - supportLevel: import(".prisma/client").$Enums.SupportLevel | null; - unitNumber: string | null; - addrGuid: string | null; - sign: boolean; - signSize: string | null; - locationId: string; - }>; - getWalkingRoute(cutId: string, userId: string, filters: WalkingRouteInput): Promise; - recordVisit(userId: string, data: RecordVisitInput): Promise<{ - address: { - id: string; - location: { - address: string; - }; - unitNumber: string | null; - }; - } & { - id: string; - durationSeconds: number | null; - userId: string; - sessionId: string | null; - notes: string | null; - outcome: import(".prisma/client").$Enums.VisitOutcome; - shiftId: string | null; - supportLevel: import(".prisma/client").$Enums.SupportLevel | null; - signRequested: boolean; - signSize: string | null; - visitedAt: Date; - addressId: string; - }>; - recordBulkVisit(userId: string, data: BulkRecordVisitInput): Promise<{ - created: number; - visits: { - id: string; - durationSeconds: number | null; - userId: string; - sessionId: string | null; - notes: string | null; - outcome: import(".prisma/client").$Enums.VisitOutcome; - shiftId: string | null; - supportLevel: import(".prisma/client").$Enums.SupportLevel | null; - signRequested: boolean; - signSize: string | null; - visitedAt: Date; - addressId: string; - }[]; - }>; - getAdminStats(): Promise<{ - totalVisits: number; - todayVisits: number; - activeSessions: number; - activeVolunteers: number; - overallCompletion: number; - }>; - getCutStats(cutId: string): Promise<{ - cutId: string; - cutName: string; - totalLocations: number; - visitedLocations: number; - completionPercentage: number; - totalVisits: number; - byOutcome: Record; - }>; - getAdminActivity(filters: AdminActivityInput): Promise<{ - visits: ({ - user: { - id: string; - email: string; - name: string | null; - }; - address: { - id: string; - location: { - address: string; - }; - unitNumber: string | null; - }; - } & { - id: string; - durationSeconds: number | null; - userId: string; - sessionId: string | null; - notes: string | null; - outcome: import(".prisma/client").$Enums.VisitOutcome; - shiftId: string | null; - supportLevel: import(".prisma/client").$Enums.SupportLevel | null; - signRequested: boolean; - signSize: string | null; - visitedAt: Date; - addressId: string; - })[]; - pagination: { - page: number; - limit: number; - total: number; - totalPages: number; - }; - }>; - getVolunteers(): Promise<{ - userId: string; - name: string | null; - email: string; - totalVisits: number; - sessions: number; - lastActive: Date | null; - }[]>; - getVolunteerStats(userId: string): Promise<{ - totalVisits: number; - todayVisits: number; - byOutcome: Record; - sessions: number; - }>; - getAdminVisits(filters: AdminVisitsInput): Promise<{ - visits: ({ - user: { - id: string; - email: string; - name: string | null; - }; - address: { - id: string; - location: { - address: string; - }; - unitNumber: string | null; - }; - } & { - id: string; - durationSeconds: number | null; - userId: string; - sessionId: string | null; - notes: string | null; - outcome: import(".prisma/client").$Enums.VisitOutcome; - shiftId: string | null; - supportLevel: import(".prisma/client").$Enums.SupportLevel | null; - signRequested: boolean; - signSize: string | null; - visitedAt: Date; - addressId: string; - })[]; - pagination: { - page: number; - limit: number; - total: number; - totalPages: number; - }; - }>; - getOutcomeTrends(filters: OutcomeTrendsQueryInput): Promise<{ - granularity: "week" | "day"; - dateFrom: string; - dateTo: string; - series: { - date: string; - }[]; - totals: Record; - }>; - recalculateCutCompletion(cutId: string): Promise; - closeAbandonedSessions(): Promise; -}; -//# sourceMappingURL=canvass.service.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/map/canvass/canvass.service.d.ts.map b/api/dist/modules/map/canvass/canvass.service.d.ts.map deleted file mode 100644 index ed2abe3f..00000000 --- a/api/dist/modules/map/canvass/canvass.service.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"canvass.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/map/canvass/canvass.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAoD,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAgBpG,OAAO,KAAK,EACV,gBAAgB,EAChB,oBAAoB,EACpB,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,4BAA4B,EAC5B,uBAAuB,EACxB,MAAM,mBAAmB,CAAC;AAwE3B,eAAO,MAAM,cAAc;6BAGM,MAAM;;;;;;;;;;;uBAgCZ,MAAM;;;;;;wBAuBL,MAAM,WAAW,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BA6B7B,MAAM;;;;;;;;;;;;;;;;;;;;yBAUV,MAAM,QAAQ,iBAAiB;;;;;;;;;;;;;;;;;;;;0BAgC9B,MAAM,UAAU,MAAM;;;;;;;;;;;qCA4GzC,MAAM,UACL,MAAM,WACL;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,UACnE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;sCAoGN,MAAM,WACL;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,UACnE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;wCAuFH,MAAM,UACT,MAAM,QACR,QAAQ,QACR,4BAA4B;;;;;;;;;;;;;;;;;;2BA+BP,MAAM,UAAU,MAAM,WAAW,iBAAiB;wBA2BrD,MAAM,QAAQ,gBAAgB;;;;;;;;;;;;;;;;;;;;;;4BAuH1B,MAAM,QAAQ,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;uBAqHvC,MAAM;;;;;;;;;8BAuDC,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BA0FlB,MAAM;;;;;;4BAIR,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BA0Dd,uBAAuB;;;;;;;;;oCAoDjB,MAAM;;CA8D7C,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/canvass/canvass.service.js b/api/dist/modules/map/canvass/canvass.service.js deleted file mode 100644 index bc4695f7..00000000 --- a/api/dist/modules/map/canvass/canvass.service.js +++ /dev/null @@ -1,980 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.canvassService = void 0; -const client_1 = require("@prisma/client"); -const library_1 = require("@prisma/client/runtime/library"); -const database_1 = require("../../../config/database"); -const error_handler_1 = require("../../../middleware/error-handler"); -const logger_1 = require("../../../utils/logger"); -const metrics_1 = require("../../../utils/metrics"); -const spatial_1 = require("../../../utils/spatial"); -const crm_activity_1 = require("../../../utils/crm-activity"); -const canvass_route_service_1 = require("./canvass-route.service"); -const metrics_2 = require("../../../utils/metrics"); -const notification_queue_service_1 = require("../../../services/notification-queue.service"); -const notification_helper_1 = require("../../../services/notification.helper"); -const env_1 = require("../../../config/env"); -const rocketchat_webhook_service_1 = require("../../../services/rocketchat-webhook.service"); -const listmonk_event_sync_service_1 = require("../../../services/listmonk-event-sync.service"); -const achievements_service_1 = require("../../social/achievements.service"); -const ADDRESS_SELECT = { - id: true, - unitNumber: true, - firstName: true, - lastName: true, - email: true, - phone: true, - supportLevel: true, - sign: true, - signSize: true, - notes: true, - location: { - select: { - id: true, - latitude: true, - longitude: true, - address: true, - buildingNotes: true, - }, - }, -}; -async function annotateAddressesWithVisits(addresses, userId) { - const addressIds = addresses.map((a) => a.id); - if (addressIds.length === 0) - return []; - const latestVisits = await database_1.prisma.canvassVisit.findMany({ - where: { addressId: { in: addressIds } }, - orderBy: { visitedAt: 'desc' }, - distinct: ['addressId'], - select: { - addressId: true, - outcome: true, - visitedAt: true, - userId: true, - user: { select: { name: true } }, - }, - }); - const visitMap = new Map(latestVisits.map((v) => [v.addressId, v])); - return addresses.map((addr) => { - const visit = visitMap.get(addr.id); - return { - ...addr, - location: { - ...addr.location, - latitude: Number(addr.location.latitude), - longitude: Number(addr.location.longitude), - }, - lastVisit: visit - ? { - outcome: visit.outcome, - visitedAt: visit.visitedAt, - visitorName: visit.user?.name ?? null, - isMyVisit: visit.userId === userId, - } - : null, - }; - }); -} -const ADMIN_ADDRESS_FIELDS = ['firstName', 'lastName', 'unitNumber', 'email', 'phone']; -const VOLUNTEER_ADDRESS_FIELDS = ['supportLevel', 'sign', 'signSize', 'notes']; -exports.canvassService = { - // ─── Volunteer Methods ───────────────────────────────────────────── - async getMyAssignments(userId) { - const signups = await database_1.prisma.shiftSignup.findMany({ - where: { - userId, - status: client_1.SignupStatus.CONFIRMED, - shift: { cutId: { not: null } }, - }, - include: { - shift: { - include: { - cut: { select: { id: true, name: true, completionPercentage: true, geojson: true } }, - }, - }, - }, - orderBy: { shift: { date: 'asc' } }, - }); - return signups - .filter((s) => s.shift.cut) - .map((s) => ({ - shiftId: s.shift.id, - shiftTitle: s.shift.title, - shiftDate: s.shift.date, - startTime: s.shift.startTime, - endTime: s.shift.endTime, - location: s.shift.location, - cutId: s.shift.cut.id, - cutName: s.shift.cut.name, - completionPercentage: s.shift.cut.completionPercentage, - })); - }, - async getMyStats(userId) { - const today = new Date(); - today.setHours(0, 0, 0, 0); - const [totalVisits, todayVisits, byOutcome, sessions] = await Promise.all([ - database_1.prisma.canvassVisit.count({ where: { userId } }), - database_1.prisma.canvassVisit.count({ where: { userId, visitedAt: { gte: today } } }), - database_1.prisma.canvassVisit.groupBy({ - by: ['outcome'], - where: { userId }, - _count: true, - }), - database_1.prisma.canvassSession.count({ where: { userId } }), - ]); - const outcomeMap = {}; - for (const row of byOutcome) { - outcomeMap[row.outcome] = row._count; - } - return { totalVisits, todayVisits, byOutcome: outcomeMap, sessions }; - }, - async getMyVisits(userId, filters) { - const { page, limit } = filters; - const skip = (page - 1) * limit; - const [visits, total] = await Promise.all([ - database_1.prisma.canvassVisit.findMany({ - where: { userId }, - skip, - take: limit, - orderBy: { visitedAt: 'desc' }, - include: { - address: { - select: { - id: true, - unitNumber: true, - location: { select: { address: true } }, - }, - }, - }, - }), - database_1.prisma.canvassVisit.count({ where: { userId } }), - ]); - return { - visits, - pagination: { page, limit, total, totalPages: Math.ceil(total / limit) }, - }; - }, - async getActiveSession(userId) { - return database_1.prisma.canvassSession.findFirst({ - where: { userId, status: client_1.CanvassSessionStatus.ACTIVE }, - include: { - cut: { select: { id: true, name: true } }, - shift: { select: { id: true, title: true } }, - }, - }); - }, - async startSession(userId, data) { - // Check for existing active session - const existing = await database_1.prisma.canvassSession.findFirst({ - where: { userId, status: client_1.CanvassSessionStatus.ACTIVE }, - }); - if (existing) { - throw new error_handler_1.AppError(409, 'You already have an active canvass session', 'SESSION_ACTIVE'); - } - // Verify cut exists - const cut = await database_1.prisma.cut.findUnique({ where: { id: data.cutId } }); - if (!cut) { - throw new error_handler_1.AppError(404, 'Cut not found', 'CUT_NOT_FOUND'); - } - const session = await database_1.prisma.canvassSession.create({ - data: { - userId, - cutId: data.cutId, - shiftId: data.shiftId, - startLatitude: data.startLatitude, - startLongitude: data.startLongitude, - }, - include: { - cut: { select: { id: true, name: true } }, - shift: { select: { id: true, title: true } }, - }, - }); - return session; - }, - async endSession(sessionId, userId) { - const session = await database_1.prisma.canvassSession.findUnique({ where: { id: sessionId } }); - if (!session) { - throw new error_handler_1.AppError(404, 'Session not found', 'SESSION_NOT_FOUND'); - } - if (session.userId !== userId) { - throw new error_handler_1.AppError(403, 'Not your session', 'FORBIDDEN'); - } - if (session.status !== client_1.CanvassSessionStatus.ACTIVE) { - throw new error_handler_1.AppError(400, 'Session is not active', 'SESSION_NOT_ACTIVE'); - } - const updated = await database_1.prisma.canvassSession.update({ - where: { id: sessionId }, - data: { status: client_1.CanvassSessionStatus.COMPLETED, endedAt: new Date() }, - }); - // Recalculate cut completion percentage - await this.recalculateCutCompletion(session.cutId); - // Notify Rocket.Chat - try { - const [rcUser, rcCut, rcVisitCount] = await Promise.all([ - database_1.prisma.user.findUnique({ where: { id: userId }, select: { name: true, email: true } }), - database_1.prisma.cut.findUnique({ where: { id: session.cutId }, select: { name: true } }), - database_1.prisma.canvassVisit.count({ where: { sessionId } }), - ]); - rocketchat_webhook_service_1.rocketchatWebhookService.onCanvassSessionCompleted({ - userName: rcUser?.name || rcUser?.email || 'Unknown', - visitCount: rcVisitCount, - cutName: rcCut?.name || undefined, - }).catch(() => { }); - } - catch { /* non-critical */ } - // Notification: volunteer session summary - try { - if (await (0, notification_helper_1.isNotificationEnabled)('notifyVolunteerSessionSummary')) { - const [user, cut, visitCount, outcomeGroups, trackingSession] = await Promise.all([ - database_1.prisma.user.findUnique({ where: { id: userId }, select: { email: true, name: true } }), - database_1.prisma.cut.findUnique({ where: { id: session.cutId }, select: { name: true } }), - database_1.prisma.canvassVisit.count({ where: { sessionId } }), - database_1.prisma.canvassVisit.groupBy({ by: ['outcome'], where: { sessionId }, _count: true }), - database_1.prisma.trackingSession.findFirst({ - where: { userId, canvassSessionId: sessionId }, - select: { totalDistanceM: true }, - }), - ]); - if (user && visitCount > 0) { - const durationMs = updated.endedAt - ? updated.endedAt.getTime() - session.startedAt.getTime() - : 0; - const durationMinutes = Math.round(durationMs / 60000); - const distanceKm = trackingSession?.totalDistanceM - ? Number(trackingSession.totalDistanceM) / 1000 - : 0; - const outcomeBreakdown = {}; - for (const row of outcomeGroups) { - outcomeBreakdown[row.outcome] = row._count; - } - await notification_queue_service_1.notificationQueueService.enqueue({ - type: 'volunteer-session-summary', - volunteerEmail: user.email, - volunteerName: user.name || user.email, - cutName: cut?.name || 'Unknown area', - sessionDate: session.startedAt.toLocaleDateString('en-CA', { - weekday: 'long', year: 'numeric', month: 'long', day: 'numeric', - }), - visitCount, - durationMinutes, - distanceKm, - outcomeBreakdown, - }); - } - } - } - catch (err) { - logger_1.logger.error('Failed to enqueue session summary notification:', err); - } - // Listmonk event sync — add canvasser to subscribers - try { - const [syncUser, syncCut, syncVisitCount, syncOutcomes] = await Promise.all([ - database_1.prisma.user.findUnique({ where: { id: userId }, select: { email: true, name: true } }), - database_1.prisma.cut.findUnique({ where: { id: session.cutId }, select: { name: true } }), - database_1.prisma.canvassVisit.count({ where: { sessionId } }), - database_1.prisma.canvassVisit.groupBy({ by: ['outcome'], where: { sessionId }, _count: true }), - ]); - if (syncUser) { - const outcomes = {}; - for (const row of syncOutcomes) { - outcomes[row.outcome] = row._count; - } - listmonk_event_sync_service_1.listmonkEventSyncService.onCanvassSessionCompleted({ - email: syncUser.email, - name: syncUser.name || syncUser.email, - cutName: syncCut?.name || 'Unknown', - visitCount: syncVisitCount, - outcomes, - }).catch(() => { }); - } - } - catch { /* non-critical */ } - return updated; - }, - async getCutLocationsForCanvass(cutId, userId, bounds, limit) { - const startTime = Date.now(); - const cut = await database_1.prisma.cut.findUnique({ where: { id: cutId } }); - if (!cut) { - throw new error_handler_1.AppError(404, 'Cut not found', 'CUT_NOT_FOUND'); - } - const polygons = (0, spatial_1.parseGeoJsonPolygon)(cut.geojson); - // Two-stage filtering: bounds first (fast DB query), then polygon (in-memory) - const where = {}; - if (bounds) { - // Convert to Decimal for proper PostgreSQL type matching - where.latitude = { - gte: new library_1.Decimal(bounds.minLat.toString()), - lte: new library_1.Decimal(bounds.maxLat.toString()) - }; - where.longitude = { - gte: new library_1.Decimal(bounds.minLng.toString()), - lte: new library_1.Decimal(bounds.maxLng.toString()) - }; - } - // CRITICAL: Apply limit to ADDRESSES not locations - // Fetch more locations than needed to account for multi-unit buildings - const addressLimit = Math.min(limit || 5000, 5000); - const locationFetchLimit = Math.ceil(addressLimit * 1.5); // Fetch 50% more locations to ensure we get enough addresses - const allLocations = await database_1.prisma.location.findMany({ - where, - select: { - id: true, - latitude: true, - longitude: true, - address: true, - buildingNotes: true, - addresses: { - select: { - id: true, - unitNumber: true, - firstName: true, - lastName: true, - email: true, - phone: true, - supportLevel: true, - sign: true, - signSize: true, - notes: true, - }, - }, - }, - take: locationFetchLimit, - }); - // Filter locations by polygon and flatten addresses, RESPECTING ADDRESS LIMIT - const addressesInCut = []; - let addressCount = 0; - for (const loc of allLocations) { - // Stop if we've reached the address limit - if (addressCount >= addressLimit) { - break; - } - const lat = Number(loc.latitude); - const lng = Number(loc.longitude); - if (polygons.some((poly) => (0, spatial_1.isPointInPolygon)(lat, lng, poly))) { - for (const addr of loc.addresses) { - // Check limit before adding each address - if (addressCount >= addressLimit) { - break; - } - addressesInCut.push({ - ...addr, - location: { - id: loc.id, - latitude: loc.latitude, - longitude: loc.longitude, - address: loc.address, - buildingNotes: loc.buildingNotes, - }, - }); - addressCount++; - } - } - } - const result = await annotateAddressesWithVisits(addressesInCut, userId); - const durationSeconds = (Date.now() - startTime) / 1000; - (0, metrics_1.recordLocationQuery)('canvass_cut', !!bounds, result.length, durationSeconds); - return result; - }, - async getAllLocationsForCanvass(userId, bounds, limit) { - const startTime = Date.now(); - const where = {}; - if (bounds) { - // Convert to Decimal for proper PostgreSQL type matching - where.latitude = { - gte: new library_1.Decimal(bounds.minLat.toString()), - lte: new library_1.Decimal(bounds.maxLat.toString()) - }; - where.longitude = { - gte: new library_1.Decimal(bounds.minLng.toString()), - lte: new library_1.Decimal(bounds.maxLng.toString()) - }; - } - // CRITICAL: Apply limit to ADDRESSES not locations - // Fetch more locations than needed to account for multi-unit buildings - const addressLimit = Math.min(limit || 5000, 5000); - const locationFetchLimit = Math.ceil(addressLimit * 1.5); // Fetch 50% more locations to ensure we get enough addresses - const allLocations = await database_1.prisma.location.findMany({ - where, - select: { - id: true, - latitude: true, - longitude: true, - address: true, - buildingNotes: true, - addresses: { - select: { - id: true, - unitNumber: true, - firstName: true, - lastName: true, - email: true, - phone: true, - supportLevel: true, - sign: true, - signSize: true, - notes: true, - }, - }, - }, - take: locationFetchLimit, - }); - // Flatten addresses with location embedded, RESPECTING ADDRESS LIMIT - const allAddresses = []; - let addressCount = 0; - for (const loc of allLocations) { - // Stop if we've reached the address limit - if (addressCount >= addressLimit) { - break; - } - for (const addr of loc.addresses) { - // Check limit before adding each address - if (addressCount >= addressLimit) { - break; - } - allAddresses.push({ - ...addr, - location: { - id: loc.id, - latitude: loc.latitude, - longitude: loc.longitude, - address: loc.address, - buildingNotes: loc.buildingNotes, - }, - }); - addressCount++; - } - } - const result = await annotateAddressesWithVisits(allAddresses, userId); - const durationSeconds = (Date.now() - startTime) / 1000; - (0, metrics_1.recordLocationQuery)('canvass_all', !!bounds, result.length, durationSeconds); - return result; - }, - async updateAddressAsVolunteer(addressId, userId, role, data) { - const existing = await database_1.prisma.address.findUnique({ where: { id: addressId } }); - if (!existing) { - throw new error_handler_1.AppError(404, 'Address not found', 'ADDRESS_NOT_FOUND'); - } - const isAdmin = role === client_1.UserRole.SUPER_ADMIN || role === client_1.UserRole.MAP_ADMIN; - // Build update data, stripping admin-only fields for non-admins - const updateData = { - updatedByUserId: userId, - }; - for (const field of VOLUNTEER_ADDRESS_FIELDS) { - if (data[field] !== undefined) { - updateData[field] = data[field]; - } - } - if (isAdmin) { - for (const field of ADMIN_ADDRESS_FIELDS) { - if (data[field] !== undefined) { - updateData[field] = data[field]; - } - } - } - return database_1.prisma.address.update({ where: { id: addressId }, data: updateData }); - }, - async getWalkingRoute(cutId, userId, filters) { - const addresses = await this.getCutLocationsForCanvass(cutId, userId); - let filtered = addresses; - if (filters.excludeVisited) { - filtered = addresses.filter((a) => !a.lastVisit); - } - const routeLocations = filtered.map((a) => ({ - id: a.location.id, // Use location ID for routing - latitude: a.location.latitude, - longitude: a.location.longitude, - })); - const cut = await database_1.prisma.cut.findUnique({ - where: { id: cutId }, - select: { geojson: true }, - }); - return (0, canvass_route_service_1.calculateWalkingRoute)(routeLocations, filters.startLatitude, filters.startLongitude, cut?.geojson); - }, - async recordVisit(userId, data) { - // Verify address exists - const address = await database_1.prisma.address.findUnique({ where: { id: data.addressId } }); - if (!address) { - throw new error_handler_1.AppError(404, 'Address not found', 'ADDRESS_NOT_FOUND'); - } - // Create visit record - const visit = await database_1.prisma.canvassVisit.create({ - data: { - addressId: data.addressId, - userId, - shiftId: data.shiftId, - sessionId: data.sessionId, - outcome: data.outcome, - supportLevel: data.supportLevel, - signRequested: data.signRequested ?? false, - signSize: data.signSize, - notes: data.notes, - durationSeconds: data.durationSeconds, - }, - include: { - address: { - select: { - id: true, - unitNumber: true, - location: { select: { address: true } }, - }, - }, - }, - }); - // If SPOKE_WITH and updateLocation, push data to the address record - if (data.outcome === client_1.VisitOutcome.SPOKE_WITH && data.updateLocation) { - const updateData = { - updatedByUserId: userId, - }; - if (data.supportLevel) - updateData.supportLevel = data.supportLevel; - if (data.signRequested !== undefined) - updateData.sign = data.signRequested; - if (data.signSize) - updateData.signSize = data.signSize; - if (data.notes) { - const timestamp = new Date().toISOString().split('T')[0]; - const prefix = `[${timestamp}] ${data.notes}`; - updateData.notes = address.notes ? `${prefix}\n${address.notes}` : prefix; - } - const updatedAddress = await database_1.prisma.address.update({ - where: { id: data.addressId }, - data: updateData, - include: { location: { select: { address: true } } }, - }); - // Sync support level change to Listmonk (fire-and-forget) - if (updatedAddress.email) { - const name = [updatedAddress.firstName, updatedAddress.lastName].filter(Boolean).join(' '); - listmonk_event_sync_service_1.listmonkEventSyncService.onAddressUpdated({ - email: updatedAddress.email, - name, - supportLevel: updatedAddress.supportLevel, - sign: updatedAddress.sign, - address: updatedAddress.location.address, - }).catch(() => { }); - } - } - (0, metrics_2.recordCanvassVisit)(data.outcome); - // CRM activity via ContactAddress lookup (fire-and-forget) - database_1.prisma.contactAddress.findFirst({ - where: { addressId: data.addressId }, - select: { contactId: true }, - }).then((ca) => { - if (ca) { - (0, crm_activity_1.recordCrmActivity)({ - contactId: ca.contactId, - activityType: 'CANVASS_VISIT', - title: `Canvass visit: ${data.outcome}`, - metadata: { addressId: data.addressId, outcome: data.outcome, visitId: visit.id }, - }).catch(() => { }); - } - }).catch(() => { }); - // Achievement check (fire-and-forget) - achievements_service_1.achievementsService.checkAndUnlock(userId, ['canvass']).catch(() => { }); - // Notification: sign request alert for admins - if (data.signRequested) { - try { - if (await (0, notification_helper_1.isNotificationEnabled)('notifyAdminSignRequested')) { - const adminEmails = await (0, notification_helper_1.getAdminEmailsByRole)([client_1.UserRole.SUPER_ADMIN, client_1.UserRole.MAP_ADMIN]); - if (adminEmails.length > 0) { - const [volunteer, shift] = await Promise.all([ - database_1.prisma.user.findUnique({ where: { id: userId }, select: { name: true } }), - data.shiftId ? database_1.prisma.shift.findUnique({ where: { id: data.shiftId }, select: { title: true } }) : null, - ]); - const addressStr = visit.address?.location?.address || 'Unknown address'; - const adminUrl = `${env_1.env.ADMIN_URL || 'http://localhost:3000'}/app/canvass/dashboard`; - await notification_queue_service_1.notificationQueueService.enqueue({ - type: 'admin-sign-requested', - adminEmails, - volunteerName: volunteer?.name || 'Unknown', - address: addressStr, - shiftTitle: shift?.title || 'No shift', - signSize: data.signSize || '', - adminUrl, - }); - } - } - } - catch (err) { - logger_1.logger.error('Failed to enqueue sign request notification:', err); - } - } - return visit; - }, - async recordBulkVisit(userId, data) { - // Verify session exists and belongs to user - if (data.sessionId) { - const session = await database_1.prisma.canvassSession.findUnique({ - where: { id: data.sessionId }, - include: { cut: true }, - }); - if (!session || session.userId !== userId) { - throw new error_handler_1.AppError(403, 'Invalid session', 'INVALID_SESSION'); - } - if (session.status !== 'ACTIVE') { - throw new error_handler_1.AppError(400, 'Session is not active', 'INACTIVE_SESSION'); - } - // Verify location is within cut boundary - if (session.cutId && session.cut) { - const location = await database_1.prisma.location.findUnique({ - where: { id: data.locationId }, - }); - if (!location) { - throw new error_handler_1.AppError(404, 'Location not found', 'LOCATION_NOT_FOUND'); - } - if (session.cut.geojson) { - try { - const polygons = (0, spatial_1.parseGeoJsonPolygon)(session.cut.geojson); - const isWithinBoundary = polygons.some((polygon) => (0, spatial_1.isPointInPolygon)(Number(location.latitude), Number(location.longitude), polygon)); - if (!isWithinBoundary) { - throw new error_handler_1.AppError(403, 'Location is outside your assigned territory', 'LOCATION_OUT_OF_BOUNDS'); - } - } - catch (err) { - logger_1.logger.error('Failed to validate location boundary for bulk visit', { error: err instanceof Error ? err.message : JSON.stringify(err) }); - // Don't block the visit if polygon parsing fails, but log it - } - } - } - } - // Get all unvisited addresses at this location - const addresses = await database_1.prisma.address.findMany({ - where: { - locationId: data.locationId, - canvassVisits: { none: {} }, - }, - }); - if (addresses.length === 0) { - throw new error_handler_1.AppError(400, 'No unvisited addresses found at this location', 'NO_UNVISITED_ADDRESSES'); - } - // Create visit record for each address - const visits = await Promise.all(addresses.map((addr) => database_1.prisma.canvassVisit.create({ - data: { - addressId: addr.id, - userId, - sessionId: data.sessionId, - shiftId: data.shiftId, - outcome: data.outcome, - notes: data.notes ? `[BULK] ${data.notes}` : null, - visitedAt: new Date(), - }, - }))); - visits.forEach(() => (0, metrics_2.recordCanvassVisit)(data.outcome)); - return { created: visits.length, visits }; - }, - // ─── Admin Methods ───────────────────────────────────────────────── - async getAdminStats() { - const today = new Date(); - today.setHours(0, 0, 0, 0); - const [totalVisits, todayVisits, activeSessions, activeVolunteers, cuts] = await Promise.all([ - database_1.prisma.canvassVisit.count(), - database_1.prisma.canvassVisit.count({ where: { visitedAt: { gte: today } } }), - database_1.prisma.canvassSession.count({ where: { status: client_1.CanvassSessionStatus.ACTIVE } }), - database_1.prisma.canvassVisit.findMany({ - where: { visitedAt: { gte: today } }, - distinct: ['userId'], - select: { userId: true }, - }), - database_1.prisma.cut.findMany({ - select: { id: true, name: true, completionPercentage: true }, - }), - ]); - (0, metrics_2.setActiveCanvassSessions)(activeSessions); - const avgCompletion = cuts.length > 0 - ? Math.round(cuts.reduce((sum, c) => sum + c.completionPercentage, 0) / cuts.length) - : 0; - return { - totalVisits, - todayVisits, - activeSessions, - activeVolunteers: activeVolunteers.length, - overallCompletion: avgCompletion, - }; - }, - async getCutStats(cutId) { - const cut = await database_1.prisma.cut.findUnique({ where: { id: cutId } }); - if (!cut) - throw new error_handler_1.AppError(404, 'Cut not found', 'CUT_NOT_FOUND'); - const polygons = (0, spatial_1.parseGeoJsonPolygon)(cut.geojson); - const allLocations = await database_1.prisma.location.findMany({ - // latitude/longitude are non-nullable in schema - select: { - id: true, - latitude: true, - longitude: true, - addresses: { select: { id: true } }, - }, - }); - // Filter locations within polygons and collect all address IDs - const addressIds = []; - for (const loc of allLocations) { - if (polygons.some((p) => (0, spatial_1.isPointInPolygon)(Number(loc.latitude), Number(loc.longitude), p))) { - addressIds.push(...loc.addresses.map((a) => a.id)); - } - } - const [totalAddresses, visitedAddresses, totalVisits, byOutcome] = await Promise.all([ - Promise.resolve(addressIds.length), - database_1.prisma.canvassVisit.findMany({ - where: { addressId: { in: addressIds } }, - distinct: ['addressId'], - select: { addressId: true }, - }), - database_1.prisma.canvassVisit.count({ where: { addressId: { in: addressIds } } }), - database_1.prisma.canvassVisit.groupBy({ - by: ['outcome'], - where: { addressId: { in: addressIds } }, - _count: true, - }), - ]); - const outcomeMap = {}; - for (const row of byOutcome) { - outcomeMap[row.outcome] = row._count; - } - return { - cutId, - cutName: cut.name, - totalLocations: totalAddresses, - visitedLocations: visitedAddresses.length, - completionPercentage: cut.completionPercentage, - totalVisits, - byOutcome: outcomeMap, - }; - }, - async getAdminActivity(filters) { - const { page, limit, cutId, userId, outcome } = filters; - const skip = (page - 1) * limit; - const where = {}; - if (userId) - where.userId = userId; - if (outcome) - where.outcome = outcome; - // If filtering by cut, we need to find addresses in that cut - if (cutId) { - const cut = await database_1.prisma.cut.findUnique({ where: { id: cutId } }); - if (cut) { - const polygons = (0, spatial_1.parseGeoJsonPolygon)(cut.geojson); - const allLocations = await database_1.prisma.location.findMany({ - // latitude/longitude are non-nullable in schema - select: { - id: true, - latitude: true, - longitude: true, - addresses: { select: { id: true } }, - }, - }); - const addressIds = []; - for (const loc of allLocations) { - if (polygons.some((p) => (0, spatial_1.isPointInPolygon)(Number(loc.latitude), Number(loc.longitude), p))) { - addressIds.push(...loc.addresses.map((a) => a.id)); - } - } - where.addressId = { in: addressIds }; - } - } - const [visits, total] = await Promise.all([ - database_1.prisma.canvassVisit.findMany({ - where, - skip, - take: limit, - orderBy: { visitedAt: 'desc' }, - include: { - address: { - select: { - id: true, - unitNumber: true, - location: { select: { address: true } }, - }, - }, - user: { select: { id: true, name: true, email: true } }, - }, - }), - database_1.prisma.canvassVisit.count({ where }), - ]); - return { - visits, - pagination: { page, limit, total, totalPages: Math.ceil(total / limit) }, - }; - }, - async getVolunteers() { - const volunteers = await database_1.prisma.canvassVisit.groupBy({ - by: ['userId'], - _count: true, - _max: { visitedAt: true }, - }); - const userIds = volunteers.map((v) => v.userId); - const users = await database_1.prisma.user.findMany({ - where: { id: { in: userIds } }, - select: { id: true, name: true, email: true }, - }); - const userMap = new Map(users.map((u) => [u.id, u])); - const sessions = await database_1.prisma.canvassSession.groupBy({ - by: ['userId'], - where: { userId: { in: userIds } }, - _count: true, - }); - const sessionMap = new Map(sessions.map((s) => [s.userId, s._count])); - return volunteers.map((v) => ({ - userId: v.userId, - name: userMap.get(v.userId)?.name ?? null, - email: userMap.get(v.userId)?.email ?? '', - totalVisits: v._count, - sessions: sessionMap.get(v.userId) ?? 0, - lastActive: v._max.visitedAt, - })); - }, - async getVolunteerStats(userId) { - return this.getMyStats(userId); - }, - async getAdminVisits(filters) { - const { page, limit, cutId, userId, shiftId, outcome, sortBy, sortOrder } = filters; - const skip = (page - 1) * limit; - const where = {}; - if (userId) - where.userId = userId; - if (shiftId) - where.shiftId = shiftId; - if (outcome) - where.outcome = outcome; - if (cutId) { - const cut = await database_1.prisma.cut.findUnique({ where: { id: cutId } }); - if (cut) { - const polygons = (0, spatial_1.parseGeoJsonPolygon)(cut.geojson); - const allLocations = await database_1.prisma.location.findMany({ - // latitude/longitude are non-nullable in schema - select: { - id: true, - latitude: true, - longitude: true, - addresses: { select: { id: true } }, - }, - }); - const addressIds = []; - for (const loc of allLocations) { - if (polygons.some((p) => (0, spatial_1.isPointInPolygon)(Number(loc.latitude), Number(loc.longitude), p))) { - addressIds.push(...loc.addresses.map((a) => a.id)); - } - } - where.addressId = { in: addressIds }; - } - } - const [visits, total] = await Promise.all([ - database_1.prisma.canvassVisit.findMany({ - where, - skip, - take: limit, - orderBy: { [sortBy]: sortOrder }, - include: { - address: { - select: { - id: true, - unitNumber: true, - location: { select: { address: true } }, - }, - }, - user: { select: { id: true, name: true, email: true } }, - }, - }), - database_1.prisma.canvassVisit.count({ where }), - ]); - return { - visits, - pagination: { page, limit, total, totalPages: Math.ceil(total / limit) }, - }; - }, - async getOutcomeTrends(filters) { - const { granularity } = filters; - const dateTo = filters.dateTo ? new Date(filters.dateTo) : new Date(); - const dateFrom = filters.dateFrom - ? new Date(filters.dateFrom) - : new Date(dateTo.getTime() - 30 * 24 * 60 * 60 * 1000); - // Ensure dateTo covers end of day - const dateToEnd = new Date(dateTo); - dateToEnd.setHours(23, 59, 59, 999); - const rows = await database_1.prisma.$queryRaw ` - SELECT DATE_TRUNC(${granularity}, "visitedAt") as period, - outcome::text as outcome, - COUNT(*)::int as count - FROM canvass_visits - WHERE "visitedAt" >= ${dateFrom} AND "visitedAt" <= ${dateToEnd} - GROUP BY period, outcome - ORDER BY period ASC - `; - // Pivot rows into series: [{ date, NOT_HOME: n, SPOKE_WITH: n, ... }] - const pivotMap = new Map(); - const totals = {}; - for (const row of rows) { - const dateStr = row.period.toISOString().split('T')[0]; - if (!pivotMap.has(dateStr)) { - pivotMap.set(dateStr, {}); - } - pivotMap.get(dateStr)[row.outcome] = row.count; - totals[row.outcome] = (totals[row.outcome] || 0) + row.count; - } - const series = Array.from(pivotMap.entries()).map(([date, outcomes]) => ({ - date, - ...outcomes, - })); - return { - granularity, - dateFrom: dateFrom.toISOString().split('T')[0], - dateTo: dateTo.toISOString().split('T')[0], - series, - totals, - }; - }, - // ─── Helpers ─────────────────────────────────────────────────────── - async recalculateCutCompletion(cutId) { - const cut = await database_1.prisma.cut.findUnique({ where: { id: cutId } }); - if (!cut) - return; - const polygons = (0, spatial_1.parseGeoJsonPolygon)(cut.geojson); - const allLocations = await database_1.prisma.location.findMany({ - // latitude/longitude are non-nullable in schema - select: { - id: true, - latitude: true, - longitude: true, - addresses: { select: { id: true } }, - }, - }); - // Filter locations within polygons and collect all address IDs - const addressIds = []; - for (const loc of allLocations) { - if (polygons.some((p) => (0, spatial_1.isPointInPolygon)(Number(loc.latitude), Number(loc.longitude), p))) { - addressIds.push(...loc.addresses.map((a) => a.id)); - } - } - if (addressIds.length === 0) - return; - const visitedAddresses = await database_1.prisma.canvassVisit.findMany({ - where: { addressId: { in: addressIds } }, - distinct: ['addressId'], - select: { addressId: true }, - }); - const pct = Math.round((visitedAddresses.length / addressIds.length) * 100); - await database_1.prisma.cut.update({ - where: { id: cutId }, - data: { - completionPercentage: pct, - lastCanvassed: new Date(), - }, - }); - }, - async closeAbandonedSessions() { - const cutoff = new Date(Date.now() - 12 * 60 * 60 * 1000); // 12 hours ago - const result = await database_1.prisma.canvassSession.updateMany({ - where: { - status: client_1.CanvassSessionStatus.ACTIVE, - startedAt: { lt: cutoff }, - }, - data: { - status: client_1.CanvassSessionStatus.ABANDONED, - endedAt: new Date(), - }, - }); - if (result.count > 0) { - logger_1.logger.info(`Closed ${result.count} abandoned canvass sessions`); - } - return result.count; - }, -}; -//# sourceMappingURL=canvass.service.js.map \ No newline at end of file diff --git a/api/dist/modules/map/canvass/canvass.service.js.map b/api/dist/modules/map/canvass/canvass.service.js.map deleted file mode 100644 index dda84d77..00000000 --- a/api/dist/modules/map/canvass/canvass.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"canvass.service.js","sourceRoot":"","sources":["../../../../src/modules/map/canvass/canvass.service.ts"],"names":[],"mappings":";;;AAAA,2CAAoG;AACpG,4DAAyD;AACzD,uDAAkD;AAClD,qEAA6D;AAC7D,kDAA+C;AAC/C,oDAA6D;AAC7D,oDAA+E;AAC/E,8DAAgE;AAChE,mEAAgE;AAChE,oDAAsF;AACtF,6FAAwF;AACxF,+EAAoG;AACpG,6CAA0C;AAC1C,6FAAwF;AACxF,+FAAyF;AACzF,4EAAwE;AAaxE,MAAM,cAAc,GAAG;IACrB,EAAE,EAAE,IAAI;IACR,UAAU,EAAE,IAAI;IAChB,SAAS,EAAE,IAAI;IACf,QAAQ,EAAE,IAAI;IACd,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,IAAI;IACX,YAAY,EAAE,IAAI;IAClB,IAAI,EAAE,IAAI;IACV,QAAQ,EA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AAG,UAAU,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,CAAC;QAE5E,MAAM,iBAAM,CAAC,GAAG,CAAC,MAAM,CAAC;YACtB,KAAK,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE;YACpB,IAAI,EAAE;gBACJ,oBAAoB,EAAE,GAAG;gBACzB,aAAa,EAAE,IAAI,IAAI,EAAE;aAC1B;SACF,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,sBAAsB;QAC1B,MAAM,MAAM,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,eAAe;QAC1E,MAAM,MAAM,GAAG,MAAM,iBAAM,CAAC,cAAc,CAAC,UAAU,CAAC;YACpD,KAAK,EAAE;gBACL,MAAM,EAAE,6BAAoB,CAAC,MAAM;gBACnC,SAAS,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;aAC1B;YACD,IAAI,EAAE;gBACJ,MAAM,EAAE,6BAAoB,CAAC,SAAS;gBACtC,OAAO,EAAE,IAAI,IAAI,EAAE;aACpB;SACF,CAAC,CAAC;QAEH,IAAI,MAAM,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC;YACrB,eAAM,CAAC,IAAI,CAAC,UAAU,MAAM,CAAC,KAAK,6BAA6B,CAAC,CAAC;QACnE,CAAC;QAED,OAAO,MAAM,CAAC,KAAK,CAAC;IACtB,CAAC;CACF,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/cuts/cuts.routes.d.ts b/api/dist/modules/map/cuts/cuts.routes.d.ts deleted file mode 100644 index c1b95c0c..00000000 --- a/api/dist/modules/map/cuts/cuts.routes.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -declare const adminRouter: import("express-serve-static-core").Router; -declare const publicRouter: import("express-serve-static-core").Router; -export { adminRouter as cutsAdminRouter, publicRouter as cutsPublicRouter }; -//# sourceMappingURL=cuts.routes.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/map/cuts/cuts.routes.d.ts.map b/api/dist/modules/map/cuts/cuts.routes.d.ts.map deleted file mode 100644 index dc95c5e2..00000000 --- a/api/dist/modules/map/cuts/cuts.routes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cuts.routes.d.ts","sourceRoot":"","sources":["../../../../src/modules/map/cuts/cuts.routes.ts"],"names":[],"mappings":"AAsBA,QAAA,MAAM,WAAW,4CAAW,CAAC;AAyJ7B,QAAA,MAAM,YAAY,4CAAW,CAAC;AAe9B,OAAO,EAAE,WAAW,IAAI,eAAe,EAAE,YAAY,IAAI,gBAAgB,EAAE,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/cuts/cuts.routes.js b/api/dist/modules/map/cuts/cuts.routes.js deleted file mode 100644 index e369d81a..00000000 --- a/api/dist/modules/map/cuts/cuts.routes.js +++ /dev/null @@ -1,159 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.cutsPublicRouter = exports.cutsAdminRouter = void 0; -const express_1 = require("express"); -const multer_1 = __importDefault(require("multer")); -const cuts_service_1 = require("./cuts.service"); -const cuts_schemas_1 = require("./cuts.schemas"); -const validate_1 = require("../../../middleware/validate"); -const auth_middleware_1 = require("../../../middleware/auth.middleware"); -const rbac_middleware_1 = require("../../../middleware/rbac.middleware"); -const roles_1 = require("../../../utils/roles"); -const geojsonUpload = (0, multer_1.default)({ - storage: multer_1.default.memoryStorage(), - limits: { fileSize: 10 * 1024 * 1024 }, - fileFilter: (_req, file, cb) => { - if (file.originalname.endsWith('.geojson') || file.originalname.endsWith('.json') || file.mimetype === 'application/json' || file.mimetype === 'application/geo+json') { - cb(null, true); - } - else { - cb(new Error('Only .geojson or .json files are allowed')); - } - }, -}); -// --- Admin Router --- -const adminRouter = (0, express_1.Router)(); -exports.cutsAdminRouter = adminRouter; -adminRouter.use(auth_middleware_1.authenticate); -adminRouter.use((0, rbac_middleware_1.requireRole)(...roles_1.MAP_ROLES)); -// GET /api/map/cuts — list paginated -adminRouter.get('/', (0, validate_1.validate)(cuts_schemas_1.listCutsSchema, 'query'), async (req, res, next) => { - try { - const result = await cuts_service_1.cutsService.findAll(req.query); - res.json(result); - } - catch (err) { - next(err); - } -}); -// GET /api/map/cuts/export-geojson — all cuts as FeatureCollection -adminRouter.get('/export-geojson', async (_req, res, next) => { - try { - const collection = await cuts_service_1.cutsService.exportAllGeoJson(); - res.setHeader('Content-Type', 'application/geo+json'); - res.setHeader('Content-Disposition', 'attachment; filename=cuts.geojson'); - res.json(collection); - } - catch (err) { - next(err); - } -}); -// POST /api/map/cuts/import-geojson — upload + create cuts -adminRouter.post('/import-geojson', geojsonUpload.single('file'), async (req, res, next) => { - try { - if (!req.file) { - res.status(400).json({ error: { message: 'No file uploaded', code: 'NO_FILE' } }); - return; - } - const result = await cuts_service_1.cutsService.importGeoJson(req.file.buffer, req.user.id); - res.json(result); - } - catch (err) { - next(err); - } -}); -// GET /api/map/cuts/:id/export-geojson — single cut as Feature -adminRouter.get('/:id/export-geojson', async (req, res, next) => { - try { - const id = req.params.id; - const feature = await cuts_service_1.cutsService.exportSingleGeoJson(id); - res.setHeader('Content-Type', 'application/geo+json'); - res.setHeader('Content-Disposition', `attachment; filename=cut-${id}.geojson`); - res.json(feature); - } - catch (err) { - next(err); - } -}); -// GET /api/map/cuts/:id — single cut -adminRouter.get('/:id', async (req, res, next) => { - try { - const id = req.params.id; - const cut = await cuts_service_1.cutsService.findById(id); - res.json(cut); - } - catch (err) { - next(err); - } -}); -// POST /api/map/cuts — create cut -adminRouter.post('/', (0, validate_1.validate)(cuts_schemas_1.createCutSchema), async (req, res, next) => { - try { - const cut = await cuts_service_1.cutsService.create(req.body, req.user.id); - res.status(201).json(cut); - } - catch (err) { - next(err); - } -}); -// PUT /api/map/cuts/:id — update cut -adminRouter.put('/:id', (0, validate_1.validate)(cuts_schemas_1.updateCutSchema), async (req, res, next) => { - try { - const id = req.params.id; - const cut = await cuts_service_1.cutsService.update(id, req.body); - res.json(cut); - } - catch (err) { - next(err); - } -}); -// DELETE /api/map/cuts/:id — delete cut -adminRouter.delete('/:id', async (req, res, next) => { - try { - const id = req.params.id; - await cuts_service_1.cutsService.delete(id); - res.status(204).send(); - } - catch (err) { - next(err); - } -}); -// GET /api/map/cuts/:id/locations — locations within cut -adminRouter.get('/:id/locations', async (req, res, next) => { - try { - const id = req.params.id; - const locations = await cuts_service_1.cutsService.getLocationsInCut(id); - res.json(locations); - } - catch (err) { - next(err); - } -}); -// GET /api/map/cuts/:id/statistics — support level breakdown for cut -adminRouter.get('/:id/statistics', async (req, res, next) => { - try { - const id = req.params.id; - const stats = await cuts_service_1.cutsService.getStatistics(id); - res.json(stats); - } - catch (err) { - next(err); - } -}); -// --- Public Router --- -const publicRouter = (0, express_1.Router)(); -exports.cutsPublicRouter = publicRouter; -// GET /api/map/cuts/public — all public cuts for map display -publicRouter.get('/public', async (_req, res, next) => { - try { - const cuts = await cuts_service_1.cutsService.getPublicCuts(); - res.json(cuts); - } - catch (err) { - next(err); - } -}); -//# sourceMappingURL=cuts.routes.js.map \ No newline at end of file diff --git a/api/dist/modules/map/cuts/cuts.routes.js.map b/api/dist/modules/map/cuts/cuts.routes.js.map deleted file mode 100644 index 181bdc8a..00000000 --- a/api/dist/modules/map/cuts/cuts.routes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cuts.routes.js","sourceRoot":"","sources":["../../../../src/modules/map/cuts/cuts.routes.ts"],"names":[],"mappings":";;;;;;AAAA,qCAAkE;AAClE,oDAA4B;AAC5B,iDAA6C;AAC7C,iDAAkF;AAClF,2DAAwD;AACxD,yEAAmE;AACnE,yEAAkE;AAClE,gDAAiD;AAEjD,MAAM,aAAa,GAAG,IAAA,gBAAM,EAAC;IAC3B,OAAO,EAAE,gBAAM,CAAC,aAAa,EAAE;IAC/B,M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iBAAiB,CAAC,EAAE,CAAC,CAAC;QAC1D,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACtB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,GAAG,CAAC,CAAC;IACZ,CAAC;AACH,CAAC,CACF,CAAC;AAEF,qEAAqE;AACrE,WAAW,CAAC,GAAG,CACb,iBAAiB,EACjB,KAAK,EAAE,GAAY,EAAE,GAAa,EAAE,IAAkB,EAAE,EAAE;IACxD,IAAI,CAAC;QACH,MAAM,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC,EAAY,CAAC;QACnC,MAAM,KAAK,GAAG,MAAM,0BAAW,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;QAClD,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,GAAG,CAAC,CAAC;IACZ,CAAC;AACH,CAAC,CACF,CAAC;AAEF,wBAAwB;AACxB,MAAM,YAAY,GAAG,IAAA,gBAAM,GAAE,CAAC;AAe2B,wCAAgB;AAbzE,6DAA6D;AAC7D,YAAY,CAAC,GAAG,CACd,SAAS,EACT,KAAK,EAAE,IAAa,EAAE,GAAa,EAAE,IAAkB,EAAE,EAAE;IACzD,IAAI,CAAC;QACH,MAAM,IAAI,GAAG,MAAM,0BAAW,CAAC,aAAa,EAAE,CAAC;QAC/C,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,GAAG,CAAC,CAAC;IACZ,CAAC;AACH,CAAC,CACF,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/cuts/cuts.schemas.d.ts b/api/dist/modules/map/cuts/cuts.schemas.d.ts deleted file mode 100644 index 5b7919ca..00000000 --- a/api/dist/modules/map/cuts/cuts.schemas.d.ts +++ /dev/null @@ -1,122 +0,0 @@ -import { z } from 'zod'; -export declare const createCutSchema: z.ZodObject<{ - name: z.ZodString; - description: z.ZodOptional; - color: z.ZodDefault; - opacity: z.ZodDefault; - category: z.ZodOptional>; - isPublic: z.ZodDefault>; - isOfficial: z.ZodDefault>; - geojson: z.ZodEffects; - bounds: z.ZodOptional; - showLocations: z.ZodDefault>; - exportEnabled: z.ZodDefault>; - assignedTo: z.ZodOptional; -}, "strip", z.ZodTypeAny, { - name: string; - isPublic: boolean; - color: string; - opacity: number; - isOfficial: boolean; - geojson: string; - showLocations: boolean; - exportEnabled: boolean; - category?: "CUSTOM" | "WARD" | "NEIGHBORHOOD" | "DISTRICT" | undefined; - description?: string | undefined; - bounds?: string | undefined; - assignedTo?: string | undefined; -}, { - name: string; - geojson: string; - category?: "CUSTOM" | "WARD" | "NEIGHBORHOOD" | "DISTRICT" | undefined; - description?: string | undefined; - isPublic?: boolean | undefined; - color?: string | undefined; - opacity?: number | undefined; - isOfficial?: boolean | undefined; - bounds?: string | undefined; - showLocations?: boolean | undefined; - exportEnabled?: boolean | undefined; - assignedTo?: string | undefined; -}>; -export declare const updateCutSchema: z.ZodObject<{ - name: z.ZodOptional; - description: z.ZodOptional>; - color: z.ZodOptional; - opacity: z.ZodOptional; - category: z.ZodOptional>>; - isPublic: z.ZodOptional; - isOfficial: z.ZodOptional; - geojson: z.ZodOptional>; - bounds: z.ZodOptional>; - showLocations: z.ZodOptional; - exportEnabled: z.ZodOptional; - assignedTo: z.ZodOptional>; - lastCanvassed: z.ZodOptional>; - completionPercentage: z.ZodOptional; -}, "strip", z.ZodTypeAny, { - name?: string | undefined; - category?: "CUSTOM" | "WARD" | "NEIGHBORHOOD" | "DISTRICT" | null | undefined; - description?: string | null | undefined; - isPublic?: boolean | undefined; - color?: string | undefined; - opacity?: number | undefined; - isOfficial?: boolean | undefined; - geojson?: string | undefined; - bounds?: string | null | undefined; - showLocations?: boolean | undefined; - exportEnabled?: boolean | undefined; - assignedTo?: string | null | undefined; - lastCanvassed?: string | null | undefined; - completionPercentage?: number | undefined; -}, { - name?: string | undefined; - category?: "CUSTOM" | "WARD" | "NEIGHBORHOOD" | "DISTRICT" | null | undefined; - description?: string | null | undefined; - isPublic?: boolean | undefined; - color?: string | undefined; - opacity?: number | undefined; - isOfficial?: boolean | undefined; - geojson?: string | undefined; - bounds?: string | null | undefined; - showLocations?: boolean | undefined; - exportEnabled?: boolean | undefined; - assignedTo?: string | null | undefined; - lastCanvassed?: string | null | undefined; - completionPercentage?: number | undefined; -}>; -export declare const listCutsSchema: z.ZodObject<{ - page: z.ZodDefault; - limit: z.ZodDefault; - category: z.ZodOptional>; - search: z.ZodOptional; -}, "strip", z.ZodTypeAny, { - limit: number; - page: number; - search?: string | undefined; - category?: "CUSTOM" | "WARD" | "NEIGHBORHOOD" | "DISTRICT" | undefined; -}, { - search?: string | undefined; - category?: "CUSTOM" | "WARD" | "NEIGHBORHOOD" | "DISTRICT" | undefined; - limit?: number | undefined; - page?: number | undefined; -}>; -export type CreateCutInput = z.infer; -export type UpdateCutInput = z.infer; -export type ListCutsInput = z.infer; -//# sourceMappingURL=cuts.schemas.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/map/cuts/cuts.schemas.d.ts.map b/api/dist/modules/map/cuts/cuts.schemas.d.ts.map deleted file mode 100644 index 6c475e3f..00000000 --- a/api/dist/modules/map/cuts/cuts.schemas.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cuts.schemas.d.ts","sourceRoot":"","sources":["../../../../src/modules/map/cuts/cuts.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAexB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAa1B,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAe1B,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;EAKzB,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAC7D,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAC7D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/cuts/cuts.schemas.js b/api/dist/modules/map/cuts/cuts.schemas.js deleted file mode 100644 index 9b15c7e6..00000000 --- a/api/dist/modules/map/cuts/cuts.schemas.js +++ /dev/null @@ -1,51 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.listCutsSchema = exports.updateCutSchema = exports.createCutSchema = void 0; -const zod_1 = require("zod"); -const client_1 = require("@prisma/client"); -const geojsonValidator = zod_1.z.string().refine((val) => { - try { - const parsed = JSON.parse(val); - return parsed.type === 'Polygon' || parsed.type === 'MultiPolygon'; - } - catch { - return false; - } -}, { message: 'Must be valid GeoJSON with type Polygon or MultiPolygon' }); -exports.createCutSchema = zod_1.z.object({ - name: zod_1.z.string().min(1, 'Name is required'), - description: zod_1.z.string().optional(), - color: zod_1.z.string().regex(/^#[0-9a-fA-F]{6}$/, 'Must be a hex color').default('#3388ff'), - opacity: zod_1.z.number().min(0).max(1).default(0.3), - category: zod_1.z.nativeEnum(client_1.CutCategory).optional(), - isPublic: zod_1.z.boolean().optional().default(false), - isOfficial: zod_1.z.boolean().optional().default(false), - geojson: geojsonValidator, - bounds: zod_1.z.string().optional(), - showLocations: zod_1.z.boolean().optional().default(true), - exportEnabled: zod_1.z.boolean().optional().default(true), - assignedTo: zod_1.z.string().optional(), -}); -exports.updateCutSchema = zod_1.z.object({ - name: zod_1.z.string().min(1).optional(), - description: zod_1.z.string().nullable().optional(), - color: zod_1.z.string().regex(/^#[0-9a-fA-F]{6}$/, 'Must be a hex color').optional(), - opacity: zod_1.z.number().min(0).max(1).optional(), - category: zod_1.z.nativeEnum(client_1.CutCategory).nullable().optional(), - isPublic: zod_1.z.boolean().optional(), - isOfficial: zod_1.z.boolean().optional(), - geojson: geojsonValidator.optional(), - bounds: zod_1.z.string().nullable().optional(), - showLocations: zod_1.z.boolean().optional(), - exportEnabled: zod_1.z.boolean().optional(), - assignedTo: zod_1.z.string().nullable().optional(), - lastCanvassed: zod_1.z.string().datetime().nullable().optional(), - completionPercentage: zod_1.z.number().int().min(0).max(100).optional(), -}); -exports.listCutsSchema = zod_1.z.object({ - page: zod_1.z.coerce.number().int().positive().default(1), - limit: zod_1.z.coerce.number().int().positive().max(100).default(20), - category: zod_1.z.nativeEnum(client_1.CutCategory).optional(), - search: zod_1.z.string().optional(), -}); -//# sourceMappingURL=cuts.schemas.js.map \ No newline at end of file diff --git a/api/dist/modules/map/cuts/cuts.schemas.js.map b/api/dist/modules/map/cuts/cuts.schemas.js.map deleted file mode 100644 index 1b6e405a..00000000 --- a/api/dist/modules/map/cuts/cuts.schemas.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cuts.schemas.js","sourceRoot":"","sources":["../../../../src/modules/map/cuts/cuts.schemas.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,2CAA6C;AAE7C,MAAM,gBAAgB,GAAG,OAAC,CAAC,MAAM,EAAE,CAAC,MAAM,CACxC,CAAC,GAAG,EAAE,EAAE;IACN,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAqB,CAAC;QACnD,OAAO,MAAM,CAAC,IAAI,KAAK,SAAS,IAAI,MAAM,CAAC,IAAI,KAAK,cAAc,CAAC;IACrE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC,EACD,EAAE,OAAO,EAAE,yDAAyD,EAAE,CACvE,CAAC;AAEW,QAAA,eAAe,GAAG,OAAC,CAAC,MAAM,CAAC;IACtC,IAAI,EA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,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IAC9D,QAAQ,EAAE,OAAC,CAAC,UAAU,CAAC,oBAAW,CAAC,CAAC,QAAQ,EAAE;IAC9C,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC9B,CAAC,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/cuts/cuts.service.d.ts b/api/dist/modules/map/cuts/cuts.service.d.ts deleted file mode 100644 index 4bdf0056..00000000 --- a/api/dist/modules/map/cuts/cuts.service.d.ts +++ /dev/null @@ -1,172 +0,0 @@ -import { Prisma } from '@prisma/client'; -import type { CreateCutInput, UpdateCutInput, ListCutsInput } from './cuts.schemas'; -export declare const cutsService: { - findAll(filters: ListCutsInput): Promise<{ - cuts: { - id: string; - name: string; - createdAt: Date; - updatedAt: Date; - category: import(".prisma/client").$Enums.CutCategory | null; - description: string | null; - isPublic: boolean; - createdByUserId: string | null; - color: string; - opacity: Prisma.Decimal; - isOfficial: boolean; - geojson: string; - bounds: string | null; - showLocations: boolean; - exportEnabled: boolean; - assignedTo: string | null; - filterSettings: Prisma.JsonValue | null; - lastCanvassed: Date | null; - completionPercentage: number; - }[]; - pagination: { - page: number; - limit: number; - total: number; - totalPages: number; - }; - }>; - findById(id: string): Promise<{ - id: string; - name: string; - createdAt: Date; - updatedAt: Date; - category: import(".prisma/client").$Enums.CutCategory | null; - description: string | null; - isPublic: boolean; - createdByUserId: string | null; - color: string; - opacity: Prisma.Decimal; - isOfficial: boolean; - geojson: string; - bounds: string | null; - showLocations: boolean; - exportEnabled: boolean; - assignedTo: string | null; - filterSettings: Prisma.JsonValue | null; - lastCanvassed: Date | null; - completionPercentage: number; - }>; - create(data: CreateCutInput, userId: string): Promise<{ - id: string; - name: string; - createdAt: Date; - updatedAt: Date; - category: import(".prisma/client").$Enums.CutCategory | null; - description: string | null; - isPublic: boolean; - createdByUserId: string | null; - color: string; - opacity: Prisma.Decimal; - isOfficial: boolean; - geojson: string; - bounds: string | null; - showLocations: boolean; - exportEnabled: boolean; - assignedTo: string | null; - filterSettings: Prisma.JsonValue | null; - lastCanvassed: Date | null; - completionPercentage: number; - }>; - update(id: string, data: UpdateCutInput): Promise<{ - id: string; - name: string; - createdAt: Date; - updatedAt: Date; - category: import(".prisma/client").$Enums.CutCategory | null; - description: string | null; - isPublic: boolean; - createdByUserId: string | null; - color: string; - opacity: Prisma.Decimal; - isOfficial: boolean; - geojson: string; - bounds: string | null; - showLocations: boolean; - exportEnabled: boolean; - assignedTo: string | null; - filterSettings: Prisma.JsonValue | null; - lastCanvassed: Date | null; - completionPercentage: number; - }>; - delete(id: string): Promise; - getPublicCuts(): Promise<{ - id: string; - name: string; - category: import(".prisma/client").$Enums.CutCategory | null; - description: string | null; - color: string; - opacity: Prisma.Decimal; - geojson: string; - bounds: string | null; - }[]>; - getLocationsInCut(id: string): Promise<{ - id: string; - createdAt: Date; - updatedAt: Date; - latitude: Prisma.Decimal; - longitude: Prisma.Decimal; - createdByUserId: string | null; - updatedByUserId: string | null; - address: string; - postalCode: string | null; - province: string | null; - federalDistrict: string | null; - buildingUse: number | null; - locGuid: string | null; - buildingType: import(".prisma/client").$Enums.BuildingType; - totalUnits: number; - buildingNotes: string | null; - geocodeConfidence: number | null; - geocodeProvider: import(".prisma/client").$Enums.GeocodeProvider | null; - }[]>; - exportSingleGeoJson(id: string): Promise<{ - type: "Feature"; - properties: { - name: string; - description: string | null; - color: string; - 'fill-opacity': number; - fill: string; - category: import(".prisma/client").$Enums.CutCategory | null; - isPublic: boolean; - isOfficial: boolean; - assignedTo: string | null; - }; - geometry: any; - }>; - exportAllGeoJson(): Promise<{ - type: "FeatureCollection"; - features: { - type: "Feature"; - properties: { - name: string; - description: string | null; - color: string; - 'fill-opacity': number; - fill: string; - category: import(".prisma/client").$Enums.CutCategory | null; - isPublic: boolean; - isOfficial: boolean; - assignedTo: string | null; - }; - geometry: any; - }[]; - }>; - importGeoJson(buffer: Buffer, userId: string): Promise<{ - total: number; - success: number; - failed: number; - errors: string[]; - }>; - getStatistics(id: string): Promise<{ - total: number; - byLevel: Record; - withSign: number; - }>; -}; -//# sourceMappingURL=cuts.service.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/map/cuts/cuts.service.d.ts.map b/api/dist/modules/map/cuts/cuts.service.d.ts.map deleted file mode 100644 index e3d43866..00000000 --- a/api/dist/modules/map/cuts/cuts.service.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cuts.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/map/cuts/cuts.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAe,MAAM,gBAAgB,CAAC;AAKrD,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpF,eAAO,MAAM,WAAW;qBACC,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAoCjB,MAAM;;;;;;;;;;;;;;;;;;;;;iBAQN,cAAc,UAAU,MAAM;;;;;;;;;;;;;;;;;;;;;eAmChC,MAAM,QAAQ,cAAc;;;;;;;;;;;;;;;;;;;;;eAgC5B,MAAM;;;;;;;;;;;0BA0BK,MAAM;;;;;;;;;;;;;;;;;;;;4BAqBJ,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAkDR,MAAM,UAAU,MAAM;;;;;;sBAsF1B,MAAM;;;;;CAwD/B,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/cuts/cuts.service.js b/api/dist/modules/map/cuts/cuts.service.js deleted file mode 100644 index 8648b7d2..00000000 --- a/api/dist/modules/map/cuts/cuts.service.js +++ /dev/null @@ -1,327 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.cutsService = void 0; -const client_1 = require("@prisma/client"); -const database_1 = require("../../../config/database"); -const error_handler_1 = require("../../../middleware/error-handler"); -const spatial_1 = require("../../../utils/spatial"); -const logger_1 = require("../../../utils/logger"); -exports.cutsService = { - async findAll(filters) { - const { page, limit, category, search } = filters; - const skip = (page - 1) * limit; - const where = {}; - if (search) { - where.OR = [ - { name: { contains: search, mode: 'insensitive' } }, - { description: { contains: search, mode: 'insensitive' } }, - ]; - } - if (category) - where.category = category; - const [cuts, total] = await Promise.all([ - database_1.prisma.cut.findMany({ - where, - skip, - take: limit, - orderBy: { createdAt: 'desc' }, - }), - database_1.prisma.cut.count({ where }), - ]); - return { - cuts, - pagination: { - page, - limit, - total, - totalPages: Math.ceil(total / limit), - }, - }; - }, - async findById(id) { - const cut = await database_1.prisma.cut.findUnique({ where: { id } }); - if (!cut) { - throw new error_handler_1.AppError(404, 'Cut not found', 'CUT_NOT_FOUND'); - } - return cut; - }, - async create(data, userId) { - // Auto-calculate bounds from geojson if not provided - let boundsStr = data.bounds; - if (!boundsStr) { - try { - const rings = (0, spatial_1.parseGeoJsonPolygon)(data.geojson); - const allCoords = rings.flat(); - const bounds = (0, spatial_1.calculateBounds)(allCoords); - boundsStr = JSON.stringify(bounds); - } - catch { - // Bounds calculation optional - } - } - const cut = await database_1.prisma.cut.create({ - data: { - name: data.name, - description: data.description, - color: data.color, - opacity: data.opacity, - category: data.category, - isPublic: data.isPublic, - isOfficial: data.isOfficial, - geojson: data.geojson, - bounds: boundsStr, - showLocations: data.showLocations, - exportEnabled: data.exportEnabled, - assignedTo: data.assignedTo, - createdByUserId: userId, - }, - }); - return cut; - }, - async update(id, data) { - const existing = await database_1.prisma.cut.findUnique({ where: { id } }); - if (!existing) { - throw new error_handler_1.AppError(404, 'Cut not found', 'CUT_NOT_FOUND'); - } - // Recalculate bounds if geojson changed - const updateData = { ...data }; - if (data.geojson && !data.bounds) { - try { - const rings = (0, spatial_1.parseGeoJsonPolygon)(data.geojson); - const allCoords = rings.flat(); - const bounds = (0, spatial_1.calculateBounds)(allCoords); - updateData.bounds = JSON.stringify(bounds); - } - catch { - // Bounds calculation optional - } - } - if (data.lastCanvassed !== undefined) { - updateData.lastCanvassed = data.lastCanvassed ? new Date(data.lastCanvassed) : null; - } - const cut = await database_1.prisma.cut.update({ - where: { id }, - data: updateData, - }); - return cut; - }, - async delete(id) { - const existing = await database_1.prisma.cut.findUnique({ where: { id } }); - if (!existing) { - throw new error_handler_1.AppError(404, 'Cut not found', 'CUT_NOT_FOUND'); - } - await database_1.prisma.cut.delete({ where: { id } }); - }, - async getPublicCuts() { - const cuts = await database_1.prisma.cut.findMany({ - where: { isPublic: true }, - select: { - id: true, - name: true, - description: true, - color: true, - opacity: true, - category: true, - geojson: true, - bounds: true, - }, - orderBy: { name: 'asc' }, - }); - return cuts; - }, - async getLocationsInCut(id) { - const cut = await database_1.prisma.cut.findUnique({ where: { id } }); - if (!cut) { - throw new error_handler_1.AppError(404, 'Cut not found', 'CUT_NOT_FOUND'); - } - const rings = (0, spatial_1.parseGeoJsonPolygon)(cut.geojson); - // Get all locations (latitude/longitude are non-nullable) - const locations = await database_1.prisma.location.findMany(); - // Filter to those inside the polygon - const inside = locations.filter((loc) => { - const lat = Number(loc.latitude); - const lng = Number(loc.longitude); - return rings.some((ring) => (0, spatial_1.isPointInPolygon)(lat, lng, ring)); - }); - return inside; - }, - async exportSingleGeoJson(id) { - const cut = await database_1.prisma.cut.findUnique({ where: { id } }); - if (!cut) - throw new error_handler_1.AppError(404, 'Cut not found', 'CUT_NOT_FOUND'); - const geojson = JSON.parse(cut.geojson); - return { - type: 'Feature', - properties: { - name: cut.name, - description: cut.description, - color: cut.color, - 'fill-opacity': Number(cut.opacity), - fill: cut.color, - category: cut.category, - isPublic: cut.isPublic, - isOfficial: cut.isOfficial, - assignedTo: cut.assignedTo, - }, - geometry: geojson, - }; - }, - async exportAllGeoJson() { - const cuts = await database_1.prisma.cut.findMany({ orderBy: { name: 'asc' } }); - const features = cuts.map((cut) => { - const geojson = JSON.parse(cut.geojson); - return { - type: 'Feature', - properties: { - name: cut.name, - description: cut.description, - color: cut.color, - 'fill-opacity': Number(cut.opacity), - fill: cut.color, - category: cut.category, - isPublic: cut.isPublic, - isOfficial: cut.isOfficial, - assignedTo: cut.assignedTo, - }, - geometry: geojson, - }; - }); - return { - type: 'FeatureCollection', - features, - }; - }, - async importGeoJson(buffer, userId) { - let parsed; - try { - parsed = JSON.parse(buffer.toString('utf-8')); - } - catch { - throw new error_handler_1.AppError(400, 'Invalid JSON file', 'INVALID_JSON'); - } - // Collect features from various GeoJSON shapes - const features = []; - const type = parsed.type; - if (type === 'FeatureCollection' && Array.isArray(parsed.features)) { - for (const f of parsed.features) { - if (f.geometry) - features.push({ geometry: f.geometry, properties: (f.properties ?? {}) }); - } - } - else if (type === 'Feature' && parsed.geometry) { - features.push({ geometry: parsed.geometry, properties: (parsed.properties ?? {}) }); - } - else if (type === 'Polygon' || type === 'MultiPolygon') { - features.push({ geometry: parsed, properties: {} }); - } - else { - throw new error_handler_1.AppError(400, 'Unsupported GeoJSON type. Expected Feature, FeatureCollection, Polygon, or MultiPolygon.', 'UNSUPPORTED_GEOJSON'); - } - let success = 0; - let failed = 0; - const errors = []; - for (let i = 0; i < features.length; i++) { - try { - const { geometry, properties } = features[i]; - const geoType = geometry.type; - if (geoType !== 'Polygon' && geoType !== 'MultiPolygon') { - errors.push(`Feature ${i + 1}: Unsupported geometry type "${geoType}"`); - failed++; - continue; - } - const geojsonStr = JSON.stringify(geometry); - // Extract properties - const name = properties?.name || `Imported Cut ${i + 1}`; - const color = properties?.color || properties?.fill || '#3388ff'; - const opacity = typeof properties?.['fill-opacity'] === 'number' ? properties['fill-opacity'] : 0.3; - const categoryRaw = properties?.category?.toUpperCase(); - const category = categoryRaw && Object.values(client_1.CutCategory).includes(categoryRaw) - ? categoryRaw - : undefined; - // Calculate bounds - let boundsStr; - try { - const rings = (0, spatial_1.parseGeoJsonPolygon)(geojsonStr); - const allCoords = rings.flat(); - const bounds = (0, spatial_1.calculateBounds)(allCoords); - boundsStr = JSON.stringify(bounds); - } - catch { /* optional */ } - await database_1.prisma.cut.create({ - data: { - name, - description: properties?.description || undefined, - color: /^#[0-9a-fA-F]{6}$/.test(color) ? color : '#3388ff', - opacity, - category, - isPublic: properties?.isPublic === true, - isOfficial: properties?.isOfficial === true, - geojson: geojsonStr, - bounds: boundsStr, - assignedTo: properties?.assignedTo || undefined, - createdByUserId: userId, - }, - }); - success++; - } - catch (err) { - const msg = err instanceof Error ? err.message : 'Unknown error'; - errors.push(`Feature ${i + 1}: ${msg}`); - failed++; - logger_1.logger.warn(`GeoJSON import feature ${i + 1} failed:`, err); - } - } - return { total: features.length, success, failed, errors: errors.slice(0, 50) }; - }, - async getStatistics(id) { - const cut = await database_1.prisma.cut.findUnique({ where: { id } }); - if (!cut) { - throw new error_handler_1.AppError(404, 'Cut not found', 'CUT_NOT_FOUND'); - } - const rings = (0, spatial_1.parseGeoJsonPolygon)(cut.geojson); - // Get all locations with addresses (latitude/longitude are non-nullable) - const locations = await database_1.prisma.location.findMany({ - select: { - id: true, - latitude: true, - longitude: true, - addresses: { - select: { - id: true, - supportLevel: true, - sign: true, - }, - }, - }, - }); - // Filter locations inside polygon and flatten addresses - const addressesInCut = []; - for (const loc of locations) { - const lat = Number(loc.latitude); - const lng = Number(loc.longitude); - if (rings.some((ring) => (0, spatial_1.isPointInPolygon)(lat, lng, ring))) { - addressesInCut.push(...loc.addresses); - } - } - const byLevel = { - LEVEL_1: 0, - LEVEL_2: 0, - LEVEL_3: 0, - LEVEL_4: 0, - NONE: 0, - }; - let withSign = 0; - for (const addr of addressesInCut) { - const level = addr.supportLevel || 'NONE'; - byLevel[level] = (byLevel[level] || 0) + 1; - if (addr.sign) - withSign++; - } - return { - total: addressesInCut.length, - byLevel, - withSign, - }; - }, -}; -//# sourceMappingURL=cuts.service.js.map \ No newline at end of file diff --git a/api/dist/modules/map/cuts/cuts.service.js.map b/api/dist/modules/map/cuts/cuts.service.js.map deleted file mode 100644 index a4273968..00000000 --- a/api/dist/modules/map/cuts/cuts.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cuts.service.js","sourceRoot":"","sources":["../../../../src/modules/map/cuts/cuts.service.ts"],"names":[],"mappings":";;;AAAA,2CAAqD;AACrD,uDAAkD;AAClD,qEAA6D;AAC7D,oDAAgG;AAChG,kDAA+C;AAGlC,QAAA,WAAW,GAAG;IACzB,KAAK,CAAC,OAAO,CAAC,OAAsB;QAClC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;QAClD,MAAM,IAAI,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC;QAEhC,MAAM,KAAK,GAAyB,EAAE,CAAC;QAEvC,IAAI,MAAM,EAAE,CAAC;YACX,KAAK,CAAC,EAAE,GAAG;gBACT,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE;gBACnD,EAAE,WAAW,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE;aAC3D,CAAC;QACJ,CAAC;QAED,IAAI,QAAQ;YAAE,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAExC,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;YACtC,iBAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;gBAClB,KAAK;gBACL,IAAI;gBACJ,IAAI,EAAE,KAAK;gBACX,OAAO,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE;aAC/B,CAAC;YACF,iBAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,CAAC;SAC5B,CAAC,CAAC;QAEH,OAAO;YACL,IAAI;YACJ,UAAU,EAAE;gBACV,IAAI;gBACJ,KAAK;gBACL,KAAK;gBACL,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,GA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AC;QACH,CAAC;QAED,MAAM,OAAO,GAA2B;YACtC,OAAO,EAAE,CAAC;YACV,OAAO,EAAE,CAAC;YACV,OAAO,EAAE,CAAC;YACV,OAAO,EAAE,CAAC;YACV,IAAI,EAAE,CAAC;SACR,CAAC;QAEF,IAAI,QAAQ,GAAG,CAAC,CAAC;QAEjB,KAAK,MAAM,IAAI,IAAI,cAAc,EAAE,CAAC;YAClC,MAAM,KAAK,GAAG,IAAI,CAAC,YAAY,IAAI,MAAM,CAAC;YAC1C,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;YAC3C,IAAI,IAAI,CAAC,IAAI;gBAAE,QAAQ,EAAE,CAAC;QAC5B,CAAC;QAED,OAAO;YACL,KAAK,EAAE,cAAc,CAAC,MAAM;YAC5B,OAAO;YACP,QAAQ;SACT,CAAC;IACJ,CAAC;CACF,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/geocoding/geocoding.routes.d.ts b/api/dist/modules/map/geocoding/geocoding.routes.d.ts deleted file mode 100644 index a304cfe6..00000000 --- a/api/dist/modules/map/geocoding/geocoding.routes.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const router: import("express-serve-static-core").Router; -export { router as geocodingRouter }; -//# sourceMappingURL=geocoding.routes.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/map/geocoding/geocoding.routes.d.ts.map b/api/dist/modules/map/geocoding/geocoding.routes.d.ts.map deleted file mode 100644 index 0de833ef..00000000 --- a/api/dist/modules/map/geocoding/geocoding.routes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"geocoding.routes.d.ts","sourceRoot":"","sources":["../../../../src/modules/map/geocoding/geocoding.routes.ts"],"names":[],"mappings":"AAaA,QAAA,MAAM,MAAM,4CAAW,CAAC;AAmBxB,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/geocoding/geocoding.routes.js b/api/dist/modules/map/geocoding/geocoding.routes.js deleted file mode 100644 index 6cc16d7d..00000000 --- a/api/dist/modules/map/geocoding/geocoding.routes.js +++ /dev/null @@ -1,30 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.geocodingRouter = void 0; -const express_1 = require("express"); -const zod_1 = require("zod"); -const geocoding_service_1 = require("./geocoding.service"); -const validate_1 = require("../../../middleware/validate"); -const auth_middleware_1 = require("../../../middleware/auth.middleware"); -const rbac_middleware_1 = require("../../../middleware/rbac.middleware"); -const roles_1 = require("../../../utils/roles"); -const searchSchema = zod_1.z.object({ - q: zod_1.z.string().min(2, 'Query must be at least 2 characters'), - limit: zod_1.z.coerce.number().int().min(1).max(10).default(5), -}); -const router = (0, express_1.Router)(); -exports.geocodingRouter = router; -router.use(auth_middleware_1.authenticate); -router.use((0, rbac_middleware_1.requireRole)(...roles_1.MAP_ROLES)); -// GET /api/map/geocoding/search?q=Ottawa&limit=5 -router.get('/search', (0, validate_1.validate)(searchSchema, 'query'), async (req, res, next) => { - try { - const { q, limit } = req.query; - const results = await geocoding_service_1.geocodingService.search(q, limit); - res.json(results); - } - catch (err) { - next(err); - } -}); -//# sourceMappingURL=geocoding.routes.js.map \ No newline at end of file diff --git a/api/dist/modules/map/geocoding/geocoding.routes.js.map b/api/dist/modules/map/geocoding/geocoding.routes.js.map deleted file mode 100644 index df0c67a3..00000000 --- a/api/dist/modules/map/geocoding/geocoding.routes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"geocoding.routes.js","sourceRoot":"","sources":["../../../../src/modules/map/geocoding/geocoding.routes.ts"],"names":[],"mappings":";;;AAAA,qCAAkE;AAClE,6BAAwB;AACxB,2DAAuD;AACvD,2DAAwD;AACxD,yEAAmE;AACnE,yEAAkE;AAClE,gDAAiD;AAEjD,MAAM,YAAY,GAAG,OAAC,CAAC,MAAM,CAAC;IAC5B,CAAC,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,qCAAqC,CAAC;IAC3D,KAAK,EAAE,OAAC,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;CACzD,CAAC,CAAC;AAEH,MAAM,MAAM,GAAG,IAAA,gBAAM,GAAE,CAAC;AAmBL,iCAAe;AAlBlC,MAAM,CAAC,GAAG,CAAC,8BAAY,CAAC,CAAC;AACzB,MAAM,CAAC,GAAG,CAAC,IAAA,6BAAW,EAAC,GAAG,iBAAS,CAAC,CAAC,CAAC;AAEtC,iDAAiD;AACjD,MAAM,CAAC,GAAG,CACR,SAAS,EACT,IAAA,mBAAQ,EAAC,YAAY,EAAE,OAAO,CAAC,EAC/B,KAAK,EAAE,GAAY,EAAE,GAAa,EAAE,IAAkB,EAAE,EAAE;IACxD,IAAI,CAAC;QACH,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,GAAG,CAAC,KAAgD,CAAC;QAC1E,MAAM,OAAO,GAAG,MAAM,oCAAgB,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;QACxD,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACpB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,GAAG,CAAC,CAAC;IACZ,CAAC;AACH,CAAC,CACF,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/geocoding/geocoding.service.d.ts b/api/dist/modules/map/geocoding/geocoding.service.d.ts deleted file mode 100644 index 23743b73..00000000 --- a/api/dist/modules/map/geocoding/geocoding.service.d.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { GeocodeProvider } from '@prisma/client'; -export interface BoundsQuery { - minLat: number; - maxLat: number; - minLng: number; - maxLng: number; -} -export interface GeocodeResult { - latitude: number; - longitude: number; - confidence: number; - provider: GeocodeProvider; - formattedAddress?: string; -} -export interface ReverseGeocodeResult { - address: string; - city?: string; - province?: string; - country?: string; -} -export declare const geocodingService: { - geocodeBatch(addresses: string[], bounds?: BoundsQuery): Promise<(GeocodeResult | null)[]>; - geocode(address: string, bounds?: BoundsQuery): Promise; - reverseGeocode(lat: number, lng: number): Promise; - search(query: string, limit?: number): Promise>; - clearCache(): Promise; - getCacheStats(): Promise<{ - keys: number; - hits: number; - misses: number; - }>; -}; -//# sourceMappingURL=geocoding.service.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/map/geocoding/geocoding.service.d.ts.map b/api/dist/modules/map/geocoding/geocoding.service.d.ts.map deleted file mode 100644 index 93cc61da..00000000 --- a/api/dist/modules/map/geocoding/geocoding.service.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"geocoding.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/map/geocoding/geocoding.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAOjD,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,eAAe,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAiZD,eAAO,MAAM,gBAAgB;4BAEd,MAAM,EAAE,WACV,WAAW,GACnB,OAAO,CAAC,CAAC,aAAa,GAAG,IAAI,CAAC,EAAE,CAAC;qBAuCb,MAAM,WAAW,WAAW,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;wBA6FzD,MAAM,OAAO,MAAM,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC;kBAuBhE,MAAM,UAAS,MAAM,GAAO,OAAO,CAAC,KAAK,CAAC;QAC5D,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;QAClB,WAAW,EAAE,MAAM,CAAC;QACpB,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC,CAAC;;qBAwCoB,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAe/E,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/geocoding/geocoding.service.js b/api/dist/modules/map/geocoding/geocoding.service.js deleted file mode 100644 index d73e3910..00000000 --- a/api/dist/modules/map/geocoding/geocoding.service.js +++ /dev/null @@ -1,554 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.geocodingService = void 0; -const client_1 = require("@prisma/client"); -const crypto_1 = __importDefault(require("crypto")); -const env_1 = require("../../../config/env"); -const redis_1 = require("../../../config/redis"); -const logger_1 = require("../../../utils/logger"); -const metrics_1 = require("../../../utils/metrics"); -// Redis cache configuration -const CACHE_KEY_PREFIX = 'GEOCODE_CACHE:'; -// Helper function to hash address for cache key -function hashAddress(address) { - return crypto_1.default.createHash('sha256').update(address).digest('hex').substring(0, 16); -} -// Helper functions for Redis cache operations -async function getCachedResult(address) { - if (env_1.env.GEOCODING_CACHE_ENABLED !== 'true') - return null; - try { - const key = `${CACHE_KEY_PREFIX}${hashAddress(address)}`; - const cached = await redis_1.redis.get(key); - if (!cached) { - metrics_1.cm_geocode_cache_misses.inc(); - return null; - } - const parsed = JSON.parse(cached); - metrics_1.cm_geocode_cache_hits.inc(); - // Return result without cachedAt timestamp - const { cachedAt, ...result } = parsed; - return result; - } - catch (err) { - logger_1.logger.warn('Failed to get cached geocode result:', err); - metrics_1.cm_geocode_cache_misses.inc(); - return null; - } -} -async function setCachedResult(address, result) { - if (env_1.env.GEOCODING_CACHE_ENABLED !== 'true') - return; - try { - const key = `${CACHE_KEY_PREFIX}${hashAddress(address)}`; - const ttlSeconds = env_1.env.GEOCODING_CACHE_TTL_HOURS * 60 * 60; - const cachedResult = { - ...result, - cachedAt: Date.now(), - }; - await redis_1.redis.setex(key, ttlSeconds, JSON.stringify(cachedResult)); - } - catch (err) { - logger_1.logger.warn('Failed to cache geocode result:', err); - } -} -// Address abbreviation expansions (comprehensive Canadian/US terms) -const abbreviations = { - // Street types - 'st': 'street', - 'ave': 'avenue', - 'blvd': 'boulevard', - 'dr': 'drive', - 'rd': 'road', - 'ln': 'lane', - 'ct': 'court', - 'crt': 'court', - 'pl': 'place', - 'cres': 'crescent', - 'terr': 'terrace', - 'hwy': 'highway', - 'pkwy': 'parkway', - 'sq': 'square', - 'mews': 'mews', - 'circ': 'circle', - 'cir': 'circle', - 'way': 'way', - 'trail': 'trail', - 'grove': 'grove', - 'heights': 'heights', - 'gdns': 'gardens', - 'gdn': 'garden', - 'gate': 'gate', - 'bay': 'bay', - 'close': 'close', - 'walk': 'walk', - // Directional suffixes - 'n': 'north', - 'ne': 'northeast', - 'e': 'east', - 'se': 'southeast', - 's': 'south', - 'sw': 'southwest', - 'w': 'west', - 'nw': 'northwest', - // Unit types - 'apt': 'apartment', - 'unit': 'unit', - 'ste': 'suite', - 'fl': 'floor', - 'bldg': 'building', - 'dept': 'department', -}; -/** - * Normalize postal code format - * K1A0B1 → K1A 0B1 - * k1a 0b1 → K1A 0B1 - */ -function normalizePostalCode(address) { - // Canadian postal code pattern: A1A 1A1 or A1A1A1 - const postalCodeRegex = /\b([A-Za-z]\d[A-Za-z])\s*(\d[A-Za-z]\d)\b/g; - return address.replace(postalCodeRegex, (match, p1, p2) => { - return `${p1.toUpperCase()} ${p2.toUpperCase()}`; - }); -} -/** - * Normalize address: lowercase, trim whitespace, normalize postal codes - */ -function normalizeAddress(address, city, province) { - let normalized = address.trim().toLowerCase(); - // Trim consecutive whitespace - normalized = normalized.replace(/\s+/g, ' '); - // Normalize postal code before lowercasing - normalized = normalizePostalCode(normalized); - // Append city/province for better geocoding context (if available) - if (city) { - normalized += `, ${city.toLowerCase()}`; - } - if (province) { - normalized += `, ${province.toLowerCase()}`; - } - return normalized; -} -/** - * Expand common address abbreviations - */ -function expandAbbreviations(address) { - let expanded = address.toLowerCase(); - for (const [abbr, full] of Object.entries(abbreviations)) { - // Case-insensitive replacement with word boundaries - const regex = new RegExp(`\\b${abbr}\\b`, 'gi'); - expanded = expanded.replace(regex, full); - } - return expanded; -} -// Default geographic bounds for filtering -const DEFAULT_BOUNDS = { - CANADA: { minLat: 41.67, maxLat: 83.11, minLng: -141.00, maxLng: -52.62 }, - USA: { minLat: 24.52, maxLat: 49.38, minLng: -125.00, maxLng: -66.93 }, -}; -// Detect country from address (look for Canadian province codes or "Canada") -function detectCountry(address) { - const upper = address.toUpperCase(); - const canadianProvinces = ['ON', 'QC', 'BC', 'AB', 'MB', 'SK', 'NS', 'NB', 'PE', 'NL', 'NT', 'NU', 'YT']; - for (const prov of canadianProvinces) { - if (upper.includes(` ${prov} `) || upper.includes(` ${prov},`) || upper.endsWith(` ${prov}`)) { - return 'CANADA'; - } - } - if (upper.includes('CANADA')) - return 'CANADA'; - if (upper.includes('USA') || upper.includes('UNITED STATES')) - return 'USA'; - return null; -} -// Adjust confidence based on provider reputation and result quality -function adjustConfidence(result) { - let confidence = result.rawConfidence; - // Provider-specific adjustments based on historical accuracy - const providerAdjustment = { - [client_1.GeocodeProvider.GOOGLE]: +10, // Most accurate - [client_1.GeocodeProvider.MAPBOX]: +5, // High accuracy - [client_1.GeocodeProvider.NOMINATIM]: 0, // Baseline - [client_1.GeocodeProvider.ARCGIS]: -5, // Less accurate for residential - [client_1.GeocodeProvider.PHOTON]: -10, // Least accurate - [client_1.GeocodeProvider.LOCATIONIQ]: 0, - [client_1.GeocodeProvider.UNKNOWN]: 0, - }; - confidence += providerAdjustment[result.provider] || 0; - // Clamp to 0-100 range - return Math.max(0, Math.min(100, confidence)); -} -function calculateValidationScore(input, returned) { - if (!returned) - return 50; - const inputParts = input.toLowerCase().split(/[\s,]+/).filter(Boolean); - const returnedLower = returned.toLowerCase(); - let matches = 0; - for (const part of inputParts) { - if (part.length > 2 && returnedLower.includes(part)) - matches++; - } - return inputParts.length > 0 ? Math.round((matches / inputParts.length) * 100) : 50; -} -function sleep(ms) { - return new Promise((resolve) => setTimeout(resolve, ms)); -} -async function geocodeGoogleMaps(address, bounds) { - if (!env_1.env.GOOGLE_MAPS_API_KEY || env_1.env.GOOGLE_MAPS_ENABLED !== 'true') - return null; - try { - const url = new URL('https://maps.googleapis.com/maps/api/geocode/json'); - url.searchParams.set('address', address); - url.searchParams.set('key', env_1.env.GOOGLE_MAPS_API_KEY); - // Add bounds to bias results toward the specified region - if (bounds) { - const boundsStr = `${bounds.minLat},${bounds.minLng}|${bounds.maxLat},${bounds.maxLng}`; - url.searchParams.set('bounds', boundsStr); - } - const res = await fetch(url.toString()); - if (!res.ok) - return null; - const data = await res.json(); - if (data.status !== 'OK' || !data.results[0]) - return null; - const result = data.results[0]; - const locationType = result.geometry.location_type; - // Map Google's location_type to confidence score - const confidenceMap = { - 'ROOFTOP': 100, // Precise address - 'RANGE_INTERPOLATED': 85, // Interpolated between two points - 'GEOMETRIC_CENTER': 70, // Center of a polygon (street, neighborhood) - 'APPROXIMATE': 50, // Approximate (city, postal code) - }; - return { - latitude: result.geometry.location.lat, - longitude: result.geometry.location.lng, - rawConfidence: confidenceMap[locationType] || 70, - formattedAddress: result.formatted_address, - provider: client_1.GeocodeProvider.GOOGLE, - }; - } - catch (err) { - logger_1.logger.warn('Google Maps geocode failed:', err); - return null; - } -} -async function geocodeNominatim(address, bounds) { - try { - let url = `https://nominatim.openstreetmap.org/search?q=${encodeURIComponent(address)}&format=json&limit=1&addressdetails=1`; - // Add viewbox (bounds) to bias results toward the specified region - if (bounds) { - const viewbox = `${bounds.minLng},${bounds.minLat},${bounds.maxLng},${bounds.maxLat}`; - url += `&viewbox=${viewbox}&bounded=1`; - } - const res = await fetch(url, { - headers: { 'User-Agent': 'ChangemakerLite/2.0 (contact@cmlite.org)' }, - }); - if (!res.ok) - return null; - const data = await res.json(); - if (!data.length) - return null; - const item = data[0]; - return { - latitude: parseFloat(item.lat), - longitude: parseFloat(item.lon), - rawConfidence: Math.round((item.importance ?? 0.5) * 100), - formattedAddress: item.display_name, - provider: client_1.GeocodeProvider.NOMINATIM, - }; - } - catch (err) { - logger_1.logger.warn('Nominatim geocode failed:', err); - return null; - } -} -async function geocodeArcGIS(address, bounds) { - try { - let url = `https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/findAddressCandidates?SingleLine=${encodeURIComponent(address)}&f=json&maxLocations=1`; - // Add searchExtent (bounds) to filter results to the specified region - if (bounds) { - const extent = `${bounds.minLng},${bounds.minLat},${bounds.maxLng},${bounds.maxLat}`; - url += `&searchExtent=${extent}`; - } - const res = await fetch(url); - if (!res.ok) - return null; - const data = await res.json(); - if (!data.candidates?.length) - return null; - const item = data.candidates[0]; - return { - latitude: item.location.y, - longitude: item.location.x, - rawConfidence: Math.round(item.score), - formattedAddress: item.address, - provider: client_1.GeocodeProvider.ARCGIS, - }; - } - catch (err) { - logger_1.logger.warn('ArcGIS geocode failed:', err); - return null; - } -} -async function geocodePhoton(address, bounds) { - try { - let url = `https://photon.komoot.io/api/?q=${encodeURIComponent(address)}&limit=1`; - // Add bbox (bounds) to filter results to the specified region - if (bounds) { - const bbox = `${bounds.minLng},${bounds.minLat},${bounds.maxLng},${bounds.maxLat}`; - url += `&bbox=${bbox}`; - } - const res = await fetch(url); - if (!res.ok) - return null; - const data = await res.json(); - if (!data.features?.length) - return null; - const feat = data.features[0]; - const coords = feat.geometry.coordinates; - const props = feat.properties; - const formatted = [props.name, props.street, props.city, props.state, props.country].filter(Boolean).join(', '); - // Use improved confidence scoring instead of hardcoded 65% - // Photon doesn't provide confidence, so estimate based on result completeness - let confidence = 50; // Base confidence - if (props.name) - confidence += 10; - if (props.street) - confidence += 15; - if (props.city) - confidence += 10; - return { - latitude: coords[1], - longitude: coords[0], - rawConfidence: confidence, - formattedAddress: formatted || undefined, - provider: client_1.GeocodeProvider.PHOTON, - }; - } - catch (err) { - logger_1.logger.warn('Photon geocode failed:', err); - return null; - } -} -async function geocodeMapbox(address, bounds) { - if (!env_1.env.MAPBOX_API_KEY) - return null; - try { - let url = `https://api.mapbox.com/geocoding/v5/mapbox.places/${encodeURIComponent(address)}.json?access_token=${env_1.env.MAPBOX_API_KEY}&limit=1`; - // Add bbox (bounds) to bias results toward the specified region - if (bounds) { - const bbox = `${bounds.minLng},${bounds.minLat},${bounds.maxLng},${bounds.maxLat}`; - url += `&bbox=${bbox}`; - } - const res = await fetch(url); - if (!res.ok) - return null; - const data = await res.json(); - if (!data.features?.length) - return null; - const feat = data.features[0]; - return { - latitude: feat.center[1], - longitude: feat.center[0], - rawConfidence: Math.round((feat.relevance ?? 0.5) * 100), - formattedAddress: feat.place_name, - provider: client_1.GeocodeProvider.MAPBOX, - }; - } - catch (err) { - logger_1.logger.warn('Mapbox geocode failed:', err); - return null; - } -} -exports.geocodingService = { - async geocodeBatch(addresses, bounds) { - if (env_1.env.GEOCODING_PARALLEL_ENABLED !== 'true') { - // Sequential fallback - const results = []; - for (const addr of addresses) { - const result = await this.geocode(addr, bounds); - results.push(result); - } - return results; - } - // Parallel batch processing - const batchSize = env_1.env.GEOCODING_BATCH_SIZE; - const results = []; - for (let i = 0; i < addresses.length; i += batchSize) { - const batch = addresses.slice(i, i + batchSize); - const batchPromises = batch.map((addr) => this.geocode(addr, bounds).catch((err) => { - logger_1.logger.warn(`Batch geocode failed for address: ${addr}`, err); - return null; - })); - const batchResults = await Promise.allSettled(batchPromises); - const resolvedResults = batchResults.map((r) => r.status === 'fulfilled' ? r.value : null); - results.push(...resolvedResults); - // Respect rate limits: delay between batches - if (i + batchSize < addresses.length) { - await sleep(env_1.env.GEOCODING_RATE_LIMIT_MS); - } - } - return results; - }, - async geocode(address, bounds) { - // Check Redis cache - const normalizedAddress = normalizeAddress(address); - const cached = await getCachedResult(normalizedAddress); - if (cached) { - return cached; - } - // Auto-detect country and apply default bounds if not provided - if (!bounds) { - const detectedCountry = detectCountry(address); - if (detectedCountry) { - bounds = DEFAULT_BOUNDS[detectedCountry]; - } - } - // Try address variations - const variations = [address, expandAbbreviations(address)]; - // Remove duplicates - const uniqueVariations = [...new Set(variations.map((v) => v.trim()))]; - // Provider chain: Google Maps first (if enabled), then fallbacks - const providers = [ - geocodeGoogleMaps, - geocodeNominatim, - geocodeArcGIS, - geocodePhoton, - geocodeMapbox, - ]; - for (const variation of uniqueVariations) { - for (const provider of providers) { - const result = await provider(variation, bounds); - if (result) { - // Apply provider-specific confidence adjustments - const adjustedConfidence = adjustConfidence(result); - const validationScore = calculateValidationScore(address, result.formattedAddress); - const combinedConfidence = Math.round((adjustedConfidence + validationScore) / 2); - const geocodeResult = { - latitude: result.latitude, - longitude: result.longitude, - confidence: combinedConfidence, - provider: result.provider, - formattedAddress: result.formattedAddress, - }; - // Cache the result in Redis - await setCachedResult(normalizedAddress, geocodeResult); - if (combinedConfidence >= 85) { - return geocodeResult; - } - // If confidence is decent but not great, keep looking - // but store as best so far - let bestResult = geocodeResult; - // Try remaining providers for this variation - const providerIndex = providers.indexOf(provider); - for (let i = providerIndex + 1; i < providers.length; i++) { - await sleep(env_1.env.GEOCODING_RATE_LIMIT_MS); - const altResult = await providers[i](variation, bounds); - if (altResult) { - const altAdjusted = adjustConfidence(altResult); - const altValidation = calculateValidationScore(address, altResult.formattedAddress); - const altConfidence = Math.round((altAdjusted + altValidation) / 2); - if (altConfidence > bestResult.confidence) { - bestResult = { - latitude: altResult.latitude, - longitude: altResult.longitude, - confidence: altConfidence, - provider: altResult.provider, - formattedAddress: altResult.formattedAddress, - }; - } - if (altConfidence >= 85) - break; - } - } - // Cache the best result in Redis - await setCachedResult(normalizedAddress, bestResult); - return bestResult; - } - await sleep(env_1.env.GEOCODING_RATE_LIMIT_MS); - } - } - return null; - }, - async reverseGeocode(lat, lng) { - try { - const url = `https://nominatim.openstreetmap.org/reverse?lat=${lat}&lon=${lng}&format=json`; - const res = await fetch(url, { - headers: { 'User-Agent': 'ChangemakerLite/2.0 (contact@cmlite.org)' }, - }); - if (!res.ok) - return null; - const data = await res.json(); - return { - address: data.display_name, - city: data.address?.city || data.address?.town || data.address?.village, - province: data.address?.state, - country: data.address?.country, - }; - } - catch (err) { - logger_1.logger.warn('Reverse geocode failed:', err); - return null; - } - }, - async search(query, limit = 5) { - try { - const url = `https://nominatim.openstreetmap.org/search?q=${encodeURIComponent(query)}&format=json&limit=${limit}&addressdetails=1`; - const res = await fetch(url, { - headers: { 'User-Agent': 'ChangemakerLite/2.0 (contact@cmlite.org)' }, - }); - if (!res.ok) - return []; - const data = await res.json(); - return data.map((item) => ({ - latitude: parseFloat(item.lat), - longitude: parseFloat(item.lon), - displayName: item.display_name, - type: item.type || item.class || 'place', - provider: 'nominatim', - })); - } - catch (err) { - logger_1.logger.warn('Nominatim search failed:', err); - return []; - } - }, - async clearCache() { - if (env_1.env.GEOCODING_CACHE_ENABLED !== 'true') - return; - try { - // Find all cache keys and delete them - const keys = await redis_1.redis.keys(`${CACHE_KEY_PREFIX}*`); - if (keys.length > 0) { - await redis_1.redis.del(...keys); - logger_1.logger.info(`Cleared ${keys.length} geocoding cache entries`); - } - } - catch (err) { - logger_1.logger.error('Failed to clear geocoding cache:', err); - throw err; - } - }, - // Add method to get cache statistics - async getCacheStats() { - try { - const keys = await redis_1.redis.keys(`${CACHE_KEY_PREFIX}*`); - const hitsMetric = await metrics_1.cm_geocode_cache_hits.get(); - const missesMetric = await metrics_1.cm_geocode_cache_misses.get(); - return { - keys: keys.length, - hits: hitsMetric.values[0]?.value || 0, - misses: missesMetric.values[0]?.value || 0, - }; - } - catch (err) { - logger_1.logger.error('Failed to get cache stats:', err); - return { keys: 0, hits: 0, misses: 0 }; - } - }, -}; -//# sourceMappingURL=geocoding.service.js.map \ No newline at end of file diff --git a/api/dist/modules/map/geocoding/geocoding.service.js.map b/api/dist/modules/map/geocoding/geocoding.service.js.map deleted file mode 100644 index 0dcdc958..00000000 --- a/api/dist/modules/map/geocoding/geocoding.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"geocoding.service.js","sourceRoot":"","sources":["../../../../src/modules/map/geocoding/geocoding.service.ts"],"names":[],"mappings":";;;;;;AAAA,2CAAiD;AACjD,oDAA4B;AAC5B,6CAA0C;AAC1C,iDAA8C;AAC9C,kDAA+C;AAC/C,oDAAwF;AAgCxF,4BAA4B;AAC5B,MAAM,gBAAgB,GAAG,gBAAgB,CAAC;AAM1C,gDAAgD;AAChD,SAAS,WAAW,CAAC,OAAe;IAClC,OAAO,gBAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACpF,CAAC;AAED,8CAA8C;AAC9C,KAAK,UAAU,eAAe,CAAC,OAAe;IAC5C,IAAI,SAAG,CAAC,uBAAuB,KAAK,MAAM;QAAE,OAAO,IAAI,CAAC;IAExD,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,GAAG,gBAAgB,GAAG,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC;QACzD,MAAM,MAAM,GAAG,MAAM,aAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAEpC,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,iCAAuB,CAAC,GAAG,EAAE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C;YAChE,CAAC;QACH,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,eAAM,CAAC,KAAK,CAAC,kCAAkC,EAAE,GAAG,CAAC,CAAC;YACtD,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC;IAED,qCAAqC;IACrC,KAAK,CAAC,aAAa;QACjB,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,aAAK,CAAC,IAAI,CAAC,GAAG,gBAAgB,GAAG,CAAC,CAAC;YACtD,MAAM,UAAU,GAAG,MAAM,+BAAqB,CAAC,GAAG,EAAE,CAAC;YACrD,MAAM,YAAY,GAAG,MAAM,iCAAuB,CAAC,GAAG,EAAE,CAAC;YACzD,OAAO;gBACL,IAAI,EAAE,IAAI,CAAC,MAAM;gBACjB,IAAI,EAAE,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC;gBACtC,MAAM,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC;aAC3C,CAAC;QACJ,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,eAAM,CAAC,KAAK,CAAC,4BAA4B,EAAE,GAAG,CAAC,CAAC;YAChD,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;QACzC,CAAC;IACH,CAAC;CACF,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/locations/bulk-geocode.routes.d.ts b/api/dist/modules/map/locations/bulk-geocode.routes.d.ts deleted file mode 100644 index 1338a83f..00000000 --- a/api/dist/modules/map/locations/bulk-geocode.routes.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const router: import("express-serve-static-core").Router; -export { router as bulkGeocodeRouter }; -//# sourceMappingURL=bulk-geocode.routes.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/map/locations/bulk-geocode.routes.d.ts.map b/api/dist/modules/map/locations/bulk-geocode.routes.d.ts.map deleted file mode 100644 index 9a5b171c..00000000 --- a/api/dist/modules/map/locations/bulk-geocode.routes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bulk-geocode.routes.d.ts","sourceRoot":"","sources":["../../../../src/modules/map/locations/bulk-geocode.routes.ts"],"names":[],"mappings":"AAQA,QAAA,MAAM,MAAM,4CAAW,CAAC;AAsCxB,OAAO,EAAE,MAAM,IAAI,iBAAiB,EAAE,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/locations/bulk-geocode.routes.js b/api/dist/modules/map/locations/bulk-geocode.routes.js deleted file mode 100644 index 26b8e72e..00000000 --- a/api/dist/modules/map/locations/bulk-geocode.routes.js +++ /dev/null @@ -1,45 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.bulkGeocodeRouter = void 0; -const express_1 = require("express"); -const geocode_queue_service_1 = require("../../../services/geocode-queue.service"); -const bulk_geocode_schemas_1 = require("./bulk-geocode.schemas"); -const validate_1 = require("../../../middleware/validate"); -const auth_middleware_1 = require("../../../middleware/auth.middleware"); -const rbac_middleware_1 = require("../../../middleware/rbac.middleware"); -const roles_1 = require("../../../utils/roles"); -const router = (0, express_1.Router)(); -exports.bulkGeocodeRouter = router; -router.use(auth_middleware_1.authenticate); -router.use((0, rbac_middleware_1.requireRole)(...roles_1.MAP_ROLES)); -// POST /api/map/locations/bulk-geocode — start bulk geocoding job -router.post('/', (0, validate_1.validate)(bulk_geocode_schemas_1.bulkGeocodeSchema), async (req, res, next) => { - try { - const jobId = await geocode_queue_service_1.geocodeQueueService.startBulkGeocode(req.user.id, req.body); - res.json({ jobId, message: 'Bulk geocoding job started' }); - } - catch (err) { - next(err); - } -}); -// GET /api/map/locations/bulk-geocode/:jobId — get job status -router.get('/:jobId', async (req, res, next) => { - try { - const status = await geocode_queue_service_1.geocodeQueueService.getJobStatus(req.params.jobId); - res.json(status); - } - catch (err) { - next(err); - } -}); -// GET /api/map/locations/bulk-geocode/stats — queue statistics -router.get('/stats', async (_req, res, next) => { - try { - const stats = await geocode_queue_service_1.geocodeQueueService.getStats(); - res.json(stats); - } - catch (err) { - next(err); - } -}); -//# sourceMappingURL=bulk-geocode.routes.js.map \ No newline at end of file diff --git a/api/dist/modules/map/locations/bulk-geocode.routes.js.map b/api/dist/modules/map/locations/bulk-geocode.routes.js.map deleted file mode 100644 index 806f2591..00000000 --- a/api/dist/modules/map/locations/bulk-geocode.routes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bulk-geocode.routes.js","sourceRoot":"","sources":["../../../../src/modules/map/locations/bulk-geocode.routes.ts"],"names":[],"mappings":";;;AAAA,qCAAkE;AAClE,mFAA8E;AAC9E,iEAA2D;AAC3D,2DAAwD;AACxD,yEAAmE;AACnE,yEAAkE;AAClE,gDAAiD;AAEjD,MAAM,MAAM,GAAG,IAAA,gBAAM,GAAE,CAAC;AAsCL,mCAAiB;AArCpC,MAAM,CAAC,GAAG,CAAC,8BAAY,CAAC,CAAC;AACzB,MAAM,CAAC,GAAG,CAAC,IAAA,6BAAW,EAAC,GAAG,iBAAS,CAAC,CAAC,CAAC;AAEtC,kEAAkE;AAClE,MAAM,CAAC,IAAI,CACT,GAAG,EACH,IAAA,mBAAQ,EAAC,wCAAiB,CAAC,EAC3B,KAAK,EAAE,GAAY,EAAE,GAAa,EAAE,IAAkB,EAAE,EAAE;IACxD,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,MAAM,2CAAmB,CAAC,gBAAgB,CAAC,GAAG,CAAC,IAAK,CAAC,EAAE,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;QACjF,GAAG,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,4BAA4B,EAAE,CAAC,CAAC;IAC7D,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,GAAG,CAAC,CAAC;IACZ,CAAC;AACH,CAAC,CACF,CAAC;AAEF,8DAA8D;AAC9D,MAAM,CAAC,GAAG,CAAC,SAAS,EAAE,KAAK,EAAE,GAAY,EAAE,GAAa,EAAE,IAAkB,EAAE,EAAE;IAC9E,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,2CAAmB,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,KAAe,CAAC,CAAC;QAClF,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACnB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,GAAG,CAAC,CAAC;IACZ,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,+DAA+D;AAC/D,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,EAAE,IAAa,EAAE,GAAa,EAAE,IAAkB,EAAE,EAAE;IAC9E,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,MAAM,2CAAmB,CAAC,QAAQ,EAAE,CAAC;QACnD,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,GAAG,CAAC,CAAC;IACZ,CAAC;AACH,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/locations/bulk-geocode.schemas.d.ts b/api/dist/modules/map/locations/bulk-geocode.schemas.d.ts deleted file mode 100644 index 7078b78f..00000000 --- a/api/dist/modules/map/locations/bulk-geocode.schemas.d.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { z } from 'zod'; -export declare const bulkGeocodeSchema: z.ZodObject<{ - confidenceThreshold: z.ZodOptional; - buildingType: z.ZodOptional>; - cutId: z.ZodOptional; - limit: z.ZodOptional; -}, "strip", z.ZodTypeAny, { - limit?: number | undefined; - cutId?: string | undefined; - buildingType?: "SINGLE_FAMILY" | "MULTI_UNIT" | "MIXED_USE" | "COMMERCIAL" | undefined; - confidenceThreshold?: number | undefined; -}, { - limit?: number | undefined; - cutId?: string | undefined; - buildingType?: "SINGLE_FAMILY" | "MULTI_UNIT" | "MIXED_USE" | "COMMERCIAL" | undefined; - confidenceThreshold?: number | undefined; -}>; -export type BulkGeocodeInput = z.infer; -//# sourceMappingURL=bulk-geocode.schemas.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/map/locations/bulk-geocode.schemas.d.ts.map b/api/dist/modules/map/locations/bulk-geocode.schemas.d.ts.map deleted file mode 100644 index c488da79..00000000 --- a/api/dist/modules/map/locations/bulk-geocode.schemas.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bulk-geocode.schemas.d.ts","sourceRoot":"","sources":["../../../../src/modules/map/locations/bulk-geocode.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;EAK5B,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/locations/bulk-geocode.schemas.js b/api/dist/modules/map/locations/bulk-geocode.schemas.js deleted file mode 100644 index 12324f22..00000000 --- a/api/dist/modules/map/locations/bulk-geocode.schemas.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.bulkGeocodeSchema = void 0; -const zod_1 = require("zod"); -exports.bulkGeocodeSchema = zod_1.z.object({ - confidenceThreshold: zod_1.z.number().min(0).max(100).optional(), - buildingType: zod_1.z.enum(['SINGLE_FAMILY', 'MULTI_UNIT', 'MIXED_USE', 'COMMERCIAL']).optional(), - cutId: zod_1.z.string().cuid().optional(), - limit: zod_1.z.number().min(1).max(5000).optional(), -}); -//# sourceMappingURL=bulk-geocode.schemas.js.map \ No newline at end of file diff --git a/api/dist/modules/map/locations/bulk-geocode.schemas.js.map b/api/dist/modules/map/locations/bulk-geocode.schemas.js.map deleted file mode 100644 index 10c2c100..00000000 --- a/api/dist/modules/map/locations/bulk-geocode.schemas.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"bulk-geocode.schemas.js","sourceRoot":"","sources":["../../../../src/modules/map/locations/bulk-geocode.schemas.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAEX,QAAA,iBAAiB,GAAG,OAAC,CAAC,MAAM,CAAC;IACxC,mBAAmB,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IAC1D,YAAY,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,eAAe,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,CAAC,CAAC,CAAC,QAAQ,EAAE;IAC3F,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,QAAQ,EAAE;IACnC,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE;CAC9C,CAAC,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/locations/locations.routes.d.ts b/api/dist/modules/map/locations/locations.routes.d.ts deleted file mode 100644 index 0bd97be1..00000000 --- a/api/dist/modules/map/locations/locations.routes.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -declare const adminRouter: import("express-serve-static-core").Router; -declare const publicRouter: import("express-serve-static-core").Router; -export { adminRouter as locationsAdminRouter, publicRouter as locationsPublicRouter }; -//# sourceMappingURL=locations.routes.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/map/locations/locations.routes.d.ts.map b/api/dist/modules/map/locations/locations.routes.d.ts.map deleted file mode 100644 index 689fc921..00000000 --- a/api/dist/modules/map/locations/locations.routes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"locations.routes.d.ts","sourceRoot":"","sources":["../../../../src/modules/map/locations/locations.routes.ts"],"names":[],"mappings":"AA+CA,QAAA,MAAM,WAAW,4CAAW,CAAC;AA4R7B,QAAA,MAAM,YAAY,4CAAW,CAAC;AA4B9B,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,YAAY,IAAI,qBAAqB,EAAE,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/locations/locations.routes.js b/api/dist/modules/map/locations/locations.routes.js deleted file mode 100644 index 11a64bb1..00000000 --- a/api/dist/modules/map/locations/locations.routes.js +++ /dev/null @@ -1,288 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.locationsPublicRouter = exports.locationsAdminRouter = void 0; -const express_1 = require("express"); -const multer_1 = __importDefault(require("multer")); -const locations_service_1 = require("./locations.service"); -const locations_schemas_1 = require("./locations.schemas"); -const spatial_1 = require("../../../utils/spatial"); -const database_1 = require("../../../config/database"); -const validate_1 = require("../../../middleware/validate"); -const auth_middleware_1 = require("../../../middleware/auth.middleware"); -const rbac_middleware_1 = require("../../../middleware/rbac.middleware"); -const roles_1 = require("../../../utils/roles"); -// Multer config for CSV upload (memory storage, 10MB limit) -const upload = (0, multer_1.default)({ - storage: multer_1.default.memoryStorage(), - limits: { fileSize: 10 * 1024 * 1024 }, - fileFilter: (_req, file, cb) => { - if (file.mimetype === 'text/csv' || file.originalname.endsWith('.csv')) { - cb(null, true); - } - else { - cb(new Error('Only CSV files are allowed')); - } - }, -}); -// Multer config for bulk import (100MB limit for large NAR files) -const bulkUpload = (0, multer_1.default)({ - storage: multer_1.default.memoryStorage(), - limits: { fileSize: 100 * 1024 * 1024 }, - fileFilter: (_req, file, cb) => { - if (file.mimetype === 'text/csv' || file.originalname.endsWith('.csv')) { - cb(null, true); - } - else { - cb(new Error('Only CSV files are allowed')); - } - }, -}); -// --- Admin Router --- -const adminRouter = (0, express_1.Router)(); -exports.locationsAdminRouter = adminRouter; -adminRouter.use(auth_middleware_1.authenticate); -adminRouter.use((0, rbac_middleware_1.requireRole)(...roles_1.MAP_ROLES)); -// GET /api/map/locations — list with pagination + filters -adminRouter.get('/', (0, validate_1.validate)(locations_schemas_1.listLocationsSchema, 'query'), async (req, res, next) => { - try { - const result = await locations_service_1.locationsService.findAll(req.query); - res.json(result); - } - catch (err) { - next(err); - } -}); -// GET /api/map/locations/stats — location statistics -adminRouter.get('/stats', async (_req, res, next) => { - try { - const stats = await locations_service_1.locationsService.getStats(); - res.json(stats); - } - catch (err) { - next(err); - } -}); -// GET /api/map/locations/export-csv — export as CSV download -adminRouter.get('/export-csv', async (_req, res, next) => { - try { - const csv = await locations_service_1.locationsService.exportToCsv(); - res.setHeader('Content-Type', 'text/csv'); - res.setHeader('Content-Disposition', 'attachment; filename=locations.csv'); - res.send(csv); - } - catch (err) { - next(err); - } -}); -// GET /api/map/locations/all — all geocoded locations for admin map -adminRouter.get('/all', async (req, res, next) => { - try { - const bounds = req.query.minLat ? { - minLat: parseFloat(req.query.minLat), - maxLat: parseFloat(req.query.maxLat), - minLng: parseFloat(req.query.minLng), - maxLng: parseFloat(req.query.maxLng), - } : undefined; - const limit = req.query.limit ? parseInt(req.query.limit, 10) : 5000; - const locations = await locations_service_1.locationsService.getAllForMap(bounds, limit); - // Add header if we hit the limit - if (locations.length === limit) { - res.setHeader('X-Location-Limit-Hit', 'true'); - } - res.json(locations); - } - catch (err) { - next(err); - } -}); -// POST /api/map/locations/reverse-geocode — reverse geocode lat/lng to address -adminRouter.post('/reverse-geocode', (0, validate_1.validate)(locations_schemas_1.reverseGeocodeSchema), async (req, res, next) => { - try { - const result = await locations_service_1.locationsService.reverseGeocode(req.body.latitude, req.body.longitude); - res.json(result); - } - catch (err) { - next(err); - } -}); -// POST /api/map/locations/import-bulk — bulk import (NAR or standard CSV) -adminRouter.post('/import-bulk', bulkUpload.single('file'), async (req, res, next) => { - // Set 5-minute timeout for large files - req.setTimeout(5 * 60 * 1000); - res.setTimeout(5 * 60 * 1000); - try { - if (!req.file) { - res.status(400).json({ error: { message: 'No file uploaded', code: 'NO_FILE' } }); - return; - } - const parsed = locations_schemas_1.bulkImportSchema.parse(req.body); - // Build filters based on filterType - const filters = {}; - if (parsed.filterType === 'cut' && parsed.cutId) { - const cut = await database_1.prisma.cut.findUnique({ where: { id: parsed.cutId } }); - if (cut) { - try { - filters.cutPolygon = (0, spatial_1.parseGeoJsonPolygon)(cut.geojson); - } - catch { /* ignore invalid polygon */ } - } - } - else if (parsed.filterType === 'mapArea') { - // Load map settings and compute approximate bounding box - const settings = await database_1.prisma.mapSettings.findFirst(); - if (settings?.latitude && settings?.longitude && settings?.zoom) { - const lat = parseFloat(settings.latitude.toString()); - const lng = parseFloat(settings.longitude.toString()); - const zoom = settings.zoom; - // Approximate visible area for a ~1200x800 viewport - const degreesPerTile = 360 / Math.pow(2, zoom); - const halfLng = (1200 / 256 / 2) * degreesPerTile; - const halfLat = (800 / 256 / 2) * degreesPerTile; - filters.bounds = { - north: lat + halfLat, - south: lat - halfLat, - east: lng + halfLng, - west: lng - halfLng, - }; - } - } - else if (parsed.filterType === 'city' && parsed.filterCity) { - filters.city = parsed.filterCity; - } - else if (parsed.filterType === 'province' && parsed.filterProvince) { - filters.province = parsed.filterProvince; - } - const result = await locations_service_1.locationsService.importBulk(req.file.buffer, req.user.id, parsed, filters); - res.json(result); - } - catch (err) { - next(err); - } -}); -// GET /api/map/locations/:id — get single location -adminRouter.get('/:id', async (req, res, next) => { - try { - const id = req.params.id; - const location = await locations_service_1.locationsService.findById(id); - res.json(location); - } - catch (err) { - next(err); - } -}); -// GET /api/map/locations/:id/history — get location edit history -adminRouter.get('/:id/history', async (req, res, next) => { - try { - const id = req.params.id; - const page = req.query.page ? parseInt(req.query.page, 10) : 1; - const limit = req.query.limit ? parseInt(req.query.limit, 10) : 20; - const result = await locations_service_1.locationsService.getHistory(id, page, limit); - res.json(result); - } - catch (err) { - next(err); - } -}); -// POST /api/map/locations — create location -adminRouter.post('/', (0, validate_1.validate)(locations_schemas_1.createLocationSchema), async (req, res, next) => { - try { - const location = await locations_service_1.locationsService.create(req.body, req.user.id); - res.status(201).json(location); - } - catch (err) { - next(err); - } -}); -// PUT /api/map/locations/:id — update location -adminRouter.put('/:id', (0, validate_1.validate)(locations_schemas_1.updateLocationSchema), async (req, res, next) => { - try { - const id = req.params.id; - const location = await locations_service_1.locationsService.update(id, req.body, req.user.id); - res.json(location); - } - catch (err) { - next(err); - } -}); -// DELETE /api/map/locations/:id — delete location -adminRouter.delete('/:id', async (req, res, next) => { - try { - const id = req.params.id; - await locations_service_1.locationsService.delete(id); - res.status(204).send(); - } - catch (err) { - next(err); - } -}); -// POST /api/map/locations/bulk-delete — bulk delete -adminRouter.post('/bulk-delete', (0, validate_1.validate)(locations_schemas_1.bulkDeleteSchema), async (req, res, next) => { - try { - const result = await locations_service_1.locationsService.bulkDelete(req.body.ids); - res.json(result); - } - catch (err) { - next(err); - } -}); -// POST /api/map/locations/geocode — geocode an address -adminRouter.post('/geocode', (0, validate_1.validate)(locations_schemas_1.geocodeAddressSchema), async (req, res, next) => { - try { - const result = await locations_service_1.locationsService.geocodeAddress(req.body.address); - res.json(result); - } - catch (err) { - next(err); - } -}); -// POST /api/map/locations/geocode-missing — geocode all ungeocoded locations -adminRouter.post('/geocode-missing', async (_req, res, next) => { - try { - const result = await locations_service_1.locationsService.geocodeMissing(); - res.json(result); - } - catch (err) { - next(err); - } -}); -// POST /api/map/locations/import-csv — upload + import CSV -adminRouter.post('/import-csv', upload.single('file'), async (req, res, next) => { - try { - if (!req.file) { - res.status(400).json({ error: { message: 'No file uploaded', code: 'NO_FILE' } }); - return; - } - const result = await locations_service_1.locationsService.importFromCsv(req.file.buffer, req.user.id); - res.json(result); - } - catch (err) { - next(err); - } -}); -// --- Public Router --- -const publicRouter = (0, express_1.Router)(); -exports.locationsPublicRouter = publicRouter; -// GET /api/map/locations/public — all locations for map (no PII) -publicRouter.get('/public', async (req, res, next) => { - try { - const bounds = req.query.minLat ? { - minLat: parseFloat(req.query.minLat), - maxLat: parseFloat(req.query.maxLat), - minLng: parseFloat(req.query.minLng), - maxLng: parseFloat(req.query.maxLng), - } : undefined; - const locations = await locations_service_1.locationsService.getPublicLocations(bounds); - // Add header if we hit the safety limit - if (locations.length === 5000) { - res.setHeader('X-Location-Limit-Hit', 'true'); - } - res.json(locations); - } - catch (err) { - next(err); - } -}); -//# sourceMappingURL=locations.routes.js.map \ No newline at end of file diff --git a/api/dist/modules/map/locations/locations.routes.js.map b/api/dist/modules/map/locations/locations.routes.js.map deleted file mode 100644 index a8d1ec19..00000000 --- a/api/dist/modules/map/locations/locations.routes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"locations.routes.js","sourceRoot":"","sources":["../../../../src/modules/map/locations/locations.routes.ts"],"names":[],"mappings":";;;;;;AAAA,qCAAkE;AAClE,oDAA4B;AAC5B,2DAAuD;AACvD,2DAS6B;AAC7B,oDAA6D;AAC7D,uDAAkD;AAClD,2DAAwD;AACxD,yEAAmE;AACnE,yEAAkE;AAClE,gDAAiD;AAEjD,4DAA4D;AAC5D,MAAM,MAAM,GAAG,IAAA,gBAAM,EAAC;IACpB,OAAO,EAAE,gBAAM,CAAC,aAAa,EAAE;IAC/B,MAAM,EAAE,EAAE,QAAQ,EAAE,EAAE,GAAG,IAAI,GAAG,IAAI,EAAE;IACtC,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE;QAC7B,IAAI,IAAI,CAAC,QAAQ,KAAK,UAAU,IAAI,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;YACvE,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACjB,CAAC;aAAM,CAAC;YACN,EAAE,CAAC,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC,CAAC;QAC9C,CAAC;IACH,CAAC;CACF,CAAC,CAAC;AAEH,kEAAkE;AAClE,MAAM,UAAU,GAAG,IAAA,gBAAM,EAAC;IACxB,OA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AC9C,MAAM,EAAE,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,MAAgB,CAAC;YAC9C,MAAM,EAAE,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,MAAgB,CAAC;SAC/C,CAAC,CAAC,CAAC,SAAS,CAAC;QAEd,MAAM,SAAS,GAAG,MAAM,oCAAgB,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC;QAEpE,wCAAwC;QACxC,IAAI,SAAS,CAAC,MAAM,KAAK,IAAI,EAAE,CAAC;YAC9B,GAAG,CAAC,SAAS,CAAC,sBAAsB,EAAE,MAAM,CAAC,CAAC;QAChD,CAAC;QAED,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACtB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,GAAG,CAAC,CAAC;IACZ,CAAC;AACH,CAAC,CACF,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/locations/locations.schemas.d.ts b/api/dist/modules/map/locations/locations.schemas.d.ts deleted file mode 100644 index 330d62b1..00000000 --- a/api/dist/modules/map/locations/locations.schemas.d.ts +++ /dev/null @@ -1,228 +0,0 @@ -import { z } from 'zod'; -export declare const createLocationSchema: z.ZodObject<{ - address: z.ZodString; - firstName: z.ZodOptional; - lastName: z.ZodOptional; - email: z.ZodUnion<[z.ZodOptional, z.ZodLiteral<"">]>; - phone: z.ZodOptional; - unitNumber: z.ZodOptional; - supportLevel: z.ZodOptional>; - sign: z.ZodDefault>; - signSize: z.ZodOptional; - notes: z.ZodOptional; - buildingNotes: z.ZodOptional; - latitude: z.ZodOptional; - longitude: z.ZodOptional; -}, "strip", z.ZodTypeAny, { - address: string; - sign: boolean; - email?: string | undefined; - phone?: string | undefined; - latitude?: number | undefined; - longitude?: number | undefined; - notes?: string | undefined; - firstName?: string | undefined; - lastName?: string | undefined; - supportLevel?: "LEVEL_1" | "LEVEL_2" | "LEVEL_3" | "LEVEL_4" | undefined; - unitNumber?: string | undefined; - buildingNotes?: string | undefined; - signSize?: string | undefined; -}, { - address: string; - email?: string | undefined; - phone?: string | undefined; - latitude?: number | undefined; - longitude?: number | undefined; - notes?: string | undefined; - firstName?: string | undefined; - lastName?: string | undefined; - supportLevel?: "LEVEL_1" | "LEVEL_2" | "LEVEL_3" | "LEVEL_4" | undefined; - unitNumber?: string | undefined; - buildingNotes?: string | undefined; - sign?: boolean | undefined; - signSize?: string | undefined; -}>; -export declare const updateLocationSchema: z.ZodObject<{ - address: z.ZodOptional; - latitude: z.ZodOptional>; - longitude: z.ZodOptional>; - postalCode: z.ZodOptional>; - province: z.ZodOptional>; - buildingType: z.ZodOptional>>; - buildingNotes: z.ZodOptional>; - firstName: z.ZodOptional>; - lastName: z.ZodOptional>; - email: z.ZodOptional, z.ZodLiteral<"">]>>>; - phone: z.ZodOptional>; - unitNumber: z.ZodOptional>; - supportLevel: z.ZodOptional>>; - sign: z.ZodOptional; - signSize: z.ZodOptional>; - notes: z.ZodOptional>; -}, "strip", z.ZodTypeAny, { - email?: string | null | undefined; - phone?: string | null | undefined; - latitude?: number | null | undefined; - longitude?: number | null | undefined; - notes?: string | null | undefined; - firstName?: string | null | undefined; - lastName?: string | null | undefined; - supportLevel?: "LEVEL_1" | "LEVEL_2" | "LEVEL_3" | "LEVEL_4" | null | undefined; - address?: string | undefined; - unitNumber?: string | null | undefined; - postalCode?: string | null | undefined; - province?: string | null | undefined; - buildingType?: "SINGLE_FAMILY" | "MULTI_UNIT" | "MIXED_USE" | "COMMERCIAL" | null | undefined; - buildingNotes?: string | null | undefined; - sign?: boolean | undefined; - signSize?: string | null | undefined; -}, { - email?: string | null | undefined; - phone?: string | null | undefined; - latitude?: number | null | undefined; - longitude?: number | null | undefined; - notes?: string | null | undefined; - firstName?: string | null | undefined; - lastName?: string | null | undefined; - supportLevel?: "LEVEL_1" | "LEVEL_2" | "LEVEL_3" | "LEVEL_4" | null | undefined; - address?: string | undefined; - unitNumber?: string | null | undefined; - postalCode?: string | null | undefined; - province?: string | null | undefined; - buildingType?: "SINGLE_FAMILY" | "MULTI_UNIT" | "MIXED_USE" | "COMMERCIAL" | null | undefined; - buildingNotes?: string | null | undefined; - sign?: boolean | undefined; - signSize?: string | null | undefined; -}>; -export declare const listLocationsSchema: z.ZodObject<{ - page: z.ZodDefault; - limit: z.ZodDefault; - search: z.ZodOptional; - supportLevel: z.ZodOptional>; - hasSign: z.ZodOptional; - confidenceLevel: z.ZodOptional>; - sortBy: z.ZodDefault>>; - sortOrder: z.ZodDefault>>; -}, "strip", z.ZodTypeAny, { - limit: number; - page: number; - sortBy: "createdAt" | "supportLevel" | "address"; - sortOrder: "asc" | "desc"; - search?: string | undefined; - supportLevel?: "LEVEL_1" | "LEVEL_2" | "LEVEL_3" | "LEVEL_4" | undefined; - hasSign?: boolean | undefined; - confidenceLevel?: "none" | "low" | "medium" | "high" | undefined; -}, { - search?: string | undefined; - limit?: number | undefined; - page?: number | undefined; - sortBy?: "createdAt" | "supportLevel" | "address" | undefined; - sortOrder?: "asc" | "desc" | undefined; - supportLevel?: "LEVEL_1" | "LEVEL_2" | "LEVEL_3" | "LEVEL_4" | undefined; - hasSign?: boolean | undefined; - confidenceLevel?: "none" | "low" | "medium" | "high" | undefined; -}>; -export declare const locationIdSchema: z.ZodObject<{ - id: z.ZodString; -}, "strip", z.ZodTypeAny, { - id: string; -}, { - id: string; -}>; -export declare const geocodeAddressSchema: z.ZodObject<{ - address: z.ZodString; -}, "strip", z.ZodTypeAny, { - address: string; -}, { - address: string; -}>; -export declare const bulkDeleteSchema: z.ZodObject<{ - ids: z.ZodArray; -}, "strip", z.ZodTypeAny, { - ids: string[]; -}, { - ids: string[]; -}>; -export declare const reverseGeocodeSchema: z.ZodObject<{ - latitude: z.ZodNumber; - longitude: z.ZodNumber; -}, "strip", z.ZodTypeAny, { - latitude: number; - longitude: number; -}, { - latitude: number; - longitude: number; -}>; -export declare const bulkImportSchema: z.ZodObject<{ - format: z.ZodDefault>; - filterType: z.ZodDefault>; - cutId: z.ZodOptional; - filterCity: z.ZodOptional; - filterProvince: z.ZodOptional; - residentialOnly: z.ZodDefault; - deduplicateRadius: z.ZodDefault; - skipGeocoding: z.ZodDefault; - batchSize: z.ZodDefault; -}, "strip", z.ZodTypeAny, { - format: "standard" | "nar"; - filterType: "none" | "city" | "cut" | "province" | "mapArea"; - residentialOnly: boolean; - deduplicateRadius: number; - skipGeocoding: boolean; - batchSize: number; - cutId?: string | undefined; - filterCity?: string | undefined; - filterProvince?: string | undefined; -}, { - format?: "standard" | "nar" | undefined; - cutId?: string | undefined; - filterType?: "none" | "city" | "cut" | "province" | "mapArea" | undefined; - filterCity?: string | undefined; - filterProvince?: string | undefined; - residentialOnly?: boolean | undefined; - deduplicateRadius?: number | undefined; - skipGeocoding?: boolean | undefined; - batchSize?: number | undefined; -}>; -export declare const boundsQuerySchema: z.ZodObject<{ - minLat: z.ZodNumber; - maxLat: z.ZodNumber; - minLng: z.ZodNumber; - maxLng: z.ZodNumber; -}, "strip", z.ZodTypeAny, { - minLat: number; - maxLat: number; - minLng: number; - maxLng: number; -}, { - minLat: number; - maxLat: number; - minLng: number; - maxLng: number; -}>; -export type CreateLocationInput = z.infer; -export type UpdateLocationInput = z.infer; -export type ListLocationsInput = z.infer; -export type BulkImportInput = z.infer; -export type BoundsQuery = z.infer; -//# sourceMappingURL=locations.schemas.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/map/locations/locations.schemas.d.ts.map b/api/dist/modules/map/locations/locations.schemas.d.ts.map deleted file mode 100644 index 853feb64..00000000 --- a/api/dist/modules/map/locations/locations.schemas.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"locations.schemas.d.ts","sourceRoot":"","sources":["../../../../src/modules/map/locations/locations.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAc/B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmB/B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAS9B,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;EAE3B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;EAE/B,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;EAE3B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;EAG/B,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAU3B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;EAK5B,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACvE,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACvE,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACrE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC/D,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/locations/locations.schemas.js b/api/dist/modules/map/locations/locations.schemas.js deleted file mode 100644 index 21c5dbd4..00000000 --- a/api/dist/modules/map/locations/locations.schemas.js +++ /dev/null @@ -1,81 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.boundsQuerySchema = exports.bulkImportSchema = exports.reverseGeocodeSchema = exports.bulkDeleteSchema = exports.geocodeAddressSchema = exports.locationIdSchema = exports.listLocationsSchema = exports.updateLocationSchema = exports.createLocationSchema = void 0; -const zod_1 = require("zod"); -const client_1 = require("@prisma/client"); -exports.createLocationSchema = zod_1.z.object({ - address: zod_1.z.string().min(1, 'Address is required'), - firstName: zod_1.z.string().optional(), - lastName: zod_1.z.string().optional(), - email: zod_1.z.string().email().optional().or(zod_1.z.literal('')), - phone: zod_1.z.string().optional(), - unitNumber: zod_1.z.string().optional(), - supportLevel: zod_1.z.nativeEnum(client_1.SupportLevel).optional(), - sign: zod_1.z.boolean().optional().default(false), - signSize: zod_1.z.string().optional(), - notes: zod_1.z.string().optional(), - buildingNotes: zod_1.z.string().max(2000, 'Building notes must be 2000 characters or less').optional(), - latitude: zod_1.z.number().min(-90).max(90).optional(), - longitude: zod_1.z.number().min(-180).max(180).optional(), -}); -exports.updateLocationSchema = zod_1.z.object({ - // Location fields - address: zod_1.z.string().min(1).optional(), - latitude: zod_1.z.number().min(-90).max(90).nullable().optional(), - longitude: zod_1.z.number().min(-180).max(180).nullable().optional(), - postalCode: zod_1.z.string().nullable().optional(), - province: zod_1.z.string().nullable().optional(), - buildingType: zod_1.z.nativeEnum(client_1.BuildingType).nullable().optional(), - buildingNotes: zod_1.z.string().max(2000, 'Building notes must be 2000 characters or less').nullable().optional(), - // Address fields (will update first address) - firstName: zod_1.z.string().nullable().optional(), - lastName: zod_1.z.string().nullable().optional(), - email: zod_1.z.string().email().optional().or(zod_1.z.literal('')).nullable().optional(), - phone: zod_1.z.string().nullable().optional(), - unitNumber: zod_1.z.string().nullable().optional(), - supportLevel: zod_1.z.nativeEnum(client_1.SupportLevel).nullable().optional(), - sign: zod_1.z.boolean().optional(), - signSize: zod_1.z.string().nullable().optional(), - notes: zod_1.z.string().nullable().optional(), -}); -exports.listLocationsSchema = zod_1.z.object({ - page: zod_1.z.coerce.number().int().positive().default(1), - limit: zod_1.z.coerce.number().int().positive().max(100).default(20), - search: zod_1.z.string().optional(), - supportLevel: zod_1.z.nativeEnum(client_1.SupportLevel).optional(), - hasSign: zod_1.z.coerce.boolean().optional(), - confidenceLevel: zod_1.z.enum(['high', 'medium', 'low', 'none']).optional(), - sortBy: zod_1.z.enum(['createdAt', 'address', 'supportLevel']).optional().default('createdAt'), - sortOrder: zod_1.z.enum(['asc', 'desc']).optional().default('desc'), -}); -exports.locationIdSchema = zod_1.z.object({ - id: zod_1.z.string().min(1), -}); -exports.geocodeAddressSchema = zod_1.z.object({ - address: zod_1.z.string().min(1, 'Address is required'), -}); -exports.bulkDeleteSchema = zod_1.z.object({ - ids: zod_1.z.array(zod_1.z.string().min(1)).min(1, 'At least one ID is required'), -}); -exports.reverseGeocodeSchema = zod_1.z.object({ - latitude: zod_1.z.number().min(-90).max(90), - longitude: zod_1.z.number().min(-180).max(180), -}); -exports.bulkImportSchema = zod_1.z.object({ - format: zod_1.z.enum(['standard', 'nar']).default('standard'), - filterType: zod_1.z.enum(['none', 'cut', 'mapArea', 'city', 'province']).default('none'), - cutId: zod_1.z.string().optional(), - filterCity: zod_1.z.string().optional(), - filterProvince: zod_1.z.string().optional(), - residentialOnly: zod_1.z.coerce.boolean().default(false), - deduplicateRadius: zod_1.z.coerce.number().min(0).max(100).default(5), - skipGeocoding: zod_1.z.coerce.boolean().default(true), - batchSize: zod_1.z.coerce.number().int().min(100).max(5000).default(1000), -}); -exports.boundsQuerySchema = zod_1.z.object({ - minLat: zod_1.z.coerce.number().min(-90).max(90), - maxLat: zod_1.z.coerce.number().min(-90).max(90), - minLng: zod_1.z.coerce.number().min(-180).max(180), - maxLng: zod_1.z.coerce.number().min(-180).max(180), -}); -//# sourceMappingURL=locations.schemas.js.map \ No newline at end of file diff --git a/api/dist/modules/map/locations/locations.schemas.js.map b/api/dist/modules/map/locations/locations.schemas.js.map deleted file mode 100644 index 9de1df51..00000000 --- a/api/dist/modules/map/locations/locations.schemas.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"locations.schemas.js","sourceRoot":"","sources":["../../../../src/modules/map/locations/locations.schemas.ts"],"names":[],"mappings":";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,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;CAC7C,CAAC,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/locations/locations.service.d.ts b/api/dist/modules/map/locations/locations.service.d.ts deleted file mode 100644 index affa5db6..00000000 --- a/api/dist/modules/map/locations/locations.service.d.ts +++ /dev/null @@ -1,266 +0,0 @@ -import { Prisma, SupportLevel } from '@prisma/client'; -import type { CreateLocationInput, UpdateLocationInput, ListLocationsInput, BulkImportInput } from './locations.schemas'; -interface ImportFilters { - cutPolygon?: number[][][]; - bounds?: { - north: number; - south: number; - east: number; - west: number; - }; - city?: string; - province?: string; -} -export declare const locationsService: { - findAll(filters: ListLocationsInput): Promise<{ - locations: ({ - addresses: { - id: string; - firstName: string | null; - lastName: string | null; - supportLevel: import(".prisma/client").$Enums.SupportLevel | null; - unitNumber: string | null; - sign: boolean; - }[]; - } & { - id: string; - createdAt: Date; - updatedAt: Date; - latitude: Prisma.Decimal; - longitude: Prisma.Decimal; - createdByUserId: string | null; - updatedByUserId: string | null; - address: string; - postalCode: string | null; - province: string | null; - federalDistrict: string | null; - buildingUse: number | null; - locGuid: string | null; - buildingType: import(".prisma/client").$Enums.BuildingType; - totalUnits: number; - buildingNotes: string | null; - geocodeConfidence: number | null; - geocodeProvider: import(".prisma/client").$Enums.GeocodeProvider | null; - })[]; - pagination: { - page: number; - limit: number; - total: number; - totalPages: number; - }; - }>; - findById(id: string): Promise<{ - addresses: { - id: string; - email: string | null; - phone: string | null; - notes: string | null; - firstName: string | null; - lastName: string | null; - supportLevel: import(".prisma/client").$Enums.SupportLevel | null; - unitNumber: string | null; - sign: boolean; - signSize: string | null; - }[]; - } & { - id: string; - createdAt: Date; - updatedAt: Date; - latitude: Prisma.Decimal; - longitude: Prisma.Decimal; - createdByUserId: string | null; - updatedByUserId: string | null; - address: string; - postalCode: string | null; - province: string | null; - federalDistrict: string | null; - buildingUse: number | null; - locGuid: string | null; - buildingType: import(".prisma/client").$Enums.BuildingType; - totalUnits: number; - buildingNotes: string | null; - geocodeConfidence: number | null; - geocodeProvider: import(".prisma/client").$Enums.GeocodeProvider | null; - }>; - create(data: CreateLocationInput, userId: string | null): Promise<{ - id: string; - createdAt: Date; - updatedAt: Date; - latitude: Prisma.Decimal; - longitude: Prisma.Decimal; - createdByUserId: string | null; - updatedByUserId: string | null; - address: string; - postalCode: string | null; - province: string | null; - federalDistrict: string | null; - buildingUse: number | null; - locGuid: string | null; - buildingType: import(".prisma/client").$Enums.BuildingType; - totalUnits: number; - buildingNotes: string | null; - geocodeConfidence: number | null; - geocodeProvider: import(".prisma/client").$Enums.GeocodeProvider | null; - }>; - update(id: string, data: UpdateLocationInput, userId: string): Promise<{ - id: string; - createdAt: Date; - updatedAt: Date; - latitude: Prisma.Decimal; - longitude: Prisma.Decimal; - createdByUserId: string | null; - updatedByUserId: string | null; - address: string; - postalCode: string | null; - province: string | null; - federalDistrict: string | null; - buildingUse: number | null; - locGuid: string | null; - buildingType: import(".prisma/client").$Enums.BuildingType; - totalUnits: number; - buildingNotes: string | null; - geocodeConfidence: number | null; - geocodeProvider: import(".prisma/client").$Enums.GeocodeProvider | null; - }>; - delete(id: string): Promise; - bulkDelete(ids: string[]): Promise<{ - deleted: number; - }>; - getHistory(locationId: string, page?: number, limit?: number): Promise<{ - history: ({ - user: { - id: string; - email: string; - name: string | null; - role: import(".prisma/client").$Enums.UserRole; - } | null; - } & { - id: string; - createdAt: Date; - userId: string | null; - action: import(".prisma/client").$Enums.LocationHistoryAction; - metadata: Prisma.JsonValue | null; - locationId: string; - field: string | null; - oldValue: string | null; - newValue: string | null; - })[]; - pagination: { - page: number; - limit: number; - total: number; - totalPages: number; - }; - }>; - geocodeAddress(address: string): Promise; - geocodeMissing(): Promise<{ - total: number; - geocoded: number; - failed: number; - }>; - getStats(): Promise<{ - total: number; - buildingTypes: { - SINGLE_FAMILY: number; - MULTI_UNIT: number; - MIXED_USE: number; - COMMERCIAL: number; - }; - geocoded: number; - ungeocoded: number; - confidence: { - high: number; - medium: number; - low: number; - none: number; - average: number | null; - }; - providers: { - nominatim: number; - mapbox: number; - arcgis: number; - photon: number; - google: number; - locationiq: number; - manual: number; - }; - }>; - getAllForMap(bounds?: { - minLat: number; - maxLat: number; - minLng: number; - maxLng: number; - }, limit?: number): Promise<({ - addresses: { - id: string; - email: string | null; - phone: string | null; - notes: string | null; - firstName: string | null; - lastName: string | null; - supportLevel: import(".prisma/client").$Enums.SupportLevel | null; - unitNumber: string | null; - sign: boolean; - signSize: string | null; - }[]; - } & { - id: string; - createdAt: Date; - updatedAt: Date; - latitude: Prisma.Decimal; - longitude: Prisma.Decimal; - createdByUserId: string | null; - updatedByUserId: string | null; - address: string; - postalCode: string | null; - province: string | null; - federalDistrict: string | null; - buildingUse: number | null; - locGuid: string | null; - buildingType: import(".prisma/client").$Enums.BuildingType; - totalUnits: number; - buildingNotes: string | null; - geocodeConfidence: number | null; - geocodeProvider: import(".prisma/client").$Enums.GeocodeProvider | null; - })[]>; - getPublicLocations(bounds?: { - minLat: number; - maxLat: number; - minLng: number; - maxLng: number; - }): Promise<{ - id: string; - latitude: Prisma.Decimal; - longitude: Prisma.Decimal; - addresses: { - id: string; - supportLevel: import(".prisma/client").$Enums.SupportLevel | null; - unitNumber: string | null; - sign: boolean; - signSize: string | null; - }[]; - address: string; - }[]>; - importFromCsv(buffer: Buffer, userId: string): Promise<{ - total: number; - success: number; - warnings: number; - failed: number; - errors: string[]; - }>; - reverseGeocode(latitude: number, longitude: number): Promise; - importBulk(buffer: Buffer, userId: string, options: BulkImportInput, filters?: ImportFilters): Promise<{ - total: number; - created: number; - skippedDuplicate: number; - skippedOutOfBounds: number; - skippedInvalid: number; - errors: string[]; - }>; - exportToCsv(filters?: { - supportLevel?: SupportLevel; - hasSign?: boolean; - }): Promise; -}; -export {}; -//# sourceMappingURL=locations.service.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/map/locations/locations.service.d.ts.map b/api/dist/modules/map/locations/locations.service.d.ts.map deleted file mode 100644 index 6662ccae..00000000 --- a/api/dist/modules/map/locations/locations.service.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"locations.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/map/locations/locations.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,YAAY,EAA0C,MAAM,gBAAgB,CAAC;AAW9F,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAKzH,UAAU,aAAa;IACrB,UAAU,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;IAC1B,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACtE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAkLD,eAAO,MAAM,gBAAgB;qBACJ,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0FtB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0BN,mBAAmB,UAAU,MAAM,GAAG,IAAI;;;;;;;;;;;;;;;;;;;;eA2E5C,MAAM,QAAQ,mBAAmB,UAAU,MAAM;;;;;;;;;;;;;;;;;;;;eA2HjD,MAAM;oBAQD,MAAM,EAAE;;;2BAOD,MAAM,SAAQ,MAAM,UAAa,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;4BA4BtC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAwIR;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,UAAS,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCA4C3E;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE;;;;;;;;;;;;;0BA2DxE,MAAM,UAAU,MAAM;;;;;;;6BA4GnB,MAAM,aAAa,MAAM;uBAS9C,MAAM,UACN,MAAM,WACL,eAAe,YACd,aAAa;;;;;;;;0BAgUG;QAAE,YAAY,CAAC,EAAE,YAAY,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE;CAyD/E,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/locations/locations.service.js b/api/dist/modules/map/locations/locations.service.js deleted file mode 100644 index cd0a63c9..00000000 --- a/api/dist/modules/map/locations/locations.service.js +++ /dev/null @@ -1,1157 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.locationsService = void 0; -const client_1 = require("@prisma/client"); -const sync_1 = require("csv-parse/sync"); -const sync_2 = require("csv-stringify/sync"); -const proj4_1 = __importDefault(require("proj4")); -const database_1 = require("../../../config/database"); -const error_handler_1 = require("../../../middleware/error-handler"); -const geocoding_service_1 = require("../geocoding/geocoding.service"); -const logger_1 = require("../../../utils/logger"); -const metrics_1 = require("../../../utils/metrics"); -const spatial_1 = require("../../../utils/spatial"); -const settings_service_1 = require("../settings/settings.service"); -// Statistics Canada Lambert Conformal Conic projection (EPSG:3347) → WGS84 (EPSG:4326) -proj4_1.default.defs('EPSG:3347', '+proj=lcc +lat_1=49 +lat_2=77 +lat_0=63.390675 +lon_0=-91.86666666666666 +x_0=6200000 +y_0=3000000 +ellps=GRS80 +units=m +no_defs'); -// Map CSV header names to our fields (case-insensitive, flexible) -const CSV_HEADER_MAP = { - 'address': 'address', - 'street': 'address', - 'street address': 'address', - 'first name': 'firstName', - 'firstname': 'firstName', - 'first': 'firstName', - 'last name': 'lastName', - 'lastname': 'lastName', - 'last': 'lastName', - 'email': 'email', - 'e-mail': 'email', - 'phone': 'phone', - 'telephone': 'phone', - 'tel': 'phone', - 'phone number': 'phone', - 'unit': 'unitNumber', - 'unit number': 'unitNumber', - 'unitnumber': 'unitNumber', - 'apt': 'unitNumber', - 'apartment': 'unitNumber', - 'suite': 'unitNumber', - 'support level': 'supportLevel', - 'supportlevel': 'supportLevel', - 'support': 'supportLevel', - 'level': 'supportLevel', - 'sign': 'sign', - 'lawn sign': 'sign', - 'sign size': 'signSize', - 'signsize': 'signSize', - 'notes': 'notes', - 'note': 'notes', - 'comments': 'notes', - 'latitude': 'latitude', - 'lat': 'latitude', - 'longitude': 'longitude', - 'lng': 'longitude', - 'lon': 'longitude', -}; -// NAR (National Address Register) column name mapping → internal keys -// Supports both 2025 NAR format (CIVIC_NO, OFFICIAL_STREET_NAME, BG_X/BG_Y) -// and legacy format (STR_NBR, STR_NME, LAT/LNG) -const NAR_HEADER_MAP = { - // 2025 NAR Address file columns - 'civic_no': 'CIVIC_NO', - 'civic_no_suffix': 'CIVIC_NO_SUFFIX', - 'official_street_name': 'STREET_NAME', - 'official_street_type': 'STREET_TYPE', - 'official_street_dir': 'STREET_DIR', - 'apt_no_label': 'UNIT_NBR', - 'bg_x': 'BG_X', - 'bg_y': 'BG_Y', - 'bg_latitude': 'LAT', - 'bg_longitude': 'LNG', - 'mail_mun_name': 'CITY', - 'csd_eng_name': 'CSD_NAME', - 'mail_prov_abvn': 'PROV', - 'prov_code': 'PROV_CODE', - 'mail_postal_code': 'POSTAL_CODE', - 'fed_eng_name': 'FED_DISTRICT', - 'fed_code': 'FED_CODE', - 'bu_use': 'BU_USE', - // Legacy column support (backward compatibility) - 'str_nbr': 'CIVIC_NO', 'street_number': 'CIVIC_NO', 'house_number': 'CIVIC_NO', - 'str_nme': 'STREET_NAME', 'street_name': 'STREET_NAME', - 'str_typ': 'STREET_TYPE', 'street_type': 'STREET_TYPE', - 'str_dir': 'STREET_DIR', 'street_direction': 'STREET_DIR', - 'unit_nbr': 'UNIT_NBR', 'unit': 'UNIT_NBR', 'suite': 'UNIT_NBR', - 'lat': 'LAT', 'latitude': 'LAT', - 'lng': 'LNG', 'lon': 'LNG', 'longitude': 'LNG', 'long': 'LNG', - 'city': 'CITY', 'mun_nme': 'CITY', 'municipality': 'CITY', - 'prov': 'PROV', 'province': 'PROV', 'prv_nme': 'PROV', -}; -// Columns that indicate NAR format (match 3+ = NAR) -const NAR_DETECT_COLUMNS = [ - 'CIVIC_NO', 'OFFICIAL_STREET_NAME', 'OFFICIAL_STREET_TYPE', // 2025 NAR - 'BG_X', 'BG_Y', 'MAIL_POSTAL_CODE', 'MAIL_PROV_ABVN', // 2025 NAR - 'BG_LATITUDE', 'BG_LONGITUDE', // 2025 NAR Location files - 'STR_NBR', 'STR_NME', 'STR_TYP', 'LAT', 'LNG', // Legacy -]; -function detectNarFormat(headers) { - const normalizedHeaders = headers.map((h) => h.trim().toUpperCase()); - let matchCount = 0; - const matched = new Set(); - for (const col of NAR_DETECT_COLUMNS) { - if (normalizedHeaders.includes(col) && !matched.has(col)) { - matched.add(col); - matchCount++; - } - } - // Also check via aliases (lowercase header → uppercase target) - for (const h of normalizedHeaders) { - const alias = NAR_HEADER_MAP[h.toLowerCase()]; - if (alias && !matched.has(h)) { - matched.add(h); - matchCount++; - } - } - return matchCount >= 3; -} -/** Convert BG_X/BG_Y (EPSG:3347 Lambert) to [lat, lng] (WGS84) */ -function lambertToLatLng(bgX, bgY) { - const [lng, lat] = (0, proj4_1.default)('EPSG:3347', 'EPSG:4326', [bgX, bgY]); - return [lat, lng]; -} -function roundCoord(val, decimals = 5) { - const factor = Math.pow(10, decimals); - return Math.round(val * factor) / factor; -} -function parseSupportLevel(value) { - const v = value.trim(); - if (v === '1' || v.toLowerCase() === 'level_1') - return client_1.SupportLevel.LEVEL_1; - if (v === '2' || v.toLowerCase() === 'level_2') - return client_1.SupportLevel.LEVEL_2; - if (v === '3' || v.toLowerCase() === 'level_3') - return client_1.SupportLevel.LEVEL_3; - if (v === '4' || v.toLowerCase() === 'level_4') - return client_1.SupportLevel.LEVEL_4; - return undefined; -} -function parseBoolean(value) { - const v = value.trim().toLowerCase(); - return v === 'true' || v === 'yes' || v === '1' || v === 'y'; -} -/** - * Record location history for audit trail - */ -async function recordHistory(locationId, userId, action, changes, metadata) { - const historyRecords = changes?.map(({ field, oldValue, newValue }) => ({ - locationId, - userId, - action, - field, - oldValue: oldValue != null ? String(oldValue) : null, - newValue: newValue != null ? String(newValue) : null, - metadata: metadata ? metadata : undefined, - })) ?? [{ - locationId, - userId, - action, - field: null, - oldValue: null, - newValue: null, - metadata: metadata ? metadata : undefined, - }]; - await database_1.prisma.locationHistory.createMany({ data: historyRecords }); -} -exports.locationsService = { - async findAll(filters) { - const { page, limit, search, supportLevel, hasSign, confidenceLevel, sortBy, sortOrder } = filters; - const skip = (page - 1) * limit; - const where = {}; - // Address-level filters (search contacts, supportLevel, sign) - const addressWhere = {}; - let hasAddressFilters = false; - if (search) { - // Search both location address and address contact info - where.OR = [ - { address: { contains: search, mode: 'insensitive' } }, - { - addresses: { - some: { - OR: [ - { firstName: { contains: search, mode: 'insensitive' } }, - { lastName: { contains: search, mode: 'insensitive' } }, - { email: { contains: search, mode: 'insensitive' } }, - ], - }, - }, - }, - ]; - } - if (supportLevel) { - addressWhere.supportLevel = supportLevel; - hasAddressFilters = true; - } - if (hasSign !== undefined) { - addressWhere.sign = hasSign; - hasAddressFilters = true; - } - if (hasAddressFilters) { - where.addresses = { some: addressWhere }; - } - // Confidence level filter (Location-level) - if (confidenceLevel) { - if (confidenceLevel === 'high') { - where.geocodeConfidence = { gte: 85 }; - } - else if (confidenceLevel === 'medium') { - where.geocodeConfidence = { gte: 60, lt: 85 }; - } - else if (confidenceLevel === 'low') { - where.geocodeConfidence = { lt: 60, gt: 0 }; - } - else if (confidenceLevel === 'none') { - const noConfidenceConditions = [{ geocodeConfidence: null }, { geocodeConfidence: 0 }]; - where.OR = where.OR ? [...where.OR, ...noConfidenceConditions] : noConfidenceConditions; - } - } - const orderBy = { [sortBy]: sortOrder }; - const [locations, total] = await Promise.all([ - database_1.prisma.location.findMany({ - where, - skip, - take: limit, - orderBy, - include: { - addresses: { - select: { - id: true, - unitNumber: true, - firstName: true, - lastName: true, - supportLevel: true, - sign: true, - }, - }, - }, - }), - database_1.prisma.location.count({ where }), - ]); - return { - locations, - pagination: { - page, - limit, - total, - totalPages: Math.ceil(total / limit), - }, - }; - }, - async findById(id) { - const location = await database_1.prisma.location.findUnique({ - where: { id }, - include: { - addresses: { - select: { - id: true, - unitNumber: true, - firstName: true, - lastName: true, - email: true, - phone: true, - supportLevel: true, - sign: true, - signSize: true, - notes: true, - }, - }, - }, - }); - if (!location) { - throw new error_handler_1.AppError(404, 'Location not found', 'LOCATION_NOT_FOUND'); - } - return location; - }, - async create(data, userId) { - // Split data into Location (building) and Address (unit) fields - const locationData = { - address: data.address, - latitude: data.latitude, - longitude: data.longitude, - createdByUserId: userId, - }; - const addressData = { - unitNumber: data.unitNumber, - firstName: data.firstName, - lastName: data.lastName, - email: data.email, - phone: data.phone, - supportLevel: data.supportLevel, - sign: data.sign, - signSize: data.signSize, - notes: data.notes, - }; - // Auto-geocode if address provided and no lat/lng - let geocodeMetadata; - if (data.address && data.latitude == null && data.longitude == null) { - const result = await geocoding_service_1.geocodingService.geocode(data.address); - if (result) { - locationData.latitude = result.latitude; - locationData.longitude = result.longitude; - locationData.geocodeConfidence = result.confidence; - locationData.geocodeProvider = result.provider; - geocodeMetadata = { - provider: result.provider, - confidence: result.confidence, - geocoded: true, - }; - } - } - // Create location, address, and record history in transaction - const location = await database_1.prisma.$transaction(async (tx) => { - const newLocation = await tx.location.create({ data: locationData }); - // Create default Address record (even if no occupant data) - await tx.address.create({ - data: { - locationId: newLocation.id, - unitNumber: addressData.unitNumber || null, - firstName: addressData.firstName || null, - lastName: addressData.lastName || null, - email: addressData.email || null, - phone: addressData.phone || null, - supportLevel: addressData.supportLevel || null, - sign: addressData.sign ?? false, - signSize: addressData.signSize || null, - notes: addressData.notes || null, - createdByUserId: userId, - }, - }); - // Record creation history - await tx.locationHistory.create({ - data: { - locationId: newLocation.id, - userId, - action: geocodeMetadata ? client_1.LocationHistoryAction.GEOCODED : client_1.LocationHistoryAction.CREATED, - metadata: geocodeMetadata ? geocodeMetadata : undefined, - }, - }); - return newLocation; - }); - return location; - }, - async update(id, data, userId) { - const existing = await database_1.prisma.location.findUnique({ - where: { id }, - include: { addresses: true }, - }); - if (!existing) { - throw new error_handler_1.AppError(404, 'Location not found', 'LOCATION_NOT_FOUND'); - } - // Split data into Location and Address fields - const locationUpdateData = { - updatedByUserId: userId, - }; - const addressUpdateData = { - updatedByUserId: userId, - }; - // Location fields - if (data.address !== undefined && data.address) - locationUpdateData.address = data.address; - if (data.latitude !== undefined) - locationUpdateData.latitude = data.latitude; - if (data.longitude !== undefined) - locationUpdateData.longitude = data.longitude; - if (data.postalCode !== undefined) - locationUpdateData.postalCode = data.postalCode ?? undefined; - if (data.province !== undefined) - locationUpdateData.province = data.province ?? undefined; - if (data.buildingType !== undefined) - locationUpdateData.buildingType = data.buildingType ?? undefined; - if (data.buildingNotes !== undefined) - locationUpdateData.buildingNotes = data.buildingNotes ?? undefined; - // Address fields (will update first address or create one) - const addressFields = ['unitNumber', 'firstName', 'lastName', 'email', 'phone', 'supportLevel', 'sign', 'signSize', 'notes']; - let hasAddressUpdates = false; - for (const field of addressFields) { - if (data[field] !== undefined) { - addressUpdateData[field] = data[field] === '' ? null : data[field]; - hasAddressUpdates = true; - } - } - // Track field changes for history - const changes = []; - let action = client_1.LocationHistoryAction.UPDATED; - let metadata; - // Check for explicit lat/lng changes (MOVED_ON_MAP) - if (data.latitude !== undefined && Number(data.latitude) !== Number(existing.latitude)) { - changes.push({ field: 'latitude', oldValue: existing.latitude, newValue: data.latitude }); - action = client_1.LocationHistoryAction.MOVED_ON_MAP; - } - if (data.longitude !== undefined && Number(data.longitude) !== Number(existing.longitude)) { - changes.push({ field: 'longitude', oldValue: existing.longitude, newValue: data.longitude }); - action = client_1.LocationHistoryAction.MOVED_ON_MAP; - } - // Re-geocode if address changed and no explicit lat/lng provided - if (data.address && data.address !== existing.address && data.latitude === undefined && data.longitude === undefined) { - const result = await geocoding_service_1.geocodingService.geocode(data.address); - if (result) { - locationUpdateData.latitude = result.latitude; - locationUpdateData.longitude = result.longitude; - locationUpdateData.geocodeConfidence = result.confidence; - locationUpdateData.geocodeProvider = result.provider; - action = client_1.LocationHistoryAction.GEOCODED; - metadata = { - provider: result.provider, - confidence: result.confidence, - }; - changes.push({ field: 'latitude', oldValue: existing.latitude, newValue: result.latitude }); - changes.push({ field: 'longitude', oldValue: existing.longitude, newValue: result.longitude }); - } - } - // Track location field changes - if (data.address !== undefined && data.address !== existing.address) { - changes.push({ field: 'address', oldValue: existing.address, newValue: data.address }); - } - // Update location, address, and record history in transaction - const location = await database_1.prisma.$transaction(async (tx) => { - const updated = await tx.location.update({ - where: { id }, - data: locationUpdateData, - }); - // Update address if there are address fields - if (hasAddressUpdates) { - if (existing.addresses.length > 0) { - // Update first address (default unit) - await tx.address.update({ - where: { id: existing.addresses[0].id }, - data: addressUpdateData, - }); - } - else { - // Create address if none exists - const { updatedByUserId, ...addressFields } = addressUpdateData; - await tx.address.create({ - data: { - locationId: id, - ...addressFields, - createdByUserId: userId, - }, - }); - } - } - // Record history if there were changes - if (changes.length > 0) { - const historyRecords = changes.map(({ field, oldValue, newValue }) => ({ - locationId: id, - userId, - action, - field, - oldValue: oldValue != null ? String(oldValue) : null, - newValue: newValue != null ? String(newValue) : null, - metadata: metadata ? metadata : null, - })); - await tx.locationHistory.createMany({ data: historyRecords }); - } - return updated; - }); - return location; - }, - async delete(id) { - const existing = await database_1.prisma.location.findUnique({ where: { id } }); - if (!existing) { - throw new error_handler_1.AppError(404, 'Location not found', 'LOCATION_NOT_FOUND'); - } - await database_1.prisma.location.delete({ where: { id } }); - }, - async bulkDelete(ids) { - const result = await database_1.prisma.location.deleteMany({ - where: { id: { in: ids } }, - }); - return { deleted: result.count }; - }, - async getHistory(locationId, page = 1, limit = 20) { - const skip = (page - 1) * limit; - const [history, total] = await Promise.all([ - database_1.prisma.locationHistory.findMany({ - where: { locationId }, - include: { - user: { - select: { id: true, email: true, name: true, role: true }, - }, - }, - orderBy: { createdAt: 'desc' }, - skip, - take: limit, - }), - database_1.prisma.locationHistory.count({ where: { locationId } }), - ]); - return { - history, - pagination: { - page, - limit, - total, - totalPages: Math.ceil(total / limit), - }, - }; - }, - async geocodeAddress(address) { - const result = await geocoding_service_1.geocodingService.geocode(address); - if (!result) { - throw new error_handler_1.AppError(404, 'Could not geocode address', 'GEOCODE_FAILED'); - } - return result; - }, - async geocodeMissing() { - // NOTE: In V2 schema, latitude/longitude/address are all non-nullable, - // so this will return empty results. Kept for API compatibility. - const missing = await database_1.prisma.location.findMany({ - where: { - geocodeConfidence: null, // Find ungeocoded locations by confidence - }, - select: { id: true, address: true }, - take: 100, // Limit batch size - }); - let geocoded = 0; - let failed = 0; - for (const loc of missing) { - if (!loc.address) - continue; - try { - const result = await geocoding_service_1.geocodingService.geocode(loc.address); - if (result) { - await database_1.prisma.location.update({ - where: { id: loc.id }, - data: { - latitude: result.latitude, - longitude: result.longitude, - geocodeConfidence: result.confidence, - geocodeProvider: result.provider, - }, - }); - geocoded++; - } - else { - failed++; - } - } - catch (err) { - logger_1.logger.warn(`Failed to geocode location ${loc.id}:`, err); - failed++; - } - } - return { total: missing.length, geocoded, failed }; - }, - async getStats() { - try { - const [total, singleFamily, multiUnit, mixedUse, commercial, geocoded, - // Confidence distribution - confidenceHigh, confidenceMedium, confidenceLow, confidenceNone, - // Provider breakdown - nominatim, mapbox, arcgis, photon, google, locationiq, manual,] = await Promise.all([ - database_1.prisma.location.count(), - database_1.prisma.location.count({ where: { buildingType: 'SINGLE_FAMILY' } }), - database_1.prisma.location.count({ where: { buildingType: 'MULTI_UNIT' } }), - database_1.prisma.location.count({ where: { buildingType: 'MIXED_USE' } }), - database_1.prisma.location.count({ where: { buildingType: 'COMMERCIAL' } }), - database_1.prisma.location.count(), // All locations (latitude/longitude are non-nullable) - // Confidence queries - database_1.prisma.location.count({ where: { geocodeConfidence: { gte: 85 } } }), - database_1.prisma.location.count({ where: { geocodeConfidence: { gte: 60, lt: 85 } } }), - database_1.prisma.location.count({ where: { geocodeConfidence: { lt: 60 } } }), - database_1.prisma.location.count({ where: { OR: [{ geocodeConfidence: null }, { geocodeConfidence: 0 }] } }), - // Provider queries - database_1.prisma.location.count({ where: { geocodeProvider: client_1.GeocodeProvider.NOMINATIM } }), - database_1.prisma.location.count({ where: { geocodeProvider: client_1.GeocodeProvider.MAPBOX } }), - database_1.prisma.location.count({ where: { geocodeProvider: client_1.GeocodeProvider.ARCGIS } }), - database_1.prisma.location.count({ where: { geocodeProvider: client_1.GeocodeProvider.PHOTON } }), - database_1.prisma.location.count({ where: { geocodeProvider: client_1.GeocodeProvider.GOOGLE } }), - database_1.prisma.location.count({ where: { geocodeProvider: client_1.GeocodeProvider.LOCATIONIQ } }), - database_1.prisma.location.count({ where: { OR: [{ geocodeProvider: client_1.GeocodeProvider.UNKNOWN }, { geocodeProvider: null }] } }), - ]); - // Calculate average confidence - const avgConfidenceResult = await database_1.prisma.location.aggregate({ - _avg: { geocodeConfidence: true }, - where: { geocodeConfidence: { gt: 0 } }, // gt: 0 already excludes null - }); - return { - total, - buildingTypes: { - SINGLE_FAMILY: singleFamily, - MULTI_UNIT: multiUnit, - MIXED_USE: mixedUse, - COMMERCIAL: commercial, - }, - geocoded, - ungeocoded: total - geocoded, - // Confidence stats - confidence: { - high: confidenceHigh, - medium: confidenceMedium, - low: confidenceLow, - none: confidenceNone, - average: avgConfidenceResult._avg.geocodeConfidence - ? Math.round(avgConfidenceResult._avg.geocodeConfidence) - : null, - }, - // Provider breakdown - providers: { - nominatim, - mapbox, - arcgis, - photon, - google, - locationiq, - manual, - }, - }; - } - catch (error) { - logger_1.logger.error('Failed to fetch location stats:', error); - throw error; // Re-throw to trigger 500 response - } - }, - async getAllForMap(bounds, limit = 5000) { - const startTime = Date.now(); - const where = {}; - if (bounds) { - // Fix Decimal type handling - convert bounds to Prisma.Decimal - where.latitude = { - gte: new client_1.Prisma.Decimal(bounds.minLat.toString()), - lte: new client_1.Prisma.Decimal(bounds.maxLat.toString()), - }; - where.longitude = { - gte: new client_1.Prisma.Decimal(bounds.minLng.toString()), - lte: new client_1.Prisma.Decimal(bounds.maxLng.toString()), - }; - } - const locations = await database_1.prisma.location.findMany({ - where, - orderBy: { createdAt: 'desc' }, - take: limit, // Zoom-aware limit from frontend - include: { - addresses: { - select: { - id: true, - unitNumber: true, - firstName: true, - lastName: true, - email: true, - phone: true, - supportLevel: true, - sign: true, - signSize: true, - notes: true, - }, - }, - }, - }); - const durationSeconds = (Date.now() - startTime) / 1000; - (0, metrics_1.recordLocationQuery)('admin_all', !!bounds, locations.length, durationSeconds); - return locations; - }, - async getPublicLocations(bounds) { - const startTime = Date.now(); - const where = {}; - if (bounds) { - // Fix Decimal type handling - convert bounds to Prisma.Decimal - where.latitude = { - gte: new client_1.Prisma.Decimal(bounds.minLat.toString()), - lte: new client_1.Prisma.Decimal(bounds.maxLat.toString()), - }; - where.longitude = { - gte: new client_1.Prisma.Decimal(bounds.minLng.toString()), - lte: new client_1.Prisma.Decimal(bounds.maxLng.toString()), - }; - } - const locations = await database_1.prisma.location.findMany({ - where, - select: { - id: true, - latitude: true, - longitude: true, - address: true, - addresses: { - select: { - id: true, - unitNumber: true, - supportLevel: true, - sign: true, - signSize: true, - }, - }, - }, - take: 5000, // Safety limit - }); - // Server-side enforcement: strip sensitive fields based on map visibility settings - const mapSettings = await settings_service_1.mapSettingsService.get(); - if (!mapSettings.publicShowSupportLevels || !mapSettings.publicShowSignInfo) { - for (const loc of locations) { - for (const addr of loc.addresses) { - if (!mapSettings.publicShowSupportLevels) { - addr.supportLevel = null; - } - if (!mapSettings.publicShowSignInfo) { - addr.sign = false; - addr.signSize = null; - } - } - } - } - const durationSeconds = (Date.now() - startTime) / 1000; - (0, metrics_1.recordLocationQuery)('public', !!bounds, locations.length, durationSeconds); - return locations; - }, - async importFromCsv(buffer, userId) { - let records; - try { - records = (0, sync_1.parse)(buffer, { - columns: true, - skip_empty_lines: true, - trim: true, - bom: true, - }); - } - catch { - throw new error_handler_1.AppError(400, 'Invalid CSV file format', 'INVALID_CSV'); - } - if (!records.length) { - throw new error_handler_1.AppError(400, 'CSV file is empty', 'EMPTY_CSV'); - } - // Detect column mapping from headers - const headers = Object.keys(records[0]); - const columnMap = {}; - for (const header of headers) { - const normalized = header.toLowerCase().trim(); - const mapped = CSV_HEADER_MAP[normalized]; - if (mapped) { - columnMap[header] = mapped; - } - } - let success = 0; - let warnings = 0; - let failed = 0; - const errors = []; - for (let i = 0; i < records.length; i++) { - const record = records[i]; - try { - const row = {}; - for (const [header, field] of Object.entries(columnMap)) { - const value = record[header]; - if (value !== undefined && value !== '') { - row[field] = value; - } - } - if (!row.address) { - errors.push(`Row ${i + 2}: Missing address`); - failed++; - continue; - } - // Split into Location and Address data - const locationData = { - address: row.address, - createdByUserId: userId, - }; - const addressData = { - firstName: row.firstName || null, - lastName: row.lastName || null, - email: row.email || null, - phone: row.phone || null, - unitNumber: row.unitNumber || null, - supportLevel: row.supportLevel ? parseSupportLevel(row.supportLevel) : null, - sign: row.sign ? parseBoolean(row.sign) : false, - signSize: row.signSize || null, - notes: row.notes || null, - }; - // Use provided lat/lng or geocode - if (row.latitude && row.longitude) { - const lat = parseFloat(row.latitude); - const lng = parseFloat(row.longitude); - if (!isNaN(lat) && !isNaN(lng)) { - locationData.latitude = lat; - locationData.longitude = lng; - } - } - else { - const result = await geocoding_service_1.geocodingService.geocode(row.address); - if (result) { - locationData.latitude = result.latitude; - locationData.longitude = result.longitude; - locationData.geocodeConfidence = result.confidence; - locationData.geocodeProvider = result.provider; - } - else { - warnings++; - } - } - // Create Location and Address in transaction - const newLocation = await database_1.prisma.location.create({ data: locationData }); - await database_1.prisma.address.create({ - data: { - locationId: newLocation.id, - ...addressData, - createdByUserId: userId, - }, - }); - success++; - } - catch (err) { - const msg = err instanceof Error ? err.message : 'Unknown error'; - errors.push(`Row ${i + 2}: ${msg}`); - failed++; - } - } - return { total: records.length, success, warnings, failed, errors: errors.slice(0, 50) }; - }, - async reverseGeocode(latitude, longitude) { - const result = await geocoding_service_1.geocodingService.reverseGeocode(latitude, longitude); - if (!result) { - throw new error_handler_1.AppError(404, 'Could not reverse geocode coordinates', 'REVERSE_GEOCODE_FAILED'); - } - return result; - }, - async importBulk(buffer, userId, options, filters) { - let records; - try { - records = (0, sync_1.parse)(buffer, { - columns: true, - skip_empty_lines: true, - trim: true, - bom: true, - }); - } - catch { - throw new error_handler_1.AppError(400, 'Invalid CSV file format', 'INVALID_CSV'); - } - if (!records.length) { - throw new error_handler_1.AppError(400, 'CSV file is empty', 'EMPTY_CSV'); - } - const headers = Object.keys(records[0]); - const isNar = options.format === 'nar' || detectNarFormat(headers); - // Build header mapping for NAR (map original CSV header → internal key) - const headerMap = {}; - if (isNar) { - for (const header of headers) { - const lower = header.trim().toLowerCase(); - const alias = NAR_HEADER_MAP[lower]; - if (alias) { - headerMap[header] = alias; - } - } - } - // Load existing coordinates for deduplication - const existingCoords = new Set(); - if (options.deduplicateRadius > 0) { - const existing = await database_1.prisma.location.findMany({ - select: { latitude: true, longitude: true }, - }); // No where clause needed - latitude/longitude are non-nullable - for (const loc of existing) { - const key = `${roundCoord(Number(loc.latitude))}:${roundCoord(Number(loc.longitude))}`; - existingCoords.add(key); - } - } - const inFileCoords = new Set(); - let created = 0; - let skippedDuplicate = 0; - let skippedOutOfBounds = 0; - let skippedInvalid = 0; - const errors = []; - const parsedRecords = []; - const addressesToGeocode = []; - const geocodeIndexMap = new Map(); // maps parsedRecord index → geocode result index - for (let i = 0; i < records.length; i++) { - const record = records[i]; - try { - let address; - let unitNumber; - let lat; - let lng; - let postalCode; - let province; - let federalDistrict; - let buildingUse; - if (isNar) { - // Build address from NAR fields (supports 2025 + legacy format) - const getValue = (narKey) => { - for (const [header, mapped] of Object.entries(headerMap)) { - if (mapped === narKey) - return (record[header] ?? '').trim(); - } - return ''; - }; - // Build civic address: "123A Main ST W" - const civicNo = getValue('CIVIC_NO'); - const civicSuffix = getValue('CIVIC_NO_SUFFIX'); - const streetName = getValue('STREET_NAME'); - const streetType = getValue('STREET_TYPE'); - const streetDir = getValue('STREET_DIR'); - const streetParts = [ - civicNo + (civicSuffix || ''), - streetName, - streetType, - streetDir, - ].filter(Boolean); - address = streetParts.join(' '); - const city = getValue('CITY') || getValue('CSD_NAME'); - province = getValue('PROV') || undefined; - // City/province filters (fast string check before coordinate work) - if (filters?.city && city.toLowerCase() !== filters.city.toLowerCase()) { - skippedOutOfBounds++; - continue; - } - if (filters?.province && province && province.toLowerCase() !== filters.province.toLowerCase()) { - skippedOutOfBounds++; - continue; - } - if (city) - address += `, ${city}`; - if (province) - address += `, ${province}`; - unitNumber = getValue('UNIT_NBR') || undefined; - postalCode = getValue('POSTAL_CODE') || undefined; - federalDistrict = getValue('FED_DISTRICT') || undefined; - const buUse = getValue('BU_USE'); - if (buUse) { - const parsed = parseInt(buUse, 10); - if (!isNaN(parsed)) - buildingUse = parsed; - } - // Residential filter: skip non-residential (BU_USE 3) if filtering - if (options.residentialOnly && buildingUse === 3) { - skippedOutOfBounds++; - continue; - } - // Coordinates: prefer BG_LATITUDE/BG_LONGITUDE, fallback to BG_X/BG_Y (Lambert→WGS84), then LAT/LNG - const bgLatStr = getValue('LAT'); - const bgLngStr = getValue('LNG'); - if (bgLatStr && bgLngStr) { - lat = parseFloat(bgLatStr); - lng = parseFloat(bgLngStr); - if (isNaN(lat) || isNaN(lng)) { - lat = undefined; - lng = undefined; - } - } - if (lat === undefined || lng === undefined) { - const bgXStr = getValue('BG_X'); - const bgYStr = getValue('BG_Y'); - if (bgXStr && bgYStr) { - const bgX = parseFloat(bgXStr); - const bgY = parseFloat(bgYStr); - if (!isNaN(bgX) && !isNaN(bgY)) { - [lat, lng] = lambertToLatLng(bgX, bgY); - } - } - } - } - else { - // Standard CSV - use existing header mapping - const row = {}; - for (const [header, field] of Object.entries(CSV_HEADER_MAP)) { - for (const h of headers) { - if (h.toLowerCase().trim() === header) { - const value = record[h]; - if (value !== undefined && value !== '') { - row[field] = value; - } - } - } - } - address = row.address; - unitNumber = row.unitNumber; - if (row.latitude && row.longitude) { - lat = parseFloat(row.latitude); - lng = parseFloat(row.longitude); - if (isNaN(lat) || isNaN(lng)) { - lat = undefined; - lng = undefined; - } - } - } - if (!address) { - skippedInvalid++; - if (i < 20) - errors.push(`Row ${i + 2}: Missing address`); - continue; - } - const needsGeocoding = lat === undefined && lng === undefined && !options.skipGeocoding; - parsedRecords.push({ - rowIndex: i, - address, - unitNumber, - lat, - lng, - postalCode, - province, - federalDistrict, - buildingUse, - needsGeocoding, - }); - if (needsGeocoding) { - geocodeIndexMap.set(parsedRecords.length - 1, addressesToGeocode.length); - addressesToGeocode.push(address); - } - } - catch (err) { - skippedInvalid++; - if (errors.length < 50) { - const msg = err instanceof Error ? err.message : 'Unknown error'; - errors.push(`Row ${i + 2}: ${msg}`); - } - } - } - // Phase 2: Batch geocode all addresses in parallel - let geocodeResults = []; - if (addressesToGeocode.length > 0 && !options.skipGeocoding) { - logger_1.logger.info(`Batch geocoding ${addressesToGeocode.length} addresses...`); - geocodeResults = await geocoding_service_1.geocodingService.geocodeBatch(addressesToGeocode); - logger_1.logger.info(`Batch geocoding complete: ${geocodeResults.filter(r => r !== null).length} succeeded`); - } - // Phase 3: Apply geocoding results and create location records - const batch = []; - for (let i = 0; i < parsedRecords.length; i++) { - const parsed = parsedRecords[i]; - let { lat, lng } = parsed; - try { - // Apply geocoding result if needed - if (parsed.needsGeocoding) { - const geocodeIndex = geocodeIndexMap.get(i); - if (geocodeIndex !== undefined) { - const result = geocodeResults[geocodeIndex]; - if (result) { - lat = result.latitude; - lng = result.longitude; - } - } - } - // Skip if no coordinates - if (lat === undefined || lng === undefined) { - skippedInvalid++; - if (errors.length < 20) - errors.push(`Row ${parsed.rowIndex + 2}: No coordinates`); - continue; - } - // Cut boundary filter - if (filters?.cutPolygon && filters.cutPolygon.length > 0) { - const inside = filters.cutPolygon.some((ring) => (0, spatial_1.isPointInPolygon)(lat, lng, ring)); - if (!inside) { - skippedOutOfBounds++; - continue; - } - } - // Bounding box filter (map area) - if (filters?.bounds) { - const { north, south, east, west } = filters.bounds; - if (lat < south || lat > north || lng < west || lng > east) { - skippedOutOfBounds++; - continue; - } - } - // Deduplication - if (options.deduplicateRadius > 0) { - const coordKey = `${roundCoord(lat)}:${roundCoord(lng)}`; - if (existingCoords.has(coordKey) || inFileCoords.has(coordKey)) { - skippedDuplicate++; - continue; - } - inFileCoords.add(coordKey); - } - batch.push({ - address: parsed.address, - latitude: lat, - longitude: lng, - postalCode: parsed.postalCode, - province: parsed.province, - federalDistrict: parsed.federalDistrict, - buildingUse: parsed.buildingUse, - createdByUserId: userId, - }); - // Flush batch - if (batch.length >= options.batchSize) { - const result = await database_1.prisma.location.createMany({ data: [...batch], skipDuplicates: true }); - created += result.count; - batch.length = 0; - } - } - catch (err) { - skippedInvalid++; - if (errors.length < 50) { - const msg = err instanceof Error ? err.message : 'Unknown error'; - errors.push(`Row ${parsed.rowIndex + 2}: ${msg}`); - } - } - } - // Flush remaining - if (batch.length > 0) { - const result = await database_1.prisma.location.createMany({ data: batch, skipDuplicates: true }); - created += result.count; - } - return { - total: records.length, - created, - skippedDuplicate, - skippedOutOfBounds, - skippedInvalid, - errors: errors.slice(0, 50), - }; - }, - async exportToCsv(filters) { - const where = {}; - // Build address filters - const addressWhere = {}; - if (filters?.supportLevel) - addressWhere.supportLevel = filters.supportLevel; - if (filters?.hasSign !== undefined) - addressWhere.sign = filters.hasSign; - // If there are address filters, only include locations with matching addresses - if (Object.keys(addressWhere).length > 0) { - where.addresses = { some: addressWhere }; - } - const locations = await database_1.prisma.location.findMany({ - where, - include: { addresses: true }, - orderBy: { createdAt: 'desc' }, - }); - // Sanitize a field value against CSV formula injection. - // Spreadsheet apps treat cells starting with =, +, -, @, \t, \r as formulas. - // Prefixing with an apostrophe causes Excel/Sheets to treat the value as plain text. - function sanitizeCsvField(value) { - if (/^[=+\-@\t\r]/.test(value)) - return `'${value}`; - return value; - } - // Flatten: one row per address - const rows = []; - for (const loc of locations) { - for (const addr of loc.addresses) { - // Skip addresses that don't match filters - if (filters?.supportLevel && addr.supportLevel !== filters.supportLevel) - continue; - if (filters?.hasSign !== undefined && addr.sign !== filters.hasSign) - continue; - rows.push({ - address: sanitizeCsvField(loc.address || ''), - unitNumber: sanitizeCsvField(addr.unitNumber || ''), - firstName: sanitizeCsvField(addr.firstName || ''), - lastName: sanitizeCsvField(addr.lastName || ''), - email: sanitizeCsvField(addr.email || ''), - phone: sanitizeCsvField(addr.phone || ''), - supportLevel: addr.supportLevel || '', - sign: addr.sign ? 'Yes' : 'No', - signSize: addr.signSize || '', - notes: sanitizeCsvField(addr.notes || ''), - latitude: loc.latitude?.toString() || '', - longitude: loc.longitude?.toString() || '', - geocodeConfidence: loc.geocodeConfidence?.toString() || '', - geocodeProvider: loc.geocodeProvider || '', - createdAt: loc.createdAt.toISOString(), - }); - } - } - return (0, sync_2.stringify)(rows, { header: true }); - }, -}; -//# sourceMappingURL=locations.service.js.map \ No newline at end of file diff --git a/api/dist/modules/map/locations/locations.service.js.map b/api/dist/modules/map/locations/locations.service.js.map deleted file mode 100644 index dfa30f8b..00000000 --- a/api/dist/modules/map/locations/locations.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"locations.service.js","sourceRoot":"","sources":["../../../../src/modules/map/locations/locations.service.ts"],"names":[],"mappings":";;;;;;AAAA,2CAA8F;AAC9F,yCAAuC;AACvC,6CAA+C;AAC/C,kDAA0B;AAC1B,uDAAkD;AAClD,qEAA6D;AAC7D,sEAAkE;AAClE,kDAA+C;AAC/C,oDAA6D;AAC7D,oDAA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SAAS,IAAI,EAAE,CAAC;oBACjD,QAAQ,EAAE,gBAAgB,CAAC,IAAI,CAAC,QAAQ,IAAI,EAAE,CAAC;oBAC/C,KAAK,EAAE,gBAAgB,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;oBACzC,KAAK,EAAE,gBAAgB,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;oBACzC,YAAY,EAAE,IAAI,CAAC,YAAY,IAAI,EAAE;oBACrC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI;oBAC9B,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,EAAE;oBAC7B,KAAK,EAAE,gBAAgB,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;oBACzC,QAAQ,EAAE,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE;oBACxC,SAAS,EAAE,GAAG,CAAC,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE;oBAC1C,iBAAiB,EAAE,GAAG,CAAC,iBAAiB,EAAE,QAAQ,EAAE,IAAI,EAAE;oBAC1D,eAAe,EAAE,GAAG,CAAC,eAAe,IAAI,EAAE;oBAC1C,SAAS,EAAE,GAAG,CAAC,SAAS,CAAC,WAAW,EAAE;iBACvC,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QAED,OAAO,IAAA,gBAAS,EAAC,IAAI,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3C,CAAC;CACF,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/locations/nar-import.routes.d.ts b/api/dist/modules/map/locations/nar-import.routes.d.ts deleted file mode 100644 index ed3491dc..00000000 --- a/api/dist/modules/map/locations/nar-import.routes.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const narImportRouter: import("express-serve-static-core").Router; -export { narImportRouter }; -//# sourceMappingURL=nar-import.routes.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/map/locations/nar-import.routes.d.ts.map b/api/dist/modules/map/locations/nar-import.routes.d.ts.map deleted file mode 100644 index bf5e5f0f..00000000 --- a/api/dist/modules/map/locations/nar-import.routes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"nar-import.routes.d.ts","sourceRoot":"","sources":["../../../../src/modules/map/locations/nar-import.routes.ts"],"names":[],"mappings":"AAsBA,QAAA,MAAM,eAAe,4CAAW,CAAC;AAoFjC,OAAO,EAAE,eAAe,EAAE,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/locations/nar-import.routes.js b/api/dist/modules/map/locations/nar-import.routes.js deleted file mode 100644 index f945fdea..00000000 --- a/api/dist/modules/map/locations/nar-import.routes.js +++ /dev/null @@ -1,95 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.narImportRouter = void 0; -const express_1 = require("express"); -const zod_1 = require("zod"); -const crypto_1 = require("crypto"); -const nar_import_service_1 = require("./nar-import.service"); -const redis_1 = require("../../../config/redis"); -const logger_1 = require("../../../utils/logger"); -const auth_middleware_1 = require("../../../middleware/auth.middleware"); -const rbac_middleware_1 = require("../../../middleware/rbac.middleware"); -const validate_1 = require("../../../middleware/validate"); -const roles_1 = require("../../../utils/roles"); -const serverImportSchema = zod_1.z.object({ - provinceCode: zod_1.z.string().min(1).max(2), - filterType: zod_1.z.enum(['none', 'city', 'postalPrefix', 'cut']).default('none'), - filterCity: zod_1.z.string().optional(), - filterPostalPrefix: zod_1.z.string().min(3).max(3).optional(), - cutId: zod_1.z.string().optional(), - residentialOnly: zod_1.z.boolean().default(true), - deduplicateRadius: zod_1.z.number().min(0).max(100).default(5), - batchSize: zod_1.z.number().int().min(100).max(5000).default(1000), -}); -const narImportRouter = (0, express_1.Router)(); -exports.narImportRouter = narImportRouter; -narImportRouter.use(auth_middleware_1.authenticate); -narImportRouter.use((0, rbac_middleware_1.requireRole)(...roles_1.MAP_ROLES)); -// GET /api/map/nar-import/datasets — list available NAR datasets by province -narImportRouter.get('/datasets', async (_req, res, next) => { - try { - const result = await nar_import_service_1.narImportService.listDatasets(); - res.json(result); - } - catch (err) { - next(err); - } -}); -// GET /api/map/nar-import/status/:importId — poll import progress -narImportRouter.get('/status/:importId', async (req, res, next) => { - try { - const importId = req.params.importId; - const data = await redis_1.redis.get(`nar-import:${importId}`); - if (!data) { - res.status(404).json({ error: { message: 'Import not found or expired', code: 'NOT_FOUND' } }); - return; - } - res.json(JSON.parse(data)); - } - catch (err) { - next(err); - } -}); -// POST /api/map/nar-import — start a province import (fire-and-forget, returns importId) -narImportRouter.post('/', (0, validate_1.validate)(serverImportSchema), async (req, res, next) => { - try { - const importId = (0, crypto_1.randomUUID)(); - const userId = req.user.id; - // Write initial progress so status endpoint works immediately - await (0, nar_import_service_1.writeProgress)(importId, { - status: 'loading-locations', - totalRows: 0, - locationsCreated: 0, - addressesCreated: 0, - skippedDuplicate: 0, - skippedOutOfBounds: 0, - skippedNonResidential: 0, - skippedInvalid: 0, - currentFile: '', - provinceName: '', - }); - // Fire and forget — errors are written to Redis - nar_import_service_1.narImportService.importProvince(userId, req.body, importId).catch(async (err) => { - const errorMsg = err instanceof Error ? err.message : 'Unknown error'; - logger_1.logger.error(`NAR import ${importId} failed: ${errorMsg}`); - await (0, nar_import_service_1.writeProgress)(importId, { - status: 'failed', - totalRows: 0, - locationsCreated: 0, - addressesCreated: 0, - skippedDuplicate: 0, - skippedOutOfBounds: 0, - skippedNonResidential: 0, - skippedInvalid: 0, - currentFile: '', - provinceName: '', - error: errorMsg, - }); - }); - res.json({ importId }); - } - catch (err) { - next(err); - } -}); -//# sourceMappingURL=nar-import.routes.js.map \ No newline at end of file diff --git a/api/dist/modules/map/locations/nar-import.routes.js.map b/api/dist/modules/map/locations/nar-import.routes.js.map deleted file mode 100644 index fee4f87f..00000000 --- a/api/dist/modules/map/locations/nar-import.routes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"nar-import.routes.js","sourceRoot":"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C,EAAE,QAAQ,EAAE,CAAC,CAAC;IACzB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,GAAG,CAAC,CAAC;IACZ,CAAC;AACH,CAAC,CACF,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/locations/nar-import.service.d.ts b/api/dist/modules/map/locations/nar-import.service.d.ts deleted file mode 100644 index ea5b6e6e..00000000 --- a/api/dist/modules/map/locations/nar-import.service.d.ts +++ /dev/null @@ -1,80 +0,0 @@ -interface NarFileInfo { - filename: string; - fullPath: string; - sizeBytes: number; - sizeFormatted: string; - provinceCode: string; - provinceName: string; - provinceAbbr: string; - type: 'address' | 'location'; - partNumber?: number; -} -interface NarDataset { - provinceCode: string; - provinceName: string; - provinceAbbr: string; - addressFiles: NarFileInfo[]; - locationFiles: NarFileInfo[]; - totalAddressSize: number; - totalLocationSize: number; -} -interface LocationLookup { - lat: number; - lng: number; - fedDistrict?: string; - fedCode?: string; -} -export interface ServerImportOptions { - provinceCode: string; - filterType: 'none' | 'city' | 'postalPrefix' | 'cut'; - filterCity?: string; - filterPostalPrefix?: string; - cutId?: string; - residentialOnly: boolean; - deduplicateRadius: number; - batchSize: number; -} -export interface ServerImportResult { - provinceCode: string; - provinceName: string; - totalRows: number; - locationsCreated: number; - addressesCreated: number; - skippedDuplicate: number; - skippedOutOfBounds: number; - skippedNonResidential: number; - skippedInvalid: number; - errors: string[]; - durationMs: number; -} -export interface ImportProgress { - status: 'loading-locations' | 'importing' | 'creating-records' | 'complete' | 'failed'; - totalRows: number; - locationsCreated: number; - addressesCreated: number; - skippedDuplicate: number; - skippedOutOfBounds: number; - skippedNonResidential: number; - skippedInvalid: number; - currentFile: string; - provinceName: string; - error?: string; - result?: ServerImportResult; -} -export declare function writeProgress(importId: string, progress: ImportProgress): Promise; -export declare const narImportService: { - /** List available NAR datasets grouped by province */ - listDatasets(): Promise<{ - narDir: string | null; - datasets: NarDataset[]; - }>; - /** - * Load Location file(s) into a lookup Map for a given province. - * Returns Map. - */ - loadLocationLookup(locationFiles: NarFileInfo[]): Promise>; - /** Import a province's NAR data using Location+Address file join */ - importProvince(userId: string, options: ServerImportOptions, importId?: string): Promise; -}; -export {}; -//# sourceMappingURL=nar-import.service.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/map/locations/nar-import.service.d.ts.map b/api/dist/modules/map/locations/nar-import.service.d.ts.map deleted file mode 100644 index a5bd9c77..00000000 --- a/api/dist/modules/map/locations/nar-import.service.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"nar-import.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/map/locations/nar-import.service.ts"],"names":[],"mappings":"AAgCA,UAAU,WAAW;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,SAAS,GAAG,UAAU,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,UAAU,UAAU;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,aAAa,EAAE,WAAW,EAAE,CAAC;IAC7B,gBAAgB,EAAE,MAAM,CAAC;IACzB,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,UAAU,cAAc;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,GAAG,M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gB;IAC3B,sDAAsD;oBAChC,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,QAAQ,EAAE,UAAU,EAAE,CAAA;KAAE,CAAC;IA+DhF;;;OAGG;sCACqC,WAAW,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IAgC5F,oEAAoE;2BAE1D,MAAM,WACL,mBAAmB,aACjB,MAAM,GAChB,OAAO,CAAC,kBAAkB,CAAC;CAqW/B,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/locations/nar-import.service.js b/api/dist/modules/map/locations/nar-import.service.js deleted file mode 100644 index 91e51c7b..00000000 --- a/api/dist/modules/map/locations/nar-import.service.js +++ /dev/null @@ -1,532 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.narImportService = void 0; -exports.writeProgress = writeProgress; -const fs = __importStar(require("fs")); -const path = __importStar(require("path")); -const csv_parse_1 = require("csv-parse"); -const proj4_1 = __importDefault(require("proj4")); -const database_1 = require("../../../config/database"); -const redis_1 = require("../../../config/redis"); -const logger_1 = require("../../../utils/logger"); -const spatial_1 = require("../../../utils/spatial"); -const path_validator_1 = require("../../../utils/path-validator"); -const env_1 = require("../../../config/env"); -// Statistics Canada Lambert Conformal Conic (EPSG:3347) → WGS84 -proj4_1.default.defs('EPSG:3347', '+proj=lcc +lat_1=49 +lat_2=77 +lat_0=63.390675 +lon_0=-91.86666666666666 +x_0=6200000 +y_0=3000000 +ellps=GRS80 +units=m +no_defs'); -const PROVINCE_MAP = { - '10': { name: 'Newfoundland and Labrador', abbr: 'NL' }, - '11': { name: 'Prince Edward Island', abbr: 'PE' }, - '12': { name: 'Nova Scotia', abbr: 'NS' }, - '13': { name: 'New Brunswick', abbr: 'NB' }, - '24': { name: 'Quebec', abbr: 'QC' }, - '35': { name: 'Ontario', abbr: 'ON' }, - '46': { name: 'Manitoba', abbr: 'MB' }, - '47': { name: 'Saskatchewan', abbr: 'SK' }, - '48': { name: 'Alberta', abbr: 'AB' }, - '59': { name: 'British Columbia', abbr: 'BC' }, - '60': { name: 'Yukon', abbr: 'YT' }, - '61': { name: 'Northwest Territories', abbr: 'NT' }, - '62': { name: 'Nunavut', abbr: 'NU' }, -}; -function formatBytes(bytes) { - if (bytes < 1024) - return `${bytes} B`; - if (bytes < 1024 * 1024) - return `${(bytes / 1024).toFixed(1)} KB`; - if (bytes < 1024 * 1024 * 1024) - return `${(bytes / (1024 * 1024)).toFixed(1)} MB`; - return `${(bytes / (1024 * 1024 * 1024)).toFixed(1)} GB`; -} -function roundCoord(val, decimals = 5) { - const factor = Math.pow(10, decimals); - return Math.round(val * factor) / factor; -} -function getDataDir() { - return env_1.env.NAR_DATA_DIR; -} -/** Scan the NAR data directory and find the most recent dataset */ -function findNarDirectory(baseDir) { - if (!fs.existsSync(baseDir)) - return null; - // Look for subdirectories with YYYYMM pattern (e.g., 202512) - const entries = fs.readdirSync(baseDir, { withFileTypes: true }); - const dateDirs = entries - .filter((e) => e.isDirectory() && /^\d{6}$/.test(e.name)) - .map((e) => e.name) - .sort() - .reverse(); - if (dateDirs.length > 0) - return path.join(baseDir, dateDirs[0]); - // Fallback: check if Addresses/ exists directly - if (fs.existsSync(path.join(baseDir, 'Addresses'))) - return baseDir; - return null; -} -function parseFileInfo(filePath, filename) { - // Match patterns like Address_13.csv, Address_24_part_1.csv, Location_59_part_2.csv - const match = filename.match(/^(Address|Location)_(\d+)(?:_part_(\d+))?\.csv$/i); - if (!match) - return null; - const type = match[1].toLowerCase() === 'address' ? 'address' : 'location'; - const provinceCode = match[2]; - const partNumber = match[3] ? parseInt(match[3], 10) : undefined; - const prov = PROVINCE_MAP[provinceCode]; - if (!prov) - return null; - const stats = fs.statSync(filePath); - return { - filename, - fullPath: filePath, - sizeBytes: stats.size, - sizeFormatted: formatBytes(stats.size), - provinceCode, - provinceName: prov.name, - provinceAbbr: prov.abbr, - type, - partNumber, - }; -} -const PROGRESS_TTL = 3600; // 1 hour -const PROGRESS_INTERVAL = 5000; // write every 5000 rows -async function writeProgress(importId, progress) { - try { - await redis_1.redis.set(`nar-import:${importId}`, JSON.stringify(progress), 'EX', PROGRESS_TTL); - } - catch (err) { - logger_1.logger.warn('Failed to write NAR import progress to Redis', err); - } -} -exports.narImportService = { - /** List available NAR datasets grouped by province */ - async listDatasets() { - const baseDir = getDataDir(); - const narDir = findNarDirectory(baseDir); - if (!narDir) - return { narDir: null, datasets: [] }; - // Validate directory paths to prevent traversal attacks - const addressDir = await (0, path_validator_1.validateFilePath)(baseDir, path.relative(baseDir, path.join(narDir, 'Addresses'))); - const locationDir = await (0, path_validator_1.validateFilePath)(baseDir, path.relative(baseDir, path.join(narDir, 'Locations'))); - const files = []; - if (fs.existsSync(addressDir)) { - for (const f of fs.readdirSync(addressDir)) { - // Validate each file path - const filePath = await (0, path_validator_1.validateFilePath)(addressDir, f); - const info = parseFileInfo(filePath, f); - if (info) - files.push(info); - } - } - if (fs.existsSync(locationDir)) { - for (const f of fs.readdirSync(locationDir)) { - // Validate each file path - const filePath = await (0, path_validator_1.validateFilePath)(locationDir, f); - const info = parseFileInfo(filePath, f); - if (info) - files.push(info); - } - } - // Group by province - const byProvince = new Map(); - for (const file of files) { - let dataset = byProvince.get(file.provinceCode); - if (!dataset) { - dataset = { - provinceCode: file.provinceCode, - provinceName: file.provinceName, - provinceAbbr: file.provinceAbbr, - addressFiles: [], - locationFiles: [], - totalAddressSize: 0, - totalLocationSize: 0, - }; - byProvince.set(file.provinceCode, dataset); - } - if (file.type === 'address') { - dataset.addressFiles.push(file); - dataset.totalAddressSize += file.sizeBytes; - } - else { - dataset.locationFiles.push(file); - dataset.totalLocationSize += file.sizeBytes; - } - } - // Sort files within each dataset, sort datasets by province code - const datasets = Array.from(byProvince.values()); - for (const ds of datasets) { - ds.addressFiles.sort((a, b) => (a.partNumber ?? 0) - (b.partNumber ?? 0)); - ds.locationFiles.sort((a, b) => (a.partNumber ?? 0) - (b.partNumber ?? 0)); - } - datasets.sort((a, b) => a.provinceCode.localeCompare(b.provinceCode)); - return { narDir, datasets }; - }, - /** - * Load Location file(s) into a lookup Map for a given province. - * Returns Map. - */ - async loadLocationLookup(locationFiles) { - const lookup = new Map(); - for (const file of locationFiles) { - logger_1.logger.info(`Loading location lookup from ${file.filename} (${file.sizeFormatted})`); - const parser = fs.createReadStream(file.fullPath).pipe((0, csv_parse_1.parse)({ columns: true, skip_empty_lines: true, trim: true, bom: true })); - for await (const record of parser) { - const locGuid = (record.LOC_GUID ?? '').trim(); - if (!locGuid) - continue; - const lat = parseFloat(record.BG_LATITUDE ?? ''); - const lng = parseFloat(record.BG_LONGITUDE ?? ''); - if (isNaN(lat) || isNaN(lng)) - continue; - lookup.set(locGuid, { - lat, - lng, - fedDistrict: (record.FED_ENG_NAME ?? '').trim() || undefined, - fedCode: (record.FED_CODE ?? '').trim() || undefined, - }); - } - logger_1.logger.info(`Loaded ${lookup.size} locations from ${file.filename}`); - } - return lookup; - }, - /** Import a province's NAR data using Location+Address file join */ - async importProvince(userId, options, importId) { - const startTime = Date.now(); - const { narDir, datasets } = await this.listDatasets(); - if (!narDir) { - throw new Error('NAR data directory not found. Place NAR data in ' + getDataDir()); - } - const dataset = datasets.find((d) => d.provinceCode === options.provinceCode); - if (!dataset) { - throw new Error(`Province ${options.provinceCode} not found in NAR data`); - } - if (dataset.addressFiles.length === 0) { - throw new Error(`No address files found for province ${options.provinceCode}`); - } - const result = { - provinceCode: dataset.provinceCode, - provinceName: dataset.provinceName, - totalRows: 0, - locationsCreated: 0, - addressesCreated: 0, - skippedDuplicate: 0, - skippedOutOfBounds: 0, - skippedNonResidential: 0, - skippedInvalid: 0, - errors: [], - durationMs: 0, - }; - // Helper to write progress if importId is provided - const progress = { - status: 'loading-locations', - totalRows: 0, - locationsCreated: 0, - addressesCreated: 0, - skippedDuplicate: 0, - skippedOutOfBounds: 0, - skippedNonResidential: 0, - skippedInvalid: 0, - currentFile: '', - provinceName: dataset.provinceName, - }; - const updateProgress = async (updates) => { - if (!importId) - return; - if (updates) - Object.assign(progress, updates); - await writeProgress(importId, progress); - }; - // Phase 1: Load Location file(s) for coordinate + federal district lookup - await updateProgress(); - let locationLookup; - if (dataset.locationFiles.length > 0) { - locationLookup = await this.loadLocationLookup(dataset.locationFiles); - logger_1.logger.info(`Location lookup ready: ${locationLookup.size} entries for ${dataset.provinceName}`); - } - else { - locationLookup = new Map(); - logger_1.logger.warn(`No Location files for ${dataset.provinceName}, will use proj4 coordinate conversion`); - } - // Load cut polygon if filtering by cut - let cutPolygon; - if (options.filterType === 'cut' && options.cutId) { - const cut = await database_1.prisma.cut.findUnique({ where: { id: options.cutId } }); - if (cut) { - try { - cutPolygon = (0, spatial_1.parseGeoJsonPolygon)(cut.geojson); - } - catch { - logger_1.logger.warn(`Invalid cut polygon for ${options.cutId}`); - } - } - } - // Load existing coordinates for deduplication - const existingCoords = new Set(); - if (options.deduplicateRadius > 0) { - const existing = await database_1.prisma.location.findMany({ - select: { latitude: true, longitude: true }, - }); // No where clause needed - latitude/longitude are non-nullable - for (const loc of existing) { - const key = `${roundCoord(Number(loc.latitude))}:${roundCoord(Number(loc.longitude))}`; - existingCoords.add(key); - } - } - const inFileCoords = new Set(); - // Phase 2: Stream Address file(s) and group by LOC_GUID - await updateProgress({ status: 'importing' }); - const addressesByLocGuid = new Map(); - for (const addressFile of dataset.addressFiles) { - logger_1.logger.info(`Processing ${addressFile.filename} (${addressFile.sizeFormatted})`); - await updateProgress({ currentFile: addressFile.filename }); - const parser = fs.createReadStream(addressFile.fullPath).pipe((0, csv_parse_1.parse)({ columns: true, skip_empty_lines: true, trim: true, bom: true })); - for await (const record of parser) { - result.totalRows++; - try { - const locGuid = (record.LOC_GUID ?? '').trim(); - if (!locGuid) { - result.skippedInvalid++; - continue; - } - // Extract BU_USE for residential filter - const buUse = parseInt(record.BU_USE ?? '', 10); - if (options.residentialOnly && buUse === 3) { - result.skippedNonResidential++; - continue; - } - // Extract address components - const civicNo = (record.CIVIC_NO ?? '').trim(); - const civicSuffix = (record.CIVIC_NO_SUFFIX ?? '').trim(); - const streetName = (record.OFFICIAL_STREET_NAME ?? '').trim(); - const streetType = (record.OFFICIAL_STREET_TYPE ?? '').trim(); - const streetDir = (record.OFFICIAL_STREET_DIR ?? '').trim(); - const city = (record.MAIL_MUN_NAME ?? record.CSD_ENG_NAME ?? '').trim(); - const prov = (record.MAIL_PROV_ABVN ?? '').trim(); - const postalCode = (record.MAIL_POSTAL_CODE ?? '').trim() || undefined; - const unitNumber = (record.APT_NO_LABEL ?? '').trim() || undefined; - const addrGuid = (record.ADDR_GUID ?? '').trim(); - // City filter - if (options.filterType === 'city' && options.filterCity) { - if (city.toLowerCase() !== options.filterCity.toLowerCase()) { - result.skippedOutOfBounds++; - continue; - } - } - // Postal prefix filter - if (options.filterType === 'postalPrefix' && options.filterPostalPrefix && postalCode) { - if (!postalCode.toUpperCase().startsWith(options.filterPostalPrefix.toUpperCase())) { - result.skippedOutOfBounds++; - continue; - } - } - else if (options.filterType === 'postalPrefix' && options.filterPostalPrefix && !postalCode) { - result.skippedOutOfBounds++; - continue; - } - if (!streetName) { - result.skippedInvalid++; - continue; - } - // Get coordinates + federal district from Location lookup - let lat; - let lng; - let federalDistrict; - const locData = locationLookup.get(locGuid); - if (locData) { - lat = locData.lat; - lng = locData.lng; - federalDistrict = locData.fedDistrict; - } - else { - // Fallback: convert BG_X/BG_Y via proj4 - const bgX = parseFloat(record.BG_X ?? ''); - const bgY = parseFloat(record.BG_Y ?? ''); - if (!isNaN(bgX) && !isNaN(bgY)) { - const [projLng, projLat] = (0, proj4_1.default)('EPSG:3347', 'EPSG:4326', [bgX, bgY]); - lat = projLat; - lng = projLng; - } - } - if (lat === undefined || lng === undefined) { - result.skippedInvalid++; - continue; - } - // Cut boundary filter - if (cutPolygon && cutPolygon.length > 0) { - const inside = cutPolygon.some((ring) => (0, spatial_1.isPointInPolygon)(lat, lng, ring)); - if (!inside) { - result.skippedOutOfBounds++; - continue; - } - } - // Group addresses by LOC_GUID - if (!addressesByLocGuid.has(locGuid)) { - addressesByLocGuid.set(locGuid, []); - } - addressesByLocGuid.get(locGuid).push({ - addrGuid, - locGuid, - unitNumber, - civicNo, - civicSuffix, - streetName, - streetType, - streetDir, - city, - prov, - postalCode, - buUse: isNaN(buUse) ? undefined : buUse, - lat, - lng, - federalDistrict, - }); - // Write progress to Redis every PROGRESS_INTERVAL rows - if (result.totalRows % PROGRESS_INTERVAL === 0) { - await updateProgress({ - totalRows: result.totalRows, - locationsCreated: result.locationsCreated, - addressesCreated: result.addressesCreated, - skippedDuplicate: result.skippedDuplicate, - skippedOutOfBounds: result.skippedOutOfBounds, - skippedNonResidential: result.skippedNonResidential, - skippedInvalid: result.skippedInvalid, - }); - } - } - catch (err) { - result.skippedInvalid++; - if (result.errors.length < 50) { - const msg = err instanceof Error ? err.message : 'Unknown error'; - result.errors.push(`Row ${result.totalRows}: ${msg}`); - } - } - } - } - // Phase 3: Create Locations and Addresses in batches - logger_1.logger.info(`Creating locations and addresses from ${addressesByLocGuid.size} unique buildings`); - await updateProgress({ status: 'creating-records' }); - const locationBatch = []; - const addressBatch = []; - const locationIdByGuid = new Map(); - // Helper function to build base address without unit number - const buildBaseAddress = (addr) => { - const streetParts = [ - addr.civicNo + (addr.civicSuffix || ''), - addr.streetName, - addr.streetType, - addr.streetDir, - ].filter(Boolean); - let baseAddr = streetParts.join(' '); - if (addr.city) - baseAddr += `, ${addr.city}`; - if (addr.prov) - baseAddr += `, ${addr.prov}`; - return baseAddr; - }; - for (const [locGuid, addressRecords] of addressesByLocGuid.entries()) { - const firstRecord = addressRecords[0]; - // Deduplication check (using first address coordinates) - if (options.deduplicateRadius > 0) { - const coordKey = `${roundCoord(firstRecord.lat)}:${roundCoord(firstRecord.lng)}`; - if (existingCoords.has(coordKey) || inFileCoords.has(coordKey)) { - result.skippedDuplicate += addressRecords.length; - continue; - } - inFileCoords.add(coordKey); - } - // Create Location (one per LOC_GUID) - const locationId = `loc_${Date.now()}_${Math.random().toString(36).substring(7)}`; - locationBatch.push({ - id: locationId, - latitude: firstRecord.lat, - longitude: firstRecord.lng, - address: buildBaseAddress(firstRecord), - postalCode: firstRecord.postalCode, - province: firstRecord.prov || undefined, - federalDistrict: firstRecord.federalDistrict, - buildingUse: firstRecord.buUse, - locGuid, - buildingType: addressRecords.length > 1 ? 'MULTI_UNIT' : 'SINGLE_FAMILY', - totalUnits: addressRecords.length, - createdByUserId: userId, - }); - locationIdByGuid.set(locGuid, locationId); - // Create Addresses (one per unit) - for (const record of addressRecords) { - addressBatch.push({ - id: `addr_${Date.now()}_${Math.random().toString(36).substring(7)}`, - locationId, - unitNumber: record.unitNumber, - addrGuid: record.addrGuid, - createdByUserId: userId, - }); - } - // Batch insert every 1000 locations - if (locationBatch.length >= 1000) { - await database_1.prisma.location.createMany({ data: locationBatch, skipDuplicates: true }); - await database_1.prisma.address.createMany({ data: addressBatch, skipDuplicates: true }); - result.locationsCreated += locationBatch.length; - result.addressesCreated += addressBatch.length; - locationBatch.length = 0; - addressBatch.length = 0; - logger_1.logger.info(`Progress: ${result.locationsCreated} locations, ${result.addressesCreated} addresses created`); - } - } - // Flush remaining batches - if (locationBatch.length > 0) { - await database_1.prisma.location.createMany({ data: locationBatch, skipDuplicates: true }); - await database_1.prisma.address.createMany({ data: addressBatch, skipDuplicates: true }); - result.locationsCreated += locationBatch.length; - result.addressesCreated += addressBatch.length; - } - result.durationMs = Date.now() - startTime; - logger_1.logger.info(`NAR import complete for ${dataset.provinceName}: ${result.locationsCreated} locations, ${result.addressesCreated} addresses created from ${result.totalRows} rows in ${(result.durationMs / 1000).toFixed(1)}s`); - await updateProgress({ - status: 'complete', - totalRows: result.totalRows, - locationsCreated: result.locationsCreated, - addressesCreated: result.addressesCreated, - skippedDuplicate: result.skippedDuplicate, - skippedOutOfBounds: result.skippedOutOfBounds, - skippedNonResidential: result.skippedNonResidential, - skippedInvalid: result.skippedInvalid, - result, - }); - return result; - }, -}; -//# sourceMappingURL=nar-import.service.js.map \ No newline at end of file diff --git a/api/dist/modules/map/locations/nar-import.service.js.map b/api/dist/modules/map/locations/nar-import.service.js.map deleted file mode 100644 index 747bc98e..00000000 --- a/api/dist/modules/map/locations/nar-import.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"nar-import.service.js","sourceRoot":"","sources":["../../../../src/modules/map/locations/nar-import.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmKA,sCAMC;AAxKD,uCAAyB;AACzB,2CAA6B;AAC7B,yCAAkC;AAElC,kDAA0B;AAC1B,uDAAkD;AAClD,iDAA8C;AAC9C,kDAA+C;AAC/C,oDAA+E;AAC/E,kEAAiE;AACjE,6CAA0C;AAE1C,g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AC,EAAE,IAAI,EAAE,YAAY,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC,CAAC;YAC9E,MAAM,CAAC,gBAAgB,IAAI,aAAa,CAAC,MAAM,CAAC;YAChD,MAAM,CAAC,gBAAgB,IAAI,YAAY,CAAC,MAAM,CAAC;QACjD,CAAC;QAED,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC;QAC3C,eAAM,CAAC,IAAI,CACT,2BAA2B,OAAO,CAAC,YAAY,KAAK,MAAM,CAAC,gBAAgB,eAAe,MAAM,CAAC,gBAAgB,2BAA2B,MAAM,CAAC,SAAS,YAAY,CAAC,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CACjN,CAAC;QAEF,MAAM,cAAc,CAAC;YACnB,MAAM,EAAE,UAAU;YAClB,SAAS,EAAE,MAAM,CAAC,SAAS;YAC3B,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;YACzC,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;YACzC,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;YACzC,kBAAkB,EAAE,MAAM,CAAC,kBAAkB;YAC7C,qBAAqB,EAAE,MAAM,CAAC,qBAAqB;YACnD,cAAc,EAAE,MAAM,CAAC,cAAc;YACrC,MAAM;SACP,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC;IAChB,CAAC;CACF,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/settings/settings.routes.d.ts b/api/dist/modules/map/settings/settings.routes.d.ts deleted file mode 100644 index 878a26be..00000000 --- a/api/dist/modules/map/settings/settings.routes.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const router: import("express-serve-static-core").Router; -export { router as mapSettingsRouter }; -//# sourceMappingURL=settings.routes.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/map/settings/settings.routes.d.ts.map b/api/dist/modules/map/settings/settings.routes.d.ts.map deleted file mode 100644 index 685ab0a0..00000000 --- a/api/dist/modules/map/settings/settings.routes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"settings.routes.d.ts","sourceRoot":"","sources":["../../../../src/modules/map/settings/settings.routes.ts"],"names":[],"mappings":"AAQA,QAAA,MAAM,MAAM,4CAAW,CAAC;AA+BxB,OAAO,EAAE,MAAM,IAAI,iBAAiB,EAAE,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/settings/settings.routes.js b/api/dist/modules/map/settings/settings.routes.js deleted file mode 100644 index a93be629..00000000 --- a/api/dist/modules/map/settings/settings.routes.js +++ /dev/null @@ -1,33 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.mapSettingsRouter = void 0; -const express_1 = require("express"); -const settings_service_1 = require("./settings.service"); -const settings_schemas_1 = require("./settings.schemas"); -const validate_1 = require("../../../middleware/validate"); -const auth_middleware_1 = require("../../../middleware/auth.middleware"); -const rbac_middleware_1 = require("../../../middleware/rbac.middleware"); -const roles_1 = require("../../../utils/roles"); -const router = (0, express_1.Router)(); -exports.mapSettingsRouter = router; -// GET /api/map/settings — public (needed for map center/zoom) -router.get('/', async (_req, res, next) => { - try { - const settings = await settings_service_1.mapSettingsService.get(); - res.json(settings); - } - catch (err) { - next(err); - } -}); -// PUT /api/map/settings — admin only -router.put('/', auth_middleware_1.authenticate, (0, rbac_middleware_1.requireRole)(...roles_1.MAP_ROLES), (0, validate_1.validate)(settings_schemas_1.updateMapSettingsSchema), async (req, res, next) => { - try { - const settings = await settings_service_1.mapSettingsService.update(req.body); - res.json(settings); - } - catch (err) { - next(err); - } -}); -//# sourceMappingURL=settings.routes.js.map \ No newline at end of file diff --git a/api/dist/modules/map/settings/settings.routes.js.map b/api/dist/modules/map/settings/settings.routes.js.map deleted file mode 100644 index 7a3a700c..00000000 --- a/api/dist/modules/map/settings/settings.routes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"settings.routes.js","sourceRoot":"","sources":["../../../../src/modules/map/settings/settings.routes.ts"],"names":[],"mappings":";;;AAAA,qCAAkE;AAClE,yDAAwD;AACxD,yDAA6D;AAC7D,2DAAwD;AACxD,yEAAmE;AACnE,yEAAkE;AAClE,gDAAiD;AAEjD,MAAM,MAAM,GAAG,IAAA,gBAAM,GAAE,CAAC;AA+BL,mCAAiB;AA7BpC,8DAA8D;AAC9D,MAAM,CAAC,GAAG,CACR,GAAG,EACH,KAAK,EAAE,IAAa,EAAE,GAAa,EAAE,IAAkB,EAAE,EAAE;IACzD,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,qCAAkB,CAAC,GAAG,EAAE,CAAC;QAChD,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACrB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,GAAG,CAAC,CAAC;IACZ,CAAC;AACH,CAAC,CACF,CAAC;AAEF,qCAAqC;AACrC,MAAM,CAAC,GAAG,CACR,GAAG,EACH,8BAAY,EACZ,IAAA,6BAAW,EAAC,GAAG,iBAAS,CAAC,EACzB,IAAA,mBAAQ,EAAC,0CAAuB,CAAC,EACjC,KAAK,EAAE,GAAY,EAAE,GAAa,EAAE,IAAkB,EAAE,EAAE;IACxD,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,MAAM,qCAAkB,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC3D,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACrB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,GAAG,CAAC,CAAC;IACZ,CAAC;AACH,CAAC,CACF,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/settings/settings.schemas.d.ts b/api/dist/modules/map/settings/settings.schemas.d.ts deleted file mode 100644 index 5aadd0d9..00000000 --- a/api/dist/modules/map/settings/settings.schemas.d.ts +++ /dev/null @@ -1,64 +0,0 @@ -import { z } from 'zod'; -export declare const updateMapSettingsSchema: z.ZodObject<{ - latitude: z.ZodOptional; - longitude: z.ZodOptional; - zoom: z.ZodOptional; - walkSheetTitle: z.ZodOptional>; - walkSheetSubtitle: z.ZodOptional>; - walkSheetFooter: z.ZodOptional>; - qrCode1Url: z.ZodUnion<[z.ZodOptional>, z.ZodLiteral<"">]>; - qrCode1Label: z.ZodOptional>; - qrCode2Url: z.ZodUnion<[z.ZodOptional>, z.ZodLiteral<"">]>; - qrCode2Label: z.ZodOptional>; - qrCode3Url: z.ZodUnion<[z.ZodOptional>, z.ZodLiteral<"">]>; - qrCode3Label: z.ZodOptional>; - publicMapEnabled: z.ZodOptional; - publicShowLocations: z.ZodOptional; - publicShowSupportLevels: z.ZodOptional; - publicShowCuts: z.ZodOptional; - publicShowEvents: z.ZodOptional; - publicShowAddresses: z.ZodOptional; - publicShowSignInfo: z.ZodOptional; -}, "strip", z.ZodTypeAny, { - latitude?: number | undefined; - longitude?: number | undefined; - zoom?: number | undefined; - walkSheetTitle?: string | null | undefined; - walkSheetSubtitle?: string | null | undefined; - walkSheetFooter?: string | null | undefined; - qrCode1Url?: string | null | undefined; - qrCode1Label?: string | null | undefined; - qrCode2Url?: string | null | undefined; - qrCode2Label?: string | null | undefined; - qrCode3Url?: string | null | undefined; - qrCode3Label?: string | null | undefined; - publicMapEnabled?: boolean | undefined; - publicShowLocations?: boolean | undefined; - publicShowSupportLevels?: boolean | undefined; - publicShowCuts?: boolean | undefined; - publicShowEvents?: boolean | undefined; - publicShowAddresses?: boolean | undefined; - publicShowSignInfo?: boolean | undefined; -}, { - latitude?: number | undefined; - longitude?: number | undefined; - zoom?: number | undefined; - walkSheetTitle?: string | null | undefined; - walkSheetSubtitle?: string | null | undefined; - walkSheetFooter?: string | null | undefined; - qrCode1Url?: string | null | undefined; - qrCode1Label?: string | null | undefined; - qrCode2Url?: string | null | undefined; - qrCode2Label?: string | null | undefined; - qrCode3Url?: string | null | undefined; - qrCode3Label?: string | null | undefined; - publicMapEnabled?: boolean | undefined; - publicShowLocations?: boolean | undefined; - publicShowSupportLevels?: boolean | undefined; - publicShowCuts?: boolean | undefined; - publicShowEvents?: boolean | undefined; - publicShowAddresses?: boolean | undefined; - publicShowSignInfo?: boolean | undefined; -}>; -export type UpdateMapSettingsInput = z.infer; -//# sourceMappingURL=settings.schemas.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/map/settings/settings.schemas.d.ts.map b/api/dist/modules/map/settings/settings.schemas.d.ts.map deleted file mode 100644 index eac77ee0..00000000 --- a/api/dist/modules/map/settings/settings.schemas.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"settings.schemas.d.ts","sourceRoot":"","sources":["../../../../src/modules/map/settings/settings.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoBlC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/settings/settings.schemas.js b/api/dist/modules/map/settings/settings.schemas.js deleted file mode 100644 index b1dee6fd..00000000 --- a/api/dist/modules/map/settings/settings.schemas.js +++ /dev/null @@ -1,26 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.updateMapSettingsSchema = void 0; -const zod_1 = require("zod"); -exports.updateMapSettingsSchema = zod_1.z.object({ - latitude: zod_1.z.number().min(-90).max(90).optional(), - longitude: zod_1.z.number().min(-180).max(180).optional(), - zoom: zod_1.z.number().int().min(2).max(19).optional(), - walkSheetTitle: zod_1.z.string().nullable().optional(), - walkSheetSubtitle: zod_1.z.string().nullable().optional(), - walkSheetFooter: zod_1.z.string().nullable().optional(), - qrCode1Url: zod_1.z.string().url().nullable().optional().or(zod_1.z.literal('')), - qrCode1Label: zod_1.z.string().nullable().optional(), - qrCode2Url: zod_1.z.string().url().nullable().optional().or(zod_1.z.literal('')), - qrCode2Label: zod_1.z.string().nullable().optional(), - qrCode3Url: zod_1.z.string().url().nullable().optional().or(zod_1.z.literal('')), - qrCode3Label: zod_1.z.string().nullable().optional(), - publicMapEnabled: zod_1.z.boolean().optional(), - publicShowLocations: zod_1.z.boolean().optional(), - publicShowSupportLevels: zod_1.z.boolean().optional(), - publicShowCuts: zod_1.z.boolean().optional(), - publicShowEvents: zod_1.z.boolean().optional(), - publicShowAddresses: zod_1.z.boolean().optional(), - publicShowSignInfo: zod_1.z.boolean().optional(), -}); -//# sourceMappingURL=settings.schemas.js.map \ No newline at end of file diff --git a/api/dist/modules/map/settings/settings.schemas.js.map b/api/dist/modules/map/settings/settings.schemas.js.map deleted file mode 100644 index 24efc698..00000000 --- a/api/dist/modules/map/settings/settings.schemas.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"settings.schemas.js","sourceRoot":"","sources":["../../../../src/modules/map/settings/settings.schemas.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AAEX,QAAA,uBAAuB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC9C,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;IAChD,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE;IACnD,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE;IAChD,cAAc,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAChD,iBAAiB,EAAE,O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,QAAQ,EAAE;IAC3C,kBAAkB,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAC3C,CAAC,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/settings/settings.service.d.ts b/api/dist/modules/map/settings/settings.service.d.ts deleted file mode 100644 index 4d39d0b7..00000000 --- a/api/dist/modules/map/settings/settings.service.d.ts +++ /dev/null @@ -1,54 +0,0 @@ -import type { UpdateMapSettingsInput } from './settings.schemas'; -export declare const mapSettingsService: { - get(): Promise<{ - id: string; - createdAt: Date; - updatedAt: Date; - createdBy: string | null; - latitude: import("@prisma/client/runtime/library").Decimal | null; - longitude: import("@prisma/client/runtime/library").Decimal | null; - zoom: number | null; - walkSheetTitle: string | null; - walkSheetSubtitle: string | null; - walkSheetFooter: string | null; - qrCode1Url: string | null; - qrCode1Label: string | null; - qrCode2Url: string | null; - qrCode2Label: string | null; - qrCode3Url: string | null; - qrCode3Label: string | null; - publicMapEnabled: boolean; - publicShowLocations: boolean; - publicShowSupportLevels: boolean; - publicShowCuts: boolean; - publicShowEvents: boolean; - publicShowAddresses: boolean; - publicShowSignInfo: boolean; - }>; - update(data: UpdateMapSettingsInput): Promise<{ - id: string; - createdAt: Date; - updatedAt: Date; - createdBy: string | null; - latitude: import("@prisma/client/runtime/library").Decimal | null; - longitude: import("@prisma/client/runtime/library").Decimal | null; - zoom: number | null; - walkSheetTitle: string | null; - walkSheetSubtitle: string | null; - walkSheetFooter: string | null; - qrCode1Url: string | null; - qrCode1Label: string | null; - qrCode2Url: string | null; - qrCode2Label: string | null; - qrCode3Url: string | null; - qrCode3Label: string | null; - publicMapEnabled: boolean; - publicShowLocations: boolean; - publicShowSupportLevels: boolean; - publicShowCuts: boolean; - publicShowEvents: boolean; - publicShowAddresses: boolean; - publicShowSignInfo: boolean; - }>; -}; -//# sourceMappingURL=settings.service.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/map/settings/settings.service.d.ts.map b/api/dist/modules/map/settings/settings.service.d.ts.map deleted file mode 100644 index 20d87c1e..00000000 --- a/api/dist/modules/map/settings/settings.service.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"settings.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/map/settings/settings.service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEjE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;iBAeV,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;CAiB1C,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/settings/settings.service.js b/api/dist/modules/map/settings/settings.service.js deleted file mode 100644 index b9ae4d06..00000000 --- a/api/dist/modules/map/settings/settings.service.js +++ /dev/null @@ -1,37 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.mapSettingsService = void 0; -const database_1 = require("../../../config/database"); -exports.mapSettingsService = { - async get() { - let settings = await database_1.prisma.mapSettings.findFirst(); - if (!settings) { - settings = await database_1.prisma.mapSettings.create({ - data: { - latitude: 45.4215, - longitude: -75.6972, - zoom: 12, - }, - }); - } - return settings; - }, - async update(data) { - const existing = await database_1.prisma.mapSettings.findFirst(); - if (existing) { - return database_1.prisma.mapSettings.update({ - where: { id: existing.id }, - data, - }); - } - return database_1.prisma.mapSettings.create({ - data: { - latitude: data.latitude ?? 45.4215, - longitude: data.longitude ?? -75.6972, - zoom: data.zoom ?? 12, - ...data, - }, - }); - }, -}; -//# sourceMappingURL=settings.service.js.map \ No newline at end of file diff --git a/api/dist/modules/map/settings/settings.service.js.map b/api/dist/modules/map/settings/settings.service.js.map deleted file mode 100644 index 6139147c..00000000 --- a/api/dist/modules/map/settings/settings.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"settings.service.js","sourceRoot":"","sources":["../../../../src/modules/map/settings/settings.service.ts"],"names":[],"mappings":";;;AAAA,uDAAkD;AAGrC,QAAA,kBAAkB,GAAG;IAChC,KAAK,CAAC,GAAG;QACP,IAAI,QAAQ,GAAG,MAAM,iBAAM,CAAC,WAAW,CAAC,SAAS,EAAE,CAAC;QACpD,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,QAAQ,GAAG,MAAM,iBAAM,CAAC,WAAW,CAAC,MAAM,CAAC;gBACzC,IAAI,EAAE;oBACJ,QAAQ,EAAE,OAAO;oBACjB,SAAS,EAAE,CAAC,OAAO;oBACnB,IAAI,EAAE,EAAE;iBACT;aACF,CAAC,CAAC;QACL,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,IAA4B;QACvC,MAAM,QAAQ,GAAG,MAAM,iBAAM,CAAC,WAAW,CAAC,SAAS,EAAE,CAAC;QACtD,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO,iBAAM,CAAC,WAAW,CAAC,MAAM,CAAC;gBAC/B,KAAK,EAAE,EAAE,EAAE,EAAE,QAAQ,CAAC,EAAE,EAAE;gBAC1B,IAAI;aACL,CAAC,CAAC;QACL,CAAC;QACD,OAAO,iBAAM,CAAC,WAAW,CAAC,MAAM,CAAC;YAC/B,IAAI,EAAE;gBACJ,QAAQ,EAAE,IAAI,CAAC,QAAQ,IAAI,OAAO;gBAClC,SAAS,EAAE,IAAI,CAAC,SAAS,IAAI,CAAC,OAAO;gBACrC,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,EAAE;gBACrB,GAAG,IAAI;aACR;SACF,CAAC,CAAC;IACL,CAAC;CACF,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/shifts/shift-series.routes.d.ts b/api/dist/modules/map/shifts/shift-series.routes.d.ts deleted file mode 100644 index f0a290b8..00000000 --- a/api/dist/modules/map/shifts/shift-series.routes.d.ts +++ /dev/null @@ -1,3 +0,0 @@ -declare const router: import("express-serve-static-core").Router; -export default router; -//# sourceMappingURL=shift-series.routes.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/map/shifts/shift-series.routes.d.ts.map b/api/dist/modules/map/shifts/shift-series.routes.d.ts.map deleted file mode 100644 index b114cab2..00000000 --- a/api/dist/modules/map/shifts/shift-series.routes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"shift-series.routes.d.ts","sourceRoot":"","sources":["../../../../src/modules/map/shifts/shift-series.routes.ts"],"names":[],"mappings":"AAQA,QAAA,MAAM,MAAM,4CAAW,CAAC;AAqExB,eAAe,MAAM,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/shifts/shift-series.routes.js b/api/dist/modules/map/shifts/shift-series.routes.js deleted file mode 100644 index d4a95097..00000000 --- a/api/dist/modules/map/shifts/shift-series.routes.js +++ /dev/null @@ -1,64 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -const express_1 = require("express"); -const auth_middleware_1 = require("../../../middleware/auth.middleware"); -const rbac_middleware_1 = require("../../../middleware/rbac.middleware"); -const validate_1 = require("../../../middleware/validate"); -const shift_series_service_1 = require("./shift-series.service"); -const shift_series_schemas_1 = require("./shift-series.schemas"); -const roles_1 = require("../../../utils/roles"); -const router = (0, express_1.Router)(); -// All routes require admin role -router.use(auth_middleware_1.authenticate, (0, rbac_middleware_1.requireRole)(...roles_1.SCHEDULING_ROLES)); -// Create series -router.post('/', (0, validate_1.validate)(shift_series_schemas_1.createShiftSeriesSchema), async (req, res, next) => { - try { - const result = await shift_series_service_1.ShiftSeriesService.createSeries(req.body, req.user?.id); - res.json(result); - } - catch (error) { - next(error); - } -}); -// Get series shift count -router.get('/:id/count', async (req, res, next) => { - try { - const count = await shift_series_service_1.ShiftSeriesService.getShiftCount(req.params.id); - res.json({ count }); - } - catch (error) { - next(error); - } -}); -// Get series -router.get('/:id', async (req, res, next) => { - try { - const series = await shift_series_service_1.ShiftSeriesService.getSeries(req.params.id); - res.json({ series }); - } - catch (error) { - next(error); - } -}); -// Update series -router.put('/:id', (0, validate_1.validate)(shift_series_schemas_1.updateShiftSeriesSchema), async (req, res, next) => { - try { - const series = await shift_series_service_1.ShiftSeriesService.updateSeries(req.params.id, req.body); - res.json({ series }); - } - catch (error) { - next(error); - } -}); -// Delete series -router.delete('/:id', async (req, res, next) => { - try { - await shift_series_service_1.ShiftSeriesService.deleteSeries(req.params.id); - res.json({ success: true }); - } - catch (error) { - next(error); - } -}); -exports.default = router; -//# sourceMappingURL=shift-series.routes.js.map \ No newline at end of file diff --git a/api/dist/modules/map/shifts/shift-series.routes.js.map b/api/dist/modules/map/shifts/shift-series.routes.js.map deleted file mode 100644 index 85aaae0e..00000000 --- a/api/dist/modules/map/shifts/shift-series.routes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"shift-series.routes.js","sourceRoot":"","sources":["../../../../src/modules/map/shifts/shift-series.routes.ts"],"names":[],"mappings":";;AAAA,qCAAiC;AACjC,yEAAmE;AACnE,yEAAkE;AAClE,2DAAwD;AACxD,iEAA4D;AAC5D,iEAA0F;AAC1F,gDAAwD;AAExD,MAAM,MAAM,GAAG,IAAA,gBAAM,GAAE,CAAC;AAExB,gCAAgC;AAChC,MAAM,CAAC,GAAG,CAAC,8BAAY,EAAE,IAAA,6BAAW,EAAC,GAAG,wBAAgB,CAAC,CAAC,CAAC;AAE3D,gBAAgB;AAChB,MAAM,CAAC,IAAI,CACT,GAAG,EACH,IAAA,mBAAQ,EAAC,8CAAuB,CAAC,EACjC,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;IACvB,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,yCAAkB,CAAC,YAAY,CAClD,GAAG,CAAC,IAAI,EACR,GAAG,CAAC,IAAI,EAAE,EAAE,CACb,CAAC;QACF,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACnB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,KAAK,CAAC,CAAC;IACd,CAAC;AACH,CAAC,CACF,CAAC;AAEF,yBAAyB;AACzB,MAAM,CAAC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;AAChB,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE;IAC7C,IAAI,CAAC;QACH,MAAM,yCAAkB,CAAC,YAAY,CAAC,GAAG,CAAC,MAAM,CAAC,EAAY,CAAC,CAAC;QAC/D,GAAG,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;IAC9B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,KAAK,CAAC,CAAC;IACd,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,kBAAe,MAAM,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/shifts/shift-series.schemas.d.ts b/api/dist/modules/map/shifts/shift-series.schemas.d.ts deleted file mode 100644 index 876206fd..00000000 --- a/api/dist/modules/map/shifts/shift-series.schemas.d.ts +++ /dev/null @@ -1,108 +0,0 @@ -import { z } from 'zod'; -export declare const createShiftSeriesSchema: z.ZodEffects; - startTime: z.ZodString; - endTime: z.ZodString; - location: z.ZodOptional; - maxVolunteers: z.ZodNumber; - isPublic: z.ZodDefault>; - cutId: z.ZodOptional; - frequency: z.ZodNativeEnum<{ - DAILY: "DAILY"; - WEEKLY: "WEEKLY"; - MONTHLY: "MONTHLY"; - }>; - daysOfWeek: z.ZodOptional>; - startDate: z.ZodString; - endDate: z.ZodOptional; -}, "strip", z.ZodTypeAny, { - title: string; - startDate: string; - isPublic: boolean; - startTime: string; - endTime: string; - maxVolunteers: number; - frequency: "DAILY" | "WEEKLY" | "MONTHLY"; - location?: string | undefined; - endDate?: string | undefined; - description?: string | undefined; - cutId?: string | undefined; - daysOfWeek?: number[] | undefined; -}, { - title: string; - startDate: string; - startTime: string; - endTime: string; - maxVolunteers: number; - frequency: "DAILY" | "WEEKLY" | "MONTHLY"; - location?: string | undefined; - endDate?: string | undefined; - description?: string | undefined; - isPublic?: boolean | undefined; - cutId?: string | undefined; - daysOfWeek?: number[] | undefined; -}>, { - title: string; - startDate: string; - isPublic: boolean; - startTime: string; - endTime: string; - maxVolunteers: number; - frequency: "DAILY" | "WEEKLY" | "MONTHLY"; - location?: string | undefined; - endDate?: string | undefined; - description?: string | undefined; - cutId?: string | undefined; - daysOfWeek?: number[] | undefined; -}, { - title: string; - startDate: string; - startTime: string; - endTime: string; - maxVolunteers: number; - frequency: "DAILY" | "WEEKLY" | "MONTHLY"; - location?: string | undefined; - endDate?: string | undefined; - description?: string | undefined; - isPublic?: boolean | undefined; - cutId?: string | undefined; - daysOfWeek?: number[] | undefined; -}>; -export declare const updateShiftSeriesSchema: z.ZodObject<{ - title: z.ZodOptional; - description: z.ZodOptional>; - startTime: z.ZodOptional; - endTime: z.ZodOptional; - location: z.ZodOptional>; - maxVolunteers: z.ZodOptional; - isPublic: z.ZodOptional; - cutId: z.ZodOptional>; - editMode: z.ZodEnum<["THIS", "FUTURE", "ALL"]>; - fromDate: z.ZodOptional; -}, "strip", z.ZodTypeAny, { - editMode: "THIS" | "FUTURE" | "ALL"; - location?: string | null | undefined; - title?: string | undefined; - description?: string | null | undefined; - isPublic?: boolean | undefined; - cutId?: string | null | undefined; - startTime?: string | undefined; - endTime?: string | undefined; - maxVolunteers?: number | undefined; - fromDate?: string | undefined; -}, { - editMode: "THIS" | "FUTURE" | "ALL"; - location?: string | null | undefined; - title?: string | undefined; - description?: string | null | undefined; - isPublic?: boolean | undefined; - cutId?: string | null | undefined; - startTime?: string | undefined; - endTime?: string | undefined; - maxVolunteers?: number | undefined; - fromDate?: string | undefined; -}>; -export type CreateShiftSeriesInput = z.infer; -export type UpdateShiftSeriesInput = z.infer; -//# sourceMappingURL=shift-series.schemas.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/map/shifts/shift-series.schemas.d.ts.map b/api/dist/modules/map/shifts/shift-series.schemas.d.ts.map deleted file mode 100644 index fc13eb33..00000000 --- a/api/dist/modules/map/shifts/shift-series.schemas.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"shift-series.schemas.d.ts","sourceRoot":"","sources":["../../../../src/modules/map/shifts/shift-series.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwBnC,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWlC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAC7E,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/shifts/shift-series.schemas.js b/api/dist/modules/map/shifts/shift-series.schemas.js deleted file mode 100644 index 3b3c4a0f..00000000 --- a/api/dist/modules/map/shifts/shift-series.schemas.js +++ /dev/null @@ -1,39 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.updateShiftSeriesSchema = exports.createShiftSeriesSchema = void 0; -const zod_1 = require("zod"); -const client_1 = require("@prisma/client"); -exports.createShiftSeriesSchema = zod_1.z.object({ - title: zod_1.z.string().min(1, 'Title is required'), - description: zod_1.z.string().optional(), - startTime: zod_1.z.string().regex(/^\d{2}:\d{2}$/, 'Start time must be HH:MM'), - endTime: zod_1.z.string().regex(/^\d{2}:\d{2}$/, 'End time must be HH:MM'), - location: zod_1.z.string().optional(), - maxVolunteers: zod_1.z.number().int().min(1, 'Must have at least 1 volunteer spot'), - isPublic: zod_1.z.boolean().optional().default(false), - cutId: zod_1.z.string().optional(), - // Recurrence - frequency: zod_1.z.nativeEnum(client_1.RecurrenceFrequency), - daysOfWeek: zod_1.z.array(zod_1.z.number().int().min(0).max(6)).optional(), // 0=Sun, 6=Sat - startDate: zod_1.z.string().regex(/^\d{4}-\d{2}-\d{2}$/, 'Start date must be YYYY-MM-DD'), - endDate: zod_1.z.string().regex(/^\d{4}-\d{2}-\d{2}$/, 'End date must be YYYY-MM-DD').optional(), -}).refine((data) => { - // Weekly requires daysOfWeek - if (data.frequency === client_1.RecurrenceFrequency.WEEKLY && !data.daysOfWeek?.length) { - return false; - } - return true; -}, { message: 'Weekly recurrence requires at least one day of week', path: ['daysOfWeek'] }); -exports.updateShiftSeriesSchema = zod_1.z.object({ - title: zod_1.z.string().min(1).optional(), - description: zod_1.z.string().nullable().optional(), - startTime: zod_1.z.string().regex(/^\d{2}:\d{2}$/).optional(), - endTime: zod_1.z.string().regex(/^\d{2}:\d{2}$/).optional(), - location: zod_1.z.string().nullable().optional(), - maxVolunteers: zod_1.z.number().int().min(1).optional(), - isPublic: zod_1.z.boolean().optional(), - cutId: zod_1.z.string().nullable().optional(), - editMode: zod_1.z.enum(['THIS', 'FUTURE', 'ALL']), - fromDate: zod_1.z.string().regex(/^\d{4}-\d{2}-\d{2}$/).optional(), // Required for FUTURE -}); -//# sourceMappingURL=shift-series.schemas.js.map \ No newline at end of file diff --git a/api/dist/modules/map/shifts/shift-series.schemas.js.map b/api/dist/modules/map/shifts/shift-series.schemas.js.map deleted file mode 100644 index 7c8da0ea..00000000 --- a/api/dist/modules/map/shifts/shift-series.schemas.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"shift-series.schemas.js","sourceRoot":"","sources":["../../../../src/modules/map/shifts/shift-series.schemas.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,2CAAqD;AAExC,QAAA,uBAAuB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC9C,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,mBAAmB,CAAC;IAC7C,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,SAAS,EAAE,OAAC,CAAC,MAAM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AE,CACzF,CAAC;AAEW,QAAA,uBAAuB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC9C,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACnC,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC7C,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,QAAQ,EAAE;IACvD,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC,QAAQ,EAAE;IACrD,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC1C,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACjD,QAAQ,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IAChC,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IACvC,QAAQ,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAC;IAC3C,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC,QAAQ,EAAE,EAAE,sBAAsB;CACrF,CAAC,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/shifts/shift-series.service.d.ts b/api/dist/modules/map/shifts/shift-series.service.d.ts deleted file mode 100644 index 172382a6..00000000 --- a/api/dist/modules/map/shifts/shift-series.service.d.ts +++ /dev/null @@ -1,194 +0,0 @@ -import type { CreateShiftSeriesInput, UpdateShiftSeriesInput } from './shift-series.schemas'; -export declare class ShiftSeriesService { - /** - * Generate occurrence dates based on recurrence rules - */ - static generateOccurrences(input: CreateShiftSeriesInput): Date[]; - /** - * Create a shift series and generate all individual shifts - */ - static createSeries(input: CreateShiftSeriesInput, createdBy?: string): Promise<{ - series: { - id: string; - createdAt: Date; - updatedAt: Date; - location: string | null; - title: string; - startDate: Date; - endDate: Date | null; - description: string | null; - createdBy: string | null; - isPublic: boolean; - cutId: string | null; - startTime: string; - endTime: string; - maxVolunteers: number; - frequency: import(".prisma/client").$Enums.RecurrenceFrequency; - daysOfWeek: import("@prisma/client/runtime/library").JsonValue | null; - }; - generatedShiftsCount: number; - }>; - /** - * Get count of non-exception shifts in a series - */ - static getShiftCount(seriesId: string): Promise; - /** - * Get series with all its shifts - */ - static getSeries(seriesId: string): Promise<{ - shifts: ({ - signups: { - status: import(".prisma/client").$Enums.SignupStatus; - id: string; - userId: string | null; - userEmail: string; - shiftId: string; - userName: string | null; - shiftTitle: string | null; - userPhone: string | null; - signupDate: Date; - signupSource: import(".prisma/client").$Enums.SignupSource; - }[]; - } & { - status: import(".prisma/client").$Enums.ShiftStatus; - date: Date; - id: string; - createdAt: Date; - updatedAt: Date; - location: string | null; - title: string; - description: string | null; - createdBy: string | null; - isPublic: boolean; - cutId: string | null; - startTime: string; - endTime: string; - gancioEventId: number | null; - meetingId: string | null; - seriesId: string | null; - isException: boolean; - maxVolunteers: number; - currentVolunteers: number; - })[]; - cut: { - id: string; - name: string; - createdAt: Date; - updatedAt: Date; - category: import(".prisma/client").$Enums.CutCategory | null; - description: string | null; - isPublic: boolean; - createdByUserId: string | null; - color: string; - opacity: import("@prisma/client/runtime/library").Decimal; - isOfficial: boolean; - geojson: string; - bounds: string | null; - showLocations: boolean; - exportEnabled: boolean; - assignedTo: string | null; - filterSettings: import("@prisma/client/runtime/library").JsonValue | null; - lastCanvassed: Date | null; - completionPercentage: number; - } | null; - } & { - id: string; - createdAt: Date; - updatedAt: Date; - location: string | null; - title: string; - startDate: Date; - endDate: Date | null; - description: string | null; - createdBy: string | null; - isPublic: boolean; - cutId: string | null; - startTime: string; - endTime: string; - maxVolunteers: number; - frequency: import(".prisma/client").$Enums.RecurrenceFrequency; - daysOfWeek: import("@prisma/client/runtime/library").JsonValue | null; - }>; - /** - * Update series shifts based on edit mode - */ - static updateSeries(seriesId: string, input: UpdateShiftSeriesInput): Promise<{ - shifts: ({ - signups: { - status: import(".prisma/client").$Enums.SignupStatus; - id: string; - userId: string | null; - userEmail: string; - shiftId: string; - userName: string | null; - shiftTitle: string | null; - userPhone: string | null; - signupDate: Date; - signupSource: import(".prisma/client").$Enums.SignupSource; - }[]; - } & { - status: import(".prisma/client").$Enums.ShiftStatus; - date: Date; - id: string; - createdAt: Date; - updatedAt: Date; - location: string | null; - title: string; - description: string | null; - createdBy: string | null; - isPublic: boolean; - cutId: string | null; - startTime: string; - endTime: string; - gancioEventId: number | null; - meetingId: string | null; - seriesId: string | null; - isException: boolean; - maxVolunteers: number; - currentVolunteers: number; - })[]; - cut: { - id: string; - name: string; - createdAt: Date; - updatedAt: Date; - category: import(".prisma/client").$Enums.CutCategory | null; - description: string | null; - isPublic: boolean; - createdByUserId: string | null; - color: string; - opacity: import("@prisma/client/runtime/library").Decimal; - isOfficial: boolean; - geojson: string; - bounds: string | null; - showLocations: boolean; - exportEnabled: boolean; - assignedTo: string | null; - filterSettings: import("@prisma/client/runtime/library").JsonValue | null; - lastCanvassed: Date | null; - completionPercentage: number; - } | null; - } & { - id: string; - createdAt: Date; - updatedAt: Date; - location: string | null; - title: string; - startDate: Date; - endDate: Date | null; - description: string | null; - createdBy: string | null; - isPublic: boolean; - cutId: string | null; - startTime: string; - endTime: string; - maxVolunteers: number; - frequency: import(".prisma/client").$Enums.RecurrenceFrequency; - daysOfWeek: import("@prisma/client/runtime/library").JsonValue | null; - }>; - /** - * Delete series (cascades to shifts via onDelete: SetNull) - */ - static deleteSeries(seriesId: string): Promise; -} -//# sourceMappingURL=shift-series.service.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/map/shifts/shift-series.service.d.ts.map b/api/dist/modules/map/shifts/shift-series.service.d.ts.map deleted file mode 100644 index 7f1a1904..00000000 --- a/api/dist/modules/map/shifts/shift-series.service.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"shift-series.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/map/shifts/shift-series.service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAK7F,qBAAa,kBAAkB;IAC7B;;OAEG;IACH,MAAM,CAAC,mBAAmB,CAAC,KAAK,EAAE,sBAAsB,GAAG,IAAI,EAAE;IA8CjE;;OAEG;WACU,YAAY,CAAC,KAAK,EAAE,sBAAsB,EAAE,SAAS,CAAC,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;IA2D3E;;OAEG;WACU,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAM7D;;OAEG;WACU,SAAS,CAAC,QAAQ,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAmBvC;;OAEG;WACU,YAAY,CACvB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA0C/B;;OAEG;WACU,YAAY,CAAC,QAAQ,EAAE,MAAM;CAW3C"} \ No newline at end of file diff --git a/api/dist/modules/map/shifts/shift-series.service.js b/api/dist/modules/map/shifts/shift-series.service.js deleted file mode 100644 index 2abd8bfe..00000000 --- a/api/dist/modules/map/shifts/shift-series.service.js +++ /dev/null @@ -1,188 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.ShiftSeriesService = void 0; -const database_1 = require("../../../config/database"); -const client_1 = require("@prisma/client"); -const MAX_OCCURRENCES = 100; -const MAX_DAYS = 365; -class ShiftSeriesService { - /** - * Generate occurrence dates based on recurrence rules - */ - static generateOccurrences(input) { - const dates = []; - const startDate = new Date(input.startDate); - const endDate = input.endDate ? new Date(input.endDate) : null; - let currentDate = new Date(startDate); - let count = 0; - while (count < MAX_OCCURRENCES) { - // Check end date - if (endDate && currentDate > endDate) - break; - // Check max days - const daysDiff = Math.floor((currentDate.getTime() - startDate.getTime()) / (1000 * 60 * 60 * 24)); - if (daysDiff > MAX_DAYS) - break; - // Check if date matches recurrence pattern - let shouldInclude = false; - if (input.frequency === client_1.RecurrenceFrequency.DAILY) { - shouldInclude = true; - } - else if (input.frequency === client_1.RecurrenceFrequency.WEEKLY) { - const dayOfWeek = currentDate.getDay(); // 0=Sun, 6=Sat - shouldInclude = input.daysOfWeek?.includes(dayOfWeek) ?? false; - } - else if (input.frequency === client_1.RecurrenceFrequency.MONTHLY) { - shouldInclude = currentDate.getDate() === startDate.getDate(); - } - if (shouldInclude) { - dates.push(new Date(currentDate)); - count++; - } - // Increment date - if (input.frequency === client_1.RecurrenceFrequency.DAILY) { - currentDate.setDate(currentDate.getDate() + 1); - } - else if (input.frequency === client_1.RecurrenceFrequency.WEEKLY) { - currentDate.setDate(currentDate.getDate() + 1); // Check each day - } - else if (input.frequency === client_1.RecurrenceFrequency.MONTHLY) { - currentDate.setMonth(currentDate.getMonth() + 1); - } - } - return dates; - } - /** - * Create a shift series and generate all individual shifts - */ - static async createSeries(input, createdBy) { - // Generate occurrence dates - const dates = this.generateOccurrences(input); - if (dates.length === 0) { - throw new Error('No valid dates generated from recurrence rules'); - } - // Create series and shifts in transaction - const result = await database_1.prisma.$transaction(async (tx) => { - // Create series - const series = await tx.shiftSeries.create({ - data: { - title: input.title, - description: input.description, - startTime: input.startTime, - endTime: input.endTime, - location: input.location, - maxVolunteers: input.maxVolunteers, - isPublic: input.isPublic ?? false, - cutId: input.cutId, - frequency: input.frequency, - daysOfWeek: input.daysOfWeek, - startDate: new Date(input.startDate), - endDate: input.endDate ? new Date(input.endDate) : null, - createdBy, - }, - }); - // Create individual shifts - const shifts = await Promise.all(dates.map((date) => tx.shift.create({ - data: { - title: input.title, - description: input.description, - date, - startTime: input.startTime, - endTime: input.endTime, - location: input.location, - maxVolunteers: input.maxVolunteers, - isPublic: input.isPublic ?? false, - cutId: input.cutId, - seriesId: series.id, - createdBy, - }, - }))); - return { series, shifts }; - }); - return { - series: result.series, - generatedShiftsCount: result.shifts.length, - }; - } - /** - * Get count of non-exception shifts in a series - */ - static async getShiftCount(seriesId) { - return database_1.prisma.shift.count({ - where: { seriesId, isException: false }, - }); - } - /** - * Get series with all its shifts - */ - static async getSeries(seriesId) { - const series = await database_1.prisma.shiftSeries.findUnique({ - where: { id: seriesId }, - include: { - cut: true, - shifts: { - orderBy: { date: 'asc' }, - include: { signups: true }, - }, - }, - }); - if (!series) { - throw new Error('Shift series not found'); - } - return series; - } - /** - * Update series shifts based on edit mode - */ - static async updateSeries(seriesId, input) { - const series = await database_1.prisma.shiftSeries.findUnique({ - where: { id: seriesId }, - include: { shifts: true }, - }); - if (!series) { - throw new Error('Shift series not found'); - } - const { editMode, fromDate, ...updates } = input; - if (editMode === 'ALL') { - // Update series + all shifts - await database_1.prisma.$transaction(async (tx) => { - await tx.shiftSeries.update({ - where: { id: seriesId }, - data: updates, - }); - await tx.shift.updateMany({ - where: { seriesId, isException: false }, - data: updates, - }); - }); - } - else if (editMode === 'FUTURE' && fromDate) { - // Update shifts from date onwards - await database_1.prisma.shift.updateMany({ - where: { - seriesId, - date: { gte: new Date(fromDate) }, - isException: false, - }, - data: updates, - }); - } - // Note: THIS mode is handled by regular shift update with isException flag - return this.getSeries(seriesId); - } - /** - * Delete series (cascades to shifts via onDelete: SetNull) - */ - static async deleteSeries(seriesId) { - // Delete all shifts in series first - await database_1.prisma.shift.deleteMany({ - where: { seriesId }, - }); - // Then delete series - await database_1.prisma.shiftSeries.delete({ - where: { id: seriesId }, - }); - } -} -exports.ShiftSeriesService = ShiftSeriesService; -//# sourceMappingURL=shift-series.service.js.map \ No newline at end of file diff --git a/api/dist/modules/map/shifts/shift-series.service.js.map b/api/dist/modules/map/shifts/shift-series.service.js.map deleted file mode 100644 index dbac52ac..00000000 --- a/api/dist/modules/map/shifts/shift-series.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"shift-series.service.js","sourceRoot":"","sources":["../../../../src/modules/map/shifts/shift-series.service.ts"],"names":[],"mappings":";;;AAAA,uDAAkD;AAClD,2CAAqD;AAGrD,MAAM,eAAe,GAAG,GAAG,CAAC;AAC5B,MAAM,QAAQ,GAAG,GAAG,CAAC;AAErB,MAAa,kBAAkB;IAC7B;;OAEG;IACH,MAAM,CAAC,mBAAmB,CAAC,KAA6B;QACtD,MAAM,KAAK,GAAW,EAAE,CAAC;QACzB,MAAM,SAAS,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QAC5C,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAE/D,IAAI,WAAW,GAAG,IAAI,IAAI,CAAC,SAAS,CAAC,CAAC;QACtC,IAAI,KAAK,GAAG,CAAC,CAAC;QAEd,OAAO,KAAK,GAAG,eAAe,EAAE,CAAC;YAC/B,iBAAiB;YACjB,IAAI,OAAO,IAAI,WAAW,GAAG,OAAO;gBAAE,MAAM;YAE5C,iBAAiB;YACjB,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,OAAO,EAAE,GAAG,SAAS,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;YACnG,IAAI,QAAQ,GAAG,QAAQ;gBAAE,MAAM;YAE/B,2CAA2C;YAC3C,IAAI,aAAa,GAAG,KAAK,CAAC;YAE1B,IA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AAK;iBACnB;gBACD,IAAI,EAAE,OAAO;aACd,CAAC,CAAC;QACL,CAAC;QACD,2EAA2E;QAE3E,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IAClC,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,QAAgB;QACxC,oCAAoC;QACpC,MAAM,iBAAM,CAAC,KAAK,CAAC,UAAU,CAAC;YAC5B,KAAK,EAAE,EAAE,QAAQ,EAAE;SACpB,CAAC,CAAC;QAEH,qBAAqB;QACrB,MAAM,iBAAM,CAAC,WAAW,CAAC,MAAM,CAAC;YAC9B,KAAK,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE;SACxB,CAAC,CAAC;IACL,CAAC;CACF;AA5MD,gDA4MC"} \ No newline at end of file diff --git a/api/dist/modules/map/shifts/shifts.routes.d.ts b/api/dist/modules/map/shifts/shifts.routes.d.ts deleted file mode 100644 index d6565c4a..00000000 --- a/api/dist/modules/map/shifts/shifts.routes.d.ts +++ /dev/null @@ -1,5 +0,0 @@ -declare const adminRouter: import("express-serve-static-core").Router; -declare const volunteerRouter: import("express-serve-static-core").Router; -declare const publicRouter: import("express-serve-static-core").Router; -export { adminRouter as shiftsAdminRouter, publicRouter as shiftsPublicRouter, volunteerRouter as shiftsVolunteerRouter }; -//# sourceMappingURL=shifts.routes.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/map/shifts/shifts.routes.d.ts.map b/api/dist/modules/map/shifts/shifts.routes.d.ts.map deleted file mode 100644 index dcb44aab..00000000 --- a/api/dist/modules/map/shifts/shifts.routes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"shifts.routes.d.ts","sourceRoot":"","sources":["../../../../src/modules/map/shifts/shifts.routes.ts"],"names":[],"mappings":"AAkBA,QAAA,MAAM,WAAW,4CAAW,CAAC;AAuL7B,QAAA,MAAM,eAAe,4CAAW,CAAC;AA2DjC,QAAA,MAAM,YAAY,4CAAW,CAAC;AA0E9B,OAAO,EAAE,WAAW,IAAI,iBAAiB,EAAE,YAAY,IAAI,kBAAkB,EAAE,eAAe,IAAI,qBAAqB,EAAE,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/shifts/shifts.routes.js b/api/dist/modules/map/shifts/shifts.routes.js deleted file mode 100644 index 02a40d92..00000000 --- a/api/dist/modules/map/shifts/shifts.routes.js +++ /dev/null @@ -1,264 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.shiftsVolunteerRouter = exports.shiftsPublicRouter = exports.shiftsAdminRouter = void 0; -const express_1 = require("express"); -const shifts_service_1 = require("./shifts.service"); -const shifts_schemas_1 = require("./shifts.schemas"); -const validate_1 = require("../../../middleware/validate"); -const auth_middleware_1 = require("../../../middleware/auth.middleware"); -const rbac_middleware_1 = require("../../../middleware/rbac.middleware"); -const rate_limit_1 = require("../../../middleware/rate-limit"); -const database_1 = require("../../../config/database"); -const redis_1 = require("../../../config/redis"); -const roles_1 = require("../../../utils/roles"); -// --- Admin Router --- -const adminRouter = (0, express_1.Router)(); -exports.shiftsAdminRouter = adminRouter; -adminRouter.use(auth_middleware_1.authenticate); -adminRouter.use((0, rbac_middleware_1.requireRole)(...roles_1.SCHEDULING_ROLES)); -// GET /api/map/shifts — list paginated -adminRouter.get('/', (0, validate_1.validate)(shifts_schemas_1.listShiftsSchema, 'query'), async (req, res, next) => { - try { - const result = await shifts_service_1.shiftsService.findAll(req.query); - res.json(result); - } - catch (err) { - next(err); - } -}); -// GET /api/map/shifts/stats — statistics -adminRouter.get('/stats', async (_req, res, next) => { - try { - const stats = await shifts_service_1.shiftsService.getStats(); - res.json(stats); - } - catch (err) { - next(err); - } -}); -// GET /api/map/shifts/calendar — calendar data -adminRouter.get('/calendar', async (req, res, next) => { - try { - const { startDate, endDate } = req.query; - if (!startDate || !endDate) { - return res.status(400).json({ error: 'startDate and endDate required' }); - } - const data = await shifts_service_1.shiftsService.getCalendarData(startDate, endDate); - res.json(data); - } - catch (err) { - next(err); - } -}); -// GET /api/map/shifts/:id — single shift with signups -adminRouter.get('/:id', async (req, res, next) => { - try { - const id = req.params.id; - const shift = await shifts_service_1.shiftsService.findById(id); - res.json(shift); - } - catch (err) { - next(err); - } -}); -// POST /api/map/shifts — create -adminRouter.post('/', (0, validate_1.validate)(shifts_schemas_1.createShiftSchema), async (req, res, next) => { - try { - const shift = await shifts_service_1.shiftsService.create(req.body, req.user.id); - res.status(201).json(shift); - } - catch (err) { - next(err); - } -}); -// PUT /api/map/shifts/:id — update -adminRouter.put('/:id', (0, validate_1.validate)(shifts_schemas_1.updateShiftSchema), async (req, res, next) => { - try { - const id = req.params.id; - const shift = await shifts_service_1.shiftsService.update(id, req.body); - res.json(shift); - } - catch (err) { - next(err); - } -}); -// DELETE /api/map/shifts/:id — delete -adminRouter.delete('/:id', async (req, res, next) => { - try { - const id = req.params.id; - await shifts_service_1.shiftsService.delete(id); - res.status(204).send(); - } - catch (err) { - next(err); - } -}); -// POST /api/map/shifts/:id/signups — admin add volunteer -adminRouter.post('/:id/signups', (0, validate_1.validate)(shifts_schemas_1.addSignupSchema), async (req, res, next) => { - try { - const id = req.params.id; - const signup = await shifts_service_1.shiftsService.addSignup(id, req.body); - res.status(201).json(signup); - } - catch (err) { - next(err); - } -}); -// DELETE /api/map/shifts/:id/signups/:signupId — admin remove volunteer -adminRouter.delete('/:id/signups/:signupId', async (req, res, next) => { - try { - const signupId = req.params.signupId; - await shifts_service_1.shiftsService.removeSignup(signupId); - res.status(204).send(); - } - catch (err) { - next(err); - } -}); -// POST /api/map/shifts/:id/meeting — create and link a video briefing meeting -adminRouter.post('/:id/meeting', async (req, res, next) => { - try { - const id = req.params.id; - const meeting = await shifts_service_1.shiftsService.createMeetingForShift(id, req.user.id); - res.status(201).json(meeting); - } - catch (err) { - next(err); - } -}); -// DELETE /api/map/shifts/:id/meeting — remove video briefing from shift -adminRouter.delete('/:id/meeting', async (req, res, next) => { - try { - const id = req.params.id; - await shifts_service_1.shiftsService.removeMeetingFromShift(id); - res.status(204).send(); - } - catch (err) { - next(err); - } -}); -// POST /api/map/shifts/:id/email-details — email all volunteers -adminRouter.post('/:id/email-details', async (req, res, next) => { - try { - const id = req.params.id; - const result = await shifts_service_1.shiftsService.emailShiftDetails(id); - res.json(result); - } - catch (err) { - next(err); - } -}); -// --- Volunteer Router --- -const volunteerRouter = (0, express_1.Router)(); -exports.shiftsVolunteerRouter = volunteerRouter; -volunteerRouter.use(auth_middleware_1.authenticate); -// GET /api/map/shifts/volunteer/upcoming — upcoming shifts with signup status -volunteerRouter.get('/volunteer/upcoming', async (req, res, next) => { - try { - const shifts = await shifts_service_1.shiftsService.getUpcomingForVolunteer(req.user.id); - res.json(shifts); - } - catch (err) { - next(err); - } -}); -// GET /api/map/shifts/volunteer/my-signups — own confirmed signups -volunteerRouter.get('/volunteer/my-signups', async (req, res, next) => { - try { - const signups = await shifts_service_1.shiftsService.getMySignups(req.user.id); - res.json(signups); - } - catch (err) { - next(err); - } -}); -// POST /api/map/shifts/volunteer/:id/signup — sign up for shift -volunteerRouter.post('/volunteer/:id/signup', rate_limit_1.shiftSignupRateLimit, async (req, res, next) => { - try { - const id = req.params.id; - const signup = await shifts_service_1.shiftsService.volunteerSignup(id, req.user.id); - res.status(201).json(signup); - } - catch (err) { - next(err); - } -}); -// DELETE /api/map/shifts/volunteer/:id/signup — cancel own signup -volunteerRouter.delete('/volunteer/:id/signup', async (req, res, next) => { - try { - const id = req.params.id; - await shifts_service_1.shiftsService.cancelVolunteerSignup(id, req.user.id); - res.status(204).send(); - } - catch (err) { - next(err); - } -}); -// --- Public Router --- -const publicRouter = (0, express_1.Router)(); -exports.shiftsPublicRouter = publicRouter; -// GET /api/map/shifts/public — list upcoming public shifts -publicRouter.get('/public', async (_req, res, next) => { - try { - const shifts = await shifts_service_1.shiftsService.getPublicShifts(); - res.json(shifts); - } - catch (err) { - next(err); - } -}); -// POST /api/map/shifts/public/:id/signup — public signup -publicRouter.post('/public/:id/signup', rate_limit_1.shiftSignupRateLimit, (0, validate_1.validate)(shifts_schemas_1.publicSignupSchema), async (req, res, next) => { - try { - const id = req.params.id; - const result = await shifts_service_1.shiftsService.publicSignup(id, req.body); - res.status(201).json(result); - } - catch (err) { - next(err); - } -}); -// GET /api/map/shifts/public/related — related active campaigns -publicRouter.get('/public/related', async (_req, res, next) => { - try { - const cacheKey = 'shifts:related:campaigns'; - try { - const cached = await redis_1.redis.get(cacheKey); - if (cached) { - res.json(JSON.parse(cached)); - return; - } - } - catch { /* cache miss */ } - const campaigns = await database_1.prisma.campaign.findMany({ - where: { status: 'ACTIVE' }, - select: { - id: true, - slug: true, - title: true, - description: true, - _count: { select: { emails: true } }, - }, - orderBy: { createdAt: 'desc' }, - take: 3, - }); - const result = { - campaigns: campaigns.map(c => ({ - id: c.id, - slug: c.slug, - title: c.title, - description: c.description?.slice(0, 150) ?? null, - emailCount: c._count.emails, - })), - }; - try { - await redis_1.redis.setex(cacheKey, 300, JSON.stringify(result)); - } - catch { /* non-critical */ } - res.json(result); - } - catch (err) { - next(err); - } -}); -//# sourceMappingURL=shifts.routes.js.map \ No newline at end of file diff --git a/api/dist/modules/map/shifts/shifts.routes.js.map b/api/dist/modules/map/shifts/shifts.routes.js.map deleted file mode 100644 index 3a89dd5c..00000000 --- a/api/dist/modules/map/shifts/shifts.routes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"shifts.routes.js","sourceRoot":"","sources":["../../../../src/modules/map/shifts/shifts.routes.ts"],"names":[],"mappings":";;;AAAA,qCAAkE;AAClE,qDAAiD;AACjD,qDAM0B;AAC1B,2DAAwD;AACxD,yEAAmE;AACnE,yEAAkE;AAClE,+DAAsE;AACtE,uDAAkD;AAClD,iDAA8C;AAC9C,gDAAwD;AAExD,uBAAuB;AACvB,MAAM,WAAW,GAAG,IAAA,gBAAM,GAAE,CAAC;AA4TL,wCAAiB;AA3TzC,WAAW,CAAC,GAAG,CAAC,8BAAY,CAAC,CAAC;AAC9B,WA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CAAC,MAAM,CAAC,CAAC;IACnB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,GAAG,CAAC,CAAC;IACZ,CAAC;AACH,CAAC,CACF,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/shifts/shifts.schemas.d.ts b/api/dist/modules/map/shifts/shifts.schemas.d.ts deleted file mode 100644 index 7a159c3d..00000000 --- a/api/dist/modules/map/shifts/shifts.schemas.d.ts +++ /dev/null @@ -1,128 +0,0 @@ -import { z } from 'zod'; -export declare const createShiftSchema: z.ZodObject<{ - title: z.ZodString; - description: z.ZodOptional; - date: z.ZodString; - startTime: z.ZodString; - endTime: z.ZodString; - location: z.ZodOptional; - maxVolunteers: z.ZodNumber; - isPublic: z.ZodDefault>; - cutId: z.ZodOptional; -}, "strip", z.ZodTypeAny, { - date: string; - title: string; - isPublic: boolean; - startTime: string; - endTime: string; - maxVolunteers: number; - location?: string | undefined; - description?: string | undefined; - cutId?: string | undefined; -}, { - date: string; - title: string; - startTime: string; - endTime: string; - maxVolunteers: number; - location?: string | undefined; - description?: string | undefined; - isPublic?: boolean | undefined; - cutId?: string | undefined; -}>; -export declare const updateShiftSchema: z.ZodObject<{ - title: z.ZodOptional; - description: z.ZodOptional>; - date: z.ZodOptional; - startTime: z.ZodOptional; - endTime: z.ZodOptional; - location: z.ZodOptional>; - maxVolunteers: z.ZodOptional; - isPublic: z.ZodOptional; - status: z.ZodOptional>; - cutId: z.ZodOptional>; -}, "strip", z.ZodTypeAny, { - status?: "CANCELLED" | "OPEN" | "FULL" | undefined; - date?: string | undefined; - location?: string | null | undefined; - title?: string | undefined; - description?: string | null | undefined; - isPublic?: boolean | undefined; - cutId?: string | null | undefined; - startTime?: string | undefined; - endTime?: string | undefined; - maxVolunteers?: number | undefined; -}, { - status?: "CANCELLED" | "OPEN" | "FULL" | undefined; - date?: string | undefined; - location?: string | null | undefined; - title?: string | undefined; - description?: string | null | undefined; - isPublic?: boolean | undefined; - cutId?: string | null | undefined; - startTime?: string | undefined; - endTime?: string | undefined; - maxVolunteers?: number | undefined; -}>; -export declare const listShiftsSchema: z.ZodObject<{ - page: z.ZodDefault; - limit: z.ZodDefault; - search: z.ZodOptional; - status: z.ZodOptional>; - upcoming: z.ZodOptional; - sortBy: z.ZodDefault>>; - sortOrder: z.ZodDefault>>; -}, "strip", z.ZodTypeAny, { - limit: number; - page: number; - sortBy: "date" | "createdAt" | "title"; - sortOrder: "asc" | "desc"; - status?: "CANCELLED" | "OPEN" | "FULL" | undefined; - search?: string | undefined; - upcoming?: boolean | undefined; -}, { - status?: "CANCELLED" | "OPEN" | "FULL" | undefined; - search?: string | undefined; - limit?: number | undefined; - page?: number | undefined; - sortBy?: "date" | "createdAt" | "title" | undefined; - sortOrder?: "asc" | "desc" | undefined; - upcoming?: boolean | undefined; -}>; -export declare const addSignupSchema: z.ZodObject<{ - userEmail: z.ZodString; - userName: z.ZodOptional; -}, "strip", z.ZodTypeAny, { - userEmail: string; - userName?: string | undefined; -}, { - userEmail: string; - userName?: string | undefined; -}>; -export declare const publicSignupSchema: z.ZodObject<{ - email: z.ZodString; - name: z.ZodString; - phone: z.ZodOptional; -}, "strip", z.ZodTypeAny, { - email: string; - name: string; - phone?: string | undefined; -}, { - email: string; - name: string; - phone?: string | undefined; -}>; -export type CreateShiftInput = z.infer; -export type UpdateShiftInput = z.infer; -export type ListShiftsInput = z.infer; -export type AddSignupInput = z.infer; -export type PublicSignupInput = z.infer; -//# sourceMappingURL=shifts.schemas.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/map/shifts/shifts.schemas.d.ts.map b/api/dist/modules/map/shifts/shifts.schemas.d.ts.map deleted file mode 100644 index 93ce3a6b..00000000 --- a/api/dist/modules/map/shifts/shifts.schemas.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"shifts.schemas.d.ts","sourceRoot":"","sources":["../../../../src/modules/map/shifts/shifts.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAU5B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAW5B,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQ3B,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;EAG1B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;EAI7B,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AACjE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AACjE,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC/D,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAC7D,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/shifts/shifts.schemas.js b/api/dist/modules/map/shifts/shifts.schemas.js deleted file mode 100644 index d484a654..00000000 --- a/api/dist/modules/map/shifts/shifts.schemas.js +++ /dev/null @@ -1,47 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.publicSignupSchema = exports.addSignupSchema = exports.listShiftsSchema = exports.updateShiftSchema = exports.createShiftSchema = void 0; -const zod_1 = require("zod"); -const client_1 = require("@prisma/client"); -exports.createShiftSchema = zod_1.z.object({ - title: zod_1.z.string().min(1, 'Title is required'), - description: zod_1.z.string().optional(), - date: zod_1.z.string().regex(/^\d{4}-\d{2}-\d{2}$/, 'Date must be YYYY-MM-DD'), - startTime: zod_1.z.string().regex(/^\d{2}:\d{2}$/, 'Start time must be HH:MM'), - endTime: zod_1.z.string().regex(/^\d{2}:\d{2}$/, 'End time must be HH:MM'), - location: zod_1.z.string().optional(), - maxVolunteers: zod_1.z.number().int().min(1, 'Must have at least 1 volunteer spot'), - isPublic: zod_1.z.boolean().optional().default(false), - cutId: zod_1.z.string().optional(), -}); -exports.updateShiftSchema = zod_1.z.object({ - title: zod_1.z.string().min(1).optional(), - description: zod_1.z.string().nullable().optional(), - date: zod_1.z.string().regex(/^\d{4}-\d{2}-\d{2}$/, 'Date must be YYYY-MM-DD').optional(), - startTime: zod_1.z.string().regex(/^\d{2}:\d{2}$/, 'Start time must be HH:MM').optional(), - endTime: zod_1.z.string().regex(/^\d{2}:\d{2}$/, 'End time must be HH:MM').optional(), - location: zod_1.z.string().nullable().optional(), - maxVolunteers: zod_1.z.number().int().min(1).optional(), - isPublic: zod_1.z.boolean().optional(), - status: zod_1.z.nativeEnum(client_1.ShiftStatus).optional(), - cutId: zod_1.z.string().nullable().optional(), -}); -exports.listShiftsSchema = zod_1.z.object({ - page: zod_1.z.coerce.number().int().positive().default(1), - limit: zod_1.z.coerce.number().int().positive().max(100).default(20), - search: zod_1.z.string().optional(), - status: zod_1.z.nativeEnum(client_1.ShiftStatus).optional(), - upcoming: zod_1.z.coerce.boolean().optional(), - sortBy: zod_1.z.enum(['date', 'createdAt', 'title']).optional().default('date'), - sortOrder: zod_1.z.enum(['asc', 'desc']).optional().default('desc'), -}); -exports.addSignupSchema = zod_1.z.object({ - userEmail: zod_1.z.string().email('Valid email is required'), - userName: zod_1.z.string().optional(), -}); -exports.publicSignupSchema = zod_1.z.object({ - email: zod_1.z.string().email('Valid email is required'), - name: zod_1.z.string().min(1, 'Name is required'), - phone: zod_1.z.string().optional(), -}); -//# sourceMappingURL=shifts.schemas.js.map \ No newline at end of file diff --git a/api/dist/modules/map/shifts/shifts.schemas.js.map b/api/dist/modules/map/shifts/shifts.schemas.js.map deleted file mode 100644 index 4501ac67..00000000 --- a/api/dist/modules/map/shifts/shifts.schemas.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"shifts.schemas.js","sourceRoot":"","sources":["../../../../src/modules/map/shifts/shifts.schemas.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,2CAA6C;AAEhC,QAAA,iBAAiB,GAAG,OAAC,CAAC,MAAM,CAAC;IACxC,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,mBAAmB,CAAC;IAC7C,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAClC,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,qBAAqB,EAAE,yBAAyB,CAAC;IACxE,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,eAAe,EAAE,0BAA0B,CAAC;IACxE,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,eAAe,EAAE,wBAAwB,CAAC;IACpE,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,aAAa,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,qCAAqC,CAAC;IAC7E,QAAQ,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC;IAC/C,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC7B,CAAC,CAAC;AAEU,QAAA,iBAAiB,GAAG,OAAC,CAAC,MAAM,CAAC;IACxC,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACnC,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IAC7C,IAAI,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,MAAM,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACvC,MAAM,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC;IACzE,SAAS,EAAE,OAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC;CAC9D,CAAC,CAAC;AAEU,QAAA,eAAe,GAAG,OAAC,CAAC,MAAM,CAAC;IACtC,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,yBAAyB,CAAC;IACtD,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAChC,CAAC,CAAC;AAEU,QAAA,kBAAkB,GAAG,OAAC,CAAC,MAAM,CAAC;IACzC,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,yBAAyB,CAAC;IAClD,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,kBAAkB,CAAC;IAC3C,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAC7B,CAAC,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/shifts/shifts.service.d.ts b/api/dist/modules/map/shifts/shifts.service.d.ts deleted file mode 100644 index 2d75bfd1..00000000 --- a/api/dist/modules/map/shifts/shifts.service.d.ts +++ /dev/null @@ -1,304 +0,0 @@ -import type { CreateShiftInput, UpdateShiftInput, ListShiftsInput, AddSignupInput, PublicSignupInput } from './shifts.schemas'; -export declare const shiftsService: { - findAll(filters: ListShiftsInput): Promise<{ - shifts: ({ - _count: { - signups: number; - }; - cut: { - id: string; - name: string; - } | null; - meeting: { - id: string; - title: string; - isActive: boolean; - slug: string; - jitsiRoom: string; - } | null; - } & { - status: import(".prisma/client").$Enums.ShiftStatus; - date: Date; - id: string; - createdAt: Date; - updatedAt: Date; - location: string | null; - title: string; - description: string | null; - createdBy: string | null; - isPublic: boolean; - cutId: string | null; - startTime: string; - endTime: string; - gancioEventId: number | null; - meetingId: string | null; - seriesId: string | null; - isException: boolean; - maxVolunteers: number; - currentVolunteers: number; - })[]; - pagination: { - page: number; - limit: number; - total: number; - totalPages: number; - }; - }>; - findById(id: string): Promise<{ - _count: { - signups: number; - }; - cut: { - id: string; - name: string; - } | null; - meeting: { - id: string; - title: string; - isActive: boolean; - slug: string; - jitsiRoom: string; - } | null; - signups: ({ - user: { - id: string; - email: string; - name: string | null; - phone: string | null; - } | null; - } & { - status: import(".prisma/client").$Enums.SignupStatus; - id: string; - userId: string | null; - userEmail: string; - shiftId: string; - userName: string | null; - shiftTitle: string | null; - userPhone: string | null; - signupDate: Date; - signupSource: import(".prisma/client").$Enums.SignupSource; - })[]; - } & { - status: import(".prisma/client").$Enums.ShiftStatus; - date: Date; - id: string; - createdAt: Date; - updatedAt: Date; - location: string | null; - title: string; - description: string | null; - createdBy: string | null; - isPublic: boolean; - cutId: string | null; - startTime: string; - endTime: string; - gancioEventId: number | null; - meetingId: string | null; - seriesId: string | null; - isException: boolean; - maxVolunteers: number; - currentVolunteers: number; - }>; - create(data: CreateShiftInput, userId: string): Promise<{ - status: import(".prisma/client").$Enums.ShiftStatus; - date: Date; - id: string; - createdAt: Date; - updatedAt: Date; - location: string | null; - title: string; - description: string | null; - createdBy: string | null; - isPublic: boolean; - cutId: string | null; - startTime: string; - endTime: string; - gancioEventId: number | null; - meetingId: string | null; - seriesId: string | null; - isException: boolean; - maxVolunteers: number; - currentVolunteers: number; - }>; - update(id: string, data: UpdateShiftInput): Promise<{ - status: import(".prisma/client").$Enums.ShiftStatus; - date: Date; - id: string; - createdAt: Date; - updatedAt: Date; - location: string | null; - title: string; - description: string | null; - createdBy: string | null; - isPublic: boolean; - cutId: string | null; - startTime: string; - endTime: string; - gancioEventId: number | null; - meetingId: string | null; - seriesId: string | null; - isException: boolean; - maxVolunteers: number; - currentVolunteers: number; - }>; - delete(id: string): Promise; - createMeetingForShift(shiftId: string, userId: string): Promise<{ - id: string; - createdAt: Date; - updatedAt: Date; - title: string; - isActive: boolean; - description: string | null; - slug: string; - createdByUserId: string; - jitsiRoom: string; - startTime: Date | null; - endTime: Date | null; - }>; - removeMeetingFromShift(shiftId: string): Promise; - getStats(): Promise<{ - total: number; - open: number; - full: number; - cancelled: number; - upcoming: number; - totalSignups: number; - }>; - getSignups(shiftId: string): Promise<({ - user: { - id: string; - email: string; - name: string | null; - phone: string | null; - } | null; - } & { - status: import(".prisma/client").$Enums.SignupStatus; - id: string; - userId: string | null; - userEmail: string; - shiftId: string; - userName: string | null; - shiftTitle: string | null; - userPhone: string | null; - signupDate: Date; - signupSource: import(".prisma/client").$Enums.SignupSource; - })[]>; - addSignup(shiftId: string, data: AddSignupInput): Promise<{ - status: import(".prisma/client").$Enums.SignupStatus; - id: string; - userId: string | null; - userEmail: string; - shiftId: string; - userName: string | null; - shiftTitle: string | null; - userPhone: string | null; - signupDate: Date; - signupSource: import(".prisma/client").$Enums.SignupSource; - }>; - removeSignup(signupId: string): Promise; - publicSignup(shiftId: string, data: PublicSignupInput): Promise<{ - signup: { - status: import(".prisma/client").$Enums.SignupStatus; - id: string; - userId: string | null; - userEmail: string; - shiftId: string; - userName: string | null; - shiftTitle: string | null; - userPhone: string | null; - signupDate: Date; - signupSource: import(".prisma/client").$Enums.SignupSource; - }; - isNewUser: boolean; - }>; - cancelPublicSignup(shiftId: string, userEmail: string): Promise; - getUpcomingForVolunteer(userId: string): Promise<{ - isSignedUp: boolean; - status: import(".prisma/client").$Enums.ShiftStatus; - date: Date; - id: string; - location: string | null; - title: string; - description: string | null; - meeting: { - id: string; - isActive: boolean; - slug: string; - } | null; - startTime: string; - endTime: string; - maxVolunteers: number; - currentVolunteers: number; - }[]>; - volunteerSignup(shiftId: string, userId: string): Promise<{ - status: import(".prisma/client").$Enums.SignupStatus; - id: string; - userId: string | null; - userEmail: string; - shiftId: string; - userName: string | null; - shiftTitle: string | null; - userPhone: string | null; - signupDate: Date; - signupSource: import(".prisma/client").$Enums.SignupSource; - }>; - cancelVolunteerSignup(shiftId: string, userId: string): Promise; - getMySignups(userId: string): Promise<({ - shift: { - status: import(".prisma/client").$Enums.ShiftStatus; - date: Date; - id: string; - location: string | null; - title: string; - description: string | null; - meeting: { - id: string; - isActive: boolean; - slug: string; - } | null; - startTime: string; - endTime: string; - maxVolunteers: number; - currentVolunteers: number; - }; - } & { - status: import(".prisma/client").$Enums.SignupStatus; - id: string; - userId: string | null; - userEmail: string; - shiftId: string; - userName: string | null; - shiftTitle: string | null; - userPhone: string | null; - signupDate: Date; - signupSource: import(".prisma/client").$Enums.SignupSource; - })[]>; - getPublicShifts(): Promise<{ - status: import(".prisma/client").$Enums.ShiftStatus; - date: Date; - id: string; - location: string | null; - title: string; - description: string | null; - meeting: { - id: string; - isActive: boolean; - slug: string; - } | null; - startTime: string; - endTime: string; - maxVolunteers: number; - currentVolunteers: number; - }[]>; - emailShiftDetails(shiftId: string): Promise<{ - sent: number; - failed: number; - }>; - getCalendarData(startDate: string, endDate: string): Promise<{ - dates: Record; - }>; -}; -//# sourceMappingURL=shifts.service.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/map/shifts/shifts.service.d.ts.map b/api/dist/modules/map/shifts/shifts.service.d.ts.map deleted file mode 100644 index 6e24ddf0..00000000 --- a/api/dist/modules/map/shifts/shifts.service.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"shifts.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/map/shifts/shifts.service.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EACV,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,iBAAiB,EAClB,MAAM,kBAAkB,CAAC;AAoB1B,eAAO,MAAM,aAAa;qBACD,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAwDnB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0BN,gBAAgB,UAAU,MAAM;;;;;;;;;;;;;;;;;;;;;eA2ClC,MAAM,QAAQ,gBAAgB;;;;;;;;;;;;;;;;;;;;;eA8C9B,MAAM;mCAwBc,MAAM,UAAU,MAAM;;;;;;;;;;;;;oCAyBrB,MAAM;;;;;;;;;wBA4BlB,MAAM;;;;;;;;;;;;;;;;;;;uBAaP,MAAM,QAAQ,cAAc;;;;;;;;;;;;2BA2ExB,MAAM;0BA4BP,MAAM,QAAQ,iBAAiB;;;;;;;;;;;;;;;gCAuQzB,MAAM,aAAa,MAAM;oCAuGrB,MAAM;;;;;;;;;;;;;;;;;;6BA4Cb,MAAM,UAAU,MAAM;;;;;;;;;;;;mCAsLhB,MAAM,UAAU,MAAM;yBAqGhC,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+BA8DA,MAAM;;;;+BAuDN,MAAM,WAAW,MAAM;;mBAiBf,MAAM;oBAAU,GAAG,EAAE;;;CAe/D,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/shifts/shifts.service.js b/api/dist/modules/map/shifts/shifts.service.js deleted file mode 100644 index fffbac39..00000000 --- a/api/dist/modules/map/shifts/shifts.service.js +++ /dev/null @@ -1,1141 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.shiftsService = void 0; -const bcryptjs_1 = __importDefault(require("bcryptjs")); -const client_1 = require("@prisma/client"); -const database_1 = require("../../../config/database"); -const error_handler_1 = require("../../../middleware/error-handler"); -const email_service_1 = require("../../../services/email.service"); -const notification_queue_service_1 = require("../../../services/notification-queue.service"); -const notification_helper_1 = require("../../../services/notification.helper"); -const env_1 = require("../../../config/env"); -const logger_1 = require("../../../utils/logger"); -const metrics_1 = require("../../../utils/metrics"); -const rocketchat_webhook_service_1 = require("../../../services/rocketchat-webhook.service"); -const listmonk_event_sync_service_1 = require("../../../services/listmonk-event-sync.service"); -const gancio_client_1 = require("../../../services/gancio.client"); -const unified_calendar_service_1 = require("../../events/unified-calendar.service"); -const group_service_1 = require("../../social/group.service"); -const achievements_service_1 = require("../../social/achievements.service"); -const slug_1 = require("../../../utils/slug"); -const settings_service_1 = require("../../settings/settings.service"); -const sms_notification_service_1 = require("../../../services/sms-notification.service"); -const crypto_1 = __importDefault(require("crypto")); -const adjectives = ['Blue', 'Red', 'Green', 'Swift', 'Bright', 'Bold', 'Calm', 'Fair']; -const nouns = ['Eagle', 'River', 'Mountain', 'Star', 'Forest', 'Lake', 'Wolf', 'Hawk']; -function generateReadablePassword() { - const adj = adjectives[Math.floor(Math.random() * adjectives.length)]; - const noun = nouns[Math.floor(Math.random() * nouns.length)]; - const num = Math.floor(Math.random() * 90) + 10; - return `${adj}${noun}${num}`; -} -const meetingSelect = { - id: true, - slug: true, - title: true, - isActive: true, - jitsiRoom: true, -}; -exports.shiftsService = { - async findAll(filters) { - const { page, limit, search, status, upcoming, sortBy, sortOrder } = filters; - const skip = (page - 1) * limit; - const where = {}; - if (search) { - where.OR = [ - { title: { contains: search, mode: 'insensitive' } }, - { location: { contains: search, mode: 'insensitive' } }, - ]; - } - if (status) - where.status = status; - if (upcoming) { - where.date = { gte: new Date() }; - } - const orderBy = sortBy === 'title' - ? { title: sortOrder } - : sortBy === 'createdAt' - ? { createdAt: sortOrder } - : { date: sortOrder }; - const [shifts, total] = await Promise.all([ - database_1.prisma.shift.findMany({ - where, - skip, - take: limit, - orderBy, - include: { - cut: { select: { id: true, name: true } }, - meeting: { select: meetingSelect }, - _count: { - select: { - signups: { where: { status: client_1.SignupStatus.CONFIRMED } }, - }, - }, - }, - }), - database_1.prisma.shift.count({ where }), - ]); - return { - shifts, - pagination: { - page, - limit, - total, - totalPages: Math.ceil(total / limit), - }, - }; - }, - async findById(id) { - const shift = await database_1.prisma.shift.findUnique({ - where: { id }, - include: { - cut: { select: { id: true, name: true } }, - meeting: { select: meetingSelect }, - signups: { - where: { status: client_1.SignupStatus.CONFIRMED }, - include: { user: { select: { id: true, email: true, name: true, phone: true } } }, - orderBy: { signupDate: 'desc' }, - }, - _count: { - select: { - signups: { where: { status: client_1.SignupStatus.CONFIRMED } }, - }, - }, - }, - }); - if (!shift) { - throw new error_handler_1.AppError(404, 'Shift not found', 'SHIFT_NOT_FOUND'); - } - return shift; - }, - async create(data, userId) { - const shift = await database_1.prisma.shift.create({ - data: { - title: data.title, - description: data.description, - date: new Date(data.date), - startTime: data.startTime, - endTime: data.endTime, - location: data.location, - maxVolunteers: data.maxVolunteers, - isPublic: data.isPublic, - cutId: data.cutId, - createdBy: userId, - }, - }); - // Gancio event sync (fire-and-forget) - if (gancio_client_1.gancioClient.enabled) { - gancio_client_1.gancioClient.createEvent({ - title: shift.title, - description: shift.description, - location: shift.location, - date: shift.date, - startTime: shift.startTime, - endTime: shift.endTime, - }).then(async (eventId) => { - if (eventId) { - await database_1.prisma.shift.update({ - where: { id: shift.id }, - data: { gancioEventId: eventId }, - }); - } - }).catch((err) => { - logger_1.logger.warn('Gancio sync on shift create failed:', err); - }); - } - // Bust unified calendar cache - unified_calendar_service_1.unifiedCalendarService.bustCache().catch(() => { }); - return shift; - }, - async update(id, data) { - const existing = await database_1.prisma.shift.findUnique({ where: { id } }); - if (!existing) { - throw new error_handler_1.AppError(404, 'Shift not found', 'SHIFT_NOT_FOUND'); - } - const updateData = { ...data }; - if (data.date) { - updateData.date = new Date(data.date); - } - // Auto-update status when capacity changes - if (data.maxVolunteers !== undefined) { - if (existing.currentVolunteers >= data.maxVolunteers && existing.status === client_1.ShiftStatus.OPEN) { - updateData.status = client_1.ShiftStatus.FULL; - } - else if (existing.currentVolunteers < data.maxVolunteers && existing.status === client_1.ShiftStatus.FULL) { - updateData.status = client_1.ShiftStatus.OPEN; - } - } - const shift = await database_1.prisma.shift.update({ - where: { id }, - data: updateData, - }); - // Gancio event sync (fire-and-forget) - if (gancio_client_1.gancioClient.enabled && shift.gancioEventId) { - gancio_client_1.gancioClient.updateEvent(shift.gancioEventId, { - title: shift.title, - description: shift.description, - location: shift.location, - date: shift.date, - startTime: shift.startTime, - endTime: shift.endTime, - }).catch((err) => { - logger_1.logger.warn('Gancio sync on shift update failed:', err); - }); - } - // Bust unified calendar cache - unified_calendar_service_1.unifiedCalendarService.bustCache().catch(() => { }); - return shift; - }, - async delete(id) { - const existing = await database_1.prisma.shift.findUnique({ where: { id } }); - if (!existing) { - throw new error_handler_1.AppError(404, 'Shift not found', 'SHIFT_NOT_FOUND'); - } - // Delete Gancio event before deleting shift (fire-and-forget) - if (gancio_client_1.gancioClient.enabled && existing.gancioEventId) { - gancio_client_1.gancioClient.deleteEvent(existing.gancioEventId).catch((err) => { - logger_1.logger.warn('Gancio sync on shift delete failed:', err); - }); - } - // Delete associated meeting if exists - if (existing.meetingId) { - await database_1.prisma.meeting.delete({ where: { id: existing.meetingId } }).catch(() => { }); - } - await database_1.prisma.shift.delete({ where: { id } }); - // Bust unified calendar cache - unified_calendar_service_1.unifiedCalendarService.bustCache().catch(() => { }); - }, - async createMeetingForShift(shiftId, userId) { - const shift = await database_1.prisma.shift.findUnique({ where: { id: shiftId } }); - if (!shift) - throw new error_handler_1.AppError(404, 'Shift not found', 'SHIFT_NOT_FOUND'); - if (shift.meetingId) - throw new error_handler_1.AppError(400, 'Shift already has a meeting', 'MEETING_EXISTS'); - const settings = await settings_service_1.siteSettingsService.get(); - if (!settings.enableMeet) - throw new error_handler_1.AppError(400, 'Video meetings are not enabled', 'MEET_DISABLED'); - const meeting = await database_1.prisma.meeting.create({ - data: { - slug: (0, slug_1.generateSlug)(shift.title), - title: `${shift.title} — Video Briefing`, - jitsiRoom: crypto_1.default.randomUUID(), - createdByUserId: userId, - }, - }); - await database_1.prisma.shift.update({ - where: { id: shiftId }, - data: { meetingId: meeting.id }, - }); - return meeting; - }, - async removeMeetingFromShift(shiftId) { - const shift = await database_1.prisma.shift.findUnique({ where: { id: shiftId } }); - if (!shift) - throw new error_handler_1.AppError(404, 'Shift not found', 'SHIFT_NOT_FOUND'); - if (!shift.meetingId) - throw new error_handler_1.AppError(400, 'Shift has no meeting', 'NO_MEETING'); - const meetingId = shift.meetingId; - await database_1.prisma.shift.update({ - where: { id: shiftId }, - data: { meetingId: null }, - }); - // Delete the meeting record - await database_1.prisma.meeting.delete({ where: { id: meetingId } }).catch(() => { }); - }, - async getStats() { - const [total, open, full, cancelled, upcoming, totalSignups] = await Promise.all([ - database_1.prisma.shift.count(), - database_1.prisma.shift.count({ where: { status: client_1.ShiftStatus.OPEN } }), - database_1.prisma.shift.count({ where: { status: client_1.ShiftStatus.FULL } }), - database_1.prisma.shift.count({ where: { status: client_1.ShiftStatus.CANCELLED } }), - database_1.prisma.shift.count({ where: { date: { gte: new Date() }, status: { not: client_1.ShiftStatus.CANCELLED } } }), - database_1.prisma.shiftSignup.count({ where: { status: client_1.SignupStatus.CONFIRMED } }), - ]); - return { total, open, full, cancelled, upcoming, totalSignups }; - }, - async getSignups(shiftId) { - const shift = await database_1.prisma.shift.findUnique({ where: { id: shiftId } }); - if (!shift) { - throw new error_handler_1.AppError(404, 'Shift not found', 'SHIFT_NOT_FOUND'); - } - return database_1.prisma.shiftSignup.findMany({ - where: { shiftId }, - include: { user: { select: { id: true, email: true, name: true, phone: true } } }, - orderBy: { signupDate: 'desc' }, - }); - }, - async addSignup(shiftId, data) { - const shift = await database_1.prisma.shift.findUnique({ where: { id: shiftId } }); - if (!shift) { - throw new error_handler_1.AppError(404, 'Shift not found', 'SHIFT_NOT_FOUND'); - } - if (shift.currentVolunteers >= shift.maxVolunteers) { - throw new error_handler_1.AppError(400, 'Shift is full', 'SHIFT_FULL'); - } - // Check unique constraint - const existing = await database_1.prisma.shiftSignup.findUnique({ - where: { shiftId_userEmail: { shiftId, userEmail: data.userEmail } }, - }); - if (existing) { - if (existing.status === client_1.SignupStatus.CANCELLED) { - // Re-activate cancelled signup - const [signup] = await database_1.prisma.$transaction([ - database_1.prisma.shiftSignup.update({ - where: { id: existing.id }, - data: { status: client_1.SignupStatus.CONFIRMED, signupSource: client_1.SignupSource.ADMIN }, - }), - database_1.prisma.shift.update({ - where: { id: shiftId }, - data: { - currentVolunteers: { increment: 1 }, - status: shift.currentVolunteers + 1 >= shift.maxVolunteers ? client_1.ShiftStatus.FULL : undefined, - }, - }), - ]); - return signup; - } - throw new error_handler_1.AppError(409, 'Volunteer already signed up', 'DUPLICATE_SIGNUP'); - } - // Look up user - const user = await database_1.prisma.user.findUnique({ where: { email: data.userEmail } }); - const [signup] = await database_1.prisma.$transaction([ - database_1.prisma.shiftSignup.create({ - data: { - shiftId, - shiftTitle: shift.title, - userId: user?.id, - userEmail: data.userEmail, - userName: data.userName || user?.name, - signupSource: client_1.SignupSource.ADMIN, - }, - }), - database_1.prisma.shift.update({ - where: { id: shiftId }, - data: { - currentVolunteers: { increment: 1 }, - status: shift.currentVolunteers + 1 >= shift.maxVolunteers ? client_1.ShiftStatus.FULL : undefined, - }, - }), - ]); - // Listmonk event sync - listmonk_event_sync_service_1.listmonkEventSyncService.onShiftSignup({ - email: data.userEmail, - name: data.userName || data.userEmail, - shiftTitle: shift.title, - shiftDate: new Date(shift.date).toISOString().split('T')[0], - }).catch(() => { }); - // Social group sync (fire-and-forget) - group_service_1.groupService.syncShiftTeam(shiftId).catch(() => { }); - // Achievement check (fire-and-forget) - if (user?.id) - achievements_service_1.achievementsService.checkAndUnlock(user.id, ['shifts']).catch(() => { }); - return signup; - }, - async removeSignup(signupId) { - const signup = await database_1.prisma.shiftSignup.findUnique({ where: { id: signupId } }); - if (!signup) { - throw new error_handler_1.AppError(404, 'Signup not found', 'SIGNUP_NOT_FOUND'); - } - if (signup.status === client_1.SignupStatus.CANCELLED) { - throw new error_handler_1.AppError(400, 'Signup already cancelled', 'ALREADY_CANCELLED'); - } - await database_1.prisma.$transaction([ - database_1.prisma.shiftSignup.update({ - where: { id: signupId }, - data: { status: client_1.SignupStatus.CANCELLED }, - }), - database_1.prisma.shift.update({ - where: { id: signup.shiftId }, - data: { - currentVolunteers: { decrement: 1 }, - status: client_1.ShiftStatus.OPEN, - }, - }), - ]); - // Social group sync (fire-and-forget) - group_service_1.groupService.syncShiftTeam(signup.shiftId).catch(() => { }); - }, - async publicSignup(shiftId, data) { - const shift = await database_1.prisma.shift.findUnique({ where: { id: shiftId } }); - if (!shift) { - throw new error_handler_1.AppError(404, 'Shift not found', 'SHIFT_NOT_FOUND'); - } - if (!shift.isPublic) { - throw new error_handler_1.AppError(403, 'This shift is not open for public signup', 'NOT_PUBLIC'); - } - if (shift.status !== client_1.ShiftStatus.OPEN) { - throw new error_handler_1.AppError(400, 'This shift is not accepting signups', 'NOT_OPEN'); - } - if (shift.date < new Date(new Date().toISOString().split('T')[0])) { - throw new error_handler_1.AppError(400, 'This shift has already passed', 'SHIFT_PAST'); - } - if (shift.currentVolunteers >= shift.maxVolunteers) { - throw new error_handler_1.AppError(400, 'Shift is full', 'SHIFT_FULL'); - } - // Check unique constraint - const existingSignup = await database_1.prisma.shiftSignup.findUnique({ - where: { shiftId_userEmail: { shiftId, userEmail: data.email } }, - }); - if (existingSignup && existingSignup.status === client_1.SignupStatus.CONFIRMED) { - throw new error_handler_1.AppError(409, 'You are already signed up for this shift', 'DUPLICATE_SIGNUP'); - } - // Look up existing user - let user = await database_1.prisma.user.findUnique({ where: { email: data.email } }); - let isNewUser = false; - let tempPassword; - if (!user) { - // Create temp user - tempPassword = generateReadablePassword(); - const hashedPassword = await bcryptjs_1.default.hash(tempPassword, 12); - const shiftDate = new Date(shift.date); - shiftDate.setDate(shiftDate.getDate() + 1); - user = await database_1.prisma.user.create({ - data: { - email: data.email, - password: hashedPassword, - name: data.name, - phone: data.phone, - role: 'TEMP', - roles: JSON.parse(JSON.stringify(['TEMP'])), - createdVia: 'PUBLIC_SHIFT_SIGNUP', - expiresAt: shiftDate, - }, - }); - isNewUser = true; - } - // Create signup (or re-activate cancelled one) - let signup; - if (existingSignup && existingSignup.status === client_1.SignupStatus.CANCELLED) { - [signup] = await database_1.prisma.$transaction([ - database_1.prisma.shiftSignup.update({ - where: { id: existingSignup.id }, - data: { - status: client_1.SignupStatus.CONFIRMED, - signupSource: user ? client_1.SignupSource.AUTHENTICATED : client_1.SignupSource.PUBLIC, - userName: data.name, - userPhone: data.phone, - userId: user.id, - }, - }), - database_1.prisma.shift.update({ - where: { id: shiftId }, - data: { - currentVolunteers: { increment: 1 }, - status: shift.currentVolunteers + 1 >= shift.maxVolunteers ? client_1.ShiftStatus.FULL : undefined, - }, - }), - ]); - } - else { - [signup] = await database_1.prisma.$transaction([ - database_1.prisma.shiftSignup.create({ - data: { - shiftId, - shiftTitle: shift.title, - userId: user.id, - userEmail: data.email, - userName: data.name, - userPhone: data.phone, - signupSource: isNewUser ? client_1.SignupSource.PUBLIC : client_1.SignupSource.AUTHENTICATED, - }, - }), - database_1.prisma.shift.update({ - where: { id: shiftId }, - data: { - currentVolunteers: { increment: 1 }, - status: shift.currentVolunteers + 1 >= shift.maxVolunteers ? client_1.ShiftStatus.FULL : undefined, - }, - }), - ]); - } - // Send confirmation email - try { - const shiftDate = new Date(shift.date); - const dateStr = shiftDate.toLocaleDateString('en-CA', { - weekday: 'long', - year: 'numeric', - month: 'long', - day: 'numeric', - }); - await email_service_1.emailService.sendShiftSignupConfirmation({ - recipientEmail: data.email, - recipientName: data.name, - shiftTitle: shift.title, - shiftDate: dateStr, - shiftTime: `${shift.startTime} — ${shift.endTime}`, - shiftLocation: shift.location || 'TBD', - isNewUser, - tempPassword, - loginUrl: `${env_1.env.CORS_ORIGINS.split(',')[0].trim()}/login`, - }); - } - catch (err) { - logger_1.logger.error('Failed to send shift signup confirmation email:', err); - } - // SMS signup confirmation (fire-and-forget) - if (data.phone) { - const shiftDate = new Date(shift.date); - const smsDateStr = shiftDate.toLocaleDateString('en-CA', { - weekday: 'long', - year: 'numeric', - month: 'long', - day: 'numeric', - }); - sms_notification_service_1.smsNotificationService.sendShiftSignupConfirmation(data.phone, { - name: data.name, - shiftTitle: shift.title, - shiftDate: smsDateStr, - shiftTime: `${shift.startTime} — ${shift.endTime}`, - }).catch(err => logger_1.logger.error('SMS signup confirmation failed:', err)); - } - // Notify Rocket.Chat - const shiftDateStr = new Date(shift.date).toLocaleDateString('en-CA', { month: 'short', day: 'numeric' }); - rocketchat_webhook_service_1.rocketchatWebhookService.onShiftSignup({ - userName: data.name || data.email, - shiftTitle: shift.title, - shiftDate: shiftDateStr, - }).catch(() => { }); - // Notification: admin shift signup alert - try { - if (await (0, notification_helper_1.isNotificationEnabled)('notifyAdminShiftSignup')) { - const adminEmails = await (0, notification_helper_1.getAdminEmailsByRole)([client_1.UserRole.SUPER_ADMIN, client_1.UserRole.MAP_ADMIN]); - if (adminEmails.length > 0) { - const adminUrl = `${env_1.env.ADMIN_URL || 'http://localhost:3000'}/app/map/shifts`; - const shiftDate = new Date(shift.date); - const dateStr = shiftDate.toLocaleDateString('en-CA', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }); - await notification_queue_service_1.notificationQueueService.enqueue({ - type: 'admin-shift-signup', - adminEmails, - shiftTitle: shift.title, - shiftDate: dateStr, - volunteerName: data.name, - volunteerEmail: data.email, - signupSource: 'Public Form', - adminUrl, - }); - } - } - } - catch (err) { - logger_1.logger.error('Failed to enqueue admin shift signup notification:', err); - } - // Notification: schedule 24h pre-shift reminder - try { - if (await (0, notification_helper_1.isNotificationEnabled)('notifyVolunteerShiftReminder')) { - const shiftDatetime = new Date(shift.date); - const [startH, startM] = shift.startTime.split(':').map(Number); - shiftDatetime.setHours(startH || 0, startM || 0, 0, 0); - await notification_queue_service_1.notificationQueueService.scheduleShiftReminder({ - type: 'volunteer-shift-reminder', - recipientEmail: data.email, - recipientName: data.name, - shiftTitle: shift.title, - shiftDate: shiftDatetime.toLocaleDateString('en-CA', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }), - shiftStartTime: shift.startTime, - shiftEndTime: shift.endTime, - shiftLocation: shift.location || 'TBD', - shiftDescription: shift.description || '', - currentVolunteers: shift.currentVolunteers + 1, - maxVolunteers: shift.maxVolunteers, - shiftStatus: shift.status, - }, shiftDatetime); - } - } - catch (err) { - logger_1.logger.error('Failed to schedule shift reminder:', err); - } - // SMS shift reminder (fire-and-forget, delay calculated by notification service) - if (data.phone) { - const smsShiftDatetime = new Date(shift.date); - const [smsH, smsM] = shift.startTime.split(':').map(Number); - smsShiftDatetime.setHours(smsH || 0, smsM || 0, 0, 0); - sms_notification_service_1.smsNotificationService.sendShiftReminder(data.phone, { - name: data.name, - shiftTitle: shift.title, - shiftTime: shift.startTime, - shiftLocation: shift.location || 'TBD', - }, smsShiftDatetime).catch(err => logger_1.logger.error('SMS shift reminder failed:', err)); - } - // Notification: schedule post-shift thank-you (2h after end) - try { - if (await (0, notification_helper_1.isNotificationEnabled)('notifyVolunteerShiftThankYou')) { - const shiftEndDatetime = new Date(shift.date); - const [endH, endM] = shift.endTime.split(':').map(Number); - shiftEndDatetime.setHours(endH || 0, endM || 0, 0, 0); - const shiftDate = new Date(shift.date); - const dateStr = shiftDate.toLocaleDateString('en-CA', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }); - const signupUrl = `${env_1.env.CORS_ORIGINS.split(',')[0].trim()}/shifts`; - await notification_queue_service_1.notificationQueueService.scheduleShiftThankYou({ - type: 'volunteer-shift-thank-you', - volunteerEmail: data.email, - volunteerName: data.name, - shiftTitle: shift.title, - shiftDate: dateStr, - shiftTime: `${shift.startTime} — ${shift.endTime}`, - shiftLocation: shift.location || 'TBD', - signupUrl, - }, shiftEndDatetime); - } - } - catch (err) { - logger_1.logger.error('Failed to schedule shift thank-you:', err); - } - (0, metrics_1.recordShiftSignup)(); - // Listmonk event sync - listmonk_event_sync_service_1.listmonkEventSyncService.onShiftSignup({ - email: data.email, - name: data.name, - shiftTitle: shift.title, - shiftDate: new Date(shift.date).toISOString().split('T')[0], - }).catch(() => { }); - // Social group sync (fire-and-forget) - group_service_1.groupService.syncShiftTeam(shiftId).catch(() => { }); - // Achievement check (fire-and-forget) - if (user?.id) - achievements_service_1.achievementsService.checkAndUnlock(user.id, ['shifts']).catch(() => { }); - return { signup, isNewUser }; - }, - async cancelPublicSignup(shiftId, userEmail) { - const signup = await database_1.prisma.shiftSignup.findUnique({ - where: { shiftId_userEmail: { shiftId, userEmail } }, - }); - if (!signup) { - throw new error_handler_1.AppError(404, 'Signup not found', 'SIGNUP_NOT_FOUND'); - } - if (signup.status === client_1.SignupStatus.CANCELLED) { - throw new error_handler_1.AppError(400, 'Signup already cancelled', 'ALREADY_CANCELLED'); - } - const shift = await database_1.prisma.shift.findUnique({ where: { id: shiftId } }); - await database_1.prisma.$transaction([ - database_1.prisma.shiftSignup.update({ - where: { id: signup.id }, - data: { status: client_1.SignupStatus.CANCELLED }, - }), - database_1.prisma.shift.update({ - where: { id: shiftId }, - data: { - currentVolunteers: { decrement: 1 }, - status: client_1.ShiftStatus.OPEN, - }, - }), - ]); - // Notification: cancellation acknowledgement + cancel reminder - try { - if (shift && await (0, notification_helper_1.isNotificationEnabled)('notifyVolunteerCancellation')) { - const shiftDate = new Date(shift.date); - const dateStr = shiftDate.toLocaleDateString('en-CA', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }); - const signupUrl = `${env_1.env.CORS_ORIGINS.split(',')[0].trim()}/shifts`; - await notification_queue_service_1.notificationQueueService.enqueue({ - type: 'volunteer-cancellation', - volunteerEmail: userEmail, - volunteerName: signup.userName || userEmail, - shiftTitle: shift.title, - shiftDate: dateStr, - shiftTime: `${shift.startTime} — ${shift.endTime}`, - signupUrl, - }); - } - // Cancel the pending shift reminder - if (shift) { - const shiftDatetime = new Date(shift.date); - const [startH, startM] = shift.startTime.split(':').map(Number); - shiftDatetime.setHours(startH || 0, startM || 0, 0, 0); - await notification_queue_service_1.notificationQueueService.cancelShiftReminder(userEmail, shiftDatetime); - } - // Cancel the pending shift thank-you - if (shift) { - const shiftEndDatetime = new Date(shift.date); - const [endH, endM] = shift.endTime.split(':').map(Number); - shiftEndDatetime.setHours(endH || 0, endM || 0, 0, 0); - await notification_queue_service_1.notificationQueueService.cancelShiftThankYou(userEmail, shiftEndDatetime); - } - } - catch (err) { - logger_1.logger.error('Failed to enqueue cancellation notification:', err); - } - // Notify Rocket.Chat of cancellation - if (shift) { - const shiftDateStr = new Date(shift.date).toLocaleDateString('en-CA', { month: 'short', day: 'numeric' }); - rocketchat_webhook_service_1.rocketchatWebhookService.onShiftCancellation({ - userName: signup.userName || userEmail, - shiftTitle: shift.title, - shiftDate: shiftDateStr, - }).catch(() => { }); - } - // Notification: admin shift cancellation alert - try { - if (shift && await (0, notification_helper_1.isNotificationEnabled)('notifyAdminShiftCancellation')) { - const adminEmails = await (0, notification_helper_1.getAdminEmailsByRole)([client_1.UserRole.SUPER_ADMIN, client_1.UserRole.MAP_ADMIN]); - if (adminEmails.length > 0) { - const adminUrl = `${env_1.env.ADMIN_URL || 'http://localhost:3000'}/app/map/shifts`; - const shiftDate = new Date(shift.date); - const dateStr = shiftDate.toLocaleDateString('en-CA', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }); - await notification_queue_service_1.notificationQueueService.enqueue({ - type: 'admin-shift-cancellation', - adminEmails, - shiftTitle: shift.title, - shiftDate: dateStr, - volunteerName: signup.userName || userEmail, - volunteerEmail: userEmail, - cancellationSource: 'Public Form', - adminUrl, - }); - } - } - } - catch (err) { - logger_1.logger.error('Failed to enqueue admin shift cancellation notification:', err); - } - // Social group sync (fire-and-forget) - group_service_1.groupService.syncShiftTeam(shiftId).catch(() => { }); - }, - async getUpcomingForVolunteer(userId) { - const user = await database_1.prisma.user.findUnique({ where: { id: userId }, select: { email: true } }); - if (!user) - throw new error_handler_1.AppError(404, 'User not found', 'USER_NOT_FOUND'); - const shifts = await database_1.prisma.shift.findMany({ - where: { - isPublic: true, - status: { not: client_1.ShiftStatus.CANCELLED }, - date: { gte: new Date(new Date().toISOString().split('T')[0]) }, - }, - select: { - id: true, - title: true, - description: true, - date: true, - startTime: true, - endTime: true, - location: true, - maxVolunteers: true, - currentVolunteers: true, - status: true, - meeting: { select: { id: true, slug: true, isActive: true } }, - }, - orderBy: [{ date: 'asc' }, { startTime: 'asc' }], - }); - // Check signup status for each shift - const signups = await database_1.prisma.shiftSignup.findMany({ - where: { - userEmail: user.email, - shiftId: { in: shifts.map((s) => s.id) }, - status: client_1.SignupStatus.CONFIRMED, - }, - select: { shiftId: true }, - }); - const signedUpSet = new Set(signups.map((s) => s.shiftId)); - return shifts.map((s) => ({ - ...s, - isSignedUp: signedUpSet.has(s.id), - })); - }, - async volunteerSignup(shiftId, userId) { - const user = await database_1.prisma.user.findUnique({ - where: { id: userId }, - select: { id: true, email: true, name: true, phone: true }, - }); - if (!user) - throw new error_handler_1.AppError(404, 'User not found', 'USER_NOT_FOUND'); - const shift = await database_1.prisma.shift.findUnique({ where: { id: shiftId } }); - if (!shift) - throw new error_handler_1.AppError(404, 'Shift not found', 'SHIFT_NOT_FOUND'); - if (!shift.isPublic) - throw new error_handler_1.AppError(403, 'This shift is not open for signup', 'NOT_PUBLIC'); - if (shift.status === client_1.ShiftStatus.CANCELLED) - throw new error_handler_1.AppError(400, 'This shift is cancelled', 'SHIFT_CANCELLED'); - if (shift.date < new Date(new Date().toISOString().split('T')[0])) - throw new error_handler_1.AppError(400, 'This shift has already passed', 'SHIFT_PAST'); - if (shift.currentVolunteers >= shift.maxVolunteers) - throw new error_handler_1.AppError(400, 'Shift is full', 'SHIFT_FULL'); - const existing = await database_1.prisma.shiftSignup.findUnique({ - where: { shiftId_userEmail: { shiftId, userEmail: user.email } }, - }); - if (existing && existing.status === client_1.SignupStatus.CONFIRMED) { - throw new error_handler_1.AppError(409, 'Already signed up for this shift', 'DUPLICATE_SIGNUP'); - } - let signup; - if (existing && existing.status === client_1.SignupStatus.CANCELLED) { - [signup] = await database_1.prisma.$transaction([ - database_1.prisma.shiftSignup.update({ - where: { id: existing.id }, - data: { status: client_1.SignupStatus.CONFIRMED, signupSource: client_1.SignupSource.AUTHENTICATED }, - }), - database_1.prisma.shift.update({ - where: { id: shiftId }, - data: { - currentVolunteers: { increment: 1 }, - status: shift.currentVolunteers + 1 >= shift.maxVolunteers ? client_1.ShiftStatus.FULL : undefined, - }, - }), - ]); - } - else { - [signup] = await database_1.prisma.$transaction([ - database_1.prisma.shiftSignup.create({ - data: { - shiftId, - shiftTitle: shift.title, - userId: user.id, - userEmail: user.email, - userName: user.name, - userPhone: user.phone, - signupSource: client_1.SignupSource.AUTHENTICATED, - }, - }), - database_1.prisma.shift.update({ - where: { id: shiftId }, - data: { - currentVolunteers: { increment: 1 }, - status: shift.currentVolunteers + 1 >= shift.maxVolunteers ? client_1.ShiftStatus.FULL : undefined, - }, - }), - ]); - } - // Send confirmation email - try { - const shiftDate = new Date(shift.date); - const dateStr = shiftDate.toLocaleDateString('en-CA', { - weekday: 'long', year: 'numeric', month: 'long', day: 'numeric', - }); - await email_service_1.emailService.sendShiftSignupConfirmation({ - recipientEmail: user.email, - recipientName: user.name || user.email, - shiftTitle: shift.title, - shiftDate: dateStr, - shiftTime: `${shift.startTime} — ${shift.endTime}`, - shiftLocation: shift.location || 'TBD', - isNewUser: false, - loginUrl: `${env_1.env.CORS_ORIGINS.split(',')[0].trim()}/login`, - }); - } - catch (err) { - logger_1.logger.error('Failed to send volunteer shift signup confirmation email:', err); - } - // Notify Rocket.Chat - const shiftDateStr = new Date(shift.date).toLocaleDateString('en-CA', { month: 'short', day: 'numeric' }); - rocketchat_webhook_service_1.rocketchatWebhookService.onShiftSignup({ - userName: user.name || user.email, - shiftTitle: shift.title, - shiftDate: shiftDateStr, - }).catch(() => { }); - // Notification: admin shift signup alert - try { - if (await (0, notification_helper_1.isNotificationEnabled)('notifyAdminShiftSignup')) { - const adminEmails = await (0, notification_helper_1.getAdminEmailsByRole)([client_1.UserRole.SUPER_ADMIN, client_1.UserRole.MAP_ADMIN]); - if (adminEmails.length > 0) { - const adminUrl = `${env_1.env.ADMIN_URL || 'http://localhost:3000'}/app/map/shifts`; - const shiftDate = new Date(shift.date); - const dateStr = shiftDate.toLocaleDateString('en-CA', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }); - await notification_queue_service_1.notificationQueueService.enqueue({ - type: 'admin-shift-signup', - adminEmails, - shiftTitle: shift.title, - shiftDate: dateStr, - volunteerName: user.name || user.email, - volunteerEmail: user.email, - signupSource: 'Authenticated Volunteer', - adminUrl, - }); - } - } - } - catch (err) { - logger_1.logger.error('Failed to enqueue admin shift signup notification:', err); - } - // Notification: schedule 24h pre-shift reminder - try { - if (await (0, notification_helper_1.isNotificationEnabled)('notifyVolunteerShiftReminder')) { - const shiftDatetime = new Date(shift.date); - const [startH, startM] = shift.startTime.split(':').map(Number); - shiftDatetime.setHours(startH || 0, startM || 0, 0, 0); - await notification_queue_service_1.notificationQueueService.scheduleShiftReminder({ - type: 'volunteer-shift-reminder', - recipientEmail: user.email, - recipientName: user.name || user.email, - shiftTitle: shift.title, - shiftDate: shiftDatetime.toLocaleDateString('en-CA', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }), - shiftStartTime: shift.startTime, - shiftEndTime: shift.endTime, - shiftLocation: shift.location || 'TBD', - shiftDescription: shift.description || '', - currentVolunteers: shift.currentVolunteers + 1, - maxVolunteers: shift.maxVolunteers, - shiftStatus: shift.status, - }, shiftDatetime); - } - } - catch (err) { - logger_1.logger.error('Failed to schedule shift reminder:', err); - } - // Notification: schedule post-shift thank-you (2h after end) - try { - if (await (0, notification_helper_1.isNotificationEnabled)('notifyVolunteerShiftThankYou')) { - const shiftEndDatetime = new Date(shift.date); - const [endH, endM] = shift.endTime.split(':').map(Number); - shiftEndDatetime.setHours(endH || 0, endM || 0, 0, 0); - const shiftDate = new Date(shift.date); - const dateStr = shiftDate.toLocaleDateString('en-CA', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }); - const signupUrl = `${env_1.env.CORS_ORIGINS.split(',')[0].trim()}/shifts`; - await notification_queue_service_1.notificationQueueService.scheduleShiftThankYou({ - type: 'volunteer-shift-thank-you', - volunteerEmail: user.email, - volunteerName: user.name || user.email, - shiftTitle: shift.title, - shiftDate: dateStr, - shiftTime: `${shift.startTime} — ${shift.endTime}`, - shiftLocation: shift.location || 'TBD', - signupUrl, - }, shiftEndDatetime); - } - } - catch (err) { - logger_1.logger.error('Failed to schedule shift thank-you:', err); - } - // Listmonk event sync - listmonk_event_sync_service_1.listmonkEventSyncService.onShiftSignup({ - email: user.email, - name: user.name || user.email, - shiftTitle: shift.title, - shiftDate: new Date(shift.date).toISOString().split('T')[0], - }).catch(() => { }); - // Social group sync (fire-and-forget) - group_service_1.groupService.syncShiftTeam(shiftId).catch(() => { }); - // Achievement check (fire-and-forget) - achievements_service_1.achievementsService.checkAndUnlock(userId, ['shifts']).catch(() => { }); - return signup; - }, - async cancelVolunteerSignup(shiftId, userId) { - const user = await database_1.prisma.user.findUnique({ where: { id: userId }, select: { email: true, name: true } }); - if (!user) - throw new error_handler_1.AppError(404, 'User not found', 'USER_NOT_FOUND'); - const signup = await database_1.prisma.shiftSignup.findUnique({ - where: { shiftId_userEmail: { shiftId, userEmail: user.email } }, - }); - if (!signup) - throw new error_handler_1.AppError(404, 'Signup not found', 'SIGNUP_NOT_FOUND'); - if (signup.status === client_1.SignupStatus.CANCELLED) - throw new error_handler_1.AppError(400, 'Already cancelled', 'ALREADY_CANCELLED'); - const shift = await database_1.prisma.shift.findUnique({ where: { id: shiftId } }); - await database_1.prisma.$transaction([ - database_1.prisma.shiftSignup.update({ - where: { id: signup.id }, - data: { status: client_1.SignupStatus.CANCELLED }, - }), - database_1.prisma.shift.update({ - where: { id: shiftId }, - data: { - currentVolunteers: { decrement: 1 }, - status: client_1.ShiftStatus.OPEN, - }, - }), - ]); - // Notification: cancellation acknowledgement + cancel reminder - try { - if (shift && await (0, notification_helper_1.isNotificationEnabled)('notifyVolunteerCancellation')) { - const shiftDate = new Date(shift.date); - const dateStr = shiftDate.toLocaleDateString('en-CA', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }); - const signupUrl = `${env_1.env.CORS_ORIGINS.split(',')[0].trim()}/shifts`; - await notification_queue_service_1.notificationQueueService.enqueue({ - type: 'volunteer-cancellation', - volunteerEmail: user.email, - volunteerName: user.name || user.email, - shiftTitle: shift.title, - shiftDate: dateStr, - shiftTime: `${shift.startTime} — ${shift.endTime}`, - signupUrl, - }); - } - // Cancel the pending shift reminder - if (shift) { - const shiftDatetime = new Date(shift.date); - const [startH, startM] = shift.startTime.split(':').map(Number); - shiftDatetime.setHours(startH || 0, startM || 0, 0, 0); - await notification_queue_service_1.notificationQueueService.cancelShiftReminder(user.email, shiftDatetime); - } - // Cancel the pending shift thank-you - if (shift) { - const shiftEndDatetime = new Date(shift.date); - const [endH, endM] = shift.endTime.split(':').map(Number); - shiftEndDatetime.setHours(endH || 0, endM || 0, 0, 0); - await notification_queue_service_1.notificationQueueService.cancelShiftThankYou(user.email, shiftEndDatetime); - } - } - catch (err) { - logger_1.logger.error('Failed to enqueue cancellation notification:', err); - } - // Notify Rocket.Chat of cancellation - if (shift) { - const shiftDateStr = new Date(shift.date).toLocaleDateString('en-CA', { month: 'short', day: 'numeric' }); - rocketchat_webhook_service_1.rocketchatWebhookService.onShiftCancellation({ - userName: user.name || user.email, - shiftTitle: shift.title, - shiftDate: shiftDateStr, - }).catch(() => { }); - } - // Notification: admin shift cancellation alert - try { - if (shift && await (0, notification_helper_1.isNotificationEnabled)('notifyAdminShiftCancellation')) { - const adminEmails = await (0, notification_helper_1.getAdminEmailsByRole)([client_1.UserRole.SUPER_ADMIN, client_1.UserRole.MAP_ADMIN]); - if (adminEmails.length > 0) { - const adminUrl = `${env_1.env.ADMIN_URL || 'http://localhost:3000'}/app/map/shifts`; - const shiftDate = new Date(shift.date); - const dateStr = shiftDate.toLocaleDateString('en-CA', { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }); - await notification_queue_service_1.notificationQueueService.enqueue({ - type: 'admin-shift-cancellation', - adminEmails, - shiftTitle: shift.title, - shiftDate: dateStr, - volunteerName: user.name || user.email, - volunteerEmail: user.email, - cancellationSource: 'Volunteer Portal', - adminUrl, - }); - } - } - } - catch (err) { - logger_1.logger.error('Failed to enqueue admin shift cancellation notification:', err); - } - // Social group sync (fire-and-forget) - group_service_1.groupService.syncShiftTeam(shiftId).catch(() => { }); - }, - async getMySignups(userId) { - const user = await database_1.prisma.user.findUnique({ where: { id: userId }, select: { email: true } }); - if (!user) - throw new error_handler_1.AppError(404, 'User not found', 'USER_NOT_FOUND'); - const signups = await database_1.prisma.shiftSignup.findMany({ - where: { - userEmail: user.email, - status: client_1.SignupStatus.CONFIRMED, - shift: { - date: { gte: new Date(new Date().toISOString().split('T')[0]) }, - status: { not: client_1.ShiftStatus.CANCELLED }, - }, - }, - include: { - shift: { - select: { - id: true, - title: true, - description: true, - date: true, - startTime: true, - endTime: true, - location: true, - maxVolunteers: true, - currentVolunteers: true, - status: true, - meeting: { select: { id: true, slug: true, isActive: true } }, - }, - }, - }, - orderBy: { shift: { date: 'asc' } }, - }); - return signups; - }, - async getPublicShifts() { - const shifts = await database_1.prisma.shift.findMany({ - where: { - isPublic: true, - status: { not: client_1.ShiftStatus.CANCELLED }, - date: { gte: new Date(new Date().toISOString().split('T')[0]) }, - }, - select: { - id: true, - title: true, - description: true, - date: true, - startTime: true, - endTime: true, - location: true, - maxVolunteers: true, - currentVolunteers: true, - status: true, - meeting: { select: { id: true, slug: true, isActive: true } }, - }, - orderBy: [{ date: 'asc' }, { startTime: 'asc' }], - }); - return shifts; - }, - async emailShiftDetails(shiftId) { - const shift = await database_1.prisma.shift.findUnique({ - where: { id: shiftId }, - include: { - signups: { - where: { status: client_1.SignupStatus.CONFIRMED }, - }, - }, - }); - if (!shift) { - throw new error_handler_1.AppError(404, 'Shift not found', 'SHIFT_NOT_FOUND'); - } - const shiftDate = new Date(shift.date); - const dateStr = shiftDate.toLocaleDateString('en-CA', { - weekday: 'long', - year: 'numeric', - month: 'long', - day: 'numeric', - }); - let sent = 0; - let failed = 0; - for (const signup of shift.signups) { - try { - const result = await email_service_1.emailService.sendShiftDetailsEmail({ - recipientEmail: signup.userEmail, - recipientName: signup.userName || signup.userEmail, - shiftTitle: shift.title, - shiftDate: dateStr, - shiftStartTime: shift.startTime, - shiftEndTime: shift.endTime, - shiftLocation: shift.location || 'TBD', - shiftDescription: shift.description || '', - currentVolunteers: shift.currentVolunteers, - maxVolunteers: shift.maxVolunteers, - shiftStatus: shift.status, - }); - if (result.success) { - sent++; - } - else { - failed++; - } - } - catch (err) { - logger_1.logger.error(`Failed to send shift details to ${signup.userEmail}:`, err); - failed++; - } - } - return { sent, failed }; - }, - async getCalendarData(startDate, endDate) { - const shifts = await database_1.prisma.shift.findMany({ - where: { - date: { - gte: new Date(startDate), - lte: new Date(endDate), - }, - }, - include: { - cut: { select: { id: true, name: true } }, - signups: true, - series: { select: { id: true, frequency: true } }, - }, - orderBy: { startTime: 'asc' }, - }); - // Group by date - const dateMap = {}; - for (const shift of shifts) { - const dateKey = shift.date.toISOString().split('T')[0]; - if (!dateMap[dateKey]) { - dateMap[dateKey] = { count: 0, shifts: [] }; - } - dateMap[dateKey].count++; - dateMap[dateKey].shifts.push(shift); - } - return { dates: dateMap }; - }, -}; -//# sourceMappingURL=shifts.service.js.map \ No newline at end of file diff --git a/api/dist/modules/map/shifts/shifts.service.js.map b/api/dist/modules/map/shifts/shifts.service.js.map deleted file mode 100644 index 695605e6..00000000 --- a/api/dist/modules/map/shifts/shifts.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"shifts.service.js","sourceRoot":"","sources":["../../../../src/modules/map/shifts/shifts.service.ts"],"names":[],"mappings":";;;;;;AAAA,wDAA8B;AAC9B,2CAA2F;AAC3F,uDAAkD;AAClD,qEAA6D;AAC7D,mEAA+D;AAC/D,6FAAwF;AACxF,+EAAoG;AACpG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.ts deleted file mode 100644 index b21d470c..00000000 --- a/api/dist/modules/map/tracking/tracking.routes.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -declare const volunteerRouter: import("express-serve-static-core").Router; -declare const adminRouter: import("express-serve-static-core").Router; -export { volunteerRouter as trackingVolunteerRouter, adminRouter as trackingAdminRouter }; -//# sourceMappingURL=tracking.routes.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/map/tracking/tracking.routes.d.ts.map b/api/dist/modules/map/tracking/tracking.routes.d.ts.map deleted file mode 100644 index a8055006..00000000 --- a/api/dist/modules/map/tracking/tracking.routes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tracking.routes.d.ts","sourceRoot":"","sources":["../../../../src/modules/map/tracking/tracking.routes.ts"],"names":[],"mappings":"AAiBA,QAAA,MAAM,eAAe,4CAAW,CAAC;AAoHjC,QAAA,MAAM,WAAW,4CAAW,CAAC;AA8C7B,OAAO,EAAE,eAAe,IAAI,uBAAuB,EAAE,WAAW,IAAI,mBAAmB,EAAE,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/tracking/tracking.routes.js b/api/dist/modules/map/tracking/tracking.routes.js deleted file mode 100644 index 02682dab..00000000 --- a/api/dist/modules/map/tracking/tracking.routes.js +++ /dev/null @@ -1,138 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.trackingAdminRouter = exports.trackingVolunteerRouter = void 0; -const express_1 = require("express"); -const tracking_service_1 = require("./tracking.service"); -const tracking_schemas_1 = require("./tracking.schemas"); -const validate_1 = require("../../../middleware/validate"); -const auth_middleware_1 = require("../../../middleware/auth.middleware"); -const rbac_middleware_1 = require("../../../middleware/rbac.middleware"); -const rate_limit_1 = require("../../../middleware/rate-limit"); -const roles_1 = require("../../../utils/roles"); -// ─── Volunteer Router ──────────────────────────────────────────────── -const volunteerRouter = (0, express_1.Router)(); -exports.trackingVolunteerRouter = volunteerRouter; -volunteerRouter.use(auth_middleware_1.authenticate); -// POST /api/map/tracking/sessions — start tracking session -volunteerRouter.post('/sessions', (0, validate_1.validate)(tracking_schemas_1.startTrackingSchema), async (req, res, next) => { - try { - const session = await tracking_service_1.trackingService.startSession(req.user.id, req.body); - res.status(201).json(session); - } - catch (err) { - next(err); - } -}); -// POST /api/map/tracking/sessions/:id/end — end tracking session -volunteerRouter.post('/sessions/:id/end', async (req, res, next) => { - try { - const id = req.params.id; - const session = await tracking_service_1.trackingService.endSession(id, req.user.id); - if (!session) { - res.status(404).json({ error: { message: 'Active tracking session not found', code: 'NOT_FOUND' } }); - return; - } - res.json(session); - } - catch (err) { - next(err); - } -}); -// POST /api/map/tracking/sessions/:id/points — submit GPS point batch -volunteerRouter.post('/sessions/:id/points', rate_limit_1.gpsTrackingRateLimit, (0, validate_1.validate)(tracking_schemas_1.submitPointsSchema), async (req, res, next) => { - try { - const id = req.params.id; - const result = await tracking_service_1.trackingService.submitPoints(id, req.user.id, req.body); - res.json(result); - } - catch (err) { - next(err); - } -}); -// POST /api/map/tracking/sessions/:id/link-canvass — link to canvass session -volunteerRouter.post('/sessions/:id/link-canvass', (0, validate_1.validate)(tracking_schemas_1.linkCanvassSchema), async (req, res, next) => { - try { - const id = req.params.id; - const session = await tracking_service_1.trackingService.linkCanvassSession(id, req.body); - res.json(session); - } - catch (err) { - next(err); - } -}); -// GET /api/map/tracking/my/session — get active tracking session -volunteerRouter.get('/my/session', async (req, res, next) => { - try { - const session = await tracking_service_1.trackingService.getActiveSession(req.user.id); - res.json(session); - } - catch (err) { - next(err); - } -}); -// GET /api/map/tracking/my/sessions — paginated list of own tracking sessions -volunteerRouter.get('/my/sessions', (0, validate_1.validate)(tracking_schemas_1.myHistoricalListQuerySchema, 'query'), async (req, res, next) => { - try { - const query = req.query; - const result = await tracking_service_1.trackingService.getHistoricalSessions({ - ...query, - userId: req.user.id, - }); - res.json(result); - } - catch (err) { - next(err); - } -}); -// GET /api/map/tracking/my/sessions/:id/route — full route for own session -volunteerRouter.get('/my/sessions/:id/route', async (req, res, next) => { - try { - const id = req.params.id; - const route = await tracking_service_1.trackingService.getMySessionRoute(id, req.user.id); - if (!route) { - res.status(404).json({ error: { message: 'Session not found', code: 'NOT_FOUND' } }); - return; - } - res.json(route); - } - catch (err) { - next(err); - } -}); -// ─── Admin Router ──────────────────────────────────────────────────── -const adminRouter = (0, express_1.Router)(); -exports.trackingAdminRouter = adminRouter; -adminRouter.use(auth_middleware_1.authenticate); -adminRouter.use((0, rbac_middleware_1.requireRole)(...roles_1.MAP_ROLES)); -// GET /api/map/tracking/live — active volunteers with positions + recent trails -adminRouter.get('/live', (0, validate_1.validate)(tracking_schemas_1.liveVolunteersQuerySchema, 'query'), async (req, res, next) => { - try { - const volunteers = await tracking_service_1.trackingService.getLiveVolunteers(req.query); - res.json(volunteers); - } - catch (err) { - next(err); - } -}); -// GET /api/map/tracking/sessions — historical session list -adminRouter.get('/sessions', (0, validate_1.validate)(tracking_schemas_1.historicalListQuerySchema, 'query'), async (req, res, next) => { - try { - const result = await tracking_service_1.trackingService.getHistoricalSessions(req.query); - res.json(result); - } - catch (err) { - next(err); - } -}); -// GET /api/map/tracking/sessions/:id/route — full route for a session -adminRouter.get('/sessions/:id/route', async (req, res, next) => { - try { - const id = req.params.id; - const route = await tracking_service_1.trackingService.getSessionRoute(id); - res.json(route); - } - catch (err) { - next(err); - } -}); -//# sourceMappingURL=tracking.routes.js.map \ No newline at end of file diff --git a/api/dist/modules/map/tracking/tracking.routes.js.map b/api/dist/modules/map/tracking/tracking.routes.js.map deleted file mode 100644 index dc25fc99..00000000 --- a/api/dist/modules/map/tracking/tracking.routes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tracking.routes.js","sourceRoot":"","sources":["../../../../src/modules/map/tracking/tracking.routes.ts"],"names":[],"mappings":";;;AAAA,qCAAkE;AAClE,yDAAqD;AACrD,yDAO4B;AAC5B,2DAAwD;AACxD,yEAAmE;AACnE,yEAAkE;AAClE,+DAAsE;AACtE,gDAAiD;AAEj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AG,CAAC,CAAC;IACZ,CAAC;AACH,CAAC,CACF,CAAC;AAEF,sEAAsE;AACtE,WAAW,CAAC,GAAG,CACb,qBAAqB,EACrB,KAAK,EAAE,GAAY,EAAE,GAAa,EAAE,IAAkB,EAAE,EAAE;IACxD,IAAI,CAAC;QACH,MAAM,EAAE,GAAG,GAAG,CAAC,MAAM,CAAC,EAAY,CAAC;QACnC,MAAM,KAAK,GAAG,MAAM,kCAAe,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;QACxD,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,GAAG,CAAC,CAAC;IACZ,CAAC;AACH,CAAC,CACF,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/tracking/tracking.schemas.d.ts b/api/dist/modules/map/tracking/tracking.schemas.d.ts deleted file mode 100644 index e0378a02..00000000 --- a/api/dist/modules/map/tracking/tracking.schemas.d.ts +++ /dev/null @@ -1,112 +0,0 @@ -import { z } from 'zod'; -export declare const startTrackingSchema: z.ZodObject<{ - canvassSessionId: z.ZodOptional; - latitude: z.ZodOptional; - longitude: z.ZodOptional; -}, "strip", z.ZodTypeAny, { - latitude?: number | undefined; - longitude?: number | undefined; - canvassSessionId?: string | undefined; -}, { - latitude?: number | undefined; - longitude?: number | undefined; - canvassSessionId?: string | undefined; -}>; -export declare const submitPointsSchema: z.ZodObject<{ - points: z.ZodArray; - recordedAt: z.ZodString; - eventType: z.ZodOptional>; - }, "strip", z.ZodTypeAny, { - latitude: number; - longitude: number; - recordedAt: string; - eventType?: "LOCATION_ADDED" | "VISIT_RECORDED" | "SESSION_STARTED" | "SESSION_ENDED" | undefined; - accuracy?: number | undefined; - }, { - latitude: number; - longitude: number; - recordedAt: string; - eventType?: "LOCATION_ADDED" | "VISIT_RECORDED" | "SESSION_STARTED" | "SESSION_ENDED" | undefined; - accuracy?: number | undefined; - }>, "many">; -}, "strip", z.ZodTypeAny, { - points: { - latitude: number; - longitude: number; - recordedAt: string; - eventType?: "LOCATION_ADDED" | "VISIT_RECORDED" | "SESSION_STARTED" | "SESSION_ENDED" | undefined; - accuracy?: number | undefined; - }[]; -}, { - points: { - latitude: number; - longitude: number; - recordedAt: string; - eventType?: "LOCATION_ADDED" | "VISIT_RECORDED" | "SESSION_STARTED" | "SESSION_ENDED" | undefined; - accuracy?: number | undefined; - }[]; -}>; -export declare const linkCanvassSchema: z.ZodObject<{ - canvassSessionId: z.ZodString; -}, "strip", z.ZodTypeAny, { - canvassSessionId: string; -}, { - canvassSessionId: string; -}>; -export declare const liveVolunteersQuerySchema: z.ZodObject<{ - staleCutoffMinutes: z.ZodDefault; -}, "strip", z.ZodTypeAny, { - staleCutoffMinutes: number; -}, { - staleCutoffMinutes?: number | undefined; -}>; -export declare const historicalListQuerySchema: z.ZodObject<{ - userId: z.ZodOptional; - from: z.ZodOptional; - to: z.ZodOptional; - page: z.ZodDefault; - limit: z.ZodDefault; -}, "strip", z.ZodTypeAny, { - limit: number; - page: number; - from?: string | undefined; - userId?: string | undefined; - to?: string | undefined; -}, { - from?: string | undefined; - limit?: number | undefined; - userId?: string | undefined; - page?: number | undefined; - to?: string | undefined; -}>; -export declare const myHistoricalListQuerySchema: z.ZodObject<{ - from: z.ZodOptional; - to: z.ZodOptional; - page: z.ZodDefault; - limit: z.ZodDefault; -}, "strip", z.ZodTypeAny, { - limit: number; - page: number; - from?: string | undefined; - to?: string | undefined; -}, { - from?: string | undefined; - limit?: number | undefined; - page?: number | undefined; - to?: string | undefined; -}>; -export type StartTrackingInput = z.infer; -export type SubmitPointsInput = z.infer; -export type LinkCanvassInput = z.infer; -export type LiveVolunteersQueryInput = z.infer; -export type HistoricalListQueryInput = z.infer; -export type MyHistoricalListQueryInput = z.infer; -//# sourceMappingURL=tracking.schemas.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/map/tracking/tracking.schemas.d.ts.map b/api/dist/modules/map/tracking/tracking.schemas.d.ts.map deleted file mode 100644 index 2ac66c7f..00000000 --- a/api/dist/modules/map/tracking/tracking.schemas.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tracking.schemas.d.ts","sourceRoot":"","sources":["../../../../src/modules/map/tracking/tracking.schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;EAI9B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAa7B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;EAE5B,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;EAEpC,CAAC;AAEH,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;EAMpC,CAAC;AAEH,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;EAKtC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACrE,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AACnE,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AACjE,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AACjF,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AACjF,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/tracking/tracking.schemas.js b/api/dist/modules/map/tracking/tracking.schemas.js deleted file mode 100644 index 099b7dd8..00000000 --- a/api/dist/modules/map/tracking/tracking.schemas.js +++ /dev/null @@ -1,42 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.myHistoricalListQuerySchema = exports.historicalListQuerySchema = exports.liveVolunteersQuerySchema = exports.linkCanvassSchema = exports.submitPointsSchema = exports.startTrackingSchema = void 0; -const zod_1 = require("zod"); -const client_1 = require("@prisma/client"); -exports.startTrackingSchema = zod_1.z.object({ - canvassSessionId: zod_1.z.string().optional(), - latitude: zod_1.z.number().min(-90).max(90).optional(), - longitude: zod_1.z.number().min(-180).max(180).optional(), -}); -exports.submitPointsSchema = zod_1.z.object({ - points: zod_1.z - .array(zod_1.z.object({ - latitude: zod_1.z.number().min(-90).max(90), - longitude: zod_1.z.number().min(-180).max(180), - accuracy: zod_1.z.number().positive().optional(), - recordedAt: zod_1.z.string().datetime(), - eventType: zod_1.z.nativeEnum(client_1.TrackPointEvent).optional(), - })) - .min(1) - .max(100), -}); -exports.linkCanvassSchema = zod_1.z.object({ - canvassSessionId: zod_1.z.string().min(1), -}); -exports.liveVolunteersQuerySchema = zod_1.z.object({ - staleCutoffMinutes: zod_1.z.coerce.number().int().positive().default(10), -}); -exports.historicalListQuerySchema = zod_1.z.object({ - userId: zod_1.z.string().optional(), - from: zod_1.z.string().datetime().optional(), - to: zod_1.z.string().datetime().optional(), - page: zod_1.z.coerce.number().int().positive().default(1), - limit: zod_1.z.coerce.number().int().positive().max(100).default(20), -}); -exports.myHistoricalListQuerySchema = zod_1.z.object({ - from: zod_1.z.string().datetime().optional(), - to: zod_1.z.string().datetime().optional(), - page: zod_1.z.coerce.number().int().positive().default(1), - limit: zod_1.z.coerce.number().int().positive().max(100).default(15), -}); -//# sourceMappingURL=tracking.schemas.js.map \ No newline at end of file diff --git a/api/dist/modules/map/tracking/tracking.schemas.js.map b/api/dist/modules/map/tracking/tracking.schemas.js.map deleted file mode 100644 index 3af6f47a..00000000 --- a/api/dist/modules/map/tracking/tracking.schemas.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tracking.schemas.js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AG,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;CAC/D,CAAC,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/tracking/tracking.service.d.ts b/api/dist/modules/map/tracking/tracking.service.d.ts deleted file mode 100644 index 05f4edac..00000000 --- a/api/dist/modules/map/tracking/tracking.service.d.ts +++ /dev/null @@ -1,127 +0,0 @@ -import { Prisma } from '@prisma/client'; -import type { StartTrackingInput, SubmitPointsInput, LinkCanvassInput, LiveVolunteersQueryInput, HistoricalListQueryInput } from './tracking.schemas'; -declare class TrackingService { - /** Start or resume a tracking session for a volunteer. */ - startSession(userId: string, data: StartTrackingInput): Promise<{ - id: string; - userId: string; - isActive: boolean; - startedAt: Date; - endedAt: Date | null; - totalPoints: number; - totalDistanceM: number; - lastLatitude: Prisma.Decimal | null; - lastLongitude: Prisma.Decimal | null; - lastRecordedAt: Date | null; - canvassSessionId: string | null; - }>; - /** End a tracking session. */ - endSession(sessionId: string, userId: string): Promise<{ - id: string; - userId: string; - isActive: boolean; - startedAt: Date; - endedAt: Date | null; - totalPoints: number; - totalDistanceM: number; - lastLatitude: Prisma.Decimal | null; - lastLongitude: Prisma.Decimal | null; - lastRecordedAt: Date | null; - canvassSessionId: string | null; - } | null>; - /** Submit a batch of GPS points for a tracking session. */ - submitPoints(sessionId: string, userId: string, data: SubmitPointsInput): Promise<{ - inserted: number; - addedDistanceM: number; - }>; - /** Get the active tracking session for a user. */ - getActiveSession(userId: string): Promise<{ - id: string; - userId: string; - isActive: boolean; - startedAt: Date; - endedAt: Date | null; - totalPoints: number; - totalDistanceM: number; - lastLatitude: Prisma.Decimal | null; - lastLongitude: Prisma.Decimal | null; - lastRecordedAt: Date | null; - canvassSessionId: string | null; - } | null>; - /** Link a canvass session to an existing tracking session. */ - linkCanvassSession(trackingSessionId: string, data: LinkCanvassInput): Promise<{ - id: string; - userId: string; - isActive: boolean; - startedAt: Date; - endedAt: Date | null; - totalPoints: number; - totalDistanceM: number; - lastLatitude: Prisma.Decimal | null; - lastLongitude: Prisma.Decimal | null; - lastRecordedAt: Date | null; - canvassSessionId: string | null; - }>; - /** Get all active volunteers with their recent trail for the admin live map. */ - getLiveVolunteers(query: LiveVolunteersQueryInput): Promise<{ - userId: string; - name: string | null; - email: string; - latitude: number; - longitude: number; - lastRecordedAt: string; - recentTrail: [number, number][]; - canvassSessionId: string | null; - trackingSessionId: string; - }[]>; - /** Get the full route for a tracking session, verifying ownership. */ - getMySessionRoute(trackingSessionId: string, userId: string): Promise<{ - coordinates: [number, number][]; - events: { - latitude: number; - longitude: number; - eventType: import(".prisma/client").$Enums.TrackPointEvent; - recordedAt: string; - }[]; - totalPoints: number; - } | null>; - /** Get the full route for a tracking session. */ - getSessionRoute(trackingSessionId: string): Promise<{ - coordinates: [number, number][]; - events: { - latitude: number; - longitude: number; - eventType: import(".prisma/client").$Enums.TrackPointEvent; - recordedAt: string; - }[]; - totalPoints: number; - }>; - /** Paginated list of historical tracking sessions. */ - getHistoricalSessions(query: HistoricalListQueryInput): Promise<{ - sessions: { - id: string; - userId: string; - userName: string | null; - userEmail: string; - startedAt: string; - endedAt: string | null; - totalPoints: number; - totalDistanceM: number; - canvassSessionId: string | null; - isActive: boolean; - }[]; - pagination: { - page: number; - limit: number; - total: number; - totalPages: number; - }; - }>; - /** Delete old track points and empty sessions. */ - cleanupOldData(retentionDays: number): Promise; - /** Mark stale tracking sessions as inactive. */ - closeStaleTrackingSessions(minutes: number): Promise; -} -export declare const trackingService: TrackingService; -export {}; -//# sourceMappingURL=tracking.service.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/map/tracking/tracking.service.d.ts.map b/api/dist/modules/map/tracking/tracking.service.d.ts.map deleted file mode 100644 index 31ddaea4..00000000 --- a/api/dist/modules/map/tracking/tracking.service.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tracking.service.d.ts","sourceRoot":"","sources":["../../../../src/modules/map/tracking/tracking.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAIxC,OAAO,KAAK,EACV,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,wBAAwB,EACxB,wBAAwB,EACzB,MAAM,oBAAoB,CAAC;AAI5B,cAAM,eAAe;IACnB,0DAA0D;IACpD,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB;;;;;;;;;;;;;IAkB3D,8BAA8B;IACxB,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;;;;;;;;;;;;;IAYlD,2DAA2D;IACrD,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB;;;;IA4D7E,kDAAkD;IAC5C,gBAAgB,CAAC,MAAM,EAAE,MAAM;;;;;;;;;;;;;IAMrC,8DAA8D;IACxD,kBAAkB,CAAC,iBAAiB,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB;;;;;;;;;;;;;IAO1E,gFAAgF;IAC1E,iBAAiB,CAAC,KAAK,EAAE,wBAAwB;;;;;;;;;;;IAyCvD,sEAAsE;IAChE,iBAAiB,CAAC,iBAAiB,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;;;;;;;;;;IAQjE,iDAAiD;IAC3C,eAAe,CAAC,iBAAiB,EAAE,MAAM;;;;;;;;;;IA2B/C,sDAAsD;IAChD,qBAAqB,CAAC,KAAK,EAAE,wBAAwB;;;;;;;;;;;;;;;;;;;;IA6C3D,kDAAkD;IAC5C,cAAc,CAAC,aAAa,EAAE,MAAM;IA2B1C,gDAAgD;IAC1C,0BAA0B,CAAC,OAAO,EAAE,MAAM;CAkBjD;AAED,eAAO,MAAM,eAAe,iBAAwB,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/map/tracking/tracking.service.js b/api/dist/modules/map/tracking/tracking.service.js deleted file mode 100644 index feda29a7..00000000 --- a/api/dist/modules/map/tracking/tracking.service.js +++ /dev/null @@ -1,260 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.trackingService = void 0; -const client_1 = require("@prisma/client"); -const database_1 = require("../../../config/database"); -const spatial_1 = require("../../../utils/spatial"); -const logger_1 = require("../../../utils/logger"); -const MAX_DISTANCE_JUMP_M = 1000; // Skip distance calc for GPS glitches > 1km -class TrackingService { - /** Start or resume a tracking session for a volunteer. */ - async startSession(userId, data) { - // Check for existing active session — reuse it - const existing = await database_1.prisma.trackingSession.findFirst({ - where: { userId, isActive: true }, - }); - if (existing) - return existing; - return database_1.prisma.trackingSession.create({ - data: { - userId, - canvassSessionId: data.canvassSessionId ?? null, - lastLatitude: data.latitude != null ? new client_1.Prisma.Decimal(data.latitude) : null, - lastLongitude: data.longitude != null ? new client_1.Prisma.Decimal(data.longitude) : null, - lastRecordedAt: data.latitude != null ? new Date() : null, - }, - }); - } - /** End a tracking session. */ - async endSession(sessionId, userId) { - const session = await database_1.prisma.trackingSession.findFirst({ - where: { id: sessionId, userId, isActive: true }, - }); - if (!session) - return null; - return database_1.prisma.trackingSession.update({ - where: { id: sessionId }, - data: { isActive: false, endedAt: new Date() }, - }); - } - /** Submit a batch of GPS points for a tracking session. */ - async submitPoints(sessionId, userId, data) { - const session = await database_1.prisma.trackingSession.findFirst({ - where: { id: sessionId, userId, isActive: true }, - }); - if (!session) { - throw Object.assign(new Error('Active tracking session not found'), { statusCode: 404 }); - } - const { points } = data; - // Batch insert all points - await database_1.prisma.trackPoint.createMany({ - data: points.map((p) => ({ - trackingSessionId: sessionId, - latitude: new client_1.Prisma.Decimal(p.latitude), - longitude: new client_1.Prisma.Decimal(p.longitude), - accuracy: p.accuracy ?? null, - recordedAt: new Date(p.recordedAt), - eventType: p.eventType ?? null, - })), - }); - // Calculate incremental distance - let addedDistance = 0; - let prevLat = session.lastLatitude ? Number(session.lastLatitude) : null; - let prevLng = session.lastLongitude ? Number(session.lastLongitude) : null; - // Sort points by recordedAt for correct distance calculation - const sorted = [...points].sort((a, b) => new Date(a.recordedAt).getTime() - new Date(b.recordedAt).getTime()); - for (const p of sorted) { - if (prevLat != null && prevLng != null) { - const d = (0, spatial_1.haversineDistance)(prevLat, prevLng, p.latitude, p.longitude); - if (d <= MAX_DISTANCE_JUMP_M) { - addedDistance += d; - } - } - prevLat = p.latitude; - prevLng = p.longitude; - } - const lastPoint = sorted[sorted.length - 1]; - // Update session summary fields - await database_1.prisma.trackingSession.update({ - where: { id: sessionId }, - data: { - totalPoints: { increment: points.length }, - totalDistanceM: { increment: addedDistance }, - lastLatitude: new client_1.Prisma.Decimal(lastPoint.latitude), - lastLongitude: new client_1.Prisma.Decimal(lastPoint.longitude), - lastRecordedAt: new Date(lastPoint.recordedAt), - }, - }); - return { inserted: points.length, addedDistanceM: Math.round(addedDistance) }; - } - /** Get the active tracking session for a user. */ - async getActiveSession(userId) { - return database_1.prisma.trackingSession.findFirst({ - where: { userId, isActive: true }, - }); - } - /** Link a canvass session to an existing tracking session. */ - async linkCanvassSession(trackingSessionId, data) { - return database_1.prisma.trackingSession.update({ - where: { id: trackingSessionId }, - data: { canvassSessionId: data.canvassSessionId }, - }); - } - /** Get all active volunteers with their recent trail for the admin live map. */ - async getLiveVolunteers(query) { - const cutoff = new Date(Date.now() - query.staleCutoffMinutes * 60 * 1000); - const sessions = await database_1.prisma.trackingSession.findMany({ - where: { - isActive: true, - lastRecordedAt: { gte: cutoff }, - }, - include: { - user: { select: { id: true, name: true, email: true } }, - }, - orderBy: { lastRecordedAt: 'desc' }, - }); - // For each session, fetch last 20 track points for the trail polyline - const results = await Promise.all(sessions.map(async (s) => { - const recentPoints = await database_1.prisma.trackPoint.findMany({ - where: { trackingSessionId: s.id }, - orderBy: { recordedAt: 'desc' }, - take: 20, - select: { latitude: true, longitude: true }, - }); - return { - userId: s.user.id, - name: s.user.name, - email: s.user.email, - latitude: Number(s.lastLatitude), - longitude: Number(s.lastLongitude), - lastRecordedAt: s.lastRecordedAt?.toISOString() ?? s.startedAt.toISOString(), - recentTrail: recentPoints.reverse().map((p) => [Number(p.latitude), Number(p.longitude)]), - canvassSessionId: s.canvassSessionId, - trackingSessionId: s.id, - }; - })); - return results; - } - /** Get the full route for a tracking session, verifying ownership. */ - async getMySessionRoute(trackingSessionId, userId) { - const session = await database_1.prisma.trackingSession.findFirst({ - where: { id: trackingSessionId, userId }, - }); - if (!session) - return null; - return this.getSessionRoute(trackingSessionId); - } - /** Get the full route for a tracking session. */ - async getSessionRoute(trackingSessionId) { - const points = await database_1.prisma.trackPoint.findMany({ - where: { trackingSessionId }, - orderBy: { recordedAt: 'asc' }, - select: { - latitude: true, - longitude: true, - accuracy: true, - recordedAt: true, - eventType: true, - }, - }); - return { - coordinates: points.map((p) => [Number(p.latitude), Number(p.longitude)]), - events: points - .filter((p) => p.eventType != null) - .map((p) => ({ - latitude: Number(p.latitude), - longitude: Number(p.longitude), - eventType: p.eventType, - recordedAt: p.recordedAt.toISOString(), - })), - totalPoints: points.length, - }; - } - /** Paginated list of historical tracking sessions. */ - async getHistoricalSessions(query) { - const where = {}; - if (query.userId) - where.userId = query.userId; - if (query.from || query.to) { - where.startedAt = {}; - if (query.from) - where.startedAt.gte = new Date(query.from); - if (query.to) - where.startedAt.lte = new Date(query.to); - } - const [sessions, total] = await Promise.all([ - database_1.prisma.trackingSession.findMany({ - where, - include: { - user: { select: { id: true, name: true, email: true } }, - }, - orderBy: { startedAt: 'desc' }, - skip: (query.page - 1) * query.limit, - take: query.limit, - }), - database_1.prisma.trackingSession.count({ where }), - ]); - return { - sessions: sessions.map((s) => ({ - id: s.id, - userId: s.user.id, - userName: s.user.name, - userEmail: s.user.email, - startedAt: s.startedAt.toISOString(), - endedAt: s.endedAt?.toISOString() ?? null, - totalPoints: s.totalPoints, - totalDistanceM: s.totalDistanceM, - canvassSessionId: s.canvassSessionId, - isActive: s.isActive, - })), - pagination: { - page: query.page, - limit: query.limit, - total, - totalPages: Math.ceil(total / query.limit), - }, - }; - } - /** Delete old track points and empty sessions. */ - async cleanupOldData(retentionDays) { - const cutoff = new Date(Date.now() - retentionDays * 24 * 60 * 60 * 1000); - const { count: deletedPoints } = await database_1.prisma.trackPoint.deleteMany({ - where: { recordedAt: { lt: cutoff } }, - }); - // Delete sessions with zero remaining points that are inactive - const emptySessions = await database_1.prisma.trackingSession.findMany({ - where: { - isActive: false, - trackPoints: { none: {} }, - }, - select: { id: true }, - }); - if (emptySessions.length > 0) { - await database_1.prisma.trackingSession.deleteMany({ - where: { id: { in: emptySessions.map((s) => s.id) } }, - }); - } - if (deletedPoints > 0 || emptySessions.length > 0) { - logger_1.logger.info(`Tracking cleanup: deleted ${deletedPoints} points, ${emptySessions.length} empty sessions`); - } - } - /** Mark stale tracking sessions as inactive. */ - async closeStaleTrackingSessions(minutes) { - const cutoff = new Date(Date.now() - minutes * 60 * 1000); - const { count } = await database_1.prisma.trackingSession.updateMany({ - where: { - isActive: true, - OR: [ - { lastRecordedAt: { lt: cutoff } }, - { lastRecordedAt: null, startedAt: { lt: cutoff } }, - ], - }, - data: { isActive: false, endedAt: new Date() }, - }); - if (count > 0) { - logger_1.logger.info(`Closed ${count} stale tracking sessions (no data for ${minutes}min)`); - } - } -} -exports.trackingService = new TrackingService(); -//# sourceMappingURL=tracking.service.js.map \ No newline at end of file diff --git a/api/dist/modules/map/tracking/tracking.service.js.map b/api/dist/modules/map/tracking/tracking.service.js.map deleted file mode 100644 index 9c945054..00000000 --- a/api/dist/modules/map/tracking/tracking.service.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"tracking.service.js","sourceRoot":"","sources":["../../../../src/modules/map/tracking/tracking.service.ts"],"names":[],"mappings":";;;AAAA,2CAAwC;AACxC,uDAAkD;AAClD,oDAA2D;AAC3D,kDAA+C;AAS/C,MAAM,mBAAmB,GAAG,IAAI,CAAC,CAAC,4CAA4C;AAE9E,MAAM,eAAe;IACnB,0DAA0D;IAC1D,KAAK,CAAC,YAAY,CAAC,MAAc,EAAE,IAAwB;QACzD,+CAA+C;QA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;QACrF,CAAC;IACH,CAAC;CACF;AAEY,QAAA,eAAe,GAAG,IAAI,eAAe,EAAE,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/media/db/index.d.ts b/api/dist/modules/media/db/index.d.ts deleted file mode 100644 index 89b84355..00000000 --- a/api/dist/modules/media/db/index.d.ts +++ /dev/null @@ -1,8 +0,0 @@ -import pg from 'pg'; -import * as schema from './schema'; -export declare const db: import("drizzle-orm/node-postgres").NodePgDatabase & { - $client: pg.Pool; -}; -export { schema }; -export declare function closeDrizzleConnection(): Promise; -//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/media/db/index.d.ts.map b/api/dist/modules/media/db/index.d.ts.map deleted file mode 100644 index 949318d5..00000000 --- a/api/dist/modules/media/db/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/media/db/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AAUnC,eAAO,MAAM,EAAE;;CAA4B,CAAC;AAG5C,OAAO,EAAE,MAAM,EAAE,CAAC;AAGlB,wBAAsB,sBAAsB,kBAE3C"} \ No newline at end of file diff --git a/api/dist/modules/media/db/index.js b/api/dist/modules/media/db/index.js deleted file mode 100644 index 127d56af..00000000 --- a/api/dist/modules/media/db/index.js +++ /dev/null @@ -1,57 +0,0 @@ -"use strict"; -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - var desc = Object.getOwnPropertyDescriptor(m, k); - if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { - desc = { enumerable: true, get: function() { return m[k]; } }; - } - Object.defineProperty(o, k2, desc); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || (function () { - var ownKeys = function(o) { - ownKeys = Object.getOwnPropertyNames || function (o) { - var ar = []; - for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; - return ar; - }; - return ownKeys(o); - }; - return function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); - __setModuleDefault(result, mod); - return result; - }; -})(); -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.schema = exports.db = void 0; -exports.closeDrizzleConnection = closeDrizzleConnection; -const node_postgres_1 = require("drizzle-orm/node-postgres"); -const pg_1 = __importDefault(require("pg")); -const env_1 = require("../../../config/env"); -const schema = __importStar(require("./schema")); -exports.schema = schema; -const { Pool } = pg_1.default; -// Create PostgreSQL connection pool for Drizzle -const pool = new Pool({ - connectionString: env_1.env.DATABASE_URL, -}); -// Drizzle database instance with schema -exports.db = (0, node_postgres_1.drizzle)(pool, { schema }); -// Graceful shutdown -async function closeDrizzleConnection() { - await pool.end(); -} -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/api/dist/modules/media/db/index.js.map b/api/dist/modules/media/db/index.js.map deleted file mode 100644 index 11c57017..00000000 --- a/api/dist/modules/media/db/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/modules/media/db/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,wDAEC;AArBD,6DAAoD;AACpD,4CAAoB;AACpB,6CAA0C;AAC1C,iDAAmC;AAa1B,wBAAM;AAXf,MAAM,EAAE,IAAI,EAAE,GAAG,YAAE,CAAC;AAEpB,gDAAgD;AAChD,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC;IACpB,gBAAgB,EAAE,SAAG,CAAC,YAAY;CACnC,CAAC,CAAC;AAEH,wCAAwC;AAC3B,QAAA,EAAE,GAAG,IAAA,uBAAO,EAAC,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;AAK5C,oBAAoB;AACb,KAAK,UAAU,sBAAsB;IAC1C,MAAM,IAAI,CAAC,GAAG,EAAE,CAAC;AACnB,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/media/db/schema.d.ts b/api/dist/modules/media/db/schema.d.ts deleted file mode 100644 index 44a451b8..00000000 --- a/api/dist/modules/media/db/schema.d.ts +++ /dev/null @@ -1,16458 +0,0 @@ -export declare const DIRECTORY_TYPES: readonly ["studios", "gifs", "private", "inbox", "curated", "playback", "compilations", "videos", "highlights"]; -export type DirectoryType = typeof DIRECTORY_TYPES[number]; -export declare const videos: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "videos"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "videos"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - path: import("drizzle-orm/pg-core").PgColumn<{ - name: "path"; - tableName: "videos"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - filename: import("drizzle-orm/pg-core").PgColumn<{ - name: "filename"; - tableName: "videos"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - producer: import("drizzle-orm/pg-core").PgColumn<{ - name: "producer"; - tableName: "videos"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - creator: import("drizzle-orm/pg-core").PgColumn<{ - name: "creator"; - tableName: "videos"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - title: import("drizzle-orm/pg-core").PgColumn<{ - name: "title"; - tableName: "videos"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - durationSeconds: import("drizzle-orm/pg-core").PgColumn<{ - name: "duration_seconds"; - tableName: "videos"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - quality: import("drizzle-orm/pg-core").PgColumn<{ - name: "quality"; - tableName: "videos"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - orientation: import("drizzle-orm/pg-core").PgColumn<{ - name: "orientation"; - tableName: "videos"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - hasAudio: import("drizzle-orm/pg-core").PgColumn<{ - name: "has_audio"; - tableName: "videos"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - fileSize: import("drizzle-orm/pg-core").PgColumn<{ - name: "file_size"; - tableName: "videos"; - dataType: "number"; - columnType: "PgBigInt53"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - fileHash: import("drizzle-orm/pg-core").PgColumn<{ - name: "file_hash"; - tableName: "videos"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - width: import("drizzle-orm/pg-core").PgColumn<{ - name: "width"; - tableName: "videos"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - height: import("drizzle-orm/pg-core").PgColumn<{ - name: "height"; - tableName: "videos"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - lastValidated: import("drizzle-orm/pg-core").PgColumn<{ - name: "last_validated"; - tableName: "videos"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - isValid: import("drizzle-orm/pg-core").PgColumn<{ - name: "is_valid"; - tableName: "videos"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - thumbnailPath: import("drizzle-orm/pg-core").PgColumn<{ - name: "thumbnail_path"; - tableName: "videos"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "videos"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - tags: import("drizzle-orm/pg-core").PgColumn<{ - name: "tags"; - tableName: "videos"; - dataType: "json"; - columnType: "PgJsonb"; - data: string[]; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: string[]; - }>; - directoryType: import("drizzle-orm/pg-core").PgColumn<{ - name: "directory_type"; - tableName: "videos"; - dataType: "string"; - columnType: "PgText"; - data: "studios" | "gifs" | "private" | "inbox" | "curated" | "playback" | "compilations" | "videos" | "highlights"; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: "studios" | "gifs" | "private" | "inbox" | "curated" | "playback" | "compilations" | "videos" | "highlights"; - }>; - publicViewCount: import("drizzle-orm/pg-core").PgColumn<{ - name: "public_view_count"; - tableName: "videos"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - publicUpvoteCount: import("drizzle-orm/pg-core").PgColumn<{ - name: "public_upvote_count"; - tableName: "videos"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - publicCommentCount: import("drizzle-orm/pg-core").PgColumn<{ - name: "public_comment_count"; - tableName: "videos"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - publicCompletionCount: import("drizzle-orm/pg-core").PgColumn<{ - name: "public_completion_count"; - tableName: "videos"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - publicTotalWatchTime: import("drizzle-orm/pg-core").PgColumn<{ - name: "public_total_watch_time"; - tableName: "videos"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - movedFromPublicAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "moved_from_public_at"; - tableName: "videos"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - originalFilename: import("drizzle-orm/pg-core").PgColumn<{ - name: "original_filename"; - tableName: "videos"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - originalPath: import("drizzle-orm/pg-core").PgColumn<{ - name: "original_path"; - tableName: "videos"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - standardizedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "standardized_at"; - tableName: "videos"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export declare const compilations: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "compilations"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "compilations"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - filename: import("drizzle-orm/pg-core").PgColumn<{ - name: "filename"; - tableName: "compilations"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - path: import("drizzle-orm/pg-core").PgColumn<{ - name: "path"; - tableName: "compilations"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - durationSeconds: import("drizzle-orm/pg-core").PgColumn<{ - name: "duration_seconds"; - tableName: "compilations"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - videoIds: import("drizzle-orm/pg-core").PgColumn<{ - name: "video_ids"; - tableName: "compilations"; - dataType: "json"; - columnType: "PgJsonb"; - data: number[]; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: number[]; - }>; - settings: import("drizzle-orm/pg-core").PgColumn<{ - name: "settings"; - tableName: "compilations"; - dataType: "json"; - columnType: "PgJsonb"; - data: Record; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: Record; - }>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "compilations"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export type ResourceCategory = 'gpu_ai' | 'gpu_encode' | 'cpu'; -export type JobStatus = 'pending' | 'queued' | 'running' | 'completed' | 'failed' | 'cancelled'; -export declare const jobs: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "jobs"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "jobs"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - type: import("drizzle-orm/pg-core").PgColumn<{ - name: "type"; - tableName: "jobs"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - status: import("drizzle-orm/pg-core").PgColumn<{ - name: "status"; - tableName: "jobs"; - dataType: "string"; - columnType: "PgText"; - data: JobStatus; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: JobStatus; - }>; - progress: import("drizzle-orm/pg-core").PgColumn<{ - name: "progress"; - tableName: "jobs"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - log: import("drizzle-orm/pg-core").PgColumn<{ - name: "log"; - tableName: "jobs"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - params: import("drizzle-orm/pg-core").PgColumn<{ - name: "params"; - tableName: "jobs"; - dataType: "json"; - columnType: "PgJsonb"; - data: Record; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: Record; - }>; - startedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "started_at"; - tableName: "jobs"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - completedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "completed_at"; - tableName: "jobs"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "jobs"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - resourceCategory: import("drizzle-orm/pg-core").PgColumn<{ - name: "resource_category"; - tableName: "jobs"; - dataType: "string"; - columnType: "PgText"; - data: ResourceCategory; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: ResourceCategory; - }>; - vramRequired: import("drizzle-orm/pg-core").PgColumn<{ - name: "vram_required"; - tableName: "jobs"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - queuePosition: import("drizzle-orm/pg-core").PgColumn<{ - name: "queue_position"; - tableName: "jobs"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - waitingReason: import("drizzle-orm/pg-core").PgColumn<{ - name: "waiting_reason"; - tableName: "jobs"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - priority: import("drizzle-orm/pg-core").PgColumn<{ - name: "priority"; - tableName: "jobs"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - pipelineId: import("drizzle-orm/pg-core").PgColumn<{ - name: "pipeline_id"; - tableName: "jobs"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - pipelineStepId: import("drizzle-orm/pg-core").PgColumn<{ - name: "pipeline_step_id"; - tableName: "jobs"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export type Video = typeof videos.$inferSelect; -export type NewVideo = typeof videos.$inferInsert; -export type Compilation = typeof compilations.$inferSelect; -export type NewCompilation = typeof compilations.$inferInsert; -export type Job = typeof jobs.$inferSelect; -export type NewJob = typeof jobs.$inferInsert; -export type JobType = 'compilation' | 'scan' | 'public_scan' | 'organize' | 'organize_studio' | 'reencode_streaming' | 'compile_random' | 'compile_quad' | 'compile_quad_horizontal' | 'compile_triple_vertical' | 'compile_mega' | 'compile_gif' | 'generate_gif' | 'fetch' | 'digest' | 'digest_generate' | 'clip_generate' | 'highlight_generate' | 'tag_generation' | 'scene_extract' | 'clip_extract_only' | 'auto_organize_publish'; -export interface ReencodeParams { - dryRun?: boolean; - forceCpu?: boolean; - debug?: boolean; - skipHevc?: boolean; - forceAll?: boolean; - targetDir?: string; - singleFile?: string; -} -export interface ClipCountParams { - clipCount: 30 | 60 | 100; - excludedDirs?: string[]; -} -export interface ClipSetsParams { - clipSets: 30 | 60 | 100; - excludedDirs?: string[]; -} -export interface DurationOverlayParams { - duration: 30 | 45 | 60 | 90 | 120; - overlaySource: string; - excludedDirs?: string[]; -} -export interface CreatorParams { - creator: string; - excludedDirs?: string[]; -} -export interface GenerateGifParams { - videoPath: string; - segmentDuration?: number; -} -export interface FetchParams { - urls: string[]; - mode: 'single' | 'batch'; -} -export interface DigestParams { - digestId: number; - videoId: number; -} -export interface DigestGenerateParams { - digestId: number; - videoId: number; - adCutSpec?: AdCutSpec; -} -export interface ClipGenerateParams { - digestId: number; - options?: { - clipIds?: number[]; - burnCaptions?: boolean; - captionStyle?: CaptionStyle; - editedTranscript?: Array<{ - index: number; - text: string; - }>; - closingAdImagePath?: string; - closingAdDuration?: number; - }; -} -export interface HighlightGenerateParams { - reactionId: number; - mediaId: number; - userId: number; - timestamp: number; - actualStartTime: number; - actualEndTime: number; - sourceMediaPath: string; - username: string; -} -export interface SceneExtractParams { - digestId: number; - videoId: number; - sceneIds?: number[]; - generateScenes?: boolean; - generateClips?: boolean; -} -export interface ClipExtractOnlyParams { - digestId: number; - videoId: number; - clipIds?: number[]; - generateScenes?: boolean; - generateClips?: boolean; -} -export interface DigestConfig { - positions?: string[]; - settings?: string[]; - activities?: string[]; - frameInterval?: number; - minClipDuration?: number; - maxAdDuration?: number; - transcribe?: boolean; - visionModel?: string; - textModel?: string; - customPrompts?: { - descriptionStage?: string; - taggingStage?: string; - classificationStage?: string; - synthesis?: string; - }; -} -export interface FrameAnalysis { - timestamp: number; - framePath: string; - performerCount: number; - performerBreakdown?: { - women: number; - men: number; - }; - genders: string[]; - position: string; - setting: string; - cameraAngle: string; - intensity: 'soft' | 'moderate' | 'intense'; - notableElements: string[]; - visualInterestScore: number; - description: string; - fullDescription?: string; - visualElements?: string[]; - atmosphere?: string; - extractedTags?: Array<{ - category: string; - value: string; - confidence: number; - source: 'matched' | 'visual' | 'inferred'; - }>; - isKeyMoment?: boolean; - keyMomentType?: 'intro' | 'narrative' | 'action_peak' | 'transition' | 'climax' | 'outro'; - keyMomentReason?: string; - shotType?: 'wide' | 'close-up' | 'medium' | 'pov' | 'overhead' | 'side'; - hasDialogue?: boolean; - eyeContact?: boolean; - isTextHeavy?: boolean; - estimatedTextPercentage?: number; - hasWatermark?: boolean; - watermarkType?: 'studio' | 'performer' | 'network' | 'copyright' | 'other'; - frameType?: 'sexual_content' | 'non_sexual' | 'text_overlay' | 'branding' | 'advertisement'; - isStaticSequence?: boolean; - faceDetection?: { - faces: Array<{ - bbox: [number, number, number, number]; - gender: 0 | 1; - age: number; - detScore: number; - trackId?: string; - embedding?: number[]; - }>; - count: number; - womenCount: number; - menCount: number; - avgAge: number; - source: 'face_service' | 'vision_model'; - serviceAvailable: boolean; - }; - joytagTags?: Array<{ - tag: string; - confidence: number; - category?: string; - mappedValue?: string; - }>; - joytagInferenceMs?: number; -} -export interface TranscriptSegment { - start: number; - end: number; - text: string; - words?: { - word: string; - start: number; - end: number; - }[]; -} -export interface DigestTag { - category: string; - value: string; - confidence: number; - evidence: string[]; - source?: 'vlm' | 'joytag' | 'merged'; -} -export interface ClipSuggestion { - startTime: number; - endTime: number; - reason: string; - type: 'visual' | 'audio' | 'both'; - interestScore: number; - tags: string[]; -} -export interface AdCutSpec { - totalDuration: number; - suggestedTitle: string; - clips: { - startTime: number; - endTime: number; - order: number; - transitionIn?: string; - }[]; -} -/** - * Individual prompt call within a stage. - * Tracks each AI model call with its prompt, response, and timing. - */ -export interface PromptCall { - id: string; - name: string; - type: 'vision' | 'text' | 'api'; - model?: string; - status: 'pending' | 'running' | 'complete' | 'failed'; - prompt?: string; - rawResponse?: string; - parsedResult?: unknown; - durationMs?: number; - error?: string; - timestamp?: number; - tokenCount?: number; - retryCount?: number; - parameters?: Record; -} -export interface StageResult { - stage: 'description' | 'tagging' | 'classification'; - rawResponse: string; - parsedResult: unknown; - durationMs: number; - model: string; - promptCalls?: PromptCall[]; -} -export interface FrameStageResults { - description?: StageResult; - tagging?: StageResult; - classification?: StageResult; -} -export type DigestStageResults = Record; -export declare const publicMedia: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "public_media"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "public_media"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - path: import("drizzle-orm/pg-core").PgColumn<{ - name: "path"; - tableName: "public_media"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - filename: import("drizzle-orm/pg-core").PgColumn<{ - name: "filename"; - tableName: "public_media"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - category: import("drizzle-orm/pg-core").PgColumn<{ - name: "category"; - tableName: "public_media"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - durationSeconds: import("drizzle-orm/pg-core").PgColumn<{ - name: "duration_seconds"; - tableName: "public_media"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - quality: import("drizzle-orm/pg-core").PgColumn<{ - name: "quality"; - tableName: "public_media"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - orientation: import("drizzle-orm/pg-core").PgColumn<{ - name: "orientation"; - tableName: "public_media"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - thumbnailPath: import("drizzle-orm/pg-core").PgColumn<{ - name: "thumbnail_path"; - tableName: "public_media"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - fileSize: import("drizzle-orm/pg-core").PgColumn<{ - name: "file_size"; - tableName: "public_media"; - dataType: "number"; - columnType: "PgBigInt53"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - viewCount: import("drizzle-orm/pg-core").PgColumn<{ - name: "view_count"; - tableName: "public_media"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - upvoteCount: import("drizzle-orm/pg-core").PgColumn<{ - name: "upvote_count"; - tableName: "public_media"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - commentCount: import("drizzle-orm/pg-core").PgColumn<{ - name: "comment_count"; - tableName: "public_media"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - finishCount: import("drizzle-orm/pg-core").PgColumn<{ - name: "finish_count"; - tableName: "public_media"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - totalWatchTime: import("drizzle-orm/pg-core").PgColumn<{ - name: "total_watch_time"; - tableName: "public_media"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "public_media"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - isLocked: import("drizzle-orm/pg-core").PgColumn<{ - name: "is_locked"; - tableName: "public_media"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - lockedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "locked_at"; - tableName: "public_media"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - lockedBy: import("drizzle-orm/pg-core").PgColumn<{ - name: "locked_by"; - tableName: "public_media"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - position: import("drizzle-orm/pg-core").PgColumn<{ - name: "position"; - tableName: "public_media"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - uploaderId: import("drizzle-orm/pg-core").PgColumn<{ - name: "uploader_id"; - tableName: "public_media"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export declare const sessions: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "sessions"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "sessions"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "sessions"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - lastSeenAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "last_seen_at"; - tableName: "sessions"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - ipAddress: import("drizzle-orm/pg-core").PgColumn<{ - name: "ip_address"; - tableName: "sessions"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userAgent: import("drizzle-orm/pg-core").PgColumn<{ - name: "user_agent"; - tableName: "sessions"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - deviceType: import("drizzle-orm/pg-core").PgColumn<{ - name: "device_type"; - tableName: "sessions"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - browser: import("drizzle-orm/pg-core").PgColumn<{ - name: "browser"; - tableName: "sessions"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - os: import("drizzle-orm/pg-core").PgColumn<{ - name: "os"; - tableName: "sessions"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - country: import("drizzle-orm/pg-core").PgColumn<{ - name: "country"; - tableName: "sessions"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - countryName: import("drizzle-orm/pg-core").PgColumn<{ - name: "country_name"; - tableName: "sessions"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - region: import("drizzle-orm/pg-core").PgColumn<{ - name: "region"; - tableName: "sessions"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - city: import("drizzle-orm/pg-core").PgColumn<{ - name: "city"; - tableName: "sessions"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - timezone: import("drizzle-orm/pg-core").PgColumn<{ - name: "timezone"; - tableName: "sessions"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - latitude: import("drizzle-orm/pg-core").PgColumn<{ - name: "latitude"; - tableName: "sessions"; - dataType: "number"; - columnType: "PgReal"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - longitude: import("drizzle-orm/pg-core").PgColumn<{ - name: "longitude"; - tableName: "sessions"; - dataType: "number"; - columnType: "PgReal"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userId: import("drizzle-orm/pg-core").PgColumn<{ - name: "user_id"; - tableName: "sessions"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - firstSeenAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "first_seen_at"; - tableName: "sessions"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - visitCount: import("drizzle-orm/pg-core").PgColumn<{ - name: "visit_count"; - tableName: "sessions"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export declare const upvotes: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "upvotes"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "upvotes"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - mediaId: import("drizzle-orm/pg-core").PgColumn<{ - name: "media_id"; - tableName: "upvotes"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - sessionId: import("drizzle-orm/pg-core").PgColumn<{ - name: "session_id"; - tableName: "upvotes"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "upvotes"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export declare const comments: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "comments"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "comments"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - mediaId: import("drizzle-orm/pg-core").PgColumn<{ - name: "media_id"; - tableName: "comments"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - sessionId: import("drizzle-orm/pg-core").PgColumn<{ - name: "session_id"; - tableName: "comments"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userId: import("drizzle-orm/pg-core").PgColumn<{ - name: "user_id"; - tableName: "comments"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - content: import("drizzle-orm/pg-core").PgColumn<{ - name: "content"; - tableName: "comments"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "comments"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - safetyStatus: import("drizzle-orm/pg-core").PgColumn<{ - name: "safety_status"; - tableName: "comments"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - safetyCheckedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "safety_checked_at"; - tableName: "comments"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - safetyCategories: import("drizzle-orm/pg-core").PgColumn<{ - name: "safety_categories"; - tableName: "comments"; - dataType: "json"; - columnType: "PgJsonb"; - data: string[]; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: string[]; - }>; - safetyReasoning: import("drizzle-orm/pg-core").PgColumn<{ - name: "safety_reasoning"; - tableName: "comments"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - isHidden: import("drizzle-orm/pg-core").PgColumn<{ - name: "is_hidden"; - tableName: "comments"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - hiddenAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "hidden_at"; - tableName: "comments"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - hiddenReason: import("drizzle-orm/pg-core").PgColumn<{ - name: "hidden_reason"; - tableName: "comments"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - moderationNotes: import("drizzle-orm/pg-core").PgColumn<{ - name: "moderation_notes"; - tableName: "comments"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export declare const views: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "views"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "views"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - mediaId: import("drizzle-orm/pg-core").PgColumn<{ - name: "media_id"; - tableName: "views"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - sessionId: import("drizzle-orm/pg-core").PgColumn<{ - name: "session_id"; - tableName: "views"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - watchTimeSeconds: import("drizzle-orm/pg-core").PgColumn<{ - name: "watch_time_seconds"; - tableName: "views"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - lastUpdated: import("drizzle-orm/pg-core").PgColumn<{ - name: "last_updated"; - tableName: "views"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "views"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export type PublicMedia = typeof publicMedia.$inferSelect; -export type NewPublicMedia = typeof publicMedia.$inferInsert; -export type Session = typeof sessions.$inferSelect; -export type NewSession = typeof sessions.$inferInsert; -export type Upvote = typeof upvotes.$inferSelect; -export type NewUpvote = typeof upvotes.$inferInsert; -export type Comment = typeof comments.$inferSelect; -export type NewComment = typeof comments.$inferInsert; -export type View = typeof views.$inferSelect; -export type NewView = typeof views.$inferInsert; -export declare const v2Users: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "users"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "users"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - email: import("drizzle-orm/pg-core").PgColumn<{ - name: "email"; - tableName: "users"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - password: import("drizzle-orm/pg-core").PgColumn<{ - name: "password"; - tableName: "users"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - name: import("drizzle-orm/pg-core").PgColumn<{ - name: "name"; - tableName: "users"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - phone: import("drizzle-orm/pg-core").PgColumn<{ - name: "phone"; - tableName: "users"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - role: import("drizzle-orm/pg-core").PgColumn<{ - name: "role"; - tableName: "users"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - status: import("drizzle-orm/pg-core").PgColumn<{ - name: "status"; - tableName: "users"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - permissions: import("drizzle-orm/pg-core").PgColumn<{ - name: "permissions"; - tableName: "users"; - dataType: "json"; - columnType: "PgJsonb"; - data: unknown; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdVia: import("drizzle-orm/pg-core").PgColumn<{ - name: "createdVia"; - tableName: "users"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - expiresAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "expiresAt"; - tableName: "users"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - expireDays: import("drizzle-orm/pg-core").PgColumn<{ - name: "expireDays"; - tableName: "users"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - lastLoginAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "lastLoginAt"; - tableName: "users"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - emailVerified: import("drizzle-orm/pg-core").PgColumn<{ - name: "emailVerified"; - tableName: "users"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "createdAt"; - tableName: "users"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - updatedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "updatedAt"; - tableName: "users"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export declare const mediaUsers: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "media_users"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "media_users"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - username: import("drizzle-orm/pg-core").PgColumn<{ - name: "username"; - tableName: "media_users"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - email: import("drizzle-orm/pg-core").PgColumn<{ - name: "email"; - tableName: "media_users"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - passwordHash: import("drizzle-orm/pg-core").PgColumn<{ - name: "password_hash"; - tableName: "media_users"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - role: import("drizzle-orm/pg-core").PgColumn<{ - name: "role"; - tableName: "media_users"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - status: import("drizzle-orm/pg-core").PgColumn<{ - name: "status"; - tableName: "media_users"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - emailVerified: import("drizzle-orm/pg-core").PgColumn<{ - name: "email_verified"; - tableName: "media_users"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - linkedSessionId: import("drizzle-orm/pg-core").PgColumn<{ - name: "linked_session_id"; - tableName: "media_users"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "media_users"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - approvedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "approved_at"; - tableName: "media_users"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - approvedBy: import("drizzle-orm/pg-core").PgColumn<{ - name: "approved_by"; - tableName: "media_users"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - lastLoginAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "last_login_at"; - tableName: "media_users"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - isTrusted: import("drizzle-orm/pg-core").PgColumn<{ - name: "is_trusted"; - tableName: "media_users"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - maxUploadDurationSeconds: import("drizzle-orm/pg-core").PgColumn<{ - name: "max_upload_duration_seconds"; - tableName: "media_users"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - autoAcceptUploads: import("drizzle-orm/pg-core").PgColumn<{ - name: "auto_accept_uploads"; - tableName: "media_users"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - trustedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "trusted_at"; - tableName: "media_users"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - trustedBy: import("drizzle-orm/pg-core").PgColumn<{ - name: "trusted_by"; - tableName: "media_users"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - defaultPlaylistId: import("drizzle-orm/pg-core").PgColumn<{ - name: "default_playlist_id"; - tableName: "media_users"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - socialLinksPublic: import("drizzle-orm/pg-core").PgColumn<{ - name: "social_links_public"; - tableName: "media_users"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - subscriptionStatus: import("drizzle-orm/pg-core").PgColumn<{ - name: "subscription_status"; - tableName: "media_users"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - subscriptionPlanId: import("drizzle-orm/pg-core").PgColumn<{ - name: "subscription_plan_id"; - tableName: "media_users"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - subscriptionEndDate: import("drizzle-orm/pg-core").PgColumn<{ - name: "subscription_end_date"; - tableName: "media_users"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - lifetimeMember: import("drizzle-orm/pg-core").PgColumn<{ - name: "lifetime_member"; - tableName: "media_users"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - totalPaidCAD: import("drizzle-orm/pg-core").PgColumn<{ - name: "total_paid_cad"; - tableName: "media_users"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - lastModerationAction: import("drizzle-orm/pg-core").PgColumn<{ - name: "last_moderation_action"; - tableName: "media_users"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export declare const authTokens: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "auth_tokens"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "auth_tokens"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userId: import("drizzle-orm/pg-core").PgColumn<{ - name: "user_id"; - tableName: "auth_tokens"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - token: import("drizzle-orm/pg-core").PgColumn<{ - name: "token"; - tableName: "auth_tokens"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - type: import("drizzle-orm/pg-core").PgColumn<{ - name: "type"; - tableName: "auth_tokens"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - expiresAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "expires_at"; - tableName: "auth_tokens"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "auth_tokens"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export declare const sessionBans: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "session_bans"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "session_bans"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - sessionId: import("drizzle-orm/pg-core").PgColumn<{ - name: "session_id"; - tableName: "session_bans"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - reason: import("drizzle-orm/pg-core").PgColumn<{ - name: "reason"; - tableName: "session_bans"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - bannedBy: import("drizzle-orm/pg-core").PgColumn<{ - name: "banned_by"; - tableName: "session_bans"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "session_bans"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - expiresAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "expires_at"; - tableName: "session_bans"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export declare const commentModeration: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "comment_moderation"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "comment_moderation"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - commentId: import("drizzle-orm/pg-core").PgColumn<{ - name: "comment_id"; - tableName: "comment_moderation"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - status: import("drizzle-orm/pg-core").PgColumn<{ - name: "status"; - tableName: "comment_moderation"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - moderatedBy: import("drizzle-orm/pg-core").PgColumn<{ - name: "moderated_by"; - tableName: "comment_moderation"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - moderatedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "moderated_at"; - tableName: "comment_moderation"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - reason: import("drizzle-orm/pg-core").PgColumn<{ - name: "reason"; - tableName: "comment_moderation"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export declare const emailVerificationTokens: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "email_verification_tokens"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "email_verification_tokens"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userId: import("drizzle-orm/pg-core").PgColumn<{ - name: "user_id"; - tableName: "email_verification_tokens"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - token: import("drizzle-orm/pg-core").PgColumn<{ - name: "token"; - tableName: "email_verification_tokens"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - expiresAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "expires_at"; - tableName: "email_verification_tokens"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "email_verification_tokens"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export declare const passwordResetTokens: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "password_reset_tokens"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "password_reset_tokens"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userId: import("drizzle-orm/pg-core").PgColumn<{ - name: "user_id"; - tableName: "password_reset_tokens"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - token: import("drizzle-orm/pg-core").PgColumn<{ - name: "token"; - tableName: "password_reset_tokens"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - expiresAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "expires_at"; - tableName: "password_reset_tokens"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "password_reset_tokens"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - usedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "used_at"; - tableName: "password_reset_tokens"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export declare const emailChangeTokens: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "email_change_tokens"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "email_change_tokens"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userId: import("drizzle-orm/pg-core").PgColumn<{ - name: "user_id"; - tableName: "email_change_tokens"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - newEmail: import("drizzle-orm/pg-core").PgColumn<{ - name: "new_email"; - tableName: "email_change_tokens"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - token: import("drizzle-orm/pg-core").PgColumn<{ - name: "token"; - tableName: "email_change_tokens"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - expiresAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "expires_at"; - tableName: "email_change_tokens"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "email_change_tokens"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export type MediaUser = typeof mediaUsers.$inferSelect; -export type NewMediaUser = typeof mediaUsers.$inferInsert; -export type AuthToken = typeof authTokens.$inferSelect; -export type NewAuthToken = typeof authTokens.$inferInsert; -export type SessionBan = typeof sessionBans.$inferSelect; -export type NewSessionBan = typeof sessionBans.$inferInsert; -export type CommentModeration = typeof commentModeration.$inferSelect; -export type NewCommentModeration = typeof commentModeration.$inferInsert; -export type EmailVerificationToken = typeof emailVerificationTokens.$inferSelect; -export type NewEmailVerificationToken = typeof emailVerificationTokens.$inferInsert; -export type PasswordResetToken = typeof passwordResetTokens.$inferSelect; -export type NewPasswordResetToken = typeof passwordResetTokens.$inferInsert; -export type EmailChangeToken = typeof emailChangeTokens.$inferSelect; -export type NewEmailChangeToken = typeof emailChangeTokens.$inferInsert; -export type UserRole = 'admin' | 'user'; -export type UserStatus = 'pending' | 'approved' | 'banned'; -export type CommentModerationStatus = 'pending' | 'approved' | 'rejected'; -export type CommentSafetyStatus = 'pending' | 'safe' | 'flagged' | 'error'; -export declare const userAchievements: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "user_achievements"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "user_achievements"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userId: import("drizzle-orm/pg-core").PgColumn<{ - name: "user_id"; - tableName: "user_achievements"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - achievementId: import("drizzle-orm/pg-core").PgColumn<{ - name: "achievement_id"; - tableName: "user_achievements"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - unlockedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "unlocked_at"; - tableName: "user_achievements"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - progress: import("drizzle-orm/pg-core").PgColumn<{ - name: "progress"; - tableName: "user_achievements"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - notified: import("drizzle-orm/pg-core").PgColumn<{ - name: "notified"; - tableName: "user_achievements"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export declare const userStats: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "user_stats"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "user_stats"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userId: import("drizzle-orm/pg-core").PgColumn<{ - name: "user_id"; - tableName: "user_stats"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - totalWatchTimeSeconds: import("drizzle-orm/pg-core").PgColumn<{ - name: "total_watch_time_seconds"; - tableName: "user_stats"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - totalVideosWatched: import("drizzle-orm/pg-core").PgColumn<{ - name: "total_videos_watched"; - tableName: "user_stats"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - totalUpvotesGiven: import("drizzle-orm/pg-core").PgColumn<{ - name: "total_upvotes_given"; - tableName: "user_stats"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - totalCommentsMade: import("drizzle-orm/pg-core").PgColumn<{ - name: "total_comments_made"; - tableName: "user_stats"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - totalFinishes: import("drizzle-orm/pg-core").PgColumn<{ - name: "total_finishes"; - tableName: "user_stats"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - currentDayStreak: import("drizzle-orm/pg-core").PgColumn<{ - name: "current_day_streak"; - tableName: "user_stats"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - longestDayStreak: import("drizzle-orm/pg-core").PgColumn<{ - name: "longest_day_streak"; - tableName: "user_stats"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - lastActiveDate: import("drizzle-orm/pg-core").PgColumn<{ - name: "last_active_date"; - tableName: "user_stats"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - longestSingleSession: import("drizzle-orm/pg-core").PgColumn<{ - name: "longest_single_session"; - tableName: "user_stats"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - categoriesCompleted: import("drizzle-orm/pg-core").PgColumn<{ - name: "categories_completed"; - tableName: "user_stats"; - dataType: "json"; - columnType: "PgJsonb"; - data: string[]; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: string[]; - }>; - nightOwlCount: import("drizzle-orm/pg-core").PgColumn<{ - name: "night_owl_count"; - tableName: "user_stats"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - earlyBirdCount: import("drizzle-orm/pg-core").PgColumn<{ - name: "early_bird_count"; - tableName: "user_stats"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - updatedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "updated_at"; - tableName: "user_stats"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export declare const userFinishes: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "user_finishes"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "user_finishes"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userId: import("drizzle-orm/pg-core").PgColumn<{ - name: "user_id"; - tableName: "user_finishes"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - mediaId: import("drizzle-orm/pg-core").PgColumn<{ - name: "media_id"; - tableName: "user_finishes"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - sessionId: import("drizzle-orm/pg-core").PgColumn<{ - name: "session_id"; - tableName: "user_finishes"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "user_finishes"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export declare const REACTION_TYPES: readonly ["like", "love", "laugh", "wow", "sad", "angry"]; -export type ReactionType = typeof REACTION_TYPES[number]; -export declare const videoReactions: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "video_reactions"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "video_reactions"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userId: import("drizzle-orm/pg-core").PgColumn<{ - name: "user_id"; - tableName: "video_reactions"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - mediaId: import("drizzle-orm/pg-core").PgColumn<{ - name: "media_id"; - tableName: "video_reactions"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - reactionType: import("drizzle-orm/pg-core").PgColumn<{ - name: "reaction_type"; - tableName: "video_reactions"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - videoTimestamp: import("drizzle-orm/pg-core").PgColumn<{ - name: "video_timestamp"; - tableName: "video_reactions"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "video_reactions"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export type VideoReaction = typeof videoReactions.$inferSelect; -export type NewVideoReaction = typeof videoReactions.$inferInsert; -export declare const highlightCooldowns: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "highlight_cooldowns"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "highlight_cooldowns"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userId: import("drizzle-orm/pg-core").PgColumn<{ - name: "user_id"; - tableName: "highlight_cooldowns"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - lastGeneratedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "last_generated_at"; - tableName: "highlight_cooldowns"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export type HighlightCooldown = typeof highlightCooldowns.$inferSelect; -export type NewHighlightCooldown = typeof highlightCooldowns.$inferInsert; -export declare const userDailyActivity: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "user_daily_activity"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "user_daily_activity"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userId: import("drizzle-orm/pg-core").PgColumn<{ - name: "user_id"; - tableName: "user_daily_activity"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - activityDate: import("drizzle-orm/pg-core").PgColumn<{ - name: "activity_date"; - tableName: "user_daily_activity"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - watchTimeSeconds: import("drizzle-orm/pg-core").PgColumn<{ - name: "watch_time_seconds"; - tableName: "user_daily_activity"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - videosWatched: import("drizzle-orm/pg-core").PgColumn<{ - name: "videos_watched"; - tableName: "user_daily_activity"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - firstActivityHour: import("drizzle-orm/pg-core").PgColumn<{ - name: "first_activity_hour"; - tableName: "user_daily_activity"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "user_daily_activity"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export type UserAchievement = typeof userAchievements.$inferSelect; -export type NewUserAchievement = typeof userAchievements.$inferInsert; -export type UserStatsRecord = typeof userStats.$inferSelect; -export type NewUserStatsRecord = typeof userStats.$inferInsert; -export type UserFinish = typeof userFinishes.$inferSelect; -export type NewUserFinish = typeof userFinishes.$inferInsert; -export type UserDailyActivity = typeof userDailyActivity.$inferSelect; -export type NewUserDailyActivity = typeof userDailyActivity.$inferInsert; -export type AchievementRarity = 'common' | 'uncommon' | 'rare' | 'epic' | 'legendary'; -export declare const chatThreadReadStatus: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "chat_thread_read_status"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "chat_thread_read_status"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userId: import("drizzle-orm/pg-core").PgColumn<{ - name: "user_id"; - tableName: "chat_thread_read_status"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - mediaId: import("drizzle-orm/pg-core").PgColumn<{ - name: "media_id"; - tableName: "chat_thread_read_status"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - lastSeenAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "last_seen_at"; - tableName: "chat_thread_read_status"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export type ChatThreadReadStatus = typeof chatThreadReadStatus.$inferSelect; -export type NewChatThreadReadStatus = typeof chatThreadReadStatus.$inferInsert; -export declare const appSettings: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "app_settings"; - schema: undefined; - columns: { - key: import("drizzle-orm/pg-core").PgColumn<{ - name: "key"; - tableName: "app_settings"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - value: import("drizzle-orm/pg-core").PgColumn<{ - name: "value"; - tableName: "app_settings"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - updatedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "updated_at"; - tableName: "app_settings"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export type AppSetting = typeof appSettings.$inferSelect; -export type NewAppSetting = typeof appSettings.$inferInsert; -export declare const rateLimits: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "rate_limits"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "rate_limits"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - key: import("drizzle-orm/pg-core").PgColumn<{ - name: "key"; - tableName: "rate_limits"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - count: import("drizzle-orm/pg-core").PgColumn<{ - name: "count"; - tableName: "rate_limits"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - resetAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "reset_at"; - tableName: "rate_limits"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export type RateLimit = typeof rateLimits.$inferSelect; -export type NewRateLimit = typeof rateLimits.$inferInsert; -export declare const WORD_FILTER_LEVELS: readonly ["low", "medium", "high", "custom"]; -export type WordFilterLevel = typeof WORD_FILTER_LEVELS[number]; -export declare const moderationWordLists: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "moderation_word_lists"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "moderation_word_lists"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - level: import("drizzle-orm/pg-core").PgColumn<{ - name: "level"; - tableName: "moderation_word_lists"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - word: import("drizzle-orm/pg-core").PgColumn<{ - name: "word"; - tableName: "moderation_word_lists"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "moderation_word_lists"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdBy: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_by"; - tableName: "moderation_word_lists"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export type ModerationWordList = typeof moderationWordLists.$inferSelect; -export type NewModerationWordList = typeof moderationWordLists.$inferInsert; -export type CommentHiddenReason = 'ai_flagged' | 'word_filter' | 'spam' | 'manual' | 'rate_limit' | 'duplicate' | 'link'; -export declare const REPORT_TYPES: readonly ["inappropriate", "spam", "copyright", "illegal", "false_info", "other"]; -export type ReportType = typeof REPORT_TYPES[number]; -export declare const REPORT_STATUS: readonly ["pending", "reviewed", "actioned", "dismissed"]; -export type ReportStatus = typeof REPORT_STATUS[number]; -export declare const contentReports: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "content_reports"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "content_reports"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - mediaId: import("drizzle-orm/pg-core").PgColumn<{ - name: "media_id"; - tableName: "content_reports"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - sessionId: import("drizzle-orm/pg-core").PgColumn<{ - name: "session_id"; - tableName: "content_reports"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userId: import("drizzle-orm/pg-core").PgColumn<{ - name: "user_id"; - tableName: "content_reports"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - reportType: import("drizzle-orm/pg-core").PgColumn<{ - name: "report_type"; - tableName: "content_reports"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - description: import("drizzle-orm/pg-core").PgColumn<{ - name: "description"; - tableName: "content_reports"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - status: import("drizzle-orm/pg-core").PgColumn<{ - name: "status"; - tableName: "content_reports"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - resolvedBy: import("drizzle-orm/pg-core").PgColumn<{ - name: "resolved_by"; - tableName: "content_reports"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - resolvedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "resolved_at"; - tableName: "content_reports"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - resolutionNotes: import("drizzle-orm/pg-core").PgColumn<{ - name: "resolution_notes"; - tableName: "content_reports"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "content_reports"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export type ContentReport = typeof contentReports.$inferSelect; -export type NewContentReport = typeof contentReports.$inferInsert; -export declare const playlists: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "playlists"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "playlists"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userId: import("drizzle-orm/pg-core").PgColumn<{ - name: "user_id"; - tableName: "playlists"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - name: import("drizzle-orm/pg-core").PgColumn<{ - name: "name"; - tableName: "playlists"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - description: import("drizzle-orm/pg-core").PgColumn<{ - name: "description"; - tableName: "playlists"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - isPublic: import("drizzle-orm/pg-core").PgColumn<{ - name: "is_public"; - tableName: "playlists"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - shareToken: import("drizzle-orm/pg-core").PgColumn<{ - name: "share_token"; - tableName: "playlists"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - thumbnailMediaId: import("drizzle-orm/pg-core").PgColumn<{ - name: "thumbnail_media_id"; - tableName: "playlists"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - videoCount: import("drizzle-orm/pg-core").PgColumn<{ - name: "video_count"; - tableName: "playlists"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - totalDurationSeconds: import("drizzle-orm/pg-core").PgColumn<{ - name: "total_duration_seconds"; - tableName: "playlists"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - viewCount: import("drizzle-orm/pg-core").PgColumn<{ - name: "view_count"; - tableName: "playlists"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "playlists"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - updatedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "updated_at"; - tableName: "playlists"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export declare const playlistVideos: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "playlist_videos"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "playlist_videos"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - playlistId: import("drizzle-orm/pg-core").PgColumn<{ - name: "playlist_id"; - tableName: "playlist_videos"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - mediaId: import("drizzle-orm/pg-core").PgColumn<{ - name: "media_id"; - tableName: "playlist_videos"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - position: import("drizzle-orm/pg-core").PgColumn<{ - name: "position"; - tableName: "playlist_videos"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - addedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "added_at"; - tableName: "playlist_videos"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export declare const featuredPlaylists: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "featured_playlists"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "featured_playlists"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - playlistId: import("drizzle-orm/pg-core").PgColumn<{ - name: "playlist_id"; - tableName: "featured_playlists"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - position: import("drizzle-orm/pg-core").PgColumn<{ - name: "position"; - tableName: "featured_playlists"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - featuredBy: import("drizzle-orm/pg-core").PgColumn<{ - name: "featured_by"; - tableName: "featured_playlists"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - featuredAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "featured_at"; - tableName: "featured_playlists"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export declare const playlistViews: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "playlist_views"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "playlist_views"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - playlistId: import("drizzle-orm/pg-core").PgColumn<{ - name: "playlist_id"; - tableName: "playlist_views"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - sessionId: import("drizzle-orm/pg-core").PgColumn<{ - name: "session_id"; - tableName: "playlist_views"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "playlist_views"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export type Playlist = typeof playlists.$inferSelect; -export type NewPlaylist = typeof playlists.$inferInsert; -export type PlaylistVideo = typeof playlistVideos.$inferSelect; -export type NewPlaylistVideo = typeof playlistVideos.$inferInsert; -export type FeaturedPlaylist = typeof featuredPlaylists.$inferSelect; -export type NewFeaturedPlaylist = typeof featuredPlaylists.$inferInsert; -export type PlaylistView = typeof playlistViews.$inferSelect; -export type NewPlaylistView = typeof playlistViews.$inferInsert; -export declare const ads: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "ads"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "ads"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - type: import("drizzle-orm/pg-core").PgColumn<{ - name: "type"; - tableName: "ads"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - variant: import("drizzle-orm/pg-core").PgColumn<{ - name: "variant"; - tableName: "ads"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - imagePath: import("drizzle-orm/pg-core").PgColumn<{ - name: "image_path"; - tableName: "ads"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - linkUrl: import("drizzle-orm/pg-core").PgColumn<{ - name: "link_url"; - tableName: "ads"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - title: import("drizzle-orm/pg-core").PgColumn<{ - name: "title"; - tableName: "ads"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - visibility: import("drizzle-orm/pg-core").PgColumn<{ - name: "visibility"; - tableName: "ads"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - isActive: import("drizzle-orm/pg-core").PgColumn<{ - name: "is_active"; - tableName: "ads"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - position: import("drizzle-orm/pg-core").PgColumn<{ - name: "position"; - tableName: "ads"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - impressionCount: import("drizzle-orm/pg-core").PgColumn<{ - name: "impression_count"; - tableName: "ads"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - clickCount: import("drizzle-orm/pg-core").PgColumn<{ - name: "click_count"; - tableName: "ads"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "ads"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - updatedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "updated_at"; - tableName: "ads"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export declare const adImpressions: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "ad_impressions"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "ad_impressions"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - adId: import("drizzle-orm/pg-core").PgColumn<{ - name: "ad_id"; - tableName: "ad_impressions"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - sessionId: import("drizzle-orm/pg-core").PgColumn<{ - name: "session_id"; - tableName: "ad_impressions"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userId: import("drizzle-orm/pg-core").PgColumn<{ - name: "user_id"; - tableName: "ad_impressions"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "ad_impressions"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export declare const adClicks: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "ad_clicks"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "ad_clicks"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - adId: import("drizzle-orm/pg-core").PgColumn<{ - name: "ad_id"; - tableName: "ad_clicks"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - sessionId: import("drizzle-orm/pg-core").PgColumn<{ - name: "session_id"; - tableName: "ad_clicks"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userId: import("drizzle-orm/pg-core").PgColumn<{ - name: "user_id"; - tableName: "ad_clicks"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "ad_clicks"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export type Ad = typeof ads.$inferSelect; -export type NewAd = typeof ads.$inferInsert; -export type AdImpression = typeof adImpressions.$inferSelect; -export type NewAdImpression = typeof adImpressions.$inferInsert; -export type AdClick = typeof adClicks.$inferSelect; -export type NewAdClick = typeof adClicks.$inferInsert; -export type AdType = 'make_account' | 'custom'; -export type AdVisibility = 'everyone' | 'members_only' | 'non_members'; -export declare const FRIENDSHIP_STATUS: readonly ["pending", "accepted", "declined"]; -export type FriendshipStatus = typeof FRIENDSHIP_STATUS[number]; -export declare const friendships: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "friendships"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "friendships"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userId: import("drizzle-orm/pg-core").PgColumn<{ - name: "user_id"; - tableName: "friendships"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - friendId: import("drizzle-orm/pg-core").PgColumn<{ - name: "friend_id"; - tableName: "friendships"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - status: import("drizzle-orm/pg-core").PgColumn<{ - name: "status"; - tableName: "friendships"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "friendships"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - acceptedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "accepted_at"; - tableName: "friendships"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export declare const userBlocks: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "user_blocks"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "user_blocks"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userId: import("drizzle-orm/pg-core").PgColumn<{ - name: "user_id"; - tableName: "user_blocks"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - blockedUserId: import("drizzle-orm/pg-core").PgColumn<{ - name: "blocked_user_id"; - tableName: "user_blocks"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "user_blocks"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export declare const pokes: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "pokes"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "pokes"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - fromUserId: import("drizzle-orm/pg-core").PgColumn<{ - name: "from_user_id"; - tableName: "pokes"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - toUserId: import("drizzle-orm/pg-core").PgColumn<{ - name: "to_user_id"; - tableName: "pokes"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - isRead: import("drizzle-orm/pg-core").PgColumn<{ - name: "is_read"; - tableName: "pokes"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "pokes"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export declare const videoRecommendations: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "video_recommendations"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "video_recommendations"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - fromUserId: import("drizzle-orm/pg-core").PgColumn<{ - name: "from_user_id"; - tableName: "video_recommendations"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - toUserId: import("drizzle-orm/pg-core").PgColumn<{ - name: "to_user_id"; - tableName: "video_recommendations"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - mediaId: import("drizzle-orm/pg-core").PgColumn<{ - name: "media_id"; - tableName: "video_recommendations"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - message: import("drizzle-orm/pg-core").PgColumn<{ - name: "message"; - tableName: "video_recommendations"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - isRead: import("drizzle-orm/pg-core").PgColumn<{ - name: "is_read"; - tableName: "video_recommendations"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "video_recommendations"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export declare const userPresence: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "user_presence"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "user_presence"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userId: import("drizzle-orm/pg-core").PgColumn<{ - name: "user_id"; - tableName: "user_presence"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - isOnline: import("drizzle-orm/pg-core").PgColumn<{ - name: "is_online"; - tableName: "user_presence"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - currentMediaId: import("drizzle-orm/pg-core").PgColumn<{ - name: "current_media_id"; - tableName: "user_presence"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - lastActivityAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "last_activity_at"; - tableName: "user_presence"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - lastVideoChangeAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "last_video_change_at"; - tableName: "user_presence"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export declare const userGalleryImages: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "user_gallery_images"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "user_gallery_images"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userId: import("drizzle-orm/pg-core").PgColumn<{ - name: "user_id"; - tableName: "user_gallery_images"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - filename: import("drizzle-orm/pg-core").PgColumn<{ - name: "filename"; - tableName: "user_gallery_images"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - originalFilename: import("drizzle-orm/pg-core").PgColumn<{ - name: "original_filename"; - tableName: "user_gallery_images"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - position: import("drizzle-orm/pg-core").PgColumn<{ - name: "position"; - tableName: "user_gallery_images"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - uploadedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "uploaded_at"; - tableName: "user_gallery_images"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export type Friendship = typeof friendships.$inferSelect; -export type NewFriendship = typeof friendships.$inferInsert; -export type UserBlock = typeof userBlocks.$inferSelect; -export type NewUserBlock = typeof userBlocks.$inferInsert; -export type Poke = typeof pokes.$inferSelect; -export type NewPoke = typeof pokes.$inferInsert; -export type VideoRecommendation = typeof videoRecommendations.$inferSelect; -export type NewVideoRecommendation = typeof videoRecommendations.$inferInsert; -export type UserPresence = typeof userPresence.$inferSelect; -export type NewUserPresence = typeof userPresence.$inferInsert; -export type UserGalleryImage = typeof userGalleryImages.$inferSelect; -export type NewUserGalleryImage = typeof userGalleryImages.$inferInsert; -export declare const SOCIAL_PLATFORMS: readonly ["twitter", "instagram", "onlyfans", "fansly", "reddit", "discord", "tiktok", "youtube", "twitch", "snapchat", "linktree", "custom"]; -export type SocialPlatform = typeof SOCIAL_PLATFORMS[number]; -export declare const userSocialLinks: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "user_social_links"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "user_social_links"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userId: import("drizzle-orm/pg-core").PgColumn<{ - name: "user_id"; - tableName: "user_social_links"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - platform: import("drizzle-orm/pg-core").PgColumn<{ - name: "platform"; - tableName: "user_social_links"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - url: import("drizzle-orm/pg-core").PgColumn<{ - name: "url"; - tableName: "user_social_links"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - displayName: import("drizzle-orm/pg-core").PgColumn<{ - name: "display_name"; - tableName: "user_social_links"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - position: import("drizzle-orm/pg-core").PgColumn<{ - name: "position"; - tableName: "user_social_links"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "user_social_links"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export type UserSocialLink = typeof userSocialLinks.$inferSelect; -export type NewUserSocialLink = typeof userSocialLinks.$inferInsert; -export declare const privacySettings: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "privacy_settings"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "privacy_settings"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userId: import("drizzle-orm/pg-core").PgColumn<{ - name: "user_id"; - tableName: "privacy_settings"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - showOnlineStatus: import("drizzle-orm/pg-core").PgColumn<{ - name: "show_online_status"; - tableName: "privacy_settings"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - showCurrentlyWatching: import("drizzle-orm/pg-core").PgColumn<{ - name: "show_currently_watching"; - tableName: "privacy_settings"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - showInFriendActivity: import("drizzle-orm/pg-core").PgColumn<{ - name: "show_in_friend_activity"; - tableName: "privacy_settings"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - anonymizePublicComments: import("drizzle-orm/pg-core").PgColumn<{ - name: "anonymize_public_comments"; - tableName: "privacy_settings"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - hidePublicReactions: import("drizzle-orm/pg-core").PgColumn<{ - name: "hide_public_reactions"; - tableName: "privacy_settings"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - hidePublicFinishes: import("drizzle-orm/pg-core").PgColumn<{ - name: "hide_public_finishes"; - tableName: "privacy_settings"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - allowFriendRequests: import("drizzle-orm/pg-core").PgColumn<{ - name: "allow_friend_requests"; - tableName: "privacy_settings"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - closeFriendsOnlyWatching: import("drizzle-orm/pg-core").PgColumn<{ - name: "close_friends_only_watching"; - tableName: "privacy_settings"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "privacy_settings"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - updatedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "updated_at"; - tableName: "privacy_settings"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export declare const closeFriends: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "close_friends"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "close_friends"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userId: import("drizzle-orm/pg-core").PgColumn<{ - name: "user_id"; - tableName: "close_friends"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - closeFriendId: import("drizzle-orm/pg-core").PgColumn<{ - name: "close_friend_id"; - tableName: "close_friends"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - addedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "added_at"; - tableName: "close_friends"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export type PrivacySettings = typeof privacySettings.$inferSelect; -export type NewPrivacySettings = typeof privacySettings.$inferInsert; -export type CloseFriend = typeof closeFriends.$inferSelect; -export type NewCloseFriend = typeof closeFriends.$inferInsert; -export declare const USER_UPLOAD_STATUS: readonly ["pending", "approved", "rejected"]; -export type UserUploadStatus = typeof USER_UPLOAD_STATUS[number]; -export declare const userUploads: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "user_uploads"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "user_uploads"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userId: import("drizzle-orm/pg-core").PgColumn<{ - name: "user_id"; - tableName: "user_uploads"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - filename: import("drizzle-orm/pg-core").PgColumn<{ - name: "filename"; - tableName: "user_uploads"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - originalFilename: import("drizzle-orm/pg-core").PgColumn<{ - name: "original_filename"; - tableName: "user_uploads"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - path: import("drizzle-orm/pg-core").PgColumn<{ - name: "path"; - tableName: "user_uploads"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - durationSeconds: import("drizzle-orm/pg-core").PgColumn<{ - name: "duration_seconds"; - tableName: "user_uploads"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - quality: import("drizzle-orm/pg-core").PgColumn<{ - name: "quality"; - tableName: "user_uploads"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - orientation: import("drizzle-orm/pg-core").PgColumn<{ - name: "orientation"; - tableName: "user_uploads"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - fileSize: import("drizzle-orm/pg-core").PgColumn<{ - name: "file_size"; - tableName: "user_uploads"; - dataType: "number"; - columnType: "PgBigInt53"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - thumbnailPath: import("drizzle-orm/pg-core").PgColumn<{ - name: "thumbnail_path"; - tableName: "user_uploads"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - status: import("drizzle-orm/pg-core").PgColumn<{ - name: "status"; - tableName: "user_uploads"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - reviewedBy: import("drizzle-orm/pg-core").PgColumn<{ - name: "reviewed_by"; - tableName: "user_uploads"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - reviewedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "reviewed_at"; - tableName: "user_uploads"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - reviewNotes: import("drizzle-orm/pg-core").PgColumn<{ - name: "review_notes"; - tableName: "user_uploads"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - publicMediaId: import("drizzle-orm/pg-core").PgColumn<{ - name: "public_media_id"; - tableName: "user_uploads"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - uploadInviteId: import("drizzle-orm/pg-core").PgColumn<{ - name: "upload_invite_id"; - tableName: "user_uploads"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "user_uploads"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export type UserUpload = typeof userUploads.$inferSelect; -export type NewUserUpload = typeof userUploads.$inferInsert; -export declare const UPLOAD_INVITE_STATUS: readonly ["active", "inactive", "expired"]; -export type UploadInviteStatus = typeof UPLOAD_INVITE_STATUS[number]; -export declare const uploadInvites: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "upload_invites"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "upload_invites"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - code: import("drizzle-orm/pg-core").PgColumn<{ - name: "code"; - tableName: "upload_invites"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - label: import("drizzle-orm/pg-core").PgColumn<{ - name: "label"; - tableName: "upload_invites"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdBy: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_by"; - tableName: "upload_invites"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - status: import("drizzle-orm/pg-core").PgColumn<{ - name: "status"; - tableName: "upload_invites"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - maxUploads: import("drizzle-orm/pg-core").PgColumn<{ - name: "max_uploads"; - tableName: "upload_invites"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - uploadCount: import("drizzle-orm/pg-core").PgColumn<{ - name: "upload_count"; - tableName: "upload_invites"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - expiresAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "expires_at"; - tableName: "upload_invites"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "upload_invites"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export type UploadInvite = typeof uploadInvites.$inferSelect; -export type NewUploadInvite = typeof uploadInvites.$inferInsert; -export declare const tagCategories: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "tag_categories"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "tag_categories"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - name: import("drizzle-orm/pg-core").PgColumn<{ - name: "name"; - tableName: "tag_categories"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - displayOrder: import("drizzle-orm/pg-core").PgColumn<{ - name: "display_order"; - tableName: "tag_categories"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "tag_categories"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export declare const tags: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "tags"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "tags"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - categoryId: import("drizzle-orm/pg-core").PgColumn<{ - name: "category_id"; - tableName: "tags"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - name: import("drizzle-orm/pg-core").PgColumn<{ - name: "name"; - tableName: "tags"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - displayOrder: import("drizzle-orm/pg-core").PgColumn<{ - name: "display_order"; - tableName: "tags"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "tags"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export declare const publicMediaTags: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "public_media_tags"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "public_media_tags"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - mediaId: import("drizzle-orm/pg-core").PgColumn<{ - name: "media_id"; - tableName: "public_media_tags"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - tagId: import("drizzle-orm/pg-core").PgColumn<{ - name: "tag_id"; - tableName: "public_media_tags"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - addedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "added_at"; - tableName: "public_media_tags"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export declare const userUploadSuggestedTags: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "user_upload_suggested_tags"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "user_upload_suggested_tags"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - uploadId: import("drizzle-orm/pg-core").PgColumn<{ - name: "upload_id"; - tableName: "user_upload_suggested_tags"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - tagId: import("drizzle-orm/pg-core").PgColumn<{ - name: "tag_id"; - tableName: "user_upload_suggested_tags"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - suggestedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "suggested_at"; - tableName: "user_upload_suggested_tags"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export declare const userTagPreferences: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "user_tag_preferences"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "user_tag_preferences"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userId: import("drizzle-orm/pg-core").PgColumn<{ - name: "user_id"; - tableName: "user_tag_preferences"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - tagId: import("drizzle-orm/pg-core").PgColumn<{ - name: "tag_id"; - tableName: "user_tag_preferences"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - savedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "saved_at"; - tableName: "user_tag_preferences"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export type TagCategory = typeof tagCategories.$inferSelect; -export type NewTagCategory = typeof tagCategories.$inferInsert; -export type Tag = typeof tags.$inferSelect; -export type NewTag = typeof tags.$inferInsert; -export type PublicMediaTag = typeof publicMediaTags.$inferSelect; -export type NewPublicMediaTag = typeof publicMediaTags.$inferInsert; -export type UserUploadSuggestedTag = typeof userUploadSuggestedTags.$inferSelect; -export type NewUserUploadSuggestedTag = typeof userUploadSuggestedTags.$inferInsert; -export type UserTagPreference = typeof userTagPreferences.$inferSelect; -export type NewUserTagPreference = typeof userTagPreferences.$inferInsert; -/** - * Links public media items to performers for "Browse Actors" feature. - */ -export declare const publicMediaPerformers: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "public_media_performers"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "public_media_performers"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - mediaId: import("drizzle-orm/pg-core").PgColumn<{ - name: "media_id"; - tableName: "public_media_performers"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - performerId: import("drizzle-orm/pg-core").PgColumn<{ - name: "performer_id"; - tableName: "public_media_performers"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - addedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "added_at"; - tableName: "public_media_performers"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export type PublicMediaPerformer = typeof publicMediaPerformers.$inferSelect; -export type NewPublicMediaPerformer = typeof publicMediaPerformers.$inferInsert; -export declare const DIGEST_STATUS: readonly ["pending", "scene_detection", "extracting", "analyzing", "face_detection", "transcribing", "segmenting", "synthesizing", "completed", "failed", "cancelled"]; -export type DigestStatus = typeof DIGEST_STATUS[number]; -export declare const videoDigests: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "video_digests"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "video_digests"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - videoId: import("drizzle-orm/pg-core").PgColumn<{ - name: "video_id"; - tableName: "video_digests"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - jobId: import("drizzle-orm/pg-core").PgColumn<{ - name: "job_id"; - tableName: "video_digests"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - status: import("drizzle-orm/pg-core").PgColumn<{ - name: "status"; - tableName: "video_digests"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - progress: import("drizzle-orm/pg-core").PgColumn<{ - name: "progress"; - tableName: "video_digests"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - frameCount: import("drizzle-orm/pg-core").PgColumn<{ - name: "frame_count"; - tableName: "video_digests"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - config: import("drizzle-orm/pg-core").PgColumn<{ - name: "config"; - tableName: "video_digests"; - dataType: "json"; - columnType: "PgJsonb"; - data: DigestConfig; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: DigestConfig; - }>; - frameAnalyses: import("drizzle-orm/pg-core").PgColumn<{ - name: "frame_analyses"; - tableName: "video_digests"; - dataType: "json"; - columnType: "PgJsonb"; - data: FrameAnalysis[]; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: FrameAnalysis[]; - }>; - transcript: import("drizzle-orm/pg-core").PgColumn<{ - name: "transcript"; - tableName: "video_digests"; - dataType: "json"; - columnType: "PgJsonb"; - data: TranscriptSegment[]; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: TranscriptSegment[]; - }>; - tags: import("drizzle-orm/pg-core").PgColumn<{ - name: "tags"; - tableName: "video_digests"; - dataType: "json"; - columnType: "PgJsonb"; - data: DigestTag[]; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: DigestTag[]; - }>; - suggestedClips: import("drizzle-orm/pg-core").PgColumn<{ - name: "suggested_clips"; - tableName: "video_digests"; - dataType: "json"; - columnType: "PgJsonb"; - data: ClipSuggestion[]; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: ClipSuggestion[]; - }>; - adCutSpec: import("drizzle-orm/pg-core").PgColumn<{ - name: "ad_cut_spec"; - tableName: "video_digests"; - dataType: "json"; - columnType: "PgJsonb"; - data: AdCutSpec; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: AdCutSpec; - }>; - stageResults: import("drizzle-orm/pg-core").PgColumn<{ - name: "stage_results"; - tableName: "video_digests"; - dataType: "json"; - columnType: "PgJsonb"; - data: DigestStageResults; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: DigestStageResults; - }>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "video_digests"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - startedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "started_at"; - tableName: "video_digests"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - completedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "completed_at"; - tableName: "video_digests"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - error: import("drizzle-orm/pg-core").PgColumn<{ - name: "error"; - tableName: "video_digests"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export declare const digestVideoTags: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "digest_video_tags"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "digest_video_tags"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - digestId: import("drizzle-orm/pg-core").PgColumn<{ - name: "digest_id"; - tableName: "digest_video_tags"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - videoId: import("drizzle-orm/pg-core").PgColumn<{ - name: "video_id"; - tableName: "digest_video_tags"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - category: import("drizzle-orm/pg-core").PgColumn<{ - name: "category"; - tableName: "digest_video_tags"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - value: import("drizzle-orm/pg-core").PgColumn<{ - name: "value"; - tableName: "digest_video_tags"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - confidence: import("drizzle-orm/pg-core").PgColumn<{ - name: "confidence"; - tableName: "digest_video_tags"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - source: import("drizzle-orm/pg-core").PgColumn<{ - name: "source"; - tableName: "digest_video_tags"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - evidence: import("drizzle-orm/pg-core").PgColumn<{ - name: "evidence"; - tableName: "digest_video_tags"; - dataType: "json"; - columnType: "PgJsonb"; - data: string[]; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: string[]; - }>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "digest_video_tags"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export type VideoDigest = typeof videoDigests.$inferSelect; -export type NewVideoDigest = typeof videoDigests.$inferInsert; -export type DigestVideoTag = typeof digestVideoTags.$inferSelect; -export type NewDigestVideoTag = typeof digestVideoTags.$inferInsert; -export declare const CLIP_TYPES: readonly ["hook", "intro", "action", "climax", "highlight"]; -export type ClipType = typeof CLIP_TYPES[number]; -export declare const CLIP_STATUS: readonly ["pending", "processing", "completed", "failed"]; -export type ClipStatus = typeof CLIP_STATUS[number]; -export declare const CLIP_SOURCES: readonly ["machine", "manual"]; -export type ClipSource = typeof CLIP_SOURCES[number]; -export declare const digestSelectedClips: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "digest_selected_clips"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "digest_selected_clips"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - digestId: import("drizzle-orm/pg-core").PgColumn<{ - name: "digest_id"; - tableName: "digest_selected_clips"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - videoId: import("drizzle-orm/pg-core").PgColumn<{ - name: "video_id"; - tableName: "digest_selected_clips"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - clipType: import("drizzle-orm/pg-core").PgColumn<{ - name: "clip_type"; - tableName: "digest_selected_clips"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - startTime: import("drizzle-orm/pg-core").PgColumn<{ - name: "start_time"; - tableName: "digest_selected_clips"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - endTime: import("drizzle-orm/pg-core").PgColumn<{ - name: "end_time"; - tableName: "digest_selected_clips"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - duration: import("drizzle-orm/pg-core").PgColumn<{ - name: "duration"; - tableName: "digest_selected_clips"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - reason: import("drizzle-orm/pg-core").PgColumn<{ - name: "reason"; - tableName: "digest_selected_clips"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - interestScore: import("drizzle-orm/pg-core").PgColumn<{ - name: "interest_score"; - tableName: "digest_selected_clips"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - position: import("drizzle-orm/pg-core").PgColumn<{ - name: "position"; - tableName: "digest_selected_clips"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - transcriptHint: import("drizzle-orm/pg-core").PgColumn<{ - name: "transcript_hint"; - tableName: "digest_selected_clips"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - tags: import("drizzle-orm/pg-core").PgColumn<{ - name: "tags"; - tableName: "digest_selected_clips"; - dataType: "json"; - columnType: "PgJsonb"; - data: string[]; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: string[]; - }>; - source: import("drizzle-orm/pg-core").PgColumn<{ - name: "source"; - tableName: "digest_selected_clips"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - isIncluded: import("drizzle-orm/pg-core").PgColumn<{ - name: "is_included"; - tableName: "digest_selected_clips"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - isHook: import("drizzle-orm/pg-core").PgColumn<{ - name: "is_hook"; - tableName: "digest_selected_clips"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - sequenceOrder: import("drizzle-orm/pg-core").PgColumn<{ - name: "sequence_order"; - tableName: "digest_selected_clips"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - hookSourceClipId: import("drizzle-orm/pg-core").PgColumn<{ - name: "hook_source_clip_id"; - tableName: "digest_selected_clips"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "digest_selected_clips"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export declare const digestGeneratedClips: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "digest_generated_clips"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "digest_generated_clips"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - selectedClipId: import("drizzle-orm/pg-core").PgColumn<{ - name: "selected_clip_id"; - tableName: "digest_generated_clips"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - digestId: import("drizzle-orm/pg-core").PgColumn<{ - name: "digest_id"; - tableName: "digest_generated_clips"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - folderId: import("drizzle-orm/pg-core").PgColumn<{ - name: "folder_id"; - tableName: "digest_generated_clips"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - clipPath: import("drizzle-orm/pg-core").PgColumn<{ - name: "clip_path"; - tableName: "digest_generated_clips"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - gifPath: import("drizzle-orm/pg-core").PgColumn<{ - name: "gif_path"; - tableName: "digest_generated_clips"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - status: import("drizzle-orm/pg-core").PgColumn<{ - name: "status"; - tableName: "digest_generated_clips"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - error: import("drizzle-orm/pg-core").PgColumn<{ - name: "error"; - tableName: "digest_generated_clips"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "digest_generated_clips"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - completedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "completed_at"; - tableName: "digest_generated_clips"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - publishedToPublicMediaId: import("drizzle-orm/pg-core").PgColumn<{ - name: "published_to_public_media_id"; - tableName: "digest_generated_clips"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - publishedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "published_at"; - tableName: "digest_generated_clips"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export declare const CAPTION_POSITIONS: readonly ["bottom", "top"]; -export type CaptionPosition = typeof CAPTION_POSITIONS[number]; -export declare const CAPTION_SIZES: readonly ["small", "medium", "large"]; -export type CaptionSize = typeof CAPTION_SIZES[number]; -export interface CaptionStyle { - position: CaptionPosition; - fontSize: CaptionSize; -} -export declare const digestCompilations: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "digest_compilations"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "digest_compilations"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - digestId: import("drizzle-orm/pg-core").PgColumn<{ - name: "digest_id"; - tableName: "digest_compilations"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - videoId: import("drizzle-orm/pg-core").PgColumn<{ - name: "video_id"; - tableName: "digest_compilations"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - folderId: import("drizzle-orm/pg-core").PgColumn<{ - name: "folder_id"; - tableName: "digest_compilations"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - filename: import("drizzle-orm/pg-core").PgColumn<{ - name: "filename"; - tableName: "digest_compilations"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - name: import("drizzle-orm/pg-core").PgColumn<{ - name: "name"; - tableName: "digest_compilations"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - path: import("drizzle-orm/pg-core").PgColumn<{ - name: "path"; - tableName: "digest_compilations"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - durationSeconds: import("drizzle-orm/pg-core").PgColumn<{ - name: "duration_seconds"; - tableName: "digest_compilations"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - orientation: import("drizzle-orm/pg-core").PgColumn<{ - name: "orientation"; - tableName: "digest_compilations"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - status: import("drizzle-orm/pg-core").PgColumn<{ - name: "status"; - tableName: "digest_compilations"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - error: import("drizzle-orm/pg-core").PgColumn<{ - name: "error"; - tableName: "digest_compilations"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - hasCaptions: import("drizzle-orm/pg-core").PgColumn<{ - name: "has_captions"; - tableName: "digest_compilations"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - captionStyle: import("drizzle-orm/pg-core").PgColumn<{ - name: "caption_style"; - tableName: "digest_compilations"; - dataType: "json"; - columnType: "PgJsonb"; - data: CaptionStyle; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: CaptionStyle; - }>; - closingAdPath: import("drizzle-orm/pg-core").PgColumn<{ - name: "closing_ad_path"; - tableName: "digest_compilations"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - closingAdDuration: import("drizzle-orm/pg-core").PgColumn<{ - name: "closing_ad_duration"; - tableName: "digest_compilations"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - tags: import("drizzle-orm/pg-core").PgColumn<{ - name: "tags"; - tableName: "digest_compilations"; - dataType: "json"; - columnType: "PgJsonb"; - data: string[]; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: string[]; - }>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "digest_compilations"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - completedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "completed_at"; - tableName: "digest_compilations"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export type DigestSelectedClip = typeof digestSelectedClips.$inferSelect; -export type NewDigestSelectedClip = typeof digestSelectedClips.$inferInsert; -export type DigestGeneratedClip = typeof digestGeneratedClips.$inferSelect; -export type NewDigestGeneratedClip = typeof digestGeneratedClips.$inferInsert; -export type DigestCompilation = typeof digestCompilations.$inferSelect; -export type NewDigestCompilation = typeof digestCompilations.$inferInsert; -export declare const digestOutputFolders: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "digest_output_folders"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "digest_output_folders"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - digestId: import("drizzle-orm/pg-core").PgColumn<{ - name: "digest_id"; - tableName: "digest_output_folders"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - videoId: import("drizzle-orm/pg-core").PgColumn<{ - name: "video_id"; - tableName: "digest_output_folders"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - folderPath: import("drizzle-orm/pg-core").PgColumn<{ - name: "folder_path"; - tableName: "digest_output_folders"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - folderName: import("drizzle-orm/pg-core").PgColumn<{ - name: "folder_name"; - tableName: "digest_output_folders"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - folderType: import("drizzle-orm/pg-core").PgColumn<{ - name: "folder_type"; - tableName: "digest_output_folders"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - clipCount: import("drizzle-orm/pg-core").PgColumn<{ - name: "clip_count"; - tableName: "digest_output_folders"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - compilationCount: import("drizzle-orm/pg-core").PgColumn<{ - name: "compilation_count"; - tableName: "digest_output_folders"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - totalSize: import("drizzle-orm/pg-core").PgColumn<{ - name: "total_size"; - tableName: "digest_output_folders"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "digest_output_folders"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export type DigestOutputFolder = typeof digestOutputFolders.$inferSelect; -export type NewDigestOutputFolder = typeof digestOutputFolders.$inferInsert; -export declare const digestGeneratedScenes: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "digest_generated_scenes"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "digest_generated_scenes"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - digestId: import("drizzle-orm/pg-core").PgColumn<{ - name: "digest_id"; - tableName: "digest_generated_scenes"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - videoId: import("drizzle-orm/pg-core").PgColumn<{ - name: "video_id"; - tableName: "digest_generated_scenes"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - folderId: import("drizzle-orm/pg-core").PgColumn<{ - name: "folder_id"; - tableName: "digest_generated_scenes"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - sceneNumber: import("drizzle-orm/pg-core").PgColumn<{ - name: "scene_number"; - tableName: "digest_generated_scenes"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - scenePath: import("drizzle-orm/pg-core").PgColumn<{ - name: "scene_path"; - tableName: "digest_generated_scenes"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - startTime: import("drizzle-orm/pg-core").PgColumn<{ - name: "start_time"; - tableName: "digest_generated_scenes"; - dataType: "number"; - columnType: "PgReal"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - endTime: import("drizzle-orm/pg-core").PgColumn<{ - name: "end_time"; - tableName: "digest_generated_scenes"; - dataType: "number"; - columnType: "PgReal"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - duration: import("drizzle-orm/pg-core").PgColumn<{ - name: "duration"; - tableName: "digest_generated_scenes"; - dataType: "number"; - columnType: "PgReal"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - tags: import("drizzle-orm/pg-core").PgColumn<{ - name: "tags"; - tableName: "digest_generated_scenes"; - dataType: "json"; - columnType: "PgJsonb"; - data: string[]; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: string[]; - }>; - dominantPosition: import("drizzle-orm/pg-core").PgColumn<{ - name: "dominant_position"; - tableName: "digest_generated_scenes"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "digest_generated_scenes"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - publishedToPublicMediaId: import("drizzle-orm/pg-core").PgColumn<{ - name: "published_to_public_media_id"; - tableName: "digest_generated_scenes"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - publishedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "published_at"; - tableName: "digest_generated_scenes"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export type DigestGeneratedScene = typeof digestGeneratedScenes.$inferSelect; -export type NewDigestGeneratedScene = typeof digestGeneratedScenes.$inferInsert; -export interface MergedCutDetail { - timestamp: number; - sources: ('transnetv2' | 'pyscenedetect' | 'clip')[]; - confidence: number; - weight: number; -} -export declare const videoSceneCuts: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "video_scene_cuts"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "video_scene_cuts"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - videoId: import("drizzle-orm/pg-core").PgColumn<{ - name: "video_id"; - tableName: "video_scene_cuts"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - cuts: import("drizzle-orm/pg-core").PgColumn<{ - name: "cuts"; - tableName: "video_scene_cuts"; - dataType: "json"; - columnType: "PgJsonb"; - data: number[]; - driverParam: unknown; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: number[]; - }>; - sceneCount: import("drizzle-orm/pg-core").PgColumn<{ - name: "scene_count"; - tableName: "video_scene_cuts"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - duration: import("drizzle-orm/pg-core").PgColumn<{ - name: "duration"; - tableName: "video_scene_cuts"; - dataType: "number"; - columnType: "PgReal"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - detector: import("drizzle-orm/pg-core").PgColumn<{ - name: "detector"; - tableName: "video_scene_cuts"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - threshold: import("drizzle-orm/pg-core").PgColumn<{ - name: "threshold"; - tableName: "video_scene_cuts"; - dataType: "number"; - columnType: "PgReal"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - transnetCuts: import("drizzle-orm/pg-core").PgColumn<{ - name: "transnet_cuts"; - tableName: "video_scene_cuts"; - dataType: "json"; - columnType: "PgJsonb"; - data: number[] | null; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: number[] | null; - }>; - pyscenedetectCuts: import("drizzle-orm/pg-core").PgColumn<{ - name: "pyscenedetect_cuts"; - tableName: "video_scene_cuts"; - dataType: "json"; - columnType: "PgJsonb"; - data: number[] | null; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: number[] | null; - }>; - clipCuts: import("drizzle-orm/pg-core").PgColumn<{ - name: "clip_cuts"; - tableName: "video_scene_cuts"; - dataType: "json"; - columnType: "PgJsonb"; - data: number[] | null; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: number[] | null; - }>; - mergedCutsDetailed: import("drizzle-orm/pg-core").PgColumn<{ - name: "merged_cuts_detailed"; - tableName: "video_scene_cuts"; - dataType: "json"; - columnType: "PgJsonb"; - data: MergedCutDetail[] | null; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: MergedCutDetail[] | null; - }>; - mergeStrategy: import("drizzle-orm/pg-core").PgColumn<{ - name: "merge_strategy"; - tableName: "video_scene_cuts"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - toleranceSeconds: import("drizzle-orm/pg-core").PgColumn<{ - name: "tolerance_seconds"; - tableName: "video_scene_cuts"; - dataType: "number"; - columnType: "PgReal"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - detectorsUsed: import("drizzle-orm/pg-core").PgColumn<{ - name: "detectors_used"; - tableName: "video_scene_cuts"; - dataType: "json"; - columnType: "PgJsonb"; - data: string[] | null; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: string[] | null; - }>; - processingTimeMs: import("drizzle-orm/pg-core").PgColumn<{ - name: "processing_time_ms"; - tableName: "video_scene_cuts"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "video_scene_cuts"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export type VideoSceneCuts = typeof videoSceneCuts.$inferSelect; -export type NewVideoSceneCuts = typeof videoSceneCuts.$inferInsert; -export declare const SEGMENT_TYPES: readonly ["scene", "tag_change", "vocal", "fixed_interval"]; -export type SegmentType = typeof SEGMENT_TYPES[number]; -export declare const VOCAL_CATEGORIES: readonly ["dialogue", "dirty_talk", "climax", "interview", "moan"]; -export type VocalCategory = typeof VOCAL_CATEGORIES[number]; -export interface TagTimelineEntry { - tag: string; - confidence: number; - category?: string; -} -export declare const videoTagTimeline: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "video_tag_timeline"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "video_tag_timeline"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - videoId: import("drizzle-orm/pg-core").PgColumn<{ - name: "video_id"; - tableName: "video_tag_timeline"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - digestId: import("drizzle-orm/pg-core").PgColumn<{ - name: "digest_id"; - tableName: "video_tag_timeline"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - timestamp: import("drizzle-orm/pg-core").PgColumn<{ - name: "timestamp"; - tableName: "video_tag_timeline"; - dataType: "number"; - columnType: "PgReal"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - tags: import("drizzle-orm/pg-core").PgColumn<{ - name: "tags"; - tableName: "video_tag_timeline"; - dataType: "json"; - columnType: "PgJsonb"; - data: TagTimelineEntry[]; - driverParam: unknown; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: TagTimelineEntry[]; - }>; - dominantPosition: import("drizzle-orm/pg-core").PgColumn<{ - name: "dominant_position"; - tableName: "video_tag_timeline"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - performerCount: import("drizzle-orm/pg-core").PgColumn<{ - name: "performer_count"; - tableName: "video_tag_timeline"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - intensity: import("drizzle-orm/pg-core").PgColumn<{ - name: "intensity"; - tableName: "video_tag_timeline"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - hasDialogue: import("drizzle-orm/pg-core").PgColumn<{ - name: "has_dialogue"; - tableName: "video_tag_timeline"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - hasEyeContact: import("drizzle-orm/pg-core").PgColumn<{ - name: "has_eye_contact"; - tableName: "video_tag_timeline"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - framePath: import("drizzle-orm/pg-core").PgColumn<{ - name: "frame_path"; - tableName: "video_tag_timeline"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "video_tag_timeline"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export type VideoTagTimeline = typeof videoTagTimeline.$inferSelect; -export type NewVideoTagTimeline = typeof videoTagTimeline.$inferInsert; -export declare const videoSegments: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "video_segments"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "video_segments"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - digestId: import("drizzle-orm/pg-core").PgColumn<{ - name: "digest_id"; - tableName: "video_segments"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - videoId: import("drizzle-orm/pg-core").PgColumn<{ - name: "video_id"; - tableName: "video_segments"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - segmentType: import("drizzle-orm/pg-core").PgColumn<{ - name: "segment_type"; - tableName: "video_segments"; - dataType: "string"; - columnType: "PgText"; - data: "scene" | "tag_change" | "vocal" | "fixed_interval"; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: "scene" | "tag_change" | "vocal" | "fixed_interval"; - }>; - startTime: import("drizzle-orm/pg-core").PgColumn<{ - name: "start_time"; - tableName: "video_segments"; - dataType: "number"; - columnType: "PgReal"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - endTime: import("drizzle-orm/pg-core").PgColumn<{ - name: "end_time"; - tableName: "video_segments"; - dataType: "number"; - columnType: "PgReal"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - duration: import("drizzle-orm/pg-core").PgColumn<{ - name: "duration"; - tableName: "video_segments"; - dataType: "number"; - columnType: "PgReal"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - tags: import("drizzle-orm/pg-core").PgColumn<{ - name: "tags"; - tableName: "video_segments"; - dataType: "json"; - columnType: "PgJsonb"; - data: string[]; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: string[]; - }>; - transcriptSnippet: import("drizzle-orm/pg-core").PgColumn<{ - name: "transcript_snippet"; - tableName: "video_segments"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - vocalCategory: import("drizzle-orm/pg-core").PgColumn<{ - name: "vocal_category"; - tableName: "video_segments"; - dataType: "string"; - columnType: "PgText"; - data: "climax" | "dialogue" | "dirty_talk" | "interview" | "moan"; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: "climax" | "dialogue" | "dirty_talk" | "interview" | "moan"; - }>; - positionChange: import("drizzle-orm/pg-core").PgColumn<{ - name: "position_change"; - tableName: "video_segments"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - dominantPosition: import("drizzle-orm/pg-core").PgColumn<{ - name: "dominant_position"; - tableName: "video_segments"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - interestScore: import("drizzle-orm/pg-core").PgColumn<{ - name: "interest_score"; - tableName: "video_segments"; - dataType: "number"; - columnType: "PgReal"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - hasEyeContact: import("drizzle-orm/pg-core").PgColumn<{ - name: "has_eye_contact"; - tableName: "video_segments"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - hasFullSentence: import("drizzle-orm/pg-core").PgColumn<{ - name: "has_full_sentence"; - tableName: "video_segments"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - isClimaxMoment: import("drizzle-orm/pg-core").PgColumn<{ - name: "is_climax_moment"; - tableName: "video_segments"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - captioned: import("drizzle-orm/pg-core").PgColumn<{ - name: "captioned"; - tableName: "video_segments"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - captionText: import("drizzle-orm/pg-core").PgColumn<{ - name: "caption_text"; - tableName: "video_segments"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - title: import("drizzle-orm/pg-core").PgColumn<{ - name: "title"; - tableName: "video_segments"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - keyframePath: import("drizzle-orm/pg-core").PgColumn<{ - name: "keyframe_path"; - tableName: "video_segments"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - keyframeTimestamp: import("drizzle-orm/pg-core").PgColumn<{ - name: "keyframe_timestamp"; - tableName: "video_segments"; - dataType: "number"; - columnType: "PgReal"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - isIncluded: import("drizzle-orm/pg-core").PgColumn<{ - name: "is_included"; - tableName: "video_segments"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - sequenceOrder: import("drizzle-orm/pg-core").PgColumn<{ - name: "sequence_order"; - tableName: "video_segments"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - isHook: import("drizzle-orm/pg-core").PgColumn<{ - name: "is_hook"; - tableName: "video_segments"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - includeInClips: import("drizzle-orm/pg-core").PgColumn<{ - name: "include_in_clips"; - tableName: "video_segments"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "video_segments"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export type VideoSegment = typeof videoSegments.$inferSelect; -export type NewVideoSegment = typeof videoSegments.$inferInsert; -export declare const videoTags: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "video_tags"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "video_tags"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - videoId: import("drizzle-orm/pg-core").PgColumn<{ - name: "video_id"; - tableName: "video_tags"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - tagId: import("drizzle-orm/pg-core").PgColumn<{ - name: "tag_id"; - tableName: "video_tags"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - confidence: import("drizzle-orm/pg-core").PgColumn<{ - name: "confidence"; - tableName: "video_tags"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - source: import("drizzle-orm/pg-core").PgColumn<{ - name: "source"; - tableName: "video_tags"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - digestId: import("drizzle-orm/pg-core").PgColumn<{ - name: "digest_id"; - tableName: "video_tags"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "video_tags"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export declare const SUGGESTED_TAG_STATUS: readonly ["pending", "approved", "rejected", "mapped"]; -export type SuggestedTagStatus = typeof SUGGESTED_TAG_STATUS[number]; -export declare const digestSuggestedTags: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "digest_suggested_tags"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "digest_suggested_tags"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - digestId: import("drizzle-orm/pg-core").PgColumn<{ - name: "digest_id"; - tableName: "digest_suggested_tags"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - videoId: import("drizzle-orm/pg-core").PgColumn<{ - name: "video_id"; - tableName: "digest_suggested_tags"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - suggestedCategory: import("drizzle-orm/pg-core").PgColumn<{ - name: "suggested_category"; - tableName: "digest_suggested_tags"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - suggestedValue: import("drizzle-orm/pg-core").PgColumn<{ - name: "suggested_value"; - tableName: "digest_suggested_tags"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - confidence: import("drizzle-orm/pg-core").PgColumn<{ - name: "confidence"; - tableName: "digest_suggested_tags"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - status: import("drizzle-orm/pg-core").PgColumn<{ - name: "status"; - tableName: "digest_suggested_tags"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - mappedTagId: import("drizzle-orm/pg-core").PgColumn<{ - name: "mapped_tag_id"; - tableName: "digest_suggested_tags"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - reviewedBy: import("drizzle-orm/pg-core").PgColumn<{ - name: "reviewed_by"; - tableName: "digest_suggested_tags"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - reviewedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "reviewed_at"; - tableName: "digest_suggested_tags"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "digest_suggested_tags"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export declare const digestClipTags: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "digest_clip_tags"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "digest_clip_tags"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - clipId: import("drizzle-orm/pg-core").PgColumn<{ - name: "clip_id"; - tableName: "digest_clip_tags"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - tagId: import("drizzle-orm/pg-core").PgColumn<{ - name: "tag_id"; - tableName: "digest_clip_tags"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - source: import("drizzle-orm/pg-core").PgColumn<{ - name: "source"; - tableName: "digest_clip_tags"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "digest_clip_tags"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export type VideoTag = typeof videoTags.$inferSelect; -export type NewVideoTag = typeof videoTags.$inferInsert; -export type DigestSuggestedTag = typeof digestSuggestedTags.$inferSelect; -export type NewDigestSuggestedTag = typeof digestSuggestedTags.$inferInsert; -export type DigestClipTag = typeof digestClipTags.$inferSelect; -export type NewDigestClipTag = typeof digestClipTags.$inferInsert; -export declare const WATCH_PARTY_STATUS: readonly ["waiting", "active", "paused", "ended"]; -export type WatchPartyStatus = typeof WATCH_PARTY_STATUS[number]; -export declare const LOOP_MODE: readonly ["none", "video", "queue"]; -export type LoopMode = typeof LOOP_MODE[number]; -export interface WatchPartySummaryStats { - totalWatchTimeSeconds: number; - peakParticipantCount: number; - totalParticipants: number; - chatMessageCount: number; - reactionCount: number; - mostActiveChatter?: { - userId: number; - username: string; - messageCount: number; - }; - mostUsedReaction?: { - emoji: string; - reactionType: string; - count: number; - }; - participantDetails: Array<{ - userId: number; - username: string; - watchTimeSeconds: number; - chatMessageCount: number; - reactionCount: number; - }>; -} -export declare const watchPartySessions: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "watch_party_sessions"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "watch_party_sessions"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - hostId: import("drizzle-orm/pg-core").PgColumn<{ - name: "host_id"; - tableName: "watch_party_sessions"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - mediaId: import("drizzle-orm/pg-core").PgColumn<{ - name: "media_id"; - tableName: "watch_party_sessions"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - inviteCode: import("drizzle-orm/pg-core").PgColumn<{ - name: "invite_code"; - tableName: "watch_party_sessions"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - status: import("drizzle-orm/pg-core").PgColumn<{ - name: "status"; - tableName: "watch_party_sessions"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - currentTime: import("drizzle-orm/pg-core").PgColumn<{ - name: "current_time"; - tableName: "watch_party_sessions"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - isPlaying: import("drizzle-orm/pg-core").PgColumn<{ - name: "is_playing"; - tableName: "watch_party_sessions"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - maxParticipants: import("drizzle-orm/pg-core").PgColumn<{ - name: "max_participants"; - tableName: "watch_party_sessions"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - allowChat: import("drizzle-orm/pg-core").PgColumn<{ - name: "allow_chat"; - tableName: "watch_party_sessions"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "watch_party_sessions"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - startedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "started_at"; - tableName: "watch_party_sessions"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - endedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "ended_at"; - tableName: "watch_party_sessions"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - summaryStats: import("drizzle-orm/pg-core").PgColumn<{ - name: "summary_stats"; - tableName: "watch_party_sessions"; - dataType: "json"; - columnType: "PgJsonb"; - data: WatchPartySummaryStats; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: WatchPartySummaryStats; - }>; - }; - dialect: "pg"; -}>; -export declare const watchPartyParticipants: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "watch_party_participants"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "watch_party_participants"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - partyId: import("drizzle-orm/pg-core").PgColumn<{ - name: "party_id"; - tableName: "watch_party_participants"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userId: import("drizzle-orm/pg-core").PgColumn<{ - name: "user_id"; - tableName: "watch_party_participants"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - isConnected: import("drizzle-orm/pg-core").PgColumn<{ - name: "is_connected"; - tableName: "watch_party_participants"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - isKicked: import("drizzle-orm/pg-core").PgColumn<{ - name: "is_kicked"; - tableName: "watch_party_participants"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - joinedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "joined_at"; - tableName: "watch_party_participants"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - leftAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "left_at"; - tableName: "watch_party_participants"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export declare const watchPartyChatMessages: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "watch_party_chat_messages"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "watch_party_chat_messages"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - partyId: import("drizzle-orm/pg-core").PgColumn<{ - name: "party_id"; - tableName: "watch_party_chat_messages"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userId: import("drizzle-orm/pg-core").PgColumn<{ - name: "user_id"; - tableName: "watch_party_chat_messages"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - content: import("drizzle-orm/pg-core").PgColumn<{ - name: "content"; - tableName: "watch_party_chat_messages"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "watch_party_chat_messages"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export declare const watchPartyReactions: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "watch_party_reactions"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "watch_party_reactions"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - partyId: import("drizzle-orm/pg-core").PgColumn<{ - name: "party_id"; - tableName: "watch_party_reactions"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userId: import("drizzle-orm/pg-core").PgColumn<{ - name: "user_id"; - tableName: "watch_party_reactions"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - reactionType: import("drizzle-orm/pg-core").PgColumn<{ - name: "reaction_type"; - tableName: "watch_party_reactions"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - videoTimestamp: import("drizzle-orm/pg-core").PgColumn<{ - name: "video_timestamp"; - tableName: "watch_party_reactions"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "watch_party_reactions"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export declare const INVITE_STATUS: readonly ["pending", "accepted", "declined", "expired"]; -export type InviteStatus = typeof INVITE_STATUS[number]; -export declare const watchPartyInvites: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "watch_party_invites"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "watch_party_invites"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - partyId: import("drizzle-orm/pg-core").PgColumn<{ - name: "party_id"; - tableName: "watch_party_invites"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - fromUserId: import("drizzle-orm/pg-core").PgColumn<{ - name: "from_user_id"; - tableName: "watch_party_invites"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - toUserId: import("drizzle-orm/pg-core").PgColumn<{ - name: "to_user_id"; - tableName: "watch_party_invites"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - status: import("drizzle-orm/pg-core").PgColumn<{ - name: "status"; - tableName: "watch_party_invites"; - dataType: "string"; - columnType: "PgText"; - data: "pending" | "accepted" | "declined" | "expired"; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: "pending" | "accepted" | "declined" | "expired"; - }>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "watch_party_invites"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - respondedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "responded_at"; - tableName: "watch_party_invites"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export type WatchPartySession = typeof watchPartySessions.$inferSelect; -export type NewWatchPartySession = typeof watchPartySessions.$inferInsert; -export type WatchPartyParticipant = typeof watchPartyParticipants.$inferSelect; -export type NewWatchPartyParticipant = typeof watchPartyParticipants.$inferInsert; -export type WatchPartyChatMessage = typeof watchPartyChatMessages.$inferSelect; -export type NewWatchPartyChatMessage = typeof watchPartyChatMessages.$inferInsert; -export type WatchPartyReaction = typeof watchPartyReactions.$inferSelect; -export type NewWatchPartyReaction = typeof watchPartyReactions.$inferInsert; -export type WatchPartyInvite = typeof watchPartyInvites.$inferSelect; -export type NewWatchPartyInvite = typeof watchPartyInvites.$inferInsert; -export type TagGenerationContentType = 'public' | 'inbox' | 'upload'; -export type TagGenerationStatus = 'pending' | 'extracting' | 'analyzing' | 'completed' | 'failed' | 'cancelled'; -export interface TagGenerationOptions { - frameCount?: number; - frameInterval?: number; - autoApplyThreshold?: number; - reuseDigestTags?: boolean; -} -export interface TagSuggestion { - tagId?: number; - categoryName: string; - tagName: string; - confidence: number; - frameIndices: number[]; - isMatched: boolean; -} -export interface ContentTagResult { - contentId: number; - contentType: TagGenerationContentType; - filename: string; - thumbnailPath?: string; - existingTags: number[]; - suggestedTags: TagSuggestion[]; - framePaths?: string[]; - digestId?: number; - processedAt: string; -} -export declare const tagGenerationJobs: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "tag_generation_jobs"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "tag_generation_jobs"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - status: import("drizzle-orm/pg-core").PgColumn<{ - name: "status"; - tableName: "tag_generation_jobs"; - dataType: "string"; - columnType: "PgText"; - data: TagGenerationStatus; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: TagGenerationStatus; - }>; - contentType: import("drizzle-orm/pg-core").PgColumn<{ - name: "content_type"; - tableName: "tag_generation_jobs"; - dataType: "string"; - columnType: "PgText"; - data: TagGenerationContentType; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: TagGenerationContentType; - }>; - contentIds: import("drizzle-orm/pg-core").PgColumn<{ - name: "content_ids"; - tableName: "tag_generation_jobs"; - dataType: "json"; - columnType: "PgJsonb"; - data: number[]; - driverParam: unknown; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: number[]; - }>; - options: import("drizzle-orm/pg-core").PgColumn<{ - name: "options"; - tableName: "tag_generation_jobs"; - dataType: "json"; - columnType: "PgJsonb"; - data: TagGenerationOptions; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: TagGenerationOptions; - }>; - results: import("drizzle-orm/pg-core").PgColumn<{ - name: "results"; - tableName: "tag_generation_jobs"; - dataType: "json"; - columnType: "PgJsonb"; - data: ContentTagResult[]; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: ContentTagResult[]; - }>; - progress: import("drizzle-orm/pg-core").PgColumn<{ - name: "progress"; - tableName: "tag_generation_jobs"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - currentItem: import("drizzle-orm/pg-core").PgColumn<{ - name: "current_item"; - tableName: "tag_generation_jobs"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - totalItems: import("drizzle-orm/pg-core").PgColumn<{ - name: "total_items"; - tableName: "tag_generation_jobs"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - error: import("drizzle-orm/pg-core").PgColumn<{ - name: "error"; - tableName: "tag_generation_jobs"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "tag_generation_jobs"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - completedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "completed_at"; - tableName: "tag_generation_jobs"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export type TagGenerationJob = typeof tagGenerationJobs.$inferSelect; -export type NewTagGenerationJob = typeof tagGenerationJobs.$inferInsert; -/** - * Named performers that can be associated with multiple detected faces. - * Integrates with tag system for public gallery filtering. - */ -export declare const creators: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "creators"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "creators"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - name: import("drizzle-orm/pg-core").PgColumn<{ - name: "name"; - tableName: "creators"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - slug: import("drizzle-orm/pg-core").PgColumn<{ - name: "slug"; - tableName: "creators"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - gender: import("drizzle-orm/pg-core").PgColumn<{ - name: "gender"; - tableName: "creators"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - primaryFaceId: import("drizzle-orm/pg-core").PgColumn<{ - name: "primary_face_id"; - tableName: "creators"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - faceCount: import("drizzle-orm/pg-core").PgColumn<{ - name: "face_count"; - tableName: "creators"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - videoCount: import("drizzle-orm/pg-core").PgColumn<{ - name: "video_count"; - tableName: "creators"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - tagId: import("drizzle-orm/pg-core").PgColumn<{ - name: "tag_id"; - tableName: "creators"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - isPublic: import("drizzle-orm/pg-core").PgColumn<{ - name: "is_public"; - tableName: "creators"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - centroidEmbedding: import("drizzle-orm/pg-core").PgColumn<{ - name: "centroid_embedding"; - tableName: "creators"; - dataType: "json"; - columnType: "PgJsonb"; - data: number[]; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: number[]; - }>; - centroidUpdatedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "centroid_updated_at"; - tableName: "creators"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - centroidFaceCount: import("drizzle-orm/pg-core").PgColumn<{ - name: "centroid_face_count"; - tableName: "creators"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - embeddingVariance: import("drizzle-orm/pg-core").PgColumn<{ - name: "embedding_variance"; - tableName: "creators"; - dataType: "number"; - columnType: "PgReal"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - avgIntraClusterSimilarity: import("drizzle-orm/pg-core").PgColumn<{ - name: "avg_intra_cluster_similarity"; - tableName: "creators"; - dataType: "number"; - columnType: "PgReal"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - avgAge: import("drizzle-orm/pg-core").PgColumn<{ - name: "avg_age"; - tableName: "creators"; - dataType: "number"; - columnType: "PgReal"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - ageStdDev: import("drizzle-orm/pg-core").PgColumn<{ - name: "age_std_dev"; - tableName: "creators"; - dataType: "number"; - columnType: "PgReal"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "creators"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - updatedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "updated_at"; - tableName: "creators"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export type Creator = typeof creators.$inferSelect; -export type NewCreator = typeof creators.$inferInsert; -export declare const FACE_STATUS: readonly ["pending", "assigned", "ignored", "skipped"]; -export type FaceStatus = typeof FACE_STATUS[number]; -/** - * Stores face embeddings for performer recognition. - * Each row represents a single detected face that can be linked to a performer. - */ -export declare const performerFaces: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "performer_faces"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "performer_faces"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - performerId: import("drizzle-orm/pg-core").PgColumn<{ - name: "performer_id"; - tableName: "performer_faces"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - performerName: import("drizzle-orm/pg-core").PgColumn<{ - name: "performer_name"; - tableName: "performer_faces"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - faceEmbedding: import("drizzle-orm/pg-core").PgColumn<{ - name: "face_embedding"; - tableName: "performer_faces"; - dataType: "json"; - columnType: "PgJsonb"; - data: number[]; - driverParam: unknown; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: number[]; - }>; - gender: import("drizzle-orm/pg-core").PgColumn<{ - name: "gender"; - tableName: "performer_faces"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - age: import("drizzle-orm/pg-core").PgColumn<{ - name: "age"; - tableName: "performer_faces"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - detectionScore: import("drizzle-orm/pg-core").PgColumn<{ - name: "detection_score"; - tableName: "performer_faces"; - dataType: "number"; - columnType: "PgReal"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - bbox: import("drizzle-orm/pg-core").PgColumn<{ - name: "bbox"; - tableName: "performer_faces"; - dataType: "json"; - columnType: "PgJsonb"; - data: number[]; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: number[]; - }>; - faceCropPath: import("drizzle-orm/pg-core").PgColumn<{ - name: "face_crop_path"; - tableName: "performer_faces"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - sourceFrame: import("drizzle-orm/pg-core").PgColumn<{ - name: "source_frame"; - tableName: "performer_faces"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - sourceVideo: import("drizzle-orm/pg-core").PgColumn<{ - name: "source_video"; - tableName: "performer_faces"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - sourceDigestId: import("drizzle-orm/pg-core").PgColumn<{ - name: "source_digest_id"; - tableName: "performer_faces"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - frameTimestamp: import("drizzle-orm/pg-core").PgColumn<{ - name: "frame_timestamp"; - tableName: "performer_faces"; - dataType: "number"; - columnType: "PgReal"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - frameIndex: import("drizzle-orm/pg-core").PgColumn<{ - name: "frame_index"; - tableName: "performer_faces"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - facesInFrame: import("drizzle-orm/pg-core").PgColumn<{ - name: "faces_in_frame"; - tableName: "performer_faces"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - status: import("drizzle-orm/pg-core").PgColumn<{ - name: "status"; - tableName: "performer_faces"; - dataType: "string"; - columnType: "PgText"; - data: "pending" | "skipped" | "ignored" | "assigned"; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: "pending" | "skipped" | "ignored" | "assigned"; - }>; - matchConfidence: import("drizzle-orm/pg-core").PgColumn<{ - name: "match_confidence"; - tableName: "performer_faces"; - dataType: "number"; - columnType: "PgReal"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - isVerified: import("drizzle-orm/pg-core").PgColumn<{ - name: "is_verified"; - tableName: "performer_faces"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "performer_faces"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - updatedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "updated_at"; - tableName: "performer_faces"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export type CreatorFace = typeof performerFaces.$inferSelect; -export type NewCreatorFace = typeof performerFaces.$inferInsert; -export declare const DISCREPANCY_TYPES: readonly ["no_face_match", "low_confidence", "name_mismatch", "gender_mismatch", "unknown_performer", "extra_face"]; -export type DiscrepancyType = typeof DISCREPANCY_TYPES[number]; -export declare const DISCREPANCY_STATUS: readonly ["pending", "confirmed", "rejected", "merged", "ignored"]; -export type DiscrepancyStatus = typeof DISCREPANCY_STATUS[number]; -export declare const DISCREPANCY_RESOLUTIONS: readonly ["use_filename", "use_face", "create_alias", "ignore", "assign_face"]; -export type DiscrepancyResolution = typeof DISCREPANCY_RESOLUTIONS[number]; -/** - * Tracks mismatches between filename-parsed performers and face detection results. - * Used for admin review and resolution of performer identification issues. - */ -export declare const performerDiscrepancies: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "performer_discrepancies"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "performer_discrepancies"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - videoId: import("drizzle-orm/pg-core").PgColumn<{ - name: "video_id"; - tableName: "performer_discrepancies"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - digestId: import("drizzle-orm/pg-core").PgColumn<{ - name: "digest_id"; - tableName: "performer_discrepancies"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - parsedPerformerName: import("drizzle-orm/pg-core").PgColumn<{ - name: "parsed_performer_name"; - tableName: "performer_discrepancies"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - parsedMethod: import("drizzle-orm/pg-core").PgColumn<{ - name: "parsed_method"; - tableName: "performer_discrepancies"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - parsedConfidence: import("drizzle-orm/pg-core").PgColumn<{ - name: "parsed_confidence"; - tableName: "performer_discrepancies"; - dataType: "number"; - columnType: "PgReal"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - detectedPerformerId: import("drizzle-orm/pg-core").PgColumn<{ - name: "detected_performer_id"; - tableName: "performer_discrepancies"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - detectedPerformerName: import("drizzle-orm/pg-core").PgColumn<{ - name: "detected_performer_name"; - tableName: "performer_discrepancies"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - faceMatchConfidence: import("drizzle-orm/pg-core").PgColumn<{ - name: "face_match_confidence"; - tableName: "performer_discrepancies"; - dataType: "number"; - columnType: "PgReal"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - faceSimilarity: import("drizzle-orm/pg-core").PgColumn<{ - name: "face_similarity"; - tableName: "performer_discrepancies"; - dataType: "number"; - columnType: "PgReal"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - discrepancyType: import("drizzle-orm/pg-core").PgColumn<{ - name: "discrepancy_type"; - tableName: "performer_discrepancies"; - dataType: "string"; - columnType: "PgText"; - data: "no_face_match" | "low_confidence" | "name_mismatch" | "gender_mismatch" | "unknown_performer" | "extra_face"; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: "no_face_match" | "low_confidence" | "name_mismatch" | "gender_mismatch" | "unknown_performer" | "extra_face"; - }>; - status: import("drizzle-orm/pg-core").PgColumn<{ - name: "status"; - tableName: "performer_discrepancies"; - dataType: "string"; - columnType: "PgText"; - data: "pending" | "rejected" | "ignored" | "merged" | "confirmed"; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: "pending" | "rejected" | "ignored" | "merged" | "confirmed"; - }>; - resolvedBy: import("drizzle-orm/pg-core").PgColumn<{ - name: "resolved_by"; - tableName: "performer_discrepancies"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - resolvedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "resolved_at"; - tableName: "performer_discrepancies"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - resolution: import("drizzle-orm/pg-core").PgColumn<{ - name: "resolution"; - tableName: "performer_discrepancies"; - dataType: "string"; - columnType: "PgText"; - data: "ignore" | "use_filename" | "use_face" | "create_alias" | "assign_face"; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: "ignore" | "use_filename" | "use_face" | "create_alias" | "assign_face"; - }>; - adminNotes: import("drizzle-orm/pg-core").PgColumn<{ - name: "admin_notes"; - tableName: "performer_discrepancies"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "performer_discrepancies"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export type CreatorDiscrepancy = typeof performerDiscrepancies.$inferSelect; -export type NewCreatorDiscrepancy = typeof performerDiscrepancies.$inferInsert; -export declare const PIPELINE_STATUS: readonly ["pending", "queued", "running", "paused", "completed", "failed", "cancelled"]; -export type PipelineStatus = typeof PIPELINE_STATUS[number]; -export declare const PIPELINE_STEP_STATUS: readonly ["pending", "waiting_dependency", "waiting_resource", "running", "completed", "failed", "skipped"]; -export type PipelineStepStatus = typeof PIPELINE_STEP_STATUS[number]; -export type PipelineStepType = 'frame_extraction' | 'scene_detection' | 'vision_analysis' | 'transcription' | 'synthesis' | 'tag_generation' | 'clip_generation' | 'anime_generation' | 'custom'; -export declare const pipelines: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "pipelines"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "pipelines"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - name: import("drizzle-orm/pg-core").PgColumn<{ - name: "name"; - tableName: "pipelines"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - description: import("drizzle-orm/pg-core").PgColumn<{ - name: "description"; - tableName: "pipelines"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - status: import("drizzle-orm/pg-core").PgColumn<{ - name: "status"; - tableName: "pipelines"; - dataType: "string"; - columnType: "PgText"; - data: "cancelled" | "pending" | "completed" | "failed" | "paused" | "running" | "queued"; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: "cancelled" | "pending" | "completed" | "failed" | "paused" | "running" | "queued"; - }>; - priority: import("drizzle-orm/pg-core").PgColumn<{ - name: "priority"; - tableName: "pipelines"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - context: import("drizzle-orm/pg-core").PgColumn<{ - name: "context"; - tableName: "pipelines"; - dataType: "json"; - columnType: "PgJsonb"; - data: Record; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: Record; - }>; - totalVramRequired: import("drizzle-orm/pg-core").PgColumn<{ - name: "total_vram_required"; - tableName: "pipelines"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - estimatedDurationMs: import("drizzle-orm/pg-core").PgColumn<{ - name: "estimated_duration_ms"; - tableName: "pipelines"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - progress: import("drizzle-orm/pg-core").PgColumn<{ - name: "progress"; - tableName: "pipelines"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - currentStepId: import("drizzle-orm/pg-core").PgColumn<{ - name: "current_step_id"; - tableName: "pipelines"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - completedSteps: import("drizzle-orm/pg-core").PgColumn<{ - name: "completed_steps"; - tableName: "pipelines"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - totalSteps: import("drizzle-orm/pg-core").PgColumn<{ - name: "total_steps"; - tableName: "pipelines"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - error: import("drizzle-orm/pg-core").PgColumn<{ - name: "error"; - tableName: "pipelines"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - retryCount: import("drizzle-orm/pg-core").PgColumn<{ - name: "retry_count"; - tableName: "pipelines"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - maxRetries: import("drizzle-orm/pg-core").PgColumn<{ - name: "max_retries"; - tableName: "pipelines"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "pipelines"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - queuedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "queued_at"; - tableName: "pipelines"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - startedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "started_at"; - tableName: "pipelines"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - completedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "completed_at"; - tableName: "pipelines"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - lastHeartbeat: import("drizzle-orm/pg-core").PgColumn<{ - name: "last_heartbeat"; - tableName: "pipelines"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - runningOnNode: import("drizzle-orm/pg-core").PgColumn<{ - name: "running_on_node"; - tableName: "pipelines"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export declare const pipelineSteps: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "pipeline_steps"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "pipeline_steps"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - pipelineId: import("drizzle-orm/pg-core").PgColumn<{ - name: "pipeline_id"; - tableName: "pipeline_steps"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - name: import("drizzle-orm/pg-core").PgColumn<{ - name: "name"; - tableName: "pipeline_steps"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - stepType: import("drizzle-orm/pg-core").PgColumn<{ - name: "step_type"; - tableName: "pipeline_steps"; - dataType: "string"; - columnType: "PgText"; - data: PipelineStepType; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: PipelineStepType; - }>; - sequenceOrder: import("drizzle-orm/pg-core").PgColumn<{ - name: "sequence_order"; - tableName: "pipeline_steps"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - dependsOn: import("drizzle-orm/pg-core").PgColumn<{ - name: "depends_on"; - tableName: "pipeline_steps"; - dataType: "json"; - columnType: "PgJsonb"; - data: number[]; - driverParam: unknown; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: number[]; - }>; - resourceCategory: import("drizzle-orm/pg-core").PgColumn<{ - name: "resource_category"; - tableName: "pipeline_steps"; - dataType: "string"; - columnType: "PgText"; - data: ResourceCategory; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: ResourceCategory; - }>; - vramRequired: import("drizzle-orm/pg-core").PgColumn<{ - name: "vram_required"; - tableName: "pipeline_steps"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - requiredContainers: import("drizzle-orm/pg-core").PgColumn<{ - name: "required_containers"; - tableName: "pipeline_steps"; - dataType: "json"; - columnType: "PgJsonb"; - data: string[]; - driverParam: unknown; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: string[]; - }>; - config: import("drizzle-orm/pg-core").PgColumn<{ - name: "config"; - tableName: "pipeline_steps"; - dataType: "json"; - columnType: "PgJsonb"; - data: Record; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: Record; - }>; - status: import("drizzle-orm/pg-core").PgColumn<{ - name: "status"; - tableName: "pipeline_steps"; - dataType: "string"; - columnType: "PgText"; - data: "pending" | "completed" | "failed" | "running" | "skipped" | "waiting_dependency" | "waiting_resource"; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: "pending" | "completed" | "failed" | "running" | "skipped" | "waiting_dependency" | "waiting_resource"; - }>; - progress: import("drizzle-orm/pg-core").PgColumn<{ - name: "progress"; - tableName: "pipeline_steps"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - result: import("drizzle-orm/pg-core").PgColumn<{ - name: "result"; - tableName: "pipeline_steps"; - dataType: "json"; - columnType: "PgJsonb"; - data: unknown; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: unknown; - }>; - error: import("drizzle-orm/pg-core").PgColumn<{ - name: "error"; - tableName: "pipeline_steps"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - estimatedDurationMs: import("drizzle-orm/pg-core").PgColumn<{ - name: "estimated_duration_ms"; - tableName: "pipeline_steps"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - startedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "started_at"; - tableName: "pipeline_steps"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - completedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "completed_at"; - tableName: "pipeline_steps"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - durationMs: import("drizzle-orm/pg-core").PgColumn<{ - name: "duration_ms"; - tableName: "pipeline_steps"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export declare const pipelineStepEvents: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "pipeline_step_events"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "pipeline_step_events"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - stepId: import("drizzle-orm/pg-core").PgColumn<{ - name: "step_id"; - tableName: "pipeline_step_events"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - eventType: import("drizzle-orm/pg-core").PgColumn<{ - name: "event_type"; - tableName: "pipeline_step_events"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - eventData: import("drizzle-orm/pg-core").PgColumn<{ - name: "event_data"; - tableName: "pipeline_step_events"; - dataType: "json"; - columnType: "PgJsonb"; - data: Record; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: Record; - }>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "pipeline_step_events"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export declare const resourceSnapshots: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "resource_snapshots"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "resource_snapshots"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - gpuIndex: import("drizzle-orm/pg-core").PgColumn<{ - name: "gpu_index"; - tableName: "resource_snapshots"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - gpuName: import("drizzle-orm/pg-core").PgColumn<{ - name: "gpu_name"; - tableName: "resource_snapshots"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - vramUsedMb: import("drizzle-orm/pg-core").PgColumn<{ - name: "vram_used_mb"; - tableName: "resource_snapshots"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - vramTotalMb: import("drizzle-orm/pg-core").PgColumn<{ - name: "vram_total_mb"; - tableName: "resource_snapshots"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - gpuUtilization: import("drizzle-orm/pg-core").PgColumn<{ - name: "gpu_utilization"; - tableName: "resource_snapshots"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - gpuTemperature: import("drizzle-orm/pg-core").PgColumn<{ - name: "gpu_temperature"; - tableName: "resource_snapshots"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - activeProcesses: import("drizzle-orm/pg-core").PgColumn<{ - name: "active_processes"; - tableName: "resource_snapshots"; - dataType: "json"; - columnType: "PgJsonb"; - data: { - pid: number; - name: string; - vramMb: number; - }[]; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: { - pid: number; - name: string; - vramMb: number; - }[]; - }>; - pipelineId: import("drizzle-orm/pg-core").PgColumn<{ - name: "pipeline_id"; - tableName: "resource_snapshots"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - stepId: import("drizzle-orm/pg-core").PgColumn<{ - name: "step_id"; - tableName: "resource_snapshots"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "resource_snapshots"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export declare const pipelineTemplates: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "pipeline_templates"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "pipeline_templates"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - name: import("drizzle-orm/pg-core").PgColumn<{ - name: "name"; - tableName: "pipeline_templates"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - displayName: import("drizzle-orm/pg-core").PgColumn<{ - name: "display_name"; - tableName: "pipeline_templates"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - description: import("drizzle-orm/pg-core").PgColumn<{ - name: "description"; - tableName: "pipeline_templates"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - steps: import("drizzle-orm/pg-core").PgColumn<{ - name: "steps"; - tableName: "pipeline_templates"; - dataType: "json"; - columnType: "PgJsonb"; - data: { - name: string; - stepType: PipelineStepType; - dependsOn: string[]; - config?: Record; - resourceCategory: ResourceCategory; - vramRequired: number; - requiredContainers: string[]; - }[]; - driverParam: unknown; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: { - name: string; - stepType: PipelineStepType; - dependsOn: string[]; - config?: Record; - resourceCategory: ResourceCategory; - vramRequired: number; - requiredContainers: string[]; - }[]; - }>; - contextSchema: import("drizzle-orm/pg-core").PgColumn<{ - name: "context_schema"; - tableName: "pipeline_templates"; - dataType: "json"; - columnType: "PgJsonb"; - data: Record; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: Record; - }>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "pipeline_templates"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - updatedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "updated_at"; - tableName: "pipeline_templates"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export type Pipeline = typeof pipelines.$inferSelect; -export type NewPipeline = typeof pipelines.$inferInsert; -export type PipelineStep = typeof pipelineSteps.$inferSelect; -export type NewPipelineStep = typeof pipelineSteps.$inferInsert; -export type PipelineStepEvent = typeof pipelineStepEvents.$inferSelect; -export type NewPipelineStepEvent = typeof pipelineStepEvents.$inferInsert; -export type ResourceSnapshot = typeof resourceSnapshots.$inferSelect; -export type NewResourceSnapshot = typeof resourceSnapshots.$inferInsert; -export type PipelineTemplate = typeof pipelineTemplates.$inferSelect; -export type NewPipelineTemplate = typeof pipelineTemplates.$inferInsert; -export type SubscriptionStatus = 'none' | 'active' | 'grace_period' | 'delinquent' | 'lifetime'; -export type PaymentStatus = 'unmatched' | 'matched' | 'applied' | 'disputed' | 'refunded'; -export type InvoiceStatus = 'pending' | 'paid' | 'overdue' | 'cancelled' | 'refunded'; -export declare const subscriptionPlans: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "subscription_plans"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "subscription_plans"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - name: import("drizzle-orm/pg-core").PgColumn<{ - name: "name"; - tableName: "subscription_plans"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - displayName: import("drizzle-orm/pg-core").PgColumn<{ - name: "display_name"; - tableName: "subscription_plans"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - description: import("drizzle-orm/pg-core").PgColumn<{ - name: "description"; - tableName: "subscription_plans"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - priceCAD: import("drizzle-orm/pg-core").PgColumn<{ - name: "price_cad"; - tableName: "subscription_plans"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - durationDays: import("drizzle-orm/pg-core").PgColumn<{ - name: "duration_days"; - tableName: "subscription_plans"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - isActive: import("drizzle-orm/pg-core").PgColumn<{ - name: "is_active"; - tableName: "subscription_plans"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - sortOrder: import("drizzle-orm/pg-core").PgColumn<{ - name: "sort_order"; - tableName: "subscription_plans"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "subscription_plans"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - updatedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "updated_at"; - tableName: "subscription_plans"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export declare const userSubscriptions: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "user_subscriptions"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "user_subscriptions"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userId: import("drizzle-orm/pg-core").PgColumn<{ - name: "user_id"; - tableName: "user_subscriptions"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - planId: import("drizzle-orm/pg-core").PgColumn<{ - name: "plan_id"; - tableName: "user_subscriptions"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - status: import("drizzle-orm/pg-core").PgColumn<{ - name: "status"; - tableName: "user_subscriptions"; - dataType: "string"; - columnType: "PgText"; - data: SubscriptionStatus; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: SubscriptionStatus; - }>; - startDate: import("drizzle-orm/pg-core").PgColumn<{ - name: "start_date"; - tableName: "user_subscriptions"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - endDate: import("drizzle-orm/pg-core").PgColumn<{ - name: "end_date"; - tableName: "user_subscriptions"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - gracePeriodEndDate: import("drizzle-orm/pg-core").PgColumn<{ - name: "grace_period_end_date"; - tableName: "user_subscriptions"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - lastPaymentId: import("drizzle-orm/pg-core").PgColumn<{ - name: "last_payment_id"; - tableName: "user_subscriptions"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - autoRenew: import("drizzle-orm/pg-core").PgColumn<{ - name: "auto_renew"; - tableName: "user_subscriptions"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - notes: import("drizzle-orm/pg-core").PgColumn<{ - name: "notes"; - tableName: "user_subscriptions"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "user_subscriptions"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - updatedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "updated_at"; - tableName: "user_subscriptions"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export declare const invoices: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "invoices"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "invoices"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userId: import("drizzle-orm/pg-core").PgColumn<{ - name: "user_id"; - tableName: "invoices"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - planId: import("drizzle-orm/pg-core").PgColumn<{ - name: "plan_id"; - tableName: "invoices"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - invoiceNumber: import("drizzle-orm/pg-core").PgColumn<{ - name: "invoice_number"; - tableName: "invoices"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - amountCAD: import("drizzle-orm/pg-core").PgColumn<{ - name: "amount_cad"; - tableName: "invoices"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - status: import("drizzle-orm/pg-core").PgColumn<{ - name: "status"; - tableName: "invoices"; - dataType: "string"; - columnType: "PgText"; - data: InvoiceStatus; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: InvoiceStatus; - }>; - dueDate: import("drizzle-orm/pg-core").PgColumn<{ - name: "due_date"; - tableName: "invoices"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - paidAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "paid_at"; - tableName: "invoices"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - paymentId: import("drizzle-orm/pg-core").PgColumn<{ - name: "payment_id"; - tableName: "invoices"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - description: import("drizzle-orm/pg-core").PgColumn<{ - name: "description"; - tableName: "invoices"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - notes: import("drizzle-orm/pg-core").PgColumn<{ - name: "notes"; - tableName: "invoices"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "invoices"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - updatedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "updated_at"; - tableName: "invoices"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export interface PaymentEmailPayload { - from: string; - fromName?: string; - to: string; - subject: string; - textBody?: string; - htmlBody?: string; - date: string; - headers?: Record; - messageId?: string; -} -export declare const payments: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "payments"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "payments"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - invoiceId: import("drizzle-orm/pg-core").PgColumn<{ - name: "invoice_id"; - tableName: "payments"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userId: import("drizzle-orm/pg-core").PgColumn<{ - name: "user_id"; - tableName: "payments"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - senderEmail: import("drizzle-orm/pg-core").PgColumn<{ - name: "sender_email"; - tableName: "payments"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - senderName: import("drizzle-orm/pg-core").PgColumn<{ - name: "sender_name"; - tableName: "payments"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - amountCAD: import("drizzle-orm/pg-core").PgColumn<{ - name: "amount_cad"; - tableName: "payments"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - referenceNumber: import("drizzle-orm/pg-core").PgColumn<{ - name: "reference_number"; - tableName: "payments"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - customMessage: import("drizzle-orm/pg-core").PgColumn<{ - name: "custom_message"; - tableName: "payments"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - status: import("drizzle-orm/pg-core").PgColumn<{ - name: "status"; - tableName: "payments"; - dataType: "string"; - columnType: "PgText"; - data: PaymentStatus; - driverParam: string; - notNull: true; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: PaymentStatus; - }>; - matchConfidence: import("drizzle-orm/pg-core").PgColumn<{ - name: "match_confidence"; - tableName: "payments"; - dataType: "number"; - columnType: "PgReal"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - matchMethod: import("drizzle-orm/pg-core").PgColumn<{ - name: "match_method"; - tableName: "payments"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - rawEmailJson: import("drizzle-orm/pg-core").PgColumn<{ - name: "raw_email_json"; - tableName: "payments"; - dataType: "json"; - columnType: "PgJsonb"; - data: PaymentEmailPayload; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: PaymentEmailPayload; - }>; - receivedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "received_at"; - tableName: "payments"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - processedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "processed_at"; - tableName: "payments"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - processedBy: import("drizzle-orm/pg-core").PgColumn<{ - name: "processed_by"; - tableName: "payments"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "payments"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - updatedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "updated_at"; - tableName: "payments"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export declare const paymentAuditLog: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "payment_audit_log"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "payment_audit_log"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - paymentId: import("drizzle-orm/pg-core").PgColumn<{ - name: "payment_id"; - tableName: "payment_audit_log"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - invoiceId: import("drizzle-orm/pg-core").PgColumn<{ - name: "invoice_id"; - tableName: "payment_audit_log"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userId: import("drizzle-orm/pg-core").PgColumn<{ - name: "user_id"; - tableName: "payment_audit_log"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - action: import("drizzle-orm/pg-core").PgColumn<{ - name: "action"; - tableName: "payment_audit_log"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - previousState: import("drizzle-orm/pg-core").PgColumn<{ - name: "previous_state"; - tableName: "payment_audit_log"; - dataType: "json"; - columnType: "PgJsonb"; - data: Record; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: Record; - }>; - newState: import("drizzle-orm/pg-core").PgColumn<{ - name: "new_state"; - tableName: "payment_audit_log"; - dataType: "json"; - columnType: "PgJsonb"; - data: Record; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: Record; - }>; - performedBy: import("drizzle-orm/pg-core").PgColumn<{ - name: "performed_by"; - tableName: "payment_audit_log"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - notes: import("drizzle-orm/pg-core").PgColumn<{ - name: "notes"; - tableName: "payment_audit_log"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - ipAddress: import("drizzle-orm/pg-core").PgColumn<{ - name: "ip_address"; - tableName: "payment_audit_log"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "payment_audit_log"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export type SubscriptionPlan = typeof subscriptionPlans.$inferSelect; -export type NewSubscriptionPlan = typeof subscriptionPlans.$inferInsert; -export type UserSubscription = typeof userSubscriptions.$inferSelect; -export type NewUserSubscription = typeof userSubscriptions.$inferInsert; -export type Invoice = typeof invoices.$inferSelect; -export type NewInvoice = typeof invoices.$inferInsert; -export type Payment = typeof payments.$inferSelect; -export type NewPayment = typeof payments.$inferInsert; -export type PaymentAuditLogEntry = typeof paymentAuditLog.$inferSelect; -export type NewPaymentAuditLogEntry = typeof paymentAuditLog.$inferInsert; -export declare const NOTIFICATION_TYPES: readonly ["friend_request", "friend_request_accepted", "poke", "video_recommendation", "watch_party_invite", "achievement_unlocked", "comment_reply", "digest_completed", "digest_failed", "upload_approved", "upload_rejected", "system"]; -export type NotificationType = typeof NOTIFICATION_TYPES[number]; -export interface NotificationMetadata { - actorUsername?: string; - mediaId?: number; - mediaTitle?: string; - mediaThumbnail?: string; - achievementName?: string; - achievementIcon?: string; - achievementRarity?: AchievementRarity; - partyId?: number; - digestId?: number; - uploadId?: number; - message?: string; - [key: string]: unknown; -} -export declare const notifications: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "notifications"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "notifications"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userId: import("drizzle-orm/pg-core").PgColumn<{ - name: "user_id"; - tableName: "notifications"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - type: import("drizzle-orm/pg-core").PgColumn<{ - name: "type"; - tableName: "notifications"; - dataType: "string"; - columnType: "PgText"; - data: "friend_request" | "poke" | "upload_approved" | "upload_rejected" | "system" | "friend_request_accepted" | "video_recommendation" | "watch_party_invite" | "achievement_unlocked" | "comment_reply" | "digest_completed" | "digest_failed"; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: "friend_request" | "poke" | "upload_approved" | "upload_rejected" | "system" | "friend_request_accepted" | "video_recommendation" | "watch_party_invite" | "achievement_unlocked" | "comment_reply" | "digest_completed" | "digest_failed"; - }>; - title: import("drizzle-orm/pg-core").PgColumn<{ - name: "title"; - tableName: "notifications"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - message: import("drizzle-orm/pg-core").PgColumn<{ - name: "message"; - tableName: "notifications"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - referenceType: import("drizzle-orm/pg-core").PgColumn<{ - name: "reference_type"; - tableName: "notifications"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - referenceId: import("drizzle-orm/pg-core").PgColumn<{ - name: "reference_id"; - tableName: "notifications"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - actorId: import("drizzle-orm/pg-core").PgColumn<{ - name: "actor_id"; - tableName: "notifications"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - metadata: import("drizzle-orm/pg-core").PgColumn<{ - name: "metadata"; - tableName: "notifications"; - dataType: "json"; - columnType: "PgJsonb"; - data: NotificationMetadata; - driverParam: unknown; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: NotificationMetadata; - }>; - isRead: import("drizzle-orm/pg-core").PgColumn<{ - name: "is_read"; - tableName: "notifications"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - actionUrl: import("drizzle-orm/pg-core").PgColumn<{ - name: "action_url"; - tableName: "notifications"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - groupKey: import("drizzle-orm/pg-core").PgColumn<{ - name: "group_key"; - tableName: "notifications"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "notifications"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - readAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "read_at"; - tableName: "notifications"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export declare const notificationPreferences: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "notification_preferences"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "notification_preferences"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - userId: import("drizzle-orm/pg-core").PgColumn<{ - name: "user_id"; - tableName: "notification_preferences"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - emailFriendRequest: import("drizzle-orm/pg-core").PgColumn<{ - name: "email_friend_request"; - tableName: "notification_preferences"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - emailFriendRequestAccepted: import("drizzle-orm/pg-core").PgColumn<{ - name: "email_friend_request_accepted"; - tableName: "notification_preferences"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - emailPoke: import("drizzle-orm/pg-core").PgColumn<{ - name: "email_poke"; - tableName: "notification_preferences"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - emailVideoRecommendation: import("drizzle-orm/pg-core").PgColumn<{ - name: "email_video_recommendation"; - tableName: "notification_preferences"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - emailWatchPartyInvite: import("drizzle-orm/pg-core").PgColumn<{ - name: "email_watch_party_invite"; - tableName: "notification_preferences"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - emailAchievement: import("drizzle-orm/pg-core").PgColumn<{ - name: "email_achievement"; - tableName: "notification_preferences"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - emailDigestComplete: import("drizzle-orm/pg-core").PgColumn<{ - name: "email_digest_complete"; - tableName: "notification_preferences"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - emailDigestFailed: import("drizzle-orm/pg-core").PgColumn<{ - name: "email_digest_failed"; - tableName: "notification_preferences"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - emailUploadApproved: import("drizzle-orm/pg-core").PgColumn<{ - name: "email_upload_approved"; - tableName: "notification_preferences"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - emailUploadRejected: import("drizzle-orm/pg-core").PgColumn<{ - name: "email_upload_rejected"; - tableName: "notification_preferences"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - inAppFriendRequest: import("drizzle-orm/pg-core").PgColumn<{ - name: "inapp_friend_request"; - tableName: "notification_preferences"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - inAppFriendRequestAccepted: import("drizzle-orm/pg-core").PgColumn<{ - name: "inapp_friend_request_accepted"; - tableName: "notification_preferences"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - inAppPoke: import("drizzle-orm/pg-core").PgColumn<{ - name: "inapp_poke"; - tableName: "notification_preferences"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - inAppVideoRecommendation: import("drizzle-orm/pg-core").PgColumn<{ - name: "inapp_video_recommendation"; - tableName: "notification_preferences"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - inAppWatchPartyInvite: import("drizzle-orm/pg-core").PgColumn<{ - name: "inapp_watch_party_invite"; - tableName: "notification_preferences"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - inAppAchievement: import("drizzle-orm/pg-core").PgColumn<{ - name: "inapp_achievement"; - tableName: "notification_preferences"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - inAppDigestComplete: import("drizzle-orm/pg-core").PgColumn<{ - name: "inapp_digest_complete"; - tableName: "notification_preferences"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - inAppDigestFailed: import("drizzle-orm/pg-core").PgColumn<{ - name: "inapp_digest_failed"; - tableName: "notification_preferences"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - inAppUploadApproved: import("drizzle-orm/pg-core").PgColumn<{ - name: "inapp_upload_approved"; - tableName: "notification_preferences"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - inAppUploadRejected: import("drizzle-orm/pg-core").PgColumn<{ - name: "inapp_upload_rejected"; - tableName: "notification_preferences"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - inAppCommentReply: import("drizzle-orm/pg-core").PgColumn<{ - name: "inapp_comment_reply"; - tableName: "notification_preferences"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - inAppSystem: import("drizzle-orm/pg-core").PgColumn<{ - name: "inapp_system"; - tableName: "notification_preferences"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - quietHoursEnabled: import("drizzle-orm/pg-core").PgColumn<{ - name: "quiet_hours_enabled"; - tableName: "notification_preferences"; - dataType: "boolean"; - columnType: "PgBoolean"; - data: boolean; - driverParam: boolean; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - quietHoursStart: import("drizzle-orm/pg-core").PgColumn<{ - name: "quiet_hours_start"; - tableName: "notification_preferences"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - quietHoursEnd: import("drizzle-orm/pg-core").PgColumn<{ - name: "quiet_hours_end"; - tableName: "notification_preferences"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - updatedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "updated_at"; - tableName: "notification_preferences"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export type Notification = typeof notifications.$inferSelect; -export type NewNotification = typeof notifications.$inferInsert; -export type NotificationPreferences = typeof notificationPreferences.$inferSelect; -export type NewNotificationPreferences = typeof notificationPreferences.$inferInsert; -export declare const GEO_BLOCKING_MODES: readonly ["disabled", "blocklist", "allowlist"]; -export type GeoBlockingMode = typeof GEO_BLOCKING_MODES[number]; -export declare const geoBlockingRules: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "geo_blocking_rules"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "geo_blocking_rules"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - country: import("drizzle-orm/pg-core").PgColumn<{ - name: "country"; - tableName: "geo_blocking_rules"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - countryName: import("drizzle-orm/pg-core").PgColumn<{ - name: "country_name"; - tableName: "geo_blocking_rules"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - region: import("drizzle-orm/pg-core").PgColumn<{ - name: "region"; - tableName: "geo_blocking_rules"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - city: import("drizzle-orm/pg-core").PgColumn<{ - name: "city"; - tableName: "geo_blocking_rules"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "geo_blocking_rules"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdBy: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_by"; - tableName: "geo_blocking_rules"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - note: import("drizzle-orm/pg-core").PgColumn<{ - name: "note"; - tableName: "geo_blocking_rules"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export type GeoBlockingRule = typeof geoBlockingRules.$inferSelect; -export type NewGeoBlockingRule = typeof geoBlockingRules.$inferInsert; -export declare const INBOX_FILE_TYPES: readonly ["clip", "scene", "video"]; -export type InboxFileType = typeof INBOX_FILE_TYPES[number]; -export declare const publishedInboxFiles: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "published_inbox_files"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "published_inbox_files"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - sourceInboxPath: import("drizzle-orm/pg-core").PgColumn<{ - name: "source_inbox_path"; - tableName: "published_inbox_files"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - filename: import("drizzle-orm/pg-core").PgColumn<{ - name: "filename"; - tableName: "published_inbox_files"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - publishedAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "published_at"; - tableName: "published_inbox_files"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - publishedToPath: import("drizzle-orm/pg-core").PgColumn<{ - name: "published_to_path"; - tableName: "published_inbox_files"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - publicMediaId: import("drizzle-orm/pg-core").PgColumn<{ - name: "public_media_id"; - tableName: "published_inbox_files"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - fileType: import("drizzle-orm/pg-core").PgColumn<{ - name: "file_type"; - tableName: "published_inbox_files"; - dataType: "string"; - columnType: "PgText"; - data: "video" | "scene" | "clip"; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: "video" | "scene" | "clip"; - }>; - }; - dialect: "pg"; -}>; -export type PublishedInboxFile = typeof publishedInboxFiles.$inferSelect; -export type NewPublishedInboxFile = typeof publishedInboxFiles.$inferInsert; -export declare const OCR_TEXT_TYPES: readonly ["credits", "title_card", "overlay", "unknown"]; -export type OcrTextType = typeof OCR_TEXT_TYPES[number]; -export declare const videoOcrResults: import("drizzle-orm/pg-core").PgTableWithColumns<{ - name: "video_ocr_results"; - schema: undefined; - columns: { - id: import("drizzle-orm/pg-core").PgColumn<{ - name: "id"; - tableName: "video_ocr_results"; - dataType: "number"; - columnType: "PgSerial"; - data: number; - driverParam: number; - notNull: true; - hasDefault: true; - isPrimaryKey: true; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - digestId: import("drizzle-orm/pg-core").PgColumn<{ - name: "digest_id"; - tableName: "video_ocr_results"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - videoId: import("drizzle-orm/pg-core").PgColumn<{ - name: "video_id"; - tableName: "video_ocr_results"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - frameIndex: import("drizzle-orm/pg-core").PgColumn<{ - name: "frame_index"; - tableName: "video_ocr_results"; - dataType: "number"; - columnType: "PgInteger"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - timestamp: import("drizzle-orm/pg-core").PgColumn<{ - name: "timestamp"; - tableName: "video_ocr_results"; - dataType: "number"; - columnType: "PgReal"; - data: number; - driverParam: string | number; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - extractedText: import("drizzle-orm/pg-core").PgColumn<{ - name: "extracted_text"; - tableName: "video_ocr_results"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - confidence: import("drizzle-orm/pg-core").PgColumn<{ - name: "confidence"; - tableName: "video_ocr_results"; - dataType: "number"; - columnType: "PgReal"; - data: number; - driverParam: string | number; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - textType: import("drizzle-orm/pg-core").PgColumn<{ - name: "text_type"; - tableName: "video_ocr_results"; - dataType: "string"; - columnType: "PgText"; - data: "unknown" | "credits" | "title_card" | "overlay"; - driverParam: string; - notNull: false; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, { - $type: "unknown" | "credits" | "title_card" | "overlay"; - }>; - sourceFrame: import("drizzle-orm/pg-core").PgColumn<{ - name: "source_frame"; - tableName: "video_ocr_results"; - dataType: "string"; - columnType: "PgText"; - data: string; - driverParam: string; - notNull: true; - hasDefault: false; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: [string, ...string[]]; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - createdAt: import("drizzle-orm/pg-core").PgColumn<{ - name: "created_at"; - tableName: "video_ocr_results"; - dataType: "date"; - columnType: "PgTimestamp"; - data: Date; - driverParam: string; - notNull: false; - hasDefault: true; - isPrimaryKey: false; - isAutoincrement: false; - hasRuntimeDefault: false; - enumValues: undefined; - baseColumn: never; - identity: undefined; - generated: undefined; - }, {}, {}>; - }; - dialect: "pg"; -}>; -export type VideoOcrResult = typeof videoOcrResults.$inferSelect; -export type NewVideoOcrResult = typeof videoOcrResults.$inferInsert; -//# sourceMappingURL=schema.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/media/db/schema.d.ts.map b/api/dist/modules/media/db/schema.d.ts.map deleted file mode 100644 index 9548c90a..00000000 --- a/api/dist/modules/media/db/schema.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/modules/media/db/schema.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,eAAe,iHAAkH,CAAC;AAC/I,MAAM,MAAM,aAAa,GAAG,OAAO,eAAe,CAAC,MAAM,CAAC,CAAC;AAE3D,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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/api/dist/modules/media/db/schema.js deleted file mode 100644 index 6ba9130e..00000000 --- a/api/dist/modules/media/db/schema.js +++ /dev/null @@ -1,1734 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.closeFriends = exports.privacySettings = exports.userSocialLinks = exports.SOCIAL_PLATFORMS = exports.userGalleryImages = exports.userPresence = exports.videoRecommendations = exports.pokes = exports.userBlocks = exports.friendships = exports.FRIENDSHIP_STATUS = exports.adClicks = exports.adImpressions = exports.ads = exports.playlistViews = exports.featuredPlaylists = exports.playlistVideos = exports.playlists = exports.contentReports = exports.REPORT_STATUS = exports.REPORT_TYPES = exports.moderationWordLists = exports.WORD_FILTER_LEVELS = exports.rateLimits = exports.appSettings = exports.chatThreadReadStatus = exports.userDailyActivity = exports.highlightCooldowns = exports.videoReactions = exports.REACTION_TYPES = exports.userFinishes = exports.userStats = exports.userAchievements = exports.emailChangeTokens = exports.passwordResetTokens = exports.emailVerificationTokens = exports.commentModeration = exports.sessionBans = exports.authTokens = exports.mediaUsers = exports.v2Users = exports.views = exports.comments = exports.upvotes = exports.sessions = exports.publicMedia = exports.jobs = exports.compilations = exports.videos = exports.DIRECTORY_TYPES = void 0; -exports.PIPELINE_STEP_STATUS = exports.PIPELINE_STATUS = exports.performerDiscrepancies = exports.DISCREPANCY_RESOLUTIONS = exports.DISCREPANCY_STATUS = exports.DISCREPANCY_TYPES = exports.performerFaces = exports.FACE_STATUS = exports.creators = exports.tagGenerationJobs = exports.watchPartyInvites = exports.INVITE_STATUS = exports.watchPartyReactions = exports.watchPartyChatMessages = exports.watchPartyParticipants = exports.watchPartySessions = exports.LOOP_MODE = exports.WATCH_PARTY_STATUS = exports.digestClipTags = exports.digestSuggestedTags = exports.SUGGESTED_TAG_STATUS = exports.videoTags = exports.videoSegments = exports.videoTagTimeline = exports.VOCAL_CATEGORIES = exports.SEGMENT_TYPES = exports.videoSceneCuts = exports.digestGeneratedScenes = exports.digestOutputFolders = exports.digestCompilations = exports.CAPTION_SIZES = exports.CAPTION_POSITIONS = exports.digestGeneratedClips = exports.digestSelectedClips = exports.CLIP_SOURCES = exports.CLIP_STATUS = exports.CLIP_TYPES = exports.digestVideoTags = exports.videoDigests = exports.DIGEST_STATUS = exports.publicMediaPerformers = exports.userTagPreferences = exports.userUploadSuggestedTags = exports.publicMediaTags = exports.tags = exports.tagCategories = exports.uploadInvites = exports.UPLOAD_INVITE_STATUS = exports.userUploads = exports.USER_UPLOAD_STATUS = void 0; -exports.videoOcrResults = exports.OCR_TEXT_TYPES = exports.publishedInboxFiles = exports.INBOX_FILE_TYPES = exports.geoBlockingRules = exports.GEO_BLOCKING_MODES = exports.notificationPreferences = exports.notifications = exports.NOTIFICATION_TYPES = exports.paymentAuditLog = exports.payments = exports.invoices = exports.userSubscriptions = exports.subscriptionPlans = exports.pipelineTemplates = exports.resourceSnapshots = exports.pipelineStepEvents = exports.pipelineSteps = exports.pipelines = void 0; -const pg_core_1 = require("drizzle-orm/pg-core"); -// Directory type enum for efficient filtering (replaces LIKE patterns) -exports.DIRECTORY_TYPES = ['studios', 'gifs', 'private', 'inbox', 'curated', 'playback', 'compilations', 'videos', 'highlights']; -exports.videos = (0, pg_core_1.pgTable)('videos', { - id: (0, pg_core_1.serial)('id').primaryKey(), - path: (0, pg_core_1.text)('path').notNull().unique(), - filename: (0, pg_core_1.text)('filename').notNull(), - producer: (0, pg_core_1.text)('producer'), - creator: (0, pg_core_1.text)('creator'), - title: (0, pg_core_1.text)('title'), - durationSeconds: (0, pg_core_1.integer)('duration_seconds'), - quality: (0, pg_core_1.text)('quality'), - orientation: (0, pg_core_1.text)('orientation'), - hasAudio: (0, pg_core_1.boolean)('has_audio').default(true), - fileSize: (0, pg_core_1.bigint)('file_size', { mode: 'number' }), - fileHash: (0, pg_core_1.text)('file_hash'), - width: (0, pg_core_1.integer)('width'), - height: (0, pg_core_1.integer)('height'), - lastValidated: (0, pg_core_1.timestamp)('last_validated', { withTimezone: true }), - isValid: (0, pg_core_1.boolean)('is_valid').default(true), - thumbnailPath: (0, pg_core_1.text)('thumbnail_path'), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), - tags: (0, pg_core_1.jsonb)('tags').$type(), - // Directory type for efficient filtering (indexed) - directoryType: (0, pg_core_1.text)('directory_type').$type(), - // Historical engagement stats (preserved when moved from public media) - publicViewCount: (0, pg_core_1.integer)('public_view_count'), - publicUpvoteCount: (0, pg_core_1.integer)('public_upvote_count'), - publicCommentCount: (0, pg_core_1.integer)('public_comment_count'), - publicCompletionCount: (0, pg_core_1.integer)('public_completion_count'), - publicTotalWatchTime: (0, pg_core_1.integer)('public_total_watch_time'), - movedFromPublicAt: (0, pg_core_1.timestamp)('moved_from_public_at', { withTimezone: true }), - // Name standardization tracking - originalFilename: (0, pg_core_1.text)('original_filename'), - originalPath: (0, pg_core_1.text)('original_path'), - standardizedAt: (0, pg_core_1.timestamp)('standardized_at', { withTimezone: true }), -}, (table) => ({ - orientationIdx: (0, pg_core_1.index)('idx_orientation').on(table.orientation), - producerIdx: (0, pg_core_1.index)('idx_producer').on(table.producer), - isValidIdx: (0, pg_core_1.index)('idx_is_valid').on(table.isValid), - directoryTypeIdx: (0, pg_core_1.index)('idx_directory_type').on(table.directoryType), - fingerprintIdx: (0, pg_core_1.index)('idx_videos_fingerprint').on(table.durationSeconds, table.fileSize, table.width, table.height), - // Composite index for common filtering pattern (directory + valid + orientation) - directoryValidOrientationIdx: (0, pg_core_1.index)('idx_videos_directory_valid_orientation').on(table.directoryType, table.isValid, table.orientation), -})); -exports.compilations = (0, pg_core_1.pgTable)('compilations', { - id: (0, pg_core_1.serial)('id').primaryKey(), - filename: (0, pg_core_1.text)('filename').notNull(), - path: (0, pg_core_1.text)('path'), - durationSeconds: (0, pg_core_1.integer)('duration_seconds'), - videoIds: (0, pg_core_1.jsonb)('video_ids').$type(), - settings: (0, pg_core_1.jsonb)('settings').$type(), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), -}); -exports.jobs = (0, pg_core_1.pgTable)('jobs', { - id: (0, pg_core_1.serial)('id').primaryKey(), - type: (0, pg_core_1.text)('type').notNull(), - status: (0, pg_core_1.text)('status').default('pending').$type(), - progress: (0, pg_core_1.integer)('progress').default(0), - log: (0, pg_core_1.text)('log'), - params: (0, pg_core_1.jsonb)('params').$type(), - startedAt: (0, pg_core_1.timestamp)('started_at', { withTimezone: true }), - completedAt: (0, pg_core_1.timestamp)('completed_at', { withTimezone: true }), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), - // Queue management columns - resourceCategory: (0, pg_core_1.text)('resource_category').default('cpu').$type(), - vramRequired: (0, pg_core_1.integer)('vram_required').default(0), - queuePosition: (0, pg_core_1.integer)('queue_position'), - waitingReason: (0, pg_core_1.text)('waiting_reason'), - priority: (0, pg_core_1.integer)('priority').default(5), - // Pipeline integration (optional - for jobs created via pipeline) - pipelineId: (0, pg_core_1.integer)('pipeline_id'), - pipelineStepId: (0, pg_core_1.integer)('pipeline_step_id'), -}, (table) => ({ - queueIdx: (0, pg_core_1.index)('idx_jobs_queue').on(table.status, table.priority, table.createdAt), - resourceIdx: (0, pg_core_1.index)('idx_jobs_resource').on(table.resourceCategory, table.status), - pipelineIdx: (0, pg_core_1.index)('idx_jobs_pipeline').on(table.pipelineId), -})); -// ============================================ -// Public Gallery Tables -// ============================================ -exports.publicMedia = (0, pg_core_1.pgTable)('public_media', { - id: (0, pg_core_1.serial)('id').primaryKey(), - path: (0, pg_core_1.text)('path').notNull().unique(), - filename: (0, pg_core_1.text)('filename').notNull(), - category: (0, pg_core_1.text)('category').notNull(), - durationSeconds: (0, pg_core_1.integer)('duration_seconds'), - quality: (0, pg_core_1.text)('quality'), - orientation: (0, pg_core_1.text)('orientation'), - thumbnailPath: (0, pg_core_1.text)('thumbnail_path'), - fileSize: (0, pg_core_1.bigint)('file_size', { mode: 'number' }), - // Denormalized counters for performance - viewCount: (0, pg_core_1.integer)('view_count').default(0), - upvoteCount: (0, pg_core_1.integer)('upvote_count').default(0), - commentCount: (0, pg_core_1.integer)('comment_count').default(0), - finishCount: (0, pg_core_1.integer)('finish_count').default(0), - totalWatchTime: (0, pg_core_1.integer)('total_watch_time').default(0), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), - // Locked video system - isLocked: (0, pg_core_1.boolean)('is_locked').default(false), - lockedAt: (0, pg_core_1.timestamp)('locked_at', { withTimezone: true }), - lockedBy: (0, pg_core_1.integer)('locked_by'), - // Manual ordering for playlist (curated category) - position: (0, pg_core_1.integer)('position').default(0), - // Track uploader for quickies - uploaderId: (0, pg_core_1.integer)('uploader_id'), -}, (table) => ({ - categoryIdx: (0, pg_core_1.index)('idx_public_media_category').on(table.category), - pathIdx: (0, pg_core_1.index)('idx_public_media_path').on(table.path), - isLockedIdx: (0, pg_core_1.index)('idx_public_media_is_locked').on(table.isLocked), - positionIdx: (0, pg_core_1.index)('idx_public_media_position').on(table.position), - // Quickies performance indexes - uploaderIdx: (0, pg_core_1.index)('idx_public_media_uploader').on(table.uploaderId), - categoryDateIdx: (0, pg_core_1.index)('idx_public_media_category_date').on(table.category, table.createdAt), - orientationIdx: (0, pg_core_1.index)('idx_public_media_orientation').on(table.orientation), - // Composite index for common filtering (category + locked + date) - categoryLockedDateIdx: (0, pg_core_1.index)('idx_public_media_category_locked_date').on(table.category, table.isLocked, table.createdAt), -})); -exports.sessions = (0, pg_core_1.pgTable)('sessions', { - id: (0, pg_core_1.text)('id').primaryKey(), // UUID from client - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), - lastSeenAt: (0, pg_core_1.timestamp)('last_seen_at', { withTimezone: true }), - // Device tracking - ipAddress: (0, pg_core_1.text)('ip_address'), - userAgent: (0, pg_core_1.text)('user_agent'), - deviceType: (0, pg_core_1.text)('device_type'), // 'desktop' | 'mobile' | 'tablet' - browser: (0, pg_core_1.text)('browser'), - os: (0, pg_core_1.text)('os'), - // Geography (from GeoIP) - country: (0, pg_core_1.text)('country'), // ISO code: 'US' - countryName: (0, pg_core_1.text)('country_name'), // 'United States' - region: (0, pg_core_1.text)('region'), // 'CA' - city: (0, pg_core_1.text)('city'), // 'Los Angeles' - timezone: (0, pg_core_1.text)('timezone'), // 'America/Los_Angeles' - latitude: (0, pg_core_1.real)('latitude'), - longitude: (0, pg_core_1.real)('longitude'), - // User correlation - userId: (0, pg_core_1.integer)('user_id'), // Links session to authenticated user - // Analytics - firstSeenAt: (0, pg_core_1.timestamp)('first_seen_at', { withTimezone: true }), // For return visitor detection - visitCount: (0, pg_core_1.integer)('visit_count').default(1), // Increment on return visits -}, (table) => ({ - userIdIdx: (0, pg_core_1.index)('idx_sessions_user_id').on(table.userId), - countryIdx: (0, pg_core_1.index)('idx_sessions_country').on(table.country), -})); -exports.upvotes = (0, pg_core_1.pgTable)('upvotes', { - id: (0, pg_core_1.serial)('id').primaryKey(), - mediaId: (0, pg_core_1.integer)('media_id').notNull(), - sessionId: (0, pg_core_1.text)('session_id').notNull(), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), -}, (table) => ({ - uniqueVoteIdx: (0, pg_core_1.index)('idx_upvotes_unique').on(table.mediaId, table.sessionId), - mediaIdx: (0, pg_core_1.index)('idx_upvotes_media').on(table.mediaId), -})); -exports.comments = (0, pg_core_1.pgTable)('comments', { - id: (0, pg_core_1.serial)('id').primaryKey(), - mediaId: (0, pg_core_1.integer)('media_id').notNull(), - sessionId: (0, pg_core_1.text)('session_id').notNull(), - userId: (0, pg_core_1.integer)('user_id'), - content: (0, pg_core_1.text)('content').notNull(), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), - // Content safety fields for LLM-based moderation - safetyStatus: (0, pg_core_1.text)('safety_status').default('pending'), - safetyCheckedAt: (0, pg_core_1.timestamp)('safety_checked_at', { withTimezone: true }), - safetyCategories: (0, pg_core_1.jsonb)('safety_categories').$type(), - safetyReasoning: (0, pg_core_1.text)('safety_reasoning'), - // Hidden comment fields for auto-moderation - isHidden: (0, pg_core_1.boolean)('is_hidden').default(false), - hiddenAt: (0, pg_core_1.timestamp)('hidden_at', { withTimezone: true }), - hiddenReason: (0, pg_core_1.text)('hidden_reason'), - // Admin moderation notes (internal, not shown to users) - moderationNotes: (0, pg_core_1.text)('moderation_notes'), -}, (table) => ({ - mediaIdx: (0, pg_core_1.index)('idx_comments_media').on(table.mediaId), - sessionIdx: (0, pg_core_1.index)('idx_comments_session').on(table.sessionId), - userIdx: (0, pg_core_1.index)('idx_comments_user').on(table.userId), - safetyStatusIdx: (0, pg_core_1.index)('idx_comments_safety_status').on(table.safetyStatus), - isHiddenIdx: (0, pg_core_1.index)('idx_comments_is_hidden').on(table.isHidden), -})); -exports.views = (0, pg_core_1.pgTable)('views', { - id: (0, pg_core_1.serial)('id').primaryKey(), - mediaId: (0, pg_core_1.integer)('media_id').notNull(), - sessionId: (0, pg_core_1.text)('session_id').notNull(), - watchTimeSeconds: (0, pg_core_1.integer)('watch_time_seconds').default(0), - lastUpdated: (0, pg_core_1.timestamp)('last_updated', { withTimezone: true }).defaultNow(), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), -}, (table) => ({ - uniqueViewIdx: (0, pg_core_1.index)('idx_views_unique').on(table.mediaId, table.sessionId), - mediaIdx: (0, pg_core_1.index)('idx_views_media').on(table.mediaId), -})); -// ============================================ -// User Management Tables -// ============================================ -// V2 Users table (for authentication only) -// This matches the Prisma User model to allow Drizzle queries for auth -// Table name: 'users' (created by Prisma migrations) -exports.v2Users = (0, pg_core_1.pgTable)('users', { - id: (0, pg_core_1.text)('id').primaryKey(), - email: (0, pg_core_1.text)('email').notNull().unique(), - password: (0, pg_core_1.text)('password').notNull(), - name: (0, pg_core_1.text)('name'), - phone: (0, pg_core_1.text)('phone'), - role: (0, pg_core_1.text)('role').notNull().default('USER'), - status: (0, pg_core_1.text)('status').notNull().default('ACTIVE'), - permissions: (0, pg_core_1.jsonb)('permissions'), - createdVia: (0, pg_core_1.text)('createdVia').notNull().default('STANDARD'), - expiresAt: (0, pg_core_1.timestamp)('expiresAt', { withTimezone: true }), - expireDays: (0, pg_core_1.integer)('expireDays'), - lastLoginAt: (0, pg_core_1.timestamp)('lastLoginAt', { withTimezone: true }), - emailVerified: (0, pg_core_1.boolean)('emailVerified').notNull().default(false), - createdAt: (0, pg_core_1.timestamp)('createdAt', { withTimezone: true }).notNull().defaultNow(), - updatedAt: (0, pg_core_1.timestamp)('updatedAt', { withTimezone: true }).notNull().defaultNow(), -}, (table) => ({ - emailIdx: (0, pg_core_1.index)('User_email_key').on(table.email), -})); -// Media-specific users table (for future media-api user management) -// NOTE: This is separate from v2Users and not currently used -// If/when media-api needs its own user system, this table can be created -exports.mediaUsers = (0, pg_core_1.pgTable)('media_users', { - id: (0, pg_core_1.serial)('id').primaryKey(), - username: (0, pg_core_1.text)('username').notNull().unique(), - email: (0, pg_core_1.text)('email').notNull().unique(), - passwordHash: (0, pg_core_1.text)('password_hash').notNull(), - role: (0, pg_core_1.text)('role').notNull().default('user'), - status: (0, pg_core_1.text)('status').notNull().default('pending'), - emailVerified: (0, pg_core_1.boolean)('email_verified').default(false), - linkedSessionId: (0, pg_core_1.text)('linked_session_id'), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), - approvedAt: (0, pg_core_1.timestamp)('approved_at', { withTimezone: true }), - approvedBy: (0, pg_core_1.integer)('approved_by'), - lastLoginAt: (0, pg_core_1.timestamp)('last_login_at', { withTimezone: true }), - // Trusted user fields - isTrusted: (0, pg_core_1.boolean)('is_trusted').default(false), - maxUploadDurationSeconds: (0, pg_core_1.integer)('max_upload_duration_seconds').default(60), - autoAcceptUploads: (0, pg_core_1.boolean)('auto_accept_uploads').default(false), - trustedAt: (0, pg_core_1.timestamp)('trusted_at', { withTimezone: true }), - trustedBy: (0, pg_core_1.integer)('trusted_by'), - defaultPlaylistId: (0, pg_core_1.integer)('default_playlist_id'), - // Social links visibility - socialLinksPublic: (0, pg_core_1.boolean)('social_links_public').default(false), - // Subscription fields - subscriptionStatus: (0, pg_core_1.text)('subscription_status').default('none'), // none, active, grace_period, delinquent, lifetime - subscriptionPlanId: (0, pg_core_1.integer)('subscription_plan_id'), - subscriptionEndDate: (0, pg_core_1.timestamp)('subscription_end_date', { withTimezone: true }), - lifetimeMember: (0, pg_core_1.boolean)('lifetime_member').default(false), - totalPaidCAD: (0, pg_core_1.integer)('total_paid_cad').default(0), // Lifetime total in cents - // Moderation tracking - lastModerationAction: (0, pg_core_1.timestamp)('last_moderation_action', { withTimezone: true }), -}, (table) => ({ - emailIdx: (0, pg_core_1.index)('idx_media_users_email').on(table.email), - usernameIdx: (0, pg_core_1.index)('idx_media_users_username').on(table.username), - statusIdx: (0, pg_core_1.index)('idx_media_users_status').on(table.status), - trustedIdx: (0, pg_core_1.index)('idx_media_users_trusted').on(table.isTrusted), - subscriptionStatusIdx: (0, pg_core_1.index)('idx_media_users_subscription_status').on(table.subscriptionStatus), -})); -exports.authTokens = (0, pg_core_1.pgTable)('auth_tokens', { - id: (0, pg_core_1.serial)('id').primaryKey(), - userId: (0, pg_core_1.integer)('user_id').notNull(), - token: (0, pg_core_1.text)('token').notNull().unique(), - type: (0, pg_core_1.text)('type').notNull(), - expiresAt: (0, pg_core_1.timestamp)('expires_at', { withTimezone: true }).notNull(), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), -}, (table) => ({ - tokenIdx: (0, pg_core_1.index)('idx_auth_tokens_token').on(table.token), - userIdx: (0, pg_core_1.index)('idx_auth_tokens_user').on(table.userId), -})); -exports.sessionBans = (0, pg_core_1.pgTable)('session_bans', { - id: (0, pg_core_1.serial)('id').primaryKey(), - sessionId: (0, pg_core_1.text)('session_id').notNull(), - reason: (0, pg_core_1.text)('reason'), - bannedBy: (0, pg_core_1.integer)('banned_by'), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), - expiresAt: (0, pg_core_1.timestamp)('expires_at', { withTimezone: true }), // null = permanent -}, (table) => ({ - sessionIdx: (0, pg_core_1.index)('idx_session_bans_session').on(table.sessionId), -})); -exports.commentModeration = (0, pg_core_1.pgTable)('comment_moderation', { - id: (0, pg_core_1.serial)('id').primaryKey(), - commentId: (0, pg_core_1.integer)('comment_id').notNull(), - status: (0, pg_core_1.text)('status').notNull().default('pending'), - moderatedBy: (0, pg_core_1.integer)('moderated_by'), - moderatedAt: (0, pg_core_1.timestamp)('moderated_at', { withTimezone: true }), - reason: (0, pg_core_1.text)('reason'), -}, (table) => ({ - commentIdx: (0, pg_core_1.index)('idx_comment_moderation_comment').on(table.commentId), - statusIdx: (0, pg_core_1.index)('idx_comment_moderation_status').on(table.status), -})); -// Email Verification Tokens -exports.emailVerificationTokens = (0, pg_core_1.pgTable)('email_verification_tokens', { - id: (0, pg_core_1.serial)('id').primaryKey(), - userId: (0, pg_core_1.integer)('user_id').notNull(), - token: (0, pg_core_1.text)('token').notNull().unique(), - expiresAt: (0, pg_core_1.timestamp)('expires_at', { withTimezone: true }).notNull(), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), -}, (table) => ({ - tokenIdx: (0, pg_core_1.index)('idx_email_verification_tokens_token').on(table.token), - userIdx: (0, pg_core_1.index)('idx_email_verification_tokens_user').on(table.userId), -})); -// Password Reset Tokens -exports.passwordResetTokens = (0, pg_core_1.pgTable)('password_reset_tokens', { - id: (0, pg_core_1.serial)('id').primaryKey(), - userId: (0, pg_core_1.integer)('user_id').notNull(), - token: (0, pg_core_1.text)('token').notNull().unique(), - expiresAt: (0, pg_core_1.timestamp)('expires_at', { withTimezone: true }).notNull(), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), - usedAt: (0, pg_core_1.timestamp)('used_at', { withTimezone: true }), -}, (table) => ({ - tokenIdx: (0, pg_core_1.index)('idx_password_reset_tokens_token').on(table.token), - userIdx: (0, pg_core_1.index)('idx_password_reset_tokens_user').on(table.userId), -})); -// Email Change Tokens -exports.emailChangeTokens = (0, pg_core_1.pgTable)('email_change_tokens', { - id: (0, pg_core_1.serial)('id').primaryKey(), - userId: (0, pg_core_1.integer)('user_id').notNull(), - newEmail: (0, pg_core_1.text)('new_email').notNull(), - token: (0, pg_core_1.text)('token').notNull().unique(), - expiresAt: (0, pg_core_1.timestamp)('expires_at', { withTimezone: true }).notNull(), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), -}, (table) => ({ - tokenIdx: (0, pg_core_1.index)('idx_email_change_tokens_token').on(table.token), - userIdx: (0, pg_core_1.index)('idx_email_change_tokens_user').on(table.userId), -})); -// ============================================ -// Achievement & Dashboard Tables -// ============================================ -exports.userAchievements = (0, pg_core_1.pgTable)('user_achievements', { - id: (0, pg_core_1.serial)('id').primaryKey(), - userId: (0, pg_core_1.integer)('user_id').notNull(), - achievementId: (0, pg_core_1.text)('achievement_id').notNull(), - unlockedAt: (0, pg_core_1.timestamp)('unlocked_at', { withTimezone: true }).notNull(), - progress: (0, pg_core_1.integer)('progress').default(0), - notified: (0, pg_core_1.boolean)('notified').default(false), -}, (table) => ({ - userIdx: (0, pg_core_1.index)('idx_user_achievements_user').on(table.userId), - // Unique constraint for ON CONFLICT support in batch inserts - userAchievementUnique: (0, pg_core_1.uniqueIndex)('idx_user_achievements_unique').on(table.userId, table.achievementId), -})); -exports.userStats = (0, pg_core_1.pgTable)('user_stats', { - id: (0, pg_core_1.serial)('id').primaryKey(), - userId: (0, pg_core_1.integer)('user_id').notNull().unique(), - totalWatchTimeSeconds: (0, pg_core_1.integer)('total_watch_time_seconds').default(0), - totalVideosWatched: (0, pg_core_1.integer)('total_videos_watched').default(0), - totalUpvotesGiven: (0, pg_core_1.integer)('total_upvotes_given').default(0), - totalCommentsMade: (0, pg_core_1.integer)('total_comments_made').default(0), - totalFinishes: (0, pg_core_1.integer)('total_finishes').default(0), - currentDayStreak: (0, pg_core_1.integer)('current_day_streak').default(0), - longestDayStreak: (0, pg_core_1.integer)('longest_day_streak').default(0), - lastActiveDate: (0, pg_core_1.text)('last_active_date'), // YYYY-MM-DD format - longestSingleSession: (0, pg_core_1.integer)('longest_single_session').default(0), - categoriesCompleted: (0, pg_core_1.jsonb)('categories_completed').$type(), - nightOwlCount: (0, pg_core_1.integer)('night_owl_count').default(0), - earlyBirdCount: (0, pg_core_1.integer)('early_bird_count').default(0), - updatedAt: (0, pg_core_1.timestamp)('updated_at', { withTimezone: true }), -}); -exports.userFinishes = (0, pg_core_1.pgTable)('user_finishes', { - id: (0, pg_core_1.serial)('id').primaryKey(), - userId: (0, pg_core_1.integer)('user_id').notNull(), - mediaId: (0, pg_core_1.integer)('media_id'), - sessionId: (0, pg_core_1.text)('session_id'), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).notNull(), -}, (table) => ({ - userIdx: (0, pg_core_1.index)('idx_user_finishes_user').on(table.userId), - dateIdx: (0, pg_core_1.index)('idx_user_finishes_date').on(table.createdAt), -})); -// ============================================ -// Video Reactions Table -// ============================================ -exports.REACTION_TYPES = ['like', 'love', 'laugh', 'wow', 'sad', 'angry']; -exports.videoReactions = (0, pg_core_1.pgTable)('video_reactions', { - id: (0, pg_core_1.serial)('id').primaryKey(), - userId: (0, pg_core_1.integer)('user_id').notNull(), - mediaId: (0, pg_core_1.integer)('media_id').notNull(), - reactionType: (0, pg_core_1.text)('reaction_type').notNull(), - videoTimestamp: (0, pg_core_1.integer)('video_timestamp').notNull(), // seconds into the video when reaction was clicked - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).notNull(), -}, (table) => ({ - userMediaTypeIdx: (0, pg_core_1.index)('idx_video_reactions_user_media_type').on(table.userId, table.mediaId, table.reactionType), - mediaTimestampIdx: (0, pg_core_1.index)('idx_video_reactions_media_timestamp').on(table.mediaId, table.videoTimestamp), - mediaIdx: (0, pg_core_1.index)('idx_video_reactions_media').on(table.mediaId), - createdAtIdx: (0, pg_core_1.index)('idx_video_reactions_created').on(table.createdAt), -})); -// ============================================ -// Quickie Generation Cooldowns Table -// ============================================ -exports.highlightCooldowns = (0, pg_core_1.pgTable)('highlight_cooldowns', { - id: (0, pg_core_1.serial)('id').primaryKey(), - userId: (0, pg_core_1.integer)('user_id').notNull(), - lastGeneratedAt: (0, pg_core_1.timestamp)('last_generated_at', { withTimezone: true }).notNull(), -}, (table) => ({ - userIdx: (0, pg_core_1.index)('idx_highlight_cooldowns_user').on(table.userId), -})); -exports.userDailyActivity = (0, pg_core_1.pgTable)('user_daily_activity', { - id: (0, pg_core_1.serial)('id').primaryKey(), - userId: (0, pg_core_1.integer)('user_id').notNull(), - activityDate: (0, pg_core_1.text)('activity_date').notNull(), // YYYY-MM-DD - watchTimeSeconds: (0, pg_core_1.integer)('watch_time_seconds').default(0), - videosWatched: (0, pg_core_1.integer)('videos_watched').default(0), - firstActivityHour: (0, pg_core_1.integer)('first_activity_hour'), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }), -}, (table) => ({ - uniqueIdx: (0, pg_core_1.index)('idx_user_daily_activity_unique').on(table.userId, table.activityDate), -})); -// ============================================ -// Chat Thread Tracking Table -// ============================================ -exports.chatThreadReadStatus = (0, pg_core_1.pgTable)('chat_thread_read_status', { - id: (0, pg_core_1.serial)('id').primaryKey(), - userId: (0, pg_core_1.integer)('user_id').notNull(), - mediaId: (0, pg_core_1.integer)('media_id').notNull(), - lastSeenAt: (0, pg_core_1.timestamp)('last_seen_at', { withTimezone: true }).notNull(), -}, (table) => ({ - uniqueIdx: (0, pg_core_1.index)('idx_chat_thread_read_unique').on(table.userId, table.mediaId), - userIdx: (0, pg_core_1.index)('idx_chat_thread_read_user').on(table.userId), -})); -// ============================================ -// App Settings Table -// ============================================ -exports.appSettings = (0, pg_core_1.pgTable)('app_settings', { - key: (0, pg_core_1.text)('key').primaryKey(), - value: (0, pg_core_1.text)('value').notNull(), - updatedAt: (0, pg_core_1.timestamp)('updated_at', { withTimezone: true }).defaultNow(), -}); -// ============================================ -// Rate Limiting Table (for persistent rate limits) -// ============================================ -exports.rateLimits = (0, pg_core_1.pgTable)('rate_limits', { - id: (0, pg_core_1.serial)('id').primaryKey(), - key: (0, pg_core_1.text)('key').notNull().unique(), - count: (0, pg_core_1.integer)('count').notNull().default(1), - resetAt: (0, pg_core_1.timestamp)('reset_at', { withTimezone: true }).notNull(), -}, (table) => ({ - keyIdx: (0, pg_core_1.uniqueIndex)('idx_rate_limits_key').on(table.key), - resetAtIdx: (0, pg_core_1.index)('idx_rate_limits_reset_at').on(table.resetAt), -})); -// ============================================ -// Moderation Word Lists Table -// ============================================ -exports.WORD_FILTER_LEVELS = ['low', 'medium', 'high', 'custom']; -exports.moderationWordLists = (0, pg_core_1.pgTable)('moderation_word_lists', { - id: (0, pg_core_1.serial)('id').primaryKey(), - level: (0, pg_core_1.text)('level').notNull(), - word: (0, pg_core_1.text)('word').notNull(), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), - createdBy: (0, pg_core_1.integer)('created_by'), -}, (table) => ({ - levelIdx: (0, pg_core_1.index)('idx_moderation_word_lists_level').on(table.level), - wordIdx: (0, pg_core_1.index)('idx_moderation_word_lists_word').on(table.word), -})); -// ============================================ -// Content Reports Table -// ============================================ -exports.REPORT_TYPES = ['inappropriate', 'spam', 'copyright', 'illegal', 'false_info', 'other']; -exports.REPORT_STATUS = ['pending', 'reviewed', 'actioned', 'dismissed']; -exports.contentReports = (0, pg_core_1.pgTable)('content_reports', { - id: (0, pg_core_1.serial)('id').primaryKey(), - mediaId: (0, pg_core_1.integer)('media_id').notNull(), - sessionId: (0, pg_core_1.text)('session_id'), - userId: (0, pg_core_1.integer)('user_id'), - reportType: (0, pg_core_1.text)('report_type').notNull(), - description: (0, pg_core_1.text)('description'), - status: (0, pg_core_1.text)('status').notNull().default('pending'), - resolvedBy: (0, pg_core_1.integer)('resolved_by'), - resolvedAt: (0, pg_core_1.timestamp)('resolved_at', { withTimezone: true }), - resolutionNotes: (0, pg_core_1.text)('resolution_notes'), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), -}, (table) => ({ - mediaIdx: (0, pg_core_1.index)('idx_content_reports_media').on(table.mediaId), - statusIdx: (0, pg_core_1.index)('idx_content_reports_status').on(table.status), - sessionIdx: (0, pg_core_1.index)('idx_content_reports_session').on(table.sessionId), - createdAtIdx: (0, pg_core_1.index)('idx_content_reports_created').on(table.createdAt), -})); -// ============================================ -// Playlist Tables -// ============================================ -exports.playlists = (0, pg_core_1.pgTable)('playlists', { - id: (0, pg_core_1.serial)('id').primaryKey(), - userId: (0, pg_core_1.integer)('user_id').notNull(), - name: (0, pg_core_1.text)('name').notNull(), - description: (0, pg_core_1.text)('description'), - isPublic: (0, pg_core_1.boolean)('is_public').default(false), - shareToken: (0, pg_core_1.text)('share_token').unique(), - thumbnailMediaId: (0, pg_core_1.integer)('thumbnail_media_id'), - // Denormalized counters - videoCount: (0, pg_core_1.integer)('video_count').default(0), - totalDurationSeconds: (0, pg_core_1.integer)('total_duration_seconds').default(0), - viewCount: (0, pg_core_1.integer)('view_count').default(0), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), - updatedAt: (0, pg_core_1.timestamp)('updated_at', { withTimezone: true }), -}, (table) => ({ - userIdx: (0, pg_core_1.index)('idx_playlists_user').on(table.userId), - publicIdx: (0, pg_core_1.index)('idx_playlists_public').on(table.isPublic), - shareTokenIdx: (0, pg_core_1.index)('idx_playlists_share_token').on(table.shareToken), - // Prevent duplicate playlist names per user (e.g., multiple "My Quickies") - userNameIdx: (0, pg_core_1.uniqueIndex)('idx_playlists_user_name').on(table.userId, table.name), -})); -exports.playlistVideos = (0, pg_core_1.pgTable)('playlist_videos', { - id: (0, pg_core_1.serial)('id').primaryKey(), - playlistId: (0, pg_core_1.integer)('playlist_id').notNull(), - mediaId: (0, pg_core_1.integer)('media_id').notNull(), - position: (0, pg_core_1.integer)('position').notNull().default(0), - addedAt: (0, pg_core_1.timestamp)('added_at', { withTimezone: true }).defaultNow(), -}, (table) => ({ - playlistIdx: (0, pg_core_1.index)('idx_playlist_videos_playlist').on(table.playlistId), - mediaIdx: (0, pg_core_1.index)('idx_playlist_videos_media').on(table.mediaId), - uniqueIdx: (0, pg_core_1.index)('idx_playlist_videos_unique').on(table.playlistId, table.mediaId), -})); -exports.featuredPlaylists = (0, pg_core_1.pgTable)('featured_playlists', { - id: (0, pg_core_1.serial)('id').primaryKey(), - playlistId: (0, pg_core_1.integer)('playlist_id').notNull().unique(), - position: (0, pg_core_1.integer)('position').notNull().default(0), - featuredBy: (0, pg_core_1.integer)('featured_by'), - featuredAt: (0, pg_core_1.timestamp)('featured_at', { withTimezone: true }), -}, (table) => ({ - positionIdx: (0, pg_core_1.index)('idx_featured_playlists_position').on(table.position), -})); -exports.playlistViews = (0, pg_core_1.pgTable)('playlist_views', { - id: (0, pg_core_1.serial)('id').primaryKey(), - playlistId: (0, pg_core_1.integer)('playlist_id').notNull(), - sessionId: (0, pg_core_1.text)('session_id').notNull(), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), -}, (table) => ({ - playlistIdx: (0, pg_core_1.index)('idx_playlist_views_playlist').on(table.playlistId), - uniqueIdx: (0, pg_core_1.index)('idx_playlist_views_unique').on(table.playlistId, table.sessionId), -})); -// ============================================ -// Advertisement Tables -// ============================================ -exports.ads = (0, pg_core_1.pgTable)('ads', { - id: (0, pg_core_1.serial)('id').primaryKey(), - type: (0, pg_core_1.text)('type').notNull(), - // For make_account: variant identifier (e.g., 'playlist_promo', 'chat_promo') - // For custom: null (uses imagePath instead) - variant: (0, pg_core_1.text)('variant'), - // Custom ad fields - imagePath: (0, pg_core_1.text)('image_path'), - linkUrl: (0, pg_core_1.text)('link_url'), - title: (0, pg_core_1.text)('title'), // For alt text and admin reference - // Visibility: 'everyone', 'members_only', 'non_members' - visibility: (0, pg_core_1.text)('visibility').notNull().default('everyone'), - // Status - isActive: (0, pg_core_1.boolean)('is_active').default(true), - // Ordering for rotation - position: (0, pg_core_1.integer)('position').default(0), - // Denormalized counters for performance - impressionCount: (0, pg_core_1.integer)('impression_count').default(0), - clickCount: (0, pg_core_1.integer)('click_count').default(0), - // Timestamps - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), - updatedAt: (0, pg_core_1.timestamp)('updated_at', { withTimezone: true }), -}, (table) => ({ - typeIdx: (0, pg_core_1.index)('idx_ads_type').on(table.type), - isActiveIdx: (0, pg_core_1.index)('idx_ads_is_active').on(table.isActive), - visibilityIdx: (0, pg_core_1.index)('idx_ads_visibility').on(table.visibility), -})); -exports.adImpressions = (0, pg_core_1.pgTable)('ad_impressions', { - id: (0, pg_core_1.serial)('id').primaryKey(), - adId: (0, pg_core_1.integer)('ad_id').notNull().references(() => exports.ads.id, { onDelete: 'cascade' }), - sessionId: (0, pg_core_1.text)('session_id'), - userId: (0, pg_core_1.integer)('user_id'), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), -}, (table) => ({ - adIdx: (0, pg_core_1.index)('idx_ad_impressions_ad').on(table.adId), - sessionIdx: (0, pg_core_1.index)('idx_ad_impressions_session').on(table.sessionId), - dateIdx: (0, pg_core_1.index)('idx_ad_impressions_date').on(table.createdAt), -})); -exports.adClicks = (0, pg_core_1.pgTable)('ad_clicks', { - id: (0, pg_core_1.serial)('id').primaryKey(), - adId: (0, pg_core_1.integer)('ad_id').notNull().references(() => exports.ads.id, { onDelete: 'cascade' }), - sessionId: (0, pg_core_1.text)('session_id'), - userId: (0, pg_core_1.integer)('user_id'), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), -}, (table) => ({ - adIdx: (0, pg_core_1.index)('idx_ad_clicks_ad').on(table.adId), - sessionIdx: (0, pg_core_1.index)('idx_ad_clicks_session').on(table.sessionId), - dateIdx: (0, pg_core_1.index)('idx_ad_clicks_date').on(table.createdAt), -})); -// ============================================ -// Friends & Social Tables -// ============================================ -exports.FRIENDSHIP_STATUS = ['pending', 'accepted', 'declined']; -exports.friendships = (0, pg_core_1.pgTable)('friendships', { - id: (0, pg_core_1.serial)('id').primaryKey(), - userId: (0, pg_core_1.integer)('user_id').notNull(), - friendId: (0, pg_core_1.integer)('friend_id').notNull(), - status: (0, pg_core_1.text)('status').notNull().default('pending'), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), - acceptedAt: (0, pg_core_1.timestamp)('accepted_at', { withTimezone: true }), -}, (table) => ({ - userFriendIdx: (0, pg_core_1.index)('idx_friendships_user_friend').on(table.userId, table.friendId), - userIdx: (0, pg_core_1.index)('idx_friendships_user').on(table.userId), - friendIdx: (0, pg_core_1.index)('idx_friendships_friend').on(table.friendId), - statusIdx: (0, pg_core_1.index)('idx_friendships_status').on(table.status), -})); -exports.userBlocks = (0, pg_core_1.pgTable)('user_blocks', { - id: (0, pg_core_1.serial)('id').primaryKey(), - userId: (0, pg_core_1.integer)('user_id').notNull(), - blockedUserId: (0, pg_core_1.integer)('blocked_user_id').notNull(), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), -}, (table) => ({ - uniqueBlockIdx: (0, pg_core_1.index)('idx_user_blocks_unique').on(table.userId, table.blockedUserId), - userIdx: (0, pg_core_1.index)('idx_user_blocks_user').on(table.userId), -})); -exports.pokes = (0, pg_core_1.pgTable)('pokes', { - id: (0, pg_core_1.serial)('id').primaryKey(), - fromUserId: (0, pg_core_1.integer)('from_user_id').notNull(), - toUserId: (0, pg_core_1.integer)('to_user_id').notNull(), - isRead: (0, pg_core_1.boolean)('is_read').default(false), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), -}, (table) => ({ - toUserIdx: (0, pg_core_1.index)('idx_pokes_to_user').on(table.toUserId), - fromUserIdx: (0, pg_core_1.index)('idx_pokes_from_user').on(table.fromUserId), -})); -// Video recommendations - share videos with friends -exports.videoRecommendations = (0, pg_core_1.pgTable)('video_recommendations', { - id: (0, pg_core_1.serial)('id').primaryKey(), - fromUserId: (0, pg_core_1.integer)('from_user_id').notNull(), - toUserId: (0, pg_core_1.integer)('to_user_id').notNull(), - mediaId: (0, pg_core_1.integer)('media_id').notNull(), - message: (0, pg_core_1.text)('message'), - isRead: (0, pg_core_1.boolean)('is_read').default(false), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), -}, (table) => ({ - toUserIdx: (0, pg_core_1.index)('idx_video_recommendations_to_user').on(table.toUserId), - fromUserIdx: (0, pg_core_1.index)('idx_video_recommendations_from_user').on(table.fromUserId), - mediaIdx: (0, pg_core_1.index)('idx_video_recommendations_media').on(table.mediaId), -})); -exports.userPresence = (0, pg_core_1.pgTable)('user_presence', { - id: (0, pg_core_1.serial)('id').primaryKey(), - userId: (0, pg_core_1.integer)('user_id').notNull().unique(), - isOnline: (0, pg_core_1.boolean)('is_online').default(false), - currentMediaId: (0, pg_core_1.integer)('current_media_id'), - lastActivityAt: (0, pg_core_1.timestamp)('last_activity_at', { withTimezone: true }), - lastVideoChangeAt: (0, pg_core_1.timestamp)('last_video_change_at', { withTimezone: true }), -}, (table) => ({ - onlineIdx: (0, pg_core_1.index)('idx_user_presence_online').on(table.isOnline), - userIdx: (0, pg_core_1.index)('idx_user_presence_user').on(table.userId), -})); -exports.userGalleryImages = (0, pg_core_1.pgTable)('user_gallery_images', { - id: (0, pg_core_1.serial)('id').primaryKey(), - userId: (0, pg_core_1.integer)('user_id').notNull(), - filename: (0, pg_core_1.text)('filename').notNull(), - originalFilename: (0, pg_core_1.text)('original_filename'), - position: (0, pg_core_1.integer)('position').notNull().default(0), - uploadedAt: (0, pg_core_1.timestamp)('uploaded_at', { withTimezone: true }).defaultNow(), -}, (table) => ({ - userIdx: (0, pg_core_1.index)('idx_user_gallery_user').on(table.userId), - positionIdx: (0, pg_core_1.index)('idx_user_gallery_position').on(table.userId, table.position), -})); -// Social link platforms -exports.SOCIAL_PLATFORMS = [ - 'twitter', 'instagram', 'onlyfans', 'fansly', 'reddit', - 'discord', 'tiktok', 'youtube', 'twitch', 'snapchat', - 'linktree', 'custom' -]; -exports.userSocialLinks = (0, pg_core_1.pgTable)('user_social_links', { - id: (0, pg_core_1.serial)('id').primaryKey(), - userId: (0, pg_core_1.integer)('user_id').notNull(), - platform: (0, pg_core_1.text)('platform').notNull(), // One of SOCIAL_PLATFORMS - url: (0, pg_core_1.text)('url').notNull(), - displayName: (0, pg_core_1.text)('display_name'), // Optional custom label - position: (0, pg_core_1.integer)('position').notNull().default(0), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), -}, (table) => ({ - userIdx: (0, pg_core_1.index)('idx_user_social_links_user').on(table.userId), - positionIdx: (0, pg_core_1.index)('idx_user_social_links_position').on(table.userId, table.position), -})); -// ============================================ -// Privacy Settings Tables -// ============================================ -exports.privacySettings = (0, pg_core_1.pgTable)('privacy_settings', { - id: (0, pg_core_1.serial)('id').primaryKey(), - userId: (0, pg_core_1.integer)('user_id').notNull().unique().references(() => exports.mediaUsers.id, { onDelete: 'cascade' }), - // Online Status - showOnlineStatus: (0, pg_core_1.boolean)('show_online_status').default(true), - showCurrentlyWatching: (0, pg_core_1.boolean)('show_currently_watching').default(true), - // Activity Visibility - showInFriendActivity: (0, pg_core_1.boolean)('show_in_friend_activity').default(true), - anonymizePublicComments: (0, pg_core_1.boolean)('anonymize_public_comments').default(false), - hidePublicReactions: (0, pg_core_1.boolean)('hide_public_reactions').default(false), - hidePublicFinishes: (0, pg_core_1.boolean)('hide_public_finishes').default(false), - // Friend Requests - allowFriendRequests: (0, pg_core_1.boolean)('allow_friend_requests').default(true), - // Close Friends restrictions - closeFriendsOnlyWatching: (0, pg_core_1.boolean)('close_friends_only_watching').default(false), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), - updatedAt: (0, pg_core_1.timestamp)('updated_at', { withTimezone: true }), -}, (table) => ({ - userIdx: (0, pg_core_1.index)('idx_privacy_settings_user').on(table.userId), -})); -exports.closeFriends = (0, pg_core_1.pgTable)('close_friends', { - id: (0, pg_core_1.serial)('id').primaryKey(), - userId: (0, pg_core_1.integer)('user_id').notNull().references(() => exports.mediaUsers.id, { onDelete: 'cascade' }), - closeFriendId: (0, pg_core_1.integer)('close_friend_id').notNull().references(() => exports.mediaUsers.id, { onDelete: 'cascade' }), - addedAt: (0, pg_core_1.timestamp)('added_at', { withTimezone: true }).defaultNow(), -}, (table) => ({ - uniqueIdx: (0, pg_core_1.uniqueIndex)('idx_close_friends_unique').on(table.userId, table.closeFriendId), - userIdx: (0, pg_core_1.index)('idx_close_friends_user').on(table.userId), -})); -// ============================================ -// User Uploads (Trusted User Feature) -// ============================================ -exports.USER_UPLOAD_STATUS = ['pending', 'approved', 'rejected']; -exports.userUploads = (0, pg_core_1.pgTable)('user_uploads', { - id: (0, pg_core_1.serial)('id').primaryKey(), - userId: (0, pg_core_1.integer)('user_id').notNull(), - filename: (0, pg_core_1.text)('filename').notNull(), - originalFilename: (0, pg_core_1.text)('original_filename'), - path: (0, pg_core_1.text)('path').notNull(), - durationSeconds: (0, pg_core_1.integer)('duration_seconds'), - quality: (0, pg_core_1.text)('quality'), - orientation: (0, pg_core_1.text)('orientation'), - fileSize: (0, pg_core_1.bigint)('file_size', { mode: 'number' }), - thumbnailPath: (0, pg_core_1.text)('thumbnail_path'), - status: (0, pg_core_1.text)('status').notNull().default('pending'), - reviewedBy: (0, pg_core_1.integer)('reviewed_by'), - reviewedAt: (0, pg_core_1.timestamp)('reviewed_at', { withTimezone: true }), - reviewNotes: (0, pg_core_1.text)('review_notes'), - publicMediaId: (0, pg_core_1.integer)('public_media_id'), - uploadInviteId: (0, pg_core_1.integer)('upload_invite_id'), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), -}, (table) => ({ - userIdx: (0, pg_core_1.index)('idx_user_uploads_user').on(table.userId), - statusIdx: (0, pg_core_1.index)('idx_user_uploads_status').on(table.status), - createdAtIdx: (0, pg_core_1.index)('idx_user_uploads_created').on(table.createdAt), - inviteIdx: (0, pg_core_1.index)('idx_user_uploads_invite').on(table.uploadInviteId), -})); -// ============================================ -// Upload Invites (Shareable Upload Links) -// ============================================ -exports.UPLOAD_INVITE_STATUS = ['active', 'inactive', 'expired']; -exports.uploadInvites = (0, pg_core_1.pgTable)('upload_invites', { - id: (0, pg_core_1.serial)('id').primaryKey(), - code: (0, pg_core_1.text)('code').notNull().unique(), - label: (0, pg_core_1.text)('label'), - createdBy: (0, pg_core_1.integer)('created_by').notNull(), - status: (0, pg_core_1.text)('status').notNull().default('active'), - maxUploads: (0, pg_core_1.integer)('max_uploads'), - uploadCount: (0, pg_core_1.integer)('upload_count').notNull().default(0), - expiresAt: (0, pg_core_1.timestamp)('expires_at', { withTimezone: true }), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), -}, (table) => ({ - codeIdx: (0, pg_core_1.index)('idx_upload_invites_code').on(table.code), - statusIdx: (0, pg_core_1.index)('idx_upload_invites_status').on(table.status), - createdByIdx: (0, pg_core_1.index)('idx_upload_invites_created_by').on(table.createdBy), -})); -// ============================================ -// Tag System Tables -// ============================================ -exports.tagCategories = (0, pg_core_1.pgTable)('tag_categories', { - id: (0, pg_core_1.serial)('id').primaryKey(), - name: (0, pg_core_1.text)('name').notNull().unique(), - displayOrder: (0, pg_core_1.integer)('display_order').notNull().default(0), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), -}, (table) => ({ - displayOrderIdx: (0, pg_core_1.index)('idx_tag_categories_display_order').on(table.displayOrder), -})); -exports.tags = (0, pg_core_1.pgTable)('tags', { - id: (0, pg_core_1.serial)('id').primaryKey(), - categoryId: (0, pg_core_1.integer)('category_id').notNull(), - name: (0, pg_core_1.text)('name').notNull(), - displayOrder: (0, pg_core_1.integer)('display_order').notNull().default(0), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), -}, (table) => ({ - categoryIdx: (0, pg_core_1.index)('idx_tags_category').on(table.categoryId), - displayOrderIdx: (0, pg_core_1.index)('idx_tags_display_order').on(table.displayOrder), - uniqueNamePerCategory: (0, pg_core_1.index)('idx_tags_unique_name').on(table.categoryId, table.name), -})); -exports.publicMediaTags = (0, pg_core_1.pgTable)('public_media_tags', { - id: (0, pg_core_1.serial)('id').primaryKey(), - mediaId: (0, pg_core_1.integer)('media_id').notNull(), - tagId: (0, pg_core_1.integer)('tag_id').notNull(), - addedAt: (0, pg_core_1.timestamp)('added_at', { withTimezone: true }).defaultNow(), -}, (table) => ({ - mediaIdx: (0, pg_core_1.index)('idx_public_media_tags_media').on(table.mediaId), - tagIdx: (0, pg_core_1.index)('idx_public_media_tags_tag').on(table.tagId), - uniqueIdx: (0, pg_core_1.index)('idx_public_media_tags_unique').on(table.mediaId, table.tagId), -})); -exports.userUploadSuggestedTags = (0, pg_core_1.pgTable)('user_upload_suggested_tags', { - id: (0, pg_core_1.serial)('id').primaryKey(), - uploadId: (0, pg_core_1.integer)('upload_id').notNull(), - tagId: (0, pg_core_1.integer)('tag_id').notNull(), - suggestedAt: (0, pg_core_1.timestamp)('suggested_at', { withTimezone: true }).defaultNow(), -}, (table) => ({ - uploadIdx: (0, pg_core_1.index)('idx_user_upload_suggested_tags_upload').on(table.uploadId), - tagIdx: (0, pg_core_1.index)('idx_user_upload_suggested_tags_tag').on(table.tagId), - uniqueIdx: (0, pg_core_1.index)('idx_user_upload_suggested_tags_unique').on(table.uploadId, table.tagId), -})); -exports.userTagPreferences = (0, pg_core_1.pgTable)('user_tag_preferences', { - id: (0, pg_core_1.serial)('id').primaryKey(), - userId: (0, pg_core_1.integer)('user_id').notNull(), - tagId: (0, pg_core_1.integer)('tag_id').notNull(), - savedAt: (0, pg_core_1.timestamp)('saved_at', { withTimezone: true }).defaultNow(), -}, (table) => ({ - userIdx: (0, pg_core_1.index)('idx_user_tag_preferences_user').on(table.userId), - tagIdx: (0, pg_core_1.index)('idx_user_tag_preferences_tag').on(table.tagId), - uniqueIdx: (0, pg_core_1.index)('idx_user_tag_preferences_unique').on(table.userId, table.tagId), -})); -// ============================================ -// Public Media Performers Junction -// ============================================ -/** - * Links public media items to performers for "Browse Actors" feature. - */ -exports.publicMediaPerformers = (0, pg_core_1.pgTable)('public_media_performers', { - id: (0, pg_core_1.serial)('id').primaryKey(), - mediaId: (0, pg_core_1.integer)('media_id').notNull(), - performerId: (0, pg_core_1.integer)('performer_id').notNull(), - addedAt: (0, pg_core_1.timestamp)('added_at', { withTimezone: true }).defaultNow(), -}, (table) => ({ - mediaIdx: (0, pg_core_1.index)('idx_public_media_performers_media').on(table.mediaId), - performerIdx: (0, pg_core_1.index)('idx_public_media_performers_performer').on(table.performerId), - uniqueIdx: (0, pg_core_1.uniqueIndex)('idx_public_media_performers_unique').on(table.mediaId, table.performerId), -})); -// ============================================ -// Video Digest Tables -// ============================================ -exports.DIGEST_STATUS = [ - 'pending', 'scene_detection', 'extracting', 'analyzing', - 'face_detection', 'transcribing', 'segmenting', 'synthesizing', - 'completed', 'failed', 'cancelled' -]; -exports.videoDigests = (0, pg_core_1.pgTable)('video_digests', { - id: (0, pg_core_1.serial)('id').primaryKey(), - videoId: (0, pg_core_1.integer)('video_id').notNull(), - jobId: (0, pg_core_1.integer)('job_id'), - status: (0, pg_core_1.text)('status').notNull().default('pending'), - progress: (0, pg_core_1.integer)('progress').default(0), - frameCount: (0, pg_core_1.integer)('frame_count'), - config: (0, pg_core_1.jsonb)('config').$type(), - frameAnalyses: (0, pg_core_1.jsonb)('frame_analyses').$type(), - transcript: (0, pg_core_1.jsonb)('transcript').$type(), - tags: (0, pg_core_1.jsonb)('tags').$type(), - suggestedClips: (0, pg_core_1.jsonb)('suggested_clips').$type(), - adCutSpec: (0, pg_core_1.jsonb)('ad_cut_spec').$type(), - // Per-frame stage results for observability (persisted during analysis) - stageResults: (0, pg_core_1.jsonb)('stage_results').$type(), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), - startedAt: (0, pg_core_1.timestamp)('started_at', { withTimezone: true }), - completedAt: (0, pg_core_1.timestamp)('completed_at', { withTimezone: true }), - error: (0, pg_core_1.text)('error'), -}, (table) => ({ - videoIdx: (0, pg_core_1.index)('idx_video_digests_video').on(table.videoId), - statusIdx: (0, pg_core_1.index)('idx_video_digests_status').on(table.status), - createdAtIdx: (0, pg_core_1.index)('idx_video_digests_created').on(table.createdAt), -})); -exports.digestVideoTags = (0, pg_core_1.pgTable)('digest_video_tags', { - id: (0, pg_core_1.serial)('id').primaryKey(), - digestId: (0, pg_core_1.integer)('digest_id').notNull(), - videoId: (0, pg_core_1.integer)('video_id').notNull(), - category: (0, pg_core_1.text)('category').notNull(), - value: (0, pg_core_1.text)('value').notNull(), - confidence: (0, pg_core_1.integer)('confidence'), - source: (0, pg_core_1.text)('source').default('digest'), - evidence: (0, pg_core_1.jsonb)('evidence').$type(), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), -}, (table) => ({ - digestIdx: (0, pg_core_1.index)('idx_digest_video_tags_digest').on(table.digestId), - videoIdx: (0, pg_core_1.index)('idx_digest_video_tags_video').on(table.videoId), - categoryIdx: (0, pg_core_1.index)('idx_digest_video_tags_category').on(table.category), - valueIdx: (0, pg_core_1.index)('idx_digest_video_tags_value').on(table.value), - categoryValueIdx: (0, pg_core_1.index)('idx_digest_video_tags_cat_val').on(table.category, table.value), -})); -// ============================================ -// Digest Clip Selection & Generation Tables -// ============================================ -exports.CLIP_TYPES = ['hook', 'intro', 'action', 'climax', 'highlight']; -exports.CLIP_STATUS = ['pending', 'processing', 'completed', 'failed']; -exports.CLIP_SOURCES = ['machine', 'manual']; -// Stage 1: Selected clips from digest analysis (metadata only, no extraction yet) -exports.digestSelectedClips = (0, pg_core_1.pgTable)('digest_selected_clips', { - id: (0, pg_core_1.serial)('id').primaryKey(), - digestId: (0, pg_core_1.integer)('digest_id').notNull(), - videoId: (0, pg_core_1.integer)('video_id').notNull(), - clipType: (0, pg_core_1.text)('clip_type').notNull(), - startTime: (0, pg_core_1.integer)('start_time').notNull(), // seconds - endTime: (0, pg_core_1.integer)('end_time').notNull(), - duration: (0, pg_core_1.integer)('duration').notNull(), - reason: (0, pg_core_1.text)('reason'), - interestScore: (0, pg_core_1.integer)('interest_score'), - position: (0, pg_core_1.text)('position'), // For action clips (e.g., 'doggy style') - transcriptHint: (0, pg_core_1.text)('transcript_hint'), // For climax clips (keyword that triggered selection) - tags: (0, pg_core_1.jsonb)('tags').$type(), - source: (0, pg_core_1.text)('source').notNull().default('machine'), - isIncluded: (0, pg_core_1.integer)('is_included').notNull().default(1), // 1 = included in generation, 0 = excluded - isHook: (0, pg_core_1.integer)('is_hook').notNull().default(0), // 1 = this clip is the cinematic hook (teaser at start) - sequenceOrder: (0, pg_core_1.integer)('sequence_order').notNull().default(0), // Order in final compilation (0-based) - hookSourceClipId: (0, pg_core_1.integer)('hook_source_clip_id'), // If set, this is a hook copy cloned from the referenced clip - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), -}, (table) => ({ - digestIdx: (0, pg_core_1.index)('idx_digest_selected_clips_digest').on(table.digestId), - videoIdx: (0, pg_core_1.index)('idx_digest_selected_clips_video').on(table.videoId), - clipTypeIdx: (0, pg_core_1.index)('idx_digest_selected_clips_type').on(table.clipType), - sourceIdx: (0, pg_core_1.index)('idx_digest_selected_clips_source').on(table.source), - sequenceOrderIdx: (0, pg_core_1.index)('idx_digest_selected_clips_sequence').on(table.sequenceOrder), - isHookIdx: (0, pg_core_1.index)('idx_digest_selected_clips_is_hook').on(table.isHook), - hookSourceIdx: (0, pg_core_1.index)('idx_digest_selected_clips_hook_source').on(table.hookSourceClipId), -})); -// Stage 2: Generated clips (after FFmpeg extraction) -exports.digestGeneratedClips = (0, pg_core_1.pgTable)('digest_generated_clips', { - id: (0, pg_core_1.serial)('id').primaryKey(), - selectedClipId: (0, pg_core_1.integer)('selected_clip_id').notNull(), - digestId: (0, pg_core_1.integer)('digest_id').notNull(), - folderId: (0, pg_core_1.integer)('folder_id'), // References digestOutputFolders.id - clipPath: (0, pg_core_1.text)('clip_path'), - gifPath: (0, pg_core_1.text)('gif_path'), // Only set if duration <= 60s - status: (0, pg_core_1.text)('status').notNull().default('pending'), - error: (0, pg_core_1.text)('error'), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), - completedAt: (0, pg_core_1.timestamp)('completed_at', { withTimezone: true }), - // Publishing tracking - publishedToPublicMediaId: (0, pg_core_1.integer)('published_to_public_media_id'), - publishedAt: (0, pg_core_1.timestamp)('published_at', { withTimezone: true }), -}, (table) => ({ - selectedClipIdx: (0, pg_core_1.index)('idx_digest_generated_clips_selected').on(table.selectedClipId), - digestIdx: (0, pg_core_1.index)('idx_digest_generated_clips_digest').on(table.digestId), - statusIdx: (0, pg_core_1.index)('idx_digest_generated_clips_status').on(table.status), - folderIdx: (0, pg_core_1.index)('idx_digest_generated_clips_folder').on(table.folderId), -})); -// Caption style type for digest compilations -exports.CAPTION_POSITIONS = ['bottom', 'top']; -exports.CAPTION_SIZES = ['small', 'medium', 'large']; -// Stage 2: Compilation videos -exports.digestCompilations = (0, pg_core_1.pgTable)('digest_compilations', { - id: (0, pg_core_1.serial)('id').primaryKey(), - digestId: (0, pg_core_1.integer)('digest_id').notNull(), - videoId: (0, pg_core_1.integer)('video_id').notNull(), - folderId: (0, pg_core_1.integer)('folder_id'), // References digestOutputFolders.id - filename: (0, pg_core_1.text)('filename').notNull(), - name: (0, pg_core_1.text)('name'), // Optional user-provided name for the compilation - path: (0, pg_core_1.text)('path').notNull(), - durationSeconds: (0, pg_core_1.integer)('duration_seconds'), - orientation: (0, pg_core_1.text)('orientation'), - status: (0, pg_core_1.text)('status').notNull().default('pending'), - error: (0, pg_core_1.text)('error'), - // Caption burning options - hasCaptions: (0, pg_core_1.integer)('has_captions').notNull().default(0), // 1 = captions burned in - captionStyle: (0, pg_core_1.jsonb)('caption_style').$type(), - // Closing ad frame options - closingAdPath: (0, pg_core_1.text)('closing_ad_path'), // Path to uploaded ad frame image - closingAdDuration: (0, pg_core_1.integer)('closing_ad_duration'), // Duration in seconds (3-10) - // Aggregated tags from constituent segments - tags: (0, pg_core_1.jsonb)('tags').$type(), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), - completedAt: (0, pg_core_1.timestamp)('completed_at', { withTimezone: true }), -}, (table) => ({ - digestIdx: (0, pg_core_1.index)('idx_digest_compilations_digest').on(table.digestId), - videoIdx: (0, pg_core_1.index)('idx_digest_compilations_video').on(table.videoId), - statusIdx: (0, pg_core_1.index)('idx_digest_compilations_status').on(table.status), - folderIdx: (0, pg_core_1.index)('idx_digest_compilations_folder').on(table.folderId), -})); -// ============================================ -// Digest Output Folders Table -// ============================================ -exports.digestOutputFolders = (0, pg_core_1.pgTable)('digest_output_folders', { - id: (0, pg_core_1.serial)('id').primaryKey(), - digestId: (0, pg_core_1.integer)('digest_id').notNull(), - videoId: (0, pg_core_1.integer)('video_id').notNull(), - folderPath: (0, pg_core_1.text)('folder_path').notNull(), - folderName: (0, pg_core_1.text)('folder_name').notNull(), - folderType: (0, pg_core_1.text)('folder_type').notNull().default('clips'), // 'clips' | 'scenes' | 'compilation' - clipCount: (0, pg_core_1.integer)('clip_count').default(0), - compilationCount: (0, pg_core_1.integer)('compilation_count').default(0), - totalSize: (0, pg_core_1.integer)('total_size'), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), -}, (table) => ({ - digestIdx: (0, pg_core_1.index)('idx_digest_output_folders_digest').on(table.digestId), - videoIdx: (0, pg_core_1.index)('idx_digest_output_folders_video').on(table.videoId), - folderPathIdx: (0, pg_core_1.index)('idx_digest_output_folders_path').on(table.folderPath), -})); -// ============================================ -// Digest Generated Scenes Table -// ============================================ -// Tracks individual scene files extracted from digests with derived tags -exports.digestGeneratedScenes = (0, pg_core_1.pgTable)('digest_generated_scenes', { - id: (0, pg_core_1.serial)('id').primaryKey(), - digestId: (0, pg_core_1.integer)('digest_id').notNull(), - videoId: (0, pg_core_1.integer)('video_id').notNull(), - folderId: (0, pg_core_1.integer)('folder_id'), // References digestOutputFolders.id - sceneNumber: (0, pg_core_1.integer)('scene_number').notNull(), - scenePath: (0, pg_core_1.text)('scene_path'), - startTime: (0, pg_core_1.real)('start_time').notNull(), - endTime: (0, pg_core_1.real)('end_time').notNull(), - duration: (0, pg_core_1.real)('duration').notNull(), - // Tags derived from videoTagTimeline for this time range - tags: (0, pg_core_1.jsonb)('tags').$type(), - dominantPosition: (0, pg_core_1.text)('dominant_position'), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), - // Publishing tracking - publishedToPublicMediaId: (0, pg_core_1.integer)('published_to_public_media_id'), - publishedAt: (0, pg_core_1.timestamp)('published_at', { withTimezone: true }), -}, (table) => ({ - digestIdx: (0, pg_core_1.index)('idx_digest_generated_scenes_digest').on(table.digestId), - videoIdx: (0, pg_core_1.index)('idx_digest_generated_scenes_video').on(table.videoId), - folderIdx: (0, pg_core_1.index)('idx_digest_generated_scenes_folder').on(table.folderId), - scenePathIdx: (0, pg_core_1.index)('idx_digest_generated_scenes_path').on(table.scenePath), -})); -// Caches detected scene cuts per video for clean clip transitions -// Extended for combined multi-detector scene detection -exports.videoSceneCuts = (0, pg_core_1.pgTable)('video_scene_cuts', { - id: (0, pg_core_1.serial)('id').primaryKey(), - videoId: (0, pg_core_1.integer)('video_id').notNull(), - // Array of cut timestamps in seconds (includes 0 and video end) - cuts: (0, pg_core_1.jsonb)('cuts').$type().notNull(), - // Number of scenes detected - sceneCount: (0, pg_core_1.integer)('scene_count').notNull(), - // Video duration at time of detection - duration: (0, pg_core_1.real)('duration').notNull(), - // Detection configuration - detector: (0, pg_core_1.text)('detector').notNull().default('content'), // 'content', 'adaptive', 'transnetv2', 'combined' - threshold: (0, pg_core_1.real)('threshold').notNull().default(27.0), - // ============================================ - // Combined Detection Fields (for multi-detector merging) - // ============================================ - // Individual detector results for debugging/analysis - transnetCuts: (0, pg_core_1.jsonb)('transnet_cuts').$type(), - pyscenedetectCuts: (0, pg_core_1.jsonb)('pyscenedetect_cuts').$type(), - clipCuts: (0, pg_core_1.jsonb)('clip_cuts').$type(), - // Detailed merged cuts with source attribution - mergedCutsDetailed: (0, pg_core_1.jsonb)('merged_cuts_detailed').$type(), - // Merge configuration - mergeStrategy: (0, pg_core_1.text)('merge_strategy').default('weighted'), // 'union' | 'intersection' | 'weighted' | 'majority' - toleranceSeconds: (0, pg_core_1.real)('tolerance_seconds').default(0.75), - // Which detectors were used (for cache validation) - detectorsUsed: (0, pg_core_1.jsonb)('detectors_used').$type(), - // Total processing time for combined detection - processingTimeMs: (0, pg_core_1.integer)('processing_time_ms'), - // Timestamps - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), -}, (table) => ({ - videoIdx: (0, pg_core_1.index)('idx_video_scene_cuts_video').on(table.videoId), -})); -// ============================================ -// Video Segmentation Tables (Multi-Method Analysis) -// ============================================ -// Segment types for multi-method clip detection -exports.SEGMENT_TYPES = ['scene', 'tag_change', 'vocal', 'fixed_interval']; -// Vocal moment categories for transcript-based segments -exports.VOCAL_CATEGORIES = ['dialogue', 'dirty_talk', 'climax', 'interview', 'moan']; -// Stores JoyTag results at regular intervals for change detection -exports.videoTagTimeline = (0, pg_core_1.pgTable)('video_tag_timeline', { - id: (0, pg_core_1.serial)('id').primaryKey(), - videoId: (0, pg_core_1.integer)('video_id').notNull(), - digestId: (0, pg_core_1.integer)('digest_id').notNull(), - timestamp: (0, pg_core_1.real)('timestamp').notNull(), // Seconds from video start - // JoyTag results at this timestamp - tags: (0, pg_core_1.jsonb)('tags').$type().notNull(), - // Derived/computed fields for efficient querying - dominantPosition: (0, pg_core_1.text)('dominant_position'), // Most confident sexual position tag - performerCount: (0, pg_core_1.integer)('performer_count'), - intensity: (0, pg_core_1.integer)('intensity'), // 0-10 score based on tag analysis - hasDialogue: (0, pg_core_1.boolean)('has_dialogue').default(false), - hasEyeContact: (0, pg_core_1.boolean)('has_eye_contact').default(false), - // Frame reference - framePath: (0, pg_core_1.text)('frame_path'), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), -}, (table) => ({ - videoIdx: (0, pg_core_1.index)('idx_video_tag_timeline_video').on(table.videoId), - digestIdx: (0, pg_core_1.index)('idx_video_tag_timeline_digest').on(table.digestId), - timestampIdx: (0, pg_core_1.index)('idx_video_tag_timeline_timestamp').on(table.videoId, table.timestamp), - positionIdx: (0, pg_core_1.index)('idx_video_tag_timeline_position').on(table.dominantPosition), -})); -// Stores detected segments by type (scene, tag_change, vocal, fixed_interval) -exports.videoSegments = (0, pg_core_1.pgTable)('video_segments', { - id: (0, pg_core_1.serial)('id').primaryKey(), - digestId: (0, pg_core_1.integer)('digest_id').notNull(), - videoId: (0, pg_core_1.integer)('video_id').notNull(), - segmentType: (0, pg_core_1.text)('segment_type').notNull().$type(), - startTime: (0, pg_core_1.real)('start_time').notNull(), // Seconds - endTime: (0, pg_core_1.real)('end_time').notNull(), // Seconds - duration: (0, pg_core_1.real)('duration').notNull(), // Seconds - // Segment metadata (varies by type) - tags: (0, pg_core_1.jsonb)('tags').$type(), - transcriptSnippet: (0, pg_core_1.text)('transcript_snippet'), - vocalCategory: (0, pg_core_1.text)('vocal_category').$type(), - positionChange: (0, pg_core_1.text)('position_change'), // "oral → doggystyle" - dominantPosition: (0, pg_core_1.text)('dominant_position'), - // Scoring for auto-sequence building - interestScore: (0, pg_core_1.real)('interest_score').default(0), - hasEyeContact: (0, pg_core_1.boolean)('has_eye_contact').default(false), - hasFullSentence: (0, pg_core_1.boolean)('has_full_sentence').default(false), - isClimaxMoment: (0, pg_core_1.boolean)('is_climax_moment').default(false), - // Caption/title generation - captioned: (0, pg_core_1.boolean)('captioned').default(false), - captionText: (0, pg_core_1.text)('caption_text'), - title: (0, pg_core_1.text)('title'), - // Frame reference for thumbnail - keyframePath: (0, pg_core_1.text)('keyframe_path'), - keyframeTimestamp: (0, pg_core_1.real)('keyframe_timestamp'), - // Inclusion in sequence (for Abstract) - isIncluded: (0, pg_core_1.boolean)('is_included').default(true), - sequenceOrder: (0, pg_core_1.integer)('sequence_order'), - isHook: (0, pg_core_1.boolean)('is_hook').default(false), - // Inclusion for clip generation (for Clips tab, independent from Abstract) - includeInClips: (0, pg_core_1.boolean)('include_in_clips').default(true), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), -}, (table) => ({ - digestIdx: (0, pg_core_1.index)('idx_video_segments_digest').on(table.digestId), - videoIdx: (0, pg_core_1.index)('idx_video_segments_video').on(table.videoId), - typeIdx: (0, pg_core_1.index)('idx_video_segments_type').on(table.segmentType), - timeIdx: (0, pg_core_1.index)('idx_video_segments_time').on(table.videoId, table.startTime), - includedIdx: (0, pg_core_1.index)('idx_video_segments_included').on(table.digestId, table.isIncluded), - sequenceIdx: (0, pg_core_1.index)('idx_video_segments_sequence').on(table.digestId, table.sequenceOrder), - clipsIdx: (0, pg_core_1.index)('idx_video_segments_clips').on(table.digestId, table.includeInClips), -})); -// ============================================ -// Video Tag Mapping Tables (Digest → Tag System) -// ============================================ -// Links videos to existing tags (from digest or manual) -exports.videoTags = (0, pg_core_1.pgTable)('video_tags', { - id: (0, pg_core_1.serial)('id').primaryKey(), - videoId: (0, pg_core_1.integer)('video_id').notNull(), - tagId: (0, pg_core_1.integer)('tag_id').notNull(), - confidence: (0, pg_core_1.integer)('confidence'), // 0-100, null for manual - source: (0, pg_core_1.text)('source').notNull().default('manual'), - digestId: (0, pg_core_1.integer)('digest_id'), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), -}, (table) => ({ - videoIdx: (0, pg_core_1.index)('idx_video_tags_video').on(table.videoId), - tagIdx: (0, pg_core_1.index)('idx_video_tags_tag').on(table.tagId), - sourceIdx: (0, pg_core_1.index)('idx_video_tags_source').on(table.source), - uniqueIdx: (0, pg_core_1.index)('idx_video_tags_unique').on(table.videoId, table.tagId), -})); -exports.SUGGESTED_TAG_STATUS = ['pending', 'approved', 'rejected', 'mapped']; -// Unmatched tags from digest that need admin review -exports.digestSuggestedTags = (0, pg_core_1.pgTable)('digest_suggested_tags', { - id: (0, pg_core_1.serial)('id').primaryKey(), - digestId: (0, pg_core_1.integer)('digest_id').notNull(), - videoId: (0, pg_core_1.integer)('video_id').notNull(), - suggestedCategory: (0, pg_core_1.text)('suggested_category').notNull(), - suggestedValue: (0, pg_core_1.text)('suggested_value').notNull(), - confidence: (0, pg_core_1.integer)('confidence'), // 0-100 - status: (0, pg_core_1.text)('status').notNull().default('pending'), - mappedTagId: (0, pg_core_1.integer)('mapped_tag_id'), - reviewedBy: (0, pg_core_1.integer)('reviewed_by'), - reviewedAt: (0, pg_core_1.timestamp)('reviewed_at', { withTimezone: true }), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), -}, (table) => ({ - digestIdx: (0, pg_core_1.index)('idx_digest_suggested_tags_digest').on(table.digestId), - videoIdx: (0, pg_core_1.index)('idx_digest_suggested_tags_video').on(table.videoId), - statusIdx: (0, pg_core_1.index)('idx_digest_suggested_tags_status').on(table.status), - categoryValueIdx: (0, pg_core_1.index)('idx_digest_suggested_tags_cat_val').on(table.suggestedCategory, table.suggestedValue), -})); -// Clip-level tag assignments (links clips to formal tags) -exports.digestClipTags = (0, pg_core_1.pgTable)('digest_clip_tags', { - id: (0, pg_core_1.serial)('id').primaryKey(), - clipId: (0, pg_core_1.integer)('clip_id').notNull(), - tagId: (0, pg_core_1.integer)('tag_id').notNull(), - source: (0, pg_core_1.text)('source').notNull().default('auto'), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), -}, (table) => ({ - clipIdx: (0, pg_core_1.index)('idx_digest_clip_tags_clip').on(table.clipId), - tagIdx: (0, pg_core_1.index)('idx_digest_clip_tags_tag').on(table.tagId), - uniqueIdx: (0, pg_core_1.index)('idx_digest_clip_tags_unique').on(table.clipId, table.tagId), -})); -// ============================================ -// Watch Party Tables -// ============================================ -exports.WATCH_PARTY_STATUS = ['waiting', 'active', 'paused', 'ended']; -exports.LOOP_MODE = ['none', 'video', 'queue']; -exports.watchPartySessions = (0, pg_core_1.pgTable)('watch_party_sessions', { - id: (0, pg_core_1.serial)('id').primaryKey(), - hostId: (0, pg_core_1.integer)('host_id').notNull().references(() => exports.mediaUsers.id, { onDelete: 'cascade' }), - mediaId: (0, pg_core_1.integer)('media_id').notNull().references(() => exports.publicMedia.id, { onDelete: 'cascade' }), - inviteCode: (0, pg_core_1.text)('invite_code').notNull().unique(), - status: (0, pg_core_1.text)('status').notNull().default('waiting'), - currentTime: (0, pg_core_1.integer)('current_time').default(0), // playback position in seconds - isPlaying: (0, pg_core_1.boolean)('is_playing').default(false), - maxParticipants: (0, pg_core_1.integer)('max_participants').default(20), - allowChat: (0, pg_core_1.boolean)('allow_chat').default(true), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), - startedAt: (0, pg_core_1.timestamp)('started_at', { withTimezone: true }), - endedAt: (0, pg_core_1.timestamp)('ended_at', { withTimezone: true }), - // Post-party summary stats (generated when party ends) - summaryStats: (0, pg_core_1.jsonb)('summary_stats').$type(), -}, (table) => ({ - hostIdx: (0, pg_core_1.index)('idx_watch_party_sessions_host').on(table.hostId), - inviteCodeIdx: (0, pg_core_1.index)('idx_watch_party_sessions_invite').on(table.inviteCode), - statusIdx: (0, pg_core_1.index)('idx_watch_party_sessions_status').on(table.status), - createdAtIdx: (0, pg_core_1.index)('idx_watch_party_sessions_created').on(table.createdAt), -})); -exports.watchPartyParticipants = (0, pg_core_1.pgTable)('watch_party_participants', { - id: (0, pg_core_1.serial)('id').primaryKey(), - partyId: (0, pg_core_1.integer)('party_id').notNull().references(() => exports.watchPartySessions.id, { onDelete: 'cascade' }), - userId: (0, pg_core_1.integer)('user_id').notNull().references(() => exports.mediaUsers.id, { onDelete: 'cascade' }), - isConnected: (0, pg_core_1.boolean)('is_connected').default(false), - isKicked: (0, pg_core_1.boolean)('is_kicked').default(false), - joinedAt: (0, pg_core_1.timestamp)('joined_at', { withTimezone: true }).defaultNow(), - leftAt: (0, pg_core_1.timestamp)('left_at', { withTimezone: true }), -}, (table) => ({ - partyIdx: (0, pg_core_1.index)('idx_watch_party_participants_party').on(table.partyId), - userIdx: (0, pg_core_1.index)('idx_watch_party_participants_user').on(table.userId), - uniqueIdx: (0, pg_core_1.index)('idx_watch_party_participants_unique').on(table.partyId, table.userId), -})); -exports.watchPartyChatMessages = (0, pg_core_1.pgTable)('watch_party_chat_messages', { - id: (0, pg_core_1.serial)('id').primaryKey(), - partyId: (0, pg_core_1.integer)('party_id').notNull().references(() => exports.watchPartySessions.id, { onDelete: 'cascade' }), - userId: (0, pg_core_1.integer)('user_id').notNull().references(() => exports.mediaUsers.id, { onDelete: 'cascade' }), - content: (0, pg_core_1.text)('content').notNull(), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), -}, (table) => ({ - partyIdx: (0, pg_core_1.index)('idx_watch_party_chat_party').on(table.partyId), - createdAtIdx: (0, pg_core_1.index)('idx_watch_party_chat_created').on(table.createdAt), -})); -// Watch Party Reactions (persisted for summary stats) -exports.watchPartyReactions = (0, pg_core_1.pgTable)('watch_party_reactions', { - id: (0, pg_core_1.serial)('id').primaryKey(), - partyId: (0, pg_core_1.integer)('party_id').notNull().references(() => exports.watchPartySessions.id, { onDelete: 'cascade' }), - userId: (0, pg_core_1.integer)('user_id').notNull().references(() => exports.mediaUsers.id, { onDelete: 'cascade' }), - reactionType: (0, pg_core_1.text)('reaction_type').notNull(), - videoTimestamp: (0, pg_core_1.integer)('video_timestamp'), // seconds into video when reaction was sent - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), -}, (table) => ({ - partyIdx: (0, pg_core_1.index)('idx_watch_party_reactions_party').on(table.partyId), - userIdx: (0, pg_core_1.index)('idx_watch_party_reactions_user').on(table.userId), -})); -// Watch Party Invites -exports.INVITE_STATUS = ['pending', 'accepted', 'declined', 'expired']; -exports.watchPartyInvites = (0, pg_core_1.pgTable)('watch_party_invites', { - id: (0, pg_core_1.serial)('id').primaryKey(), - partyId: (0, pg_core_1.integer)('party_id').notNull().references(() => exports.watchPartySessions.id, { onDelete: 'cascade' }), - fromUserId: (0, pg_core_1.integer)('from_user_id').notNull().references(() => exports.mediaUsers.id, { onDelete: 'cascade' }), - toUserId: (0, pg_core_1.integer)('to_user_id').notNull().references(() => exports.mediaUsers.id, { onDelete: 'cascade' }), - status: (0, pg_core_1.text)('status').notNull().default('pending').$type(), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), - respondedAt: (0, pg_core_1.timestamp)('responded_at', { withTimezone: true }), -}, (table) => ({ - partyIdx: (0, pg_core_1.index)('idx_watch_party_invites_party').on(table.partyId), - toUserIdx: (0, pg_core_1.index)('idx_watch_party_invites_to_user').on(table.toUserId), - fromUserIdx: (0, pg_core_1.index)('idx_watch_party_invites_from_user').on(table.fromUserId), - statusIdx: (0, pg_core_1.index)('idx_watch_party_invites_status').on(table.status), -})); -exports.tagGenerationJobs = (0, pg_core_1.pgTable)('tag_generation_jobs', { - id: (0, pg_core_1.serial)('id').primaryKey(), - status: (0, pg_core_1.text)('status').$type().default('pending').notNull(), - contentType: (0, pg_core_1.text)('content_type').$type().notNull(), - contentIds: (0, pg_core_1.jsonb)('content_ids').$type().notNull(), - options: (0, pg_core_1.jsonb)('options').$type(), - results: (0, pg_core_1.jsonb)('results').$type(), - progress: (0, pg_core_1.integer)('progress').default(0), - currentItem: (0, pg_core_1.integer)('current_item').default(0), - totalItems: (0, pg_core_1.integer)('total_items').default(0), - error: (0, pg_core_1.text)('error'), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), - completedAt: (0, pg_core_1.timestamp)('completed_at', { withTimezone: true }), -}, (table) => ({ - statusIdx: (0, pg_core_1.index)('idx_tag_gen_status').on(table.status), - contentTypeIdx: (0, pg_core_1.index)('idx_tag_gen_content_type').on(table.contentType), - createdAtIdx: (0, pg_core_1.index)('idx_tag_gen_created_at').on(table.createdAt), -})); -// ============================================================================ -// Performer Face Recognition -// ============================================================================ -/** - * Named performers that can be associated with multiple detected faces. - * Integrates with tag system for public gallery filtering. - */ -exports.creators = (0, pg_core_1.pgTable)('creators', { - id: (0, pg_core_1.serial)('id').primaryKey(), - name: (0, pg_core_1.text)('name').notNull().unique(), - slug: (0, pg_core_1.text)('slug').notNull().unique(), // URL-friendly name for public browsing - gender: (0, pg_core_1.integer)('gender'), // 0=female, 1=male, null=unknown - primaryFaceId: (0, pg_core_1.integer)('primary_face_id'), // Best face image for display thumbnail - faceCount: (0, pg_core_1.integer)('face_count').default(0), // Denormalized count of linked faces - videoCount: (0, pg_core_1.integer)('video_count').default(0), // Videos featuring this performer - tagId: (0, pg_core_1.integer)('tag_id'), // Link to performers tag category for filtering - isPublic: (0, pg_core_1.boolean)('is_public').default(false), // Visible in public Browse Actors - // Centroid embedding for efficient matching (512-D averaged, quality-filtered) - centroidEmbedding: (0, pg_core_1.jsonb)('centroid_embedding').$type(), - centroidUpdatedAt: (0, pg_core_1.timestamp)('centroid_updated_at', { withTimezone: true }), - centroidFaceCount: (0, pg_core_1.integer)('centroid_face_count').default(0), // Faces used in centroid computation - // Quality metrics for adaptive matching - embeddingVariance: (0, pg_core_1.real)('embedding_variance'), // How spread out the embeddings are - avgIntraClusterSimilarity: (0, pg_core_1.real)('avg_intra_cluster_similarity'), // Average similarity within performer's faces - avgAge: (0, pg_core_1.real)('avg_age'), // Average detected age of performer - ageStdDev: (0, pg_core_1.real)('age_std_dev'), // Standard deviation of detected ages - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), - updatedAt: (0, pg_core_1.timestamp)('updated_at', { withTimezone: true }).defaultNow(), -}, (table) => ({ - nameIdx: (0, pg_core_1.index)('idx_creators_name').on(table.name), - slugIdx: (0, pg_core_1.index)('idx_creators_slug').on(table.slug), - genderIdx: (0, pg_core_1.index)('idx_creators_gender').on(table.gender), - tagIdx: (0, pg_core_1.index)('idx_creators_tag').on(table.tagId), - publicIdx: (0, pg_core_1.index)('idx_creators_public').on(table.isPublic), -})); -// Face status for tracking review state -exports.FACE_STATUS = ['pending', 'assigned', 'ignored', 'skipped']; -/** - * Stores face embeddings for performer recognition. - * Each row represents a single detected face that can be linked to a performer. - */ -exports.performerFaces = (0, pg_core_1.pgTable)('performer_faces', { - id: (0, pg_core_1.serial)('id').primaryKey(), - // Performer identification - FK to performers table (null if unidentified) - performerId: (0, pg_core_1.integer)('performer_id'), // Links to creators.id - performerName: (0, pg_core_1.text)('performer_name'), // Legacy field, kept for migration - // 512-dimensional face embedding vector from ArcFace - // Stored as JSON array for compatibility (consider pgvector for production) - faceEmbedding: (0, pg_core_1.jsonb)('face_embedding').$type().notNull(), - // Face attributes from InsightFace - gender: (0, pg_core_1.integer)('gender'), // 0=female, 1=male - age: (0, pg_core_1.integer)('age'), - detectionScore: (0, pg_core_1.real)('detection_score'), // Confidence of face detection - // Bounding box in source frame [x1, y1, x2, y2] - bbox: (0, pg_core_1.jsonb)('bbox').$type(), - // Face crop image path - faceCropPath: (0, pg_core_1.text)('face_crop_path'), // Path to cropped face thumbnail - // Source information - sourceFrame: (0, pg_core_1.text)('source_frame'), // Path to frame this was extracted from - sourceVideo: (0, pg_core_1.text)('source_video'), // Path to source video - sourceDigestId: (0, pg_core_1.integer)('source_digest_id'), // Link to video digest - frameTimestamp: (0, pg_core_1.real)('frame_timestamp'), // Timestamp in video - frameIndex: (0, pg_core_1.integer)('frame_index'), // Index of frame in digest - // Face grouping metadata - facesInFrame: (0, pg_core_1.integer)('faces_in_frame').default(1), // How many faces were in this frame - status: (0, pg_core_1.text)('status').$type().default('pending'), // Review status - // Matching metadata - matchConfidence: (0, pg_core_1.real)('match_confidence'), // Confidence of performer match (if matched) - isVerified: (0, pg_core_1.boolean)('is_verified').default(false), // Human-verified match - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), - updatedAt: (0, pg_core_1.timestamp)('updated_at', { withTimezone: true }).defaultNow(), -}, (table) => ({ - performerIdIdx: (0, pg_core_1.index)('idx_performer_faces_performer').on(table.performerId), - performerNameIdx: (0, pg_core_1.index)('idx_performer_faces_name').on(table.performerName), - sourceVideoIdx: (0, pg_core_1.index)('idx_performer_faces_video').on(table.sourceVideo), - genderIdx: (0, pg_core_1.index)('idx_performer_faces_gender').on(table.gender), - digestIdx: (0, pg_core_1.index)('idx_performer_faces_digest').on(table.sourceDigestId), - cropPathIdx: (0, pg_core_1.index)('idx_performer_faces_crop').on(table.faceCropPath), - statusIdx: (0, pg_core_1.index)('idx_performer_faces_status').on(table.status), - facesInFrameIdx: (0, pg_core_1.index)('idx_performer_faces_faces_in_frame').on(table.facesInFrame), - detectionScoreIdx: (0, pg_core_1.index)('idx_performer_faces_det_score').on(table.detectionScore), -})); -// Discrepancy types for filename vs face detection mismatches -exports.DISCREPANCY_TYPES = [ - 'no_face_match', // Parsed name has no matching face - 'low_confidence', // Face match confidence below threshold - 'name_mismatch', // Filename says X but face matches Y - 'gender_mismatch', // Gender of face doesn't match expected - 'unknown_performer', // Parsed name not in performers database - 'extra_face', // Detected face not in parsed performers -]; -// Resolution status for discrepancies -exports.DISCREPANCY_STATUS = ['pending', 'confirmed', 'rejected', 'merged', 'ignored']; -// Resolution types -exports.DISCREPANCY_RESOLUTIONS = ['use_filename', 'use_face', 'create_alias', 'ignore', 'assign_face']; -/** - * Tracks mismatches between filename-parsed performers and face detection results. - * Used for admin review and resolution of performer identification issues. - */ -exports.performerDiscrepancies = (0, pg_core_1.pgTable)('performer_discrepancies', { - id: (0, pg_core_1.serial)('id').primaryKey(), - // Source info - videoId: (0, pg_core_1.integer)('video_id').references(() => exports.videos.id, { onDelete: 'cascade' }), - digestId: (0, pg_core_1.integer)('digest_id').references(() => exports.videoDigests.id, { onDelete: 'cascade' }), - // What filename parsing said - parsedPerformerName: (0, pg_core_1.text)('parsed_performer_name').notNull(), - parsedMethod: (0, pg_core_1.text)('parsed_method'), // 'llm', 'regex', 'manual' - parsedConfidence: (0, pg_core_1.real)('parsed_confidence'), - // What face detection found - detectedPerformerId: (0, pg_core_1.integer)('detected_performer_id').references(() => exports.creators.id, { onDelete: 'set null' }), - detectedPerformerName: (0, pg_core_1.text)('detected_performer_name'), - faceMatchConfidence: (0, pg_core_1.real)('face_match_confidence'), - faceSimilarity: (0, pg_core_1.real)('face_similarity'), - // Discrepancy details - discrepancyType: (0, pg_core_1.text)('discrepancy_type').$type().notNull(), - // Resolution - status: (0, pg_core_1.text)('status').$type().default('pending').notNull(), - resolvedBy: (0, pg_core_1.integer)('resolved_by').references(() => exports.mediaUsers.id, { onDelete: 'set null' }), - resolvedAt: (0, pg_core_1.timestamp)('resolved_at', { withTimezone: true }), - resolution: (0, pg_core_1.text)('resolution').$type(), - adminNotes: (0, pg_core_1.text)('admin_notes'), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow().notNull(), -}, (table) => ({ - videoIdx: (0, pg_core_1.index)('idx_discrepancies_video').on(table.videoId), - digestIdx: (0, pg_core_1.index)('idx_discrepancies_digest').on(table.digestId), - statusIdx: (0, pg_core_1.index)('idx_discrepancies_status').on(table.status), - typeIdx: (0, pg_core_1.index)('idx_discrepancies_type').on(table.discrepancyType), - detectedPerformerIdx: (0, pg_core_1.index)('idx_discrepancies_detected_performer').on(table.detectedPerformerId), -})); -// ============================================ -// Pipeline Management System -// ============================================ -// Pipeline status lifecycle -exports.PIPELINE_STATUS = ['pending', 'queued', 'running', 'paused', 'completed', 'failed', 'cancelled']; -// Pipeline step status -exports.PIPELINE_STEP_STATUS = ['pending', 'waiting_dependency', 'waiting_resource', 'running', 'completed', 'failed', 'skipped']; -// Pipeline definition - a multi-step workflow -exports.pipelines = (0, pg_core_1.pgTable)('pipelines', { - id: (0, pg_core_1.serial)('id').primaryKey(), - name: (0, pg_core_1.text)('name').notNull(), - description: (0, pg_core_1.text)('description'), - status: (0, pg_core_1.text)('status').notNull().default('pending').$type(), - priority: (0, pg_core_1.integer)('priority').default(5), - // Context for the entire pipeline (e.g., videoId, digestId) - context: (0, pg_core_1.jsonb)('context').$type(), - // Resource requirements aggregated from steps - totalVramRequired: (0, pg_core_1.integer)('total_vram_required').default(0), - estimatedDurationMs: (0, pg_core_1.integer)('estimated_duration_ms'), - // Progress tracking - progress: (0, pg_core_1.integer)('progress').default(0), - currentStepId: (0, pg_core_1.integer)('current_step_id'), - completedSteps: (0, pg_core_1.integer)('completed_steps').default(0), - totalSteps: (0, pg_core_1.integer)('total_steps').default(0), - // Error handling - error: (0, pg_core_1.text)('error'), - retryCount: (0, pg_core_1.integer)('retry_count').default(0), - maxRetries: (0, pg_core_1.integer)('max_retries').default(3), - // Timestamps - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), - queuedAt: (0, pg_core_1.timestamp)('queued_at', { withTimezone: true }), - startedAt: (0, pg_core_1.timestamp)('started_at', { withTimezone: true }), - completedAt: (0, pg_core_1.timestamp)('completed_at', { withTimezone: true }), - // Crash recovery - lastHeartbeat: (0, pg_core_1.timestamp)('last_heartbeat', { withTimezone: true }), - runningOnNode: (0, pg_core_1.text)('running_on_node'), // For future multi-node support -}, (table) => ({ - statusIdx: (0, pg_core_1.index)('idx_pipelines_status').on(table.status), - priorityIdx: (0, pg_core_1.index)('idx_pipelines_priority').on(table.priority, table.createdAt), - heartbeatIdx: (0, pg_core_1.index)('idx_pipelines_heartbeat').on(table.lastHeartbeat), -})); -// Individual steps within a pipeline -exports.pipelineSteps = (0, pg_core_1.pgTable)('pipeline_steps', { - id: (0, pg_core_1.serial)('id').primaryKey(), - pipelineId: (0, pg_core_1.integer)('pipeline_id').notNull().references(() => exports.pipelines.id, { onDelete: 'cascade' }), - // Step definition - name: (0, pg_core_1.text)('name').notNull(), - stepType: (0, pg_core_1.text)('step_type').notNull().$type(), - sequenceOrder: (0, pg_core_1.integer)('sequence_order').notNull(), - // Dependencies (array of step IDs that must complete first) - dependsOn: (0, pg_core_1.jsonb)('depends_on').$type().default([]), - // Resource requirements - resourceCategory: (0, pg_core_1.text)('resource_category').default('cpu').$type(), - vramRequired: (0, pg_core_1.integer)('vram_required').default(0), - requiredContainers: (0, pg_core_1.jsonb)('required_containers').$type().default([]), - // Step configuration - config: (0, pg_core_1.jsonb)('config').$type(), - // Execution state - status: (0, pg_core_1.text)('status').notNull().default('pending').$type(), - progress: (0, pg_core_1.integer)('progress').default(0), - result: (0, pg_core_1.jsonb)('result').$type(), - error: (0, pg_core_1.text)('error'), - // Timing - estimatedDurationMs: (0, pg_core_1.integer)('estimated_duration_ms'), - startedAt: (0, pg_core_1.timestamp)('started_at', { withTimezone: true }), - completedAt: (0, pg_core_1.timestamp)('completed_at', { withTimezone: true }), - durationMs: (0, pg_core_1.integer)('duration_ms'), -}, (table) => ({ - pipelineIdx: (0, pg_core_1.index)('idx_pipeline_steps_pipeline').on(table.pipelineId), - sequenceIdx: (0, pg_core_1.index)('idx_pipeline_steps_sequence').on(table.pipelineId, table.sequenceOrder), - statusIdx: (0, pg_core_1.index)('idx_pipeline_steps_status').on(table.status), -})); -// Step-level progress events for detailed observability -exports.pipelineStepEvents = (0, pg_core_1.pgTable)('pipeline_step_events', { - id: (0, pg_core_1.serial)('id').primaryKey(), - stepId: (0, pg_core_1.integer)('step_id').notNull().references(() => exports.pipelineSteps.id, { onDelete: 'cascade' }), - eventType: (0, pg_core_1.text)('event_type').notNull(), // 'stage_start', 'progress', 'prompt_call', 'stage_complete', 'log', 'error' - eventData: (0, pg_core_1.jsonb)('event_data').$type(), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), -}, (table) => ({ - stepIdx: (0, pg_core_1.index)('idx_pipeline_step_events_step').on(table.stepId), - createdAtIdx: (0, pg_core_1.index)('idx_pipeline_step_events_created').on(table.createdAt), -})); -// Real-time GPU/resource tracking snapshots -exports.resourceSnapshots = (0, pg_core_1.pgTable)('resource_snapshots', { - id: (0, pg_core_1.serial)('id').primaryKey(), - // GPU metrics (from nvidia-smi) - gpuIndex: (0, pg_core_1.integer)('gpu_index').default(0), - gpuName: (0, pg_core_1.text)('gpu_name'), - vramUsedMb: (0, pg_core_1.integer)('vram_used_mb'), - vramTotalMb: (0, pg_core_1.integer)('vram_total_mb'), - gpuUtilization: (0, pg_core_1.integer)('gpu_utilization'), // 0-100% - gpuTemperature: (0, pg_core_1.integer)('gpu_temperature'), // Celsius - // Active processes using GPU - activeProcesses: (0, pg_core_1.jsonb)('active_processes').$type(), - // Linked to pipeline/step if applicable - pipelineId: (0, pg_core_1.integer)('pipeline_id'), - stepId: (0, pg_core_1.integer)('step_id'), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), -}, (table) => ({ - createdAtIdx: (0, pg_core_1.index)('idx_resource_snapshots_created').on(table.createdAt), - pipelineIdx: (0, pg_core_1.index)('idx_resource_snapshots_pipeline').on(table.pipelineId), -})); -// Pipeline templates for common workflows -exports.pipelineTemplates = (0, pg_core_1.pgTable)('pipeline_templates', { - id: (0, pg_core_1.serial)('id').primaryKey(), - name: (0, pg_core_1.text)('name').notNull().unique(), - displayName: (0, pg_core_1.text)('display_name').notNull(), - description: (0, pg_core_1.text)('description'), - // Template definition - array of step configurations - steps: (0, pg_core_1.jsonb)('steps').$type().notNull(), - // Default context schema (for validation) - contextSchema: (0, pg_core_1.jsonb)('context_schema').$type(), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), - updatedAt: (0, pg_core_1.timestamp)('updated_at', { withTimezone: true }), -}, (table) => ({ - nameIdx: (0, pg_core_1.index)('idx_pipeline_templates_name').on(table.name), -})); -// Subscription Plans - Available subscription tiers -exports.subscriptionPlans = (0, pg_core_1.pgTable)('subscription_plans', { - id: (0, pg_core_1.serial)('id').primaryKey(), - name: (0, pg_core_1.text)('name').notNull().unique(), // 'monthly', 'quarterly', 'yearly', 'lifetime' - displayName: (0, pg_core_1.text)('display_name').notNull(), // 'Monthly Subscription' - description: (0, pg_core_1.text)('description'), - priceCAD: (0, pg_core_1.integer)('price_cad').notNull(), // Price in cents (e.g., 1000 = $10.00) - durationDays: (0, pg_core_1.integer)('duration_days'), // null for lifetime - isActive: (0, pg_core_1.boolean)('is_active').default(true), - sortOrder: (0, pg_core_1.integer)('sort_order').default(0), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), - updatedAt: (0, pg_core_1.timestamp)('updated_at', { withTimezone: true }), -}); -// User Subscriptions - Tracks individual user subscription status -exports.userSubscriptions = (0, pg_core_1.pgTable)('user_subscriptions', { - id: (0, pg_core_1.serial)('id').primaryKey(), - userId: (0, pg_core_1.integer)('user_id').notNull().references(() => exports.mediaUsers.id, { onDelete: 'cascade' }), - planId: (0, pg_core_1.integer)('plan_id').references(() => exports.subscriptionPlans.id), - status: (0, pg_core_1.text)('status').notNull().default('inactive').$type(), - startDate: (0, pg_core_1.timestamp)('start_date', { withTimezone: true }), - endDate: (0, pg_core_1.timestamp)('end_date', { withTimezone: true }), // null for lifetime - gracePeriodEndDate: (0, pg_core_1.timestamp)('grace_period_end_date', { withTimezone: true }), - lastPaymentId: (0, pg_core_1.integer)('last_payment_id'), - autoRenew: (0, pg_core_1.boolean)('auto_renew').default(true), - notes: (0, pg_core_1.text)('notes'), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), - updatedAt: (0, pg_core_1.timestamp)('updated_at', { withTimezone: true }), -}, (table) => ({ - userIdx: (0, pg_core_1.uniqueIndex)('idx_user_subscriptions_user').on(table.userId), - statusIdx: (0, pg_core_1.index)('idx_user_subscriptions_status').on(table.status), - endDateIdx: (0, pg_core_1.index)('idx_user_subscriptions_end_date').on(table.endDate), -})); -// Invoices - Generated invoices for users -exports.invoices = (0, pg_core_1.pgTable)('invoices', { - id: (0, pg_core_1.serial)('id').primaryKey(), - userId: (0, pg_core_1.integer)('user_id').notNull().references(() => exports.mediaUsers.id, { onDelete: 'cascade' }), - planId: (0, pg_core_1.integer)('plan_id').references(() => exports.subscriptionPlans.id), - invoiceNumber: (0, pg_core_1.text)('invoice_number').notNull().unique(), // INV-2026-00001 - amountCAD: (0, pg_core_1.integer)('amount_cad').notNull(), // Amount in cents - status: (0, pg_core_1.text)('status').notNull().default('pending').$type(), - dueDate: (0, pg_core_1.timestamp)('due_date', { withTimezone: true }).notNull(), - paidAt: (0, pg_core_1.timestamp)('paid_at', { withTimezone: true }), - paymentId: (0, pg_core_1.integer)('payment_id'), - description: (0, pg_core_1.text)('description'), - notes: (0, pg_core_1.text)('notes'), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), - updatedAt: (0, pg_core_1.timestamp)('updated_at', { withTimezone: true }), -}, (table) => ({ - userIdx: (0, pg_core_1.index)('idx_invoices_user').on(table.userId), - statusIdx: (0, pg_core_1.index)('idx_invoices_status').on(table.status), - dueDateIdx: (0, pg_core_1.index)('idx_invoices_due_date').on(table.dueDate), - invoiceNumberIdx: (0, pg_core_1.index)('idx_invoices_number').on(table.invoiceNumber), -})); -// Payments - Records of actual payments received (e-transfers) -exports.payments = (0, pg_core_1.pgTable)('payments', { - id: (0, pg_core_1.serial)('id').primaryKey(), - invoiceId: (0, pg_core_1.integer)('invoice_id').references(() => exports.invoices.id), - userId: (0, pg_core_1.integer)('user_id').references(() => exports.mediaUsers.id, { onDelete: 'set null' }), - // E-transfer details - senderEmail: (0, pg_core_1.text)('sender_email').notNull(), - senderName: (0, pg_core_1.text)('sender_name'), - amountCAD: (0, pg_core_1.integer)('amount_cad').notNull(), // Amount in cents - referenceNumber: (0, pg_core_1.text)('reference_number').unique(), // Interac reference - customMessage: (0, pg_core_1.text)('custom_message'), // Contains username hint - // Matching/processing status - status: (0, pg_core_1.text)('status').notNull().default('unmatched').$type(), - matchConfidence: (0, pg_core_1.real)('match_confidence'), // 0.0-1.0 confidence score - matchMethod: (0, pg_core_1.text)('match_method'), // 'email_exact', 'username_message', 'manual', 'llm' - // Raw email data for audit trail - rawEmailJson: (0, pg_core_1.jsonb)('raw_email_json').$type(), - receivedAt: (0, pg_core_1.timestamp)('received_at', { withTimezone: true }).notNull(), - processedAt: (0, pg_core_1.timestamp)('processed_at', { withTimezone: true }), - processedBy: (0, pg_core_1.integer)('processed_by'), // Admin who manually matched - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), - updatedAt: (0, pg_core_1.timestamp)('updated_at', { withTimezone: true }), -}, (table) => ({ - userIdx: (0, pg_core_1.index)('idx_payments_user').on(table.userId), - invoiceIdx: (0, pg_core_1.index)('idx_payments_invoice').on(table.invoiceId), - statusIdx: (0, pg_core_1.index)('idx_payments_status').on(table.status), - senderEmailIdx: (0, pg_core_1.index)('idx_payments_sender_email').on(table.senderEmail), - referenceIdx: (0, pg_core_1.index)('idx_payments_reference').on(table.referenceNumber), - receivedAtIdx: (0, pg_core_1.index)('idx_payments_received_at').on(table.receivedAt), -})); -// Payment Audit Log - Audit trail for all payment operations -exports.paymentAuditLog = (0, pg_core_1.pgTable)('payment_audit_log', { - id: (0, pg_core_1.serial)('id').primaryKey(), - paymentId: (0, pg_core_1.integer)('payment_id').references(() => exports.payments.id), - invoiceId: (0, pg_core_1.integer)('invoice_id').references(() => exports.invoices.id), - userId: (0, pg_core_1.integer)('user_id').references(() => exports.mediaUsers.id), - action: (0, pg_core_1.text)('action').notNull(), // 'created', 'matched', 'applied', 'refunded', 'manual_override', etc. - previousState: (0, pg_core_1.jsonb)('previous_state').$type(), - newState: (0, pg_core_1.jsonb)('new_state').$type(), - performedBy: (0, pg_core_1.integer)('performed_by'), // Admin user ID - notes: (0, pg_core_1.text)('notes'), - ipAddress: (0, pg_core_1.text)('ip_address'), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), -}, (table) => ({ - paymentIdx: (0, pg_core_1.index)('idx_payment_audit_payment').on(table.paymentId), - invoiceIdx: (0, pg_core_1.index)('idx_payment_audit_invoice').on(table.invoiceId), - userIdx: (0, pg_core_1.index)('idx_payment_audit_user').on(table.userId), - actionIdx: (0, pg_core_1.index)('idx_payment_audit_action').on(table.action), - createdAtIdx: (0, pg_core_1.index)('idx_payment_audit_created').on(table.createdAt), -})); -// ============================================ -// Notification System Tables -// ============================================ -// Notification types enum -exports.NOTIFICATION_TYPES = [ - 'friend_request', - 'friend_request_accepted', - 'poke', - 'video_recommendation', - 'watch_party_invite', - 'achievement_unlocked', - 'comment_reply', - 'digest_completed', - 'digest_failed', - 'upload_approved', - 'upload_rejected', - 'system', -]; -// Main notifications table -exports.notifications = (0, pg_core_1.pgTable)('notifications', { - id: (0, pg_core_1.serial)('id').primaryKey(), - userId: (0, pg_core_1.integer)('user_id').notNull().references(() => exports.mediaUsers.id, { onDelete: 'cascade' }), - type: (0, pg_core_1.text)('type').notNull().$type(), - title: (0, pg_core_1.text)('title').notNull(), - message: (0, pg_core_1.text)('message'), - referenceType: (0, pg_core_1.text)('reference_type'), // 'user', 'media', 'watch_party', 'digest', 'upload', etc. - referenceId: (0, pg_core_1.integer)('reference_id'), - actorId: (0, pg_core_1.integer)('actor_id').references(() => exports.mediaUsers.id, { onDelete: 'set null' }), - metadata: (0, pg_core_1.jsonb)('metadata').$type(), - isRead: (0, pg_core_1.boolean)('is_read').default(false), - actionUrl: (0, pg_core_1.text)('action_url'), - groupKey: (0, pg_core_1.text)('group_key'), // For aggregation (e.g., "poke_123" to group multiple pokes from same user) - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), - readAt: (0, pg_core_1.timestamp)('read_at', { withTimezone: true }), -}, (table) => ({ - userUnreadIdx: (0, pg_core_1.index)('idx_notifications_user_unread').on(table.userId, table.isRead), - userCreatedIdx: (0, pg_core_1.index)('idx_notifications_user_created').on(table.userId, table.createdAt), - typeIdx: (0, pg_core_1.index)('idx_notifications_type').on(table.type), - createdAtIdx: (0, pg_core_1.index)('idx_notifications_created').on(table.createdAt), - actorIdx: (0, pg_core_1.index)('idx_notifications_actor').on(table.actorId), -})); -// User notification preferences table -exports.notificationPreferences = (0, pg_core_1.pgTable)('notification_preferences', { - id: (0, pg_core_1.serial)('id').primaryKey(), - userId: (0, pg_core_1.integer)('user_id').notNull().unique().references(() => exports.mediaUsers.id, { onDelete: 'cascade' }), - // Email toggles per notification type - emailFriendRequest: (0, pg_core_1.boolean)('email_friend_request').default(true), - emailFriendRequestAccepted: (0, pg_core_1.boolean)('email_friend_request_accepted').default(true), - emailPoke: (0, pg_core_1.boolean)('email_poke').default(true), - emailVideoRecommendation: (0, pg_core_1.boolean)('email_video_recommendation').default(true), - emailWatchPartyInvite: (0, pg_core_1.boolean)('email_watch_party_invite').default(true), - emailAchievement: (0, pg_core_1.boolean)('email_achievement').default(false), - emailDigestComplete: (0, pg_core_1.boolean)('email_digest_complete').default(true), - emailDigestFailed: (0, pg_core_1.boolean)('email_digest_failed').default(true), - emailUploadApproved: (0, pg_core_1.boolean)('email_upload_approved').default(true), - emailUploadRejected: (0, pg_core_1.boolean)('email_upload_rejected').default(true), - // In-app toggles per notification type (default all on) - inAppFriendRequest: (0, pg_core_1.boolean)('inapp_friend_request').default(true), - inAppFriendRequestAccepted: (0, pg_core_1.boolean)('inapp_friend_request_accepted').default(true), - inAppPoke: (0, pg_core_1.boolean)('inapp_poke').default(true), - inAppVideoRecommendation: (0, pg_core_1.boolean)('inapp_video_recommendation').default(true), - inAppWatchPartyInvite: (0, pg_core_1.boolean)('inapp_watch_party_invite').default(true), - inAppAchievement: (0, pg_core_1.boolean)('inapp_achievement').default(true), - inAppDigestComplete: (0, pg_core_1.boolean)('inapp_digest_complete').default(true), - inAppDigestFailed: (0, pg_core_1.boolean)('inapp_digest_failed').default(true), - inAppUploadApproved: (0, pg_core_1.boolean)('inapp_upload_approved').default(true), - inAppUploadRejected: (0, pg_core_1.boolean)('inapp_upload_rejected').default(true), - inAppCommentReply: (0, pg_core_1.boolean)('inapp_comment_reply').default(true), - inAppSystem: (0, pg_core_1.boolean)('inapp_system').default(true), - // Quiet hours settings - quietHoursEnabled: (0, pg_core_1.boolean)('quiet_hours_enabled').default(false), - quietHoursStart: (0, pg_core_1.text)('quiet_hours_start'), // "22:00" (24-hour format) - quietHoursEnd: (0, pg_core_1.text)('quiet_hours_end'), // "08:00" - updatedAt: (0, pg_core_1.timestamp)('updated_at', { withTimezone: true }).defaultNow(), -}, (table) => ({ - userIdx: (0, pg_core_1.index)('idx_notification_preferences_user').on(table.userId), -})); -// ============================================ -// Geo-Blocking Tables -// ============================================ -exports.GEO_BLOCKING_MODES = ['disabled', 'blocklist', 'allowlist']; -exports.geoBlockingRules = (0, pg_core_1.pgTable)('geo_blocking_rules', { - id: (0, pg_core_1.serial)('id').primaryKey(), - country: (0, pg_core_1.text)('country').notNull(), // ISO Alpha-2 code (required) - countryName: (0, pg_core_1.text)('country_name'), // Display name - region: (0, pg_core_1.text)('region'), // Optional - state/province ISO code - city: (0, pg_core_1.text)('city'), // Optional - city name - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), - createdBy: (0, pg_core_1.integer)('created_by').references(() => exports.mediaUsers.id), - note: (0, pg_core_1.text)('note'), // Admin note explaining why blocked -}, (table) => ({ - countryIdx: (0, pg_core_1.index)('idx_geo_blocking_country').on(table.country), - uniqueRule: (0, pg_core_1.uniqueIndex)('idx_geo_blocking_unique').on(table.country, table.region, table.city), -})); -// ============================================ -// Inbox Publishing Tracking -// ============================================ -exports.INBOX_FILE_TYPES = ['clip', 'scene', 'video']; -exports.publishedInboxFiles = (0, pg_core_1.pgTable)('published_inbox_files', { - id: (0, pg_core_1.serial)('id').primaryKey(), - sourceInboxPath: (0, pg_core_1.text)('source_inbox_path').notNull(), // Original path in inbox - filename: (0, pg_core_1.text)('filename').notNull(), - publishedAt: (0, pg_core_1.timestamp)('published_at', { withTimezone: true }).defaultNow(), - publishedToPath: (0, pg_core_1.text)('published_to_path'), // Destination path in public directory - publicMediaId: (0, pg_core_1.integer)('public_media_id').references(() => exports.publicMedia.id, { onDelete: 'set null' }), - fileType: (0, pg_core_1.text)('file_type').$type().notNull(), -}, (table) => ({ - sourcePathIdx: (0, pg_core_1.index)('idx_published_inbox_source').on(table.sourceInboxPath), - fileTypeIdx: (0, pg_core_1.index)('idx_published_inbox_file_type').on(table.fileType), -})); -// ============================================ -// Video OCR Results Table -// ============================================ -exports.OCR_TEXT_TYPES = ['credits', 'title_card', 'overlay', 'unknown']; -exports.videoOcrResults = (0, pg_core_1.pgTable)('video_ocr_results', { - id: (0, pg_core_1.serial)('id').primaryKey(), - digestId: (0, pg_core_1.integer)('digest_id').notNull(), - videoId: (0, pg_core_1.integer)('video_id').notNull(), - frameIndex: (0, pg_core_1.integer)('frame_index').notNull(), - timestamp: (0, pg_core_1.real)('timestamp').notNull(), - extractedText: (0, pg_core_1.text)('extracted_text').notNull(), - confidence: (0, pg_core_1.real)('confidence'), - textType: (0, pg_core_1.text)('text_type').$type(), - sourceFrame: (0, pg_core_1.text)('source_frame').notNull(), - createdAt: (0, pg_core_1.timestamp)('created_at', { withTimezone: true }).defaultNow(), -}, (table) => ({ - digestIdx: (0, pg_core_1.index)('idx_video_ocr_results_digest').on(table.digestId), - videoIdx: (0, pg_core_1.index)('idx_video_ocr_results_video').on(table.videoId), -})); -//# sourceMappingURL=schema.js.map \ No newline at end of file diff --git a/api/dist/modules/media/db/schema.js.map b/api/dist/modules/media/db/schema.js.map deleted file mode 100644 index 8e7f3891..00000000 --- a/api/dist/modules/media/db/schema.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../src/modules/media/db/schema.ts"],"names":[],"mappings":";;;;;AAAA,iDAAkI;AAElI,uEAAuE;AAC1D,QAAA,eAAe,GAAG,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,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C,QAAA,cAAc,GAAG,CAAC,SAAS,EAAE,YAAY,EAAE,SAAS,EAAE,SAAS,CAAU,CAAC;AAG1E,QAAA,eAAe,GAAG,IAAA,iBAAO,EAAC,mBAAmB,EAAE;IAC1D,EAAE,EAAE,IAAA,gBAAM,EAAC,IAAI,CAAC,CAAC,UAAU,EAAE;IAC7B,QAAQ,EAAE,IAAA,iBAAO,EAAC,WAAW,CAAC,CAAC,OAAO,EAAE;IACxC,OAAO,EAAE,IAAA,iBAAO,EAAC,UAAU,CAAC,CAAC,OAAO,EAAE;IACtC,UAAU,EAAE,IAAA,iBAAO,EAAC,aAAa,CAAC,CAAC,OAAO,EAAE;IAC5C,SAAS,EAAE,IAAA,cAAI,EAAC,WAAW,CAAC,CAAC,OAAO,EAAE;IACtC,aAAa,EAAE,IAAA,cAAI,EAAC,gBAAgB,CAAC,CAAC,OAAO,EAAE;IAC/C,UAAU,EAAE,IAAA,cAAI,EAAC,YAAY,CAAC;IAC9B,QAAQ,EAAE,IAAA,cAAI,EAAC,WAAW,CAAC,CAAC,KAAK,EAAe;IAChD,WAAW,EAAE,IAAA,cAAI,EAAC,cAAc,CAAC,CAAC,OAAO,EAAE;IAC3C,SAAS,EAAE,IAAA,mBAAS,EAAC,YAAY,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,UAAU,EAAE;CACxE,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACb,SAAS,EAAE,IAAA,eAAK,EAAC,8BAA8B,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC;IACnE,QAAQ,EAAE,IAAA,eAAK,EAAC,6BAA6B,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC;CACjE,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/api/dist/modules/media/middleware/auth.d.ts b/api/dist/modules/media/middleware/auth.d.ts deleted file mode 100644 index 361f3f39..00000000 --- a/api/dist/modules/media/middleware/auth.d.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { FastifyRequest, FastifyReply } from 'fastify'; -import { UserRole } from '@prisma/client'; -declare module 'fastify' { - interface FastifyRequest { - user?: { - id: string; - email: string; - role: UserRole; - roles: UserRole[]; - }; - } -} -/** - * Authenticate user via V2 JWT access token - * Verifies token and checks user status in Prisma database - */ -export declare function authenticate(request: FastifyRequest, reply: FastifyReply): Promise; -/** - * Require admin role (SUPER_ADMIN, INFLUENCE_ADMIN, or MAP_ADMIN) - * Also checks auth, so no need to use authenticate() separately - */ -export declare function requireAdminRole(request: FastifyRequest, reply: FastifyReply): Promise; -/** - * Optional authentication - attach user if token present, but don't require it - * Used for public endpoints that want to know if user is logged in - */ -export declare function optionalAuth(request: FastifyRequest, _reply: FastifyReply): Promise; -//# sourceMappingURL=auth.d.ts.map \ No newline at end of file diff --git a/api/dist/modules/media/middleware/auth.d.ts.map b/api/dist/modules/media/middleware/auth.d.ts.map deleted file mode 100644 index 4e15085f..00000000 --- a/api/dist/modules/media/middleware/auth.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../../src/modules/media/middleware/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvD,OAAO,EAAE,QAAQ,EAAc,MAAM,gBAAgB,CAAC;AAMtD,OAAO,QAAQ,SAAS,CAAC;IACvB,UAAU,cAAc;QACtB,IAAI,CAAC,EAAE;YACL,EAAE,EAAE,MAAM,CAAC;YACX,KAAK,EAAE,MAAM,CAAC;YACd,IAAI,EAAE,QAAQ,CAAC;YACf,KAAK,EAAE,QAAQ,EAAE,CAAC;SACnB,CAAC;KACH;CACF;AASD;;;GAGG;AACH,wBAAsB,YAAY,CAChC,OAAO,EAAE,cAAc,EACvB,KAAK,EAAE,YAAY,GAClB,OAAO,CAAC,IAAI,CAAC,CAyEf;AAED;;;GAGG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,cAAc,EACvB,KAAK,EAAE,YAAY,GAClB,OAAO,CAAC,IAAI,CAAC,CAgBf;AAED;;;GAGG;AACH,wBAAsB,YAAY,CAChC,OAAO,EAAE,cAAc,EACvB,MAAM,EAAE,YAAY,GACnB,OAAO,CAAC,IAAI,CAAC,CA0Cf"} \ No newline at end of file diff --git a/api/dist/modules/media/middleware/auth.js b/api/dist/modules/media/middleware/auth.js deleted file mode 100644 index 0fbd5046..00000000 --- a/api/dist/modules/media/middleware/auth.js +++ /dev/null @@ -1,149 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.authenticate = authenticate; -exports.requireAdminRole = requireAdminRole; -exports.optionalAuth = optionalAuth; -const jsonwebtoken_1 = __importDefault(require("jsonwebtoken")); -const client_1 = require("@prisma/client"); -const database_1 = require("../../../config/database"); -const env_1 = require("../../../config/env"); -const roles_1 = require("../../../utils/roles"); -/** - * Authenticate user via V2 JWT access token - * Verifies token and checks user status in Prisma database - */ -async function authenticate(request, reply) { - const authHeader = request.headers.authorization; - const queryToken = request.query?.token; - // Support both Authorization header and ?token= query param (for /