Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

topcoder-platform/lambda-member-v5user-skill-sync

Repository files navigation

member-skills-sync-lambda

Prerequisites

  • Nodejs(v12+)

Configuration

Configuration for the skill record processor is at config/default.js. The following parameters can be set in config files or in env variables:

Local Test

  • install the dependencies
npm install
  • run linters if required
npm run lint
npm run lint:fix # To fix possible lint errors
  • run test
npm test

Deploy

  • make sure you have installed the dependencies
  • make sure you have aws credentials in you environment
  • update the .env file, set AUTH0_CLIENT_ID and AUTH0_CLIENT_SECRET and other configurations that you want to change
npm run deploy

Verification

After deploy, you can open aws lambda config to test, here is the example event json { "Records":[ { "eventID":"904156e21aa4f1085f970bfdbcbfb483", "eventName":"MODIFY", "eventVersion":"1.1", "eventSource":"aws:dynamodb", "awsRegion":"us-east-1", "dynamodb":{ "ApproximateCreationDateTime":1618587935, "Keys":{ "userId":{ "N":"40153932" } }, "NewImage":{ "skills":{ "S":"{\"110\":{\"tagName\":null,\"hidden\":false,\"score\":1.0,\"sources\":[]},\"117\":{\"tagName\":null,\"hidden\":false,\"score\":1.0,\"sources\":[]}}" }, "userHandle":{ "S":"sachin-kumar" }, "updatedBy":{ "S":"40153932" }, "userId":{ "N":"40153932" }, "handleLower":{ "S":"sachin-kumar" }, "updatedAt":{ "N":"1618587934734" } }, "OldImage":{ "skills":{ "S":"{\"110\":{\"tagName\":null,\"hidden\":false,\"score\":1.0,\"sources\":[]}}" }, "userHandle":{ "S":"sachin-kumar" }, "updatedBy":{ "S":"40153932" }, "userId":{ "N":"40153932" }, "handleLower":{ "S":"sachin-kumar" }, "updatedAt":{ "N":"1618586677911" } }, "SequenceNumber":"9298848500000000010313715543", "SizeBytes":394, "StreamViewType":"NEW_AND_OLD_IMAGES" }, "eventSourceARN":":table/MemberEnteredSkills/stream/2018-09-21T08:58:50.405" } ] }