presta icon indicating copy to clipboard operation
presta copied to clipboard

Clean up context/event typings

Open estrattonbailey opened this issue 3 years ago • 0 comments

Here's a full dump of what Netlify sends through:

{
  "path": "/api/debug",
  "headers": {
    "accept": "*/*",
    "client-ip": "100.64.0.153",
    "content-length": "17",
    "content-type": "application/json",
    "forwarded": "for=104.153.230.193;proto=https",
    "host": [
      "presta-examples-hybrid.netlify.app"
    ],
    "user-agent": "insomnia/2021.3.0",
    "via": "http/1.1 Netlify[a6bc9ff2-5860-4286-8f5d-54ad5afda6f3] (Netlify Edge Server)",
    "x-bb-ab": "0.400349",
    "x-bb-client-request-uuid": "90512692-9be1-4b57-bb73-8f234b8e5ae9",
    "x-bb-ip": "104.153.230.193",
    "x-bb-loop": "1",
    "x-country": "US",
    "x-datadog-parent-id": "10594547098324678308",
    "x-datadog-sampling-priority": "1",
    "x-datadog-trace-id": "10002953044985329645",
    "x-foo": "10",
    "x-forwarded-for": "104.153.230.193, 100.64.0.153",
    "x-forwarded-proto": "https",
    "x-nf-client-connection-ip": "104.153.230.193",
    "x-nf-connection-proto": "https",
    "x-nf-request-id": "90512692-9be1-4b57-bb73-8f234b8e5ae9",
    "Accept": [
      "*/*"
    ],
    "Client-Ip": [
      "100.64.0.153"
    ],
    "Content-Length": [
      "17"
    ],
    "Content-Type": [
      "application/json"
    ],
    "Forwarded": [
      "for=104.153.230.193;proto=https"
    ],
    "User-Agent": [
      "insomnia/2021.3.0"
    ],
    "Via": [
      "http/1.1 Netlify[a6bc9ff2-5860-4286-8f5d-54ad5afda6f3] (Netlify Edge Server)"
    ],
    "X-Bb-Ab": [
      "0.400349"
    ],
    "X-Bb-Client-Request-Uuid": [
      "90512692-9be1-4b57-bb73-8f234b8e5ae9"
    ],
    "X-Bb-Ip": [
      "104.153.230.193"
    ],
    "X-Bb-Loop": [
      "1"
    ],
    "X-Country": [
      "US"
    ],
    "X-Datadog-Parent-Id": [
      "10594547098324678308"
    ],
    "X-Datadog-Sampling-Priority": [
      "1"
    ],
    "X-Datadog-Trace-Id": [
      "10002953044985329645"
    ],
    "X-Foo": [
      "10"
    ],
    "X-Forwarded-For": [
      "104.153.230.193, 100.64.0.153"
    ],
    "X-Forwarded-Proto": [
      "https"
    ],
    "X-Nf-Client-Connection-Ip": [
      "104.153.230.193"
    ],
    "X-Nf-Connection-Proto": [
      "https"
    ],
    "X-Nf-Request-Id": [
      "90512692-9be1-4b57-bb73-8f234b8e5ae9"
    ]
  },
  "params": {},
  "query": {
    "foo": [
      "a"
    ]
  },
  "lambda": {
    "event": {
      "rawUrl": "https://presta-examples-hybrid.netlify.app/api/debug?foo=a",
      "rawQuery": "foo=a",
      "path": "/api/debug",
      "httpMethod": "POST",
      "headers": {
        "accept": "*/*",
        "client-ip": "100.64.0.153",
        "content-length": "17",
        "content-type": "application/json",
        "forwarded": "for=104.153.230.193;proto=https",
        "host": "presta-examples-hybrid.netlify.app",
        "user-agent": "insomnia/2021.3.0",
        "via": "http/1.1 Netlify[a6bc9ff2-5860-4286-8f5d-54ad5afda6f3] (Netlify Edge Server)",
        "x-bb-ab": "0.400349",
        "x-bb-client-request-uuid": "90512692-9be1-4b57-bb73-8f234b8e5ae9",
        "x-bb-ip": "104.153.230.193",
        "x-bb-loop": "1",
        "x-country": "US",
        "x-datadog-parent-id": "10594547098324678308",
        "x-datadog-sampling-priority": "1",
        "x-datadog-trace-id": "10002953044985329645",
        "x-foo": "10",
        "x-forwarded-for": "104.153.230.193, 100.64.0.153",
        "x-forwarded-proto": "https",
        "x-nf-client-connection-ip": "104.153.230.193",
        "x-nf-connection-proto": "https",
        "x-nf-request-id": "90512692-9be1-4b57-bb73-8f234b8e5ae9"
      },
      "multiValueHeaders": {
        "Accept": [
          "*/*"
        ],
        "Client-Ip": [
          "100.64.0.153"
        ],
        "Content-Length": [
          "17"
        ],
        "Content-Type": [
          "application/json"
        ],
        "Forwarded": [
          "for=104.153.230.193;proto=https"
        ],
        "User-Agent": [
          "insomnia/2021.3.0"
        ],
        "Via": [
          "http/1.1 Netlify[a6bc9ff2-5860-4286-8f5d-54ad5afda6f3] (Netlify Edge Server)"
        ],
        "X-Bb-Ab": [
          "0.400349"
        ],
        "X-Bb-Client-Request-Uuid": [
          "90512692-9be1-4b57-bb73-8f234b8e5ae9"
        ],
        "X-Bb-Ip": [
          "104.153.230.193"
        ],
        "X-Bb-Loop": [
          "1"
        ],
        "X-Country": [
          "US"
        ],
        "X-Datadog-Parent-Id": [
          "10594547098324678308"
        ],
        "X-Datadog-Sampling-Priority": [
          "1"
        ],
        "X-Datadog-Trace-Id": [
          "10002953044985329645"
        ],
        "X-Foo": [
          "10"
        ],
        "X-Forwarded-For": [
          "104.153.230.193, 100.64.0.153"
        ],
        "X-Forwarded-Proto": [
          "https"
        ],
        "X-Nf-Client-Connection-Ip": [
          "104.153.230.193"
        ],
        "X-Nf-Connection-Proto": [
          "https"
        ],
        "X-Nf-Request-Id": [
          "90512692-9be1-4b57-bb73-8f234b8e5ae9"
        ],
        "host": [
          "presta-examples-hybrid.netlify.app"
        ]
      },
      "queryStringParameters": {
        "foo": "a"
      },
      "multiValueQueryStringParameters": {
        "foo": [
          "a"
        ]
      },
      "body": "{\n\t\"test\": true\n}",
      "isBase64Encoded": false
    },
    "context": {
      "callbackWaitsForEmptyEventLoop": true,
      "functionVersion": "$LATEST",
      "functionName": "8b85c4aba30af0d5b4332026e9ef0505d9b43c4e9422edac1cde19f60adb4b51",
      "memoryLimitInMB": "1024",
      "logGroupName": "/aws/lambda/8b85c4aba30af0d5b4332026e9ef0505d9b43c4e9422edac1cde19f60adb4b51",
      "logStreamName": "2021/06/22/[$LATEST]2f7c4d58cefa41b9958b5191b41b898f",
      "clientContext": {
        "custom": {
          "netlify": "eyJzaXRlX3VybCI6Imh0dHBzOi8vcHJlc3RhLWV4YW1wbGVzLWh5YnJpZC5uZXRsaWZ5LmFwcCJ9"
        }
      },
      "invokedFunctionArn": "arn:aws:lambda:us-east-1:653012714635:function:8b85c4aba30af0d5b4332026e9ef0505d9b43c4e9422edac1cde19f60adb4b51",
      "awsRequestId": "a3a89bc5-4320-4321-9259-c567102e04e3"
    }
  },
  "method": "POST",
  "body": "{\n\t\"test\": true\n}"
}

estrattonbailey avatar Jun 22 '21 14:06 estrattonbailey