Skip to content

Commit b2e29f5

Browse files
committed
feat: implement error handler and update lifecycle hooks
Release-As: 0.0.22
1 parent 9de4b38 commit b2e29f5

File tree

99 files changed

+1899
-1853
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+1899
-1853
lines changed

CHANGELOG.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
# Changelog
22

3-
## 0.0.2 (2024-12-08)
4-
3+
All notable changes to the "Stone.js AWS Lambda Adapter" extension will be documented in this file.
54

6-
### Features
5+
## Unreleased
76

8-
* implement aws adapters ([8695eb2](https://github.com/stonemjs/aws-lambda-adapter/commit/8695eb2c7960769d56015943ac0839e787f176d2))
97

10-
## Changelog
8+
## 0.0.2 (2024-12-08)
119

12-
All notable changes to the "Stone.js AWS Lambda Adapter" extension will be documented in this file.
1310

14-
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
11+
### Features
1512

16-
## Unreleased
13+
* implement aws adapters ([8695eb2](https://github.com/stonemjs/aws-lambda-adapter/commit/8695eb2c7960769d56015943ac0839e787f176d2))

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
[![npm](https://img.shields.io/npm/l/@stone-js/aws-lambda-adapter)](https://opensource.org/licenses/Apache-2.0)
44
[![npm](https://img.shields.io/npm/v/@stone-js/aws-lambda-adapter)](https://www.npmjs.com/package/@stone-js/aws-lambda-adapter)
55
[![npm](https://img.shields.io/npm/dm/@stone-js/aws-lambda-adapter)](https://www.npmjs.com/package/@stone-js/aws-lambda-adapter)
6-
![Maintenance](https://img.shields.io/maintenance/yes/2024)
6+
![Maintenance](https://img.shields.io/maintenance/yes/2025)
77
[![Publish Package to npmjs](https://github.com/stonemjs/aws-lambda-adapter/actions/workflows/release.yml/badge.svg)](https://github.com/stonemjs/aws-lambda-adapter/actions/workflows/release.yml)
8-
[![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=stonemjs/aws-lambda-adapter)](https://dependabot.com)
8+
[![Dependabot Status](https://img.shields.io/badge/Dependabot-enabled-brightgreen.svg?logo=dependabot)](https://github.com/stonemjs/aws-lambda-adapter/network/updates)
99
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org)
1010

1111
Stone.js AWS Lambda Adapters with typings.

docs/AWSLambdaAdapter/README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
[**AWS Lambda Adapter Documentation v0.0.0**](../README.md)
1+
[**AWS Lambda Adapter Documentation v0.0.2**](../README.md)
22

33
***
44

55
[AWS Lambda Adapter Documentation](../modules.md) / AWSLambdaAdapter
66

77
# AWSLambdaAdapter
88

9-
## Index
10-
11-
### Classes
9+
## Classes
1210

1311
- [AWSLambdaAdapter](classes/AWSLambdaAdapter.md)

docs/AWSLambdaAdapter/classes/AWSLambdaAdapter.md

Lines changed: 16 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
[**AWS Lambda Adapter Documentation v0.0.0**](../../README.md)
1+
[**AWS Lambda Adapter Documentation v0.0.2**](../../README.md)
22

33
***
44

55
[AWS Lambda Adapter Documentation](../../modules.md) / [AWSLambdaAdapter](../README.md) / AWSLambdaAdapter
66

77
# Class: AWSLambdaAdapter
88

9+
Defined in: [src/AWSLambdaAdapter.ts:40](https://github.com/stonemjs/aws-lambda-adapter/blob/9de4b38bb7a5afd4d5599dae1399969698a2422d/src/AWSLambdaAdapter.ts#L40)
10+
911
AWS Lambda Adapter for Stone.js.
1012

1113
The `AWSLambdaAdapter` provides seamless integration between Stone.js applications
@@ -70,13 +72,15 @@ export { handler };
7072

7173
> `protected` **new AWSLambdaAdapter**(`options`): [`AWSLambdaAdapter`](AWSLambdaAdapter.md)
7274
75+
Defined in: node\_modules/@stone-js/core/dist/index.d.ts:1876
76+
7377
Create an Adapter.
7478

7579
#### Parameters
7680

7781
##### options
7882

79-
`AdapterOptions`\<[`RawResponse`](../../declarations/type-aliases/RawResponse.md), `IncomingEvent`, `OutgoingResponse`\>
83+
`AdapterOptions`\<`IncomingEvent`, `OutgoingResponse`\>
8084

8185
Adapter options.
8286

@@ -86,26 +90,16 @@ Adapter options.
8690

8791
#### Inherited from
8892

89-
`Adapter<
90-
AwsLambdaEvent,
91-
RawResponse,
92-
AwsLambdaContext,
93-
IncomingEvent,
94-
IncomingEventOptions,
95-
OutgoingResponse,
96-
AwsLambdaAdapterContext
97-
>.constructor`
98-
99-
#### Defined in
100-
101-
node\_modules/@stone-js/core/dist/index.d.ts:1772
93+
`Adapter< AwsLambdaEvent, RawResponse, AwsLambdaContext, IncomingEvent, IncomingEventOptions, OutgoingResponse, AwsLambdaAdapterContext >.constructor`
10294

10395
## Methods
10496

10597
### eventListener()
10698

10799
> `protected` **eventListener**(`rawEvent`, `executionContext`): `Promise`\<[`RawResponse`](../../declarations/type-aliases/RawResponse.md)\>
108100
101+
Defined in: [src/AWSLambdaAdapter.ts:113](https://github.com/stonemjs/aws-lambda-adapter/blob/9de4b38bb7a5afd4d5599dae1399969698a2422d/src/AWSLambdaAdapter.ts#L113)
102+
109103
Processes an incoming AWS Lambda event.
110104

111105
This method transforms the raw AWS Lambda event into a Stone.js `IncomingEvent`,
@@ -131,16 +125,14 @@ The AWS Lambda execution context for the event.
131125

132126
A promise resolving to the processed `RawResponse`.
133127

134-
#### Defined in
135-
136-
[src/AWSLambdaAdapter.ts:115](https://github.com/stonemjs/aws-lambda-adapter/blob/f00bc5adf35a7d817c9d8d34c42561c4c82e758d/src/AWSLambdaAdapter.ts#L115)
137-
138128
***
139129

140130
### onInit()
141131

142132
> `protected` **onInit**(): `Promise`\<`void`\>
143133
134+
Defined in: [src/AWSLambdaAdapter.ts:93](https://github.com/stonemjs/aws-lambda-adapter/blob/9de4b38bb7a5afd4d5599dae1399969698a2422d/src/AWSLambdaAdapter.ts#L93)
135+
144136
Initializes the adapter and validates its execution context.
145137

146138
Ensures the adapter is running in an AWS Lambda environment. If not, it
@@ -158,16 +150,14 @@ If executed outside an AWS Lambda context (e.g., browser).
158150

159151
`Adapter.onInit`
160152

161-
#### Defined in
162-
163-
[src/AWSLambdaAdapter.ts:95](https://github.com/stonemjs/aws-lambda-adapter/blob/f00bc5adf35a7d817c9d8d34c42561c4c82e758d/src/AWSLambdaAdapter.ts#L95)
164-
165153
***
166154

167155
### run()
168156

169157
> **run**\<`ExecutionResultType`\>(): `Promise`\<`ExecutionResultType`\>
170158
159+
Defined in: [src/AWSLambdaAdapter.ts:75](https://github.com/stonemjs/aws-lambda-adapter/blob/9de4b38bb7a5afd4d5599dae1399969698a2422d/src/AWSLambdaAdapter.ts#L75)
160+
171161
Executes the adapter and provides an AWS Lambda-compatible handler function.
172162

173163
The `run` method initializes the adapter and returns a handler function
@@ -194,16 +184,14 @@ If used outside the AWS Lambda environment.
194184

195185
`Adapter.run`
196186

197-
#### Defined in
198-
199-
[src/AWSLambdaAdapter.ts:77](https://github.com/stonemjs/aws-lambda-adapter/blob/f00bc5adf35a7d817c9d8d34c42561c4c82e758d/src/AWSLambdaAdapter.ts#L77)
200-
201187
***
202188

203189
### create()
204190

205191
> `static` **create**(`options`): [`AWSLambdaAdapter`](AWSLambdaAdapter.md)
206192
193+
Defined in: [src/AWSLambdaAdapter.ts:60](https://github.com/stonemjs/aws-lambda-adapter/blob/9de4b38bb7a5afd4d5599dae1399969698a2422d/src/AWSLambdaAdapter.ts#L60)
194+
207195
Creates an instance of the `AWSLambdaAdapter`.
208196

209197
This factory method allows developers to instantiate the adapter with
@@ -214,7 +202,7 @@ AWS Lambda usage.
214202

215203
##### options
216204

217-
`AdapterOptions`\<[`RawResponse`](../../declarations/type-aliases/RawResponse.md), `IncomingEvent`, `OutgoingResponse`\>
205+
`AdapterOptions`\<`IncomingEvent`, `OutgoingResponse`\>
218206

219207
The configuration options for the adapter, including
220208
handler resolver, error handling, and other settings.
@@ -224,7 +212,3 @@ The configuration options for the adapter, including
224212
[`AWSLambdaAdapter`](AWSLambdaAdapter.md)
225213

226214
A fully initialized `AWSLambdaAdapter` instance.
227-
228-
#### Defined in
229-
230-
[src/AWSLambdaAdapter.ts:60](https://github.com/stonemjs/aws-lambda-adapter/blob/f00bc5adf35a7d817c9d8d34c42561c4c82e758d/src/AWSLambdaAdapter.ts#L60)

docs/AWSLambdaHttpAdapter/README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
[**AWS Lambda Adapter Documentation v0.0.0**](../README.md)
1+
[**AWS Lambda Adapter Documentation v0.0.2**](../README.md)
22

33
***
44

55
[AWS Lambda Adapter Documentation](../modules.md) / AWSLambdaHttpAdapter
66

77
# AWSLambdaHttpAdapter
88

9-
## Index
10-
11-
### Classes
9+
## Classes
1210

1311
- [AWSLambdaHttpAdapter](classes/AWSLambdaHttpAdapter.md)

docs/AWSLambdaHttpAdapter/classes/AWSLambdaHttpAdapter.md

Lines changed: 16 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1-
[**AWS Lambda Adapter Documentation v0.0.0**](../../README.md)
1+
[**AWS Lambda Adapter Documentation v0.0.2**](../../README.md)
22

33
***
44

55
[AWS Lambda Adapter Documentation](../../modules.md) / [AWSLambdaHttpAdapter](../README.md) / AWSLambdaHttpAdapter
66

77
# Class: AWSLambdaHttpAdapter
88

9+
Defined in: [src/AWSLambdaHttpAdapter.ts:42](https://github.com/stonemjs/aws-lambda-adapter/blob/9de4b38bb7a5afd4d5599dae1399969698a2422d/src/AWSLambdaHttpAdapter.ts#L42)
10+
911
AWS Lambda HTTP Adapter for Stone.js.
1012

1113
The `AWSLambdaHttpAdapter` extends the functionality of the Stone.js `Adapter`
@@ -71,13 +73,15 @@ export { handler };
7173

7274
> `protected` **new AWSLambdaHttpAdapter**(`options`): [`AWSLambdaHttpAdapter`](AWSLambdaHttpAdapter.md)
7375
76+
Defined in: node\_modules/@stone-js/core/dist/index.d.ts:1876
77+
7478
Create an Adapter.
7579

7680
#### Parameters
7781

7882
##### options
7983

80-
`AdapterOptions`\<[`RawHttpResponseOptions`](../../declarations/interfaces/RawHttpResponseOptions.md), `IncomingHttpEvent`, `OutgoingHttpResponse`\>
84+
`AdapterOptions`\<`IncomingHttpEvent`, `OutgoingHttpResponse`\>
8185

8286
Adapter options.
8387

@@ -87,26 +91,16 @@ Adapter options.
8791

8892
#### Inherited from
8993

90-
`Adapter<
91-
AwsLambdaHttpEvent,
92-
RawHttpResponse,
93-
AwsLambdaContext,
94-
IncomingHttpEvent,
95-
IncomingHttpEventOptions,
96-
OutgoingHttpResponse,
97-
AwsLambdaHttpAdapterContext
98-
>.constructor`
99-
100-
#### Defined in
101-
102-
node\_modules/@stone-js/core/dist/index.d.ts:1772
94+
`Adapter< AwsLambdaHttpEvent, RawHttpResponse, AwsLambdaContext, IncomingHttpEvent, IncomingHttpEventOptions, OutgoingHttpResponse, AwsLambdaHttpAdapterContext >.constructor`
10395

10496
## Methods
10597

10698
### eventListener()
10799

108100
> `protected` **eventListener**(`rawEvent`, `executionContext`): `Promise`\<[`RawHttpResponseOptions`](../../declarations/interfaces/RawHttpResponseOptions.md)\>
109101
102+
Defined in: [src/AWSLambdaHttpAdapter.ts:113](https://github.com/stonemjs/aws-lambda-adapter/blob/9de4b38bb7a5afd4d5599dae1399969698a2422d/src/AWSLambdaHttpAdapter.ts#L113)
103+
110104
Processes an incoming AWS Lambda HTTP event.
111105

112106
Converts a raw AWS Lambda HTTP event into an `IncomingHttpEvent`, processes it through
@@ -132,16 +126,14 @@ The AWS Lambda execution context associated with the event.
132126

133127
A promise resolving to the processed `RawHttpResponse`.
134128

135-
#### Defined in
136-
137-
[src/AWSLambdaHttpAdapter.ts:115](https://github.com/stonemjs/aws-lambda-adapter/blob/f00bc5adf35a7d817c9d8d34c42561c4c82e758d/src/AWSLambdaHttpAdapter.ts#L115)
138-
139129
***
140130

141131
### onInit()
142132

143133
> `protected` **onInit**(): `Promise`\<`void`\>
144134
135+
Defined in: [src/AWSLambdaHttpAdapter.ts:93](https://github.com/stonemjs/aws-lambda-adapter/blob/9de4b38bb7a5afd4d5599dae1399969698a2422d/src/AWSLambdaHttpAdapter.ts#L93)
136+
145137
Initializes the adapter and validates its execution context.
146138

147139
Ensures that the adapter is running in an AWS Lambda environment. Throws an error
@@ -159,16 +151,14 @@ If executed outside an AWS Lambda environment.
159151

160152
`Adapter.onInit`
161153

162-
#### Defined in
163-
164-
[src/AWSLambdaHttpAdapter.ts:95](https://github.com/stonemjs/aws-lambda-adapter/blob/f00bc5adf35a7d817c9d8d34c42561c4c82e758d/src/AWSLambdaHttpAdapter.ts#L95)
165-
166154
***
167155

168156
### run()
169157

170158
> **run**\<`ExecutionResultType`\>(): `Promise`\<`ExecutionResultType`\>
171159
160+
Defined in: [src/AWSLambdaHttpAdapter.ts:75](https://github.com/stonemjs/aws-lambda-adapter/blob/9de4b38bb7a5afd4d5599dae1399969698a2422d/src/AWSLambdaHttpAdapter.ts#L75)
161+
172162
Executes the adapter and provides an AWS Lambda-compatible HTTP handler function.
173163

174164
This method initializes the adapter and returns a handler function that can
@@ -195,16 +185,14 @@ If used outside the AWS Lambda environment.
195185

196186
`Adapter.run`
197187

198-
#### Defined in
199-
200-
[src/AWSLambdaHttpAdapter.ts:77](https://github.com/stonemjs/aws-lambda-adapter/blob/f00bc5adf35a7d817c9d8d34c42561c4c82e758d/src/AWSLambdaHttpAdapter.ts#L77)
201-
202188
***
203189

204190
### create()
205191

206192
> `static` **create**(`options`): [`AWSLambdaHttpAdapter`](AWSLambdaHttpAdapter.md)
207193
194+
Defined in: [src/AWSLambdaHttpAdapter.ts:60](https://github.com/stonemjs/aws-lambda-adapter/blob/9de4b38bb7a5afd4d5599dae1399969698a2422d/src/AWSLambdaHttpAdapter.ts#L60)
195+
208196
Creates an instance of the `AWSLambdaHttpAdapter`.
209197

210198
This factory method initializes the adapter with the specified configuration options.
@@ -213,7 +201,7 @@ This factory method initializes the adapter with the specified configuration opt
213201

214202
##### options
215203

216-
`AdapterOptions`\<[`RawHttpResponseOptions`](../../declarations/interfaces/RawHttpResponseOptions.md), `IncomingHttpEvent`, `OutgoingHttpResponse`\>
204+
`AdapterOptions`\<`IncomingHttpEvent`, `OutgoingHttpResponse`\>
217205

218206
Configuration options for the adapter, including the handler resolver
219207
and error handling mechanisms.
@@ -223,7 +211,3 @@ Configuration options for the adapter, including the handler resolver
223211
[`AWSLambdaHttpAdapter`](AWSLambdaHttpAdapter.md)
224212

225213
A new instance of `AWSLambdaHttpAdapter`.
226-
227-
#### Defined in
228-
229-
[src/AWSLambdaHttpAdapter.ts:60](https://github.com/stonemjs/aws-lambda-adapter/blob/f00bc5adf35a7d817c9d8d34c42561c4c82e758d/src/AWSLambdaHttpAdapter.ts#L60)

docs/AwsLambdaErrorHandler/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[**AWS Lambda Adapter Documentation v0.0.2**](../README.md)
2+
3+
***
4+
5+
[AWS Lambda Adapter Documentation](../modules.md) / AwsLambdaErrorHandler
6+
7+
# AwsLambdaErrorHandler
8+
9+
## Classes
10+
11+
- [AwsLambdaErrorHandler](classes/AwsLambdaErrorHandler.md)
12+
13+
## Interfaces
14+
15+
- [AwsLambdaErrorHandlerOptions](interfaces/AwsLambdaErrorHandlerOptions.md)

0 commit comments

Comments
 (0)