Commit graph

749 commits

Author SHA1 Message Date
Paulo Castellano
5ccd00ffa2
Merge branch 'main' into main 2026-06-16 18:57:08 -03:00
Paulo Castellano
ce1073918a
Merge pull request #101 from trypostit/feat/mcp-api-platform-meta
Full per-platform meta parity for posts (API + MCP)
2026-06-16 18:14:46 -03:00
Paulo Castellano
40425d7bdc test,refactor: review fixes for per-platform meta parity
- Assert nested Discord meta keys (mention token/label, embed title/color)
  survive validated(), replacing a vacuous coalesced assertion.
- Cover the MCP publish guard for TikTok privacy and Pinterest board, not
  just Discord.
- Use assertUnprocessable() to match sibling API tests; type-hint the API
  UpdatePostRequest withValidator closure.
2026-06-16 18:11:29 -03:00
Paulo Castellano
bf399c80fa docs: document the single-source PostPlatform.meta validation rule
Record in CLAUDE.md that all platforms.*.meta validation and required-on-publish
logic lives only in PostPlatformMetaRules, why (validated() strips unlisted keys),
and where to add new per-platform meta + tests.
2026-06-16 17:52:50 -03:00
Paulo Castellano
ba20534a6d refactor(meta): own the platforms.*.meta parent rule in PostPlatformMetaRules
The shared rules() returned only meta sub-keys, so every caller still repeated
its own 'platforms.*.meta' => array parent (with slightly different sometimes/
nullable combos). Fold the parent into rules() with a single safe contract so
callers just spread one source for the whole meta block.
2026-06-16 17:50:40 -03:00
Paulo Castellano
3aa4b2a2f0 test(api,mcp): cover per-platform meta across networks
Broaden the post meta tests beyond Discord: store persists Instagram aspect
ratio, Pinterest board, TikTok privacy + flags; API update enforces TikTok
privacy and Pinterest board on publish and allows drafts without required meta;
MCP update merges meta and the publish guard ignores disabled platforms.
2026-06-16 17:44:27 -03:00
Paulo Castellano
bdea56d5e1 feat(api,mcp): full per-platform meta parity for posts
Centralize per-platform PostPlatform.meta validation in PostPlatformMetaRules
(shared by web, REST API and MCP). The API and MCP previously only accepted
aspect_ratio, silently stripping channel_id/board_id/privacy_level and the rest
via validated(), so Discord/Pinterest/TikTok couldn't be configured or published
through those entry points. Now all per-platform meta is accepted and persisted,
required-on-publish is enforced on API update (TikTok privacy, Pinterest board,
Discord channel), and the MCP publish tool guards a post's stored meta before
dispatching. Adds API + MCP tests and a PostPlatform discord() factory state.
2026-06-16 17:39:07 -03:00
Paulo Castellano
206d01f77e
Merge pull request #100 from trypostit/feat/discord-channel
feat(channels): add Discord as a social channel
2026-06-16 17:13:47 -03:00
Paulo Castellano
cc8f6625a1 feat(channels): Discord post-level engagement metrics
Add per-post Discord metrics (server member count, thread replies as comments,
and reaction counts) read live with the bot token via GET message + guild
with_counts, wired into PostMetricsFetcher. Redesign the shared post metrics
row: monochrome line icons for member/comment counts vs clean reaction pills,
so audience stats read distinctly from reactions. Applies to Telegram too.
2026-06-16 17:05:13 -03:00
Paulo Castellano
bf0494fbe6 fix(channels): restrict Discord picker to postable channels the bot can use
Only text (0) and announcement (5) channels accept a direct message — forum
(15) and media (16) require thread creation, so they're dropped from the
picker (they returned 'non-text channel'). Channels are also filtered by the
bot's effective VIEW_CHANNEL + SEND_MESSAGES, computed from role base perms and
channel overwrites (Discord's documented algorithm), with a safe fallback to
type-only filtering when the bot's roles can't be resolved.
2026-06-16 16:34:02 -03:00
Paulo Castellano
df81532c67 feat(channels): show channel + mentions in Discord preview, light theme
Persist channel_name (display-only) so the preview header shows the chosen
channel; render mentions as pills; restyle the preview to a light theme to
match the rest of the app.
2026-06-16 16:14:59 -03:00
Paulo Castellano
3547b471ea feat(discord): implement channel caching and enhance UI for channel selection
- Introduced caching for Discord channel lookups, reducing API calls and improving performance.
- Updated the DiscordSettings component to use a SearchableSelect for better user experience when selecting channels.
- Added new language strings for channel search and no channels found messages in English, Spanish, and Portuguese.
- Updated tests to ensure channel list caching is isolated between runs.
2026-06-16 15:53:20 -03:00
Paulo Castellano
47c3b4a9e9 chore(channels): document Discord env vars in .env.example 2026-06-16 15:28:58 -03:00
Paulo Castellano
5a54bf17fb fix(channels): discord review round 5 — asset, channel fallback, media test
- Add a placeholder discord.png so the brand mark isn't a broken image
  (operators can swap in the official logo).
- Keep a saved Discord channel selectable before the live channel list loads
  (or if the lookup is unavailable), so editing a post never loses the channel.
- Cover the media multipart upload path (payload_json + files[N]) with a test.
2026-06-16 15:04:46 -03:00
Paulo Castellano
c2dd4515b2 feat(channels): add Discord as a social channel
Connect a Discord server via OAuth (bot authorization) and schedule/publish
messages to its channels, with mentions and rich embeds.

- Connect: custom Socialite Discord provider (bot scope) maps the authorized
  guild to a SocialAccount; throws if no server was authorized.
- Publish: DiscordPublisher posts via the global bot token, validates the chosen
  channel belongs to the connected guild (anti cross-guild), optimizes media,
  builds allowed_mentions only from explicit mention chips (no accidental pings),
  and renders rich embeds.
- Compose: per-post channel picker (live lookup), mention autocomplete and an
  embed editor, gated by a required-channel compliance rule; Discord post preview.
- Enum/config/content-type wiring, ConnectionVerifier health check, throttled
  lookup endpoints, i18n (en/es/pt-BR), and tests.

Operators must create a Discord application and set DISCORD_CLIENT_ID,
DISCORD_CLIENT_SECRET, DISCORD_BOT_TOKEN and DISCORD_CLIENT_REDIRECT.
2026-06-16 14:44:00 -03:00
Paulo Castellano
7d52ea72c5
Merge pull request #99 from trypostit/feat/rss-multiformat-simplepie
feat(automations): multi-format RSS/Atom feeds with dynamic variables
2026-06-16 12:24:24 -03:00
Paulo Castellano
45da024fc6 fix(automations): code-review hardening for feed fetch & URL validation
- inspectFeed fetches via SafeHttpFetcher::get (SSRF guard + timeout + redirect
  cap + UA) instead of a raw, timeout-less Http::get; add a timeout to the node fetch.
- ResolvableUrl now requires an http(s) scheme, so it's no weaker than the plain
  url rule it replaced (rejects file://, javascript://).
- Apply ResolvableUrl to the HTTP Request and Webhook node URLs too, so templated
  {{ }} URLs validate consistently across every URL field.
- Clear a fetch_rss node's discovered_fields when its feed_url changes, so stale
  fields from the previous feed stop showing up as autocomplete suggestions.
2026-06-16 12:09:16 -03:00
Paulo Castellano
f55d35363f fix(automations): return null on any feed parse failure
Wrap FeedParser::parse in try/catch so an unexpected Throwable from third-party
feed content (not just invalid XML) maps to the clean fetch_rss_malformed
failure instead of bubbling up as an unhandled exception — matching the
failed()-not-throw pattern of the sibling HTTP node.
2026-06-16 12:09:16 -03:00
Paulo Castellano
b2932262cf fix(automations): reliably open a node's config when switching nodes
A click with a few px of jitter crossed Vue Flow's 1px drag threshold and was
treated as a drag, so onNodeClick never fired and the config panel didn't switch
between nodes. Raise nodeDragThreshold to 5 so normal clicks stay clicks, and
also select the node on drag start as a safety net.
2026-06-16 11:26:05 -03:00
Paulo Castellano
109ad7dfc0 fix(automations): preview shows the newest feed item, not the oldest
A manual/dry "test with real data" run surfaces a single item and never fans
out, but it was taking the oldest new item (items are sorted oldest-first for
production fan-out). Surface the newest item in preview instead — what the user
expects to test against. Real runs are unchanged. Works for every feed format.
2026-06-16 11:26:05 -03:00
Paulo Castellano
4bb7d450a3 chore(release): link GitHub release in changelog email + add v1.0.2 artifacts
Tweak the /release command's email template (GitHub release link in the byline,
"Paulo from TryPost.it" signature) and add the generated v1.0.2 release notes.
2026-06-16 11:09:25 -03:00
Paulo Castellano
3acaafb81e test(automations): extract inline feed XML into shared fixtures
Move the RSS sample feeds out of inline heredocs/constants in FetchRssNodeTest
into tests/fixtures/feeds/, matching the parser fixtures. Centralize the
feedFixture() loader in tests/Pest.php and use it across the feed tests.
2026-06-16 11:06:46 -03:00
Paulo Castellano
246a159f34 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 10:56:08 -03:00
Sebastian Albert
fdb55e88a3
Rename project from 'post.fotohof.at' to 'trypost' 2026-06-15 21:59:00 +02:00
Sebastian Albert
8e2ae4d589
Merge branch 'trypostit:main' into main 2026-06-15 21:57:28 +02:00
Paulo Castellano
b18b9b2303
Merge pull request #98 from trypostit/feat/discord-widget
feat(discord): global floating Discord widget
2026-06-15 13:28:20 -03:00
Paulo Castellano
f41b28c31d feat(discord): global floating Discord widget with PostHog tracking
- Fixed bottom-right Discord button (indies-club style) linking to
  https://trypost.it/discord, mounted globally in AppSidebarLayout
- Captures discord.clicked (placement: floating_widget) via captureEvent
- i18n label + aria-label in common.php (en, es, pt-BR)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-15 13:23:03 -03:00
sebastian-works
c4c9d56fb9 fix: upgrade concurrently to v10, security updates 2026-06-14 23:40:40 +02:00
Paulo Castellano
c71234337d
Merge pull request #96 from trypostit/fix/past-due-no-forced-subscribe
Past-due access, reliable checkout.completed, and complete morph map
2026-06-14 16:18:51 -03:00
Paulo Castellano
65116de859 Register all models in the morph map + lock it with a test
Add the five automation models to Relation::enforceMorphMap(), document the
all-models-must-be-mapped rule in CLAUDE.md, and add MorphMapTest to fail
when any app/Models class is missing from the map.
2026-06-14 16:12:49 -03:00
Paulo Castellano
f223cf14ce Fire checkout.completed reliably for trial-with-card checkouts
A trial-with-card subscription is already subscribed() (status trialing)
by the time the webhook lands, so /billing/processing usually mounts
already-active and the false->true poll transition the event depended on
never happened — only 3 of 66 real subscriptions emitted checkout.completed.

Complete the purchase from whichever path runs first (onMounted when already
active, or the poll transition), de-duplicated per checkout session via a
one-time Cache::add gate on session_id so back-button/refresh can't re-fire.
2026-06-14 16:12:49 -03:00
Paulo Castellano
8e334cd676 Keep past_due subscribers in-app instead of forcing re-subscribe
A past_due subscription made subscribed() return false (Cashier default),
so EnsureAccountReady redirected to /subscribe — which starts a brand-new
checkout and creates a second subscription. Past-due users already have a
subscription; they only need to update their payment method.

Enable Cashier::keepPastDueSubscriptionsActive() so past_due counts as
active and users keep navigating. Surface a past-due notice in the sidebar
footer linking to the Stripe billing portal (not /subscribe). Both trial
modes (subscription trial / generic trial) are unaffected.
2026-06-14 15:46:17 -03:00
Paulo Castellano
11c27dfd62
Merge pull request #95 from trypostit/feat/telegram-channel
Add Telegram publishing channel
2026-06-14 14:46:33 -03:00
Paulo Castellano
c9f086ea94 Use formatNumberCompact helper in post platform metrics 2026-06-14 14:09:39 -03:00
Paulo Castellano
389177c25b Soften Telegram preview bubble shadow (drop trypost ink shadow) 2026-06-14 14:07:36 -03:00
Paulo Castellano
0c3c837bd3 Polish Telegram preview: simulate channel reactions 2026-06-14 13:58:14 -03:00
Paulo Castellano
548138f277 Render Telegram subscribers as an icon pill with divider before reactions 2026-06-14 13:53:57 -03:00
Paulo Castellano
a5b33f5b0a Show Telegram subscribers on post metrics; render reactions as compact pills 2026-06-14 13:50:12 -03:00
Paulo Castellano
fc1d51ca60 Telegram connect dialog: drop footer Close button, top-align icon 2026-06-14 13:35:03 -03:00
Paulo Castellano
b9fa8be513 Group Telegram service classes under Services/Social/Telegram 2026-06-14 13:32:03 -03:00
Paulo Castellano
80b68088a0 Type Telegram media kinds with a TelegramMediaType enum 2026-06-14 13:23:05 -03:00
Paulo Castellano
b6a3cb886c Centralize Telegram Bot API URL/token construction in a TelegramApi helper 2026-06-14 12:41:19 -03:00
Paulo Castellano
e907ad087f Lock Telegram @mention passthrough in sanitizer test 2026-06-14 11:40:55 -03:00
Paulo Castellano
c719480cf1 Harden Telegram reactions/analytics from PR review; add scoping + edge-case tests 2026-06-14 11:37:04 -03:00
Paulo Castellano
ba246a3ddd Add Telegram analytics: per-post reactions (webhook) + channel subscribers 2026-06-14 11:18:40 -03:00
Paulo Castellano
ce5d59a149 Detect Telegram connection via broadcast instead of polling 2026-06-14 10:58:13 -03:00
Paulo Castellano
f5d6c4a186 Fetch Telegram channel photo synchronously in the connect action (drop avatar job) 2026-06-14 10:30:17 -03:00
Paulo Castellano
f194bde58d Fall back to display_name for disconnect confirmation when username is null (Telegram) 2026-06-14 10:21:52 -03:00
Paulo Castellano
b9cc12aef7 Fetch Telegram channel photo as avatar; extract ConnectTelegramChannel action 2026-06-14 10:18:44 -03:00
Paulo Castellano
58eab0619b Use TelegramConnectStatus enum for connect status instead of magic strings 2026-06-14 09:59:36 -03:00