{
  "repo": "tidbcloud/jiraport",
  "binary": "api",
  "binary_path": "cmd/api/main.go",
  "dependencies": {
    "Runtime JiraportApiLifecycle.Startup": {
      "infrastructure": {},
      "services": []
    },
    "Runtime JiraportApiLifecycle.LoadConfig": {
      "infrastructure": {
        "filesystem": {
          "conditions": [
            "Always"
          ],
          "operations": [
            {
              "operation": "READ FILE",
              "trigger": "Load config.yaml from the configured CONFIG_PATH directory before any route or client initialization",
              "conditions": [
                "Always"
              ],
              "implementation": "LoadConfig(configPath) -> viper.ReadInConfig()"
            }
          ]
        }
      },
      "services": []
    },
    "Runtime JiraportApiLifecycle.InitializeResolverDispatch": {
      "infrastructure": {
        "aws_sdk_config": {
          "conditions": [
            "Only when resolver-url is empty and is-local-dev is false"
          ],
          "operations": [
            {
              "operation": "LOAD AWS CONFIG",
              "trigger": "Create the AWS Lambda async client used to dispatch events to the resolver function",
              "conditions": [
                "viper.GetString(\"resolver-url\") == \"\"",
                "viper.GetBool(\"is-local-dev\") == false"
              ],
              "implementation": "lambdacli.New(logger, resolver-function-name) -> awsconfig.LoadDefaultConfig(ctx, awsconfig.WithRegion(\"us-west-1\"))"
            }
          ]
        }
      },
      "services": []
    },
    "Runtime JiraportApiLifecycle.RegisterRoutes": {
      "infrastructure": {},
      "services": []
    },
    "Runtime JiraportApiLifecycle.StartRuntime": {
      "infrastructure": {},
      "services": []
    },
    "HTTP GET /healthz": {
      "infrastructure": {},
      "services": []
    },
    "HTTP GET /version": {
      "infrastructure": {},
      "services": []
    },
    "HTTP POST /jira/webhook/:receiver": {
      "infrastructure": {},
      "services": [
        {
          "name": "jiraport-resolver-http-ingress",
          "target_interface": "POST resolver-url",
          "operation_type": "http_post",
          "target_repo": "tidbcloud/jiraport",
          "conditions": [
            "The webhook body can be read successfully",
            "X-Hub-Signature matches the configured secret",
            "payload unmarshals into JiraWebhookEvent",
            "resolver-url is configured"
          ],
          "operations": [
            {
              "operation": "HTTP POST",
              "trigger": "Forward the normalized JiraIssue event to the resolver service over HTTP instead of AWS Lambda",
              "conditions": [
                "viper.GetString(\"resolver-url\") != \"\""
              ],
              "implementation": "lambda httpClient.InvokeAsync(ctx, event) -> http.NewRequestWithContext(\"POST\", resolverURL, eventJSON); client.Do(req)"
            }
          ]
        },
        {
          "name": "aws-lambda-resolver",
          "target_interface": "InvokeAsync resolver-function-name",
          "operation_type": "lambda_invoke",
          "target_repo": "aws/lambda",
          "conditions": [
            "The webhook body can be read successfully",
            "X-Hub-Signature matches the configured secret",
            "payload unmarshals into JiraWebhookEvent",
            "resolver-url is empty",
            "is-local-dev is false"
          ],
          "operations": [
            {
              "operation": "INVOKE ASYNC",
              "trigger": "Forward the normalized JiraIssue event to the configured resolver Lambda function",
              "conditions": [
                "viper.GetString(\"resolver-url\") == \"\"",
                "viper.GetBool(\"is-local-dev\") == false"
              ],
              "implementation": "lambda Client.InvokeAsync(ctx, event) -> lambdaClient.Invoke(ctx, &lambda.InvokeInput{InvocationType: Event})"
            }
          ]
        }
      ]
    },
    "HTTP POST /lark/ack": {
      "infrastructure": {},
      "services": [
        {
          "name": "jiraport-resolver-http-ingress",
          "target_interface": "POST resolver-url",
          "operation_type": "http_post",
          "target_repo": "tidbcloud/jiraport",
          "conditions": [
            "request body binds into AckWebhookEvent",
            "resolver-url is configured"
          ],
          "operations": [
            {
              "operation": "HTTP POST",
              "trigger": "Forward NotificationAck to the resolver over HTTP",
              "conditions": [
                "viper.GetString(\"resolver-url\") != \"\""
              ],
              "implementation": "lambda httpClient.InvokeAsync(ctx, ev) -> client.Do(req)"
            }
          ]
        },
        {
          "name": "aws-lambda-resolver",
          "target_interface": "InvokeAsync resolver-function-name",
          "operation_type": "lambda_invoke",
          "target_repo": "aws/lambda",
          "conditions": [
            "request body binds into AckWebhookEvent",
            "resolver-url is empty",
            "is-local-dev is false"
          ],
          "operations": [
            {
              "operation": "INVOKE ASYNC",
              "trigger": "Forward NotificationAck to the resolver Lambda function",
              "conditions": [
                "viper.GetString(\"resolver-url\") == \"\"",
                "viper.GetBool(\"is-local-dev\") == false"
              ],
              "implementation": "lambda Client.InvokeAsync(ctx, ev) -> lambdaClient.Invoke(ctx, &lambda.InvokeInput{InvocationType: Event})"
            }
          ]
        }
      ]
    },
    "HTTP POST /hook/comment": {
      "infrastructure": {},
      "services": [
        {
          "name": "jiraport-resolver-http-ingress",
          "target_interface": "POST resolver-url",
          "operation_type": "http_post",
          "target_repo": "tidbcloud/jiraport",
          "conditions": [
            "The hook body can be read successfully",
            "X-Hub-Signature matches the configured secret",
            "payload unmarshals into HookBody",
            "resolver-url is configured"
          ],
          "operations": [
            {
              "operation": "HTTP POST",
              "trigger": "Forward HookEvent to the resolver over HTTP",
              "conditions": [
                "viper.GetString(\"resolver-url\") != \"\""
              ],
              "implementation": "lambda httpClient.InvokeAsync(ctx, ev) -> client.Do(req)"
            }
          ]
        },
        {
          "name": "aws-lambda-resolver",
          "target_interface": "InvokeAsync resolver-function-name",
          "operation_type": "lambda_invoke",
          "target_repo": "aws/lambda",
          "conditions": [
            "The hook body can be read successfully",
            "X-Hub-Signature matches the configured secret",
            "payload unmarshals into HookBody",
            "resolver-url is empty",
            "is-local-dev is false"
          ],
          "operations": [
            {
              "operation": "INVOKE ASYNC",
              "trigger": "Forward HookEvent to the resolver Lambda function",
              "conditions": [
                "viper.GetString(\"resolver-url\") == \"\"",
                "viper.GetBool(\"is-local-dev\") == false"
              ],
              "implementation": "lambda Client.InvokeAsync(ctx, ev) -> lambdaClient.Invoke(ctx, &lambda.InvokeInput{InvocationType: Event})"
            }
          ]
        }
      ]
    }
  },
  "notes": [
    "All business effects are delegated to the resolver binary by async event dispatch; cmd/api itself never writes to MySQL or calls Jira/Lark downstream APIs directly."
  ]
}
