rest-client-sdk
Advanced tools
Comparing version 6.1.0 to 6.2.0
# Changelog | ||
## 6.2.0 | ||
### Changed | ||
- [TypeScript] better handle deserializeResponse method definition | ||
## 6.1.0 | ||
@@ -4,0 +10,0 @@ |
@@ -64,3 +64,4 @@ import URI from 'urijs'; | ||
delete(entity: D['entity'], requestParams?: {}): Promise<Response>; | ||
deserializeResponse<LOR extends 'list' | 'item'>(requestPromise: Promise<Response>, listOrItem: LOR): Promise<D['entity'] | D['list']>; | ||
deserializeResponse(requestPromise: Promise<Response>, listOrItem: 'list'): Promise<D['list']>; | ||
deserializeResponse(requestPromise: Promise<Response>, listOrItem: 'item'): Promise<D['entity']>; | ||
makeUri(input: string | URI): URI; | ||
@@ -67,0 +68,0 @@ authorizedFetch(input: string | URI, requestParams?: {}): Promise<Response>; |
{ | ||
"name": "rest-client-sdk", | ||
"version": "6.1.0", | ||
"version": "6.2.0", | ||
"description": "Rest Client SDK for API", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -221,7 +221,7 @@ # Mapado 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) | ||
class SomeEntityClient extends AbstractClient<TSMetadata['some_entities']> { | ||
getPathBase(pathParameters: object) { | ||
getPathBase(pathParameters: object): string { | ||
return '/v2/some_entities'; // you need to return the full query string for the collection GET query | ||
} | ||
getEntityURI(entity: SomeEntity) { | ||
getEntityURI(entity: SomeEntity): string { | ||
return `${this.getPathBase()}/${entity.id}`; // this will be the URI used by update / delete script | ||
@@ -228,0 +228,0 @@ } |
@@ -81,3 +81,3 @@ import URI from 'urijs'; | ||
'item' | ||
) as Promise<D['entity']>; | ||
); | ||
} | ||
@@ -102,3 +102,3 @@ | ||
'list' | ||
) as Promise<D['list']>; | ||
); | ||
} | ||
@@ -157,3 +157,3 @@ | ||
'item' | ||
) as Promise<D['entity']>; | ||
); | ||
} | ||
@@ -202,3 +202,3 @@ | ||
'item' | ||
) as Promise<D['entity']>; | ||
); | ||
} | ||
@@ -228,2 +228,12 @@ | ||
deserializeResponse( | ||
requestPromise: Promise<Response>, | ||
listOrItem: 'list' | ||
): Promise<D['list']>; | ||
deserializeResponse( | ||
requestPromise: Promise<Response>, | ||
listOrItem: 'item' | ||
): Promise<D['entity']>; | ||
deserializeResponse<LOR extends 'list' | 'item'>( | ||
@@ -230,0 +240,0 @@ requestPromise: Promise<Response>, |
Sorry, the diff of this file is not supported yet
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
530378
6878