From ece51fc7977b612330049af36095ab2310a001af Mon Sep 17 00:00:00 2001 From: Barbora Plasovska Date: Tue, 4 Aug 2026 15:27:35 +0200 Subject: [PATCH] make view optional in the common schema, require it explicitly per event type --- lib/cjs/generated/rum.d.ts | 21 ++++++++++++++++++--- lib/esm/generated/rum.d.ts | 21 ++++++++++++++++++--- schemas/rum/_common-schema.json | 2 +- schemas/rum/_vital-common-schema.json | 6 +++++- schemas/rum/action-schema.json | 2 +- schemas/rum/error-schema.json | 2 +- schemas/rum/long_task-schema.json | 6 +++++- schemas/rum/resource-schema.json | 6 +++++- schemas/rum/transition-schema.json | 6 +++++- schemas/rum/view_update-schema.json | 6 +++++- 10 files changed, 64 insertions(+), 14 deletions(-) diff --git a/lib/cjs/generated/rum.d.ts b/lib/cjs/generated/rum.d.ts index b46b6264..15c6a87e 100644 --- a/lib/cjs/generated/rum.d.ts +++ b/lib/cjs/generated/rum.d.ts @@ -94,7 +94,7 @@ export type RumActionEvent = CommonProperties & ViewContainerSchema & { /** * View properties */ - readonly view?: { + readonly view: { /** * Is the action starting in the foreground (focus in browser) */ @@ -167,6 +167,9 @@ export type RumTransitionEvent = CommonProperties & { * RUM event type */ readonly type: 'transition'; + readonly view: { + [k: string]: unknown; + }; /** * Stream properties */ @@ -447,7 +450,7 @@ export type RumErrorEvent = CommonProperties & ActionChildProperties & ViewConta /** * View properties */ - readonly view?: { + readonly view: { /** * Is the error starting in the foreground (focus in browser) */ @@ -494,6 +497,9 @@ export type RumLongTaskEvent = CommonProperties & ActionChildProperties & ViewCo * RUM event type */ readonly type: 'long_task'; + readonly view: { + [k: string]: unknown; + }; /** * Long Task properties */ @@ -624,6 +630,9 @@ export type RumResourceEvent = CommonProperties & ActionChildProperties & ViewCo * RUM event type */ readonly type: 'resource'; + readonly view: { + [k: string]: unknown; + }; /** * Resource properties */ @@ -881,6 +890,9 @@ export type RumViewUpdateEvent = ViewContainerSchema & StreamSchema & ViewProper * RUM event type */ readonly type: 'view_update'; + readonly view: { + [k: string]: unknown; + }; [k: string]: unknown; }; export type RumVitalEvent = RumVitalDurationEvent | RumVitalOperationStepEvent | RumVitalAppLaunchEvent; @@ -912,6 +924,9 @@ export type RumVitalEventCommonProperties = CommonProperties & ViewContainerSche * RUM event type */ readonly type: 'vital'; + readonly view: { + [k: string]: unknown; + }; /** * Vital properties */ @@ -1073,7 +1088,7 @@ export interface CommonProperties { /** * View properties */ - readonly view: { + readonly view?: { /** * UUID of the view */ diff --git a/lib/esm/generated/rum.d.ts b/lib/esm/generated/rum.d.ts index b46b6264..15c6a87e 100644 --- a/lib/esm/generated/rum.d.ts +++ b/lib/esm/generated/rum.d.ts @@ -94,7 +94,7 @@ export type RumActionEvent = CommonProperties & ViewContainerSchema & { /** * View properties */ - readonly view?: { + readonly view: { /** * Is the action starting in the foreground (focus in browser) */ @@ -167,6 +167,9 @@ export type RumTransitionEvent = CommonProperties & { * RUM event type */ readonly type: 'transition'; + readonly view: { + [k: string]: unknown; + }; /** * Stream properties */ @@ -447,7 +450,7 @@ export type RumErrorEvent = CommonProperties & ActionChildProperties & ViewConta /** * View properties */ - readonly view?: { + readonly view: { /** * Is the error starting in the foreground (focus in browser) */ @@ -494,6 +497,9 @@ export type RumLongTaskEvent = CommonProperties & ActionChildProperties & ViewCo * RUM event type */ readonly type: 'long_task'; + readonly view: { + [k: string]: unknown; + }; /** * Long Task properties */ @@ -624,6 +630,9 @@ export type RumResourceEvent = CommonProperties & ActionChildProperties & ViewCo * RUM event type */ readonly type: 'resource'; + readonly view: { + [k: string]: unknown; + }; /** * Resource properties */ @@ -881,6 +890,9 @@ export type RumViewUpdateEvent = ViewContainerSchema & StreamSchema & ViewProper * RUM event type */ readonly type: 'view_update'; + readonly view: { + [k: string]: unknown; + }; [k: string]: unknown; }; export type RumVitalEvent = RumVitalDurationEvent | RumVitalOperationStepEvent | RumVitalAppLaunchEvent; @@ -912,6 +924,9 @@ export type RumVitalEventCommonProperties = CommonProperties & ViewContainerSche * RUM event type */ readonly type: 'vital'; + readonly view: { + [k: string]: unknown; + }; /** * Vital properties */ @@ -1073,7 +1088,7 @@ export interface CommonProperties { /** * View properties */ - readonly view: { + readonly view?: { /** * UUID of the view */ diff --git a/schemas/rum/_common-schema.json b/schemas/rum/_common-schema.json index cd91f4fa..9406bbce 100644 --- a/schemas/rum/_common-schema.json +++ b/schemas/rum/_common-schema.json @@ -4,7 +4,7 @@ "title": "CommonProperties", "type": "object", "description": "Schema of common properties of RUM events", - "required": ["date", "application", "session", "view", "_dd"], + "required": ["date", "application", "session", "_dd"], "properties": { "date": { "type": "integer", diff --git a/schemas/rum/_vital-common-schema.json b/schemas/rum/_vital-common-schema.json index fb31d654..8af9e651 100644 --- a/schemas/rum/_vital-common-schema.json +++ b/schemas/rum/_vital-common-schema.json @@ -12,7 +12,7 @@ "$ref": "_view-container-schema.json" }, { - "required": ["type", "vital"], + "required": ["type", "view", "vital"], "properties": { "type": { "type": "string", @@ -20,6 +20,10 @@ "const": "vital", "readOnly": true }, + "view": { + "type": "object", + "readOnly": true + }, "vital": { "type": "object", "description": "Vital properties", diff --git a/schemas/rum/action-schema.json b/schemas/rum/action-schema.json index f74ce228..b347c279 100644 --- a/schemas/rum/action-schema.json +++ b/schemas/rum/action-schema.json @@ -12,7 +12,7 @@ "$ref": "_view-container-schema.json" }, { - "required": ["type", "action"], + "required": ["type", "view", "action"], "properties": { "type": { "type": "string", diff --git a/schemas/rum/error-schema.json b/schemas/rum/error-schema.json index b123bfa3..34d6d9a0 100644 --- a/schemas/rum/error-schema.json +++ b/schemas/rum/error-schema.json @@ -15,7 +15,7 @@ "$ref": "_view-container-schema.json" }, { - "required": ["type", "error"], + "required": ["type", "view", "error"], "properties": { "type": { "type": "string", diff --git a/schemas/rum/long_task-schema.json b/schemas/rum/long_task-schema.json index 127b413c..9f94a598 100644 --- a/schemas/rum/long_task-schema.json +++ b/schemas/rum/long_task-schema.json @@ -16,7 +16,7 @@ "$ref": "_view-container-schema.json" }, { - "required": ["type", "long_task"], + "required": ["type", "view", "long_task"], "properties": { "type": { "type": "string", @@ -24,6 +24,10 @@ "const": "long_task", "readOnly": true }, + "view": { + "type": "object", + "readOnly": true + }, "long_task": { "type": "object", "description": "Long Task properties", diff --git a/schemas/rum/resource-schema.json b/schemas/rum/resource-schema.json index 6554f83e..3ceef057 100644 --- a/schemas/rum/resource-schema.json +++ b/schemas/rum/resource-schema.json @@ -15,7 +15,7 @@ "$ref": "_view-container-schema.json" }, { - "required": ["type", "resource"], + "required": ["type", "view", "resource"], "properties": { "type": { "type": "string", @@ -23,6 +23,10 @@ "const": "resource", "readOnly": true }, + "view": { + "type": "object", + "readOnly": true + }, "resource": { "type": "object", "description": "Resource properties", diff --git a/schemas/rum/transition-schema.json b/schemas/rum/transition-schema.json index d5997098..e4790514 100644 --- a/schemas/rum/transition-schema.json +++ b/schemas/rum/transition-schema.json @@ -9,7 +9,7 @@ "$ref": "_common-schema.json" }, { - "required": ["type", "transition", "stream"], + "required": ["type", "view", "transition", "stream"], "properties": { "type": { "type": "string", @@ -17,6 +17,10 @@ "const": "transition", "readOnly": true }, + "view": { + "type": "object", + "readOnly": true + }, "stream": { "type": "object", "description": "Stream properties", diff --git a/schemas/rum/view_update-schema.json b/schemas/rum/view_update-schema.json index b1d7064f..148d8301 100644 --- a/schemas/rum/view_update-schema.json +++ b/schemas/rum/view_update-schema.json @@ -18,13 +18,17 @@ "$ref": "_common-schema.json" }, { - "required": ["type"], + "required": ["type", "view"], "properties": { "type": { "type": "string", "description": "RUM event type", "const": "view_update", "readOnly": true + }, + "view": { + "type": "object", + "readOnly": true } } }