@jbouduin/hal-rest-client
Advanced tools
Comparing version 0.8.1 to 0.9.0
@@ -13,3 +13,7 @@ import "reflect-metadata"; | ||
private jsonParser; | ||
get config(): import("axios").AxiosDefaults<any>; | ||
get config(): Omit<import("axios").AxiosDefaults<any>, "headers"> & { | ||
headers: import("axios").HeadersDefaults & { | ||
[key: string]: string | number | boolean | string[] | import("axios").AxiosHeaders; | ||
}; | ||
}; | ||
get requestInterceptors(): AxiosInterceptorManager<AxiosRequestConfig<any>>; | ||
@@ -16,0 +20,0 @@ get responseInterceptors(): AxiosInterceptorManager<AxiosResponse<any, any>>; |
@@ -8,3 +8,3 @@ { | ||
], | ||
"version": "0.8.1", | ||
"version": "0.9.0", | ||
"description": "Hal rest client for typescript", | ||
@@ -29,3 +29,3 @@ "tags": [ | ||
"dependencies": { | ||
"axios": "^0.26.1", | ||
"axios": "^1.2.2", | ||
"reflect-metadata": "^0.1.13" | ||
@@ -32,0 +32,0 @@ }, |
@@ -8,2 +8,3 @@ # @jbouduin/hal-rest-client | ||
The hal-rest-client library helps you to work with Hypertext Application Language (HAL) in Typescript. | ||
@@ -20,5 +21,5 @@ This is a friendly fork of the original [hal-rest-client](https://github.com/deblockt/hal-rest-client) repository. | ||
## What I intend to do (without the intention to invest lots of time): | ||
* Do some clean-up where appropriate | ||
* Do some more clean-up where appropriate | ||
* Adapt and extend the library to my own needs and any changes (although not probable) in the HAL-Specification | ||
* Correct bugs (feel free to create issues if you find one) | ||
* Correct bugs (feel free to create an issue if you find one) | ||
@@ -32,8 +33,3 @@ ## Pull requests | ||
hal-rest-client library to help you work with Hypertext Application Language (HAL) on Typescript. It's work fine with browser or nodejs app. | ||
It can map rest service return to Typescript object for simply access link or property. | ||
## Install | ||
Using npm : | ||
@@ -55,3 +51,3 @@ | ||
To have access to your service, you need to create an hal-rest-client instance . | ||
To have access to your service, you need to create a hal-rest-client instance. | ||
@@ -149,3 +145,3 @@ ``` ts | ||
Resource can be updated, an save with a PATCH query. | ||
Resource can be updated, and saves with a PATCH query. | ||
@@ -271,3 +267,3 @@ ``` ts | ||
Resource can be updated, an save with a PATCH query. | ||
Resource can be updated, and saved with a PATCH query. | ||
@@ -278,5 +274,5 @@ ``` ts | ||
``` | ||
> update return a promise. use `await` to wait end of update. | ||
> update returns a promise. use `await` to wait end of update. | ||
You can set a link, the new value for a link must be an `HalResource` or an other model, populated or not. | ||
You can set a link, the new value for a link must be a `HalResource` or an other model, populated or not. | ||
``` ts | ||
@@ -287,3 +283,3 @@ // init an HalResource called newPerson | ||
``` | ||
> on the request send to server, only the uri is sent not all the object. | ||
> when sending the request send to server, only the uri is sent, not the object complete object. | ||
@@ -304,7 +300,7 @@ #### create a resource | ||
If your server return the new created object as body, you can do this : | ||
If your server returns the newly created object as body, you can do this : | ||
``` ts | ||
const resource = await client.create("/resources", { name: "Thomas" }, Resource); | ||
``` | ||
> Resource is an Resource object if server return a resource or just json if a simple json is returned | ||
> Resource is a Resource object if server return a resource or just json if a simple json is returned | ||
@@ -330,3 +326,3 @@ ##### Create a new Object | ||
``` | ||
> if your server return new created object, create return this object. createdResource have type Resource. create don't populate the existing object. | ||
> if your server returns a newly created object, create return this object. createdResource is of type Resource. Create doesn't populate the existing object. | ||
@@ -341,3 +337,3 @@ ## Configuration | ||
To do, you have two solution: | ||
To do, you have two solutions: | ||
@@ -386,3 +382,3 @@ ```typescript | ||
an base URL can be used to fetch resources. | ||
a base URL can be used to fetch resources. | ||
@@ -471,3 +467,3 @@ ``` ts | ||
- parseProp : parse a simple property (not an HalResource) | ||
- parseProp : parse a simple property (not a HalResource) | ||
- parseResource : parse a HalResource or model class |
144365
1846
457
+ Addedasynckit@0.4.0(transitive)
+ Addedaxios@1.7.9(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addedform-data@4.0.1(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedproxy-from-env@1.1.0(transitive)
- Removedaxios@0.26.1(transitive)
Updatedaxios@^1.2.2