{
  "openapi": "3.0.0",
  "info": {
    "title": "@digipair/skill-pdf",
    "summary": "PDF Manipulation",
    "description": "This skill allows users to manipulate PDF files to extract or fill out forms.",
    "version": "0.1.0",
    "x-icon": "📕"
  },
  "paths": {
    "/fillForm": {
      "post": {
        "tags": ["service"],
        "summary": "Fill out a PDF form",
        "description": "Fills out a PDF form with the specified values.",
        "parameters": [
          {
            "name": "file",
            "summary": "File",
            "required": true,
            "description": "Base64 encoded PDF file to fill out",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "data",
            "summary": "Data",
            "required": true,
            "description": "Data to insert into the PDF",
            "schema": {
              "type": "object"
            }
          },
          {
            "name": "flatten",
            "summary": "Flatten",
            "required": false,
            "description": "Flatten the form after filling",
            "schema": {
              "type": "boolean"
            }
          }
        ],
        "x-events": [],
        "responses": {
          "200": {
            "description": "PDF form filled successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "string",
                  "description": "Base64 encoded PDF file with filled form data",
                  "example": "data:application/pdf;base64,..."
                }
              }
            }
          }
        }
      }
    },
    "/getFields": {
      "post": {
        "tags": ["service"],
        "summary": "Extract fields from a PDF",
        "description": "Extracts fields from a PDF form.",
        "parameters": [
          {
            "name": "file",
            "summary": "File",
            "required": true,
            "description": "Base64 encoded PDF file to analyze",
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-events": [],
        "responses": {
          "200": {
            "description": "PDF fields extracted successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Object containing field names as keys and their values",
                  "additionalProperties": {
                    "oneOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "boolean"
                      }
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/getSize": {
      "post": {
        "tags": ["service"],
        "summary": "Number of pages in a PDF",
        "description": "Returns the number of pages in a PDF.",
        "parameters": [
          {
            "name": "file",
            "summary": "File",
            "required": true,
            "description": "PDF file to analyze",
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-events": [],
        "responses": {
          "200": {
            "description": "PDF page count retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "integer",
                  "description": "Number of pages in the PDF document",
                  "minimum": 1
                }
              }
            }
          }
        }
      }
    },
    "/getText": {
      "post": {
        "tags": ["service"],
        "summary": "Text from a PDF",
        "description": "Returns the text from a PDF.",
        "parameters": [
          {
            "name": "file",
            "summary": "File",
            "required": true,
            "description": "PDF file to analyze",
            "schema": {
              "type": "string"
            }
          }
        ],
        "x-events": [],
        "responses": {
          "200": {
            "description": "PDF text retrieved successfully",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "description": "Text extracted from the PDF document organized by page"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {}
  }
}
