diff --git a/release/progress.md b/release/progress.md index 9ac47ed..071eb59 100644 --- a/release/progress.md +++ b/release/progress.md @@ -6,7 +6,87 @@ Prioritized tasks that are currently in progress. ## to do +- [ ] fix: change `passthroughBehavior` to `never` instead of `when_no_match`, if correct - [ ] bug: `rx init` shouldn't overwrite a file if it exists. Can overwrite with `--force`. - [ ] bug: the CORS headers should be added to all operations, not just `OPTIONS` - [ ] bug: all errors should be friendly, unless verbose is on. - [ ] feature: all log output history should be stored like git log or reflog format. +- [ ] feature: upgrade to AWS API Gateway v2 API +- [ ] bug: oclif autocomplete doesn't work when opening a new shell on mac (maybe because of bashrc instead of bash_profile?) + +## notes + +```typescript +import 'source-map-support/register' +import { APIGatewayProxyHandler, APIGatewayEvent } from 'aws-lambda' +import { APIGateway } from 'aws-sdk' + +const gateway = new APIGateway() + +export const handler: APIGatewayProxyHandler = async function (event, context) { + const getExportResponse = await gateway.getExport({ + restApiId: event.requestContext.apiId, + stageName: event.requestContext.stage, + exportType: 'swagger', + parameters: event.requestContext.path === '/docs/postman' ? { extensions: 'postman' } : undefined, + accepts: 'application/json' + }).promise() + if (!getExportResponse.body) { + console.error('No export returned') + return { + statusCode: 500, + body: JSON.stringify({ message: 'Internal server error' }) + } + } + return { + statusCode: 200, + headers: { + 'Content-Type': 'application/json' + }, + body: getExportResponse.body.toString() + } +} +``` + +```yaml + /docs/swagger: + get: + summary: Returns a swagger specification + description: Returns a swagger specification + produces: + - application/json + responses: + 200: + description: OK + schema: + $ref: "#/definitions/SpecResponse" + security: + - api_key: [] + x-amazon-apigateway-auth: + type: aws_iam + x-amazon-apigateway-integration: + type: aws_proxy + httpMethod: POST + uri: ${spec_lambda_invoke_arn} + passthroughBehavior: when_no_match + /docs/postman: + get: + summary: Returns a postman collection + description: Returns a postman collection + produces: + - application/json + responses: + 200: + description: OK + schema: + $ref: "#/definitions/SpecResponse" + security: + - api_key: [] + x-amazon-apigateway-auth: + type: aws_iam + x-amazon-apigateway-integration: + type: aws_proxy + httpMethod: POST + uri: ${spec_lambda_invoke_arn} + passthroughBehavior: when_no_match +``` diff --git a/release/v2.0.0.md b/release/v2.0.0.md index 0d93e38..9177edf 100644 --- a/release/v2.0.0.md +++ b/release/v2.0.0.md @@ -70,7 +70,8 @@ rx test # --load --chaos # chores - [x] move to the oclif framework for a better cli development, usage, and distribution experience -- [ ] revert a39d95f and implement tests +- [x] revert a39d95f +- [ ] implement tests - [ ] configure all package distribution options # release notes