Comparing version 1.0.0 to 1.1.0
@@ -10,2 +10,3 @@ "use strict"; | ||
write: ['post', 'data', true], | ||
patch: ['patch', 'data', true], | ||
'delete': ['delete', 'data'], | ||
@@ -32,2 +33,5 @@ deleteVersions: ['post', 'delete', true], | ||
: `${mount}/${methods[config.method][1]}/${config.path}${version}`; | ||
config.headers = Object.assign(Object.assign({}, ((config.method === 'patch') | ||
? { 'Content-Type': 'application/merge-patch+json' } | ||
: {})), config.headers); | ||
if (methods[config.method][2] && !config.data) { | ||
@@ -34,0 +38,0 @@ throw new invalid_config_error_1.default(config); |
@@ -11,9 +11,9 @@ "use strict"; | ||
Vault.methodsWithoutData.forEach((method) => { | ||
vaultFuncs[method] = async (path) => { | ||
return this._vault({ method, path }); | ||
vaultFuncs[method] = async (path, config) => { | ||
return this._vault(Object.assign(Object.assign({}, config), { method, path })); | ||
}; | ||
}); | ||
Vault.methodsWithData.forEach((method) => { | ||
vaultFuncs[method] = async (path, data) => { | ||
return this._vault({ method, path, data }); | ||
vaultFuncs[method] = async (path, data, config) => { | ||
return this._vault(Object.assign(Object.assign({}, config), { method, path, data })); | ||
}; | ||
@@ -20,0 +20,0 @@ }); |
{ | ||
"name": "vault-api", | ||
"version": "1.0.0", | ||
"description": "NodeJS client for HTTP API for Hashicorp Vault.", | ||
"version": "1.1.0", | ||
"description": "Axios-like NodeJS API for Hashicorp Vault.", | ||
"main": "dist/index.js", | ||
@@ -12,3 +12,3 @@ "types": "dist/index.d.ts", | ||
"license": "MIT License", | ||
"homepage": "https://github.com/SaiHemanthBR/vault-api#readme", | ||
"homepage": "https://github.com/SaiHemanthBR/vault-api/wiki", | ||
"keywords": [ | ||
@@ -15,0 +15,0 @@ "vault", |
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
17511
332