@e2y/odata-client
Advanced tools
Comparing version 1.0.10 to 1.0.11
@@ -32,2 +32,3 @@ "use strict"; | ||
const expect_1 = __importDefault(require("expect")); | ||
const https = __importStar(require("https")); | ||
const md5_1 = __importDefault(require("md5")); | ||
@@ -37,9 +38,8 @@ const odata_1 = require("odata"); | ||
const datetime_1 = require("./constants/datetime"); | ||
const https = __importStar(require("https")); | ||
class ODataClient { | ||
constructor({ baseURL, accessPassword, password, username, cronjob }) { | ||
constructor({ baseURL, accessPassword, password, username, cronjob, headers }) { | ||
this.BASE_URL = baseURL; | ||
this.CRONJOB_ENDPOINT = cronjob?.endpoint ?? 'InboundCronJobs/CronJobs'; | ||
this.CRONJOB_PRE_PERSISTENCE_HOOK_BEAN_ID = cronjob?.prePersistenceHookBeanId; | ||
this.handler = this.createOHandlerDefaultInstance(baseURL, username, password, accessPassword); | ||
this.handler = this.createOHandlerDefaultInstance(baseURL, username, password, accessPassword, headers); | ||
} | ||
@@ -70,3 +70,3 @@ static configuredWith(config) { | ||
} | ||
createOHandlerDefaultInstance(baseURL, username, password, accessPassword) { | ||
createOHandlerDefaultInstance(baseURL, username, password, accessPassword, additionalHeaders) { | ||
const Authorization = ODataClient.generateAuthorization(username, password), Cookie = accessPassword ? { Cookie: ODataClient.encryptMD5(accessPassword) } : undefined; | ||
@@ -83,3 +83,4 @@ return (0, odata_1.o)(baseURL, { | ||
'Content-Type': 'application/json', | ||
...Cookie | ||
...Cookie, | ||
...additionalHeaders | ||
}, | ||
@@ -107,2 +108,2 @@ onError: (oHandler, response) => { | ||
exports.ODataClient = ODataClient; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib2RhdGEtY2xpZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL29kYXRhLWNsaWVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7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MsRUFBRSxNQUFNLEVBQUUsRUFBRSxJQUFJLEVBQUUsU0FBUyxFQUFFLEVBQUUsTUFBTSxFQUFFLEVBQUUsSUFBSSxFQUFFLFVBQVUsRUFBRSxFQUFFLENBQUMsQ0FBQztRQUMvRixDQUFDLEVBQ0QsaUJBQWlCLENBQUMsT0FBTyxFQUN6QixpQkFBaUIsQ0FBQyxRQUFRLENBQzNCLENBQUM7SUFDSixDQUFDO0lBRU8sZ0RBQWdEO1FBQ3RELElBQUEsZ0JBQU0sRUFDSixJQUFJLENBQUMsb0NBQW9DLEVBQ3pDLHVHQUF1RyxDQUN4RyxDQUFDO0lBQ0osQ0FBQztDQUNGO0FBMUdELGtDQTBHQyJ9 |
export interface ODataClientConfig { | ||
accessPassword?: string; | ||
baseURL: string; | ||
password: string; | ||
username: string; | ||
cronjob?: { | ||
@@ -10,2 +8,5 @@ prePersistenceHookBeanId: string; | ||
}; | ||
headers?: Record<string, string>; | ||
password: string; | ||
username: string; | ||
} |
{ | ||
"name": "@e2y/odata-client", | ||
"version": "1.0.10", | ||
"version": "1.0.11", | ||
"description": "odata client", | ||
@@ -35,3 +35,3 @@ "author": "e2y", | ||
}, | ||
"gitHead": "7fb3a1459a99cdc40cacbe00326254a1c39f05bc" | ||
"gitHead": "245409cb12610b4276c3f9945711053890d7c811" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18205
218