Change Log
All notable changes to this project will be documented in this file.
Last updated
All notable changes to this project will be documented in this file.
Last updated
All notable changes to this project will be documented in this file.
The format is based on , and this project adheres to .
Data Service:
Schema createMode
, readMode
, updateMode
and deleteMode
have been updated to accept multiple granular options, matching the revamped access mode changes in Data Service 1.4.0
Schema Transition Action type: "task"
now supports the priority
field
Schema Transition afterActions
now supports the type: "task"
Action
Access mode documentation has been revamped for the relevant exh.data.documents.*
methods
exh.data.documents.transition
now accepts a name
field the requestBody
, allowing a Transition to be triggered by its name
exh.data.documents.unlinkAllUsers
and unlinkAllGroups
methods added, to unlink all users or groups from a Document
TRANSITION_DOCUMENTS
has been added as a supported permission
exh.events.create
now supports a normalizeEventContent
option to disable normalization of event content
exh.data.documents.unlinkUsers
and unlinkGroups
now also accept an array of user or group ids directly
Thanks to tran-simon
for the pointing out the initially incorrect unlinkUsers
type definition!
The RQL contains
and excludes
methods type definitions have been improved
Data Service Schema Transition:
Now correctly states name
is optional and id
is only a returned field.
Action type: "task"
now correctly types functioName
as functionName
Action type: "notifyAlgoQueueManager"
no longer claims it has an id
and version
field
exh.templates.findFirst
, findById
and findByName
now correctly defines undefined
as a return type
exh.data.documents.unlinkUsers
usage with an object is deprecated in favor of an array of ids directly or unlinkAllUsers
for unlinking all users
exh.data.documents.unlinkGroups
usage with an object is deprecated in favor of an array of ids directly or unlinkAllGroups
for unlinking all groups
No longer minifying to prevent huge error stack traces, we expect that where it matters bundlers are in use anyway
exh.data.schemas.update
now correctly accepts all the *Mode
and *Limit
schema properties
Added missing Schema
and TypeConfiguration
properties
Corrected the notification settings type
exh.auth.oauth1.tokens
now has find
, findFirst
, findById
and remove
methods
exh.auth.oauth2.tokens
now has find
, findFirst
, findById
and remove
methods
The exh.events.subscriptions
methods now also support the new retriable
field
exh.auth.oauth1.getTokens
is deprecated in favor of exh.auth.oauth1.tokens.find
exh.auth.oauth1.removeToken
is deprecated in favor of exh.auth.oauth1.tokens.remove
exh.events.subscriptions.create
should no longer be used, this is managed by the system
Now also publishing to the NPM registry, no longer needing to authenticate with GitHub Packages to install the SDK
exh.users.globalRoles
now has find
, findFirst
, findById
and findByName
methods
exh.users.groupRoles
now has find
, findFirst
, findById
and findByName
methods
exh.auth.applications
now has find
, findFirst
, findById
and findByName
methods
exh.users.globalRoles.get
is deprecated in favor of exh.users.globalRoles.find
exh.users.groupRoles.get
is deprecated in favor of exh.users.groupRoles.find
exh.auth.applications.get
is deprecated in favor of exh.auth.applications.find
The data
for exh.profiles.update
is now correctly typed.
The rqlBuilder.intermediate()
method now correctly wraps multiple expressions in an and
expression.
Synced the values of GlobalPermissionName
with the current API permissions.
Role permissions are now correctly typed
Any string is now accepted as a permission, but the GlobalPermissionName
can still be used as a source of known permissions
This affects the methods for adding/removing permissions for both global roles and group roles
Data service transition action types corrected. Thank you, tran-simon
!
MfaRequiredError
now exposes a typed mfa
property to complete the MFA flow type safe
All runtime dependencies are now pinned to their specific version
axios
updated to 0.28.1
fflate
updated to 0.8.2
typescript-json-decoder
updated to 1.0.11
qs
updated to 6.12.0
Removed the dependency on ts-toolbelt
as it was no longer required
Using an oAuth2 confidential client on web no longer causes a global not defined
error
exh.files.create
and exh.files.createFromText
now work correctly while using oAuth1 in React Native
The generic API_ERROR
name is no longer shown for errors with more specific information available
Type corrections for the user, profile, file, index and mfa entities
Corrected the places where the name of a schema can also be used rather than just the id
The groupIds
for exh.data.documents.unlinkGroups
is now correctly marked as optional
Corrected the permission mentioned for exh.users.groupRoles.removeUsersFromStaff
Pinned the qs
version because of breaking changes in their latest release for our oAuth1 signature generation
exh.users.createAccount
and exh.users.updateEmail
:
Now accept an activationMode
field
After enabling in the verification settings, this field can be set to use the pin code mode
exh.users.requestEmailActivation
and exh.users.requestPasswordReset
:
Alternatively now also accept an object with an email
and mode
field
After enabling in the verification settings, the mode
field can be set to use the pin code mode
Additional errors are thrown when request limiting is enabled via the verification settings
exh.users.validatePasswordReset
and exh.users.validateEmailActivation
:
Alternatively now also accept an email
and pinCode
field
Additional errors are thrown when using the pin code mode
exh.users.getEmailTemplates
and exh.users.setEmailTemplates
now support the new pin code email templates:
oidcUnlinkPinEmailTemplateId
activationPinEmailTemplateId
reactivationPinEmailTemplateId
passwordResetPinEmailTemplateId
Improved oAuth2 access token refreshing
If the SDK is able to estimate the expiry time of an access token, the token is refreshed before it expires
This done just before a request is about to made, preventing the extra request to just receive an expired token error
Tokens received from the exh.auth.authenticate
method, next to expiresIn
, now also include an creationTimestamp
field
createClient
and createOAuth2Client
now accept an expiresIn
and creationTimestamp
field
Methods to work with the activation requests:
exh.users.activationRequests.find
exh.users.activationRequests.findFirst
exh.users.activationRequests.findById
exh.users.activationRequests.findByUserId
exh.users.activationRequests.remove
Methods to work with the forgot password requests:
exh.users.forgotPasswordRequests.find
exh.users.forgotPasswordRequests.findFirst
exh.users.forgotPasswordRequests.findById
exh.users.forgotPasswordRequests.findByUserId
exh.users.forgotPasswordRequests.remove
Methods to work with the user verification settings:
exh.users.settings.getVerificationSettings
exh.users.settings.updateVerificationSettings
exh.auth.applications.deleteVersion
now calls the correct endpoint
Automatic oAuth2 access token refreshing now properly uses client credentials
Optional fields for exh.auth.users.addMfaMethod
are now correctly marked as optional
The return value of exh.users.changePassword
is now correctly typed as a boolean
Corrected the VIEW_API_FUNCTION_REQUEST_LOGS
permission name mentioned in the inline documentation
The statuses
field of the data service Schema
entity is now typed correctly
Disable double encoding for all RQL operations with rqlBuilder.doubleEncodeValues = false
Disable double encoding for a single RQL operation rqlBuilder({ doubleEncodeValues: false }).eq(name, '< value >').build()
Breaking Change: Starting from v8.0.0, the SDK will no longer normalize custom keys in requests and responses. This means that all custom keys will be sent and received as they are provided.
The normalization of custom keys can be re-enabled for a single operation to the behavior before 8.0.0 by setting the option exh.service.operation({ normalizeCustomData: true })
The normalization of custom keys can be re-enabled for all operations on a client to the behavior before 8.0.0 using the snippet exh = createClient({ ...options, normalizeCustomData: true });
Breaking Change: For all unauthenticated methods the response will now undergo the same transformation steps as any other request.
The timestamps previously returned as strings are now converted to date objects in exh.auth.authenticate
, exh.auth.confirmMfa
andexh.users.createAccount
.
New implementation of the hashing for oAuth1 signature generation
This change is not expected to have any impact on the SDK usage
In the TokenDataOauth1
interface updateTimeStamp
is changed to updateTimestamp
timeZone
is now accepted as a valid parameter for the resolve functions in the template service
New implementation of the oAuth1 signature generation to support double Encoding of RQL values in OAuth1
clients
Enable double encoding for all RQL operations with rqlBuilder.doubleEncodeValues = true
Enable double encoding for a single RQL operation rqlBuilder({ doubleEncodeValues: true }).eq(name, '< value >').build()
When enabling double encoded values ensure that instances of encoding values for the rql builder such as encodeURIComponent()
are removed
Double Encoding of RQL values is currently only supported in OAuth2
clients and will come to OAuth1
clients at a later date.
A skip count operator to the rql builder rqlBuilder().eq(name, '< value >').skipCount().build()
Providing this operator skips the record counting step of a request to increase performance. As a result, the page object in a response will not include the total field.
Documentation for an incorrect permission value of exh.users.globalRoles.addPermissions()
REMOVE_ROLE_PERMISSIONS
to REMOVE_ROLE_PERMISSION
findAll
, findAllIterator
and update
methods to the Dispatcher service
Updated types and documentation for the Dispatcher service
Exported the missing RQLString
type
Type support React Native form data
Bumped Axios version to fix content-type header issue
Fixed onUploadProgress
callback event triggering without a provided function
Removed discrimination between node and web environments
Support for File Service settings:
exh.files.settings
Correctly export the interfaces of the tasks component
Support for API Functions:
exh.tasks.api
exh.tasks.apiRequests
exh.tasks.apiRequests.logs
A Function may now be directly executed as a task using the method:
exh.tasks.functions.execute()
Support for Tasks
Task Schedules may now be managed using methods found in:
exh.tasks.schedules
Task Logs produced during the execution of a task can now be accessed using methods found in:
exh.tasks.logs
Monitoring File Uploads
VIEW_GROUPS
permission value is changed to the correct VIEW_GROUP
ADD_ROLE_PERMISSION
is now described correctly as singular in the inline documentation
Updated RegisterUserData
interface optional fields
Support for OpenID Connect
OAuth 2 clients now allow users to authenticate themselves with OpenID connect. See:
exh.auth.generateOidcAuthenticationUrl()
exh.auth.authenticateWithOidc()
Manage your OpenID Connect configuration via new methods found in:
exh.auth.oidc
exh.auth.oidc.providers
exh.auth.oidc.loginAttempts
Methods to manage the User Service email templates:
exh.users.getEmailTemplates()
exh.users.setEmailTemplates()
While creating an oAuth1 client both token
and tokenSecret
can now be supplied. In which case there is no need for an extra exh.auth.authenticate
call.
While creating an oAuth2 client both refreshToken
and accessToken
can now be supplied. In which case there is no need for an extra exh.auth.authenticate
call.
Improved types and inline documentation (JSDoc) for the exh.auth.applications
section
More detailed descriptions for the methods
Descriptions for the fields within the data types we accept and return
Support large file uploads
Task cancellation
For API errors the qName
variable is mapped to the name
variable, to improve consistency with default errors.
Corrected the interfaces to be consistent with the API
Updated dead links in documentation
logout()
can now be performed on a proxy Client
Tasks now take an optional generic to set the data type
userId
is now available on the raw mock
Password policy -> exh.users.passwordPolicy
and exh.users.updatePasswordPolicy
Extra Playstore endpoint -> payments.playStoreHistory.purchaseReceipts
Extra permissions for the updated task service
RQL option to several endpoints
Types for the exh.auth.application.create
and exh.auth.application.createVersion
have been exported. See Authentication examples for more info.
Pako to fflate
Refactored the Schema and Document Types
Return type of exh.auth.application.update
is now correctly typed as AffectedRecords
Removed payments.playStoreHistory.purchases
(deprecated)
The removal of the group roles now has the correct parameters
renamed createTransaction
to completeTransaction
on the payments.appStore service
When passing in localhost
as host. No prefixing takes places.
Profile
type has been revised
ProxyClient
existed double. One of those has been renamed to ProxyInstance
sdk.data.documents.create
now accepts 3 generics.
sdk.data.documents.update
now accepts a generic for the update type.
Exported findAllGeneric
and findAllIterator
for usage on raw functions
Better type for findAllIterator
Playstore endpoints can handle rql now
There are now 3 mocked exports. getMockSdkProxy
, getMockSdkOAuth2
and getMockSdkOAuth1
with matching types. The getMockSdk
is also still available and mapped to getMockSdkOAuth2
.
btoa
function to be used when you are using React-Native in combination with a Confidential Application. See documentation for more info.
createOAuth1Client
and createOAuth2Client
have had their type signatures updated. The freshTokensCallback
will now have the correct type.
Updated payments service to reflect v1.2.0 payments REST API
createProxyClient
is a new way to initialize the SDK using a proxy service.
Comment
interface.
Calls not needing authentication are now correctly skipping this
The payments services has had some refactoring.
parseGlobalPermissions
is a function to parse strings are return valid permissions
userId
getter on the OAuthClient
interface now returns a Promise<string>
in stead of string
. You can access this on sdk.raw.userId
services that have a findAll
method now also have findAllIterator
.
sdk.data.schemas
, sdk.data.documents
and sdk.data.users
have had changes to their find
function. This now returns the current value with two added functions next()
and previous()
which can be used to easily traverse the data.
rqlParser accepts a regular string which will be checked using the parser function and returns a valid RQLString.
added endTimestamp
to list of fieldnames that are parsed at Date
rqlBuilder now supports the excludes
operator
several examples had updates to reflect proper usage
Fixed sdk.files.create
options types. See #352
JSDoc for rqlBuilder().contains
. See #351
GET requests returning a 500 status will be retried 4 more times at 300ms intervals. To disable this behaviour add shouldRetry: false
to the options parameter. See #373
findAll
function added on users and data.documents. See #333
OAuth2 authenticate
returns tokenData
.
OAuth2 authenticate
can now be used with an authorization code. See Docs.
OAuth2 supports confidentials applications.
removed console.log in sdk.data.documents.find
function
Fixed documentation tables
OAuth1 authenticate
returns tokenData
Updated documentation on SSL pinning
Add logout
function to sdk.auth
Updated installation instructions
Add findAll
to sdk.data.schemas
Client creation allows for extra headers which will be set on every call.
Functions now accept options to set custom headers
Added missing permissions
Added findFirst method in users service
Fixed bug to show a clear error when the user is not authenticated
Fixed documentation format
Updated README installation
Updated rql parameter type. Is always rql: RQLString
now. Functions affected:
sdk.payments.orders.addTagsToOrder
sdk.payments.orders.removeTagsFromOrder
sdk.payments.products.removeTagsFromProduct
Updated parameter position if rql is a required parameter, it is always the first parameter. Functions affected
sdk.users.groupRoles.remove
sdk.users.groupRoles.removePermissions
sdk.users.groupRoles.removeFromStaff
sdk.users.groupRoles.removeUsersFromStaff
Renamed all methods from delete
to remove
and all of them returning AffectedRecords
Renamed all methods from deleteFields
to removeFields
Localizations Service
Profiles Service
Notifications Service
optional skipTokenCheck
parameter to Oauth1 authentication flow with token/tokenSecret.
Events Service
Fixed return types of sdk.users.getStaff
and sdk.users.getPatients
Updated docs links
updateProfileImage
method is deprecated
Gzip option sdk.data.documents.create
sdk.files.create
signature has changed.
Custom Document no longer need to extend from DocumentBase. You can just pass in the type for data
sdk.files.createFromText
where you can pass in your text directly.
Added transitionsByName
getter to easily get the transition you need.
Added findTransitionIdByName
function on schema
objects to easily find the transitionId you need.
Added findById
, findByName
and findFirst
helpers to services having a generic find
function.
Payments Service
Added or
, and
and contains
operators to the RQL builder.
apiHost
has been renamed to host
and should not include the protocol or api
subdomain. Example `
client
is renamed to createClient
rawAxios
is renamed to raw
createOAuth1Client
and createOAuth2Client
are now exported as more specifically typed versions of createClient
Additional http header is added with every request. Which includes the package version and when running in node the node version.
Added Test Reports
getMockSdk
function to get back a mocked SDK. See README for more info
Templates resolveAsPdf
will return a Buffer
sdk.authenticate
now includes possible error responses in the JSDoc annotations
rqlBuilder
now has JSDoc annotations
Fix for results with arrays containing strings
File creation now correctly set the file name on the form-data. Accepts extra parameter extension
which defaults to pdf
The MailsService now correctly decamelizes the keys in the request
Templates basepath fix
Services scoping:
Configurations Service
Dispatchers Service
Mails Service
Templates Service
Types are now exposed within modules, so the usage will be:
Error now not only extend from the ApiError
class but also from their respective HTTP error code error. Possible errors are
400: BadRequestError
401: UnauthorizedError
403: ForbiddenError
404: NotFoundError
500: ServerError
PagedResults are now using generics
Every merge into dev will create a tag and package with the current version number suffixed with -dev.X
where X auto-increments
Removed * @throws {ApiError}
in JSDoc comments, only specific errors are mentioned when mentioned in the Swagger documentation
ClientId for OAuth2 and consumerkey/secret for Oauth1 are now passed in during client initialization in stead of authentication. This way on not authenicated calls the clientId and consumerkey/secret information is added to the requests.
OAuth2
OAuth1
Removed query
from list results
PartialUserData
is renamed to User
Changes to the UserData
interface
language
type is changed from string
to LanguageCode
timeZone
type is changed from string
to TimeZone
lastFailedTimestamp
type is changed from number
to Date
added creationTimestamp
and updateTimestamp
Change to the RegisterUserData
interface
phoneNumber
is now required
Correctly exporting all the possible errors.
Optional paramaters are now grouped in an options object as last parameters.
The Axios instance used by the SDK is now directly accessible
Data Service now includes:
Transitions Service
Documents Service
Comments Service
You can pass in your own interface when calling the sdk.data.findDocuments<CustomDocument>(schemaId);
endpoint
The SDK also expose JSON-schema interface you can use to compose your own
OAuth1 token/tokenSecret flow is implemented.
Functions expecting an RQL should now show a more clear error when passing in a regular string.
The authenticate
and confirmMfa
methods have been scoped under the auth
namespace.
Certains methods under the users
namespace have had their name changed.
Removed debug
option. Use responseLogger
and requestLogger
options in stead. See README for example.
Tasks Service
Data Service now includes:
Schemas Service
Properties Service
Statuses Service
Indexes Service
Client initialization is changed. For example if you want to use the OAuth2 password flow, you no longer pass in the credentials as oauth
property in the client. But you have to call the authenticate
function. See README for other flows.
Multi-factor authentication via (authenticate / confirmMfa functions).
freshTokensCallback
option when creating the client. Pass in a function to retrieve the response when new tokens are received.
OAuth2 Refresh Token Grant flow.
files
service.
data
service: only to create a schema at the moment.
Functions that accept an RQL parameter no longer accepts regular string, but expect the output of and rqlBuilder -> build().
ApiError
now extends the built-in Error
.
Some functions allowed empty requestBody
which was incorrect in some cases, these have been fixed as well.
Breaking Change: RQL values are now by default when using the RQL builder
Please consult the for more information
Please consult the for more information
Please consult the for more information
Functionality to allow the of values when using the RQL builder
The skip count operator is currently supported in , and efforts are underway to make it available for all services.
File Service may now be managed using methods found in:
An may now be executed using methods found in:
produced by executing API Functions are accessible using methods found in:
produced during the execution of an API Function can be accessed using methods found in:
The SDK now supports in the browser using a callback function.
The return type of exh.users.update()
is returning the correct UserData
. See
OAuth1 token management -> exh.auth.oauth1.getTokens
/ exh.auth.oauth1.removeToken
. See
Updated the EnlistmentConfiguration
type. See
Running yarn
on windows machines resulted in an error
The contains
and excludes
endpoints of the rql builder now accepts an array of expressions iso a single string. See
Fixed bug when calling sdk.files.create
with tags as an array. See
Properties on your JSONSchema on the data service will no longer have any automatic date parsing.
If you are using the sdk.raw
instance you can now pass in additional parameters to the http verbs. See
Document
interface now accepts an optional second parameter for the status property of the document. See
Refactor of userId
getter on the sdk.raw
instance. It now works consistently everywhere (browser/node/react-native). See
Added findAll
and findAllIterator
to notifications. The find
method is also update to have pagination helpers
oauth1/ssoTokens/generate
and oauth1/ssoTokens/consume
are added under the sdk.auth.oauth1
scope.