Skip to content

Commit

Permalink
feat: add consentRequests related endpoints (#94)
Browse files Browse the repository at this point in the history
* feat: add consentRequests related endpoints

* chore: improve test coverage
  • Loading branch information
sridharvoruganti authored Apr 12, 2021
1 parent ef1c034 commit 946f458
Show file tree
Hide file tree
Showing 7 changed files with 512 additions and 35 deletions.
24 changes: 12 additions & 12 deletions src/audit-resolve.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,33 @@
},
"1589|sqlite>sqlite3>node-pre-gyp>rc>ini": {
"decision": "ignore",
"madeAt": 1615383991700,
"expiresAt": 1617975978786
"madeAt": 1617995554900,
"expiresAt": 1618600328607
},
"1589|00unidentified>sqlite>sqlite3>node-pre-gyp>rc>ini": {
"decision": "ignore",
"madeAt": 1615383991701,
"expiresAt": 1617975978786
"madeAt": 1617995554900,
"expiresAt": 1618600328607
},
"1589|00unidentified>00unidentified>sqlite>sqlite3>node-pre-gyp>rc>ini": {
"decision": "ignore",
"madeAt": 1615383991701,
"expiresAt": 1617975978786
"madeAt": 1617995554900,
"expiresAt": 1618600328607
},
"1589|ava>update-notifier>latest-version>package-json>registry-auth-token>rc>ini": {
"decision": "ignore",
"madeAt": 1615383991701,
"expiresAt": 1617975978786
"madeAt": 1617995554900,
"expiresAt": 1618600328607
},
"1589|ava>update-notifier>latest-version>package-json>registry-url>rc>ini": {
"decision": "ignore",
"madeAt": 1615383991701,
"expiresAt": 1617975978786
"madeAt": 1617995554900,
"expiresAt": 1618600328607
},
"1589|ava>update-notifier>is-installed-globally>global-dirs>ini": {
"decision": "ignore",
"madeAt": 1615383991701,
"expiresAt": 1617975978786
"madeAt": 1617995554900,
"expiresAt": 1618600328607
},
"1654|ava>yargs>y18n": {
"decision": "fix",
Expand Down
41 changes: 41 additions & 0 deletions src/lib/objectStore/inMemoryImpl.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@

/*****
License
--------------
Copyright © 2017 Bill & Melinda Gates Foundation
The Mojaloop files are made available by the Bill & Melinda Gates Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, the Mojaloop files are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Contributors
--------------
This is the official list of the Mojaloop project contributors for this file.
Names of the original copyright holders (individuals or organizations)
should be listed with a '*' in the first column. People who have
contributed from an organization can be listed under the organization
that actually holds the copyright for their contributions (see the
Gates Foundation organization for an example). Those individuals should have
their names indented and be marked with a '-'. Email address can be added
optionally within square brackets <email>.
* Gates Foundation
* ModusBox
* Vijaya Kumar Guthi <vijaya.guthi@modusbox.com> (Original Author)
--------------
******/

const storedObject = {
};

const set = async (key, value) => {
storedObject[key] = { ...value };
};

const get = async (key) => ({ ...storedObject[key] });

const init = async () => null;

module.exports = {
set,
get,
init,
};
44 changes: 44 additions & 0 deletions src/lib/objectStore/objectStoreInterface.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*****
License
--------------
Copyright © 2017 Bill & Melinda Gates Foundation
The Mojaloop files are made available by the Bill & Melinda Gates Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, the Mojaloop files are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Contributors
--------------
This is the official list of the Mojaloop project contributors for this file.
Names of the original copyright holders (individuals or organizations)
should be listed with a '*' in the first column. People who have
contributed from an organization can be listed under the organization
that actually holds the copyright for their contributions (see the
Gates Foundation organization for an example). Those individuals should have
their names indented and be marked with a '-'. Email address can be added
optionally within square brackets <email>.
* Gates Foundation
* ModusBox
* Vijaya Kumar Guthi <vijaya.guthi@modusbox.com> (Original Author)
--------------
******/

const objectStoreImpl = require('./inMemoryImpl');

const set = async (key, value) => {
await objectStoreImpl.set(key, value);
};

const get = async (key) => {
const value = await objectStoreImpl.get(key);
return value;
};

const init = async () => {
await objectStoreImpl.init();
};

module.exports = {
set,
get,
init,
};
Loading

0 comments on commit 946f458

Please sign in to comment.