Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
@anttiviljami/openapi-lambda-adapter
Advanced tools
JavaScript client library for integrating AWS Lambdas with openapi-client-axios
JavaScript/Typescript library for making AWS Lambda to Lambda calls via openapi-client-axios .
client.api.registerRunner(getLambdaRunner('target-lambda-name'))
client.getPet(1)
client.searchPets()
client.searchPets({ ids: [1, 2, 3] })
client.updatePet(1, payload)
Resources:
MyLambda:
Type: AWS::Serverless::Function
Properties:
...
Policies:
- LambdaInvokePolicy:
FunctionName: target-lambda-name
npm install --save openapi-client-axios openapi-lambda-adapter
Setup for single lambda handling all API Gateway requests
import OpenAPIClientAxios from 'openapi-client-axios';
import { getLambdaRunner } from 'openapi-lambda-adapter';
const api = new OpenAPIClientAxios({ definition: 'https://example.com/api/openapi.json' });
const client = api.initSync();
client.api.registerRunner(getLambdaRunner('target-lambda-name'));
const res = await client.createPet(null, { name: 'Garfield' });
console.log('Pet created', res.data);
Setup for multiple lambdas, each lambda handling one API Gateway resource
import OpenAPIClientAxios from 'openapi-client-axios';
import { getLambdaRunner } from 'openapi-lambda-adapter';
const api = new OpenAPIClientAxios({ definition: 'https://example.com/api/openapi.json' });
const client = api.initSync();
client.api.getOperations().forEach((operation) => {
const lambdaName = ... get lambda-name for operationId
client.api.registerRunner(getLambdaRunner(lambdaName), operation.operationId)
})
const res = await client.createPet(null, { name: 'Garfield' });
console.log('Pet created', res.data);
const resp = await client.getPet({ id: 1 }, null);
console.log('Pet retrieved', resp.data);
FAQs
JavaScript client library for integrating AWS Lambdas with openapi-client-axios
We found that @anttiviljami/openapi-lambda-adapter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.