Challenge Overview
Challenge Objectives
-
Update the wrapper for Topcoder Challenge API (v5)
-
The wrapper is intended to be used as a public module for use in other applications
Project Background
-
Challenge API is a project that deals with all things related to challenges.
-
It essentially is a CRUD api
Technology Stack
-
Nodejs version 10
Code access
You can find the code here. Kindly use the develop branch for your changes. This wrapper has the Challenges, Challenge Types, Challenge Phases and Challenge Settings resources ready.
Individual requirements
Update the wrapper for Topcoder Challenge API (v5) (Major Requirement)
-
The “Wrapper” will be a nodejs module that will be used instead of directly making HTTP calls to the challenge api. The wrapper will expose methods that will be used in place of the direct http calls to the challenge api that we are doing currently.
-
Source code for challenge api can be found here. Please make sure you are on the “develop” branch
-
You can find the swagger specification for this api here. You will be using this as a reference when creating the wrapper.
-
Not all endpoints are in scope. The list of endpoints that are in scope will be shared in the contest forum.
Provide documentation for the wrapper (Major Requirement)
-
After creating the wrapper for the endpoints in scope, you need to provide a documentation for it
-
The expectation from the documentation is any developer that installs this wrapper as a nodejs module in their application is able to follow the documentation and determine how to use the wrapper to make requests to the v5 challenge api
Provide tests for the wrapper (Minor Requirement)
-
Provide tests for the new endpoints added to the wrapper. Existing tests should continue to work
-
You will use mocha and chai for testing
-
Use nock to mock the api requests. Do not make actual api calls.
-
This point alone is a major requirement - your tests will NOT test the challenge api. Your tests will only test if the wrapper works correctly or not. You are not expected to test if the challenge api itself works correctly.
-
You need to provide unit tests with a code coverage of 80% or more.
Deployment guide and validation document
There is no “deployment guide” needed for this wrapper. Instead, we are looking for a good documentation on how to install the wrapper as well as how to use it. Please refer to the submission api wrapper that we would like you to use as a reference.
Important Notes
-
Follow existing conventions
-
Use async await pattern
-
Use standard as your linter. Ensure there are no lint errors in your submission.
-
Typescript is not allowed. No build or compilation of code is expected
-
Kindly use the submission api wrapper as reference when creating the challenge api wrapper. Check out the documentation of the submission api wrapper in particular - we are expecting the documentation to be on the same lines.
-
You will indeed support the three different methods of authorization - user jwt tokens (like the ones you get when you login to Topcoder), m2m tokens (the ones that are generated by other apps to communicate between each other) and direct jwt token (the one where the token is not generated but instead directly passed - it is either the user jwt token or m2m token, but it is not generated by the wrapper itself). Please check out the submission api wrapper for details on each of these.
-
You need to use the swagger specification as reference. If there is a discrepancy between the behaviour of the api v/s what is defined in swagger specification, kindly use the swagger specification as the source of truth (and let us know in the contest forum).
-
We already have an existing module that acts as the wrapper. However, that is not to our expectations and thus we are launching this contest. You cannot use that module in your submission and have to necessarily create a new one. That wrapper is also NOT for the v5 challenge api, which is the subject of this contest
-
The wrapper is not expected to validate that all the fields / attributes that a request needs are provided. It’s task is to only provide helper functions.