Skip to content

Instantly share code, notes, and snippets.

@sime

sime/raw.log Secret

Created November 15, 2017 14:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sime/53c95c49e495d61d824958f0b5feaaab to your computer and use it in GitHub Desktop.
Save sime/53c95c49e495d61d824958f0b5feaaab to your computer and use it in GitHub Desktop.
Serverless offline + webpack
Serverless: Load command run
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command create
Serverless: Load command install
Serverless: Load command package
Serverless: Load command deploy
Serverless: Load command deploy:function
Serverless: Load command deploy:list
Serverless: Load command deploy:list:functions
Serverless: Load command invoke
Serverless: Load command invoke:local
Serverless: Load command info
Serverless: Load command logs
Serverless: Load command login
Serverless: Load command logout
Serverless: Load command metrics
Serverless: Load command print
Serverless: Load command remove
Serverless: Load command rollback
Serverless: Load command rollback:function
Serverless: Load command slstats
Serverless: Load command plugin
Serverless: Load command plugin
Serverless: Load command plugin:install
Serverless: Load command plugin
Serverless: Load command plugin:uninstall
Serverless: Load command plugin
Serverless: Load command plugin:list
Serverless: Load command plugin
Serverless: Load command plugin:search
Serverless: Load command emit
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command rollback
Serverless: Load command rollback:function
Serverless: Load command webpack
Serverless: Load command webpack:invoke
Serverless: Load command webpack:watch
Serverless: Load command webpack:serve
Serverless: WARNING: Plugin ServerlessWebpack uses deprecated hook before:deploy:createDeploymentArtifacts,
use package:createDeploymentArtifacts hook instead
Serverless: WARNING: Plugin ServerlessWebpack uses deprecated hook after:deploy:createDeploymentArtifacts,
use package:createDeploymentArtifacts hook instead
Serverless: Load command offline
Serverless: Load command offline:start
Serverless Warning --------------------------------------
A valid service attribute to satisfy the declaration 'self:custom.env.parameters.node_env' could not be found.
Serverless: Invoke offline:start
Serverless: WARNING: More than one matching handlers found for 'handler'. Using 'handler.js'.
Serverless: WARNING: More than one matching handlers found for 'handler'. Using 'handler.js'.
Serverless: WARNING: More than one matching handlers found for 'handler'. Using 'handler.js'.
Serverless: WARNING: More than one matching handlers found for 'handler'. Using 'handler.js'.
Serverless: Bundling with Webpack...
Time: 5512ms
Asset Size Chunks Chunk Names
handler.js 4.86 MB 0 [emitted] [big] handler
handler.js.map 6.41 MB 0 [emitted] handler
[22] ./node_modules/depd/index.js 10.6 kB {0} [built]
[26] ./node_modules/inversify/lib/inversify.js 1.93 kB {0} [built]
[29] ./app/Types.js 787 bytes {0} [built]
[60] ./node_modules/inversify-express-utils/lib/index.js 1.03 kB {0} [built]
[93] ./app/inversify.config.js 2.92 kB {0} [built]
[121] ./node_modules/body-parser/index.js 2.66 kB {0} [built]
[349] ./handler.js 1.01 kB {0} [built]
[350] ./node_modules/serverless-http/serverless-http.js 1.65 kB {0} [built]
[365] ./node_modules/body-parser/lib/types/json.js 4.87 kB {0} [built]
[398] ./node_modules/body-parser/lib/types/urlencoded.js 5.79 kB {0} [built]
[426] ./node_modules/inversify-express-utils/lib/decorators.js 4.89 kB {0} [built]
[975] ./node_modules/@rps/portal-authorizer/lib/main.js 282 bytes {0} [built]
[985] ./node_modules/@rps/jwt-verification/lib/main.js 389 bytes {0} [built]
[1047] ./src/controller/RestaurantController.js 1.26 kB {0} [built]
[1048] ./src/controller/OnboardingController.js 3.85 kB {0} [built]
+ 1105 hidden modules
WARNING in ./node_modules/express/lib/view.js
81:13-25 Critical dependency: the request of a dependency is an expression
@ ./node_modules/express/lib/view.js
@ ./node_modules/express/lib/application.js
@ ./node_modules/express/lib/express.js
@ ./node_modules/express/index.js
@ ./node_modules/inversify-express-utils/lib/server.js
@ ./node_modules/inversify-express-utils/lib/index.js
@ ./handler.js
Serverless: Watching with Webpack...
Serverless: Starting Offline: test/eu-west-1.
[offline] options: { host: 'localhost',
location: '.webpack/service',
port: 4000,
prefix: '/',
stage: 'test',
region: 'eu-west-1',
noTimeout: false,
noEnvironment: false,
resourceRoutes: false,
dontPrintOutput: false,
httpsProtocol: '',
skipCacheInvalidation: false,
noAuth: false,
corsAllowOrigin: [ '*' ],
corsAllowHeaders: [ 'accept', 'content-type', 'x-api-key' ],
corsAllowCredentials: true,
apiKey: 'd41d8cd98f00b204e9800998ecf8427e',
c: true,
environment: 'environments/test.yml',
exec: 'yarn test-system',
verbose: true,
corsConfig:
{ origin: [ '*' ],
headers: [ 'accept', 'content-type', 'x-api-key' ],
credentials: true } }
[offline] globalBabelOptions: undefined
[offline] funOptions {
"funName": "restaurant",
"handlerName": "handle",
"handlerPath": "/home/travis/build/deliveryhero/rps-kyc/.webpack/service/handler",
"funTimeout": 30000
}
[offline] restaurant runtime nodejs6.10
Serverless: Routes for restaurant:
Serverless: GET /v1/restaurants/{restaurantId}
[offline] funOptions {
"funName": "getOnboarding",
"handlerName": "handle",
"handlerPath": "/home/travis/build/deliveryhero/rps-kyc/.webpack/service/handler",
"funTimeout": 30000
}
[offline] getOnboarding runtime nodejs6.10
Serverless: Routes for getOnboarding:
Serverless: GET /v1/restaurants/{restaurantId}/onboarding
[offline] funOptions {
"funName": "postOnboarding",
"handlerName": "handle",
"handlerPath": "/home/travis/build/deliveryhero/rps-kyc/.webpack/service/handler",
"funTimeout": 30000
}
[offline] postOnboarding runtime nodejs6.10
Serverless: Routes for postOnboarding:
Serverless: POST /v1/restaurants/{restaurantId}/onboarding
[offline] funOptions {
"funName": "putOnboarding",
"handlerName": "handle",
"handlerPath": "/home/travis/build/deliveryhero/rps-kyc/.webpack/service/handler",
"funTimeout": 30000
}
[offline] putOnboarding runtime nodejs6.10
Serverless: Routes for putOnboarding:
Serverless: PUT /v1/restaurants/{restaurantId}/onboarding
Serverless: Offline listening on http://localhost:4000
Serverless: Offline executing script [yarn test-system]
Serverless: GET /v1/restaurants/1/onboarding (λ: getOnboarding)
Serverless: The first request might take a few extra seconds
[offline] requestId: 5067446692887196
[offline] contentType: application/json
[offline] requestTemplate:
[offline] payload: null
[offline] Invalidating cache...
[offline] Loading handler... (/home/travis/build/deliveryhero/rps-kyc/.webpack/service/handler)
[offline] event: { headers:
{ Authorization: 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdXRoU2NoZW1hIjp7InJlc3RhdXJhbnRzIjpbeyJpZCI6MSwicGxhdGZvcm1zIjpbeyJyZXN0YXVyYW50SWQiOiIxMDA5MzExMjNuIiwicGxhdGZvcm1JZCI6IkRFTElWRVJZX0hFUk8ifV19XX0sImlhdCI6MTUxMDc1NTk4NCwiZXhwIjoxNTEwNzU2MDIwLCJpc3MiOiJ0ZXN0cyIsInN1YiI6IjEifQ.VcCIxuhOt61RyH7uiwxVKSuHJfsfp9Tz9mlmTivmkjIQ8BEg1Xj5ByftWS2vbsOZ_XQ103im1CPDxm_GoOh7Gb5kUmJHV5o5LodGayCRHgxK_eQ6M91OMhNWy4Ai9utDK-xyAazfdstiVEaZvZQN_q42KbDFn-_wELGhWsSdkwt6zhYzF2P_Yt-E6fdbhwWKXSisokpiHbWgukZ6TU2p0m6x_RI06ZMxtCh_eZA3yfFC49r0et-YR0spViaYLxztnOOnuQXPLrhUYhAqt0dDDlaYos1jd-vd3qAULaR4NcI2Nr-ubJN4J4w8XsFE3xANtc3I9kSCxhbjeu4wywAUuQ',
Host: 'localhost:4000',
Connection: 'close' },
path: '/v1/restaurants/1/onboarding',
pathParameters: { restaurantId: '1' },
requestContext:
{ accountId: 'offlineContext_accountId',
resourceId: 'offlineContext_resourceId',
apiId: 'offlineContext_apiId',
stage: 'test',
requestId: 'offlineContext_requestId_',
identity:
{ cognitoIdentityPoolId: 'offlineContext_cognitoIdentityPoolId',
accountId: 'offlineContext_accountId',
cognitoIdentityId: 'offlineContext_cognitoIdentityId',
caller: 'offlineContext_caller',
apiKey: 'offlineContext_apiKey',
sourceIp: '127.0.0.1',
cognitoAuthenticationType: 'offlineContext_cognitoAuthenticationType',
cognitoAuthenticationProvider: 'offlineContext_cognitoAuthenticationProvider',
userArn: 'offlineContext_userArn',
userAgent: '',
user: 'offlineContext_user' },
authorizer:
{ principalId: 'offlineContext_authorizer_principalId',
claims: [Object] },
resourcePath: '/v1/restaurants/{restaurantId}/onboarding',
httpMethod: 'GET' },
resource: '/v1/restaurants/{restaurantId}/onboarding',
httpMethod: 'GET',
queryStringParameters: null,
stageVariables: null,
body: null,
isOffline: true }
[offline] _____ CALLING HANDLER _____
[offline] _____ HANDLER RESOLVED _____
[offline] Using response 'default'
[offline] _____ RESPONSE PARAMETERS PROCCESSING _____
[offline] Found 0 responseParameters for 'default' response
Serverless: [200] {"isBase64Encoded":false,"statusCode":200,"headers":{"x-powered-by":"Express","access-control-allow-origin":"*","content-type":"application/json; charset=utf-8","content-length":"29","etag":"W/\"1d-CroS47FMUtL1I8bmOMOeKdH6/cs\""},"body":"{\"data\":{\"status\":\"STARTED\"}}"}
[offline] requestId: 5067446692887196
Serverless: GET /v1/restaurants/20/onboarding (λ: getOnboarding)
[offline] requestId: 18824580903418786
[offline] contentType: application/json
[offline] requestTemplate:
[offline] payload: null
[offline] Invalidating cache...
[offline] Loading handler... (/home/travis/build/deliveryhero/rps-kyc/.webpack/service/handler)
[offline] event: { headers:
{ Authorization: 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdXRoU2NoZW1hIjp7InJlc3RhdXJhbnRzIjpbeyJpZCI6MjAsInBsYXRmb3JtcyI6W3sicmVzdGF1cmFudElkIjoiMTAwOTMxMTIzbiIsInBsYXRmb3JtSWQiOiJERUxJVkVSWV9IRVJPIn1dfV19LCJpYXQiOjE1MTA3NTU5ODUsImV4cCI6MTUxMDc1NjAyMSwiaXNzIjoidGVzdHMiLCJzdWIiOiIxIn0.zI6nk2DuK4qOiwPeroMF5srRgT8f65W6VO0WpHq1T08XBXJk9WYf6U9aZNH5usq--zwD9zZNxR8UfmU0G7vieDOriR0Ermuk6F_cUG2ikqjDlhxhHlOrIlhmdH9vf2409DtX0kIaA4MKbFuiQzgdmcqMEEYzHGUeXaRdjISFRGMSgEVmHJPTJTk9WtxnLqhFCMAESzD8lWl_Mdj3e-cAsRgrQHCwet3ah6AF3d9Ss2uJamcLqcQAXKfUMK8Mi0H6IUTzFj5YpU75OMPhH8T11o-dUMSSdjN4K3V1BbumfGLDqfJ1-x7iJDp81OHjTI-MKRMCTP6I_CQPt1LhEZy2yA',
Host: 'localhost:4000',
Connection: 'close' },
path: '/v1/restaurants/20/onboarding',
pathParameters: { restaurantId: '20' },
requestContext:
{ accountId: 'offlineContext_accountId',
resourceId: 'offlineContext_resourceId',
apiId: 'offlineContext_apiId',
stage: 'test',
requestId: 'offlineContext_requestId_',
identity:
{ cognitoIdentityPoolId: 'offlineContext_cognitoIdentityPoolId',
accountId: 'offlineContext_accountId',
cognitoIdentityId: 'offlineContext_cognitoIdentityId',
caller: 'offlineContext_caller',
apiKey: 'offlineContext_apiKey',
sourceIp: '127.0.0.1',
cognitoAuthenticationType: 'offlineContext_cognitoAuthenticationType',
cognitoAuthenticationProvider: 'offlineContext_cognitoAuthenticationProvider',
userArn: 'offlineContext_userArn',
userAgent: '',
user: 'offlineContext_user' },
authorizer:
{ principalId: 'offlineContext_authorizer_principalId',
claims: [Object] },
resourcePath: '/v1/restaurants/{restaurantId}/onboarding',
httpMethod: 'GET' },
resource: '/v1/restaurants/{restaurantId}/onboarding',
httpMethod: 'GET',
queryStringParameters: null,
stageVariables: null,
body: null,
isOffline: true }
[offline] _____ CALLING HANDLER _____
[offline] _____ HANDLER RESOLVED _____
[offline] Using response 'default'
[offline] _____ RESPONSE PARAMETERS PROCCESSING _____
[offline] Found 0 responseParameters for 'default' response
Serverless: [404] {"isBase64Encoded":false,"statusCode":404,"headers":{"x-powered-by":"Express","access-control-allow-origin":"*","content-type":"text/plain; charset=utf-8","content-length":"9","etag":"W/\"9-0gXL1ngzMqISxa6S1zx3F4wtLyg\""},"body":"Not Found"}
[offline] requestId: 18824580903418786
Serverless: GET /v1/restaurants/1/onboarding (λ: getOnboarding)
[offline] requestId: 15444938076694914
[offline] contentType: application/json
[offline] requestTemplate:
[offline] payload: null
[offline] Invalidating cache...
[offline] Loading handler... (/home/travis/build/deliveryhero/rps-kyc/.webpack/service/handler)
[offline] event: { headers:
{ Authorization: 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdXRoU2NoZW1hIjp7InJlc3RhdXJhbnRzIjpbeyJpZCI6NTU1LCJwbGF0Zm9ybXMiOlt7InJlc3RhdXJhbnRJZCI6IjEwMDkzMTEyM24iLCJwbGF0Zm9ybUlkIjoiREVMSVZFUllfSEVSTyJ9XX0seyJpZCI6MjY3LCJwbGF0Zm9ybXMiOlt7InJlc3RhdXJhbnRJZCI6ImFiY2RlZjEyMzQ1IiwicGxhdGZvcm1JZCI6IlNPTUVUSElORyJ9XX1dfSwiaWF0IjoxNTEwNzU1OTg2LCJleHAiOjE1MTA3NTYwMjIsImlzcyI6InRlc3RzIiwic3ViIjoiMSJ9.mb5HopnoFCpcyNnIjnFsKa4eDXf3__va79wu-xlwK69txINY1x8JVcDi9cqbJCtMRFYdGls4l6bH6jkUn9fO-UQhf-4TWemTkhEgwvw8D76BUBBKz2ir9i2uswdv2a98IVmZQR-KD7tHKNslV6Dci5Psjn8Rtk27X7Rv6B68s7Qg5RGhgyr59KBeV6VIjxrCKCYh9RX8rPgoCppTVPYEG45WOYUhlL6PZSgQbdLky2Q-WdpEHRx7o-AhlYGDRNb1SCCPPfaPyO90slYgUCS4zSjxjpLblDDLUQN8WM8I8L6rzTwvRs-K8ar_aj02IgjrMAVKU9YZvFml3uuAtuCyyA',
Host: 'localhost:4000',
Connection: 'close' },
path: '/v1/restaurants/1/onboarding',
pathParameters: { restaurantId: '1' },
requestContext:
{ accountId: 'offlineContext_accountId',
resourceId: 'offlineContext_resourceId',
apiId: 'offlineContext_apiId',
stage: 'test',
requestId: 'offlineContext_requestId_',
identity:
{ cognitoIdentityPoolId: 'offlineContext_cognitoIdentityPoolId',
accountId: 'offlineContext_accountId',
cognitoIdentityId: 'offlineContext_cognitoIdentityId',
caller: 'offlineContext_caller',
apiKey: 'offlineContext_apiKey',
sourceIp: '127.0.0.1',
cognitoAuthenticationType: 'offlineContext_cognitoAuthenticationType',
cognitoAuthenticationProvider: 'offlineContext_cognitoAuthenticationProvider',
userArn: 'offlineContext_userArn',
userAgent: '',
user: 'offlineContext_user' },
authorizer:
{ principalId: 'offlineContext_authorizer_principalId',
claims: [Object] },
resourcePath: '/v1/restaurants/{restaurantId}/onboarding',
httpMethod: 'GET' },
resource: '/v1/restaurants/{restaurantId}/onboarding',
httpMethod: 'GET',
queryStringParameters: null,
stageVariables: null,
body: null,
isOffline: true }
[offline] _____ CALLING HANDLER _____
[offline] _____ HANDLER RESOLVED _____
[offline] Using response 'default'
[offline] _____ RESPONSE PARAMETERS PROCCESSING _____
[offline] Found 0 responseParameters for 'default' response
Serverless: [403] {"isBase64Encoded":false,"statusCode":403,"headers":{"x-powered-by":"Express","access-control-allow-origin":"*","content-type":"text/html; charset=utf-8","content-length":"58","etag":"W/\"3a-nIY/6bHcVVsBS8Fk7U9dDEbUFBg\""},"body":"{\"state\":\"ERROR\",\"code\":\"FORBIDDEN\",\"message\":\"Forbidden\"}"}
[offline] requestId: 15444938076694914
Serverless: GET /v1/restaurants/1/onboarding (λ: getOnboarding)
[offline] requestId: 7865230564181445
[offline] contentType: application/json
[offline] requestTemplate:
[offline] payload: null
[offline] Invalidating cache...
[offline] Loading handler... (/home/travis/build/deliveryhero/rps-kyc/.webpack/service/handler)
[offline] event: { headers: { Host: 'localhost:4000', Connection: 'close' },
path: '/v1/restaurants/1/onboarding',
pathParameters: { restaurantId: '1' },
requestContext:
{ accountId: 'offlineContext_accountId',
resourceId: 'offlineContext_resourceId',
apiId: 'offlineContext_apiId',
stage: 'test',
requestId: 'offlineContext_requestId_',
identity:
{ cognitoIdentityPoolId: 'offlineContext_cognitoIdentityPoolId',
accountId: 'offlineContext_accountId',
cognitoIdentityId: 'offlineContext_cognitoIdentityId',
caller: 'offlineContext_caller',
apiKey: 'offlineContext_apiKey',
sourceIp: '127.0.0.1',
cognitoAuthenticationType: 'offlineContext_cognitoAuthenticationType',
cognitoAuthenticationProvider: 'offlineContext_cognitoAuthenticationProvider',
userArn: 'offlineContext_userArn',
userAgent: '',
user: 'offlineContext_user' },
authorizer:
{ principalId: 'offlineContext_authorizer_principalId',
claims: undefined },
resourcePath: '/v1/restaurants/{restaurantId}/onboarding',
httpMethod: 'GET' },
resource: '/v1/restaurants/{restaurantId}/onboarding',
httpMethod: 'GET',
queryStringParameters: null,
stageVariables: null,
body: null,
isOffline: true }
[offline] _____ CALLING HANDLER _____
[offline] _____ HANDLER RESOLVED _____
[offline] Using response 'default'
[offline] _____ RESPONSE PARAMETERS PROCCESSING _____
[offline] Found 0 responseParameters for 'default' response
Serverless: [401] {"isBase64Encoded":false,"statusCode":401,"headers":{"x-powered-by":"Express","access-control-allow-origin":"*","content-type":"text/html; charset=utf-8","content-length":"128","etag":"W/\"80-u6pNafVGAPXguCMxsbCER5doXIA\""},"body":"{\"state\":\"ERROR\",\"code\":\"TOKEN_INVALID\",\"message\":\"Authorization failed, invalid authorization header (did you forget Bearer?)\"}"}
[offline] requestId: 7865230564181445
Serverless: GET /v1/restaurants/1/onboarding (λ: getOnboarding)
[offline] requestId: 6845871496602047
[offline] contentType: application/json
[offline] requestTemplate:
[offline] payload: null
[offline] Invalidating cache...
[offline] Loading handler... (/home/travis/build/deliveryhero/rps-kyc/.webpack/service/handler)
[offline] event: { headers:
{ Authorization: 'Bearer some totally wrong token',
Host: 'localhost:4000',
Connection: 'close' },
path: '/v1/restaurants/1/onboarding',
pathParameters: { restaurantId: '1' },
requestContext:
{ accountId: 'offlineContext_accountId',
resourceId: 'offlineContext_resourceId',
apiId: 'offlineContext_apiId',
stage: 'test',
requestId: 'offlineContext_requestId_',
identity:
{ cognitoIdentityPoolId: 'offlineContext_cognitoIdentityPoolId',
accountId: 'offlineContext_accountId',
cognitoIdentityId: 'offlineContext_cognitoIdentityId',
caller: 'offlineContext_caller',
apiKey: 'offlineContext_apiKey',
sourceIp: '127.0.0.1',
cognitoAuthenticationType: 'offlineContext_cognitoAuthenticationType',
cognitoAuthenticationProvider: 'offlineContext_cognitoAuthenticationProvider',
userArn: 'offlineContext_userArn',
userAgent: '',
user: 'offlineContext_user' },
authorizer:
{ principalId: 'offlineContext_authorizer_principalId',
claims: undefined },
resourcePath: '/v1/restaurants/{restaurantId}/onboarding',
httpMethod: 'GET' },
resource: '/v1/restaurants/{restaurantId}/onboarding',
httpMethod: 'GET',
queryStringParameters: null,
stageVariables: null,
body: null,
isOffline: true }
[offline] _____ CALLING HANDLER _____
[offline] _____ HANDLER RESOLVED _____
[offline] Using response 'default'
[offline] _____ RESPONSE PARAMETERS PROCCESSING _____
[offline] Found 0 responseParameters for 'default' response
Serverless: [401] {"isBase64Encoded":false,"statusCode":401,"headers":{"x-powered-by":"Express","access-control-allow-origin":"*","content-type":"text/html; charset=utf-8","content-length":"108","etag":"W/\"6c-AX6WhN/5z+Z0ogyoaWFczFHY4iw\""},"body":"{\"state\":\"ERROR\",\"code\":\"TOKEN_INVALID\",\"message\":\"Authorization failed, provided token cannot be verified\"}"}
[offline] requestId: 6845871496602047
Serverless: POST /v1/restaurants/2/onboarding (λ: postOnboarding)
Serverless: The first request might take a few extra seconds
[offline] error in converting request.payload to JSON: SyntaxError: Unexpected end of JSON input
at Object.parse (native)
at handler (/home/travis/build/deliveryhero/rps-kyc/node_modules/serverless-offline/src/index.js:481:40)
at Object.internals.handler (/home/travis/build/deliveryhero/rps-kyc/node_modules/hapi/lib/handler.js:96:36)
at request._protect.run (/home/travis/build/deliveryhero/rps-kyc/node_modules/hapi/lib/handler.js:30:23)
at internals.Protect.run (/home/travis/build/deliveryhero/rps-kyc/node_modules/hapi/lib/protect.js:64:5)
at exports.execute (/home/travis/build/deliveryhero/rps-kyc/node_modules/hapi/lib/handler.js:24:22)
at each (/home/travis/build/deliveryhero/rps-kyc/node_modules/hapi/lib/request.js:384:16)
at iterate (/home/travis/build/deliveryhero/rps-kyc/node_modules/items/lib/index.js:36:13)
at done (/home/travis/build/deliveryhero/rps-kyc/node_modules/items/lib/index.js:28:25)
at internals.Auth.payload (/home/travis/build/deliveryhero/rps-kyc/node_modules/hapi/lib/auth.js:223:16)
at each (/home/travis/build/deliveryhero/rps-kyc/node_modules/hapi/lib/request.js:384:16)
at iterate (/home/travis/build/deliveryhero/rps-kyc/node_modules/items/lib/index.js:36:13)
at done (/home/travis/build/deliveryhero/rps-kyc/node_modules/items/lib/index.js:28:25)
at onParsed (/home/travis/build/deliveryhero/rps-kyc/node_modules/hapi/lib/route.js:402:20)
at Subtext.parse (/home/travis/build/deliveryhero/rps-kyc/node_modules/hapi/lib/route.js:423:20)
at next (/home/travis/build/deliveryhero/rps-kyc/node_modules/subtext/lib/index.js:45:26)
at Wreck.read (/home/travis/build/deliveryhero/rps-kyc/node_modules/subtext/lib/index.js:242:16)
at finish (/home/travis/build/deliveryhero/rps-kyc/node_modules/subtext/node_modules/wreck/lib/index.js:374:20)
at wrapped (/home/travis/build/deliveryhero/rps-kyc/node_modules/hoek/lib/index.js:875:20)
at onReaderFinish (/home/travis/build/deliveryhero/rps-kyc/node_modules/subtext/node_modules/wreck/lib/index.js:449:16)
at g (events.js:291:16)
at emitNone (events.js:91:20)
at emit (events.js:185:7)
at finishMaybe (_stream_writable.js:515:14)
at endWritable (_stream_writable.js:525:3)
at Writable.end (_stream_writable.js:490:5)
at IncomingMessage.onend (_stream_readable.js:511:10)
at IncomingMessage.g (events.js:291:16)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickDomainCallback (internal/process/next_tick.js:122:9)
[offline] requestId: 47207959852590897
[offline] contentType: application/json
[offline] requestTemplate:
[offline] payload:
[offline] Invalidating cache...
[offline] Loading handler... (/home/travis/build/deliveryhero/rps-kyc/.webpack/service/handler)
[offline] event: { headers:
{ Authorization: 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdXRoU2NoZW1hIjp7InJlc3RhdXJhbnRzIjpbeyJpZCI6MiwicGxhdGZvcm1zIjpbeyJyZXN0YXVyYW50SWQiOiIxMDA5MzExMjNuIiwicGxhdGZvcm1JZCI6IkRFTElWRVJZX0hFUk8ifV19XX0sImlhdCI6MTUxMDc1NTk4NywiZXhwIjoxNTEwNzU2MDIzLCJpc3MiOiJ0ZXN0cyIsInN1YiI6IjEifQ.QFO_09jCaFyIGZhghy29DAXEXAOa6OG2KsMJb2WSi6iLUIVggtAfUD28iYSgjiYw7AI8jSU8EQUKxLEx7xhoEUF1NTV4haikSxBqD_ueN6hExW3xT57n1M1KPhZH-E1yuglOmRGgIhFojS3PtPg6TbmtnIkpo-mLJlYoOMQ-WMr0GeSm3kTtJT44d8fD5JuIa601MshGFuoRqDN0wGV9GoYDZZkyAsk1cTHsJK-b-GwbcSJAzApq-oKaMpV_ws7Zuyc73tsd2rdsRT1lXXbl7-xpTNLI7JugeSAf-DlrSYyLqdBTHNc-RKbDYgs14LFDabfIUPxlX0LK-nHwy7rnrA',
'Content-type': 'application/json',
Host: 'localhost:4000',
Connection: 'close',
'Content-Length': '0' },
path: '/v1/restaurants/2/onboarding',
pathParameters: { restaurantId: '2' },
requestContext:
{ accountId: 'offlineContext_accountId',
resourceId: 'offlineContext_resourceId',
apiId: 'offlineContext_apiId',
stage: 'test',
requestId: 'offlineContext_requestId_',
identity:
{ cognitoIdentityPoolId: 'offlineContext_cognitoIdentityPoolId',
accountId: 'offlineContext_accountId',
cognitoIdentityId: 'offlineContext_cognitoIdentityId',
caller: 'offlineContext_caller',
apiKey: 'offlineContext_apiKey',
sourceIp: '127.0.0.1',
cognitoAuthenticationType: 'offlineContext_cognitoAuthenticationType',
cognitoAuthenticationProvider: 'offlineContext_cognitoAuthenticationProvider',
userArn: 'offlineContext_userArn',
userAgent: '',
user: 'offlineContext_user' },
authorizer:
{ principalId: 'offlineContext_authorizer_principalId',
claims: [Object] },
resourcePath: '/v1/restaurants/{restaurantId}/onboarding',
httpMethod: 'POST' },
resource: '/v1/restaurants/{restaurantId}/onboarding',
httpMethod: 'POST',
queryStringParameters: null,
stageVariables: null,
body: '',
isOffline: true }
[offline] _____ CALLING HANDLER _____
[offline] _____ HANDLER RESOLVED _____
[offline] Using response 'default'
[offline] _____ RESPONSE PARAMETERS PROCCESSING _____
[offline] Found 0 responseParameters for 'default' response
Serverless: [200] {"isBase64Encoded":false,"statusCode":200,"headers":{"x-powered-by":"Express","access-control-allow-origin":"*","content-type":"application/json; charset=utf-8","content-length":"29","etag":"W/\"1d-CroS47FMUtL1I8bmOMOeKdH6/cs\""},"body":"{\"data\":{\"status\":\"STARTED\"}}"}
[offline] requestId: 47207959852590897
Serverless: POST /v1/restaurants/2/onboarding (λ: postOnboarding)
[offline] error in converting request.payload to JSON: SyntaxError: Unexpected end of JSON input
at Object.parse (native)
at handler (/home/travis/build/deliveryhero/rps-kyc/node_modules/serverless-offline/src/index.js:481:40)
at Object.internals.handler (/home/travis/build/deliveryhero/rps-kyc/node_modules/hapi/lib/handler.js:96:36)
at request._protect.run (/home/travis/build/deliveryhero/rps-kyc/node_modules/hapi/lib/handler.js:30:23)
at internals.Protect.run (/home/travis/build/deliveryhero/rps-kyc/node_modules/hapi/lib/protect.js:64:5)
at exports.execute (/home/travis/build/deliveryhero/rps-kyc/node_modules/hapi/lib/handler.js:24:22)
at each (/home/travis/build/deliveryhero/rps-kyc/node_modules/hapi/lib/request.js:384:16)
at iterate (/home/travis/build/deliveryhero/rps-kyc/node_modules/items/lib/index.js:36:13)
at done (/home/travis/build/deliveryhero/rps-kyc/node_modules/items/lib/index.js:28:25)
at internals.Auth.payload (/home/travis/build/deliveryhero/rps-kyc/node_modules/hapi/lib/auth.js:223:16)
at each (/home/travis/build/deliveryhero/rps-kyc/node_modules/hapi/lib/request.js:384:16)
at iterate (/home/travis/build/deliveryhero/rps-kyc/node_modules/items/lib/index.js:36:13)
at done (/home/travis/build/deliveryhero/rps-kyc/node_modules/items/lib/index.js:28:25)
at onParsed (/home/travis/build/deliveryhero/rps-kyc/node_modules/hapi/lib/route.js:402:20)
at Subtext.parse (/home/travis/build/deliveryhero/rps-kyc/node_modules/hapi/lib/route.js:423:20)
at next (/home/travis/build/deliveryhero/rps-kyc/node_modules/subtext/lib/index.js:45:26)
at Wreck.read (/home/travis/build/deliveryhero/rps-kyc/node_modules/subtext/lib/index.js:242:16)
at finish (/home/travis/build/deliveryhero/rps-kyc/node_modules/subtext/node_modules/wreck/lib/index.js:374:20)
at wrapped (/home/travis/build/deliveryhero/rps-kyc/node_modules/hoek/lib/index.js:875:20)
at onReaderFinish (/home/travis/build/deliveryhero/rps-kyc/node_modules/subtext/node_modules/wreck/lib/index.js:449:16)
at g (events.js:291:16)
at emitNone (events.js:91:20)
at emit (events.js:185:7)
at finishMaybe (_stream_writable.js:515:14)
at endWritable (_stream_writable.js:525:3)
at Writable.end (_stream_writable.js:490:5)
at IncomingMessage.onend (_stream_readable.js:511:10)
at IncomingMessage.g (events.js:291:16)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickDomainCallback (internal/process/next_tick.js:122:9)
[offline] requestId: 6595504491235167
[offline] contentType: application/json
[offline] requestTemplate:
[offline] payload:
[offline] Invalidating cache...
[offline] Loading handler... (/home/travis/build/deliveryhero/rps-kyc/.webpack/service/handler)
[offline] event: { headers:
{ Authorization: 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdXRoU2NoZW1hIjp7InJlc3RhdXJhbnRzIjpbeyJpZCI6MSwicGxhdGZvcm1zIjpbeyJyZXN0YXVyYW50SWQiOiIxMDA5MzExMjNuIiwicGxhdGZvcm1JZCI6IkRFTElWRVJZX0hFUk8ifV19XX0sImlhdCI6MTUxMDc1NTk4NywiZXhwIjoxNTEwNzU2MDIzLCJpc3MiOiJ0ZXN0cyIsInN1YiI6IjEifQ.x1gUr9wIfdvCMrvX8obdUiyw9tpv26QZJJuPAnauAnCxNe9aL5G_noV1Xxyk4JtWoQ3Hu1Lg7TJFbtq8UOaXPNcAt6QWZyoHw_k0V6x7HnSn-MV6sGZ7QXEfaF5KIVJgxQeztKUmRJ59LjhuDwIh2u7jSmI1E-xj0HQpdeXfKJTM814TQxMp-uvHnQHe12gdLXWgiNrdRvCP4DRvk5kfI2Ob6TjkfPUE7r_pd-t8KvhehpIS3WvKgPAzBr-p9l_bZ38ODUXFhBzxaQSTWOdRaJe8pzn7k32VOtqLMQVPmKQdbX3vrP-r4RD5c5Zb619gkRv7_7fSlSGTpB-0aqXskA',
'Content-type': 'application/json',
Host: 'localhost:4000',
Connection: 'close',
'Content-Length': '0' },
path: '/v1/restaurants/2/onboarding',
pathParameters: { restaurantId: '2' },
requestContext:
{ accountId: 'offlineContext_accountId',
resourceId: 'offlineContext_resourceId',
apiId: 'offlineContext_apiId',
stage: 'test',
requestId: 'offlineContext_requestId_',
identity:
{ cognitoIdentityPoolId: 'offlineContext_cognitoIdentityPoolId',
accountId: 'offlineContext_accountId',
cognitoIdentityId: 'offlineContext_cognitoIdentityId',
caller: 'offlineContext_caller',
apiKey: 'offlineContext_apiKey',
sourceIp: '127.0.0.1',
cognitoAuthenticationType: 'offlineContext_cognitoAuthenticationType',
cognitoAuthenticationProvider: 'offlineContext_cognitoAuthenticationProvider',
userArn: 'offlineContext_userArn',
userAgent: '',
user: 'offlineContext_user' },
authorizer:
{ principalId: 'offlineContext_authorizer_principalId',
claims: [Object] },
resourcePath: '/v1/restaurants/{restaurantId}/onboarding',
httpMethod: 'POST' },
resource: '/v1/restaurants/{restaurantId}/onboarding',
httpMethod: 'POST',
queryStringParameters: null,
stageVariables: null,
body: '',
isOffline: true }
[offline] _____ CALLING HANDLER _____
[offline] _____ HANDLER RESOLVED _____
[offline] Using response 'default'
[offline] _____ RESPONSE PARAMETERS PROCCESSING _____
[offline] Found 0 responseParameters for 'default' response
Serverless: [403] {"isBase64Encoded":false,"statusCode":403,"headers":{"x-powered-by":"Express","access-control-allow-origin":"*","content-type":"text/html; charset=utf-8","content-length":"58","etag":"W/\"3a-nIY/6bHcVVsBS8Fk7U9dDEbUFBg\""},"body":"{\"state\":\"ERROR\",\"code\":\"FORBIDDEN\",\"message\":\"Forbidden\"}"}
[offline] requestId: 6595504491235167
Serverless: PUT /v1/restaurants/2/onboarding (λ: putOnboarding)
Serverless: The first request might take a few extra seconds
[offline] requestId: 1653091278608596
[offline] contentType: application/json
[offline] requestTemplate:
[offline] payload: { address: {}, phoneNumber: {} }
[offline] Invalidating cache...
[offline] Loading handler... (/home/travis/build/deliveryhero/rps-kyc/.webpack/service/handler)
[offline] event: { headers:
{ Authorization: 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdXRoU2NoZW1hIjp7InJlc3RhdXJhbnRzIjpbeyJpZCI6MiwicGxhdGZvcm1zIjpbeyJyZXN0YXVyYW50SWQiOiIxMDA5MzExMjNuIiwicGxhdGZvcm1JZCI6IkRFTElWRVJZX0hFUk8ifV19XX0sImlhdCI6MTUxMDc1NTk4OCwiZXhwIjoxNTEwNzU2MDI0LCJpc3MiOiJ0ZXN0cyIsInN1YiI6IjEifQ.IWfQfdJObOu8bCNWf1LjhnfnPcmAtsJ6nssMjzH6q3GvJXG6b-km9gSntANmY0U_5Ztp4MBzVMBZPn4yQdcpkiMD4N_S4Omx0oPFgXgpzwNhq37Z7enDU1RoDs_3aNjHlNQ5DkfUNp3MqMc0XOjJiAmtyzf7Pqs7u_dmxAJRpwemlcHCu3V4ajJVERDv4VMricwcwbVDXUAjSKLGoXx_bp6WBgvN7Ck0f2IJ4JS07RX1O4MGnNWGk1EF-7rQWWuhqlaFClB8ylzdFlFAAmPXWLPzJqKT0VYIxt6_UYP6I4--YdJStuIvLPt3Gk_SE3kphOAOKWxNw64JxNqCpOU-XQ',
'Content-type': 'application/json',
Host: 'localhost:4000',
Connection: 'close',
'Content-Length': 31,
'Content-Type': 'application/json' },
path: '/v1/restaurants/2/onboarding',
pathParameters: { restaurantId: '2' },
requestContext:
{ accountId: 'offlineContext_accountId',
resourceId: 'offlineContext_resourceId',
apiId: 'offlineContext_apiId',
stage: 'test',
requestId: 'offlineContext_requestId_',
identity:
{ cognitoIdentityPoolId: 'offlineContext_cognitoIdentityPoolId',
accountId: 'offlineContext_accountId',
cognitoIdentityId: 'offlineContext_cognitoIdentityId',
caller: 'offlineContext_caller',
apiKey: 'offlineContext_apiKey',
sourceIp: '127.0.0.1',
cognitoAuthenticationType: 'offlineContext_cognitoAuthenticationType',
cognitoAuthenticationProvider: 'offlineContext_cognitoAuthenticationProvider',
userArn: 'offlineContext_userArn',
userAgent: '',
user: 'offlineContext_user' },
authorizer:
{ principalId: 'offlineContext_authorizer_principalId',
claims: [Object] },
resourcePath: '/v1/restaurants/{restaurantId}/onboarding',
httpMethod: 'PUT' },
resource: '/v1/restaurants/{restaurantId}/onboarding',
httpMethod: 'PUT',
queryStringParameters: null,
stageVariables: null,
body: '{"address":{},"phoneNumber":{}}',
isOffline: true }
[offline] _____ CALLING HANDLER _____
[offline] _____ HANDLER RESOLVED _____
[offline] Using response 'default'
[offline] _____ RESPONSE PARAMETERS PROCCESSING _____
[offline] Found 0 responseParameters for 'default' response
Serverless: [404] {"isBase64Encoded":false,"statusCode":404,"headers":{"x-powered-by":"Express","access-control-allow-origin":"*","content-type":"text/plain; charset=utf-8","content-length":"9","etag":"W/\"9-0gXL1ngzMqISxa6S1zx3F4wtLyg\""},"body":"Not Found"}
[offline] requestId: 1653091278608596
Serverless: PUT /v1/restaurants/1/onboarding (λ: putOnboarding)
[offline] requestId: 26261482120766244
[offline] contentType: application/json
[offline] requestTemplate:
[offline] payload: { address: {}, phoneNumber: {} }
[offline] Invalidating cache...
[offline] Loading handler... (/home/travis/build/deliveryhero/rps-kyc/.webpack/service/handler)
Serverless: Error while loading putOnboarding
[ 'Error: Serverless-offline: handler for \'putOnboarding\' is not a function',
'at Object.createHandler (/home/travis/build/deliveryhero/rps-kyc/node_modules/serverless-offline/src/functionHelper.js:38:13)',
'at handler (/home/travis/build/deliveryhero/rps-kyc/node_modules/serverless-offline/src/index.js:499:40)',
'at Object.internals.handler (/home/travis/build/deliveryhero/rps-kyc/node_modules/hapi/lib/handler.js:96:36)',
'at request._protect.run (/home/travis/build/deliveryhero/rps-kyc/node_modules/hapi/lib/handler.js:30:23)',
'at internals.Protect.run (/home/travis/build/deliveryhero/rps-kyc/node_modules/hapi/lib/protect.js:64:5)',
'at exports.execute (/home/travis/build/deliveryhero/rps-kyc/node_modules/hapi/lib/handler.js:24:22)',
'at each (/home/travis/build/deliveryhero/rps-kyc/node_modules/hapi/lib/request.js:384:16)',
'at iterate (/home/travis/build/deliveryhero/rps-kyc/node_modules/items/lib/index.js:36:13)',
'at done (/home/travis/build/deliveryhero/rps-kyc/node_modules/items/lib/index.js:28:25)',
'at internals.Auth.payload (/home/travis/build/deliveryhero/rps-kyc/node_modules/hapi/lib/auth.js:223:16)',
'at each (/home/travis/build/deliveryhero/rps-kyc/node_modules/hapi/lib/request.js:384:16)',
'at iterate (/home/travis/build/deliveryhero/rps-kyc/node_modules/items/lib/index.js:36:13)',
'at done (/home/travis/build/deliveryhero/rps-kyc/node_modules/items/lib/index.js:28:25)',
'at onParsed (/home/travis/build/deliveryhero/rps-kyc/node_modules/hapi/lib/route.js:402:20)',
'at Subtext.parse (/home/travis/build/deliveryhero/rps-kyc/node_modules/hapi/lib/route.js:423:20)',
'at next (/home/travis/build/deliveryhero/rps-kyc/node_modules/subtext/lib/index.js:45:26)',
'at Wreck.read (/home/travis/build/deliveryhero/rps-kyc/node_modules/subtext/lib/index.js:242:16)',
'at finish (/home/travis/build/deliveryhero/rps-kyc/node_modules/subtext/node_modules/wreck/lib/index.js:374:20)',
'at wrapped (/home/travis/build/deliveryhero/rps-kyc/node_modules/hoek/lib/index.js:875:20)',
'at onReaderFinish (/home/travis/build/deliveryhero/rps-kyc/node_modules/subtext/node_modules/wreck/lib/index.js:449:16)',
'at g (events.js:291:16)',
'at emitNone (events.js:91:20)',
'at emit (events.js:185:7)',
'at finishMaybe (_stream_writable.js:515:14)',
'at endWritable (_stream_writable.js:525:3)',
'at Writable.end (_stream_writable.js:490:5)',
'at IncomingMessage.onend (_stream_readable.js:511:10)',
'at IncomingMessage.g (events.js:291:16)',
'at emitNone (events.js:91:20)',
'at IncomingMessage.emit (events.js:185:7)',
'at endReadableNT (_stream_readable.js:974:12)',
'at _combinedTickCallback (internal/process/next_tick.js:74:11)' ]
Serverless: Replying error in handler
Hash: 591c22549112cebd241b
Version: webpack 3.8.1
Time: 7203ms
Asset Size Chunks Chunk Names
handler.js 4.86 MB 0 [emitted] [big] handler
handler.js.map 6.41 MB 0 [emitted] handler
[22] ./node_modules/depd/index.js 10.6 kB {0} [built]
[26] ./node_modules/inversify/lib/inversify.js 1.93 kB {0} [built]
[29] ./app/Types.js 787 bytes {0} [built]
[60] ./node_modules/inversify-express-utils/lib/index.js 1.03 kB {0} [built]
[93] ./app/inversify.config.js 2.92 kB {0} [built]
[121] ./node_modules/body-parser/index.js 2.66 kB {0} [built]
[349] ./handler.js 1.01 kB {0} [built]
[350] ./node_modules/serverless-http/serverless-http.js 1.65 kB {0} [built]
[365] ./node_modules/body-parser/lib/types/json.js 4.87 kB {0} [built]
[398] ./node_modules/body-parser/lib/types/urlencoded.js 5.79 kB {0} [built]
[426] ./node_modules/inversify-express-utils/lib/decorators.js 4.89 kB {0} [built]
[975] ./node_modules/@rps/portal-authorizer/lib/main.js 282 bytes {0} [built]
[985] ./node_modules/@rps/jwt-verification/lib/main.js 389 bytes {0} [built]
[1047] ./src/controller/RestaurantController.js 1.26 kB {0} [built]
[1048] ./src/controller/OnboardingController.js 3.85 kB {0} [built]
+ 1105 hidden modules
WARNING in ./node_modules/express/lib/view.js
81:13-25 Critical dependency: the request of a dependency is an expression
@ ./node_modules/express/lib/view.js
@ ./node_modules/express/lib/application.js
@ ./node_modules/express/lib/express.js
@ ./node_modules/express/index.js
@ ./node_modules/inversify-express-utils/lib/server.js
@ ./node_modules/inversify-express-utils/lib/index.js
@ ./handler.js
Serverless: PUT /v1/restaurants/1/onboarding (λ: putOnboarding)
[offline] requestId: 17821631615193834
[offline] contentType: application/json
[offline] requestTemplate:
[offline] payload: { email: 'test@deliveryhero.com',
address:
{ city: 'Berlin',
country: 'de',
houseNumberOrName: '1',
zip: '12459',
street: 'Friedrichstr' },
phoneNumber: { countryCode: '49', number: '1234567890', type: 'mobile' } }
[offline] Invalidating cache...
[offline] Loading handler... (/home/travis/build/deliveryhero/rps-kyc/.webpack/service/handler)
[offline] event: { headers:
{ Authorization: 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdXRoU2NoZW1hIjp7InJlc3RhdXJhbnRzIjpbeyJpZCI6MSwicGxhdGZvcm1zIjpbeyJyZXN0YXVyYW50SWQiOiIxMDA5MzExMjNuIiwicGxhdGZvcm1JZCI6IkRFTElWRVJZX0hFUk8ifV19XX0sImlhdCI6MTUxMDc1NTk5MCwiZXhwIjoxNTEwNzU2MDI2LCJpc3MiOiJ0ZXN0cyIsInN1YiI6IjEifQ.4SGrf7QaFXHz10AIpxbNlNXcSfWqsG4SXW5WDEPCmF9ZLAuxzx5ZZeMwgaDd5uq0FA3mgIGnZl_mjCQKW__ms3CgVEjsiMU7G08Q8mdrHTp6BebGohVtdmPdiZKQtgDW3_wgv6DZ2gYZmh3Ik3_xotokVl4GkxIgu7H7kf_yRdHf3DhFp19ajRU3c-EfQEsxPYfiyEH1doVd7rvvdlt_5FhTLEWkPkAvvDO8cTH4GGvVXYJ4PC9kM4wUvQijzj3KZk_idzpqoVqZ5pxaYHTa2YSJmvbCvt15sZ4qGOZcaPMMwYdapzVNSS3kJmaJUDkl9EXdn4ec78Im2pCK7KyUUA',
'Content-type': 'application/json',
Host: 'localhost:4000',
Connection: 'close',
'Content-Length': 211,
'Content-Type': 'application/json' },
path: '/v1/restaurants/1/onboarding',
pathParameters: { restaurantId: '1' },
requestContext:
{ accountId: 'offlineContext_accountId',
resourceId: 'offlineContext_resourceId',
apiId: 'offlineContext_apiId',
stage: 'test',
requestId: 'offlineContext_requestId_',
identity:
{ cognitoIdentityPoolId: 'offlineContext_cognitoIdentityPoolId',
accountId: 'offlineContext_accountId',
cognitoIdentityId: 'offlineContext_cognitoIdentityId',
caller: 'offlineContext_caller',
apiKey: 'offlineContext_apiKey',
sourceIp: '127.0.0.1',
cognitoAuthenticationType: 'offlineContext_cognitoAuthenticationType',
cognitoAuthenticationProvider: 'offlineContext_cognitoAuthenticationProvider',
userArn: 'offlineContext_userArn',
userAgent: '',
user: 'offlineContext_user' },
authorizer:
{ principalId: 'offlineContext_authorizer_principalId',
claims: [Object] },
resourcePath: '/v1/restaurants/{restaurantId}/onboarding',
httpMethod: 'PUT' },
resource: '/v1/restaurants/{restaurantId}/onboarding',
httpMethod: 'PUT',
queryStringParameters: null,
stageVariables: null,
body: '{"email":"test@deliveryhero.com","address":{"city":"Berlin","country":"de","houseNumberOrName":"1","zip":"12459","street":"Friedrichstr"},"phoneNumber":{"countryCode":"49","number":"1234567890","type":"mobile"}}',
isOffline: true }
[offline] _____ CALLING HANDLER _____
Hash: 591c22549112cebd241b
Version: webpack 3.8.1
Time: 445ms
Asset Size Chunks Chunk Names
handler.js 4.86 MB 0 [big] handler
handler.js.map 6.41 MB 0 handler
[22] ./node_modules/depd/index.js 10.6 kB {0}
[26] ./node_modules/inversify/lib/inversify.js 1.93 kB {0}
[29] ./app/Types.js 787 bytes {0} [built]
[60] ./node_modules/inversify-express-utils/lib/index.js 1.03 kB {0}
[93] ./app/inversify.config.js 2.92 kB {0} [built]
[121] ./node_modules/body-parser/index.js 2.66 kB {0}
[349] ./handler.js 1.01 kB {0} [built]
[350] ./node_modules/serverless-http/serverless-http.js 1.65 kB {0}
[365] ./node_modules/body-parser/lib/types/json.js 4.87 kB {0}
[398] ./node_modules/body-parser/lib/types/urlencoded.js 5.79 kB {0}
[426] ./node_modules/inversify-express-utils/lib/decorators.js 4.89 kB {0}
[975] ./node_modules/@rps/portal-authorizer/lib/main.js 282 bytes {0}
[985] ./node_modules/@rps/jwt-verification/lib/main.js 389 bytes {0}
[1047] ./src/controller/RestaurantController.js 1.26 kB {0} [built]
[1048] ./src/controller/OnboardingController.js 3.85 kB {0} [built]
+ 1105 hidden modules
WARNING in ./node_modules/express/lib/view.js
81:13-25 Critical dependency: the request of a dependency is an expression
@ ./node_modules/express/lib/view.js
@ ./node_modules/express/lib/application.js
@ ./node_modules/express/lib/express.js
@ ./node_modules/express/index.js
@ ./node_modules/inversify-express-utils/lib/server.js
@ ./node_modules/inversify-express-utils/lib/index.js
@ ./handler.js
[offline] _____ HANDLER RESOLVED _____
[offline] Using response 'default'
[offline] _____ RESPONSE PARAMETERS PROCCESSING _____
[offline] Found 0 responseParameters for 'default' response
Serverless: [200] {"isBase64Encoded":false,"statusCode":200,"headers":{"x-powered-by":"Express","access-control-allow-origin":"*","content-type":"application/json; charset=utf-8","content-length":"28","etag":"W/\"1c-wPBiDOo2+5pzDxuZxSPdsT3iq8o\""},"body":"{\"data\":{\"status\":\"QUEUED\"}}"}
[offline] requestId: 17821631615193834
Serverless: PUT /v1/restaurants/1/onboarding (λ: putOnboarding)
[offline] error in converting request.payload to JSON: SyntaxError: Unexpected end of JSON input
at Object.parse (native)
at handler (/home/travis/build/deliveryhero/rps-kyc/node_modules/serverless-offline/src/index.js:481:40)
at Object.internals.handler (/home/travis/build/deliveryhero/rps-kyc/node_modules/hapi/lib/handler.js:96:36)
at request._protect.run (/home/travis/build/deliveryhero/rps-kyc/node_modules/hapi/lib/handler.js:30:23)
at internals.Protect.run (/home/travis/build/deliveryhero/rps-kyc/node_modules/hapi/lib/protect.js:64:5)
at exports.execute (/home/travis/build/deliveryhero/rps-kyc/node_modules/hapi/lib/handler.js:24:22)
at each (/home/travis/build/deliveryhero/rps-kyc/node_modules/hapi/lib/request.js:384:16)
at iterate (/home/travis/build/deliveryhero/rps-kyc/node_modules/items/lib/index.js:36:13)
at done (/home/travis/build/deliveryhero/rps-kyc/node_modules/items/lib/index.js:28:25)
at internals.Auth.payload (/home/travis/build/deliveryhero/rps-kyc/node_modules/hapi/lib/auth.js:223:16)
at each (/home/travis/build/deliveryhero/rps-kyc/node_modules/hapi/lib/request.js:384:16)
at iterate (/home/travis/build/deliveryhero/rps-kyc/node_modules/items/lib/index.js:36:13)
at done (/home/travis/build/deliveryhero/rps-kyc/node_modules/items/lib/index.js:28:25)
at onParsed (/home/travis/build/deliveryhero/rps-kyc/node_modules/hapi/lib/route.js:402:20)
at Subtext.parse (/home/travis/build/deliveryhero/rps-kyc/node_modules/hapi/lib/route.js:423:20)
at next (/home/travis/build/deliveryhero/rps-kyc/node_modules/subtext/lib/index.js:45:26)
at Wreck.read (/home/travis/build/deliveryhero/rps-kyc/node_modules/subtext/lib/index.js:242:16)
at finish (/home/travis/build/deliveryhero/rps-kyc/node_modules/subtext/node_modules/wreck/lib/index.js:374:20)
at wrapped (/home/travis/build/deliveryhero/rps-kyc/node_modules/hoek/lib/index.js:875:20)
at onReaderFinish (/home/travis/build/deliveryhero/rps-kyc/node_modules/subtext/node_modules/wreck/lib/index.js:449:16)
at g (events.js:291:16)
at emitNone (events.js:91:20)
at emit (events.js:185:7)
at finishMaybe (_stream_writable.js:515:14)
at endWritable (_stream_writable.js:525:3)
at Writable.end (_stream_writable.js:490:5)
at IncomingMessage.onend (_stream_readable.js:511:10)
at IncomingMessage.g (events.js:291:16)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickDomainCallback (internal/process/next_tick.js:122:9)
[offline] requestId: 8457949670508995
[offline] contentType: application/json
[offline] requestTemplate:
[offline] payload:
[offline] Invalidating cache...
[offline] Loading handler... (/home/travis/build/deliveryhero/rps-kyc/.webpack/service/handler)
[offline] event: { headers:
{ Authorization: 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdXRoU2NoZW1hIjp7InJlc3RhdXJhbnRzIjpbeyJpZCI6MSwicGxhdGZvcm1zIjpbeyJyZXN0YXVyYW50SWQiOiIxMDA5MzExMjNuIiwicGxhdGZvcm1JZCI6IkRFTElWRVJZX0hFUk8ifV19XX0sImlhdCI6MTUxMDc1NTk5MSwiZXhwIjoxNTEwNzU2MDI3LCJpc3MiOiJ0ZXN0cyIsInN1YiI6IjEifQ.a3tgpI4428b-KV-Hmgh1FfLhnVFPOeJTZr8s9HT6JJj8rKbZIIj2hu_dc6wV7riS5AM3BcZtKiFV3sDcU2I_mKNZExyrL8S9XgN_jVon7C7nrxSnGc75rmiopeVoUODF0pW8wdplYXR3MeifEuGPvZUOrlRnaVX-zkIl0GwGiYf2ebluSbRd7f-9nOeYa27x9KLK2s9c_KVU3bFwTYGgwK9UvncT-A77E7SxBDCdfolIg6PuujJRbh2fjozY7TqxbmirnDRrZbYVf-l6QbRCdsv0L04jewxw5Oo96j7g7GtBWkc4bT4JPQOo5l1cuH5UGOVMqQktPQP1ieAtzOeoJA',
'Content-type': 'application/json',
Host: 'localhost:4000',
Connection: 'close',
'Content-Length': '0' },
path: '/v1/restaurants/1/onboarding',
pathParameters: { restaurantId: '1' },
requestContext:
{ accountId: 'offlineContext_accountId',
resourceId: 'offlineContext_resourceId',
apiId: 'offlineContext_apiId',
stage: 'test',
requestId: 'offlineContext_requestId_',
identity:
{ cognitoIdentityPoolId: 'offlineContext_cognitoIdentityPoolId',
accountId: 'offlineContext_accountId',
cognitoIdentityId: 'offlineContext_cognitoIdentityId',
caller: 'offlineContext_caller',
apiKey: 'offlineContext_apiKey',
sourceIp: '127.0.0.1',
cognitoAuthenticationType: 'offlineContext_cognitoAuthenticationType',
cognitoAuthenticationProvider: 'offlineContext_cognitoAuthenticationProvider',
userArn: 'offlineContext_userArn',
userAgent: '',
user: 'offlineContext_user' },
authorizer:
{ principalId: 'offlineContext_authorizer_principalId',
claims: [Object] },
resourcePath: '/v1/restaurants/{restaurantId}/onboarding',
httpMethod: 'PUT' },
resource: '/v1/restaurants/{restaurantId}/onboarding',
httpMethod: 'PUT',
queryStringParameters: null,
stageVariables: null,
body: '',
isOffline: true }
[offline] _____ CALLING HANDLER _____
(node:6774) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Can't set headers after they are sent.
[offline] _____ HANDLER RESOLVED _____
[offline] Using response 'default'
[offline] _____ RESPONSE PARAMETERS PROCCESSING _____
[offline] Found 0 responseParameters for 'default' response
Serverless: [400] {"isBase64Encoded":false,"statusCode":400,"headers":{"x-powered-by":"Express","access-control-allow-origin":"*","content-type":"application/json; charset=utf-8","content-length":"1007","etag":"W/\"3ef-mRzo7ZsoDkK+DFteO85Dw69oDxE\""},"body":"{\"state\":\"ERROR\",\"code\":\"VALIDATION_ERROR\",\"message\":\"Error\",\"errors\":[{\"field\":\"address.city\",\"code\":\"FIELD_CANNOT_BE_EMPTY\",\"message\":\"address.city cannot be empty\"},{\"field\":\"address.country\",\"code\":\"FIELD_CANNOT_BE_EMPTY\",\"message\":\"address.country cannot be empty\"},{\"field\":\"address.houseNumberOrName\",\"code\":\"FIELD_CANNOT_BE_EMPTY\",\"message\":\"address.houseNumberOrName cannot be empty\"},{\"field\":\"address.zip\",\"code\":\"FIELD_CANNOT_BE_EMPTY\",\"message\":\"address.zip cannot be empty\"},{\"field\":\"address.street\",\"code\":\"FIELD_CANNOT_BE_EMPTY\",\"message\":\"address.street cannot be empty\"},{\"field\":\"email\",\"code\":\"FIELD_CANNOT_BE_EMPTY\",\"message\":\"email cannot be empty\"},{\"field\":\"phoneNumber.countryCode\",\"code\":\"FIELD_CANNOT_BE_EMPTY\",\"message\":\"phoneNumber.countryCode cannot be empty\"},{\"field\":\"phoneNumber.number\",\"code\":\"FIELD_CANNOT_BE_EMPTY\",\"message\":\"phoneNumber.number cannot be empty\"},{\"field\":\"phoneNumber.type\",\"code\":\"FIELD_CANNOT_BE_EMPTY\",\"message\":\"phoneNumber.type cannot be empty\"}]}"}
[offline] requestId: 8457949670508995
Serverless: PUT /v1/restaurants/2/onboarding (λ: putOnboarding)
[offline] error in converting request.payload to JSON: SyntaxError: Unexpected end of JSON input
at Object.parse (native)
at handler (/home/travis/build/deliveryhero/rps-kyc/node_modules/serverless-offline/src/index.js:481:40)
at Object.internals.handler (/home/travis/build/deliveryhero/rps-kyc/node_modules/hapi/lib/handler.js:96:36)
at request._protect.run (/home/travis/build/deliveryhero/rps-kyc/node_modules/hapi/lib/handler.js:30:23)
at internals.Protect.run (/home/travis/build/deliveryhero/rps-kyc/node_modules/hapi/lib/protect.js:64:5)
at exports.execute (/home/travis/build/deliveryhero/rps-kyc/node_modules/hapi/lib/handler.js:24:22)
at each (/home/travis/build/deliveryhero/rps-kyc/node_modules/hapi/lib/request.js:384:16)
at iterate (/home/travis/build/deliveryhero/rps-kyc/node_modules/items/lib/index.js:36:13)
at done (/home/travis/build/deliveryhero/rps-kyc/node_modules/items/lib/index.js:28:25)
at internals.Auth.payload (/home/travis/build/deliveryhero/rps-kyc/node_modules/hapi/lib/auth.js:223:16)
at each (/home/travis/build/deliveryhero/rps-kyc/node_modules/hapi/lib/request.js:384:16)
at iterate (/home/travis/build/deliveryhero/rps-kyc/node_modules/items/lib/index.js:36:13)
at done (/home/travis/build/deliveryhero/rps-kyc/node_modules/items/lib/index.js:28:25)
at onParsed (/home/travis/build/deliveryhero/rps-kyc/node_modules/hapi/lib/route.js:402:20)
at Subtext.parse (/home/travis/build/deliveryhero/rps-kyc/node_modules/hapi/lib/route.js:423:20)
at next (/home/travis/build/deliveryhero/rps-kyc/node_modules/subtext/lib/index.js:45:26)
at Wreck.read (/home/travis/build/deliveryhero/rps-kyc/node_modules/subtext/lib/index.js:242:16)
at finish (/home/travis/build/deliveryhero/rps-kyc/node_modules/subtext/node_modules/wreck/lib/index.js:374:20)
at wrapped (/home/travis/build/deliveryhero/rps-kyc/node_modules/hoek/lib/index.js:875:20)
at onReaderFinish (/home/travis/build/deliveryhero/rps-kyc/node_modules/subtext/node_modules/wreck/lib/index.js:449:16)
at g (events.js:291:16)
at emitNone (events.js:91:20)
at emit (events.js:185:7)
at finishMaybe (_stream_writable.js:515:14)
at endWritable (_stream_writable.js:525:3)
at Writable.end (_stream_writable.js:490:5)
at IncomingMessage.onend (_stream_readable.js:511:10)
at IncomingMessage.g (events.js:291:16)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickDomainCallback (internal/process/next_tick.js:122:9)
[offline] requestId: 09525364281420856
[offline] contentType: application/json
[offline] requestTemplate:
[offline] payload:
[offline] Invalidating cache...
[offline] Loading handler... (/home/travis/build/deliveryhero/rps-kyc/.webpack/service/handler)
[offline] event: { headers:
{ Authorization: 'Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdXRoU2NoZW1hIjp7InJlc3RhdXJhbnRzIjpbeyJpZCI6MSwicGxhdGZvcm1zIjpbeyJyZXN0YXVyYW50SWQiOiIxMDA5MzExMjNuIiwicGxhdGZvcm1JZCI6IkRFTElWRVJZX0hFUk8ifV19XX0sImlhdCI6MTUxMDc1NTk5MiwiZXhwIjoxNTEwNzU2MDI4LCJpc3MiOiJ0ZXN0cyIsInN1YiI6IjEifQ.2ulmXxzUrfBMdvNFePYF7d4FMO2O3-9vHspftmu_hfPy6g8IFzxJFwbi2sBeQwvpLdBUV0deEaY7Hi0MO9iVXzrDwZ-6_rvVxJrNEwKLCDrb_80neKa7-mtCjxP8Hf84WfJHZ7CVItN_7jvpkAR4rR4SNXiFRLYEu0Ywu0N1reF4NJEQ3KUt92dAp-Ubv1bZAx8cxm24mAAemtwxK4G12Q9M5nW-Pvh8pxxuI5-5MpmG3GI8SHxZXY7WWPxRnMpBNdONn2YIXQ0k_XzAqaBT3lc9XztB-YLtNQOllEUsya0DFoTHf5WgNsbq4VLZnywnevwCFbp4vzA9CG5VqGPxaw',
'Content-type': 'application/json',
Host: 'localhost:4000',
Connection: 'close',
'Content-Length': '0' },
path: '/v1/restaurants/2/onboarding',
pathParameters: { restaurantId: '2' },
requestContext:
{ accountId: 'offlineContext_accountId',
resourceId: 'offlineContext_resourceId',
apiId: 'offlineContext_apiId',
stage: 'test',
requestId: 'offlineContext_requestId_',
identity:
{ cognitoIdentityPoolId: 'offlineContext_cognitoIdentityPoolId',
accountId: 'offlineContext_accountId',
cognitoIdentityId: 'offlineContext_cognitoIdentityId',
caller: 'offlineContext_caller',
apiKey: 'offlineContext_apiKey',
sourceIp: '127.0.0.1',
cognitoAuthenticationType: 'offlineContext_cognitoAuthenticationType',
cognitoAuthenticationProvider: 'offlineContext_cognitoAuthenticationProvider',
userArn: 'offlineContext_userArn',
userAgent: '',
user: 'offlineContext_user' },
authorizer:
{ principalId: 'offlineContext_authorizer_principalId',
claims: [Object] },
resourcePath: '/v1/restaurants/{restaurantId}/onboarding',
httpMethod: 'PUT' },
resource: '/v1/restaurants/{restaurantId}/onboarding',
httpMethod: 'PUT',
queryStringParameters: null,
stageVariables: null,
body: '',
isOffline: true }
[offline] _____ CALLING HANDLER _____
[offline] _____ HANDLER RESOLVED _____
[offline] Using response 'default'
[offline] _____ RESPONSE PARAMETERS PROCCESSING _____
[offline] Found 0 responseParameters for 'default' response
Serverless: [403] {"isBase64Encoded":false,"statusCode":403,"headers":{"x-powered-by":"Express","access-control-allow-origin":"*","content-type":"text/html; charset=utf-8","content-length":"58","etag":"W/\"3a-nIY/6bHcVVsBS8Fk7U9dDEbUFBg\""},"body":"{\"state\":\"ERROR\",\"code\":\"FORBIDDEN\",\"message\":\"Forbidden\"}"}
[offline] requestId: 09525364281420856
Serverless: exec stdout: [
GetOnboardingTest
✓ should return restaurant data (935ms)
✓ should return 404 when onboarding not found (564ms)
✓ should return 403 when restaurant doesn't match auth schema ones (189ms)
✓ should return 401 when no token passed (183ms)
✓ should return 401 when token cannot be validated (213ms)
StartOnboardingTest
✓ should start onboarding (237ms)
✓ should retrun 403 when unauthorized (180ms)
StartOnboardingTest
✓ should return 404 when onboarding not found (134ms)
1) should return validation errors
✓ should update onboarding (1295ms)
✓ should validate empty request (710ms)
✓ should retrun 403 when unauthorized (118ms)
11 passing (8s)
1 failing
1) StartOnboardingTest
should return validation errors:
Uncaught Error: expected 200 to sort of equal 400
+ expected - actual
-200
+400
at Assertion.assert (/home/travis/build/deliveryhero/rps-kyc/node_modules/expect.js/index.js:96:13)
at Assertion.eql (/home/travis/build/deliveryhero/rps-kyc/node_modules/expect.js/index.js:230:10)
at IncomingMessage.<anonymous> (/home/travis/build/deliveryhero/rps-kyc/test/system/UpdateOnboarding.spec.ts:91:43)
at emitOne (events.js:96:13)
at IncomingMessage.emit (events.js:188:7)
at IncomingMessage.Readable.read (_stream_readable.js:381:10)
at flow (_stream_readable.js:761:34)
at resume_ (_stream_readable.js:743:3)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickDomainCallback (internal/process/next_tick.js:122:9)
]
Serverless: exec stderr: [warning package.json: No license field
error Command failed with exit code 1.
]
Serverless: Offline error executing script [Error: Command failed: yarn test-system
warning package.json: No license field
error Command failed with exit code 1.
]
Serverless: Halting offline server
error Command failed with exit code 1.
error Command failed with exit code 1.
The command "AWS_REGION=eu-west-1 yarn test" exited with 1.
store build cache
nothing changed, not updating cache
Done. Your build exited with 1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment