New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@jbouduin/hal-rest-client

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jbouduin/hal-rest-client - npm Package Compare versions

Comparing version 0.8.1 to 0.9.0

6

dist/lib/hal-rest-client.d.ts

@@ -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>>;

4

package.json

@@ -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
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc