@symbo.ls/sdk 2.32.11 → 2.32.13

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 (50) hide show
  1. package/README.md +141 -0
  2. package/dist/cjs/config/environment.js +18 -7
  3. package/dist/cjs/index.js +38 -12
  4. package/dist/cjs/services/BaseService.js +46 -0
  5. package/dist/cjs/services/DnsService.js +6 -5
  6. package/dist/cjs/services/TrackingService.js +661 -0
  7. package/dist/cjs/services/index.js +5 -5
  8. package/dist/cjs/utils/changePreprocessor.js +8 -1
  9. package/dist/cjs/utils/services.js +27 -3
  10. package/dist/esm/config/environment.js +18 -7
  11. package/dist/esm/index.js +20747 -5912
  12. package/dist/esm/services/AdminService.js +64 -7
  13. package/dist/esm/services/AuthService.js +64 -7
  14. package/dist/esm/services/BaseService.js +64 -7
  15. package/dist/esm/services/BranchService.js +64 -7
  16. package/dist/esm/services/CollabService.js +72 -8
  17. package/dist/esm/services/DnsService.js +70 -12
  18. package/dist/esm/services/FileService.js +64 -7
  19. package/dist/esm/services/PaymentService.js +64 -7
  20. package/dist/esm/services/PlanService.js +64 -7
  21. package/dist/esm/services/ProjectService.js +72 -8
  22. package/dist/esm/services/PullRequestService.js +64 -7
  23. package/dist/esm/services/ScreenshotService.js +64 -7
  24. package/dist/esm/services/SubscriptionService.js +64 -7
  25. package/dist/esm/services/TrackingService.js +18321 -0
  26. package/dist/esm/services/index.js +20667 -5882
  27. package/dist/esm/utils/CollabClient.js +18 -7
  28. package/dist/esm/utils/changePreprocessor.js +8 -1
  29. package/dist/esm/utils/services.js +27 -3
  30. package/dist/node/config/environment.js +18 -7
  31. package/dist/node/index.js +42 -16
  32. package/dist/node/services/BaseService.js +46 -0
  33. package/dist/node/services/DnsService.js +6 -5
  34. package/dist/node/services/TrackingService.js +632 -0
  35. package/dist/node/services/index.js +5 -5
  36. package/dist/node/utils/changePreprocessor.js +8 -1
  37. package/dist/node/utils/services.js +27 -3
  38. package/package.json +8 -6
  39. package/src/config/environment.js +19 -11
  40. package/src/index.js +44 -14
  41. package/src/services/BaseService.js +43 -0
  42. package/src/services/DnsService.js +5 -5
  43. package/src/services/TrackingService.js +853 -0
  44. package/src/services/index.js +6 -5
  45. package/src/utils/changePreprocessor.js +25 -1
  46. package/src/utils/services.js +28 -4
  47. package/dist/cjs/services/CoreService.js +0 -2818
  48. package/dist/esm/services/CoreService.js +0 -3513
  49. package/dist/node/services/CoreService.js +0 -2789
  50. package/src/services/CoreService.js +0 -3208
@@ -12,7 +12,9 @@ var CONFIG = {
12
12
  // Feature toggles that apply across all environments by default
13
13
  features: {
14
14
  newUserOnboarding: true,
15
- betaFeatures: false
15
+ betaFeatures: false,
16
+ // Tracking is enabled by default unless overridden per environment
17
+ trackingEnabled: true
16
18
  }
17
19
  },
18
20
  // Environment-specific configurations
