{
  "openapi": "3.1.0",
  "info": {
    "title": "Internet Janitor API",
    "version": "0.2.1",
    "description": "Small deterministic cleanup operations for machine inputs. No account required during demand validation."
  },
  "servers": [
    {
      "url": "https://internet-janitor.capneura.workers.dev"
    }
  ],
  "tags": [
    {
      "name": "cleanup",
      "description": "Deterministic normalization and detection operations."
    }
  ],
  "paths": {
    "/api/normalize-whitespace": {
      "post": {
        "operationId": "normalize_whitespace",
        "summary": "Collapse repeated whitespace to one space and trim leading/trailing whitespace.",
        "tags": [
          "cleanup"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "input"
                ],
                "properties": {
                  "input": {
                    "type": "string",
                    "maxLength": 16384
                  }
                }
              },
              "examples": {
                "sample": {
                  "value": {
                    "input": "example"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Operation completed successfully."
          },
          "400": {
            "description": "Malformed JSON or missing input."
          },
          "413": {
            "description": "Input is too large."
          },
          "422": {
            "description": "Input could not be normalized."
          }
        }
      }
    },
    "/api/safe-filename": {
      "post": {
        "operationId": "safe_filename",
        "summary": "Convert a string into a Windows-safe filename, including reserved device-name protection.",
        "tags": [
          "cleanup"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "input"
                ],
                "properties": {
                  "input": {
                    "type": "string",
                    "maxLength": 16384
                  }
                }
              },
              "examples": {
                "sample": {
                  "value": {
                    "input": "example"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Operation completed successfully."
          },
          "400": {
            "description": "Malformed JSON or missing input."
          },
          "413": {
            "description": "Input is too large."
          },
          "422": {
            "description": "Input could not be normalized."
          }
        }
      }
    },
    "/api/normalize-decimal": {
      "post": {
        "operationId": "normalize_decimal",
        "summary": "Normalize common US/EU decimal representations to a dot-decimal string. Ambiguous single separators followed by three digits are flagged.",
        "tags": [
          "cleanup"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "input"
                ],
                "properties": {
                  "input": {
                    "type": "string",
                    "maxLength": 16384
                  }
                }
              },
              "examples": {
                "sample": {
                  "value": {
                    "input": "€1.234,50"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Operation completed successfully."
          },
          "400": {
            "description": "Malformed JSON or missing input."
          },
          "413": {
            "description": "Input is too large."
          },
          "422": {
            "description": "Input could not be normalized."
          }
        }
      }
    },
    "/api/detect-delimiter": {
      "post": {
        "operationId": "detect_delimiter",
        "summary": "Detect comma, semicolon, tab, or pipe delimiters across up to 20 non-empty rows while ignoring delimiters inside double quotes.",
        "tags": [
          "cleanup"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "input"
                ],
                "properties": {
                  "input": {
                    "type": "string",
                    "maxLength": 16384
                  }
                }
              },
              "examples": {
                "sample": {
                  "value": {
                    "input": "example"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Operation completed successfully."
          },
          "400": {
            "description": "Malformed JSON or missing input."
          },
          "413": {
            "description": "Input is too large."
          },
          "422": {
            "description": "Input could not be normalized."
          }
        }
      }
    },
    "/api/normalize-boolean": {
      "post": {
        "operationId": "normalize_boolean",
        "summary": "Normalize common boolean representations such as yes/no, on/off, 1/0, true/false.",
        "tags": [
          "cleanup"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "input"
                ],
                "properties": {
                  "input": {
                    "type": "string",
                    "maxLength": 16384
                  }
                }
              },
              "examples": {
                "sample": {
                  "value": {
                    "input": "example"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Operation completed successfully."
          },
          "400": {
            "description": "Malformed JSON or missing input."
          },
          "413": {
            "description": "Input is too large."
          },
          "422": {
            "description": "Input could not be normalized."
          }
        }
      }
    }
  }
}