Commit Graph

9 Commits

Author SHA1 Message Date
Jeff Emmett 6a335e4dba fix(rsocials): include Postiz platform-specific settings defaults
Postiz's POST /public/v1/posts validates required per-platform fields on
settings (e.g. X needs who_can_reply_post). Added defaultSettingsFor()
covering x, linkedin, instagram, youtube.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-17 11:03:21 -04:00
Jeff Emmett 1cde95f3fc fix(rsocials): Postiz createPost/createThread use nested posts[] shape
Postiz's /public/v1/posts expects a nested envelope:
  { type, date, shortLink, tags, posts: [{ integration:{id}, value:[{content}], settings:{__type} }] }

The earlier shim's flat {content, integrationIds, type, scheduledAt} was
rejected with "All posts must have an integration id" (the field is named
integration, not integrationIds; it's a nested object, not an array of strings).

Also: Postiz treats PostItem.value[] as thread segments, so createThread now
sends ONE request with multiple value entries rather than N grouped posts.

Callers now pass full {id, identifier} tuples so settings.__type is set
correctly (otherwise Postiz can't route to the provider handler).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-17 10:49:18 -04:00
Jeff Emmett 878646a399 fix(rsocials): Postiz public API uses raw key + /api prefix, not Bearer
Postiz's Nest backend expects Authorization: <apiKey> (no "Bearer"
prefix) and the public API is reverse-proxied at
<hostname>/api/public/v1/*. Our client was hitting /public/v1/*
directly and using Bearer, which 401'd.

Tolerate both config.url shapes (with or without /api) so older
module settings that point at the root host keep working.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-17 10:40:17 -04:00
Jeff Emmett 5c32119946 feat(rsocials): auto-push scheduled posts to Postiz + reconcile published state
Per-post "Schedule to Postiz" button on Post nodes (rSpace → Postiz), a 60s
server sweep that auto-pushes Scheduled posts within a 10min lead window,
and a Postiz → rSpace reconcile poll that flips postizStatus to
'published' (or 'failed') and records publishedAt + releaseURL.

- schemas: PostNodeData gains postizPostId, postizIntegrationId,
  postizStatus, postizError, postizSentAt, postizCheckedAt,
  postizReleaseURL, publishedAt.
- postiz-client: listPosts(startDate, endDate) for reconciliation.
- mod.ts: sendCampaignNodeToPostiz() helper, POST /api/campaign/flows/
  :flowId/nodes/:nodeId/send-postiz, postizSweep() + postizReconcile()
  wired into onInit via startPostizScheduler.
- folk-campaign-planner: button + status badge in Post inspector,
  timeline/table dot colors reflect postizStatus (queued=purple,
  published=green, failed=red). Timeline bucket stays by scheduledAt.
- campaign-planner.css: postiz state pill styles.
- Bump campaign-planner JS/CSS to ?v=2 to bust CF cache.

Mock-Postiz smoke against the client lib passes 20/20 assertions.
Live Postiz round-trip pending deploy to Netcup.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-17 10:28:26 -04:00
Jeff Emmett 7c29ccea41 feat(rinbox): bridge Listmonk newsletter campaigns with multisig approval
Newsletter campaigns now require N-of-M team member approval via rInbox
before Listmonk starts sending. The send-newsletter workflow node creates
a draft campaign and gates it through the team inbox; a manual submit-
approval route is also available. The multisig email UI shows a green
"Newsletter Approval" badge with campaign ID for newsletter approvals.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-21 15:03:06 -07:00
Jeff Emmett 0c9b07525f feat(rsocials): merge Posts & Threads nav + Postiz API integration
Rename "Threads" to "Posts & Threads" in hub nav, route title, and subPageInfos.
Thread gallery now shows draft/scheduled posts from campaigns alongside threads.
Add Postiz API client (postiz-client.ts) with settings schema for URL + API key.
Proxy routes: /api/postiz/status, integrations, posts, threads.
Wire workflow executor to call real Postiz API for post/thread/cross-post nodes.
Add "Send to Postiz" button in thread builder (editor + readonly views).
Add approval queue: PendingApproval schema (v5), GET/POST /api/approvals routes,
wait-approval workflow node creates pending approvals and pauses execution.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 14:28:22 -07:00
Jeff Emmett c92ca0fe05 feat(rsocials): newsletter manager + listmonk proxy + backlog tasks
Add Listmonk newsletter management proxy API with role-based auth,
newsletter manager component, password setting type support, and
new backlog task files. Update newsletter subscribe URL.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-10 12:24:02 -07:00
Jeff Emmett f8557b1940 feat: upgrade thread image prompts to memetic infographic style
Replace generic "dark themed, minimal" prompts with detailed
infographic-style prompts that generate bold, shareable visuals
with typography overlays, iconic symbols, and data-viz elements.

Add try/catch error handling around fal.ai calls to prevent
unhandled network errors from crashing the request handler.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-05 20:44:08 -08:00
Jeff Emmett 831c8b1c24 feat: refactor rSocials from monolith to full rApp
Decompose the 2,116-line mod.ts into a canonical rApp matching the
rFlows/rBooks pattern with Automerge sync, web components, and
extracted CSS.

New files:
- schemas.ts: SocialsDoc, ThreadData, Campaign types + Automerge schema
- local-first-client.ts: browser-side sync client
- lib/types.ts: shared types, DEMO_FEED, PLATFORM_LIMITS
- lib/image-gen.ts: server-only fal.ai + file upload helpers
- components/folk-thread-builder.ts: compose/preview/readonly component
- components/folk-thread-gallery.ts: thread listing grid component
- components/folk-campaign-manager.ts: campaign viewer with import modal
- components/socials.css: all extracted CSS (~550 lines)

mod.ts slimmed to ~616 lines: ensureDoc, image APIs, page routes
injecting <folk-*> web components, file→Automerge migration, seed
template, and module export. Thread/campaign CRUD moved from REST
to Automerge local-first sync.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 20:42:18 -08:00