/** * Configuration for enriching events. */ export interface FaultEnrichment { /** * Configuration for asset registration. */ assetRegistration?: AssetRegistrationConfiguration; auth?: AuthConfiguration; /** * Configuration for handling fault code. */ fault: FaultConfiguration; /** * Configuration for heartbeats. */ heartbeat?: HeartbeatConfiguration; } /** * Configuration for asset registration. */ export interface AssetRegistrationConfiguration extends ApiRequestConfig { /** * Connecting specific data points to their intended targets or fields. */ data: TargetData; } /** * Authentication configuration for event enrichment. */ export interface AuthConfiguration extends ApiRequestConfig { /** * Type of authorization protocol. e.g.: Basic, OAuth2 */ type: "Basic" | "OAuth2"; } /** * Configuration for handling fault details. */ export interface FaultConfiguration extends ApiRequestConfig { /** * List of fault codes that the OEM app is interested in. */ sourceAddresses: Array; /** * Max number of elements when batching. */ batchSize?: number; /** * Connecting specific data points to their intended targets or fields. */ data: TargetData; } /** * Configuration for heartbeats. */ export interface HeartbeatConfiguration extends ApiRequestConfig { /** * Frequency of the heartbeat. */ frequency: "PT15M" | "PT1H" | "P1D"; /** * Max number of elements when batching. */ batchSize?: number; /** * Connecting specific data points to their intended targets or fields. */ data: TargetData; } /** * Common configuration for API requests. */ export interface ApiRequestConfig { /** * Headers with which to build the request. */ headers?: HeadersMap; /** * Body parameters with which to build the request. */ bodyParams?: Record; /** * URL for the API endpoint. */ url: string; } /** * Mapping of HTTP header keys to values. */ type HeadersMap = { [KeyHeader in HeaderKey]: "application/x-www-form-urlencoded" | "application/json" | "multipart/form-data"; }; /** * HTTP header keys. More can be added as a union. */ type HeaderKey = "Content-Type"; /** * Node attribute. With recursion, together, they allow the backend to dynamically build a payload that supports arrays and objects. */ export interface TargetData { [sourceName: string]: TargetDataAttributes; } /** * Attributes for target data mapping. */ export interface TargetDataAttributes { targetName: string; targetType: "String" | "Number" | "Array" | "Object"; targetFormat?: "EpochMs" | "EpochS" | "Iso8601" | "Empty" | "LowerCase" | "Null" | "UpperCase"; fallbackSourceName?: string; data?: TargetData; } export {};