# serverless.yml

useDotenv: true

service: learn-card-http-bridge

plugins:
    - serverless-esbuild
    - serverless-plugin-warmup

custom:
    esbuild:
        packager: bun
    warmup:
        default:
            enabled: true

provider:
    name: aws
    runtime: nodejs14.x
    stage: dev
    region: us-east-1
    timeout: 29
    httpApi:
        cors: true
    environment:
        WALLET_SEED: ${env:WALLET_SEED}

package:
    patterns:
        - src/didkit_wasm_bg.wasm

functions:
    api:
        handler: lambda.handler
        memorySize: 2048
        events:
            - httpApi: 'GET /'
            - httpApi: 'GET /did'
            - httpApi: 'GET /credentials'
            - httpApi: 'GET /credentials/{id}'
            - httpApi: 'DELETE /credentials/{id}'
            - httpApi: 'POST /credentials/issue'
            - httpApi: 'POST /credentials/status'
            - httpApi: 'POST /credentials/verify'
            - httpApi: 'POST /credentials/derive'
            - httpApi: 'POST /presentations/issue'
            - httpApi: 'POST /presentations/verify'
            - httpApi: 'POST /presentations/prove'
            - httpApi: 'GET /presentations'
            - httpApi: 'GET /presentations/{id}'
            - httpApi: 'DELETE /presentations/{id}'
            - httpApi: 'POST /exchanges/{exchangeId}'
            - httpApi: 'POST /exchanges/{exchangeId}/{transactionId}'
        warmup:
            default:
                enabled:
                    - dev
                    - prod
