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.
Files changed (68) hide show
  1. package/functions/alert-system/helpers/alert_helpers.js +6 -6
  2. package/functions/alert-system/index.js +1 -1
  3. package/functions/api-v2/helpers/data-fetchers/firestore.js +2218 -0
  4. package/functions/api-v2/helpers/task_engine_helper.js +51 -0
  5. package/functions/api-v2/index.js +36 -0
  6. package/functions/api-v2/middleware/identity_middleware.js +48 -0
  7. package/functions/api-v2/package.json +6 -0
  8. package/functions/api-v2/routes/alerts.js +168 -0
  9. package/functions/api-v2/routes/index.js +35 -0
  10. package/functions/api-v2/routes/notifications.js +38 -0
  11. package/functions/api-v2/routes/popular_investors.js +204 -0
  12. package/functions/api-v2/routes/profile.js +212 -0
  13. package/functions/api-v2/routes/reviews.js +72 -0
  14. package/functions/api-v2/routes/settings.js +71 -0
  15. package/functions/api-v2/routes/sync.js +132 -0
  16. package/functions/api-v2/routes/verification.js +47 -0
  17. package/functions/api-v2/routes/watchlists.js +148 -0
  18. package/functions/computation-system/helpers/computation_worker.js +1 -1
  19. package/functions/task-engine/helpers/popular_investor_helpers.js +2 -2
  20. package/index.js +6 -2
  21. package/package.json +3 -2
  22. package/functions/generic-api/user-api/ADDING_LEGACY_ROUTES_GUIDE.md +0 -345
  23. package/functions/generic-api/user-api/CODE_REORGANIZATION_PLAN.md +0 -320
  24. package/functions/generic-api/user-api/COMPLETE_REFACTORING_PLAN.md +0 -116
  25. package/functions/generic-api/user-api/FIRESTORE_PATHS_INVENTORY.md +0 -171
  26. package/functions/generic-api/user-api/FIRESTORE_PATH_MIGRATION_REFERENCE.md +0 -710
  27. package/functions/generic-api/user-api/FIRESTORE_PATH_VALIDATION.md +0 -109
  28. package/functions/generic-api/user-api/MIGRATION_PLAN.md +0 -499
  29. package/functions/generic-api/user-api/README_MIGRATION.md +0 -152
  30. package/functions/generic-api/user-api/REFACTORING_COMPLETE.md +0 -106
  31. package/functions/generic-api/user-api/REFACTORING_STATUS.md +0 -85
  32. package/functions/generic-api/user-api/VERIFICATION_MIGRATION_NOTES.md +0 -206
  33. package/functions/generic-api/user-api/helpers/ORGANIZATION_COMPLETE.md +0 -126
  34. /package/functions/{generic-api → old-generic-api}/admin-api/index.js +0 -0
  35. /package/functions/{generic-api → old-generic-api}/helpers/api_helpers.js +0 -0
  36. /package/functions/{generic-api → old-generic-api}/index.js +0 -0
  37. /package/functions/{generic-api → old-generic-api}/user-api/helpers/alerts/alert_helpers.js +0 -0
  38. /package/functions/{generic-api → old-generic-api}/user-api/helpers/alerts/subscription_helpers.js +0 -0
  39. /package/functions/{generic-api → old-generic-api}/user-api/helpers/alerts/test_alert_helpers.js +0 -0
  40. /package/functions/{generic-api → old-generic-api}/user-api/helpers/collection_helpers.js +0 -0
  41. /package/functions/{generic-api → old-generic-api}/user-api/helpers/core/compression_helpers.js +0 -0
  42. /package/functions/{generic-api → old-generic-api}/user-api/helpers/core/data_lookup_helpers.js +0 -0
  43. /package/functions/{generic-api → old-generic-api}/user-api/helpers/core/path_resolution_helpers.js +0 -0
  44. /package/functions/{generic-api → old-generic-api}/user-api/helpers/core/user_status_helpers.js +0 -0
  45. /package/functions/{generic-api → old-generic-api}/user-api/helpers/data/computation_helpers.js +0 -0
  46. /package/functions/{generic-api → old-generic-api}/user-api/helpers/data/instrument_helpers.js +0 -0
  47. /package/functions/{generic-api → old-generic-api}/user-api/helpers/data/portfolio_helpers.js +0 -0
  48. /package/functions/{generic-api → old-generic-api}/user-api/helpers/data/social_helpers.js +0 -0
  49. /package/functions/{generic-api → old-generic-api}/user-api/helpers/data_helpers.js +0 -0
  50. /package/functions/{generic-api → old-generic-api}/user-api/helpers/dev/dev_helpers.js +0 -0
  51. /package/functions/{generic-api → old-generic-api}/user-api/helpers/fetch/on_demand_fetch_helpers.js +0 -0
  52. /package/functions/{generic-api → old-generic-api}/user-api/helpers/metrics/personalized_metrics_helpers.js +0 -0
  53. /package/functions/{generic-api → old-generic-api}/user-api/helpers/notifications/notification_helpers.js +0 -0
  54. /package/functions/{generic-api → old-generic-api}/user-api/helpers/profile/pi_profile_helpers.js +0 -0
  55. /package/functions/{generic-api → old-generic-api}/user-api/helpers/profile/profile_view_helpers.js +0 -0
  56. /package/functions/{generic-api → old-generic-api}/user-api/helpers/profile/user_profile_helpers.js +0 -0
  57. /package/functions/{generic-api → old-generic-api}/user-api/helpers/recommendations/recommendation_helpers.js +0 -0
  58. /package/functions/{generic-api → old-generic-api}/user-api/helpers/reviews/review_helpers.js +0 -0
  59. /package/functions/{generic-api → old-generic-api}/user-api/helpers/rootdata/rootdata_aggregation_helpers.js +0 -0
  60. /package/functions/{generic-api → old-generic-api}/user-api/helpers/search/pi_request_helpers.js +0 -0
  61. /package/functions/{generic-api → old-generic-api}/user-api/helpers/search/pi_search_helpers.js +0 -0
  62. /package/functions/{generic-api → old-generic-api}/user-api/helpers/sync/user_sync_helpers.js +0 -0
  63. /package/functions/{generic-api → old-generic-api}/user-api/helpers/verification/verification_helpers.js +0 -0
  64. /package/functions/{generic-api → old-generic-api}/user-api/helpers/watchlist/watchlist_analytics_helpers.js +0 -0
  65. /package/functions/{generic-api → old-generic-api}/user-api/helpers/watchlist/watchlist_data_helpers.js +0 -0
  66. /package/functions/{generic-api → old-generic-api}/user-api/helpers/watchlist/watchlist_generation_helpers.js +0 -0
  67. /package/functions/{generic-api → old-generic-api}/user-api/helpers/watchlist/watchlist_management_helpers.js +0 -0
  68. /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',