Replace magic strings across the automation domain with backed PHP enums
(HttpMethod, AuthType, DelayUnit, ScheduleField) and mirrored TS consts
(http-method, auth-type, delay-unit, schedule-field, condition-operator,
publish-mode), plus the existing Condition\Handle / Operator / Publish\Mode.
Also:
- require scheduled_offset via concrete-index required_if instead of
defaulting to 60 when the publish mode is scheduled
- fail the webhook node explicitly when the resolved url is empty
- localize node failure messages (fetch_rss/http/webhook)
- cast resolver/strtoupper inputs to string so a present-null config value
degrades gracefully instead of crashing
- list automations with config('app.pagination.default'), drop the perPage param
28 lines
582 B
PHP
28 lines
582 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Enums\Automation;
|
|
|
|
/**
|
|
* HTTP verbs available to the HTTP Request and Webhook nodes. Mirrors the
|
|
* frontend HttpMethod const (resources/js/types/automation/http-method.ts).
|
|
*/
|
|
enum HttpMethod: string
|
|
{
|
|
case Get = 'GET';
|
|
case Post = 'POST';
|
|
case Put = 'PUT';
|
|
case Patch = 'PATCH';
|
|
case Delete = 'DELETE';
|
|
|
|
/**
|
|
* Verbs that carry a request body.
|
|
*
|
|
* @return array<int, self>
|
|
*/
|
|
public static function withBody(): array
|
|
{
|
|
return [self::Post, self::Put, self::Patch];
|
|
}
|
|
}
|