{
  "$schema": "https://json-schema.org/draft-07/schema",
  "$id": "sync-npm-packages",
  "title": "JSON schema for sync-npm-packages config",
  "description": "JSON schema for sync-npm-packages config",
  "type": "object",
  "definitions": {
    "arrayable-string": {
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      ]
    }
  },
  "properties": {
    "cwd": {
      "type": "string",
      "description": "Current working directory for glob"
    },
    "debug": {
      "type": "boolean",
      "description": "Enable debug mode",
      "default": false
    },
    "defaultIgnore": {
      "type": "boolean",
      "description": "Use built-in default ignore patterns",
      "default": true
    },
    "dry": {
      "type": "boolean",
      "description": "Dry run",
      "default": false
    },
    "exclude": {
      "description": "Exclude packages from being synced",
      "$ref": "#/definitions/arrayable-string",
      "default": []
    },
    "ignore": {
      "description": "Ignore package.json glob pattern",
      "$ref": "#/definitions/arrayable-string",
      "default": []
    },
    "include": {
      "description": "Additional packages to sync",
      "$ref": "#/definitions/arrayable-string",
      "default": []
    },
    "target": {
      "type": "string",
      "description": "Target mirror site to sync",
      "enum": ["npmmirror", "custom"]
    },
    "withOptional": {
      "description": "With optionalDependencies in package.json",
      "type": "boolean",
      "default": false
    },
    "retry": {
      "type": "number",
      "description": "Number of retry attempts on failure",
      "default": 3,
      "minimum": 0
    },
    "retryDelay": {
      "type": "number",
      "description": "Delay between retries in milliseconds",
      "default": 1000,
      "minimum": 0
    },
    "concurrency": {
      "type": "number",
      "description": "Maximum number of concurrent sync requests",
      "default": 5,
      "minimum": 1
    },
    "timeout": {
      "type": "number",
      "description": "Request timeout in milliseconds",
      "default": 10000,
      "minimum": 1000
    },
    "verbose": {
      "type": "boolean",
      "description": "Enable verbose output",
      "default": false
    },
    "silent": {
      "type": "boolean",
      "description": "Silent mode, suppress all output",
      "default": false
    },
    "registry": {
      "type": "string",
      "description": "Custom registry host or HTTPS URL for syncing",
      "examples": ["https://registry.example.com", "registry.npmmirror.com"]
    },
    "syncMethod": {
      "type": "string",
      "description": "HTTP method used for sync request",
      "enum": ["PUT", "POST", "PATCH"],
      "default": "PUT"
    },
    "syncPathTemplate": {
      "type": "string",
      "description": "Path template used when target is custom, supports {packageName} placeholder",
      "examples": ["/-/package/{packageName}/syncs", "/api/sync/{packageName}"]
    },
    "cache": {
      "type": "boolean",
      "description": "Enable caching of synced packages to avoid duplicate syncs",
      "default": false
    },
    "cacheDir": {
      "type": "string",
      "description": "Directory to store cache files",
      "default": ".sync-cache"
    },
    "beforeSync": {
      "description": "Callback function executed before each package sync",
      "type": "null"
    },
    "afterSync": {
      "description": "Callback function executed after each package sync attempt",
      "type": "null"
    }
  },
  "required": ["target"],
  "additionalProperties": false
}
