bulltrackers-module 1.0.600 → 1.0.602

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.
@@ -13,19 +13,36 @@ const { isDeveloper } = require('../helpers/data-fetchers/firestore.js'); // Usi
13
13
 
14
14
  // List of public routes that don't require userCid
15
15
  // Also includes routes that use Firebase Auth token authentication (like /verification/lookup)
16
+ // And routes that return static/public data (like /alerts/types)
16
17
  const PUBLIC_ROUTES = [
17
18
  '/watchlists/public',
18
19
  '/popular-investors/trending',
19
20
  '/popular-investors/categories',
20
21
  '/popular-investors/master-list',
21
22
  '/popular-investors/search',
22
- '/verification/lookup' // Uses Firebase Auth token instead of userCid
23
+ '/verification/lookup', // Uses Firebase Auth token instead of userCid
24
+ '/alerts/types', // Static data - doesn't need userCid
25
+ '/alerts/dynamic-watchlist-computations', // Static data - doesn't need userCid
26
+ '/popular-investors/track-view' // Optional userCid - can track views anonymously
23
27
  ];
24
28
 
25
29
  const isPublicRoute = (path, originalUrl) => {
26
30
  // Check both the path and originalUrl to handle Express routing
27
31
  const fullPath = originalUrl || path;
28
- return PUBLIC_ROUTES.some(route => fullPath.includes(route));
32
+
33
+ // Check exact matches and pattern matches
34
+ for (const route of PUBLIC_ROUTES) {
35
+ // Exact match
36
+ if (fullPath === route || fullPath.includes(route)) {
37
+ return true;
38
+ }
39
+ // Pattern match for routes with parameters (e.g., /popular-investors/:piId/track-view)
40
+ if (route.includes('/track-view') && fullPath.includes('/track-view')) {
41
+ return true;
42
+ }
43
+ }
44
+
45
+ return false;
29
46
  };
30
47
 
31
48
  const resolveUserIdentity = async (req, res, next) => {
@@ -90,7 +90,7 @@ router.get('/types', async (req, res) => {
90
90
  router.get('/dynamic-watchlist-computations', async (req, res) => {
91
91
  try {
92
92
  // Import getAllAlertTypes from alert system
93
- const { getAllAlertTypes } = require('../../../../alert-system/helpers/alert_type_registry.js');
93
+ const { getAllAlertTypes } = require('../../alert-system/helpers/alert_type_registry.js');
94
94
  const alertTypes = getAllAlertTypes();
95
95
 
96
96
  // Extract unique computations from alert types
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bulltrackers-module",
3
- "version": "1.0.600",
3
+ "version": "1.0.602",
4
4
  "description": "Helper Functions for Bulltrackers.",
5
5
  "main": "index.js",
6
6
  "files": [