Skip to content

Commit ca818f8

Browse files
committed
Refactor RUM Vital event schema to only allow app_launch Vital to have optional view
1 parent eda52a0 commit ca818f8

4 files changed

Lines changed: 252 additions & 173 deletions

File tree

lib/cjs/generated/rum.d.ts

Lines changed: 80 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,34 +1232,22 @@ export declare type RumViewEvent = CommonProperties & ViewContainerSchema & Stre
12321232
/**
12331233
* Schema of all properties of a Vital event
12341234
*/
1235-
export declare type RumVitalEvent = CommonProperties & ViewContainerSchema & {
1235+
export declare type RumVitalEvent = (CommonProperties & ViewContainerSchema & VitalCommonInternalProperties & {
12361236
/**
12371237
* RUM event type
12381238
*/
12391239
readonly type: 'vital';
1240-
readonly vital: DurationProperties | AppLaunchProperties | FeatureOperationProperties;
1240+
readonly vital: DurationProperties | FeatureOperationProperties;
1241+
[k: string]: unknown;
1242+
}) | (CommonProperties & ViewContainerSchema & VitalCommonInternalProperties & {
12411243
/**
1242-
* Internal properties
1244+
* RUM event type
12431245
*/
1244-
readonly _dd?: {
1245-
/**
1246-
* Internal vital properties
1247-
*/
1248-
readonly vital?: {
1249-
/**
1250-
* Whether the value of the vital is computed by the SDK (as opposed to directly provided by the customer)
1251-
*/
1252-
readonly computed_value?: boolean;
1253-
[k: string]: unknown;
1254-
};
1255-
/**
1256-
* Profiling context
1257-
*/
1258-
profiling?: ProfilingInternalContextSchema;
1259-
[k: string]: unknown;
1260-
};
1246+
readonly type: 'vital';
1247+
readonly vital: AppLaunchProperties;
1248+
readonly view?: View;
12611249
[k: string]: unknown;
1262-
};
1250+
});
12631251
/**
12641252
* Duration properties of a Vital event
12651253
*/
@@ -1292,6 +1280,28 @@ export declare type VitalCommonProperties = {
12921280
readonly description?: string;
12931281
[k: string]: unknown;
12941282
};
1283+
/**
1284+
* Schema for a feature operation.
1285+
*/
1286+
export declare type FeatureOperationProperties = VitalCommonProperties & {
1287+
/**
1288+
* Type of the vital.
1289+
*/
1290+
readonly type: 'operation_step';
1291+
/**
1292+
* Optional key to distinguish between multiple operations of the same name running in parallel (e.g., 'photo_upload' with keys 'profile_pic' vs 'cover')
1293+
*/
1294+
readonly operation_key?: string;
1295+
/**
1296+
* Type of the step that triggered the vital, if applicable
1297+
*/
1298+
readonly step_type?: 'start' | 'update' | 'retry' | 'end';
1299+
/**
1300+
* Reason for the failure of the step, if applicable
1301+
*/
1302+
readonly failure_reason?: 'error' | 'abandoned' | 'other';
1303+
[k: string]: unknown;
1304+
};
12951305
/**
12961306
* Schema for app launch metrics.
12971307
*/
@@ -1322,28 +1332,6 @@ export declare type AppLaunchProperties = VitalCommonProperties & {
13221332
readonly has_saved_instance_state_bundle?: boolean;
13231333
[k: string]: unknown;
13241334
};
1325-
/**
1326-
* Schema for a feature operation.
1327-
*/
1328-
export declare type FeatureOperationProperties = VitalCommonProperties & {
1329-
/**
1330-
* Type of the vital.
1331-
*/
1332-
readonly type: 'operation_step';
1333-
/**
1334-
* Optional key to distinguish between multiple operations of the same name running in parallel (e.g., 'photo_upload' with keys 'profile_pic' vs 'cover')
1335-
*/
1336-
readonly operation_key?: string;
1337-
/**
1338-
* Type of the step that triggered the vital, if applicable
1339-
*/
1340-
readonly step_type?: 'start' | 'update' | 'retry' | 'end';
1341-
/**
1342-
* Reason for the failure of the step, if applicable
1343-
*/
1344-
readonly failure_reason?: 'error' | 'abandoned' | 'other';
1345-
[k: string]: unknown;
1346-
};
13471335
/**
13481336
* Schema of common properties of RUM events
13491337
*/
@@ -1408,28 +1396,7 @@ export interface CommonProperties {
14081396
* The source of this event
14091397
*/
14101398
readonly source?: 'android' | 'ios' | 'browser' | 'flutter' | 'react-native' | 'roku' | 'unity' | 'kotlin-multiplatform';
1411-
/**
1412-
* View properties
1413-
*/
1414-
readonly view?: {
1415-
/**
1416-
* UUID of the view
1417-
*/
1418-
readonly id: string;
1419-
/**
1420-
* URL that linked to the initial view of the page
1421-
*/
1422-
referrer?: string;
1423-
/**
1424-
* URL of the view
1425-
*/
1426-
url: string;
1427-
/**
1428-
* User defined name of the view
1429-
*/
1430-
name?: string;
1431-
[k: string]: unknown;
1432-
};
1399+
readonly view?: View;
14331400
/**
14341401
* User properties
14351402
*/
@@ -1686,6 +1653,28 @@ export interface CommonProperties {
16861653
};
16871654
[k: string]: unknown;
16881655
}
1656+
/**
1657+
* View properties
1658+
*/
1659+
export interface View {
1660+
/**
1661+
* UUID of the view
1662+
*/
1663+
readonly id: string;
1664+
/**
1665+
* URL that linked to the initial view of the page
1666+
*/
1667+
referrer?: string;
1668+
/**
1669+
* URL of the view
1670+
*/
1671+
url: string;
1672+
/**
1673+
* User defined name of the view
1674+
*/
1675+
name?: string;
1676+
[k: string]: unknown;
1677+
}
16891678
/**
16901679
* View Container schema for views that are nested (webviews in mobile)
16911680
*/
@@ -2043,3 +2032,29 @@ export interface ViewAccessibilityProperties {
20432032
readonly rtl_enabled?: boolean;
20442033
[k: string]: unknown;
20452034
}
2035+
/**
2036+
* Common internal properties for vital events
2037+
*/
2038+
export interface VitalCommonInternalProperties {
2039+
/**
2040+
* Internal properties
2041+
*/
2042+
readonly _dd?: {
2043+
/**
2044+
* Internal vital properties
2045+
*/
2046+
readonly vital?: {
2047+
/**
2048+
* Whether the value of the vital is computed by the SDK (as opposed to directly provided by the customer)
2049+
*/
2050+
readonly computed_value?: boolean;
2051+
[k: string]: unknown;
2052+
};
2053+
/**
2054+
* Profiling context
2055+
*/
2056+
profiling?: ProfilingInternalContextSchema;
2057+
[k: string]: unknown;
2058+
};
2059+
[k: string]: unknown;
2060+
}

