Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] [hackathon] api reference generator #3274

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
},
"devDependencies": {
"@jsdevtools/coverage-istanbul-loader": "3.0.5",
"@microsoft/api-extractor": "7.47.7",
"@microsoft/api-extractor-model": "7.29.6",
"@microsoft/tsdoc": "0.15.0",
"@types/chrome": "0.0.270",
"@types/connect-busboy": "1.0.3",
"@types/cors": "2.8.17",
Expand Down Expand Up @@ -82,6 +85,7 @@
"ts-loader": "9.5.1",
"ts-node": "10.9.2",
"tsconfig-paths-webpack-plugin": "4.1.0",
"typedoc": "0.26.6",
"typescript": "5.5.4",
"webdriverio": "8.40.5",
"webpack": "5.94.0",
Expand Down
205 changes: 103 additions & 102 deletions packages/core/src/domain/telemetry/telemetryEvent.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -389,116 +389,16 @@ export type TelemetryUsageEvent = CommonTelemetryProperties & {
* Telemetry type
*/
type: 'usage'

usage: TelemetryCommonFeaturesUsage | TelemetryBrowserFeaturesUsage
[k: string]: unknown
}
[k: string]: unknown
}
/**
* Schema of features usage common across SDKs
*/
export type TelemetryCommonFeaturesUsage =
| {
/**
* setTrackingConsent API
*/
feature: 'set-tracking-consent'
/**
* The tracking consent value set by the user
*/
tracking_consent: 'granted' | 'not-granted' | 'pending'
[k: string]: unknown
}
| {
/**
* stopSession API
*/
feature: 'stop-session'
[k: string]: unknown
}
| {
/**
* startView API
*/
feature: 'start-view'
[k: string]: unknown
}
| {
/**
* addAction API
*/
feature: 'add-action'
[k: string]: unknown
}
| {
/**
* addError API
*/
feature: 'add-error'
[k: string]: unknown
}
| {
/**
* setGlobalContext, setGlobalContextProperty, addAttribute APIs
*/
feature: 'set-global-context'
[k: string]: unknown
}
| {
/**
* setUser, setUserProperty, setUserInfo APIs
*/
feature: 'set-user'
[k: string]: unknown
}
| {
/**
* addFeatureFlagEvaluation API
*/
feature: 'add-feature-flag-evaluation'
[k: string]: unknown
}
/**
* Schema of browser specific features usage
*/
export type TelemetryBrowserFeaturesUsage =
| {
/**
* startSessionReplayRecording API
*/
feature: 'start-session-replay-recording'
/**
* Whether the recording is allowed to start even on sessions sampled out of replay
*/
is_forced?: boolean
[k: string]: unknown
}
| {
/**
* startDurationVital API
*/
feature: 'start-duration-vital'
[k: string]: unknown
}
| {
/**
* stopDurationVital API
*/
feature: 'stop-duration-vital'
[k: string]: unknown
}
| {
/**
* addDurationVital API
*/
feature: 'add-duration-vital'
[k: string]: unknown
}

/**
* Schema of common properties of Telemetry events
*/
export interface CommonTelemetryProperties {
export type CommonTelemetryProperties = {
/**
* Internal properties
*/
Expand Down Expand Up @@ -573,6 +473,7 @@ export interface CommonTelemetryProperties {
* Enabled experimental features
*/
readonly experimental_features?: string[]

telemetry?: {
/**
* Device properties
Expand Down Expand Up @@ -614,3 +515,103 @@ export interface CommonTelemetryProperties {
}
[k: string]: unknown
}
/**
* Schema of features usage common across SDKs
*/
export type TelemetryCommonFeaturesUsage =
| {
/**
* setTrackingConsent API
*/
feature: 'set-tracking-consent'
/**
* The tracking consent value set by the user
*/
tracking_consent: 'granted' | 'not-granted' | 'pending'
[k: string]: unknown
}
| {
/**
* stopSession API
*/
feature: 'stop-session'
[k: string]: unknown
}
| {
/**
* startView API
*/
feature: 'start-view'
[k: string]: unknown
}
| {
/**
* addAction API
*/
feature: 'add-action'
[k: string]: unknown
}
| {
/**
* addError API
*/
feature: 'add-error'
[k: string]: unknown
}
| {
/**
* setGlobalContext, setGlobalContextProperty, addAttribute APIs
*/
feature: 'set-global-context'
[k: string]: unknown
}
| {
/**
* setUser, setUserProperty, setUserInfo APIs
*/
feature: 'set-user'
[k: string]: unknown
}
| {
/**
* addFeatureFlagEvaluation API
*/
feature: 'add-feature-flag-evaluation'
[k: string]: unknown
}
/**
* Schema of browser specific features usage
*/
export type TelemetryBrowserFeaturesUsage =
| {
/**
* startSessionReplayRecording API
*/
feature: 'start-session-replay-recording'
/**
* Whether the recording is allowed to start even on sessions sampled out of replay
*/
is_forced?: boolean
[k: string]: unknown
}
| {
/**
* startDurationVital API
*/
feature: 'start-duration-vital'
[k: string]: unknown
}
| {
/**
* stopDurationVital API
*/
feature: 'stop-duration-vital'
[k: string]: unknown
}
| {
/**
* addDurationVital API
*/
feature: 'add-duration-vital'
[k: string]: unknown
}
Loading