统一前后端代码格式化配置
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
import { buildClaimUrl } from '../../claim/claim-service.js'
|
||||
import {
|
||||
shouldEnsureKuaishouCloudClaimLink,
|
||||
TASK_STATUS,
|
||||
} from '../../../domain/task-status.js'
|
||||
import { shouldEnsureKuaishouCloudClaimLink, TASK_STATUS } from '../../../domain/task-status.js'
|
||||
import {
|
||||
confirmKuaishouCloudTaskRole,
|
||||
dispatchKuaishouCloudFulfillmentTask,
|
||||
@@ -95,9 +92,7 @@ async function prepareBinding(
|
||||
options: FulfillmentActionOptions = {},
|
||||
): Promise<FulfillmentActionResult> {
|
||||
// 后台/显式 force:旧号可被 CT 回收,忽略退号失败并取新号+新绑链
|
||||
const force =
|
||||
options.force === true ||
|
||||
String(options.source || '').includes('admin_')
|
||||
const force = options.force === true || String(options.source || '').includes('admin_')
|
||||
const result = await prepareKuaishouCloudFulfillmentTask(task, {
|
||||
source: options.source || 'executor_prepare_binding',
|
||||
actor: options.actor,
|
||||
|
||||
@@ -78,51 +78,30 @@ async function runExecutorAction(
|
||||
return handler(task, options)
|
||||
}
|
||||
|
||||
export function prepareFulfillmentBinding(
|
||||
task: TaskRow,
|
||||
options: FulfillmentActionOptions = {},
|
||||
) {
|
||||
export function prepareFulfillmentBinding(task: TaskRow, options: FulfillmentActionOptions = {}) {
|
||||
return runExecutorAction(task, 'prepareBinding', options)
|
||||
}
|
||||
|
||||
export function rebindFulfillmentRole(
|
||||
task: TaskRow,
|
||||
options: FulfillmentActionOptions = {},
|
||||
) {
|
||||
export function rebindFulfillmentRole(task: TaskRow, options: FulfillmentActionOptions = {}) {
|
||||
return runExecutorAction(task, 'rebindRole', options)
|
||||
}
|
||||
|
||||
export function refreshFulfillmentRole(
|
||||
task: TaskRow,
|
||||
options: FulfillmentActionOptions = {},
|
||||
) {
|
||||
export function refreshFulfillmentRole(task: TaskRow, options: FulfillmentActionOptions = {}) {
|
||||
return runExecutorAction(task, 'refreshRole', options)
|
||||
}
|
||||
|
||||
export function confirmFulfillmentRole(
|
||||
task: TaskRow,
|
||||
options: FulfillmentActionOptions = {},
|
||||
) {
|
||||
export function confirmFulfillmentRole(task: TaskRow, options: FulfillmentActionOptions = {}) {
|
||||
return runExecutorAction(task, 'confirmRole', options)
|
||||
}
|
||||
|
||||
export function redeemFulfillmentTask(
|
||||
task: TaskRow,
|
||||
options: FulfillmentActionOptions = {},
|
||||
) {
|
||||
export function redeemFulfillmentTask(task: TaskRow, options: FulfillmentActionOptions = {}) {
|
||||
return runExecutorAction(task, 'redeemTask', options)
|
||||
}
|
||||
|
||||
export function dispatchFulfillmentTask(
|
||||
task: TaskRow,
|
||||
options: FulfillmentActionOptions = {},
|
||||
) {
|
||||
export function dispatchFulfillmentTask(task: TaskRow, options: FulfillmentActionOptions = {}) {
|
||||
return runExecutorAction(task, 'dispatchTask', options)
|
||||
}
|
||||
|
||||
export function returnFulfillmentNumber(
|
||||
task: TaskRow,
|
||||
options: FulfillmentActionOptions = {},
|
||||
) {
|
||||
export function returnFulfillmentNumber(task: TaskRow, options: FulfillmentActionOptions = {}) {
|
||||
return runExecutorAction(task, 'returnNumber', options)
|
||||
}
|
||||
|
||||
@@ -10,7 +10,8 @@ export const FULFILLMENT_EXECUTOR_KEYS = {
|
||||
} as const
|
||||
|
||||
export type FulfillmentExecutorKey =
|
||||
(typeof FULFILLMENT_EXECUTOR_KEYS)[keyof typeof FULFILLMENT_EXECUTOR_KEYS] | (string & {})
|
||||
| (typeof FULFILLMENT_EXECUTOR_KEYS)[keyof typeof FULFILLMENT_EXECUTOR_KEYS]
|
||||
| (string & {})
|
||||
|
||||
export type FulfillmentDeliveryLink = {
|
||||
claimUrl: string
|
||||
@@ -53,10 +54,7 @@ export type FulfillmentActionResult = {
|
||||
|
||||
export type FulfillmentExecutor = {
|
||||
key: FulfillmentExecutorKey
|
||||
preparePaidTask?: (
|
||||
task: TaskRow,
|
||||
deps: FulfillmentPrepareDeps,
|
||||
) => Promise<TaskRow | null>
|
||||
preparePaidTask?: (task: TaskRow, deps: FulfillmentPrepareDeps) => Promise<TaskRow | null>
|
||||
resolveDeliveryLink?: (task: TaskRow) => Promise<FulfillmentDeliveryLink | null>
|
||||
/** lewan:准备绑定资源(虚拟号 / bindUrl) */
|
||||
prepareBinding?: (
|
||||
@@ -104,8 +102,10 @@ export function normalizeExecutorKey(value: unknown): FulfillmentExecutorKey {
|
||||
|
||||
export function isKuaishouCloudExecutor(value: unknown): boolean {
|
||||
const executorKey = normalizeExecutorKey(value)
|
||||
return executorKey === FULFILLMENT_EXECUTOR_KEYS.KUAISHOU_CLOUD ||
|
||||
return (
|
||||
executorKey === FULFILLMENT_EXECUTOR_KEYS.KUAISHOU_CLOUD ||
|
||||
executorKey === FULFILLMENT_EXECUTOR_KEYS.KUAISHOU_INDUSTRY
|
||||
)
|
||||
}
|
||||
|
||||
export function isKuaishouFeifeiExecutor(value: unknown): boolean {
|
||||
|
||||
Reference in New Issue
Block a user