Change Log
All notable changes to this project will be documented in this file.
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[8.8.1]
Fixed
Bumped axios version to
0.30.2to resolve vulnerabilityCVE-2025-58754
[8.8.0]
Added
exh.files.createnow accepts asignaloption to supply an AbortSignal to cancel the file upload
[8.7.1]
Fixed
Bumped form-data version to
4.0.4to fix vulnerabilityCVE-2025-7783
[8.7.0]
Added
Introduced
exh.notificationsV2with methods for Notifications Service v2:exh.notificationsV2.*provides functionality to send and retrieve notificationsexh.notificationsV2.userSettings.*offers management of user's devices
[8.6.0]
Added
Introduced methods to manage objects in arrays in the Data Service
exh.data.documents.appendObjectToArrayexh.data.documents.updateObjectInArrayexh.data.documents.removeObjectFromArray
Fixed
Added missing properties
userIdandapplicationIdfor the methodsdk.payments.appStore.completeTransactionBumped Axios version to
0.30to fix vulnerabilityCVE-2025-27152
[8.5.0]
Added
Data Service:
Schema
createMode,readMode,updateModeanddeleteModehave been updated to accept multiple granular options, matching the revamped access mode changes in Data Service1.4.0Schema Transition Action
type: "task"now supports thepriorityfieldSchema Transition
afterActionsnow supports thetype: "task"ActionAccess mode documentation has been revamped for the relevant
exh.data.documents.*methodsexh.data.documents.transitionnow accepts anamefield therequestBody, allowing a Transition to be triggered by itsnameexh.data.documents.unlinkAllUsersandunlinkAllGroupsmethods added, to unlink all users or groups from a Document
TRANSITION_DOCUMENTShas been added as a supported permissionexh.events.createnow supports anormalizeEventContentoption to disable normalization of event content
Changed
exh.data.documents.unlinkUsersandunlinkGroupsnow also accept an array of user or group ids directlyThanks to
tran-simonfor the pointing out the initially incorrectunlinkUserstype definition!
The RQL
containsandexcludesmethods type definitions have been improved
Fixed
Data Service Schema Transition:
Now correctly states
nameis optional andidis only a returned field.Action
type: "task"now correctly typesfunctioNameasfunctionNameAction
type: "notifyAlgoQueueManager"no longer claims it has anidandversionfield
exh.templates.findFirst,findByIdandfindByNamenow correctly definesundefinedas a return type
Deprecated
exh.data.documents.unlinkUsersusage with an object is deprecated in favor of an array of ids directly orunlinkAllUsersfor unlinking all usersexh.data.documents.unlinkGroupsusage with an object is deprecated in favor of an array of ids directly orunlinkAllGroupsfor unlinking all groups
[8.4.1]
Fixed
No longer minifying to prevent huge error stack traces, we expect that where it matters bundlers are in use anyway
exh.data.schemas.updatenow correctly accepts all the*Modeand*Limitschema propertiesAdded missing
SchemaandTypeConfigurationpropertiesCorrected the notification settings type
[8.4.0]
Added
exh.auth.oauth1.tokensnow hasfind,findFirst,findByIdandremovemethodsexh.auth.oauth2.tokensnow hasfind,findFirst,findByIdandremovemethodsThe
exh.events.subscriptionsmethods now also support the newretriablefield
Deprecated
exh.auth.oauth1.getTokensis deprecated in favor ofexh.auth.oauth1.tokens.findexh.auth.oauth1.removeTokenis deprecated in favor ofexh.auth.oauth1.tokens.removeexh.events.subscriptions.createshould no longer be used, this is managed by the system
[8.3.0]
Added
Now also publishing to the NPM registry, no longer needing to authenticate with GitHub Packages to install the SDK
exh.users.globalRolesnow hasfind,findFirst,findByIdandfindByNamemethodsexh.users.groupRolesnow hasfind,findFirst,findByIdandfindByNamemethodsexh.auth.applicationsnow hasfind,findFirst,findByIdandfindByNamemethods
Deprecated
exh.users.globalRoles.getis deprecated in favor ofexh.users.globalRoles.findexh.users.groupRoles.getis deprecated in favor ofexh.users.groupRoles.findexh.auth.applications.getis deprecated in favor ofexh.auth.applications.find
Fixed
The
dataforexh.profiles.updateis now correctly typed.The
rqlBuilder.intermediate()method now correctly wraps multiple expressions in anandexpression.Synced the values of
GlobalPermissionNamewith the current API permissions.Role permissions are now correctly typed
Any string is now accepted as a permission, but the
GlobalPermissionNamecan still be used as a source of known permissionsThis affects the methods for adding/removing permissions for both global roles and group roles
Data service transition action types corrected. Thank you,
tran-simon!
[8.2.0]
Added
MfaRequiredErrornow exposes a typedmfaproperty to complete the MFA flow type safe
Changed
All runtime dependencies are now pinned to their specific version
axiosupdated to0.28.1fflateupdated to0.8.2typescript-json-decoderupdated to1.0.11qsupdated to6.12.0Removed the dependency on
ts-toolbeltas it was no longer required
Fixed
Using an oAuth2 confidential client on web no longer causes a
global not definederrorexh.files.createandexh.files.createFromTextnow work correctly while using oAuth1 in React NativeThe generic
API_ERRORname is no longer shown for errors with more specific information availableType 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
groupIdsforexh.data.documents.unlinkGroupsis now correctly marked as optionalCorrected the permission mentioned for
exh.users.groupRoles.removeUsersFromStaff
[8.1.1]
Fixed
Pinned the
qsversion because of breaking changes in their latest release for our oAuth1 signature generation
[8.1.0]
Changed
exh.users.createAccountandexh.users.updateEmail:Now accept an
activationModefieldAfter enabling in the verification settings, this field can be set to use the pin code mode
exh.users.requestEmailActivationandexh.users.requestPasswordReset:Alternatively now also accept an object with an
emailandmodefieldAfter enabling in the verification settings, the
modefield can be set to use the pin code modeAdditional errors are thrown when request limiting is enabled via the verification settings
exh.users.validatePasswordResetandexh.users.validateEmailActivation:Alternatively now also accept an
emailandpinCodefieldAdditional errors are thrown when using the pin code mode
exh.users.getEmailTemplatesandexh.users.setEmailTemplatesnow support the new pin code email templates:oidcUnlinkPinEmailTemplateIdactivationPinEmailTemplateIdreactivationPinEmailTemplateIdpasswordResetPinEmailTemplateId
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.authenticatemethod, next toexpiresIn, now also include ancreationTimestampfieldcreateClientandcreateOAuth2Clientnow accept anexpiresInandcreationTimestampfield
Added
Methods to work with the activation requests:
exh.users.activationRequests.findexh.users.activationRequests.findFirstexh.users.activationRequests.findByIdexh.users.activationRequests.findByUserIdexh.users.activationRequests.remove
Methods to work with the forgot password requests:
exh.users.forgotPasswordRequests.findexh.users.forgotPasswordRequests.findFirstexh.users.forgotPasswordRequests.findByIdexh.users.forgotPasswordRequests.findByUserIdexh.users.forgotPasswordRequests.remove
Methods to work with the user verification settings:
exh.users.settings.getVerificationSettingsexh.users.settings.updateVerificationSettings
Fixed
exh.auth.applications.deleteVersionnow calls the correct endpointAutomatic oAuth2 access token refreshing now properly uses client credentials
Optional fields for
exh.auth.users.addMfaMethodare now correctly marked as optionalThe return value of
exh.users.changePasswordis now correctly typed as a booleanCorrected the
VIEW_API_FUNCTION_REQUEST_LOGSpermission name mentioned in the inline documentationThe
statusesfield of the data serviceSchemaentity is now typed correctly
[8.0.0]
Changed
Breaking Change: RQL values are now double encoded by default when using the RQL builder
Disable double encoding for all RQL operations with
rqlBuilder.doubleEncodeValues = falseDisable double encoding for a single RQL operation
rqlBuilder({ doubleEncodeValues: false }).eq(name, '< value >').build()Please consult the Migration Guide for more information
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 });Please consult the Migration Guide for more information
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.confirmMfaandexh.users.createAccount.Please consult the Migration Guide for more information
New implementation of the hashing for oAuth1 signature generation
This change is not expected to have any impact on the SDK usage
Bug Fixes
In the
TokenDataOauth1interfaceupdateTimeStampis changed toupdateTimestamptimeZoneis now accepted as a valid parameter for the resolve functions in the template service
[v7.8.0]
Changed
New implementation of the oAuth1 signature generation to support double Encoding of RQL values in
OAuth1clients
[v7.7.0]
Added
Functionality to allow the double encoding of values when using the RQL builder
Enable double encoding for all RQL operations with
rqlBuilder.doubleEncodeValues = trueEnable 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 removedDouble Encoding of RQL values is currently only supported in
OAuth2clients and will come toOAuth1clients 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.
The skip count operator is currently supported in select services, and efforts are underway to make it available for all services.
Fixed
Documentation for an incorrect permission value of
exh.users.globalRoles.addPermissions()REMOVE_ROLE_PERMISSIONStoREMOVE_ROLE_PERMISSION
[v7.6.0]
Added
findAll,findAllIteratorandupdatemethods to the Dispatcher service
Improvements
Updated types and documentation for the Dispatcher service
Exported the missing
RQLStringtype
[v7.5.1]
Added
Type support React Native form data
Fixes
Bumped Axios version to fix content-type header issue
Fixed
onUploadProgresscallback event triggering without a provided functionRemoved discrimination between node and web environments
[v7.5.0]
Added
Support for File Service settings:
File Service settings may now be managed using methods found in:
exh.files.settings
[v7.4.1]
Fixes
Correctly export the interfaces of the tasks component
[v7.4.0]
Added
Support for API Functions:
An API Function may now be executed using methods found in:
exh.tasks.api
API Requests produced by executing API Functions are accessible using methods found in:
exh.tasks.apiRequests
API Request Logs produced during the execution of an API Function can be accessed using methods found in:
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
The SDK now supports monitoring file uploads in the browser using a callback function.
function uploadProgressCallback(event) { const progress = (event.loaded / event.total) * 100; // ... Do something with the progress value } const fileMetaData = await exh.files.create('myReport.pdf', myBuffer, { onUploadProgress: uploadProgressCallback, tags: ['ecg-report'] });
Changed
VIEW_GROUPSpermission value is changed to the correctVIEW_GROUPADD_ROLE_PERMISSIONis now described correctly as singular in the inline documentationUpdated
RegisterUserDatainterface optional fields
[v7.3.0]
Added
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.oidcexh.auth.oidc.providersexh.auth.oidc.loginAttempts
Methods to manage the User Service email templates:
exh.users.getEmailTemplates()exh.users.setEmailTemplates()
While creating an oAuth1 client both
tokenandtokenSecretcan now be supplied. In which case there is no need for an extraexh.auth.authenticatecall.
const exh = createClient({
host: 'https://api.example.extrahorizon.io',
consumerKey: 'cf29b211b5030202ffce5b2510759d0a53ea5b17',
consumerSecret: '9bd34e19b5e1714e2c57ae0127d98dd0d0c0b2a2',
token: '409ce9ba49c56cce31b9d2b1b2f5ed5ac01b4011',
tokenSecret: '1cc0b97b4c4721bb6da3d85b80cda8165e6ad5a7',
});
const currentUser = await exh.users.me();While creating an oAuth2 client both
refreshTokenandaccessTokencan now be supplied. In which case there is no need for an extraexh.auth.authenticatecall.
const exh = createClient({
host: 'https://api.example.extrahorizon.io',
clientId: 'f8d9c891c106131bec970c6da05f887dc82eaff7',
refreshToken: 'ca27ada704e5b26a1fca20c130daf4f95f727d3f',
accessToken: '019dc6fe1672176f28e8e894ba99aed1f49656c8',
});
const currentUser = await exh.users.me();Changed
Improved types and inline documentation (JSDoc) for the
exh.auth.applicationssectionMore detailed descriptions for the methods
Descriptions for the fields within the data types we accept and return
[v7.2.1]
Added
Support large file uploads
Fixes
Task cancellation
[v7.2.0]
Added
For API errors the
qNamevariable is mapped to thenamevariable, to improve consistency with default errors.
Fixes
Corrected the interfaces to be consistent with the API
Updated dead links in documentation
[v7.1.0]
Added
logout()can now be performed on a proxy ClientTasks now take an optional generic to set the data type
userIdis now available on the raw mock
Fixes
The return type of
exh.users.update()is returning the correctUserData. See issue #605
[v7.0.0]
Added
OAuth1 token management ->
exh.auth.oauth1.getTokens/exh.auth.oauth1.removeToken. See issue #465Password policy ->
exh.users.passwordPolicyandexh.users.updatePasswordPolicyExtra Playstore endpoint ->
payments.playStoreHistory.purchaseReceiptsExtra permissions for the updated task service
RQL option to several endpoints
Changed
Types for the
exh.auth.application.createandexh.auth.application.createVersionhave been exported. See Authentication examples for more info.Pako to fflate
Refactored the Schema and Document Types
Updated the
EnlistmentConfigurationtype. See issue #596
Fixes
Running
yarnon windows machines resulted in an error issue #612Return type of
exh.auth.application.updateis now correctly typed asAffectedRecords
Breaking changes
Removed
payments.playStoreHistory.purchases(deprecated)The
containsandexcludesendpoints of the rql builder now accepts an array of expressions iso a single string. See issue #603The removal of the group roles now has the correct parameters
- exh.users.groupRoles.remove(rql, groupId, roleId, options)
+ exh.users.groupRoles.remove(rql, groupId, options)[v6.1.0]
Breaking changes
renamed
createTransactiontocompleteTransactionon the payments.appStore service
- sdk.payments.appStore.createTransaction
+ sdk.payments.appStore.completeTransactionChanged
When passing in
localhostas host. No prefixing takes places.Fixed bug when calling
sdk.files.createwith tags as an array. See PR #544Properties on your JSONSchema on the data service will no longer have any automatic date parsing. PR #546
If you are using the
sdk.rawinstance you can now pass in additional parameters to the http verbs. See PR #546
const result = sdk.raw.get('/files/v1', {
interceptors: {
skipCamelizeResponseData: true, // will recursively rename keys to camelCase
skipTransformResponseData: true, // maps the values of certain keys to Dates
skipTransformKeysResponseData: true, // renames certain keys for consistency
},
});Profiletype has been revised
-fibricheckInfo?: string;
+fibricheckInfo?: {
+ app?: {
+ version?: string;
+ build?: string;
+ branch?: string;
+ };
+ device?: {
+ os?: string;
+ model?: string;
+ type?: 'android' | 'ios';
+ manufacturer?: string;
+ };
+};ProxyClientexisted double. One of those has been renamed toProxyInstance
-export interface ProxyClient extends HttpInstance {
+export interface ProxyInstance extends HttpInstance {[v6.0.0]
Breaking Changes
sdk.data.documents.createnow accepts 3 generics.
-create<CustomData = null, CustomStatus = null>(
- schemaId: ObjectId,
- requestBody: Record<string, any>,
- options?: OptionsWithRql & { gzip?: boolean }
-): Promise<Document<CustomData, CustomStatus>>;
+create<InputData = null, OutputData = null, CustomStatus = null>(
+ schemaId: ObjectId,
+ requestBody: InputData,
+ options?: OptionsWithRql & { gzip?: boolean }
+): Promise<Document<OutputData, CustomStatus>>;Added
sdk.data.documents.updatenow accepts a generic for the update type.Exported
findAllGenericandfindAllIteratorfor usage on raw functionsBetter type for
findAllIterator
[v5.3.1]
Added/Fixed
Playstore endpoints can handle rql now
[v5.3.0]
Added
There are now 3 mocked exports.
getMockSdkProxy,getMockSdkOAuth2andgetMockSdkOAuth1with matching types. ThegetMockSdkis also still available and mapped togetMockSdkOAuth2.
[v5.2.0]
Added
btoafunction to be used when you are using React-Native in combination with a Confidential Application. See documentation for more info.createOAuth1ClientandcreateOAuth2Clienthave had their type signatures updated. ThefreshTokensCallbackwill now have the correct type.Updated payments service to reflect v1.2.0 payments REST API
createProxyClientis a new way to initialize the SDK using a proxy service.
Changed
Commentinterface.
- userId
+ creatorId
+ commentedTimestampDocumentinterface now accepts an optional second parameter for the status property of the document. See PR #461Refactor of
userIdgetter on thesdk.rawinstance. It now works consistently everywhere (browser/node/react-native). See PR #462Added
findAllandfindAllIteratorto notifications. Thefindmethod is also update to have pagination helpers PR #475
[v5.1.0]
Added
oauth1/ssoTokens/generateandoauth1/ssoTokens/consumeare added under thesdk.auth.oauth1scope. More info
Changes
Calls not needing authentication are now correctly skipping this
sdk.users.createAccount();
sdk.users.requestPasswordReset();
sdk.users.requestEmailActivation();
sdk.users.isEmailAvailable();[v5.0.0]
Breaking Changes
The payments services has had some refactoring.
- sdk.payments.subscriptions.getEntitlements();
- sdk.payments.subscriptions.getEvents();
+ sdk.payments.subscriptions.entitlements.find();
+ sdk.payments.subscriptions.events.find();- sdk.payments.appStoreSubscriptions.getSubscriptions();
- sdk.payments.appStoreSubscriptions.getSubscriptionsProducts();
+ sdk.payments.appStoreSubscriptioons.subscriptions.find();
+ sdk.payments.appStoreSubscriptioons.products.find();
- sdk.payments.appStoreSubscriptions.createSubscriptionsProduct();
- sdk.payments.appStoreSubscriptions.removeSubscriptionsProduct();
- sdk.payments.appStoreSubscriptions.updateSubscriptionsProduct();
+ sdk.payments.appStoreSubscriptions.products.create();
+ sdk.payments.appStoreSubscriptions.products.remove();
+ sdk.payments.appStoreSubscriptions.products.update();Added
parseGlobalPermissionsis a function to parse strings are return valid permissions
Changed
userIdgetter on theOAuthClientinterface now returns aPromise<string>in stead ofstring. You can access this onsdk.raw.userId
[v4.5.0]
Added
services that have a
findAllmethod now also havefindAllIterator.
const iterator = sdk.data.documents.findAllIterator('5a9552adcfd7f200016728d5');
for await (const page of iterator) {
console.log(page); /* PagedResult<Document> */
}sdk.data.schemas,sdk.data.documentsandsdk.data.usershave had changes to theirfindfunction. This now returns the current value with two added functionsnext()andprevious()which can be used to easily traverse the data.
const users = await sdk.users.find();
console.log('users,', users.page); // { total: 8268, offset: 0, limit: 20 }
console.log((await users.next()).page); // { total: 8268, offset: 20, limit: 20 }
console.log((await users.next()).page); // { total: 8268, offset: 40, limit: 20 }
console.log((await users.next()).page); // { total: 8268, offset: 60, limit: 20 }
console.log((await users.previous()).page); // { total: 8268, offset: 40, limit: 20 }rqlParser accepts a regular string which will be checked using the parser function and returns a valid RQLString.
Changes
added
endTimestampto list of fieldnames that are parsed at DaterqlBuilder now supports the
excludesoperatorseveral examples had updates to reflect proper usage
[v4.4.0]
Changes
Fixed
sdk.files.createoptions types. See #352
-options?: OptionsBase & { tags: [] }
+options?: OptionsBase & { tags: string[] }JSDoc for
rqlBuilder().contains. See #351GET requests returning a 500 status will be retried 4 more times at 300ms intervals. To disable this behaviour add
shouldRetry: falseto the options parameter. See #373findAllfunction added on users and data.documents. See #333
[v4.3.0]
Changes
OAuth2
authenticatereturnstokenData.OAuth2
authenticatecan now be used with an authorization code. See Docs.OAuth2 supports confidentials applications.
const sdk = createClient({
host: 'https://api.sandbox.extrahorizon.io',
clientId: '',
clientSecret: '',
});[v4.2.1]
Changes
removed console.log in
sdk.data.documents.findfunction
[v4.2.0]
Added
Fixed documentation tables
OAuth1
authenticatereturnstokenDataUpdated documentation on SSL pinning
Add
logoutfunction tosdk.authUpdated installation instructions
Add
findAlltosdk.data.schemasClient creation allows for extra headers which will be set on every call.
const sdk = createClient({
host: 'https://api.sandbox.extrahorizon.io',
clientId: '',
headers: {
'X-Forwarded-Application': 'test',
},
});Functions now accept options to set custom headers
await sdk.data.documents.create(
'5f3511c7e9ae42283ae2eb29',
{
model: 'string',
},
{ gzip: true, headers: { 'x-test': 'test' } }
);[v4.1.0]
Added
Added missing permissions
Added findFirst method in users service
Changes
Fixed bug to show a clear error when the user is not authenticated
Fixed documentation format
Updated README installation
[v4.0.0]
Breaking Changes
Updated rql parameter type. Is always
rql: RQLStringnow. 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
deletetoremoveand all of them returningAffectedRecordsRenamed all methods from
deleteFieldstoremoveFields
[3.2.0]
Added
Localizations Service
Profiles Service
Notifications Service
optional
skipTokenCheckparameter to Oauth1 authentication flow with token/tokenSecret.Events Service
Changes
Fixed return types of
sdk.users.getStaffandsdk.users.getPatientsUpdated docs links
updateProfileImagemethod is deprecatedGzip option
sdk.data.documents.create
await sdk.data.documents.create('schemaId', document, {
gzip: true,
});[3.1.0]
Breaking Changes
sdk.files.createsignature has changed.
- sdk.files.create({name: 'test.pdf', file: file, extension: 'pdf', tags: ['tag']);
+ sdk.files.create('test.pdf', file, {tags: ['tag]})Custom Document no longer need to extend from DocumentBase. You can just pass in the type for
data
- interface CustomDocument extends DocumentBase {
- data: {
- ppg: Number[];
- location: {
- longitude: Number;
- latitude: Number;
- };
- };
- }
- const document = await sdk.data.documents.find<CustomDocument>();
+ interface MyData {
+ data: {
+ ppg: Number[];
+ location: {
+ longitude: Number;
+ latitude: Number;
+ };
+ };
+ }
+ const document = await sdk.data.documents.find<MyData>();Added
sdk.files.createFromTextwhere you can pass in your text directly.
await sdk.files.createFromText('this-is-a-string');Added
transitionsByNamegetter to easily get the transition you need.
const {
data: [schema],
} = await sdk.data.schemas.find();
const transition = schema.transitionsByName.lambda_to_review;Added
findTransitionIdByNamefunction onschemaobjects to easily find the transitionId you need.
const {
data: [schema],
} = await sdk.data.schemas.find();
const transitionId = schema.findTransitionIdByName('lambda_to_review');Added
findById,findByNameandfindFirsthelpers to services having a genericfindfunction.Payments Service
Added
or,andandcontainsoperators to the RQL builder.
[3.0.2]
Breaking Changes
apiHosthas been renamed tohostand should not include the protocol orapisubdomain. Example `
+ const sdk = createClient({
+ host: 'sandbox.extrahorizon.io',
+ consumerKey: '',
+ consumerSecret: '',
+ });clientis renamed tocreateClient
- import { client } from '@extrahorizon/javascript-sdk';
+ import { createClient } from '@extrahorizon/javascript-sdk';rawAxiosis renamed toraw
Added
createOAuth1ClientandcreateOAuth2Clientare now exported as more specifically typed versions ofcreateClientAdditional http header is added with every request. Which includes the package version and when running in node the node version.
Added Test Reports
getMockSdkfunction to get back a mocked SDK. See README for more info
Changes
Templates
resolveAsPdfwill return aBuffersdk.authenticatenow includes possible error responses in the JSDoc annotationsrqlBuildernow has JSDoc annotationsFix for results with arrays containing strings
File creation now correctly set the file name on the form-data. Accepts extra parameter
extensionwhich defaults topdfThe MailsService now correctly decamelizes the keys in the request
[3.0.1]
Changes
Templates basepath fix
[3.0.0]
Breaking Changes
Services scoping:
auth: {
- createApplication(),
- getApplications(),
- updateApplication(),
- deleteApplication(),
- createApplicationVersion(),
- deleteApplicationVersion(),
+ applications: {
+ create(),
+ get(),
+ update(),
+ delete(),
+ createVersion(),
+ deleteVersion(),
+ },
- createOauth2Authorization(),
- getOauth2Authorizations(),
- deleteOauth2Authorization(),
+ oauth2: {
+ createAuthorization(),
+ getAuthorizations(),
+ deleteAuthorization()
+ },
- getMfaSetting(),
- enableMfa(),
- disableMfa(),
- addMfaSetting(),
- confirmMfaMethodVerification(),
- removeMfaMethod(),
+ users: {
+ getMfaSetting(),
+ enableMfa(),
+ disableMfa(),
+ addMfaSetting(),
+ confirmMfaMethodVerification(),
+ removeMfaMethod()
+ }
},
data: {
- createSchema(),
- updateSchema(),
- deleteSchema(),
- enableSchema(),
- disableSchema(),
+ schemas: {
+ create(),
+ find(),
+ update(),
+ delete(),
+ enable(),
+ disable(),
+ },
- createIndex(),
- deleteIndex(),
+ indexes: {
+ create(),
+ delete(),
+ },
- createStatus(),
- updateStatus(),
- deleteStatus(),
+ statuses: {
+ create(),
+ update(),
+ delete(),
+ },
- createProperty(),
- deleteProperty(),
- updateProperty(),
+ properties: {
+ create(),
+ update(),
+ delete(),
+ },
- createComment(),
- findComments(),
- updateComment(),
- deleteComment(),
+ comments: {
+ create(),
+ find(),
+ update(),
+ delete(),
+ },
- createDocument(),
- findDocuments(),
- updateDocument(),
- deleteDocument(),
- deleteFieldsFromDocument(),
- transitionDocument(),
- linkGroupsToDocument(),
- unlinkGroupsFromDocument(),
- linkUsersToDocument(),
- unlinkUsersFromDocument(),
+ documents: {
+ create(),
+ find(),
+ update(),
+ delete(),
+ deleteFields(),
+ transition(),
+ linkGroups(),
+ unlinkGroups(),
+ linkUsers(),
+ unlinkUsers(),
+ },
- updateCreationTransition(),
- createTransition(),
- updateTransition(),
- deleteTransition()
+ transitions: {
+ updateCreation(),
+ create(),
+ update(),
+ delete(),
+ }
},
files: {
- createFile(),
- deleteFile(),
- retrieveFile(),
- retrieveFileStream(),
- getFileDetails(),
+ create(),
+ delete(),
+ retrieve(),
+ retrieveStream(),
+ getDetails(),
},
tasks: {
- createTask(),
- cancelTask(),
+ create(),
+ cancel(),
},
users: {
- getPermissions(),
- getRoles(),
- createRole(),
- deleteRole(),
- updateRole(),
- addPermissionsToRole(),
- removePermissionsFromRole(),
- addRolesToUsers(),
- removeRolesFromUsers(),
+ globalRoles: {
+ getPermissions(),
+ get(),
+ create(),
+ delete(),
+ update(),
+ addPermissions(),
+ removePermissions(),
+ addToUsers(),
+ removeFromUsers(),
+ },
- getGroupsPermissions(),
- getGroupsRoles(),
- addRoleToGroup(),
- updateGroupsRole(),
- removeRoleFromGroup(),
- addPermissionsToGroupRoles(),
- removePermissionsFromGroupRoles(),
- assignRolesToStaff(),
- removeRolesFromStaff(),
- addUsersToStaff(),
- removeUsersFromStaff(),
+ groupRoles: {
+ getPermissions(),
+ get(),
+ addRole(),
+ update(),
+ removeRole(),
+ addPermissions(),
+ removePermissions(),
+ assignToStaff(),
+ removeFromStaff(),
+ addUsersToStaff(),
+ removeUsersFromStaff(),
+ },
}Added
Configurations Service
Dispatchers Service
Mails Service
Templates Service
Changes
Types are now exposed within modules, so the usage will be:
import type { FilesServicesTypes: { CreateFile } } from "@extrahorizon/javascript-sdk";
const inputFile: CreateFile = {}Error now not only extend from the
ApiErrorclass but also from their respective HTTP error code error. Possible errors are400:
BadRequestError401:
UnauthorizedError403:
ForbiddenError404:
NotFoundError500:
ServerError
PagedResults are now using generics
Every merge into dev will create a tag and package with the current version number suffixed with
-dev.Xwhere X auto-incrementsRemoved
* @throws {ApiError}in JSDoc comments, only specific errors are mentioned when mentioned in the Swagger documentation
[2.0.0] - 2021-05-12
Breaking changes
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
const sdk = client({
apiHost: '',
+ clientId: '',
});
await sdk.authenticate({
- clientId: '',
password: '',
username: ''
});OAuth1
const sdk = client({
apiHost: '',
+ consumerKey: '',
+ consumerSecret: '',
});
await sdk.authenticate({
- consumerKey: '',
- consumerSecret: '',
password: '',
email: ''
});Changes
Removed
queryfrom list resultsPartialUserDatais renamed toUserChanges to the
UserDatainterfacelanguagetype is changed fromstringtoLanguageCodetimeZonetype is changed fromstringtoTimeZonelastFailedTimestamptype is changed fromnumbertoDateadded
creationTimestampandupdateTimestamp
Change to the
RegisterUserDatainterfacephoneNumberis now required
[1.0.1] - 2021-05-05
Changes
Correctly exporting all the possible errors.
[1.0.0] - 2021-05-05
Breaking changes
Optional paramaters are now grouped in an options object as last parameters.
- await sdk.tasks.find(rql);
+ await sdk.tasks.find({ rql });- await sdk.users.getGroupsRoles(groupId, rql);
+ await sdk.tasks.getGroupsRoles(groupId, { rql });Added
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);endpointThe SDK also expose JSON-schema interface you can use to compose your own
Changes
OAuth1 token/tokenSecret flow is implemented.
Functions expecting an RQL should now show a more clear error when passing in a regular string.
[0.0.7] - 2021-04-28
Breaking changes
The authenticate and confirmMfa methods have been scoped under the auth namespace.
-await sdk.authenticate({ refreshToken: '' });
+await sdk.auth.authenticate({ refreshToken: '' });Certains methods under the users namespace have had their name changed.
-sdk.user.mfaDisable
+sdk.user.disableMfa
-sdk.user.mfaEnable
+sdk.user.enableMfa
-sdk.user.mfaSetting
+sdk.user.getMfaSetting
-sdk.user.mfaAddMethod
+sdk.user.addMfaMethod
-sdk.user.mfaMethodConfirmVerification
+sdk.user.confirmMfaMethodVerification
-sdk.user.mfaRemoveMethod
+sdk.user.removeMfaMethodRemoved debug option. Use responseLogger and requestLogger options in stead. See README for example.
-const sdk = client({
- apiHost: '',
- debug: true
-});
+import AxiosLogger from "axios-logger";
+
+const sdk = client({
+ apiHost: '',
+ requestLogger: AxiosLogger.requestLogger,
+ responseLogger: AxiosLogger.responseLogger
+});Added
Tasks Service
Data Service now includes:
Schemas Service
Properties Service
Statuses Service
Indexes Service
[0.0.6] - 2021-04-21
Breaking changes
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.
-const sdk = client({
- apiHost: '',
- oauth: {
- clientId: '',
- password: '',
- username: '',
- },
-});
+const sdk = client({
+ apiHost: '',
+});
+
+await sdk.authenticate({
+ clientId: '',
+ password: '',
+ username: ''
+});Added
Multi-factor authentication via (authenticate / confirmMfa functions).
freshTokensCallbackoption when creating the client. Pass in a function to retrieve the response when new tokens are received.OAuth2 Refresh Token Grant flow.
filesservice.dataservice: only to create a schema at the moment.
Changes
Functions that accept an RQL parameter no longer accepts regular string, but expect the output of and rqlBuilder -> build().
ApiErrornow extends the built-inError.Some functions allowed empty
requestBodywhich was incorrect in some cases, these have been fixed as well.
Last updated