@aikirun/types 0.15.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/schedule-api.d.ts +14 -9
- package/dist/schedule.d.ts +9 -5
- package/dist/workflow-run.d.ts +3 -2
- package/dist/workflow-run.js +3 -3
- package/package.json +1 -1
package/dist/schedule-api.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { ScheduleSpec, Schedule, ScheduleStatus } from './schedule.js';
|
|
1
|
+
import { ScheduleSpec, ScheduleActivateOptions, Schedule, ScheduleStatus } from './schedule.js';
|
|
2
2
|
|
|
3
3
|
interface ScheduleApi {
|
|
4
4
|
activateV1: (_: ScheduleActivateRequestV1) => Promise<ScheduleActivateResponseV1>;
|
|
5
5
|
getByIdV1: (_: ScheduleGetByIdRequestV1) => Promise<ScheduleGetByIdResponseV1>;
|
|
6
|
-
|
|
6
|
+
getByReferenceIdV1: (_: ScheduleGetByReferenceIdRequestV1) => Promise<ScheduleGetByReferenceIdResponseV1>;
|
|
7
7
|
listV1: (_: ScheduleListRequestV1) => Promise<ScheduleListResponseV1>;
|
|
8
8
|
pauseV1: (_: SchedulePauseRequestV1) => Promise<SchedulePauseResponseV1>;
|
|
9
9
|
resumeV1: (_: ScheduleResumeRequestV1) => Promise<ScheduleResumeResponseV1>;
|
|
10
10
|
deleteV1: (_: ScheduleDeleteRequestV1) => Promise<void>;
|
|
11
11
|
}
|
|
12
12
|
interface ScheduleActivateRequestV1 {
|
|
13
|
-
name: string;
|
|
14
13
|
workflowName: string;
|
|
15
14
|
workflowVersionId: string;
|
|
16
15
|
input?: unknown;
|
|
17
16
|
spec: ScheduleSpec;
|
|
17
|
+
options?: ScheduleActivateOptions;
|
|
18
18
|
}
|
|
19
19
|
interface ScheduleActivateResponseV1 {
|
|
20
20
|
schedule: Schedule;
|
|
@@ -25,19 +25,24 @@ interface ScheduleGetByIdRequestV1 {
|
|
|
25
25
|
interface ScheduleGetByIdResponseV1 {
|
|
26
26
|
schedule: Schedule;
|
|
27
27
|
}
|
|
28
|
-
interface
|
|
29
|
-
|
|
30
|
-
workflowName: string;
|
|
31
|
-
workflowVersionId: string;
|
|
28
|
+
interface ScheduleGetByReferenceIdRequestV1 {
|
|
29
|
+
referenceId: string;
|
|
32
30
|
}
|
|
33
|
-
interface
|
|
31
|
+
interface ScheduleGetByReferenceIdResponseV1 {
|
|
34
32
|
schedule: Schedule;
|
|
35
33
|
}
|
|
34
|
+
interface ScheduleWorkflowFilter {
|
|
35
|
+
name?: string;
|
|
36
|
+
versionId?: string;
|
|
37
|
+
}
|
|
36
38
|
interface ScheduleListRequestV1 {
|
|
37
39
|
limit?: number;
|
|
38
40
|
offset?: number;
|
|
39
41
|
filters?: {
|
|
40
42
|
status?: ScheduleStatus[];
|
|
43
|
+
id?: string;
|
|
44
|
+
referenceId?: string;
|
|
45
|
+
workflows?: ScheduleWorkflowFilter[];
|
|
41
46
|
};
|
|
42
47
|
}
|
|
43
48
|
interface ScheduleListResponseV1 {
|
|
@@ -60,4 +65,4 @@ interface ScheduleDeleteRequestV1 {
|
|
|
60
65
|
id: string;
|
|
61
66
|
}
|
|
62
67
|
|
|
63
|
-
export type { ScheduleActivateRequestV1, ScheduleActivateResponseV1, ScheduleApi, ScheduleDeleteRequestV1, ScheduleGetByIdRequestV1, ScheduleGetByIdResponseV1,
|
|
68
|
+
export type { ScheduleActivateRequestV1, ScheduleActivateResponseV1, ScheduleApi, ScheduleDeleteRequestV1, ScheduleGetByIdRequestV1, ScheduleGetByIdResponseV1, ScheduleGetByReferenceIdRequestV1, ScheduleGetByReferenceIdResponseV1, ScheduleListRequestV1, ScheduleListResponseV1, SchedulePauseRequestV1, SchedulePauseResponseV1, ScheduleResumeRequestV1, ScheduleResumeResponseV1, ScheduleWorkflowFilter };
|
package/dist/schedule.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
type ScheduleId = string & {
|
|
2
2
|
_brand: "schedule_id";
|
|
3
3
|
};
|
|
4
|
-
type ScheduleName = string & {
|
|
5
|
-
_brand: "schedule_name";
|
|
6
|
-
};
|
|
7
4
|
type OverlapPolicy = "allow" | "skip" | "cancel_previous";
|
|
5
|
+
interface ScheduleReferenceOptions {
|
|
6
|
+
id: string;
|
|
7
|
+
conflictPolicy?: "upsert" | "error";
|
|
8
|
+
}
|
|
9
|
+
interface ScheduleActivateOptions {
|
|
10
|
+
reference?: ScheduleReferenceOptions;
|
|
11
|
+
}
|
|
8
12
|
interface CronScheduleSpec {
|
|
9
13
|
type: "cron";
|
|
10
14
|
expression: string;
|
|
@@ -20,12 +24,12 @@ type ScheduleSpec = CronScheduleSpec | IntervalScheduleSpec;
|
|
|
20
24
|
type ScheduleStatus = "active" | "paused" | "deleted";
|
|
21
25
|
interface Schedule {
|
|
22
26
|
id: string;
|
|
23
|
-
name: string;
|
|
24
27
|
workflowName: string;
|
|
25
28
|
workflowVersionId: string;
|
|
26
29
|
input?: unknown;
|
|
27
30
|
spec: ScheduleSpec;
|
|
28
31
|
status: ScheduleStatus;
|
|
32
|
+
options?: ScheduleActivateOptions;
|
|
29
33
|
createdAt: number;
|
|
30
34
|
updatedAt: number;
|
|
31
35
|
lastOccurrence?: number;
|
|
@@ -33,4 +37,4 @@ interface Schedule {
|
|
|
33
37
|
runCount: number;
|
|
34
38
|
}
|
|
35
39
|
|
|
36
|
-
export type { CronScheduleSpec, IntervalScheduleSpec, OverlapPolicy, Schedule, ScheduleId,
|
|
40
|
+
export type { CronScheduleSpec, IntervalScheduleSpec, OverlapPolicy, Schedule, ScheduleActivateOptions, ScheduleId, ScheduleReferenceOptions, ScheduleSpec, ScheduleStatus };
|
package/dist/workflow-run.d.ts
CHANGED
|
@@ -143,6 +143,7 @@ interface WorkflowRun<Input = unknown, Output = unknown> {
|
|
|
143
143
|
createdAt: number;
|
|
144
144
|
revision: number;
|
|
145
145
|
input?: Input;
|
|
146
|
+
inputHash: string;
|
|
146
147
|
address: string;
|
|
147
148
|
options: WorkflowStartOptions;
|
|
148
149
|
attempts: number;
|
|
@@ -200,9 +201,9 @@ declare class WorkflowRunFailedError extends Error {
|
|
|
200
201
|
readonly reason?: string;
|
|
201
202
|
constructor(id: WorkflowRunId, attempts: number, reason?: string);
|
|
202
203
|
}
|
|
203
|
-
declare class
|
|
204
|
+
declare class WorkflowRunRevisionConflictError extends Error {
|
|
204
205
|
readonly id: WorkflowRunId;
|
|
205
206
|
constructor(id: WorkflowRunId);
|
|
206
207
|
}
|
|
207
208
|
|
|
208
|
-
export { type ChildWorkflowRunInfo, type ChildWorkflowWaitResult, type ChildWorkflowWaitResultCompleted, type ChildWorkflowWaitResultTimeout, type NonTerminalWorkflowRunStatus, type TerminalWorkflowRunStatus, type WorkflowDefinitionOptions, type WorkflowFailureCause, type WorkflowReferenceOptions, type WorkflowRun, type WorkflowRunAddress,
|
|
209
|
+
export { type ChildWorkflowRunInfo, type ChildWorkflowWaitResult, type ChildWorkflowWaitResultCompleted, type ChildWorkflowWaitResultTimeout, type NonTerminalWorkflowRunStatus, type TerminalWorkflowRunStatus, type WorkflowDefinitionOptions, type WorkflowFailureCause, type WorkflowReferenceOptions, type WorkflowRun, type WorkflowRunAddress, WorkflowRunFailedError, type WorkflowRunId, WorkflowRunNotExecutableError, WorkflowRunRevisionConflictError, type WorkflowRunScheduledReason, type WorkflowRunState, type WorkflowRunStateAwaitingChildWorkflow, type WorkflowRunStateAwaitingEvent, type WorkflowRunStateAwaitingRetry, type WorkflowRunStateAwaitingRetryBase, type WorkflowRunStateAwaitingRetryCausedByChildWorkflow, type WorkflowRunStateAwaitingRetryCausedBySelf, type WorkflowRunStateAwaitingRetryCausedByTask, type WorkflowRunStateCancelled, type WorkflowRunStateCompleted, type WorkflowRunStateFailed, type WorkflowRunStateFailedByChildWorkflow, type WorkflowRunStateFailedBySelf, type WorkflowRunStateFailedByTask, type WorkflowRunStateInComplete, type WorkflowRunStatePaused, type WorkflowRunStateQueued, type WorkflowRunStateRunning, type WorkflowRunStateScheduled, type WorkflowRunStateScheduledBase, type WorkflowRunStateScheduledByAwake, type WorkflowRunStateScheduledByAwakeEarly, type WorkflowRunStateScheduledByChildWorkflow, type WorkflowRunStateScheduledByEvent, type WorkflowRunStateScheduledByNew, type WorkflowRunStateScheduledByResume, type WorkflowRunStateScheduledByRetry, type WorkflowRunStateScheduledByTaskRetry, type WorkflowRunStateSleeping, type WorkflowRunStateTransition, type WorkflowRunStatus, WorkflowRunSuspendedError, type WorkflowRunTaskStateTransition, type WorkflowRunTransition, type WorkflowRunTransitionBase, type WorkflowStartOptions, isTerminalWorkflowRunStatus };
|
package/dist/workflow-run.js
CHANGED
|
@@ -39,18 +39,18 @@ var WorkflowRunFailedError = class extends Error {
|
|
|
39
39
|
this.reason = reason;
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
|
-
var
|
|
42
|
+
var WorkflowRunRevisionConflictError = class extends Error {
|
|
43
43
|
id;
|
|
44
44
|
constructor(id) {
|
|
45
45
|
super(`Conflict while trying to update Workflow run ${id}`);
|
|
46
|
-
this.name = "
|
|
46
|
+
this.name = "WorkflowRunRevisionConflictError";
|
|
47
47
|
this.id = id;
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
50
|
export {
|
|
51
|
-
WorkflowRunConflictError,
|
|
52
51
|
WorkflowRunFailedError,
|
|
53
52
|
WorkflowRunNotExecutableError,
|
|
53
|
+
WorkflowRunRevisionConflictError,
|
|
54
54
|
WorkflowRunSuspendedError,
|
|
55
55
|
isTerminalWorkflowRunStatus
|
|
56
56
|
};
|