File tree Expand file tree Collapse file tree 3 files changed +54
-0
lines changed Expand file tree Collapse file tree 3 files changed +54
-0
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,14 @@ describe('Account', () => {
45
45
createResult = res ;
46
46
} ) ;
47
47
48
+ test ( 'get' , async ( ) => {
49
+ const res = await client . get ( createResult . resourceId ) ;
50
+
51
+ expect ( res . FlowServiceName ) . toBe ( options . name ) ;
52
+ expect ( res . Type ) . toBe ( 'STANDARD' ) ;
53
+ expect ( res . Definition ) . toBe ( options . definition ) ;
54
+ } ) ;
55
+
48
56
test ( 'update' , async ( ) => {
49
57
options . resourceId = createResult . resourceId ;
50
58
options . role = createResult . roleName ;
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import {
12
12
ExecuteApiOptions ,
13
13
ExecuteResult ,
14
14
ExecuteState ,
15
+ FlowDetail ,
15
16
} from './interface' ;
16
17
import APIS , { ActionType } from './apis' ;
17
18
import { pascalCaseProps , randomId } from '../../utils/index' ;
@@ -42,6 +43,24 @@ export default class Asw {
42
43
this . cam = new Cam ( credentials ) ;
43
44
}
44
45
46
+ /**
47
+ * 获取执行状态
48
+ * @param executeName 执行名称
49
+ * @returns 执行状态
50
+ */
51
+ async get ( resourceId : string ) : Promise < FlowDetail | null > {
52
+ try {
53
+ const res = await this . request ( {
54
+ Action : 'DescribeFlowServiceDetail' ,
55
+ FlowServiceResource : resourceId ,
56
+ } ) ;
57
+
58
+ return res as FlowDetail ;
59
+ } catch ( e ) {
60
+ return null ;
61
+ }
62
+ }
63
+
45
64
/**
46
65
* 创建工作流
47
66
* @param {CreateOptions } options 创建参数
Original file line number Diff line number Diff line change @@ -117,3 +117,30 @@ export interface ExecuteState {
117
117
// 请求 ID
118
118
RequestId : string ;
119
119
}
120
+
121
+ export interface FlowDetail {
122
+ // 状态机所属服务名
123
+ FlowServiceName : string ;
124
+ // 状态机状态
125
+ Status : string ;
126
+ // 定义文本(JSON格式)
127
+ Definition : string ;
128
+ // 角色资源名
129
+ RoleResource : string ;
130
+ // 状态机的类型,可以为 (EXPRESS/STANDARD)
131
+ Type : string ;
132
+ // 生成时间
133
+ CreateDate : string ;
134
+ // 备注
135
+ Description : string ;
136
+ // 状态机所属服务中文名
137
+ FlowServiceChineseName : string ;
138
+ // Boolean 是否开启日志CLS服务
139
+ EnableCLS : boolean ;
140
+ // CLS日志查看地址
141
+ CLSUrl : string ;
142
+ // 工作流提示输入
143
+ FlowInput : string ;
144
+ // 请求 ID
145
+ RequestId : string ;
146
+ }
You can’t perform that action at this time.
0 commit comments