diff --git a/package-lock.json b/package-lock.json index 5cffcfc..45fed98 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "lhisp-oauth-client", - "version": "1.0.23", + "version": "1.0.24", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "lhisp-oauth-client", - "version": "1.0.23", + "version": "1.0.24", "license": "MIT", "dependencies": { "axios": "^1.6.1", diff --git a/package.json b/package.json index 37aca59..4f9850c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lhisp-oauth-client", - "version": "1.0.23", + "version": "1.0.24", "main": "src/index", "types": "src/index.d.ts", "repository": "git@bitbucket.org:leandro_costa/lhisp-oauth-client.git", diff --git a/src/lhisp-oauth-client.ts b/src/lhisp-oauth-client.ts index cd0a8ef..dfc7649 100644 --- a/src/lhisp-oauth-client.ts +++ b/src/lhisp-oauth-client.ts @@ -146,6 +146,7 @@ export class LhispOauthClient { data, params, contentType = ContentType.APPLICATION_JSON, + ...opt }: ExecutarRequestParams): Promise { try { await this.getAccessToken(); @@ -163,6 +164,7 @@ export class LhispOauthClient { headers, data, params, + ...opt, }); return response.data; @@ -180,47 +182,38 @@ export class LhispOauthClient { } } - async get({ path, contentType = ContentType.APPLICATION_JSON, params }: ExecutarRequestParams) { + async get(opt: ExecutarRequestParams) { return this.executarRequest({ method: "GET", - path, - contentType, - params, + ...opt, }); } - async put({ path, data, contentType = ContentType.APPLICATION_JSON }: ExecutarRequestParams) { + async put(opt: ExecutarRequestParams) { return this.executarRequest({ method: "PUT", - path, - data, - contentType, + ...opt, }); } - async patch({ path, data, contentType = ContentType.APPLICATION_JSON }: ExecutarRequestParams) { + async patch(opt: ExecutarRequestParams) { return this.executarRequest({ method: "PATCH", - path, - data, - contentType, + ...opt, }); } - async post({ path, data, contentType = ContentType.APPLICATION_JSON }: ExecutarRequestParams) { + async post(opt: ExecutarRequestParams) { return this.executarRequest({ method: "POST", - path, - data, - contentType, + ...opt, }); } - async delete({ path, contentType = ContentType.APPLICATION_JSON }: ExecutarRequestParams) { + async delete(opt: ExecutarRequestParams) { return this.executarRequest({ method: "DELETE", - path, - contentType, + ...opt, }); } }