@@ -30,13 +32,17 @@ var CONFIG = {
30
32
  // For based api
31
33
  githubClientId: "Ov23liAFrsR0StbAO6PO",
32
34
  // For github api
33
- grafanaUrl: "https://faro-collector-prod-us-east-0.grafana.net/collect/aef64330db80bdfeaac084317bf72f99",
35
+ grafanaUrl: "",
34
36
  // For grafana tracing
35
- grafanaAppName: "Localhost Symbols",
37
+ grafanaAppName: "Symbols Localhost",
36
38
  // Environment-specific feature toggles (override common)
37
39
  features: {
38
- betaFeatures: true
40
+ // Disable tracking by default on localhost/dev machines
41
+ trackingEnabled: false,
39
42
  // Enable beta features in local dev
43
+ betaFeatures: true,
44
+ // Preserve common defaults explicitly for local
45
+ newUserOnboarding: true
40
46
  },
41
47
  typesenseCollectionName: "docs",
42
48
  typesenseApiKey: "vZya3L2zpq8L6iI5WWMUZJZABvT63VDb",
@@ -64,7 +70,7 @@ var CONFIG = {
64
70
  basedProject: "platform-v2-sm",
65
71
  basedOrg: "symbols",
66
72
  githubClientId: "Ov23liHxyWFBxS8f1gnF",
67
- grafanaUrl: "https://faro-collector-prod-us-east-0.grafana.net/collect/7a3ba473cee2025c68513667024316b8",
73
+ grafanaUrl: "",
68
74
  // For grafana tracing
69
75
  grafanaAppName: "Symbols Test",
70
76
  typesenseCollectionName: "docs",
@@ -77,7 +83,7 @@ var CONFIG = {
77
83
  socketUrl: "https://upcoming.api.symbols.app",
78
84
  apiUrl: "https://upcoming.api.symbols.app",
79
85
  githubClientId: "Ov23liWF7NvdZ056RV5J",
80
- grafanaUrl: "https://faro-collector-prod-us-east-0.grafana.net/collect/7a3ba473cee2025c68513667024316b8",
86
+ grafanaUrl: "",
81
87
  // For grafana tracing
82
88
  grafanaAppName: "Symbols Upcoming",
83
89
  typesenseCollectionName: "docs",
@@ -93,7 +99,7 @@ var CONFIG = {
93
99
  basedProject: "platform-v2-sm",
94
100
  basedOrg: "symbols",
95
101
  githubClientId: "Ov23ligwZDQVD0VfuWNa",
96
- grafanaUrl: "https://faro-collector-prod-us-east-0.grafana.net/collect/7a3ba473cee2025c68513667024316b8",
102
+ grafanaUrl: "",
97
103
  // For grafana tracing
98
104
  grafanaAppName: "Symbols Staging",
99
105
  typesenseCollectionName: "docs",
@@ -132,6 +138,11 @@ var getConfig = () => {
132
138
  const envConfig = { ...CONFIG.common, ...CONFIG[env] };
133
139
  const finalConfig = {
134
140
  ...envConfig,
141
+ // Deep-merge feature flags so env-specific overrides don't drop common defaults
142
+ features: {
143
+ ...CONFIG.common.features || {},
144
+ ...CONFIG[env] && CONFIG[env].features || {}
145
+ },
135
146
  socketUrl: process.env.SYMBOLS_APP_SOCKET_URL || envConfig.socketUrl,
136
147
  apiUrl: process.env.SYMBOLS_APP_API_URL || envConfig.apiUrl,
137
148
  basedEnv: process.env.SYMBOLS_APP_BASED_ENV || envConfig.basedEnv,
@@ -637,6 +648,39 @@ var BaseService = class {
637
648
  this._ready = false;
638
649
  this._error = error;
639
650
  }
651
+ _getTrackingService() {
652
+ var _a;
653
+ const services = (_a = this._context) == null ? void 0 : _a.services;
654
+ const tracking = services == null ? void 0 : services.tracking;
655
+ if (!tracking || typeof tracking.trackError !== "function") {
656
+ return null;
657
+ }
658
+ return tracking;
659
+ }
660
+ _shouldTrackErrors() {
661
+ var _a;
662
+ const name = (_a = this == null ? void 0 : this.constructor) == null ? void 0 : _a.name;
663
+ return name !== "TrackingService";
664
+ }
665
+ _trackServiceError(error, details = {}) {
666
+ var _a;
667
+ if (!this._shouldTrackErrors()) {
668
+ return;
669
+ }
670
+ try {
671
+ const tracking = this._getTrackingService();
672
+ if (!tracking) {
673
+ return;
674
+ }
675
+ const context = {
676
+ service: ((_a = this == null ? void 0 : this.constructor) == null ? void 0 : _a.name) || "UnknownService",
677
+ apiUrl: this._apiUrl || null,
678
+ ...details
679
+ };
680
+ tracking.trackError(error instanceof Error ? error : new Error(String(error)), context);
681
+ } catch {
682
+ }
683
+ }
640
684
  _requireAuth() {
641
685
  if (!this._context.authToken) {
642
686
  throw new Error("Authentication required");
@@ -686,10 +730,23 @@ var BaseService = class {
686
730
  error = await response.json();
687
731
  } catch {
688
732
  }
733
+ this._trackServiceError(
734
+ new Error(error.message || error.error || `HTTP ${response.status}: ${response.statusText}`),
735
+ {
736
+ endpoint,
737
+ methodName: options.methodName,
738
+ status: response.status,
739
+ statusText: response.statusText
740
+ }
741
+ );
689
742
  throw new Error(error.message || error.error || "Request failed", { cause: error });
690
743
  }
691
744
  return response.status === 204 ? null : response.json();
692
745
  } catch (error) {
746
+ this._trackServiceError(error, {
747
+ endpoint,
748
+ methodName: options.methodName
749
+ });
693
750
  throw new Error(`Request failed: ${error.message}`, { cause: error });
694
751
  }
695
752
  }
@@ -1077,7 +1134,14 @@ function preprocessChanges(root, tuples = [], options = {}) {
1077
1134
  if (!canConsiderExpansion || isFilesPath || value && value.type === "files") {
1078
1135
  return [t];
1079
1136
  }
1080
- const prev = getByPathSafe(root, path) || {};
1137
+ const prevRaw = getByPathSafe(root, path);
1138
+ const isCreatePath = Array.isArray(path) && action === "update" && // e.g. ['update', ['components', 'NewKey'], {...}]
1139
+ (!isSchemaPath && path.length === 2 || // e.g. ['update', ['schema', 'components', 'NewKey'], {...}]
1140
+ isSchemaPath && path.length === 3) && (prevRaw === null || typeof prevRaw === "undefined");
1141
+ if (isCreatePath) {
1142
+ return [t];
1143
+ }
1144
+ const prev = prevRaw || {};
1081
1145
  const next = value || {};
1082
1146
  if (!isPlainObject2(prev) || !isPlainObject2(next)) {
1083
1147
  return [t];
@@ -12,7 +12,9 @@ var CONFIG = {
12
12
  // Feature toggles that apply across all environments by default
13
13
  features: {
14
14
  newUserOnboarding: true,
15
- betaFeatures: false
15
+ betaFeatures: false,
16
+ // Tracking is enabled by default unless overridden per environment
17
+ trackingEnabled: true
16
18
  }
17
19
  },
18
20
  // Environment-specific configurations
@@ -30,13 +32,17 @@ var CONFIG = {
30
32
  // For based api
31
33
  githubClientId: "Ov23liAFrsR0StbAO6PO",
32
34
  // For github api
33
- grafanaUrl: "https://faro-collector-prod-us-east-0.grafana.net/collect/aef64330db80bdfeaac084317bf72f99",
35
+ grafanaUrl: "",
34
36
  // For grafana tracing
35
- grafanaAppName: "Localhost Symbols",
37
+ grafanaAppName: "Symbols Localhost",
36
38
  // Environment-specific feature toggles (override common)
37
39
  features: {
38
- betaFeatures: true
40
+ // Disable tracking by default on localhost/dev machines
41
+ trackingEnabled: false,
39
42
  // Enable beta features in local dev
43
+ betaFeatures: true,
44
+ // Preserve common defaults explicitly for local
45
+ newUserOnboarding: true
40
46
  },
41
47
  typesenseCollectionName: "docs",
42
48
  typesenseApiKey: "vZya3L2zpq8L6iI5WWMUZJZABvT63VDb",
@@ -64,7 +70,7 @@ var CONFIG = {
64
70
  basedProject: "platform-v2-sm",
65
71
  basedOrg: "symbols",
66
72
  githubClientId: "Ov23liHxyWFBxS8f1gnF",
67
- grafanaUrl: "https://faro-collector-prod-us-east-0.grafana.net/collect/7a3ba473cee2025c68513667024316b8",
73
+ grafanaUrl: "",
68
74
  // For grafana tracing
69
75
  grafanaAppName: "Symbols Test",
70
76
  typesenseCollectionName: "docs",
@@ -77,7 +83,7 @@ var CONFIG = {
77
83
  socketUrl: "https://upcoming.api.symbols.app",
78
84
  apiUrl: "https://upcoming.api.symbols.app",
79
85
  githubClientId: "Ov23liWF7NvdZ056RV5J",
80
- grafanaUrl: "https://faro-collector-prod-us-east-0.grafana.net/collect/7a3ba473cee2025c68513667024316b8",
86
+ grafanaUrl: "",
81
87
  // For grafana tracing
82
88
  grafanaAppName: "Symbols Upcoming",
83
89
  typesenseCollectionName: "docs",
@@ -93,7 +99,7 @@ var CONFIG = {
93
99
  basedProject: "platform-v2-sm",
94
100
  basedOrg: "symbols",
95
101
  githubClientId: "Ov23ligwZDQVD0VfuWNa",
96
- grafanaUrl: "https://faro-collector-prod-us-east-0.grafana.net/collect/7a3ba473cee2025c68513667024316b8",
102
+ grafanaUrl: "",
97
103
  // For grafana tracing
98
104
  grafanaAppName: "Symbols Staging",
99
105
  typesenseCollectionName: "docs",
@@ -132,6 +138,11 @@ var getConfig = () => {
132
138
  const envConfig = { ...CONFIG.common, ...CONFIG[env] };
133
139
  const finalConfig = {
134
140
  ...envConfig,
141
+ // Deep-merge feature flags so env-specific overrides don't drop common defaults
142
+ features: {
143
+ ...CONFIG.common.features || {},
144
+ ...CONFIG[env] && CONFIG[env].features || {}
145
+ },
135
146
  socketUrl: process.env.SYMBOLS_APP_SOCKET_URL || envConfig.socketUrl,
136
147
  apiUrl: process.env.SYMBOLS_APP_API_URL || envConfig.apiUrl,
137
148
  basedEnv: process.env.SYMBOLS_APP_BASED_ENV || envConfig.basedEnv,
@@ -637,6 +648,39 @@ var BaseService = class {
637
648
  this._ready = false;
638
649
  this._error = error;
639
650
  }
651
+ _getTrackingService() {
652
+ var _a;
653
+ const services = (_a = this._context) == null ? void 0 : _a.services;
654
+ const tracking = services == null ? void 0 : services.tracking;
655
+ if (!tracking || typeof tracking.trackError !== "function") {
656
+ return null;
657
+ }
658
+ return tracking;
659
+ }
660
+ _shouldTrackErrors() {
661
+ var _a;
662
+ const name = (_a = this == null ? void 0 : this.constructor) == null ? void 0 : _a.name;
663
+ return name !== "TrackingService";
664
+ }
665
+ _trackServiceError(error, details = {}) {
666
+ var _a;
667
+ if (!this._shouldTrackErrors()) {
668
+ return;
669
+ }
670
+ try {
671
+ const tracking = this._getTrackingService();
672
+ if (!tracking) {
673
+ return;
674
+ }
675
+ const context = {
676
+ service: ((_a = this == null ? void 0 : this.constructor) == null ? void 0 : _a.name) || "UnknownService",
677
+ apiUrl: this._apiUrl || null,
678
+ ...details
679
+ };
680
+ tracking.trackError(error instanceof Error ? error : new Error(String(error)), context);
681
+ } catch {
682
+ }
683
+ }
640
684
  _requireAuth() {
641
685
  if (!this._context.authToken) {
642
686
  throw new Error("Authentication required");
@@ -686,10 +730,23 @@ var BaseService = class {
686
730
  error = await response.json();
687
731
  } catch {
688
732
  }
733
+ this._trackServiceError(
734
+ new Error(error.message || error.error || `HTTP ${response.status}: ${response.statusText}`),
735
+ {
736
+ endpoint,
737
+ methodName: options.methodName,
738
+ status: response.status,
739
+ statusText: response.statusText
740
+ }
741
+ );
689
742
  throw new Error(error.message || error.error || "Request failed", { cause: error });
690
743
  }
691
744
  return response.status === 204 ? null : response.json();
692
745
  } catch (error) {
746
+ this._trackServiceError(error, {
747
+ endpoint,
748
+ methodName: options.methodName
749
+ });
693
750
  throw new Error(`Request failed: ${error.message}`, { cause: error });
694
751
  }
695
752
  }
@@ -12,7 +12,9 @@ var CONFIG = {
12
12
  // Feature toggles that apply across all environments by default
13
13
  features: {
14
14
  newUserOnboarding: true,
15
- betaFeatures: false
15
+ betaFeatures: false,
16
+ // Tracking is enabled by default unless overridden per environment
17
+ trackingEnabled: true
16
18
  }
17
19
  },
18
20
  // Environment-specific configurations
@@ -30,13 +32,17 @@ var CONFIG = {
30
32
  // For based api
31
33
  githubClientId: "Ov23liAFrsR0StbAO6PO",
32
34
  // For github api
33
- grafanaUrl: "https://faro-collector-prod-us-east-0.grafana.net/collect/aef64330db80bdfeaac084317bf72f99",
35
+ grafanaUrl: "",
34
36
  // For grafana tracing
35
- grafanaAppName: "Localhost Symbols",
37
+ grafanaAppName: "Symbols Localhost",
36
38
  // Environment-specific feature toggles (override common)
37
39
  features: {
38
- betaFeatures: true
40
+ // Disable tracking by default on localhost/dev machines
41
+ trackingEnabled: false,
39
42
  // Enable beta features in local dev
43
+ betaFeatures: true,
44
+ // Preserve common defaults explicitly for local
45
+ newUserOnboarding: true
40
46
  },
41
47
  typesenseCollectionName: "docs",
42
48
  typesenseApiKey: "vZya3L2zpq8L6iI5WWMUZJZABvT63VDb",
@@ -64,7 +70,7 @@ var CONFIG = {
64
70
  basedProject: "platform-v2-sm",
65
71
  basedOrg: "symbols",
66
72
  githubClientId: "Ov23liHxyWFBxS8f1gnF",
67
- grafanaUrl: "https://faro-collector-prod-us-east-0.grafana.net/collect/7a3ba473cee2025c68513667024316b8",
73
+ grafanaUrl: "",
68
74
  // For grafana tracing
69
75
  grafanaAppName: "Symbols Test",
70
76
  typesenseCollectionName: "docs",
@@ -77,7 +83,7 @@ var CONFIG = {
77
83
  socketUrl: "https://upcoming.api.symbols.app",
78
84
  apiUrl: "https://upcoming.api.symbols.app",
79
85
  githubClientId: "Ov23liWF7NvdZ056RV5J",
80
- grafanaUrl: "https://faro-collector-prod-us-east-0.grafana.net/collect/7a3ba473cee2025c68513667024316b8",
86
+ grafanaUrl: "",
81
87
  // For grafana tracing
82
88
  grafanaAppName: "Symbols Upcoming",
83
89
  typesenseCollectionName: "docs",
@@ -93,7 +99,7 @@ var CONFIG = {
93
99
  basedProject: "platform-v2-sm",
94
100
  basedOrg: "symbols",
95
101
  githubClientId: "Ov23ligwZDQVD0VfuWNa",
96
- grafanaUrl: "https://faro-collector-prod-us-east-0.grafana.net/collect/7a3ba473cee2025c68513667024316b8",
102
+ grafanaUrl: "",
97
103
  // For grafana tracing
98
104
  grafanaAppName: "Symbols Staging",
99
105
  typesenseCollectionName: "docs",
@@ -132,6 +138,11 @@ var getConfig = () => {
132
138
  const envConfig = { ...CONFIG.common, ...CONFIG[env] };
133
139
  const finalConfig = {
134
140
  ...envConfig,
141
+ // Deep-merge feature flags so env-specific overrides don't drop common defaults
142
+ features: {
143
+ ...CONFIG.common.features || {},
144
+ ...CONFIG[env] && CONFIG[env].features || {}
145
+ },
135
146
  socketUrl: process.env.SYMBOLS_APP_SOCKET_URL || envConfig.socketUrl,
136
147
  apiUrl: process.env.SYMBOLS_APP_API_URL || envConfig.apiUrl,
137
148
  basedEnv: process.env.SYMBOLS_APP_BASED_ENV || envConfig.basedEnv,
@@ -637,6 +648,39 @@ var BaseService = class {
637
648
  this._ready = false;
638
649
  this._error = error;
639
650
  }
651
+ _getTrackingService() {
652
+ var _a;
653
+ const services = (_a = this._context) == null ? void 0 : _a.services;
654
+ const tracking = services == null ? void 0 : services.tracking;
655
+ if (!tracking || typeof tracking.trackError !== "function") {
656
+ return null;
657
+ }
658
+ return tracking;
659
+ }
660
+ _shouldTrackErrors() {
661
+ var _a;
662
+ const name = (_a = this == null ? void 0 : this.constructor) == null ? void 0 : _a.name;
663
+ return name !== "TrackingService";
664
+ }
665
+ _trackServiceError(error, details = {}) {
666
+ var _a;
667
+ if (!this._shouldTrackErrors()) {
668
+ return;
669
+ }
670
+ try {
671
+ const tracking = this._getTrackingService();
672
+ if (!tracking) {
673
+ return;
674
+ }
675
+ const context = {
676
+ service: ((_a = this == null ? void 0 : this.constructor) == null ? void 0 : _a.name) || "UnknownService",
677
+ apiUrl: this._apiUrl || null,
678
+ ...details
679
+ };
680
+ tracking.trackError(error instanceof Error ? error : new Error(String(error)), context);
681
+ } catch {
682
+ }
683
+ }
640
684
  _requireAuth() {
641
685
  if (!this._context.authToken) {
642
686
  throw new Error("Authentication required");
@@ -686,10 +730,23 @@ var BaseService = class {
686
730
  error = await response.json();
687
731
  } catch {
688
732
  }
733
+ this._trackServiceError(
734
+ new Error(error.message || error.error || `HTTP ${response.status}: ${response.statusText}`),
735
+ {
736
+ endpoint,
737
+ methodName: options.methodName,
738
+ status: response.status,
739
+ statusText: response.statusText
740
+ }
741
+ );
689
742
  throw new Error(error.message || error.error || "Request failed", { cause: error });
690
743
  }
691
744
  return response.status === 204 ? null : response.json();
692
745
  } catch (error) {
746
+ this._trackServiceError(error, {
747
+ endpoint,
748
+ methodName: options.methodName
749
+ });
693
750
  throw new Error(`Request failed: ${error.message}`, { cause: error });
694
751
  }
695
752
  }
@@ -12,7 +12,9 @@ var CONFIG = {
12
12
  // Feature toggles that apply across all environments by default
13
13
  features: {
14
14
  newUserOnboarding: true,
15
- betaFeatures: false
15
+ betaFeatures: false,
16
+ // Tracking is enabled by default unless overridden per environment
17
+ trackingEnabled: true
16
18
  }
17
19
  },
18
20
  // Environment-specific configurations
@@ -30,13 +32,17 @@ var CONFIG = {
30
32
  // For based api
31
33
  githubClientId: "Ov23liAFrsR0StbAO6PO",
32
34
  // For github api
33
- grafanaUrl: "https://faro-collector-prod-us-east-0.grafana.net/collect/aef64330db80bdfeaac084317bf72f99",
35
+ grafanaUrl: "",
34
36
  // For grafana tracing
35
- grafanaAppName: "Localhost Symbols",
37
+ grafanaAppName: "Symbols Localhost",
36
38
  // Environment-specific feature toggles (override common)
37
39
  features: {
38
- betaFeatures: true
40
+ // Disable tracking by default on localhost/dev machines
41
+ trackingEnabled: false,
39
42
  // Enable beta features in local dev
43
+ betaFeatures: true,
44
+ // Preserve common defaults explicitly for local
45
+ newUserOnboarding: true
40
46
  },
41
47
  typesenseCollectionName: "docs",
42
48
  typesenseApiKey: "vZya3L2zpq8L6iI5WWMUZJZABvT63VDb",
@@ -64,7 +70,7 @@ var CONFIG = {
64
70
  basedProject: "platform-v2-sm",
65
71
  basedOrg: "symbols",
66
72
  githubClientId: "Ov23liHxyWFBxS8f1gnF",
67
- grafanaUrl: "https://faro-collector-prod-us-east-0.grafana.net/collect/7a3ba473cee2025c68513667024316b8",
73
+ grafanaUrl: "",
68
74
  // For grafana tracing
69
75
  grafanaAppName: "Symbols Test",
70
76
  typesenseCollectionName: "docs",
@@ -77,7 +83,7 @@ var CONFIG = {
77
83
  socketUrl: "https://upcoming.api.symbols.app",
78
84
  apiUrl: "https://upcoming.api.symbols.app",
79
85
  githubClientId: "Ov23liWF7NvdZ056RV5J",
80
- grafanaUrl: "https://faro-collector-prod-us-east-0.grafana.net/collect/7a3ba473cee2025c68513667024316b8",
86
+ grafanaUrl: "",
81
87
  // For grafana tracing
82
88
  grafanaAppName: "Symbols Upcoming",
83
89
  typesenseCollectionName: "docs",
@@ -93,7 +99,7 @@ var CONFIG = {
93
99
  basedProject: "platform-v2-sm",
94
100
  basedOrg: "symbols",
95
101
  githubClientId: "Ov23ligwZDQVD0VfuWNa",
96
- grafanaUrl: "https://faro-collector-prod-us-east-0.grafana.net/collect/7a3ba473cee2025c68513667024316b8",
102
+ grafanaUrl: "",
97
103
  // For grafana tracing
98
104
  grafanaAppName: "Symbols Staging",
99
105
  typesenseCollectionName: "docs",
@@ -132,6 +138,11 @@ var getConfig = () => {
132
138
  const envConfig = { ...CONFIG.common, ...CONFIG[env] };
133
139
  const finalConfig = {
134
140
  ...envConfig,
141
+ // Deep-merge feature flags so env-specific overrides don't drop common defaults
142
+ features: {
143
+ ...CONFIG.common.features || {},
144
+ ...CONFIG[env] && CONFIG[env].features || {}
145
+ },
135
146
  socketUrl: process.env.SYMBOLS_APP_SOCKET_URL || envConfig.socketUrl,
136
147
  apiUrl: process.env.SYMBOLS_APP_API_URL || envConfig.apiUrl,
137
148
  basedEnv: process.env.SYMBOLS_APP_BASED_ENV || envConfig.basedEnv,
@@ -637,6 +648,39 @@ var BaseService = class {
637
648
  this._ready = false;
638
649
  this._error = error;
639
650
  }
651
+ _getTrackingService() {
652
+ var _a;
653
+ const services = (_a = this._context) == null ? void 0 : _a.services;
654
+ const tracking = services == null ? void 0 : services.tracking;
655
+ if (!tracking || typeof tracking.trackError !== "function") {
656
+ return null;
657
+ }
658
+ return tracking;
659
+ }
660
+ _shouldTrackErrors() {
661
+ var _a;
662
+ const name = (_a = this == null ? void 0 : this.constructor) == null ? void 0 : _a.name;
663
+ return name !== "TrackingService";
664
+ }
665
+ _trackServiceError(error, details = {}) {
666
+ var _a;
667
+ if (!this._shouldTrackErrors()) {
668
+ return;
669
+ }
670
+ try {
671
+ const tracking = this._getTrackingService();
672
+ if (!tracking) {
673
+ return;
674
+ }
675
+ const context = {
676
+ service: ((_a = this == null ? void 0 : this.constructor) == null ? void 0 : _a.name) || "UnknownService",
677
+ apiUrl: this._apiUrl || null,
678
+ ...details
679
+ };
680
+ tracking.trackError(error instanceof Error ? error : new Error(String(error)), context);
681
+ } catch {
682
+ }
683
+ }
640
684
  _requireAuth() {
641
685
  if (!this._context.authToken) {
642
686
  throw new Error("Authentication required");
@@ -686,10 +730,23 @@ var BaseService = class {
686
730
  error = await response.json();
687
731
  } catch {
688
732
  }
733
+ this._trackServiceError(
734
+ new Error(error.message || error.error || `HTTP ${response.status}: ${response.statusText}`),
735
+ {
736
+ endpoint,
737
+ methodName: options.methodName,
738
+ status: response.status,
739
+ statusText: response.statusText
740
+ }
741
+ );
689
742
  throw new Error(error.message || error.error || "Request failed", { cause: error });
690
743
  }
691
744
  return response.status === 204 ? null : response.json();
692
745
  } catch (error) {
746
+ this._trackServiceError(error, {
747
+ endpoint,
748
+ methodName: options.methodName
749
+ });
693
750
  throw new Error(`Request failed: ${error.message}`, { cause: error });
694
751
  }
695
752
  }