{
  "repo": "tidbcloud/jiraport",
  "binary": "api",
  "binary_path": "cmd/api/main.go",
  "surface_kind": "mixed_service",
  "type": "mixed_service",
  "services": [
    {
      "name": "JiraportApiLifecycle",
      "package": "main",
      "methods": [
        {
          "name": "Startup",
          "name_key": "Runtime JiraportApiLifecycle.Startup",
          "input": "CONFIG_PATH + env vars + flags",
          "output": "configured gin router plus resolver dispatch client",
          "type": "local"
        },
        {
          "name": "LoadConfig",
          "name_key": "Runtime JiraportApiLifecycle.LoadConfig",
          "input": "config directory path",
          "output": "viper configuration with resolved matcher/template paths",
          "type": "local"
        },
        {
          "name": "InitializeResolverDispatch",
          "name_key": "Runtime JiraportApiLifecycle.InitializeResolverDispatch",
          "input": "resolver-url, is-local-dev, resolver-function-name",
          "output": "HTTP or AWS Lambda async event client for resolver",
          "type": "local"
        },
        {
          "name": "RegisterRoutes",
          "name_key": "Runtime JiraportApiLifecycle.RegisterRoutes",
          "input": "gin.Engine",
          "output": "health, version, jira webhook, lark ack, and hook comment routes",
          "type": "local"
        },
        {
          "name": "StartRuntime",
          "name_key": "Runtime JiraportApiLifecycle.StartRuntime",
          "input": "server-mode flag + listen-address",
          "output": "either an HTTP server or a Lambda proxy adapter",
          "type": "local"
        }
      ]
    },
    {
      "name": "JiraportApiHTTP",
      "type": "http",
      "methods": [
        {
          "name": "GET /healthz",
          "name_key": "HTTP GET /healthz",
          "input": "none",
          "output": "HTTP 200",
          "path": "/healthz",
          "type": "http"
        },
        {
          "name": "GET /version",
          "name_key": "HTTP GET /version",
          "input": "none",
          "output": "version string",
          "path": "/version",
          "type": "http"
        },
        {
          "name": "POST /jira/webhook/{receiver}",
          "name_key": "HTTP POST /jira/webhook/:receiver",
          "input": "Jira webhook payload with X-Hub-Signature",
          "output": "HTTP 200 after async resolver dispatch, or auth/parse error",
          "path": "/jira/webhook/:receiver",
          "type": "http"
        },
        {
          "name": "POST /lark/ack",
          "name_key": "HTTP POST /lark/ack",
          "input": "Lark ack webhook JSON",
          "output": "HTTP 200 after async resolver dispatch, or bind/invoke error",
          "path": "/lark/ack",
          "type": "http"
        },
        {
          "name": "POST /hook/comment",
          "name_key": "HTTP POST /hook/comment",
          "input": "signed hook payload",
          "output": "HTTP 200 after async resolver dispatch, or auth/parse/invoke error",
          "path": "/hook/comment",
          "type": "http"
        }
      ]
    }
  ],
  "extensions": {
    "notes": [
      "The API binary can run in two transport modes: direct gin HTTP server when server-mode=true, or AWS Lambda proxy mode that forwards APIGatewayV2 and ALB events into the same router.",
      "All three POST endpoints only enqueue work to the resolver binary; they do not perform Jira, Lark, or hook business logic locally.",
      "The resolver dispatch client is selected at startup: HTTP POST to resolver-url when configured, otherwise AWS Lambda Invoke with InvocationTypeEvent."
    ]
  }
}
