{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/subsquid-squid-manifest/latest.json",
  "x-lintel": {
    "source": "https://cdn.subsquid.io/schemas/squid_manifest.json",
    "sourceSha256": "32e77377fcc768ea89f250f1b28c1ce8b1dc3ca284c9cb047702e30c7c2644ac",
    "fileMatch": [
      "squid.yaml",
      "*.squid.yaml",
      "squid.yml",
      "*.squid.yml"
    ],
    "parsers": [
      "yaml"
    ]
  },
  "type": "object",
  "properties": {
    "manifest_version": {
      "const": "subsquid.io/v0.1"
    },
    "name": {
      "type": "string",
      "minLength": 3,
      "maxLength": 30,
      "pattern": "^[a-z0-9]([a-z0-9\\-]*[a-z0-9])?$"
    },
    "version": {
      "type": "integer",
      "maximum": 1000000,
      "exclusiveMinimum": 0
    },
    "slot": {
      "type": "string",
      "minLength": 2,
      "maxLength": 6,
      "pattern": "^[a-z0-9]([a-z0-9\\-]*[a-z0-9])?$"
    },
    "tag": {
      "type": "string",
      "minLength": 2,
      "maxLength": 32,
      "pattern": "^[a-z0-9]([a-z0-9\\-]*[a-z0-9])?$"
    },
    "description": {
      "type": "string"
    },
    "queries": {
      "type": "object",
      "properties": {},
      "additionalProperties": false
    },
    "build": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "dockerfile": {
          "type": "string",
          "default": "Dockerfile"
        },
        "node_version": {
          "type": "string",
          "default": "20",
          "enum": [
            "18",
            "20",
            "21"
          ]
        },
        "package_manager": {
          "type": "string",
          "default": "auto",
          "enum": [
            "auto",
            "npm",
            "pnpm",
            "yarn"
          ]
        },
        "install": {
          "type": "object",
          "properties": {
            "cmd": {
              "type": "array",
              "minItems": 1,
              "items": {
                "type": "string",
                "pattern": "^[:\\-\\/\\w.]+$"
              }
            }
          },
          "required": [
            "cmd"
          ],
          "additionalProperties": false
        },
        "cmd": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "string",
            "pattern": "^[:\\-\\/\\w.]+$"
          }
        }
      },
      "additionalProperties": false
    },
    "deploy": {
      "type": "object",
      "properties": {
        "cors": {
          "type": "object",
          "properties": {
            "enabled": {
              "type": "boolean",
              "default": true
            },
            "allow_origin": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "allow_methods": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "allow_headers": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "expose_headers": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "allow_credentials": {
              "type": "boolean"
            },
            "max_age": {
              "type": "integer",
              "exclusiveMinimum": 0
            }
          },
          "additionalProperties": false
        },
        "addons": {
          "type": "object",
          "properties": {
            "postgres": {
              "type": [
                "object",
                "null"
              ],
              "properties": {
                "version": {
                  "default": "14",
                  "const": "14"
                },
                "config": {
                  "type": "object",
                  "properties": {
                    "statement_timeout": {
                      "type": "integer",
                      "exclusiveMinimum": 0
                    },
                    "log_min_duration_statement": {
                      "type": "integer",
                      "exclusiveMinimum": 0
                    },
                    "max_locks_per_transaction": {
                      "type": "integer",
                      "exclusiveMinimum": 0
                    },
                    "max_pred_locks_per_transaction": {
                      "type": "integer",
                      "exclusiveMinimum": 0
                    }
                  },
                  "additionalProperties": false
                }
              },
              "additionalProperties": false
            },
            "neon": {
              "type": "object",
              "properties": {
                "version": {
                  "default": "16",
                  "const": "16"
                }
              },
              "additionalProperties": false
            },
            "hasura": {
              "type": [
                "object",
                "null"
              ],
              "properties": {
                "version": {
                  "type": "string",
                  "default": "latest"
                },
                "env": {
                  "type": "object",
                  "properties": {
                    "/^[a-zA-Z_][a-zA-Z0-9_]*$/": {
                      "type": "string",
                      "properties": {},
                      "required": [],
                      "additionalProperties": false
                    }
                  },
                  "additionalProperties": false,
                  "patternProperties": {
                    "^[a-zA-Z_][a-zA-Z0-9_]*$": {
                      "type": "string",
                      "properties": {},
                      "required": [],
                      "additionalProperties": false
                    }
                  }
                }
              },
              "additionalProperties": false
            },
            "rpc": {
              "type": "array",
              "items": {
                "type": "string",
                "enum": [
                  "acala.http",
                  "aleph-zero.http",
                  "aleph-zero-testnet.http",
                  "amplitude.http",
                  "arbitrum-one.http",
                  "arbitrum-goerli.http",
                  "arbitrum-sepolia.http",
                  "arbitrum-nova.http",
                  "asset-hub-kusama.http",
                  "asset-hub-polkadot.http",
                  "asset-hub-rococo.http",
                  "asset-hub-westend.http",
                  "astar.http",
                  "astar-substrate.http",
                  "ava.http",
                  "ava-testnet.http",
                  "base.http",
                  "base-goerli.http",
                  "base-sepolia.http",
                  "basilisk.http",
                  "berachain.http",
                  "bittensor.http",
                  "bittensor-testnet.http",
                  "blast-l2.http",
                  "bridge-hub-kusama.http",
                  "bridge-hub-polkadot.http",
                  "bridge-hub-rococo.http",
                  "bridge-hub-westend.http",
                  "bsc.http",
                  "bsc-testnet.http",
                  "centrifuge.http",
                  "collectives-polkadot.http",
                  "collectives-westend.http",
                  "crust.http",
                  "darwinia.http",
                  "darwiniacrab.http",
                  "eden.http",
                  "eth.http",
                  "eth-goerli.http",
                  "eth-holesky.http",
                  "eth-sepolia.http",
                  "evmos.http",
                  "fantom.http",
                  "fantom-testnet.http",
                  "frequency.http",
                  "gnosis.http",
                  "hydradx.http",
                  "interlay.http",
                  "karura.http",
                  "khala.http",
                  "kilt.http",
                  "kintsugi.http",
                  "kusama.http",
                  "linea.http",
                  "litentry.http",
                  "mantle.http",
                  "mantle-sepolia.http",
                  "metis.http",
                  "moonbase-alpha.http",
                  "moonbase.http",
                  "moonbeam.http",
                  "moonbeam-substrate.http",
                  "moonriver.http",
                  "moonriver-substrate.http",
                  "oktc.http",
                  "opbnb.http",
                  "opbnb-testnet.http",
                  "optimism.http",
                  "optimism-goerli.http",
                  "pendulum.http",
                  "phala.http",
                  "polkadex.http",
                  "polkadot.http",
                  "polygon.http",
                  "polygon-amoy-testnet.http",
                  "polygon-testnet.http",
                  "polygon-zkevm.http",
                  "polygon-zkevm-cardona-testnet.http",
                  "polygon-zkevm-testnet.http",
                  "rococo.http",
                  "scroll.http",
                  "scroll-sepolia.http",
                  "shibuya.http",
                  "shibuya-substrate.http",
                  "shiden.http",
                  "shiden-substrate.http",
                  "solana.http",
                  "sonic-mainnet.http",
                  "turing.http",
                  "unichain.http",
                  "unichain-sepolia.http",
                  "zeitgeist.http",
                  "zksync.http",
                  "zksync-sepolia.http"
                ]
              }
            }
          },
          "additionalProperties": false
        },
        "env": {
          "type": "object",
          "properties": {
            "/^[a-zA-Z_][a-zA-Z0-9_]*$/": {
              "type": "string",
              "properties": {},
              "required": [],
              "additionalProperties": false
            }
          },
          "additionalProperties": false,
          "patternProperties": {
            "^[a-zA-Z_][a-zA-Z0-9_]*$": {
              "type": "string",
              "properties": {},
              "required": [],
              "additionalProperties": false
            }
          }
        },
        "init": {
          "type": "object",
          "properties": {
            "env": {
              "type": "object",
              "properties": {
                "/^[a-zA-Z_][a-zA-Z0-9_]*$/": {
                  "type": "string",
                  "properties": {},
                  "required": [],
                  "additionalProperties": false
                }
              },
              "additionalProperties": false,
              "patternProperties": {
                "^[a-zA-Z_][a-zA-Z0-9_]*$": {
                  "type": "string",
                  "properties": {},
                  "required": [],
                  "additionalProperties": false
                }
              }
            },
            "cmd": {
              "type": "array",
              "minItems": 1,
              "items": {
                "type": "string",
                "pattern": "^[:\\-\\/\\w.]+$"
              }
            }
          },
          "required": [
            "cmd"
          ],
          "additionalProperties": false
        },
        "migrate": {
          "type": "object",
          "description": "[DEPRECATED] Please use \"deploy.init\" instead",
          "properties": {
            "env": {
              "type": "object",
              "properties": {
                "/^[a-zA-Z_][a-zA-Z0-9_]*$/": {
                  "type": "string",
                  "properties": {},
                  "required": [],
                  "additionalProperties": false
                }
              },
              "additionalProperties": false,
              "patternProperties": {
                "^[a-zA-Z_][a-zA-Z0-9_]*$": {
                  "type": "string",
                  "properties": {},
                  "required": [],
                  "additionalProperties": false
                }
              }
            },
            "cmd": {
              "type": "array",
              "minItems": 1,
              "items": {
                "type": "string",
                "pattern": "^[:\\-\\/\\w.]+$"
              }
            }
          },
          "required": [
            "cmd"
          ],
          "additionalProperties": false
        },
        "processor": {
          "if": {
            "type": "array",
            "items": {}
          },
          "then": {
            "type": "array",
            "uniqueItems": true,
            "minItems": 1,
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$",
                  "maxLength": 63
                },
                "env": {
                  "type": "object",
                  "properties": {
                    "/^[a-zA-Z_][a-zA-Z0-9_]*$/": {
                      "type": "string",
                      "properties": {},
                      "required": [],
                      "additionalProperties": false
                    }
                  },
                  "additionalProperties": false,
                  "patternProperties": {
                    "^[a-zA-Z_][a-zA-Z0-9_]*$": {
                      "type": "string",
                      "properties": {},
                      "required": [],
                      "additionalProperties": false
                    }
                  }
                },
                "cmd": {
                  "type": "array",
                  "minItems": 1,
                  "items": {
                    "type": "string",
                    "pattern": "^[:\\-\\/\\w.]+$"
                  }
                }
              },
              "required": [
                "name",
                "cmd"
              ],
              "additionalProperties": false
            }
          },
          "else": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string",
                "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$",
                "maxLength": 63
              },
              "env": {
                "type": "object",
                "properties": {
                  "/^[a-zA-Z_][a-zA-Z0-9_]*$/": {
                    "type": "string",
                    "properties": {},
                    "required": [],
                    "additionalProperties": false
                  }
                },
                "additionalProperties": false,
                "patternProperties": {
                  "^[a-zA-Z_][a-zA-Z0-9_]*$": {
                    "type": "string",
                    "properties": {},
                    "required": [],
                    "additionalProperties": false
                  }
                }
              },
              "cmd": {
                "type": "array",
                "minItems": 1,
                "items": {
                  "type": "string",
                  "pattern": "^[:\\-\\/\\w.]+$"
                }
              }
            },
            "required": [
              "cmd"
            ],
            "additionalProperties": false
          }
        },
        "api": {
          "type": "object",
          "properties": {
            "env": {
              "type": "object",
              "properties": {
                "/^[a-zA-Z_][a-zA-Z0-9_]*$/": {
                  "type": "string",
                  "properties": {},
                  "required": [],
                  "additionalProperties": false
                }
              },
              "additionalProperties": false,
              "patternProperties": {
                "^[a-zA-Z_][a-zA-Z0-9_]*$": {
                  "type": "string",
                  "properties": {},
                  "required": [],
                  "additionalProperties": false
                }
              }
            },
            "cmd": {
              "type": "array",
              "minItems": 1,
              "items": {
                "type": "string",
                "pattern": "^[:\\-\\/\\w.]+$"
              }
            }
          },
          "required": [
            "cmd"
          ],
          "additionalProperties": false
        },
        "secrets": {
          "type": "array",
          "description": "[DEPRECATED] Please use secrets context <https://docs.subsquid.io/cloud/resources/env-variables/#secrets>",
          "items": {
            "type": "string",
            "pattern": "^[a-zA-Z_][a-zA-Z0-9_]*$"
          }
        }
      },
      "required": [
        "processor"
      ],
      "additionalProperties": false
    },
    "scale": {
      "type": "object",
      "properties": {
        "dedicated": {
          "type": "boolean"
        },
        "addons": {
          "type": "object",
          "properties": {
            "postgres": {
              "type": "object",
              "properties": {
                "storage": {
                  "type": "string",
                  "pattern": "^\\d+[GT]i?$"
                },
                "autoresize": {
                  "type": "boolean"
                },
                "autoresize_limit": {
                  "type": "string"
                },
                "profile": {
                  "type": "string",
                  "enum": [
                    "small",
                    "medium",
                    "large",
                    "xlarge",
                    "2xlarge"
                  ]
                }
              },
              "additionalProperties": false
            },
            "hasura": {
              "type": "object",
              "properties": {
                "replicas": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 5
                },
                "profile": {
                  "type": "string",
                  "enum": [
                    "small",
                    "medium",
                    "large"
                  ]
                }
              },
              "additionalProperties": false
            },
            "neon": {
              "type": "object",
              "properties": {
                "autoscaling_limit_min_cu": {
                  "type": "string",
                  "default": "0.25",
                  "enum": [
                    "0.25",
                    "0.5",
                    "1",
                    "2",
                    "3",
                    "4",
                    "8"
                  ]
                },
                "autoscaling_limit_max_cu": {
                  "type": "string",
                  "default": "0.25",
                  "enum": [
                    "0.25",
                    "0.5",
                    "1",
                    "2",
                    "3",
                    "4",
                    "8"
                  ]
                }
              },
              "additionalProperties": false
            },
            "rpc": {
              "type": "object",
              "description": "[DEPRECATED] Please use billing settings in Cloud UI",
              "properties": {
                "monthly-cap": {
                  "type": "string",
                  "pattern": "\\d+[km]"
                },
                "max-rate": {
                  "type": "string",
                  "pattern": "\\d+rp[sm]"
                }
              },
              "additionalProperties": false
            }
          },
          "additionalProperties": false
        },
        "processor": {
          "type": "object",
          "default": {
            "profile": "small"
          },
          "properties": {
            "profile": {
              "type": "string",
              "enum": [
                "small",
                "medium",
                "large"
              ]
            }
          },
          "additionalProperties": false
        },
        "api": {
          "type": "object",
          "properties": {
            "replicas": {
              "type": "integer",
              "exclusiveMinimum": 0,
              "maximum": 5
            },
            "profile": {
              "type": "string",
              "enum": [
                "small",
                "medium",
                "large"
              ]
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    },
    "manifestVersion": {
      "description": "[DEPRECATED] Please use \"manifest_version\" instead.",
      "const": "subsquid.io/v0.1"
    }
  },
  "additionalProperties": false,
  "required": [
    "deploy"
  ],
  "oneOf": [
    {
      "required": [
        "slot"
      ]
    },
    {
      "required": [
        "version"
      ]
    },
    {
      "required": [
        "tag"
      ]
    },
    {
      "not": {
        "oneOf": [
          {
            "required": [
              "slot"
            ]
          },
          {
            "required": [
              "version"
            ]
          },
          {
            "required": [
              "tag"
            ]
          },
          {
            "required": [
              "slot",
              "version"
            ]
          },
          {
            "required": [
              "slot",
              "tag"
            ]
          },
          {
            "required": [
              "version",
              "tag"
            ]
          }
        ]
      }
    }
  ]
}
