@extrahorizon/javascript-sdk 8.2.0 → 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.
- package/CHANGELOG.md +1177 -1161
- package/README.md +108 -119
- package/build/index.cjs.js +1 -1
- package/build/index.mjs +1 -1
- package/build/types/btoa.d.ts +6 -6
- package/build/types/client.d.ts +136 -136
- package/build/types/constants.d.ts +15 -15
- package/build/types/errorHandler.d.ts +2 -2
- package/build/types/errors.d.ts +332 -332
- package/build/types/http/client.d.ts +2 -2
- package/build/types/http/index.d.ts +4 -4
- package/build/types/http/interceptors.d.ts +9 -9
- package/build/types/http/oAuth1Signature.d.ts +14 -14
- package/build/types/http/oauth1.d.ts +3 -3
- package/build/types/http/oauth2.d.ts +3 -3
- package/build/types/http/proxy.d.ts +3 -3
- package/build/types/http/types.d.ts +331 -331
- package/build/types/http/utils.d.ts +21 -21
- package/build/types/index.d.ts +9 -9
- package/build/types/mock.d.ts +43 -43
- package/build/types/mockType.d.ts +1547 -1511
- package/build/types/parseStoredCredentials.d.ts +11 -11
- package/build/types/rql/index.d.ts +16 -16
- package/build/types/rql/parser.d.ts +1 -1
- package/build/types/rql/types.d.ts +168 -168
- package/build/types/services/auth/applications/index.d.ts +5 -5
- package/build/types/services/auth/applications/types.d.ts +260 -190
- package/build/types/services/auth/index.d.ts +3 -3
- package/build/types/services/auth/oauth1/index.d.ts +5 -5
- package/build/types/services/auth/oauth1/types.d.ts +63 -63
- package/build/types/services/auth/oauth2/index.d.ts +5 -5
- package/build/types/services/auth/oauth2/types.d.ts +52 -52
- package/build/types/services/auth/oidc/index.d.ts +5 -5
- package/build/types/services/auth/oidc/loginAttempts/index.d.ts +5 -5
- package/build/types/services/auth/oidc/loginAttempts/types.d.ts +67 -67
- package/build/types/services/auth/oidc/providers/index.d.ts +5 -5
- package/build/types/services/auth/oidc/providers/types.d.ts +144 -144
- package/build/types/services/auth/oidc/types.d.ts +40 -40
- package/build/types/services/auth/types.d.ts +39 -39
- package/build/types/services/auth/users/index.d.ts +5 -5
- package/build/types/services/auth/users/types.d.ts +121 -121
- package/build/types/services/configurations/general.d.ts +5 -5
- package/build/types/services/configurations/groups.d.ts +5 -5
- package/build/types/services/configurations/index.d.ts +10 -10
- package/build/types/services/configurations/patients.d.ts +5 -5
- package/build/types/services/configurations/staff.d.ts +5 -5
- package/build/types/services/configurations/types.d.ts +222 -222
- package/build/types/services/configurations/users.d.ts +5 -5
- package/build/types/services/data/comments.d.ts +5 -5
- package/build/types/services/data/documents.d.ts +5 -5
- package/build/types/services/data/index.d.ts +13 -13
- package/build/types/services/data/indexes.d.ts +5 -5
- package/build/types/services/data/infrastructure.d.ts +10 -10
- package/build/types/services/data/json-schema.d.ts +121 -121
- package/build/types/services/data/properties.d.ts +5 -5
- package/build/types/services/data/schemas.d.ts +5 -5
- package/build/types/services/data/statuses.d.ts +5 -5
- package/build/types/services/data/transitions.d.ts +5 -5
- package/build/types/services/data/types.d.ts +899 -899
- package/build/types/services/dispatchers/actions/index.d.ts +5 -5
- package/build/types/services/dispatchers/actions/types.d.ts +78 -78
- package/build/types/services/dispatchers/dispatchers/index.d.ts +5 -5
- package/build/types/services/dispatchers/dispatchers/types.d.ts +111 -111
- package/build/types/services/dispatchers/index.d.ts +7 -7
- package/build/types/services/dispatchers/types.d.ts +2 -2
- package/build/types/services/events/events.d.ts +5 -5
- package/build/types/services/events/health.d.ts +9 -9
- package/build/types/services/events/index.d.ts +6 -6
- package/build/types/services/events/subscriptions.d.ts +5 -5
- package/build/types/services/events/types.d.ts +90 -90
- package/build/types/services/files/files.d.ts +5 -5
- package/build/types/services/files/formHelpers.d.ts +3 -3
- package/build/types/services/files/index.d.ts +6 -6
- package/build/types/services/files/settings/index.d.ts +5 -5
- package/build/types/services/files/settings/types.d.ts +38 -38
- package/build/types/services/files/tokens.d.ts +5 -5
- package/build/types/services/files/types.d.ts +185 -185
- package/build/types/services/helpers.d.ts +7 -7
- package/build/types/services/http-client.d.ts +22 -22
- package/build/types/services/index.d.ts +15 -15
- package/build/types/services/localizations/countries.d.ts +5 -5
- package/build/types/services/localizations/health.d.ts +9 -9
- package/build/types/services/localizations/index.d.ts +4 -4
- package/build/types/services/localizations/languages.d.ts +5 -5
- package/build/types/services/localizations/localizations.d.ts +5 -5
- package/build/types/services/localizations/types.d.ts +145 -145
- package/build/types/services/logs/access/index.d.ts +5 -5
- package/build/types/services/logs/access/types.d.ts +41 -41
- package/build/types/services/logs/index.d.ts +3 -3
- package/build/types/services/logs/types.d.ts +4 -4
- package/build/types/services/mails/index.d.ts +3 -3
- package/build/types/services/mails/mails.d.ts +5 -5
- package/build/types/services/mails/types.d.ts +141 -141
- package/build/types/services/notifications/health.d.ts +9 -9
- package/build/types/services/notifications/index.d.ts +7 -7
- package/build/types/services/notifications/notifications.d.ts +5 -5
- package/build/types/services/notifications/settings.d.ts +5 -5
- package/build/types/services/notifications/types.d.ts +222 -222
- package/build/types/services/payments/appStore.d.ts +5 -5
- package/build/types/services/payments/appStoreSubscriptions.d.ts +5 -5
- package/build/types/services/payments/health.d.ts +9 -9
- package/build/types/services/payments/index.d.ts +15 -15
- package/build/types/services/payments/orders.d.ts +5 -5
- package/build/types/services/payments/playStore.d.ts +5 -5
- package/build/types/services/payments/playStoreHistory.d.ts +5 -5
- package/build/types/services/payments/playStoreSubscriptions.d.ts +5 -5
- package/build/types/services/payments/products.d.ts +5 -5
- package/build/types/services/payments/stripe.d.ts +5 -5
- package/build/types/services/payments/subscriptions.d.ts +5 -5
- package/build/types/services/payments/types.d.ts +1189 -1189
- package/build/types/services/profiles/groups.d.ts +5 -5
- package/build/types/services/profiles/health.d.ts +9 -9
- package/build/types/services/profiles/index.d.ts +9 -9
- package/build/types/services/profiles/logs.d.ts +5 -5
- package/build/types/services/profiles/profiles.d.ts +5 -5
- package/build/types/services/profiles/types.d.ts +370 -369
- package/build/types/services/tasks/api/index.d.ts +5 -5
- package/build/types/services/tasks/api/types.d.ts +146 -146
- package/build/types/services/tasks/apiRequests/index.d.ts +5 -5
- package/build/types/services/tasks/apiRequests/logs/index.d.ts +5 -5
- package/build/types/services/tasks/apiRequests/logs/types.d.ts +25 -25
- package/build/types/services/tasks/apiRequests/types.d.ts +83 -83
- package/build/types/services/tasks/functions/index.d.ts +5 -5
- package/build/types/services/tasks/functions/types.d.ts +27 -27
- package/build/types/services/tasks/index.d.ts +15 -15
- package/build/types/services/tasks/logs/index.d.ts +5 -5
- package/build/types/services/tasks/logs/types.d.ts +28 -28
- package/build/types/services/tasks/schedules/index.d.ts +5 -5
- package/build/types/services/tasks/schedules/types.d.ts +88 -88
- package/build/types/services/tasks/tasks.d.ts +5 -5
- package/build/types/services/tasks/types.d.ts +107 -107
- package/build/types/services/templates/index.d.ts +3 -3
- package/build/types/services/templates/templates.d.ts +5 -5
- package/build/types/services/templates/types.d.ts +202 -202
- package/build/types/services/types.d.ts +77 -77
- package/build/types/services/users/activationRequests/index.d.ts +4 -4
- package/build/types/services/users/activationRequests/types.d.ts +70 -70
- package/build/types/services/users/forgotPasswordRequests/index.d.ts +4 -4
- package/build/types/services/users/forgotPasswordRequests/types.d.ts +70 -70
- package/build/types/services/users/globalRoles.d.ts +5 -5
- package/build/types/services/users/groupRoles.d.ts +5 -5
- package/build/types/services/users/health.d.ts +9 -9
- package/build/types/services/users/index.d.ts +16 -16
- package/build/types/services/users/settings/index.d.ts +4 -4
- package/build/types/services/users/settings/types.d.ts +47 -47
- package/build/types/services/users/types.d.ts +1116 -1055
- package/build/types/services/users/users.d.ts +5 -5
- package/build/types/sha1.d.ts +11 -11
- package/build/types/types.d.ts +102 -102
- package/build/types/utils.d.ts +4 -4
- package/build/types/version.d.ts +1 -1
- package/package.json +62 -62
package/README.md
CHANGED
|
@@ -1,119 +1,108 @@
|
|
|
1
|
-
# Extra Horizon JavaScript SDK
|
|
2
|
-
|
|
3
|
-
This package serves as a JavaScript wrapper around all [Extra Horizon](https://www.extrahorizon.com/cloud-services) cloud services.
|
|
4
|
-
|
|
5
|
-
## Features
|
|
6
|
-
|
|
7
|
-
- [Auth][auth]: Provides authentication functionality. The Authentication service supports both OAuth 1.0a and OAuth 2.0 standards.
|
|
8
|
-
- [Users][users]: The user service stands in for managing users themselves, as well as roles related to users and groups of users.
|
|
9
|
-
- [Data][data]: A flexible data storage for structured data. Additionally, the service enables you to configure a state machine for instances of the structured data. You can couple actions that need to be triggered by the state machine, when/as the entities (instance of structured data) change their state. Thanks to these actions you can define automation rules (see later for more in depth description). These actions also make it possible to interact with other services.
|
|
10
|
-
- [Files][files]: A service that handles file storage, metadata & file retrieval based on tokens.
|
|
11
|
-
- [Tasks][tasks]: Start functions on demand, directly or at a future moment.
|
|
12
|
-
- [Templates][templates]: The template service manages templates used to build emails. It can be used to retrieve, create, update or delete templates as well as resolving them.
|
|
13
|
-
- [Mails][mails]: Provides mail functionality for other services.
|
|
14
|
-
- [Configurations][configurations]: Provides storage for custom configuration objects. On different levels (general, groups, users, links between groups and users).
|
|
15
|
-
- [Dispatchers][dispatchers]: Configure actions that need to be invoked when a specific event is/was triggered.
|
|
16
|
-
- [Payments][payments]: A service that provides payment functionality.
|
|
17
|
-
- [Profiles][profiles]: Storage service of profiles. A profile is a separate object on its own, comprising medical information like medication and medical history, as well as technical information, like what phone a user is using.
|
|
18
|
-
- [Notifications][notifications]: A service that handles push notifications.
|
|
19
|
-
- [Localizations][localizations]: Storage and retrieval of text snippets, translated into multiple languages.
|
|
20
|
-
- [Events][events]: Service that provides event (publish/subscribe) functionality for other services.
|
|
21
|
-
|
|
22
|
-
## Getting started
|
|
23
|
-
|
|
24
|
-
To get started with the ExtraHorizon SDK you'll need to install it, and then get credentials which will allow you to access the backend.
|
|
25
|
-
|
|
26
|
-
## Installation
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
```
|
|
31
|
-
@extrahorizon
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
(
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
##
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
[
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
[
|
|
107
|
-
[
|
|
108
|
-
[
|
|
109
|
-
[files]: https://swagger.extrahorizon.com/listing/?service=files-service&redirectToVersion=1
|
|
110
|
-
[tasks]: https://swagger.extrahorizon.com/listing/?service=tasks-service&redirectToVersion=1
|
|
111
|
-
[templates]: https://swagger.extrahorizon.com/listing/?service=templates-service&redirectToVersion=1
|
|
112
|
-
[mails]: https://swagger.extrahorizon.com/listing/?service=mail-service&redirectToVersion=1
|
|
113
|
-
[configurations]: https://swagger.extrahorizon.com/listing/?service=configurations-service&redirectToVersion=2
|
|
114
|
-
[dispatchers]: https://swagger.extrahorizon.com/listing/?service=dispatchers-service&redirectToVersion=1
|
|
115
|
-
[payments]: https://swagger.extrahorizon.com/listing/?service=payments-service&redirectToVersion=1
|
|
116
|
-
[profiles]: https://swagger.extrahorizon.com/listing/?service=profiles-service&redirectToVersion=1
|
|
117
|
-
[notifications]: https://swagger.extrahorizon.com/listing/?service=notifications-service&redirectToVersion=1
|
|
118
|
-
[localizations]: https://swagger.extrahorizon.com/listing/?service=localizations-service&redirectToVersion=1
|
|
119
|
-
[events]: https://swagger.extrahorizon.com/listing/?service=events-service&redirectToVersion=1
|
|
1
|
+
# Extra Horizon JavaScript SDK
|
|
2
|
+
|
|
3
|
+
This package serves as a JavaScript wrapper around all [Extra Horizon](https://www.extrahorizon.com/cloud-services) cloud services.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- [Auth][auth]: Provides authentication functionality. The Authentication service supports both OAuth 1.0a and OAuth 2.0 standards.
|
|
8
|
+
- [Users][users]: The user service stands in for managing users themselves, as well as roles related to users and groups of users.
|
|
9
|
+
- [Data][data]: A flexible data storage for structured data. Additionally, the service enables you to configure a state machine for instances of the structured data. You can couple actions that need to be triggered by the state machine, when/as the entities (instance of structured data) change their state. Thanks to these actions you can define automation rules (see later for more in depth description). These actions also make it possible to interact with other services.
|
|
10
|
+
- [Files][files]: A service that handles file storage, metadata & file retrieval based on tokens.
|
|
11
|
+
- [Tasks][tasks]: Start functions on demand, directly or at a future moment.
|
|
12
|
+
- [Templates][templates]: The template service manages templates used to build emails. It can be used to retrieve, create, update or delete templates as well as resolving them.
|
|
13
|
+
- [Mails][mails]: Provides mail functionality for other services.
|
|
14
|
+
- [Configurations][configurations]: Provides storage for custom configuration objects. On different levels (general, groups, users, links between groups and users).
|
|
15
|
+
- [Dispatchers][dispatchers]: Configure actions that need to be invoked when a specific event is/was triggered.
|
|
16
|
+
- [Payments][payments]: A service that provides payment functionality.
|
|
17
|
+
- [Profiles][profiles]: Storage service of profiles. A profile is a separate object on its own, comprising medical information like medication and medical history, as well as technical information, like what phone a user is using.
|
|
18
|
+
- [Notifications][notifications]: A service that handles push notifications.
|
|
19
|
+
- [Localizations][localizations]: Storage and retrieval of text snippets, translated into multiple languages.
|
|
20
|
+
- [Events][events]: Service that provides event (publish/subscribe) functionality for other services.
|
|
21
|
+
|
|
22
|
+
## Getting started
|
|
23
|
+
|
|
24
|
+
To get started with the ExtraHorizon SDK you'll need to install it, and then get credentials which will allow you to access the backend.
|
|
25
|
+
|
|
26
|
+
## Installation
|
|
27
|
+
|
|
28
|
+
Using npm:
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
npm install @extrahorizon/javascript-sdk
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Using yarn:
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
yarn add @extrahorizon/javascript-sdk
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Quick Start
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
import { createOAuth2Client } from '@extrahorizon/javascript-sdk';
|
|
44
|
+
|
|
45
|
+
(async () => {
|
|
46
|
+
const exh = createOAuth2Client({
|
|
47
|
+
host: '',
|
|
48
|
+
clientId: '',
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
await exh.auth.authenticate({
|
|
52
|
+
password: '',
|
|
53
|
+
username: '',
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
console.log('exh.users.health()', await exh.users.health());
|
|
57
|
+
console.log('exh.users.me()', await exh.users.me());
|
|
58
|
+
})();
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Please see [authentication examples](https://extrahorizon.github.io/javascript-sdk/#/docs/examples/authentication) for more options.
|
|
62
|
+
|
|
63
|
+
## Interceptors
|
|
64
|
+
|
|
65
|
+
The data returned from the backend is mapped using interceptors:
|
|
66
|
+
|
|
67
|
+
- Timestamps will be of type Date
|
|
68
|
+
- Keys in objects will be camelCased
|
|
69
|
+
- `records_affected` will be replaced by `affected_records`
|
|
70
|
+
|
|
71
|
+
## Documentation
|
|
72
|
+
|
|
73
|
+
- [https://docs.extrahorizon.com/javascript-sdk/](https://docs.extrahorizon.com/javascript-sdk/)
|
|
74
|
+
|
|
75
|
+
## 🔑 License
|
|
76
|
+
|
|
77
|
+
The MIT License (MIT). Please see [License File](/LICENSE) for more information.
|
|
78
|
+
|
|
79
|
+
## Developer Notes
|
|
80
|
+
|
|
81
|
+
Throughout the different services we use `this` for easy access to other functions in each service. The usage of `this` as first parameter is explained here: https://www.typescriptlang.org/docs/handbook/2/functions.html#declaring-this-in-a-function. This parameter is excluded from all exported types.
|
|
82
|
+
|
|
83
|
+
```ts
|
|
84
|
+
find(
|
|
85
|
+
this: DataSchemasService,
|
|
86
|
+
options?: { rql?: RQLString }
|
|
87
|
+
): Promise<PagedResult<Schema>>;
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
## Migration Guides
|
|
91
|
+
[Migrating to v8.0.0](MIGRATING_TO_V8.0.0.MD)
|
|
92
|
+
|
|
93
|
+
## Swagger files
|
|
94
|
+
|
|
95
|
+
[auth]: https://swagger.extrahorizon.com/listing/?service=auth-service&redirectToVersion=2
|
|
96
|
+
[users]: https://swagger.extrahorizon.com/listing/?service=users-service&redirectToVersion=1
|
|
97
|
+
[data]: https://swagger.extrahorizon.com/listing/?service=data-service&redirectToVersion=1
|
|
98
|
+
[files]: https://swagger.extrahorizon.com/listing/?service=files-service&redirectToVersion=1
|
|
99
|
+
[tasks]: https://swagger.extrahorizon.com/listing/?service=tasks-service&redirectToVersion=1
|
|
100
|
+
[templates]: https://swagger.extrahorizon.com/listing/?service=templates-service&redirectToVersion=1
|
|
101
|
+
[mails]: https://swagger.extrahorizon.com/listing/?service=mail-service&redirectToVersion=1
|
|
102
|
+
[configurations]: https://swagger.extrahorizon.com/listing/?service=configurations-service&redirectToVersion=2
|
|
103
|
+
[dispatchers]: https://swagger.extrahorizon.com/listing/?service=dispatchers-service&redirectToVersion=1
|
|
104
|
+
[payments]: https://swagger.extrahorizon.com/listing/?service=payments-service&redirectToVersion=1
|
|
105
|
+
[profiles]: https://swagger.extrahorizon.com/listing/?service=profiles-service&redirectToVersion=1
|
|
106
|
+
[notifications]: https://swagger.extrahorizon.com/listing/?service=notifications-service&redirectToVersion=1
|
|
107
|
+
[localizations]: https://swagger.extrahorizon.com/listing/?service=localizations-service&redirectToVersion=1
|
|
108
|
+
[events]: https://swagger.extrahorizon.com/listing/?service=events-service&redirectToVersion=1
|