lib/esm/generated/rum.d.ts

Lines changed: 80 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,34 +1232,22 @@ export declare type RumViewEvent = CommonProperties & ViewContainerSchema & Stre
12321232
/**
12331233
* Schema of all properties of a Vital event
12341234
*/
1235-
export declare type RumVitalEvent = CommonProperties & ViewContainerSchema & {
1235+
export declare type RumVitalEvent = (CommonProperties & ViewContainerSchema & VitalCommonInternalProperties & {
12361236
/**
12371237
* RUM event type
12381238
*/
12391239
readonly type: 'vital';
1240-
readonly vital: DurationProperties | AppLaunchProperties | FeatureOperationProperties;
1240+
readonly vital: DurationProperties | FeatureOperationProperties;
1241+
[k: string]: unknown;
1242+
}) | (CommonProperties & ViewContainerSchema & VitalCommonInternalProperties & {
12411243
/**
1242-
* Internal properties
1244+
* RUM event type
12431245
*/
1244-
readonly _dd?: {
1245-
/**
1246-
* Internal vital properties
1247-
*/
1248-
readonly vital?: {
1249-
/**
1250-
* Whether the value of the vital is computed by the SDK (as opposed to directly provided by the customer)
1251-
*/
1252-
readonly computed_value?: boolean;
1253-
[k: string]: unknown;
1254-
};
1255-
/**
1256-
* Profiling context
1257-
*/
1258-
profiling?: ProfilingInternalContextSchema;
1259-
[k: string]: unknown;
1260-
};
1246+
readonly type: 'vital';
1247+
readonly vital: AppLaunchProperties;
1248+
readonly view?: View;
12611249
[k: string]: unknown;
1262-
};
1250+
});
12631251
/**
12641252
* Duration properties of a Vital event
12651253
*/
@@ -1292,6 +1280,28 @@ export declare type VitalCommonProperties = {
12921280
readonly description?: string;
12931281
[k: string]: unknown;
12941282
};
1283+
/**
1284+
* Schema for a feature operation.
1285+
*/
1286+
export declare type FeatureOperationProperties = VitalCommonProperties & {
1287+
/**
1288+
* Type of the vital.
1289+
*/
1290+
readonly type: 'operation_step';
1291+
/**
1292+
* Optional key to distinguish between multiple operations of the same name running in parallel (e.g., 'photo_upload' with keys 'profile_pic' vs 'cover')
1293+
*/
1294+
readonly operation_key?: string;
1295+
/**
1296+
* Type of the step that triggered the vital, if applicable
1297+
*/
1298+
readonly step_type?: 'start' | 'update' | 'retry' | 'end';
1299+
/**
1300+
* Reason for the failure of the step, if applicable
1301+
*/
1302+
readonly failure_reason?: 'error' | 'abandoned' | 'other';
1303+
[k: string]: unknown;
1304+
};
12951305
/**
12961306
* Schema for app launch metrics.
12971307
*/
@@ -1322,28 +1332,6 @@ export declare type AppLaunchProperties = VitalCommonProperties & {
13221332
readonly has_saved_instance_state_bundle?: boolean;
13231333
[k: string]: unknown;
13241334
};
1325-
/**
1326-
* Schema for a feature operation.
1327-
*/
1328-
export declare type FeatureOperationProperties = VitalCommonProperties & {
1329-
/**
1330-
* Type of the vital.
1331-
*/
1332-
readonly type: 'operation_step';
1333-
/**
1334-
* Optional key to distinguish between multiple operations of the same name running in parallel (e.g., 'photo_upload' with keys 'profile_pic' vs 'cover')
1335-
*/
1336-
readonly operation_key?: string;
1337-
/**
1338-
* Type of the step that triggered the vital, if applicable
1339-
*/
1340-
readonly step_type?: 'start' | 'update' | 'retry' | 'end';
1341-
/**
1342-
* Reason for the failure of the step, if applicable
1343-
*/
1344-
readonly failure_reason?: 'error' | 'abandoned' | 'other';
1345-
[k: string]: unknown;
1346-
};
13471335
/**
13481336
* Schema of common properties of RUM events
13491337
*/
@@ -1408,28 +1396,7 @@ export interface CommonProperties {
14081396
* The source of this event
14091397
*/
14101398
readonly source?: 'android' | 'ios' | 'browser' | 'flutter' | 'react-native' | 'roku' | 'unity' | 'kotlin-multiplatform';
1411-
/**
1412-
* View properties
1413-
*/
1414-
readonly view?: {
1415-
/**
1416-
* UUID of the view
1417-
*/
1418-
readonly id: string;
1419-
/**
1420-
* URL that linked to the initial view of the page
1421-
*/
1422-
referrer?: string;
1423-
/**
1424-
* URL of the view
1425-
*/
1426-
url: string;
1427-
/**
1428-
* User defined name of the view
1429-
*/
1430-
name?: string;
1431-
[k: string]: unknown;
1432-
};
1399+
readonly view?: View;
14331400
/**
14341401
* User properties
14351402
*/
@@ -1686,6 +1653,28 @@ export interface CommonProperties {
16861653
};
16871654
[k: string]: unknown;
16881655
}
1656+
/**
1657+
* View properties
1658+
*/
1659+
export interface View {
1660+
/**
1661+
* UUID of the view
1662+
*/
1663+
readonly id: string;
1664+
/**
1665+
* URL that linked to the initial view of the page
1666+
*/
1667+
referrer?: string;
1668+
/**
1669+
* URL of the view
1670+
*/
1671+
url: string;
1672+
/**
1673+
* User defined name of the view
1674+
*/
1675+
name?: string;
1676+
[k: string]: unknown;
1677+
}
16891678
/**
16901679
* View Container schema for views that are nested (webviews in mobile)
16911680
*/
@@ -2043,3 +2032,29 @@ export interface ViewAccessibilityProperties {
20432032
readonly rtl_enabled?: boolean;
20442033
[k: string]: unknown;
20452034
}
2035+
/**
2036+
* Common internal properties for vital events
2037+
*/
2038+
export interface VitalCommonInternalProperties {
2039+
/**
2040+
* Internal properties
2041+
*/
2042+
readonly _dd?: {
2043+
/**
2044+
* Internal vital properties
2045+
*/
2046+
readonly vital?: {
2047+
/**
2048+
* Whether the value of the vital is computed by the SDK (as opposed to directly provided by the customer)
2049+
*/
2050+
readonly computed_value?: boolean;
2051+
[k: string]: unknown;
2052+
};
2053+
/**
2054+
* Profiling context
2055+
*/
2056+
profiling?: ProfilingInternalContextSchema;
2057+
[k: string]: unknown;
2058+
};
2059+
[k: string]: unknown;
2060+
}

0 commit comments

Comments
 (0)