mirror of
https://github.com/langgenius/dify.git
synced 2026-05-05 01:48:04 +08:00
fix(webhook-trigger): request array type adjustment (#25005)
This commit is contained in:
@ -116,7 +116,7 @@ describe('Monthly Multi-Select Execution Time Calculator', () => {
|
||||
time: '10:30 AM',
|
||||
},
|
||||
timezone: 'UTC',
|
||||
id: 'test',
|
||||
id: 'test',
|
||||
type: 'trigger-schedule',
|
||||
data: {},
|
||||
position: { x: 0, y: 0 },
|
||||
|
||||
@ -363,7 +363,7 @@ describe('Weekly Schedule Time Logic Tests', () => {
|
||||
time: '2:00 PM',
|
||||
},
|
||||
timezone: 'UTC',
|
||||
}
|
||||
}
|
||||
|
||||
const weeklyTimes = getNextExecutionTimes(weeklyConfig, 1)
|
||||
const dailyTimes = getNextExecutionTimes(dailyConfig, 1)
|
||||
@ -387,7 +387,7 @@ describe('Weekly Schedule Time Logic Tests', () => {
|
||||
time: '2:00 PM',
|
||||
},
|
||||
timezone: 'UTC',
|
||||
}
|
||||
}
|
||||
|
||||
const weeklyTimes = getNextExecutionTimes(weeklyConfig, 1)
|
||||
const dailyTimes = getNextExecutionTimes(dailyConfig, 1)
|
||||
|
||||
@ -130,7 +130,7 @@ const nodeDefault: NodeDefault<ScheduleTriggerNodeType> = {
|
||||
try {
|
||||
Intl.DateTimeFormat(undefined, { timeZone: payload.timezone })
|
||||
}
|
||||
catch {
|
||||
catch {
|
||||
errorMessages = t('workflow.nodes.triggerSchedule.invalidTimezone')
|
||||
}
|
||||
}
|
||||
@ -138,13 +138,13 @@ const nodeDefault: NodeDefault<ScheduleTriggerNodeType> = {
|
||||
if (payload.mode === 'cron') {
|
||||
if (!payload.cron_expression || payload.cron_expression.trim() === '')
|
||||
errorMessages = t(`${i18nPrefix}.fieldRequired`, { field: t('workflow.nodes.triggerSchedule.cronExpression') })
|
||||
else if (!isValidCronExpression(payload.cron_expression))
|
||||
else if (!isValidCronExpression(payload.cron_expression))
|
||||
errorMessages = t('workflow.nodes.triggerSchedule.invalidCronExpression')
|
||||
}
|
||||
else if (payload.mode === 'visual') {
|
||||
else if (payload.mode === 'visual') {
|
||||
if (!payload.frequency)
|
||||
errorMessages = t(`${i18nPrefix}.fieldRequired`, { field: t('workflow.nodes.triggerSchedule.frequency') })
|
||||
else
|
||||
else
|
||||
errorMessages = validateVisualConfig(payload, t)
|
||||
}
|
||||
}
|
||||
@ -154,7 +154,7 @@ const nodeDefault: NodeDefault<ScheduleTriggerNodeType> = {
|
||||
if (nextTimes.length === 0)
|
||||
errorMessages = t('workflow.nodes.triggerSchedule.noValidExecutionTime')
|
||||
}
|
||||
catch {
|
||||
catch {
|
||||
errorMessages = t('workflow.nodes.triggerSchedule.executionTimeCalculationError')
|
||||
}
|
||||
}
|
||||
|
||||
@ -12,7 +12,7 @@ const matchesField = (value: number, pattern: string, min: number, max: number):
|
||||
if (range === '*') {
|
||||
return value % stepValue === min % stepValue
|
||||
}
|
||||
else {
|
||||
else {
|
||||
const rangeStart = Number.parseInt(range, 10)
|
||||
if (Number.isNaN(rangeStart)) return false
|
||||
return value >= rangeStart && (value - rangeStart) % stepValue === 0
|
||||
@ -96,15 +96,15 @@ const matchesCron = (
|
||||
return matchesField(currentDay, dayOfMonth, 1, 31)
|
||||
|| matchesField(currentDayOfWeek, dayOfWeek, 0, 6)
|
||||
}
|
||||
else if (dayOfMonthSpecified) {
|
||||
else if (dayOfMonthSpecified) {
|
||||
// Only day of month specified
|
||||
return matchesField(currentDay, dayOfMonth, 1, 31)
|
||||
}
|
||||
else if (dayOfWeekSpecified) {
|
||||
else if (dayOfWeekSpecified) {
|
||||
// Only day of week specified
|
||||
return matchesField(currentDayOfWeek, dayOfWeek, 0, 6)
|
||||
}
|
||||
else {
|
||||
else {
|
||||
// Both are *, matches any day
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user