feature/IO-3357-Reynolds-and-Reynolds-DMS-API-Integration - Checkpoint - Remove old attempt at Reynolds Integration in favor of new library.
This commit is contained in:
25
server/rr/rr-client.js
Normal file
25
server/rr/rr-client.js
Normal file
@@ -0,0 +1,25 @@
|
||||
const { RRClient } = require("./lib/index.cjs");
|
||||
|
||||
/**
|
||||
* Build an RR client using env credentials.
|
||||
* @param {{logger?: {debug?:Function,info?:Function,warn?:Function,error?:Function}}} opts
|
||||
*/
|
||||
function makeRRClient({ logger } = {}) {
|
||||
const baseUrl = process.env.RR_BASE_URL;
|
||||
const username = process.env.RR_USERNAME;
|
||||
const password = process.env.RR_PASSWORD;
|
||||
|
||||
if (!baseUrl || !username || !password) {
|
||||
throw new Error("RR creds missing (RR_BASE_URL, RR_USERNAME, RR_PASSWORD).");
|
||||
}
|
||||
|
||||
return new RRClient({
|
||||
baseUrl,
|
||||
username,
|
||||
password,
|
||||
logger
|
||||
// retries: { max: 3 }, // optional: override retry policy
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = { makeRRClient };
|
||||
Reference in New Issue
Block a user