@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.
- package/README.md +141 -0
- package/dist/cjs/config/environment.js +18 -7
- package/dist/cjs/index.js +38 -12
- package/dist/cjs/services/BaseService.js +46 -0
- package/dist/cjs/services/DnsService.js +6 -5
- package/dist/cjs/services/TrackingService.js +661 -0
- package/dist/cjs/services/index.js +5 -5
- package/dist/cjs/utils/changePreprocessor.js +8 -1
- package/dist/cjs/utils/services.js +27 -3
- package/dist/esm/config/environment.js +18 -7
- package/dist/esm/index.js +20747 -5912
- package/dist/esm/services/AdminService.js +64 -7
- package/dist/esm/services/AuthService.js +64 -7
- package/dist/esm/services/BaseService.js +64 -7
- package/dist/esm/services/BranchService.js +64 -7
- package/dist/esm/services/CollabService.js +72 -8
- package/dist/esm/services/DnsService.js +70 -12
- package/dist/esm/services/FileService.js +64 -7
- package/dist/esm/services/PaymentService.js +64 -7
- package/dist/esm/services/PlanService.js +64 -7
- package/dist/esm/services/ProjectService.js +72 -8
- package/dist/esm/services/PullRequestService.js +64 -7
- package/dist/esm/services/ScreenshotService.js +64 -7
- package/dist/esm/services/SubscriptionService.js +64 -7
- package/dist/esm/services/TrackingService.js +18321 -0
- package/dist/esm/services/index.js +20667 -5882
- package/dist/esm/utils/CollabClient.js +18 -7
- package/dist/esm/utils/changePreprocessor.js +8 -1
- package/dist/esm/utils/services.js +27 -3
- package/dist/node/config/environment.js +18 -7
- package/dist/node/index.js +42 -16
- package/dist/node/services/BaseService.js +46 -0
- package/dist/node/services/DnsService.js +6 -5
- package/dist/node/services/TrackingService.js +632 -0
- package/dist/node/services/index.js +5 -5
- package/dist/node/utils/changePreprocessor.js +8 -1
- package/dist/node/utils/services.js +27 -3
- package/package.json +8 -6
- package/src/config/environment.js +19 -11
- package/src/index.js +44 -14
- package/src/services/BaseService.js +43 -0
- package/src/services/DnsService.js +5 -5
- package/src/services/TrackingService.js +853 -0
- package/src/services/index.js +6 -5
- package/src/utils/changePreprocessor.js +25 -1
- package/src/utils/services.js +28 -4
- package/dist/cjs/services/CoreService.js +0 -2818
- package/dist/esm/services/CoreService.js +0 -3513
- package/dist/node/services/CoreService.js +0 -2789
- 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: "
|
|
35
|
+
grafanaUrl: "",
|
|
34
36
|
// For grafana tracing
|
|
35
|
-
grafanaAppName: "Localhost
|
|
37
|
+
grafanaAppName: "Symbols Localhost",
|
|
36
38
|
// Environment-specific feature toggles (override common)
|
|
37
39
|
features: {
|
|
38
|
-
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
35
|
+
grafanaUrl: "",
|
|
34
36
|
// For grafana tracing
|
|
35
|
-
grafanaAppName: "Localhost
|
|
37
|
+
grafanaAppName: "Symbols Localhost",
|
|
36
38
|
// Environment-specific feature toggles (override common)
|
|
37
39
|
features: {
|
|
38
|
-
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
35
|
+
grafanaUrl: "",
|
|
34
36
|
// For grafana tracing
|
|
35
|
-
grafanaAppName: "Localhost
|
|
37
|
+
grafanaAppName: "Symbols Localhost",
|
|
36
38
|
// Environment-specific feature toggles (override common)
|
|
37
39
|
features: {
|
|
38
|
-
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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: "
|
|
35
|
+
grafanaUrl: "",
|
|
34
36
|
// For grafana tracing
|
|
35
|
-
grafanaAppName: "Localhost
|
|
37
|
+
grafanaAppName: "Symbols Localhost",
|
|
36
38
|
// Environment-specific feature toggles (override common)
|
|
37
39
|
features: {
|
|
38
|
-
|
|
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: "
|
|
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: "
|
|
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: "
|
|
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
|
}
|
|
@@ -14095,7 +14095,9 @@ var CONFIG = {
|
|
|
14095
14095
|
// Feature toggles that apply across all environments by default
|
|
14096
14096
|
features: {
|
|
14097
14097
|
newUserOnboarding: true,
|
|
14098
|
-
betaFeatures: false
|
|
14098
|
+
betaFeatures: false,
|
|
14099
|
+
// Tracking is enabled by default unless overridden per environment
|
|
14100
|
+
trackingEnabled: true
|
|
14099
14101
|
}
|
|
14100
14102
|
},
|
|
14101
14103
|
// Environment-specific configurations
|
|
@@ -14113,13 +14115,17 @@ var CONFIG = {
|
|
|
14113
14115
|
// For based api
|
|
14114
14116
|
githubClientId: "Ov23liAFrsR0StbAO6PO",
|
|
14115
14117
|
// For github api
|
|
14116
|
-
grafanaUrl: "
|
|
14118
|
+
grafanaUrl: "",
|
|
14117
14119
|
// For grafana tracing
|
|
14118
|
-
grafanaAppName: "Localhost
|
|
14120
|
+
grafanaAppName: "Symbols Localhost",
|
|
14119
14121
|
// Environment-specific feature toggles (override common)
|
|
14120
14122
|
features: {
|
|
14121
|
-
|
|
14123
|
+
// Disable tracking by default on localhost/dev machines
|
|
14124
|
+
trackingEnabled: false,
|
|
14122
14125
|
// Enable beta features in local dev
|
|
14126
|
+
betaFeatures: true,
|
|
14127
|
+
// Preserve common defaults explicitly for local
|
|
14128
|
+
newUserOnboarding: true
|
|
14123
14129
|
},
|
|
14124
14130
|
typesenseCollectionName: "docs",
|
|
14125
14131
|
typesenseApiKey: "vZya3L2zpq8L6iI5WWMUZJZABvT63VDb",
|
|
@@ -14147,7 +14153,7 @@ var CONFIG = {
|
|
|
14147
14153
|
basedProject: "platform-v2-sm",
|
|
14148
14154
|
basedOrg: "symbols",
|
|
14149
14155
|
githubClientId: "Ov23liHxyWFBxS8f1gnF",
|
|
14150
|
-
grafanaUrl: "
|
|
14156
|
+
grafanaUrl: "",
|
|
14151
14157
|
// For grafana tracing
|
|
14152
14158
|
grafanaAppName: "Symbols Test",
|
|
14153
14159
|
typesenseCollectionName: "docs",
|
|
@@ -14160,7 +14166,7 @@ var CONFIG = {
|
|
|
14160
14166
|
socketUrl: "https://upcoming.api.symbols.app",
|
|
14161
14167
|
apiUrl: "https://upcoming.api.symbols.app",
|
|
14162
14168
|
githubClientId: "Ov23liWF7NvdZ056RV5J",
|
|
14163
|
-
grafanaUrl: "
|
|
14169
|
+
grafanaUrl: "",
|
|
14164
14170
|
// For grafana tracing
|
|
14165
14171
|
grafanaAppName: "Symbols Upcoming",
|
|
14166
14172
|
typesenseCollectionName: "docs",
|
|
@@ -14176,7 +14182,7 @@ var CONFIG = {
|
|
|
14176
14182
|
basedProject: "platform-v2-sm",
|
|
14177
14183
|
basedOrg: "symbols",
|
|
14178
14184
|
githubClientId: "Ov23ligwZDQVD0VfuWNa",
|
|
14179
|
-
grafanaUrl: "
|
|
14185
|
+
grafanaUrl: "",
|
|
14180
14186
|
// For grafana tracing
|
|
14181
14187
|
grafanaAppName: "Symbols Staging",
|
|
14182
14188
|
typesenseCollectionName: "docs",
|
|
@@ -14215,6 +14221,11 @@ var getConfig = () => {
|
|
|
14215
14221
|
const envConfig = { ...CONFIG.common, ...CONFIG[env] };
|
|
14216
14222
|
const finalConfig = {
|
|
14217
14223
|
...envConfig,
|
|
14224
|
+
// Deep-merge feature flags so env-specific overrides don't drop common defaults
|
|
14225
|
+
features: {
|
|
14226
|
+
...CONFIG.common.features || {},
|
|
14227
|
+
...CONFIG[env] && CONFIG[env].features || {}
|
|
14228
|
+
},
|
|
14218
14229
|
socketUrl: process.env.SYMBOLS_APP_SOCKET_URL || envConfig.socketUrl,
|
|
14219
14230
|
apiUrl: process.env.SYMBOLS_APP_API_URL || envConfig.apiUrl,
|
|
14220
14231
|
basedEnv: process.env.SYMBOLS_APP_BASED_ENV || envConfig.basedEnv,
|
|
@@ -14720,6 +14731,39 @@ var BaseService = class {
|
|
|
14720
14731
|
this._ready = false;
|
|
14721
14732
|
this._error = error;
|
|
14722
14733
|
}
|
|
14734
|
+
_getTrackingService() {
|
|
14735
|
+
var _a;
|
|
14736
|
+
const services = (_a = this._context) == null ? void 0 : _a.services;
|
|
14737
|
+
const tracking = services == null ? void 0 : services.tracking;
|
|
14738
|
+
if (!tracking || typeof tracking.trackError !== "function") {
|
|
14739
|
+
return null;
|
|
14740
|
+
}
|
|
14741
|
+
return tracking;
|
|
14742
|
+
}
|
|
14743
|
+
_shouldTrackErrors() {
|
|
14744
|
+
var _a;
|
|
14745
|
+
const name = (_a = this == null ? void 0 : this.constructor) == null ? void 0 : _a.name;
|
|
14746
|
+
return name !== "TrackingService";
|
|
14747
|
+
}
|
|
14748
|
+
_trackServiceError(error, details = {}) {
|
|
14749
|
+
var _a;
|
|
14750
|
+
if (!this._shouldTrackErrors()) {
|
|
14751
|
+
return;
|
|
14752
|
+
}
|
|
14753
|
+
try {
|
|
14754
|
+
const tracking = this._getTrackingService();
|
|
14755
|
+
if (!tracking) {
|
|
14756
|
+
return;
|
|
14757
|
+
}
|
|
14758
|
+
const context = {
|
|
14759
|
+
service: ((_a = this == null ? void 0 : this.constructor) == null ? void 0 : _a.name) || "UnknownService",
|
|
14760
|
+
apiUrl: this._apiUrl || null,
|
|
14761
|
+
...details
|
|
14762
|
+
};
|
|
14763
|
+
tracking.trackError(error instanceof Error ? error : new Error(String(error)), context);
|
|
14764
|
+
} catch {
|
|
14765
|
+
}
|
|
14766
|
+
}
|
|
14723
14767
|
_requireAuth() {
|
|
14724
14768
|
if (!this._context.authToken) {
|
|
14725
14769
|
throw new Error("Authentication required");
|
|
@@ -14769,10 +14813,23 @@ var BaseService = class {
|
|
|
14769
14813
|
error = await response.json();
|
|
14770
14814
|
} catch {
|
|
14771
14815
|
}
|
|
14816
|
+
this._trackServiceError(
|
|
14817
|
+
new Error(error.message || error.error || `HTTP ${response.status}: ${response.statusText}`),
|
|
14818
|
+
{
|
|
14819
|
+
endpoint,
|
|
14820
|
+
methodName: options.methodName,
|
|
14821
|
+
status: response.status,
|
|
14822
|
+
statusText: response.statusText
|
|
14823
|
+
}
|
|
14824
|
+
);
|
|
14772
14825
|
throw new Error(error.message || error.error || "Request failed", { cause: error });
|
|
14773
14826
|
}
|
|
14774
14827
|
return response.status === 204 ? null : response.json();
|
|
14775
14828
|
} catch (error) {
|
|
14829
|
+
this._trackServiceError(error, {
|
|
14830
|
+
endpoint,
|
|
14831
|
+
methodName: options.methodName
|
|
14832
|
+
});
|
|
14776
14833
|
throw new Error(`Request failed: ${error.message}`, { cause: error });
|
|
14777
14834
|
}
|
|
14778
14835
|
}
|
|
@@ -24932,7 +24989,14 @@ function preprocessChanges(root, tuples = [], options = {}) {
|
|
|
24932
24989
|
if (!canConsiderExpansion || isFilesPath || value2 && value2.type === "files") {
|
|
24933
24990
|
return [t];
|
|
24934
24991
|
}
|
|
24935
|
-
const
|
|
24992
|
+
const prevRaw = getByPathSafe(root, path);
|
|
24993
|
+
const isCreatePath = Array.isArray(path) && action === "update" && // e.g. ['update', ['components', 'NewKey'], {...}]
|
|
24994
|
+
(!isSchemaPath && path.length === 2 || // e.g. ['update', ['schema', 'components', 'NewKey'], {...}]
|
|
24995
|
+
isSchemaPath && path.length === 3) && (prevRaw === null || typeof prevRaw === "undefined");
|
|
24996
|
+
if (isCreatePath) {
|
|
24997
|
+
return [t];
|
|
24998
|
+
}
|
|
24999
|
+
const prev = prevRaw || {};
|
|
24936
25000
|
const next = value2 || {};
|
|
24937
25001
|
if (!isPlainObject2(prev) || !isPlainObject2(next)) {
|
|
24938
25002
|
return [t];
|