Files
floci/compatibility-tests/sdk-test-node/package.json
T
Dixit R Jain 3ae5c7b467 feat(apigatewayv2): Add WebSocket data-plane support (#712)
* feat: implement API Gateway v2 WebSocket data-plane support Implement full WebSocket data-plane for API Gateway v2, including: - Real WebSocket connection handling via Vert.x (ws://localhost:4566/ws/{apiId}/{stage}) - $connect/$disconnect/$default route lifecycle with Lambda integration - Custom route selection via routeSelectionExpression ($request.body.{field}) - @connections management API (POST/GET/DELETE) for server-to-client messaging - Lambda REQUEST authorizer support on $connect with identity source validation - Stage variable substitution in integration URIs - Multiple integration types: AWS_PROXY, AWS (VTL), HTTP_PROXY, HTTP (VTL), MOCK - Route response selection expression for bidirectional messaging - Binary frame support (isBase64Encoded: true) - 128 KB payload size limit enforcement (frames and @connections POST) - 10-minute idle timeout and 2-hour max connection duration - GoneException (410) for disconnected connections - $connect response headers propagation - Server-initiated close via @connections DELETE (skips $disconnect Lambda) Also includes: - Refactored LambdaArnUtils.extractFunctionNameFromUri as shared utility - Extended Authorizer/Integration/Stage models with new fields - Comprehensive Java integration tests (WebSocket lifecycle, routing, auth, etc.) - Node.js SDK compatibility tests using ws client and @aws-sdk/client-apigatewaymanagementapi - Updated documentation with full feature matrix

* test(apigatewayv2): support custom WebSocket endpoint via env var

- Update wsUrl helper to read FLOCI_ENDPOINT environment variable
- Convert http/https schemes to ws/wss for WebSocket compatibility
- Strip trailing slashes from endpoint URL for consistent formatting
- Enable testing against non-localhost endpoints for CI/CD flexibility

* fix: use AwsErrorResponse for @connections API error responses

Replace raw JSON string literals in handlePostToConnection,
handleGetConnectionInfo, and handleDeleteConnection with the
project-standard AwsErrorResponse record, which serialises to
the correct {"__type": ..., "message": ...} wire shape.

* fix: simplify extractFunctionNameFromUri using AwsArnUtils.parse

Adopt AwsArnUtils.parse() as the core of the implementation per
reviewer suggestion. One addition beyond the suggested snippet:
the API Gateway v1 integration URI format embeds a Lambda ARN
inside an apigateway ARN (resource starts with 'path/.../functions/'),
so we detect that pattern and recurse on the embedded ARN before
applying the standard function-name extraction. All 43
LambdaArnUtilsTest cases pass, including the API Gateway v1 style URI.
2026-05-08 17:15:35 -05:00

41 lines
1.3 KiB
JSON

{
"name": "floci-compatibility-tests-typescript",
"version": "1.0.0",
"type": "module",
"scripts": {
"test": "vitest run",
"test:watch": "vitest"
},
"dependencies": {
"@aws-sdk/client-acm": "^3.500.0",
"@aws-sdk/client-apigatewayv2": "^3.500.0",
"@aws-sdk/client-eventbridge": "^3.500.0",
"@aws-sdk/client-cloudformation": "^3.500.0",
"@aws-sdk/client-cloudwatch": "^3.500.0",
"@aws-sdk/client-cognito-identity-provider": "^3.500.0",
"@aws-sdk/client-dynamodb": "^3.500.0",
"@aws-sdk/client-ecr": "^3.500.0",
"@aws-sdk/client-pipes": "^3.500.0",
"@aws-sdk/client-iam": "^3.500.0",
"@aws-sdk/client-kinesis": "^3.500.0",
"@aws-sdk/client-kms": "^3.500.0",
"@aws-sdk/client-lambda": "^3.500.0",
"@aws-sdk/client-s3": "^3.500.0",
"@aws-sdk/client-secrets-manager": "^3.500.0",
"@aws-sdk/client-sns": "^3.500.0",
"@aws-sdk/client-sqs": "^3.500.0",
"@aws-sdk/client-ssm": "^3.500.0",
"@aws-sdk/client-apigatewaymanagementapi": "^3.500.0",
"@aws-sdk/client-sts": "^3.500.0",
"selfsigned": "^5.5.0",
"ws": "^8.0.0"
},
"devDependencies": {
"@types/node": "^20.0.0",
"@types/ws": "^8.0.0",
"esbuild": "^0.21.0",
"typescript": "^5.4.0",
"vitest": "^2.0.0"
}
}