bulltrackers-module 1.0.629 → 1.0.631
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/functions/alert-system/helpers/alert_helpers.js +69 -77
- package/functions/alert-system/index.js +19 -29
- package/functions/api-v2/helpers/notification_helpers.js +187 -0
- package/functions/computation-system/helpers/computation_worker.js +1 -1
- package/functions/task-engine/helpers/popular_investor_helpers.js +11 -7
- package/index.js +0 -5
- package/package.json +1 -2
- package/functions/old-generic-api/admin-api/index.js +0 -895
- package/functions/old-generic-api/helpers/api_helpers.js +0 -457
- package/functions/old-generic-api/index.js +0 -204
- package/functions/old-generic-api/user-api/helpers/alerts/alert_helpers.js +0 -355
- package/functions/old-generic-api/user-api/helpers/alerts/subscription_helpers.js +0 -327
- package/functions/old-generic-api/user-api/helpers/alerts/test_alert_helpers.js +0 -212
- package/functions/old-generic-api/user-api/helpers/collection_helpers.js +0 -193
- package/functions/old-generic-api/user-api/helpers/core/compression_helpers.js +0 -68
- package/functions/old-generic-api/user-api/helpers/core/data_lookup_helpers.js +0 -256
- package/functions/old-generic-api/user-api/helpers/core/path_resolution_helpers.js +0 -640
- package/functions/old-generic-api/user-api/helpers/core/user_status_helpers.js +0 -195
- package/functions/old-generic-api/user-api/helpers/data/computation_helpers.js +0 -503
- package/functions/old-generic-api/user-api/helpers/data/instrument_helpers.js +0 -55
- package/functions/old-generic-api/user-api/helpers/data/portfolio_helpers.js +0 -245
- package/functions/old-generic-api/user-api/helpers/data/social_helpers.js +0 -174
- package/functions/old-generic-api/user-api/helpers/data_helpers.js +0 -87
- package/functions/old-generic-api/user-api/helpers/dev/dev_helpers.js +0 -336
- package/functions/old-generic-api/user-api/helpers/fetch/on_demand_fetch_helpers.js +0 -615
- package/functions/old-generic-api/user-api/helpers/metrics/personalized_metrics_helpers.js +0 -231
- package/functions/old-generic-api/user-api/helpers/notifications/notification_helpers.js +0 -641
- package/functions/old-generic-api/user-api/helpers/profile/pi_profile_helpers.js +0 -182
- package/functions/old-generic-api/user-api/helpers/profile/profile_view_helpers.js +0 -137
- package/functions/old-generic-api/user-api/helpers/profile/user_profile_helpers.js +0 -190
- package/functions/old-generic-api/user-api/helpers/recommendations/recommendation_helpers.js +0 -66
- package/functions/old-generic-api/user-api/helpers/reviews/review_helpers.js +0 -550
- package/functions/old-generic-api/user-api/helpers/rootdata/rootdata_aggregation_helpers.js +0 -378
- package/functions/old-generic-api/user-api/helpers/search/pi_request_helpers.js +0 -295
- package/functions/old-generic-api/user-api/helpers/search/pi_search_helpers.js +0 -162
- package/functions/old-generic-api/user-api/helpers/sync/user_sync_helpers.js +0 -677
- package/functions/old-generic-api/user-api/helpers/verification/verification_helpers.js +0 -323
- package/functions/old-generic-api/user-api/helpers/watchlist/watchlist_analytics_helpers.js +0 -96
- package/functions/old-generic-api/user-api/helpers/watchlist/watchlist_data_helpers.js +0 -141
- package/functions/old-generic-api/user-api/helpers/watchlist/watchlist_generation_helpers.js +0 -310
- package/functions/old-generic-api/user-api/helpers/watchlist/watchlist_management_helpers.js +0 -829
- package/functions/old-generic-api/user-api/index.js +0 -109
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @fileoverview User API Router.
|
|
3
|
-
* Handles Reviews, Watchlists, User Analytics, and Verification.
|
|
4
|
-
*/
|
|
5
|
-
const express = require('express');
|
|
6
|
-
const { submitReview, getReviews, getUserReview, checkReviewEligibility } = require('./helpers/reviews/review_helpers');
|
|
7
|
-
const { getPiAnalytics, getUserRecommendations, getWatchlist, updateWatchlist, autoGenerateWatchlist, getUserDataStatus, getUserPortfolio, getUserSocialPosts, getUserComputations, getUserVerification, getInstrumentMappings, searchPopularInvestors, requestPiAddition, getWatchlistTriggerCounts, checkPisInRankings, getPiProfile, checkIfUserIsPopularInvestor, trackProfileView, getSignedInUserPIPersonalizedMetrics } = require('./helpers/data_helpers');
|
|
8
|
-
const { initiateVerification, finalizeVerification } = require('./helpers/verification/verification_helpers');
|
|
9
|
-
const { getUserWatchlists, getWatchlist: getWatchlistById, createWatchlist, updateWatchlist: updateWatchlistById, deleteWatchlist, copyWatchlist, getPublicWatchlists, publishWatchlistVersion, getWatchlistVersions } = require('./helpers/watchlist/watchlist_management_helpers');
|
|
10
|
-
const { subscribeToAlerts, updateSubscription, unsubscribeFromAlerts, getUserSubscriptions, subscribeToWatchlist } = require('./helpers/alerts/subscription_helpers');
|
|
11
|
-
const { setDevOverride, getDevOverrideStatus } = require('./helpers/dev/dev_helpers');
|
|
12
|
-
const { getAlertTypes, getDynamicWatchlistComputations, getUserAlerts, getAlertCount, markAlertRead, markAllAlertsRead, deleteAlert } = require('./helpers/alerts/alert_helpers');
|
|
13
|
-
const { requestPiFetch, getPiFetchStatus } = require('./helpers/fetch/on_demand_fetch_helpers');
|
|
14
|
-
const { requestUserSync, getUserSyncStatus } = require('./helpers/sync/user_sync_helpers');
|
|
15
|
-
const { sendTestAlert } = require('./helpers/alerts/test_alert_helpers');
|
|
16
|
-
const { getNotificationPreferences, updateNotificationPreferences, getNotificationHistory } = require('./helpers/notifications/notification_helpers');
|
|
17
|
-
|
|
18
|
-
module.exports = (dependencies, config) => {
|
|
19
|
-
const router = express.Router();
|
|
20
|
-
|
|
21
|
-
// --- Identity & Verification ---
|
|
22
|
-
router.post('/verify/init', (req, res) => initiateVerification(req, res, dependencies, config));
|
|
23
|
-
router.post('/verify/finalize', (req, res) => finalizeVerification(req, res, dependencies, config));
|
|
24
|
-
|
|
25
|
-
// --- Reviews ---
|
|
26
|
-
router.post('/review', (req, res) => submitReview(req, res, dependencies, config));
|
|
27
|
-
router.get('/reviews/:piCid', (req, res) => getReviews(req, res, dependencies, config));
|
|
28
|
-
router.get('/me/review/:piCid', (req, res) => getUserReview(req, res, dependencies, config));
|
|
29
|
-
router.get('/me/review-eligibility/:piCid', (req, res) => checkReviewEligibility(req, res, dependencies, config));
|
|
30
|
-
|
|
31
|
-
// --- Data Serving ---
|
|
32
|
-
router.get('/pi/:cid/analytics', (req, res) => getPiAnalytics(req, res, dependencies, config));
|
|
33
|
-
router.get('/pi/:cid/profile', (req, res) => getPiProfile(req, res, dependencies, config));
|
|
34
|
-
router.post('/pi/:piCid/track-view', (req, res) => trackProfileView(req, res, dependencies, config));
|
|
35
|
-
|
|
36
|
-
// --- On-Demand PI Fetch ---
|
|
37
|
-
router.post('/pi/:piCid/request-fetch', (req, res) => requestPiFetch(req, res, dependencies, config));
|
|
38
|
-
router.get('/pi/:piCid/fetch-status', (req, res) => getPiFetchStatus(req, res, dependencies, config));
|
|
39
|
-
|
|
40
|
-
// --- User Sync (for profile pages) ---
|
|
41
|
-
router.post('/:userCid/sync', (req, res) => requestUserSync(req, res, dependencies, config));
|
|
42
|
-
router.get('/:userCid/sync-status', (req, res) => getUserSyncStatus(req, res, dependencies, config));
|
|
43
|
-
|
|
44
|
-
// Signed-In User Personalized Routes
|
|
45
|
-
// Note: Router is mounted at /user, so these routes should be /me/* not /user/me/*
|
|
46
|
-
router.get('/me/hedges', (req, res) => getUserRecommendations(req, res, dependencies, config, 'hedges'));
|
|
47
|
-
router.get('/me/similar', (req, res) => getUserRecommendations(req, res, dependencies, config, 'similar'));
|
|
48
|
-
router.get('/me/data-status', (req, res) => getUserDataStatus(req, res, dependencies, config));
|
|
49
|
-
router.get('/me/portfolio', (req, res) => getUserPortfolio(req, res, dependencies, config));
|
|
50
|
-
router.get('/me/social-posts', (req, res) => getUserSocialPosts(req, res, dependencies, config));
|
|
51
|
-
router.get('/me/computations', (req, res) => getUserComputations(req, res, dependencies, config));
|
|
52
|
-
router.get('/me/verification', (req, res) => getUserVerification(req, res, dependencies, config));
|
|
53
|
-
router.get('/me/instrument-mappings', (req, res) => getInstrumentMappings(req, res, dependencies, config));
|
|
54
|
-
router.get('/me/is-popular-investor', (req, res) => checkIfUserIsPopularInvestor(req, res, dependencies, config));
|
|
55
|
-
router.get('/me/pi-personalized-metrics', (req, res) => getSignedInUserPIPersonalizedMetrics(req, res, dependencies, config));
|
|
56
|
-
|
|
57
|
-
// --- Watchlist & Alerts ---
|
|
58
|
-
// Legacy single watchlist endpoints (for backward compatibility)
|
|
59
|
-
router.get('/me/watchlist', (req, res) => getWatchlist(req, res, dependencies, config));
|
|
60
|
-
router.post('/watchlist', (req, res) => updateWatchlist(req, res, dependencies, config));
|
|
61
|
-
router.post('/me/watchlist/auto-generate', (req, res) => autoGenerateWatchlist(req, res, dependencies, config));
|
|
62
|
-
|
|
63
|
-
// New multi-watchlist endpoints
|
|
64
|
-
router.get('/me/watchlists', (req, res) => getUserWatchlists(req, res, dependencies, config));
|
|
65
|
-
router.post('/me/watchlists', (req, res) => createWatchlist(req, res, dependencies, config));
|
|
66
|
-
router.get('/me/watchlists/:id', (req, res) => getWatchlistById(req, res, dependencies, config));
|
|
67
|
-
router.put('/me/watchlists/:id', (req, res) => updateWatchlistById(req, res, dependencies, config));
|
|
68
|
-
router.delete('/me/watchlists/:id', (req, res) => deleteWatchlist(req, res, dependencies, config));
|
|
69
|
-
router.post('/me/watchlists/:id/copy', (req, res) => copyWatchlist(req, res, dependencies, config));
|
|
70
|
-
router.post('/me/watchlists/:id/publish', (req, res) => publishWatchlistVersion(req, res, dependencies, config));
|
|
71
|
-
|
|
72
|
-
// Public watchlists
|
|
73
|
-
router.get('/public-watchlists', (req, res) => getPublicWatchlists(req, res, dependencies, config));
|
|
74
|
-
router.get('/public-watchlists/:id/versions', (req, res) => getWatchlistVersions(req, res, dependencies, config));
|
|
75
|
-
|
|
76
|
-
// --- Alert Subscriptions ---
|
|
77
|
-
router.post('/me/subscriptions', (req, res) => subscribeToAlerts(req, res, dependencies, config));
|
|
78
|
-
router.get('/me/subscriptions', (req, res) => getUserSubscriptions(req, res, dependencies, config));
|
|
79
|
-
router.put('/me/subscriptions/:piCid', (req, res) => updateSubscription(req, res, dependencies, config));
|
|
80
|
-
router.delete('/me/subscriptions/:piCid', (req, res) => unsubscribeFromAlerts(req, res, dependencies, config));
|
|
81
|
-
router.post('/me/watchlists/:id/subscribe-all', (req, res) => subscribeToWatchlist(req, res, dependencies, config));
|
|
82
|
-
|
|
83
|
-
// --- PI Search & Requests ---
|
|
84
|
-
router.get('/search/pis', (req, res) => searchPopularInvestors(req, res, dependencies, config));
|
|
85
|
-
router.post('/requests/pi-addition', (req, res) => requestPiAddition(req, res, dependencies, config));
|
|
86
|
-
router.get('/me/watchlists/:id/trigger-counts', (req, res) => getWatchlistTriggerCounts(req, res, dependencies, config));
|
|
87
|
-
router.get('/me/watchlists/:id/rankings-check', (req, res) => checkPisInRankings(req, res, dependencies, config));
|
|
88
|
-
|
|
89
|
-
// --- Developer Mode (only for whitelisted developer accounts) ---
|
|
90
|
-
router.post('/dev/override', (req, res) => setDevOverride(req, res, dependencies, config));
|
|
91
|
-
router.get('/dev/override', (req, res) => getDevOverrideStatus(req, res, dependencies, config));
|
|
92
|
-
router.post('/dev/test-alert', (req, res) => sendTestAlert(req, res, dependencies, config));
|
|
93
|
-
|
|
94
|
-
// --- Alert Management ---
|
|
95
|
-
router.get('/me/alert-types', (req, res) => getAlertTypes(req, res, dependencies, config));
|
|
96
|
-
router.get('/me/dynamic-watchlist-computations', (req, res) => getDynamicWatchlistComputations(req, res, dependencies, config));
|
|
97
|
-
router.get('/me/alerts', (req, res) => getUserAlerts(req, res, dependencies, config));
|
|
98
|
-
router.get('/me/alerts/count', (req, res) => getAlertCount(req, res, dependencies, config));
|
|
99
|
-
router.put('/me/alerts/:alertId/read', (req, res) => markAlertRead(req, res, dependencies, config));
|
|
100
|
-
router.put('/me/alerts/read-all', (req, res) => markAllAlertsRead(req, res, dependencies, config));
|
|
101
|
-
router.delete('/me/alerts/:alertId', (req, res) => deleteAlert(req, res, dependencies, config));
|
|
102
|
-
|
|
103
|
-
// --- Notification Preferences & History ---
|
|
104
|
-
router.get('/me/notification-preferences', (req, res) => getNotificationPreferences(req, res, dependencies, config));
|
|
105
|
-
router.put('/me/notification-preferences', (req, res) => updateNotificationPreferences(req, res, dependencies, config));
|
|
106
|
-
router.get('/me/notifications', (req, res) => getNotificationHistory(req, res, dependencies, config));
|
|
107
|
-
|
|
108
|
-
return router;
|
|
109
|
-
};
|