An AWS Lambda function for retrieving and caching data from Ellucian Banner via the BannerJS module.
Invoke the Lambda using banner-proxy:<QUALIFIER>, where <QUALIFIER>
can be either a version number or alias (recommended to use the live
alias as it has been tested and is stable).
{
school: <STRING>,
term: <NUMBER>,
method: <STRING>, #See BannerJS documentation for a list of methods
params: {<PARAMS>} #Optional, arguments to pass to the BannerJS method being called. See the BannerJS documentation for more info
}
Note: the BannerJS module and AWS CLI are needed for this section.
- Clone both this repository and the BannerJS repository locally.
- Run
/path/to/bannerjs/deploy.sh | /path/to/banner proxy/deploy.sh
This repo contains a Mocha test suite, utilizing a mocked Banner library.
- Run
npm install
to install the rewire mocking dependency.
- If Mocha is not installed, run
npm install -g mocha
- Run
npm test
ormocha
to run the test suite.
Note: the AWS CLI needs to be installed and configured for this section.
The repo also contains a series of integration tests meant to be run against the deployed Lambda on AWS (where it has access to the Banner module via a custom layer). These can be found in test/integration_tests.json
and can be run with the Unit Testing Lambda via the test/integration_tests.sh
shell script, which will log the results to integration_test_results.json
.
{
"school": "temple",
"term": 202036,
"method": "classSearch",
"params": {
"term": 202036,
"subject": "MATH",
"offset": 0,
"pageSize": 25
}
}
{
"school": "temple",
"term": 202036,
"method": "getCampuses"
}
{
"school": "temple",
"term": 202036,
"method": "getInstructors",
"params": {
"term": 202036
}
}
This test event should throw an error:
{
"school": "temple",
"foo": "foo",
"bar": "bar"
}