diff --git a/src/views/workflow-history/__fixtures__/workflow-history-activity-events.ts b/src/views/workflow-history/__fixtures__/workflow-history-activity-events.ts index d333608b..ec398929 100644 --- a/src/views/workflow-history/__fixtures__/workflow-history-activity-events.ts +++ b/src/views/workflow-history/__fixtures__/workflow-history-activity-events.ts @@ -1,5 +1,3 @@ -import { type HistoryEvent } from '@/__generated__/proto-ts/uber/cadence/api/v1/HistoryEvent'; - import type { ActivityHistoryEvent } from '../workflow-history.types'; export const scheduleActivityTaskEvent = { @@ -50,7 +48,7 @@ export const scheduleActivityTaskEvent = { }, }, attributes: 'activityTaskScheduledEventAttributes', -} as const satisfies HistoryEvent; +} as const satisfies ActivityHistoryEvent; export const startActivityTaskEvent = { eventId: '9', diff --git a/src/views/workflow-history/__fixtures__/workflow-history-child-workflow-events.ts b/src/views/workflow-history/__fixtures__/workflow-history-child-workflow-events.ts new file mode 100644 index 00000000..fe866c36 --- /dev/null +++ b/src/views/workflow-history/__fixtures__/workflow-history-child-workflow-events.ts @@ -0,0 +1,265 @@ +import type { ChildWorkflowExecutionHistoryEvent } from '../workflow-history.types'; + +export const initiateChildWorkflowEvent = { + eventId: "40", + eventTime: { + seconds: "172579671", + nanos: 830123299 + }, + version: "575102", + taskId: "5877269782", + startChildWorkflowExecutionInitiatedEventAttributes: { + domain: "cadence-domain", + workflowId: "workflow.cancellation-workflow.cancellation.external-child", + workflowType: { + name: "workflow.cancellation.external" + }, + taskList: { + name: "canary-task-queue", + kind: "TASK_LIST_KIND_INVALID" + }, + input: { + data: "MTcyNjQ5Mjc1MTc5ODgxMjMwOAozMDAwMDAwMDAwMAo=" + }, + executionStartToCloseTimeout: { + seconds: "360", + nanos: 0 + }, + taskStartToCloseTimeout: { + seconds: "10", + nanos: 0 + }, + parentClosePolicy: "PARENT_CLOSE_POLICY_ABANDON", + control: "", + decisionTaskCompletedEventId: "4", + workflowIdReusePolicy: "WORKFLOW_ID_REUSE_POLICY_ALLOW_DUPLICATE", + retryPolicy: null, + cronSchedule: "", + memo: null, + searchAttributes: null, + delayStart: null, + jitterStart: null, + firstRunAt: null, + header: { + fields: { + } + }, + }, + attributes: "startChildWorkflowExecutionInitiatedEventAttributes" +} as const satisfies ChildWorkflowExecutionHistoryEvent; + +export const initiateFailureChildWorkflowEvent = { + eventId: "41", + eventTime: { + seconds: "1725769672", + nanos: 830123299 + }, + version: "575102", + taskId: "5877269783", + startChildWorkflowExecutionFailedEventAttributes: { + domain: "cadence-domain", + workflowId: "workflow.cancellation-workflow.cancellation.external-child", + workflowType: { + name: "workflow.cancellation.external" + }, + control: "", + decisionTaskCompletedEventId: "4", + cause:'CHILD_WORKFLOW_EXECUTION_FAILED_CAUSE_INVALID', + initiatedEventId:'' + }, + attributes: "startChildWorkflowExecutionFailedEventAttributes" +} as const satisfies ChildWorkflowExecutionHistoryEvent; + + +export const startChildWorkflowEvent = { + eventId: "42", + eventTime: { + seconds: "1725769673", + nanos: 862443565 + }, + version: "575102", + taskId: "5877269784", + childWorkflowExecutionStartedEventAttributes: { + domain: "cadence-domain", + workflowExecution: { + workflowId: "workflow.cancellation-workflow.cancellation.external-child", + runId: "107495f0-ab19-4631-b6b9-dca2c2a30482" + }, + workflowType: { + name: "workflow.cancellation.external" + }, + initiatedEventId: "40", + header: { + fields: { + } + } + }, + attributes: "childWorkflowExecutionStartedEventAttributes" +} as const satisfies ChildWorkflowExecutionHistoryEvent; + +export const completeChildWorkflowEvent = { + eventId: "43", + eventTime: { + seconds: "1725769674", + nanos: 218146161 + }, + version: "575102", + taskId: "5877269785", + childWorkflowExecutionCompletedEventAttributes: { + domain: "cadence-domain", + workflowExecution: { + workflowId: "workflow.cancellation-workflow.cancellation.external-child", + runId: "107495f0-ab19-4631-b6b9-dca2c2a30482" + }, + workflowType: { + name: "workflow.cancellation.external" + }, + initiatedEventId: "9", + startedEventId: "41", + result: null + }, + attributes: "childWorkflowExecutionCompletedEventAttributes" +} as const satisfies ChildWorkflowExecutionHistoryEvent; + +export const cancelChildWorkflowEvent = { + eventId: "44", + eventTime: { + seconds: "1725769675", + nanos: 993971123 + }, + version: "575102", + taskId: "5877269786", + childWorkflowExecutionCanceledEventAttributes: { + domain: "cadence-domain", + workflowExecution: { + workflowId: "workflow.cancellation-workflow.cancellation.external-child", + runId: "107495f0-ab19-4631-b6b9-dca2c2a30482" + }, + workflowType: { + name: "workflow.cancellation.external" + }, + initiatedEventId: "40", + startedEventId: "42", + details: { + data: "Y2FuY2VsZWQgYmVmb3JlIHN0YXJ0aW5nIG90aGVyIHdvcmtmbG93OiBDYW5jZWxlZEVycm9y" + } + }, + attributes: "childWorkflowExecutionCanceledEventAttributes" +} as const satisfies ChildWorkflowExecutionHistoryEvent; + + +export const terminateChildWorkflowEvent = { + eventId: "45", + eventTime: { + seconds: "1725769676", + nanos: 993971123 + }, + version: "575102", + taskId: "5877269787", + childWorkflowExecutionTerminatedEventAttributes: { + domain: "cadence-domain", + workflowExecution: { + workflowId: "workflow.cancellation-workflow.cancellation.external-child", + runId: "107495f0-ab19-4631-b6b9-dca2c2a30482" + }, + workflowType: { + name: "workflow.cancellation.external" + }, + initiatedEventId: "40", + startedEventId: "42", + }, + attributes: "childWorkflowExecutionTerminatedEventAttributes" +} as const satisfies ChildWorkflowExecutionHistoryEvent; + + +export const timeoutChildWorkflowEvent = { + eventId: "46", + eventTime: { + seconds: "1725769677", + nanos: 993971123 + }, + version: "575102", + taskId: "5877269788", + childWorkflowExecutionTimedOutEventAttributes: { + domain: "cadence-domain", + workflowExecution: { + workflowId: "workflow.cancellation-workflow.cancellation.external-child", + runId: "107495f0-ab19-4631-b6b9-dca2c2a30482" + }, + workflowType: { + name: "workflow.cancellation.external" + }, + initiatedEventId: "40", + startedEventId: "42", + timeoutType: 'TIMEOUT_TYPE_HEARTBEAT', + + }, + attributes: "childWorkflowExecutionTimedOutEventAttributes" +} as const satisfies ChildWorkflowExecutionHistoryEvent; + + +export const failChildWorkflowEvent = { + eventId: "47", + eventTime: { + seconds: "1725769678", + nanos: 993971123 + }, + version: "575102", + taskId: "5877269789", + childWorkflowExecutionFailedEventAttributes: { + domain: "cadence-domain", + workflowExecution: { + workflowId: "workflow.cancellation-workflow.cancellation.external-child", + runId: "107495f0-ab19-4631-b6b9-dca2c2a30482" + }, + workflowType: { + name: "workflow.cancellation.external" + }, + initiatedEventId: "40", + startedEventId: "42", + failure: { + details: '', + reason: '' + } + }, + attributes: "childWorkflowExecutionFailedEventAttributes" +} as const satisfies ChildWorkflowExecutionHistoryEvent; + + +export const completedChildeWorkflowEvents: ChildWorkflowExecutionHistoryEvent[] = [ + initiateChildWorkflowEvent, + startChildWorkflowEvent, + completeChildWorkflowEvent, +] + + +export const failedChildeWorkflowEvents: ChildWorkflowExecutionHistoryEvent[] = [ + initiateChildWorkflowEvent, + startChildWorkflowEvent, + failChildWorkflowEvent, + +] + +export const timedoutChildeWorkflowEvents: ChildWorkflowExecutionHistoryEvent[] = [ + initiateChildWorkflowEvent, + startChildWorkflowEvent, + timeoutChildWorkflowEvent, +] + +export const terminatedChildeWorkflowEvents: ChildWorkflowExecutionHistoryEvent[] = [ + initiateChildWorkflowEvent, + startChildWorkflowEvent, + terminateChildWorkflowEvent, +] + +export const canceledChildWorkflowEvents: ChildWorkflowExecutionHistoryEvent[] = [ + initiateChildWorkflowEvent, + startChildWorkflowEvent, + cancelChildWorkflowEvent, +] + + +export const initationFailedChildeWorkflowEvents: ChildWorkflowExecutionHistoryEvent[] = [ + initiateChildWorkflowEvent, + initiateFailureChildWorkflowEvent, +] \ No newline at end of file diff --git a/src/views/workflow-history/__fixtures__/workflow-history-decision-events.ts b/src/views/workflow-history/__fixtures__/workflow-history-decision-events.ts index f8a07c5b..9c6e62b5 100644 --- a/src/views/workflow-history/__fixtures__/workflow-history-decision-events.ts +++ b/src/views/workflow-history/__fixtures__/workflow-history-decision-events.ts @@ -56,8 +56,71 @@ export const completeDecisionTaskEvent = { attributes: 'decisionTaskCompletedEventAttributes', } as const satisfies DecisionHistoryEvent; + +export const failedDecisionTaskEvent = { + eventId:'5', + eventTime: { + seconds: '1725747370', + nanos: 599272953, + }, + attributes:'decisionTaskFailedEventAttributes', + version: '575102', + taskId: '22647174902', + decisionTaskFailedEventAttributes: { + scheduledEventId: '2', + startedEventId: '3', + cause: 'DECISION_TASK_FAILED_CAUSE_BAD_START_CHILD_EXECUTION_ATTRIBUTES', + failure: { + reason: '', + details:'WorkflowId exceeds length limit.', + }, + identity: '1@dca50-hrk@cadence-canary-production@canary-task-queue@bd570bec-e2cf-470f-937b-0e71d3d8a6d8', + baseRunId: '', + newRunId: '', + forkEventVersion: '0', + binaryChecksum: 'uDeploy:ffc875a4c3571872881f79c939921e00398ab260', + requestId: '66f7f58b-3d3b-4178-972a-fa7825ceec39', + } +}as const satisfies DecisionHistoryEvent; + +export const timeoutDecisionTaskEvent = { + eventId:'6', + eventTime: { + seconds: '1725747370', + nanos: 599273063, + }, + attributes:'decisionTaskTimedOutEventAttributes', + version: '575102', + taskId: '22647174903', + decisionTaskTimedOutEventAttributes: { + scheduledEventId: '2', + startedEventId: '3', + cause: 'DECISION_TASK_TIMED_OUT_CAUSE_TIMEOUT', + timeoutType:'TIMEOUT_TYPE_HEARTBEAT', + reason:'Missed heart beat', + baseRunId: '', + newRunId: '', + forkEventVersion: '0', + requestId: '66f7f58b-3d3b-4178-972a-fa7825ceec40', + } +}as const satisfies DecisionHistoryEvent; + + export const completedDecisionTaskEvents: DecisionHistoryEvent[] = [ scheduleDecisionTaskEvent, startDecisionTaskEvent, completeDecisionTaskEvent, ]; + +export const failedDecisionTaskEvents: DecisionHistoryEvent[] = [ + scheduleDecisionTaskEvent, + startDecisionTaskEvent, + failedDecisionTaskEvent, +]; + + +export const timedoutDecisionTaskEvents: DecisionHistoryEvent[] = [ + scheduleDecisionTaskEvent, + startDecisionTaskEvent, + timeoutDecisionTaskEvent, +]; diff --git a/src/views/workflow-history/__fixtures__/workflow-history-request-cancel-external-workflow-events.ts b/src/views/workflow-history/__fixtures__/workflow-history-request-cancel-external-workflow-events.ts new file mode 100644 index 00000000..8fb96e62 --- /dev/null +++ b/src/views/workflow-history/__fixtures__/workflow-history-request-cancel-external-workflow-events.ts @@ -0,0 +1,47 @@ +import type { RequestCancelExternalWorkflowExecutionHistoryEvent } from '../workflow-history.types'; + +export const initiateRequestCancelExternalWorkflowEvent = { + eventId: "25", + eventTime: { + seconds: "1725749470", + nanos: 886551263 + }, + version: "575102", + taskId: "5877269814", + requestCancelExternalWorkflowExecutionInitiatedEventAttributes: { + decisionTaskCompletedEventId: "24", + domain: "cadence-domain", + workflowExecution: { + workflowId: "workflow.cancellation-workflow.cancellation.external-child", + runId: "" + }, + control: "", + childWorkflowOnly: true + }, + attributes: "requestCancelExternalWorkflowExecutionInitiatedEventAttributes" +} as const satisfies RequestCancelExternalWorkflowExecutionHistoryEvent; + +export const requestCancelExternalWorkflowEvent = { + eventId: "26", + eventTime: { + seconds: "1725749570", + nanos: 927769344 + }, + version: "575102", + taskId: "5877269818", + externalWorkflowExecutionCancelRequestedEventAttributes: { + initiatedEventId: "25", + domain: "cadence-domain", + workflowExecution: { + workflowId: "workflow.cancellation-workflow.cancellation.external-child", + runId: "" + } + }, + attributes: "externalWorkflowExecutionCancelRequestedEventAttributes" +} as const satisfies RequestCancelExternalWorkflowExecutionHistoryEvent; + + +export const requestedCancelExternalWorkflowEvents: RequestCancelExternalWorkflowExecutionHistoryEvent[] = [ + initiateRequestCancelExternalWorkflowEvent, + requestCancelExternalWorkflowEvent, +]; diff --git a/src/views/workflow-history/__fixtures__/workflow-history-singal-external-workflow-events.ts b/src/views/workflow-history/__fixtures__/workflow-history-singal-external-workflow-events.ts new file mode 100644 index 00000000..29311b88 --- /dev/null +++ b/src/views/workflow-history/__fixtures__/workflow-history-singal-external-workflow-events.ts @@ -0,0 +1,83 @@ +import type { SignalExternalWorkflowExecutionHistoryEvent } from '../workflow-history.types'; + +export const initiateSignalExternalWorkflowEvent = { + eventId: "30", + eventTime: { + seconds: "1725769470", + nanos: 356394585 + }, + version: "575102", + taskId: "8090823668", + signalExternalWorkflowExecutionInitiatedEventAttributes: { + decisionTaskCompletedEventId: "4", + domain: "cadence-domain", + workflowExecution: { + workflowId: "workflow.reset.base-b3439f7e-1daa-4716-a42e-3a621631bad3", + runId: "" + }, + signalName: "signalBeforeReset", + input: { + data: "InNpZ25hbFZhbHVlIgo=" + }, + control: "MA==", + childWorkflowOnly: true + }, + attributes: "signalExternalWorkflowExecutionInitiatedEventAttributes" +} as const satisfies SignalExternalWorkflowExecutionHistoryEvent; + + + +export const signalExternalWorkflowEvent = { + eventId: "31", + eventTime: { + seconds: "1725769570", + nanos: 375790674 + }, + version: "575102", + taskId: "8090823672", + externalWorkflowExecutionSignaledEventAttributes: { + initiatedEventId: "30", + domain: "cadence-domain", + workflowExecution: { + workflowId: "workflow.reset.base-b3439f7e-1daa-4716-a42e-3a621631bad3", + runId: "" + }, + control: "MA==" + }, + attributes: "externalWorkflowExecutionSignaledEventAttributes" +} as const satisfies SignalExternalWorkflowExecutionHistoryEvent; + +export const failSignalExternalWorkflowEvent = { + eventId: "31", + eventTime: { + seconds: "1725769670", + nanos: 375790674 + }, + version: "575102", + taskId: "8090823672", + signalExternalWorkflowExecutionFailedEventAttributes: { + cause: 'SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_FAILED_CAUSE_INVALID', + decisionTaskCompletedEventId: "4", + initiatedEventId: '30', + domain: "cadence-domain", + workflowExecution: { + workflowId: "workflow.reset.base-b3439f7e-1daa-4716-a42e-3a621631bad3", + runId: "" + }, + control: "MA==" + }, + attributes: "signalExternalWorkflowExecutionFailedEventAttributes" +} as const satisfies SignalExternalWorkflowExecutionHistoryEvent; + + + +export const signaledExternalWorkflowEvents: SignalExternalWorkflowExecutionHistoryEvent[] = [ + initiateSignalExternalWorkflowEvent, + signalExternalWorkflowEvent, +]; + + +export const failedSignalExternalWorkflowEvents: SignalExternalWorkflowExecutionHistoryEvent[] = [ + initiateSignalExternalWorkflowEvent, + failSignalExternalWorkflowEvent, +]; \ No newline at end of file diff --git a/src/views/workflow-history/__fixtures__/workflow-history-single-events.ts b/src/views/workflow-history/__fixtures__/workflow-history-single-events.ts new file mode 100644 index 00000000..7da626f1 --- /dev/null +++ b/src/views/workflow-history/__fixtures__/workflow-history-single-events.ts @@ -0,0 +1,336 @@ +import type { SingleHistoryEvent } from '../workflow-history.types'; + + +//TODO: get more realistic time and workflow id/ run id references that relates to other events + +export const startWorkflowExecutionEvent = { + eventId: '1', + eventTime: { + seconds: '1724747315', + nanos: 549377718, + }, + version: '575102', + taskId: '22647173800', + workflowExecutionStartedEventAttributes: { + partitionConfig: { + }, + workflowType: { + name: 'workflow.cron', + }, + parentExecutionInfo: null, + taskList: { + name: 'cadence-tasklist', + kind: 'TASK_LIST_KIND_INVALID', + }, + input: { + data: 'InN0cmluZyB2YWx1ZSIsCiJ0b2tlbiIs', + }, + executionStartToCloseTimeout: { + seconds: '1080', + nanos: 0, + }, + taskStartToCloseTimeout: { + seconds: '10', + nanos: 0, + }, + continuedExecutionRunId: 'e8565005-a234-4077-a917-6e5992ccbe4a', + initiator: 'CONTINUE_AS_NEW_INITIATOR_CRON_SCHEDULE', + continuedFailure: null, + lastCompletionResult: null, + originalExecutionRunId: '9c42ffa3-c9b1-430d-a993-b84fdce8c9f2', + identity: '', + firstExecutionRunId: '1d0e29d3-9c20-4eda-aeca-daed7f0ccb2e', + retryPolicy: null, + attempt: 0, + expirationTime: null, + cronSchedule: '@every 1m', + firstDecisionTaskBackoff: { + seconds: '55', + nanos: 0, + }, + memo: null, + searchAttributes: null, + prevAutoResetPoints: { + points: [], + }, + header: { + fields: { + }, + }, + firstScheduledTime: { + seconds: '1716246362', + nanos: 895425298, + }, + requestId: '8b2d2b6f-996a-431e-96b3-17d19cf0e508', + }, + attributes: 'workflowExecutionStartedEventAttributes', +} as const satisfies SingleHistoryEvent; + + +export const signalWorkflowExecutionEvent = { + eventId: "2", + eventTime: { + seconds: '1724747415', + nanos: 549377718, + }, + version: '575102', + taskId: '22647173801', + workflowExecutionSignaledEventAttributes: { + signalName: "signal-name", + input: { + data: "ImNhZGVuY2Uuc2lnbmFsIg==" + }, + identity: "cadence-service", + requestId: "488cd24f-37b0-48f7-955a-c5c8c7653290" + }, + attributes: "workflowExecutionSignaledEventAttributes" +} as const satisfies SingleHistoryEvent; + +export const recordMarkerExecutionEvent = { + eventId: '3', + eventTime: { + seconds: '1724747515', + nanos: 549377718, + }, + version: '575102', + taskId: '22647173802', + markerRecordedEventAttributes: { + markerName: 'Version', + details: { + data: 'ImluaXRpYWwgdmVyc2lvbiIKMwo=', + }, + decisionTaskCompletedEventId: '4', + header: null, + }, + attributes: 'markerRecordedEventAttributes', +} as const satisfies SingleHistoryEvent; + + +export const failWorkflowExecutionEvent = { + eventId: "48", + eventTime: { + seconds: '1726747515', + nanos: 549377718, + }, + version: '575102', + taskId: '22647173803', + workflowExecutionFailedEventAttributes: { + failure: { + reason: "cadenceInternal:Generic", + details: "bmV3IGV4ZWN1dGlvbiB0cmlnZ2VyZWQgYnkgcmVzZXQgaXMgbm90IGNvbXBsZXRlZA==" + }, + decisionTaskCompletedEventId: "4" + }, + attributes: "workflowExecutionFailedEventAttributes" +} as const satisfies SingleHistoryEvent; + + + +export const terminateWorkflowExecutionEvent = { + eventId: "49", + eventTime: { + seconds: '1726747615', + nanos: 549377718, + }, + version: "587402", + taskId: "6051339957", + workflowExecutionTerminatedEventAttributes: { + reason: "reset domain", + details: null, + identity: "history-service" + }, + attributes: "workflowExecutionTerminatedEventAttributes" +} as const satisfies SingleHistoryEvent; + + + +export const timeoutWorkflowExecutionEvent = { + eventId: "50", + eventTime: { + seconds: '1726747715', + nanos: 549377718, + }, + version: "587402", + taskId: "6051339957", + workflowExecutionTimedOutEventAttributes: { + timeoutType: "TIMEOUT_TYPE_START_TO_CLOSE" + }, + attributes: "workflowExecutionTimedOutEventAttributes" +} as const satisfies SingleHistoryEvent; + + + +export const completeWorkflowExecutionEvent = { + eventId: "51", + eventTime: { + seconds: '1726747715', + nanos: 549377718, + }, + version: "587402", + taskId: "605133998", + workflowExecutionCompletedEventAttributes: { + result: null, + decisionTaskCompletedEventId: "4" + }, + attributes: "workflowExecutionCompletedEventAttributes" +} as const satisfies SingleHistoryEvent; + +export const cancelRequestActivityTaskEvent = { + eventId: '52', + eventTime: { + seconds: '1726747715', + nanos: 549377718, + }, + version: "587402", + taskId: "605133998", + activityTaskCancelRequestedEventAttributes: { + activityId: '0', + decisionTaskCompletedEventId: '4', + }, + attributes: 'activityTaskCancelRequestedEventAttributes', +} as const satisfies SingleHistoryEvent; + + +export const failCancelTimerEvent = { + eventId: "53", + eventTime: { + seconds: "1725748670", + nanos: 860748144 + }, + version: "587402", + taskId: "12690929028", + cancelTimerFailedEventAttributes: { + cause: '', + timerId: "0", + decisionTaskCompletedEventId: "9", + identity: "67b17b8c-fc30-4c5c-ac7e-bc3046311b18" + }, + attributes: "cancelTimerFailedEventAttributes" +} as const satisfies SingleHistoryEvent; + +export const failCancelRequestActivityTaskEvent = { + eventId: '54', + eventTime: { + seconds: '1725747370', + nanos: 599547391, + }, + version: '587402', + taskId: '22647174807', + requestCancelActivityTaskFailedEventAttributes: { + activityId: "0", + decisionTaskCompletedEventId: '4', + cause: '', + }, + attributes: 'requestCancelActivityTaskFailedEventAttributes', +} as const satisfies SingleHistoryEvent; + + +export const continueAsNewWorkflowExecutionEvent = { + eventId: '55', + eventTime: { + seconds: '1725747375', + nanos: 636983242, + }, + version: '587402', + taskId: '22647174866', + workflowExecutionContinuedAsNewEventAttributes: { + newExecutionRunId: '8f27807a-9125-4833-b8f1-d52a4c59be9a', + workflowType: { + name: 'workflow.cron', + }, + taskList: { + name: 'cadence-task-queue', + kind: 'TASK_LIST_KIND_INVALID', + }, + input: { + data: 'InN0cmluZyB2YWx1ZSIsCiJ0b2tlbiIs', + }, + executionStartToCloseTimeout: { + seconds: '1080', + nanos: 0, + }, + taskStartToCloseTimeout: { + seconds: '10', + nanos: 0, + }, + decisionTaskCompletedEventId: '17', + backoffStartInterval: { + seconds: '55', + nanos: 0, + }, + initiator: 'CONTINUE_AS_NEW_INITIATOR_CRON_SCHEDULE', + failure: null, + lastCompletionResult: null, + header: { + fields: { + }, + }, + memo: null, + searchAttributes: null, + }, + attributes: 'workflowExecutionContinuedAsNewEventAttributes', +} as const satisfies SingleHistoryEvent; + +// TODO: Fill with realistic data +export const requestCancelWorkflowExecutionEvent = { + eventId: "56", + eventTime: { + seconds: "1726046172", + nanos: 860760687 + }, + version: "580100", + taskId: "12690929027", + workflowExecutionCancelRequestedEventAttributes: { + cause: '', + identity: '', + requestId: '', + externalExecutionInfo: { + initiatedId: "", + workflowExecution: { + runId: "", + workflowId: "" + } + } + }, + attributes: "workflowExecutionCancelRequestedEventAttributes" +} as const satisfies SingleHistoryEvent; +export const cancelWorkflowExecutionEvent = { + eventId: "57", + eventTime: { + seconds: "1726046172", + nanos: 860760687 + }, + version: "580100", + taskId: "12690929027", + workflowExecutionCanceledEventAttributes: { + decisionTaskCompletedEventId: "9", + details: { + data: "d29ya2Zsb3cgc2xlZXA6IENhbmNlbGVkRXJyb3I=" + } + }, + attributes: "workflowExecutionCanceledEventAttributes" +} as const satisfies SingleHistoryEvent; + + + + +export const upsertWorkflowSearchAttributesEvent = { + eventId: "58", + eventTime: { + seconds: "1726556443", + nanos: 322569089 + }, + version: "587402", + taskId: "6051339897", + upsertWorkflowSearchAttributesEventAttributes: { + decisionTaskCompletedEventId: "4", + searchAttributes: { + indexedFields: { + CadenceChangeVersion: { + data: "WyJpbml0aWFsIHZlcnNpb24tMyJd" + } + } + } + }, + attributes: "upsertWorkflowSearchAttributesEventAttributes" +} as const satisfies SingleHistoryEvent; \ No newline at end of file diff --git a/src/views/workflow-history/__fixtures__/workflow-history-timer-events.ts b/src/views/workflow-history/__fixtures__/workflow-history-timer-events.ts new file mode 100644 index 00000000..4ef05031 --- /dev/null +++ b/src/views/workflow-history/__fixtures__/workflow-history-timer-events.ts @@ -0,0 +1,63 @@ +import type { TimerHistoryEvent } from '../workflow-history.types'; + +export const startTimerTaskEvent = { + eventId:"16", + eventTime: { + seconds: '1725748370', + nanos: 632072806, + }, + version:"575102", + taskId:"12690929026", + timerStartedEventAttributes:{ + timerId:"0", + startToFireTimeout:{ + seconds:"5", + nanos:0 + }, + decisionTaskCompletedEventId:"4" + }, + attributes:"timerStartedEventAttributes" + + } as const satisfies TimerHistoryEvent; + +export const fireTimerTaskEvent = { + eventId:"17", + eventTime:{ + seconds:"1725748470", + nanos:5167157 + }, + version:"575102", + taskId:"12690929027", + timerFiredEventAttributes:{ + timerId:"0", + startedEventId:"10" + }, + attributes:"timerFiredEventAttributes" + } as const satisfies TimerHistoryEvent; + +export const cancelTimerTaskEvent = { + eventId:"18", + eventTime:{ + seconds:"1725748670", + nanos:860748144 + }, + version:"575102", + taskId:"12690929028", + timerCanceledEventAttributes:{ + timerId:"0", + startedEventId:"5", + decisionTaskCompletedEventId:"9", + identity:"67b17b8c-fc30-4c5c-ac7e-bc3046311b18" + }, + attributes:"timerCanceledEventAttributes" + }as const satisfies TimerHistoryEvent; + +export const cancelTimerTaskEvents: TimerHistoryEvent[] = [ + startTimerTaskEvent, + cancelTimerTaskEvent, +]; + +export const firedActivityTaskEvents: TimerHistoryEvent[] = [ + startTimerTaskEvent, + fireTimerTaskEvent, +]; \ No newline at end of file