Add Confluence import, a Slack app per workspace, and GitHub, Linear and Figma link previews

Link previews: link cards for GitHub issues, pull requests and
repositories, Linear issues and Figma files are read through the
services' APIs and show a status pill (Open, Merged, In Progress…) and a
line of details. Public items need nothing; a workspace's tokens, set by
its admins under Workspace settings → Integrations and checked with each
service before being sealed, reach private ones and Linear.
GET /link-preview takes the workspace; the link card stores kind,
status, state and meta.

Slack: each workspace connects its own Slack app, made from a manifest
the settings page fills in. Docwell posts chosen page and comment events
to a channel (edits at most every 30 minutes per page), previews links
to Docwell pages posted in Slack, and answers /docwell with a search as
the member whose email matches the Slack user, shown only to them. Only
pages every member can open are posted or previewed. Requests from Slack
are signature-checked; the webhook dispatcher gained listeners so Slack
follows the same events.

Confluence: a space's HTML export imports with its page tree (from
index.html, else breadcrumbs), links between pages, pictures and
attachments. Panels become callouts, code macros code blocks with their
language, expand macros toggles, task lists to-dos.

New collection workspace_integrations (schema snapshot regenerated),
OpenAPI and generated Go, TypeScript and Dart types, strings in all five
languages, the user guide, and a rebuilt mobile editor bundle.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
tajniak81andClaude Opus 5.5 committed 2026-11-16 20:42:11 +01:00
1 parent 7fa5df53e5
commit f1963f1391
36 files changed
+5091 -103

No files matched your search

