Releases: widesky/jswidesky-client
3.1.1 Patch Release
3.1.0 Minor Release
The following changes have been made to the library:
ADDED
- Added new options under
http
which allows an optional to be passed to the HTTP and HTTPSAgent
used inaxios
requests. See NodeJS 16.x - HTTP Agent options.
3.0.1 - NPM Patch Release
No changes have been made. The package was released with a new tag 3.0.1
as NPM does not allow package versions to be
duplicated, even in the case where a package's version was unpublished. This is documented in npm Unpublish Policy - Considerations.
3.0.0 - Major Release (BREAKING CHANGE)
Note: The v3.0.0 package for @widesky/jswidesky-client
does not exist in NPM as it was unpublished. Please use v3.0.1
or later instead.
The following changes have been made to the library, that includes a breaking change:
Fixed
- Fixed minified file error "Invalid or expected token".
Changed
- BREAKING CHANGE: Changed minified file name from "wideskyClient.min.js" to "jsWideSky.min.js".
- BREAKING CHANGE: Changed default export name of minified file from
wideskyClient
(assuming this was set as a default
when not specified in the webpack configuration) toJsWideSky
.
2.1.5 Patch Release
The following changes have been made to the library:
CHANGED
getWatchSocket
function now accounts for subpath in URL when retrieving a socket connection.
2.1.4 Patch Release
The following changes have been made to the library:
CHANGED
- Changed the error message produced when more than 1 GraphQL error is encountered. Previously, all that was logged
was "More than 1 error encountered" which is too vague. This has been changed to "More than 1 GraphQLError
encountered" with additional logs detailing each GraphQL error encountered as " @ locations/s ...".
2.1.3 Hotfix Release
The following changes have been made to the library:
FIXED
- Added utility class
EntityCriteria
to package exports.
2.1.2 Hotfix Release
The following changes have been made to the library:
FIXED
- Fixed bug
TypeError: Cannot read properties of undefined (reading '0')
when usingWideSkyClient.batch.hisWrite
.
CHANGED
- Added empty payload check.
ADDED
- Size property to
HisWritePayload
to get the number of rows currently added to the payload.
2.1.1 Hotfix Release
The following changes have been made to the library:
FIXED
- Fixed
getWatchSocket
function returning an invalid socket due to a missing namespace URL.
2.1.0 Major Release
The following changes have been made to the library:
Added
- Added Haystack utility functions for ease of use. These include:
removePrefix(value)
: Remove the Haystack prefix from the given String value if applied.getId(entity, tag)
: Get a UUID from the entity, or the Haystack reference tag is specified.getReadableName(entity)
: Get thefqname
orid
tag of the entity.
- Added new argument
options
toWideSkyClient
constructor to accept configurations for the underlyingaxios
client
instance and WideSky client batch operations. The options argument is expected to have the following structure as
defined in Client Options. - Added a new static function
make
to create aWideSkyClient
instance from a configuration Object. The Object can
have the following options:serverURL
: The URL to the WideSky API server (required).username
: The username for a WideSky user (required).password
: The password the above WideSky username (required).clientId
: The Client ID for OAuth 2.0 authentication (required).clientSecret
: The Client secret for OAuth 2.0 authentication (required).accessToken
: A valid WideSky access token for OAuth 2.0 authentication (optional).options
: An Object containing attributes axios and client for configuring the axios and WideSky client
respectively. The options argument is expected to have the following structure as defined in
Client Options.logger
: This can be one of:- Empty, meaning a default Bunyan logger is used.
- Object, for which a Bunyan instance will be created with:
- name: Name of logging instance.
- level: Bunyan logging level to shows logs higher than
- raw: If true, output in JSON format. If false, output in prettified Bunyan logging format.
- Bunyan logging instance
- Added new set of functions under property
v2
of theWideSkyClient
instance.v2
consists of client functions:find
: Same functionality as the existingWideSkyClient.find
but returns only the rows.
- Added new class
HisWritePayload
to more easily create payloads suitable for thehisWrite
function. - Added new function
performOpInBatch
to perform client operations in a batched and parallel manner. Will be used
as the basis for all new batch functions added. - Add new batch functions:
client.batch.hisWrite(payload, options)
client.batch.hisRead(ids, from, to, options)
client.batch.hisDelete(ids, start, end, options)
client.batch.create(entities, options)
client.batch.update(entities, options)
client.batch.deleteById(ids, options)
client.batch.deleteByFilter(filter, limit, options)
client.batch.hisReadByFilter(filter, from, to, options)
client.batch.updateByFilter(filter, criteriaList, options)
client.batch.hisDeleteByFilter(filter, start, end, options)
client.batch.migrateHistory(fromEntity, toEntity)
client.batch.addChildrenByFilter(filter, children, tagMap)
client.batch.multiFind(filterAndLimits, options)
client.batch.updateOrCreate(entities, options)
- Added new utility class
EntityCriteria
to be used withclient.batch.updateByFilter
. - Added new function
entityCount(filter)
to get the number of entities from a filter via a GraphQL query. - Added new function
findAsId(filter, limit)
to optimise functions that only require the ids of the entity,
normally discarding any other information that would be returned fromclient.find
.
Changed
- Client no longer throws a Axios error if a response has been received and response is a Haystack of GraphQL error.
Instead, the error found in the response as received from a WideSky API server is used as the error message.
This has been changed as the WideSky API server already created good responses to request errors and changes should
only be in API server.