FabricFabricSDK
Portal SDK

Documents

CRUD on portal documents — specs, runbooks, plans, anything markdown.

Documents are first-class objects in the Fabric portal — they participate in projects, features, and workflows. The portal renders them with full markdown + MDX support and tracks revisions.

fabric_list_documents

> What documents are in the migration project?

Input:

{
  projectId?: string,
  workspaceId?: string,
  limit?: number,         // default 20
  cursor?: string         // pagination
}

Output:

{
  documents: Array<{
    id, title, kind, projectId, workspaceId,
    createdAt, updatedAt, updatedBy
  }>,
  nextCursor?: string
}

fabric_get_document

> Show me the API design spec.

Input: { documentId: string }

Output:

{
  document: {
    id, title, content,   // full markdown
    kind, projectId, workspaceId,
    createdAt, updatedAt, updatedBy,
    revisions: Array<{ id, createdAt, createdBy, summary }>
  }
}

fabric_create_document

> Create a new architecture doc in the platform project titled "Webhook delivery semantics".

Input:

{
  title: string,
  content: string,                                  // markdown body
  kind?: "spec" | "runbook" | "plan" | "note",      // default "note"
  projectId?: string,
  workspaceId?: string
}

Output: { document: { id, title, kind, ... } }

fabric_update_document

> Append a new section to the migration runbook covering rollback.

Input:

{
  documentId: string,
  title?: string,
  content?: string,         // full replacement
  revisionSummary?: string  // why this change
}

Updates create a new revision; the prior content remains queryable via fabric_get_document.document.revisions.