Files
outline/server/queues/tasks/SlabAPIImportTask.ts
T
Claude e70e0daa7a Add shell SlabAPIImportTask as a Slab-specific seam
Slab imports previously ran through MarkdownAPIImportTask directly. Introduce
a thin SlabAPIImportTask subclass so Slab gets its own task name (for
scheduling, tracing, and retries) and a dedicated place to override
behavior as Slab exports diverge from the generic Markdown shape.

The subclass inherits all conversion/attachment/persistence logic and only
overrides scheduleNextTask to keep the whole import chain on the Slab class.
MarkdownImportsProcessor now selects the task implementation by the import's
service when scheduling the first task.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AC5Ho2SHBjNpxEAMr5uL6o
2026-06-29 16:14:38 +00:00

24 lines
974 B
TypeScript

import type { IntegrationService } from "@shared/types";
import type { ImportTask } from "@server/models";
import MarkdownAPIImportTask from "./MarkdownAPIImportTask";
type Service = IntegrationService.Markdown | IntegrationService.Slab;
/**
* Imports a Slab workspace export.
*
* Slab exports the same zip-of-Markdown structure as Outline's own Markdown
* export, so all conversion, attachment, and persistence logic is inherited
* from {@link MarkdownAPIImportTask}. This subclass exists as a dedicated
* seam for Slab-specific behavior (e.g. quirks in how Slab references remote
* assets) and so Slab imports are scheduled, traced, and retried under their
* own task name rather than the generic Markdown one.
*/
export default class SlabAPIImportTask extends MarkdownAPIImportTask {
protected async scheduleNextTask(
importTask: ImportTask<Service>
): Promise<void> {
await new SlabAPIImportTask().schedule({ importTaskId: importTask.id });
}
}