
Research
Shai-Hulud Descends to Hades: Miasma Worm Campaign Spreads with New PyPI Wave
Socket found 37 malicious PyPI wheels that abuse Python startup hooks to launch a Bun-powered credential stealer tied to Mini Shai-Hulud/Miasma.
eventbridge-schema-validation
Advanced tools
Typescript toolbox for AWS EventBridge
putEvents call when publishing more than 10 events at a timenpm i typebridge --save
Typebridge
v1and above is meant to be used with AWS SDK v3. If you want to use Typebridge with AWS SDK v2, you should installv0versions of this packagenpm i typebridge@^0
import { EventBridgeClient } from '@aws-sdk/client-eventbridge';
import { Bus, Event } from 'typebridge';
export const MyBus = new Bus({
name: 'applicationBus',
EventBridge: new EventBridgeClient({}),
});
export const MyEventPayloadSchema = {
type: 'object',
properties: {
stringAttribute: { type: 'string' },
numberAttribute: { type: 'integer' },
},
required: ['stringAttribute'],
additionalProperties: false
} as const;
export const MyEvent = new Event({
name: 'MyEvent',
bus: MyBus,
schema: MyEventPayloadSchema,
source: 'mySource'
});
import { MyEvent } from './events.ts';
export const handler = async (event) => {
await MyEvent.publish({
stringAttribute: 'string',
numberAttribute: 12,
})
return 'Event published !'
};
Typechecking is automatically enabled:
await MyEvent.publish({
stringAttribute: 'string',
numberAttribute: 12,
// the following line will trigger a Typescript error
anotherAttribute: 'wrong'
})
import { MyBus, MyEvent } from './events.ts';
export const handler = async (event) => {
const events = event.details.map(detail => MyEvent.create({
stringAttribute: detail.stringAttribute,
numberAttribute: detail.numberAttribute,
})
await MyBus.put(events);
return 'Event published !'
};
Using the serverless framework with serverless.ts service file:
import type { Serverless } from 'serverless/aws';
const serverlessConfiguration: Serverless = {
service: 'typebridge-test',
provider: {
name: 'aws',
runtime: 'nodejs12.x',
},
functions: {
hello: {
handler: 'MyEventHandler.handler',
events: [
{
eventBridge: {
eventBus: 'applicationBus',
pattern: NewUserConnectedEvent.pattern,
},
},
],
}
}
}
module.exports = serverlessConfiguration;
import { PublishedEvent } from 'typebridge';
import { MyEvent } from './events.ts';
export const handler = (event: PublishedEvent<typeof MyEvent>) => {
// Typed as string
return event.detail.stringAttribute;
}
Using middy middleware stack in your lambda's handler, you can throw an error before your handler's code being executed if the input event source or detail-type were not expected, or if the detail property does not satisfy the JSON-schema used in MyEvent constructor.
import middy from '@middy/core';
import jsonValidator from '@middy/validator';
import { MyEvent } from './events.ts';
const handler = (event) => {
return 'Validation succeeded';
};
// If event.detail does not match the JSON-schema supplied to MyEvent constructor, the middleware will throw an error
export const main = middy(handler).use(
jsonValidator({ inputSchema: MyEvent.publishedEventSchema }),
);
FAQs
Typescript toolbox for AWS EventBridge
We found that eventbridge-schema-validation 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.

Research
Socket found 37 malicious PyPI wheels that abuse Python startup hooks to launch a Bun-powered credential stealer tied to Mini Shai-Hulud/Miasma.

Security News
RubyGems and Bundler 4.0.13 introduced an opt-in cooldown feature that delays newly published gems during dependency resolution.

Security News
pnpm 11.5 now recognizes npm staged publish approvals in release metadata, preventing those releases from being mistaken for lower-trust package publishes.