{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/arc-json/latest.json",
  "title": "OpenJS Architect JSON Schema",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/architect/parser/v2.3.0/arc-schema.json",
    "sourceSha256": "a1c0f117c8402278a53c746ee82ec1f66d3f156e8ee3971c722f750909b3dc2a",
    "fileMatch": [
      "arc.json",
      "arc.yml",
      "arc.yaml"
    ],
    "parsers": [
      "json",
      "yaml"
    ]
  },
  "type": "object",
  "properties": {
    "app": {
      "items": {
        "$ref": "#/$defs/looseName"
      },
      "title": "@app",
      "description": "Application namespace",
      "type": [
        "string",
        "array"
      ],
      "maxItems": 1
    },
    "aws": {
      "properties": {
        "apigateway": {
          "type": "string"
        },
        "bucket": {
          "type": "string"
        },
        "concurrency": {
          "type": "number"
        },
        "layer": {
          "type": [
            "string",
            "object",
            "array"
          ]
        },
        "layers": {
          "type": [
            "string",
            "object",
            "array"
          ]
        },
        "memory": {
          "type": "number"
        },
        "policy": {
          "type": [
            "string",
            "object",
            "array"
          ]
        },
        "policies": {
          "type": [
            "string",
            "object",
            "array"
          ]
        },
        "profile": {
          "type": "string"
        },
        "region": {
          "type": "string"
        },
        "runtime": {
          "type": "string"
        },
        "timeout": {
          "type": "number"
        }
      },
      "title": "@aws",
      "description": "AWS specific configuration",
      "type": [
        "array",
        "object"
      ],
      "maxItems": 12,
      "uniqueItems": true,
      "items": {
        "type": [
          "array",
          "object"
        ],
        "maxItems": 2,
        "prefixItems": [
          {
            "type": "string",
            "enum": [
              "apigateway",
              "bucket",
              "concurrency",
              "layer",
              "layers",
              "memory",
              "policy",
              "policies",
              "profile",
              "region",
              "runtime",
              "timeout"
            ]
          },
          {
            "type": [
              "string",
              "number"
            ]
          }
        ]
      }
    },
    "static": {
      "items": {
        "type": [
          "array",
          "object"
        ],
        "properties": {
          "fingerprint": {
            "type": [
              "boolean",
              "string"
            ]
          },
          "folder": {
            "type": "string"
          },
          "ignore": {
            "type": [
              "string",
              "object",
              "array"
            ]
          },
          "prefix": {
            "type": "string"
          },
          "production": {
            "type": "string"
          },
          "prune": {
            "type": "boolean"
          },
          "spa": {
            "type": "boolean"
          },
          "staging": {
            "type": "string"
          }
        },
        "prefixItems": [
          {
            "type": "string",
            "enum": [
              "fingerprint",
              "folder",
              "ignore",
              "prefix",
              "production",
              "prune",
              "spa",
              "staging"
            ]
          },
          {
            "type": [
              "string",
              "boolean",
              "array",
              "object"
            ]
          }
        ]
      },
      "title": "@static",
      "description": "Static asset & S3 configuration",
      "uniqueItems": true,
      "type": "array",
      "maxItems": 6
    },
    "ws": {
      "items": {
        "$ref": "#/$defs/strictName"
      },
      "type": "array",
      "title": "@ws",
      "description": "API Gateway WebSocket configuration",
      "uniqueItems": true
    },
    "http": {
      "items": {
        "type": [
          "array",
          "object"
        ],
        "maxItems": 2,
        "maxProperties": 1,
        "properties": {
          "any": {
            "type": "string",
            "pattern": "^[a-zA-Z0-9\\/\\-:\\._\\*]+$"
          },
          "get": {
            "type": "string",
            "pattern": "^[a-zA-Z0-9\\/\\-:\\._\\*]+$"
          },
          "post": {
            "type": "string",
            "pattern": "^[a-zA-Z0-9\\/\\-:\\._\\*]+$"
          },
          "put": {
            "type": "string",
            "pattern": "^[a-zA-Z0-9\\/\\-:\\._\\*]+$"
          },
          "patch": {
            "type": "string",
            "pattern": "^[a-zA-Z0-9\\/\\-:\\._\\*]+$"
          },
          "delete": {
            "type": "string",
            "pattern": "^[a-zA-Z0-9\\/\\-:\\._\\*]+$"
          },
          "head": {
            "type": "string",
            "pattern": "^[a-zA-Z0-9\\/\\-:\\._\\*]+$"
          },
          "options": {
            "type": "string",
            "pattern": "^[a-zA-Z0-9\\/\\-:\\._\\*]+$"
          }
        },
        "prefixItems": [
          {
            "type": "string",
            "enum": [
              "any",
              "get",
              "post",
              "put",
              "patch",
              "delete",
              "head",
              "options"
            ]
          },
          {
            "type": "string",
            "pattern": "^[a-zA-Z0-9\\/\\-:\\._\\*]+$"
          }
        ]
      },
      "title": "@http",
      "description": "API Gateway configuration",
      "type": "array",
      "uniqueItems": true
    },
    "proxy": {
      "items": {
        "type": [
          "array",
          "object"
        ],
        "maxItems": 3,
        "maxProperties": 1,
        "properties": {
          "testing": {
            "type": "string",
            "pattern": "^https?:\\/\\/.+$"
          },
          "staging": {
            "type": "string",
            "pattern": "^https?:\\/\\/.+$"
          },
          "production": {
            "type": "string",
            "pattern": "^https?:\\/\\/.+$"
          }
        },
        "prefixItems": [
          {
            "type": "string",
            "enum": [
              "testing",
              "staging",
              "production"
            ]
          },
          {
            "type": "string",
            "pattern": "^https?:\\/\\/.+$"
          }
        ]
      },
      "title": "@proxy",
      "description": "Proxy",
      "type": "array",
      "uniqueItems": true
    },
    "events": {
      "items": {
        "$ref": "#/$defs/strictName"
      },
      "type": "array",
      "title": "@events",
      "description": "Events configuration",
      "uniqueItems": true
    },
    "queues": {
      "items": {
        "$ref": "#/$defs/strictName"
      },
      "type": "array",
      "title": "@queues",
      "description": "Queues configuration",
      "uniqueItems": true
    },
    "macros": {
      "items": {
        "$ref": "#/$defs/macros"
      },
      "type": "array",
      "title": "@macros",
      "description": "Deployment macros configuration",
      "uniqueItems": true
    },
    "scheduled": {
      "items": {
        "prefixItems": [
          {
            "type": "string",
            "pattern": "^[a-z][a-z|\\-|0-9]+$"
          },
          {
            "type": "string",
            "pattern": "^(rate|cron)"
          }
        ],
        "type": [
          "array",
          "object"
        ],
        "title": "scheduled handlers"
      },
      "type": [
        "array",
        "object"
      ],
      "title": "@scheduled",
      "description": "Scheduled event configuration",
      "uniqueItems": true
    },
    "tables": {
      "items": {
        "$ref": "#/$defs/table"
      },
      "type": "array",
      "title": "@tables",
      "description": "DynamoDB database tables configuration",
      "uniqueItems": true
    },
    "indexes": {
      "items": {
        "$ref": "#/$defs/table"
      },
      "type": "array",
      "title": "@indexes",
      "description": "DynamoDB global secondary indexes configuration",
      "uniqueItems": true
    }
  },
  "$defs": {
    "strictName": {
      "type": "string",
      "pattern": "^[a-z][a-z0-9\\-]+$"
    },
    "looseName": {
      "type": "string",
      "pattern": "^[a-z][a-zA-Z0-9\\-_]+$"
    },
    "macros": {
      "type": "string",
      "pattern": "^[a-z][a-zA-Z0-9\\-_/.]+$"
    },
    "region": {
      "type": "string",
      "enum": [
        "us-east-1",
        "us-east-2",
        "us-west-1",
        "us-west-2",
        "ca-central-1",
        "eu-west-1",
        "eu-central-1",
        "eu-west-2",
        "eu-west-3",
        "eu-north-1",
        "ap-northeast-1",
        "ap-northeast-2",
        "ap-southeast-1",
        "ap-southeast-2",
        "ap-south-1",
        "sa-east-1",
        "us-gov-west-1",
        "us-gov-east-1"
      ]
    },
    "table": {
      "type": "object",
      "title": "DynamoDB table",
      "propertyNames": {
        "pattern": "^[a-z][a-z|0-9|\\-]+$"
      },
      "minProperties": 1,
      "maxProperties": 1
    }
  },
  "required": [
    "app"
  ],
  "additionalProperties": {
    "type": [
      "array",
      "object"
    ],
    "items": {
      "type": [
        "string",
        "number",
        "boolean",
        "array",
        "object"
      ]
    }
  }
}
