Skip to content

Commit ece51fc

Browse files
make view optional in the common schema, require it explicitly per event type
1 parent 45083b4 commit ece51fc

10 files changed

Lines changed: 64 additions & 14 deletions

lib/cjs/generated/rum.d.ts

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export type RumActionEvent = CommonProperties & ViewContainerSchema & {
9494
/**
9595
* View properties
9696
*/
97-
readonly view?: {
97+
readonly view: {
9898
/**
9999
* Is the action starting in the foreground (focus in browser)
100100
*/
@@ -167,6 +167,9 @@ export type RumTransitionEvent = CommonProperties & {
167167
* RUM event type
168168
*/
169169
readonly type: 'transition';
170+
readonly view: {
171+
[k: string]: unknown;
172+
};
170173
/**
171174
* Stream properties
172175
*/
@@ -447,7 +450,7 @@ export type RumErrorEvent = CommonProperties & ActionChildProperties & ViewConta
447450
/**
448451
* View properties
449452
*/
450-
readonly view?: {
453+
readonly view: {
451454
/**
452455
* Is the error starting in the foreground (focus in browser)
453456
*/
@@ -494,6 +497,9 @@ export type RumLongTaskEvent = CommonProperties & ActionChildProperties & ViewCo
494497
* RUM event type
495498
*/
496499
readonly type: 'long_task';
500+
readonly view: {
501+
[k: string]: unknown;
502+
};
497503
/**
498504
* Long Task properties
499505
*/
@@ -624,6 +630,9 @@ export type RumResourceEvent = CommonProperties & ActionChildProperties & ViewCo
624630
* RUM event type
625631
*/
626632
readonly type: 'resource';
633+
readonly view: {
634+
[k: string]: unknown;
635+
};
627636
/**
628637
* Resource properties
629638
*/
@@ -881,6 +890,9 @@ export type RumViewUpdateEvent = ViewContainerSchema & StreamSchema & ViewProper
881890
* RUM event type
882891
*/
883892
readonly type: 'view_update';
893+
readonly view: {
894+
[k: string]: unknown;
895+
};
884896
[k: string]: unknown;
885897
};
886898
export type RumVitalEvent = RumVitalDurationEvent | RumVitalOperationStepEvent | RumVitalAppLaunchEvent;
@@ -912,6 +924,9 @@ export type RumVitalEventCommonProperties = CommonProperties & ViewContainerSche
912924
* RUM event type
913925
*/
914926
readonly type: 'vital';
927+
readonly view: {
928+
[k: string]: unknown;
929+
};
915930
/**
916931
* Vital properties
917932
*/
@@ -1073,7 +1088,7 @@ export interface CommonProperties {
10731088
/**
10741089
* View properties
10751090
*/
1076-
readonly view: {
1091+
readonly view?: {
10771092
/**
10781093
* UUID of the view
10791094
*/

lib/esm/generated/rum.d.ts

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export type RumActionEvent = CommonProperties & ViewContainerSchema & {
9494
/**
9595
* View properties
9696
*/
97-
readonly view?: {
97+
readonly view: {
9898
/**
9999
* Is the action starting in the foreground (focus in browser)
100100
*/
@@ -167,6 +167,9 @@ export type RumTransitionEvent = CommonProperties & {
167167
* RUM event type
168168
*/
169169
readonly type: 'transition';
170+
readonly view: {
171+
[k: string]: unknown;
172+
};
170173
/**
171174
* Stream properties
172175
*/
@@ -447,7 +450,7 @@ export type RumErrorEvent = CommonProperties & ActionChildProperties & ViewConta
447450
/**
448451
* View properties
449452
*/
450-
readonly view?: {
453+
readonly view: {
451454
/**
452455
* Is the error starting in the foreground (focus in browser)
453456
*/
@@ -494,6 +497,9 @@ export type RumLongTaskEvent = CommonProperties & ActionChildProperties & ViewCo
494497
* RUM event type
495498
*/
496499
readonly type: 'long_task';
500+
readonly view: {
501+
[k: string]: unknown;
502+
};
497503
/**
498504
* Long Task properties
499505
*/
@@ -624,6 +630,9 @@ export type RumResourceEvent = CommonProperties & ActionChildProperties & ViewCo
624630
* RUM event type
625631
*/
626632
readonly type: 'resource';
633+
readonly view: {
634+
[k: string]: unknown;
635+
};
627636
/**
628637
* Resource properties
629638
*/
@@ -881,6 +890,9 @@ export type RumViewUpdateEvent = ViewContainerSchema & StreamSchema & ViewProper
881890
* RUM event type
882891
*/
883892
readonly type: 'view_update';
893+
readonly view: {
894+
[k: string]: unknown;
895+
};
884896
[k: string]: unknown;
885897
};
886898
export type RumVitalEvent = RumVitalDurationEvent | RumVitalOperationStepEvent | RumVitalAppLaunchEvent;
@@ -912,6 +924,9 @@ export type RumVitalEventCommonProperties = CommonProperties & ViewContainerSche
912924
* RUM event type
913925
*/
914926
readonly type: 'vital';
927+
readonly view: {
928+
[k: string]: unknown;
929+
};
915930
/**
916931
* Vital properties
917932
*/
@@ -1073,7 +1088,7 @@ export interface CommonProperties {
10731088
/**
10741089
* View properties
10751090
*/
1076-
readonly view: {
1091+
readonly view?: {
10771092
/**
10781093
* UUID of the view
10791094
*/

schemas/rum/_common-schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"title": "CommonProperties",
55
"type": "object",
66
"description": "Schema of common properties of RUM events",
7-
"required": ["date", "application", "session", "view", "_dd"],
7+
"required": ["date", "application", "session", "_dd"],
88
"properties": {
99
"date": {
1010
"type": "integer",

schemas/rum/_vital-common-schema.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,18 @@
1212
"$ref": "_view-container-schema.json"
1313
},
1414
{
15-
"required": ["type", "vital"],
15+
"required": ["type", "view", "vital"],
1616
"properties": {
1717
"type": {
1818
"type": "string",
1919
"description": "RUM event type",
2020
"const": "vital",
2121
"readOnly": true
2222
},
23+
"view": {
24+
"type": "object",
25+
"readOnly": true
26+
},
2327
"vital": {
2428
"type": "object",
2529
"description": "Vital properties",

schemas/rum/action-schema.json

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

schemas/rum/error-schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"$ref": "_view-container-schema.json"
1616
},
1717
{
18-
"required": ["type", "error"],
18+
"required": ["type", "view", "error"],
1919
"properties": {
2020
"type": {
2121
"type": "string",

schemas/rum/long_task-schema.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,18 @@
1616
"$ref": "_view-container-schema.json"
1717
},
1818
{
19-
"required": ["type", "long_task"],
19+
"required": ["type", "view", "long_task"],
2020
"properties": {
2121
"type": {
2222
"type": "string",
2323
"description": "RUM event type",
2424
"const": "long_task",
2525
"readOnly": true
2626
},
27+
"view": {
28+
"type": "object",
29+
"readOnly": true
30+
},
2731
"long_task": {
2832
"type": "object",
2933
"description": "Long Task properties",

schemas/rum/resource-schema.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,18 @@
1515
"$ref": "_view-container-schema.json"
1616
},
1717
{
18-
"required": ["type", "resource"],
18+
"required": ["type", "view", "resource"],
1919
"properties": {
2020
"type": {
2121
"type": "string",
2222
"description": "RUM event type",
2323
"const": "resource",
2424
"readOnly": true
2525
},
26+
"view": {
27+
"type": "object",
28+
"readOnly": true
29+
},
2630
"resource": {
2731
"type": "object",
2832
"description": "Resource properties",

schemas/rum/transition-schema.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,18 @@
99
"$ref": "_common-schema.json"
1010
},
1111
{
12-
"required": ["type", "transition", "stream"],
12+
"required": ["type", "view", "transition", "stream"],
1313
"properties": {
1414
"type": {
1515
"type": "string",
1616
"description": "RUM event type",
1717
"const": "transition",
1818
"readOnly": true
1919
},
20+
"view": {
21+
"type": "object",
22+
"readOnly": true
23+
},
2024
"stream": {
2125
"type": "object",
2226
"description": "Stream properties",

schemas/rum/view_update-schema.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,17 @@
1818
"$ref": "_common-schema.json"
1919
},
2020
{
21-
"required": ["type"],
21+
"required": ["type", "view"],
2222
"properties": {
2323
"type": {
2424
"type": "string",
2525
"description": "RUM event type",
2626
"const": "view_update",
2727
"readOnly": true
28+
},
29+
"view": {
30+
"type": "object",
31+
"readOnly": true
2832
}
2933
}
3034
}

0 commit comments

Comments
 (0)