bulltrackers-module 1.0.591 → 1.0.593
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 +6 -6
- package/functions/alert-system/index.js +1 -1
- package/functions/api-v2/helpers/data-fetchers/firestore.js +2218 -0
- package/functions/api-v2/helpers/task_engine_helper.js +51 -0
- package/functions/api-v2/index.js +36 -0
- package/functions/api-v2/middleware/identity_middleware.js +48 -0
- package/functions/api-v2/package.json +6 -0
- package/functions/api-v2/routes/alerts.js +168 -0
- package/functions/api-v2/routes/index.js +35 -0
- package/functions/api-v2/routes/notifications.js +38 -0
- package/functions/api-v2/routes/popular_investors.js +204 -0
- package/functions/api-v2/routes/profile.js +212 -0
- package/functions/api-v2/routes/reviews.js +72 -0
- package/functions/api-v2/routes/settings.js +71 -0
- package/functions/api-v2/routes/sync.js +132 -0
- package/functions/api-v2/routes/verification.js +47 -0
- package/functions/api-v2/routes/watchlists.js +148 -0
- package/functions/computation-system/helpers/computation_worker.js +1 -1
- package/functions/task-engine/helpers/popular_investor_helpers.js +2 -2
- package/index.js +6 -2
- package/package.json +3 -2
- package/functions/generic-api/user-api/ADDING_LEGACY_ROUTES_GUIDE.md +0 -345
- package/functions/generic-api/user-api/CODE_REORGANIZATION_PLAN.md +0 -320
- package/functions/generic-api/user-api/COMPLETE_REFACTORING_PLAN.md +0 -116
- package/functions/generic-api/user-api/FIRESTORE_PATHS_INVENTORY.md +0 -171
- package/functions/generic-api/user-api/FIRESTORE_PATH_MIGRATION_REFERENCE.md +0 -710
- package/functions/generic-api/user-api/FIRESTORE_PATH_VALIDATION.md +0 -109
- package/functions/generic-api/user-api/MIGRATION_PLAN.md +0 -499
- package/functions/generic-api/user-api/README_MIGRATION.md +0 -152
- package/functions/generic-api/user-api/REFACTORING_COMPLETE.md +0 -106
- package/functions/generic-api/user-api/REFACTORING_STATUS.md +0 -85
- package/functions/generic-api/user-api/VERIFICATION_MIGRATION_NOTES.md +0 -206
- package/functions/generic-api/user-api/helpers/ORGANIZATION_COMPLETE.md +0 -126
- /package/functions/{generic-api → old-generic-api}/admin-api/index.js +0 -0
- /package/functions/{generic-api → old-generic-api}/helpers/api_helpers.js +0 -0
- /package/functions/{generic-api → old-generic-api}/index.js +0 -0
- /package/functions/{generic-api → old-generic-api}/user-api/helpers/alerts/alert_helpers.js +0 -0
- /package/functions/{generic-api → old-generic-api}/user-api/helpers/alerts/subscription_helpers.js +0 -0
- /package/functions/{generic-api → old-generic-api}/user-api/helpers/alerts/test_alert_helpers.js +0 -0
- /package/functions/{generic-api → old-generic-api}/user-api/helpers/collection_helpers.js +0 -0
- /package/functions/{generic-api → old-generic-api}/user-api/helpers/core/compression_helpers.js +0 -0
- /package/functions/{generic-api → old-generic-api}/user-api/helpers/core/data_lookup_helpers.js +0 -0
- /package/functions/{generic-api → old-generic-api}/user-api/helpers/core/path_resolution_helpers.js +0 -0
- /package/functions/{generic-api → old-generic-api}/user-api/helpers/core/user_status_helpers.js +0 -0
- /package/functions/{generic-api → old-generic-api}/user-api/helpers/data/computation_helpers.js +0 -0
- /package/functions/{generic-api → old-generic-api}/user-api/helpers/data/instrument_helpers.js +0 -0
- /package/functions/{generic-api → old-generic-api}/user-api/helpers/data/portfolio_helpers.js +0 -0
- /package/functions/{generic-api → old-generic-api}/user-api/helpers/data/social_helpers.js +0 -0
- /package/functions/{generic-api → old-generic-api}/user-api/helpers/data_helpers.js +0 -0
- /package/functions/{generic-api → old-generic-api}/user-api/helpers/dev/dev_helpers.js +0 -0
- /package/functions/{generic-api → old-generic-api}/user-api/helpers/fetch/on_demand_fetch_helpers.js +0 -0
- /package/functions/{generic-api → old-generic-api}/user-api/helpers/metrics/personalized_metrics_helpers.js +0 -0
- /package/functions/{generic-api → old-generic-api}/user-api/helpers/notifications/notification_helpers.js +0 -0
- /package/functions/{generic-api → old-generic-api}/user-api/helpers/profile/pi_profile_helpers.js +0 -0
- /package/functions/{generic-api → old-generic-api}/user-api/helpers/profile/profile_view_helpers.js +0 -0
- /package/functions/{generic-api → old-generic-api}/user-api/helpers/profile/user_profile_helpers.js +0 -0
- /package/functions/{generic-api → old-generic-api}/user-api/helpers/recommendations/recommendation_helpers.js +0 -0
- /package/functions/{generic-api → old-generic-api}/user-api/helpers/reviews/review_helpers.js +0 -0
- /package/functions/{generic-api → old-generic-api}/user-api/helpers/rootdata/rootdata_aggregation_helpers.js +0 -0
- /package/functions/{generic-api → old-generic-api}/user-api/helpers/search/pi_request_helpers.js +0 -0
- /package/functions/{generic-api → old-generic-api}/user-api/helpers/search/pi_search_helpers.js +0 -0
- /package/functions/{generic-api → old-generic-api}/user-api/helpers/sync/user_sync_helpers.js +0 -0
- /package/functions/{generic-api → old-generic-api}/user-api/helpers/verification/verification_helpers.js +0 -0
- /package/functions/{generic-api → old-generic-api}/user-api/helpers/watchlist/watchlist_analytics_helpers.js +0 -0
- /package/functions/{generic-api → old-generic-api}/user-api/helpers/watchlist/watchlist_data_helpers.js +0 -0
- /package/functions/{generic-api → old-generic-api}/user-api/helpers/watchlist/watchlist_generation_helpers.js +0 -0
- /package/functions/{generic-api → old-generic-api}/user-api/helpers/watchlist/watchlist_management_helpers.js +0 -0
- /package/functions/{generic-api → old-generic-api}/user-api/index.js +0 -0
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
const { FieldValue } = require('@google-cloud/firestore');
|
|
7
7
|
const zlib = require('zlib');
|
|
8
8
|
const { getAlertTypeByComputation, generateAlertMessage } = require('./alert_type_registry');
|
|
9
|
-
const { writeWithMigration } = require('../../generic-api/user-api/helpers/core/path_resolution_helpers');
|
|
9
|
+
const { writeWithMigration } = require('../../old-generic-api/user-api/helpers/core/path_resolution_helpers');
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Process alerts for a specific PI from computation results
|
|
@@ -97,7 +97,7 @@ async function processAlertForPI(db, logger, piCid, alertType, computationMetada
|
|
|
97
97
|
// 6. Update global rootdata collection for computation system
|
|
98
98
|
// (Wrap in try-catch to prevent crashing the alert if metrics fail)
|
|
99
99
|
try {
|
|
100
|
-
const { updateAlertHistoryRootData } = require('../../generic-api/user-api/helpers/rootdata/rootdata_aggregation_helpers');
|
|
100
|
+
const { updateAlertHistoryRootData } = require('../../old-generic-api/user-api/helpers/rootdata/rootdata_aggregation_helpers');
|
|
101
101
|
const triggeredUserCids = subscriptions.map(s => s.userCid);
|
|
102
102
|
await updateAlertHistoryRootData(db, logger, piCid, alertType, computationMetadata, computationDate, triggeredUserCids);
|
|
103
103
|
} catch (e) {
|
|
@@ -141,8 +141,8 @@ async function findSubscriptionsForPI(db, logger, piCid, alertTypeId, computatio
|
|
|
141
141
|
// Check for developer accounts with pretendSubscribedToAllAlerts flag enabled
|
|
142
142
|
// This allows developers to test the alert system without manually configuring subscriptions
|
|
143
143
|
try {
|
|
144
|
-
const { getDevOverride, isDeveloperAccount } = require('../../generic-api/user-api/helpers/dev/dev_helpers');
|
|
145
|
-
const { getPIMasterList } = require('../../generic-api/user-api/helpers/core/user_status_helpers');
|
|
144
|
+
const { getDevOverride, isDeveloperAccount } = require('../../old-generic-api/user-api/helpers/dev/dev_helpers');
|
|
145
|
+
const { getPIMasterList } = require('../../old-generic-api/user-api/helpers/core/user_status_helpers');
|
|
146
146
|
const config = dependencies.config || {};
|
|
147
147
|
const collectionRegistry = dependencies.collectionRegistry || null;
|
|
148
148
|
|
|
@@ -227,7 +227,7 @@ async function findSubscriptionsForPI(db, logger, piCid, alertTypeId, computatio
|
|
|
227
227
|
}
|
|
228
228
|
|
|
229
229
|
// Step 2: For each user, read their watchlists from SignedInUsers/{cid}/watchlists
|
|
230
|
-
const { readWithMigration } = require('../../generic-api/user-api/helpers/core/path_resolution_helpers');
|
|
230
|
+
const { readWithMigration } = require('../../old-generic-api/user-api/helpers/core/path_resolution_helpers');
|
|
231
231
|
// const { collectionRegistry } = dependencies; // Already destructured above
|
|
232
232
|
// const config = dependencies.config || {}; // Already defined
|
|
233
233
|
|
|
@@ -321,7 +321,7 @@ function shouldTriggerAlert(subscription, alertTypeId) {
|
|
|
321
321
|
async function getPIUsername(db, piCid) {
|
|
322
322
|
try {
|
|
323
323
|
// Try to get from master list first (single source of truth)
|
|
324
|
-
const { getPIUsernameFromMasterList } = require('../../generic-api/user-api/helpers/core/user_status_helpers');
|
|
324
|
+
const { getPIUsernameFromMasterList } = require('../../old-generic-api/user-api/helpers/core/user_status_helpers');
|
|
325
325
|
const username = await getPIUsernameFromMasterList(db, piCid, null, null);
|
|
326
326
|
|
|
327
327
|
if (username) return username;
|
|
@@ -417,7 +417,7 @@ async function sendAllClearNotification(db, logger, userCid, piCid, piUsername,
|
|
|
417
417
|
|
|
418
418
|
// Use writeWithMigration to write to new path (with legacy fallback)
|
|
419
419
|
// notifications is a subcollection, so we need isCollection: true and documentId
|
|
420
|
-
const { writeWithMigration } = require('../generic-api/user-api/helpers/core/path_resolution_helpers');
|
|
420
|
+
const { writeWithMigration } = require('../old-generic-api/user-api/helpers/core/path_resolution_helpers');
|
|
421
421
|
await writeWithMigration(
|
|
422
422
|
db,
|
|
423
423
|
'signedInUsers',
|