{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "definitions": {
        "IAzureChartStorage": {
            "properties": {
                "kind": {
                    "enum": [
                        "azure"
                    ],
                    "type": "string"
                },
                "storageAccessKey": {
                    "$ref": "#/definitions/IAzureKeyVaultSecret"
                },
                "storageAccount": {
                    "type": "string"
                },
                "storageContainerName": {
                    "type": "string"
                },
                "storagePrefix": {
                    "type": "string"
                }
            },
            "type": "object"
        },
        "IAzureKeyVaultSecret": {
            "properties": {
                "secretName": {
                    "type": "string"
                },
                "vaultName": {
                    "type": "string"
                }
            },
            "type": "object"
        },
        "ICoreSystemConfig": {
            "description": "Nebula system config",
            "type": "object"
        },
        "ICronJobServiceConfig": {
            "description": "Nebula cronjob service config",
            "properties": {
                "version": {
                    "type": "string"
                }
            },
            "type": "object"
        },
        "INebulaApiServiceConfig": {
            "description": "Nebula API service config",
            "properties": {
                "port": {
                    "description": "Port that API runs on",
                    "type": "number"
                },
                "version": {
                    "type": "string"
                }
            },
            "type": "object"
        },
        "INebulaHelmConfig": {
            "description": "Project helm chart details",
            "properties": {
                "chartStorage": {
                    "$ref": "#/definitions/IAzureChartStorage",
                    "description": "Helm Chart Storage"
                },
                "repository": {
                    "$ref": "#/definitions/INebulaHelmRepositoryConfig",
                    "description": "Helm chart repositories to register"
                },
                "version": {
                    "description": "Helm chart version",
                    "type": "string"
                }
            },
            "type": "object"
        },
        "INebulaHelmRepo": {
            "description": "Helm repository details",
            "properties": {
                "alias": {
                    "description": "Helm repo alias to use when referenced in helm dependencies",
                    "type": "string"
                },
                "path": {
                    "description": "Location of helm repository",
                    "type": "string"
                }
            },
            "type": "object"
        },
        "INebulaHelmRepositoryConfig": {
            "description": "Project helm chart repository details",
            "properties": {
                "rocketmakers": {
                    "$ref": "#/definitions/INebulaHelmRepo",
                    "description": "Rocketmakers helm chart repository"
                },
                "stable": {
                    "$ref": "#/definitions/INebulaHelmRepo",
                    "description": "Stable helm chart repository"
                }
            },
            "type": "object"
        },
        "INebulaJobServiceConfig": {
            "description": "Nebula job service config",
            "properties": {
                "version": {
                    "type": "string"
                }
            },
            "type": "object"
        },
        "INebulaMicroserviceSpec": {
            "description": "Nebula external micro-services to use",
            "properties": {
                "name": {
                    "description": "Microservice name",
                    "type": "string"
                }
            },
            "type": "object"
        },
        "INebulaPlatformConfigBuild": {
            "properties": {
                "registry": {
                    "description": "Docker registry to publish images to",
                    "type": "string"
                },
                "registryAuth": {
                    "description": "Authentication mode for the Docker registry",
                    "enum": [
                        "azure"
                    ],
                    "type": "string"
                },
                "services": {
                    "description": "Docker services to build",
                    "items": {
                        "anyOf": [
                            {
                                "$ref": "#/definitions/INebulaPlatformConfigBuildApiService"
                            },
                            {
                                "$ref": "#/definitions/INebulaPlatformConfigBuildUiService"
                            },
                            {
                                "$ref": "#/definitions/INebulaPlatformConfigBuildCronJobService"
                            },
                            {
                                "$ref": "#/definitions/INebulaPlatformConfigBuildJobService"
                            }
                        ]
                    },
                    "type": "array"
                }
            },
            "type": "object"
        },
        "INebulaPlatformConfigBuildApiService": {
            "properties": {
                "alias": {
                    "description": "Override the inferred service name with this value",
                    "type": "string"
                },
                "config": {
                    "$ref": "#/definitions/INebulaPlatformConfigBuildServiceApiConfig",
                    "description": "Nebula service build additional config"
                },
                "context": {
                    "description": "Location of service Dockerfile",
                    "type": "string"
                },
                "remote": {
                    "default": false,
                    "description": "Specify whether the context is remote or not. If true, Nebula will look for a docker image of that name instead of building the service",
                    "type": "boolean"
                },
                "sync": {
                    "description": "Specify the relative paths (globs) of files to sync to the container",
                    "items": {
                        "type": "string"
                    },
                    "type": "array"
                },
                "syncCommand": {
                    "description": "Specify the container command to use for sync",
                    "items": {
                        "type": "string"
                    },
                    "type": "array"
                },
                "type": {
                    "description": "Nebula service type. Used to infer deployment config",
                    "enum": [
                        "api"
                    ],
                    "type": "string"
                }
            },
            "type": "object"
        },
        "INebulaPlatformConfigBuildCronJobService": {
            "properties": {
                "alias": {
                    "description": "Override the inferred service name with this value",
                    "type": "string"
                },
                "config": {
                    "$ref": "#/definitions/INebulaPlatformConfigBuildServiceConfig",
                    "description": "Nebula service build additional config"
                },
                "context": {
                    "description": "Location of service Dockerfile",
                    "type": "string"
                },
                "remote": {
                    "default": false,
                    "description": "Specify whether the context is remote or not. If true, Nebula will look for a docker image of that name instead of building the service",
                    "type": "boolean"
                },
                "schedule": {
                    "description": "The cron schedule, e.g. \"1 * * * *\"",
                    "type": "string"
                },
                "sync": {
                    "description": "Specify the relative paths (globs) of files to sync to the container",
                    "items": {
                        "type": "string"
                    },
                    "type": "array"
                },
                "syncCommand": {
                    "description": "Specify the container command to use for sync",
                    "items": {
                        "type": "string"
                    },
                    "type": "array"
                },
                "type": {
                    "description": "Nebula service type. Used to infer deployment config",
                    "enum": [
                        "cronjob"
                    ],
                    "type": "string"
                }
            },
            "type": "object"
        },
        "INebulaPlatformConfigBuildJobService": {
            "properties": {
                "alias": {
                    "description": "Override the inferred service name with this value",
                    "type": "string"
                },
                "config": {
                    "$ref": "#/definitions/INebulaPlatformConfigBuildServiceConfig",
                    "description": "Nebula service build additional config"
                },
                "context": {
                    "description": "Location of service Dockerfile",
                    "type": "string"
                },
                "remote": {
                    "default": false,
                    "description": "Specify whether the context is remote or not. If true, Nebula will look for a docker image of that name instead of building the service",
                    "type": "boolean"
                },
                "sync": {
                    "description": "Specify the relative paths (globs) of files to sync to the container",
                    "items": {
                        "type": "string"
                    },
                    "type": "array"
                },
                "syncCommand": {
                    "description": "Specify the container command to use for sync",
                    "items": {
                        "type": "string"
                    },
                    "type": "array"
                },
                "type": {
                    "description": "Nebula service type. Used to infer deployment config",
                    "enum": [
                        "job"
                    ],
                    "type": "string"
                }
            },
            "type": "object"
        },
        "INebulaPlatformConfigBuildServiceApiConfig": {
            "description": "Nebula service build additional config",
            "properties": {
                "command": {
                    "description": "Override the default Dockerfile command. Otherwise use the Dockerfile default for that type.",
                    "items": {
                        "type": "string"
                    },
                    "type": "array"
                },
                "health": {
                    "description": "Endpoint to test the readiness/liveness of the containers",
                    "type": "string"
                }
            },
            "type": "object"
        },
        "INebulaPlatformConfigBuildServiceConfig": {
            "description": "Nebula service build additional config",
            "properties": {
                "command": {
                    "description": "Override the default Dockerfile command. Otherwise use the Dockerfile default for that type.",
                    "items": {
                        "type": "string"
                    },
                    "type": "array"
                }
            },
            "type": "object"
        },
        "INebulaPlatformConfigBuildUiService": {
            "properties": {
                "alias": {
                    "description": "Override the inferred service name with this value",
                    "type": "string"
                },
                "config": {
                    "$ref": "#/definitions/INebulaPlatformConfigBuildServiceConfig",
                    "description": "Nebula service build additional config"
                },
                "context": {
                    "description": "Location of service Dockerfile",
                    "type": "string"
                },
                "remote": {
                    "default": false,
                    "description": "Specify whether the context is remote or not. If true, Nebula will look for a docker image of that name instead of building the service",
                    "type": "boolean"
                },
                "sync": {
                    "description": "Specify the relative paths (globs) of files to sync to the container",
                    "items": {
                        "type": "string"
                    },
                    "type": "array"
                },
                "syncCommand": {
                    "description": "Specify the container command to use for sync",
                    "items": {
                        "type": "string"
                    },
                    "type": "array"
                },
                "type": {
                    "description": "Nebula service type. Used to infer deployment config",
                    "enum": [
                        "ui"
                    ],
                    "type": "string"
                }
            },
            "type": "object"
        },
        "INebulaPlatformConfigDeploy": {
            "description": "Nebula deployment config",
            "properties": {
                "config": {
                    "$ref": "#/definitions/INebulaPlatformConfigDeployConfig",
                    "description": "Non-sensitive project config"
                },
                "database": {
                    "$ref": "#/definitions/TNebulaDatabase",
                    "description": "Nebula database configuration"
                },
                "external": {
                    "description": "External nebula micro-services",
                    "items": {
                        "$ref": "#/definitions/INebulaMicroserviceSpec"
                    },
                    "type": "array"
                },
                "helm": {
                    "$ref": "#/definitions/INebulaHelmConfig",
                    "description": "Nebula helm configuration"
                },
                "orbit": {
                    "$ref": "#/definitions/INebulaPlatformOrbitConfig",
                    "description": "Orbit deployment config"
                },
                "secrets": {
                    "$ref": "#/definitions/INebulaPlatformConfigDeploySecrets",
                    "description": "Sensitive project config"
                },
                "services": {
                    "$ref": "#/definitions/INebulaPlatformServicesConfig",
                    "description": "Nebula service config"
                }
            },
            "type": "object"
        },
        "INebulaPlatformConfigDeployConfig": {
            "description": "Non-sensitive project config",
            "properties": {
                "values": {
                    "description": "Non-sensitive project config values to be injected as environment values (mounting as files is planned).",
                    "items": {
                        "$ref": "#/definitions/INebulaPlatformConfigDeployConfigValue"
                    },
                    "type": "array"
                }
            },
            "type": "object"
        },
        "INebulaPlatformConfigDeployConfigValue": {
            "properties": {
                "name": {
                    "description": "Name of config value (same as the environment variable).",
                    "type": "string"
                },
                "scope": {
                    "description": "Scope this value to services within the deployment",
                    "items": {
                        "type": "string"
                    },
                    "type": "array"
                },
                "value": {
                    "description": "Value to assign to this config value. Can also use the following Nebula system envs:\n  - NEBULA_ENVIRONMENT: value of the config deploy environment setting",
                    "type": "string"
                }
            },
            "type": "object"
        },
        "INebulaPlatformConfigDeploySecrets": {
            "description": "Sensitive project config",
            "properties": {
                "engine": {
                    "$ref": "#/definitions/INebulaPlatformConfigDeploySecretsEngine",
                    "description": "Nebula supported secrets engine config"
                },
                "values": {
                    "description": "Sensitive project config values to be injected as environment values or files/",
                    "items": {
                        "$ref": "#/definitions/INebulaPlatformConfigDeploySecretsValue"
                    },
                    "type": "array"
                }
            },
            "type": "object"
        },
        "INebulaPlatformConfigDeploySecretsEngine": {
            "description": "Nebula supported secrets engine config",
            "properties": {
                "config": {
                    "$ref": "#/definitions/INebulaPlatformConfigDeploySecretsEngineSopsConfig",
                    "description": "Secrets engine type config"
                },
                "type": {
                    "$ref": "#/definitions/NebulaSecretsEngine",
                    "description": "Secrets engine type"
                }
            },
            "type": "object"
        },
        "INebulaPlatformConfigDeploySecretsEngineSopsConfig": {
            "description": "Nebula sops engine config",
            "properties": {
                "path": {
                    "description": "Path to the sops file to decrypt and inject secrets from. This is relative to the nebula.json file.",
                    "type": "string"
                }
            },
            "type": "object"
        },
        "INebulaPlatformConfigDeploySecretsValue": {
            "description": "Sensitive project config values to be injected as environment values or files/",
            "properties": {
                "filePathEnvOverride": {
                    "description": "[NOT IMPLEMENTED YET] This will override the file path env var to a non-conventional value",
                    "type": "string"
                },
                "injectAs": {
                    "$ref": "#/definitions/NebulaSecretsEngineInjectType",
                    "description": "Inject the secret as either a file or an environment variable."
                },
                "name": {
                    "description": "Name of secret when it is injected.\n\n[NOT_IMPLEMENTED_YET] When a secret is a file, we also generate a corresponding environment variable describing where the secret is.\n\nFor example, the file path env var for `foo_bar_baz` would be FOO_BAR_BAZ_SECRET_FILE_PATH",
                    "type": "string"
                },
                "path": {
                    "description": "Location of secret to be injected. Not needed if this matches the name of the secret.",
                    "type": "string"
                }
            },
            "type": "object"
        },
        "INebulaPlatformConfigProject": {
            "description": "Project details",
            "properties": {
                "name": {
                    "description": "Project name",
                    "type": "string"
                }
            },
            "type": "object"
        },
        "INebulaPlatformConfigStaging": {
            "description": "Nebula staging area details. Where everything is built",
            "properties": {
                "path": {
                    "description": "Location of Nebula staging area where everything is built",
                    "type": "string"
                }
            },
            "type": "object"
        },
        "INebulaPlatformOrbitCapsuleConfig": {
            "description": "Nebula Orbit Capsule config",
            "properties": {
                "name": {
                    "$ref": "#/definitions/NebulaOrbitCapsules"
                },
                "values": {
                    "additionalProperties": true,
                    "properties": {
                    },
                    "type": "object"
                }
            },
            "type": "object"
        },
        "INebulaPlatformOrbitConfig": {
            "description": "Nebula Orbit config",
            "properties": {
                "capsules": {
                    "description": "Orbit capsules to deploy",
                    "items": {
                        "$ref": "#/definitions/INebulaPlatformOrbitCapsuleConfig"
                    },
                    "type": "array"
                },
                "prefix": {
                    "description": "Orbit capsule prefix in config",
                    "type": "string"
                },
                "version": {
                    "description": "Orbit version to deploy",
                    "type": "string"
                }
            },
            "type": "object"
        },
        "INebulaPlatformServicesConfig": {
            "description": "Nebula services config",
            "properties": {
                "api": {
                    "$ref": "#/definitions/INebulaApiServiceConfig",
                    "description": "Nebula API service config"
                },
                "cronjob": {
                    "$ref": "#/definitions/ICronJobServiceConfig",
                    "description": "Nebula cronjob service config"
                },
                "job": {
                    "$ref": "#/definitions/INebulaJobServiceConfig",
                    "description": "Nebula job service config"
                },
                "ui": {
                    "$ref": "#/definitions/INebulaUiServiceConfig",
                    "description": "Nebula ui service config"
                }
            },
            "type": "object"
        },
        "INebulaUiServiceConfig": {
            "description": "Nebula ui service config",
            "properties": {
                "port": {
                    "description": "Port that ui files will be served on",
                    "type": "number"
                },
                "version": {
                    "type": "string"
                }
            },
            "type": "object"
        },
        "NebulaOrbitCapsules": {
            "description": "Orbit capsule",
            "enum": [
                "audit",
                "auth",
                "notify",
                "storage"
            ],
            "type": "string"
        },
        "NebulaSecretsEngine": {
            "description": "Secrets engine",
            "enum": [
                "raw",
                "sops"
            ],
            "type": "string"
        },
        "NebulaSecretsEngineInjectType": {
            "description": "Secrets engine injection type",
            "enum": [
                "env",
                "file"
            ],
            "type": "string"
        },
        "TNebulaDatabase": {
            "enum": [
                "mssql",
                "postgres"
            ],
            "type": "string"
        }
    },
    "description": "Nebula config",
    "properties": {
        "applicationVersion": {
            "description": "Application version",
            "type": "string"
        },
        "basePath": {
            "description": "Nebula base path that everything is relative from",
            "type": "string"
        },
        "build": {
            "$ref": "#/definitions/INebulaPlatformConfigBuild",
            "description": "Nebula build details"
        },
        "chartVersion": {
            "description": "Chart version",
            "type": "string"
        },
        "deploy": {
            "$ref": "#/definitions/INebulaPlatformConfigDeploy",
            "description": "Nebula deploy details"
        },
        "kubernetesVersion": {
            "description": "Platform version",
            "type": "string"
        },
        "project": {
            "$ref": "#/definitions/INebulaPlatformConfigProject",
            "description": "Project details"
        },
        "staging": {
            "$ref": "#/definitions/INebulaPlatformConfigStaging",
            "description": "Nebula staging area details"
        },
        "system": {
            "$ref": "#/definitions/ICoreSystemConfig",
            "description": "Nebula system config"
        }
    },
    "type": "object"
}

