Skip to content

Commit

Permalink
RUM-2162: Add parent view id to event schema
Browse files Browse the repository at this point in the history
  • Loading branch information
N-Boutaib committed Nov 17, 2023
1 parent d9624e7 commit d713408
Show file tree
Hide file tree
Showing 8 changed files with 94 additions and 10 deletions.
30 changes: 25 additions & 5 deletions lib/cjs/generated/rum.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export declare type RumEvent = RumActionEvent | RumErrorEvent | RumLongTaskEvent
/**
* Schema of all properties of an Action event
*/
export declare type RumActionEvent = CommonProperties & {
export declare type RumActionEvent = CommonProperties & ParentViewSchema & {
/**
* RUM event type
*/
Expand Down Expand Up @@ -150,7 +150,7 @@ export declare type RumActionEvent = CommonProperties & {
/**
* Schema of all properties of an Error event
*/
export declare type RumErrorEvent = CommonProperties & ActionChildProperties & {
export declare type RumErrorEvent = CommonProperties & ActionChildProperties & ParentViewSchema & {
/**
* RUM event type
*/
Expand Down Expand Up @@ -280,7 +280,7 @@ export declare type RumErrorEvent = CommonProperties & ActionChildProperties & {
/**
* Schema of all properties of a Long Task event
*/
export declare type RumLongTaskEvent = CommonProperties & ActionChildProperties & {
export declare type RumLongTaskEvent = CommonProperties & ActionChildProperties & ParentViewSchema & {
/**
* RUM event type
*/
Expand Down Expand Up @@ -318,7 +318,7 @@ export declare type RumLongTaskEvent = CommonProperties & ActionChildProperties
/**
* Schema of all properties of a Resource event
*/
export declare type RumResourceEvent = CommonProperties & ActionChildProperties & {
export declare type RumResourceEvent = CommonProperties & ActionChildProperties & ParentViewSchema & {
/**
* RUM event type
*/
Expand Down Expand Up @@ -508,7 +508,7 @@ export declare type RumResourceEvent = CommonProperties & ActionChildProperties
/**
* Schema of all properties of a View event
*/
export declare type RumViewEvent = CommonProperties & {
export declare type RumViewEvent = CommonProperties & ParentViewSchema & {
/**
* RUM event type
*/
Expand Down Expand Up @@ -1103,6 +1103,26 @@ export interface CommonProperties {
};
[k: string]: unknown;
}
/**
* Parent view schema for views that are nested (webviews in mobile)
*/
export interface ParentViewSchema {
/**
* Parent view properties (view wrapping the current view)
*/
readonly parent_view?: {
/**
* ID of the parent view
*/
readonly id: string;
/**
* Source of the parent view
*/
readonly source: 'android' | 'ios' | 'browser' | 'flutter' | 'react-native' | 'roku';
[k: string]: unknown;
};
[k: string]: unknown;
}
/**
* Schema of all properties of events that can have parent actions
*/
Expand Down
30 changes: 25 additions & 5 deletions lib/esm/generated/rum.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export declare type RumEvent = RumActionEvent | RumErrorEvent | RumLongTaskEvent
/**
* Schema of all properties of an Action event
*/
export declare type RumActionEvent = CommonProperties & {
export declare type RumActionEvent = CommonProperties & ParentViewSchema & {
/**
* RUM event type
*/
Expand Down Expand Up @@ -150,7 +150,7 @@ export declare type RumActionEvent = CommonProperties & {
/**
* Schema of all properties of an Error event
*/
export declare type RumErrorEvent = CommonProperties & ActionChildProperties & {
export declare type RumErrorEvent = CommonProperties & ActionChildProperties & ParentViewSchema & {
/**
* RUM event type
*/
Expand Down Expand Up @@ -280,7 +280,7 @@ export declare type RumErrorEvent = CommonProperties & ActionChildProperties & {
/**
* Schema of all properties of a Long Task event
*/
export declare type RumLongTaskEvent = CommonProperties & ActionChildProperties & {
export declare type RumLongTaskEvent = CommonProperties & ActionChildProperties & ParentViewSchema & {
/**
* RUM event type
*/
Expand Down Expand Up @@ -318,7 +318,7 @@ export declare type RumLongTaskEvent = CommonProperties & ActionChildProperties
/**
* Schema of all properties of a Resource event
*/
export declare type RumResourceEvent = CommonProperties & ActionChildProperties & {
export declare type RumResourceEvent = CommonProperties & ActionChildProperties & ParentViewSchema & {
/**
* RUM event type
*/
Expand Down Expand Up @@ -508,7 +508,7 @@ export declare type RumResourceEvent = CommonProperties & ActionChildProperties
/**
* Schema of all properties of a View event
*/
export declare type RumViewEvent = CommonProperties & {
export declare type RumViewEvent = CommonProperties & ParentViewSchema & {
/**
* RUM event type
*/
Expand Down Expand Up @@ -1103,6 +1103,26 @@ export interface CommonProperties {
};
[k: string]: unknown;
}
/**
* Parent view schema for views that are nested (webviews in mobile)
*/
export interface ParentViewSchema {
/**
* Parent view properties (view wrapping the current view)
*/
readonly parent_view?: {
/**
* ID of the parent view
*/
readonly id: string;
/**
* Source of the parent view
*/
readonly source: 'android' | 'ios' | 'browser' | 'flutter' | 'react-native' | 'roku';
[k: string]: unknown;
};
[k: string]: unknown;
}
/**
* Schema of all properties of events that can have parent actions
*/
Expand Down
29 changes: 29 additions & 0 deletions schemas/rum/_parent-view-schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"$id": "rum/_parent-view-schema.json",
"title": "ParentViewSchema",
"type": "object",
"description": "Parent view schema for views that are nested (webviews in mobile)",
"properties": {
"parent_view": {
"type": "object",
"description": "Parent view properties (view wrapping the current view)",
"required": ["id", "source"],
"properties": {
"id": {
"type": "string",
"description": "ID of the parent view",
"pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$",
"readOnly": true
},
"source": {
"type": "string",
"description": "Source of the parent view",
"enum": ["android", "ios", "browser", "flutter", "react-native", "roku"],
"readOnly": true
}
},
"readOnly": true
}
}
}
3 changes: 3 additions & 0 deletions schemas/rum/action-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
{
"$ref": "_common-schema.json"
},
{
"$ref": "_parent-view-schema.json"
},
{
"required": ["type", "action"],
"properties": {
Expand Down
3 changes: 3 additions & 0 deletions schemas/rum/error-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
{
"$ref": "_action-child-schema.json"
},
{
"$ref": "_parent-view-schema.json"
},
{
"required": ["type", "error"],
"properties": {
Expand Down
3 changes: 3 additions & 0 deletions schemas/rum/long_task-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
{
"$ref": "_action-child-schema.json"
},
{
"$ref": "_parent-view-schema.json"
},
{
"required": ["type", "long_task"],
"properties": {
Expand Down
3 changes: 3 additions & 0 deletions schemas/rum/resource-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
{
"$ref": "_action-child-schema.json"
},
{
"$ref": "_parent-view-schema.json"
},
{
"required": ["type", "resource"],
"properties": {
Expand Down
3 changes: 3 additions & 0 deletions schemas/rum/view-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
{
"$ref": "_common-schema.json"
},
{
"$ref": "_parent-view-schema.json"
},
{
"required": ["type", "view", "_dd"],
"properties": {
Expand Down

0 comments on commit d713408

Please sign in to comment.