MCPcopy Create free account
hub / github.com/PIKACHUIM/CFWorkerACME / Processing

Function Processing

src/certs.ts:99–114  ·  view source on GitHub ↗
(env: Bindings)

Source from the content-addressed store, hash-verified

97
98// 整体处理进程 ====================================================================================
99export async function Processing(env: Bindings) {
100 let order_list: any = await saves.selectDB(env.DB_CF, "Apply", {flag: {value: 5, op: "!="}});
101 let result: any[] = []
102 for (const id in order_list) { // 获取信息 ==================================================================
103 let order_info = order_list[id]; // 获取当前订单详细情况
104 let order_mail = order_info['mail']; // 当前订单用户邮箱
105 let order_user: any = (await saves.selectDB( // 查询申请者信息
106 env.DB_CF, "Users", {mail: {value: order_mail}}))[0]; // 按不同阶段分配程序处理 ========================
107 if (order_info['flag'] == 0) result.push(await newApply(env, order_user, order_info));// 执行创建订单操作
108 if (order_info['flag'] == 1) result.push(await setApply(env, order_user, order_info));// 自动执行域名代理
109 if (order_info['flag'] == 2) result.push(await opDomain(env, order_user, order_info, []));// 自动验证域名
110 if (order_info['flag'] == 3) result.push(await dnsAuthy(env, order_user, order_info));// 自动执行域名验证
111 if (order_info['flag'] == 4) result.push(await getCerts(env, order_user, order_info));// 自动执行获取证书
112 } // ========================================================================================================
113 return result;
114}
115
116// 单订单一键推进 ==================================================================================
117// 按当前 flag 循环推进状态机,直到进入需要外部介入的节点:

Callers

nothing calls this directly

Calls 5

newApplyFunction · 0.85
setApplyFunction · 0.85
opDomainFunction · 0.85
dnsAuthyFunction · 0.85
getCertsFunction · 0.85

Tested by

no test coverage detected