Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,24 @@ Breaking changes to the format must be reflected by a major version update in `_

After editing any schema, you must re-generate the JS + TS definitions ([see below](#build-js-sources--ts-definitions)).

## Consuming this repository
## How this repository is consumed?

Consuming projects are encouraged to use a _yarn github_ reference as dependency, e.g:
This repository accommodates various usages, specifically:

yarn add rum-events-format@DataDog/rum-events-format#workspace=rum-events-format
- The [Browser SDK](https://github.com/DataDog/browser-sdk/):

Updating to the latest change is possible with _yarn up_, e.g:
- Generates TypeScript types from `schemas/rum-events-browser-schema.json`,
`schemas/telemetry-events-schema.json` and `schemas/session-replay-browser-schema.json`.

yarn up rum-events-format@DataDog/rum-events-format#workspace=rum-events-format
- Validates data within unit and e2e tests against `schemas/rum-events-schema.json`.

It is also possible to specify the exact commit hash to use, e.g:
- The [iOS SDK](https://github.com/DataDog/dd-sdk-ios/) generates native data models based on
`schemas/rum-events-mobile-schema.json` and `schemas/session-replay-mobile-schema.json`.

yarn up "rum-events-format@DataDog/rum-events-format#workspace=rum-events-format&commit=COMMIT-HASH"
- The [Android SDK](https://github.com/DataDog/dd-sdk-android/) generates native data models based on
schemas coming from `rum/`, `session-replay/` and `telemetry/` folders.

- The Datadog App is using TypeScript types by including the `lib/` folder as a package dependency.

# Tools

Expand Down
56 changes: 28 additions & 28 deletions lib/cjs/generated/mobileSessionReplay.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,34 +231,6 @@ export declare type MobileMutationData = {
*/
readonly source: 0;
} & MobileMutationPayload;
/**
* Mobile-specific. Schema of a MutationPayload.
*/
export declare type MobileMutationPayload = {
/**
* Contains the newly added wireframes.
*/
readonly adds?: {
/**
* The previous wireframe id next or after which this new wireframe is drawn or attached to, respectively.
*/
previousId?: number;
wireframe: Wireframe;
}[];
/**
* Contains the removed wireframes as an array of ids.
*/
readonly removes?: {
/**
* The id of the wireframe that needs to be removed.
*/
id: number;
}[];
/**
* Contains the updated wireframes mutations.
*/
readonly updates?: WireframeUpdateMutation[];
};
/**
* Schema of a WireframeUpdateMutation type.
*/
Expand Down Expand Up @@ -587,6 +559,34 @@ export interface WireframeClip {
*/
readonly right?: number;
}
/**
* Mobile-specific. Schema of a MutationPayload.
*/
export interface MobileMutationPayload {
/**
* Contains the newly added wireframes.
*/
readonly adds: {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ Question : Why this property is not optional anymore ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah good catch. This happened when I did this change. I think the intent was to make it required but it never worked (at least with json-schema-to-typescript). Let's wait for a Mobile review to know more.

/**
* The previous wireframe id next or after which this new wireframe is drawn or attached to, respectively.
*/
previousId?: number;
wireframe: Wireframe;
}[];
/**
* Contains the removed wireframes as an array of ids.
*/
readonly removes: {
/**
* The id of the wireframe that needs to be removed.
*/
id: number;
}[];
/**
* Contains the updated wireframes mutations.
*/
readonly updates: WireframeUpdateMutation[];
}
/**
* Schema of common properties for WireframeUpdate events type.
*/
Expand Down
183 changes: 103 additions & 80 deletions lib/cjs/generated/rum.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ export declare type RumTransitionEvent = CommonProperties & {
* RUM event type
*/
readonly type: 'transition';
view: {
[k: string]: unknown;
};
/**
* Stream properties
*/
Expand Down Expand Up @@ -461,6 +464,9 @@ export declare type RumLongTaskEvent = CommonProperties & ActionChildProperties
* RUM event type
*/
readonly type: 'long_task';
view: {
[k: string]: unknown;
};
/**
* Long Task properties
*/
Expand Down Expand Up @@ -577,6 +583,9 @@ export declare type RumResourceEvent = CommonProperties & ActionChildProperties
* RUM event type
*/
readonly type: 'resource';
view: {
[k: string]: unknown;
};
/**
* Resource properties
*/
Expand Down Expand Up @@ -1229,119 +1238,133 @@ export declare type RumViewEvent = CommonProperties & ViewContainerSchema & Stre
};
[k: string]: unknown;
};
export declare type RumVitalEvent = RumVitalDurationEvent | RumVitalOperationStepEvent | RumVitalAppLaunchEvent;
/**
* Schema of all properties of a Vital event
* Schema for a duration vital event.
*/
export declare type RumVitalEvent = CommonProperties & ViewContainerSchema & {
/**
* RUM event type
*/
readonly type: 'vital';
readonly vital: DurationProperties | AppLaunchProperties | FeatureOperationProperties;
export declare type RumVitalDurationEvent = RumVitalEventCommonProperties & {
view: {
[k: string]: unknown;
};
/**
* Internal properties
* Vital properties
*/
readonly _dd?: {
readonly vital: {
/**
* Internal vital properties
* Type of the vital.
*/
readonly vital?: {
/**
* Whether the value of the vital is computed by the SDK (as opposed to directly provided by the customer)
*/
readonly computed_value?: boolean;
[k: string]: unknown;
};
readonly type: 'duration';
/**
* Profiling context
* Duration of the vital in nanoseconds.
*/
profiling?: ProfilingInternalContextSchema;
readonly duration: number;
[k: string]: unknown;
};
[k: string]: unknown;
};
/**
* Duration properties of a Vital event
*/
export declare type DurationProperties = VitalCommonProperties & {
/**
* Type of the vital.
*/
readonly type: 'duration';
/**
* Duration of the vital in nanoseconds.
*/
readonly duration: number;
[k: string]: unknown;
};
/**
* Schema of common properties for a Vital event
*/
export declare type VitalCommonProperties = {
/**
* UUID of the vital
*/
readonly id: string;
export declare type RumVitalEventCommonProperties = CommonProperties & ViewContainerSchema & {
/**
* Name of the vital, as it is also used as facet path for its value, it must contain only letters, digits, or the characters - _ . @ $
* RUM event type
*/
readonly name?: string;
readonly type: 'vital';
/**
* Description of the vital. It can be used as a secondary identifier (URL, React component name...)
* Vital properties
*/
readonly description?: string;
readonly vital: {
/**
* UUID of the vital
*/
readonly id: string;
/**
* Name of the vital, as it is also used as facet path for its value, it must contain only letters, digits, or the characters - _ . @ $
*/
readonly name?: string;
/**
* Description of the vital. It can be used as a secondary identifier (URL, React component name...)
*/
readonly description?: string;
[k: string]: unknown;
};
[k: string]: unknown;
};
/**
* Schema for app launch metrics.
* Schema for a vital operation step event.
*/
export declare type AppLaunchProperties = VitalCommonProperties & {
/**
* Type of the vital.
*/
readonly type: 'app_launch';
/**
* The metric of the app launch.
*/
readonly app_launch_metric: 'ttid' | 'ttfd';
/**
* Duration of the vital in nanoseconds.
*/
readonly duration: number;
/**
* The type of the app launch.
*/
readonly startup_type?: 'cold_start' | 'warm_start';
/**
* Whether the app launch was prewarmed.
*/
readonly is_prewarmed?: boolean;
export declare type RumVitalOperationStepEvent = RumVitalEventCommonProperties & {
view: {
[k: string]: unknown;
};
/**
* If the app launch had a saved instance state bundle.
* Vital properties
*/
readonly has_saved_instance_state_bundle?: boolean;
readonly vital: {
/**
* Type of the vital.
*/
readonly type: 'operation_step';
/**
* Optional key to distinguish between multiple operations of the same name running in parallel (e.g., 'photo_upload' with keys 'profile_pic' vs 'cover')
*/
readonly operation_key?: string;
/**
* Type of the step that triggered the vital, if applicable
*/
readonly step_type: 'start' | 'update' | 'retry' | 'end';
/**
* Reason for the failure of the step, if applicable
*/
readonly failure_reason?: 'error' | 'abandoned' | 'other';
[k: string]: unknown;
};
[k: string]: unknown;
};
/**
* Schema for a feature operation.
* Schema for app launch metrics.
*/
export declare type FeatureOperationProperties = VitalCommonProperties & {
/**
* Type of the vital.
*/
readonly type: 'operation_step';
/**
* Optional key to distinguish between multiple operations of the same name running in parallel (e.g., 'photo_upload' with keys 'profile_pic' vs 'cover')
*/
readonly operation_key?: string;
export declare type RumVitalAppLaunchEvent = RumVitalEventCommonProperties & {
/**
* Type of the step that triggered the vital, if applicable
* Vital properties
*/
readonly step_type?: 'start' | 'update' | 'retry' | 'end';
readonly vital: {
/**
* Type of the vital.
*/
readonly type: 'app_launch';
/**
* The metric of the app launch.
*/
readonly app_launch_metric: 'ttid' | 'ttfd';
/**
* Duration of the vital in nanoseconds.
*/
readonly duration: number;
/**
* The type of the app launch.
*/
readonly startup_type?: 'cold_start' | 'warm_start';
/**
* Whether the app launch was prewarmed.
*/
readonly is_prewarmed?: boolean;
/**
* If the app launch had a saved instance state bundle.
*/
readonly has_saved_instance_state_bundle?: boolean;
[k: string]: unknown;
};
/**
* Reason for the failure of the step, if applicable
* Internal properties
*/
readonly failure_reason?: 'error' | 'abandoned' | 'other';
readonly _dd?: {
/**
* Profiling context
*/
profiling?: ProfilingInternalContextSchema;
[k: string]: unknown;
};
[k: string]: unknown;
};
/**
Expand Down
Loading
Loading