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
13 changes: 8 additions & 5 deletions packages/runtime-handler/src/dev-runtime/route.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
Context,
ServerlessCallback,
ServerlessEventObject,
ServerlessFunctionSignature,
TwilioClient,
TwilioClientOptions,
Expand All @@ -17,6 +18,10 @@ import { join, resolve } from 'path';
import { deserializeError } from 'serialize-error';
import { checkForValidAccountSid } from './checks/check-account-sid';
import { checkForValidAuthToken } from './checks/check-auth-token';
import {
restrictedHeaderExactMatches,
restrictedHeaderPrefixes,
} from './checks/restricted-headers';
import { Reply } from './internal/functionRunner';
import { Response } from './internal/response';
import * as Runtime from './internal/runtime';
Expand All @@ -25,10 +30,6 @@ import debug from './utils/debug';
import { wrapErrorInHtml } from './utils/error-html';
import { requireFromProject } from './utils/requireFromProject';
import { cleanUpStackTrace } from './utils/stack-trace/clean-up';
import {
restrictedHeaderPrefixes,
restrictedHeaderExactMatches,
} from './checks/restricted-headers';

const log = debug('twilio-runtime-handler:dev:route');

Expand Down Expand Up @@ -75,7 +76,9 @@ export function constructHeaders(rawHeaders?: string[]): Headers {
return {};
}

export function constructEvent<T extends {} = {}>(req: ExpressRequest): T {
export function constructEvent<T extends ServerlessEventObject>(
req: ExpressRequest
): T {
return {
request: {
headers: constructHeaders(req.rawHeaders),
Expand Down
2 changes: 1 addition & 1 deletion packages/twilio-run/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"license": "MIT",
"dependencies": {
"@twilio-labs/serverless-api": "^5.1.1",
"@twilio-labs/serverless-runtime-types": "^2.1.0",
"@twilio-labs/serverless-runtime-types": "2.1.0-rc.0",
"@types/express": "4.17.7",
"@types/inquirer": "^6.0.3",
"@types/is-ci": "^2.0.0",
Expand Down