Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 50 additions & 59 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"request-promise-native": "1.0.5",
"rimraf": "2.6.2",
"serverless-aws-documentation": "1.0.0",
"serverless-domain-manager": "1.1.17",
"serverless-domain-manager": "1.1.18",
"serverless-offline": "3.16.0",
"serverless-plugin-typescript": "1.1.3",
"serverless-stack-output": "0.2.0",
Expand Down
4 changes: 2 additions & 2 deletions shared/api.interfaces.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { APIGatewayEvent, Context, ProxyCallback, ProxyHandler, ProxyResult } from 'aws-lambda'; // tslint:disable-line no-implicit-dependencies (Using only the type information from the @types package.)
import { APIGatewayEvent, Context, ProxyCallback, ProxyResult } from 'aws-lambda'; // tslint:disable-line no-implicit-dependencies (Using only the type information from the @types package.)
import { ErrorResult } from './errors';

// Type aliases to hide the 'aws-lambda' package and have consistent, short naming.
export type ApiCallback = ProxyCallback;
export type ApiContext = Context;
export type ApiEvent = APIGatewayEvent;
export type ApiHandler = ProxyHandler;
export type ApiHandler = (event: APIGatewayEvent, context: Context, callback: ApiCallback) => void; // Same as ProxyHandler, but requires callback.
export type ApiResponse = ProxyResult;

export interface ErrorResponseBody {
Expand Down
2 changes: 1 addition & 1 deletion src/health/health.controller.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ describe('HealthController', () => {
};
}

handler(event, <ApiContext> {}, (error?: Error, result?: ApiResponse): void => {
handler(event, <ApiContext> {}, (error?: Error | null, result?: ApiResponse): void => {
if (typeof result === 'undefined') {
reject('No result was returned by the handler!');
return;
Expand Down
2 changes: 1 addition & 1 deletion src/swagger/swagger.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export class SwaggerService {
const version: string = <string> this._env.API_INFO_VERSION;

return this._repo.getRestApiId(stageName, restApiName)
.then((restApiId: string) => {
.then((restApiId: string | undefined) => {
if (!restApiId) {
throw new NotFoundResult(ErrorCode.InvalidName, 'Cannot find the API with the specified name!');
}
Expand Down
4 changes: 2 additions & 2 deletions test/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const callSuccess: SuccessCaller = <T>(handler: ApiHandler, pathParameter
event.pathParameters = pathParameters;
}

handler(event, <ApiContext> {}, (error?: Error, result?: ApiResponse): void => {
handler(event, <ApiContext> {}, (error?: Error | null, result?: ApiResponse): void => {
if (typeof result === 'undefined') {
reject('No result was returned by the handler!');
return;
Expand All @@ -35,7 +35,7 @@ export const callFailure: FailureCaller = (handler: ApiHandler, pathParameters?:
event.pathParameters = pathParameters;
}

handler(event, <ApiContext> {}, (error?: Error, result?: ApiResponse): void => {
handler(event, <ApiContext> {}, (error?: Error | null, result?: ApiResponse): void => {
if (typeof result === 'undefined') {
reject('No result was returned by the handler!');
return;
Expand Down