+185 -1
View File
@@ -1251,10 +1251,14 @@ paths:
description: >-
docwell-server fetches the page itself (public addresses only: private, loopback
and link-local ones are refused, redirects included). A page that can't be read
still gets a preview with its address and site name.
still gets a preview with its address and site name. GitHub issues, pull requests and
repositories, Linear issues and Figma files are read through their APIs and get a kind,
status and details; with workspace set (a workspace the caller belongs to), that
workspace's tokens reach private items.
security: [{ bearer: [] }]
parameters:
- { name: url, in: query, required: true, schema: { type: string, maxLength: 2000 } }
- { name: workspace, in: query, required: false, schema: { type: string } }
responses:
"200":
description: OK
@@ -3396,6 +3400,134 @@ paths:
"401": { $ref: "#/components/responses/Error" }
"403": { $ref: "#/components/responses/Error" }
"404": { $ref: "#/components/responses/Error" }
/api/v1/workspaces/{id}/integrations:
parameters:
- { name: id, in: path, required: true, schema: { type: string } }
get:
operationId: getWorkspaceIntegrations
tags: [integrations]
summary: The workspace's integrations (workspace admin)
security: [{ bearer: [] }]
responses:
"200":
description: OK
content:
application/json:
schema: { $ref: "#/components/schemas/WorkspaceIntegrations" }
"403": { $ref: "#/components/responses/Error" }
"404": { $ref: "#/components/responses/Error" }
/api/v1/workspaces/{id}/integrations/tokens/{service}:
parameters:
- { name: id, in: path, required: true, schema: { type: string } }
- { name: service, in: path, required: true, schema: { type: string, enum: [github, linear, figma] } }
put:
operationId: setIntegrationToken
tags: [integrations]
summary: Store a token for link previews (workspace admin); an empty token removes it
description: >-
The token is checked with the service first (GitHub /user, Linear viewer, Figma /v1/me), then
sealed. Link previews of members of the workspace use it to read private items.
security: [{ bearer: [] }]
requestBody:
required: true
content:
application/json:
schema:
type: object
required: [token]
properties:
token: { type: string, maxLength: 500 }
responses:
"200":
description: OK
content:
application/json:
schema: { $ref: "#/components/schemas/WorkspaceIntegrations" }
"400": { $ref: "#/components/responses/Error" }
"403": { $ref: "#/components/responses/Error" }
"404": { $ref: "#/components/responses/Error" }
/api/v1/workspaces/{id}/integrations/slack:
parameters:
- { name: id, in: path, required: true, schema: { type: string } }
put:
operationId: setSlackIntegration
tags: [integrations]
summary: Connect or change the workspace's Slack app (workspace admin); missing fields stay as they are
security: [{ bearer: [] }]
requestBody:
required: true
content:
application/json:
schema: { $ref: "#/components/schemas/SlackIntegrationInput" }
responses:
"200":
description: OK
content:
application/json:
schema: { $ref: "#/components/schemas/WorkspaceIntegrations" }
"400": { $ref: "#/components/responses/Error" }
"403": { $ref: "#/components/responses/Error" }
"404": { $ref: "#/components/responses/Error" }
delete:
operationId: deleteSlackIntegration
tags: [integrations]
summary: Disconnect Slack (workspace admin)
security: [{ bearer: [] }]
responses:
"200":
description: OK
content:
application/json:
schema: { $ref: "#/components/schemas/WorkspaceIntegrations" }
"403": { $ref: "#/components/responses/Error" }
"404": { $ref: "#/components/responses/Error" }
/api/v1/workspaces/{id}/integrations/slack/test:
parameters:
- { name: id, in: path, required: true, schema: { type: string } }
post:
operationId: testSlackIntegration
tags: [integrations]
summary: Post a hello to the Slack channel (workspace admin)
security: [{ bearer: [] }]
responses:
"204": { description: Posted }
"400": { $ref: "#/components/responses/Error" }
"403": { $ref: "#/components/responses/Error" }
"404": { $ref: "#/components/responses/Error" }
/api/v1/slack/{workspace}/events:
parameters:
- { name: workspace, in: path, required: true, schema: { type: string } }
post:
operationId: slackEvents
tags: [integrations]
summary: "Slack's Events API for one workspace's app: the URL check, and link_shared (Docwell link previews)"
description: >-
Called by Slack, signed with the app's Signing Secret (X-Slack-Signature, at most five minutes
old). Only pages every member of the workspace can open get a preview.
requestBody:
required: true
content:
application/json:
schema: { type: object, additionalProperties: true }
responses:
"200": { description: Taken (the URL check answers with its challenge) }
"401": { description: Bad or missing signature }
/api/v1/slack/{workspace}/commands:
parameters:
- { name: workspace, in: path, required: true, schema: { type: string } }
post:
operationId: slackCommands
tags: [integrations]
summary: "The /docwell slash command: a search as the Docwell member with the Slack user's email"
description: Called by Slack, signed like the events. The answer is shown only to the person who asked.
requestBody:
required: true
content:
application/x-www-form-urlencoded:
schema: { type: object, additionalProperties: true }
responses:
"200": { description: An ephemeral Slack message }
"401": { description: Bad or missing signature }
/api/v1/workspaces/{id}/webhooks:
parameters:
- { name: id, in: path, required: true, schema: { type: string } }
@@ -4463,6 +4595,58 @@ components:
description: { type: string }
image: { type: string, description: Address of the page's picture on its own site; empty when it has none }
site: { type: string }
kind:
type: string
description: For links read through a service's API (github.issue, github.pull, github.repo, linear.issue, figma.file)
status: { type: string, description: "The service's word for the item's state (Open, Merged, In Progress)" }
state:
type: string
description: The state for its colour
enum: [open, started, draft, merged, done, closed, canceled]
meta: { type: string, description: "A line of details (acme/app #12 · alice)" }
WorkspaceIntegrations:
type: object
required: [github, linear, figma, slack]
properties:
github: { $ref: "#/components/schemas/IntegrationToken" }
linear: { $ref: "#/components/schemas/IntegrationToken" }
figma: { $ref: "#/components/schemas/IntegrationToken" }
slack: { $ref: "#/components/schemas/SlackIntegration" }
IntegrationToken:
type: object
required: [set]
properties:
set: { type: boolean, description: A token is stored (it is never sent back) }
SlackIntegration:
type: object
required: [connected, hasSigningSecret, team, teamName, channel, channelName, events, unfurl, search, lastError, eventsUrl, commandsUrl, manifest]
properties:
connected: { type: boolean, description: A bot token is stored }
hasSigningSecret: { type: boolean }
team: { type: string, description: The Slack workspace id the bot belongs to }
teamName: { type: string }
channel: { type: string, description: The channel id posts go to; empty for none }
channelName: { type: string }
events: { type: array, items: { type: string }, description: Events posted to the channel }
unfurl: { type: boolean, description: Docwell links posted in Slack get a preview }
search: { type: boolean, description: /docwell searches Docwell }
lastError: { type: string, description: The last post that failed; empty when the last one worked }
eventsUrl: { type: string, description: Request URL for the Slack app's Event Subscriptions }
commandsUrl: { type: string, description: Request URL for the /docwell slash command }
manifest: { type: string, description: A Slack app manifest (JSON) with those URLs and the scopes Docwell needs }
SlackIntegrationInput:
type: object
properties:
botToken: { type: string, description: The app's Bot User OAuth Token (xoxb-…); checked with Slack }
signingSecret: { type: string, description: The app's Signing Secret }
channel: { type: string, description: "A public channel id or name (#news); empty for none" }
events:
type: array
items:
type: string
enum: [page.created, page.updated, page.moved, page.archived, page.unarchived, page.restored, comment.created, comment.resolved]
unfurl: { type: boolean }
search: { type: boolean }
Session:
type: object
required: [token, user]