rest-client-sdk
Advanced tools
Changelog
3.1.1
Changelog
3.1.0
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
TokenStorage.getCurrentTokenExpiresIn
function to known how many seconds are remaining for the access token currently storedChangelog
3.0.0
AccessDeniedError
is now UnauthorizedError
HttpError
ConflictError
to react to 409Changelog
2.3.0
TokenStorage
add possibility to pass access_token async storage key as constructor paramAbstractClient._manageAccessDenied
checks headers instead of json to ensure refreshing the token is requiredChangelog
2.2.1
TokenStorage.getAccessTokenObject()
returns an object and null if the stored token is not an objectTokenStorage.getAccessTokenObject()
does not return undefined
anymore but null
if no token object is foundChangelog
2.2.0
Changelog
2.0.0
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.
restClientSdk.foo.xxx
is deprecated, you must now call restClientSdk.getRepository('foo').xxx
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();
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 itAbstractClient
now, the default will be AbstractClient
prefix
is not used anymore, you should specify your prefix in the mapping: new Mapping('/v1')