{
  "$schema": "https://apidocs.iqrf.org/iqrf-gateway-daemon/com.iqrftech.self-desc/schema/jsonschema/1-0-0#",
  "self": {
    "vendor": "com.iqrftech.self-desc",
    "name": "schema__iqrf__JsCache",
    "format": "jsonschema",
    "version": "1-0-0"
  },
  "type": "object",
  "required": [
    "component",
    "instance",
    "urlRepo",
    "checkPeriodInMinutes",
    "downloadIfRepoCacheEmpty",
    "credentials"
  ],
  "additionalProperties": false,
  "properties": {
    "component": {
      "title": "Component name",
      "description": "Name of component.",
      "type": "string",
      "enum": [
        "iqrf::JsCache"
      ]
    },
    "instance": {
      "title": "Instance name",
      "description": "Name of component instance.",
      "type": "string",
      "pattern": "^[a-zA-Z0-9-]+$",
      "example": "JsCache-1"
    },
    "urlRepo": {
      "title": "URL repository",
      "description": "Remote IQRF repository URL",
      "type": "string",
      "example": "https://repository.iqrfalliance.org/api"
    },
    "checkPeriodInMinutes": {
      "title": "Repository cheeck period",
      "description": "Time to wait between remote repository status checks to detect updates. 0 disables automatic checks.",
      "type": "integer",
      "example": 0
    },
    "downloadIfRepoCacheEmpty": {
      "title": "Download cache if empty",
      "description": "Download remote repository and store in cache on startup if local cache does not exist.",
      "type": "boolean",
      "example": true
    },
    "credentials": {
      "title": "Credentials",
      "description": "Optional credentials for access to non-public data.",
      "oneOf": [
        {
          "type": "object",
          "required": [
            "username",
            "password"
          ],
          "additionalProperties": false,
          "properties": {
            "username": {
              "title": "Username",
              "description": "Username.",
              "type": "string",
              "minLength": 1,
              "example": "username"
            },
            "password": {
              "title": "Password",
              "description": "Password.",
              "type": "string",
              "minLength": 1,
              "example": "password"
            }
          }
        },
        {
          "type": "null"
        }
      ]
    }
  }
}
