import gql from 'graphql-tag';
import { client } from '@operato/graphql';
import { adjustFilters } from '@operato/utils';
export async function fetchPDFReportList({ filters, page, limit, sortings = [] }) {
    const adjustedFilters = adjustFilters(filters, [
        {
            name: 'refBy',
            operator: 'eq',
            value: 'pdf-published'
        }
    ]);
    const response = await client.query({
        query: gql `
      query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {
        attachments(filters: $filters, pagination: $pagination, sortings: $sortings) {
          items {
            id
            name
            description
            size
            fullpath
            refType
            refBy
            tags
            creator {
              name
            }
            createdAt
          }
          total
        }
      }
    `,
        variables: {
            filters: adjustedFilters,
            pagination: { page, limit },
            sortings
        }
    });
    return response.data;
}
export async function deletePDFReport(id) {
    const response = await client.mutate({
        mutation: gql `
      mutation ($id: String!) {
        deleteAttachment(id: $id)
      }
    `,
        variables: {
            id
        }
    });
    return response.data;
}
//# sourceMappingURL=report.js.map