@extrahorizon/javascript-sdk 8.2.0-test → 8.2.1-dev-48-41fd1f1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. package/CHANGELOG.md +1177 -1161
  2. package/README.md +108 -119
  3. package/build/index.cjs.js +1 -1
  4. package/build/index.mjs +1 -1
  5. package/build/types/btoa.d.ts +6 -6
  6. package/build/types/client.d.ts +136 -136
  7. package/build/types/constants.d.ts +15 -15
  8. package/build/types/errorHandler.d.ts +2 -2
  9. package/build/types/errors.d.ts +332 -332
  10. package/build/types/http/client.d.ts +2 -2
  11. package/build/types/http/index.d.ts +4 -4
  12. package/build/types/http/interceptors.d.ts +9 -9
  13. package/build/types/http/oAuth1Signature.d.ts +14 -14
  14. package/build/types/http/oauth1.d.ts +3 -3
  15. package/build/types/http/oauth2.d.ts +3 -3
  16. package/build/types/http/proxy.d.ts +3 -3
  17. package/build/types/http/types.d.ts +331 -331
  18. package/build/types/http/utils.d.ts +21 -21
  19. package/build/types/index.d.ts +9 -9
  20. package/build/types/mock.d.ts +43 -43
  21. package/build/types/mockType.d.ts +1547 -1511
  22. package/build/types/parseStoredCredentials.d.ts +11 -11
  23. package/build/types/rql/index.d.ts +16 -16
  24. package/build/types/rql/parser.d.ts +1 -1
  25. package/build/types/rql/types.d.ts +168 -168
  26. package/build/types/services/auth/applications/index.d.ts +5 -5
  27. package/build/types/services/auth/applications/types.d.ts +260 -190
  28. package/build/types/services/auth/index.d.ts +3 -3
  29. package/build/types/services/auth/oauth1/index.d.ts +5 -5
  30. package/build/types/services/auth/oauth1/types.d.ts +63 -63
  31. package/build/types/services/auth/oauth2/index.d.ts +5 -5
  32. package/build/types/services/auth/oauth2/types.d.ts +52 -52
  33. package/build/types/services/auth/oidc/index.d.ts +5 -5
  34. package/build/types/services/auth/oidc/loginAttempts/index.d.ts +5 -5
  35. package/build/types/services/auth/oidc/loginAttempts/types.d.ts +67 -67
  36. package/build/types/services/auth/oidc/providers/index.d.ts +5 -5
  37. package/build/types/services/auth/oidc/providers/types.d.ts +144 -144
  38. package/build/types/services/auth/oidc/types.d.ts +40 -40
  39. package/build/types/services/auth/types.d.ts +39 -39
  40. package/build/types/services/auth/users/index.d.ts +5 -5
  41. package/build/types/services/auth/users/types.d.ts +121 -121
  42. package/build/types/services/configurations/general.d.ts +5 -5
  43. package/build/types/services/configurations/groups.d.ts +5 -5
  44. package/build/types/services/configurations/index.d.ts +10 -10
  45. package/build/types/services/configurations/patients.d.ts +5 -5
  46. package/build/types/services/configurations/staff.d.ts +5 -5
  47. package/build/types/services/configurations/types.d.ts +222 -222
  48. package/build/types/services/configurations/users.d.ts +5 -5
  49. package/build/types/services/data/comments.d.ts +5 -5
  50. package/build/types/services/data/documents.d.ts +5 -5
  51. package/build/types/services/data/index.d.ts +13 -13
  52. package/build/types/services/data/indexes.d.ts +5 -5
  53. package/build/types/services/data/infrastructure.d.ts +10 -10
  54. package/build/types/services/data/json-schema.d.ts +121 -121
  55. package/build/types/services/data/properties.d.ts +5 -5
  56. package/build/types/services/data/schemas.d.ts +5 -5
  57. package/build/types/services/data/statuses.d.ts +5 -5
  58. package/build/types/services/data/transitions.d.ts +5 -5
  59. package/build/types/services/data/types.d.ts +899 -899
  60. package/build/types/services/dispatchers/actions/index.d.ts +5 -5
  61. package/build/types/services/dispatchers/actions/types.d.ts +78 -78
  62. package/build/types/services/dispatchers/dispatchers/index.d.ts +5 -5
  63. package/build/types/services/dispatchers/dispatchers/types.d.ts +111 -111
  64. package/build/types/services/dispatchers/index.d.ts +7 -7
  65. package/build/types/services/dispatchers/types.d.ts +2 -2
  66. package/build/types/services/events/events.d.ts +5 -5
  67. package/build/types/services/events/health.d.ts +9 -9
  68. package/build/types/services/events/index.d.ts +6 -6
  69. package/build/types/services/events/subscriptions.d.ts +5 -5
  70. package/build/types/services/events/types.d.ts +90 -90
  71. package/build/types/services/files/files.d.ts +5 -5
  72. package/build/types/services/files/formHelpers.d.ts +3 -3
  73. package/build/types/services/files/index.d.ts +6 -6
  74. package/build/types/services/files/settings/index.d.ts +5 -5
  75. package/build/types/services/files/settings/types.d.ts +38 -38
  76. package/build/types/services/files/tokens.d.ts +5 -5
  77. package/build/types/services/files/types.d.ts +185 -185
  78. package/build/types/services/helpers.d.ts +7 -7
  79. package/build/types/services/http-client.d.ts +22 -22
  80. package/build/types/services/index.d.ts +15 -15
  81. package/build/types/services/localizations/countries.d.ts +5 -5
  82. package/build/types/services/localizations/health.d.ts +9 -9
  83. package/build/types/services/localizations/index.d.ts +4 -4
  84. package/build/types/services/localizations/languages.d.ts +5 -5
  85. package/build/types/services/localizations/localizations.d.ts +5 -5
  86. package/build/types/services/localizations/types.d.ts +145 -145
  87. package/build/types/services/logs/access/index.d.ts +5 -5
  88. package/build/types/services/logs/access/types.d.ts +41 -41
  89. package/build/types/services/logs/index.d.ts +3 -3
  90. package/build/types/services/logs/types.d.ts +4 -4
  91. package/build/types/services/mails/index.d.ts +3 -3
  92. package/build/types/services/mails/mails.d.ts +5 -5
  93. package/build/types/services/mails/types.d.ts +141 -141
  94. package/build/types/services/notifications/health.d.ts +9 -9
  95. package/build/types/services/notifications/index.d.ts +7 -7
  96. package/build/types/services/notifications/notifications.d.ts +5 -5
  97. package/build/types/services/notifications/settings.d.ts +5 -5
  98. package/build/types/services/notifications/types.d.ts +222 -222
  99. package/build/types/services/payments/appStore.d.ts +5 -5
  100. package/build/types/services/payments/appStoreSubscriptions.d.ts +5 -5
  101. package/build/types/services/payments/health.d.ts +9 -9
  102. package/build/types/services/payments/index.d.ts +15 -15
  103. package/build/types/services/payments/orders.d.ts +5 -5
  104. package/build/types/services/payments/playStore.d.ts +5 -5
  105. package/build/types/services/payments/playStoreHistory.d.ts +5 -5
  106. package/build/types/services/payments/playStoreSubscriptions.d.ts +5 -5
  107. package/build/types/services/payments/products.d.ts +5 -5
  108. package/build/types/services/payments/stripe.d.ts +5 -5
  109. package/build/types/services/payments/subscriptions.d.ts +5 -5
  110. package/build/types/services/payments/types.d.ts +1189 -1189
  111. package/build/types/services/profiles/groups.d.ts +5 -5
  112. package/build/types/services/profiles/health.d.ts +9 -9
  113. package/build/types/services/profiles/index.d.ts +9 -9
  114. package/build/types/services/profiles/logs.d.ts +5 -5
  115. package/build/types/services/profiles/profiles.d.ts +5 -5
  116. package/build/types/services/profiles/types.d.ts +370 -369
  117. package/build/types/services/tasks/api/index.d.ts +5 -5
  118. package/build/types/services/tasks/api/types.d.ts +146 -146
  119. package/build/types/services/tasks/apiRequests/index.d.ts +5 -5
  120. package/build/types/services/tasks/apiRequests/logs/index.d.ts +5 -5
  121. package/build/types/services/tasks/apiRequests/logs/types.d.ts +25 -25
  122. package/build/types/services/tasks/apiRequests/types.d.ts +83 -83
  123. package/build/types/services/tasks/functions/index.d.ts +5 -5
  124. package/build/types/services/tasks/functions/types.d.ts +27 -27
  125. package/build/types/services/tasks/index.d.ts +15 -15
  126. package/build/types/services/tasks/logs/index.d.ts +5 -5
  127. package/build/types/services/tasks/logs/types.d.ts +28 -28
  128. package/build/types/services/tasks/schedules/index.d.ts +5 -5
  129. package/build/types/services/tasks/schedules/types.d.ts +88 -88
  130. package/build/types/services/tasks/tasks.d.ts +5 -5
  131. package/build/types/services/tasks/types.d.ts +107 -107
  132. package/build/types/services/templates/index.d.ts +3 -3
  133. package/build/types/services/templates/templates.d.ts +5 -5
  134. package/build/types/services/templates/types.d.ts +202 -202
  135. package/build/types/services/types.d.ts +77 -77
  136. package/build/types/services/users/activationRequests/index.d.ts +4 -4
  137. package/build/types/services/users/activationRequests/types.d.ts +70 -70
  138. package/build/types/services/users/forgotPasswordRequests/index.d.ts +4 -4
  139. package/build/types/services/users/forgotPasswordRequests/types.d.ts +70 -70
  140. package/build/types/services/users/globalRoles.d.ts +5 -5
  141. package/build/types/services/users/groupRoles.d.ts +5 -5
  142. package/build/types/services/users/health.d.ts +9 -9
  143. package/build/types/services/users/index.d.ts +16 -16
  144. package/build/types/services/users/settings/index.d.ts +4 -4
  145. package/build/types/services/users/settings/types.d.ts +47 -47
  146. package/build/types/services/users/types.d.ts +1116 -1055
  147. package/build/types/services/users/users.d.ts +5 -5
  148. package/build/types/sha1.d.ts +11 -11
  149. package/build/types/types.d.ts +102 -102
  150. package/build/types/utils.d.ts +4 -4
  151. package/build/types/version.d.ts +1 -1
  152. package/package.json +62 -57
