Gathering detailed insights and metrics for @anttiviljami/openapi-lambda-adapter
Gathering detailed insights and metrics for @anttiviljami/openapi-lambda-adapter
Run AWS Lambda to Lambda requests with openapi-client-axios
npm install @anttiviljami/openapi-lambda-adapter
Typescript
Module System
Node Version
NPM Version
TypeScript (98.06%)
JavaScript (1.94%)
Verify real, reachable, and deliverable emails with instant MX records, SMTP checks, and disposable email detection.
Total Downloads
268
Last Day
1
Last Week
2
Last Month
6
Last Year
72
MIT License
8 Stars
49 Commits
2 Forks
1 Watchers
4 Branches
3 Contributors
Updated on Jan 07, 2025
Minified
Minified + Gzipped
Latest Version
0.3.0
Package Id
@anttiviljami/openapi-lambda-adapter@0.3.0
Unpacked Size
32.59 kB
Size
10.03 kB
File Count
16
NPM Version
8.11.0
Node Version
16.15.1
Published on
Mar 01, 2023
Cumulative downloads
Total Downloads
Last Day
0%
1
Compared to previous day
Last Week
0%
2
Compared to previous week
Last Month
-45.5%
6
Compared to previous month
Last Year
-42.9%
72
Compared to previous year
1
28
JavaScript/Typescript library for making AWS Lambda to Lambda calls via openapi-client-axios .
1 client.api.registerRunner(getLambdaRunner('target-lambda-name'))
client.getPet(1)
client.searchPets()
client.searchPets({ ids: [1, 2, 3] })
client.updatePet(1, payload)
1 Resources: 2 MyLambda: 3 Type: AWS::Serverless::Function 4 Properties: 5 ... 6 Policies: 7 - LambdaInvokePolicy: 8 FunctionName: target-lambda-name
npm install --save openapi-client-axios openapi-lambda-adapter
Setup for single lambda handling all API Gateway requests
1import OpenAPIClientAxios from 'openapi-client-axios'; 2import { getLambdaRunner } from 'openapi-lambda-adapter'; 3 4const api = new OpenAPIClientAxios({ definition: 'https://example.com/api/openapi.json' }); 5const client = api.initSync(); 6client.api.registerRunner(getLambdaRunner('target-lambda-name')); 7 8const res = await client.createPet(null, { name: 'Garfield' }); 9console.log('Pet created', res.data);
Setup for multiple lambdas, each lambda handling one API Gateway resource
1import OpenAPIClientAxios from 'openapi-client-axios'; 2import { getLambdaRunner } from 'openapi-lambda-adapter'; 3 4const api = new OpenAPIClientAxios({ definition: 'https://example.com/api/openapi.json' }); 5const client = api.initSync(); 6client.api.getOperations().forEach((operation) => { 7 const lambdaName = ... get lambda-name for operationId 8 client.api.registerRunner(getLambdaRunner(lambdaName), operation.operationId) 9 }) 10 11const res = await client.createPet(null, { name: 'Garfield' }); 12console.log('Pet created', res.data); 13 14const resp = await client.getPet({ id: 1 }, null); 15console.log('Pet retrieved', resp.data);
No vulnerabilities found.
No security vulnerabilities found.