-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add task and workflow utility types (#34)
feat(typescript): add task and workflow utility types
- Loading branch information
Showing
5 changed files
with
75 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export type SystemSendMessageParams = { | ||
phone: string; | ||
message: string; | ||
}; | ||
|
||
export type SystemSendMessageResult = { | ||
status: string; | ||
}; | ||
|
||
export type SystemSendMessage = { | ||
params?: SystemSendMessageParams; | ||
result?: SystemSendMessageResult; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { SystemSendMessage } from "./SystemSendMessage"; | ||
|
||
type WaitTaskDuration = { | ||
duration: { | ||
hours: number; | ||
minutes: number; | ||
seconds: number; | ||
}; | ||
until?: never; | ||
}; | ||
|
||
type WaitTaskUntil = { | ||
duration?: never; | ||
until: string; | ||
}; | ||
|
||
export type TaskDefinitionsMap = { | ||
"awf.task/wait": { | ||
params: WaitTaskDuration | WaitTaskUntil; | ||
result: Record<string, unknown>; | ||
}; | ||
"system/SendMessage": SystemSendMessage; | ||
}; | ||
|
||
export declare const TaskDefinitionsNameMap: Record< | ||
keyof TaskDefinitionsMap, | ||
string | ||
>; |
17 changes: 17 additions & 0 deletions
17
resources/sdk/typescript/types/workflow/SystemCheckOutWorkflow.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
export type SystemCheckOutWorkflowParams = { | ||
clientId: string; | ||
}; | ||
|
||
export type SystemCheckOutWorkflowResult = { | ||
messageId?: string; | ||
}; | ||
|
||
export type SystemCheckOutWorkflowError = { | ||
message?: string; | ||
}; | ||
|
||
export type SystemCheckOutWorkflow = { | ||
params?: SystemCheckOutWorkflowParams; | ||
result?: SystemCheckOutWorkflowResult; | ||
error?: SystemCheckOutWorkflowError; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { SystemCheckOutWorkflow } from "./SystemCheckOutWorkflow"; | ||
|
||
export type WorkflowDefinitionsMap = { | ||
"system/CheckOutWorkflow": SystemCheckOutWorkflow; | ||
}; | ||
|
||
export declare const WorkflowDefinitionsNameMap: Record< | ||
keyof WorkflowDefinitionsMap, | ||
string | ||
>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters