import { type GasCorePayload } from '@atlaskit/analytics-gas-types'; import { type MEDIA_CONTEXT } from '@atlaskit/analytics-namespaced-context/MediaAnalyticsContext'; import { type MediaType, type FileStatus, type WithMediaFeatureFlags } from '..'; export type BaseAttributes = {}; export type PackageAttributes = { packageName: string; packageVersion: string; componentName: string; component: string; }; export type BaseEventPayload = Omit & { attributes: Attributes; }; export type FileAttributes = { fileId: string; fileSize?: number; fileMediatype?: MediaType; fileMimetype?: string; fileSource?: string; fileStatus?: FileStatus; }; export type PerformanceAttributes = { overall: { durationSincePageStart: number; durationSinceCommenced?: number; }; }; export type WithFileAttributes = { fileAttributes: FileAttributes; }; export type WithPerformanceAttributes = { performanceAttributes?: PerformanceAttributes; }; export type MediaTraceContext = { traceId: string; spanId?: string; }; export type WithTraceContext = { traceContext?: MediaTraceContext; metadataTraceContext?: MediaTraceContext; }; export type SuccessAttributes = { status: 'success'; fileMediatype?: MediaType; fileMimetype?: string; }; export type FailureAttributes = { status: 'fail'; failReason: string; error?: string; errorDetail?: string; fileMediatype?: MediaType; fileMimetype?: string; }; export type StatusAttributes = SuccessAttributes | FailureAttributes; export type OperationalAttributes = BaseAttributes | (BaseAttributes & WithFileAttributes) | (BaseAttributes & WithFileAttributes & StatusAttributes) | (BaseAttributes & WithFileAttributes & StatusAttributes & WithPerformanceAttributes & WithTraceContext); export type OperationalEventPayload = BaseEventPayload & { eventType: 'operational'; action: Action; actionSubject: ActionSubject; actionSubjectId?: ActionSubjectId; }; export type UIAttributes = BaseAttributes | (BaseAttributes & WithFileAttributes); export type UIEventPayload = BaseEventPayload & { eventType: 'ui'; action: Action; actionSubject: ActionSubject; actionSubjectId?: string; }; export type ScreenAttributes = BaseAttributes | (BaseAttributes & WithFileAttributes); export type ScreenEventPayload = BaseEventPayload & { eventType: 'screen'; actionSubject: ActionSubject; name: ActionSubject; }; export type TrackAttributes = BaseAttributes | (BaseAttributes & WithFileAttributes); export type TrackEventPayload = BaseEventPayload & { eventType: 'track'; action: Action; actionSubject: ActionSubject; actionSubjectId?: ActionSubjectId; }; export type ContextPublicAttributes = PackageAttributes; export type ContextPrivateAttributes = WithMediaFeatureFlags; export type ContextStaticProps = WithMediaFeatureFlags; export type ContextData = ContextPublicAttributes & { [MEDIA_CONTEXT]: ContextPrivateAttributes; };