Co-authored-by: hello@lv <2256334253@qq.com> Co-authored-by: wjh <wwwjh0710@163.com> Co-authored-by: sealday <sealday@gmail.com> Reviewed-on: daoyoucloud/tachybase#719
68 lines
1.1 KiB
TypeScript
68 lines
1.1 KiB
TypeScript
import { lodash } from '@tachybase/utils';
|
|
|
|
export default {
|
|
echo: {
|
|
run({ config = {} }: any, { result }, processor) {
|
|
return {
|
|
status: 1,
|
|
result: config.path == null ? result : lodash.get(result, config.path),
|
|
};
|
|
},
|
|
},
|
|
|
|
error: {
|
|
run(node, input, processor) {
|
|
throw new Error('definite error');
|
|
},
|
|
},
|
|
|
|
pending: {
|
|
run(node, input, processor) {
|
|
return {
|
|
status: 0,
|
|
};
|
|
},
|
|
},
|
|
|
|
prompt: {
|
|
run(node, input, processor) {
|
|
return {
|
|
status: 0,
|
|
};
|
|
},
|
|
resume(node, job, processor) {
|
|
return job.set({
|
|
status: 1,
|
|
});
|
|
},
|
|
},
|
|
|
|
'prompt->error': {
|
|
run(node, input, processor) {
|
|
return {
|
|
status: 0,
|
|
};
|
|
},
|
|
resume(node, input, processor) {
|
|
throw new Error('input failed');
|
|
return null;
|
|
},
|
|
},
|
|
|
|
customizedSuccess: {
|
|
run(node, input, processor) {
|
|
return {
|
|
status: 100,
|
|
};
|
|
},
|
|
},
|
|
|
|
customizedError: {
|
|
run(node, input, processor) {
|
|
return {
|
|
status: -100,
|
|
};
|
|
},
|
|
},
|
|
};
|