bulltrackers-module 1.0.682 → 1.0.684

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.
@@ -34,7 +34,7 @@ const PUBLIC_ROUTES = [
34
34
  '/popular-investors/search',
35
35
  '/popular-investors/profile', // Public PI profiles - userCid optional for personalization
36
36
  '/verification/lookup', // Uses Firebase Auth token instead of userCid
37
- '/alerts/types', // Static data - doesn't need userCid
37
+ // NOTE: /alerts/types REMOVED - now requires auth to check developer status for test alerts
38
38
  '/alerts/dynamic-watchlist-computations', // Static data - doesn't need userCid
39
39
  '/popular-investors/track-view', // Optional userCid - can track views anonymously
40
40
  '/reviews' // Public reviews - userCid optional (for showing current user's review)
@@ -189,25 +189,31 @@ router.get('/types', async (req, res, next) => {
189
189
  // GET /alerts/dynamic-watchlist-computations - Get available computations for dynamic watchlists
190
190
  router.get('/dynamic-watchlist-computations', async (req, res, next) => {
191
191
  try {
192
- // Import getAllAlertTypes from alert system
193
- const { getAllAlertTypes } = require('../../alert-system/helpers/alert_type_registry.js');
194
- const alertTypes = getAllAlertTypes();
192
+ const { logger } = req.dependencies;
195
193
 
196
- // Extract unique computations from alert types
197
- const computations = alertTypes.map(type => ({
198
- computationName: type.computationName,
199
- alertTypeName: type.name,
200
- description: type.description,
201
- severity: type.severity
202
- }));
194
+ // [UPDATED] Load alert types from manifest instead of hardcoded registry
195
+ const alertTypes = await loadAlertTypesFromManifest(logger);
203
196
 
204
- // Cache in browser/CDN for 1 hour (static data)
197
+ // Extract unique computations from alert types (exclude test alerts)
198
+ const computations = alertTypes
199
+ .filter(type => !type.isTest)
200
+ .map(type => ({
201
+ computationName: type.computationName,
202
+ alertTypeName: type.name,
203
+ description: type.description,
204
+ severity: type.severity,
205
+ configKey: type.configKey
206
+ }));
207
+
208
+ // Cache in browser/CDN for 1 hour (data changes infrequently)
205
209
  res.set('Cache-Control', 'public, max-age=3600');
206
210
  res.json({
207
211
  success: true,
208
- computations
212
+ computations,
213
+ count: computations.length
209
214
  });
210
215
  } catch (error) {
216
+ logger?.log('ERROR', `[GET /alerts/dynamic-watchlist-computations] Error: ${error.message}`);
211
217
  next(error);
212
218
  }
213
219
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bulltrackers-module",
3
- "version": "1.0.682",
3
+ "version": "1.0.684",
4
4
  "description": "Helper Functions for Bulltrackers.",
5
5
  "main": "index.js",
6
6
  "files": [