2026-05-24 12:17:19 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace App\Http\Controllers\App;
|
|
|
|
|
|
|
|
|
|
use App\Actions\Automation\Automation\ActivateAutomation;
|
|
|
|
|
use App\Actions\Automation\Automation\CreateAutomation;
|
2026-06-10 21:10:13 +00:00
|
|
|
use App\Actions\Automation\Automation\DeleteAutomation;
|
|
|
|
|
use App\Actions\Automation\Automation\GetAutomationEditorData;
|
2026-06-12 22:19:46 +00:00
|
|
|
use App\Actions\Automation\Automation\GetAutomationInvocations;
|
|
|
|
|
use App\Actions\Automation\Automation\GetAutomationMetrics;
|
2026-06-10 21:10:13 +00:00
|
|
|
use App\Actions\Automation\Automation\ListAutomations;
|
2026-05-24 12:17:19 +00:00
|
|
|
use App\Actions\Automation\Automation\PauseAutomation;
|
|
|
|
|
use App\Actions\Automation\Automation\UpdateAutomation;
|
|
|
|
|
use App\Actions\Automation\Run\RetryRunFromNode;
|
|
|
|
|
use App\Actions\Automation\Run\TestAutomation;
|
2026-07-18 13:58:07 +00:00
|
|
|
use App\Enums\Automation\Status;
|
2026-05-24 12:17:19 +00:00
|
|
|
use App\Http\Controllers\Controller;
|
|
|
|
|
use App\Http\Requests\App\Automations\ActivateAutomationRequest;
|
feat(automations): multi-format RSS/Atom feeds with dynamic variables
Replace the RSS-2.0-only SimpleXML parser with SimplePie so the Fetch RSS
node reads Atom 1.0 (YouTube, GitHub, The Verge…) and RSS 2.0 + namespace
extensions (dc:, content:, media:, yt:, itunes:). Each item exposes stable
cross-format aliases (title, link, date, content, author, …) plus every
namespaced field flattened for use as {{ fetched.* }}.
Add a feed-inspection endpoint that discovers a feed's real fields and feeds
them into the editor's expression autocomplete. Allow {{ }} expressions in the
feed URL via a ResolvableUrl rule. Parsing moves to a dedicated FeedParser
service; the fetch keeps the SSRF guard and gains XXE-safe parsing.
2026-06-16 13:56:08 +00:00
|
|
|
use App\Http\Requests\App\Automations\InspectFeedRequest;
|
2026-05-24 12:17:19 +00:00
|
|
|
use App\Http\Requests\App\Automations\PauseAutomationRequest;
|
|
|
|
|
use App\Http\Requests\App\Automations\RetryRunRequest;
|
|
|
|
|
use App\Http\Requests\App\Automations\StoreAutomationRequest;
|
|
|
|
|
use App\Http\Requests\App\Automations\TestAutomationRequest;
|
|
|
|
|
use App\Http\Requests\App\Automations\UpdateAutomationRequest;
|
feat(automations): multi-format RSS/Atom feeds with dynamic variables
Replace the RSS-2.0-only SimpleXML parser with SimplePie so the Fetch RSS
node reads Atom 1.0 (YouTube, GitHub, The Verge…) and RSS 2.0 + namespace
extensions (dc:, content:, media:, yt:, itunes:). Each item exposes stable
cross-format aliases (title, link, date, content, author, …) plus every
namespaced field flattened for use as {{ fetched.* }}.
Add a feed-inspection endpoint that discovers a feed's real fields and feeds
them into the editor's expression autocomplete. Allow {{ }} expressions in the
feed URL via a ResolvableUrl rule. Parsing moves to a dedicated FeedParser
service; the fetch keeps the SSRF guard and gains XXE-safe parsing.
2026-06-16 13:56:08 +00:00
|
|
|
use App\Http\Resources\App\Automation\FeedInspectionResource;
|
2026-05-24 12:17:19 +00:00
|
|
|
use App\Http\Resources\App\PlatformConfigResource;
|
|
|
|
|
use App\Http\Resources\App\SocialAccountResource;
|
2026-06-12 22:19:46 +00:00
|
|
|
use App\Http\Resources\AutomationInvocationResource;
|
2026-05-24 12:17:19 +00:00
|
|
|
use App\Http\Resources\AutomationNodeRunResource;
|
|
|
|
|
use App\Http\Resources\AutomationResource;
|
|
|
|
|
use App\Http\Resources\AutomationRunResource;
|
|
|
|
|
use App\Models\Automation;
|
Add expression autocomplete, side-panel editor, and richer HTTP fetch
Automations editor:
- {{ }} expression autocomplete in CodeMirror, scoped to the braces and
graph-aware (suggests only what upstream nodes provide + variables + now);
migrate the Generate prompt to CodeMirror so it shares the same completions
- Expandable editors: an expand button slides out a side-by-side panel
(matching the sidebar card), with a minimize control; the inline field
collapses to a hint while editing in the panel
- Hover-revealed editor toolbar (expand/copy) with styled tooltips so the
buttons no longer obscure the text while reading
- Beta badge on the Automations sidebar item
- Delete a single connection with Backspace/Delete (edge selection)
- Re-key node config so switching between same-type nodes refreshes the form
HTTP fetch node — cover every JSON response shape:
- Top-level array, object map (items_path=*), array of primitives, and NDJSON
- Key-based dedup via item_key_path (seen-set, FIFO-capped) for feeds without
dates; first poll records a baseline and emits nothing (date path too)
Fan-out test visibility:
- root_run_id links every forked branch back to the run that started a test,
so the test panel aggregates all branches instead of one
Fix a few pre-existing type issues (ScheduleData import, padded minute,
optional created_at).
2026-06-12 14:31:58 +00:00
|
|
|
use App\Models\AutomationNodeRun;
|
2026-05-24 12:17:19 +00:00
|
|
|
use App\Models\AutomationRun;
|
feat(automations): multi-format RSS/Atom feeds with dynamic variables
Replace the RSS-2.0-only SimpleXML parser with SimplePie so the Fetch RSS
node reads Atom 1.0 (YouTube, GitHub, The Verge…) and RSS 2.0 + namespace
extensions (dc:, content:, media:, yt:, itunes:). Each item exposes stable
cross-format aliases (title, link, date, content, author, …) plus every
namespaced field flattened for use as {{ fetched.* }}.
Add a feed-inspection endpoint that discovers a feed's real fields and feeds
them into the editor's expression autocomplete. Allow {{ }} expressions in the
feed URL via a ResolvableUrl rule. Parsing moves to a dedicated FeedParser
service; the fetch keeps the SSRF guard and gains XXE-safe parsing.
2026-06-16 13:56:08 +00:00
|
|
|
use App\Services\Automation\ExpressionResolver;
|
|
|
|
|
use App\Services\Automation\FeedParser;
|
|
|
|
|
use App\Services\Brand\SafeHttpFetcher;
|
2026-05-24 12:17:19 +00:00
|
|
|
use Illuminate\Http\JsonResponse;
|
|
|
|
|
use Illuminate\Http\RedirectResponse;
|
2026-06-13 19:30:32 +00:00
|
|
|
use Illuminate\Http\Response as HttpResponse;
|
2026-05-24 12:17:19 +00:00
|
|
|
use Inertia\Inertia;
|
|
|
|
|
use Inertia\Response;
|
feat(automations): multi-format RSS/Atom feeds with dynamic variables
Replace the RSS-2.0-only SimpleXML parser with SimplePie so the Fetch RSS
node reads Atom 1.0 (YouTube, GitHub, The Verge…) and RSS 2.0 + namespace
extensions (dc:, content:, media:, yt:, itunes:). Each item exposes stable
cross-format aliases (title, link, date, content, author, …) plus every
namespaced field flattened for use as {{ fetched.* }}.
Add a feed-inspection endpoint that discovers a feed's real fields and feeds
them into the editor's expression autocomplete. Allow {{ }} expressions in the
feed URL via a ResolvableUrl rule. Parsing moves to a dedicated FeedParser
service; the fetch keeps the SSRF guard and gains XXE-safe parsing.
2026-06-16 13:56:08 +00:00
|
|
|
use RuntimeException;
|
|
|
|
|
use Symfony\Component\HttpFoundation\Response as SymfonyResponse;
|
2026-05-24 12:17:19 +00:00
|
|
|
|
|
|
|
|
class AutomationController extends Controller
|
|
|
|
|
{
|
2026-06-10 21:10:13 +00:00
|
|
|
public function index(ListAutomations $list): Response
|
2026-05-24 12:17:19 +00:00
|
|
|
{
|
2026-06-22 19:31:54 +00:00
|
|
|
$this->authorize('viewAny', Automation::class);
|
|
|
|
|
|
2026-06-10 21:10:13 +00:00
|
|
|
$workspace = request()->user()->currentWorkspace;
|
|
|
|
|
|
2026-05-24 12:17:19 +00:00
|
|
|
$automations = Inertia::scroll(fn () => AutomationResource::collection(
|
2026-06-10 21:10:13 +00:00
|
|
|
$list($workspace)
|
2026-05-24 12:17:19 +00:00
|
|
|
));
|
|
|
|
|
|
|
|
|
|
return Inertia::render('automations/Index', [
|
|
|
|
|
'automations' => $automations,
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function store(StoreAutomationRequest $request, CreateAutomation $create): RedirectResponse
|
|
|
|
|
{
|
2026-06-22 19:31:54 +00:00
|
|
|
$this->authorize('create', Automation::class);
|
|
|
|
|
|
2026-05-24 12:17:19 +00:00
|
|
|
$automation = $create(
|
|
|
|
|
$request->user()->currentWorkspace,
|
|
|
|
|
$request->user(),
|
|
|
|
|
);
|
|
|
|
|
|
2026-06-12 22:19:46 +00:00
|
|
|
return redirect()->route('app.automations.workflow', $automation->id);
|
2026-05-24 12:17:19 +00:00
|
|
|
}
|
|
|
|
|
|
2026-06-12 22:19:46 +00:00
|
|
|
public function show(Automation $automation): RedirectResponse
|
|
|
|
|
{
|
2026-06-22 19:31:54 +00:00
|
|
|
$this->authorize('view', $automation);
|
|
|
|
|
|
2026-07-18 13:58:07 +00:00
|
|
|
// A draft opens on the builder to be set up; a live automation (active
|
|
|
|
|
// or paused) opens on its metrics, where the user watches it run.
|
|
|
|
|
$tab = $automation->status === Status::Draft ? 'workflow' : 'metrics';
|
|
|
|
|
|
|
|
|
|
return redirect()->route("app.automations.{$tab}", $automation->id);
|
2026-06-12 22:19:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function workflow(Automation $automation, GetAutomationEditorData $editorData): Response
|
2026-05-24 12:17:19 +00:00
|
|
|
{
|
|
|
|
|
$this->authorize('update', $automation);
|
|
|
|
|
|
2026-06-10 21:10:13 +00:00
|
|
|
['socialAccounts' => $socialAccounts, 'pinterestBoards' => $pinterestBoards, 'tiktokCreatorInfos' => $tiktokCreatorInfos] = $editorData($automation);
|
2026-05-24 12:17:19 +00:00
|
|
|
|
|
|
|
|
$platformConfigs = $socialAccounts->mapWithKeys(fn ($account) => [
|
|
|
|
|
$account->id => new PlatformConfigResource($account),
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
return Inertia::render('automations/Form', [
|
|
|
|
|
'automation' => AutomationResource::make($automation),
|
|
|
|
|
'socialAccounts' => SocialAccountResource::collection($socialAccounts),
|
|
|
|
|
'platformConfigs' => $platformConfigs,
|
|
|
|
|
'pinterestBoards' => $pinterestBoards,
|
|
|
|
|
'tiktokCreatorInfos' => $tiktokCreatorInfos,
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
|
2026-06-12 22:19:46 +00:00
|
|
|
public function invocations(Automation $automation, GetAutomationInvocations $invocations): Response
|
|
|
|
|
{
|
|
|
|
|
$this->authorize('view', $automation);
|
|
|
|
|
|
|
|
|
|
$status = request()->string('status')->toString() ?: null;
|
|
|
|
|
$search = request()->string('search')->toString() ?: null;
|
|
|
|
|
|
|
|
|
|
return Inertia::render('automations/Invocations', [
|
|
|
|
|
'automation' => AutomationResource::make($automation),
|
|
|
|
|
'invocations' => Inertia::scroll(fn () => AutomationInvocationResource::collection(
|
|
|
|
|
$invocations($automation, $status, $search)
|
|
|
|
|
)),
|
|
|
|
|
'filters' => [
|
|
|
|
|
'status' => $status,
|
|
|
|
|
'search' => $search,
|
|
|
|
|
],
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function settings(Automation $automation): Response
|
|
|
|
|
{
|
|
|
|
|
$this->authorize('view', $automation);
|
|
|
|
|
|
|
|
|
|
return Inertia::render('automations/Settings', [
|
|
|
|
|
'automation' => AutomationResource::make($automation),
|
|
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function metrics(Automation $automation, GetAutomationMetrics $metrics): Response
|
2026-05-24 12:17:19 +00:00
|
|
|
{
|
|
|
|
|
$this->authorize('view', $automation);
|
|
|
|
|
|
2026-06-12 22:19:46 +00:00
|
|
|
$end = (request()->date('end') ?? now())->startOfDay();
|
|
|
|
|
$start = (request()->date('start') ?? now()->subDays(6))->startOfDay();
|
|
|
|
|
|
|
|
|
|
if ($start->greaterThan($end)) {
|
|
|
|
|
[$start, $end] = [$end, $start];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Cap the window so a hand-edited URL can't request a multi-year, daily
|
|
|
|
|
// bucketed series.
|
|
|
|
|
if ($start->diffInDays($end) > 366) {
|
|
|
|
|
$start = $end->copy()->subDays(366);
|
|
|
|
|
}
|
2026-06-10 21:10:13 +00:00
|
|
|
|
2026-06-12 22:19:46 +00:00
|
|
|
return Inertia::render('automations/Metrics', [
|
2026-05-24 12:17:19 +00:00
|
|
|
'automation' => AutomationResource::make($automation),
|
2026-06-12 22:19:46 +00:00
|
|
|
'metrics' => $metrics($automation, $start, $end),
|
|
|
|
|
'filters' => [
|
|
|
|
|
'start' => $start->toDateString(),
|
|
|
|
|
'end' => $end->toDateString(),
|
|
|
|
|
],
|
2026-05-24 12:17:19 +00:00
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function update(UpdateAutomationRequest $request, Automation $automation, UpdateAutomation $update): RedirectResponse
|
|
|
|
|
{
|
|
|
|
|
$this->authorize('update', $automation);
|
|
|
|
|
|
|
|
|
|
$update($automation, $request->validated());
|
|
|
|
|
|
|
|
|
|
return back();
|
|
|
|
|
}
|
|
|
|
|
|
2026-06-10 21:10:13 +00:00
|
|
|
public function destroy(Automation $automation, DeleteAutomation $delete): RedirectResponse
|
2026-05-24 12:17:19 +00:00
|
|
|
{
|
|
|
|
|
$this->authorize('delete', $automation);
|
2026-06-10 21:10:13 +00:00
|
|
|
$delete($automation);
|
2026-05-24 12:17:19 +00:00
|
|
|
|
|
|
|
|
session()->flash('flash.banner', __('automations.flash.deleted'));
|
|
|
|
|
session()->flash('flash.bannerStyle', 'success');
|
|
|
|
|
|
|
|
|
|
return redirect()->route('app.automations.index');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function activate(ActivateAutomationRequest $request, Automation $automation, ActivateAutomation $activate): RedirectResponse
|
|
|
|
|
{
|
|
|
|
|
$this->authorize('activate', $automation);
|
|
|
|
|
|
|
|
|
|
$activate($automation);
|
|
|
|
|
|
|
|
|
|
return back();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function pause(PauseAutomationRequest $request, Automation $automation, PauseAutomation $pause): RedirectResponse
|
|
|
|
|
{
|
|
|
|
|
$this->authorize('pause', $automation);
|
|
|
|
|
|
|
|
|
|
$pause($automation);
|
|
|
|
|
|
|
|
|
|
return back();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function retryRun(
|
|
|
|
|
RetryRunRequest $request,
|
|
|
|
|
RetryRunFromNode $retry,
|
|
|
|
|
Automation $automation,
|
|
|
|
|
AutomationRun $run,
|
2026-06-13 19:30:32 +00:00
|
|
|
): HttpResponse {
|
2026-05-24 12:17:19 +00:00
|
|
|
$this->authorize('update', $automation);
|
|
|
|
|
abort_unless($run->automation_id === $automation->id, 404);
|
|
|
|
|
|
|
|
|
|
$nodeId = $request->validated('node_id') ?? $run->current_node_id;
|
|
|
|
|
$retry($run, $nodeId);
|
|
|
|
|
|
|
|
|
|
return response()->noContent();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function test(TestAutomationRequest $request, Automation $automation, TestAutomation $test): JsonResponse
|
|
|
|
|
{
|
|
|
|
|
$this->authorize('update', $automation);
|
|
|
|
|
|
|
|
|
|
$run = $test($automation, (bool) $request->validated('with_real_data', false));
|
|
|
|
|
|
|
|
|
|
return response()->json(['run_id' => $run->id]);
|
|
|
|
|
}
|
|
|
|
|
|
feat(automations): multi-format RSS/Atom feeds with dynamic variables
Replace the RSS-2.0-only SimpleXML parser with SimplePie so the Fetch RSS
node reads Atom 1.0 (YouTube, GitHub, The Verge…) and RSS 2.0 + namespace
extensions (dc:, content:, media:, yt:, itunes:). Each item exposes stable
cross-format aliases (title, link, date, content, author, …) plus every
namespaced field flattened for use as {{ fetched.* }}.
Add a feed-inspection endpoint that discovers a feed's real fields and feeds
them into the editor's expression autocomplete. Allow {{ }} expressions in the
feed URL via a ResolvableUrl rule. Parsing moves to a dedicated FeedParser
service; the fetch keeps the SSRF guard and gains XXE-safe parsing.
2026-06-16 13:56:08 +00:00
|
|
|
public function inspectFeed(
|
|
|
|
|
InspectFeedRequest $request,
|
|
|
|
|
Automation $automation,
|
|
|
|
|
ExpressionResolver $resolver,
|
|
|
|
|
SafeHttpFetcher $safeHttp,
|
|
|
|
|
FeedParser $parser,
|
|
|
|
|
): JsonResponse|FeedInspectionResource {
|
|
|
|
|
$this->authorize('update', $automation);
|
|
|
|
|
|
|
|
|
|
$feedUrl = $resolver->resolve(
|
MCP: workspace settings, viewer read access, and token access (#241)
* Add workspace MCP settings and token access controls.
Ship MCP settings UI, OAuth revoke/list helpers, Passport deploy wiring,
and workspace.token:mcp gating so assistants can connect without pulling
in welcome/onboarding from the parent epic.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Type MCP client config shapes instead of string checks.
Encode http/config-root on each advanced client and tighten primary
client ids so snippet generation does not branch on magic strings.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Polish MCP settings follow-ups from review.
Translate Ukrainian MCP copy, deep-link ChatGPT into connector
creation, drop an unused asset and revoke arg, and assert PATs are
rejected on the MCP endpoint.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Harden MCP connected clients, revoke scope, and OAuth consent.
List recoverable sessions with live refresh tokens, revoke only PATs,
throttle registration alone, and block viewers from authorizing MCP.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Simplify MCP OAuth route throttling to a single middleware group.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Allow workspace viewers read-only MCP access with web policy writes.
Mirror the web app: MCP connects on view + OAuth mcp:use, write tools
enforce createPost/update/delete/manageAccounts/manageTeam, and demotion
to Viewer keeps grants. Cover role denials, consent, and disconnect.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Harden MCP tool authz with shared workspace helpers.
Route ApiKey tools through AuthorizesMcpTool, fail closed on null user
or policy argument, and resolve the current workspace before mutating.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Drop redundant string casts on validated request data.
Enum::from and validated() fields are already strings, so the casts
add noise without changing behavior.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Show only the current user's MCP connections in settings.
Match API keys privacy: list and disconnect your own OAuth clients,
not teammates' across the account.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Cover LoadWorkspaceFromToken gaps and harden AuthorizesMcpTool tests.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Drop redundant is_string guard before UpdatePostTool find.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Refactor AppSidebar to always show MCP link and simplify route middleware definition in ai.php. The MCP link is now consistently displayed regardless of the current workspace state, and the route middleware syntax has been streamlined.
* Refresh MCP connected clients with Inertia usePoll.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Bump laravel/mcp to 0.9.1 and add the TryPost server icon.
Requires laravel/boost 2.5 for the Icon attribute; expose images/trypost/icon.png on TryPostServer.
Co-authored-by: Cursor <cursoragent@cursor.com>
* Drop no-op ReflectionClass import in TryPostServerTest.
Co-authored-by: Cursor <cursoragent@cursor.com>
---------
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-06 12:54:51 +00:00
|
|
|
$request->validated('feed_url'),
|
feat(automations): multi-format RSS/Atom feeds with dynamic variables
Replace the RSS-2.0-only SimpleXML parser with SimplePie so the Fetch RSS
node reads Atom 1.0 (YouTube, GitHub, The Verge…) and RSS 2.0 + namespace
extensions (dc:, content:, media:, yt:, itunes:). Each item exposes stable
cross-format aliases (title, link, date, content, author, …) plus every
namespaced field flattened for use as {{ fetched.* }}.
Add a feed-inspection endpoint that discovers a feed's real fields and feeds
them into the editor's expression autocomplete. Allow {{ }} expressions in the
feed URL via a ResolvableUrl rule. Parsing moves to a dedicated FeedParser
service; the fetch keeps the SSRF guard and gains XXE-safe parsing.
2026-06-16 13:56:08 +00:00
|
|
|
['variables' => $automation->resolvedVariables()],
|
|
|
|
|
);
|
|
|
|
|
|
2026-06-16 15:09:16 +00:00
|
|
|
// SafeHttpFetcher::get() bundles the SSRF guard, a request timeout, a
|
|
|
|
|
// redirect cap and a branded user-agent — so a slow or hostile feed can't
|
|
|
|
|
// hang this synchronous request. It throws on SSRF, timeout or non-2xx.
|
feat(automations): multi-format RSS/Atom feeds with dynamic variables
Replace the RSS-2.0-only SimpleXML parser with SimplePie so the Fetch RSS
node reads Atom 1.0 (YouTube, GitHub, The Verge…) and RSS 2.0 + namespace
extensions (dc:, content:, media:, yt:, itunes:). Each item exposes stable
cross-format aliases (title, link, date, content, author, …) plus every
namespaced field flattened for use as {{ fetched.* }}.
Add a feed-inspection endpoint that discovers a feed's real fields and feeds
them into the editor's expression autocomplete. Allow {{ }} expressions in the
feed URL via a ResolvableUrl rule. Parsing moves to a dedicated FeedParser
service; the fetch keeps the SSRF guard and gains XXE-safe parsing.
2026-06-16 13:56:08 +00:00
|
|
|
try {
|
2026-06-16 15:09:16 +00:00
|
|
|
$response = $safeHttp->get($feedUrl);
|
feat(automations): multi-format RSS/Atom feeds with dynamic variables
Replace the RSS-2.0-only SimpleXML parser with SimplePie so the Fetch RSS
node reads Atom 1.0 (YouTube, GitHub, The Verge…) and RSS 2.0 + namespace
extensions (dc:, content:, media:, yt:, itunes:). Each item exposes stable
cross-format aliases (title, link, date, content, author, …) plus every
namespaced field flattened for use as {{ fetched.* }}.
Add a feed-inspection endpoint that discovers a feed's real fields and feeds
them into the editor's expression autocomplete. Allow {{ }} expressions in the
feed URL via a ResolvableUrl rule. Parsing moves to a dedicated FeedParser
service; the fetch keeps the SSRF guard and gains XXE-safe parsing.
2026-06-16 13:56:08 +00:00
|
|
|
} catch (RuntimeException) {
|
|
|
|
|
return response()->json(['message' => __('automations.errors.fetch_rss_request_failed')], SymfonyResponse::HTTP_UNPROCESSABLE_ENTITY);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$items = $parser->parse($response->body());
|
|
|
|
|
|
|
|
|
|
if ($items === null) {
|
|
|
|
|
return response()->json(['message' => __('automations.errors.fetch_rss_malformed')], SymfonyResponse::HTTP_UNPROCESSABLE_ENTITY);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return new FeedInspectionResource($items[0] ?? []);
|
|
|
|
|
}
|
|
|
|
|
|
2026-05-24 12:17:19 +00:00
|
|
|
public function showRun(Automation $automation, AutomationRun $run): JsonResponse
|
|
|
|
|
{
|
|
|
|
|
$this->authorize('view', $automation);
|
|
|
|
|
abort_unless($run->automation_id === $automation->id, 404);
|
|
|
|
|
|
Add expression autocomplete, side-panel editor, and richer HTTP fetch
Automations editor:
- {{ }} expression autocomplete in CodeMirror, scoped to the braces and
graph-aware (suggests only what upstream nodes provide + variables + now);
migrate the Generate prompt to CodeMirror so it shares the same completions
- Expandable editors: an expand button slides out a side-by-side panel
(matching the sidebar card), with a minimize control; the inline field
collapses to a hint while editing in the panel
- Hover-revealed editor toolbar (expand/copy) with styled tooltips so the
buttons no longer obscure the text while reading
- Beta badge on the Automations sidebar item
- Delete a single connection with Backspace/Delete (edge selection)
- Re-key node config so switching between same-type nodes refreshes the form
HTTP fetch node — cover every JSON response shape:
- Top-level array, object map (items_path=*), array of primitives, and NDJSON
- Key-based dedup via item_key_path (seen-set, FIFO-capped) for feeds without
dates; first poll records a baseline and emits nothing (date path too)
Fan-out test visibility:
- root_run_id links every forked branch back to the run that started a test,
so the test panel aggregates all branches instead of one
Fix a few pre-existing type issues (ScheduleData import, padded minute,
optional created_at).
2026-06-12 14:31:58 +00:00
|
|
|
// Aggregate the node runs of every branch forked by a fan-out so the test
|
|
|
|
|
// panel shows the whole execution, not just the branch the root walked.
|
|
|
|
|
$rootId = $run->rootId();
|
|
|
|
|
|
|
|
|
|
$nodeRuns = AutomationNodeRun::query()
|
|
|
|
|
->whereHas('run', fn ($query) => $query
|
|
|
|
|
->where('id', $rootId)
|
|
|
|
|
->orWhere('root_run_id', $rootId))
|
|
|
|
|
->orderBy('started_at')
|
|
|
|
|
->orderBy('id')
|
|
|
|
|
->get();
|
2026-05-24 12:17:19 +00:00
|
|
|
|
|
|
|
|
return response()->json([
|
|
|
|
|
'run' => AutomationRunResource::make($run)->resolve(),
|
Add expression autocomplete, side-panel editor, and richer HTTP fetch
Automations editor:
- {{ }} expression autocomplete in CodeMirror, scoped to the braces and
graph-aware (suggests only what upstream nodes provide + variables + now);
migrate the Generate prompt to CodeMirror so it shares the same completions
- Expandable editors: an expand button slides out a side-by-side panel
(matching the sidebar card), with a minimize control; the inline field
collapses to a hint while editing in the panel
- Hover-revealed editor toolbar (expand/copy) with styled tooltips so the
buttons no longer obscure the text while reading
- Beta badge on the Automations sidebar item
- Delete a single connection with Backspace/Delete (edge selection)
- Re-key node config so switching between same-type nodes refreshes the form
HTTP fetch node — cover every JSON response shape:
- Top-level array, object map (items_path=*), array of primitives, and NDJSON
- Key-based dedup via item_key_path (seen-set, FIFO-capped) for feeds without
dates; first poll records a baseline and emits nothing (date path too)
Fan-out test visibility:
- root_run_id links every forked branch back to the run that started a test,
so the test panel aggregates all branches instead of one
Fix a few pre-existing type issues (ScheduleData import, padded minute,
optional created_at).
2026-06-12 14:31:58 +00:00
|
|
|
'node_runs' => AutomationNodeRunResource::collection($nodeRuns)->resolve(),
|
2026-05-24 12:17:19 +00:00
|
|
|
]);
|
|
|
|
|
}
|
|
|
|
|
}
|