gtsoft-snail-job-admin/src/typings/api.d.ts

1343 lines
34 KiB
TypeScript
Raw Normal View History

2024-03-08 17:59:45 +08:00
/**
* Namespace Api
*
* All backend api type
*/
declare namespace Api {
2024-03-21 10:57:53 +08:00
namespace Common {
/** common params of paginating */
interface PaginatingCommonParams {
/** page size */
size: number;
/** total count */
total: number;
2024-03-30 17:07:04 +08:00
/** current page number */
page: number;
2024-03-21 10:57:53 +08:00
}
/** common params of paginating query list data */
2024-03-26 11:47:11 +08:00
interface PaginatingQueryRecord<T = any> extends PaginatingCommonParams {
2024-03-30 17:07:04 +08:00
data: T[];
status: number;
2024-03-21 10:57:53 +08:00
}
2024-03-30 17:07:04 +08:00
/** common page record */
type CommonPageRecord<T> = {
data: T[];
page: number;
size: number;
status: number;
total: number;
};
2024-08-30 16:34:49 +08:00
/** common search params of table */
type CommonSearchParams = Pick<Common.PaginatingCommonParams, 'page' | 'size'>;
2024-03-21 10:57:53 +08:00
/**
* enable status
*
* - "1": enabled
* - "2": disabled
*/
type EnableStatus = '1' | '2';
/**
* enable status
*
2024-04-20 22:36:09 +08:00
* - 0: enabled
* - 1: disabled
*/
2024-04-20 22:36:09 +08:00
type EnableStatusNumber = 0 | 1;
2024-04-17 23:48:25 +08:00
/**
* yes/no status
*
* - "0": no
* - "1": yes
*/
type YesOrNo = '0' | '1';
2024-03-21 10:57:53 +08:00
/** common record */
2024-03-26 11:47:11 +08:00
type CommonRecord<T = any> = {
2024-03-21 10:57:53 +08:00
/** record id */
2024-04-03 16:33:18 +08:00
id?: string;
2024-03-21 10:57:53 +08:00
/** record creator */
2024-03-30 17:07:04 +08:00
createBy?: string;
2024-03-21 10:57:53 +08:00
/** record create time */
2024-04-03 16:33:18 +08:00
createDt?: string;
2024-03-21 10:57:53 +08:00
/** record updater */
2024-03-30 17:07:04 +08:00
updateBy?: string;
2024-03-21 10:57:53 +08:00
/** record update time */
2024-04-03 16:33:18 +08:00
updateDt?: string;
2024-03-21 10:57:53 +08:00
/** record status */
2024-03-30 17:07:04 +08:00
status?: EnableStatus | null;
2024-03-21 10:57:53 +08:00
} & T;
/** 1: 一致性Hash 2: 随机 3: LRU 4: 轮询 5: 第一个 6: 最后一个 */
type RouteKey = 1 | 2 | 3 | 4 | 5 | 6;
/** 阻塞策略 1:丢弃 2:覆盖 3:并行 4:恢复 */
type BlockStrategy = 1 | 2 | 3 | 4;
/** 失败策略 1:跳过 2:阻塞 */
type FailStrategy = 1 | 2;
/** 判定逻辑 1:and 2:or */
type LogicalCondition = 1 | 2;
/** 表达式类型 1:SpEl 2:Aviator 3:QL */
type Expression = 1 | 2 | 3;
/** 请求类型 1:application/json 2:application/x-www-form-urlencoded */
type ContentType = 1 | 2;
/** 工作流节点状态 */
type WorkFlowNodeStatus = 0 | 1;
/** 执行器类型 1:Java 2:Python */
type ExecutorType = 1 | 2;
/** 触发类型 2:固定时间 3:CRON 表达式 99:工作流 */
type TriggerType = 2 | 3 | 99;
/** 任务类型 1:集群 2:广播 3:切片 4:Map 5:MapReduce */
type TaskType = 1 | 2 | 3 | 4 | 5;
/** 1、待处理 2、运行中 3、成功 4、失败 5、停止 6、取消 */
type TaskBatchStatus = 1 | 2 | 3 | 4 | 5 | 6 | 98 | 99;
/** 2、处理中 3、处理成功 4、处理失败、5、任务停止 6、取消 */
type TaskStatus = 2 | 3 | 4 | 5 | 6;
/**
* 1 2 3JOB已关闭 4 5 6 7 8 9 10 11 12
* 13 14
*/
type OperationReason = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14;
2024-03-21 10:57:53 +08:00
}
2024-03-08 17:59:45 +08:00
/**
2024-03-21 10:57:53 +08:00
* namespace Auth
2024-03-08 17:59:45 +08:00
*
2024-03-21 10:57:53 +08:00
* backend api module: "auth"
2024-03-08 17:59:45 +08:00
*/
namespace Auth {
interface LoginToken {
id: string;
mode: string;
role: string;
2024-03-08 17:59:45 +08:00
token: string;
refreshToken: string;
createDt: string;
updateDt: string;
namespaceIds: NamespaceId[];
2024-03-08 17:59:45 +08:00
}
type DeleteAlertType = 'job-task' | 'retry-scene' | 'workflow-task';
2024-03-08 17:59:45 +08:00
interface UserInfo {
id: string;
2024-03-26 11:47:11 +08:00
userId: string;
username: string;
2024-03-26 11:47:11 +08:00
userName: string;
mode: string;
2024-05-11 16:18:29 +08:00
role: number;
2024-03-26 11:47:11 +08:00
roles: string[];
buttons: string[];
namespaceIds: NamespaceId[];
deleteAlert: {
[key: string]: boolean;
};
}
interface NamespaceId {
id: string;
name: string;
uniqueId: string;
2024-03-08 17:59:45 +08:00
}
}
/**
2024-03-21 10:57:53 +08:00
* namespace Route
2024-03-08 17:59:45 +08:00
*
2024-03-21 10:57:53 +08:00
* backend api module: "route"
2024-03-08 17:59:45 +08:00
*/
namespace Route {
type ElegantConstRoute = import('@elegant-router/types').ElegantConstRoute;
interface MenuRoute extends ElegantConstRoute {
id: string;
}
interface UserRoute {
routes: MenuRoute[];
home: import('@elegant-router/types').LastLevelRouteKey;
}
}
2024-03-21 10:57:53 +08:00
2024-03-22 11:22:07 +08:00
/**
* namespace Dashboard
*
* backend api module: "dashboard"
*/
namespace Dashboard {
2024-03-30 17:07:04 +08:00
type CommonSearchParams = Pick<Common.PaginatingCommonParams, 'page' | 'size'>;
2024-03-28 16:22:18 +08:00
/** Task Retry Job */
2024-03-22 11:22:07 +08:00
type CardCount = {
jobTask: JobTask;
2024-04-13 01:23:58 +08:00
workFlowTask: JobTask;
2024-03-22 11:22:07 +08:00
retryTask: RetryTask;
retryTaskBarList: RetryTaskBarList[];
onLineService: OnlineService;
};
type OnlineService = {
total: number;
clientTotal: number;
serverTotal: number;
};
type RetryTaskBarList = {
2024-03-28 16:22:18 +08:00
x?: string;
taskTotal?: number;
2024-03-22 11:22:07 +08:00
};
type RetryTask = {
totalNum: number;
runningNum: number;
finishNum: number;
maxCountNum: number;
suspendNum: number;
};
type JobTask = {
successNum: number;
failNum: number;
cancelNum: number;
stopNum: number;
totalNum: number;
successRate: number;
};
2024-03-28 16:22:18 +08:00
/** Dashboard Line */
type DashboardLine = {
taskList: TaskList;
rankList: RankList[];
2024-05-23 00:53:06 +08:00
dashboardLineResponseDOList: DashboardLineResponseDO[];
2024-03-28 16:22:18 +08:00
};
2024-05-23 00:53:06 +08:00
type DashboardLineResponseDO = {
2024-03-28 16:22:18 +08:00
createDt: string;
total: number;
} & DashboardLineJob &
DashboardLineRetry;
type DashboardLineJob = {
createDt: string;
total: number;
fail: number;
2024-03-28 16:22:18 +08:00
stop: number;
cancel: number;
success: number;
};
type DashboardLineRetry = {
createDt: string;
total: number;
successNum: number;
runningNum: number;
maxCountNum: number;
suspendNum: number;
};
type RankList = {
name: string;
total: string;
};
type TaskList = {
status: number;
2024-04-12 23:46:09 +08:00
data: Task[];
2024-03-28 16:22:18 +08:00
page: number;
size: number;
total: number;
};
2024-04-12 23:46:09 +08:00
type Task = {
2024-03-28 16:22:18 +08:00
groupName: string;
run: number;
total: number;
};
2024-04-18 16:32:38 +08:00
/**
* dashboard line type
*
* - "DAY": "今日"
* - "WEEK": "最近一周"
* - "MONTH": "最近一月"
* - "YEAR": "全年"
* - "OTHERS": "自选日期"
*/
2024-03-28 16:22:18 +08:00
type DashboardLineType = 'DAY' | 'WEEK' | 'MONTH' | 'YEAR' | 'OTHERS';
2024-04-18 16:32:38 +08:00
/**
* dashboard line mode
*
* - "JOB": "job"
* - "WORKFLOW": "workflow"
*/
2024-04-12 23:46:09 +08:00
type DashboardLineMode = 'JOB' | 'WORKFLOW';
2024-03-28 16:22:18 +08:00
2024-05-23 00:53:06 +08:00
type TaskType = 'JOB' | 'RETRY' | 'WORKFLOW';
2024-03-28 16:22:18 +08:00
type DashboardLineParams = {
groupName?: string;
type: DashboardLineType;
2024-04-12 23:46:09 +08:00
mode?: DashboardLineMode;
datetimeRange?: [string, string] | null;
2024-04-12 23:46:09 +08:00
} & CommonSearchParams;
2024-03-30 17:07:04 +08:00
2024-04-18 16:32:38 +08:00
/**
* dashboard line mode
*
* - "1": "client"
* - "2": "server"
*/
2024-03-30 17:07:04 +08:00
type DashboardPodsType = 1 | 2;
2024-04-18 16:32:38 +08:00
/** dashboard list */
2024-03-30 17:07:04 +08:00
type DashboardPodList = Common.PaginatingQueryRecord<DashboardPod>;
2024-04-18 16:32:38 +08:00
/** dashboard pod */
2024-03-30 17:07:04 +08:00
type DashboardPod = {
/** 路径/组 */
consumerBuckets: number[];
/** context path */
contextPath: string;
/** 创建时间 */
createDt: string;
/** ext attrs */
extAttrs: string;
/** 组名称 */
groupName: string;
/** host id */
hostId: string;
/** host IP */
hostIp: string;
/** host port */
hostPort: string;
/** 类型 */
nodeType: DashboardPodsType;
/** 更新时间 */
updateDt: string;
};
2024-04-18 16:32:38 +08:00
/** dashboard search params */
2024-03-30 17:07:04 +08:00
type DashboardPodsParams = CommonType.RecordNullable<
Pick<Api.Dashboard.DashboardPod, 'groupName'> & CommonSearchParams
>;
2024-03-22 11:22:07 +08:00
}
2024-04-03 16:33:18 +08:00
/**
* namespace Namespace
*
* backend api module: "Namespace"
*/
namespace Namespace {
type CommonSearchParams = Pick<Common.PaginatingCommonParams, 'page' | 'size'>;
/** namespace */
type Namespace = Common.CommonRecord<{
/** 主键 */
2024-04-10 10:29:36 +08:00
id?: string;
2024-04-03 16:33:18 +08:00
/** 名称 */
2024-04-10 10:29:36 +08:00
name?: string;
2024-04-03 16:33:18 +08:00
/** UniqueId */
uniqueId: string;
}>;
/** namespace search params */
type NamespaceSearchParams = CommonType.RecordNullable<{ keyword: string } & CommonSearchParams>;
/** namespace list */
type NamespaceList = Common.PaginatingQueryRecord<Namespace>;
}
2024-04-17 23:48:25 +08:00
namespace GroupConfig {
type CommonSearchParams = Pick<Common.PaginatingCommonParams, 'page' | 'size'>;
2024-04-20 16:34:30 +08:00
type IdGeneratorModeType = 1 | 2;
type GroupStatusType = 0 | 1;
type YesOrNoType = 0 | 1;
2024-04-17 23:48:25 +08:00
/** groupConfig */
type GroupConfig = Common.CommonRecord<{
/** 命名空间id */
2024-04-20 16:34:30 +08:00
namespaceId?: string;
2024-04-27 00:11:38 +08:00
/** 命名空间名称 */
namespaceName?: string;
2024-04-17 23:48:25 +08:00
/** 组名 */
groupName: string;
/** 组描述 */
description: string;
/** token */
token: string;
/** 组状态 0、未启用 1、启用 */
2024-04-20 16:34:30 +08:00
groupStatus: GroupStatusType;
2024-04-17 23:48:25 +08:00
/** 版本号 */
2024-04-20 16:34:30 +08:00
version?: number;
2024-04-17 23:48:25 +08:00
/** 分区 */
groupPartition: number;
/** 唯一id生成模式 默认号段模式 */
idGeneratorMode: IdGeneratorModeType;
/** 是否初始化场景 0:否 1:是 */
2024-04-20 16:34:30 +08:00
initScene: YesOrNoType;
2024-04-17 23:48:25 +08:00
/** bucket */
2024-04-20 16:34:30 +08:00
bucketIndex?: number;
2024-04-17 23:48:25 +08:00
}>;
/** groupConfig search params */
type GroupConfigSearchParams = CommonType.RecordNullable<
Pick<Api.GroupConfig.GroupConfig, 'groupName' | 'groupStatus'> & CommonSearchParams
2024-04-17 23:48:25 +08:00
>;
/** export groupConfig */
type ExportGroupConfig = Common.CommonRecord<{
groupIds: string[];
}> &
CommonType.RecordNullable<Pick<Api.GroupConfig.GroupConfig, 'groupName' | 'groupStatus'>>;
2024-04-23 23:33:00 +08:00
type GroupConfigRequestVO = {
groupName: string;
groupStatus: GroupStatusType;
token?: string;
description?: string;
groupPartition?: number;
idGeneratorMode?: IdGeneratorModeType;
initScene?: YesOrNoType;
};
2024-04-17 23:48:25 +08:00
/** groupConfig list */
type GroupConfigList = Common.PaginatingQueryRecord<GroupConfig>;
}
2024-03-21 10:57:53 +08:00
/**
* namespace SystemManage
*
* backend api module: "systemManage"
*/
namespace SystemManage {
2024-03-30 17:07:04 +08:00
type CommonSearchParams = Pick<Common.PaginatingCommonParams, 'page' | 'size'>;
2024-03-21 10:57:53 +08:00
/** role */
type Role = Common.CommonRecord<{
2024-04-03 16:33:18 +08:00
id: string;
2024-03-21 10:57:53 +08:00
/** role name */
roleName: string;
/** role code */
roleCode: string;
/** role description */
roleDesc: string;
}>;
/** role search params */
type RoleSearchParams = CommonType.RecordNullable<
Pick<Api.SystemManage.Role, 'roleName' | 'roleCode' | 'status'> & CommonSearchParams
>;
/** role list */
type RoleList = Common.PaginatingQueryRecord<Role>;
/** all role */
type AllRole = Pick<Role, 'id' | 'roleName' | 'roleCode'>;
/**
* user gender
*
* - "1": "male"
* - "2": "female"
*/
type UserGender = '1' | '2';
/** user */
type User = Common.CommonRecord<{
/** user name */
userName: string;
/** user gender */
userGender: UserGender | null;
/** user nick name */
nickName: string;
/** user phone */
userPhone: string;
/** user email */
userEmail: string;
/** user role code collection */
userRoles: string[];
}>;
/** user search params */
type UserSearchParams = CommonType.RecordNullable<
Pick<Api.SystemManage.User, 'userName' | 'userGender' | 'nickName' | 'userPhone' | 'userEmail' | 'status'> &
CommonSearchParams
>;
/** user list */
type UserList = Common.PaginatingQueryRecord<User>;
/**
* menu type
*
* - "1": directory
* - "2": menu
*/
type MenuType = '1' | '2';
type MenuButton = {
/**
* button code
*
* it can be used to control the button permission
*/
code: string;
/** button description */
desc: string;
};
/**
* icon type
*
* - "1": iconify icon
* - "2": local icon
*/
type IconType = '1' | '2';
2024-05-08 11:57:58 +08:00
type MenuPropsOfRoute = Pick<
import('vue-router').RouteMeta,
| 'i18nKey'
| 'keepAlive'
| 'constant'
| 'order'
| 'href'
| 'hideInMenu'
| 'activeMenu'
| 'multiTab'
| 'fixedIndexInTab'
| 'query'
>;
2024-03-21 10:57:53 +08:00
type Menu = Common.CommonRecord<{
2024-04-03 16:33:18 +08:00
id: string;
2024-03-21 10:57:53 +08:00
/** parent menu id */
parentId: number;
/** menu type */
menuType: MenuType;
/** menu name */
menuName: string;
/** route name */
routeName: string;
/** route path */
routePath: string;
/** component */
component?: string;
/** iconify icon name or local icon name */
icon: string;
/** icon type */
iconType: IconType;
2024-05-08 11:57:58 +08:00
/** buttons */
buttons?: MenuButton[] | null;
2024-03-21 10:57:53 +08:00
/** children menu */
2024-05-08 11:57:58 +08:00
children?: Menu[] | null;
}> &
MenuPropsOfRoute;
2024-03-26 11:47:11 +08:00
/** menu list */
type MenuList = Common.PaginatingQueryRecord<Menu>;
type MenuTree = {
2024-04-03 16:33:18 +08:00
id: string;
2024-03-26 11:47:11 +08:00
label: string;
pId: number;
children?: MenuTree[];
};
2024-03-21 10:57:53 +08:00
}
/**
* namespace NotifyConfig
*
* backend api module: "notifyConfig"
*/
namespace NotifyConfig {
type CommonSearchParams = Pick<Common.PaginatingCommonParams, 'page' | 'size'>;
/** notify-config */
type NotifyConfig = Common.CommonRecord<{
/** 组名称 */
groupName: string | null;
/** 通知人id */
recipientIds: number[];
/** 任务类型 1、重试任务 2、回调任务、3、JOB任务 4、WORKFLOW任务 */
systemTaskType: SystemTaskType | null;
2024-04-18 09:47:26 +08:00
/** 业务名称 */
businessName?: string;
/** 通知名称 */
notifyName: string;
/** 状态 */
2024-04-20 22:36:09 +08:00
notifyStatus: Api.Common.EnableStatusNumber;
/** 通知场景 */
2024-05-05 23:22:53 +08:00
notifyScene: JobNotifyScene | RetryNotifyScene | WorkflowNotifyScene | null;
/** 通知阈值 */
notifyThreshold: number;
/** 限流开关 */
2024-04-20 22:36:09 +08:00
rateLimiterStatus: Api.Common.EnableStatusNumber;
/** 每秒限流阈值 */
rateLimiterThreshold: number | null;
/** 描述 */
description: string;
}>;
/** notify-config search params */
type NotifySearchParams = CommonType.RecordNullable<
Pick<
Api.NotifyConfig.NotifyConfig,
'groupName' | 'systemTaskType' | 'notifyStatus' | 'notifyScene' | 'notifyName'
> &
CommonSearchParams
>;
/** notify-config list */
2024-04-18 09:47:26 +08:00
type NotifyConfigList = Common.PaginatingQueryRecord<NotifyConfig>;
/** 任务类型 1、重试任务 2、回调任务、 3、JOB任务 4、WORKFLOW任务 */
2024-04-20 22:36:09 +08:00
type SystemTaskType = 1 | 3 | 4;
/** 1、场景重试数量超过阈值 2、场景重试失败数量超过阈值 3、客户端上报失败 4、客户端组件异常 5、任务重试失败 6、任务重试失败进入死信队列 7、任务重试失败没有可执行的客户端节点 */
type RetryNotifyScene = 1 | 2 | 3 | 4 | 5 | 6 | 7;
/** 1、任务执行失败 2、客户端执行失败 3、没有可执行的客户端节点 */
type JobNotifyScene = 1 | 2 | 3;
2024-05-05 23:22:53 +08:00
/** 2、 客户端执行失败 3、没有可执行的客户端节点 100、工作流任务执行失败 */
type WorkflowNotifyScene = 2 | 3 | 100;
}
2024-04-17 23:20:57 +08:00
/**
* namespace Notify-recipient
*
* backend api module: "notify-recipient"
*/
namespace NotifyRecipient {
type CommonSearchParams = Pick<Common.PaginatingCommonParams, 'page' | 'size'>;
/** notifyRecipient */
type NotifyRecipient = Common.CommonRecord<{
/** 接收人名称 */
recipientName: string;
/** 通知类型 */
notifyType: AlarmType;
2024-04-17 23:20:57 +08:00
/** 属性信息 */
notifyAttribute?: string;
2024-04-17 23:20:57 +08:00
/** 描述 */
description: string;
}>;
/** dingDing Notify */
type DingDingNotify = Common.CommonRecord<{
/** 接收人名称 */
webhookUrl: string;
/** @的用户 */
ats: string[];
}> &
NotifyRecipient;
/** email Notify */
type EmailNotify = Common.CommonRecord<{
/** 通知人 */
tos: string[];
}> &
NotifyRecipient;
/** webhook Notify */
type WebhookNotify = Common.CommonRecord<{
/** 接收人名称 */
webhookUrl: string;
/* 通知类型 */
contentType: string;
/** 密钥 */
secret?: string;
}> &
NotifyRecipient;
2024-04-17 23:20:57 +08:00
/** notifyRecipient search params */
type NotifyRecipientParams = CommonType.RecordNullable<
Pick<Api.NotifyRecipient.NotifyRecipient, 'recipientName' | 'notifyType'> & CommonSearchParams
2024-04-17 23:20:57 +08:00
>;
/** notifyRecipient list */
type NotifyRecipientList = Common.PaginatingQueryRecord<NotifyRecipient>;
/** 1: 钉钉通知 2: 邮件通知 3: 企业通知 4: 飞书 5: Webhook */
type AlarmType = 1 | 2 | 3 | 4 | 5;
type ExportNotifyRecipient = Common.CommonRecord<{
notifyRecipientIds: string[];
}> &
NotifyRecipientParams;
/* 1: application/json 2application/x-www-form-urlencoded */
type AlarmTypeWebhook = 1 | 2;
2024-04-17 23:20:57 +08:00
}
2024-04-20 22:36:09 +08:00
2024-04-26 10:43:59 +08:00
namespace RetryDeadLetter {
type CommonSearchParams = Pick<Common.PaginatingCommonParams, 'page' | 'size'>;
type TaskType = 1 | 2;
/** deadLetter */
type DeadLetter = Common.CommonRecord<{
/** id */
id?: number;
2024-04-26 10:43:59 +08:00
/** UniqueId */
uniqueId?: string;
/** 组名称 */
groupName?: string;
/** 场景名称 * */
sceneName?: string;
/** 幂等ID */
idempotentId?: string;
/** 业务编号 * */
bizNo?: string;
/** 任务类型 * */
taskType?: TaskType;
/** 创建时间 * */
createDt?: string;
/** 执行器名称 */
executorName: string;
/** 执行方法参数 */
argsStr: string;
2024-04-26 10:43:59 +08:00
}>;
/** deadLetter search params */
type RetryDeadLetterSearchParams = CommonType.RecordNullable<
Pick<
Api.RetryDeadLetter.DeadLetter,
'id' | 'uniqueId' | 'groupName' | 'sceneName' | 'idempotentId' | 'bizNo' | 'taskType' | 'createDt'
> &
CommonSearchParams & { datetimeRange?: [string, string] }
2024-04-26 10:43:59 +08:00
>;
/** DeadLetter list */
type RetryDeadLetterList = Common.PaginatingQueryRecord<DeadLetter>;
type BatchDeadLetter = Common.CommonRecord<{
groupName?: string;
ids: number[];
}>;
2024-04-26 10:43:59 +08:00
}
2024-04-21 12:45:12 +08:00
/**
* namespace RetryTask
*
* backend api module: "retryTask"
*/
namespace RetryTask {
type CommonSearchParams = Pick<Common.PaginatingCommonParams, 'page' | 'size'>;
type RetryStatusType = 0 | 1 | 2 | 3;
type TaskType = 1 | 2;
/** RetryTask */
type RetryTask = Common.CommonRecord<{
/** UniqueId */
uniqueId?: string;
/** 组名称 */
groupName: string;
/** 场景名称 */
sceneName: string;
/** 幂等id */
idempotentId: string;
/** 业务编号 */
bizNo: string;
/** 执行器名称 */
executorName: string;
/** 执行方法参数 */
argsStr: string;
/** 扩展字段 */
extAttrs?: string;
/** 下次触发时间 */
nextTriggerAt?: string;
/** 重试次数 */
retryCount?: number;
/** 重试状态 0、重试中 1、重试完成 2、最大次数 3、暂停 */
retryStatus: RetryStatusType;
/** 任务类型 1、重试数据 2、回调数据 */
taskType?: TaskType;
}>;
type RetryTaskBatchAdd = {
/** 组名称 */
groupName: string;
/** 重试状态 0、重试中 1、重试完成 2、最大次数 3、暂停 */
retryStatus: RetryStatusType;
/** 日志 */
logStr: string;
};
type RetryTaskUpdateStatusRequest = {
/** id */
id: number;
/** 组名称 */
groupName: string;
/** 重试状态 0、重试中 1、重试完成 2、最大次数 3、暂停 */
retryStatus: RetryStatusType;
};
type ManualTriggerTaskRequestVO = {
groupName: string;
uniqueIds: string[];
};
type BatchDeleteRetryTaskVO = {
groupName: string;
ids: string[];
};
type GenerateRetryIdempotentIdVO = {
/** 组名称 */
groupName: string;
/** 场景名称 */
sceneName: string;
/** 执行参数 */
argsStr: string;
/** 执行器名称 */
executorName: string;
};
2024-04-21 12:45:12 +08:00
/** RetryTask search params */
type RetryTaskSearchParams = CommonType.RecordNullable<
Pick<Api.RetryTask.RetryTask, 'uniqueId' | 'groupName' | 'sceneName' | 'idempotentId' | 'bizNo' | 'retryStatus'> &
CommonSearchParams
>;
/** RetryTask list */
type RetryTaskList = Common.PaginatingQueryRecord<RetryTask>;
}
2024-04-20 22:36:09 +08:00
/**
* namespace Scene
*
* backend api module: "scene"
*/
namespace RetryScene {
import EnableStatusNumber = Api.Common.EnableStatusNumber;
type CommonSearchParams = Pick<Common.PaginatingCommonParams, 'page' | 'size'>;
/** scene */
type Scene = Common.CommonRecord<{
/** 组名 */
groupName: string;
/** 场景名 */
sceneName: string;
/** 通知场景ids */
notifyIds: number[];
2024-04-20 22:36:09 +08:00
/** 状态 */
sceneStatus: EnableStatusNumber;
/** 退避策略 */
2024-04-21 09:47:13 +08:00
backOff: BackOff;
/** 路由策略 */
routeKey: Common.RouteKey;
2024-04-20 22:36:09 +08:00
/** 最大重试次数 */
maxRetryCount: number;
/** 间隔时间 */
2024-05-15 16:58:39 +08:00
triggerInterval: string;
2024-04-20 22:36:09 +08:00
/** 调用链超时时间 */
deadlineRequest: number;
/** 超时时间 */
executorTimeout: number;
/** 描述 */
description: string;
}>;
/** scene search params */
type SceneSearchParams = CommonType.RecordNullable<
Pick<
Api.RetryScene.Scene,
| 'groupName'
| 'sceneName'
| 'sceneStatus'
| 'backOff'
| 'maxRetryCount'
| 'triggerInterval'
| 'deadlineRequest'
| 'executorTimeout'
| 'description'
| 'routeKey'
> &
CommonSearchParams
>;
type ExportScene = Common.CommonRecord<{
sceneIds: string[];
}> &
SceneSearchParams;
2024-04-20 22:36:09 +08:00
/** scene list */
type SceneList = Common.PaginatingQueryRecord<Scene>;
2024-04-21 09:47:13 +08:00
/** 1: 延迟等级 2: 固定时间 3: CRON表达式 4: 随机等待 */
type BackOff = 1 | 2 | 3 | 4;
2024-04-20 22:36:09 +08:00
}
/**
* namespace Workflow
*
* backend api module: "workflow"
*/
namespace Workflow {
import EnableStatusNumber = Api.Common.EnableStatusNumber;
type CommonSearchParams = Pick<Common.PaginatingCommonParams, 'page' | 'size'>;
/** workflow */
type Workflow = Common.CommonRecord<{
/** 工作流名称 */
workflowName: string;
/** 组名称 */
groupName: string;
/** 触发时间 */
nextTriggerAt: string;
/** 告警通知场景ids */
notifyIds: number[];
/** 状态 */
workflowStatus: EnableStatusNumber;
/** 触发类型 */
triggerType: Job.TriggerType;
/** 间隔时长 */
triggerInterval: string;
/** 超时时间 */
executorTimeout: number;
}>;
/** workflow search params */
type WorkflowSearchParams = CommonType.RecordNullable<
Pick<Api.Workflow.Workflow, 'workflowName' | 'groupName' | 'workflowStatus'> & CommonSearchParams
>;
/** workflow name search params */
type WorkflowNameSearchParams = CommonType.RecordNullable<
Pick<
Common.CommonRecord<{
keywords: string;
workflowId: number;
groupName: string;
}>,
'keywords' | 'workflowId' | 'groupName'
>
>;
type ExportWorkflow = Common.CommonRecord<{
workflowIds: string[];
}> &
WorkflowSearchParams;
/** workflow list */
type WorkflowList = Common.PaginatingQueryRecord<Workflow>;
}
/**
* namespace Job
*
* backend api module: "job"
*/
namespace Job {
type CommonSearchParams = Pick<Common.PaginatingCommonParams, 'page' | 'size'>;
/** Job */
type Job = Common.CommonRecord<{
/** 组名称 */
groupName: string;
/** 负责人id */
owerId: string;
/** 负责人名 */
owerName?: string;
/** 通知场景ids */
notifyIds: number[];
/** 任务名称 */
jobName: string;
/** 方法参数 */
argsStr: string;
/** 参数类型 */
argsType: number;
/** 扩展字段 */
extAttrs?: string;
/** 下次触发时间 */
nextTriggerAt?: string;
/** 状态 */
jobStatus: Common.EnableStatusNumber;
/** 路由策略 */
routeKey: Common.RouteKey;
/** 执行器类型 */
executorType: Common.ExecutorType;
/** 执行器名称 */
executorInfo: string;
/** 触发类型 */
triggerType: Common.TriggerType;
/** 间隔时长 */
triggerInterval: string;
/** 阻塞策略 */
blockStrategy: Common.BlockStrategy;
/** 超时时间 */
executorTimeout: number;
/** 最大重试次数 */
maxRetryTimes: number;
/** 重试间隔 */
retryInterval: number;
/** 任务类型 */
taskType: Common.TaskType;
/** 并行数 */
parallelNum: number;
/** Bucket */
bucketIndex?: number;
/** 描述 */
description?: string;
/** 通知场景 */
notifyScene?: string;
}>;
/** JobTask search params */
type JobSearchParams = CommonType.RecordNullable<
Pick<
Api.Job.Job,
| 'groupName'
| 'jobName'
| 'owerName'
| 'argsStr'
| 'executorInfo'
| 'argsType'
| 'jobStatus'
| 'routeKey'
| 'executorType'
| 'triggerType'
| 'triggerInterval'
| 'blockStrategy'
| 'executorTimeout'
| 'maxRetryTimes'
| 'retryInterval'
| 'taskType'
| 'parallelNum'
| 'description'
> &
CommonSearchParams
>;
type JobUpdateJobStatusRequestVO = {
id: string;
jobStatus: Common.EnableStatusNumber;
};
/** JobTask list */
type JobList = Common.PaginatingQueryRecord<Job>;
type ExportJob = Common.CommonRecord<{
jobIds: string[];
}> &
JobSearchParams;
/** 2、固定时间 3、CRON表达式 99、工作流 */
type TriggerType = 2 | 3 | 99;
type JobNameListSearchParams = CommonType.RecordNullable<{
groupName?: string;
jobId?: number;
keywords?: string;
}>;
2024-05-07 14:51:19 +08:00
/** jobTask */
type JobTask = Common.CommonRecord<{
/** ID */
id: string;
/** 任务 ID */
jobId: string;
/** 组名称 */
groupName: string;
/** 任务名称 */
taskName: string;
2024-05-07 14:51:19 +08:00
/** 地址 */
clientInfo: string;
/** 参数 */
argsStr: string;
/** 结果 */
resultMessage: string;
/** 重试次数 */
retryCount: string;
/** 开始执行时间 */
createDt: string;
/** 任务批次 ID */
taskBatchId: string;
/** 任务状态 ID */
taskStatus: Common.TaskStatus;
/** 任务类型 */
taskType: Common.TaskType;
/** 父级 ID */
parentId: string;
/** 子节点 */
children: JobTaskTree[];
/** 是否存在下级 */
isLeaf: boolean;
/** 执行时长(virtual) */
duration?: number;
2024-05-07 14:51:19 +08:00
}>;
type JobTaskTree = {
parentId: string;
children: JobTaskTree[];
} & JobTask;
2024-05-07 14:51:19 +08:00
/** jobTask search params */
type jobTaskSearchParams = CommonType.RecordNullable<
Pick<Api.Job.JobTask, 'groupName' | 'taskBatchId' | 'taskStatus'> &
CommonSearchParams & { startId: number; fromIndex: number; parentId: string }
2024-05-07 14:51:19 +08:00
>;
/** jobTask list */
type JobTaskList = Common.PaginatingQueryRecord<JobTask>;
/** jobTask tree list */
type JobTaskTreeList = JobTask[];
}
2024-04-23 14:31:09 +08:00
2024-04-26 01:06:58 +08:00
/**
* namespace JobBatch
*
* backend api module: "jobBatch"
*/
namespace JobBatch {
import TaskType = Api.Common.TaskType;
2024-04-26 01:06:58 +08:00
type CommonSearchParams = Pick<Common.PaginatingCommonParams, 'page' | 'size'>;
/** JobBatch */
type JobBatch = Common.CommonRecord<{
/** 组名称 */
groupName: string;
/** 任务名称 */
jobName: string;
/** 任务类型 */
taskType: TaskType;
2024-04-26 01:06:58 +08:00
/** 工作流节点名称 */
nodeName: string;
/** 任务信息id */
jobId: string;
/** 状态 */
taskBatchStatus: Common.TaskBatchStatus;
/** 开始执行时间 */
executionAt: string;
/** 执行时长(virtual) */
duration?: number;
2024-04-26 01:06:58 +08:00
/** 操作原因 */
operationReason: Common.OperationReason;
/** 执行器类型 */
executorType: Common.ExecutorType;
/** 执行器名称 */
executorInfo: string;
/** 工作流的回调节点信息 */
callback: object;
/** 名称 */
decision: object;
/** 工作流批次id */
workflowTaskBatchId: string;
/** 工作流节点id */
workflowNodeId: string;
}>;
/** JobBatch search params */
type JobBatchSearchParams = CommonType.RecordNullable<
Pick<Api.JobBatch.JobBatch, 'groupName' | 'jobName' | 'taskBatchStatus' | 'jobId' | 'taskType'> &
CommonSearchParams & { datetimeRange?: [string, string] }
2024-04-26 01:06:58 +08:00
>;
/** JobBatch list */
type JobBatchList = Common.PaginatingQueryRecord<JobBatch>;
}
2024-04-23 14:31:09 +08:00
/**
* namespace WorkflowBatch
*
* backend api module: "workflowBatch"
*/
namespace WorkflowBatch {
type CommonSearchParams = Pick<Common.PaginatingCommonParams, 'page' | 'size'>;
/** workflowBatch */
type WorkflowBatch = Common.CommonRecord<{
/** 工作流名称 */
workflowName: string;
/** 工作流ID */
workflowId?: number;
/** 组名称 */
groupName: string;
/** 执行时间 */
executionAt: string;
/** 状态 */
taskBatchStatus: Common.TaskBatchStatus;
2024-04-23 14:31:09 +08:00
/** 操作原因 */
operationReason: Common.OperationReason;
2024-04-23 14:31:09 +08:00
/** 创建时间 */
createDt: string;
}>;
/** workflowBatch search params */
type WorkflowBatchSearchParams = CommonType.RecordNullable<
Pick<Api.WorkflowBatch.WorkflowBatch, 'workflowId' | 'groupName' | 'workflowName' | 'taskBatchStatus'> &
CommonSearchParams & { datetimeRange?: [string, string] }
2024-04-23 14:31:09 +08:00
>;
/** workflowBatch list */
type WorkflowBatchList = Common.PaginatingQueryRecord<WorkflowBatch>;
}
/**
* namespace RetryLog
*
* backend api module: "retryLog"
*/
namespace RetryLog {
import RetryStatusType = Api.RetryTask.RetryStatusType;
import TaskType = Api.RetryTask.TaskType;
type CommonSearchParams = Pick<Common.PaginatingCommonParams, 'page' | 'size'>;
/** retryLog */
type RetryLog = Common.CommonRecord<{
/** UniqueId */
uniqueId: string;
/** 组名称 */
groupName: string;
/** 场景名称 */
sceneName: string;
/** 重试状态 */
retryStatus: RetryStatusType;
/** 任务类型 */
taskType: TaskType;
/** 幂等id */
idempotentId: string;
/** 业务编号 */
bizNo: string;
/** 创建时间 */
createDt: string;
/** 执行器名称 */
executorName: string;
/** 执行方法参数 */
argsStr: string;
/** 扩展字段 */
extAttrs?: string;
/** 下次触发时间 */
nextTriggerAt?: string;
/** 重试次数 */
retryCount?: number;
}>;
/** retryLog search params */
type RetryLogSearchParams = CommonType.RecordNullable<
Pick<Api.RetryLog.RetryLog, 'uniqueId' | 'groupName' | 'sceneName' | 'idempotentId' | 'bizNo' | 'retryStatus'> &
CommonSearchParams & { datetimeRange?: [string, string] }
>;
/** retryLog list */
type RetryLogList = Common.PaginatingQueryRecord<RetryLog>;
}
2024-04-26 17:34:24 +08:00
/**
* namespace UserManager
*
* backend api module: "UserManager"
*/
namespace UserManager {
type CommonSearchParams = Pick<Common.PaginatingCommonParams, 'page' | 'size'>;
/** userCenter */
type UserManager = Common.CommonRecord<{
/** 用户名 */
username: string;
/** 密码 */
2024-05-10 15:05:23 +08:00
password: string | null;
2024-04-26 17:34:24 +08:00
/** 确认密码 */
2024-05-10 15:05:23 +08:00
checkPassword?: string;
2024-04-26 17:34:24 +08:00
/** 角色 */
2024-04-27 00:11:38 +08:00
role: Role;
2024-04-26 17:34:24 +08:00
/** 组 */
2024-04-27 00:11:38 +08:00
permissions: Permission[];
}>;
type Permission = Common.CommonRecord<{
groupName: string;
namespaceId: string;
2024-04-27 22:52:31 +08:00
namespaceName?: string;
2024-04-26 17:34:24 +08:00
}>;
/** userManager search params */
type UserManagerSearchParams = CommonType.RecordNullable<
Pick<Api.UserManager.UserManager, 'id' | 'username' | 'password' | 'checkPassword' | 'role' | 'permissions'> &
2024-04-26 17:34:24 +08:00
CommonSearchParams
>;
/** userCenter list */
type UserManagerList = Common.PaginatingQueryRecord<UserManager>;
2024-04-27 00:11:38 +08:00
/** 1、user 2、admin */
type Role = 1 | 2;
type UpdateUserPassword = Common.CommonRecord<{
/** 旧密码 */
oldPassword: string;
/** 新密码 */
newPassword: string;
/** 确认密码 */
checkPassword?: string;
}>;
2024-04-26 17:34:24 +08:00
}
2024-05-07 14:51:19 +08:00
/**
* namespace JobLog
*
* backend api module: "JobLog"
*/
namespace JobLog {
type JobLevel = 'INFO' | 'WARN' | 'ERROR' | 'DEBUG';
type JobLogSearchParams = {
taskBatchId: string;
jobId: string;
taskId: string;
2024-05-07 15:19:49 +08:00
} & LogSearchParams;
type RetryLogSearchParams = {
groupName: string;
uniqueId: string;
} & LogSearchParams;
type LogSearchParams = {
2024-05-07 14:51:19 +08:00
startId: string;
fromIndex: number;
size: number;
};
type JobLogList = {
finished: boolean;
fromIndex: number;
message: JobMessage[];
nextStartId: string;
};
type JobMessage = {
index: number;
2024-05-07 14:51:19 +08:00
level: JobLevel;
2024-05-15 18:36:57 +08:00
host: string;
port: string;
2024-05-07 14:51:19 +08:00
location: string;
message: string;
thread: string;
['time_stamp']: string;
throwable: string;
};
}
2024-03-08 17:59:45 +08:00
}