rest-client-sdk
Advanced tools
Comparing version 7.0.0-rc.10 to 7.0.0
@@ -75,4 +75,3 @@ import URI from 'urijs'; | ||
private _getEntityIdentifier; | ||
private _throwIfUnitOfWorkIsDisabled; | ||
} | ||
export default AbstractClient; |
{ | ||
"name": "rest-client-sdk", | ||
"version": "7.0.0-rc.10", | ||
"version": "7.0.0", | ||
"description": "Rest Client SDK for API", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -1,2 +0,2 @@ | ||
# Rest Client JS SDK [![Build Status](https://travis-ci.org/mapado/rest-client-js-sdk.svg?branch=master)](https://travis-ci.org/mapado/rest-client-js-sdk) | ||
# Rest Client JS SDK | ||
@@ -3,0 +3,0 @@ Rest client SDK for API for Javascript usage. |
@@ -146,4 +146,2 @@ import URI from 'urijs'; | ||
): Promise<D['entity']> { | ||
this._throwIfUnitOfWorkIsDisabled(); | ||
const url = new URI(this.getPathBase(pathParameters)); | ||
@@ -186,4 +184,2 @@ url.addSearch(queryParam); | ||
): Promise<D['entity']> { | ||
this._throwIfUnitOfWorkIsDisabled(); | ||
const url = new URI(this.getEntityURI(entity)); | ||
@@ -228,4 +224,2 @@ url.addSearch(queryParam); | ||
delete(entity: D['entity'], requestParams = {}): Promise<Response> { | ||
this._throwIfUnitOfWorkIsDisabled(); | ||
const url = this.getEntityURI(entity); | ||
@@ -469,6 +463,9 @@ const identifier = this._getEntityIdentifier(entity); | ||
let params = requestParams; | ||
let baseHeaders: HeadersInit = {}; | ||
const baseHeaders: HeadersInit = { | ||
'Content-Type': 'application/json', | ||
}; | ||
if (params.method !== 'GET' || (params.method !== 'GET' && params.method !== 'DELETE')) { | ||
baseHeaders = { | ||
'Content-Type': 'application/json', | ||
}; | ||
} | ||
@@ -526,16 +523,4 @@ if (accessToken) { | ||
} | ||
private _throwIfUnitOfWorkIsDisabled(): void { | ||
if (!this.#isUnitOfWorkEnabled) { | ||
throw new Error( | ||
'UnitOfWork can be deactivated only on find* methods (for now). If you think this should be authorized, please report in https://git.io/JkYTO' | ||
); | ||
} | ||
} | ||
} | ||
type Headers = { | ||
[key: string]: unknown; | ||
}; | ||
export default AbstractClient; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
0
601449
8091