{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/swopme-co/json-schema/swopme-co-runtime-config-response-schema.json",
  "title": "RuntimeConfigResponse",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/swopme-co-openapi.json#/components/schemas/RuntimeConfigResponse",
  "type": "object",
  "required": [
    "environment",
    "deployment",
    "auth",
    "policy"
  ],
  "properties": {
    "environment": {
      "type": "object",
      "required": [
        "id",
        "projectId",
        "appId",
        "name"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "projectId": {
          "type": "string"
        },
        "appId": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      }
    },
    "deployment": {
      "type": "object",
      "required": [
        "tier",
        "strictConfig",
        "publicOrigin"
      ],
      "properties": {
        "tier": {
          "type": "string",
          "enum": [
            "development",
            "staging",
            "production"
          ]
        },
        "strictConfig": {
          "type": "boolean"
        },
        "publicOrigin": {
          "anyOf": [
            {
              "type": "string",
              "format": "uri"
            },
            {
              "type": "null"
            }
          ]
        }
      }
    },
    "auth": {
      "type": "object",
      "required": [
        "email",
        "sms",
        "passkeys"
      ],
      "properties": {
        "email": {
          "type": "object",
          "required": [
            "enabled",
            "codeDelivery",
            "requestWindowSeconds",
            "maxRequestsPerWindow",
            "verifyWindowSeconds",
            "maxVerifyAttemptsPerWindow"
          ],
          "properties": {
            "enabled": {
              "type": "boolean"
            },
            "codeDelivery": {
              "type": "string"
            },
            "requestWindowSeconds": {
              "type": "integer",
              "minimum": 1
            },
            "maxRequestsPerWindow": {
              "type": "integer",
              "minimum": 1
            },
            "verifyWindowSeconds": {
              "type": "integer",
              "minimum": 1
            },
            "maxVerifyAttemptsPerWindow": {
              "type": "integer",
              "minimum": 1
            }
          }
        },
        "sms": {
          "type": "object",
          "required": [
            "enabled",
            "codeDelivery"
          ],
          "properties": {
            "deliveryAvailable": {
              "type": "boolean"
            },
            "loginEnabled": {
              "type": "boolean"
            },
            "enabled": {
              "type": "boolean"
            },
            "codeDelivery": {
              "type": "string"
            }
          }
        },
        "passkeys": {
          "type": "object",
          "required": [
            "rpName",
            "rpId",
            "allowedOrigins"
          ],
          "properties": {
            "loginEnabled": {
              "type": "boolean"
            },
            "rpName": {
              "type": "string"
            },
            "rpId": {
              "type": "string"
            },
            "allowedOrigins": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        }
      }
    },
    "policy": {
      "type": "object",
      "required": [
        "allowedChains",
        "wallet",
        "sessions",
        "execution",
        "recovery"
      ],
      "properties": {
        "allowedChains": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Chain"
          }
        },
        "wallet": {
          "type": "object",
          "required": [
            "defaultCustodyMode",
            "allowSplitCustody",
            "autoCreateManagedAccounts",
            "managedAccountChains"
          ],
          "properties": {
            "defaultCustodyMode": {
              "anyOf": [
                {
                  "$ref": "#/$defs/CustodyMode"
                },
                {
                  "type": "null"
                }
              ]
            },
            "allowSplitCustody": {
              "type": "boolean"
            },
            "autoCreateManagedAccounts": {
              "type": "boolean"
            },
            "managedAccountChains": {
              "type": "array",
              "items": {
                "$ref": "#/$defs/Chain"
              }
            }
          }
        },
        "sessions": {
          "type": "object",
          "required": [
            "requireMfa",
            "allowDelegatedSessionKeys",
            "allowedNetworks"
          ],
          "properties": {
            "requireMfa": {
              "type": "boolean"
            },
            "allowDelegatedSessionKeys": {
              "type": "boolean"
            },
            "allowedNetworks": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        },
        "execution": {
          "type": "object",
          "required": [
            "requireMfa",
            "sponsorshipEnabled"
          ],
          "properties": {
            "requireMfa": {
              "type": "boolean"
            },
            "sponsorshipEnabled": {
              "type": "boolean"
            }
          }
        },
        "recovery": {
          "type": "object",
          "required": [
            "allowEmailRecovery",
            "allowPasskeyRecovery",
            "allowSmsRecovery"
          ],
          "properties": {
            "allowEmailRecovery": {
              "type": "boolean"
            },
            "allowPasskeyRecovery": {
              "type": "boolean"
            },
            "allowSmsRecovery": {
              "type": "boolean"
            }
          }
        }
      }
    }
  },
  "$defs": {
    "Chain": {
      "type": "string",
      "enum": [
        "evm",
        "solana"
      ]
    },
    "CustodyMode": {
      "type": "string",
      "enum": [
        "managed_tee",
        "split_custody"
      ]
    }
  }
}