Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

707 B
Raw Blame
import { storageServiceClient } from '@service-storage/client';
import type { CreateUnthreadedAnchorRequest } from '@service-storage/generated/schemas/createUnthreadedAnchorRequest';

export async function getPdfAnchors(documentId: string) {
  const result = await storageServiceClient.annotations.getAnchors({
    documentId,
  });
  return result.isOk() ? result.value.data : [];
}

export async function createPdfAnchor(
  documentId: string,
  body: CreateUnthreadedAnchorRequest
) {
  const result = await storageServiceClient.annotations.createAnchor({
    documentId,
    body,
  });
  if (result.isErr()) {
    console.error('Unable to create anchor');
    return null;
  }
  return result.value;
}