/
action-run.res.ts
53 lines (43 loc) · 1.44 KB
/
action-run.res.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import { Action } from './action';
export type ActionRunTrigger = Action['trigger']['type'] | 'sentinel' | 'manual' | 'manual-api';
export type ActionRunStatus = ActionRunResponse['status'];
export type ActionErrorType = 'TIMEOUT' | 'INSUFFICIENT_FUNDS' | 'RELAYER_CONFIGURATION' | 'INTERNAL' | 'PROGRAM';
export interface ActionRunBase {
actionRunId: string;
actionId: string;
trigger: ActionRunTrigger;
status: string;
createdAt: string;
errorType?: ActionErrorType;
}
export interface ActionRunPendingData {
status: 'pending';
}
export interface ActionRunThrottledData {
status: 'throttled';
}
export interface ActionRunErrorData {
status: 'error';
message: string;
decodedLogs?: string; // External API always returns decoded logs
requestId?: string;
errorType?: ActionErrorType;
}
export interface ActionRunSuccessData {
status: 'success';
decodedLogs?: string; // External API always returns decoded logs
result: string;
requestId: string;
}
export type ActionRunListResponse = {
items: ActionRunBase[];
next: string;
};
export type ActionRunListItemResponse = ActionRunBase;
export type ActionRunResponse = ActionRunBase &
(ActionRunPendingData | ActionRunErrorData | ActionRunSuccessData | ActionRunThrottledData);
export type ActionRunFinishedResponse = ActionRunBase & (ActionRunErrorData | ActionRunSuccessData);
export type ActionRunListParams = {
next?: string;
status?: ActionRunStatus | undefined;
};