@cfxlabsinc/b2b-services
    Preparing search index...
    type PdfTemplateEditorWrite = {
        discardDraft: () => Promise<ActionOutcome>;
        publish: (draftVersionId: number) => Promise<PdfTemplatePublishOutcome>;
        rollback: (versionId: number) => Promise<ActionOutcome>;
        saveDraft: (
            input: { body: string; sampleData: Record<string, unknown> },
        ) => Promise<
            | { draftVersion: number
            | null; ok: true }
            | { message: string; ok: false },
        >;
    }
    Index
    discardDraft: () => Promise<ActionOutcome>
    publish: (draftVersionId: number) => Promise<PdfTemplatePublishOutcome>

    Publishes the draft with this version id: the one the editor shows.

    rollback: (versionId: number) => Promise<ActionOutcome>
    saveDraft: (
        input: { body: string; sampleData: Record<string, unknown> },
    ) => Promise<
        | { draftVersion: number
        | null; ok: true }
        | { message: string; ok: false },
    >

    Resolves with the version the save became, so the editor knows its own draft.