Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rest-client-sdk

Package Overview
Dependencies
Maintainers
3
Versions
109
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rest-client-sdk - npm Package Versions

1
11

3.1.1

Diff

Changelog

Source

3.1.1

Changed

  • Read json response in _manageUnauthorized when www-authenticate header is not available
fe4nn0r
published 3.1.0 •

Changelog

Source

3.1.0

Changed

  • Store a new key expires_at in the access token (which is accessible with TokenStorage.getAccessTokenObject) to have the timestamp after which the access token will be invalid, based on the expires_in
  • Add TokenStorage.getCurrentTokenExpiresIn function to known how many seconds are remaining for the access token currently stored
badaz
published 3.0.0 •

Changelog

Source

3.0.0

Changed

  • [Breaking] AccessDeniedError is now UnauthorizedError
  • [Breaking] Default error is now HttpError
  • Add ConflictError to react to 409
badaz
published 2.3.0 •

Changelog

Source

2.3.0

Changed

  • TokenStorage add possibility to pass access_token async storage key as constructor param
  • AbstractClient._manageAccessDenied checks headers instead of json to ensure refreshing the token is required
jdeniau
published 2.2.1 •

Changelog

Source

2.2.1

Changed

  • TokenStorage.getAccessTokenObject() returns an object and null if the stored token is not an object
  • [Might Break] TokenStorage.getAccessTokenObject() does not return undefined anymore but null if no token object is found
badaz
published 2.2.0 •

Changelog

Source

2.2.0

Changed

  • Add possibility to pass null as tokenStorage argument of the sdk
  • switch method names _doFetch and _fetchWithToken in AbstractClient for coherence
badaz
published 2.1.0 •

Changelog

Source

2.1.0

Changed

  • Add method getAccessTokenObject to TokenStorage
jdeniau
published 2.0.1 •

Changelog

Source

2.0.1

Changed

  • Better packaging system #48
jdeniau
published 2.0.1-rc.1 •

jdeniau
published 2.0.0 •

Changelog

Source

2.0.0

Added

  • [Might break] Custom serializer can:
    • serializeItem has been splitted into normalizeItem + encodeItem
    • deserializeItem has been splitted into denormalizeItem + decodeItem
    • deserializeList has been splitted into denormalizeList + decodeList

You must implement them if you have a custom serialization that do not use plain javascript objects.

Changed

  • [Breaking] Calling restClientSdk.foo.xxx is deprecated, you must now call restClientSdk.getRepository('foo').xxx
  • [Breaking] RestClientSdk now takes a Mapping instance instead of a clientList. This instance is required
  • [Breaking] getName has been removed and replaced by the classmetadata key. Its return was previously sent to the serializer, it's now the mapping that is sent now. Beware that now, the key is now used both to call the repository name, and passed to the serializer Before:
class SomeClient extends AbstractClient {
  getName() {
    return 'SomeClient';
  }
}

new RestClientSdk(
  // ...
  {
    foo: SomeClient,
  }
);

Now:

  const metadata = new ClassMetadata('foo', 'some_endpoint');
  mapping = new Mapping();
  mapping.setMapping([ metadata ]);

  const sdk = new RestClientSdk(/* ... */, mapping); // `foo` will be used in serializer too
  sdk.foo.find();
  • [Breaking] Custom Serializer: If you had a Collection entity containing the result of you entities, you will need to implement the iterable protocol on this object, this way, we can register all entities in the unit of work.

Removed

  • Dropped support for node 6
  • AbstractClient does not need to specify getPathBase anymore: this is generated via the classmetata. You can still override it.
  • getEntityURI is not mandatory anymore. it will be autogenerate by the AbstractClient. You can still override it
  • There is no need to create an empty client extending AbstractClient now, the default will be AbstractClient
  • config prefix is not used anymore, you should specify your prefix in the mapping: new Mapping('/v1')
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