package/CHANGELOG.md CHANGED
@@ -1,1161 +1,1177 @@
1
- # Changelog
2
-
3
- All notable changes to this project will be documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
- and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
-
8
- ## [8.2.0]
9
-
10
- ### Added
11
- - `MfaRequiredError` now exposes a typed `mfa` property to complete the MFA flow type safe
12
-
13
- ### Changed
14
- - All runtime dependencies are now pinned to their specific version
15
- - `axios` updated to `0.28.1`
16
- - `fflate` updated to `0.8.2`
17
- - `typescript-json-decoder` updated to `1.0.11`
18
- - `qs` updated to `6.12.0`
19
- - Removed the dependency on `ts-toolbelt` as it was no longer required
20
-
21
- ### Fixed
22
- - Using an oAuth2 confidential client on web no longer causes a `global not defined` error
23
- - `exh.files.create` and `exh.files.createFromText` now work correctly while using oAuth1 in React Native
24
- - The generic `API_ERROR` name is no longer shown for errors with more specific information available
25
- - Type corrections for the user, profile, file, index and mfa entities
26
- - Corrected the places where the name of a schema can also be used rather than just the id
27
- - The `groupIds` for `exh.data.documents.unlinkGroups` is now correctly marked as optional
28
- - Corrected the permission mentioned for `exh.users.groupRoles.removeUsersFromStaff`
29
-
30
- ## [8.1.1]
31
-
32
- ### Fixed
33
- - Pinned the `qs` version because of breaking changes in their latest release for our oAuth1 signature generation
34
-
35
- ## [8.1.0]
36
-
37
- ### Changed
38
-
39
- - `exh.users.createAccount` and `exh.users.updateEmail`:
40
- - Now accept an `activationMode` field
41
- - After enabling in the verification settings, this field can be set to use the pin code mode
42
- - `exh.users.requestEmailActivation` and `exh.users.requestPasswordReset`:
43
- - Alternatively now also accept an object with an `email` and `mode` field
44
- - After enabling in the verification settings, the `mode` field can be set to use the pin code mode
45
- - Additional errors are thrown when request limiting is enabled via the verification settings
46
- - `exh.users.validatePasswordReset` and `exh.users.validateEmailActivation`:
47
- - Alternatively now also accept an `email` and `pinCode` field
48
- - Additional errors are thrown when using the pin code mode
49
- - `exh.users.getEmailTemplates` and `exh.users.setEmailTemplates` now support the new pin code email templates:
50
- - `oidcUnlinkPinEmailTemplateId`
51
- - `activationPinEmailTemplateId`
52
- - `reactivationPinEmailTemplateId`
53
- - `passwordResetPinEmailTemplateId`
54
- - Improved oAuth2 access token refreshing
55
- - If the SDK is able to estimate the expiry time of an access token, the token is refreshed before it expires
56
- - This done just before a request is about to made, preventing the extra request to just receive an expired token error
57
- - Tokens received from the `exh.auth.authenticate` method, next to `expiresIn`, now also include an `creationTimestamp` field
58
- - `createClient` and `createOAuth2Client` now accept an `expiresIn` and `creationTimestamp` field
59
-
60
- ### Added
61
-
62
- - Methods to work with the activation requests:
63
- - `exh.users.activationRequests.find`
64
- - `exh.users.activationRequests.findFirst`
65
- - `exh.users.activationRequests.findById`
66
- - `exh.users.activationRequests.findByUserId`
67
- - `exh.users.activationRequests.remove`
68
- - Methods to work with the forgot password requests:
69
- - `exh.users.forgotPasswordRequests.find`
70
- - `exh.users.forgotPasswordRequests.findFirst`
71
- - `exh.users.forgotPasswordRequests.findById`
72
- - `exh.users.forgotPasswordRequests.findByUserId`
73
- - `exh.users.forgotPasswordRequests.remove`
74
- - Methods to work with the user verification settings:
75
- - `exh.users.settings.getVerificationSettings`
76
- - `exh.users.settings.updateVerificationSettings`
77
-
78
- ### Fixed
79
-
80
- - `exh.auth.applications.deleteVersion` now calls the correct endpoint
81
- - Automatic oAuth2 access token refreshing now properly uses client credentials
82
- - Optional fields for `exh.auth.users.addMfaMethod` are now correctly marked as optional
83
- - The return value of `exh.users.changePassword` is now correctly typed as a boolean
84
- - Corrected the `VIEW_API_FUNCTION_REQUEST_LOGS` permission name mentioned in the inline documentation
85
- - The `statuses` field of the data service `Schema` entity is now typed correctly
86
-
87
- ## [8.0.0]
88
-
89
- ### Changed
90
- - **Breaking Change:** RQL values are now [double encoded](https://docs.extrahorizon.com/extrahorizon/additional-resources/resource-query-language-rql#double-encoding-of-special-characters) by default when using the RQL builder
91
- - Disable double encoding for all RQL operations with `rqlBuilder.doubleEncodeValues = false`
92
- - Disable double encoding for a single RQL operation `rqlBuilder({ doubleEncodeValues: false }).eq(name, '< value >').build()`
93
- - Please consult the [Migration Guide](https://github.com/ExtraHorizon/javascript-sdk/blob/dev/MIGRATING_TO_V8.0.0.MD) for more information
94
- - **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.
95
- - 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 })`
96
- - 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 });`
97
- - Please consult the [Migration Guide](https://github.com/ExtraHorizon/javascript-sdk/blob/dev/MIGRATING_TO_V8.0.0.MD) for more information
98
- - **Breaking Change:** For all unauthenticated methods the response will now undergo the same transformation steps as any other request.
99
- - The timestamps previously returned as strings are now converted to date objects in `exh.auth.authenticate`, `exh.auth.confirmMfa` and`exh.users.createAccount`.
100
- - Please consult the [Migration Guide](https://github.com/ExtraHorizon/javascript-sdk/blob/dev/MIGRATING_TO_V8.0.0.MD) for more information
101
- - New implementation of the hashing for oAuth1 signature generation
102
- - This change is not expected to have any impact on the SDK usage
103
-
104
- ### Bug Fixes
105
- - In the `TokenDataOauth1` interface `updateTimeStamp` is changed to `updateTimestamp`
106
- - `timeZone` is now accepted as a valid parameter for the resolve functions in the template service
107
-
108
-
109
- ## [v7.8.0]
110
-
111
- ### Changed
112
- - New implementation of the oAuth1 signature generation to support double Encoding of RQL values in `OAuth1` clients
113
-
114
- ## [v7.7.0]
115
-
116
- ### Added
117
- - Functionality to allow the [double encoding](https://docs.extrahorizon.com/extrahorizon/additional-resources/resource-query-language-rql#double-encoding-of-special-characters) of values when using the RQL builder
118
- - Enable double encoding for all RQL operations with `rqlBuilder.doubleEncodeValues = true`
119
- - Enable double encoding for a single RQL operation `rqlBuilder({ doubleEncodeValues: true }).eq(name, '< value >').build()`
120
- - When enabling double encoded values ensure that instances of encoding values for the rql builder such as `encodeURIComponent()` are removed
121
- - Double Encoding of RQL values is currently only supported in `OAuth2` clients and will come to `OAuth1` clients at a later date.
122
-
123
-
124
- - A skip count operator to the rql builder `rqlBuilder().eq(name, '< value >').skipCount().build()`
125
- - 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.
126
- - The skip count operator is currently supported in [select services](https://docs.extrahorizon.com/extrahorizon/additional-resources/resource-query-language-rql#services-with-the-skip-count-rql-operator), and efforts are underway to make it available for all services.
127
-
128
- ### Fixed
129
- - Documentation for an incorrect permission value of `exh.users.globalRoles.addPermissions()`
130
- - `REMOVE_ROLE_PERMISSIONS` to `REMOVE_ROLE_PERMISSION`
131
-
132
- ## [v7.6.0]
133
-
134
- ### Added
135
- - `findAll`, `findAllIterator` and `update` methods to the Dispatcher service
136
-
137
- ### Improvements
138
- - Updated types and documentation for the Dispatcher service
139
- - Exported the missing `RQLString` type
140
-
141
- ## [v7.5.1]
142
-
143
- ### Added
144
- - Type support React Native form data
145
-
146
- ### Fixes
147
- - Bumped Axios version to fix content-type header issue
148
- - Fixed `onUploadProgress` callback event triggering without a provided function
149
- - Removed discrimination between node and web environments
150
-
151
- ## [v7.5.0]
152
-
153
- ### Added
154
-
155
- - Support for File Service settings:
156
- - File Service [settings](https://docs.extrahorizon.com/extrahorizon/services/manage-data/file-service#settings) may now be managed using methods found in:
157
- - `exh.files.settings`
158
-
159
- ## [v7.4.1]
160
-
161
- ### Fixes
162
-
163
- - Correctly export the interfaces of the tasks component
164
-
165
- ## [v7.4.0]
166
-
167
- ### Added
168
-
169
- - Support for API Functions:
170
- - An [API Function](https://docs.extrahorizon.com/extrahorizon/services/automation/task-service/api-functions) may now be executed using methods found in:
171
- - `exh.tasks.api`
172
- - [API Requests](https://docs.extrahorizon.com/extrahorizon/services/automation/task-service/api-functions#api-requests) produced by executing API Functions are accessible using methods found in:
173
- - `exh.tasks.apiRequests`
174
- - [API Request Logs](https://docs.extrahorizon.com/extrahorizon/services/automation/task-service/api-functions#api-request-logs) produced during the execution of an API Function can be accessed using methods found in:
175
- - `exh.tasks.apiRequests.logs`
176
-
177
-
178
- - A Function may now be directly executed as a task using the method:
179
- - `exh.tasks.functions.execute()`
180
-
181
-
182
- - Support for Tasks
183
- - Task Schedules may now be managed using methods found in:
184
- - `exh.tasks.schedules`
185
- - Task Logs produced during the execution of a task can now be accessed using methods found in:
186
- - `exh.tasks.logs`
187
-
188
-
189
- - Monitoring File Uploads
190
- - The SDK now supports [monitoring file uploads](https://docs.extrahorizon.com/extrahorizon/services/manage-data/file-service#monitoring-a-file-upload) in the browser using a callback function.
191
- ```js
192
- function uploadProgressCallback(event) {
193
- const progress = (event.loaded / event.total) * 100;
194
- // ... Do something with the progress value
195
- }
196
-
197
- const fileMetaData = await exh.files.create('myReport.pdf', myBuffer, {
198
- onUploadProgress: uploadProgressCallback,
199
- tags: ['ecg-report']
200
- });
201
- ```
202
-
203
- ### Changed
204
-
205
- - `VIEW_GROUPS` permission value is changed to the correct `VIEW_GROUP`
206
- - `ADD_ROLE_PERMISSION` is now described correctly as singular in the inline documentation
207
- - Updated `RegisterUserData` interface optional fields
208
-
209
- ## [v7.3.0]
210
-
211
- ### Added
212
-
213
- - Support for OpenID Connect
214
- - OAuth 2 clients now allow users to authenticate themselves with OpenID connect. See:
215
- - `exh.auth.generateOidcAuthenticationUrl()`
216
- - `exh.auth.authenticateWithOidc()`
217
- - Manage your OpenID Connect configuration via new methods found in:
218
- - `exh.auth.oidc`
219
- - `exh.auth.oidc.providers`
220
- - `exh.auth.oidc.loginAttempts`
221
- - Methods to manage the User Service email templates:
222
- - `exh.users.getEmailTemplates()`
223
- - `exh.users.setEmailTemplates()`
224
- - While creating an oAuth1 client both `token` and `tokenSecret` can now be supplied.
225
- In which case there is no need for an extra `exh.auth.authenticate` call.
226
-
227
- ```ts
228
- const exh = createClient({
229
- host: 'https://api.example.extrahorizon.io',
230
- consumerKey: 'cf29b211b5030202ffce5b2510759d0a53ea5b17',
231
- consumerSecret: '9bd34e19b5e1714e2c57ae0127d98dd0d0c0b2a2',
232
- token: '409ce9ba49c56cce31b9d2b1b2f5ed5ac01b4011',
233
- tokenSecret: '1cc0b97b4c4721bb6da3d85b80cda8165e6ad5a7',
234
- });
235
-
236
- const currentUser = await exh.users.me();
237
- ```
238
-
239
- - While creating an oAuth2 client both `refreshToken` and `accessToken` can now be supplied.
240
- In which case there is no need for an extra `exh.auth.authenticate` call.
241
-
242
- ```ts
243
- const exh = createClient({
244
- host: 'https://api.example.extrahorizon.io',
245
- clientId: 'f8d9c891c106131bec970c6da05f887dc82eaff7',
246
- refreshToken: 'ca27ada704e5b26a1fca20c130daf4f95f727d3f',
247
- accessToken: '019dc6fe1672176f28e8e894ba99aed1f49656c8',
248
- });
249
-
250
- const currentUser = await exh.users.me();
251
- ```
252
-
253
- ### Changed
254
- - Improved types and inline documentation (JSDoc) for the `exh.auth.applications` section
255
- - More detailed descriptions for the methods
256
- - Descriptions for the fields within the data types we accept and return
257
-
258
- ## [v7.2.1]
259
-
260
- ### Added
261
-
262
- - Support large file uploads
263
-
264
- ### Fixes
265
-
266
- - Task cancellation
267
-
268
- ## [v7.2.0]
269
-
270
- ### Added
271
-
272
- - For API errors the `qName` variable is mapped to the `name` variable, to improve consistency with default errors.
273
-
274
- ### Fixes
275
-
276
- - Corrected the interfaces to be consistent with the API
277
- - Updated dead links in documentation
278
-
279
- ## [v7.1.0]
280
-
281
- ### Added
282
-
283
- - `logout()` can now be performed on a proxy Client
284
- - Tasks now take an optional generic to set the data type
285
- - `userId` is now available on the raw mock
286
-
287
- ### Fixes
288
-
289
- - The return type of `exh.users.update()` is returning the correct `UserData`. See [issue #605](https://github.com/ExtraHorizon/javascript-sdk/issues/605)
290
-
291
- ## [v7.0.0]
292
-
293
- ### Added
294
-
295
- - OAuth1 token management -> `exh.auth.oauth1.getTokens` / `exh.auth.oauth1.removeToken`. See [issue #465](https://github.com/ExtraHorizon/javascript-sdk/issues/465)
296
- - Password policy -> `exh.users.passwordPolicy` and `exh.users.updatePasswordPolicy`
297
- - Extra Playstore endpoint -> `payments.playStoreHistory.purchaseReceipts`
298
- - Extra permissions for the updated task service
299
- - RQL option to several endpoints
300
-
301
- ### Changed
302
-
303
- - Types for the `exh.auth.application.create` and `exh.auth.application.createVersion` have been exported. See Authentication examples for more info.
304
- - Pako to fflate
305
- - Refactored the Schema and Document Types
306
- - Updated the `EnlistmentConfiguration` type. See [issue #596](https://github.com/ExtraHorizon/javascript-sdk/issues/596)
307
-
308
- ### Fixes
309
- - Running `yarn` on windows machines resulted in an error [issue #612](https://github.com/ExtraHorizon/javascript-sdk/issues/612)
310
- - Return type of `exh.auth.application.update` is now correctly typed as `AffectedRecords`
311
-
312
- ### Breaking changes
313
-
314
- - Removed `payments.playStoreHistory.purchases` (deprecated)
315
- - The `contains` and `excludes` endpoints of the rql builder now accepts an array of expressions iso a single string. See [issue #603](https://github.com/ExtraHorizon/javascript-sdk/issues/603)
316
- - The removal of the group roles now has the correct parameters
317
-
318
- ```diff
319
- - exh.users.groupRoles.remove(rql, groupId, roleId, options)
320
- + exh.users.groupRoles.remove(rql, groupId, options)
321
- ```
322
-
323
- ## [v6.1.0]
324
-
325
- ### Breaking changes
326
-
327
- - renamed `createTransaction` to `completeTransaction` on the payments.appStore service
328
-
329
- ```diff
330
- - sdk.payments.appStore.createTransaction
331
- + sdk.payments.appStore.completeTransaction
332
- ```
333
-
334
- ### Changed
335
-
336
- - When passing in `localhost` as host. No prefixing takes places.
337
- - Fixed bug when calling `sdk.files.create` with tags as an array. See [PR #544](https://github.com/ExtraHorizon/javascript-sdk/pull/544)
338
- - Properties on your JSONSchema on the data service will no longer have any automatic date parsing. [PR #546](https://github.com/ExtraHorizon/javascript-sdk/pull/546)
339
- - If you are using the `sdk.raw` instance you can now pass in additional parameters to the http verbs. See [PR #546](https://github.com/ExtraHorizon/javascript-sdk/pull/546)
340
-
341
- ```ts
342
- const result = sdk.raw.get('/files/v1', {
343
- interceptors: {
344
- skipCamelizeResponseData: true, // will recursively rename keys to camelCase
345
- skipTransformResponseData: true, // maps the values of certain keys to Dates
346
- skipTransformKeysResponseData: true, // renames certain keys for consistency
347
- },
348
- });
349
- ```
350
-
351
- - `Profile` type has been revised
352
-
353
- ```diff
354
- -fibricheckInfo?: string;
355
- +fibricheckInfo?: {
356
- + app?: {
357
- + version?: string;
358
- + build?: string;
359
- + branch?: string;
360
- + };
361
- + device?: {
362
- + os?: string;
363
- + model?: string;
364
- + type?: 'android' | 'ios';
365
- + manufacturer?: string;
366
- + };
367
- +};
368
- ```
369
-
370
- - `ProxyClient` existed double. One of those has been renamed to `ProxyInstance`
371
-
372
- ```diff
373
- -export interface ProxyClient extends HttpInstance {
374
- +export interface ProxyInstance extends HttpInstance {
375
- ```
376
-
377
- ## [v6.0.0]
378
-
379
- ### Breaking Changes
380
-
381
- - `sdk.data.documents.create` now accepts 3 generics.
382
-
383
- ```diff
384
- -create<CustomData = null, CustomStatus = null>(
385
- - schemaId: ObjectId,
386
- - requestBody: Record<string, any>,
387
- - options?: OptionsWithRql & { gzip?: boolean }
388
- -): Promise<Document<CustomData, CustomStatus>>;
389
-
390
- +create<InputData = null, OutputData = null, CustomStatus = null>(
391
- + schemaId: ObjectId,
392
- + requestBody: InputData,
393
- + options?: OptionsWithRql & { gzip?: boolean }
394
- +): Promise<Document<OutputData, CustomStatus>>;
395
- ```
396
-
397
- ### Added
398
-
399
- - `sdk.data.documents.update` now accepts a generic for the update type.
400
- - Exported `findAllGeneric` and `findAllIterator` for usage on raw functions
401
- - Better type for `findAllIterator`
402
-
403
- ## [v5.3.1]
404
-
405
- ### Added/Fixed
406
-
407
- - Playstore endpoints can handle rql now
408
-
409
- ## [v5.3.0]
410
-
411
- ### Added
412
-
413
- - There are now 3 mocked exports. `getMockSdkProxy`, `getMockSdkOAuth2` and `getMockSdkOAuth1` with matching types. The `getMockSdk` is also still available and mapped to `getMockSdkOAuth2`.
414
-
415
- ## [v5.2.0]
416
-
417
- ### Added
418
-
419
- - `btoa` function to be used when you are using React-Native in combination with a Confidential Application. See documentation for more info.
420
- - `createOAuth1Client` and `createOAuth2Client` have had their type signatures updated. The `freshTokensCallback` will now have the correct type.
421
- - Updated payments service to reflect v1.2.0 payments REST API
422
- - `createProxyClient` is a new way to initialize the SDK using a proxy service.
423
-
424
- ### Changed
425
-
426
- - `Comment` interface.
427
-
428
- ```diff
429
- - userId
430
- + creatorId
431
- + commentedTimestamp
432
- ```
433
-
434
- - `Document` interface now accepts an optional second parameter for the status property of the document. See [PR #461](https://github.com/ExtraHorizon/javascript-sdk/pull/461)
435
- - Refactor of `userId` getter on the `sdk.raw` instance. It now works consistently everywhere (browser/node/react-native). See [PR #462](https://github.com/ExtraHorizon/javascript-sdk/pull/462)
436
- - Added `findAll` and `findAllIterator` to notifications. The `find` method is also update to have pagination helpers [PR #475](https://github.com/ExtraHorizon/javascript-sdk/pull/475)
437
-
438
- ## [v5.1.0]
439
-
440
- ### Added
441
-
442
- - `oauth1/ssoTokens/generate` and `oauth1/ssoTokens/consume` are added under the `sdk.auth.oauth1` scope. [More info](https://swagger.extrahorizon.com/swagger-ui/?url=https://swagger.extrahorizon.com/auth-service/2.0.4-dev/openapi.yaml#/SSO)
443
-
444
- ### Changes
445
-
446
- - Calls not needing authentication are now correctly skipping this
447
-
448
- ```ts
449
- sdk.users.createAccount();
450
- sdk.users.requestPasswordReset();
451
- sdk.users.requestEmailActivation();
452
- sdk.users.isEmailAvailable();
453
- ```
454
-
455
- ## [v5.0.0]
456
-
457
- ### Breaking Changes
458
-
459
- - The payments services has had some refactoring.
460
-
461
- ```diff
462
- - sdk.payments.subscriptions.getEntitlements();
463
- - sdk.payments.subscriptions.getEvents();
464
- + sdk.payments.subscriptions.entitlements.find();
465
- + sdk.payments.subscriptions.events.find();
466
- ```
467
-
468
- ```diff
469
- - sdk.payments.appStoreSubscriptions.getSubscriptions();
470
- - sdk.payments.appStoreSubscriptions.getSubscriptionsProducts();
471
- + sdk.payments.appStoreSubscriptioons.subscriptions.find();
472
- + sdk.payments.appStoreSubscriptioons.products.find();
473
-
474
- - sdk.payments.appStoreSubscriptions.createSubscriptionsProduct();
475
- - sdk.payments.appStoreSubscriptions.removeSubscriptionsProduct();
476
- - sdk.payments.appStoreSubscriptions.updateSubscriptionsProduct();
477
- + sdk.payments.appStoreSubscriptions.products.create();
478
- + sdk.payments.appStoreSubscriptions.products.remove();
479
- + sdk.payments.appStoreSubscriptions.products.update();
480
- ```
481
-
482
- ### Added
483
-
484
- - `parseGlobalPermissions` is a function to parse strings are return valid permissions
485
-
486
- ### Changed
487
-
488
- - `userId` getter on the `OAuthClient` interface now returns a `Promise<string>` in stead of `string`. You can access this on `sdk.raw.userId`
489
-
490
- ## [v4.5.0]
491
-
492
- ### Added
493
-
494
- - services that have a `findAll` method now also have `findAllIterator`.
495
-
496
- ```ts
497
- const iterator = sdk.data.documents.findAllIterator('5a9552adcfd7f200016728d5');
498
-
499
- for await (const page of iterator) {
500
- console.log(page); /* PagedResult<Document> */
501
- }
502
- ```
503
-
504
- - `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.
505
-
506
- ```ts
507
- const users = await sdk.users.find();
508
-
509
- console.log('users,', users.page); // { total: 8268, offset: 0, limit: 20 }
510
-
511
- console.log((await users.next()).page); // { total: 8268, offset: 20, limit: 20 }
512
- console.log((await users.next()).page); // { total: 8268, offset: 40, limit: 20 }
513
- console.log((await users.next()).page); // { total: 8268, offset: 60, limit: 20 }
514
- console.log((await users.previous()).page); // { total: 8268, offset: 40, limit: 20 }
515
- ```
516
-
517
- - rqlParser accepts a regular string which will be checked using the parser function and returns a valid RQLString.
518
-
519
- ### Changes
520
-
521
- - added `endTimestamp` to list of fieldnames that are parsed at Date
522
- - rqlBuilder now supports the `excludes` operator
523
- - several examples had updates to reflect proper usage
524
-
525
- ## [v4.4.0]
526
-
527
- ### Changes
528
-
529
- - Fixed `sdk.files.create` options types. See #352
530
-
531
- ```diff
532
- -options?: OptionsBase & { tags: [] }
533
- +options?: OptionsBase & { tags: string[] }
534
- ```
535
-
536
- - JSDoc for `rqlBuilder().contains`. See #351
537
-
538
- - 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
539
-
540
- - `findAll` function added on users and data.documents. See #333
541
-
542
- ## [v4.3.0]
543
-
544
- ### Changes
545
-
546
- - OAuth2 `authenticate` returns `tokenData`.
547
- - OAuth2 `authenticate` can now be used with an authorization code. See Docs.
548
- - OAuth2 supports confidentials applications.
549
-
550
- ```ts
551
- const sdk = createClient({
552
- host: 'https://api.sandbox.extrahorizon.io',
553
- clientId: '',
554
- clientSecret: '',
555
- });
556
- ```
557
-
558
- ## [v4.2.1]
559
-
560
- ### Changes
561
-
562
- - removed console.log in `sdk.data.documents.find` function
563
-
564
- ## [v4.2.0]
565
-
566
- ### Added
567
-
568
- - Fixed documentation tables
569
- - OAuth1 `authenticate` returns `tokenData`
570
- - Updated documentation on SSL pinning
571
- - Add `logout` function to `sdk.auth`
572
- - Updated installation instructions
573
- - Add `findAll` to `sdk.data.schemas`
574
- - Client creation allows for extra headers which will be set on every call.
575
-
576
- ```ts
577
- const sdk = createClient({
578
- host: 'https://api.sandbox.extrahorizon.io',
579
- clientId: '',
580
- headers: {
581
- 'X-Forwarded-Application': 'test',
582
- },
583
- });
584
- ```
585
-
586
- - Functions now accept options to set custom headers
587
-
588
- ```ts
589
- await sdk.data.documents.create(
590
- '5f3511c7e9ae42283ae2eb29',
591
- {
592
- model: 'string',
593
- },
594
- { gzip: true, headers: { 'x-test': 'test' } }
595
- );
596
- ```
597
-
598
- ## [v4.1.0]
599
-
600
- ### Added
601
-
602
- - Added missing permissions
603
- - Added findFirst method in users service
604
-
605
- ### Changes
606
-
607
- - Fixed bug to show a clear error when the user is not authenticated
608
- - Fixed documentation format
609
- - Updated README installation
610
-
611
- ## [v4.0.0]
612
-
613
- ### Breaking Changes
614
-
615
- - Updated rql parameter type. Is always `rql: RQLString` now. Functions affected:
616
- - sdk.payments.orders.addTagsToOrder
617
- - sdk.payments.orders.removeTagsFromOrder
618
- - sdk.payments.products.removeTagsFromProduct
619
- - Updated parameter position if rql is a required parameter, it is always the first parameter. Functions affected
620
- - sdk.users.groupRoles.remove
621
- - sdk.users.groupRoles.removePermissions
622
- - sdk.users.groupRoles.removeFromStaff
623
- - sdk.users.groupRoles.removeUsersFromStaff
624
- - Renamed all methods from `delete` to `remove` and all of them returning `AffectedRecords`
625
- - Renamed all methods from `deleteFields` to `removeFields`
626
-
627
- ## [3.2.0]
628
-
629
- ### Added
630
-
631
- - Localizations Service
632
- - Profiles Service
633
- - Notifications Service
634
- - optional `skipTokenCheck` parameter to Oauth1 authentication flow with token/tokenSecret.
635
- - Events Service
636
-
637
- ### Changes
638
-
639
- - Fixed return types of `sdk.users.getStaff` and `sdk.users.getPatients`
640
- - Updated docs links
641
- - `updateProfileImage` method is deprecated
642
- - Gzip option `sdk.data.documents.create`
643
-
644
- ```ts
645
- await sdk.data.documents.create('schemaId', document, {
646
- gzip: true,
647
- });
648
- ```
649
-
650
- ## [3.1.0]
651
-
652
- ### Breaking Changes
653
-
654
- - `sdk.files.create` signature has changed.
655
-
656
- ```diff
657
- - sdk.files.create({name: 'test.pdf', file: file, extension: 'pdf', tags: ['tag']);
658
- + sdk.files.create('test.pdf', file, {tags: ['tag]})
659
- ```
660
-
661
- - Custom Document no longer need to extend from DocumentBase. You can just pass in the type for `data`
662
-
663
- ```diff
664
- - interface CustomDocument extends DocumentBase {
665
- - data: {
666
- - ppg: Number[];
667
- - location: {
668
- - longitude: Number;
669
- - latitude: Number;
670
- - };
671
- - };
672
- - }
673
- - const document = await sdk.data.documents.find<CustomDocument>();
674
-
675
- + interface MyData {
676
- + data: {
677
- + ppg: Number[];
678
- + location: {
679
- + longitude: Number;
680
- + latitude: Number;
681
- + };
682
- + };
683
- + }
684
- + const document = await sdk.data.documents.find<MyData>();
685
- ```
686
-
687
- ### Added
688
-
689
- - `sdk.files.createFromText` where you can pass in your text directly.
690
-
691
- ```ts
692
- await sdk.files.createFromText('this-is-a-string');
693
- ```
694
-
695
- - Added `transitionsByName` getter to easily get the transition you need.
696
-
697
- ```ts
698
- const {
699
- data: [schema],
700
- } = await sdk.data.schemas.find();
701
-
702
- const transition = schema.transitionsByName.lambda_to_review;
703
- ```
704
-
705
- - Added `findTransitionIdByName` function on `schema` objects to easily find the transitionId you need.
706
-
707
- ```ts
708
- const {
709
- data: [schema],
710
- } = await sdk.data.schemas.find();
711
-
712
- const transitionId = schema.findTransitionIdByName('lambda_to_review');
713
- ```
714
-
715
- - Added `findById`, `findByName` and `findFirst` helpers to services having a generic `find` function.
716
- - Payments Service
717
- - Added `or`, `and` and `contains` operators to the RQL builder.
718
-
719
- ## [3.0.2]
720
-
721
- ### Breaking Changes
722
-
723
- - `apiHost` has been renamed to `host` and should not include the protocol or `api` subdomain. Example `
724
-
725
- ```diff
726
- + const sdk = createClient({
727
- + host: 'sandbox.extrahorizon.io',
728
- + consumerKey: '',
729
- + consumerSecret: '',
730
- + });
731
- ```
732
-
733
- - `client` is renamed to `createClient`
734
-
735
- ```diff
736
- - import { client } from '@extrahorizon/javascript-sdk';
737
- + import { createClient } from '@extrahorizon/javascript-sdk';
738
- ```
739
-
740
- - `rawAxios` is renamed to `raw`
741
-
742
- ### Added
743
-
744
- - `createOAuth1Client` and `createOAuth2Client` are now exported as more specifically typed versions of `createClient`
745
- - Additional http header is added with every request. Which includes the package version and when running in node the node version.
746
- - Added Test Reports
747
- - `getMockSdk` function to get back a mocked SDK. See README for more info
748
-
749
- ### Changes
750
-
751
- - Templates `resolveAsPdf` will return a `Buffer`
752
- - `sdk.authenticate` now includes possible error responses in the JSDoc annotations
753
- - `rqlBuilder` now has JSDoc annotations
754
- - Fix for results with arrays containing strings
755
- - File creation now correctly set the file name on the form-data. Accepts extra parameter `extension` which defaults to `pdf`
756
- - The MailsService now correctly decamelizes the keys in the request
757
-
758
- ## [3.0.1]
759
-
760
- ### Changes
761
-
762
- - Templates basepath fix
763
-
764
- ## [3.0.0]
765
-
766
- ### Breaking Changes
767
-
768
- - Services scoping:
769
-
770
- ```diff
771
- auth: {
772
- - createApplication(),
773
- - getApplications(),
774
- - updateApplication(),
775
- - deleteApplication(),
776
- - createApplicationVersion(),
777
- - deleteApplicationVersion(),
778
- + applications: {
779
- + create(),
780
- + get(),
781
- + update(),
782
- + delete(),
783
- + createVersion(),
784
- + deleteVersion(),
785
- + },
786
- - createOauth2Authorization(),
787
- - getOauth2Authorizations(),
788
- - deleteOauth2Authorization(),
789
- + oauth2: {
790
- + createAuthorization(),
791
- + getAuthorizations(),
792
- + deleteAuthorization()
793
- + },
794
- - getMfaSetting(),
795
- - enableMfa(),
796
- - disableMfa(),
797
- - addMfaSetting(),
798
- - confirmMfaMethodVerification(),
799
- - removeMfaMethod(),
800
- + users: {
801
- + getMfaSetting(),
802
- + enableMfa(),
803
- + disableMfa(),
804
- + addMfaSetting(),
805
- + confirmMfaMethodVerification(),
806
- + removeMfaMethod()
807
- + }
808
- },
809
- data: {
810
- - createSchema(),
811
- - updateSchema(),
812
- - deleteSchema(),
813
- - enableSchema(),
814
- - disableSchema(),
815
- + schemas: {
816
- + create(),
817
- + find(),
818
- + update(),
819
- + delete(),
820
- + enable(),
821
- + disable(),
822
- + },
823
- - createIndex(),
824
- - deleteIndex(),
825
- + indexes: {
826
- + create(),
827
- + delete(),
828
- + },
829
- - createStatus(),
830
- - updateStatus(),
831
- - deleteStatus(),
832
- + statuses: {
833
- + create(),
834
- + update(),
835
- + delete(),
836
- + },
837
- - createProperty(),
838
- - deleteProperty(),
839
- - updateProperty(),
840
- + properties: {
841
- + create(),
842
- + update(),
843
- + delete(),
844
- + },
845
- - createComment(),
846
- - findComments(),
847
- - updateComment(),
848
- - deleteComment(),
849
- + comments: {
850
- + create(),
851
- + find(),
852
- + update(),
853
- + delete(),
854
- + },
855
- - createDocument(),
856
- - findDocuments(),
857
- - updateDocument(),
858
- - deleteDocument(),
859
- - deleteFieldsFromDocument(),
860
- - transitionDocument(),
861
- - linkGroupsToDocument(),
862
- - unlinkGroupsFromDocument(),
863
- - linkUsersToDocument(),
864
- - unlinkUsersFromDocument(),
865
- + documents: {
866
- + create(),
867
- + find(),
868
- + update(),
869
- + delete(),
870
- + deleteFields(),
871
- + transition(),
872
- + linkGroups(),
873
- + unlinkGroups(),
874
- + linkUsers(),
875
- + unlinkUsers(),
876
- + },
877
- - updateCreationTransition(),
878
- - createTransition(),
879
- - updateTransition(),
880
- - deleteTransition()
881
- + transitions: {
882
- + updateCreation(),
883
- + create(),
884
- + update(),
885
- + delete(),
886
- + }
887
- },
888
- files: {
889
- - createFile(),
890
- - deleteFile(),
891
- - retrieveFile(),
892
- - retrieveFileStream(),
893
- - getFileDetails(),
894
- + create(),
895
- + delete(),
896
- + retrieve(),
897
- + retrieveStream(),
898
- + getDetails(),
899
- },
900
- tasks: {
901
- - createTask(),
902
- - cancelTask(),
903
- + create(),
904
- + cancel(),
905
- },
906
- users: {
907
- - getPermissions(),
908
- - getRoles(),
909
- - createRole(),
910
- - deleteRole(),
911
- - updateRole(),
912
- - addPermissionsToRole(),
913
- - removePermissionsFromRole(),
914
- - addRolesToUsers(),
915
- - removeRolesFromUsers(),
916
- + globalRoles: {
917
- + getPermissions(),
918
- + get(),
919
- + create(),
920
- + delete(),
921
- + update(),
922
- + addPermissions(),
923
- + removePermissions(),
924
- + addToUsers(),
925
- + removeFromUsers(),
926
- + },
927
- - getGroupsPermissions(),
928
- - getGroupsRoles(),
929
- - addRoleToGroup(),
930
- - updateGroupsRole(),
931
- - removeRoleFromGroup(),
932
- - addPermissionsToGroupRoles(),
933
- - removePermissionsFromGroupRoles(),
934
- - assignRolesToStaff(),
935
- - removeRolesFromStaff(),
936
- - addUsersToStaff(),
937
- - removeUsersFromStaff(),
938
- + groupRoles: {
939
- + getPermissions(),
940
- + get(),
941
- + addRole(),
942
- + update(),
943
- + removeRole(),
944
- + addPermissions(),
945
- + removePermissions(),
946
- + assignToStaff(),
947
- + removeFromStaff(),
948
- + addUsersToStaff(),
949
- + removeUsersFromStaff(),
950
- + },
951
- }
952
- ```
953
-
954
- ### Added
955
-
956
- - Configurations Service
957
- - Dispatchers Service
958
- - Mails Service
959
- - Templates Service
960
-
961
- ### Changes
962
-
963
- - Types are now exposed within modules, so the usage will be:
964
-
965
- ```
966
- import type { FilesServicesTypes: { CreateFile } } from "@extrahorizon/javascript-sdk";
967
- const inputFile: CreateFile = {}
968
- ```
969
-
970
- - Error now not only extend from the `ApiError` class but also from their respective HTTP error code error. Possible errors are
971
- - 400: `BadRequestError`
972
- - 401: `UnauthorizedError`
973
- - 403: `ForbiddenError`
974
- - 404: `NotFoundError`
975
- - 500: `ServerError`
976
- - PagedResults are now using generics
977
- - Every merge into dev will create a tag and package with the current version number suffixed with `-dev.X` where X auto-increments
978
- - Removed `* @throws {ApiError}` in JSDoc comments, only specific errors are mentioned when mentioned in the Swagger documentation
979
-
980
- ## [2.0.0] - 2021-05-12
981
-
982
- ### Breaking changes
983
-
984
- - 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.
985
-
986
- OAuth2
987
-
988
- ```diff
989
- const sdk = client({
990
- apiHost: '',
991
- + clientId: '',
992
- });
993
-
994
- await sdk.authenticate({
995
- - clientId: '',
996
- password: '',
997
- username: ''
998
- });
999
- ```
1000
-
1001
- OAuth1
1002
-
1003
- ```diff
1004
- const sdk = client({
1005
- apiHost: '',
1006
- + consumerKey: '',
1007
- + consumerSecret: '',
1008
- });
1009
-
1010
- await sdk.authenticate({
1011
- - consumerKey: '',
1012
- - consumerSecret: '',
1013
- password: '',
1014
- email: ''
1015
- });
1016
- ```
1017
-
1018
- ### Changes
1019
-
1020
- - Removed `query` from list results
1021
- - `PartialUserData` is renamed to `User`
1022
- - Changes to the `UserData` interface
1023
- - `language` type is changed from `string` to `LanguageCode`
1024
- - `timeZone` type is changed from `string` to `TimeZone`
1025
- - `lastFailedTimestamp` type is changed from `number` to `Date`
1026
- - added `creationTimestamp` and `updateTimestamp`
1027
- - Change to the `RegisterUserData` interface
1028
- - `phoneNumber` is now required
1029
-
1030
- ## [1.0.1] - 2021-05-05
1031
-
1032
- ### Changes
1033
-
1034
- - Correctly exporting all the possible errors.
1035
-
1036
- ## [1.0.0] - 2021-05-05
1037
-
1038
- ### Breaking changes
1039
-
1040
- Optional paramaters are now grouped in an options object as last parameters.
1041
-
1042
- ```diff
1043
- - await sdk.tasks.find(rql);
1044
- + await sdk.tasks.find({ rql });
1045
- ```
1046
-
1047
- ```diff
1048
- - await sdk.users.getGroupsRoles(groupId, rql);
1049
- + await sdk.tasks.getGroupsRoles(groupId, { rql });
1050
- ```
1051
-
1052
- ### Added
1053
-
1054
- - The Axios instance used by the SDK is now directly accessible
1055
- - Data Service now includes:
1056
- - Transitions Service
1057
- - Documents Service
1058
- - Comments Service
1059
- - You can pass in your own interface when calling the `sdk.data.findDocuments<CustomDocument>(schemaId);` endpoint
1060
- - The SDK also expose JSON-schema interface you can use to compose your own
1061
-
1062
- ### Changes
1063
-
1064
- - OAuth1 token/tokenSecret flow is implemented.
1065
- - Functions expecting an RQL should now show a more clear error when passing in a regular string.
1066
-
1067
- ## [0.0.7] - 2021-04-28
1068
-
1069
- ### Breaking changes
1070
-
1071
- The `authenticate` and `confirmMfa` methods have been scoped under the `auth` namespace.
1072
-
1073
- ```diff
1074
- -await sdk.authenticate({ refreshToken: '' });
1075
- +await sdk.auth.authenticate({ refreshToken: '' });
1076
- ```
1077
-
1078
- Certains methods under the `users` namespace have had their name changed.
1079
-
1080
- ```diff
1081
- -sdk.user.mfaDisable
1082
- +sdk.user.disableMfa
1083
- -sdk.user.mfaEnable
1084
- +sdk.user.enableMfa
1085
- -sdk.user.mfaSetting
1086
- +sdk.user.getMfaSetting
1087
- -sdk.user.mfaAddMethod
1088
- +sdk.user.addMfaMethod
1089
- -sdk.user.mfaMethodConfirmVerification
1090
- +sdk.user.confirmMfaMethodVerification
1091
- -sdk.user.mfaRemoveMethod
1092
- +sdk.user.removeMfaMethod
1093
- ```
1094
-
1095
- Removed `debug` option. Use `responseLogger` and `requestLogger` options in stead. See README for example.
1096
-
1097
- ```diff
1098
- -const sdk = client({
1099
- - apiHost: '',
1100
- - debug: true
1101
- -});
1102
-
1103
-
1104
- +import AxiosLogger from "axios-logger";
1105
- +
1106
- +const sdk = client({
1107
- + apiHost: '',
1108
- + requestLogger: AxiosLogger.requestLogger,
1109
- + responseLogger: AxiosLogger.responseLogger
1110
- +});
1111
- ```
1112
-
1113
- ### Added
1114
-
1115
- - Tasks Service
1116
- - Data Service now includes:
1117
- - Schemas Service
1118
- - Properties Service
1119
- - Statuses Service
1120
- - Indexes Service
1121
-
1122
- ## [0.0.6] - 2021-04-21
1123
-
1124
- ### Breaking changes
1125
-
1126
- 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.
1127
-
1128
- ```diff
1129
- -const sdk = client({
1130
- - apiHost: '',
1131
- - oauth: {
1132
- - clientId: '',
1133
- - password: '',
1134
- - username: '',
1135
- - },
1136
- -});
1137
-
1138
- +const sdk = client({
1139
- + apiHost: '',
1140
- +});
1141
- +
1142
- +await sdk.authenticate({
1143
- + clientId: '',
1144
- + password: '',
1145
- + username: ''
1146
- +});
1147
- ```
1148
-
1149
- ### Added
1150
-
1151
- - Multi-factor authentication via (authenticate / confirmMfa functions).
1152
- - `freshTokensCallback` option when creating the client. Pass in a function to retrieve the response when new tokens are received.
1153
- - OAuth2 Refresh Token Grant flow.
1154
- - `files` service.
1155
- - `data` service: only to create a schema at the moment.
1156
-
1157
- ### Changes
1158
-
1159
- - Functions that accept an RQL parameter no longer accepts regular string, but expect the output of and rqlBuilder -> build().
1160
- - `ApiError` now extends the built-in `Error`.
1161
- - Some functions allowed empty `requestBody` which was incorrect in some cases, these have been fixed as well.
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [Unreleased]
9
+
10
+ ### Added
11
+ - Now also publishing to the NPM registry, no longer needing to authenticate with GitHub Packages to install the SDK
12
+ - `exh.users.globalRoles` now has `find`, `findFirst`, `findById` and `findByName` methods
13
+ - `exh.users.groupRoles` now has `find`, `findFirst`, `findById` and `findByName` methods
14
+ - `exh.auth.applications` now has `find`, `findFirst`, `findById` and `findByName` methods
15
+
16
+ ### Deprecated
17
+ - `exh.users.globalRoles.get` is deprecated in favor of `exh.users.globalRoles.find`
18
+ - `exh.users.groupRoles.get` is deprecated in favor of `exh.users.groupRoles.find`
19
+ - `exh.auth.applications.get` is deprecated in favor of `exh.auth.applications.find`
20
+
21
+ ### Fixed
22
+ - The `data` for `exh.profiles.update` is now correctly typed.
23
+
24
+ ## [8.2.0]
25
+
26
+ ### Added
27
+ - `MfaRequiredError` now exposes a typed `mfa` property to complete the MFA flow type safe
28
+
29
+ ### Changed
30
+ - All runtime dependencies are now pinned to their specific version
31
+ - `axios` updated to `0.28.1`
32
+ - `fflate` updated to `0.8.2`
33
+ - `typescript-json-decoder` updated to `1.0.11`
34
+ - `qs` updated to `6.12.0`
35
+ - Removed the dependency on `ts-toolbelt` as it was no longer required
36
+
37
+ ### Fixed
38
+ - Using an oAuth2 confidential client on web no longer causes a `global not defined` error
39
+ - `exh.files.create` and `exh.files.createFromText` now work correctly while using oAuth1 in React Native
40
+ - The generic `API_ERROR` name is no longer shown for errors with more specific information available
41
+ - Type corrections for the user, profile, file, index and mfa entities
42
+ - Corrected the places where the name of a schema can also be used rather than just the id
43
+ - The `groupIds` for `exh.data.documents.unlinkGroups` is now correctly marked as optional
44
+ - Corrected the permission mentioned for `exh.users.groupRoles.removeUsersFromStaff`
45
+
46
+ ## [8.1.1]
47
+
48
+ ### Fixed
49
+ - Pinned the `qs` version because of breaking changes in their latest release for our oAuth1 signature generation
50
+
51
+ ## [8.1.0]
52
+
53
+ ### Changed
54
+
55
+ - `exh.users.createAccount` and `exh.users.updateEmail`:
56
+ - Now accept an `activationMode` field
57
+ - After enabling in the verification settings, this field can be set to use the pin code mode
58
+ - `exh.users.requestEmailActivation` and `exh.users.requestPasswordReset`:
59
+ - Alternatively now also accept an object with an `email` and `mode` field
60
+ - After enabling in the verification settings, the `mode` field can be set to use the pin code mode
61
+ - Additional errors are thrown when request limiting is enabled via the verification settings
62
+ - `exh.users.validatePasswordReset` and `exh.users.validateEmailActivation`:
63
+ - Alternatively now also accept an `email` and `pinCode` field
64
+ - Additional errors are thrown when using the pin code mode
65
+ - `exh.users.getEmailTemplates` and `exh.users.setEmailTemplates` now support the new pin code email templates:
66
+ - `oidcUnlinkPinEmailTemplateId`
67
+ - `activationPinEmailTemplateId`
68
+ - `reactivationPinEmailTemplateId`
69
+ - `passwordResetPinEmailTemplateId`
70
+ - Improved oAuth2 access token refreshing
71
+ - If the SDK is able to estimate the expiry time of an access token, the token is refreshed before it expires
72
+ - This done just before a request is about to made, preventing the extra request to just receive an expired token error
73
+ - Tokens received from the `exh.auth.authenticate` method, next to `expiresIn`, now also include an `creationTimestamp` field
74
+ - `createClient` and `createOAuth2Client` now accept an `expiresIn` and `creationTimestamp` field
75
+
76
+ ### Added
77
+
78
+ - Methods to work with the activation requests:
79
+ - `exh.users.activationRequests.find`
80
+ - `exh.users.activationRequests.findFirst`
81
+ - `exh.users.activationRequests.findById`
82
+ - `exh.users.activationRequests.findByUserId`
83
+ - `exh.users.activationRequests.remove`
84
+ - Methods to work with the forgot password requests:
85
+ - `exh.users.forgotPasswordRequests.find`
86
+ - `exh.users.forgotPasswordRequests.findFirst`
87
+ - `exh.users.forgotPasswordRequests.findById`
88
+ - `exh.users.forgotPasswordRequests.findByUserId`
89
+ - `exh.users.forgotPasswordRequests.remove`
90
+ - Methods to work with the user verification settings:
91
+ - `exh.users.settings.getVerificationSettings`
92
+ - `exh.users.settings.updateVerificationSettings`
93
+
94
+ ### Fixed
95
+
96
+ - `exh.auth.applications.deleteVersion` now calls the correct endpoint
97
+ - Automatic oAuth2 access token refreshing now properly uses client credentials
98
+ - Optional fields for `exh.auth.users.addMfaMethod` are now correctly marked as optional
99
+ - The return value of `exh.users.changePassword` is now correctly typed as a boolean
100
+ - Corrected the `VIEW_API_FUNCTION_REQUEST_LOGS` permission name mentioned in the inline documentation
101
+ - The `statuses` field of the data service `Schema` entity is now typed correctly
102
+
103
+ ## [8.0.0]
104
+
105
+ ### Changed
106
+ - **Breaking Change:** RQL values are now [double encoded](https://docs.extrahorizon.com/extrahorizon/additional-resources/resource-query-language-rql#double-encoding-of-special-characters) by default when using the RQL builder
107
+ - Disable double encoding for all RQL operations with `rqlBuilder.doubleEncodeValues = false`
108
+ - Disable double encoding for a single RQL operation `rqlBuilder({ doubleEncodeValues: false }).eq(name, '< value >').build()`
109
+ - Please consult the [Migration Guide](https://github.com/ExtraHorizon/javascript-sdk/blob/dev/MIGRATING_TO_V8.0.0.MD) for more information
110
+ - **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.
111
+ - 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 })`
112
+ - 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 });`
113
+ - Please consult the [Migration Guide](https://github.com/ExtraHorizon/javascript-sdk/blob/dev/MIGRATING_TO_V8.0.0.MD) for more information
114
+ - **Breaking Change:** For all unauthenticated methods the response will now undergo the same transformation steps as any other request.
115
+ - The timestamps previously returned as strings are now converted to date objects in `exh.auth.authenticate`, `exh.auth.confirmMfa` and`exh.users.createAccount`.
116
+ - Please consult the [Migration Guide](https://github.com/ExtraHorizon/javascript-sdk/blob/dev/MIGRATING_TO_V8.0.0.MD) for more information
117
+ - New implementation of the hashing for oAuth1 signature generation
118
+ - This change is not expected to have any impact on the SDK usage
119
+
120
+ ### Bug Fixes
121
+ - In the `TokenDataOauth1` interface `updateTimeStamp` is changed to `updateTimestamp`
122
+ - `timeZone` is now accepted as a valid parameter for the resolve functions in the template service
123
+
124
+
125
+ ## [v7.8.0]
126
+
127
+ ### Changed
128
+ - New implementation of the oAuth1 signature generation to support double Encoding of RQL values in `OAuth1` clients
129
+
130
+ ## [v7.7.0]
131
+
132
+ ### Added
133
+ - Functionality to allow the [double encoding](https://docs.extrahorizon.com/extrahorizon/additional-resources/resource-query-language-rql#double-encoding-of-special-characters) of values when using the RQL builder
134
+ - Enable double encoding for all RQL operations with `rqlBuilder.doubleEncodeValues = true`
135
+ - Enable double encoding for a single RQL operation `rqlBuilder({ doubleEncodeValues: true }).eq(name, '< value >').build()`
136
+ - When enabling double encoded values ensure that instances of encoding values for the rql builder such as `encodeURIComponent()` are removed
137
+ - Double Encoding of RQL values is currently only supported in `OAuth2` clients and will come to `OAuth1` clients at a later date.
138
+
139
+
140
+ - A skip count operator to the rql builder `rqlBuilder().eq(name, '< value >').skipCount().build()`
141
+ - 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.
142
+ - The skip count operator is currently supported in [select services](https://docs.extrahorizon.com/extrahorizon/additional-resources/resource-query-language-rql#services-with-the-skip-count-rql-operator), and efforts are underway to make it available for all services.
143
+
144
+ ### Fixed
145
+ - Documentation for an incorrect permission value of `exh.users.globalRoles.addPermissions()`
146
+ - `REMOVE_ROLE_PERMISSIONS` to `REMOVE_ROLE_PERMISSION`
147
+
148
+ ## [v7.6.0]
149
+
150
+ ### Added
151
+ - `findAll`, `findAllIterator` and `update` methods to the Dispatcher service
152
+
153
+ ### Improvements
154
+ - Updated types and documentation for the Dispatcher service
155
+ - Exported the missing `RQLString` type
156
+
157
+ ## [v7.5.1]
158
+
159
+ ### Added
160
+ - Type support React Native form data
161
+
162
+ ### Fixes
163
+ - Bumped Axios version to fix content-type header issue
164
+ - Fixed `onUploadProgress` callback event triggering without a provided function
165
+ - Removed discrimination between node and web environments
166
+
167
+ ## [v7.5.0]
168
+
169
+ ### Added
170
+
171
+ - Support for File Service settings:
172
+ - File Service [settings](https://docs.extrahorizon.com/extrahorizon/services/manage-data/file-service#settings) may now be managed using methods found in:
173
+ - `exh.files.settings`
174
+
175
+ ## [v7.4.1]
176
+
177
+ ### Fixes
178
+
179
+ - Correctly export the interfaces of the tasks component
180
+
181
+ ## [v7.4.0]
182
+
183
+ ### Added
184
+
185
+ - Support for API Functions:
186
+ - An [API Function](https://docs.extrahorizon.com/extrahorizon/services/automation/task-service/api-functions) may now be executed using methods found in:
187
+ - `exh.tasks.api`
188
+ - [API Requests](https://docs.extrahorizon.com/extrahorizon/services/automation/task-service/api-functions#api-requests) produced by executing API Functions are accessible using methods found in:
189
+ - `exh.tasks.apiRequests`
190
+ - [API Request Logs](https://docs.extrahorizon.com/extrahorizon/services/automation/task-service/api-functions#api-request-logs) produced during the execution of an API Function can be accessed using methods found in:
191
+ - `exh.tasks.apiRequests.logs`
192
+
193
+
194
+ - A Function may now be directly executed as a task using the method:
195
+ - `exh.tasks.functions.execute()`
196
+
197
+
198
+ - Support for Tasks
199
+ - Task Schedules may now be managed using methods found in:
200
+ - `exh.tasks.schedules`
201
+ - Task Logs produced during the execution of a task can now be accessed using methods found in:
202
+ - `exh.tasks.logs`
203
+
204
+
205
+ - Monitoring File Uploads
206
+ - The SDK now supports [monitoring file uploads](https://docs.extrahorizon.com/extrahorizon/services/manage-data/file-service#monitoring-a-file-upload) in the browser using a callback function.
207
+ ```js
208
+ function uploadProgressCallback(event) {
209
+ const progress = (event.loaded / event.total) * 100;
210
+ // ... Do something with the progress value
211
+ }
212
+
213
+ const fileMetaData = await exh.files.create('myReport.pdf', myBuffer, {
214
+ onUploadProgress: uploadProgressCallback,
215
+ tags: ['ecg-report']
216
+ });
217
+ ```
218
+
219
+ ### Changed
220
+
221
+ - `VIEW_GROUPS` permission value is changed to the correct `VIEW_GROUP`
222
+ - `ADD_ROLE_PERMISSION` is now described correctly as singular in the inline documentation
223
+ - Updated `RegisterUserData` interface optional fields
224
+
225
+ ## [v7.3.0]
226
+
227
+ ### Added
228
+
229
+ - Support for OpenID Connect
230
+ - OAuth 2 clients now allow users to authenticate themselves with OpenID connect. See:
231
+ - `exh.auth.generateOidcAuthenticationUrl()`
232
+ - `exh.auth.authenticateWithOidc()`
233
+ - Manage your OpenID Connect configuration via new methods found in:
234
+ - `exh.auth.oidc`
235
+ - `exh.auth.oidc.providers`
236
+ - `exh.auth.oidc.loginAttempts`
237
+ - Methods to manage the User Service email templates:
238
+ - `exh.users.getEmailTemplates()`
239
+ - `exh.users.setEmailTemplates()`
240
+ - While creating an oAuth1 client both `token` and `tokenSecret` can now be supplied.
241
+ In which case there is no need for an extra `exh.auth.authenticate` call.
242
+
243
+ ```ts
244
+ const exh = createClient({
245
+ host: 'https://api.example.extrahorizon.io',
246
+ consumerKey: 'cf29b211b5030202ffce5b2510759d0a53ea5b17',
247
+ consumerSecret: '9bd34e19b5e1714e2c57ae0127d98dd0d0c0b2a2',
248
+ token: '409ce9ba49c56cce31b9d2b1b2f5ed5ac01b4011',
249
+ tokenSecret: '1cc0b97b4c4721bb6da3d85b80cda8165e6ad5a7',
250
+ });
251
+
252
+ const currentUser = await exh.users.me();
253
+ ```
254
+
255
+ - While creating an oAuth2 client both `refreshToken` and `accessToken` can now be supplied.
256
+ In which case there is no need for an extra `exh.auth.authenticate` call.
257
+
258
+ ```ts
259
+ const exh = createClient({
260
+ host: 'https://api.example.extrahorizon.io',
261
+ clientId: 'f8d9c891c106131bec970c6da05f887dc82eaff7',
262
+ refreshToken: 'ca27ada704e5b26a1fca20c130daf4f95f727d3f',
263
+ accessToken: '019dc6fe1672176f28e8e894ba99aed1f49656c8',
264
+ });
265
+
266
+ const currentUser = await exh.users.me();
267
+ ```
268
+
269
+ ### Changed
270
+ - Improved types and inline documentation (JSDoc) for the `exh.auth.applications` section
271
+ - More detailed descriptions for the methods
272
+ - Descriptions for the fields within the data types we accept and return
273
+
274
+ ## [v7.2.1]
275
+
276
+ ### Added
277
+
278
+ - Support large file uploads
279
+
280
+ ### Fixes
281
+
282
+ - Task cancellation
283
+
284
+ ## [v7.2.0]
285
+
286
+ ### Added
287
+
288
+ - For API errors the `qName` variable is mapped to the `name` variable, to improve consistency with default errors.
289
+
290
+ ### Fixes
291
+
292
+ - Corrected the interfaces to be consistent with the API
293
+ - Updated dead links in documentation
294
+
295
+ ## [v7.1.0]
296
+
297
+ ### Added
298
+
299
+ - `logout()` can now be performed on a proxy Client
300
+ - Tasks now take an optional generic to set the data type
301
+ - `userId` is now available on the raw mock
302
+
303
+ ### Fixes
304
+
305
+ - The return type of `exh.users.update()` is returning the correct `UserData`. See [issue #605](https://github.com/ExtraHorizon/javascript-sdk/issues/605)
306
+
307
+ ## [v7.0.0]
308
+
309
+ ### Added
310
+
311
+ - OAuth1 token management -> `exh.auth.oauth1.getTokens` / `exh.auth.oauth1.removeToken`. See [issue #465](https://github.com/ExtraHorizon/javascript-sdk/issues/465)
312
+ - Password policy -> `exh.users.passwordPolicy` and `exh.users.updatePasswordPolicy`
313
+ - Extra Playstore endpoint -> `payments.playStoreHistory.purchaseReceipts`
314
+ - Extra permissions for the updated task service
315
+ - RQL option to several endpoints
316
+
317
+ ### Changed
318
+
319
+ - Types for the `exh.auth.application.create` and `exh.auth.application.createVersion` have been exported. See Authentication examples for more info.
320
+ - Pako to fflate
321
+ - Refactored the Schema and Document Types
322
+ - Updated the `EnlistmentConfiguration` type. See [issue #596](https://github.com/ExtraHorizon/javascript-sdk/issues/596)
323
+
324
+ ### Fixes
325
+ - Running `yarn` on windows machines resulted in an error [issue #612](https://github.com/ExtraHorizon/javascript-sdk/issues/612)
326
+ - Return type of `exh.auth.application.update` is now correctly typed as `AffectedRecords`
327
+
328
+ ### Breaking changes
329
+
330
+ - Removed `payments.playStoreHistory.purchases` (deprecated)
331
+ - The `contains` and `excludes` endpoints of the rql builder now accepts an array of expressions iso a single string. See [issue #603](https://github.com/ExtraHorizon/javascript-sdk/issues/603)
332
+ - The removal of the group roles now has the correct parameters
333
+
334
+ ```diff
335
+ - exh.users.groupRoles.remove(rql, groupId, roleId, options)
336
+ + exh.users.groupRoles.remove(rql, groupId, options)
337
+ ```
338
+
339
+ ## [v6.1.0]
340
+
341
+ ### Breaking changes
342
+
343
+ - renamed `createTransaction` to `completeTransaction` on the payments.appStore service
344
+
345
+ ```diff
346
+ - sdk.payments.appStore.createTransaction
347
+ + sdk.payments.appStore.completeTransaction
348
+ ```
349
+
350
+ ### Changed
351
+
352
+ - When passing in `localhost` as host. No prefixing takes places.
353
+ - Fixed bug when calling `sdk.files.create` with tags as an array. See [PR #544](https://github.com/ExtraHorizon/javascript-sdk/pull/544)
354
+ - Properties on your JSONSchema on the data service will no longer have any automatic date parsing. [PR #546](https://github.com/ExtraHorizon/javascript-sdk/pull/546)
355
+ - If you are using the `sdk.raw` instance you can now pass in additional parameters to the http verbs. See [PR #546](https://github.com/ExtraHorizon/javascript-sdk/pull/546)
356
+
357
+ ```ts
358
+ const result = sdk.raw.get('/files/v1', {
359
+ interceptors: {
360
+ skipCamelizeResponseData: true, // will recursively rename keys to camelCase
361
+ skipTransformResponseData: true, // maps the values of certain keys to Dates
362
+ skipTransformKeysResponseData: true, // renames certain keys for consistency
363
+ },
364
+ });
365
+ ```
366
+
367
+ - `Profile` type has been revised
368
+
369
+ ```diff
370
+ -fibricheckInfo?: string;
371
+ +fibricheckInfo?: {
372
+ + app?: {
373
+ + version?: string;
374
+ + build?: string;
375
+ + branch?: string;
376
+ + };
377
+ + device?: {
378
+ + os?: string;
379
+ + model?: string;
380
+ + type?: 'android' | 'ios';
381
+ + manufacturer?: string;
382
+ + };
383
+ +};
384
+ ```
385
+
386
+ - `ProxyClient` existed double. One of those has been renamed to `ProxyInstance`
387
+
388
+ ```diff
389
+ -export interface ProxyClient extends HttpInstance {
390
+ +export interface ProxyInstance extends HttpInstance {
391
+ ```
392
+
393
+ ## [v6.0.0]
394
+
395
+ ### Breaking Changes
396
+
397
+ - `sdk.data.documents.create` now accepts 3 generics.
398
+
399
+ ```diff
400
+ -create<CustomData = null, CustomStatus = null>(
401
+ - schemaId: ObjectId,
402
+ - requestBody: Record<string, any>,
403
+ - options?: OptionsWithRql & { gzip?: boolean }
404
+ -): Promise<Document<CustomData, CustomStatus>>;
405
+
406
+ +create<InputData = null, OutputData = null, CustomStatus = null>(
407
+ + schemaId: ObjectId,
408
+ + requestBody: InputData,
409
+ + options?: OptionsWithRql & { gzip?: boolean }
410
+ +): Promise<Document<OutputData, CustomStatus>>;
411
+ ```
412
+
413
+ ### Added
414
+
415
+ - `sdk.data.documents.update` now accepts a generic for the update type.
416
+ - Exported `findAllGeneric` and `findAllIterator` for usage on raw functions
417
+ - Better type for `findAllIterator`
418
+
419
+ ## [v5.3.1]
420
+
421
+ ### Added/Fixed
422
+
423
+ - Playstore endpoints can handle rql now
424
+
425
+ ## [v5.3.0]
426
+
427
+ ### Added
428
+
429
+ - There are now 3 mocked exports. `getMockSdkProxy`, `getMockSdkOAuth2` and `getMockSdkOAuth1` with matching types. The `getMockSdk` is also still available and mapped to `getMockSdkOAuth2`.
430
+
431
+ ## [v5.2.0]
432
+
433
+ ### Added
434
+
435
+ - `btoa` function to be used when you are using React-Native in combination with a Confidential Application. See documentation for more info.
436
+ - `createOAuth1Client` and `createOAuth2Client` have had their type signatures updated. The `freshTokensCallback` will now have the correct type.
437
+ - Updated payments service to reflect v1.2.0 payments REST API
438
+ - `createProxyClient` is a new way to initialize the SDK using a proxy service.
439
+
440
+ ### Changed
441
+
442
+ - `Comment` interface.
443
+
444
+ ```diff
445
+ - userId
446
+ + creatorId
447
+ + commentedTimestamp
448
+ ```
449
+
450
+ - `Document` interface now accepts an optional second parameter for the status property of the document. See [PR #461](https://github.com/ExtraHorizon/javascript-sdk/pull/461)
451
+ - Refactor of `userId` getter on the `sdk.raw` instance. It now works consistently everywhere (browser/node/react-native). See [PR #462](https://github.com/ExtraHorizon/javascript-sdk/pull/462)
452
+ - Added `findAll` and `findAllIterator` to notifications. The `find` method is also update to have pagination helpers [PR #475](https://github.com/ExtraHorizon/javascript-sdk/pull/475)
453
+
454
+ ## [v5.1.0]
455
+
456
+ ### Added
457
+
458
+ - `oauth1/ssoTokens/generate` and `oauth1/ssoTokens/consume` are added under the `sdk.auth.oauth1` scope. [More info](https://swagger.extrahorizon.com/swagger-ui/?url=https://swagger.extrahorizon.com/auth-service/2.0.4-dev/openapi.yaml#/SSO)
459
+
460
+ ### Changes
461
+
462
+ - Calls not needing authentication are now correctly skipping this
463
+
464
+ ```ts
465
+ sdk.users.createAccount();
466
+ sdk.users.requestPasswordReset();
467
+ sdk.users.requestEmailActivation();
468
+ sdk.users.isEmailAvailable();
469
+ ```
470
+
471
+ ## [v5.0.0]
472
+
473
+ ### Breaking Changes
474
+
475
+ - The payments services has had some refactoring.
476
+
477
+ ```diff
478
+ - sdk.payments.subscriptions.getEntitlements();
479
+ - sdk.payments.subscriptions.getEvents();
480
+ + sdk.payments.subscriptions.entitlements.find();
481
+ + sdk.payments.subscriptions.events.find();
482
+ ```
483
+
484
+ ```diff
485
+ - sdk.payments.appStoreSubscriptions.getSubscriptions();
486
+ - sdk.payments.appStoreSubscriptions.getSubscriptionsProducts();
487
+ + sdk.payments.appStoreSubscriptioons.subscriptions.find();
488
+ + sdk.payments.appStoreSubscriptioons.products.find();
489
+
490
+ - sdk.payments.appStoreSubscriptions.createSubscriptionsProduct();
491
+ - sdk.payments.appStoreSubscriptions.removeSubscriptionsProduct();
492
+ - sdk.payments.appStoreSubscriptions.updateSubscriptionsProduct();
493
+ + sdk.payments.appStoreSubscriptions.products.create();
494
+ + sdk.payments.appStoreSubscriptions.products.remove();
495
+ + sdk.payments.appStoreSubscriptions.products.update();
496
+ ```
497
+
498
+ ### Added
499
+
500
+ - `parseGlobalPermissions` is a function to parse strings are return valid permissions
501
+
502
+ ### Changed
503
+
504
+ - `userId` getter on the `OAuthClient` interface now returns a `Promise<string>` in stead of `string`. You can access this on `sdk.raw.userId`
505
+
506
+ ## [v4.5.0]
507
+
508
+ ### Added
509
+
510
+ - services that have a `findAll` method now also have `findAllIterator`.
511
+
512
+ ```ts
513
+ const iterator = sdk.data.documents.findAllIterator('5a9552adcfd7f200016728d5');
514
+
515
+ for await (const page of iterator) {
516
+ console.log(page); /* PagedResult<Document> */
517
+ }
518
+ ```
519
+
520
+ - `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.
521
+
522
+ ```ts
523
+ const users = await sdk.users.find();
524
+
525
+ console.log('users,', users.page); // { total: 8268, offset: 0, limit: 20 }
526
+
527
+ console.log((await users.next()).page); // { total: 8268, offset: 20, limit: 20 }
528
+ console.log((await users.next()).page); // { total: 8268, offset: 40, limit: 20 }
529
+ console.log((await users.next()).page); // { total: 8268, offset: 60, limit: 20 }
530
+ console.log((await users.previous()).page); // { total: 8268, offset: 40, limit: 20 }
531
+ ```
532
+
533
+ - rqlParser accepts a regular string which will be checked using the parser function and returns a valid RQLString.
534
+
535
+ ### Changes
536
+
537
+ - added `endTimestamp` to list of fieldnames that are parsed at Date
538
+ - rqlBuilder now supports the `excludes` operator
539
+ - several examples had updates to reflect proper usage
540
+
541
+ ## [v4.4.0]
542
+
543
+ ### Changes
544
+
545
+ - Fixed `sdk.files.create` options types. See #352
546
+
547
+ ```diff
548
+ -options?: OptionsBase & { tags: [] }
549
+ +options?: OptionsBase & { tags: string[] }
550
+ ```
551
+
552
+ - JSDoc for `rqlBuilder().contains`. See #351
553
+
554
+ - 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
555
+
556
+ - `findAll` function added on users and data.documents. See #333
557
+
558
+ ## [v4.3.0]
559
+
560
+ ### Changes
561
+
562
+ - OAuth2 `authenticate` returns `tokenData`.
563
+ - OAuth2 `authenticate` can now be used with an authorization code. See Docs.
564
+ - OAuth2 supports confidentials applications.
565
+
566
+ ```ts
567
+ const sdk = createClient({
568
+ host: 'https://api.sandbox.extrahorizon.io',
569
+ clientId: '',
570
+ clientSecret: '',
571
+ });
572
+ ```
573
+
574
+ ## [v4.2.1]
575
+
576
+ ### Changes
577
+
578
+ - removed console.log in `sdk.data.documents.find` function
579
+
580
+ ## [v4.2.0]
581
+
582
+ ### Added
583
+
584
+ - Fixed documentation tables
585
+ - OAuth1 `authenticate` returns `tokenData`
586
+ - Updated documentation on SSL pinning
587
+ - Add `logout` function to `sdk.auth`
588
+ - Updated installation instructions
589
+ - Add `findAll` to `sdk.data.schemas`
590
+ - Client creation allows for extra headers which will be set on every call.
591
+
592
+ ```ts
593
+ const sdk = createClient({
594
+ host: 'https://api.sandbox.extrahorizon.io',
595
+ clientId: '',
596
+ headers: {
597
+ 'X-Forwarded-Application': 'test',
598
+ },
599
+ });
600
+ ```
601
+
602
+ - Functions now accept options to set custom headers
603
+
604
+ ```ts
605
+ await sdk.data.documents.create(
606
+ '5f3511c7e9ae42283ae2eb29',
607
+ {
608
+ model: 'string',
609
+ },
610
+ { gzip: true, headers: { 'x-test': 'test' } }
611
+ );
612
+ ```
613
+
614
+ ## [v4.1.0]
615
+
616
+ ### Added
617
+
618
+ - Added missing permissions
619
+ - Added findFirst method in users service
620
+
621
+ ### Changes
622
+
623
+ - Fixed bug to show a clear error when the user is not authenticated
624
+ - Fixed documentation format
625
+ - Updated README installation
626
+
627
+ ## [v4.0.0]
628
+
629
+ ### Breaking Changes
630
+
631
+ - Updated rql parameter type. Is always `rql: RQLString` now. Functions affected:
632
+ - sdk.payments.orders.addTagsToOrder
633
+ - sdk.payments.orders.removeTagsFromOrder
634
+ - sdk.payments.products.removeTagsFromProduct
635
+ - Updated parameter position if rql is a required parameter, it is always the first parameter. Functions affected
636
+ - sdk.users.groupRoles.remove
637
+ - sdk.users.groupRoles.removePermissions
638
+ - sdk.users.groupRoles.removeFromStaff
639
+ - sdk.users.groupRoles.removeUsersFromStaff
640
+ - Renamed all methods from `delete` to `remove` and all of them returning `AffectedRecords`
641
+ - Renamed all methods from `deleteFields` to `removeFields`
642
+
643
+ ## [3.2.0]
644
+
645
+ ### Added
646
+
647
+ - Localizations Service
648
+ - Profiles Service
649
+ - Notifications Service
650
+ - optional `skipTokenCheck` parameter to Oauth1 authentication flow with token/tokenSecret.
651
+ - Events Service
652
+
653
+ ### Changes
654
+
655
+ - Fixed return types of `sdk.users.getStaff` and `sdk.users.getPatients`
656
+ - Updated docs links
657
+ - `updateProfileImage` method is deprecated
658
+ - Gzip option `sdk.data.documents.create`
659
+
660
+ ```ts
661
+ await sdk.data.documents.create('schemaId', document, {
662
+ gzip: true,
663
+ });
664
+ ```
665
+
666
+ ## [3.1.0]
667
+
668
+ ### Breaking Changes
669
+
670
+ - `sdk.files.create` signature has changed.
671
+
672
+ ```diff
673
+ - sdk.files.create({name: 'test.pdf', file: file, extension: 'pdf', tags: ['tag']);
674
+ + sdk.files.create('test.pdf', file, {tags: ['tag]})
675
+ ```
676
+
677
+ - Custom Document no longer need to extend from DocumentBase. You can just pass in the type for `data`
678
+
679
+ ```diff
680
+ - interface CustomDocument extends DocumentBase {
681
+ - data: {
682
+ - ppg: Number[];
683
+ - location: {
684
+ - longitude: Number;
685
+ - latitude: Number;
686
+ - };
687
+ - };
688
+ - }
689
+ - const document = await sdk.data.documents.find<CustomDocument>();
690
+
691
+ + interface MyData {
692
+ + data: {
693
+ + ppg: Number[];
694
+ + location: {
695
+ + longitude: Number;
696
+ + latitude: Number;
697
+ + };
698
+ + };
699
+ + }
700
+ + const document = await sdk.data.documents.find<MyData>();
701
+ ```
702
+
703
+ ### Added
704
+
705
+ - `sdk.files.createFromText` where you can pass in your text directly.
706
+
707
+ ```ts
708
+ await sdk.files.createFromText('this-is-a-string');
709
+ ```
710
+
711
+ - Added `transitionsByName` getter to easily get the transition you need.
712
+
713
+ ```ts
714
+ const {
715
+ data: [schema],
716
+ } = await sdk.data.schemas.find();
717
+
718
+ const transition = schema.transitionsByName.lambda_to_review;
719
+ ```
720
+
721
+ - Added `findTransitionIdByName` function on `schema` objects to easily find the transitionId you need.
722
+
723
+ ```ts
724
+ const {
725
+ data: [schema],
726
+ } = await sdk.data.schemas.find();
727
+
728
+ const transitionId = schema.findTransitionIdByName('lambda_to_review');
729
+ ```
730
+
731
+ - Added `findById`, `findByName` and `findFirst` helpers to services having a generic `find` function.
732
+ - Payments Service
733
+ - Added `or`, `and` and `contains` operators to the RQL builder.
734
+
735
+ ## [3.0.2]
736
+
737
+ ### Breaking Changes
738
+
739
+ - `apiHost` has been renamed to `host` and should not include the protocol or `api` subdomain. Example `
740
+
741
+ ```diff
742
+ + const sdk = createClient({
743
+ + host: 'sandbox.extrahorizon.io',
744
+ + consumerKey: '',
745
+ + consumerSecret: '',
746
+ + });
747
+ ```
748
+
749
+ - `client` is renamed to `createClient`
750
+
751
+ ```diff
752
+ - import { client } from '@extrahorizon/javascript-sdk';
753
+ + import { createClient } from '@extrahorizon/javascript-sdk';
754
+ ```
755
+
756
+ - `rawAxios` is renamed to `raw`
757
+
758
+ ### Added
759
+
760
+ - `createOAuth1Client` and `createOAuth2Client` are now exported as more specifically typed versions of `createClient`
761
+ - Additional http header is added with every request. Which includes the package version and when running in node the node version.
762
+ - Added Test Reports
763
+ - `getMockSdk` function to get back a mocked SDK. See README for more info
764
+
765
+ ### Changes
766
+
767
+ - Templates `resolveAsPdf` will return a `Buffer`
768
+ - `sdk.authenticate` now includes possible error responses in the JSDoc annotations
769
+ - `rqlBuilder` now has JSDoc annotations
770
+ - Fix for results with arrays containing strings
771
+ - File creation now correctly set the file name on the form-data. Accepts extra parameter `extension` which defaults to `pdf`
772
+ - The MailsService now correctly decamelizes the keys in the request
773
+
774
+ ## [3.0.1]
775
+
776
+ ### Changes
777
+
778
+ - Templates basepath fix
779
+
780
+ ## [3.0.0]
781
+
782
+ ### Breaking Changes
783
+
784
+ - Services scoping:
785
+
786
+ ```diff
787
+ auth: {
788
+ - createApplication(),
789
+ - getApplications(),
790
+ - updateApplication(),
791
+ - deleteApplication(),
792
+ - createApplicationVersion(),
793
+ - deleteApplicationVersion(),
794
+ + applications: {
795
+ + create(),
796
+ + get(),
797
+ + update(),
798
+ + delete(),
799
+ + createVersion(),
800
+ + deleteVersion(),
801
+ + },
802
+ - createOauth2Authorization(),
803
+ - getOauth2Authorizations(),
804
+ - deleteOauth2Authorization(),
805
+ + oauth2: {
806
+ + createAuthorization(),
807
+ + getAuthorizations(),
808
+ + deleteAuthorization()
809
+ + },
810
+ - getMfaSetting(),
811
+ - enableMfa(),
812
+ - disableMfa(),
813
+ - addMfaSetting(),
814
+ - confirmMfaMethodVerification(),
815
+ - removeMfaMethod(),
816
+ + users: {
817
+ + getMfaSetting(),
818
+ + enableMfa(),
819
+ + disableMfa(),
820
+ + addMfaSetting(),
821
+ + confirmMfaMethodVerification(),
822
+ + removeMfaMethod()
823
+ + }
824
+ },
825
+ data: {
826
+ - createSchema(),
827
+ - updateSchema(),
828
+ - deleteSchema(),
829
+ - enableSchema(),
830
+ - disableSchema(),
831
+ + schemas: {
832
+ + create(),
833
+ + find(),
834
+ + update(),
835
+ + delete(),
836
+ + enable(),
837
+ + disable(),
838
+ + },
839
+ - createIndex(),
840
+ - deleteIndex(),
841
+ + indexes: {
842
+ + create(),
843
+ + delete(),
844
+ + },
845
+ - createStatus(),
846
+ - updateStatus(),
847
+ - deleteStatus(),
848
+ + statuses: {
849
+ + create(),
850
+ + update(),
851
+ + delete(),
852
+ + },
853
+ - createProperty(),
854
+ - deleteProperty(),
855
+ - updateProperty(),
856
+ + properties: {
857
+ + create(),
858
+ + update(),
859
+ + delete(),
860
+ + },
861
+ - createComment(),
862
+ - findComments(),
863
+ - updateComment(),
864
+ - deleteComment(),
865
+ + comments: {
866
+ + create(),
867
+ + find(),
868
+ + update(),
869
+ + delete(),
870
+ + },
871
+ - createDocument(),
872
+ - findDocuments(),
873
+ - updateDocument(),
874
+ - deleteDocument(),
875
+ - deleteFieldsFromDocument(),
876
+ - transitionDocument(),
877
+ - linkGroupsToDocument(),
878
+ - unlinkGroupsFromDocument(),
879
+ - linkUsersToDocument(),
880
+ - unlinkUsersFromDocument(),
881
+ + documents: {
882
+ + create(),
883
+ + find(),
884
+ + update(),
885
+ + delete(),
886
+ + deleteFields(),
887
+ + transition(),
888
+ + linkGroups(),
889
+ + unlinkGroups(),
890
+ + linkUsers(),
891
+ + unlinkUsers(),
892
+ + },
893
+ - updateCreationTransition(),
894
+ - createTransition(),
895
+ - updateTransition(),
896
+ - deleteTransition()
897
+ + transitions: {
898
+ + updateCreation(),
899
+ + create(),
900
+ + update(),
901
+ + delete(),
902
+ + }
903
+ },
904
+ files: {
905
+ - createFile(),
906
+ - deleteFile(),
907
+ - retrieveFile(),
908
+ - retrieveFileStream(),
909
+ - getFileDetails(),
910
+ + create(),
911
+ + delete(),
912
+ + retrieve(),
913
+ + retrieveStream(),
914
+ + getDetails(),
915
+ },
916
+ tasks: {
917
+ - createTask(),
918
+ - cancelTask(),
919
+ + create(),
920
+ + cancel(),
921
+ },
922
+ users: {
923
+ - getPermissions(),
924
+ - getRoles(),
925
+ - createRole(),
926
+ - deleteRole(),
927
+ - updateRole(),
928
+ - addPermissionsToRole(),
929
+ - removePermissionsFromRole(),
930
+ - addRolesToUsers(),
931
+ - removeRolesFromUsers(),
932
+ + globalRoles: {
933
+ + getPermissions(),
934
+ + get(),
935
+ + create(),
936
+ + delete(),
937
+ + update(),
938
+ + addPermissions(),
939
+ + removePermissions(),
940
+ + addToUsers(),
941
+ + removeFromUsers(),
942
+ + },
943
+ - getGroupsPermissions(),
944
+ - getGroupsRoles(),
945
+ - addRoleToGroup(),
946
+ - updateGroupsRole(),
947
+ - removeRoleFromGroup(),
948
+ - addPermissionsToGroupRoles(),
949
+ - removePermissionsFromGroupRoles(),
950
+ - assignRolesToStaff(),
951
+ - removeRolesFromStaff(),
952
+ - addUsersToStaff(),
953
+ - removeUsersFromStaff(),
954
+ + groupRoles: {
955
+ + getPermissions(),
956
+ + get(),
957
+ + addRole(),
958
+ + update(),
959
+ + removeRole(),
960
+ + addPermissions(),
961
+ + removePermissions(),
962
+ + assignToStaff(),
963
+ + removeFromStaff(),
964
+ + addUsersToStaff(),
965
+ + removeUsersFromStaff(),
966
+ + },
967
+ }
968
+ ```
969
+
970
+ ### Added
971
+
972
+ - Configurations Service
973
+ - Dispatchers Service
974
+ - Mails Service
975
+ - Templates Service
976
+
977
+ ### Changes
978
+
979
+ - Types are now exposed within modules, so the usage will be:
980
+
981
+ ```
982
+ import type { FilesServicesTypes: { CreateFile } } from "@extrahorizon/javascript-sdk";
983
+ const inputFile: CreateFile = {}
984
+ ```
985
+
986
+ - Error now not only extend from the `ApiError` class but also from their respective HTTP error code error. Possible errors are
987
+ - 400: `BadRequestError`
988
+ - 401: `UnauthorizedError`
989
+ - 403: `ForbiddenError`
990
+ - 404: `NotFoundError`
991
+ - 500: `ServerError`
992
+ - PagedResults are now using generics
993
+ - Every merge into dev will create a tag and package with the current version number suffixed with `-dev.X` where X auto-increments
994
+ - Removed `* @throws {ApiError}` in JSDoc comments, only specific errors are mentioned when mentioned in the Swagger documentation
995
+
996
+ ## [2.0.0] - 2021-05-12
997
+
998
+ ### Breaking changes
999
+
1000
+ - 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.
1001
+
1002
+ OAuth2
1003
+
1004
+ ```diff
1005
+ const sdk = client({
1006
+ apiHost: '',
1007
+ + clientId: '',
1008
+ });
1009
+
1010
+ await sdk.authenticate({
1011
+ - clientId: '',
1012
+ password: '',
1013
+ username: ''
1014
+ });
1015
+ ```
1016
+
1017
+ OAuth1
1018
+
1019
+ ```diff
1020
+ const sdk = client({
1021
+ apiHost: '',
1022
+ + consumerKey: '',
1023
+ + consumerSecret: '',
1024
+ });
1025
+
1026
+ await sdk.authenticate({
1027
+ - consumerKey: '',
1028
+ - consumerSecret: '',
1029
+ password: '',
1030
+ email: ''
1031
+ });
1032
+ ```
1033
+
1034
+ ### Changes
1035
+
1036
+ - Removed `query` from list results
1037
+ - `PartialUserData` is renamed to `User`
1038
+ - Changes to the `UserData` interface
1039
+ - `language` type is changed from `string` to `LanguageCode`
1040
+ - `timeZone` type is changed from `string` to `TimeZone`
1041
+ - `lastFailedTimestamp` type is changed from `number` to `Date`
1042
+ - added `creationTimestamp` and `updateTimestamp`
1043
+ - Change to the `RegisterUserData` interface
1044
+ - `phoneNumber` is now required
1045
+
1046
+ ## [1.0.1] - 2021-05-05
1047
+
1048
+ ### Changes
1049
+
1050
+ - Correctly exporting all the possible errors.
1051
+
1052
+ ## [1.0.0] - 2021-05-05
1053
+
1054
+ ### Breaking changes
1055
+
1056
+ Optional paramaters are now grouped in an options object as last parameters.
1057
+
1058
+ ```diff
1059
+ - await sdk.tasks.find(rql);
1060
+ + await sdk.tasks.find({ rql });
1061
+ ```
1062
+
1063
+ ```diff
1064
+ - await sdk.users.getGroupsRoles(groupId, rql);
1065
+ + await sdk.tasks.getGroupsRoles(groupId, { rql });
1066
+ ```
1067
+
1068
+ ### Added
1069
+
1070
+ - The Axios instance used by the SDK is now directly accessible
1071
+ - Data Service now includes:
1072
+ - Transitions Service
1073
+ - Documents Service
1074
+ - Comments Service
1075
+ - You can pass in your own interface when calling the `sdk.data.findDocuments<CustomDocument>(schemaId);` endpoint
1076
+ - The SDK also expose JSON-schema interface you can use to compose your own
1077
+
1078
+ ### Changes
1079
+
1080
+ - OAuth1 token/tokenSecret flow is implemented.
1081
+ - Functions expecting an RQL should now show a more clear error when passing in a regular string.
1082
+
1083
+ ## [0.0.7] - 2021-04-28
1084
+
1085
+ ### Breaking changes
1086
+
1087
+ The `authenticate` and `confirmMfa` methods have been scoped under the `auth` namespace.
1088
+
1089
+ ```diff
1090
+ -await sdk.authenticate({ refreshToken: '' });
1091
+ +await sdk.auth.authenticate({ refreshToken: '' });
1092
+ ```
1093
+
1094
+ Certains methods under the `users` namespace have had their name changed.
1095
+
1096
+ ```diff
1097
+ -sdk.user.mfaDisable
1098
+ +sdk.user.disableMfa
1099
+ -sdk.user.mfaEnable
1100
+ +sdk.user.enableMfa
1101
+ -sdk.user.mfaSetting
1102
+ +sdk.user.getMfaSetting
1103
+ -sdk.user.mfaAddMethod
1104
+ +sdk.user.addMfaMethod
1105
+ -sdk.user.mfaMethodConfirmVerification
1106
+ +sdk.user.confirmMfaMethodVerification
1107
+ -sdk.user.mfaRemoveMethod
1108
+ +sdk.user.removeMfaMethod
1109
+ ```
1110
+
1111
+ Removed `debug` option. Use `responseLogger` and `requestLogger` options in stead. See README for example.
1112
+
1113
+ ```diff
1114
+ -const sdk = client({
1115
+ - apiHost: '',
1116
+ - debug: true
1117
+ -});
1118
+
1119
+
1120
+ +import AxiosLogger from "axios-logger";
1121
+ +
1122
+ +const sdk = client({
1123
+ + apiHost: '',
1124
+ + requestLogger: AxiosLogger.requestLogger,
1125
+ + responseLogger: AxiosLogger.responseLogger
1126
+ +});
1127
+ ```
1128
+
1129
+ ### Added
1130
+
1131
+ - Tasks Service
1132
+ - Data Service now includes:
1133
+ - Schemas Service
1134
+ - Properties Service
1135
+ - Statuses Service
1136
+ - Indexes Service
1137
+
1138
+ ## [0.0.6] - 2021-04-21
1139
+
1140
+ ### Breaking changes
1141
+
1142
+ 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.
1143
+
1144
+ ```diff
1145
+ -const sdk = client({
1146
+ - apiHost: '',
1147
+ - oauth: {
1148
+ - clientId: '',
1149
+ - password: '',
1150
+ - username: '',
1151
+ - },
1152
+ -});
1153
+
1154
+ +const sdk = client({
1155
+ + apiHost: '',
1156
+ +});
1157
+ +
1158
+ +await sdk.authenticate({
1159
+ + clientId: '',
1160
+ + password: '',
1161
+ + username: ''
1162
+ +});
1163
+ ```
1164
+
1165
+ ### Added
1166
+
1167
+ - Multi-factor authentication via (authenticate / confirmMfa functions).
1168
+ - `freshTokensCallback` option when creating the client. Pass in a function to retrieve the response when new tokens are received.
1169
+ - OAuth2 Refresh Token Grant flow.
1170
+ - `files` service.
1171
+ - `data` service: only to create a schema at the moment.
1172
+
1173
+ ### Changes
1174
+
1175
+ - Functions that accept an RQL parameter no longer accepts regular string, but expect the output of and rqlBuilder -> build().
1176
+ - `ApiError` now extends the built-in `Error`.
1177
+ - Some functions allowed empty `requestBody` which was incorrect in some cases, these have been fixed as well.