Skip to content

Commit 415b2d2

Browse files
👌 review suggestion: improve required 'view' property definition
1 parent e505ab9 commit 415b2d2

8 files changed

Lines changed: 62 additions & 79 deletions

File tree

lib/cjs/generated/rum.d.ts

Lines changed: 28 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,7 @@ export declare type RumTransitionEvent = CommonProperties & {
159159
* RUM event type
160160
*/
161161
readonly type: 'transition';
162-
view: {
163-
[k: string]: unknown;
164-
};
162+
readonly view: ViewCommonProperties;
165163
/**
166164
* Stream properties
167165
*/
@@ -464,9 +462,7 @@ export declare type RumLongTaskEvent = CommonProperties & ActionChildProperties
464462
* RUM event type
465463
*/
466464
readonly type: 'long_task';
467-
view: {
468-
[k: string]: unknown;
469-
};
465+
readonly view: ViewCommonProperties;
470466
/**
471467
* Long Task properties
472468
*/
@@ -583,9 +579,7 @@ export declare type RumResourceEvent = CommonProperties & ActionChildProperties
583579
* RUM event type
584580
*/
585581
readonly type: 'resource';
586-
view: {
587-
[k: string]: unknown;
588-
};
582+
readonly view: ViewCommonProperties;
589583
/**
590584
* Resource properties
591585
*/
@@ -1243,9 +1237,7 @@ export declare type RumVitalEvent = RumVitalDurationEvent | RumVitalOperationSte
12431237
* Schema for a duration vital event.
12441238
*/
12451239
export declare type RumVitalDurationEvent = RumVitalEventCommonProperties & {
1246-
view: {
1247-
[k: string]: unknown;
1248-
};
1240+
readonly view: ViewCommonProperties;
12491241
/**
12501242
* Vital properties
12511243
*/
@@ -1294,9 +1286,7 @@ export declare type RumVitalEventCommonProperties = CommonProperties & ViewConta
12941286
* Schema for a vital operation step event.
12951287
*/
12961288
export declare type RumVitalOperationStepEvent = RumVitalEventCommonProperties & {
1297-
view: {
1298-
[k: string]: unknown;
1299-
};
1289+
readonly view: ViewCommonProperties;
13001290
/**
13011291
* Vital properties
13021292
*/
@@ -1431,28 +1421,7 @@ export interface CommonProperties {
14311421
* The source of this event
14321422
*/
14331423
readonly source?: 'android' | 'ios' | 'browser' | 'flutter' | 'react-native' | 'roku' | 'unity' | 'kotlin-multiplatform';
1434-
/**
1435-
* View properties
1436-
*/
1437-
readonly view?: {
1438-
/**
1439-
* UUID of the view
1440-
*/
1441-
readonly id: string;
1442-
/**
1443-
* URL that linked to the initial view of the page
1444-
*/
1445-
referrer?: string;
1446-
/**
1447-
* URL of the view
1448-
*/
1449-
url: string;
1450-
/**
1451-
* User defined name of the view
1452-
*/
1453-
name?: string;
1454-
[k: string]: unknown;
1455-
};
1424+
readonly view?: ViewCommonProperties;
14561425
/**
14571426
* User properties
14581427
*/
@@ -1709,6 +1678,28 @@ export interface CommonProperties {
17091678
};
17101679
[k: string]: unknown;
17111680
}
1681+
/**
1682+
* View properties
1683+
*/
1684+
export interface ViewCommonProperties {
1685+
/**
1686+
* UUID of the view
1687+
*/
1688+
readonly id: string;
1689+
/**
1690+
* URL that linked to the initial view of the page
1691+
*/
1692+
referrer?: string;
1693+
/**
1694+
* URL of the view
1695+
*/
1696+
url: string;
1697+
/**
1698+
* User defined name of the view
1699+
*/
1700+
name?: string;
1701+
[k: string]: unknown;
1702+
}
17121703
/**
17131704
* View Container schema for views that are nested (webviews in mobile)
17141705
*/

lib/esm/generated/rum.d.ts

Lines changed: 28 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,7 @@ export declare type RumTransitionEvent = CommonProperties & {
159159
* RUM event type
160160
*/
161161
readonly type: 'transition';
162-
view: {
163-
[k: string]: unknown;
164-
};
162+
readonly view: ViewCommonProperties;
165163
/**
166164
* Stream properties
167165
*/
@@ -464,9 +462,7 @@ export declare type RumLongTaskEvent = CommonProperties & ActionChildProperties
464462
* RUM event type
465463
*/
466464
readonly type: 'long_task';
467-
view: {
468-
[k: string]: unknown;
469-
};
465+
readonly view: ViewCommonProperties;
470466
/**
471467
* Long Task properties
472468
*/
@@ -583,9 +579,7 @@ export declare type RumResourceEvent = CommonProperties & ActionChildProperties
583579
* RUM event type
584580
*/
585581
readonly type: 'resource';
586-
view: {
587-
[k: string]: unknown;
588-
};
582+
readonly view: ViewCommonProperties;
589583
/**
590584
* Resource properties
591585
*/
@@ -1243,9 +1237,7 @@ export declare type RumVitalEvent = RumVitalDurationEvent | RumVitalOperationSte
12431237
* Schema for a duration vital event.
12441238
*/
12451239
export declare type RumVitalDurationEvent = RumVitalEventCommonProperties & {
1246-
view: {
1247-
[k: string]: unknown;
1248-
};
1240+
readonly view: ViewCommonProperties;
12491241
/**
12501242
* Vital properties
12511243
*/
@@ -1294,9 +1286,7 @@ export declare type RumVitalEventCommonProperties = CommonProperties & ViewConta
12941286
* Schema for a vital operation step event.
12951287
*/
12961288
export declare type RumVitalOperationStepEvent = RumVitalEventCommonProperties & {
1297-
view: {
1298-
[k: string]: unknown;
1299-
};
1289+
readonly view: ViewCommonProperties;
13001290
/**
13011291
* Vital properties
13021292
*/
@@ -1431,28 +1421,7 @@ export interface CommonProperties {
14311421
* The source of this event
14321422
*/
14331423
readonly source?: 'android' | 'ios' | 'browser' | 'flutter' | 'react-native' | 'roku' | 'unity' | 'kotlin-multiplatform';
1434-
/**
1435-
* View properties
1436-
*/
1437-
readonly view?: {
1438-
/**
1439-
* UUID of the view
1440-
*/
1441-
readonly id: string;
1442-
/**
1443-
* URL that linked to the initial view of the page
1444-
*/
1445-
referrer?: string;
1446-
/**
1447-
* URL of the view
1448-
*/
1449-
url: string;
1450-
/**
1451-
* User defined name of the view
1452-
*/
1453-
name?: string;
1454-
[k: string]: unknown;
1455-
};
1424+
readonly view?: ViewCommonProperties;
14561425
/**
14571426
* User properties
14581427
*/
@@ -1709,6 +1678,28 @@ export interface CommonProperties {
17091678
};
17101679
[k: string]: unknown;
17111680
}
1681+
/**
1682+
* View properties
1683+
*/
1684+
export interface ViewCommonProperties {
1685+
/**
1686+
* UUID of the view
1687+
*/
1688+
readonly id: string;
1689+
/**
1690+
* URL that linked to the initial view of the page
1691+
*/
1692+
referrer?: string;
1693+
/**
1694+
* URL of the view
1695+
*/
1696+
url: string;
1697+
/**
1698+
* User defined name of the view
1699+
*/
1700+
name?: string;
1701+
[k: string]: unknown;
1702+
}
17121703
/**
17131704
* View Container schema for views that are nested (webviews in mobile)
17141705
*/

schemas/rum/_common-schema.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@
8888
"view": {
8989
"type": "object",
9090
"description": "View properties",
91+
"title": "ViewCommonProperties",
9192
"required": ["id", "url"],
9293
"properties": {
9394
"id": {

schemas/rum/long_task-schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"readOnly": true
2626
},
2727
"view": {
28-
"type": "object"
28+
"$ref": "_common-schema.json#/properties/view"
2929
},
3030
"long_task": {
3131
"type": "object",

schemas/rum/resource-schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"readOnly": true
2525
},
2626
"view": {
27-
"type": "object"
27+
"$ref": "_common-schema.json#/properties/view"
2828
},
2929
"resource": {
3030
"type": "object",

schemas/rum/transition-schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"readOnly": true
1919
},
2020
"view": {
21-
"type": "object"
21+
"$ref": "_common-schema.json#/properties/view"
2222
},
2323
"stream": {
2424
"type": "object",

schemas/rum/vital-duration-schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"required": ["view", "vital"],
1313
"properties": {
1414
"view": {
15-
"type": "object"
15+
"$ref": "_common-schema.json#/properties/view"
1616
},
1717
"vital": {
1818
"type": "object",

schemas/rum/vital-operation-step-schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"required": ["view", "vital"],
1313
"properties": {
1414
"view": {
15-
"type": "object"
15+
"$ref": "_common-schema.json#/properties/view"
1616
},
1717
"vital": {
1818
"type": "object",

0 commit comments

Comments
 (0)